瀏覽代碼

留宿微信消息通知

dzx 11 月之前
父節點
當前提交
637157062c

+ 1 - 6
src/main/java/com/xjrsoft/module/room/service/impl/WfRoomStayOvernightServiceImpl.java

@@ -5,8 +5,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.base.entity.BaseClass;
-import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserStudent;
@@ -32,8 +30,6 @@ import java.util.List;
 public class WfRoomStayOvernightServiceImpl extends MPJBaseServiceImpl<WfRoomStayOvernightMapper, WfRoomStayOvernight> implements IWfRoomStayOvernightService {
     private final IUserService userService;
 
-    private final IBaseClassService classService;
-
     private final IWeChatService weChatService;
     @Override
     public Boolean noticeParents(Long id) {
@@ -49,7 +45,6 @@ public class WfRoomStayOvernightServiceImpl extends MPJBaseServiceImpl<WfRoomSta
         SimpleDateFormat sdf = new SimpleDateFormat("yyy年MM月dd日");
 
         User student = userService.getById(applicant.getApplicantUserId());
-        BaseClass aClass = classService.getById(applicant.getClassName());
         String wechatTemplate = "pbggflZY985uimp9XQ0pe3-GftuPyF7fG5jCo97_jJU";
         for (User user : list) {
             WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
@@ -68,7 +63,7 @@ public class WfRoomStayOvernightServiceImpl extends MPJBaseServiceImpl<WfRoomSta
             }});
             //班级
             data.put("thing2", new JSONObject() {{
-                put("value", aClass.getName());
+                put("value", applicant.getClassName());
             }});
             weChatSendMessageDto.setContent(data);
             weChatService.sendTemplateMessage(weChatSendMessageDto);

+ 31 - 0
src/test/java/com/xjrsoft/module/liteflow/node/WfRoomStayOvernightNodeTest.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.liteflow.node;
+
+import com.xjrsoft.XjrSoftApplication;
+import com.xjrsoft.module.room.service.IWfRoomStayOvernightService;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2024/12/12
+ */
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = XjrSoftApplication.class)
+class WfRoomStayOvernightNodeTest {
+
+    @Autowired
+    private IWfRoomStayOvernightService wfRoomStayOvernightService;
+
+    @Test
+    void test(){
+        Long formId = 1867081409462054912L;
+        wfRoomStayOvernightService.noticeParents(formId);
+    }
+
+}