Commit 3115af61 authored by huyuchen's avatar huyuchen

hyc-切成测试环境商险配置

parent 94ee2077
......@@ -8,6 +8,7 @@ import com.alibaba.excel.util.ListUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpManagerInfoMapper;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSalaryInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimInfotVO;
......@@ -16,6 +17,7 @@ import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -34,8 +36,11 @@ import java.util.stream.Collectors;
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, EkpSalaryInfo> implements EkpSalaryInfoService {
private final EkpManagerInfoMapper managerInfoMapper;
/**
//@Description: 工资明细推送至ekp
//@Author: huyc
......@@ -327,6 +332,7 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
String deptName;
BigDecimal money;
ClaimRebackInfotVO info;
EkpDeptInfoVo deptInfo;
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
......@@ -335,6 +341,16 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
deptName = excel.getDeptName();
ClaimRebackInfotVO backInfo = new ClaimRebackInfotVO();
//根据项目编码获取ekp所有项目信息
deptInfo = managerInfoMapper.getEkpDeptInfoByNo(deptNo);
if (Common.isNotNull(deptInfo) && !deptName.equals(deptInfo.getDeptName())) {
backInfo.setDeptName(deptName);
backInfo.setDeptNo(deptNo);
backInfo.setErrorInfo("系统中的项目编码对应的项目名称和模板中不一致!");
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), backInfo.getErrorInfo(),backInfo));
continue;
}
if (money.compareTo(BigDecimal.ZERO) >= 0) {
//先找到彭超创建的款项认领明细
info = baseMapper.getClaimInfoByDeptNo(deptNo,"1");
......@@ -371,17 +387,17 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
info.setAfterAdjustMoney(BigDecimal.ZERO);
money = info.getSurMoney().add(money);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel);
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel,"2");
}
} else {
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel);
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel,"1");
}
}
}
}
public void subSwitch(String deptNo,ClaimRebackInfotVO backInfo,List<ErrorMessage>errorMessageList,
BigDecimal money,String deptName,ClaimInfotVO excel) {
BigDecimal money,String deptName,ClaimInfotVO excel,String flag) {
List<ClaimRebackInfotVO> infoList = baseMapper.getClaimBigInfoByDeptNoAndUser(deptNo);
if (Optional.ofNullable(infoList).isPresent()) {
for (ClaimRebackInfotVO subInfo : infoList) {
......@@ -399,6 +415,15 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
}
}
} else {
if ("1".equals(flag)) {
backInfo.setDeptName(deptName);
backInfo.setDeptNo(deptNo);
backInfo.setAdjustMoney(money);
backInfo.setErrorInfo("未找到该项目对应的款项认领明细");
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), backInfo.getErrorInfo(), backInfo));
return;
}
}
if (BigDecimal.ZERO.compareTo(money) > 0 ) {
backInfo.setDeptNo(deptNo);
......
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