| | |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | initStatusInfo(unionApply); |
| | | |
| | | //查询附件数据 |
| | | initImgData(unionApply); |
| | | //查询操作记录 |
| | | List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class, |
| | | new MPJLambdaWrapper<ApplyLog>() |
| | |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |
| | | unionApply.setApplyLogList(applyLogList); |
| | | |
| | | return unionApply; |
| | | } |
| | | |
| | | private void initImgData(UnionApply model) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId, model.getId()) |
| | | .in(Multifile::getObjType, Arrays.asList(new Integer[]{ |
| | | Constants.MultiFile.HBD_BD_APPLY_PDF.getKey() |
| | | ,Constants.MultiFile.HBD_BD_SIGNED_PDF.getKey() |
| | | ,Constants.MultiFile.WTB_BD_DONE_PDF.getKey() })) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .orderByAsc(Multifile::getId)); |
| | | if(multifiles!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode(); |
| | | for(Multifile f : multifiles){ |
| | | if(StringUtils.isBlank(f.getFileurl())){ |
| | | continue; |
| | | } |
| | | f.setFileurlFull(path+f.getFileurl()); |
| | | if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.HBD_BD_APPLY_PDF.getKey())){ |
| | | //签署前的投保单 |
| | | model.setToubaodanFile(f); |
| | | }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.HBD_BD_SIGNED_PDF.getKey())){ |
| | | //签署后的投保单 |
| | | model.setToubaodanSignedFile(f); |
| | | }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.WTB_BD_DONE_PDF.getKey())){ |
| | | //最終保险单 |
| | | model.setBaoxiandanFile(f); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | if(Objects.isNull(unionApply)||!Constants.equalsInteger(unionApply.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | unionApply.setStatus(Constants.formatIntegerNum(unionApply.getStatus())); |
| | | if(!unionApply.getCompanyId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起非您的合并单,您无法进行操作!"); |
| | | } |
| | | if(unionApply.getStatus().equals(Constants.UnionApplyStatus.FINISH.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,合并单业务已完结,您无法进行该操作!"); |
| | | } |
| | | if(unionApply.getStatus().equals(Constants.UnionApplyStatus.MERGE.getKey())){ |
| | | if(!unionApply.getStatus().equals(Constants.UnionApplyStatus.MERGE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,合并单业务已流转,您无法进行该操作!"); |
| | | } |
| | | |
| | |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjId(uploadMultifileDTO.getBusinessId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjType(Constants.MultiFile.HBD_BD_SIGNED_PDF.getKey()); |
| | | multifile.setObjType(Constants.MultiFile.HBD_BD_APPLY_PDF.getKey()); |
| | | multifile.setType(Constants.TWO); |
| | | multifile.setFileurl(uploadMultifileDTO.getFileurl()); |
| | | multifile.setName(uploadMultifileDTO.getName()); |