From 66979951781551f5acbcbf55f81b2a6da061bf04 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 16 Jun 2022 09:43:28 +0800
Subject: [PATCH] 制证申请审核修改,需同步外网审核状态

---
 src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java |   61 ++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java b/src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
index 64e3881..c5afaa0 100644
--- a/src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
+++ b/src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
@@ -16,6 +16,7 @@
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.FTP.MyAsyncService;
 import org.springblade.modules.accreditation.entity.AccreditationRecords;
 import org.springblade.modules.accreditation.excel.ExportSecurityBookPaperExcel;
 import org.springblade.modules.accreditation.excel.ExportSecurityPaperExcel;
@@ -51,6 +52,8 @@
 	private final AccreditationRecordsService accreditationRecordsService;
 
 	private final IUserService userService;
+
+	private final MyAsyncService myAsyncService;
 
 	/**
 	 * 自定义分页
@@ -125,7 +128,36 @@
 				user.setUpdateTime(new Date());
 				//更新
 				userService.updateById(user);
+				//外网同步
+				String s =
+					"update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
+						",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
+						",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
+						",audit_user = " + accreditationRecords.getAuditUser() + " " +
+						"where id = " + "'" + accreditationRecords.getId() + "';" +
+						"update blade_user set user_type = " + user.getUserType() + "" +
+						",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
+						"where id = " + "'" + user.getId() + "'";
+				myAsyncService.FTP(s);
+			}else {
+				//外网同步
+				String s =
+					"update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
+						",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
+						",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
+						",audit_user = " + accreditationRecords.getAuditUser() + " " +
+						"where id = " + "'" + accreditationRecords.getId() + "'";
+				myAsyncService.FTP(s);
 			}
+		}else {
+			//外网同步
+			String s =
+				"update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
+					",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
+					",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
+					",audit_user = " + accreditationRecords.getAuditUser() + " " +
+					"where id = " + "'" + accreditationRecords.getId() + "'";
+			myAsyncService.FTP(s);
 		}
 		//返回
 		return R.status(b);
@@ -156,7 +188,36 @@
 					user.setUpdateTime(new Date());
 					//更新
 					userService.updateById(user);
+					//外网同步
+					String s =
+						"update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
+							",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
+							",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
+							",audit_user = " + accreditationRecords.getAuditUser() + " " +
+							"where id = " + "'" + accreditationRecords.getId() + "';" +
+							"update blade_user set user_type = " + user.getUserType() + "" +
+							",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
+							"where id = " + "'" + user.getId() + "'";
+					myAsyncService.FTP(s);
+				}else {
+					//外网同步
+					String s =
+						"update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
+							",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
+							",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
+							",audit_user = " + accreditationRecords.getAuditUser() + " " +
+							"where id = " + "'" + accreditationRecords.getId() + "'";
+					myAsyncService.FTP(s);
 				}
+			}else {
+				//外网同步
+				String s =
+					"update sys_accreditation_records set audit_status = " + accreditationRecords.getAuditStatus() + "" +
+						",audit_detail = " + accreditationRecords.getAuditDetail() + "" +
+						",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
+						",audit_user = " + accreditationRecords.getAuditUser() + " " +
+						"where id = " + "'" + accreditationRecords.getId() + "'";
+				myAsyncService.FTP(s);
 			}
 		});
 		//返回

--
Gitblit v1.9.3