Browse Source

检修计划和任务添加姓名字段

zhongwei
ty 10 months ago
parent
commit
ce2035f145
  1. 16
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java
  2. 8
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java
  3. 4
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java
  4. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java
  5. 12
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java
  6. 13
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java
  7. 2
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java
  8. 11
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  9. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  10. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  11. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java
  12. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskDetailServiceImpl.java
  13. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  14. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java
  15. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java
  16. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java
  17. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java
  18. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskDetailWrapper.java
  19. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskWrapper.java
  20. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  21. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  22. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java
  23. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java
  24. 24
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenanceTaskWrapper.java
  25. 6
      hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml

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

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

4
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();

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

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

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

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

11
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.<TaskUserEntity>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);
// }
}
//巡检记录

20
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);
}

11
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<OperAccessMaterialEntity> 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());

20
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<OperAccessS
@Override
public R doSave(OperAccessStatisticsDTO req) {
return R.status(super.save(req));
if (ObjectUtil.isNotEmpty(req.getManager())){
User user = UserCache.getUser(req.getManager());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setManagerName(user.getName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
boolean save = super.save(req);
return R.status(save);
}
@Override

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskDetailServiceImpl.java

@ -1,8 +1,10 @@
package com.hnac.hzims.operational.access.service.impl;
import cn.hutool.core.util.ObjectUtil;
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.OperAccessTaskDetailDTO;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import com.hnac.hzims.operational.access.mapper.OperAccessTaskDetailMapper;
@ -12,7 +14,11 @@ import com.hnac.hzims.operational.access.wrapper.OperAccessTaskDetailWrapper;
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.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -27,6 +33,11 @@ public class OperAccessTaskDetailServiceImpl extends BaseServiceImpl<OperAccessT
@Override
public R doSave(OperAccessTaskDetailDTO req) {
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
return R.status(super.save(req));
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -50,6 +50,7 @@ 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.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.*;
@ -103,6 +104,17 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
@Override
public R doSave(OperAccessTaskDTO req) {
req.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999)));
if (ObjectUtil.isNotEmpty(req.getHandler())){
User user = UserCache.getUser(req.getHandler());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setHandlerName(user.getName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
}
List<OperAccessMaterialEntity> materialEntityList = JSONObject.parseArray(JSON.toJSONString(req.getAccessMaterials()), OperAccessMaterialEntity.class);
if (super.save(req)) {
if (CollectionUtil.isNotEmpty(materialEntityList)) {

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

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

16
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;

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java

@ -24,12 +24,12 @@ public class OperAccessStatisticsWrapper extends BaseEntityWrapper<OperAccessSta
@Override
public OperAccessStatisticsVO entityVO(OperAccessStatisticsEntity entity) {
OperAccessStatisticsVO vo = BeanUtil.copy(entity, OperAccessStatisticsVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
User manager = UserCache.getUser(entity.getManager());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
vo.setManagerName(Optional.ofNullable(manager).map(User :: getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// User manager = UserCache.getUser(entity.getManager());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
// vo.setManagerName(Optional.ofNullable(manager).map(User :: getName).orElse(null));
return vo;
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskDetailWrapper.java

@ -25,10 +25,10 @@ public class OperAccessTaskDetailWrapper extends BaseEntityWrapper<OperAccessTas
@Override
public OperAccessTaskDetailVO entityVO(OperAccessTaskDetailEntity entity) {
OperAccessTaskDetailVO vo = BeanUtil.copy(entity, OperAccessTaskDetailVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User :: getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User :: getName).orElse(null));
return vo;
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessTaskWrapper.java

@ -32,12 +32,12 @@ public class OperAccessTaskWrapper extends BaseEntityWrapper<OperAccessTaskEntit
public <T extends OperAccessTaskEntity> 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;
}

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -177,20 +177,23 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
@Override
public ImsSchedulingVo getByIdOneV2(Long id, Long preDutyId) {
ImsSchedulingVo imsSchedulingVo = this.baseMapper.selectByIdOneV2(id, preDutyId);
if (null == imsSchedulingVo.getGroupId()) {
imsSchedulingVo.setGroupName("临时班组");
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
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<ImsDutyMainPersonEntity>() {{
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<ImsDutyMainMapper, I
return R.success("您当前未值班");
}
ImsSchedulingVo imsSchedulingVo = getByIdOneV2(entity.getId(), null);
if (ObjectUtil.isEmpty(imsSchedulingVo)){
return R.success("暂无接班计划,请排班后重试");
}
R<User> userR = userClient.userInfoById(imsSchedulingVo.getManagerId());
imsSchedulingVo.setManagerName(userR.getData().getName());
imsSchedulingVo.setCreateDept(userR.getData().getCreateDept());

20
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 BaseServiceImpl<ImsDutyRecMapper, Ims
}
for (ImsDutyRecVO imsDutyRecVO : records) {
ImsSchedulingVo imsSchedulingVo = imsDutyMainService.getByIdOneV2(imsDutyRecVO.getDutyId(), null);
if (ObjectUtil.isEmpty(imsSchedulingVo)){
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,尽快进行排班!");
}
ImsSchedulingVo carryDutyMainVo = imsDutyMainMapper.selectByPreDutyIdOne(Optional.ofNullable(imsSchedulingVo).map(ImsSchedulingVo::getId).orElse(null));
if (ObjectUtil.isNotEmpty(carryDutyMainVo)){
if (StringUtil.isBlank(carryDutyMainVo.getGroupName())){
@ -545,7 +550,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
if (ObjectUtil.isNotEmpty(imsSchedulingVo1)&&null != imsSchedulingVo1.getManagerId()) {
imsSchedulingVo1.setUserName(userClient.userInfoById(imsSchedulingVo1.getManagerId()).getData().getName());
}else {
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,进行尽快进行排班!!!!");
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,尽快进行排班!!!!");
}
vo.setHeadDutyMainVo(imsSchedulingVo);
vo.setCarryDutyMainVo(imsSchedulingVo1);
@ -1416,10 +1421,15 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
recDTO.setStatus(DutyRecStatus.ACCEPT.getVal());
recDTO.setAcceptTime(new Date());
ImsDutyLogEntity imsDutyLogEntity = recDTO.getImsDutyLogEntity();
imsDutyLogService.update(Wrappers.<ImsDutyLogEntity>lambdaUpdate()
.set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME))
.eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId())
);
ImsDutyLogEntity update = imsDutyLogService.getOne(Wrappers.<ImsDutyLogEntity>lambdaQuery()
.eq(ImsDutyLogEntity::getDutyId, imsDutyLogEntity.getDutyId())
.last("limit 1"));
update.setCarryTime(DateUtil.format(new Date(), PATTERN_DATETIME));
imsDutyLogService.updateById(update);
// imsDutyLogService.update(Wrappers.<ImsDutyLogEntity>lambdaUpdate()
// .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME))
// .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId())
// );
log.info("更新值班日志");
}
ImsDutyRecEntity dutyRec = BeanUtil.copy(recDTO, ImsDutyRecEntity.class);

17
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);
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java

@ -36,12 +36,12 @@ public class OperMaintenancePlanWrapper extends BaseEntityWrapper<OperMaintenanc
@Override
public OperMaintenancePlanVO entityVO(OperMaintenancePlanEntity entity) {
OperMaintenancePlanVO vo = BeanUtil.copy(entity, OperMaintenancePlanVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
User disposer = UserCache.getUser(entity.getDisposer());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
vo.setDisposerName(Optional.ofNullable(disposer).map(User::getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// User disposer = UserCache.getUser(entity.getDisposer());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
// vo.setDisposerName(Optional.ofNullable(disposer).map(User::getName).orElse(null));
vo.setTypeCodeValue(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE, vo.getTypeCode()));
vo.setStatusValue(DictCache.getValue(DictConstant.MAINTENANCE_TASK_STATUS, vo.getStatus()));
//完善维护模式

24
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenanceTaskWrapper.java

@ -29,22 +29,22 @@ public class OperMaintenanceTaskWrapper extends BaseEntityWrapper<OperMaintenanc
@Override
public OperMaintenanceTaskVO entityVO(OperMaintenanceTaskEntity entity) {
OperMaintenanceTaskVO vo = BeanUtil.copy(entity, OperMaintenanceTaskVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
// User createUser = UserCache.getUser(entity.getCreateUser());
// User updateUser = UserCache.getUser(entity.getUpdateUser());
// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
vo.setIsAnomalyValue(DictCache.getValue(DictConstant.YES_NO, vo.getIsAnomaly()));
vo.setTypeCodeValue(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE, vo.getTypeCode()));
vo.setStatusValue(DictCache.getValue(DictConstant.MAINTENANCE_TASK_STATUS, vo.getStatus()));
String disposerName = Optional.ofNullable(entity.getDisposer()).map(s->{
List<String> 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<String> 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;
}

6
hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">
<process id="offlineWorkTicket1" name="线下工作票审批流程" isExecutable="true">
<process id="offlineWorkTicket" name="线下工作票审批流程" isExecutable="true">
<startEvent id="startEvent1"></startEvent>
<userTask id="sid-194BD702-29AE-4DA6-A343-05464D12BB83" name="签发人签发" flowable:candidateGroups="signer">
<extensionElements>
@ -60,8 +60,8 @@
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${signFlag==true}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_offlineWorkTicket1">
<bpmndi:BPMNPlane bpmnElement="offlineWorkTicket1" id="BPMNPlane_offlineWorkTicket1">
<bpmndi:BPMNDiagram id="BPMNDiagram_offlineWorkTicket">
<bpmndi:BPMNPlane bpmnElement="offlineWorkTicket" id="BPMNPlane_offlineWorkTicket">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="74.99999888241292" y="359.999994635582"></omgdc:Bounds>
</bpmndi:BPMNShape>

Loading…
Cancel
Save