From 2fdf30b77e0614f4785c7893a01958e8c8db8545 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sat, 04 Dec 2021 16:26:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java |   39 ++++++++++++++++++++++-----------------
 1 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java b/src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java
index 528e0ca..87402aa 100644
--- a/src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java
+++ b/src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java
@@ -98,7 +98,7 @@
 	public R submit(@RequestBody WorkReport workReport){
 		boolean status = false;
 		if (null==workReport.getId()){
-			workReport.setReportTime(new Date());
+//			workReport.setReportTime(new Date());
 			workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
 			//新增
 			status = workReportService.save(workReport);
@@ -120,26 +120,26 @@
 		}else {
 			workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
 			if (null==workReport.getReplyTime()){
-				workReport.setReplyTime(new Date());
+//				workReport.setReplyTime(new Date());
 			}
 
 			//修改
 			status = workReportService.updateById(workReport);
 
 			//内网同步
-			String s1 =
-				"update sys_work_report set type = " + "'" + workReport.getType() + "'" +
-					",content = " + "'" + workReport.getContent() + "'" +
-					",work_desc = " + "'" + workReport.getWorkDesc() + "'" +
-					",received_ids = " + "'" + workReport.getReceivedIds() + "'" +
-					",reply_content = " + "'" + workReport.getReplyContent() + "'" +
-					",reply_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(workReport.getReplyTime()) + "'" +
-					",dept_id = " + "'" + workReport.getDeptId() + "'" +
-					",reply_dept_ids = " + "'" + workReport.getReplyDeptIds() + "'" +
-					",category = " + "'" + workReport.getCategory() + "'" +
-					",user_id = " + "'" + workReport.getUserId() + "'" +
-					" " +"where id = " + "'" + workReport.getId() + "'";
-			FtpUtil.sqlFileUpload(s1);
+//			String s1 =
+//				"update sys_work_report set type = " + "'" + workReport.getType() + "'" +
+//					",content = " + "'" + workReport.getContent() + "'" +
+//					",work_desc = " + "'" + workReport.getWorkDesc() + "'" +
+//					",received_ids = " + "'" + workReport.getReceivedIds() + "'" +
+//					",reply_content = " + "'" + workReport.getReplyContent() + "'" +
+//					",reply_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(workReport.getReplyTime()) + "'" +
+//					",dept_id = " + "'" + workReport.getDeptId() + "'" +
+//					",reply_dept_ids = " + "'" + workReport.getReplyDeptIds() + "'" +
+//					",category = " + "'" + workReport.getCategory() + "'" +
+//					",user_id = " + "'" + workReport.getUserId() + "'" +
+//					" " +"where id = " + "'" + workReport.getId() + "'";
+//			FtpUtil.sqlFileUpload(s1);
 		}
 		return R.status(status);
 	}
@@ -226,10 +226,15 @@
 //			user.setCardid(idCardNo);
 //			User userDetail = userService.getOne(Condition.getQueryWrapper(user));
 			User userDetail = userService.getById(userId);
-			replyRealNameInfo = replyRealNameInfo.append(userDetail.getRealName()).append(",");
+			if (null!=userDetail) {
+				replyRealNameInfo = replyRealNameInfo.append(userDetail.getRealName()).append(",");
+			}
 		}
 		//截取
-		return replyRealNameInfo.substring(0, replyRealNameInfo.length() - 1);
+		if (replyRealNameInfo.length()>0) {
+			return replyRealNameInfo.substring(0, replyRealNameInfo.length() - 1);
+		}
+		return replyRealNameInfo.toString();
 	}
 
 }

--
Gitblit v1.9.3