Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 11 months ago
parent
commit
4ee4aebac9
  1. 16
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java
  2. 38
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
  3. 50
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java
  4. 47
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java
  5. 9
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java
  6. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java
  7. 14
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperPhenomenonVO.java
  8. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java
  9. 23
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  10. 37
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectStatisticsServiceImpl.java
  11. 48
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java

16
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java

@ -50,6 +50,12 @@ public class OperAppearanceEntity extends TenantEntity {
@ApiModelProperty(value = "问题发现人") @ApiModelProperty(value = "问题发现人")
private Long finder; private Long finder;
/** /**
* 问题发现人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "问题发现人")
private String finderName;
/**
* 问题类型 * 问题类型
* *
*/ */
@ -104,6 +110,12 @@ public class OperAppearanceEntity extends TenantEntity {
@ApiModelProperty(value = "甄别人") @ApiModelProperty(value = "甄别人")
private Long discriminator; private Long discriminator;
/** /**
* 甄别人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "甄别人")
private String discriminatorName;
/**
* 甄别时间 * 甄别时间
*/ */
@DateTimeFormat( @DateTimeFormat(
@ -151,4 +163,8 @@ public class OperAppearanceEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码") @ApiModelProperty(value = "已有缺陷编码")
private String existDefectId; private String existDefectId;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("机构名称")
private String deptName;
} }

38
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java

@ -103,12 +103,6 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "缺陷创建时间-结束时间") @ApiModelProperty(value = "缺陷创建时间-结束时间")
private String endTime; private String endTime;
// 20230612弃用该字段,无地方引用
// @TableField(exist = false)
// @ApiModelProperty(value = "机构编号集合")
// private List<Long> deptIds;
/** /**
* 区域Id * 区域Id
*/ */
@ -128,12 +122,22 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "消缺处理人") @ApiModelProperty(value = "消缺处理人")
private String planHandler; private String planHandler;
/** /**
* 消缺处理人
*/
@ApiModelProperty(value = "消缺处理人")
private String planHandlerName;
/**
* 检修任务处理人 * 检修任务处理人
*/ */
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "检修任务处理人") @ApiModelProperty(value = "检修任务处理人")
private Long handler; private Long handler;
/**
* 检修任务处理人
*/
@ApiModelProperty(value = "检修任务处理人")
private String handlerName;
/** /**
* 发现人 * 发现人
*/ */
@ -141,6 +145,11 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "发现人") @ApiModelProperty(value = "发现人")
private Long finder; private Long finder;
/** /**
* 发现人
*/
@ApiModelProperty(value = "发现人")
private String finderName;
/**
* 缺陷等级 * 缺陷等级
*/ */
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ -184,6 +193,12 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "定论人") @ApiModelProperty(value = "定论人")
private Long conclusionPeople; private Long conclusionPeople;
/** /**
* 定论人
*/
@ApiModelProperty(value = "定论人")
private String conclusionPeopleName;
/**
* 定论时间 * 定论时间
*/ */
@DateTimeFormat( @DateTimeFormat(
@ -218,6 +233,11 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty("操作票负责人") @ApiModelProperty("操作票负责人")
private Long principal; private Long principal;
/** /**
* 操作票负责人
*/
@ApiModelProperty(value = "操作票负责人")
private String principalName;
/**
* 手填值班负责人 * 手填值班负责人
*/ */
@ApiModelProperty(value = "手填操作票负责人") @ApiModelProperty(value = "手填操作票负责人")
@ -232,5 +252,9 @@ public class OperDefectEntity extends TenantEntity {
*/ */
@ApiModelProperty(value = "处理任务Id") @ApiModelProperty(value = "处理任务Id")
private Long handleTaskId; private Long handleTaskId;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("机构名称")
private String deptName;
} }

50
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java

@ -60,6 +60,13 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
@ApiModelProperty(value = "缺陷发现人") @ApiModelProperty(value = "缺陷发现人")
private Long finder; private Long finder;
/**
* 缺陷发现人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "缺陷发现人")
private String finderName;
/** /**
* 缺陷类型 * 缺陷类型
*/ */
@ -112,6 +119,12 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "甄别人") @ApiModelProperty(value = "甄别人")
private Long discriminator; private Long discriminator;
/** /**
* 甄别人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "甄别人")
private String discriminatorName;
/**
* 甄别时间 * 甄别时间
*/ */
@DateTimeFormat( @DateTimeFormat(
@ -135,6 +148,12 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "检修任务处理人") @ApiModelProperty(value = "检修任务处理人")
private Long handler; private Long handler;
/** /**
* 检修任务处理人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "检修任务处理人")
private String handlerName;
/**
* 计划工时 * 计划工时
*/ */
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ -170,6 +189,12 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "处理人") @ApiModelProperty(value = "处理人")
private Long disposer; private Long disposer;
/** /**
* 处理人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "处理人")
private String disposerName;
/**
* 处理描述 * 处理描述
*/ */
@ApiModelProperty(value = "处理描述") @ApiModelProperty(value = "处理描述")
@ -215,6 +240,12 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "定论人") @ApiModelProperty(value = "定论人")
private Long conclusionPeople; private Long conclusionPeople;
/** /**
* 定论人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "定论人")
private String conclusionPeopleName;
/**
* 定论时间 * 定论时间
*/ */
@DateTimeFormat( @DateTimeFormat(
@ -238,6 +269,12 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "消缺处理人") @ApiModelProperty(value = "消缺处理人")
private String planHandler; private String planHandler;
/**
* 消缺处理人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "消缺处理人")
private String planHandlerName;
/** /**
* 是否入库 * 是否入库
@ -288,6 +325,12 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty("操作票负责人") @ApiModelProperty("操作票负责人")
private Long principal; private Long principal;
/** /**
* 操作票负责人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "操作票负责人")
private String principalName;
/**
* 手填值班负责人 * 手填值班负责人
*/ */
@ApiModelProperty(value = "手填操作票负责人") @ApiModelProperty(value = "手填操作票负责人")
@ -313,4 +356,11 @@ public class OperDefectStatisticsEntity extends TenantEntity {
*/ */
@ApiModelProperty(value = "处理任务Id") @ApiModelProperty(value = "处理任务Id")
private Long handleTaskId; private Long handleTaskId;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("机构名称")
private String deptName;
} }

