Commit e5835abe authored by huyuchen's avatar huyuchen

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

parent 49299532
......@@ -164,21 +164,6 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
String applyNo = getCode();
//获取明细当日最大申请编号
String applyDetail = baseMapper.getMaxInusuranceDetailCode();
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
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);
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());
}
}
//暂存不做校验
if (CommonConstants.ONE_STRING.equals(tInsuranceUnpurchaseApply.getSaveFlag())) {
tInsuranceUnpurchaseApply.setCreateTime(null);
......@@ -221,6 +206,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if (Common.isNotNull(personList) && !personList.isEmpty() &&
personList.stream().noneMatch(e -> CommonConstants.ONE_STRING.equals(e.getCode()))) {
tInsuranceUnpurchaseApply.setUnbuyNum(String.valueOf(personList.size()));
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
setValue(tInsuranceUnpurchaseApply,user);
if (Common.isNotNull(tInsuranceUnpurchaseApply.getId())) {
//同倩倩确认申请时间实时更新
tInsuranceUnpurchaseApply.setCreateTime(LocalDateTime.now());
......@@ -358,6 +345,24 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return personList;
}
//申请人是否属于子分公司和该项目是否有审批通过记录赋值
private void setValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,YifuUser user) {
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);
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::getStatus, CommonConstants.THREE_STRING)
.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());
}
}
}
private void initValue(TInsuranceUnpurchaseApply tInsuranceUnpurchaseApply,TInsuranceUnpurchasePerson person) {
person.setParnetId(tInsuranceUnpurchaseApply.getId());
person.setApplyNo(tInsuranceUnpurchaseApply.getApplyNo());
......
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