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 {
* @Author pwang
* @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
......
......@@ -148,12 +148,12 @@ public class TSalaryStandard extends BaseEntity {
@ExcelProperty("款项来源(0客户到款/1垫付)")
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: 结算单调整待打印)不能为空")
@NotBlank(message = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印10 推送失败 11 推送收入中)不能为空")
@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 已审核生成收入中12已审核生成收入失败)不能为空")
@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;
/**
* 提交时间
......
......@@ -26,7 +26,7 @@ public class TSalaryStandardExportVo implements Serializable {
/**
* 状态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 发送失败)不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("薪酬状态")
......
......@@ -223,6 +223,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
// 将审核状态变为中间态
tSalaryStandard.setStatus(CommonConstants.dingleDigitIntArray[11]);
tSalaryStandard.setIncomeStartTime(new Date());
baseMapper.updateById(tSalaryStandard);
// 异步-收入相关
doSalaryAsync.doIncomeDetail(dept, salaryAccountList, id, tSalaryStandard);
}
......@@ -816,12 +817,16 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Override
public R<String> salaryDoIncome(String 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) {
Long start = tSalaryStandard.getIncomeStartTime().getTime() + 600000;
Long end = new Date().getTime();
if (start > end) {
return R.failed("上次生成时间:" + tSalaryStandard.getIncomeStartTime() + ",请稍等10分钟");
if (tSalaryStandard.getStatus() == CommonConstants.dingleDigitIntArray[11]) {
long start = tSalaryStandard.getIncomeStartTime().getTime() + 1800000;
long end = new Date().getTime();
if (start > end) {
return R.failed("上次生成时间:" + tSalaryStandard.getIncomeStartTime() + ",请稍等30分钟");
}
}
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", tSalaryStandard.getDeptId()
......@@ -837,14 +842,15 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
if (salaryAccountList != null && !salaryAccountList.isEmpty()) {
// 将重置生成推送时间
tSalaryStandard.setIncomeStartTime(new Date());
tSalaryStandard.setIncomeEndTime(null);
this.updateById(tSalaryStandard);
// 异步-收入相关
doSalaryAsync.doIncomeDetail(dept, salaryAccountList, id, tSalaryStandard);
return R.ok("生成收入并推送中,请耐心等待10分钟!");
return R.ok("生成收入并推送中,请耐心等待30分钟!");
}
return R.failed("未获取到报账明细,请重试");
} else {
return R.failed("不是待生成收入状态,请勿点击!");
return R.failed("请耐心等待!");
}
}
}
......@@ -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.salary.entity.TSalaryAccount;
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.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
......@@ -34,7 +35,7 @@ import java.util.*;
public class DoJointSalaryAsyncTask {
private final DaprSocialProperties socialProperties;
private final TSalaryStandardService tSalaryStandardService;
private final TSalaryStandardMapper salaryStandardMapper;
/**
* @Description: 收入
......@@ -52,43 +53,53 @@ public class DoJointSalaryAsyncTask {
}
Map<String, Integer> detailMap = new HashMap<>();
boolean isTrue = true;
// 收入相关
R<String> failed1 = getIncomeDetailMap(tSalaryStandard, dept, idCardList, detailMap);
if (failed1 != null) {
isTrue = false;
} else {
// 含有薪资,则计算收入
// 管理费
if (Common.isNotNull(dept.getManageServerItem()) && dept.getManageServerItem().contains(CommonConstants.FOUR_STRING)
&& CommonConstants.ZERO_STRING.equals(dept.getManagementTag())) {
// 金额-人数
if (CommonConstants.TWO_STRING.equals(dept.getManagementType())) {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, detailMap, dept.getManagementType(), CommonConstants.ONE_STRING);
} else {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, new HashMap<>(), dept.getManagementType(), CommonConstants.ONE_STRING);
TSalaryStandard s = salaryStandardMapper.selectById(id);
try {
// 收入相关
R<String> failed1 = getIncomeDetailMap(tSalaryStandard, dept, idCardList, detailMap);
if (failed1 != null) {
isTrue = false;
} else {
// 含有薪资,则计算收入
// 管理费
if (Common.isNotNull(dept.getManageServerItem()) && dept.getManageServerItem().contains(CommonConstants.FOUR_STRING)
&& CommonConstants.ZERO_STRING.equals(dept.getManagementTag())) {
// 金额-人数
if (CommonConstants.TWO_STRING.equals(dept.getManagementType())) {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, detailMap, dept.getManagementType(), CommonConstants.ONE_STRING);
} else {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, new HashMap<>(), dept.getManagementType(), CommonConstants.ONE_STRING);
}
}
}
// 风险金
if (isTrue && Common.isNotNull(dept.getRiskServerItem()) && dept.getRiskServerItem().contains(CommonConstants.FOUR_STRING)
&& CommonConstants.ZERO_STRING.equals(dept.getRiskFundTag())) {
// 金额-人数
if (CommonConstants.TWO_STRING.equals(dept.getRiskFundType())) {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, detailMap, dept.getRiskFundType(), CommonConstants.TWO_STRING);
} else {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, new HashMap<>(), dept.getRiskFundType(), CommonConstants.TWO_STRING);
// 风险金
if (isTrue && Common.isNotNull(dept.getRiskServerItem()) && dept.getRiskServerItem().contains(CommonConstants.FOUR_STRING)
&& CommonConstants.ZERO_STRING.equals(dept.getRiskFundTag())) {
// 金额-人数
if (CommonConstants.TWO_STRING.equals(dept.getRiskFundType())) {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, detailMap, dept.getRiskFundType(), CommonConstants.TWO_STRING);
} else {
// 保存明细
isTrue = saveIncomeDetail(salaryAccountList, tSalaryStandard, dept, new HashMap<>(), dept.getRiskFundType(), CommonConstants.TWO_STRING);
}
}
}
} catch (Exception e) {
isTrue = false;
log.error(e.getMessage());
}
if (isTrue) {
TSalaryStandard s = tSalaryStandardService.getById(id);
if (s != null && s.getStatus() == CommonConstants.dingleDigitIntArray[11]) {
if (s != null
&& (s.getStatus() == CommonConstants.dingleDigitIntArray[11]
|| s.getStatus() == CommonConstants.dingleDigitIntArray[12])) {
tSalaryStandard.setIncomeEndTime(new Date());
if (isTrue) {
s.setStatus(CommonConstants.TWO_INT);
tSalaryStandard.setIncomeEndTime(new Date());
tSalaryStandardService.updateById(s);
salaryStandardMapper.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