Commit 222d1e92 by unknown

1002449时间管理模板中消息配置较多配置项,可优化向下拷贝上次已配置的内容

parent 2426e6cf
...@@ -62,4 +62,6 @@ public interface TaskBiz { ...@@ -62,4 +62,6 @@ public interface TaskBiz {
TaskDto getTaskByIdAndWxUserId(Integer relSkillId, String wxUserId); TaskDto getTaskByIdAndWxUserId(Integer relSkillId, String wxUserId);
void sendReplyMessage(List<TimeControlReplyMessage> replyMessages, String wxUserId, String robotWxId, String ip); void sendReplyMessage(List<TimeControlReplyMessage> replyMessages, String wxUserId, String robotWxId, String ip);
Integer copyTaskItem(Integer taskItemId);
} }
...@@ -763,4 +763,24 @@ public class TaskBizImpl implements TaskBiz { ...@@ -763,4 +763,24 @@ public class TaskBizImpl implements TaskBiz {
} }
} }
@Override
public Integer copyTaskItem(Integer taskItemId) {
TimeControlTaskItem timeControlTaskItem = taskItemMapper.selectByPrimaryKey(taskItemId);
if (null != timeControlTaskItem) {
timeControlTaskItem.setId(null);
timeControlTaskItem.setStartDay(timeControlTaskItem.getStartDay() + 1);
taskItemMapper.insert(timeControlTaskItem);
Integer newItemId = timeControlTaskItem.getId();
List<TimeControlReplyMessage> list = replyMessageMapper.list4TaskItem(taskItemId,null);
if (!ListUtils.isEmpty(list)) {
list.forEach(replyMessage -> {
replyMessage.setTaskItemId(newItemId);
});
replyMessageMapper.batchInsert(list);
}
return newItemId;
}
return null;
}
} }
...@@ -161,4 +161,11 @@ public class TimeControlTaskFacadeImpl { ...@@ -161,4 +161,11 @@ public class TimeControlTaskFacadeImpl {
taskBiz.finishTaskSend(taskSendId); taskBiz.finishTaskSend(taskSendId);
return new ResponseDto<>(); return new ResponseDto<>();
} }
@ApiOperation(value = "复制消息配置", httpMethod = "GET")
@GetMapping("copyTaskItem")
ResponseDto<?> copyTaskItem(@RequestHeader String token, @RequestParam Integer taskItemId){
Integer id = taskBiz.copyTaskItem(taskItemId);
return new ResponseDto<>(id);
}
} }
\ No newline at end of file
...@@ -32,7 +32,10 @@ ...@@ -32,7 +32,10 @@
select task_id, task_item_id, type, reply_type, serve_id, resource_id, pic_url, serve_type, select task_id, task_item_id, type, reply_type, serve_id, resource_id, pic_url, serve_type,
description, create_time, content, link_url description, create_time, content, link_url
from time_control_reply_message from time_control_reply_message
where task_item_id = #{taskItemId} and type = #{type} where task_item_id = #{taskItemId}
<if test="type != null">
and type = #{type}
</if>
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
......
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