From 367db0a8f83da733f8a690ce72b862c1587582e3 Mon Sep 17 00:00:00 2001 From: wulin Date: Wed, 9 Dec 2020 14:25:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=92=E5=BA=8F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResultRecordController.java | 2 +- .../modules/flow/model/ResultDetailDto.java | 3 + .../performance/dto/ResultTaskDto.java | 92 +++++++++++++++++-- .../performance/entity/ResultTask.java | 60 ++++++++---- .../mapper/performance/ResultTaskMapper.xml | 51 +++++----- src/test/java/com/lz/mysql/MysqlMain.java | 2 +- 6 files changed, 157 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 8247ca5a..8a551d81 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -962,7 +962,7 @@ public class ResultRecordController extends AbstractController { resultComment.setOptDesc("修改了目标"); resultComment.setComment(commandValue); }else{ - resultComment.setOptDesc(resultComment.getOptDesc() + "修改了目标"); + resultComment.setOptDesc(resultComment.getOptDesc() + "-修改了目标"); resultComment.setComment((resultComment.getComment() == null ? "" : resultComment.getComment()) + commandValue); } diff --git a/src/main/java/com/lz/modules/flow/model/ResultDetailDto.java b/src/main/java/com/lz/modules/flow/model/ResultDetailDto.java index 601b7219..a810ea87 100644 --- a/src/main/java/com/lz/modules/flow/model/ResultDetailDto.java +++ b/src/main/java/com/lz/modules/flow/model/ResultDetailDto.java @@ -1,4 +1,5 @@ package com.lz.modules.flow.model; +import com.lz.modules.performance.dto.ResultTaskDto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -60,6 +61,8 @@ public class ResultDetailDto { private List scoreDtos; @ApiModelProperty(value = "维度id lz_result_model的id", name = "modelId") private Long modelId; + @ApiModelProperty(value = "指标任务列表", name = "taskDtos") + List taskDtos; /** * * @return diff --git a/src/main/java/com/lz/modules/performance/dto/ResultTaskDto.java b/src/main/java/com/lz/modules/performance/dto/ResultTaskDto.java index 9eb2bc7e..71d340c1 100644 --- a/src/main/java/com/lz/modules/performance/dto/ResultTaskDto.java +++ b/src/main/java/com/lz/modules/performance/dto/ResultTaskDto.java @@ -1,21 +1,101 @@ package com.lz.modules.performance.dto; - +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; /** - * @Author: djc - * @Desc: - * @Date: 2020/12/9 10:23 - */ +*

+*

*任务表 +* @author quyixiao +* @since 2020-12-09 +*/ + @Data +@ApiModel(value = "任务表Dto") public class ResultTaskDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; //任务名称 @ApiModelProperty(value = "任务名称", name = "name") private String name; //任务的当前进度 @ApiModelProperty(value = "任务的当前进度", name = "processRate") private BigDecimal processRate; -} + //排序由小到大 + @ApiModelProperty(value = "排序由小到大", name = "orderBy") + private Integer orderBy; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 任务名称 + * @return + */ + public String getName() { + return name; + } + /** + * 任务名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + + + /** + * 任务的当前进度 + * @return + */ + public BigDecimal getProcessRate() { + return processRate; + } + /** + * 任务的当前进度 + * @param processRate + */ + public void setProcessRate(BigDecimal processRate) { + this.processRate = processRate; + } + + /** + * 排序由小到大 + * @return + */ + public Integer getOrderBy() { + return orderBy; + } + /** + * 排序由小到大 + * @param orderBy + */ + public void setOrderBy(Integer orderBy) { + this.orderBy = orderBy; + } + + @Override + public String toString() { + return "ResultTaskDto{" + + ",id=" + id + + ",name=" + name + + ",processRate=" + processRate + + ",orderBy=" + orderBy + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/entity/ResultTask.java b/src/main/java/com/lz/modules/performance/entity/ResultTask.java index 187bb3f8..6eae0fd0 100644 --- a/src/main/java/com/lz/modules/performance/entity/ResultTask.java +++ b/src/main/java/com/lz/modules/performance/entity/ResultTask.java @@ -1,4 +1,5 @@ package com.lz.modules.performance.entity; + import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -9,11 +10,11 @@ import lombok.Data; import java.math.BigDecimal; import java.util.Date; /** -*

-*

*任务表 -* @author quyixiao -* @since 2020-12-08 -*/ + *

+ *

*任务表 + * @author quyixiao + * @since 2020-12-09 + */ @Data @TableName("lz_result_task") @@ -40,15 +41,18 @@ public class ResultTask implements java.io.Serializable { //任务的当前进度 @ApiModelProperty(value = "任务的当前进度", name = "processRate") private BigDecimal processRate; + //排序由小到大 + @ApiModelProperty(value = "排序由小到大", name = "orderBy") + private Integer orderBy; /** - * + * * @return */ public Long getId() { return id; } /** - * + * * @param id */ public void setId(Long id) { @@ -56,14 +60,14 @@ public class ResultTask implements java.io.Serializable { } /** - * 是否删除状态,1:删除,0:有效 + * 是否删除状态,1:删除,0:有效 * @return */ public Integer getIsDelete() { return isDelete; } /** - * 是否删除状态,1:删除,0:有效 + * 是否删除状态,1:删除,0:有效 * @param isDelete */ public void setIsDelete(Integer isDelete) { @@ -71,14 +75,14 @@ public class ResultTask implements java.io.Serializable { } /** - * 创建时间 + * 创建时间 * @return */ public Date getGmtCreate() { return gmtCreate; } /** - * 创建时间 + * 创建时间 * @param gmtCreate */ public void setGmtCreate(Date gmtCreate) { @@ -86,14 +90,14 @@ public class ResultTask implements java.io.Serializable { } /** - * 最后修改时间 + * 最后修改时间 * @return */ public Date getGmtModified() { return gmtModified; } /** - * 最后修改时间 + * 最后修改时间 * @param gmtModified */ public void setGmtModified(Date gmtModified) { @@ -101,14 +105,14 @@ public class ResultTask implements java.io.Serializable { } /** - * 任务名称 + * 任务名称 * @return */ public String getName() { return name; } /** - * 任务名称 + * 任务名称 * @param name */ public void setName(String name) { @@ -116,14 +120,14 @@ public class ResultTask implements java.io.Serializable { } /** - * lz_result_detail 的id + * lz_result_detail 的id * @return */ public Long getDetailId() { return detailId; } /** - * lz_result_detail 的id + * lz_result_detail 的id * @param detailId */ public void setDetailId(Long detailId) { @@ -131,20 +135,35 @@ public class ResultTask implements java.io.Serializable { } /** - * 任务的当前进度 + * 任务的当前进度 * @return */ public BigDecimal getProcessRate() { return processRate; } /** - * 任务的当前进度 + * 任务的当前进度 * @param processRate */ public void setProcessRate(BigDecimal processRate) { this.processRate = processRate; } + /** + * 排序由小到大 + * @return + */ + public Integer getOrderBy() { + return orderBy; + } + /** + * 排序由小到大 + * @param orderBy + */ + public void setOrderBy(Integer orderBy) { + this.orderBy = orderBy; + } + @Override public String toString() { return "ResultTask{" + @@ -155,6 +174,7 @@ public class ResultTask implements java.io.Serializable { ",name=" + name + ",detailId=" + detailId + ",processRate=" + processRate + + ",orderBy=" + orderBy + "}"; } -} \ No newline at end of file +} diff --git a/src/main/resources/mapper/performance/ResultTaskMapper.xml b/src/main/resources/mapper/performance/ResultTaskMapper.xml index c8972a84..eaea5edb 100644 --- a/src/main/resources/mapper/performance/ResultTaskMapper.xml +++ b/src/main/resources/mapper/performance/ResultTaskMapper.xml @@ -11,50 +11,54 @@ + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, detail_id AS detailId, process_rate AS processRate + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, detail_id AS detailId, process_rate AS processRate, order_by AS orderBy insert into lz_result_task( - name, - detail_id, - process_rate, - is_delete, - gmt_create, - gmt_modified + name, + detail_id, + process_rate, + order_by, + is_delete, + gmt_create, + gmt_modified )values( - #{ name}, - #{ detailId}, - #{ processRate}, - 0, - now(), - now() + #{ name}, + #{ detailId}, + #{ processRate}, + #{ orderBy}, + 0, + now(), + now() ) update - lz_result_task + lz_result_task is_delete = #{isDelete}, gmt_create = #{gmtCreate}, name = #{name}, detail_id = #{detailId}, - process_rate = #{processRate} + process_rate = #{processRate}, + order_by = #{orderBy} ,gmt_modified = now() where id = #{id} @@ -63,25 +67,22 @@ update - lz_result_task - set + lz_result_task + set is_delete = #{isDelete}, gmt_create = #{gmtCreate}, name = #{name}, detail_id = #{detailId}, - process_rate = #{processRate} - ,gmt_modified = now() + process_rate = #{processRate}, + order_by = #{orderBy} + ,gmt_modified = now() where id = #{id} - update lz_result_task set is_delete = 1 where id=#{id} limit 1 + update lz_result_task set is_delete = 1 where id=#{id} limit 1 - - diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 24972149..1ebce934 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -84,7 +84,7 @@ public class MysqlMain { List list = new ArrayList(); - list.add(new TablesBean("lz_result_detail")); + list.add(new TablesBean("lz_result_task")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments();