From f61f487b258cf68b77ec9b9ddb0badfd94ce430b Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 21 Jun 2022 09:55:52 +0800
Subject: [PATCH] 单位信息修改
---
src/main/java/org/springblade/modules/information/controller/InformationController.java | 84 +++++++++++++++++++++++++++++-------------
1 files changed, 58 insertions(+), 26 deletions(-)
diff --git a/src/main/java/org/springblade/modules/information/controller/InformationController.java b/src/main/java/org/springblade/modules/information/controller/InformationController.java
index c0748c4..66abe8c 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -295,16 +295,29 @@
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入information")
public R update(@Valid @RequestBody Information information) throws Exception {
- Information information1 = Objects.requireNonNull(BeanUtil.copy(information, Information.class));;
+ Information information1 = Objects.requireNonNull(BeanUtil.copy(information, Information.class));
+ StringBuilder builder = new StringBuilder();
//敏感数据处理
if (null!=information1.getRepresentativecell() && !information1.getRepresentativecell().equals("")) {
information1.setRepresentativecell(DesensitizedUtil.desensitizedPhoneNumber(information1.getRepresentativecell()));
+ //如果带 * 则不修改
+ if (!information.getRepresentativecell().contains("*")){
+ builder.append(",representativecell = " + "'" + information.getRepresentativecell() + "'");
+ }
}
if (null!=information1.getContacts() && !information1.getContacts().equals("")) {
information1.setContacts(DesensitizedUtil.desensitizedName(information1.getContacts()));
+ //如果带 * 则不修改
+ if (!information.getContacts().contains("*")){
+ builder.append(",contacts = " + "'" + information.getContacts() + "'");
+ }
}
if (null!=information1.getContactscell() && !information1.getContactscell().equals("")) {
information1.setContactscell(DesensitizedUtil.desensitizedPhoneNumber(information1.getContactscell()));
+ //如果带 * 则不修改
+ if (!information.getContactscell().contains("*")){
+ builder.append(",contactscell = " + "'" + information.getContactscell() + "'");
+ }
}
boolean b = informationService.updateById(information1);
if (b) {
@@ -325,34 +338,53 @@
} else {
licences = "";
}
+
if (information.getEstablishtime() != null && !"".equals(information.getEstablishtime())) {
format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
+ builder.append(",establishTime = " + "'" + format + "'");
+
+ //内网同步
+ String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
+ ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
+ ",representative = " + "'" + information.getRepresentative() + "'" +
+ ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
+ ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
+ ",enterprises = " + "'" + information.getEnterprises() + "'" +
+ ",address = " + "'" + information.getAddress() + "'" +
+ ",business = " + "'" + information.getBusiness() + "'" +
+ ",region = " + "'" + information.getRegion() + "'" +
+ ",registration = " + "'" + information.getRegistration() + "'" +
+ ",industry = " + "'" + information.getIndustry() + "'" +
+ ",departmentid = " + "'" + information.getDepartmentid() + "'" +
+ ",stats = " + "'" + information.getStats() + "'" +
+ builder.toString() +
+ ",business_License = " + "'" + businessLicenses + "'" +
+ ",licence = " + "'" + licences + "'" +
+ " " + "where id = " + "'" + information.getId() + "'";
+ //同步内网
+ myAsyncService.FTP(s1);
+ }else {
+ //内网同步
+ String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
+ ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
+ ",representative = " + "'" + information.getRepresentative() + "'" +
+ ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
+ ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
+ ",enterprises = " + "'" + information.getEnterprises() + "'" +
+ ",address = " + "'" + information.getAddress() + "'" +
+ ",business = " + "'" + information.getBusiness() + "'" +
+ ",region = " + "'" + information.getRegion() + "'" +
+ ",registration = " + "'" + information.getRegistration() + "'" +
+ ",industry = " + "'" + information.getIndustry() + "'" +
+ ",departmentid = " + "'" + information.getDepartmentid() + "'" +
+ ",stats = " + "'" + information.getStats() + "'" +
+ builder.toString() +
+ ",business_License = " + "'" + businessLicenses + "'" +
+ ",licence = " + "'" + licences + "'" +
+ " " + "where id = " + "'" + information.getId() + "'";
+ //同步内网
+ myAsyncService.FTP(s1);
}
-
-
- //内网同步
- String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
- ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
- ",representative = " + "'" + information.getRepresentative() + "'" +
- ",establishTime = " + "'" + format + "'" +
- ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
- ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
- ",enterprises = " + "'" + information.getEnterprises() + "'" +
- ",address = " + "'" + information.getAddress() + "'" +
- ",business = " + "'" + information.getBusiness() + "'" +
- ",region = " + "'" + information.getRegion() + "'" +
- ",registration = " + "'" + information.getRegistration() + "'" +
- ",industry = " + "'" + information.getIndustry() + "'" +
- ",departmentid = " + "'" + information.getDepartmentid() + "'" +
- ",stats = " + "'" + information.getStats() + "'" +
- ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
- ",contacts = " + "'" + information.getContacts() + "'" +
- ",contactscell = " + "'" + information.getContactscell() + "'" +
- ",business_License = " + "'" + businessLicenses + "'" +
- ",licence = " + "'" + licences + "'" +
- " " + "where id = " + "'" + information.getId() + "'";
- //FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
}
return R.success("修改成功");
}
--
Gitblit v1.9.3