Browse Source

值班增加值班长名称和人员名称

zhongwei
ty 8 months ago
parent
commit
747b81ca44
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ImsDutyGroupVO.java
  2. 21
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/duty/vo/ImsDutyGroupVO.java

@ -40,4 +40,6 @@ public class ImsDutyGroupVO extends ImsDutyGroupEntity {
@ApiModelProperty(value = "是否更新排班 true 是 false 否") @ApiModelProperty(value = "是否更新排班 true 是 false 否")
private Boolean updateDuty; private Boolean updateDuty;
@ApiModelProperty(value = "值班组组长名字")
private String managerName;
} }

21
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java

@ -164,6 +164,25 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
ImsDutyGroupEntity entity = pages.getRecords().get(i); ImsDutyGroupEntity entity = pages.getRecords().get(i);
ImsDutyGroupVO imsDutyGroupVO = new ImsDutyGroupVO(); ImsDutyGroupVO imsDutyGroupVO = new ImsDutyGroupVO();
imsDutyGroupVO.setId(entity.getId()); imsDutyGroupVO.setId(entity.getId());
imsDutyGroupVO.setManagerId(entity.getManagerId());
User user = UserCache.getUser(entity.getManagerId());
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())){
imsDutyGroupVO.setManagerName(user.getName());
}
List<ImsDutyGroupPVO> imsDutyGroupPVOS = imsDutyGroupPService.listByGroupId(entity.getId());
if (CollectionUtil.isNotEmpty(imsDutyGroupPVOS)){
List<Long> userIds = imsDutyGroupPVOS.stream().map(ImsDutyGroupPVO::getPersonId).collect(Collectors.toList());
String name="";
for (int i1 = 0; i1 < userIds.size(); i1++) {
name=name+UserCache.getUser(userIds.get(i1)).getName();
if (i1!= userIds.size()-1){
name=name+",";
}
}
if (StringUtils.isNotBlank(name)) {
imsDutyGroupVO.setPersonName(name);
}
}
imsDutyGroupVO.setGroupName(entity.getGroupName()); imsDutyGroupVO.setGroupName(entity.getGroupName());
imsDutyGroupVO.setTenantId(entity.getTenantId()); imsDutyGroupVO.setTenantId(entity.getTenantId());
imsDutyGroupVO.setIsDeleted(entity.getIsDeleted()); imsDutyGroupVO.setIsDeleted(entity.getIsDeleted());
@ -171,7 +190,6 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
imsDutyGroupVO.setCreateUser(entity.getCreateUser()); imsDutyGroupVO.setCreateUser(entity.getCreateUser());
List<ImsDutyGroupPEntity> list = imsDutyGroupPService.selectByGroupId(entity.getId()); List<ImsDutyGroupPEntity> list = imsDutyGroupPService.selectByGroupId(entity.getId());
String personId = ""; String personId = "";
String personName = "";
for (int j = 0, len = list.size(); j < len; j++) { for (int j = 0, len = list.size(); j < len; j++) {
if (j != 0) { if (j != 0) {
personId += "^" + list.get(j).getPersonId(); personId += "^" + list.get(j).getPersonId();
@ -183,7 +201,6 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
} }
imsDutyGroupVO.setPersonId(personId); imsDutyGroupVO.setPersonId(personId);
imsDutyGroupVO.setCreateDept(entity.getCreateDept()); imsDutyGroupVO.setCreateDept(entity.getCreateDept());
imsDutyGroupVO.setPersonName(personName);
voList.add(imsDutyGroupVO); voList.add(imsDutyGroupVO);
} }
voPages.setRecords(voList); voPages.setRecords(voList);

Loading…
Cancel
Save