Browse Source

#班组成员查询

zhongwei
yang_shj 11 months ago
parent
commit
118ec24ca6
  1. 25
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyGroupMemberVo.java
  2. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/DutyMemberVO.java
  3. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml
  4. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyGroupController.java
  5. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.java
  6. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.xml
  7. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.java
  8. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml
  9. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyGroupService.java
  10. 23
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java
  11. 10
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

25
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<DutyMemberVO> member;
}

21
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;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml

@ -36,7 +36,7 @@
ON OS.`TASK_ID` = OT.`ID` ON OS.`TASK_ID` = OT.`ID`
WHERE OS.IS_DELETED = 0 WHERE OS.IS_DELETED = 0
<if test="dto.emCode != null and dto.emCode != ''"> <if test="dto.emCode != null and dto.emCode != ''">
and OS.emCode = #{dto.emCode} and OS.EM_CODE = #{dto.emCode}
</if> </if>
<if test="dto.taskName != null"> <if test="dto.taskName != null">
and OT.`NAME` like concat('%',#{dto.taskName},'%') and OT.`NAME` like concat('%',#{dto.taskName},'%')

7
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.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupService; 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.ImsDutyGroupPersonVO;
import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -176,5 +177,11 @@ public class ImsDutyGroupController extends BladeController {
return imsDutyGroupService.getListManager(createDept); return imsDutyGroupService.getListManager(createDept);
} }
@GetMapping("/groupMember")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询班组成员", notes = "传入imsDutyGroup")
public R<List<DutyGroupMemberVo>> groupMember(@RequestParam(value = "deptId",required = false) Long deptId) {
return R.data(imsDutyGroupService.groupMember(deptId));
}
} }

3
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; package com.hnac.hzims.operational.duty.mapper;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.vo.DutyGroupMemberVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
@ -24,4 +25,6 @@ public interface ImsDutyGroupMapper extends UserDataScopeBaseMapper<ImsDutyGroup
@UserDataAuth @UserDataAuth
List<ImsDutyGroupEntity> selectDutyGroupJoinDutyMain(@Param("startDate") String startDate, @Param("endDate") String endDate); List<ImsDutyGroupEntity> selectDutyGroupJoinDutyMain(@Param("startDate") String startDate, @Param("endDate") String endDate);
@UserDataAuth
List<DutyGroupMemberVo> groupMember(@Param("deptId") Long deptId);
} }

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupMapper.xml

@ -15,6 +15,17 @@
<result column="STATUS" property="status"/> <result column="STATUS" property="status"/>
<result column="CREATE_DEPT" property="createDept"/> <result column="CREATE_DEPT" property="createDept"/>
</resultMap> </resultMap>
<resultMap id="group_member_map" type="com.hnac.hzims.operational.duty.vo.DutyGroupMemberVo">
<result column="ID" property="groupId"/>
<result column="GROUP_NAME" property="groupName"/>
<result column="CREATE_DEPT" property="createDept"/>
<collection property="member"
select="com.hnac.hzims.operational.duty.mapper.ImsDutyGroupPMapper.member"
column="ID">
</collection>
</resultMap>
<update id="updateManagerIdById"> <update id="updateManagerIdById">
update hz_ims_duty_group set MANAGER_ID = NULL where ID = #{id} update hz_ims_duty_group set MANAGER_ID = NULL where ID = #{id}
</update> </update>
@ -28,4 +39,15 @@
AND DM.DUTY_DATE &lt;= #{endDate} AND DM.DUTY_DATE &lt;= #{endDate}
</select> </select>
<select id="groupMember" resultMap="group_member_map">
SELECT ID,GROUP_NAME,CREATE_DEPT
FROM HZ_IMS_DUTY_GROUP
<where>
IS_DELETED = 0
<if test="deptId != null and deptId != ''">
AND CREATE_DEPT = #{deptId}
</if>
</where>
</select>
</mapper> </mapper>

3
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.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupPEntity; 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.duty.vo.ImsDutyGroupPVO;
import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO; import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO;
import com.hnac.hzims.operational.report.vo.DutyReportVO; import com.hnac.hzims.operational.report.vo.DutyReportVO;
@ -55,5 +56,5 @@ public interface ImsDutyGroupPMapper extends BaseMapper<ImsDutyGroupPEntity> {
*/ */
void deleteByGroupIdAndPersonId(@Param("groupId") Long groupId,@Param("personId") Long personId); void deleteByGroupIdAndPersonId(@Param("groupId") Long groupId,@Param("personId") Long personId);
List<DutyMemberVO> member(@Param("groupId") Long groupId);
} }

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyGroupPMapper.xml

@ -159,4 +159,9 @@
</if> </if>
</where> </where>
</select> </select>
<select id="member" resultType="com.hnac.hzims.operational.duty.vo.DutyMemberVO">
SELECT PERSION_ID
FROM HZ_IMS_DUTY_GROUP_P
WHERE GROUP_ID = #{groupId}
</select>
</mapper> </mapper>

3
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.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; 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.ImsDutyGroupPersonVO;
import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO; import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
@ -60,4 +61,6 @@ public interface IImsDutyGroupService extends BaseService<ImsDutyGroupEntity> {
R<List<ImsDutyGroupEntity>> getListManager(Long createDept); R<List<ImsDutyGroupEntity>> getListManager(Long createDept);
List<ImsDutyGroupEntity> getDutyGroupJoinDutyMain(String startDate,String endDate); List<ImsDutyGroupEntity> getDutyGroupJoinDutyMain(String startDate,String endDate);
List<DutyGroupMemberVo> groupMember(Long deptId);
} }

23
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.IImsDutyGroupPService;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupService; import com.hnac.hzims.operational.duty.service.IImsDutyGroupService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService; import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPVO; import com.hnac.hzims.operational.duty.vo.*;
import com.hnac.hzims.operational.duty.vo.ImsDutyGroupPersonVO;
import com.hnac.hzims.operational.duty.vo.ImsDutyGroupVO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -358,6 +356,25 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
return this.baseMapper.selectDutyGroupJoinDutyMain(startDate,endDate); return this.baseMapper.selectDutyGroupJoinDutyMain(startDate,endDate);
} }
/**
* 获取班组成员
* @param deptId
* @return
*/
@Override
public List<DutyGroupMemberVo> groupMember(Long deptId) {
List<DutyGroupMemberVo> groupMembers = this.baseMapper.groupMember(deptId);
return groupMembers.stream().peek(group->{
List<DutyMemberVO> 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());
}
/** /**
* 获取某个月的天数 * 获取某个月的天数

10
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.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; 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.api.R;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
@ -80,7 +79,12 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
private void startProcess(WorkTaskVO workTask) { private void startProcess(WorkTaskVO workTask) {
Map<String, Object> variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(workTask, DateUtil.PATTERN_DATETIME), Map.class); Map<String, Object> 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<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey("work_task", FlowUtil.getBusinessKey("work_task_v4",String.valueOf(workTask.getId())), workTask.getCode(), variables); R<BladeFlow> 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); log.error("work_task_start_process_result :{}",result);
// 更新任务流程Id // 更新任务流程Id
@ -89,7 +93,7 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
workTask.setProcessInstanceId(flow.getProcessInstanceId()); workTask.setProcessInstanceId(flow.getProcessInstanceId());
this.updateById(workTask); this.updateById(workTask);
} else { } else {
throw new ServiceException("开启检修计划流程失败,code=" + result.getCode()); throw new ServiceException("开启工作任务计划流程失败,code=" + result.getCode());
} }
} }

Loading…
Cancel
Save