6-22 - bug修复

master
tianxinlei 2026-06-23 09:01:53 +08:00
parent 10c425c1d3
commit b11d7ba0aa
24 changed files with 289 additions and 30 deletions

View File

@ -1,4 +1,4 @@
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0 Env/production (2026/6/16 17:27:02) 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/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 () {
const APP_ENV = { const APP_ENV = {
antd: { antd: {
'ant-prefix': 'micro-temp', 'ant-prefix': 'micro-temp',
@ -20,4 +20,4 @@
redirect: '', redirect: '',
FRAMEWORK: APP_ENV.antd 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.fa995cb26515e0ecf4f3.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/16 17:27:02) 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.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>

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

@ -42,4 +42,10 @@ public class TaskListIssueController {
public SingleResponse closeTaskIssueId(@PathVariable String taskIssueId) { public SingleResponse closeTaskIssueId(@PathVariable String taskIssueId) {
return taskListService.close(taskIssueId); return taskListService.close(taskIssueId);
} }
@ApiOperation("统计执行者为指定用户的下发记录数量")
@GetMapping("/countByExecuteUserId")
public SingleResponse<Long> countByExecuteUserId(@RequestParam Long userId) {
return taskListService.countIssueByExecuteUserId(userId);
}
} }

View File

@ -0,0 +1,110 @@
package com.zcloud.safetyDutyList.command.query.tasklist;
import cn.hutool.json.JSONUtil;
import com.alibaba.cola.dto.SingleResponse;
import com.alibaba.fastjson.JSONObject;
import com.jjb.saas.message.client.message.facede.MessageFacade;
import com.jjb.saas.message.client.message.request.MessageSendCmd;
import com.jjb.saas.message.client.message.request.MessageTargetCmd;
import com.zcloud.gbscommon.todolistmq.TodoListEventPusherUtil;
import com.zcloud.gbscommon.todolistmq.event.TodoListAddEvent;
import com.zcloud.gbscommon.todolistmq.event.TodoListCompleteEvent;
import com.zcloud.gbscommon.todolistmq.event.TodoListDeleteEvent;
import com.zcloud.gbscommon.utils.Tools;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* web-app
*
* @Author zhaokai
* @Date 2026-03-16 10:00:38
*/
@Component
@AllArgsConstructor
@Slf4j
public class MessageNoticeExe {
private final TodoListEventPusherUtil todoListEventPusherUtil;
@DubboReference
private MessageFacade messageFacade;
public void messageNotice(Long userId, String sourceCode,Map<String, Object> sendParams) {
//消息通知
try{
MessageSendCmd messageSendCmd = new MessageSendCmd();
messageSendCmd.setBusinessId(Tools.get32UUID());
MessageTargetCmd messageTargetCmd = new MessageTargetCmd();
messageTargetCmd.setUserId(userId);
messageSendCmd.setTargetCmd(messageTargetCmd);
messageSendCmd.setSourceCode(sourceCode);
messageSendCmd.setNeedTokenEnum(false);
messageSendCmd.setParams(sendParams);
log.info("{},消息提醒发送消息参数:messageSendCmd: {}",sourceCode, JSONUtil.toJsonStr(messageSendCmd));
SingleResponse<Boolean> d = messageFacade.send(messageSendCmd);
log.info("{},消息提醒发送消息结果:d: {}", sourceCode,JSONUtil.toJsonStr(d));
}catch (Exception e) {
log.error("{},消息提醒发送消息异常:", sourceCode,e);
}
}
@Async("asyncExecutor")
public void sendMessageAddEvent(Long userId, String title,String content, Long foreignKey, Long foreignSubsidiaryKey) {
//消息通知
try{
// 发送待办
TodoListAddEvent event = new TodoListAddEvent();
event.setTitle(title);
event.setContent(content);
event.setForeignKey(foreignKey); // 业务表ID -申请
event.setForeignSubsidiaryKey(foreignSubsidiaryKey); // 业务附表ID 没有附表时为foreignKey的值
event.setReceiveUser(userId);// user表ID
event.setPcFlag(1); // 是否PC端待办 1是 0否
event.setAppFlag(1); // 是否APP端待办 1是 0否
event.setOtherParams(new JSONObject());
log.info("待办,请求:{}",event);
//为了防止先被完成
Thread.sleep(2000L);
boolean b = todoListEventPusherUtil.sendMessageAddEvent(event);
log.info("待办,结果:{}",b);
}catch (Exception e) {
log.error("消息待办,{},发送消息异常:", title,e);
}
}
public void sendMessageCompleteEvent(Long foreignKey) {
//消息通知
try{
// 发送待办
TodoListCompleteEvent event = new TodoListCompleteEvent();
event.setForeignSubsidiaryKey(foreignKey);// 业务附表ID 没有附表时为foreignKey的值
log.info("完成待办,请求:{}",foreignKey);
boolean b = todoListEventPusherUtil.sendMessageCompleteEvent(event);
log.info("完成待办,结果:{}",b);
}catch (Exception e) {
log.error("完成待办失败",e);
}
}
public void sendMessageDeleteEvent(Long foreignKey) {
try{
TodoListDeleteEvent event2 = new TodoListDeleteEvent();
event2.setForeignSubsidiaryKey(foreignKey);// 业务附表ID 没有附表时为foreignKey的值
log.info("删除待办,请求:{}",foreignKey);
boolean b = todoListEventPusherUtil.sendMessageDeleteEvent(event2);
log.info("删除待办,结果:{}",b);
}catch (Exception e) {
log.error("完成待办失败",e);
}
}
}

View File

@ -3,15 +3,22 @@ package com.zcloud.safetyDutyList.command.query.tasklist;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse; import com.alibaba.cola.dto.SingleResponse;
import com.alibaba.cola.exception.BizException; import com.alibaba.cola.exception.BizException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zcloud.gbscommon.utils.PageQueryHelper; import com.zcloud.gbscommon.utils.PageQueryHelper;
import com.zcloud.safetyDutyList.domain.util.FeedbackCycleUtil;
import com.zcloud.safetyDutyList.dto.clientobject.tasklist.TaskExecutionCO; import com.zcloud.safetyDutyList.dto.clientobject.tasklist.TaskExecutionCO;
import com.zcloud.safetyDutyList.dto.tasklist.TaskExecutionPageQry; import com.zcloud.safetyDutyList.dto.tasklist.TaskExecutionPageQry;
import com.zcloud.safetyDutyList.persistence.dataobject.tasklist.FeedbackDO;
import com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskExecutionDO; import com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskExecutionDO;
import com.zcloud.safetyDutyList.persistence.repository.tasklist.FeedbackRepository;
import com.zcloud.safetyDutyList.persistence.repository.tasklist.TaskExecutionRepository; import com.zcloud.safetyDutyList.persistence.repository.tasklist.TaskExecutionRepository;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -23,13 +30,33 @@ import java.util.stream.Collectors;
@AllArgsConstructor @AllArgsConstructor
public class TaskExecutionQueryExe { public class TaskExecutionQueryExe {
private final TaskExecutionRepository taskExecutionRepository; private final TaskExecutionRepository taskExecutionRepository;
private final FeedbackRepository feedbackRepository;
public PageResponse<TaskExecutionCO> listPage(TaskExecutionPageQry qry) { public PageResponse<TaskExecutionCO> listPage(TaskExecutionPageQry qry) {
Map<String, Object> params = PageQueryHelper.toHashMap(qry); Map<String, Object> params = PageQueryHelper.toHashMap(qry);
PageResponse<TaskExecutionDO> pageResponse = taskExecutionRepository.listPage(params); PageResponse<TaskExecutionDO> pageResponse = taskExecutionRepository.listPage(params);
if (pageResponse.isEmpty()) {
return PageResponse.of(new ArrayList <>(), pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
}
// 获取所有的反馈
List<String> executionIds = pageResponse.getData().stream().map(d -> d.getTaskExecutionId()).collect(Collectors.toList());
Map<String, List<FeedbackDO>> feedbackMap = ObtainFeedback(executionIds);
List<TaskExecutionCO> coList = pageResponse.getData().stream().map(d -> { List<TaskExecutionCO> coList = pageResponse.getData().stream().map(d -> {
TaskExecutionCO co = new TaskExecutionCO(); TaskExecutionCO co = new TaskExecutionCO();
BeanUtils.copyProperties(d, co); BeanUtils.copyProperties(d, co);
co.setFeedbackCount(0);
co.setCurrentPeriodFeedback(0);
List<FeedbackDO> feedbackDOList = feedbackMap.get(d.getTaskExecutionId());
if (feedbackDOList != null && feedbackDOList.size() > 0) {
co.setFeedbackCount(feedbackDOList.size());
String periodFlag = FeedbackCycleUtil.generatePeriodFlag(co.getFeedbackCycleType(), LocalDateTime.now());
long matchNum = feedbackDOList.stream()
.filter(item -> periodFlag.equals(item.getFeedbackPeriodFlag()))
.count();
co.setCurrentPeriodFeedback(matchNum > 0 ? 1 : 0);
}
return co; return co;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return PageResponse.of(coList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex()); return PageResponse.of(coList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
@ -44,4 +71,19 @@ public class TaskExecutionQueryExe {
BeanUtils.copyProperties(executionDO, co); BeanUtils.copyProperties(executionDO, co);
return SingleResponse.of(co); return SingleResponse.of(co);
} }
private Map<String, List<FeedbackDO>> ObtainFeedback(List<String> executionIds) {
// 获取所有的反馈
Map<String, List<FeedbackDO>> feedbackMap = new HashMap <>();
QueryWrapper<FeedbackDO> feedbackQueryWrapper = new QueryWrapper<>();
feedbackQueryWrapper.in("task_execution_id", executionIds);
List<FeedbackDO> feedbackList = feedbackRepository.list(feedbackQueryWrapper);
if (feedbackList != null && feedbackList.size() > 0) {
feedbackMap = feedbackList.stream().collect(Collectors.groupingBy(FeedbackDO::getTaskExecutionId));
}
return feedbackMap;
}
} }

View File

@ -13,6 +13,7 @@ import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.YearMonth;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -32,6 +33,8 @@ public class TaskListIssueQueryExe {
List<TaskListIssueCO> coList = pageResponse.getData().stream().map(d -> { List<TaskListIssueCO> coList = pageResponse.getData().stream().map(d -> {
TaskListIssueCO co = new TaskListIssueCO(); TaskListIssueCO co = new TaskListIssueCO();
BeanUtils.copyProperties(d, co); BeanUtils.copyProperties(d, co);
co.setPeriodStartTime(YearMonth.from(d.getPeriodStartTime()));
co.setPeriodEndTime(YearMonth.from(d.getPeriodEndTime()));
return co; return co;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return PageResponse.of(coList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex()); return PageResponse.of(coList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
@ -46,4 +49,15 @@ public class TaskListIssueQueryExe {
BeanUtils.copyProperties(issueDO, co); BeanUtils.copyProperties(issueDO, co);
return SingleResponse.of(co); return SingleResponse.of(co);
} }
/**
*
*
* @param executeUserId ID
* @return
*/
public SingleResponse<Long> countByExecuteUserId(Long executeUserId) {
long count = taskListIssueRepository.countByExecuteUserId(executeUserId);
return SingleResponse.of(count);
}
} }

View File

@ -1,5 +1,6 @@
package com.zcloud.safetyDutyList.command.tasklist; package com.zcloud.safetyDutyList.command.tasklist;
import com.zcloud.safetyDutyList.command.query.tasklist.MessageNoticeExe;
import com.zcloud.safetyDutyList.domain.enums.TaskStatusEnum; import com.zcloud.safetyDutyList.domain.enums.TaskStatusEnum;
import com.zcloud.safetyDutyList.domain.gateway.tasklist.*; import com.zcloud.safetyDutyList.domain.gateway.tasklist.*;
import com.zcloud.safetyDutyList.domain.model.tasklist.*; import com.zcloud.safetyDutyList.domain.model.tasklist.*;
@ -35,6 +36,7 @@ public class SendTodoMessageExe {
private final TaskExecutionGateway taskExecutionGateway; private final TaskExecutionGateway taskExecutionGateway;
private final TaskDetailGateway taskDetailGateway; private final TaskDetailGateway taskDetailGateway;
private final FeedbackGateway feedbackGateway; private final FeedbackGateway feedbackGateway;
private final MessageNoticeExe messageNoticeExe;
@Scheduled(cron = "0 0 0 1 * ?") @Scheduled(cron = "0 0 0 1 * ?")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -68,6 +70,7 @@ public class SendTodoMessageExe {
continue; continue;
} }
// 当前周期标识
String currentCycleFlag = FeedbackCycleUtil.generatePeriodFlag(feedbackCycleType, LocalDateTime.now()); String currentCycleFlag = FeedbackCycleUtil.generatePeriodFlag(feedbackCycleType, LocalDateTime.now());
// 检查阶段内是否有反馈记录 // 检查阶段内是否有反馈记录

View File

@ -35,7 +35,7 @@ public class TaskListIssueCloseExe {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void execute(String taskIssueId) { public void execute(String taskIssueId) {
// 1. 关闭清单模板 // 1. 关闭清单下发
TaskListIssueE issueE = taskListIssueGateway.getByTaskIssueId(taskIssueId); TaskListIssueE issueE = taskListIssueGateway.getByTaskIssueId(taskIssueId);
if (issueE == null) { if (issueE == null) {
throw new BizException("清单下发记录不存在"); throw new BizException("清单下发记录不存在");

View File

@ -47,6 +47,15 @@ public class TaskListIssueExe {
throw new BizException("用户未登录"); throw new BizException("用户未登录");
} }
// 处理周期时间
LocalDateTime startTime = cmd.getPeriodStartTime().atDay(1).atStartOfDay();
LocalDateTime endTime = cmd.getPeriodEndTime().atEndOfMonth().atTime(23, 59, 59);
// 重复下发校验(同一清单+公司+部门+人员+时间段重叠)
if (isDuplicateIssue(cmd.getTaskListId(), cmd.getExecuteCorpId(), cmd.getExecuteDepartmentId(), cmd.getExecuteUserId(), startTime, endTime)) {
throw new BizException("该清单在相同时间段内已下发给该公司部门人员,不可重复下发");
}
TaskListE taskListE = taskListGateway.getInfoByTaskListId(cmd.getTaskListId()); TaskListE taskListE = taskListGateway.getInfoByTaskListId(cmd.getTaskListId());
if (taskListE == null) { if (taskListE == null) {
throw new BizException("任务清单不存在"); throw new BizException("任务清单不存在");
@ -60,17 +69,6 @@ public class TaskListIssueExe {
throw new BizException("任务清单下无任务可执行"); throw new BizException("任务清单下无任务可执行");
} }
// 1. 处理周期时间
LocalDateTime startTime = cmd.getPeriodStartTime().atDay(1).atStartOfDay();
LocalDateTime endTime = cmd.getPeriodEndTime().atEndOfMonth().atTime(23, 59, 59);
// LocalDateTime startTime = cmd.getPeriodStartTime()
// .withDayOfMonth(1)
// .with(LocalTime.MIN);
// LocalDateTime endTime = cmd.getPeriodEndTime()
// .withDayOfMonth(cmd.getPeriodEndTime().toLocalDate().lengthOfMonth())
// .with(LocalTime.of(23, 59, 59));
// 2. 创建清单下发记录 // 2. 创建清单下发记录
TaskListIssueE issueE = new TaskListIssueE(); TaskListIssueE issueE = new TaskListIssueE();
issueE.init(); issueE.init();
@ -108,4 +106,12 @@ public class TaskListIssueExe {
taskExecutionGateway.batchAdd(executionList); taskExecutionGateway.batchAdd(executionList);
} }
} }
/**
* ++++
*/
private Boolean isDuplicateIssue(String taskListId, Long executeCorpId, Long executeDepartmentId, Long executeUserId,
LocalDateTime periodStartTime, LocalDateTime periodEndTime) {
return taskListIssueGateway.isDuplicateIssue(taskListId, executeCorpId, executeDepartmentId, executeUserId, periodStartTime, periodEndTime);
}
} }

View File

@ -234,6 +234,11 @@ public class TaskListServiceImpl implements TaskListServiceI {
return taskListIssueQueryExe.getByTaskIssueId(taskIssueId); return taskListIssueQueryExe.getByTaskIssueId(taskIssueId);
} }
@Override
public SingleResponse<Long> countIssueByExecuteUserId(Long executeUserId) {
return taskListIssueQueryExe.countByExecuteUserId(executeUserId);
}
@Override @Override
public PageResponse<TaskExecutionCO> listExecutionPage(TaskExecutionPageQry qry) { public PageResponse<TaskExecutionCO> listExecutionPage(TaskExecutionPageQry qry) {
return taskExecutionQueryExe.listPage(qry); return taskExecutionQueryExe.listPage(qry);

View File

@ -250,6 +250,14 @@ public interface TaskListServiceI {
*/ */
SingleResponse<TaskListIssueCO> getIssueByTaskIssueId(String taskIssueId); SingleResponse<TaskListIssueCO> getIssueByTaskIssueId(String taskIssueId);
/**
*
*
* @param executeUserId ID
* @return
*/
SingleResponse<Long> countIssueByExecuteUserId(Long executeUserId);
/** /**
* task_execution * task_execution
* *

View File

@ -7,6 +7,7 @@ import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.YearMonth;
/** /**
* *
@ -53,11 +54,9 @@ public class TaskListIssueCO extends ClientObject {
@ApiModelProperty(value = "下发人员") @ApiModelProperty(value = "下发人员")
private Long issueUserId; private Long issueUserId;
@ApiModelProperty(value = "执行周期开始时间") @ApiModelProperty(value = "执行周期开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private YearMonth periodStartTime;
private LocalDateTime periodStartTime;
@ApiModelProperty(value = "执行周期结束时间") @ApiModelProperty(value = "执行周期结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private YearMonth periodEndTime;
private LocalDateTime periodEndTime;
@ApiModelProperty(value = "状态1-进行中 2-已完成 3-已关闭") @ApiModelProperty(value = "状态1-进行中 2-已完成 3-已关闭")
private Integer status; private Integer status;
@ApiModelProperty(value = "关闭时间") @ApiModelProperty(value = "关闭时间")

View File

@ -18,4 +18,8 @@ public class FeedbackListQry extends PageQuery {
private String taskExecutionId; private String taskExecutionId;
@ApiModelProperty(value = "周期标识", required = true) @ApiModelProperty(value = "周期标识", required = true)
private String feedbackPeriodFlag; private String feedbackPeriodFlag;
@ApiModelProperty(value = "反馈时间开始格式yyyy-MM-dd")
private String feedbackTimeStart;
@ApiModelProperty(value = "反馈时间结束格式yyyy-MM-dd")
private String feedbackTimeEnd;
} }

View File

@ -25,4 +25,11 @@ public interface TaskListIssueGateway {
// 清单是否下发 // 清单是否下发
Boolean isIssued(String taskListId); Boolean isIssued(String taskListId);
/**
* ++++
* @return true=false=
*/
Boolean isDuplicateIssue(String taskListId, Long executeCorpId, Long executeDepartmentId, Long executeUserId,
java.time.LocalDateTime periodStartTime, java.time.LocalDateTime periodEndTime);
} }

View File

@ -101,4 +101,12 @@ public class TaskListIssueGatewayImpl implements TaskListIssueGateway {
List<TaskListIssueDO> taskListIssueDOList = taskListIssueRepository.listByTaskListId(taskListId); List<TaskListIssueDO> taskListIssueDOList = taskListIssueRepository.listByTaskListId(taskListId);
return taskListIssueDOList != null && taskListIssueDOList.size() > 0; return taskListIssueDOList != null && taskListIssueDOList.size() > 0;
} }
// 清单是否重复下发(同一清单+公司+部门+人员+时间段重叠)
@Override
public Boolean isDuplicateIssue(String taskListId, Long executeCorpId, Long executeDepartmentId, Long executeUserId,
java.time.LocalDateTime periodStartTime, java.time.LocalDateTime periodEndTime){
List<TaskListIssueDO> taskListIssueDOList = taskListIssueRepository.listByIssueInfo(taskListId, executeCorpId, executeDepartmentId, executeUserId, periodStartTime, periodEndTime);
return taskListIssueDOList != null && taskListIssueDOList.size() > 0;
}
} }

View File

@ -19,6 +19,9 @@ public interface TaskListIssueMapper extends BaseMapper<TaskListIssueDO> {
List<TaskListIssueDO> listByTaskListId(String taskListId); List<TaskListIssueDO> listByTaskListId(String taskListId);
List<TaskListIssueDO> listByIssueInfo(String taskListId, Long executeCorpId, Long executeDepartmentId, Long executeUserId,
java.time.LocalDateTime periodStartTime, java.time.LocalDateTime periodEndTime);
List<TaskListIssueDO> listExpiredInProgress(); List<TaskListIssueDO> listExpiredInProgress();
List<TaskListIssueDO> listIssuedWithPeriod(); List<TaskListIssueDO> listIssuedWithPeriod();

View File

@ -1,6 +1,7 @@
package com.zcloud.safetyDutyList.persistence.repository.impl.tasklist; package com.zcloud.safetyDutyList.persistence.repository.impl.tasklist;
import com.alibaba.cola.dto.PageResponse; import com.alibaba.cola.dto.PageResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.repository.common.PageHelper; import com.jjb.saas.framework.repository.common.PageHelper;
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl; import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
@ -44,6 +45,12 @@ public class TaskListIssueRepositoryImpl extends BaseRepositoryImpl<TaskListIssu
return taskListIssueMapper.listByTaskListId(taskListId); return taskListIssueMapper.listByTaskListId(taskListId);
} }
@Override
public List<TaskListIssueDO> listByIssueInfo(String taskListId, Long executeCorpId, Long executeDepartmentId, Long executeUserId,
java.time.LocalDateTime periodStartTime, java.time.LocalDateTime periodEndTime) {
return taskListIssueMapper.listByIssueInfo(taskListId, executeCorpId, executeDepartmentId, executeUserId, periodStartTime, periodEndTime);
}
@Override @Override
public List<TaskListIssueDO> listExpiredInProgress() { public List<TaskListIssueDO> listExpiredInProgress() {
return taskListIssueMapper.listExpiredInProgress(); return taskListIssueMapper.listExpiredInProgress();
@ -53,4 +60,13 @@ public class TaskListIssueRepositoryImpl extends BaseRepositoryImpl<TaskListIssu
public List<TaskListIssueDO> listIssuedWithPeriod() { public List<TaskListIssueDO> listIssuedWithPeriod() {
return taskListIssueMapper.listIssuedWithPeriod(); return taskListIssueMapper.listIssuedWithPeriod();
} }
@Override
public long countByExecuteUserId(Long executeUserId) {
QueryWrapper<TaskListIssueDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("execute_user_id", executeUserId);
queryWrapper.eq("delete_enum", "FALSE");
return taskListIssueMapper.selectCount(queryWrapper);
}
} }

View File

@ -17,7 +17,18 @@ public interface TaskListIssueRepository extends BaseRepository<TaskListIssueDO>
List<TaskListIssueDO> listByTaskListId(String taskListId); List<TaskListIssueDO> listByTaskListId(String taskListId);
List<TaskListIssueDO> listByIssueInfo(String taskListId, Long executeCorpId, Long executeDepartmentId, Long executeUserId,
java.time.LocalDateTime periodStartTime, java.time.LocalDateTime periodEndTime);
List<TaskListIssueDO> listExpiredInProgress(); List<TaskListIssueDO> listExpiredInProgress();
List<TaskListIssueDO> listIssuedWithPeriod(); List<TaskListIssueDO> listIssuedWithPeriod();
/**
*
*
* @param executeUserId ID
* @return
*/
long countByExecuteUserId(Long executeUserId);
} }

View File

@ -25,6 +25,14 @@
<if test="params.feedbackPeriodFlag != null and params.feedbackPeriodFlag != ''"> <if test="params.feedbackPeriodFlag != null and params.feedbackPeriodFlag != ''">
AND f.feedback_period_flag = #{params.feedbackPeriodFlag} AND f.feedback_period_flag = #{params.feedbackPeriodFlag}
</if> </if>
<!-- 开始时间筛选:大于等于当天零点 -->
<if test="params.feedbackTimeStart != null and params.feedbackTimeStart != ''">
AND f.feedback_time &gt;= STR_TO_DATE(#{params.feedbackTimeStart}, '%Y-%m-%d')
</if>
<!-- 结束时间筛选小于等于当天23:59:59 -->
<if test="params.feedbackTimeEnd != null and params.feedbackTimeEnd != ''">
AND f.feedback_time &lt; DATE_ADD(STR_TO_DATE(#{params.feedbackTimeEnd}, '%Y-%m-%d'), INTERVAL 1 DAY)
</if>
</where> </where>
ORDER BY f.feedback_time DESC ORDER BY f.feedback_time DESC
</select> </select>

View File

@ -13,22 +13,12 @@
tl.task_level AS taskLevel, tl.task_level AS taskLevel,
tl.responsibility_post AS responsibilityPost, tl.responsibility_post AS responsibilityPost,
rating_dept.name AS ratingDepartmentName, rating_dept.name AS ratingDepartmentName,
rating_user.name AS ratingUserName, rating_user.name AS ratingUserName
IFNULL(fb_agg.feedback_count, 0) AS feedbackCount,
IFNULL(fb_agg.current_period_feedback, 0) AS currentPeriodFeedback
FROM safety_accountability_task_execution te FROM safety_accountability_task_execution te
LEFT JOIN safety_accountability_task_detail td ON te.task_detail_id = td.task_detail_id AND td.delete_enum = 'FALSE' LEFT JOIN safety_accountability_task_detail td ON te.task_detail_id = td.task_detail_id AND td.delete_enum = 'FALSE'
LEFT JOIN safety_accountability_task_list tl ON te.task_list_id = tl.task_list_id AND tl.delete_enum = 'FALSE' LEFT JOIN safety_accountability_task_list tl ON te.task_list_id = tl.task_list_id AND tl.delete_enum = 'FALSE'
LEFT JOIN department rating_dept ON te.rating_department_id = rating_dept.id LEFT JOIN department rating_dept ON te.rating_department_id = rating_dept.id
LEFT JOIN user rating_user ON te.rating_user_id = rating_user.id LEFT JOIN user rating_user ON te.rating_user_id = rating_user.id
LEFT JOIN (
SELECT task_execution_id,
COUNT(*) AS feedback_count,
MAX(CASE WHEN feedback_period_flag = DATE_FORMAT(NOW(), '%Y-%m') THEN 1 ELSE 0 END) AS current_period_feedback
FROM safety_accountability_feedback
WHERE delete_enum = 'FALSE'
GROUP BY task_execution_id
) fb_agg ON te.task_execution_id = fb_agg.task_execution_id
<where> <where>
te.delete_enum = 'FALSE' te.delete_enum = 'FALSE'
<if test="params.taskIssueId != null and params.taskIssueId != ''"> <if test="params.taskIssueId != null and params.taskIssueId != ''">

View File

@ -55,7 +55,7 @@
<if test="params.status != null"> <if test="params.status != null">
AND tli.status = #{params.status} AND tli.status = #{params.status}
</if> </if>
<if test="params.scoreStatus != null and params.scoreStatus != ''"> <if test="params.scoreStatus != null">
<!-- 状态必须是 2 已完成 或 3 已关闭 --> <!-- 状态必须是 2 已完成 或 3 已关闭 -->
AND tli.status IN (2, 3) AND tli.status IN (2, 3)
<!-- scoreStatus = 0分数为空 --> <!-- scoreStatus = 0分数为空 -->
@ -171,6 +171,19 @@
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="listByIssueInfo" resultType="com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskListIssueDO">
SELECT * FROM safety_accountability_task_list_issue
WHERE
delete_enum = 'FALSE'
AND task_list_id = #{taskListId}
AND execute_corp_id = #{executeCorpId}
AND execute_department_id = #{executeDepartmentId}
AND execute_user_id = #{executeUserId}
AND period_start_time &lt; #{periodEndTime}
AND period_end_time &gt; #{periodStartTime}
ORDER BY create_time DESC
</select>
<select id="listExpiredInProgress" resultType="com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskListIssueDO"> <select id="listExpiredInProgress" resultType="com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskListIssueDO">
SELECT * FROM safety_accountability_task_list_issue SELECT * FROM safety_accountability_task_list_issue
WHERE status = 1 AND issue_status = 1 AND (period_end_time IS NOT NULL AND period_end_time &lt; NOW()) AND delete_enum = 'FALSE' WHERE status = 1 AND issue_status = 1 AND (period_end_time IS NOT NULL AND period_end_time &lt; NOW()) AND delete_enum = 'FALSE'