提交修改

This commit is contained in:
quyixiao 2020-12-11 11:58:09 +08:00
parent f5c8447ca3
commit 244b89450c
8 changed files with 71 additions and 42 deletions

View File

@ -257,7 +257,7 @@ public class StaffRoleController extends AbstractController {
// http://localhost:8080/lz_management/user/lzstaffrole/task/comment?taskId=1&content=xxx&staffId=294&atStaffId=314 // http://localhost:8080/lz_management/user/lzstaffrole/task/comment?taskId=1&content=xxx&staffId=294&atStaffIds=314,320
@RequestMapping("/task/comment") @RequestMapping("/task/comment")
public R taskComment(TaskModel taskModel) { public R taskComment(TaskModel taskModel) {
if(taskModel.getStaffId() == null && getUser()!=null && getUserId() !=null){ if(taskModel.getStaffId() == null && getUser()!=null && getUserId() !=null){

View File

@ -318,7 +318,7 @@ public class TestController {
} }
// http://localhost:8080/lz_management/test/task/comment?taskId=1&content=xxx&staffId=294&atStaffId=314 // http://localhost:8080/lz_management/test/task/comment?taskId=1&content=xxx&staffId=294&atStaffIds=314,320
@RequestMapping("/test/task/comment") @RequestMapping("/test/task/comment")
public R taskComment(TaskModel taskModel) { public R taskComment(TaskModel taskModel) {
return staffRoleService.taskComment(taskModel); return staffRoleService.taskComment(taskModel);

View File

@ -17,6 +17,9 @@ public class TaskCommentDto {
private Long staffId; private Long staffId;
private String label; private String label;
private String staffName; private String staffName;
private Long atStaffId; private String atStaffIds;
private String atStaffName; private String atStaffNames;
private String avatar;
private String taskName;
} }

View File

@ -12,5 +12,5 @@ public class TaskModel {
private String content; private String content;
private Long staffId; private Long staffId;
private int useType; private int useType;
private Long atStaffId; private String atStaffIds;
} }

View File

@ -29,7 +29,6 @@ import com.lz.modules.flow.service.*;
import com.lz.modules.job.business.DingtalkBusiness; import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.performance.dao.TaskCommentMapper; import com.lz.modules.performance.dao.TaskCommentMapper;
import com.lz.modules.performance.entity.ResultTask; 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.entity.TaskProcessRecord;
import com.lz.modules.performance.service.ResultTaskService; import com.lz.modules.performance.service.ResultTaskService;
import com.lz.modules.performance.service.TaskCommentService; import com.lz.modules.performance.service.TaskCommentService;
@ -647,11 +646,17 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
taskProcessRecord.setStaffName(staffEntity.getName()); taskProcessRecord.setStaffName(staffEntity.getName());
} }
StaffEntity atStaffEntity = staffDao.selectStaffById(roleModel.getAtStaffId()); taskProcessRecord.setAtStaffIds(roleModel.getAtStaffIds());
if (atStaffEntity != null) { StringBuilder staffNames = new StringBuilder();
taskProcessRecord.setAtStaffId(atStaffEntity.getId()); for (String staffIdStr : StringUtil.splitToList(roleModel.getAtStaffIds(), ",")) {
taskProcessRecord.setAtStaffName(atStaffEntity.getName()); if (StringUtil.isNotBlank(staffIdStr)) {
StaffEntity atStaffEntity = staffDao.selectStaffById(NumberUtil.objToLongDefault(staffIdStr, 0l));
if (atStaffEntity != null) {
staffNames.append(atStaffEntity.getName()).append(",");
}
}
} }
taskProcessRecord.setAtStaffNames(staffNames.toString());
taskProcessRecord.setUseType(1); taskProcessRecord.setUseType(1);
taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord); taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord);
try { try {
@ -677,10 +682,19 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
if (taskProcessRecord.getStaffId().equals(taskModel.getStaffId())) { if (taskProcessRecord.getStaffId().equals(taskModel.getStaffId())) {
taskCommentDto.setIsSelf(1); taskCommentDto.setIsSelf(1);
} }
StaffEntity staffEntity = staffDao.selectStaffById(taskProcessRecord.getStaffId());
if(staffEntity !=null){
taskCommentDto.setAvatar(staffEntity.getAvatar());
}
if(taskProcessRecord.getTaskId() !=null){
ResultTask resultTask = resultTaskService.selectResultTaskById(taskProcessRecord.getTaskId());
taskCommentDto.setTaskName(resultTask.getName());
}
taskCommentDtoList.add(taskCommentDto); taskCommentDtoList.add(taskCommentDto);
} }
pageUtils.setList(taskCommentDtoList); pageUtils.setList(taskCommentDtoList);
return R.ok().put("data", pageUtils); return R.ok().put("data", pageUtils);
} }
} }

