6-24 - bug修复

master
tianxinlei 2026-06-24 09:36:47 +08:00
parent b11d7ba0aa
commit b643471948
21 changed files with 127 additions and 71 deletions

View File

@ -36,3 +36,6 @@ archives:
queueCapacity: 60
namePrefix: async-task-
keepAliveSeconds: 60
message:
template:
firstDayOfCycleSendMsgTodo: MS000146

View File

@ -1,4 +1,4 @@
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0 Env/production (2026/6/22 15:48:34) App/safetyDutyList"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0 Env/production (2026/6/24 08:50:39) App/safetyDutyList"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
const APP_ENV = {
antd: {
'ant-prefix': 'micro-temp',
@ -20,4 +20,4 @@
redirect: '',
FRAMEWORK: APP_ENV.antd
};
})();</script><script defer="defer" src="/safetyDutyList/static/js/185.46e52d05996ddef5e7f4.js"></script><script defer="defer" src="/safetyDutyList/static/js/26.7e37655f7b2954f97c50.js"></script><script defer="defer" src="/safetyDutyList/static/js/main.d7a18326ac3c57312f36.js"></script><link href="/safetyDutyList/static/css/main.c74fbb90829596498e3a.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0 Env/production (2026/6/22 15:48:34) App/safetyDutyList Version/main Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>
})();</script><script defer="defer" src="/safetyDutyList/static/js/185.46e52d05996ddef5e7f4.js"></script><script defer="defer" src="/safetyDutyList/static/js/26.7e37655f7b2954f97c50.js"></script><script defer="defer" src="/safetyDutyList/static/js/main.29d19da498ed55152606.js"></script><link href="/safetyDutyList/static/css/main.c74fbb90829596498e3a.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0 Env/production (2026/6/24 08:50:39) App/safetyDutyList Version/main Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */

View File

@ -61,10 +61,4 @@ public class TaskDetailController {
public SingleResponse<TaskDetailInfoCO> getByDetailId(@PathVariable String detailId) {
return taskListService.getByTaskDetailId(detailId);
}
@ApiOperation("关闭任务")
@PostMapping("/close")
public Response close(@Validated @RequestBody TaskDetailCloseCmd cmd) {
return taskListService.closeTaskDetail(cmd);
}
}

View File

@ -6,6 +6,7 @@ import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.safetyDutyList.api.tasklist.TaskListServiceI;
import com.zcloud.safetyDutyList.dto.clientobject.tasklist.TaskExecutionCO;
import com.zcloud.safetyDutyList.dto.tasklist.TaskDetailUpdateScoreCmd;
import com.zcloud.safetyDutyList.dto.tasklist.TaskExecutionCloseCmd;
import com.zcloud.safetyDutyList.dto.tasklist.TaskExecutionPageQry;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -43,4 +44,10 @@ public class TaskExecutionController {
public Response updateScore(@Validated @RequestBody TaskDetailUpdateScoreCmd cmd) {
return taskListService.updateTaskDetailScore(cmd);
}
@ApiOperation("关闭任务")
@PostMapping("/close")
public Response close(@Validated @RequestBody TaskExecutionCloseCmd cmd) {
return taskListService.closeTaskExecution(cmd);
}
}

View File

