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 |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 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 3bc4f69..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) {
@@ -328,11 +341,12 @@
 
 			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() + "'" +
-					",establishTime = " + "'" + format + "'" +
 					",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
 					",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
 					",enterprises = " + "'" + information.getEnterprises() + "'" +
@@ -343,12 +357,12 @@
 					",industry = " + "'" + information.getIndustry() + "'" +
 					",departmentid = " + "'" + information.getDepartmentid() + "'" +
 					",stats = " + "'" + information.getStats() + "'" +
-					",representativecell = " + "'" + information.getRepresentativecell() + "'" +
-					",contacts = " + "'" + information.getContacts() + "'" +
-					",contactscell = " + "'" + information.getContactscell() + "'" +
+					builder.toString() +
 					",business_License = " + "'" + businessLicenses + "'" +
 					",licence = " + "'" + licences + "'" +
 					" " + "where id = " + "'" + information.getId() + "'";
+				//同步内网
+				myAsyncService.FTP(s1);
 			}else {
 				//内网同步
 				String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
@@ -364,13 +378,11 @@
 					",industry = " + "'" + information.getIndustry() + "'" +
 					",departmentid = " + "'" + information.getDepartmentid() + "'" +
 					",stats = " + "'" + information.getStats() + "'" +
-					",representativecell = " + "'" + information.getRepresentativecell() + "'" +
-					",contacts = " + "'" + information.getContacts() + "'" +
-					",contactscell = " + "'" + information.getContactscell() + "'" +
+					builder.toString() +
 					",business_License = " + "'" + businessLicenses + "'" +
 					",licence = " + "'" + licences + "'" +
 					" " + "where id = " + "'" + information.getId() + "'";
-				//FtpUtil.sqlFileUpload(s1);
+				//同步内网
 				myAsyncService.FTP(s1);
 			}
 		}

--
Gitblit v1.9.3