fix(examine): 修复考核任务查询和用户信息获取问题
- 修复了考核任务查询中根据状态筛选的问题 - 优化了考核用户信息获取的逻辑,增加了主管用户 ID 和名称字段 - 调整了考核用户信息保存逻辑,自动设置主管用户 ID - 优化了任务查询接口,支持直接使用查询参数对象dev_1.1.0
parent
fe71d980b8
commit
64ef5730bf
|
@ -32,7 +32,7 @@ public class TaskSetUpController extends BaseController {
|
|||
|
||||
// 分页查询+模糊查询
|
||||
@GetMapping("/get")
|
||||
public TableDataInfo getTasks(@RequestBody TaskQueryDto queryDto) {
|
||||
public TableDataInfo getTasks(TaskQueryDto queryDto) {
|
||||
startPage();
|
||||
List<ExamineTask> tasks = taskService.getTasks(queryDto);
|
||||
return getDataTable(tasks);
|
||||
|
|
|
@ -15,8 +15,10 @@ import org.springframework.stereotype.Service;
|
|||
import tech.unissense.pms.business.examine.detail.vo.ExamineConfigDetailVo;
|
||||
import tech.unissense.pms.business.examine.task.domain.ExamineTask;
|
||||
import tech.unissense.pms.business.examine.task.mapper.ExamineTaskMapper;
|
||||
import tech.unissense.pms.business.examine.user.domain.ExamineUser;
|
||||
import tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper;
|
||||
import tech.unissense.pms.business.work.logger.service.IWorkLoggerService;
|
||||
import tech.unissense.pms.common.exception.ServiceException;
|
||||
import tech.unissense.pms.common.utils.bean.BeanUtils;
|
||||
import tech.unissense.pms.system.service.ISysDictDataService;
|
||||
|
||||
|
@ -125,7 +127,14 @@ public class ExamineDetailServiceImpl implements ExamineDetailService {
|
|||
|
||||
Map<String,Object> result=new HashMap<>();
|
||||
result.put("examineConfigDetailVoList",examineConfigDetailVoList);
|
||||
result.put("examineUser",userMapper.queryById(dto.getExamineId()));
|
||||
ExamineUser examineUser = new ExamineUser();
|
||||
examineUser.setId(dto.getExamineId());
|
||||
List<ExamineUser> list1 = userMapper.list(examineUser);
|
||||
if (CollUtil.isEmpty(list1)){
|
||||
throw new ServiceException("未找到考核人员");
|
||||
}
|
||||
result.put("examineUser",list1.get(0));
|
||||
result.put("examineTask",examineTaskMapper.queryById(dto.getExamineTaskId()));
|
||||
return result;
|
||||
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ public class ExamineUser extends BaseEntity {
|
|||
* 主管评分状态 0:待完成 1:已完成
|
||||
*/
|
||||
private String examineStatus;
|
||||
private Integer manageUserId;
|
||||
private String manageUserName;
|
||||
|
||||
private String deptId;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import tech.unissense.pms.business.examine.user.mapper.ExamineUserMapper;
|
|||
import tech.unissense.pms.business.examine.user.service.ExamineUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.unissense.pms.common.annotation.DataScope;
|
||||
import tech.unissense.pms.common.utils.SecurityUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -98,6 +99,9 @@ public class ExamineUserServiceImpl implements ExamineUserService {
|
|||
examineUser.setManageScore(examineDto.getManageScore());
|
||||
String examineStatus = StrUtil.isNotEmpty(examineDto.getExamineStatus()) ? examineDto.getExamineStatus() : user.getExamineStatus();
|
||||
String examineStatusSelf = StrUtil.isNotEmpty(examineDto.getExamineStatusSelf()) ? examineDto.getExamineStatusSelf() : user.getExamineStatusSelf();
|
||||
if ("1".equals(examineStatus) && user.getManageUserId() == null) {
|
||||
examineUser.setManageUserId(SecurityUtils.getUserId().intValue());
|
||||
}
|
||||
//均已完成 计算总分数
|
||||
boolean flag = "1".equals(examineStatus) && "1".equals(examineStatusSelf);
|
||||
if (flag) {
|
||||
|
|
|
@ -49,7 +49,14 @@
|
|||
AND task_name LIKE CONCAT('%', #{taskName}, '%')
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
AND task_status = #{taskStatus}
|
||||
<choose>
|
||||
<when test="taskStatus == 2">
|
||||
AND end_time < NOW()
|
||||
</when>
|
||||
<when test="taskStatus == 0">
|
||||
AND end_time > CURRENT_TIMESTAMP
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="year != null">
|
||||
AND year = #{year}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<result property="manageScore" column="manage_score" jdbcType="NUMERIC"/>
|
||||
<result property="examineStatus" column="examine_status" jdbcType="VARCHAR"/>
|
||||
<result property="examineStatusSelf" column="examine_status_self" jdbcType="VARCHAR"/>
|
||||
<result property="manageUserId" column="manage_user_id" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="base_query">
|
||||
|
@ -21,7 +22,8 @@
|
|||
judge_content,
|
||||
manage_score,
|
||||
examine_status,
|
||||
examine_status_self
|
||||
examine_status_self,
|
||||
manage_user_id
|
||||
from pms_examine_user
|
||||
|
||||
</sql>
|
||||
|
@ -67,8 +69,11 @@
|
|||
t1.manage_score,
|
||||
t1.examine_status,
|
||||
t1.examine_status_self,
|
||||
t2.nick_name as userName
|
||||
t1.manage_user_id,
|
||||
t2.nick_name as userName,
|
||||
t3.nick_name as manageUserName
|
||||
from pms_examine_user t1 left join sys_user t2 on t1.user_id = t2.user_id
|
||||
left join sys_user t3 on t1.manage_user_id = t3.user_id
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and t1.id = #{id}
|
||||
|
@ -165,6 +170,9 @@
|
|||
<if test="examineStatusSelf != null and examineStatusSelf != ''">
|
||||
examine_status_self = #{examineStatusSelf},
|
||||
</if>
|
||||
<if test="manageUserId != null">
|
||||
manage_user_id = #{manageUserId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
Loading…
Reference in New Issue