提交修改
This commit is contained in:
parent
e1ea17a25d
commit
1e344c6e86
@ -10,6 +10,7 @@ public class ResultDto {
|
|||||||
|
|
||||||
@TaskHeader(value = "进度", order = 1) //返回值如30%, 如果没有可以不填写
|
@TaskHeader(value = "进度", order = 1) //返回值如30%, 如果没有可以不填写
|
||||||
private String rate;
|
private String rate;
|
||||||
|
|
||||||
private Long detailId;
|
private Long detailId;
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
@ -27,4 +28,7 @@ public class ResultDto {
|
|||||||
this.taskId = taskId;
|
this.taskId = taskId;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,14 @@ public class BaseCommand {
|
|||||||
|
|
||||||
protected String[] tokens;
|
protected String[] tokens;
|
||||||
|
|
||||||
protected SysUserEntity user ;
|
protected SysUserEntity user;
|
||||||
|
|
||||||
|
public void init(SysUserEntity user, String[] tokens) throws Exception {
|
||||||
|
this.user = user;
|
||||||
|
this.tokens = tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,47 @@
|
|||||||
|
package com.lz.modules.command.base1000;
|
||||||
|
|
||||||
|
import com.lz.common.utils.Constant;
|
||||||
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.modules.app.utils.t.Tuple;
|
||||||
|
import com.lz.modules.command.BaseCommand;
|
||||||
|
import com.lz.modules.command.ICommand;
|
||||||
|
import com.lz.modules.command.annotation.Description;
|
||||||
|
import com.lz.modules.command.annotation.Name;
|
||||||
|
import com.lz.modules.command.annotation.Summary;
|
||||||
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component("add")
|
||||||
|
@Name("add")
|
||||||
|
@Summary("绩效任务查看 添加 或 更新 ")
|
||||||
|
@Description(Constant.EXAMPLE +
|
||||||
|
" add 1 \"短信开发\"\n" +
|
||||||
|
" add 1 \"短信开发\" 30 \n" +
|
||||||
|
" add 1 \"短信开发\" 30 \"中途遇到问题,可能会慢一点\"\n" +
|
||||||
|
" add 1 -n \"短信开发\" -r 30 \n" +
|
||||||
|
" add 1 -n \"短信开发\" \n" +
|
||||||
|
" add 1 -nr \"短信开发\" 30 \n" +
|
||||||
|
" update 1 -r 30 -m \n" +
|
||||||
|
" add 1 -n \"短信开发\" -r 30 -m \"中途遇到问题,可能会慢一点\"\n" +
|
||||||
|
" add 1 -nrm \"短信开发\" 30 \"中途遇到问题,可能会慢一点\"\n"
|
||||||
|
)
|
||||||
|
@Slf4j
|
||||||
|
public class AddCommand extends BaseCommand implements ICommand<Tuple> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tuple check() throws Exception {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tuple parse() throws Exception {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R process(Tuple tuple) throws Exception {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.lz.modules.command.base1000;
|
||||||
|
|
||||||
|
public class ListCommand {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package com.lz.modules.command.base1000;
|
||||||
|
|
||||||
|
public class UpdateCommand {
|
||||||
|
}
|
||||||
@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -338,7 +339,7 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
if(CollectionUtils.isEmpty(resultDtos)){
|
if(CollectionUtils.isEmpty(resultDtos)){
|
||||||
return Collections.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
List<String> detailIds = resultDtos.stream().map(resultDto -> resultDto.getId() + "").collect(Collectors.toList());
|
List<String> detailIds = new ArrayList<>();//resultDtos.stream().map(resultDto -> resultDto.getId() + "").collect(Collectors.toList());
|
||||||
|
|
||||||
List<ResultDto> dtos = resultTaskMapper.listResultTask(detailIds);
|
List<ResultDto> dtos = resultTaskMapper.listResultTask(detailIds);
|
||||||
for(ResultDto resultDto:dtos){
|
for(ResultDto resultDto:dtos){
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import java.util.Date;
|
|||||||
* <p>
|
* <p>
|
||||||
* </p>*用户执行命令的最后一个值表
|
* </p>*用户执行命令的最后一个值表
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2021-01-26
|
* @since 2021-01-27
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -31,19 +31,22 @@ public class TaskResp implements java.io.Serializable {
|
|||||||
private Date gmtModified;
|
private Date gmtModified;
|
||||||
//索引
|
//索引
|
||||||
@ApiModelProperty(value = "索引 ", name = "indexId")
|
@ApiModelProperty(value = "索引 ", name = "indexId")
|
||||||
private Integer indexId;
|
private Long indexId;
|
||||||
//用户 id
|
//用户 id
|
||||||
@ApiModelProperty(value = "用户 id", name = "userId")
|
@ApiModelProperty(value = "用户 id", name = "userId")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
//返回值内容 id
|
//detailId id
|
||||||
@ApiModelProperty(value = "返回值内容 id", name = "resultId")
|
@ApiModelProperty(value = "detailId id", name = "detailId")
|
||||||
private Long resultId;
|
private Long detailId;
|
||||||
//返回值内容
|
//返回值内容
|
||||||
@ApiModelProperty(value = "返回值内容", name = "content")
|
@ApiModelProperty(value = "返回值内容", name = "content")
|
||||||
private String content;
|
private String content;
|
||||||
//
|
//
|
||||||
@ApiModelProperty(value = "", name = "command")
|
@ApiModelProperty(value = "", name = "command")
|
||||||
private String command;
|
private String command;
|
||||||
|
//任务 id
|
||||||
|
@ApiModelProperty(value = "任务 id", name = "taskId")
|
||||||
|
private Long taskId;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -108,14 +111,14 @@ public class TaskResp implements java.io.Serializable {
|
|||||||
* 索引
|
* 索引
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer getIndexId() {
|
public Long getIndexId() {
|
||||||
return indexId;
|
return indexId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 索引
|
* 索引
|
||||||
* @param indexId
|
* @param indexId
|
||||||
*/
|
*/
|
||||||
public void setIndexId(Integer indexId) {
|
public void setIndexId(Long indexId) {
|
||||||
this.indexId = indexId;
|
this.indexId = indexId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,18 +138,18 @@ public class TaskResp implements java.io.Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回值内容 id
|
* detailId id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Long getResultId() {
|
public Long getDetailId() {
|
||||||
return resultId;
|
return detailId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 返回值内容 id
|
* detailId id
|
||||||
* @param resultId
|
* @param detailId
|
||||||
*/
|
*/
|
||||||
public void setResultId(Long resultId) {
|
public void setDetailId(Long detailId) {
|
||||||
this.resultId = resultId;
|
this.detailId = detailId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -179,6 +182,21 @@ public class TaskResp implements java.io.Serializable {
|
|||||||
this.command = command;
|
this.command = command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务 id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long getTaskId() {
|
||||||
|
return taskId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 任务 id
|
||||||
|
* @param taskId
|
||||||
|
*/
|
||||||
|
public void setTaskId(Long taskId) {
|
||||||
|
this.taskId = taskId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TaskResp{" +
|
return "TaskResp{" +
|
||||||
@ -188,9 +206,10 @@ public class TaskResp implements java.io.Serializable {
|
|||||||
",gmtModified=" + gmtModified +
|
",gmtModified=" + gmtModified +
|
||||||
",indexId=" + indexId +
|
",indexId=" + indexId +
|
||||||
",userId=" + userId +
|
",userId=" + userId +
|
||||||
",resultId=" + resultId +
|
",detailId=" + detailId +
|
||||||
",content=" + content +
|
",content=" + content +
|
||||||
",command=" + command +
|
",command=" + command +
|
||||||
|
",taskId=" + taskId +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,8 +70,8 @@ public class TaskRespServiceImpl extends ServiceImpl<TaskRespMapper, TaskResp> i
|
|||||||
List<TaskResp> taskRespList =new ArrayList<>();
|
List<TaskResp> taskRespList =new ArrayList<>();
|
||||||
for(ResultDto resultDto : list){
|
for(ResultDto resultDto : list){
|
||||||
TaskResp taskResp = new TaskResp();
|
TaskResp taskResp = new TaskResp();
|
||||||
taskResp.setIndexId(resultDto.getIndex());
|
/*taskResp.setIndexId(resultDto.getIndex());
|
||||||
taskResp.setResultId(resultDto.getId());
|
taskResp.setResultId(resultDto.getId());*/
|
||||||
taskResp.setUserId(user.getUserId());
|
taskResp.setUserId(user.getUserId());
|
||||||
taskResp.setContent(resultDto.getContent());
|
taskResp.setContent(resultDto.getContent());
|
||||||
taskResp.setCommand(command);
|
taskResp.setCommand(command);
|
||||||
@ -91,7 +91,7 @@ public class TaskRespServiceImpl extends ServiceImpl<TaskRespMapper, TaskResp> i
|
|||||||
public boolean updateIndex(SysUserEntity userEntity, TaskDto taskDto,String command) {
|
public boolean updateIndex(SysUserEntity userEntity, TaskDto taskDto,String command) {
|
||||||
TaskResp taskResp = taskRespService.selectTaskRespByUserIdIndex(userEntity.getUserId(), taskDto.getId(),command);
|
TaskResp taskResp = taskRespService.selectTaskRespByUserIdIndex(userEntity.getUserId(), taskDto.getId(),command);
|
||||||
if (taskResp != null) {
|
if (taskResp != null) {
|
||||||
taskDto.setId(taskResp.getResultId());
|
taskDto.setId(taskResp.getDetailId());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -118,7 +118,7 @@ public class TaskConvertUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
/*ResultDto resultDto1 = new ResultDto(0, 10l, "哈哈0");
|
/* ResultDto resultDto1 = new ResultDto(0, 10l, "哈哈0");
|
||||||
ResultDto resultDto2 = new ResultDto(1, 11l, "哈哈1");
|
ResultDto resultDto2 = new ResultDto(1, 11l, "哈哈1");
|
||||||
ResultDto resultDto3 = new ResultDto(2, 12l, "哈哈2");
|
ResultDto resultDto3 = new ResultDto(2, 12l, "哈哈2");
|
||||||
ResultDto resultDto4 = new ResultDto(3, 13l, "哈哈3", "30%");
|
ResultDto resultDto4 = new ResultDto(3, 13l, "哈哈3", "30%");
|
||||||
|
|||||||
@ -10,15 +10,16 @@
|
|||||||
<result column="gmt_modified" property="gmtModified"/>
|
<result column="gmt_modified" property="gmtModified"/>
|
||||||
<result column="index_id" property="indexId"/>
|
<result column="index_id" property="indexId"/>
|
||||||
<result column="user_id" property="userId"/>
|
<result column="user_id" property="userId"/>
|
||||||
<result column="result_id" property="resultId"/>
|
<result column="detail_id" property="detailId"/>
|
||||||
<result column="content" property="content"/>
|
<result column="content" property="content"/>
|
||||||
<result column="command" property="command"/>
|
<result column="command" property="command"/>
|
||||||
|
<result column="task_id" property="taskId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, index_id AS indexId, user_id AS userId, result_id AS resultId, content AS content, command AS command
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, index_id AS indexId, user_id AS userId, detail_id AS detailId, content AS content, command AS command, task_id AS taskId
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
@ -33,18 +34,20 @@
|
|||||||
insert into lz_task_resp(
|
insert into lz_task_resp(
|
||||||
<if test="indexId != null">index_id, </if>
|
<if test="indexId != null">index_id, </if>
|
||||||
<if test="userId != null">user_id, </if>
|
<if test="userId != null">user_id, </if>
|
||||||
<if test="resultId != null">result_id, </if>
|
<if test="detailId != null">detail_id, </if>
|
||||||
<if test="content != null">content, </if>
|
<if test="content != null">content, </if>
|
||||||
<if test="command != null">command, </if>
|
<if test="command != null">command, </if>
|
||||||
|
<if test="taskId != null">task_id, </if>
|
||||||
is_delete,
|
is_delete,
|
||||||
gmt_create,
|
gmt_create,
|
||||||
gmt_modified
|
gmt_modified
|
||||||
)values(
|
)values(
|
||||||
<if test="indexId != null">#{ indexId}, </if>
|
<if test="indexId != null">#{ indexId}, </if>
|
||||||
<if test="userId != null">#{ userId}, </if>
|
<if test="userId != null">#{ userId}, </if>
|
||||||
<if test="resultId != null">#{ resultId}, </if>
|
<if test="detailId != null">#{ detailId}, </if>
|
||||||
<if test="content != null">#{ content}, </if>
|
<if test="content != null">#{ content}, </if>
|
||||||
<if test="command != null">#{ command}, </if>
|
<if test="command != null">#{ command}, </if>
|
||||||
|
<if test="taskId != null">#{ taskId}, </if>
|
||||||
0,
|
0,
|
||||||
now(),
|
now(),
|
||||||
now()
|
now()
|
||||||
@ -60,9 +63,10 @@
|
|||||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||||
<if test="indexId != null">index_id = #{indexId},</if>
|
<if test="indexId != null">index_id = #{indexId},</if>
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
<if test="resultId != null">result_id = #{resultId},</if>
|
<if test="detailId != null">detail_id = #{detailId},</if>
|
||||||
<if test="content != null">content = #{content},</if>
|
<if test="content != null">content = #{content},</if>
|
||||||
<if test="command != null">command = #{command}</if>
|
<if test="command != null">command = #{command},</if>
|
||||||
|
<if test="taskId != null">task_id = #{taskId}</if>
|
||||||
</trim>
|
</trim>
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -77,9 +81,10 @@
|
|||||||
gmt_create = #{gmtCreate},
|
gmt_create = #{gmtCreate},
|
||||||
index_id = #{indexId},
|
index_id = #{indexId},
|
||||||
user_id = #{userId},
|
user_id = #{userId},
|
||||||
result_id = #{resultId},
|
detail_id = #{detailId},
|
||||||
content = #{content},
|
content = #{content},
|
||||||
command = #{command}
|
command = #{command},
|
||||||
|
task_id = #{taskId}
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -94,26 +99,27 @@
|
|||||||
insert into lz_task_resp(
|
insert into lz_task_resp(
|
||||||
index_id,
|
index_id,
|
||||||
user_id,
|
user_id,
|
||||||
result_id,
|
detail_id,
|
||||||
content,
|
content,
|
||||||
command,
|
command,
|
||||||
|
task_id,
|
||||||
is_delete,
|
is_delete,
|
||||||
gmt_create,
|
gmt_create,
|
||||||
gmt_modified
|
gmt_modified
|
||||||
) values
|
)values
|
||||||
<foreach collection="taskRespList" item="item" separator=",">
|
<foreach collection="taskRespList" item="item" separator=",">
|
||||||
(
|
(
|
||||||
#{ item.indexId},
|
#{ item.indexId},
|
||||||
#{ item.userId},
|
#{ item.userId},
|
||||||
#{ item.resultId},
|
#{ item.detailId},
|
||||||
#{ item.content},
|
#{ item.content},
|
||||||
#{ item.command},
|
#{ item.command},
|
||||||
|
#{ item.taskId},
|
||||||
0,
|
0,
|
||||||
now(),
|
now(),
|
||||||
now()
|
now()
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user