| | |
| | | .selectAs(Company::getName,UnionChange::getShopName) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 0 )",UnionChange::getAddNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 1 )",UnionChange::getDelNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 2 )",UnionChange::getChangeNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 2 )",UnionChange::getChangeNum).select("( select ifnull(sum(ac.FEE),0) from apply_change ac where t.id = ac.UNION_CHANGE_ID )",UnionChange::getFee) |
| | | .leftJoin(UnionApply.class,UnionApply::getId,UnionChange::getUnionApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,UnionApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,UnionChange::getShopId) |
| | |
| | | .selectAs(SystemUser::getType,ApplyLog::getCreatorType) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.THREE)) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.FOUR)) |
| | | .eq(ApplyLog::getApplyId,unionChange.getId()) |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |
| | | unionChange.setApplyLogList(applyLogList); |
| | | } |
| | | initFiles(unionChange); |
| | | return unionChange; |
| | | } |
| | | |
| | | private void initFiles(UnionChange unionChange) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId, unionChange.getId() ) |
| | | .in(Multifile::getObjType, Arrays.asList(new Integer[]{Constants.MultiFile.WTB_CA_TBD_PDF.getKey(),Constants.MultiFile.WTB_CA_DONE_PDF.getKey()})) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO)); |
| | | 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.WTB_CA_TBD_PDF.getKey())){ |
| | | //签署后申请单 |
| | | unionChange.setApplyFile(f); |
| | | } |
| | | if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.WTB_CA_DONE_PDF.getKey())){ |
| | | //签署后申请单 |
| | | unionChange.setPidanFile(f); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | IPage<UnionChange> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<UnionChange> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(UnionChange.class); |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | queryWrapper.selectAs(UnionApply::getCode,UnionChange::getApplyCode); |
| | | queryWrapper.selectAs(Solutions::getName,UnionChange::getSolutionsName) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 0 )",UnionChange::getAddNum) |
| | |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,UnionApply::getSolutionId); |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Constants.equalsInteger(user.getType(),Constants.TWO)){ |
| | | queryWrapper.eq(UnionChange::getShopId, pageWrap.getModel().getShopId()); |
| | | queryWrapper.eq(UnionChange::getShopId, user.getCompanyId()); |
| | | } |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | |
| | | unionChange.setCreateDate(new Date()); |
| | | unionChange.setCreator(user.getId()); |
| | | unionChange.setShopId(user.getCompanyId()); |
| | | unionChange.setIsdeleted(Constants.ZERO); |
| | | unionChange.setUnionApplyId(saveUnionChangeDTO.getUnionApplyId()); |
| | | unionChange.setApplyStartTime(saveUnionChangeDTO.getApplyDate()); |
| | | unionChange.setType(saveUnionChangeDTO.getBusinessType()); |
| | |
| | | |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getUnionChangeId,unionChange.getId()) |
| | | .in(ApplyChagneDetail::getApplyId,saveUnionChangeDTO.getApplyIds())); |
| | | .in(ApplyChagneDetail::getApplyChangeId,saveUnionChangeDTO.getApplyIds())); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD; |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user.getType().equals(Constants.TWO)){ |
| | | user.setType(Constants.formatIntegerNum(user.getType())); |
| | | if(!user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户用户,无法进行该操作!"); |
| | | } |
| | | UnionChange unionChange = unionChangeMapper.selectById(closeDTO.getId()); |
| | | if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | unionChange.setStatus(Constants.formatIntegerNum(unionChange.getStatus())); |
| | | unionChange.setShopId(Constants.formatIntegerNum(unionChange.getShopId())); |
| | | if(!unionChange.getShopId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起非您的合并单,您无法进行操作!"); |
| | | } |
| | |
| | | |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getUnionChangeId,null) |
| | | .in(ApplyChagneDetail::getApplyId,unionChange.getId())); |
| | | .eq(ApplyChagneDetail::getUnionChangeId,unionChange.getId())); |
| | | |
| | | unionChangeMapper.update(null,new UpdateWrapper<UnionChange>().lambda() |
| | | .set(UnionChange::getStatus,Constants.UnionApplyStatus.CLOSE.getKey()) |
| | | .set(UnionChange::getStatus,Constants.UnionChangeStatus.CLOSE.getKey()) |
| | | .eq(UnionChange::getId,unionChange.getId()) |
| | | ); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD; |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_CLOSE; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", closeDTO.getReason()); |
| | | ApplyLog log = new ApplyLog(unionChange,applyLogType.getName(), info |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public UnionChange unionChangeDetail(Integer unionChangeId){ |
| | | |
| | | if(Objects.isNull(unionChangeId)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | UnionChange unionChange = unionChangeJoinMapper.selectJoinOne(UnionChange.class, |
| | | new MPJLambdaWrapper<UnionChange>() |
| | | .selectAll(UnionChange.class) |
| | |
| | | ); |
| | | //企业名称 |
| | | List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class,new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(Company::getName,ApplyChange::getCompanyName) |
| | | .leftJoin(Company.class,Company::getId,ApplyChange::getCompanyId) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(ApplyChange::getUnionChangeId,unionChangeId) |
| | | ); |
| | | |
| | |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | UnionChange unionChange = this.unionChangeDetail(smsCheckDTO.getBusinessId()); |
| | | unionChange.setStatus(Constants.formatIntegerNum(unionChange.getStatus())); |
| | | if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,合并单业务已关闭"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.MERGE.getKey())){ |
| | | if(!unionChange.getStatus().equals(Constants.UnionChangeStatus.MERGE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,合并单状态已流转"); |
| | | } |
| | | Company company = companyMapper.selectById(user.getCompanyId()); |
| | |
| | | if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | unionChange.setStatus(Constants.formatIntegerNum(unionChange.getStatus())); |
| | | unionChange.setShopId(Constants.formatIntegerNum(unionChange.getShopId())); |
| | | if(!unionChange.getShopId().equals(user.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起非您的合并单,您无法进行操作!"); |
| | | } |
| | |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,合并单业务已关闭"); |
| | | } |
| | | if(unionChange.getStatus().equals(Constants.UnionChangeStatus.UPLOAD_INSURANCE_POLICY.getKey())){ |
| | | if(!unionChange.getStatus().equals(Constants.UnionChangeStatus.UPLOAD_INSURANCE_POLICY.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,合并单状态已流转"); |
| | | } |
| | | |
| | |
| | | ||StringUtils.isBlank(m.getFileurl()) |
| | | ||StringUtils.isBlank(m.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"加减保/换厂业务批单文件信息缺失"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"批单文件信息缺失"); |
| | | } |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setCreator(user.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjType(Constants.MultiFile.CA_PD_PDF.getKey()); |
| | | multifile.setType(Constants.TWO); |
| | | multifileMapper.insert(multifile); |
| | | m.setId(null); |
| | | m.setIsdeleted(Constants.ZERO); |
| | | m.setCreator(user.getId()); |
| | | m.setCreateDate(new Date()); |
| | | m.setObjType(Constants.MultiFile.CA_PD_PDF.getKey()); |
| | | m.setType(Constants.TWO); |
| | | multifileMapper.insert(m); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(CollectionUtils.isNotEmpty(applyChangeList)){ |
| | | for (ApplyChange applyChange:applyChangeList) { |
| | | applyChange.setApplyStartTime(unionChangeBXDDTO.getApplyDate()); |
| | |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setEditor(user.getId()); |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.APPROVE.getKey()); |
| | | List<ApplyChagneDetail> allList = applyChagneDetailJoinMapper.selectList(new QueryWrapper<ApplyChagneDetail>().lambda().eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId())); |
| | | List<ApplyChagneDetail> allList = applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class, |
| | | new MPJLambdaWrapper<ApplyChagneDetail>().selectAll(ApplyChagneDetail.class) |
| | | .selectAs(Member::getName,ApplyChagneDetail::getMemberName ) |
| | | .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo ) |
| | | .leftJoin(Member.class,Member::getId,ApplyChagneDetail::getMemberId) |
| | | .eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId())); |
| | | this.dealApplyChangeDetail(applyChange,allList); |
| | | applyChange.setCode(unionChangeBXDDTO.getCode()); |
| | | applyChange.setCheckUserId(user.getId()); |