diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java index 96dff59..5c1fcc9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenancePlanCreateTask.java @@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.*; import org.springblade.system.cache.DictCache; 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; import org.springframework.stereotype.Component; @@ -151,7 +152,10 @@ public class MaintenancePlanCreateTask { planEntity.setImsDutyClassId(libraryEntity.getImsDutyClassId()); planEntity.setImsDutyGroupId(libraryEntity.getImsDutyGroupId()); if(ObjectUtil.isEmpty(libraryEntity.getMaintenanceModel()) || libraryEntity.getMaintenanceModel() == 1){ - planEntity.setDisposer(Long.valueOf(disposers.get((i + startIndex) % disposers.size()))); + Long disposer = Long.valueOf(disposers.get((i + startIndex) % disposers.size())); + planEntity.setDisposer(disposer); + User user = UserCache.getUser(disposer); + planEntity.setDisposerName(user.getName()); } planEntity.setDisposeTime(planDates.get(i)); planEntities.add(planEntity); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java index d8de898..a540cf2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java @@ -34,6 +34,8 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.*; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.beans.BeanUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.stereotype.Service; @@ -342,7 +344,16 @@ public class MaintenanceServiceImpl implements MaintenanceService { ImsDutyMainEntity entity = mainService.getOne(entityLambdaQueryWrapper); if (ObjectUtil.isNotEmpty(entity) && StringUtils.isNotEmpty(entity.getDutyPersonIds())) { String userId = entity.getDutyPersonIds(); + String[] split = userId.split("\\^"); + String disposerName=""; + for (int i = 0; i < split.length; i++) { + User user = UserCache.getUser(Long.valueOf(split[i])); + if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())){ + disposerName=disposerName+user.getName(); + } + } taskEntity.setDisposer(userId.replaceAll("\\^", ",")); + taskEntity.setDisposerName(disposerName); } else { log.info("计划ID为:{}未查询到排班记录", finalPlanEntity.getId()); // LambdaUpdateWrapper planQueryWrapper = Wrappers.lambdaUpdate()