Browse Source

增加巡检任务人员姓名字段

zhongwei
ty 8 months ago
parent
commit
6372ca2209
  1. 7
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java
  2. 12
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

7
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/job/service/TaskJobService.java

@ -31,6 +31,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
@ -104,6 +105,12 @@ public class TaskJobService {
TaskUserEntity taskUserEntity = TaskUserEntity.builder().taskId(taskId).userId(planUserId)
.claimStatus(ClaimStatusEnum.UN_COLLECT.getStatus()).build();
taskUserEntity.setTenantId(tenantId);
User user = UserCache.getUser(planUserId);
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())) {
taskUserEntity.setUserName(user.getName());
}else {
taskUserEntity.setUserName("");
}
return taskUserEntity;
}

12
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

@ -180,15 +180,21 @@
order by t.UPDATE_TIME desc
</select>
<select id="getAllPageList" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">
SELECT t.*,u.USER_ID as userIds,u.USER_NAME as userNames
SELECT
t.*, b.USER_ID as userIds,
(SELECT group_concat(u.user_name) FROM HZ_ST_EX_TASK_USER u WHERE t.ID=u.TASK_ID
<if test="task.userId != null ">
and u.USER_ID=#{task.userId}
</if>) AS userNames
from
HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID and u.IS_DELETED=0
HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER b on t.ID=b.TASK_ID and b.IS_DELETED=0
where t.IS_DELETED=0
<if test="task.userId != null ">
and u.USER_ID=#{task.userId}
</if>
<include refid="getTaskListSql"></include>
GROUP BY t.id
order by t.UPDATE_TIME desc
</select>
<select id="getAllExportList" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">

Loading…
Cancel
Save