Commit 4e2b2fee authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/feature/dev-fxj' into feature/dev-fxj

parents aa69d480 6f9a20a6
...@@ -200,7 +200,7 @@ public interface CommonConstants { ...@@ -200,7 +200,7 @@ public interface CommonConstants {
* @Author pwang * @Author pwang
* @Date 2019-08-02 16:39 * @Date 2019-08-02 16:39
**/ **/
int[] dingleDigitIntArray = {0,1,2,3,4,5,6,7,8,9,10,11}; int[] dingleDigitIntArray = {0,1,2,3,4,5,6,7,8,9,10,11,12};
/** /**
* 个位数字串(阿里编码规约不允许直接使用‘魔法值’) * 个位数字串(阿里编码规约不允许直接使用‘魔法值’)
* @Author pwang * @Author pwang
......
...@@ -148,12 +148,12 @@ public class TSalaryStandard extends BaseEntity { ...@@ -148,12 +148,12 @@ public class TSalaryStandard extends BaseEntity {
@ExcelProperty("款项来源(0客户到款/1垫付)") @ExcelProperty("款项来源(0客户到款/1垫付)")
private Integer moneyFrom; private Integer moneyFrom;
/** /**
* 状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送失败 11 推送收入中) * 状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送失败 11 推送收入中12推送收入失败
*/ */
@ExcelAttribute(name = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 推送收入中)", isNotEmpty = true, errorInfo = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)不能为空") @ExcelAttribute(name = "状态(0待提交1待审核2:待推送明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 已审核生成收入中12已审核生成收入失败)", isNotEmpty = true, errorInfo = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)不能为空")
@NotBlank(message = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 推送收入中)不能为空") @NotBlank(message = "状态(0待提交1待审核2:待推送明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 已审核生成收入中12已审核生成收入失败)不能为空")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送失败 11 推送收入中)") @ExcelProperty("状态(0待提交1待审核2:待推送明细3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印 10 推送失败 11 已审核生成收入中12已审核生成收入失败)")
private Integer status; private Integer status;
/** /**
* 提交时间 * 提交时间
......
...@@ -26,7 +26,7 @@ public class TSalaryStandardExportVo implements Serializable { ...@@ -26,7 +26,7 @@ public class TSalaryStandardExportVo implements Serializable {
/** /**
* 状态0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败 * 状态0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败
*/ */
@ExcelAttribute(name = "状态", isDataId = true, readConverterExp = "0=待提交,1=待审核,2=审核通过,3=发送成功,5=审核不通过,6=确认不通过,10=发送失败") @ExcelAttribute(name = "状态", isDataId = true, readConverterExp = "0=待提交,1=待审核,2=待推送明细,3=发送成功,5=审核不通过,6=确认不通过,10=发送失败,11=已审核生成收入中,12=已审核生成收入失败")
@NotBlank(message = "状态(0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败)不能为空") @NotBlank(message = "状态(0待提交 1待审核 2审核通过 3发送成功 5审核不通过 10 发送失败)不能为空")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("薪酬状态") @ExcelProperty("薪酬状态")
......
...@@ -223,6 +223,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -223,6 +223,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
// 将审核状态变为中间态 // 将审核状态变为中间态
tSalaryStandard.setStatus(CommonConstants.dingleDigitIntArray[11]); tSalaryStandard.setStatus(CommonConstants.dingleDigitIntArray[11]);
tSalaryStandard.setIncomeStartTime(new Date()); tSalaryStandard.setIncomeStartTime(new Date());
baseMapper.updateById(tSalaryStandard);
// 异步-收入相关 // 异步-收入相关
doSalaryAsync.doIncomeDetail(dept, salaryAccountList, id, tSalaryStandard); doSalaryAsync.doIncomeDetail(dept, salaryAccountList, id, tSalaryStandard);
} }
...@@ -816,12 +817,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -816,12 +817,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Override @Override
public R<String> salaryDoIncome(String id) { public R<String> salaryDoIncome(String id) {
TSalaryStandard tSalaryStandard = this.getById(id); TSalaryStandard tSalaryStandard = this.getById(id);
if (tSalaryStandard != null && tSalaryStandard.getStatus() == CommonConstants.dingleDigitIntArray[11] if (tSalaryStandard != null
&& (tSalaryStandard.getStatus() == CommonConstants.dingleDigitIntArray[11]
|| tSalaryStandard.getStatus() == CommonConstants.dingleDigitIntArray[12])
&& tSalaryStandard.getIncomeStartTime() != null) { && tSalaryStandard.getIncomeStartTime() != null) {
Long start = tSalaryStandard.getIncomeStartTime().getTime() + 600000; if (tSalaryStandard.getStatus() == CommonConstants.dingleDigitIntArray[11]) {
Long end = new Date().getTime(); long start = tSalaryStandard.getIncomeStartTime().getTime() + 1800000;
long end = new Date().getTime();
if (start > end) { if (start > end) {
return R.failed("上次生成时间:" + tSalaryStandard.getIncomeStartTime() + ",请稍等10分钟"); return R.failed("上次生成时间:" + tSalaryStandard.getIncomeStartTime() + ",请稍等30分钟");
}
} }
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId() R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", tSalaryStandard.getDeptId() , "/tsettledomain/inner/getSettleDomainVoById", tSalaryStandard.getDeptId()
...@@ -837,14 +842,15 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -837,14 +842,15 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
if (salaryAccountList != null && !salaryAccountList.isEmpty()) { if (salaryAccountList != null && !salaryAccountList.isEmpty()) {
// 将重置生成推送时间 // 将重置生成推送时间
tSalaryStandard.setIncomeStartTime(new Date()); tSalaryStandard.setIncomeStartTime(new Date());
tSalaryStandard.setIncomeEndTime(null);
this.updateById(tSalaryStandard); this.updateById(tSalaryStandard);
// 异步-收入相关 // 异步-收入相关
doSalaryAsync.doIncomeDetail(dept, salaryAccountList, id, tSalaryStandard); doSalaryAsync.doIncomeDetail(dept, salaryAccountList, id, tSalaryStandard);
return R.ok("生成收入并推送中,请耐心等待10分钟!"); return R.ok("生成收入并推送中,请耐心等待30分钟!");
} }
return R.failed("未获取到报账明细,请重试"); return R.failed("未获取到报账明细,请重试");
} else { } else {
return R.failed("不是待生成收入状态,请勿点击!"); return R.failed("请耐心等待!");
} }
} }
} }
...@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties; ...@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService; import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail; import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
...@@ -34,7 +35,7 @@ import java.util.*; ...@@ -34,7 +35,7 @@ import java.util.*;
public class DoJointSalaryAsyncTask { public class DoJointSalaryAsyncTask {
private final DaprSocialProperties socialProperties; private final DaprSocialProperties socialProperties;
private final TSalaryStandardService tSalaryStandardService; private final TSalaryStandardMapper salaryStandardMapper;
/** /**
* @Description: 收入 * @Description: 收入
...@@ -52,6 +53,8 @@ public class DoJointSalaryAsyncTask { ...@@ -52,6 +53,8 @@ public class DoJointSalaryAsyncTask {
} }
Map<String, Integer> detailMap = new HashMap<>(); Map<String, Integer> detailMap = new HashMap<>();
boolean isTrue = true; boolean isTrue = true;
TSalaryStandard s = salaryStandardMapper.selectById(id);
try {
// 收入相关 // 收入相关
R<String> failed1 = getIncomeDetailMap(tSalaryStandard, dept, idCardList, detailMap); R<String> failed1 = getIncomeDetailMap(tSalaryStandard, dept, idCardList, detailMap);
if (failed1 != null) { if (failed1 != null) {
...@@ -83,12 +86,20 @@ public class DoJointSalaryAsyncTask { ...@@ -83,12 +86,20 @@ public class DoJointSalaryAsyncTask {
} }
} }
} }
} catch (Exception e) {
isTrue = false;
log.error(e.getMessage());
}
if (s != null
&& (s.getStatus() == CommonConstants.dingleDigitIntArray[11]
|| s.getStatus() == CommonConstants.dingleDigitIntArray[12])) {
tSalaryStandard.setIncomeEndTime(new Date());
if (isTrue) { if (isTrue) {
TSalaryStandard s = tSalaryStandardService.getById(id);
if (s != null && s.getStatus() == CommonConstants.dingleDigitIntArray[11]) {
s.setStatus(CommonConstants.TWO_INT); s.setStatus(CommonConstants.TWO_INT);
tSalaryStandard.setIncomeEndTime(new Date()); salaryStandardMapper.updateById(s);
tSalaryStandardService.updateById(s); } else {
s.setStatus(CommonConstants.dingleDigitIntArray[12]);
salaryStandardMapper.updateById(s);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment