From 118ec24ca60a1b028330ddbaa0c2f4eaed3b0f93 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 11 Jan 2024 14:19:45 +0800 Subject: [PATCH] =?UTF-8?q?#=E7=8F=AD=E7=BB=84=E6=88=90=E5=91=98=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/duty/vo/DutyGroupMemberVo.java | 25 ++++++++++++++++++++++ .../hzims/operational/duty/vo/DutyMemberVO.java | 21 ++++++++++++++++++ .../access/mapper/OperAccessStatisticsMapper.xml | 2 +- .../duty/controller/ImsDutyGroupController.java | 7 ++++++ .../duty/mapper/ImsDutyGroupMapper.java | 3 +++ .../operational/duty/mapper/ImsDutyGroupMapper.xml | 22 +++++++++++++++++++ .../duty/mapper/ImsDutyGroupPMapper.java | 3 ++- .../duty/mapper/ImsDutyGroupPMapper.xml | 5 +++++ .../duty/service/IImsDutyGroupService.java | 3 +++ .../duty/service/impl/ImsDutyGroupServiceImpl.java | 23 +++++++++++++++++--- .../repair/service/impl/WorkTaskServiceImpl.java | 10 ++++++--- 11 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyMemberVO.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java new file mode 100644 index 0000000..1a0ffe3 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.operational.duty.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + */ +@Data +public class DutyGroupMemberVo { + + @ApiModelProperty(value = "班组Id") + private String groupId; + + @ApiModelProperty(value = "班组名称") + private String groupName; + + @ApiModelProperty(value = "机构Id") + private String createDept; + + @ApiModelProperty(value = "班组成员对象") + private List member; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyMemberVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyMemberVO.java new file mode 100644 index 0000000..90395ac --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyMemberVO.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.operational.duty.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class DutyMemberVO { + + @ApiModelProperty(value = "班组人员Id") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long personId; + + @ApiModelProperty(value = "班组人员名称") + private String personName; + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml index caedd20..bda5b07 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml @@ -36,7 +36,7 @@ ON OS.`TASK_ID` = OT.`ID` WHERE OS.IS_DELETED = 0 - and OS.emCode = #{dto.emCode} + and OS.EM_CODE = #{dto.emCode} and OT.`NAME` like concat('%',#{dto.taskName},'%') diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java index c3ded48..d8d4f15 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java @@ -8,6 +8,7 @@ import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; import com.hnac.hzims.operational.duty.service.IImsDutyGroupService; +import com.hnac.hzims.operational.duty.vo.DutyGroupMemberVo; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPersonVO; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO; import io.swagger.annotations.Api; @@ -176,5 +177,11 @@ public class ImsDutyGroupController extends BladeController { return imsDutyGroupService.getListManager(createDept); } + @GetMapping("/groupMember") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询班组成员", notes = "传入imsDutyGroup") + public R> groupMember(@RequestParam(value = "deptId",required = false) Long deptId) { + return R.data(imsDutyGroupService.groupMember(deptId)); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.java index cb71e7b..e447ef2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.java @@ -1,6 +1,7 @@ package com.hnac.hzims.operational.duty.mapper; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; +import com.hnac.hzims.operational.duty.vo.DutyGroupMemberVo; import org.apache.ibatis.annotations.Param; import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; @@ -24,4 +25,6 @@ public interface ImsDutyGroupMapper extends UserDataScopeBaseMapper selectDutyGroupJoinDutyMain(@Param("startDate") String startDate, @Param("endDate") String endDate); + @UserDataAuth + List groupMember(@Param("deptId") Long deptId); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.xml index a4b6796..7d0116e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.xml @@ -15,6 +15,17 @@ + + + + + + + + + update hz_ims_duty_group set MANAGER_ID = NULL where ID = #{id} @@ -28,4 +39,15 @@ AND DM.DUTY_DATE <= #{endDate} + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.java index 72fa2b4..6d452b1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.java @@ -3,6 +3,7 @@ package com.hnac.hzims.operational.duty.mapper; import com.baomidou.mybatisplus.annotation.SqlParser; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupPEntity; +import com.hnac.hzims.operational.duty.vo.DutyMemberVO; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPVO; import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO; import com.hnac.hzims.operational.report.vo.DutyReportVO; @@ -55,5 +56,5 @@ public interface ImsDutyGroupPMapper extends BaseMapper { */ void deleteByGroupIdAndPersonId(@Param("groupId") Long groupId,@Param("personId") Long personId); - + List member(@Param("groupId") Long groupId); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml index ca66a40..0698d1a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml @@ -159,4 +159,9 @@ + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyGroupService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyGroupService.java index 292a84e..334435b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyGroupService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyGroupService.java @@ -3,6 +3,7 @@ package com.hnac.hzims.operational.duty.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; +import com.hnac.hzims.operational.duty.vo.DutyGroupMemberVo; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPersonVO; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO; import org.springblade.core.mp.base.BaseService; @@ -60,4 +61,6 @@ public interface IImsDutyGroupService extends BaseService { R> getListManager(Long createDept); List getDutyGroupJoinDutyMain(String startDate,String endDate); + + List groupMember(Long deptId); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java index 17d4e0b..f6f090d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java @@ -10,9 +10,7 @@ import com.hnac.hzims.operational.duty.mapper.ImsDutyMainPersonMapper; import com.hnac.hzims.operational.duty.service.IImsDutyGroupPService; import com.hnac.hzims.operational.duty.service.IImsDutyGroupService; import com.hnac.hzims.operational.duty.service.IImsDutyMainService; -import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPVO; -import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPersonVO; -import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO; +import com.hnac.hzims.operational.duty.vo.*; import org.apache.commons.lang3.StringUtils; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; @@ -358,6 +356,25 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl groupMember(Long deptId) { + List groupMembers = this.baseMapper.groupMember(deptId); + return groupMembers.stream().peek(group->{ + List members = group.getMember().stream().peek(member->{ + User person = UserCache.getUser(member.getPersonId()); + if (ObjectUtil.isNotEmpty(person)) { + member.setPersonName(person.getName()); + } + }).collect(Collectors.toList()); + group.setMember(members.stream().filter(o->StringUtil.isNotBlank(o.getPersonName())).collect(Collectors.toList())); + }).filter(o-> CollectionUtil.isNotEmpty(o.getMember())).collect(Collectors.toList()); + } + /** * 获取某个月的天数 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java index a394dfd..88869be 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java @@ -14,7 +14,6 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; -import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ObjectUtil; @@ -80,7 +79,12 @@ public class WorkTaskServiceImpl extends BaseServiceImpl variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(workTask, DateUtil.PATTERN_DATETIME), Map.class); - variables.put("creator", TaskUtil.getTaskUser(String.valueOf(AuthUtil.getUserId()))); + variables.put("head", TaskUtil.getTaskUser(String.valueOf(workTask.getHead()))); + // 班组成员 + String[] member = workTask.getMember().split(","); + for(int i = 1;i <= member.length ; i++){ + variables.put("duty" + i, TaskUtil.getTaskUser(member[i-1])); + } R result = flowClient.startProcessInstanceContainNameByKey("work_task", FlowUtil.getBusinessKey("work_task_v4",String.valueOf(workTask.getId())), workTask.getCode(), variables); log.error("work_task_start_process_result :{}",result); // 更新任务流程Id @@ -89,7 +93,7 @@ public class WorkTaskServiceImpl extends BaseServiceImpl