提交修改

This commit is contained in:
quyixiao 2020-12-09 18:33:01 +08:00
parent 2d6e9ddbf8
commit 75912655ab
7 changed files with 88 additions and 14 deletions

View File

@ -24,6 +24,7 @@ import com.lz.modules.flow.service.RecordRoleService;
import com.lz.modules.flow.service.StaffRoleDepartmentService;
import com.lz.modules.flow.service.StaffRoleEvaluationGroupService;
import com.lz.modules.flow.service.StaffRoleService;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.SysMenuEntity;
import com.lz.modules.sys.entity.SysRoleEntity;
import io.swagger.annotations.Api;
@ -49,7 +50,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("user/lzstaffrole")
@Api(tags = "考评组管理员管理")
public class StaffRoleController {
public class StaffRoleController extends AbstractController {
@Autowired
private StaffRoleService staffRoleService;
@ -256,16 +257,19 @@ public class StaffRoleController {
// http://localhost:8080/lz_management/user/lzstaffrole/role/delete?id=26
// http://localhost:8080/lz_management/user/lzstaffrole/task/comment?taskId=1&content=xxx&staffId=294
@RequestMapping("/task/comment")
public R taskComment(TaskModel taskModel) {
if(taskModel.getStaffId() == null && getUser()!=null && getUserId() !=null){
taskModel.setStaffId(getUserId());
}
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) {
return staffRoleService.commentList(taskModel);
}
}

View File

@ -15,6 +15,7 @@ import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.enums.ResultRecordStatusEnum;
import com.lz.modules.app.enums.RoleEnums;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.app.resp.Step;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
@ -315,4 +316,19 @@ public class TestController {
return R.error(e.getMessage());
}
}
// 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

@ -0,0 +1,8 @@
package com.lz.modules.app.dto;
import com.lz.modules.performance.entity.TaskComment;
import lombok.Data;
@Data
public class TaskCommentDto extends TaskComment {
}

View File

@ -78,4 +78,6 @@ public interface StaffRoleService extends IService<StaffRole> {
StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long loginUserId, List<String> asList);
R taskComment(TaskModel roleModel);
R commentList(TaskModel taskModel);
}

View File

@ -9,10 +9,7 @@ import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dao.DepartmentsDao;
import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.dto.EvaluationGroupInfo;
import com.lz.modules.app.dto.StaffRoleDetailInfo;
import com.lz.modules.app.dto.StaffRoleInfo;
import com.lz.modules.app.dto.StaffRoleResp;
import com.lz.modules.app.dto.*;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
@ -24,11 +21,14 @@ import com.lz.modules.app.model.RoleModel;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.equipment.entity.model.FindEmployeeResModel;
import com.lz.modules.flow.dao.RecordRoleMapper;
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
import com.lz.modules.flow.dao.StaffRoleMapper;
import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.service.*;
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.service.ResultTaskService;
@ -43,6 +43,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.jvm.hotspot.oops.TypeArrayKlass;
import java.util.*;
import java.util.stream.Collectors;
@ -114,6 +115,12 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
@Autowired
private TaskCommentService taskCommentService;
@Autowired
private DingtalkBusiness dingtalkBusiness;
@Autowired
private TaskCommentMapper taskCommentMapper;
@Override
public StaffRole selectStaffRoleById(Long id) {
return staffRoleMapper.selectStaffRoleById(id);
@ -614,14 +621,19 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
@Override
public R taskComment(TaskModel roleModel){
if(roleModel.getDetailId() == null && roleModel.getTaskId() == null){
return R.error("detailId和taskId不能同时为空");
}
TaskComment taskComment = new TaskComment();
taskComment.setContent(roleModel.getContent());
taskComment.setTaskId(roleModel.getTaskId());
if(roleModel.getTaskId() !=null){
ResultTask resultTask = resultTaskService.selectResultTaskById(roleModel.getTaskId());
taskComment.setDetailId(resultTask.getDetailId());
taskComment.setType(1);
}else{
taskComment.setDetailId(roleModel.getDetailId());
taskComment.setType(0);//
}
ResultDetail resultDetail =resultDetailService.selectResultDetailById(taskComment.getDetailId());
taskComment.setResultRecordId(resultDetail.getRecordId());
@ -631,7 +643,24 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
taskComment.setStaffName(staffEntity.getName());
}
taskCommentService.insertTaskComment(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);
taskCommentDtoList.add(taskCommentDto);
}
pageUtils.setList(taskCommentDtoList);
return R.ok().put("data", pageUtils);
}
}

View File

@ -8,9 +8,14 @@ package com.lz.modules.performance.dao;
* @since 2020-12-08
*/
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.entity.TaskComment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TaskCommentMapper extends BaseMapper<TaskComment> {
@ -31,4 +36,6 @@ public interface TaskCommentMapper extends BaseMapper<TaskComment> {
int deleteTaskCommensByTaskId(@Param("taskId") Long taskId);
List<TaskComment> selectByCondition(@Param("page") IPage page, @Param("taskModel") TaskModel taskModel);
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lz.modules.performance.daor.TaskCommentMapper">
<mapper namespace="com.lz.modules.performance.dao.TaskCommentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.performance.entity.TaskComment">
@ -95,11 +95,19 @@
</update>
<select id="selectByCondition" resultType="com.lz.modules.performance.entity.TaskComment">
select * from lz_task_comment where is_delete = 0
and (detail_id = #{taskModel.detailId} or task_id=#{taskModel.taskId} )
order by id desc
</select>
<update id="deleteTaskCommentById" parameterType="java.lang.Long">
update lz_task_comment set is_delete = 1 where id=#{id} limit 1
</update>
<update id="deleteTaskCommentById" parameterType="java.lang.Long">
<update id="deleteTaskCommensByTaskId" parameterType="java.lang.Long">
update lz_task_comment set is_delete = 1 where task_id=#{taskId}
</update>