From c64f3aa0e05e916849010966e8df4c7a3fffa303 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Fri, 11 Dec 2020 10:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/TestController.java | 3 +- .../service/impl/StaffRoleServiceImpl.java | 19 ++- .../dao/TaskProcessRecordMapper.java | 5 - .../performance/entity/TaskProcessRecord.java | 145 +++++++++++++++++- src/main/resources/2020_12_08_sql | 9 +- .../performance/TaskProcessRecordMapper.xml | 48 +++++- src/test/java/com/lz/mysql/MysqlMain.java | 3 - 7 files changed, 202 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/lz/modules/app/controller/TestController.java b/src/main/java/com/lz/modules/app/controller/TestController.java index c9d36395..a4982452 100644 --- a/src/main/java/com/lz/modules/app/controller/TestController.java +++ b/src/main/java/com/lz/modules/app/controller/TestController.java @@ -318,17 +318,16 @@ public class TestController { } - // http://localhost:8080/lz_management/test/task/comment?taskId=1&content=xxx&staffId=294 @RequestMapping("/test/task/comment") public R taskComment(TaskModel taskModel) { return staffRoleService.taskComment(taskModel); } + //http://localhost:8080/lz_management/test/comment/list?detailId=4917&pageSize=2 @RequestMapping("/test/comment/list") public R commentList(TaskModel taskModel) { return staffRoleService.commentList(taskModel); } - } diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java index c3eb938f..5ba615b2 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java @@ -30,8 +30,10 @@ import com.lz.modules.job.business.DingtalkBusiness; import com.lz.modules.performance.dao.TaskCommentMapper; import com.lz.modules.performance.entity.ResultTask; import com.lz.modules.performance.entity.TaskComment; +import com.lz.modules.performance.entity.TaskProcessRecord; import com.lz.modules.performance.service.ResultTaskService; import com.lz.modules.performance.service.TaskCommentService; +import com.lz.modules.performance.service.TaskProcessRecordService; import com.lz.modules.sys.entity.SysMenuEntity; import com.lz.modules.sys.entity.SysRoleEntity; import com.lz.modules.sys.entity.app.ResultDetail; @@ -113,6 +115,9 @@ public class StaffRoleServiceImpl extends ServiceImpl taskCommentMapper.selectByCondition(page, taskModel) ); + List taskComments = pageUtils.getList(); List taskCommentDtoList = new ArrayList<>(); for (TaskComment taskComment : taskComments) { TaskCommentDto taskCommentDto = new TaskCommentDto(); BeanUtils.copyProperties(taskComment, taskCommentDto); - if(taskComment.getStaffId().equals(taskModel.getStaffId())){ + if (taskComment.getStaffId().equals(taskModel.getStaffId())) { taskCommentDto.setIsSelf(1); } taskCommentDtoList.add(taskCommentDto); } pageUtils.setList(taskCommentDtoList); return R.ok().put("data", pageUtils); - } + + } diff --git a/src/main/java/com/lz/modules/performance/dao/TaskProcessRecordMapper.java b/src/main/java/com/lz/modules/performance/dao/TaskProcessRecordMapper.java index 4b149bdd..c3c3d184 100644 --- a/src/main/java/com/lz/modules/performance/dao/TaskProcessRecordMapper.java +++ b/src/main/java/com/lz/modules/performance/dao/TaskProcessRecordMapper.java @@ -22,20 +22,15 @@ public interface TaskProcessRecordMapper extends BaseMapper { TaskProcessRecord selectTaskProcessRecordById(@Param("id") Long id); - Long insertTaskProcessRecord(TaskProcessRecord taskProcessRecord); - int updateTaskProcessRecordById(TaskProcessRecord taskProcessRecord); - int updateCoverTaskProcessRecordById(TaskProcessRecord taskProcessRecord); - int deleteTaskProcessRecordById(@Param("id") Long id); List selectTaskProcessRecordsByTaskId(@Param("page") IPage page, @Param("taskId") Long taskId); - int deleteTaskProcessRecordsByTaskId(@Param("taskId") Long taskId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/entity/TaskProcessRecord.java b/src/main/java/com/lz/modules/performance/entity/TaskProcessRecord.java index 195edefc..20390352 100644 --- a/src/main/java/com/lz/modules/performance/entity/TaskProcessRecord.java +++ b/src/main/java/com/lz/modules/performance/entity/TaskProcessRecord.java @@ -5,14 +5,12 @@ import com.baomidou.mybatisplus.annotation.IdType; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; - -import java.math.BigDecimal; import java.util.Date; /** *

*

