From 4c19ddd36bdfb43b5ef4e8df3c9a98cd4d356d6c Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Thu, 26 May 2022 10:55:04 +0800
Subject: [PATCH] 1、资讯模糊匹配修改

---
 src/main/java/org/springblade/modules/zc/controller/ZcController.java |   71 ++++++++++++++++++++++++++---------
 1 files changed, 52 insertions(+), 19 deletions(-)

diff --git a/src/main/java/org/springblade/modules/zc/controller/ZcController.java b/src/main/java/org/springblade/modules/zc/controller/ZcController.java
index 35a9b6b..68ce16b 100644
--- a/src/main/java/org/springblade/modules/zc/controller/ZcController.java
+++ b/src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -184,6 +184,16 @@
 		return R.success("成功");
 	}
 
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/examineList")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入zc")
+	public R examineList(@Valid @RequestParam String ids,String names) {
+		zcService.updateExamine(ids,Func.toStrList(names));
+		return R.success("成功");
+	}
 
 	/**
 	 * 删除
@@ -205,37 +215,60 @@
 		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		String times = df.format(new Date());
 		zc.setZctime(times);
-		Integer userCount = iUserService.selectCount(zc.getUsername());
-		if (userCount > 0) {
-			throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户 [{}] 已存在!", zc.getUsername()));
-		}
+
+		//保留未脱敏数据
+		String names = zc.getSname();
+		String cardids = zc.getCardid();
+		String phones = zc.getPhone();
+
 		//数据脱敏处理
 		String name = DesensitizedUtil.desensitizedName(zc.getSname());
 		String cardid = DesensitizedUtil.desensitizedIdNumber(zc.getCardid());
 		String phone = DesensitizedUtil.desensitizedPhoneNumber(zc.getPhone());
 
 		//帐号默认姓+身份证后四位
-		zc.setUsername(name.substring(0,1)+cardid.substring(cardid.length()-4));
+		zc.setUsername(name.substring(0, 1) + zc.getCardid().substring(zc.getCardid().length() - 4));
+		Integer userCount = iUserService.selectCount(zc.getUsername());
+		if (userCount > 0) {
+			throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户 [{}] 已存在!", zc.getUsername()));
+		}
 
-		//内网储存完整数据
-		String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address)" +
-			"values(" + "'" + zc.getId() + "'" +
-			"," + "'" + zc.getUsername() + "'" +
-			"," + "'" + zc.getPassword() + "'" +
-			"," + "'" + zc.getSname() + "'" +
-			"," + "'" + zc.getSex() + "'" +
-			"," + "'" + zc.getPhone() + "'" +
-			"," + "'" + zc.getZctime() + "'" +
-			"," + "'" + zc.getParentId() + "'" +
-			"," + "'" + zc.getJurisdiction() + "'" +
-			"," + "'" + zc.getCardid() + "'" +
-			"," + "'" + zc.getAddress() + "'"
-			+ ")";
+
 		zc.setSname(name);
 		zc.setCardid(cardid);
 		zc.setPhone(phone);
 
 		zcService.inster(zc);
+		System.out.println("插入id++++++++++++"+zc.getId());
+		//内网储存完整数据
+		String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address)" +
+			"values(" + "'" + zc.getId() + "'" +
+			"," + "'" + zc.getUsername() + "'" +
+			"," + "'" + zc.getPassword() + "'" +
+			"," + "'" + names + "'" +
+			"," + "'" + zc.getSex() + "'" +
+			"," + "'" + phones + "'" +
+			"," + "'" + zc.getZctime() + "'" +
+			"," + "'" + zc.getParentId() + "'" +
+			"," + "'" + zc.getJurisdiction() + "'" +
+			"," + "'" + cardids + "'" +
+			"," + "'" + zc.getAddress() + "'"
+			+ ");"
+			+
+			"insert into blade_user(account,password,real_name,sex,phone,workjurisdiction,role_id,jurisdiction,cardid,address)" +
+			"values(" +
+			"'" + zc.getUsername() + "'" +
+			"," + "'" + DigestUtil.encrypt(zc.getPassword()) + "'" +
+			"," + "'" + names + "'" +
+			"," + "'" + zc.getSex() + "'" +
+			"," + "'" + phones + "'" +
+			"," + "'" + zc.getWorkjurisdiction() + "'" +
+			"," + "'" + zc.getParentId() + "'" +
+			"," + "'" + zc.getJurisdiction() + "'" +
+			"," + "'" + cardids + "'" +
+			"," + "'" + zc.getAddress() + "'"
+			+ ")";
+		System.out.println("插入语句++++++++++++"+s);
 		//同时新增到用户表
 		User user = new User();
 		user.setAccount(zc.getUsername());

--
Gitblit v1.9.3