Commit f41489a2 authored by huyuchen's avatar huyuchen

huych-含风险项目商险不购买申请提交

parent 7359c8da
......@@ -151,7 +151,6 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
}
@Override
@Transactional
public R addApply(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply) {
YifuUser user = SecurityUtils.getUser();
//字段长度校验
......@@ -167,13 +166,15 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if (Common.isNotNull(tInsuranceUnpurchaseApply.getDeptNo())) {
List<String> deptList = CommonConstants.deptList;
tInsuranceUnpurchaseApply.setCompanyFlag(deptList.stream().noneMatch(e -> e.equals(user.getDeptName())) ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
long count = baseMapper.selectCount(Wrappers.<TInsuranceUnpurchaseApply>query().lambda()
.eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchaseApply::getReasonType, tInsuranceUnpurchaseApply.getReasonType())
.eq(TInsuranceUnpurchaseApply::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
tInsuranceUnpurchaseApply.setAuditFlag(count > 0 ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
tInsuranceUnpurchaseApply.setStatus(count > 0 ? CommonConstants.THREE_STRING : tInsuranceUnpurchaseApply.getStatus());
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getReasonType())) {
long count = baseMapper.selectCount(Wrappers.<TInsuranceUnpurchaseApply>query().lambda()
.eq(TInsuranceUnpurchaseApply::getDeptNo, tInsuranceUnpurchaseApply.getDeptNo())
.eq(TInsuranceUnpurchaseApply::getReasonType, tInsuranceUnpurchaseApply.getReasonType())
.eq(TInsuranceUnpurchaseApply::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
tInsuranceUnpurchaseApply.setAuditFlag(count > 0 ? CommonConstants.ZERO_STRING : CommonConstants.ONE_STRING);
tInsuranceUnpurchaseApply.setStatus(count > 0 ? CommonConstants.THREE_STRING : tInsuranceUnpurchaseApply.getStatus());
}
}
//暂存不做校验
......@@ -330,7 +331,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
cardVo.setEmpName(vo.getEmpName());
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getReasonType())) {
flagSocial = socialDaprUtil.selectExitSocialInjury(cardVo);
if (Common.isEmpty(flagSocial) || Boolean.TRUE.equals(flagSocial.getData())) {
if (Common.isEmpty(flagSocial) || Boolean.FALSE.equals(flagSocial.getData())) {
vo.setCode(CommonConstants.ONE_STRING);
vo.setMessage(vo.getEmpName() + "_" + vo.getEmpIdcardNo() + ":无正常参保或派单中的数据,禁止提交!");
}
......@@ -354,7 +355,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
person.setDeptNo(tInsuranceUnpurchaseApply.getDeptNo());
person.setDivision(tInsuranceUnpurchaseApply.getDivision());
person.setNewLine(tInsuranceUnpurchaseApply.getNewLine());
person.setReasonType(tInsuranceUnpurchaseApply.getReasonInfo());
person.setReasonType(tInsuranceUnpurchaseApply.getReasonType());
person.setHasContainRisks(tInsuranceUnpurchaseApply.getReasonInfo());
person.setReasonInfo(tInsuranceUnpurchaseApply.getReasonInfo());
person.setCreateBy(tInsuranceUnpurchaseApply.getCreateBy());
......
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