*任务进度更新表 * @author quyixiao -* @since 2020-12-09 +* @since 2020-12-11 */ @Data @@ -40,8 +38,8 @@ public class TaskProcessRecord implements java.io.Serializable { //操作标签 @ApiModelProperty(value = "操作标签", name = "label") private String label; - //1,修改名称,2修改进度 ,3名称和进度都修改 - @ApiModelProperty(value = "1,修改名称,2修改进度 ,3名称和进度都修改", name = "type") + //1,修改名称,2修改进度 ,3名称和进度都修改 4:新增 5:删除 + @ApiModelProperty(value = "1,修改名称,2修改进度 ,3名称和进度都修改 4:新增 5:删除", name = "type") private Integer type; //任务 result_task得id @ApiModelProperty(value = "任务 result_task得id ", name = "taskId") @@ -49,6 +47,27 @@ public class TaskProcessRecord implements java.io.Serializable { //任务名称 @ApiModelProperty(value = "任务名称", name = "name") private String name; + //0表示记录,1 表示评论 + @ApiModelProperty(value = "0表示记录,1 表示评论", name = "useType") + private Integer useType; + //@人员id + @ApiModelProperty(value = "@人员id", name = "atStaffId") + private Long atStaffId; + //@人员名称 + @ApiModelProperty(value = "@人员名称", name = "atStaffName") + private String atStaffName; + //lz_result_record表id + @ApiModelProperty(value = "lz_result_record表id", name = "detailId") + private Long detailId; + //lz_detail表id + @ApiModelProperty(value = "lz_detail表id", name = "resultRecordId") + private Long resultRecordId; + //员工id + @ApiModelProperty(value = "员工id", name = "staffId") + private Long staffId; + //员工名称 + @ApiModelProperty(value = "员工名称", name = "staffName") + private String staffName; /** * * @return @@ -155,14 +174,14 @@ public class TaskProcessRecord implements java.io.Serializable { } /** - * 1,修改名称,2修改进度 ,3名称和进度都修改 + * 1,修改名称,2修改进度 ,3名称和进度都修改 4:新增 5:删除 * @return */ public Integer getType() { return type; } /** - * 1,修改名称,2修改进度 ,3名称和进度都修改 + * 1,修改名称,2修改进度 ,3名称和进度都修改 4:新增 5:删除 * @param type */ public void setType(Integer type) { @@ -199,6 +218,111 @@ public class TaskProcessRecord implements java.io.Serializable { this.name = name; } + /** + * 0表示记录,1 表示评论 + * @return + */ + public Integer getUseType() { + return useType; + } + /** + * 0表示记录,1 表示评论 + * @param useType + */ + public void setUseType(Integer useType) { + this.useType = useType; + } + + /** + * @人员id + * @return + */ + public Long getAtStaffId() { + return atStaffId; + } + /** + * @人员id + * @param atStaffId + */ + public void setAtStaffId(Long atStaffId) { + this.atStaffId = atStaffId; + } + + /** + * @人员名称 + * @return + */ + public String getAtStaffName() { + return atStaffName; + } + /** + * @人员名称 + * @param atStaffName + */ + public void setAtStaffName(String atStaffName) { + this.atStaffName = atStaffName; + } + + /** + * lz_result_record表id + * @return + */ + public Long getDetailId() { + return detailId; + } + /** + * lz_result_record表id + * @param detailId + */ + public void setDetailId(Long detailId) { + this.detailId = detailId; + } + + /** + * lz_detail表id + * @return + */ + public Long getResultRecordId() { + return resultRecordId; + } + /** + * lz_detail表id + * @param resultRecordId + */ + public void setResultRecordId(Long resultRecordId) { + this.resultRecordId = resultRecordId; + } + + /** + * 员工id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * 员工id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 员工名称 + * @return + */ + public String getStaffName() { + return staffName; + } + /** + * 员工名称 + * @param staffName + */ + public void setStaffName(String staffName) { + this.staffName = staffName; + } + @Override public String toString() { return "TaskProcessRecord{" + @@ -212,6 +336,13 @@ public class TaskProcessRecord implements java.io.Serializable { ",type=" + type + ",taskId=" + taskId + ",name=" + name + + ",useType=" + useType + + ",atStaffId=" + atStaffId + + ",atStaffName=" + atStaffName + + ",detailId=" + detailId + + ",resultRecordId=" + resultRecordId + + ",staffId=" + staffId + + ",staffName=" + staffName + "}"; } } \ No newline at end of file diff --git a/src/main/resources/2020_12_08_sql b/src/main/resources/2020_12_08_sql index 4c6b54c5..48d923e0 100644 --- a/src/main/resources/2020_12_08_sql +++ b/src/main/resources/2020_12_08_sql @@ -44,4 +44,11 @@ ALTER TABLE `lz_management`.`lz_task_comment` ADD COLUMN `task_id` int(11) DEFAU -ALTER TABLE `lz_management`.`lz_task_process_record` ADD COLUMN `process_rate` decimal(12,2) DEFAULT 0 COMMENT '当前进度' AFTER `gmt_modified`, ADD COLUMN `remark` text COMMENT '更新说明' AFTER `process_rate`, ADD COLUMN `label` text COMMENT '操作标签' AFTER `remark`, ADD COLUMN `type` int(11) DEFAULT 3 COMMENT '1,修改名称,2修改进度 ,3名称和进度都修改' AFTER `label`; \ No newline at end of file +ALTER TABLE `lz_management`.`lz_task_process_record` ADD COLUMN `detail_id` int(11) COMMENT 'lz_result_record表id' AFTER `at_staff_name`, ADD COLUMN `result_record_id` int(11) COMMENT 'lz_detail表id' AFTER `detail_id`; + + +ALTER TABLE `lz_management`.`lz_task_process_record` ADD COLUMN `process_rate` decimal(12,2) DEFAULT 0 COMMENT '当前进度' AFTER `gmt_modified`, ADD COLUMN `remark` text COMMENT '更新说明' AFTER `process_rate`, ADD COLUMN `label` text COMMENT '操作标签' AFTER `remark`, ADD COLUMN `type` int(11) DEFAULT 3 COMMENT '1,修改名称,2修改进度 ,3名称和进度都修改' AFTER `label`; + + + +ALTER TABLE `lz_management`.`lz_task_process_record` ADD COLUMN `staff_id` int(11) COMMENT '员工id' AFTER `result_record_id`, ADD COLUMN `staff_name` varchar(256) COMMENT '员工名称' AFTER `staff_id`; \ No newline at end of file diff --git a/src/main/resources/mapper/performance/TaskProcessRecordMapper.xml b/src/main/resources/mapper/performance/TaskProcessRecordMapper.xml index 85b3fe8f..99dc1195 100644 --- a/src/main/resources/mapper/performance/TaskProcessRecordMapper.xml +++ b/src/main/resources/mapper/performance/TaskProcessRecordMapper.xml @@ -2,7 +2,6 @@ - @@ -14,21 +13,29 @@ + + + + + + + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, process_rate AS processRate, remark AS remark, label AS label, type AS type, task_id AS taskId, name AS name + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, process_rate AS processRate, remark AS remark, label AS label, type AS type, task_id AS taskId, name AS name, use_type AS useType, at_staff_id AS atStaffId, at_staff_name AS atStaffName, detail_id AS detailId, result_record_id AS resultRecordId, staff_id AS staffId, staff_name AS staffName + insert into lz_task_process_record( process_rate, @@ -37,6 +44,13 @@ type, task_id, name, + use_type, + at_staff_id, + at_staff_name, + detail_id, + result_record_id, + staff_id, + staff_name, is_delete, gmt_create, gmt_modified @@ -47,6 +61,13 @@ #{ type}, #{ taskId}, #{ name}, + #{ useType}, + #{ atStaffId}, + #{ atStaffName}, + #{ detailId}, + #{ resultRecordId}, + #{ staffId}, + #{ staffName}, 0, now(), now() @@ -65,7 +86,14 @@ label = #{label}, type = #{type}, task_id = #{taskId}, - name = #{name} + name = #{name}, + use_type = #{useType}, + at_staff_id = #{atStaffId}, + at_staff_name = #{atStaffName}, + detail_id = #{detailId}, + result_record_id = #{resultRecordId}, + staff_id = #{staffId}, + staff_name = #{staffName} ,gmt_modified = now() where id = #{id} @@ -83,17 +111,23 @@ label = #{label}, type = #{type}, task_id = #{taskId}, - name = #{name} + name = #{name}, + use_type = #{useType}, + at_staff_id = #{atStaffId}, + at_staff_name = #{atStaffName}, + detail_id = #{detailId}, + result_record_id = #{resultRecordId}, + staff_id = #{staffId}, + staff_name = #{staffName} ,gmt_modified = now() where id = #{id} - update lz_task_process_record set is_delete = 1 where id=#{id} limit 1 + update lz_task_process_record 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 fc96ded1..ff99a668 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -84,9 +84,6 @@ public class MysqlMain { List list = new ArrayList(); - - list.add(new TablesBean("lz_result_task")); - list.add(new TablesBean("lz_task_process_record"));