From 49c5471cc12d7ec57db3cad6964b7e4f61d472f2 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 06 May 2022 09:31:26 +0800
Subject: [PATCH] 枪支,考试成绩,保安员证编号生成,单位信息基本信息,许可证信息,主要管理人,出资人信息,社保记录信息新增导入敏感数据处理

---
 src/main/java/org/springblade/modules/licence/controller/LicencePaperController.java |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/licence/controller/LicencePaperController.java b/src/main/java/org/springblade/modules/licence/controller/LicencePaperController.java
index 28b2dac..274ca51 100644
--- a/src/main/java/org/springblade/modules/licence/controller/LicencePaperController.java
+++ b/src/main/java/org/springblade/modules/licence/controller/LicencePaperController.java
@@ -3,14 +3,17 @@
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.common.utils.DesensitizedUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.licence.entity.LicencePaper;
 import org.springblade.modules.licence.service.LicencePaperService;
 import org.springblade.modules.licence.vo.LicencePaperVo;
+import org.springblade.modules.system.service.MyAsyncService;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
@@ -25,6 +28,8 @@
 public class LicencePaperController {
 
 	private final LicencePaperService licencePaperService;
+
+	private final MyAsyncService myAsyncService;
 
 
 //	/**
@@ -64,13 +69,64 @@
 	 */
 	@PostMapping("/submit")
 	public R submit(@RequestBody LicencePaper licencePaper){
+		LicencePaper licencePaper1 = licencePaper;
+		//脱敏处理
+		if (null!= licencePaper.getApprovalNumber() && !licencePaper.getApprovalNumber().equals("")){
+			licencePaper.setApprovalNumber(DesensitizedUtil.desensitizedSecurityNumber(licencePaper.getApprovalNumber()));
+		}
+		if (null!= licencePaper.getLicenceIssuingUnit() && !licencePaper.getLicenceIssuingUnit().equals("")){
+			licencePaper.setLicenceIssuingUnit(DesensitizedUtil.desensitizedSecurityNumber(licencePaper.getLicenceIssuingUnit()));
+		}
+		if (null!= licencePaper.getRegisterCapital() && !licencePaper.getRegisterCapital().equals("")){
+			licencePaper.setRegisterCapital("**");
+		}
+		if (null!= licencePaper.getCode() && !licencePaper.getCode().equals("")){
+			licencePaper.setCode(DesensitizedUtil.desensitizedSecurityNumber(licencePaper.getCode()));
+		}
 		if (null==licencePaper.getId()){
 			licencePaper.setCreateTime(new Date());
 			licencePaper.setUpdateTime(new Date());
 			licencePaperService.save(licencePaper);
+			//内网同步
+			String s = "insert into sys_licence_paper(" +
+				"id,type,unit_name,address,legal_people,content,approval_number,licence_issuing_unit,register_capital,code," +
+				"licence_issuing_time,create_user,create_time,update_time,dept_id,url) " +
+				"values(" + "'" + licencePaper.getId() + "'" + "," +
+				"'" + licencePaper1.getType() + "'" + "," +
+				"'" + licencePaper1.getUnitName() + "'" + "," +
+				"'" + licencePaper1.getLegalPeople() + "'" + "," +
+				"'" + licencePaper1.getContent() + "'" + "," +
+				"'" + licencePaper1.getApprovalNumber() + "'" + "," +
+				"'" + licencePaper1.getLicenceIssuingUnit() + "'" + "," +
+				"'" + licencePaper1.getRegisterCapital() + "'" + "," +
+				"'" + licencePaper1.getCode() + "'" + "," +
+				"'" + new SimpleDateFormat("yyyy-MM-dd").format(licencePaper1.getLicenceIssuingTime()) + "'" + "," +
+				"'" + licencePaper1.getCreateUser() + "'" + "," +
+				"," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(licencePaper1.getCreateTime()) + "'" +
+				"," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(licencePaper1.getUpdateTime()) + "'" +
+				"," + "'" + licencePaper1.getDeptId() + "'" +
+				"," + "'" + licencePaper1.getUrl() + "'"
+				+ ")";
+			myAsyncService.FTP(s);
 		}else {
 			licencePaper.setUpdateTime(new Date());
 			licencePaperService.updateById(licencePaper);
+			//内网同步
+			String s1 =
+				"update sys_licence_paper set unit_name = " + "'" + licencePaper1.getUnitName() + "'"
+					+ ",address = " + "'" + licencePaper1.getAddress() + "'"
+					+ ",legal_people = " + "'" + licencePaper1.getLegalPeople() + "'"
+					+ ",content = " + "'" + licencePaper1.getContent() + "'"
+					+ ",approval_number = " + "'" + licencePaper1.getApprovalNumber() + "'"
+					+ ",licence_issuing_unit = " + "'" + licencePaper1.getLicenceIssuingUnit() + "'"
+					+ ",register_capital = " + "'" + licencePaper1.getRegisterCapital() + "'"
+					+ ",code = " + "'" + licencePaper1.getCode() + "'"
+					+ ",licence_issuing_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(licencePaper1.getLicenceIssuingTime())  + "'"
+					+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(licencePaper1.getUpdateTime()) + "'"
+					+ ",dept_id = " + "'" + licencePaper1.getDeptId() + "'"
+					+ ",url = " + "'" + licencePaper1.getUrl() + "'"
+					+ " " + "where id = " + "'" + licencePaper1.getId() + "'";
+			myAsyncService.FTP(s1);
 		}
 		return R.data(licencePaper);
 	}

--
Gitblit v1.9.3