View File

@ -40,8 +40,8 @@ public class TaskProcessRecord implements java.io.Serializable {
//操作标签 //操作标签
@ApiModelProperty(value = "操作标签", name = "label") @ApiModelProperty(value = "操作标签", name = "label")
private String label; private String label;
//1修改名称2修改进度 3名称和进度都修改 4:新增 5删除 //user_type为0时1修改名称2修改进度 3名称和进度都修改 4新增 5 删除 user_type为1时0表示对所有评论1表示对单个具体的task做评论
@ApiModelProperty(value = "1修改名称2修改进度 3名称和进度都修改 4:新增 5删除", name = "type") @ApiModelProperty(value = "user_type为0时1修改名称2修改进度 3名称和进度都修改 4,新增 5 删除 。user_type为1时0表示对所有评论1表示对单个具体的task做评论", name = "type")
private Integer type; private Integer type;
//任务 result_task得id //任务 result_task得id
@ApiModelProperty(value = "任务 result_task得id ", name = "taskId") @ApiModelProperty(value = "任务 result_task得id ", name = "taskId")
@ -53,11 +53,11 @@ public class TaskProcessRecord implements java.io.Serializable {
@ApiModelProperty(value = "0表示记录1 表示评论", name = "useType") @ApiModelProperty(value = "0表示记录1 表示评论", name = "useType")
private Integer useType; private Integer useType;
//@人员id //@人员id
@ApiModelProperty(value = "@人员id", name = "atStaffId") @ApiModelProperty(value = "@人员id", name = "atStaffIds")
private Long atStaffId; private String atStaffIds;
//@人员名称 //@人员名称
@ApiModelProperty(value = "@人员名称", name = "atStaffName") @ApiModelProperty(value = "@人员名称", name = "atStaffNames")
private String atStaffName; private String atStaffNames;
//lz_result_record表id //lz_result_record表id
@ApiModelProperty(value = "lz_result_record表id", name = "detailId") @ApiModelProperty(value = "lz_result_record表id", name = "detailId")
private Long detailId; private Long detailId;
@ -176,14 +176,14 @@ public class TaskProcessRecord implements java.io.Serializable {
} }
/** /**
* 1修改名称2修改进度 3名称和进度都修改 4:新增 5删除 * user_type为0时1修改名称2修改进度 3名称和进度都修改 4新增 5 删除 user_type为1时0表示对所有评论1表示对单个具体的task做评论
* @return * @return
*/ */
public Integer getType() { public Integer getType() {
return type; return type;
} }
/** /**
* 1修改名称2修改进度 3名称和进度都修改 4:新增 5删除 * user_type为0时1修改名称2修改进度 3名称和进度都修改 4新增 5 删除 user_type为1时0表示对所有评论1表示对单个具体的task做评论
* @param type * @param type
*/ */
public void setType(Integer type) { public void setType(Integer type) {
@ -239,30 +239,30 @@ public class TaskProcessRecord implements java.io.Serializable {
* @人员id * @人员id
* @return * @return
*/ */
public Long getAtStaffId() { public String getAtStaffIds() {
return atStaffId; return atStaffIds;
} }
/** /**
* @人员id * @人员id
* @param atStaffId * @param atStaffIds
*/ */
public void setAtStaffId(Long atStaffId) { public void setAtStaffIds(String atStaffIds) {
this.atStaffId = atStaffId; this.atStaffIds = atStaffIds;
} }
/** /**
* @人员名称 * @人员名称
* @return * @return
*/ */
public String getAtStaffName() { public String getAtStaffNames() {
return atStaffName; return atStaffNames;
} }
/** /**
* @人员名称 * @人员名称
* @param atStaffName * @param atStaffNames
*/ */
public void setAtStaffName(String atStaffName) { public void setAtStaffNames(String atStaffNames) {
this.atStaffName = atStaffName; this.atStaffNames = atStaffNames;
} }
/** /**
@ -339,8 +339,8 @@ public class TaskProcessRecord implements java.io.Serializable {
",taskId=" + taskId + ",taskId=" + taskId +
",name=" + name + ",name=" + name +
",useType=" + useType + ",useType=" + useType +
",atStaffId=" + atStaffId + ",atStaffIds=" + atStaffIds +
",atStaffName=" + atStaffName + ",atStaffNames=" + atStaffNames +
",detailId=" + detailId + ",detailId=" + detailId +
",resultRecordId=" + resultRecordId + ",resultRecordId=" + resultRecordId +
",staffId=" + staffId + ",staffId=" + staffId +

View File

@ -53,3 +53,13 @@ ALTER TABLE `lz_management`.`lz_task_process_record` ADD COLUMN `process_rate` d
ALTER TABLE `lz_management`.`lz_task_process_record` CHANGE COLUMN `type` `type` int(11) DEFAULT 3 COMMENT 'user_type为0时1修改名称2修改进度 3名称和进度都修改 4新增 5 删除 。user_type为1时0表示对所有评论1表示对单个具体的task做评论'; ALTER TABLE `lz_management`.`lz_task_process_record` CHANGE COLUMN `type` `type` int(11) DEFAULT 3 COMMENT 'user_type为0时1修改名称2修改进度 3名称和进度都修改 4新增 5 删除 。user_type为1时0表示对所有评论1表示对单个具体的task做评论';
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`; 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`;
ALTER TABLE `lz_management`.`lz_task_process_record` CHANGE COLUMN `staff_id` `staff_ids` varchar(256) DEFAULT NULL COMMENT '员工id', CHANGE COLUMN `staff_name` `staff_names` varchar(256) DEFAULT NULL COMMENT '员工名称';
ALTER TABLE `lz_management`.`lz_task_process_record` CHANGE COLUMN `at_staff_id` `at_staff_ids` int(11) DEFAULT NULL COMMENT '@人员id', CHANGE COLUMN `at_staff_name` `at_staff_names` varchar(256) DEFAULT NULL COMMENT '@人员名称', CHANGE COLUMN `staff_ids` `staff_id` int(11) DEFAULT NULL COMMENT '员工id', CHANGE COLUMN `staff_names` `staff_name` varchar(256) DEFAULT NULL COMMENT '员工名称';
ALTER TABLE `lz_management`.`lz_task_process_record` CHANGE COLUMN `at_staff_ids` `at_staff_ids` varchar(256) DEFAULT NULL COMMENT '@人员id';

View File

@ -14,8 +14,8 @@
<result column="task_id" property="taskId"/> <result column="task_id" property="taskId"/>
<result column="name" property="name"/> <result column="name" property="name"/>
<result column="use_type" property="useType"/> <result column="use_type" property="useType"/>
<result column="at_staff_id" property="atStaffId"/> <result column="at_staff_ids" property="atStaffIds"/>
<result column="at_staff_name" property="atStaffName"/> <result column="at_staff_names" property="atStaffNames"/>
<result column="detail_id" property="detailId"/> <result column="detail_id" property="detailId"/>
<result column="result_record_id" property="resultRecordId"/> <result column="result_record_id" property="resultRecordId"/>
<result column="staff_id" property="staffId"/> <result column="staff_id" property="staffId"/>
@ -25,7 +25,7 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<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, 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 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_ids AS atStaffIds, at_staff_names AS atStaffNames, detail_id AS detailId, result_record_id AS resultRecordId, staff_id AS staffId, staff_name AS staffName
</sql> </sql>
@ -45,8 +45,8 @@
<if test="taskId != null">task_id, </if> <if test="taskId != null">task_id, </if>
<if test="name != null">name, </if> <if test="name != null">name, </if>
<if test="useType != null">use_type, </if> <if test="useType != null">use_type, </if>
<if test="atStaffId != null">at_staff_id, </if> <if test="atStaffIds != null">at_staff_ids, </if>
<if test="atStaffName != null">at_staff_name, </if> <if test="atStaffNames != null">at_staff_names, </if>
<if test="detailId != null">detail_id, </if> <if test="detailId != null">detail_id, </if>
<if test="resultRecordId != null">result_record_id, </if> <if test="resultRecordId != null">result_record_id, </if>
<if test="staffId != null">staff_id, </if> <if test="staffId != null">staff_id, </if>
@ -62,8 +62,8 @@
<if test="taskId != null">#{ taskId}, </if> <if test="taskId != null">#{ taskId}, </if>
<if test="name != null">#{ name}, </if> <if test="name != null">#{ name}, </if>
<if test="useType != null">#{ useType}, </if> <if test="useType != null">#{ useType}, </if>
<if test="atStaffId != null">#{ atStaffId}, </if> <if test="atStaffIds != null">#{ atStaffIds}, </if>
<if test="atStaffName != null">#{ atStaffName}, </if> <if test="atStaffNames != null">#{ atStaffNames}, </if>
<if test="detailId != null">#{ detailId}, </if> <if test="detailId != null">#{ detailId}, </if>
<if test="resultRecordId != null">#{ resultRecordId}, </if> <if test="resultRecordId != null">#{ resultRecordId}, </if>
<if test="staffId != null">#{ staffId}, </if> <if test="staffId != null">#{ staffId}, </if>
@ -88,8 +88,8 @@
<if test="taskId != null">task_id = #{taskId},</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="useType != null">use_type = #{useType},</if>
<if test="atStaffId != null">at_staff_id = #{atStaffId},</if> <if test="atStaffIds != null">at_staff_ids = #{atStaffIds},</if>
<if test="atStaffName != null">at_staff_name = #{atStaffName},</if> <if test="atStaffNames != null">at_staff_names = #{atStaffNames},</if>
<if test="detailId != null">detail_id = #{detailId},</if> <if test="detailId != null">detail_id = #{detailId},</if>
<if test="resultRecordId != null">result_record_id = #{resultRecordId},</if> <if test="resultRecordId != null">result_record_id = #{resultRecordId},</if>
<if test="staffId != null">staff_id = #{staffId},</if> <if test="staffId != null">staff_id = #{staffId},</if>
@ -113,8 +113,8 @@
task_id = #{taskId}, task_id = #{taskId},
name = #{name}, name = #{name},
use_type = #{useType}, use_type = #{useType},
at_staff_id = #{atStaffId}, at_staff_ids = #{atStaffIds},
at_staff_name = #{atStaffName}, at_staff_names = #{atStaffNames},
detail_id = #{detailId}, detail_id = #{detailId},
result_record_id = #{resultRecordId}, result_record_id = #{resultRecordId},
staff_id = #{staffId}, staff_id = #{staffId},
@ -128,6 +128,8 @@
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> </update>
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto"> <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 use_type = #{useType} and is_delete = 0 order by gmt_create desc select gmt_create,remark,label,type from lz_task_process_record where task_id=#{taskId} and use_type = #{useType} and is_delete = 0 order by gmt_create desc
</select> </select>