|
@@ -24,6 +24,7 @@ import com.xjrsoft.module.outint.vo.IdCountVo;
|
|
|
import com.xjrsoft.module.student.dto.StudentLeavePageDto;
|
|
|
import com.xjrsoft.module.student.entity.StudentLeave;
|
|
|
import com.xjrsoft.module.student.mapper.StudentLeaveMapper;
|
|
|
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
import com.xjrsoft.module.student.service.IStudentLeaveService;
|
|
|
import com.xjrsoft.module.student.vo.StudentLeavePageVo;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -49,6 +50,7 @@ public class StudentLeaveServiceImpl extends MPJBaseServiceImpl<StudentLeaveMapp
|
|
|
private final HikvisionDataMapper hikvisionDataMapper;
|
|
|
private final IUserService userService;
|
|
|
private final IWeChatService weChatService;
|
|
|
+ private final IBaseStudentSchoolRollService rollService;
|
|
|
|
|
|
@Override
|
|
|
public Boolean hikvisionLeave(Long id) {
|
|
@@ -142,12 +144,13 @@ public class StudentLeaveServiceImpl extends MPJBaseServiceImpl<StudentLeaveMapp
|
|
|
.isNotNull(User::getOpenId)
|
|
|
);
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyy年MM月dd日 HH:mm");
|
|
|
String endDate = studentLeave.getEndDate().format(formatter);
|
|
|
String startDate = studentLeave.getStartDate().format(formatter);
|
|
|
|
|
|
User student = userService.getById(studentLeave.getStudentUserId());
|
|
|
- String wechatTemplate = "sHsmz7LRj7HLd7GSTS3r2jCLvK-4Wp19iGzEvYK8n_I";
|
|
|
+ String className = rollService.getClassNameByUserId(studentLeave.getStudentUserId());
|
|
|
+ String wechatTemplate = "sCZ8W7j9-y8gaFzQSZwObjwGTaf4-9vVnIg6A18LUeE";
|
|
|
for (User user : list) {
|
|
|
WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
|
|
|
weChatSendMessageDto.setUserId(user.getOpenId());
|
|
@@ -156,28 +159,29 @@ public class StudentLeaveServiceImpl extends MPJBaseServiceImpl<StudentLeaveMapp
|
|
|
|
|
|
JSONObject data = new JSONObject();
|
|
|
// 任务名称
|
|
|
- data.put("thing8", new JSONObject() {{
|
|
|
- put("value", "学生请假");
|
|
|
+ data.put("thing4", new JSONObject() {{
|
|
|
+ put("value", studentLeave.getReason());
|
|
|
}});
|
|
|
// 事项名称
|
|
|
- data.put("thing2", new JSONObject() {{
|
|
|
- put("value", "请假时间:" + startDate + "~" + endDate);
|
|
|
+ data.put("time1", new JSONObject() {{
|
|
|
+ put("value", startDate + "~" + endDate);
|
|
|
}});
|
|
|
// 申请人
|
|
|
- data.put("thing6", new JSONObject() {{
|
|
|
+ data.put("short_thing3", new JSONObject() {{
|
|
|
put("value", student.getName());
|
|
|
}});
|
|
|
// 时间
|
|
|
- data.put("time3", new JSONObject() {{
|
|
|
+ data.put("time5", new JSONObject() {{
|
|
|
put("value", sdf.format(studentLeave.getCreateDate()));
|
|
|
}});
|
|
|
+ data.put("thing2", new JSONObject() {{
|
|
|
+ put("value", className);
|
|
|
+ }});
|
|
|
weChatSendMessageDto.setContent(data);
|
|
|
weChatService.sendTemplateMessage(weChatSendMessageDto);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- return null;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
JsonArray selectResource(ApiUtil apiUtil){
|