| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | fee = fee.subtract(new BigDecimal(maxDays).multiply(applyChagneDetail.getPrice())).add(applyChagneDetail.getFee()); |
| | | } |
| | | } |
| | | unionChange.setFee(fee); |
| | | unionChange.setFee(fee.setScale(2, RoundingMode.HALF_UP)); |
| | | //查询操作记录 |
| | | List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class, |
| | | new MPJLambdaWrapper<ApplyLog>() |
| | |
| | | } |
| | | //判断批单日期 合并单的批单生效期在为 保单起期的次日 到保单止期 |
| | | //获取开始日期次日 |
| | | if(saveUnionChangeDTO.getApplyDate().getTime()<=DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | if(saveUnionChangeDTO.getApplyDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || saveUnionChangeDTO.getApplyDate().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单生效期错误"); |
| | | } |
| | |
| | | UnionChange unionChange = new UnionChange(); |
| | | unionChange.setCreateDate(new Date()); |
| | | unionChange.setCreator(user.getId()); |
| | | unionChange.setEditDate(new Date()); |
| | | unionChange.setEditor(user.getId()); |
| | | unionChange.setShopId(user.getCompanyId()); |
| | | unionChange.setIsdeleted(Constants.ZERO); |
| | | unionChange.setUnionApplyId(saveUnionChangeDTO.getUnionApplyId()); |
| | |
| | | } |
| | | //判断批单日期 合并单的批单生效期在为 保单起期的次日 到保单止期 |
| | | //获取开始日期次日 |
| | | if(unionChangeBXDDTO.getApplyDate().getTime()<=DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | if(unionChangeBXDDTO.getApplyDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || unionChangeBXDDTO.getApplyDate().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单生效期错误"); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"批单明细记录存在非本合并单数据"); |
| | | }; |
| | | for (Multifile m:unionChangeBXDDTO.getApplyChangeBXDList()) { |
| | | if(StringUtils.isBlank(m.getName()) |
| | | || StringUtils.isBlank(m.getFileurl()) ){ |
| | | continue; |
| | | } |
| | | if(Objects.isNull(m.getObjId()) |
| | | ||StringUtils.isBlank(m.getFileurl()) |
| | | ||StringUtils.isBlank(m.getName()) |
| | |
| | | } |
| | | if(CollectionUtils.isNotEmpty(applyChangeList)){ |
| | | for (ApplyChange applyChange:applyChangeList) { |
| | | ApplyChange oldModel = applyChange; |
| | | applyChange.setApplyStartTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setValidTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setEditDate(new Date()); |
| | |
| | | .eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId())); |
| | | this.dealApplyChangeDetail(applyChange,allList); |
| | | applyChangeJoinMapper.updateById(applyChange); |
| | | |
| | | //存储批单完成信息 |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_APPROVE; |
| | | String info = ""; |
| | | if(applyChange.getValidTime()!=null && applyChange.getValidTime().getTime()/1000!= applyChange.getApplyStartTime().getTime()/1000){ |
| | | info =applyLogType.getInfo(); |
| | | info = info.replace("${param1}",DateUtil.getPlusTime2(applyChange.getValidTime())); |
| | | info = info.replace("${param2}",DateUtil.getPlusTime2(applyChange.getApplyStartTime())); |
| | | } |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(), info,applyChange.getId(),applyLogType.getKey(),JSONObject.toJSONString(oldModel), JSONObject.toJSONString(applyChange)); |
| | | applyLogMapper.insert(log); |
| | | |
| | | } |
| | | } |
| | | unionChangeMapper.update(null,new UpdateWrapper<UnionChange>().lambda() |
| | |
| | | |
| | | //修改 员工投保明细记录 历史数据 |
| | | memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>().lambda() |
| | | .set(MemberInsurance::getEndTime,applyStartTime) |
| | | .set(MemberInsurance::getEndTime,DateUtil.getMontageDate(applyStartTime,3)) |
| | | .set(MemberInsurance::getFee,oldFee) |
| | | .eq(MemberInsurance::getRelationId,oldModel.getId()) |
| | | ); |
| | |
| | | add.setFromId(detail.getId()); |
| | | applyDetailJoinMapper.insert(add); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(oldModel,applyChange.getId()); |
| | | MemberInsurance memberInsurance = new MemberInsurance(add,applyChange.getId()); |
| | | memberInsurance.setSolutionId(detail.getSolutionId()); |
| | | memberInsurance.setWorktypeName(detail.getWorkTypeName()); |
| | | memberInsurance.setDuName(detail.getDuName()); |