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/equipage/controller/GunController.java | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/springblade/modules/equipage/controller/GunController.java b/src/main/java/org/springblade/modules/equipage/controller/GunController.java
index 0789210..b21bdd5 100644
--- a/src/main/java/org/springblade/modules/equipage/controller/GunController.java
+++ b/src/main/java/org/springblade/modules/equipage/controller/GunController.java
@@ -86,15 +86,33 @@
@PostMapping("/submit")
public R submit(@RequestBody Gun gun) {
boolean status = false;
+ //脱敏处理
+ Gun gun1 = gun;
+ gun1.setCardNumber("***");
+ gun1.setIssueTime(null);
+ gun1.setValidTime(null);
+ if (null!=gun1.getIssueUnit() && !gun1.getIssueUnit().equals("")){
+ gun1.setIssueUnit("***");
+ }
+ if (null!=gun1.getGunMode() && !gun1.getGunMode().equals("")){
+ gun1.setGunMode("***");
+ }
+ if (null!=gun1.getPersonInCharge() && !gun1.getPersonInCharge().equals("")){
+ gun1.setPersonInCharge("***");
+ }
+ if (null!=gun1.getCardNo() && !gun1.getCardNo().equals("")){
+ gun1.setCardNo("***");
+ }
+ gun1.setValidTime(null);
if (null == gun.getId()) {
//新增
- status = gunService.save(gun);
+ status = gunService.save(gun1);
if (status) {
//数据同步
String s1 =
"insert into sys_gun(id,issue_unit,card_number,gun_mode," +
"dept_id,person_in_charge,issue_time,valid_time,jurisdiction,card_no) " +
- "values(" + "'" + gun.getId() + "'" + "," +
+ "values(" + "'" + gun1.getId() + "'" + "," +
"'" + gun.getIssueUnit() + "'" + "," +
"'" + gun.getCardNumber() + "'" + "," +
"'" + gun.getGunMode() + "'" + "," +
@@ -104,12 +122,11 @@
"'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" + "," +
"'" + gun.getCardNo() + "'" + "," +
"'" + gun.getJurisdiction() + "'" + ")";
- //FtpUtil.sqlFileUpload(s1);
myAsyncService.FTP(s1);
}
} else {
//修改
- status = gunService.updateById(gun);
+ status = gunService.updateById(gun1);
if (status) {
//内网同步
String s1 =
@@ -123,7 +140,6 @@
",jurisdiction = " + "'" + gun.getJurisdiction() + "'" +
",card_no = " + "'" + gun.getCardNo() + "'" +
" " + "where id = " + "'" + gun.getId() + "'";
- //FtpUtil.sqlFileUpload(s1);
myAsyncService.FTP(s1);
}
}
--
Gitblit v1.9.3