Commit c3247272 by “zcwang”

fix bug:自动执行重复发邮件

parent 704d1e43
Pipeline #44235 passed with stages
in 1 minute 33 seconds
...@@ -821,6 +821,8 @@ public class ChangeFlowBiz { ...@@ -821,6 +821,8 @@ public class ChangeFlowBiz {
// 更改变更结果确认时间 // 更改变更结果确认时间
changeRecord.setChangeConfirmResultTime(changeConfirmResultTime); changeRecord.setChangeConfirmResultTime(changeConfirmResultTime);
changeRecord.setUpdateTime(DateUtils.getCurrentTime()); changeRecord.setUpdateTime(DateUtils.getCurrentTime());
// 延期需要重新发邮件,改变执行邮件状态
changeRecord.setAutoSubmitEmail(false);
changeFlowService.updateRecord(changeRecord); changeFlowService.updateRecord(changeRecord);
return null; return null;
default: default:
......
...@@ -55,10 +55,11 @@ public interface ChangeFlowService { ...@@ -55,10 +55,11 @@ public interface ChangeFlowService {
* 根据状态及时间获取数据 * 根据状态及时间获取数据
* *
* @param entityId * @param entityId
* @param sendEmail
* @param nodeId1 * @param nodeId1
* @param nodeId2 * @param nodeId2
* @param tomorrowSpecificTime * @param tomorrowSpecificTime
* @return * @return
*/ */
List<ChangeRecord> getByStatusAndTime(Long entityId, String nodeId1, String nodeId2, long tomorrowSpecificTime); List<ChangeRecord> getByStatusAndTime(Long entityId, Integer sendEmail, String nodeId1, String nodeId2, long tomorrowSpecificTime);
} }
\ No newline at end of file
...@@ -56,7 +56,7 @@ public class ChangeFlowServiceImpl implements ChangeFlowService { ...@@ -56,7 +56,7 @@ public class ChangeFlowServiceImpl implements ChangeFlowService {
} }
@Override @Override
public List<ChangeRecord> getByStatusAndTime(Long entityId, String nodeId1, String nodeId2, long tomorrowSpecificTime) { public List<ChangeRecord> getByStatusAndTime(Long entityId, Integer sendEmail, String nodeId1, String nodeId2, long tomorrowSpecificTime) {
return changeRecordMapper.getByStatusAndTime(entityId, nodeId1, nodeId2, tomorrowSpecificTime); return changeRecordMapper.getByStatusAndTime(entityId, sendEmail, nodeId1, nodeId2, tomorrowSpecificTime);
} }
} }
\ No newline at end of file
...@@ -81,10 +81,10 @@ public class AutoSubmit extends IJobHandler { ...@@ -81,10 +81,10 @@ public class AutoSubmit extends IJobHandler {
Long tomorrowSpecificTime = DateUtils.getTomorrowSpecificTime("00:00:00"); Long tomorrowSpecificTime = DateUtils.getTomorrowSpecificTime("00:00:00");
List<Long> count = new ArrayList<>(); List<Long> count = new ArrayList<>();
Long entityId = 0L; Long entityId = 0L;
// 查询今天时间之前的数据 // 查询今天时间之前的未发送邮件的数据
try { try {
while (true) { while (true) {
List<ChangeRecord> records = changeFlowService.getByStatusAndTime(entityId, List<ChangeRecord> records = changeFlowService.getByStatusAndTime(entityId, 0,
ChangeFlowEnum.CHANGE_FLOW_EXE.getNodeId(), ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getNodeId(), ChangeFlowEnum.CHANGE_FLOW_EXE.getNodeId(), ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getNodeId(),
tomorrowSpecificTime); tomorrowSpecificTime);
if (CollectionUtils.isEmpty(records)) { if (CollectionUtils.isEmpty(records)) {
......
...@@ -168,6 +168,11 @@ public class ChangeRecord { ...@@ -168,6 +168,11 @@ public class ChangeRecord {
private Integer todoId; private Integer todoId;
/** /**
* 自动执行邮件发送
*/
private Boolean autoSubmitEmail;
/**
* 创建时间 * 创建时间
*/ */
private Long createTime; private Long createTime;
......
...@@ -29,7 +29,7 @@ public interface ChangeRecordMapper extends tk.mybatis.mapper.common.Mapper<Chan ...@@ -29,7 +29,7 @@ public interface ChangeRecordMapper extends tk.mybatis.mapper.common.Mapper<Chan
List<ChangeRecord> selectByConditionAndLimit(ChangeFlowListQueryReq changeFlowListQueryReq); List<ChangeRecord> selectByConditionAndLimit(ChangeFlowListQueryReq changeFlowListQueryReq);
@Select("select * from TB_YX_QC_CHANGE_RECORD where id > #{entityId} and `flow_node` in (#{nodeId1}, #{nodeId2}) and change_confirm_result_time <= #{currentTime} limit 200") @Select("select * from TB_YX_QC_CHANGE_RECORD where id > #{entityId} and auto_submit_email = #{sendEmail} and `flow_node` in (#{nodeId1}, #{nodeId2}) and change_confirm_result_time <= #{currentTime} limit 200")
List<ChangeRecord> getByStatusAndTime(@Param("entityId") Long entityId, @Param("nodeId1") String nodeId1, List<ChangeRecord> getByStatusAndTime(@Param("entityId") Long entityId, @Param("sendEmail") Integer sendEmail, @Param("nodeId1") String nodeId1,
@Param("nodeId2") String nodeId2, @Param("currentTime") long currentTime); @Param("nodeId2") String nodeId2, @Param("currentTime") long currentTime);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment