From 7affa3a5e568970840f3d8c0b7292239851e8164 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 29 May 2024 10:14:05 +0800 Subject: [PATCH] '123' --- ABAP_AS_WITH_POOL.jcoDestination | 2 +- .../customer/CustomerController.java | 57 +++++++++++++++---- .../ruoyi/web/utils/rbExcel/excelUtil.java | 8 +-- ruoyi-admin/src/main/resources/common.yml | 1 + .../com/ruoyi/customer/domain/Customer.java | 16 ++++++ .../domain/qcc/QccVerifyJsonResult.java | 22 +++++++ .../com/ruoyi/customer/domain/qcc/Verify.java | 18 ++++++ .../customer/domain/qcc/VerifyResultData.java | 31 ++++++++++ .../src/views/customer/customer/index.vue | 51 +++++++++++------ ruoyi-ui/src/views/redBook/quots.vue | 2 +- 10 files changed, 174 insertions(+), 34 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/QccVerifyJsonResult.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/Verify.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/VerifyResultData.java diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index e024929..4b51fa0 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Mon May 27 16:27:32 CST 2024 +#Wed May 29 10:07:47 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.120 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java index 4599e5a..2bceeff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/customer/CustomerController.java @@ -15,10 +15,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.customer.domain.RfcResult; -import com.ruoyi.customer.domain.qcc.ECIIndustryVerify; -import com.ruoyi.customer.domain.qcc.FuzzySearch; -import com.ruoyi.customer.domain.qcc.QccECIIndustryVerifyJsonResult; -import com.ruoyi.customer.domain.qcc.QccFuzzySearchJsonResult; +import com.ruoyi.customer.domain.qcc.*; import com.ruoyi.quot.domain.Quot; import com.ruoyi.system.domain.SysNotice; import com.ruoyi.system.service.ISysConfigService; @@ -73,11 +70,15 @@ public class CustomerController extends BaseController private String Qcc_SecretKey; // 接口请求地址 @Value("${qichacha.serviceName}") - private String Qcc_serviceName; + private String Qcc_serviceName; // 企查查 客户数据接口 // 接口请求地址 @Value("${qichacha.serviceNameGetInfo}") - private String Qcc_serviceName_GetInfo; + private String Qcc_serviceName_GetInfo; // 企查查 客户行业代码数据接口 + + // 接口请求地址 + @Value("${qichacha.serviceNameVerifyInfo}") + private String Qcc_serviceName_VerifyInfo; // 企查查 客户注册资本RegistCapi、人员规模PersonScope、参保人数InsuredCount @Autowired private ICustomerService customerService; @@ -222,27 +223,63 @@ public class CustomerController extends BaseController public AjaxResult commitSAPCustomer(@RequestBody Customer customer) { - if("1".equals(customer.getCusApprovalStatus())){// 数据组 提交业务员创建的客户数据提交SAP + if(StringUtils.isNotEmpty(customer.getCusId())){// 数据组 提交业务员创建的客户数据提交SAP customer.setUpdateBy(getUsername()); customer.setCusApprovalStatus("2");//客户提交 状态设置为 已审核 - }else if(StringUtils.isEmpty(customer.getCusApprovalStatus())){// 数据组创建的客户数据提交SAP + }else{// 数据组创建的客户数据提交SAP customer.setCusId(UUID.fastUUID().toString()); customer.setCusCode(IdUtils.createNo("KH_",2)); customer.setCreateBy(getUsername()); customer.setCusApprovalStatus("2");//客户提交 状态设置为 已审核 - customerService.insertCustomer(customer); } + + // 获取企查查 客户注册资本RegistCapi、人员规模PersonScope、参保人数InsuredCount + QccVerifyJsonResult verifyInfo = getQccVerifyInfo(customer.getCusVatNo()); + if("200".equals(verifyInfo)){ + if("1".equals(verifyInfo.getResult().getVerifyResult())){//存在数据 + customer.setCusRegistCapiQcc(verifyInfo.getResult().getData().getRegistCapi()); + customer.setCusPersonScopeQcc(verifyInfo.getResult().getData().getPersonScope()); + customer.setCusInsuredCountQcc(verifyInfo.getResult().getData().getInsuredCount()); + } + } + RfcResult result = SapRfcUtils.sendSAP(customer); String type = result.getType(); if("S".equals(type)){ customer.setCusSapCode(result.getPartner()); - customerService.updateCustomer(customer); + if(StringUtils.isNotEmpty(customer.getCusId())) {// 数据组 提交业务员创建的客户数据提交SAP + customerService.updateCustomer(customer); + }else{ + customerService.insertCustomer(customer); + } }else{ return error(result.getMessage()); } return success(result.getMessage()); } + // 获取企查查 客户注册资本RegistCapi、人员规模PersonScope、参保人数InsuredCount + public QccVerifyJsonResult getQccVerifyInfo(String cusVatNo) + { + QccVerifyJsonResult result = new QccVerifyJsonResult(); + String reqInterNme = Qcc_serviceName_VerifyInfo; + try { + if(!StringUtils.isEmpty(cusVatNo)){ + HttpHead reqHeader = new HttpHead(); + String[] autherHeader = QiChaChaUtil.RandomAuthentHeader(Qcc_Key, Qcc_SecretKey); + reqHeader.setHeader("Token", autherHeader[0]); + reqHeader.setHeader("Timespan", autherHeader[1]); + String reqUri = reqInterNme.concat("?key=").concat(Qcc_Key).concat("&").concat("searchKey=").concat(cusVatNo); + String tokenJson = HttpHelper.httpGet(reqUri, reqHeader.getAllHeaders()); + System.out.println(String.format("==========================>this is response:{%s}", tokenJson)); + result = JSON.parseObject(tokenJson, QccVerifyJsonResult.class); + } + } catch (Exception e1) { + e1.printStackTrace(); + } + return result; + } + /** * 发送信息-数据组审核 * @param customer diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/utils/rbExcel/excelUtil.java b/ruoyi-admin/src/main/java/com/ruoyi/web/utils/rbExcel/excelUtil.java index 9f10a16..ba1417d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/utils/rbExcel/excelUtil.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/utils/rbExcel/excelUtil.java @@ -287,7 +287,7 @@ public class excelUtil { wsheet.addCell(label); InputStream fileInputStream = new ClassPathResource("/jnlogo.png").getInputStream(); - File file = new File("logon/"+IdUtils.createNo("jnlogo",3)+".png"); // 指定输出文件路径 + File file = new File("logon/"+IdUtils.createNo("jnlogo_",3)+".png"); // 指定输出文件路径 //转换 FileUtils.copyInputStreamToFile(fileInputStream, file); @@ -296,7 +296,7 @@ public class excelUtil { wsheet.addImage(image); InputStream fileInputStream2 = new ClassPathResource("/wc.png").getInputStream(); - File file2 = new File("logon/"+IdUtils.createNo("wc",3)+".png"); // 指定输出文件路径 + File file2 = new File("logon/"+IdUtils.createNo("wc_",3)+".png"); // 指定输出文件路径 //转换 FileUtils.copyInputStreamToFile(fileInputStream2, file2); @@ -595,7 +595,7 @@ public class excelUtil { wsheet.addCell(label); InputStream fileInputStream = new ClassPathResource("/jnlogo.png").getInputStream(); - File file = new File("logon/"+IdUtils.createNo("jnlogo",3)+".png"); // 指定输出文件路径 + File file = new File("logon/"+IdUtils.createNo("jnlogo_",3)+".png"); // 指定输出文件路径 //转换 FileUtils.copyInputStreamToFile(fileInputStream, file); @@ -604,7 +604,7 @@ public class excelUtil { wsheet.addImage(image); InputStream fileInputStream2 = new ClassPathResource("/wc.png").getInputStream(); - File file2 = new File("logon/"+IdUtils.createNo("wc",3)+".png"); // 指定输出文件路径 + File file2 = new File("logon/"+IdUtils.createNo("wc_",3)+".png"); // 指定输出文件路径 //转换 FileUtils.copyInputStreamToFile(fileInputStream2, file2); diff --git a/ruoyi-admin/src/main/resources/common.yml b/ruoyi-admin/src/main/resources/common.yml index f7a7dbb..4211aa9 100644 --- a/ruoyi-admin/src/main/resources/common.yml +++ b/ruoyi-admin/src/main/resources/common.yml @@ -14,6 +14,7 @@ qichacha.key: 824936f8e78c4f4788978da38b26d488 qichacha.secretKey: 8B9EB102FD17E0CF2EDEC0FB507DEC1E qichacha.serviceName: https://api.qichacha.com/FuzzySearch/GetList qichacha.serviceNameGetInfo: https://api.qichacha.com/ECIIndustryVerify/GetInfo +qichacha.serviceNameVerifyInfo: https://api.qichacha.com/EnterpriseInfo/Verify # SAP-RFC函数 sapRfc.ashost: 172.19.0.125 #服务器 diff --git a/ruoyi-system/src/main/java/com/ruoyi/customer/domain/Customer.java b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/Customer.java index ccda9f1..bac3d5d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/customer/domain/Customer.java +++ b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/Customer.java @@ -54,6 +54,13 @@ public class Customer extends BaseEntity /** 企查查行业代码 */ private String cusIndustryCodeQcc; + /** 企查查注册资本 */ + private String cusRegistCapiQcc; + /** 企查查人员规模 */ + private String cusPersonScopeQcc; + /** 企查查参保人数 */ + private String cusInsuredCountQcc; + /** 客户组类别 */ @Excel(name = "客户组类别",dictType = "cus_group") private String cusGroup; @@ -198,6 +205,15 @@ public class Customer extends BaseEntity public String getCusIndustryCodeQcc() { return cusIndustryCodeQcc; } public void setCusIndustryCodeQcc(String cusIndustryCodeQcc) { this.cusIndustryCodeQcc = cusIndustryCodeQcc; } + public String getCusRegistCapiQcc() { return cusRegistCapiQcc; } + + public void setCusRegistCapiQcc(String cusRegistCapiQcc) { this.cusRegistCapiQcc = cusRegistCapiQcc; } + public String getCusPersonScopeQcc() { return cusPersonScopeQcc; } + + public void setCusPersonScopeQcc(String cusPersonScopeQcc) { this.cusPersonScopeQcc = cusPersonScopeQcc; } + public String getCusInsuredCountQcc() { return cusInsuredCountQcc; } + + public void setCusInsuredCountQcc(String cusInsuredCountQcc) { this.cusInsuredCountQcc = cusInsuredCountQcc; } public void setCusGroup(String cusGroup) { this.cusGroup = cusGroup; diff --git a/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/QccVerifyJsonResult.java b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/QccVerifyJsonResult.java new file mode 100644 index 0000000..872e352 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/QccVerifyJsonResult.java @@ -0,0 +1,22 @@ +package com.ruoyi.customer.domain.qcc; + +public class QccVerifyJsonResult { + private String Status; + private Verify Result; + + public String getStatus() { + return Status; + } + + public void setStatus(String status) { + Status = status; + } + + public Verify getResult() { + return Result; + } + + public void setResult(Verify result) { + Result = result; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/Verify.java b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/Verify.java new file mode 100644 index 0000000..6a8dba7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/Verify.java @@ -0,0 +1,18 @@ +package com.ruoyi.customer.domain.qcc; + +public class Verify { + private String VerifyResult; + private VerifyResultData Data; + + public String getVerifyResult() { + return VerifyResult; + } + + public void setVerifyResult(String verifyResult) { + VerifyResult = verifyResult; + } + + public VerifyResultData getData() { return Data; } + + public void setData(VerifyResultData data) { Data = data; } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/VerifyResultData.java b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/VerifyResultData.java new file mode 100644 index 0000000..0c44f46 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/customer/domain/qcc/VerifyResultData.java @@ -0,0 +1,31 @@ +package com.ruoyi.customer.domain.qcc; + +public class VerifyResultData { + private String RegistCapi; + private String PersonScope; + private String InsuredCount; + + public String getRegistCapi() { + return RegistCapi; + } + + public void setRegistCapi(String registCapi) { + RegistCapi = registCapi; + } + + public String getPersonScope() { + return PersonScope; + } + + public void setPersonScope(String personScope) { + PersonScope = personScope; + } + + public String getInsuredCount() { + return InsuredCount; + } + + public void setInsuredCount(String insuredCount) { + InsuredCount = insuredCount; + } +} diff --git a/ruoyi-ui/src/views/customer/customer/index.vue b/ruoyi-ui/src/views/customer/customer/index.vue index dca6d3a..96df81d 100644 --- a/ruoyi-ui/src/views/customer/customer/index.vue +++ b/ruoyi-ui/src/views/customer/customer/index.vue @@ -25,7 +25,7 @@ @keyup.enter.native="handleQuery" /> - + - + - - + +