修改学生证完成制作发送的文案,给处分记录和解除处分添加政治面貌选项
This commit is contained in:
@@ -222,6 +222,14 @@ public class RtStuDisciplinaryApplication extends BaseEntity {
|
||||
@Excel(name = "籍贯")
|
||||
private String jg;
|
||||
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
@ApiModelProperty("政治面貌")
|
||||
@TableField("political_status")
|
||||
@Excel(name = "政治面貌")
|
||||
private String politicalStatus;
|
||||
|
||||
/**
|
||||
* 市/县
|
||||
*/
|
||||
|
@@ -214,6 +214,14 @@ public class RtStuDisciplinaryRelieve extends BaseEntity {
|
||||
@Excel(name = "籍贯")
|
||||
private String jg;
|
||||
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
@ApiModelProperty("政治面貌")
|
||||
@TableField("political_status")
|
||||
@Excel(name = "政治面貌")
|
||||
private String politicalStatus;
|
||||
|
||||
/**
|
||||
* 市/县
|
||||
*/
|
||||
|
@@ -3,16 +3,20 @@ package com.srs.routine.service.impl;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.srs.common.core.domain.AjaxResult;
|
||||
import com.srs.common.core.domain.entity.SysUser;
|
||||
import com.srs.common.doman.dto.ProcessResultDto;
|
||||
import com.srs.common.exception.ServiceException;
|
||||
import com.srs.common.utils.DateUtils;
|
||||
import com.srs.common.utils.SecurityUtils;
|
||||
import com.srs.common.utils.WeChatUtil;
|
||||
import com.srs.flowable.service.IFlowDefinitionService;
|
||||
import com.srs.routine.domain.RtStuDisciplinaryApplication;
|
||||
import com.srs.routine.mapper.RtStuDisciplinaryApplicationMapper;
|
||||
import com.srs.system.mapper.SysUserMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.IdentityService;
|
||||
import org.flowable.engine.TaskService;
|
||||
@@ -40,6 +44,12 @@ public class RtStuDisciplinaryRelieveServiceImpl extends ServiceImpl<RtStuDiscip
|
||||
@Autowired
|
||||
RtStuDisciplinaryApplicationMapper rtStuDisciplinaryApplicationMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired
|
||||
public WeChatUtil weChatUtil;
|
||||
|
||||
/**
|
||||
* 查询学生解除处分申请
|
||||
*
|
||||
@@ -208,12 +218,49 @@ public class RtStuDisciplinaryRelieveServiceImpl extends ServiceImpl<RtStuDiscip
|
||||
// 保存审核结果到任务变量中
|
||||
variables.put("approved", true);
|
||||
|
||||
// 标记是否有任务被完成
|
||||
boolean taskCompleted = false;
|
||||
|
||||
// 完成待办任务列表
|
||||
for (Task task : tasks) {
|
||||
String taskId = task.getId();
|
||||
String applicationId = taskService.getVariable(taskId, "relieveId").toString();
|
||||
if (applicationId.equals(rtStuDisciplinaryRelieve.getRelieveId().toString())) {
|
||||
taskService.complete(task.getId(), variables);
|
||||
taskCompleted = true;
|
||||
}
|
||||
}
|
||||
// 所有相关任务完成后,发送企业微信消息
|
||||
if (taskCompleted) {
|
||||
try {
|
||||
// 获取申请人信息
|
||||
String applicantName = rtStuDisciplinaryRelieve.getStuName();
|
||||
String politicalStatus = rtStuDisciplinaryRelieve.getPoliticalStatus();
|
||||
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setRoleId(118L);
|
||||
List<SysUser> sysUsers = sysUserMapper.selectAllocatedList(sysUser);
|
||||
|
||||
// 提取二级学院的书记的账号
|
||||
List<String> userNames = sysUsers.stream()
|
||||
.map(SysUser::getUserName)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 只有政治面貌是团员时才发送企业微信消息
|
||||
if ("团员".equals(politicalStatus)) {
|
||||
// 消息内容
|
||||
String messageContent = "【解除处分】" + applicantName + "的解除处分申请已通过审核。";
|
||||
int batchSize = 10;
|
||||
for (int i = 0; i < userNames.size(); i += batchSize) {
|
||||
List<String> batch = userNames.subList(i, Math.min(i + batchSize, userNames.size()));
|
||||
// 拼接成"user1|user2|user3"格式
|
||||
String toUser = String.join("|", batch);
|
||||
// 调用企业微信发送消息方法
|
||||
weChatUtil.sendTextMessage(toUser, messageContent);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("发送企业微信消息失败:", e);
|
||||
}
|
||||
}
|
||||
return dto;
|
||||
|
@@ -117,7 +117,7 @@ public class RtStuMultiLevelReviewServiceImpl extends ServiceImpl<RtStuMultiLeve
|
||||
if (result > 0) {
|
||||
String messageContent = rtStuMultiLevelReview.getNotes();
|
||||
if (messageContent == null || messageContent.trim().isEmpty()) {
|
||||
messageContent = "你申请办理的学生证制作完成,长堽校区前往xxx领取,里建校区前往xxx领取";
|
||||
messageContent = "你申请办理的学生证制作完成,长堽校区前往经管楼学工处1-1办公室领取,里建校区前往“一站式”学生社区大厅领取";
|
||||
}
|
||||
|
||||
weChatUtil.sendTextMessage(rtStuMultiLevelReview.getStuNo(), messageContent);
|
||||
|
Reference in New Issue
Block a user