Browse Source

优化企业表查询

v4
chenrui 2 years ago
parent
commit
bf4420e776
  1. 10
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java
  2. 35
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

10
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<EnterpriseInformation> 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);
}

35
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<String, String> 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 {
//爬取页面统一信用代码

Loading…
Cancel
Save