zouxuan 4 years ago
parent
commit
22855ebb5d

+ 10 - 0
mec-common/audit-log/src/main/java/com/yonge/log/dal/model/HistoryMessage.java

@@ -8,6 +8,8 @@ import java.io.Serializable;
 @Document(collection = "im_history_message")
 public class HistoryMessage implements Serializable {
     @Id
+    private String id;
+
     private String msgUID;
 
     private String fromUserId;
@@ -36,6 +38,14 @@ public class HistoryMessage implements Serializable {
 
     private String content;
 
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
     public String getFromUserId() {
         return fromUserId;
     }

+ 6 - 6
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -120,17 +120,17 @@ public class TaskController extends BaseController {
 	@GetMapping(value = "/syncImHistoryMessageTask")
 	// 同步即时通讯聊天记录
 	public void syncImHistoryMessageTask(String date) throws Exception {
-//		date = "2021060214";
+		date = "2021060710";
 		if(date == null){
 			date = DateUtil.format(DateUtil.addHours(new Date(),-2), DateUtil.YEAR_MONTH_DAY_HOUR);
 		}
 		Object o = imFeignService.historyGet(date);
 		JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(o));
 		if(jsonObject.get("code").equals(200)){
-			Boolean success = redisCache.getRedisTemplate().opsForValue().setIfAbsent("syncImHistoryMessage" + date,date);
-			if(!success){
-				return;
-			}
+//			Boolean success = redisCache.getRedisTemplate().opsForValue().setIfAbsent("syncImHistoryMessage" + date,date);
+//			if(!success){
+//				return;
+//			}
 			String url = jsonObject.getString("url");
 			if(StringUtils.isEmpty(url)){
 				return;
@@ -139,7 +139,7 @@ public class TaskController extends BaseController {
 //			File file = new File("/Users/chenxiaoyu/Documents/" + url.substring(url.lastIndexOf("/")));
 			URL url1 = new URL(url);
 			FileUtils.copyURLToFile(url1,file);
-			UploadReturnBean uploadReturnBean = uploadFileService.uploadImHistoryMsgFile(file);
+//			UploadReturnBean uploadReturnBean = uploadFileService.uploadImHistoryMsgFile(file);
 			historyMessageService.saveImHistoryMessage(new File(file.getAbsolutePath()));
 		}
 	}