Commit 2c2e2748 authored by hongguangwu's avatar hongguangwu

薪资审核优化

parent 2964a7d4
...@@ -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;
/** /**
* 提交时间 * 提交时间
......
...@@ -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("请耐心等待!");
} }
} }
} }
...@@ -52,6 +52,8 @@ public class DoJointSalaryAsyncTask { ...@@ -52,6 +52,8 @@ public class DoJointSalaryAsyncTask {
} }
Map<String, Integer> detailMap = new HashMap<>(); Map<String, Integer> detailMap = new HashMap<>();
boolean isTrue = true; boolean isTrue = true;
TSalaryStandard s = tSalaryStandardService.getById(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,11 +85,19 @@ public class DoJointSalaryAsyncTask { ...@@ -83,11 +85,19 @@ 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()); tSalaryStandardService.updateById(s);
} else {
s.setStatus(CommonConstants.dingleDigitIntArray[12]);
tSalaryStandardService.updateById(s); tSalaryStandardService.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