diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java index b58b9d9..a8d6a20 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java @@ -149,7 +149,23 @@ public class OperAccessPlanEntity extends TenantEntity { @ApiModelProperty("当前步骤任务名称") private String taskName; + /** + * 技术负责人 + */ + @ApiModelProperty(value = "技术负责人") + private String techLeadName; + /** + * 管理负责人 + */ + @ApiModelProperty(value = "管理负责人") + private String managerName; @ApiModelProperty("当前环节处理人") private String nextStepOperator; + + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java index 273e5e1..336feff 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java @@ -111,4 +111,12 @@ public class OperAccessStatisticsEntity extends TenantEntity { @ApiModelProperty(value = "描述") private String descripiton; + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("修改人名称") + private String updateUserName; + + @ApiModelProperty("负责人名称") + private String managerName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java index 42c2995..fef2bc3 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java @@ -49,7 +49,11 @@ public class OperAccessTaskDetailEntity extends TenantEntity { @ApiModelProperty(value = "任务内容") private String content; + @ApiModelProperty("创建人名称") + private String createUserName; + @ApiModelProperty("修改人名称") + private String updateUserName; public void setValue(OperAccessContentDetailEntity contentDetailEntity){ contentDetailId = contentDetailEntity.getId(); content = contentDetailEntity.getContent(); diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java index cd0e6f8..27345a2 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java @@ -132,5 +132,11 @@ public class OperAccessTaskEntity extends TenantEntity { @ApiModelProperty("当前环节处理人") private String nextStepOperator; + @ApiModelProperty(value = "任务执行人") + private String handlerName; + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java index 82364f4..d1f9a3f 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.operational.maintenance.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.NullSerializer; @@ -72,6 +73,12 @@ public class OperMaintenancePlanEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) private Long disposer; /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String disposerName; + /** * 执行日期 */ @ApiModelProperty(value = "执行日期") @@ -114,4 +121,9 @@ public class OperMaintenancePlanEntity extends TenantEntity { */ private String stationCode; + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java index b0104d5..2f9fa11 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java @@ -71,6 +71,13 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty(value = "执行人") @JsonSerialize(nullsUsing = NullSerializer.class) private String disposer; + + /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String disposerName; /** * 执行日期 */ @@ -198,4 +205,10 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty("是否延期") private Boolean isDelay; + + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java index 4ff234c..4c018c6 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java @@ -50,4 +50,6 @@ public class TaskUserEntity extends TenantEntity { */ @ApiModelProperty(value = "领用时间") private LocalDateTime claimTime; + @ApiModelProperty(value = "用户ID") + private String userName; } \ No newline at end of file diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java index 3c9b55d..314dff3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java @@ -94,11 +94,14 @@ public class TaskController extends BladeController { TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.query().lambda().eq(TaskUserEntity::getTaskId, id).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.COLLECT.getStatus())); if(taskUserEntity!=null){ detail.setUserId(taskUserEntity.getUserId()); - User user = UserCache.getUser(taskUserEntity.getUserId()); - if(user!=null){ - String userName = user.getRealName(); - detail.setUserName(userName); + if(taskUserEntity.getUserId()!=null) { + detail.setUserName(taskUserEntity.getUserName()); } +// User user = UserCache.getUser(taskUserEntity.getUserId()); +// if(user!=null){ +// String userName = user.getRealName(); +// detail.setUserName(userName); +// } } //巡检记录 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java index 9c2a6c5..dc1f1c4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; @@ -28,6 +29,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; @@ -39,6 +41,7 @@ import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.TaskUtil; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -120,6 +123,23 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{ entity.setCode("PLAN_" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999))); entity.setProcDefId("overhaul_plan"); entity.setActStartTime(new Date()); + if (ObjectUtil.isNotEmpty(entity.getTechLead())){ + User user = UserCache.getUser(entity.getTechLead()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setTechLeadName(user.getName()); + } + } + if (ObjectUtil.isNotEmpty(entity.getManager())){ + User user = UserCache.getUser(entity.getManager()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setManagerName(user.getName()); + } + } + BladeUser user = AuthUtil.getUser(); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){ + entity.setCreateUserName(user.getUserName()); + entity.setUpdateUserName(user.getUserName()); + } planService.save(entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java index ec72544..fe8dc20 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; @@ -31,6 +32,7 @@ import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.TaskUtil; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -113,6 +115,14 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { private void save(AccessTaskV4DTO entity) { entity.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999))); List materialEntityList = JSONObject.parseArray(JSON.toJSONString(entity.getAccessMaterials()), OperAccessMaterialEntity.class); + if (ObjectUtil.isNotEmpty(entity.getHandler())){ + User user = UserCache.getUser(entity.getHandler()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setHandlerName(user.getName()); + entity.setCreateUserName(user.getName()); + entity.setUpdateUserName(user.getName()); + } + } taskService.save(entity); } @@ -254,6 +264,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { statisticsDTO.setEmCode(entity.getEmCode()); statisticsDTO.setPlanHours(entity.getPlanHours()); statisticsDTO.setManager(entity.getHandler()); + statisticsDTO.setManagerName(entity.getHandlerName()); OperAccessContentEntity content = contentService.getById(entity.getId()); if (ObjectUtil.isNotEmpty(content)) { statisticsDTO.setPid(content.getLibraryId()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java index 548fd15..15e1726 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; import com.hnac.hzims.operational.access.excel.OperAccessStatisticsExport; @@ -16,8 +17,13 @@ import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,7 +44,19 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl materialEntityList = JSONObject.parseArray(JSON.toJSONString(req.getAccessMaterials()), OperAccessMaterialEntity.class); if (super.save(req)) { if (CollectionUtil.isNotEmpty(materialEntityList)) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java index 1b085da..9dfb3f0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java @@ -20,14 +20,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - @ApiModelProperty("修改人名称") - private String updateUserName; - - @ApiModelProperty("负责人名称") - private String managerName; @ApiModelProperty(value = "任务名称") private String taskName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java index 4281ee8..49542be 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java @@ -17,9 +17,5 @@ public class OperAccessTaskDetailVO extends OperAccessTaskDetailEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - @ApiModelProperty("修改人名称") - private String updateUserName; } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java index 1254b4c..cdc7cae 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java @@ -20,14 +20,14 @@ public class OperAccessTaskVO extends OperAccessTaskEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - - @ApiModelProperty("修改人名称") - private String updateUserName; - - @ApiModelProperty("执行人名称") - private String handlerName; +// @ApiModelProperty("创建人名称") +// private String createUserName; +// +// @ApiModelProperty("修改人名称") +// private String updateUserName; +// +// @ApiModelProperty("执行人名称") +// private String handlerName; @ApiModelProperty("状态名称") private String statusName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java index 6489318..894278d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java @@ -24,12 +24,12 @@ public class OperAccessStatisticsWrapper extends BaseEntityWrapper OperAccessTaskVO entityVOExtras(T entity) { OperAccessTaskVO vo = BeanUtil.copy(entity, OperAccessTaskVO.class); - User createUser = UserCache.getUser(entity.getCreateUser()); - User updateUser = UserCache.getUser(entity.getUpdateUser()); - User handlerName = UserCache.getUser(entity.getHandler()); - vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); - vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null)); - vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null)); +// User createUser = UserCache.getUser(entity.getCreateUser()); +// User updateUser = UserCache.getUser(entity.getUpdateUser()); +// User handlerName = UserCache.getUser(entity.getHandler()); +// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); +// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null)); +// vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null)); vo.setStatusName(DictCache.getValue(DictConstant.ACCESS_TASK_STATUS, entity.getStatus())); return vo; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java index 22831e7..fafd0e9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java @@ -177,20 +177,23 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl() {{ - eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId()); - last("limit 1"); - }}); - imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson()); - } else { - ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId()); - imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName()); - imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId()); - imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId()); + if(ObjectUtil.isNotEmpty(imsSchedulingVo)) { + if (null == imsSchedulingVo.getGroupId()) { + imsSchedulingVo.setGroupName("临时班组"); + ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId()); + last("limit 1"); + }}); + imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson()); + } else { + ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId()); + imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName()); + imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId()); + imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId()); + } + return imsSchedulingVo; } - return imsSchedulingVo; + return new ImsSchedulingVo(); } @Override @@ -1257,6 +1260,9 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl userR = userClient.userInfoById(imsSchedulingVo.getManagerId()); imsSchedulingVo.setManagerName(userR.getData().getName()); imsSchedulingVo.setCreateDept(userR.getData().getCreateDept()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index 83fbfed..ff91a6a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; +import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; @@ -63,6 +64,7 @@ import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import javax.annotation.Resource; +import javax.xml.ws.WebServiceException; import java.math.BigDecimal; import java.sql.Time; import java.text.SimpleDateFormat; @@ -455,6 +457,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpllambdaUpdate() - .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME)) - .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId()) - ); + ImsDutyLogEntity update = imsDutyLogService.getOne(Wrappers.lambdaQuery() + .eq(ImsDutyLogEntity::getDutyId, imsDutyLogEntity.getDutyId()) + .last("limit 1")); + update.setCarryTime(DateUtil.format(new Date(), PATTERN_DATETIME)); + imsDutyLogService.updateById(update); +// imsDutyLogService.update(Wrappers.lambdaUpdate() +// .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME)) +// .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId()) +// ); log.info("更新值班日志"); } ImsDutyRecEntity dutyRec = BeanUtil.copy(recDTO, ImsDutyRecEntity.class); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java index f5a2407..de37b9c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java @@ -1,10 +1,12 @@ package com.hnac.hzims.operational.maintenance.controller; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.maintenance.dto.OperMaintenancePlanDTO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity; import com.hnac.hzims.operational.maintenance.scheduled.MaintenancePlanCreateTask; @@ -18,8 +20,12 @@ import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -59,6 +65,17 @@ public class OperMaintenancePlanController extends BladeController { public R save(@Valid @RequestBody OperMaintenancePlanEntity req) { //设备为临时任务类型 req.setTaskType("1"); + if (ObjectUtil.isNotEmpty(req.getDisposer())){ + User user = UserCache.getUser(req.getDisposer()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + req.setDisposerName(user.getName()); + } + } + BladeUser user = AuthUtil.getUser(); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){ + req.setCreateUserName(user.getUserName()); + req.setUpdateUserName(user.getUserName()); + } planService.save(req); return R.data(req); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java index ebe750f..3de3235 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java @@ -36,12 +36,12 @@ public class OperMaintenancePlanWrapper extends BaseEntityWrapper{ - List disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList()); - return disposerList.stream().map(d ->{ - User user = UserCache.getUser(Long.parseLong(d)); - return Optional.ofNullable(user).map(User::getName).orElse(""); - }).collect(Collectors.joining(",")); - }).orElse(""); - vo.setDisposerName(disposerName); +// String disposerName = Optional.ofNullable(entity.getDisposer()).map(s->{ +// List disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList()); +// return disposerList.stream().map(d ->{ +// User user = UserCache.getUser(Long.parseLong(d)); +// return Optional.ofNullable(user).map(User::getName).orElse(""); +// }).collect(Collectors.joining(",")); +// }).orElse(""); +// vo.setDisposerName(disposerName); return vo; } diff --git a/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml b/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml index 3e2c854..1ff2eac 100644 --- a/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml +++ b/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml @@ -1,6 +1,6 @@ - + @@ -60,8 +60,8 @@ - - + +