学生资助、学生奖惩、学籍异动内容修改

This commit is contained in:
2025-12-03 10:00:14 +08:00
parent 310bedb4b5
commit f8b635f060
54 changed files with 518 additions and 389 deletions

View File

@@ -17,6 +17,12 @@ public class FlowQueryVo {
@ApiModelProperty("流程名称")
private String name;
@ApiModelProperty("流程发起人名称")
private String startUserName;
@ApiModelProperty("提交时间(yyyy-MM-dd)")
private String deployTime;
@ApiModelProperty("开始时间")
private String startTime;

View File

@@ -80,7 +80,7 @@ public class BoStartListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
//weChatUtil.sendTextMessage(userName, content);
@@ -122,7 +122,7 @@ public class BoStartListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -90,7 +90,7 @@ public class CounselorListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -107,7 +107,9 @@ public class LeadAuditListener implements ExecutionListener {
//获取学工领导信息
String roleKey = "xgldsp"; //角色key
List<TeacherVo> xueDataInfo = leaveMapper.getShenDataInfo(roleKey);
if (xueDataInfo == null || xueDataInfo.isEmpty()) {
log.warn("未找到学工领导(roleKey={})信息,跳过该环节通知。", roleKey);
} else {
//查询指定用户的通知信息
notificationManage.setContent("您有一条【二级学院书记已提交请假申请审批】需待处理"); // 消息内容
notificationManage.setReceiver(Long.parseLong(xueDataInfo.get(0).getUserId().toString())); //接收人需添加appvoval//185043
@@ -121,24 +123,28 @@ public class LeadAuditListener implements ExecutionListener {
//构建通知信息内容
notificationManage.setContent("您有一条【学工领导已提交请假申请审批】需待处理"); // 消息内容
notificationManage.setSender(Long.parseLong(approval)); // 发送方
}
}
if(leaveDay >= 15 && leaveDay <= 30) {
//获取校领导信息
String roleKey = "xldsp"; //角色key
List<TeacherVo> lingDataInfo = leaveMapper.getShenDataInfo(roleKey);
if (lingDataInfo == null || lingDataInfo.isEmpty()) {
log.warn("未找到校领导(roleKey={})信息,跳过该环节通知。", roleKey);
} else {
notificationManage.setContent("您有一条【学工领导已提交请假申请审批】需待处理"); // 消息内容
notificationManage.setReceiver(lingDataInfo.get(0).getUserId()); //接收人185362
NotificationManage userManage = leaveMapper.selectCphMsgListForFlowable(notificationManage);
if(userManage != null) {
//删除指定通知信息
int delRes = leaveMapper.deleteCphMsgById(userManage.getId());
log.info("删除成功{}", delRes);
}
notificationManage.setContent("您有一条【学工领导已提交请假申请审批】需待处理"); // 消息内容
notificationManage.setReceiver(lingDataInfo.get(0).getUserId()); //接收人185362
NotificationManage userManage = leaveMapper.selectCphMsgListForFlowable(notificationManage);
if(userManage != null) {
//删除指定通知信息
int delRes = leaveMapper.deleteCphMsgById(userManage.getId());
log.info("删除成功{}", delRes);
//构建通知信息内容
notificationManage.setContent("您有一条【学院领导已提交请假申请审批】待处理"); // 消息内容
notificationManage.setSender(lingDataInfo.get(0).getUserId()); // 发送方185362
}
//构建通知信息内容
notificationManage.setContent("您有一条【学院领导已提交请假申请审批】待处理"); // 消息内容
notificationManage.setSender(lingDataInfo.get(0).getUserId()); // 发送方185362
}
notificationManage.setReceiver(shenUserInfo.getUserId());
notificationManage.setCreateTime(DateUtils.getNowDate());
@@ -149,7 +155,7 @@ public class LeadAuditListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -106,7 +106,7 @@ public class LeadEentListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -58,7 +58,7 @@ public class LeadStartListener implements ExecutionListener {
if (userName != null && !userName.isEmpty()) {
//查询指定用户的通知信息
NotificationManage notificationManage = new NotificationManage();
notificationManage.setContent("您有一条【辅导员已提交请假审批】待处理"); // 消息内容
notificationManage.setContent("您有一条【请假审批】待处理"); // 消息内容
notificationManage.setReceiver(Long.parseLong(approval));
NotificationManage userManage = leaveMapper.selectCphMsgListForFlowable(notificationManage);
if(userManage != null) {
@@ -68,7 +68,7 @@ public class LeadStartListener implements ExecutionListener {
}
//向系统发送通知
notificationManage.setContent("您有一条【二级学院书记已提交请假申请审批】待处理"); // 消息内容
notificationManage.setContent("您有一条【请假申请审批】待处理"); // 消息内容
notificationManage.setSender(Long.parseLong(approval)); // 发送方
notificationManage.setReceiver(updateDeptIdInfo.get(0).getUserId()); // 接收方
NotificationManage userManages = leaveMapper.selectCphMsgListForFlowable(notificationManage);
@@ -82,7 +82,7 @@ public class LeadStartListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -105,7 +105,7 @@ public class LeaveApproveListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content); // 发送消息的方法

View File

@@ -81,7 +81,7 @@ public class LeaveStartApproveListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -40,6 +40,11 @@ public class SecondaryLeaderListener implements ExecutionListener {
//TeacherVo secondaryLeaderInfo = leaveMapper.getSecondaryLeaderInfo(deptId);
//delegateExecution.setVariable("approval", secondaryLeaderInfo.getUserId());
List<TeacherVo> secondaryLeaderInfo = leaveMapper.getSecondaryLeaderInfo(deptId);
// 空数据防护:未查询到二级学院书记信息则跳过设置与通知
if (secondaryLeaderInfo == null || secondaryLeaderInfo.isEmpty()) {
log.warn("未找到二级学院书记信息deptId={},跳过审批人设置与通知。", deptId);
return;
}
//由于这里查到了多个数据,由于时间原因,暂时还没有研究到工作流中多用户节点的同时进行(所以取了第一条数据用于发消息)
delegateExecution.setVariable("approval", secondaryLeaderInfo.get(0).getUserId());
@@ -85,7 +90,7 @@ public class SecondaryLeaderListener implements ExecutionListener {
// WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
//
// // 构造包含超链接的消息内容
// String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
//
// // 步骤 4: 使用 userName 作为接收人发送消息
// //weChatUtil.sendTextMessage(userName, content);
@@ -117,7 +122,7 @@ public class SecondaryLeaderListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有待处理任务,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
String content = "您有待处理任务,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -60,7 +60,7 @@ public class ArchivingNotifyListener implements ExecutionListener {
List<String> userNameList = disciplinaryMapper.getUserNamesByUserIdList(userIdList);
if (userNameList != null && !userNameList.isEmpty()) {
String toUser = String.join("|", userNameList);
String weChatMessage = "您有一条新的学生违纪归档任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String weChatMessage = "您有一条新的学生违纪归档任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
weChatUtil.sendTextMessage(toUser, weChatMessage);
log.info("已成功向归档角色 ({}) 发送企业微信通知。", ARCHIVING_ROLE_KEY);
} else {
@@ -73,7 +73,7 @@ public class ArchivingNotifyListener implements ExecutionListener {
String activityId = (nextElement != null) ? nextElement.getId() : "Activity_1agoizv"; // 节点的ID作为备用
String messageText = "您有一条新的【" + taskName + "】待办任务需要处理。";
String link = "<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String link = "<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String hiddenIdentifier = String.format("<span id='flow-identifier' data-proc-inst-id='%s' data-activity-id='%s' style='display:none;'></span>",
execution.getProcessInstanceId(), activityId);
String internalMessageContent = messageText + link + hiddenIdentifier;

View File

@@ -39,7 +39,7 @@ public class EJXYSJListener implements ExecutionListener {
// 构造包含超链接的消息内容
String content = "您有一条新的学生违纪审批任务待处理," +
"<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
"<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -50,12 +50,12 @@ public class InitiatorNotificationListener implements ExecutionListener {
// --- 2. 准备通知内容 (解决taskName为空的问题) ---
String nextTaskName = getNextTaskName(execution);
String weChatMessage = "您提交的学生违纪处分申请已有最终处理结果,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String weChatMessage = "您提交的学生违纪处分申请已有最终处理结果,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String internalMessageText = "您有一条新的【" + nextTaskName + "】待办任务需要处理。";
String hiddenIdentifier = String.format("<span id='flow-identifier' data-proc-inst-id='%s' data-activity-id='%s' style='display:none;'></span>",
execution.getProcessInstanceId(),
((SequenceFlow) execution.getCurrentFlowElement()).getTargetRef());
String internalMessageContent = internalMessageText + "<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。" + hiddenIdentifier;
String internalMessageContent = internalMessageText + "<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。" + hiddenIdentifier;
// --- 3. 发送企业微信通知 ---
sendWeChatNotification(initiatorUserId, weChatMessage);

View File

@@ -46,7 +46,7 @@ public class InitiatorResultListener implements ExecutionListener {
if (initiatorUserName != null && !initiatorUserName.isEmpty()) {
// 4. 发送通知
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
String content = "您提交的学生违纪处分申请已有最终处理结果,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。\"";
String content = "您提交的学生违纪处分申请已有最终处理结果,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。\"";
weChatUtil.sendTextMessage(initiatorUserName, content);
log.info("已成功向流程发起人 ({}) 发送结果通知。", initiatorUserName);

View File

@@ -47,7 +47,7 @@ public class MultiInstanceMessageListener implements ExecutionListener {
// --- 步骤 3: 准备消息内容 ---
String messageText = "您有一条新的【" + taskName + "】待办任务需要处理。";
String link = "<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String link = "<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String hiddenIdentifier = String.format("<span id='flow-identifier' data-proc-inst-id='%s' data-activity-id='%s' style='display:none;'></span>",
execution.getProcessInstanceId(),
activityId);

View File

@@ -60,7 +60,7 @@ public class SchoolLeaderApprovalListener implements ExecutionListener {
List<String> userNameList = disciplinaryMapper.getUserNamesByUserIdList(userIdList);
if (userNameList != null && !userNameList.isEmpty()) {
String toUser = String.join("|", userNameList);
String weChatMessage = "校领导您有一条新的学生违纪审批任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String weChatMessage = "校领导您有一条新的学生违纪审批任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
weChatUtil.sendTextMessage(toUser, weChatMessage);
log.info("已成功向校领导 (角色: {}) 发送企业微信通知。", LEADER_ROLE_KEY);
}
@@ -71,7 +71,7 @@ public class SchoolLeaderApprovalListener implements ExecutionListener {
String activityId = (nextElement != null) ? nextElement.getId() : "Activity_0ftj9eo";
String messageText = "您有一条新的【" + taskName + "】待办任务需要处理。";
String link = "<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String link = "<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String hiddenIdentifier = String.format("<span id='flow-identifier' data-proc-inst-id='%s' data-activity-id='%s' style='display:none;'></span>",
execution.getProcessInstanceId(), activityId);
String internalMessageContent = messageText + link + hiddenIdentifier;

View File

@@ -106,7 +106,7 @@ public class StuInfoListener implements ExecutionListener {
String messageText = "您有一条新的【" + taskName + "】待办任务需要处理。";
String link = "<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String link = "<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String hiddenIdentifier = String.format("<span id='flow-identifier' data-proc-inst-id='%s' data-activity-id='%s' style='display:none;'></span>",
execution.getProcessInstanceId(), activityId);
String internalMessageContent = messageText + link + hiddenIdentifier;

View File

@@ -43,7 +43,7 @@ public class WSSListener implements ExecutionListener {
String toUser = String.join("|", userNameList);
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
String content = "您有一条新的学生违纪审批任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String content = "您有一条新的学生违纪审批任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
weChatUtil.sendTextMessage(toUser, content);
log.info("已成功向角色 '{}' 的成员发送通知。接收人: {}", TARGET_ROLE_KEY, toUser);

View File

@@ -54,7 +54,7 @@ public class XGLDSHListener implements ExecutionListener {
String toUser = String.join("|", userNameList);
String content = "您有一条新的学生违纪审批任务待处理," +
"<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
"<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>";
weChatUtil.sendTextMessage(toUser, content);
log.info("流程实例 [{}]: 已成功向角色 '{}' 成员发送企微通知,接收人: {}", processInstanceId, roleKey, toUser);

View File

@@ -43,7 +43,7 @@ public class XLZXListener implements ExecutionListener {
String toUser = String.join("|", userNameList);
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
String content = "您有一条新的学生违纪审批任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String content = "您有一条新的学生违纪审批任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
weChatUtil.sendTextMessage(toUser, content);
log.info("已成功向角色 '{}' 的成员发送通知。接收人: {}", TARGET_ROLE_KEY, toUser);

View File

@@ -58,7 +58,7 @@ public class XSJYGLKListener implements ExecutionListener {
String toUser = String.join("|", userNameList);
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
String content = "您有一条新的学生违纪审批任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String content = "您有一条新的学生违纪审批任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
weChatUtil.sendTextMessage(toUser, content);
log.info("已成功向角色 '{}' 的成员发送企业微信通知。接收人: {}", roleKey, toUser);

View File

@@ -45,7 +45,7 @@ public class XWGSListener implements ExecutionListener {
WeChatUtil weChatUtil = SpringUtils.getBean(WeChatUtil.class);
// 构造包含超链接的消息内容
String content = "您有一条新的学生违纪审批任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String content = "您有一条新的学生违纪审批任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
// 步骤 4: 使用 userName 作为接收人发送消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -62,7 +62,7 @@ public class XYWJCLWYHListener implements ExecutionListener {
return;
}
String toUser = String.join("|", userNameList);
String content = "您有一条新的学生违纪审批任务待处理,<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
String content = "您有一条新的学生违纪审批任务待处理,<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>请点击前往处理</a>。";
weChatUtil.sendTextMessage(toUser, content);
log.info("流程实例 [{}]: 已成功向'委员会'发送企微通知。", processInstanceId);
} catch (Exception e) {

View File

@@ -50,7 +50,7 @@ public class StuCounselorListener implements ExecutionListener {
// 构造包含超链接的消息内容
String content = "您有一条新的学生违纪审批任务待处理," +
"<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>点此查看</a>";
"<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>点此查看</a>";
// 发送企业微信消息
weChatUtil.sendTextMessage(userName, content);

View File

@@ -37,7 +37,7 @@ public class StuReceiveListener implements ExecutionListener {
String content = "您的违纪处理流程有新的进展:" +
approveResult + "" +
"<a href='http://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>点此查看详情</a>";
"<a href='https://zhxg.gxsdxy.cn/wab/#/pages/Approval/index'>点此查看详情</a>";
// 发送企业微信消息
weChatUtil.sendTextMessage(stuUserName, content);

View File

@@ -218,6 +218,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
// 如果父级任务多于 1 个,说明当前节点不是并行节点,原因为不考虑多对多情况
if (targetIds.size() > 1) {
// 1 对 多任务跳转currentIds 当前节点(1)targetIds 跳转到的节点(多)
if (CollectionUtils.isEmpty(currentIds)) {
throw new CustomException("未找到可驳回的当前任务节点");
}
runtimeService.createChangeActivityStateBuilder()
.processInstanceId(task.getProcessInstanceId()).
moveSingleActivityIdToActivityIds(currentIds.get(0), targetIds).changeState();
@@ -520,10 +523,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
.startedBy(userId.toString())
.orderByProcessInstanceStartTime()
.desc();
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.listPage(queryVo.getPageSize() * (queryVo.getPageNum() - 1), queryVo.getPageSize());
page.setTotal(historicProcessInstanceQuery.count());
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.list();
List<FlowTaskDto> flowList = new ArrayList<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (HistoricProcessInstance hisIns : historicProcessInstances) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(queryVo.getDeployTime())) {
String startDate = dateFormat.format(hisIns.getStartTime());
if (!startDate.equals(queryVo.getDeployTime())) {
continue;
}
}
FlowTaskDto flowTask = new FlowTaskDto();
flowTask.setCreateTime(hisIns.getStartTime());
flowTask.setFinishTime(hisIns.getEndTime());
@@ -576,7 +585,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
flowList.add(flowTask);
}
page.setRecords(flowList);
int total = flowList.size();
page.setTotal(total);
int fromIndex = Math.max(0, (queryVo.getPageNum() - 1) * queryVo.getPageSize());
int toIndex = Math.min(total, fromIndex + queryVo.getPageSize());
page.setRecords(fromIndex < toIndex ? flowList.subList(fromIndex, toIndex) : new ArrayList<>());
return AjaxResult.success(page);
}
@@ -700,9 +713,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
// if (StringUtils.isNotBlank(queryVo.getName())){
// taskQuery.processDefinitionNameLike(queryVo.getName());
// }
page.setTotal(taskQuery.count());
List<Task> taskList = taskQuery.listPage(queryVo.getPageSize() * (queryVo.getPageNum() - 1), queryVo.getPageSize());
List<Task> taskList = taskQuery.list();
List<FlowTaskDto> flowList = new ArrayList<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
for (Task task : taskList) {
FlowTaskDto flowTask = new FlowTaskDto();
// 当前流程信息
@@ -730,10 +743,24 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowTask.setStartUserId(startUser.getUserId().toString());
flowTask.setStartUserName(startUser.getNickName());
flowTask.setStartDeptName(Objects.nonNull(startUser.getDept()) ? startUser.getDept().getDeptName() : "");
if (org.apache.commons.lang3.StringUtils.isNotBlank(queryVo.getStartUserName())) {
if (flowTask.getStartUserName() == null || !flowTask.getStartUserName().contains(queryVo.getStartUserName())) {
continue;
}
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(queryVo.getDeployTime())) {
String startDate = dateFormat.format(historicProcessInstance.getStartTime());
if (!startDate.equals(queryVo.getDeployTime())) {
continue;
}
}
flowList.add(flowTask);
}
page.setRecords(flowList);
int total = flowList.size();
page.setTotal(total);
int fromIndex = Math.max(0, (queryVo.getPageNum() - 1) * queryVo.getPageSize());
int toIndex = Math.min(total, fromIndex + queryVo.getPageSize());
page.setRecords(fromIndex < toIndex ? flowList.subList(fromIndex, toIndex) : new ArrayList<>());
return AjaxResult.success(page);
}
@@ -774,7 +801,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskInstanceQuery.taskCompletedBefore(endTime);
}
List<HistoricTaskInstance> historicTaskInstanceList = taskInstanceQuery.listPage(queryVo.getPageSize() * (queryVo.getPageNum() - 1), queryVo.getPageSize());
List<HistoricTaskInstance> historicTaskInstanceList = taskInstanceQuery.list();
List<FlowTaskDto> hisTaskList = new ArrayList<>();
for (HistoricTaskInstance histTask : historicTaskInstanceList) {
FlowTaskDto flowTask = new FlowTaskDto();
@@ -809,10 +836,18 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowTask.setStartUserId(startUser.getNickName());
flowTask.setStartUserName(startUser.getNickName());
flowTask.setStartDeptName(startUser.getDept()!=null?startUser.getDept().getDeptName():"");
if (org.apache.commons.lang3.StringUtils.isNotBlank(queryVo.getStartUserName())) {
if (flowTask.getStartUserName() == null || !flowTask.getStartUserName().contains(queryVo.getStartUserName())) {
continue;
}
}
hisTaskList.add(flowTask);
}
page.setTotal(taskInstanceQuery.count());
page.setRecords(hisTaskList);
int totalFinished = hisTaskList.size();
page.setTotal(totalFinished);
int fromIndexFinished = Math.max(0, (queryVo.getPageNum() - 1) * queryVo.getPageSize());
int toIndexFinished = Math.min(totalFinished, fromIndexFinished + queryVo.getPageSize());
page.setRecords(fromIndexFinished < toIndexFinished ? hisTaskList.subList(fromIndexFinished, toIndexFinished) : new ArrayList<>());
return AjaxResult.success(page);
}