提交修改

This commit is contained in:
quyixiao 2020-12-11 10:19:06 +08:00
parent 080900fe49
commit c64f3aa0e0
7 changed files with 202 additions and 30 deletions

View File

@ -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);
}
}

View File

@ -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<StaffRoleMapper, StaffRole
@Autowired
private TaskCommentService taskCommentService;
@Autowired
private TaskProcessRecordService taskProcessRecordService;
@Autowired
private DingtalkBusiness dingtalkBusiness;
@ -622,8 +627,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
if (roleModel.getDetailId() == null && roleModel.getTaskId() == null) {
return R.error("detailId和taskId不能同时为空");
}
TaskComment taskComment = new TaskComment();
taskComment.setContent(roleModel.getContent());
TaskProcessRecord taskComment = new TaskProcessRecord();
taskComment.setLabel(roleModel.getContent());
taskComment.setTaskId(roleModel.getTaskId());
if (roleModel.getTaskId() != null) {
ResultTask resultTask = resultTaskService.selectResultTaskById(roleModel.getTaskId());
@ -640,28 +646,31 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
taskComment.setStaffId(staffEntity.getId());
taskComment.setStaffName(staffEntity.getName());
}
taskCommentService.insertTaskComment(taskComment);
taskProcessRecordService.insertTaskProcessRecord(taskComment);
dingtalkBusiness.sendTaskNoticeMsg(taskComment.getDetailId(), taskComment.getTaskId());
return R.ok();
}
@Override
public R commentList(TaskModel taskModel) {
PageUtils pageUtils = PageUtils.startPage(taskModel.getCurrPage(), taskModel.getPageSize()).doSelect(
page -> taskCommentMapper.selectByCondition(page, taskModel)
);
List<TaskComment> taskComments = pageUtils.getList();
List<TaskCommentDto> 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);
}
}

View File

@ -22,20 +22,15 @@ public interface TaskProcessRecordMapper extends BaseMapper<TaskProcessRecord> {
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<TaskProcessRecordDto> selectTaskProcessRecordsByTaskId(@Param("page") IPage page, @Param("taskId") Long taskId);
int deleteTaskProcessRecordsByTaskId(@Param("taskId") Long taskId);
}

View File

@ -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;
/**
* <p>
* </p>*任务进度更新表
* @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 +
"}";
}
}

View File

@ -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`;
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`;

View File

@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lz.modules.performance.dao.TaskProcessRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.performance.entity.TaskProcessRecord">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
@ -14,21 +13,29 @@
<result column="type" property="type"/>
<result column="task_id" property="taskId"/>
<result column="name" property="name"/>
<result column="use_type" property="useType"/>
<result column="at_staff_id" property="atStaffId"/>
<result column="at_staff_name" property="atStaffName"/>
<result column="detail_id" property="detailId"/>
<result column="result_record_id" property="resultRecordId"/>
<result column="staff_id" property="staffId"/>
<result column="staff_name" property="staffName"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
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
</sql>
<select id="selectTaskProcessRecordById" resultType="TaskProcessRecord" >
select * from lz_task_process_record where id=#{id} and is_delete = 0 limit 1
select * from lz_task_process_record where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertTaskProcessRecord" parameterType="TaskProcessRecord" useGeneratedKeys="true" keyProperty="id" >
insert into lz_task_process_record(
<if test="processRate != null">process_rate, </if>
@ -37,6 +44,13 @@
<if test="type != null">type, </if>
<if test="taskId != null">task_id, </if>
<if test="name != null">name, </if>
<if test="useType != null">use_type, </if>
<if test="atStaffId != null">at_staff_id, </if>
<if test="atStaffName != null">at_staff_name, </if>
<if test="detailId != null">detail_id, </if>
<if test="resultRecordId != null">result_record_id, </if>
<if test="staffId != null">staff_id, </if>
<if test="staffName != null">staff_name, </if>
is_delete,
gmt_create,
gmt_modified
@ -47,6 +61,13 @@
<if test="type != null">#{ type}, </if>
<if test="taskId != null">#{ taskId}, </if>
<if test="name != null">#{ name}, </if>
<if test="useType != null">#{ useType}, </if>
<if test="atStaffId != null">#{ atStaffId}, </if>
<if test="atStaffName != null">#{ atStaffName}, </if>
<if test="detailId != null">#{ detailId}, </if>
<if test="resultRecordId != null">#{ resultRecordId}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="staffName != null">#{ staffName}, </if>
0,
now(),
now()
@ -65,7 +86,14 @@
<if test="label != null">label = #{label},</if>
<if test="type != null">type = #{type},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="name != null">name = #{name}</if>
<if test="name != null">name = #{name},</if>
<if test="useType != null">use_type = #{useType},</if>
<if test="atStaffId != null">at_staff_id = #{atStaffId},</if>
<if test="atStaffName != null">at_staff_name = #{atStaffName},</if>
<if test="detailId != null">detail_id = #{detailId},</if>
<if test="resultRecordId != null">result_record_id = #{resultRecordId},</if>
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="staffName != null">staff_name = #{staffName}</if>
</trim>
,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>
<update id="deleteTaskProcessRecordById" parameterType="java.lang.Long">
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
</update>
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
select gmt_create,remark,label,type from lz_task_process_record where task_id=#{taskId} and is_delete = 0 order by gmt_create desc
</select>

View File

@ -84,9 +84,6 @@ public class MysqlMain {
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_result_task"));
list.add(new TablesBean("lz_task_process_record"));