From bf4420e776df4673b00c5765d6a5fe37c61cd676 Mon Sep 17 00:00:00 2001 From: chenrui <1950717904@qq.com> Date: Thu, 28 Nov 2024 20:45:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=81=E4=B8=9A=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppEnterpriseInformationController.java | 10 +++--- .../EnterpriseInformationServiceImpl.java | 35 +++++++++++++++---- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java index d6b2d8ae..a6ce037a 100644 --- a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java +++ b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java @@ -179,11 +179,11 @@ public class AppEnterpriseInformationController extends BaseController //查询企业二维码信息 QrCodeGenerateHistory qrCodeGenerateHistory = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseNumber); //查询企业信息 - EnterpriseInformation enterpriseInformation = new EnterpriseInformation(); - enterpriseInformation.setEnterpriseNumber(enterpriseNumber); - List enterpriseInformations = enterpriseInformationService.selectEnterpriseInformationList(enterpriseInformation); - if(enterpriseInformations.size() > 0){ - qrCodeGenerateHistory.setEnterpriseName(enterpriseInformations.get(0).getEnterpriseName()); + EnterpriseInformation enterpriseInformation = + enterpriseInformationService.selectEnterpriseInformationByNum(enterpriseNumber); + if(BeanUtil.isNotEmpty(enterpriseInformation) && + StrUtil.isNotEmpty(enterpriseInformation.getEnterpriseNumber())){ + qrCodeGenerateHistory.setEnterpriseName(enterpriseInformation.getEnterpriseName()); } return ZDResponse.success("查询成功",qrCodeGenerateHistory); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java index 6fe44e2c..66509f0f 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java @@ -265,6 +265,9 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS if (enterpriseInformations.size() == 0) { return 0; } + //生成企业统一信用代码盐 + String salt = PasswordTools.encrypt(enterpriseInformation.getEnterpriseNumber()); + //查询最新的二维码数据 QrCodeGenerateHistory qrCodeGenerateHistory1 = iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseInformation.getEnterpriseNumber()); @@ -281,8 +284,13 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS log.error("二维码生成时间不足24小时"); return 0; } - // TODO 企业添加成功,生成企业二维码 - String text = ""; + // 企业添加成功,生成企业二维码 + String uuid = IdUtil.simpleUUID(); + Map jsonMap = new HashMap<>(); + jsonMap.put("salt", salt); + jsonMap.put("codeId", uuid); + jsonMap.put("type", "zfjd"); + String text = JSON.toJSONString(jsonMap); //这里设置自定义网站url String logoPath = qrCodeUrl; String upload = null; @@ -297,7 +305,6 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS qrCodeGenerateHistory1.setStatus(1); iQrCodeGenerateHistoryService.updateQrCodeGenerateHistory(qrCodeGenerateHistory1); //重新生成二维码 - String uuid = IdUtil.simpleUUID(); QrCodeGenerateHistory qrCodeGenerateHistory = new QrCodeGenerateHistory(); qrCodeGenerateHistory.setId(uuid); //生成时间 @@ -309,8 +316,6 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS //变更原因 qrCodeGenerateHistory.setReasonsChange("登记"); int i = iQrCodeGenerateHistoryService.insertQrCodeGenerateHistory(qrCodeGenerateHistory); - //TODO 调用同步接口 同步企业工商信息 - return i; } @@ -442,7 +447,7 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS //默认ID enterpriseInformation.setId(IdUtil.simpleUUID()); //企业表中新增 - int i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation); + int i = this.insertEnterpriseInformation(enterpriseInformation); if(i > 0){ log.info("企业信息表中新增成功,新增企业:{}", JSONObject.toJSONString(enterpriseInformation)); }else{ @@ -450,6 +455,24 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS } } } + //查询企业监督码 + if(BeanUtil.isNotEmpty(enterpriseInformation) && + StringUtils.isNotEmpty(enterpriseInformation.getEnterpriseNumber())){ + QrCodeGenerateHistory qrCodeGenerateHistory = + iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseInformation.getEnterpriseNumber()); + if(BeanUtil.isNotEmpty(qrCodeGenerateHistory) && + StringUtils.isNotEmpty(qrCodeGenerateHistory.getQrCodeUrl())){ + enterpriseInformation.setQrCodeGenerateHistory(qrCodeGenerateHistory); + }else{ + //生成企业监督码 + this.generateQrCode(enterpriseInformation.getEnterpriseNumber()); + //查询企业二维码 + QrCodeGenerateHistory qrCodeGenerateHistory1 = + iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryByNewest(enterpriseInformation.getEnterpriseNumber()); + enterpriseInformation.setQrCodeGenerateHistory(qrCodeGenerateHistory1); + } + } + return enterpriseInformation; }else { //爬取页面统一信用代码