From d855dcc6aca702880467435d51e55d7540298d07 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Mon, 29 Mar 2021 15:47:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8B=85=E4=BF=9D=E5=87=BD=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E5=86=8D=E5=90=8C=E6=84=8F=E7=8A=B6=E6=80=81=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DgGuaranteeLetterAssignUserServiceImpl.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java index 691ded26..3e0140fb 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java @@ -424,12 +424,27 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl paymentConfirmationConsiderQueryWrapper = new QueryWrapper<>(); paymentConfirmationConsiderQueryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.CWB_ID); DgPaymentConfirmationConsider paymentConfirmationConsider = paymentConfirmationConsiderMapper.selectOne(paymentConfirmationConsiderQueryWrapper); paymentConfirmationConsider.setStatus(StatusCode.SP_IN_REVIEW); paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_ON_HAND); + + //法规部数据存在,更新法规部经理财务回款数据 + QueryWrapper paymentConfirmationConsiderFG = new QueryWrapper<>(); + paymentConfirmationConsiderFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); + DgPaymentConfirmationConsider paymentConfirmationConsiderFg = paymentConfirmationConsiderMapper.selectOne(paymentConfirmationConsiderFG); + //数据存在,进行更新 + if (ObjectUtil.isNotNull(paymentConfirmationConsiderFg)){ + paymentConfirmationConsiderFg.setStatus(StatusCode.SP_IN_REVIEW); + paymentConfirmationConsiderFg.setOperatingStatus(StatusCode.CZ_ON_HAND); + //清空上次的审批意见及银行回单 + paymentConfirmationConsiderFg.setAuditOpinion(""); + paymentConfirmationConsiderFg.setImgFile(""); + paymentConfirmationConsiderMapper.updateById(paymentConfirmationConsiderFg); + } + //清空上次的审批意见及银行回单 paymentConfirmationConsider.setAuditOpinion(""); paymentConfirmationConsider.setImgFile(""); From 22ae6c453955f85566e8c4899cd54e970fb93e45 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Mon, 29 Mar 2021 16:13:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E4=BF=AE=E6=94=B9=E8=AE=A4=E8=AF=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=B6=E6=96=B0=E5=A2=9E=E5=85=B3=E8=81=94=E4=BA=BA=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial/crms/dao/CustomerAppletDao.java | 2 ++ .../financial/crms/dao/CustomerDao.java | 2 ++ .../impl/CustomerAppletServiceImpl.java | 35 ++++++++++--------- .../service/impl/CustomerServiceImpl.java | 33 +++++++++++------ .../mapper/crms/CustomerAppletDao.xml | 5 +++ .../resources/mapper/crms/CustomerDao.xml | 8 +++++ .../response/AlCollectionListResponse.java | 6 ++-- .../model/response/AlCollectionResponse.java | 6 ++-- .../domain/crms/ext/CustomerCompanyVO.java | 6 ++-- 9 files changed, 68 insertions(+), 35 deletions(-) diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java index bd6adbf7..21cc17ed 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java @@ -29,6 +29,8 @@ public interface CustomerAppletDao extends BaseMapper { Boolean updateCustomer(@Param("customer") CustomerEntity customerEntity); + Long getCompanyIdByCustomerId(Long customerId); + Integer getCompanyId(Integer customerId); IPage getApplicationRecord(Page page, @Param("companyId")Integer companyId, @Param("status")Integer status); diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java index 631968ba..79bc6040 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerDao.java @@ -36,6 +36,8 @@ public interface CustomerDao extends BaseMapper { List listCustomerId(); + List listCompanyCustomerIds(); + List queryCompanyCodeAndName(int type); String getCodeByType(Integer type); diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java index 6dd29159..1963e266 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java @@ -291,25 +291,28 @@ public class CustomerAppletServiceImpl extends ServiceImpl() .eq("customer_id", companyCustomerEntity.getCustomerId())); + // 添加关联人 + Long companyId = this.getBaseMapper().getCompanyIdByCustomerId((long)customerId); + if (null != companyId) { + companyCustomerEntity.setId(companyId); + //根据企业id删除关联关系 + crmsCustomerRelatedMapper.delete(new QueryWrapper().eq("customer_id", companyCustomerEntity.getId())); - //根据企业id删除关联关系 - crmsCustomerRelatedMapper.delete(new QueryWrapper().eq("customer_id", companyCustomerEntity.getId())); - - //绑定关联关系 - List relatedList = new ArrayList<>(); - List intList = companyAppletRequest.getRelatedId(); + //绑定关联关系 + List relatedList = new ArrayList<>(); + List intList = companyAppletRequest.getRelatedId(); - for (int i = 0; i < intList.size(); i++) { - CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); - Integer integer = intList.get(i); - crmsCustomerRelated.setCustomerId(companyCustomerEntity.getId().intValue());//企业id - crmsCustomerRelated.setRelatedId(integer);//关联人/企业id - relatedList.add(crmsCustomerRelated); - } - if (relatedList.size() > 0) { - crmsCustomerRelatedService.insertCustomerRelated(relatedList); + for (int i = 0; i < intList.size(); i++) { + CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); + Integer integer = intList.get(i); + crmsCustomerRelated.setCustomerId(companyCustomerEntity.getId().intValue());//企业id + crmsCustomerRelated.setRelatedId(integer);//关联人/企业id + relatedList.add(crmsCustomerRelated); + } + if (relatedList.size() > 0) { + crmsCustomerRelatedService.insertCustomerRelated(relatedList); + } } - if (customer && company > 0) { return true; } 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 4d1178f3..46e828bb 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 @@ -77,7 +77,7 @@ public class CustomerServiceImpl extends ServiceImpl companyList = new ArrayList<>(); - List personalList = new ArrayList<>(); + /*List personalList = new ArrayList<>(); List longList = customerDao.listCustomerId(); if (longList != null) { for (Long id : longList) { @@ -350,6 +350,17 @@ public class CustomerServiceImpl extends ServiceImpl longList = customerDao.listCompanyCustomerIds(); + if (null != longList) { + for (Long id : longList) { + ResponseResult responseResult = this.getCustomerById(id); + if (null != responseResult) { + companyList.add((CustomerCompanyVO) responseResult.getData()); + } + } + } + ExcelUtil.writeExcelWithSheets(response, companyList,"客户资源信息一览表","企业类型", new CustomerCompanyVO()) .finish(); } catch (Exception e) { ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); @@ -363,9 +374,11 @@ public class CustomerServiceImpl extends ServiceImpl companyTemplates = new ArrayList<>(); - List personalTemplates = new ArrayList<>(); + /*List personalTemplates = new ArrayList<>(); ExcelUtil.writeExcelWithSheets(response, personalTemplates, "客户资源信息表模板", "个人类型", new PersonalTemplate()) .write(companyTemplates, "企业类型", new CompanyTemplate()) + .finish();*/ + ExcelUtil.writeExcelWithSheets(response, companyTemplates,"客户资源信息表模板","企业类型", new CompanyTemplate()) .finish(); } catch (Exception e) { ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORTTEMPLATE_EXSIT); @@ -385,17 +398,17 @@ public class CustomerServiceImpl extends ServiceImpl personalList = ExcelUtil.readExcel(excel, new PersonalTemplate(), 1); - List companyList = ExcelUtil.readExcel(excel, new CompanyTemplate(), 2); - /*List nameList = hrmsFeignService.listEmployeeName().getData();*/ + List companyList = ExcelUtil.readExcel(excel, new CompanyTemplate(), 1); + /*List personalList = ExcelUtil.readExcel(excel, new PersonalTemplate(), 1); + List nameList = hrmsFeignService.listEmployeeName().getData(); CustomerPersonalTOI customerPersonalTOI; - /*ManagerName manager; // 客户名称*/ + ManagerName manager; // 客户名称 // 个人类型 for (Object personal : personalList) { customerPersonalTOI = new CustomerPersonalTOI(); customerPersonalTOI.setType(0); BeanUtils.copyProperties(personal, customerPersonalTOI); - /*manager = new ManagerName(); + manager = new ManagerName(); BeanUtils.copyProperties(personal, manager); // 根据客户经理名称找到对应的员工id if (nameList != null && manager.getManager() != null) { @@ -407,9 +420,9 @@ public class CustomerServiceImpl extends ServiceImpl().FAIL("导入数据失败,员工" + manager.getManager() + "不存在"); } - }*/ + } this.saveCustomerPersonal(customerPersonalTOI); - } + }*/ // 企业类型 for (Object company : companyList) { CompanyCustomerRequest companyCustomerRequest = new CompanyCustomerRequest(); diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml index a2196242..321e4a6f 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml @@ -30,6 +30,11 @@ WHERE id = #{customer.id} + + + + + +