From 1753ab896a218722e9d6d37691b9db14c9847f1d Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Mon, 29 Mar 2021 16:18:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=94=B3=E8=AF=B7=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DgApplyAmountInfoServiceImpl.java | 78 ++++++++----------- .../DgBusinessProcessStatusMapper.xml | 5 +- .../domain/guarantee/GuaranteeCode.java | 2 +- 3 files changed, 36 insertions(+), 49 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index b100cba5..07d6c6a4 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -62,8 +62,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl redisTemplate; @Resource private CrmsFeignService crmsFeignService; @@ -136,20 +134,16 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl businessCompanyList = dgBusinessCompanyMapper.selectList(new QueryWrapper() - .eq("social_unified_code", businessApplication.getSocialUnifiedCode())); - List businessIds = new ArrayList(); - for (DgBusinessCompany businessCompany:businessCompanyList) { - businessIds.add(businessCompany.getBusinessId()); - } - //根据业务id查询dg_business_process_status表中是否存在业务为进行中的记录 - Integer businessStatus=StatusCode.YW_IN_PROGRESS;//进行中 - int count2 = dgBusinessProcessStatusMapper.selectBybusinessIdAndStatus(businessIds,businessStatus); - //如果存在,则不能再申请业务 - if(count2>0){ - ExceptionCast.cast(GuaranteeCode.REPEAT_BUSINESS); + DgApplyAmountList dgApplyAmountList = new DgApplyAmountList(); + if(businessApplication.getIsSaveOrCommit()==1){//提交 + //根据社会统一信用代码判断是否可以申请业务,同一客户如果有一笔业务在业务流程在进行中,则不能再申请 + this.repeatBusiness(businessApplication); + + dgApplyAmountList.setStatus(StatusCode.SP_IN_REVIEW);//审批状态 设置为审核中 + dgApplyAmountList.setOperatingStatus(StatusCode.CZ_LAUNCH);//操作状态设置为已发起 + }else{//保存 + dgApplyAmountList.setStatus(StatusCode.SP_DRAFT);//审批状态 保存为草稿 + dgApplyAmountList.setOperatingStatus(StatusCode.CZ_TO_BE_SUBMITTED);//操作状态设置为待提交 } //申请贷款相关信息 @@ -194,41 +188,18 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl relatedList = new ArrayList<>(); - List intList = businessApplication.getRelatedId(); - - for(int i=0;i() .eq("business_id", dgApplyAmountList.getBusinessId())); @@ -392,6 +356,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl businessCompanyList = dgBusinessCompanyMapper.selectList(new QueryWrapper() + .eq("social_unified_code", businessApplication.getSocialUnifiedCode())); + List businessIds = new ArrayList(); + for (DgBusinessCompany businessCompany:businessCompanyList) { + businessIds.add(businessCompany.getBusinessId()); + } + //根据业务id查询dg_business_process_status表中是否存在业务为进行中的记录 + Integer businessStatus=StatusCode.YW_IN_PROGRESS;//进行中 + if(businessIds.size()>0){ + int count2 = dgBusinessProcessStatusMapper.selectBybusinessIdAndStatus(businessIds,businessStatus); + //如果存在,则不能再申请业务 + if(count2>0){ + ExceptionCast.cast(GuaranteeCode.REPEAT_BUSINESS); + } + } + } + } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgBusinessProcessStatusMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgBusinessProcessStatusMapper.xml index 8f71754e..bc8c142d 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgBusinessProcessStatusMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgBusinessProcessStatusMapper.xml @@ -12,11 +12,12 @@ diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/GuaranteeCode.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/GuaranteeCode.java index 8de8578f..1559ae1e 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/GuaranteeCode.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/GuaranteeCode.java @@ -34,7 +34,7 @@ public enum GuaranteeCode implements ResultCode { FROM_DESIGN_PROCESS_ERROR(false,140001,"当前节点数据不存在!"), FROM_DESIGN_NAME_NOT_NULL(false,140002,"字段名称不能为空!"), - REPEAT_BUSINESS(false,140002,"企业已申请进行中的业务,不能再次申请!"); + REPEAT_BUSINESS(false,150001,"企业存在进行中的业务,不能再次申请!"); /** * 操作是否成功 */