lurunzhen 3 роки тому
батько
коміт
5446c60abe

+ 12 - 0
jz-crm-db/src/main/java/org/linlinjava/jz/db/util/hm/HmNoticeEnum.java

@@ -1,7 +1,10 @@
 package org.linlinjava.jz.db.util.hm;
 
 import org.linlinjava.jz.db.domain.HmEmployRelation;
+import org.linlinjava.jz.db.domain.HmEmployTask;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -94,6 +97,15 @@ public enum HmNoticeEnum {
 			content = "管家:" + relation.getButlerName() + "的跟进任务,服务记录差评";
 		return content;
 	}
+	public static void main(String[] args) {
+		String contentUser = getContentUser(5, "123132");
+		System.out.println(contentUser);
+		 HmEmployTask hmEmployTask=new HmEmployTask();
+		 hmEmployTask.setTaskStartTime(LocalDateTime.now());
+		String str="保姆" + hmEmployTask.getTaskStartTime().toLocalDate() + "的服务有任务无法完成,管家已知晓,正在跟进了解情况中!";
+		 DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy年M月d日");
+		System.out.println(dtf2.format(hmEmployTask.getTaskStartTime()));
+	}
 	/**
 	 * 雇主和保姆的话术
 	 * @param type

+ 27 - 24
jz-crm-service/src/main/java/org/linlinjava/jz/service/NoticeService.java

@@ -350,8 +350,7 @@ public class NoticeService {
 	 * @return
 	 */
 	private Integer insertNoticeUsers(HmNoticeDto dto, HmEmployRelation relation) {
-
-		String content = "";
+		Integer noticeId =null;
 		if (dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_1.getType())
 				|| dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_2.getType())
 				|| dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_3.getType())
@@ -365,32 +364,36 @@ public class NoticeService {
 				|| dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_12.getType())
 				|| dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_13.getType())
 				|| dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_14.getType())) {
+			String content = "";
 			content = HmNoticeEnum.getContentUser(dto.getRtype(),dto.getRemark());
-		}
-
-		HmNotice notice = new HmNotice();
-		BeanUtils.copyProperties(dto, notice);
-
-		notice.setContent(content);
-		notice.setrType(dto.getRtype().toString());
-		Integer noticeId = noticeService.insertNotice(notice);
-
-		List<Long> appUserId = dto.getAppUserId();
-		for (Long u : appUserId) {
-			if(u.equals(relation.getUserButlerId())) {
-				//跳过管家的,管家的单独下面处理
-				continue;
+			HmNotice notice = new HmNotice();
+			BeanUtils.copyProperties(dto, notice);
+
+			notice.setContent(content);
+			notice.setrType(dto.getRtype().toString());
+			  noticeId = noticeService.insertNotice(notice);
+
+			List<Long> appUserId = dto.getAppUserId();
+			for (Long u : appUserId) {
+				if(u.equals(relation.getUserButlerId())) {
+					//跳过管家的,管家的单独下面处理
+					continue;
+				}
+				HmNoticeUser noticeUser = new HmNoticeUser();
+				noticeUser.setNoticeId(notice.getId());
+				noticeUser.setAppUserId(u);
+				noticeUser.setTicketStatus("0");
+				noticeUser.setNoticeContent(content);// getContent(dto.getRtype(), relation)
+				noticeUserService.insert(noticeUser);
 			}
-			HmNoticeUser noticeUser = new HmNoticeUser();
-			noticeUser.setNoticeId(notice.getId());
-			noticeUser.setAppUserId(u);
-			noticeUser.setTicketStatus("0");
-			noticeUser.setNoticeContent(content);// getContent(dto.getRtype(), relation)
-			noticeUserService.insert(noticeUser);
-		}
+		} 
 
 		//保姆缺勤打卡,通知管家雇主保姆,有工单
 		if (dto.getRtype().equals(HmNoticeEnum.NOTICE_NUM_6.getType())) {
+			HmNotice notice = new HmNotice();
+			BeanUtils.copyProperties(dto, notice);  
+			noticeId=noticeService.insertNotice(notice);
+			
 			List<UserNoticeDto> userNoticeList = dto.getUserNoticeList();
 			for(UserNoticeDto u:userNoticeList) {
 				HmNoticeUser noticeUser = new HmNoticeUser();
@@ -466,7 +469,7 @@ public class NoticeService {
 		HmNoticeUser noticeUser = new HmNoticeUser();
 		noticeUser.setCreateTime(LocalDateTime.now());
 		noticeUser.setNoticeContent(content);
-		noticeUser.setIsRead(0);
+		noticeUser.setIsRead(1);//这个时候不通知,只是记录
 		noticeUser.setNoticeId(notice.getId());
 		noticeUser.setTicketStatus(ticketStatus);