47
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java

@ -61,6 +61,12 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "问题发现人") @ApiModelProperty(value = "问题发现人")
private Long finder; private Long finder;
/** /**
* 问题发现人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "问题发现人")
private String finderName;
/**
* 问题类型0-设备和1-非设备 * 问题类型0-设备和1-非设备
* *
*/ */
@ -141,6 +147,12 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "甄别人") @ApiModelProperty(value = "甄别人")
private Long discriminator; private Long discriminator;
/** /**
* 甄别人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "甄别人")
private String discriminatorName;
/**
* 甄别时间 * 甄别时间
*/ */
@DateTimeFormat( @DateTimeFormat(
@ -197,6 +209,12 @@ public class OperPhenomenonEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "决策处理方案人,决策缺陷处理方案,key 必须是 handleProgramme") @ApiModelProperty(value = "决策处理方案人,决策缺陷处理方案,key 必须是 handleProgramme")
private Long handleProgramme; private Long handleProgramme;
/**
* 决策处理方案人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "决策处理方案人")
private String handleProgrammeName;
/** /**
* 决策处理方案类型 * 决策处理方案类型
@ -217,6 +235,13 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "检修任务处理人") @ApiModelProperty(value = "检修任务处理人")
private Long handler; private Long handler;
/** /**
* 检修任务处理人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "检修任务处理人")
private String handlerName;
/**
* 处理状态已处理1未处理0默认0 * 处理状态已处理1未处理0默认0
*/ */
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
@ -262,6 +287,12 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "定论人") @ApiModelProperty(value = "定论人")
private Long conclusionPeople; private Long conclusionPeople;
/** /**
* 定论人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "定论人")
private String conclusionPeopleName;
/**
* 定论状态已定论1未定论0默认0 * 定论状态已定论1未定论0默认0
*/ */
@QueryField(condition = SqlCondition.EQUAL) @QueryField(condition = SqlCondition.EQUAL)
@ -291,6 +322,11 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "消缺处理人") @ApiModelProperty(value = "消缺处理人")
private String planHandler; private String planHandler;
/** /**
* 消缺处理人
*/
@ApiModelProperty(value = "消缺处理人")
private String planHandlerName;
/**
* 实际开始时间 * 实际开始时间
*/ */
@DateTimeFormat( @DateTimeFormat(
@ -378,6 +414,12 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty("操作票负责人") @ApiModelProperty("操作票负责人")
private Long principal; private Long principal;
/** /**
* 操作票负责人
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "操作票负责人")
private String principalName;
/**
* 手填操作票负责人 * 手填操作票负责人
*/ */
@ApiModelProperty(value = "手填操作票负责人") @ApiModelProperty(value = "手填操作票负责人")
@ -396,4 +438,9 @@ public class OperPhenomenonEntity extends TenantEntity {
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "处理人") @ApiModelProperty(value = "处理人")
private String flowHandler; private String flowHandler;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("机构名称")
private String deptName;
} }

