From 54bbda6f374f3b8ebafed04d49f756fd75e53a1a Mon Sep 17 00:00:00 2001 From: nidapeng <jp@doumee.com> Date: 星期六, 06 四月 2024 12:31:39 +0800 Subject: [PATCH] 提交一把 --- server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java | 77 +++++++++++++++++++++++++++++--------- 1 files changed, 59 insertions(+), 18 deletions(-) diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java index 59baf20..be2de67 100644 --- a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java +++ b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java @@ -154,7 +154,7 @@ .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) @@ -172,15 +172,40 @@ .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 @@ -200,6 +225,7 @@ 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) @@ -209,7 +235,7 @@ 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) { @@ -292,6 +318,7 @@ @Override + @Transactional(rollbackFor = {BusinessException.class,Exception.class}) public Integer merge(SaveUnionChangeDTO saveUnionChangeDTO){ LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); if(!user.getType().equals(Constants.TWO)){ @@ -312,7 +339,7 @@ .eq(ApplyChange::getIsdeleted, Constants.ZERO) .eq(InsuranceApply::getUnionApplyId,saveUnionChangeDTO.getUnionApplyId()) .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.CHECHED_PASSED.getKey()) - .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) + .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey()) .eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType()) .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds()) .isNull(ApplyChange::getUnionChangeId) @@ -326,6 +353,7 @@ 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()); @@ -342,7 +370,7 @@ 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; @@ -415,8 +443,11 @@ } + @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) @@ -433,8 +464,10 @@ ); //浼佷笟鍚嶇О 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) ); @@ -486,6 +519,7 @@ } 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); } @@ -498,7 +532,7 @@ 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()); @@ -551,6 +585,8 @@ 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(),"瀵逛笉璧烽潪鎮ㄧ殑鍚堝苟鍗曪紝鎮ㄦ棤娉曡繘琛屾搷浣滐紒"); } @@ -560,7 +596,7 @@ 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(),"瀵逛笉璧凤紝鍚堝苟鍗曠姸鎬佸凡娴佽浆"); } @@ -600,15 +636,15 @@ ||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); } } @@ -620,7 +656,12 @@ 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()); -- Gitblit v1.9.3