@ -66,7 +66,7 @@ public class MessageNoticeExe {
event.setForeignSubsidiaryKey(foreignSubsidiaryKey); // 业务附表ID 没有附表时为foreignKey的值
event.setReceiveUser(userId);// user表ID
event.setPcFlag(1); // 是否PC端待办 1是 0否
event.setAppFlag(1); // 是否APP端待办 1是 0否
event.setAppFlag(0); // 是否APP端待办 1是 0否
event.setOtherParams(new JSONObject());
log.info("待办,请求:{}",event);
//为了防止先被完成

View File

@ -1,6 +1,7 @@
package com.zcloud.safetyDutyList.command.tasklist;
import com.zcloud.safetyDutyList.command.query.tasklist.MessageNoticeExe;
import com.zcloud.safetyDutyList.domain.config.MessageTemplateConfig;
import com.zcloud.safetyDutyList.domain.enums.TaskStatusEnum;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.*;
import com.zcloud.safetyDutyList.domain.model.tasklist.*;
@ -12,7 +13,9 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 2
@ -35,8 +38,10 @@ public class SendTodoMessageExe {
private final TaskListIssueGateway taskListIssueGateway;
private final TaskExecutionGateway taskExecutionGateway;
private final TaskDetailGateway taskDetailGateway;
private final TaskListGateway taskListGateway;
private final FeedbackGateway feedbackGateway;
private final MessageNoticeExe messageNoticeExe;
private final MessageTemplateConfig messageTemplateConfig;
@Scheduled(cron = "0 0 0 1 * ?")
@Transactional(rollbackFor = Exception.class)
@ -52,6 +57,13 @@ public class SendTodoMessageExe {
List<TaskExecutionE> executionList = taskExecutionGateway.listByTaskIssueId(issueE.getTaskIssueId());
if (executionList == null) continue;
TaskListE taskListE = taskListGateway.getInfoByTaskListId(issueE.getTaskListId());
String taskListName = "";
if (taskListE != null) {
taskListName = taskListE.getTaskListName();
}
Boolean isSendMessage = false;
for (TaskExecutionE executionE : executionList) {
// 不是进行中就返回
@ -81,7 +93,23 @@ public class SendTodoMessageExe {
continue;
}
// todo 发送待办消息
isSendMessage = true;
break;
}
if (isSendMessage) {
// 发送消息提醒
Map<String, Object> sendParams = new HashMap <>();
sendParams.put("listName", taskListName);
messageNoticeExe.messageNotice(issueE.getExecuteUserId(), messageTemplateConfig.getFirstDayOfCycleSendMsgTodo(), sendParams);
// 发送待办消息
messageNoticeExe.sendMessageAddEvent(
issueE.getExecuteUserId(),
"您有一条任务清单待反馈,清单名称:【" + taskListName + "】",
"待反馈",
issueE.getId(),
issueE.getId());
}
}
log.info("【定时任务3】待办消息发送完成");

View File

@ -1,54 +0,0 @@
package com.zcloud.safetyDutyList.command.tasklist;
import com.alibaba.cola.exception.BizException;
import com.zcloud.safetyDutyList.domain.enums.TaskStatusEnum;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskDetailGateway;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskExecutionGateway;
import com.zcloud.safetyDutyList.domain.model.tasklist.TaskDetailE;
import com.zcloud.safetyDutyList.domain.model.tasklist.TaskExecutionE;
import com.zcloud.safetyDutyList.dto.tasklist.TaskDetailCloseCmd;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* <p>
*
* 1.
* 2.
* 3.
*/
@Component
@AllArgsConstructor
public class TaskDetailCloseExe {
private final TaskDetailGateway taskDetailGateway;
private final TaskExecutionGateway taskExecutionGateway;
@Transactional(rollbackFor = Exception.class)
public void execute(TaskDetailCloseCmd cmd) {
// 1. 关闭任务模板
TaskDetailE detailE = taskDetailGateway.getByTaskDetailId(cmd.getTaskDetailId());
if (detailE == null) {
throw new BizException("任务不存在");
}
detailE.setTaskStatus(TaskStatusEnum.CLOSED.getCode());
boolean res = taskDetailGateway.update(detailE);
if (!res) {
throw new BizException("关闭任务失败");
}
// 2. 关闭关联的所有进行中的任务执行记录
List<TaskExecutionE> executionList = taskExecutionGateway.listByTaskDetailId(cmd.getTaskDetailId());
if (executionList != null) {
for (TaskExecutionE executionE : executionList) {
if (TaskStatusEnum.IN_PROGRESS.getCode().equals(executionE.getTaskStatus())) {
executionE.setTaskStatus(TaskStatusEnum.CLOSED.getCode());
taskExecutionGateway.update(executionE);
}
}
}
}
}

View File

@ -0,0 +1,42 @@
package com.zcloud.safetyDutyList.command.tasklist;
import com.alibaba.cola.exception.BizException;
import com.zcloud.safetyDutyList.domain.enums.TaskStatusEnum;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskDetailGateway;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.TaskExecutionGateway;
import com.zcloud.safetyDutyList.domain.model.tasklist.TaskExecutionE;
import com.zcloud.safetyDutyList.dto.tasklist.TaskExecutionCloseCmd;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* <p>
*
* 1.
* 2.
* 3.
*/
@Component
@AllArgsConstructor
public class TaskExecutionCloseExe {
private final TaskExecutionGateway taskExecutionGateway;
@Transactional(rollbackFor = Exception.class)
public void execute(TaskExecutionCloseCmd cmd) {
// 1. 关闭任务执行记录
TaskExecutionE executionE = taskExecutionGateway.getByTaskExecutionId(cmd.getTaskExecutionId());
if (executionE == null) {
throw new BizException("任务执行记录不存在");
}
executionE.setTaskStatus(TaskStatusEnum.CLOSED.getCode());
boolean res = taskExecutionGateway.update(executionE);
if (!res) {
throw new BizException("关闭任务失败");
}
}
}

View File

@ -45,8 +45,8 @@ public class TaskListServiceImpl implements TaskListServiceI {
private final TaskDetailSaveBatchExe taskDetailSaveBatchExe;
/** 任务详情编辑执行器 */
private final TaskDetailEditExe taskDetailEditExe;
/** 任务详情关闭执行器 */
private final TaskDetailCloseExe taskDetailCloseExe;
/** 任务执行关闭执行器 */
private final TaskExecutionCloseExe taskExecutionCloseExe;
/** 任务评分更新执行器 */
private final TaskDetailUpdateScoreExe taskDetailUpdateScoreExe;
/** 反馈新增执行器 */
@ -155,8 +155,8 @@ public class TaskListServiceImpl implements TaskListServiceI {
}
@Override
public Response closeTaskDetail(TaskDetailCloseCmd cmd) {
taskDetailCloseExe.execute(cmd);
public Response closeTaskExecution(TaskExecutionCloseCmd cmd) {
taskExecutionCloseExe.execute(cmd);
return Response.buildSuccess();
}

View File

@ -136,7 +136,7 @@ public interface TaskListServiceI {
* @param cmd
* @return
*/
Response closeTaskDetail(TaskDetailCloseCmd cmd);
Response closeTaskExecution(TaskExecutionCloseCmd cmd);
/**
*

View File

@ -16,8 +16,8 @@ import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TaskDetailCloseCmd implements Serializable {
public class TaskExecutionCloseCmd implements Serializable {
@ApiModelProperty(value = "任务业务ID", required = true)
@NotEmpty(message = "任务业务ID不能为空")
private String taskDetailId;
private String taskExecutionId;
}

View File

@ -0,0 +1,19 @@
package com.zcloud.safetyDutyList.domain.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author zhangyue
* @date 2026/2/11 10:05
*/
@Component
@ConfigurationProperties(prefix = "message.template")
@Data
public class MessageTemplateConfig {
// 周期第一天发送消息和待办
private String firstDayOfCycleSendMsgTodo;
}

View File

@ -2,6 +2,8 @@ package com.zcloud.safetyDutyList.persistence.mapper.tasklist;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.datascope.annotation.DataScope;
import com.jjb.saas.framework.datascope.annotation.DataScopes;
import com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskListIssueDO;
import org.apache.ibatis.annotations.Mapper;
@ -9,6 +11,9 @@ import java.util.List;
import java.util.Map;
@Mapper
@DataScopes(
@DataScope(method = "listPage", menuPerms = "jgd-rwqdgl")
)
public interface TaskListIssueMapper extends BaseMapper<TaskListIssueDO> {
IPage<TaskListIssueDO> listPage(IPage<TaskListIssueDO> iPage, Map<String, Object> params, String menuPath);