9
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java

@ -21,15 +21,10 @@ public class OperDefectStatisticsVO extends OperDefectStatisticsEntity {
private static final long serialVersionUID = 8239436726489738763L; private static final long serialVersionUID = 8239436726489738763L;
@ApiModelProperty(value = "问题发现人名称")
private String finderName;
@ApiModelProperty(value = "现象Ids") @ApiModelProperty(value = "现象Ids")
private List<String> defectCodeList; private List<String> defectCodeList;
@ApiModelProperty(value = "甄别人名称")
private String discriminatorName;
@ApiModelProperty(value = "处理人名称,处理工作流的第一个处理人")
private String handlerName;
@ApiModelProperty(value = "消缺处理人名称") @ApiModelProperty(value = "消缺处理人名称")
private String planHandlerName; private String planHandlerName;
@ -37,8 +32,6 @@ public class OperDefectStatisticsVO extends OperDefectStatisticsEntity {
@ApiModelProperty(value = "两票工作负责人名称") @ApiModelProperty(value = "两票工作负责人名称")
private String principalName; private String principalName;
@ApiModelProperty(value = "定论人名称")
private String conclusionPeopleName;
@ApiModelProperty("创建人名称") @ApiModelProperty("创建人名称")
private String createUserName; private String createUserName;

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java

@ -24,8 +24,7 @@ public class OperDefectVO extends OperDefectEntity {
private static final long serialVersionUID = 330945650534291157L; private static final long serialVersionUID = 330945650534291157L;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称") @ApiModelProperty("修改人名称")
private String updateUserName; private String updateUserName;

14
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperPhenomenonVO.java

@ -21,20 +21,6 @@ public class OperPhenomenonVO extends OperPhenomenonEntity {
private static final long serialVersionUID = -8661188316092509183L; private static final long serialVersionUID = -8661188316092509183L;
@ApiModelProperty(value = "发现人")
private String finderName;
@ApiModelProperty(value = "甄别人名称")
private String discriminatorName;
@ApiModelProperty(value = "处理人名称,处理工作流的第一个处理人")
private String handlerName;
@ApiModelProperty(value = "定论人名称")
private String conclusionPeopleName;
@ApiModelProperty("创建人名称")
private String createUserName;
@ApiModelProperty("修改人名称") @ApiModelProperty("修改人名称")
private String updateUserName; private String updateUserName;

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java

@ -26,6 +26,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
@ -89,15 +90,6 @@ public class OperDefectStatisticsController extends BladeController {
LambdaQueryWrapper<OperDefectStatisticsEntity> queryWrapper = statisticsService.getQueryWrapper(entity); LambdaQueryWrapper<OperDefectStatisticsEntity> queryWrapper = statisticsService.getQueryWrapper(entity);
IPage<OperDefectStatisticsEntity> pages = statisticsService.page(Condition.getPage(query), queryWrapper); IPage<OperDefectStatisticsEntity> pages = statisticsService.page(Condition.getPage(query), queryWrapper);
IPage<OperDefectStatisticsVO> vos = OperDefectStatisticsWrapper.build().pageVO(pages); IPage<OperDefectStatisticsVO> vos = OperDefectStatisticsWrapper.build().pageVO(pages);
if(CollectionUtil.isNotEmpty(vos.getRecords())){
vos.setRecords(vos.getRecords().stream().map(o->{
R<Dept> result = sysClient.getDept(o.getCreateDept());
if(result.isSuccess() && ObjectUtil.isNotEmpty(result.getData())){
o.setDeptName(result.getData().getDeptName());
}
return o;
}).collect(Collectors.toList()));
}
return R.data(vos); return R.data(vos);
} }

23
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -41,6 +41,8 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.system.cache.DictCache; import org.springblade.system.cache.DictCache;
import org.springblade.system.feign.ISysClient; 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.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
@ -97,6 +99,15 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
if (ObjectUtil.isEmpty(AuthUtil.getDeptId())) { if (ObjectUtil.isEmpty(AuthUtil.getDeptId())) {
throw new ServiceException("获取当前用户机构失败!"); throw new ServiceException("获取当前用户机构失败!");
} }
if (ObjectUtil.isNotEmpty(entity.getFinder())&&StringUtils.isBlank(entity.getFinderName())){
User user = UserCache.getUser(entity.getFinder());
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())) {
entity.setFinderName(user.getName());
}
}
if (StringUtils.isNotBlank(AuthUtil.getUserName())){
entity.setCreateUserName(AuthUtil.getUserName());
}
//加锁 //加锁
Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + AuthUtil.getDeptId(), AuthUtil.getDeptId(), 30, TimeUnit.SECONDS); Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + AuthUtil.getDeptId(), AuthUtil.getDeptId(), 30, TimeUnit.SECONDS);
try { try {
@ -121,7 +132,7 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
e.printStackTrace(); e.printStackTrace();
log.error("保存现象失败!"+e); log.error("保存现象失败!"+e);
//抛出异常,以便回滚 //抛出异常,以便回滚
throw new ServiceException("保存现象失败!"); throw new ServiceException("保存现象失败!"+e.getMessage());
}finally { }finally {
redisTemplate.delete("SysUserLock" + AuthUtil.getDeptId()); //删除key,释放锁 redisTemplate.delete("SysUserLock" + AuthUtil.getDeptId()); //删除key,释放锁
} }
@ -281,7 +292,7 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
public R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse) { public R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse) {
long taskId; long taskId;
OperPhenomenonEntity operPhenomenonEntity; OperPhenomenonEntity operPhenomenonEntity;
log.info("消缺消息开始转换"); log.info("消缺消息开始转换"+processWorkFlowResponse);
try { try {
Map<String, Object> variables = (Map<String, Object>) processWorkFlowResponse.getVariables(); Map<String, Object> variables = (Map<String, Object>) processWorkFlowResponse.getVariables();
//现象缺陷全表更新 //现象缺陷全表更新
@ -294,6 +305,9 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
if (processWorkFlowResponse.getTaskId() != null || processWorkFlowResponse.getUserId() != null) { if (processWorkFlowResponse.getTaskId() != null || processWorkFlowResponse.getUserId() != null) {
operPhenomenonEntity.setCurrentOperator(processWorkFlowResponse.getTaskName()); operPhenomenonEntity.setCurrentOperator(processWorkFlowResponse.getTaskName());
operPhenomenonEntity.setCurrentLinkHandler(processWorkFlowResponse.getNextStepOperator()); operPhenomenonEntity.setCurrentLinkHandler(processWorkFlowResponse.getNextStepOperator());
}else {
operPhenomenonEntity.setCurrentOperator("流程结束");
operPhenomenonEntity.setCurrentLinkHandler("");
} }
//缺陷记录 //缺陷记录
OperDefectStatisticsEntity statisticsEntity = statisticsService.getOne(new LambdaUpdateWrapper<OperDefectStatisticsEntity>() {{ OperDefectStatisticsEntity statisticsEntity = statisticsService.getOne(new LambdaUpdateWrapper<OperDefectStatisticsEntity>() {{
@ -324,8 +338,7 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
defectService.save(operDefectEntity); defectService.save(operDefectEntity);
taskId = operDefectEntity.getId(); taskId = operDefectEntity.getId();
log.info("缺陷ID:" + operPhenomenonEntity.getDefectCode() + "入库成功"); log.info("缺陷ID:" + operPhenomenonEntity.getDefectCode() + "入库成功");
operPhenomenonEntity.setCurrentOperator("流程结束");
operPhenomenonEntity.setCurrentLinkHandler("");
} }
//更新数据库 //更新数据库
Long statisticsEntityId = statisticsEntity.getId(); Long statisticsEntityId = statisticsEntity.getId();
@ -341,7 +354,7 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
operAppearanceService.updateById(appearanceEntity); operAppearanceService.updateById(appearanceEntity);
//推送消息中心相关消息 //推送消息中心相关消息
sendMessage(processWorkFlowResponse, operPhenomenonEntity,taskId); sendMessage(processWorkFlowResponse, operPhenomenonEntity,taskId);
log.info("消缺消息转换结束"); log.info("消缺消息转换结束"+processWorkFlowResponse);
return R.success("消息保存成功"); return R.success("消息保存成功");
} }

37
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectStatisticsServiceImpl.java

@ -169,26 +169,29 @@ public class OperDefectStatisticsServiceImpl extends BaseServiceImpl<OperDefectS
operDefectStatisticsExportVO.setDeptName(deptName.getData()); operDefectStatisticsExportVO.setDeptName(deptName.getData());
} }
operDefectStatisticsExportVO.setDefectCode(entity.getDefectCode()); operDefectStatisticsExportVO.setDefectCode(entity.getDefectCode());
if (ObjectUtils.isNotEmpty(entity.getFinder())) { operDefectStatisticsExportVO.setFinderName(entity.getFinderName());
User user = UserCache.getUser(entity.getFinder()); operDefectStatisticsExportVO.setPlanHandler(entity.getPlanHandlerName());
if (ObjectUtils.isNotEmpty(user)) { // if (ObjectUtils.isNotEmpty(entity.getFinder())) {
operDefectStatisticsExportVO.setFinderName(user.getName()); // User user = UserCache.getUser(entity.getFinder());
} // if (ObjectUtils.isNotEmpty(user)) {
// R<User> finderUser = userClient.userInfoById(entity.getFinder()); // operDefectStatisticsExportVO.setFinderName(user.getName());
// if (finderUser.isSuccess() && ObjectUtils.isNotEmpty(finderUser.getData())) { // }
// operDefectStatisticsExportVO.setFinderName(finderUser.getData().getName()); //// R<User> finderUser = userClient.userInfoById(entity.getFinder());
// } //// if (finderUser.isSuccess() && ObjectUtils.isNotEmpty(finderUser.getData())) {
} //// operDefectStatisticsExportVO.setFinderName(finderUser.getData().getName());
if (StringUtils.isNotBlank(entity.getPlanHandler())) { //// }
User user = UserCache.getUser(Long.valueOf(entity.getPlanHandler())); // }
if (ObjectUtils.isNotEmpty(user)) {
operDefectStatisticsExportVO.setPlanHandler(user.getName()); // if (StringUtils.isNotBlank(entity.getPlanHandler())) {
} // User user = UserCache.getUser(Long.valueOf(entity.getPlanHandler()));
// if (ObjectUtils.isNotEmpty(user)) {
// operDefectStatisticsExportVO.setPlanHandler(user.getName());
// }
// R<User> planHandlerUser = userClient.userInfoById(Long.valueOf(entity.getPlanHandler())); // R<User> planHandlerUser = userClient.userInfoById(Long.valueOf(entity.getPlanHandler()));
// if (planHandlerUser.isSuccess() && ObjectUtils.isNotEmpty(planHandlerUser.getData())) { // if (planHandlerUser.isSuccess() && ObjectUtils.isNotEmpty(planHandlerUser.getData())) {
// operDefectStatisticsExportVO.setPlanHandler(planHandlerUser.getData().getName()); // operDefectStatisticsExportVO.setPlanHandler(planHandlerUser.getData().getName());
// } // }
} // }
if (ObjectUtils.isNotEmpty(entity.getFindTime())) { if (ObjectUtils.isNotEmpty(entity.getFindTime())) {
operDefectStatisticsExportVO.setFindTime(entity.getFindTime()); operDefectStatisticsExportVO.setFindTime(entity.getFindTime());
} }
@ -207,7 +210,7 @@ public class OperDefectStatisticsServiceImpl extends BaseServiceImpl<OperDefectS
} }
if (StringUtils.isNotBlank(entity.getTicketId())) { if (StringUtils.isNotBlank(entity.getTicketId())) {
R<List<WorkTicketInfoEntity>> workTicketInfoById = iTicketInfoClient.getWorkTicketInfoById(Arrays.asList(Long.valueOf(entity.getTicketId()))); R<List<WorkTicketInfoEntity>> workTicketInfoById = iTicketInfoClient.getWorkTicketInfoById(Arrays.asList(Long.valueOf(entity.getTicketId())));
if (workTicketInfoById.isSuccess()&&CollectionUtil.isNotEmpty(workTicketInfoById.getData())) { if (workTicketInfoById.isSuccess() && CollectionUtil.isNotEmpty(workTicketInfoById.getData())) {
//获取工作票的编码Id //获取工作票的编码Id
operDefectStatisticsExportVO.setTicketId(workTicketInfoById.getData().get(0).getCode()); operDefectStatisticsExportVO.setTicketId(workTicketInfoById.getData().get(0).getCode());
} }

48
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java

@ -24,30 +24,30 @@ public class OperDefectStatisticsWrapper extends BaseEntityWrapper<OperDefectSta
@Override @Override
public OperDefectStatisticsVO entityVO(OperDefectStatisticsEntity entity) { public OperDefectStatisticsVO entityVO(OperDefectStatisticsEntity entity) {
OperDefectStatisticsVO vo = BeanUtil.copy(entity, OperDefectStatisticsVO.class); OperDefectStatisticsVO vo = BeanUtil.copy(entity, OperDefectStatisticsVO.class);
User createUser = UserCache.getUser(entity.getCreateUser()); // User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser()); // User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser == null ? "" : createUser.getName()); // vo.setCreateUserName(createUser == null ? "" : createUser.getName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getName()); // vo.setUpdateUserName(updateUser == null ? "" : updateUser.getName());
if (Func.isNotEmpty(entity.getConclusionPeople())) { // if (Func.isNotEmpty(entity.getConclusionPeople())) {
User userC = UserCache.getUser(entity.getConclusionPeople()); // User userC = UserCache.getUser(entity.getConclusionPeople());
vo.setConclusionPeopleName(userC == null ? "" : userC.getName()); // vo.setConclusionPeopleName(userC == null ? "" : userC.getName());
} // }
if (Func.isNotEmpty(entity.getFinder())) { // if (Func.isNotEmpty(entity.getFinder())) {
User userF = UserCache.getUser(entity.getFinder()); // User userF = UserCache.getUser(entity.getFinder());
vo.setFinderName(userF == null ? "" : userF.getName()); // vo.setFinderName(userF == null ? "" : userF.getName());
} // }
if (Func.isNotEmpty(entity.getDiscriminator())) { // if (Func.isNotEmpty(entity.getDiscriminator())) {
User userD = UserCache.getUser(entity.getDiscriminator()); // User userD = UserCache.getUser(entity.getDiscriminator());
vo.setDiscriminatorName(userD == null ? "" : userD.getName()); // vo.setDiscriminatorName(userD == null ? "" : userD.getName());
} // }
if (Func.isNotEmpty(entity.getHandler())) { // if (Func.isNotEmpty(entity.getHandler())) {
User userHn = UserCache.getUser(entity.getHandler()); // User userHn = UserCache.getUser(entity.getHandler());
vo.setHandlerName(userHn == null ? "" : userHn.getName()); // vo.setHandlerName(userHn == null ? "" : userHn.getName());
} // }
// 赋值消缺处理人名称 // // 赋值消缺处理人名称
vo.setPlanHandlerName(Optional.ofNullable(entity.getPlanHandler()).map(Long::parseLong).map(UserCache::getUser).map(User::getName).orElse(entity.getPlanHandler())); // vo.setPlanHandlerName(Optional.ofNullable(entity.getPlanHandler()).map(Long::parseLong).map(UserCache::getUser).map(User::getName).orElse(entity.getPlanHandler()));
// 赋值两票工作负责人名称 // // 赋值两票工作负责人名称
vo.setPrincipalName(Optional.ofNullable(entity.getPrincipal()).map(UserCache::getUser).map(User::getName).orElse(entity.getPrincipalManual())); // vo.setPrincipalName(Optional.ofNullable(entity.getPrincipal()).map(UserCache::getUser).map(User::getName).orElse(entity.getPrincipalManual()));
return vo; return vo;
} }

Loading…
Cancel
Save