From 7069c80e28f86bca44bcd060b865f8e719ad634e Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Tue, 21 Feb 2023 14:41:04 +0800
Subject: [PATCH] 数据同步配置修改
---
src/main/java/org/springblade/modules/system/controller/UserController.java | 61 ++++++++++++++++--------------
1 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/src/main/java/org/springblade/modules/system/controller/UserController.java b/src/main/java/org/springblade/modules/system/controller/UserController.java
index 8537b0b..d5a67bd 100644
--- a/src/main/java/org/springblade/modules/system/controller/UserController.java
+++ b/src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -212,7 +212,9 @@
@ApiOperation(value = "列表", notes = "传入account和realName")
//@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
+ System.out.println("在线更新代码.... ");
IPage<UserVO> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
+ System.out.println("=================在线更新代码==================");
return R.data(pages);
}
@@ -274,7 +276,7 @@
"," + "'" + user.getIsDeleted() + "'" +
"," + "'" + user.getJurisdiction() + "'"
+ ")";
- myAsyncService.FTP(s);
+ myAsyncService.dataSync(s);
}
} else {
//修改
@@ -295,7 +297,7 @@
+ ",cardid = " + "'" + user.getCardid() + "'"
+ ",guncode = " + "'" + user.getGuncode() + "'"
+ " " + "where id = " + "'" + user.getId() + "'";
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
}
@@ -373,7 +375,7 @@
"update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'"
+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
+ " " + "where id = " + "'" + dispatcher1.getId() + "'";
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
});
}
@@ -398,7 +400,7 @@
"update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
+ " " + "where id = " + "'" + experience1.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
} else {
//新增
if (null != user.getRtime()) {
@@ -427,7 +429,7 @@
"," + "'" + experience.getCompanyname() + "'" +
"," + "'" + experience.getSecurityid() + "'"
+ ")";
- myAsyncService.FTP(s);
+ myAsyncService.dataSync(s);
}
}
@@ -438,10 +440,10 @@
//内网更新
String s1 =
"update blade_user set status = " + "'" + user.getStatus() + "'"
+ + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
+ " " + "where id = " + "'" + user.getId() + "'";
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
-
return R.success("修改成功");
}
}
@@ -526,7 +528,7 @@
+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
+ " " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
} else {
rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
String s1 =
@@ -560,7 +562,7 @@
+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
+ " " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
if (!states) {
return R.data(201,null,"保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!");
@@ -636,7 +638,7 @@
+ ",cell = " + "'" + user.getCell() + "'"
+ " " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
return R.success("修改成功");
}
@@ -688,8 +690,8 @@
in, in.available(), -1)
.headers(headers)
.build());
- InputStream inputStream = new ByteArrayInputStream(b);
- FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
+// InputStream inputStream = new ByteArrayInputStream(b);
+// FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
in.close();
//外围url
String urls = FileConfig.url + "/zhba/" + newName;
@@ -744,7 +746,7 @@
"update sys_accreditation_records set status = " + "'" + accreditationRecords1.getStatus() + "'" +
" " + "where id = " + "'" + accreditationRecords1.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
//返回
return R.success("修改成功");
}
@@ -755,7 +757,7 @@
+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
+ " " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
return R.success("修改成功");
}
@@ -778,9 +780,11 @@
//qfqk 同步
myAsyncService.deleteUserByQfqk(user1);
//内网同步
- String s1 = "update blade_user set is_deleted = 1 where id = " + "'" + id + "'";
+ String s1 = "update blade_user set is_deleted = 1"
+ + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
+ + " " + "where id = " + "'" + id + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
});
return R.status(userService.removeUser(ids));
}
@@ -1201,7 +1205,7 @@
",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'" +
" where id = " + "'" + user2.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
//人员离职后修改派遣记录,修改从业记录
updateUserDispatcherExp(user2);
@@ -1305,7 +1309,7 @@
"id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
"role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
"politicaloutlook,healstats,height,address,registered,rtime," +
- "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode,create_time,cell) " +
+ "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode,create_time,update_time,cell) " +
"values(" + "'" + user.getId() + "'" +
"," + "'" + user.getTenantId() + "'" +
"," + "'" + user.getAccount() + "'" +
@@ -1338,18 +1342,17 @@
"," + "'" + user.getDispatch() + "'" +
"," + "'" + user.getGuncode() + "'" +
"," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
+ "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
"," + "'" + user.getCell() + "'" + ");" +
- "insert into sys_experience(id,name,post,entryTime," +
- "cardId,companyname,securityId) " +
- "values(" + "'" + experience.getId() + "'" + "," +
- "'" + experience.getName() + "'" + "," +
- "'" + experience.getPost() + "'" + "," +
+ "insert into sys_experience(id,name,post,entryTime,cardId,companyname,securityId) " +
+ "values(" + "'" + experience.getId() + "'" +
+ "," + "'" + experience.getName() + "'" +
+ "," + "'" + experience.getPost() + "'" +
"," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
"," + "'" + experience.getCardid() + "'" +
"," + "'" + experience.getCompanyname() + "'" +
- "," + "'" + experience.getSecurityid() + "'"
- + ")";
- myAsyncService.FTP(s);
+ "," + "'" + experience.getSecurityid() + "'" + ")";
+ myAsyncService.dataSync(s);
}
@@ -1397,7 +1400,7 @@
+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
+ " " + "where id = " + "'" + dispatcher1.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
});
}
@@ -1420,7 +1423,7 @@
"update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
+ " " + "where id = " + "'" + experience1.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
} else {
//新增
if (null != user.getRtime()) {
@@ -1450,7 +1453,7 @@
"," + "'" + experience.getSecurityid() + "'"
+ ")";
//FtpUtil.sqlFileUpload(s);
- myAsyncService.FTP(s);
+ myAsyncService.dataSync(s);
}
}
--
Gitblit v1.9.3