Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
9e761a07bf
@ -257,7 +257,7 @@ public class StaffRoleController extends AbstractController {
|
||||
|
||||
|
||||
|
||||
// http://localhost:8080/lz_management/user/lzstaffrole/task/comment?taskId=1&content=xxx&staffId=294
|
||||
// http://localhost:8080/lz_management/user/lzstaffrole/task/comment?taskId=1&content=xxx&staffId=294&atStaffId=314
|
||||
@RequestMapping("/task/comment")
|
||||
public R taskComment(TaskModel taskModel) {
|
||||
if(taskModel.getStaffId() == null && getUser()!=null && getUserId() !=null){
|
||||
@ -266,6 +266,7 @@ public class StaffRoleController extends AbstractController {
|
||||
return staffRoleService.taskComment(taskModel);
|
||||
}
|
||||
|
||||
|
||||
//http://localhost:8080/lz_management/user/lzstaffrole/comment/list?detailId=4917&pageSize=2
|
||||
@RequestMapping("/comment/list")
|
||||
public R commentList(TaskModel taskModel) {
|
||||
|
||||
@ -318,7 +318,7 @@ public class TestController {
|
||||
}
|
||||
|
||||
|
||||
// http://localhost:8080/lz_management/test/task/comment?taskId=1&content=xxx&staffId=294
|
||||
// http://localhost:8080/lz_management/test/task/comment?taskId=1&content=xxx&staffId=294&atStaffId=314
|
||||
@RequestMapping("/test/task/comment")
|
||||
public R taskComment(TaskModel taskModel) {
|
||||
return staffRoleService.taskComment(taskModel);
|
||||
|
||||
@ -1,9 +1,22 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import com.lz.modules.performance.entity.TaskComment;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TaskCommentDto extends TaskComment {
|
||||
public class TaskCommentDto {
|
||||
private int isSelf;
|
||||
private Date gmtCreate;
|
||||
private Integer type;
|
||||
private Long taskId;
|
||||
private Long detailId;
|
||||
private Long resultRecordId;
|
||||
private Long staffId;
|
||||
private String label;
|
||||
private String staffName;
|
||||
private Long atStaffId;
|
||||
private String atStaffName;
|
||||
}
|
||||
|
||||
@ -11,4 +11,6 @@ public class TaskModel {
|
||||
private Long detailId;
|
||||
private String content;
|
||||
private Long staffId;
|
||||
private int useType;
|
||||
private Long atStaffId;
|
||||
}
|
||||
|
||||
@ -627,43 +627,49 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
if (roleModel.getDetailId() == null && roleModel.getTaskId() == null) {
|
||||
return R.error("detailId和taskId不能同时为空");
|
||||
}
|
||||
|
||||
TaskProcessRecord taskComment = new TaskProcessRecord();
|
||||
taskComment.setLabel(roleModel.getContent());
|
||||
taskComment.setTaskId(roleModel.getTaskId());
|
||||
TaskProcessRecord taskProcessRecord = new TaskProcessRecord();
|
||||
taskProcessRecord.setLabel(roleModel.getContent());
|
||||
taskProcessRecord.setTaskId(roleModel.getTaskId());
|
||||
if (roleModel.getTaskId() != null) {
|
||||
ResultTask resultTask = resultTaskService.selectResultTaskById(roleModel.getTaskId());
|
||||
taskComment.setDetailId(resultTask.getDetailId());
|
||||
taskComment.setType(1);
|
||||
taskProcessRecord.setDetailId(resultTask.getDetailId());
|
||||
taskProcessRecord.setType(1);
|
||||
} else {
|
||||
taskComment.setDetailId(roleModel.getDetailId());
|
||||
taskComment.setType(0);//
|
||||
taskProcessRecord.setDetailId(roleModel.getDetailId());
|
||||
taskProcessRecord.setType(0);//
|
||||
}
|
||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(taskComment.getDetailId());
|
||||
taskComment.setResultRecordId(resultDetail.getRecordId());
|
||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(taskProcessRecord.getDetailId());
|
||||
taskProcessRecord.setResultRecordId(resultDetail.getRecordId());
|
||||
|
||||
StaffEntity staffEntity = staffDao.selectStaffById(roleModel.getStaffId());
|
||||
if (staffEntity != null) {
|
||||
taskComment.setStaffId(staffEntity.getId());
|
||||
taskComment.setStaffName(staffEntity.getName());
|
||||
taskProcessRecord.setStaffId(staffEntity.getId());
|
||||
taskProcessRecord.setStaffName(staffEntity.getName());
|
||||
}
|
||||
taskProcessRecordService.insertTaskProcessRecord(taskComment);
|
||||
dingtalkBusiness.sendTaskNoticeMsg(taskComment.getDetailId(), taskComment.getTaskId());
|
||||
|
||||
StaffEntity atStaffEntity = staffDao.selectStaffById(roleModel.getAtStaffId());
|
||||
if (atStaffEntity != null) {
|
||||
taskProcessRecord.setAtStaffId(atStaffEntity.getId());
|
||||
taskProcessRecord.setAtStaffName(atStaffEntity.getName());
|
||||
}
|
||||
taskProcessRecord.setUseType(1);
|
||||
taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord);
|
||||
dingtalkBusiness.sendTaskNoticeMsg(taskProcessRecord.getDetailId(), taskProcessRecord.getTaskId());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public R commentList(TaskModel taskModel) {
|
||||
taskModel.setUseType(1);
|
||||
PageUtils pageUtils = PageUtils.startPage(taskModel.getCurrPage(), taskModel.getPageSize()).doSelect(
|
||||
page -> taskCommentMapper.selectByCondition(page, taskModel)
|
||||
page -> taskProcessRecordService.selectByCondition(page, taskModel)
|
||||
);
|
||||
|
||||
List<TaskComment> taskComments = pageUtils.getList();
|
||||
List<TaskProcessRecord> pageUtilsList = pageUtils.getList();
|
||||
List<TaskCommentDto> taskCommentDtoList = new ArrayList<>();
|
||||
for (TaskComment taskComment : taskComments) {
|
||||
for (TaskProcessRecord taskProcessRecord : pageUtilsList) {
|
||||
TaskCommentDto taskCommentDto = new TaskCommentDto();
|
||||
BeanUtils.copyProperties(taskComment, taskCommentDto);
|
||||
if (taskComment.getStaffId().equals(taskModel.getStaffId())) {
|
||||
BeanUtils.copyProperties(taskProcessRecord, taskCommentDto);
|
||||
if (taskProcessRecord.getStaffId().equals(taskModel.getStaffId())) {
|
||||
taskCommentDto.setIsSelf(1);
|
||||
}
|
||||
taskCommentDtoList.add(taskCommentDto);
|
||||
@ -672,5 +678,4 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
return R.ok().put("data", pageUtils);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ package com.lz.modules.performance.dao;
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.lz.modules.app.model.TaskModel;
|
||||
import com.lz.modules.performance.dto.TaskProcessRecordDto;
|
||||
import com.lz.modules.performance.entity.TaskProcessRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -38,4 +39,5 @@ public interface TaskProcessRecordMapper extends BaseMapper<TaskProcessRecord> {
|
||||
|
||||
List<TaskProcessRecordDto> selectTaskProcessRecordsByTaskIds(@Param("page") IPage page, @Param("taskIds") List<Long> taskIds,@Param("useType") int useType);
|
||||
|
||||
List<TaskProcessRecord> selectByCondition(@Param("page") IPage page, @Param("taskModel") TaskModel taskModel);
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
package com.lz.modules.performance.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.modules.app.model.TaskModel;
|
||||
import com.lz.modules.performance.entity.TaskProcessRecord;
|
||||
import com.lz.modules.performance.req.ChangeTaskListReq;
|
||||
|
||||
@ -37,4 +39,6 @@ public interface TaskProcessRecordService extends IService<TaskProcessRecord> {
|
||||
|
||||
|
||||
int deleteTaskProcessRecordsByTaskId(Long taskId);
|
||||
|
||||
List<TaskProcessRecord> selectByCondition(IPage page, TaskModel taskModel);
|
||||
}
|
||||
@ -1,8 +1,10 @@
|
||||
package com.lz.modules.performance.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.model.TaskModel;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.performance.dao.TaskProcessRecordMapper;
|
||||
import com.lz.modules.performance.dto.ResultTaskDto;
|
||||
@ -17,6 +19,7 @@ import com.lz.modules.sys.service.app.ResultDetailService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import sun.jvm.hotspot.oops.TypeArrayKlass;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -130,4 +133,9 @@ public class TaskProcessRecordServiceImpl extends ServiceImpl<TaskProcessRecordM
|
||||
public int deleteTaskProcessRecordsByTaskId(Long taskId){
|
||||
return taskProcessRecordMapper.deleteTaskProcessRecordsByTaskId(taskId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskProcessRecord> selectByCondition(IPage page, TaskModel taskModel) {
|
||||
return taskProcessRecordMapper.selectByCondition(page,taskModel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,5 +50,6 @@ ALTER TABLE `lz_management`.`lz_task_process_record` ADD COLUMN `detail_id` int(
|
||||
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` 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`;
|
||||
@ -150,5 +150,11 @@
|
||||
order by gmt_create desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByCondition" resultType="com.lz.modules.performance.entity.TaskProcessRecord">
|
||||
select * from lz_task_process_record where is_delete = 0 and (detail_id = #{taskModel.detailId} or task_id=#{taskModel.taskId} ) and use_type=#{taskModel.useType} order by id desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user