From 886a432781399dcaeea0fb896b0614bfcc18bee2 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Tue, 8 Dec 2020 17:15:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A9=B3=E5=9B=9E=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=B5=81=E7=A8=8B=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CrmsCompanyPersonalController.java | 8 +- .../service/ICrmsCompanyPersonalService.java | 2 + .../impl/CrmsCompanyPersonalServiceImpl.java | 5 + .../response/GuaranteeDetailResponse.java | 4 + .../impl/DgApplyAmountInfoServiceImpl.java | 43 ++++-- .../DgAssetsInvestigationServiceImpl.java | 128 +++++++++--------- .../DgGuaranteeAssignUserServiceImpl.java | 124 +++++++++-------- .../DgMessageInvestigationServiceImpl.java | 92 +++++++------ .../guarantee/DgApplyAmountListMapper.xml | 2 +- .../domain/crms/CompanyCustomerEntity.java | 2 +- .../domain/crms/ext/CustomerCompanyDTO.java | 2 +- 11 files changed, 242 insertions(+), 170 deletions(-) diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java index 2cae92ac..35036ca2 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -60,7 +61,12 @@ public class CrmsCompanyPersonalController { if(crmsCustomerRelated.getRelatedId()!=null && crmsCustomerRelated.getCustomerId()!=null){ boolean bindRelated = crmsCustomerRelatedService.save(crmsCustomerRelated); } - return result ? ResponseResult.SUCCESS("返回的关联人id="+crmsCompanyPersonal.getId()) : ResponseResult.FAIL(); + //获取返回列表 + CrmsCompanyPersonal companyPersonal = crmsCompanyPersonalService.selectById(crmsCompanyPersonal.getId()); + + List companyPersonalList = new ArrayList(); + companyPersonalList.add(companyPersonal); + return result ? ResponseResult.SUCCESS(companyPersonalList) : ResponseResult.FAIL(); } /** diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/ICrmsCompanyPersonalService.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/ICrmsCompanyPersonalService.java index 6ee22d18..12ef340d 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/ICrmsCompanyPersonalService.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/ICrmsCompanyPersonalService.java @@ -17,4 +17,6 @@ public interface ICrmsCompanyPersonalService extends IService() .eq("business_id",dgApplyAmountList1.getBusinessId())); + //如果是A,B角驳回的情况,此处审核通过之后不经过指派A,B角的操作,直接到调查 + //根据业务id查询A,B角的操作状态是否是已处理,如果是,则为A,B角已驳回的数据 + DgGuaranteeAssignUser assignUser = dgGuaranteeAssignUserMapper.selectOne(new QueryWrapper() + .eq("business_id", dgApplyAmountList1.getBusinessId()).eq("type", 1)); + DgGuaranteeAssignUser assignUser2 = dgGuaranteeAssignUserMapper.selectOne(new QueryWrapper() + .eq("business_id", dgApplyAmountList1.getBusinessId()).eq("type", 2)); + if(status.equals(StatusCode.SP_REFUSE)){//如果为拒绝,业务状态则为已否决 DgBusinessProcessStatus processStatus = new DgBusinessProcessStatus(); processStatus.setBusinessId(dgApplyAmountList1.getBusinessId()); processStatus.setBusinessStatus(StatusCode.YW_REJECTED);//业务状态设置为已否决 dgBusinessProcessStatusMapper.update(processStatus,new QueryWrapper() .eq("business_id",processStatus.getBusinessId())); - } - - if(status.equals(StatusCode.SP_REJECT)){//状态为驳回情况 + }else if(status.equals(StatusCode.SP_REJECT)){//状态为驳回情况 //担保业务员状态改为驳回,操作状态为已处理 DgApplyAmountList applyAmount = new DgApplyAmountList(); applyAmount.setStatus(status); applyAmount.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态改为待处理 dgApplyAmountListMapper.update(applyAmount,new QueryWrapper() .eq("business_id",dgApplyAmountList1.getBusinessId()).eq("type",1)); - } - - - //如果审批状态为已审核,并且操作状态为已处理,则同时新增数据到担保部,资产部和信息部,让这三个模块去审 - if(dgApplyAmountList.getStatus().equals(StatusCode.SP_REVIEWED) && dgApplyAmountList.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){ + }else if(assignUser != null && assignUser2 != null){ + if((assignUser.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)&& assignUser.getStatus().equals(StatusCode.SP_REJECT)) + ||(assignUser2.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)) && assignUser2.getStatus().equals(StatusCode.SP_REJECT)){ + //此处为AB角驳回情况,如果审核通过,则修改A,B角操作状态为待处理,状态为审核中 + if(status.equals(StatusCode.SP_REVIEWED)){ + DgGuaranteeAssignUser user = new DgGuaranteeAssignUser(); + user.setOperatingStatus(StatusCode.CZ_ON_HAND); + user.setStatus(StatusCode.SP_IN_REVIEW); + dgGuaranteeAssignUserMapper.update(user,new QueryWrapper() + .eq("business_id",dgApplyAmountList1.getBusinessId()).eq("type",1)); + dgGuaranteeAssignUserMapper.update(user,new QueryWrapper() + .eq("business_id",dgApplyAmountList1.getBusinessId()).eq("type",2)); + //担保部经理处,驳回状态改为审核中 + DgGuaranteeAssignUser user2 = new DgGuaranteeAssignUser(); + user2.setStatus(StatusCode.SP_IN_REVIEW); + dgGuaranteeAssignUserMapper.update(user2,new QueryWrapper() + .eq("business_id",dgApplyAmountList1.getBusinessId()).eq("type",3)); + } + } + }else if(dgApplyAmountList.getStatus().equals(StatusCode.SP_REVIEWED) && dgApplyAmountList.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){ + //如果审批状态为已审核,并且操作状态为已处理,则同时新增数据到担保部,资产部和信息部,让这三个模块去审 //新增一条记录到担保部 DgGuaranteeAssignUser guaranteeAssignUser = new DgGuaranteeAssignUser(); guaranteeAssignUser.setBusinessId(dgApplyAmountList1.getBusinessId());//业务id diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java index eba61dc4..e1d22e08 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java @@ -24,6 +24,7 @@ import com.daqing.framework.model.response.PromptSuccess; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.excel.ExcelUtil; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -139,16 +140,19 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl() .eq("business_id", assetsResponse.getBusinessId()).eq("type", 1)); -// assetsResponse.setAssetsAmount(assetsInvestigation.getAssetsAmount()); -// assetsResponse.setAmount(assetsInvestigation.getAmount()); -// assetsResponse.setAssetsAmount(assetsInvestigation.getAssetsAmount()); -// assetsResponse.setApplyContent(assetsInvestigation.getApplyContent()); -// assetsResponse.setAssetsCode(assetsInvestigation.getAssetsCode()); -// assetsResponse.setAssetsName(assetsInvestigation.getAssetsName()); -// assetsResponse.setAssetsTime(assetsInvestigation.getAssetsTime()); -// assetsResponse.setAuditAmount(assetsInvestigation.getAuditAmount()); -// assetsResponse.setAuditCode(assetsInvestigation.getAuditCode()); -// assetsResponse.setAuditName(assetsInvestigation.getAuditName()); + if(assetsInvestigation != null){ + BeanUtils.copyProperties(assetsInvestigation,assetsResponse); + } +/* assetsResponse.setAssetsAmount(assetsInvestigation.getAssetsAmount()); + assetsResponse.setAmount(assetsInvestigation.getAmount()); + assetsResponse.setAssetsAmount(assetsInvestigation.getAssetsAmount()); + assetsResponse.setApplyContent(assetsInvestigation.getApplyContent()); + assetsResponse.setAssetsCode(assetsInvestigation.getAssetsCode()); + assetsResponse.setAssetsName(assetsInvestigation.getAssetsName()); + assetsResponse.setAssetsTime(assetsInvestigation.getAssetsTime()); + assetsResponse.setAuditAmount(assetsInvestigation.getAuditAmount()); + assetsResponse.setAuditCode(assetsInvestigation.getAuditCode()); + assetsResponse.setAuditName(assetsInvestigation.getAuditName());*/ //结束--------------------------------------------------------------------- //根据业务id查询评估价值List @@ -217,6 +221,25 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl() .eq("business_id",dgAssetsInvestigation.getBusinessId()).eq("type",2)); + + DgAssetsMoney money = new DgAssetsMoney(); + money.setBusinessId(dgAssetsInvestigation.getBusinessId()); + money.setHouseMoney(investigateAssetsRequest.getHouseMoney()); + money.setCarMoney(investigateAssetsRequest.getCarMoney()); + money.setEquipmentMoney(investigateAssetsRequest.getEquipmentMoney()); + money.setOtherMoney(investigateAssetsRequest.getOtherMoney()); + dgAssetsMoneyMapper.update(money,new QueryWrapper() + .eq("business_id",dgAssetsInvestigation.getBusinessId())); + }else{ + //根据业务id批量新增数据到评估价值列表 + //dgAssetsAssessmentAssetsLogMapper.insertAssetsList(investigateAssetsRequest.getAssessmentList()); + DgAssetsMoney money = new DgAssetsMoney(); + money.setBusinessId(dgAssetsInvestigation.getBusinessId()); + money.setHouseMoney(investigateAssetsRequest.getHouseMoney()); + money.setCarMoney(investigateAssetsRequest.getCarMoney()); + money.setEquipmentMoney(investigateAssetsRequest.getEquipmentMoney()); + money.setOtherMoney(investigateAssetsRequest.getOtherMoney()); + dgAssetsMoneyMapper.insert(money); } //资产部调查员调查,修改审核意见以及状态,修改其他数据 @@ -244,17 +267,6 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl() - .eq("business_id",assetsInvestigation.getBusinessId())); - - DgAssetsInvestigation assets2 = new DgAssetsInvestigation(); - assets2.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 - this.baseMapper.update(assets2,new QueryWrapper() - .eq("business_id",assetsInvestigation.getBusinessId()).eq("type",3)); - } - DgAssetsInvestigation dgAssetsInvestigation = new DgAssetsInvestigation(); dgAssetsInvestigation.setId(approvalAssetsRequest.getId()); dgAssetsInvestigation.setEmpId(Integer.parseInt(dgApplyAmountInfoController.getUserId())); @@ -303,16 +301,12 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl() - .eq("business_id",processStatus.getBusinessId())); - } + DgAssetsInvestigation dgAssets = new DgAssetsInvestigation(); + dgAssets.setStatus(StatusCode.SP_REJECT);//驳回 + dgAssets.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 - //驳回情况 if(approvalAssetsRequest.getStatus().equals(StatusCode.SP_REJECT)){ + //驳回情况 //修改资产部调查下该业务的所有审批状态为驳回 DgAssetsInvestigation assets = new DgAssetsInvestigation(); assets.setStatus(StatusCode.SP_REJECT);//驳回 @@ -320,24 +314,36 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl() + .eq("business_id",assetsInvestigation.getBusinessId())); + + DgAssetsInvestigation assets2 = new DgAssetsInvestigation(); + assets2.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 + this.baseMapper.update(assets2,new QueryWrapper() + .eq("business_id",assetsInvestigation.getBusinessId()).eq("type",3)); + }else if(approvalAssetsRequest.getStatus().equals(StatusCode.SP_REFUSE)){//如果为拒绝,业务状态则为已否决 + DgBusinessProcessStatus processStatus = new DgBusinessProcessStatus(); + processStatus.setBusinessId(assetsInvestigation.getBusinessId()); + processStatus.setBusinessStatus(StatusCode.YW_REJECTED);//业务状态设置为已否决 + dgBusinessProcessStatusMapper.update(processStatus,new QueryWrapper() + .eq("business_id",processStatus.getBusinessId())); + }else if(approvalAssetsRequest.getStatus().equals(StatusCode.SP_REJECT) && assetsInvestigation.getType()==2){ + //资产部经理驳回情况 //资产部专员调查审批状态为驳回,操作状态为待处理 this.baseMapper.update(dgAssets,new QueryWrapper() .eq("business_id",assetsInvestigation.getBusinessId()).eq("type",1)); - } - //资产部领导驳回情况 - if(approvalAssetsRequest.getStatus().equals(StatusCode.SP_REJECT) && assetsInvestigation.getType()==3){ + }else if(approvalAssetsRequest.getStatus().equals(StatusCode.SP_REJECT) && assetsInvestigation.getType()==3){ + //资产部领导驳回情况 //资产部经理审批状态设置为驳回,操作状态设置为待处理 this.baseMapper.update(dgAssets,new QueryWrapper() .eq("business_id",assetsInvestigation.getBusinessId()).eq("type",2)); - } - - //如果资产部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核 - if(approvalAssetsRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgAssetsInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && assetsInvestigation.getType()==2){//资产部经理审核通过 + }else if(approvalAssetsRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgAssetsInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && assetsInvestigation.getType()==2){//资产部经理审核通过 + //如果资产部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核 //根据主键id查询业务id DgAssetsInvestigation assetsInvestigation2 = this.getBaseMapper().selectById(approvalAssetsRequest.getId()); @@ -354,12 +360,12 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl().eq("business_id",assetsInvestigation.getBusinessId())); //查看担保部分管领导是否审核通过 int a=dgGuaranteeAssignUserMapper.selectCount(new QueryWrapper() .eq("business_id",assetsInvestigation.getBusinessId()) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java index 592f46b4..658c041f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java @@ -158,10 +158,15 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl) arr1List2.get(13)); System.out.println("附件详细=============="+dgEnclosureInfo); + + //查询担保部经理审核的金额和期限 + DgGuaranteeAssignUser assignUser = this.baseMapper.selectOne(new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("type", 3)); GuaranteeDetailResponse guaranteeDetailResponse= new GuaranteeDetailResponse(); guaranteeDetailResponse.setDgApplyAmountInfo(dgApplyAmountInfo); guaranteeDetailResponse.setDgEnclosureInfo(dgEnclosureInfo); guaranteeDetailResponse.setLinkedHashMap(linkedList); + guaranteeDetailResponse.setAssignUser(assignUser); return guaranteeDetailResponse; } @@ -171,22 +176,28 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); - int n = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); - int sum = i+n; - //如果是属于驳回的数据,并且调查通过 if(guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)){ + //AB角调查,修改审核意见以及状态 + DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); + dgGuaranteeAssignUser.setId(investigateGuaranteeRequest.getId());//主键id + dgGuaranteeAssignUser.setStatus(StatusCode.SP_REJECT);//状态为驳回 + dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理 + dgGuaranteeAssignUser.setRemark(investigateGuaranteeRequest.getApplyContent());//审核意见 + this.baseMapper.updateById(dgGuaranteeAssignUser); + + int i = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",1).eq("status",StatusCode.SP_REJECT).eq("operating_status",StatusCode.CZ_PROCESSED)); + int n = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",2).eq("status",StatusCode.SP_REJECT).eq("operating_status",StatusCode.CZ_PROCESSED)); + int sum = i+n; + //如果A或B调查通过,审批状态仍然是驳回,操作状态改为已处理 + if(sum == 1){ + DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); + assignUser.setId(investigateGuaranteeRequest.getId());//主键id + assignUser.setStatus(StatusCode.SP_REJECT);//驳回 + this.baseMapper.updateById(assignUser); + } //判断AB角是否都调查通过,如果通过,则将担保部经理的状态改为待处理,同时所有的审批状态都变成审核中 if(sum == 2){ DgGuaranteeAssignUser user = new DgGuaranteeAssignUser(); @@ -194,6 +205,14 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl() .eq("business_id",guaranteeAssignUser.getBusinessId())); } + }else{ + //AB角调查,修改审核意见以及状态 + DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); + dgGuaranteeAssignUser.setId(investigateGuaranteeRequest.getId());//主键id + dgGuaranteeAssignUser.setStatus(investigateGuaranteeRequest.getStatus());//状态 + dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理 + dgGuaranteeAssignUser.setRemark(investigateGuaranteeRequest.getApplyContent());//审核意见 + this.baseMapper.updateById(dgGuaranteeAssignUser); } if(investigateGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT)){//驳回情况处理 @@ -237,8 +256,12 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); + int b = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); + int sum2 = a+b; + if(sum2==2){ DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理 assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中 @@ -261,18 +284,6 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeUser.getBusinessId())); - - DgGuaranteeAssignUser user = new DgGuaranteeAssignUser(); - user.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理 - this.baseMapper.update(assignUser,new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()).eq("type",4)); - } - DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); dgGuaranteeAssignUser.setId(approvalGuaranteeRequest.getId()); dgGuaranteeAssignUser.setEmpId(Integer.parseInt(dgApplyAmountInfoController.getUserId())); @@ -286,16 +297,11 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl() - .eq("business_id",processStatus.getBusinessId())); - } + DgGuaranteeAssignUser dgAssignUser = new DgGuaranteeAssignUser(); + dgAssignUser.setStatus(StatusCode.SP_REJECT);//驳回 + dgAssignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 - //驳回情况 - if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT)){ + if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT)){//驳回情况 //修改担保部调查下该业务的所有审批状态为驳回 DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); assignUser.setStatus(StatusCode.SP_REJECT);//驳回 @@ -303,25 +309,36 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeUser.getBusinessId())); + + DgGuaranteeAssignUser user = new DgGuaranteeAssignUser(); + user.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理 + this.baseMapper.update(user,new QueryWrapper() + .eq("business_id",guaranteeUser.getBusinessId()).eq("type",4)); + }else if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REFUSE)){//如果为拒绝,业务状态则为已否决 + DgBusinessProcessStatus processStatus = new DgBusinessProcessStatus(); + processStatus.setBusinessId(guaranteeUser.getBusinessId()); + processStatus.setBusinessStatus(StatusCode.YW_REJECTED);//业务状态设置为已否决 + dgBusinessProcessStatusMapper.update(processStatus,new QueryWrapper() + .eq("business_id",processStatus.getBusinessId())); + }else if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType()==3){ + //担保部经理驳回情况 //A,B角调查部分审批状态统一设置驳回,操作状态设置为待处理 this.baseMapper.update(dgAssignUser,new QueryWrapper() .eq("business_id",guaranteeUser.getBusinessId()).eq("type",1)); this.baseMapper.update(dgAssignUser,new QueryWrapper() .eq("business_id",guaranteeUser.getBusinessId()).eq("type",2)); - } - //担保部领导驳回情况 - if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType()==4){ + }else if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType()==4){ + //担保部领导驳回情况 //担保部经理审批状态设置为驳回,操作状态设置为待处理 this.baseMapper.update(dgAssignUser,new QueryWrapper() .eq("business_id",guaranteeUser.getBusinessId()).eq("type",3)); - } - //如果担保部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核 - if(approvalGuaranteeRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgGuaranteeAssignUser.getOperatingStatus()==StatusCode.CZ_PROCESSED && guaranteeUser.getType()==3){//担保部经理审核通过 + }else if(approvalGuaranteeRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgGuaranteeAssignUser.getOperatingStatus()==StatusCode.CZ_PROCESSED && guaranteeUser.getType()==3){//担保部经理审核通过 + //如果担保部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核 //根据主键id查询业务id DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(approvalGuaranteeRequest.getId()); @@ -338,11 +355,12 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeUser.getBusinessId())); //查看信息部分管领导是否审核通过 int a=dgMessageInvestigationMapper.selectCount(new QueryWrapper() .eq("business_id",guaranteeUser.getBusinessId()) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java index b80a6bb2..d85d6e5f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java @@ -224,8 +224,24 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl() + .eq("business_id",messageInvestigation.getBusinessId()).eq("type",1)); + + //修改信息部经理的审核状态为审核中,操作状态为待处理 + DgMessageInvestigation dgInvestigation = new DgMessageInvestigation(); + dgInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 + dgInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//审核中 + this.baseMapper.update(dgInvestigation,new QueryWrapper() + .eq("business_id",messageInvestigation.getBusinessId()).eq("type",2)); + + }else if(investigateMessageRequest.getStatus()==StatusCode.SP_IN_REVIEW ){ + //判断信息部专员是否调查通过,如果通过,修改信息部经理操作状态为待处理 DgMessageInvestigation messageInvestigation2 = new DgMessageInvestigation(); messageInvestigation2.setOperatingStatus(StatusCode.CZ_ON_HAND); this.baseMapper.update(messageInvestigation2,new QueryWrapper() @@ -247,19 +263,6 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl() - .eq("business_id",messageInvestigation.getBusinessId())); - - DgMessageInvestigation message2 = new DgMessageInvestigation(); - message2.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 - this.baseMapper.update(message,new QueryWrapper() - .eq("business_id",messageInvestigation.getBusinessId()).eq("type",3 )); - } - DgMessageInvestigation dgMessageInvestigation = new DgMessageInvestigation(); dgMessageInvestigation.setId(approvalMessageRequest.getId()); dgMessageInvestigation.setEmpId(Integer.parseInt(dgApplyAmountInfoController.getUserId())); @@ -269,17 +272,12 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl() - .eq("business_id",processStatus.getBusinessId())); - } - - //驳回情况 if(approvalMessageRequest.getStatus().equals(StatusCode.SP_REJECT)){ + //驳回情况 //修改信息部调查下该业务的所有审批状态为驳回 DgMessageInvestigation message = new DgMessageInvestigation(); message.setStatus(StatusCode.SP_REJECT);//驳回 @@ -287,24 +285,35 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl() + .eq("business_id",messageInvestigation.getBusinessId())); + + DgMessageInvestigation message2 = new DgMessageInvestigation(); + message2.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 + this.baseMapper.update(message2,new QueryWrapper() + .eq("business_id",messageInvestigation.getBusinessId()).eq("type",3 )); + }else if(approvalMessageRequest.getStatus().equals(StatusCode.SP_REFUSE)){//如果为拒绝,业务状态则为已否决 + DgBusinessProcessStatus processStatus = new DgBusinessProcessStatus(); + processStatus.setBusinessId(messageInvestigation.getBusinessId()); + processStatus.setBusinessStatus(StatusCode.YW_REJECTED);//业务状态设置为已否决 + dgBusinessProcessStatusMapper.update(processStatus,new QueryWrapper() + .eq("business_id",processStatus.getBusinessId())); + }else if(approvalMessageRequest.getStatus().equals(StatusCode.SP_REJECT) && messageInvestigation.getType()==2){ + //信息部经理驳回情况 //信息部专员审批状态设置为驳回,操作状态为待处理 this.baseMapper.update(dgMessage,new QueryWrapper() .eq("business_id",messageInvestigation.getBusinessId()).eq("type",1)); - } - //信息部领导驳回情况 - if(approvalMessageRequest.getStatus().equals(StatusCode.SP_REJECT) && messageInvestigation.getType()==3){ + }else if(approvalMessageRequest.getStatus().equals(StatusCode.SP_REJECT) && messageInvestigation.getType()==3){ + //信息部领导驳回情况 //信息部经理审批状态设置为驳回,操作状态为待处理 this.baseMapper.update(dgMessage,new QueryWrapper() .eq("business_id",messageInvestigation.getBusinessId()).eq("type",2)); - } - - //如果信息部经理审核通过,则往信息部分管领导处加一条记录,由分管领导审核 - if(approvalMessageRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgMessageInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && messageInvestigation.getType()==2){//信息部经理审核通过 + }else if(approvalMessageRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgMessageInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && messageInvestigation.getType()==2){//信息部经理审核通过 + //如果信息部经理审核通过,则往信息部分管领导处加一条记录,由分管领导审核 //根据主键id查询业务id DgMessageInvestigation messageInvestigation2 = this.getBaseMapper().selectById(approvalMessageRequest.getId()); @@ -321,11 +330,12 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl().eq("business_id",messageInvestigation.getBusinessId())); //查看担保部分管领导是否审核通过 int a=dgGuaranteeAssignUserMapper.selectCount(new QueryWrapper() .eq("business_id",messageInvestigation.getBusinessId()) diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountListMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountListMapper.xml index edce6461..733a6998 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountListMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountListMapper.xml @@ -33,7 +33,7 @@ AND (ai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')) - AND (au.emp_id =#{userId} or au.emp_id is null) + AND (au.emp_id =#{userId} or au.emp_id is null or au.emp_id ='') diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java index 19aeee27..44a46267 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java @@ -99,7 +99,7 @@ public class CompanyCustomerEntity implements Serializable { private String registerAddr; @ApiModelProperty(value = "法人-身份证号") - private Integer legalIdNumber; + private String legalIdNumber; @ApiModelProperty(value = "法人-户口所在地") private String legalHukouAddr; diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java index 68f593af..464ecb07 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java @@ -115,7 +115,7 @@ public class CustomerCompanyDTO implements Serializable { private String legalName; @ApiModelProperty(value = "法人-性别 1、男,0、女") - private String legalGender; + private Integer legalGender; @ApiModelProperty(value = "法人-身份证号") private String legalIdNumber; From a5f32b5795d2d018d5e9444649f22fea0ea3ba80 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 9 Dec 2020 14:49:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86bug,?= =?UTF-8?q?=E5=8C=85=E6=8B=AC=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E4=B8=9A=E5=8A=A1=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crms/dao/CustomerWorkbenchDao.java | 3 +- .../service/impl/CustomerServiceImpl.java | 5 +- .../impl/CustomerWorkbenchServiceImpl.java | 15 +-- .../mapper/crms/CustomerWorkbenchDao.xml | 19 ++-- .../DgAssetsInvestigationServiceImpl.java | 2 +- .../DgGuaranteeAssignUserServiceImpl.java | 44 +++++---- .../DgMessageInvestigationServiceImpl.java | 2 +- .../crms/response/CustomerEntityResponse.java | 98 +++++++++++++++++++ .../response/CustomerWorkbenchListVO.java | 3 + 9 files changed, 154 insertions(+), 37 deletions(-) create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CustomerEntityResponse.java diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerWorkbenchDao.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerWorkbenchDao.java index 57e72cd8..b61a6a11 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerWorkbenchDao.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerWorkbenchDao.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; +import com.daqing.framework.domain.crms.response.CustomerEntityResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -15,7 +16,7 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface CustomerWorkbenchDao extends BaseMapper { - IPage queryList(Page page, @Param("cr")CustomerWorkbenchRequest customerWorkbenchRequest); + IPage queryList(Page page, @Param("cr")CustomerWorkbenchRequest customerWorkbenchRequest); Boolean passById(@Param("id")Long id,@Param("manager")Long manager); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java index 7115e4ee..d6eaba47 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java @@ -615,7 +615,10 @@ public class CustomerServiceImpl extends ServiceImpl0){ + crmsCustomerRelatedService.insertCustomerRelated(relatedList); + } + if(customer==true && company>0){ return true; } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java index 5954364d..b8872bd2 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java @@ -11,6 +11,7 @@ import com.daqing.financial.crms.service.CustomerWorkbenchService; import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.ext.*; import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; +import com.daqing.framework.domain.crms.response.CustomerEntityResponse; import com.daqing.framework.domain.crms.response.CustomerWorkbenchListVO; import com.daqing.framework.domain.hrms.EmployeeEntity; import com.daqing.framework.domain.hrms.ext.EmployeeTO; @@ -56,12 +57,14 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr); - List customers = customerEntityIPage.getRecords(); + //IPage customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr); + //List customers = customerEntityIPage.getRecords(); + IPage customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr); + List customers = customerEntityIPage.getRecords(); // 获取所有的客户经理id - Long[] managerIds = customers.stream().map(CustomerEntity::getManager).toArray(Long[]::new); + Long[] managerIds = customers.stream().map(CustomerEntityResponse::getManager).toArray(Long[]::new); // 获取所有的客户id - Long[] customerIds = customers.stream().map(CustomerEntity::getId).toArray(Long[]::new); + Long[] customerIds = customers.stream().map(CustomerEntityResponse::getId).toArray(Long[]::new); // 返回列表实体类集合 List customerWorkbenchListVOS = new ArrayList<>(); for (int i = 0; i < customers.size(); i++) { @@ -248,11 +251,11 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl jointCustomerEmployee(List customers, List employeeTO) { + private List jointCustomerEmployee(List customers, List employeeTO) { List customerWorkbenchListVOS = new ArrayList<>();// 用于拼装客户信息和员工及部门信息的集合 CustomerWorkbenchListVO customerWorkbenchListVO; // 将客户信息和客户经理及部门信息拼装起来 - for (CustomerEntity customer : customers) { + for (CustomerEntityResponse customer : customers) { // 每一个客户对应一个不同的对象 customerWorkbenchListVO = new CustomerWorkbenchListVO(); for (EmployeeTO anEmployeeTO : employeeTO) { diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CustomerWorkbenchDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CustomerWorkbenchDao.xml index 008f5b68..2473c92f 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerWorkbenchDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerWorkbenchDao.xml @@ -21,23 +21,24 @@ - + SELECT cc.id,cc.code,cc.type,cc.name,cc.phone,cc.manager,ccc.id as companyId + FROM crms_customer cc + LEFT JOIN crms_company_customer ccc on ccc.customer_id=cc.id + WHERE cc.del_or_not = 0 - AND (name LIKE CONCAT('%',#{cr.codeOrName},'%') OR code LIKE CONCAT('%',#{cr.codeOrName},'%')) + AND (cc.name LIKE CONCAT('%',#{cr.codeOrName},'%') OR cc.code LIKE CONCAT('%',#{cr.codeOrName},'%')) - AND type = #{cr.customerType} + AND cc.type = #{cr.customerType} - AND create_time >= #{cr.startTime} + AND cc.create_time >= #{cr.startTime} - AND create_time <= #{cr.endTime} + AND cc.create_time <= #{cr.endTime} - ORDER BY create_time DESC + ORDER BY cc.create_time DESC diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java index e1d22e08..bc1f317b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java @@ -380,7 +380,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); + int b = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); + int sum2 = a+b; + if(sum2==2){ +/* if(){//合规调查驳回情况处理 + + }else if(){//贷审会业务流程驳回情况处理 + + }else{//正常情况处理*/ + DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); + assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理 + assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中 + assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 + this.baseMapper.update(assignUser,new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",3)); + //} + + } + //上传附件信息 DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); dgEnclosureInfo.setBusinessId(guaranteeAssignUser.getBusinessId());//业务id @@ -255,21 +278,6 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); - int b = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); - int sum2 = a+b; - if(sum2==2){ - DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); - assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理 - assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中 - assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 - this.baseMapper.update(assignUser,new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",3)); - } - //同时往审核流程进程表新增一条记录 String account = dgApplyAmountInfoController.getAccount(); AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部A/B角",investigateGuaranteeRequest.getApplyContent(),2); @@ -375,7 +383,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl