Browse Source

修改消缺流程代码实体类的相关字段

zhongwei
tyty 1 year ago
parent
commit
60591f9a55
  1. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java
  2. 14
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java
  3. 39
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
  4. 10
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java
  5. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java
  6. 34
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperAppearanceVO.java
  7. 18
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java
  8. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  9. 88
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java
  10. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java
  11. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java
  12. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  13. 45
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java
  14. 67
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  15. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java

@ -10,7 +10,7 @@ public interface TreatMethodConstant {
* 流程主键
*/
String DEFECT_CHECK_PRIMARY_KEY = "defect_check";
String DEFECT_CHECK_PRIMARY_KEY_TY = "defectDealty";
String DEFECT_CHECK = "defectCheck";
/**
* 1-应急抢修处理 2 - 检修任务处理 3- 检修计划处理

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

@ -81,13 +81,7 @@ public class OperAppearanceEntity extends TenantEntity {
@ApiModelProperty(value = "设备编号")
private String emCode;
/**
* 故障编码
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "故障缺陷编码")
private String faultCode;
/**
* 故障名称
* 故障缺陷名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "故障缺陷名称")
@ -166,4 +160,10 @@ public class OperAppearanceEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "智能诊断任务ID")
private Long diagnosisId;
/**
* 已有缺陷编码
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private Long existDefectId;
}

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

@ -81,7 +81,7 @@ public class OperDefectEntity extends TenantEntity {
* 实际工时多个处理人工时逗号隔开
*/
@ApiModelProperty(value = "实际工时,多个处理人工时逗号隔开")
private String actHours;
private Integer actHours;
/**
* 最后处理人处理描述
@ -122,12 +122,11 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "计划处理人")
private String planHandler;
/**
* 处理结论
* 处理
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "处理结论")
private String handlerConclusion;
@ApiModelProperty(value = "处理人")
private Long handler;
/**
* 缺陷等级
*/
@ -164,6 +163,34 @@ public class OperDefectEntity extends TenantEntity {
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private String existDefectId;
private Long existDefectId;
/**
* 定论人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "定论人")
private Long conclusionPeople;
/**
* 定论时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "定论时间")
private Date conclusionTime;
/**
* 定论描述
*/
@ApiModelProperty(value = "定论描述")
private String conclusion;
/**
* 计划工时
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "计划工时")
private Integer planHours;
}

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

@ -234,17 +234,11 @@ public class OperDefectStatisticsEntity extends TenantEntity {
private String planHandler;
/**
* 处理结论
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "处理结论")
private String handlerConclusion;
/**
* 是否入库
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否入库")
private Boolean isWarehousing;
private Integer isWarehousing;
/**
* 当前处理环节
*/
@ -280,6 +274,6 @@ public class OperDefectStatisticsEntity extends TenantEntity {
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private String existDefectId;
private Long existDefectId;
}

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

@ -210,10 +210,10 @@ public class OperPhenomenonEntity extends TenantEntity {
private Long handleTaskId;
/**
* 处理人处理工作流的第一个处理人
* 处理人
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "处理人,处理工作流的第一个处理人,第一个处理节点人key 必须是 problemUser")
@ApiModelProperty(value = "处理人")
private Long handler;
/**
* 处理状态已处理1未处理0默认0
@ -313,17 +313,16 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "实际结束时间")
private Date actEndTime;
/**
* 处理结论
* 最后处理人处理描述
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "处理结论")
private String handlerConclusion;
@ApiModelProperty(value = "最后处理人处理描述")
private String disposeDesc;
/**
* 是否入库
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "是否入库")
private Boolean isWarehousing;
private Integer isWarehousing;
/**
* 缺陷等级
*/
@ -371,12 +370,6 @@ public class OperPhenomenonEntity extends TenantEntity {
*/
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "已有缺陷编码")
private String existDefectId;
/**
* 现象名称
*/
@QueryField(condition = SqlCondition.LIKE)
@ApiModelProperty(value = "现象名称")
private String defectName;
private Long existDefectId;
}

34
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperAppearanceVO.java

@ -0,0 +1,34 @@
package com.hnac.hzims.operational.defect.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "现象表vo", description = "现象表vo")
public class OperAppearanceVO extends OperAppearanceEntity {
/**
* 发现结束时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "发现结束时间")
private Date findEndTime;
}

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

@ -1,15 +1,15 @@
package com.hnac.hzims.operational.defect.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
@ -60,4 +60,16 @@ public class OperDefectVO extends OperDefectEntity {
@ApiModelProperty(value = "定论描述")
private String conclusion;
private String typeCode;
/**
* 定论时间范围-最晚
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "定论时间范围-最晚")
private Date conclusionEndTime;
}

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

@ -459,7 +459,7 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
OperDefectEntity operDefectEntity = defectService.getOne(Wrappers.<OperDefectEntity>lambdaQuery().eq(OperDefectEntity::getDefectCode, operPhenomenonEntity.getDefectCode()).last("limit 1;"));
if (ObjectUtil.isNotEmpty(operDefectEntity)) {
operDefectEntity.setActEndTime(new Date());
operDefectEntity.setActHours(ObjectUtil.isNotEmpty(accessTaskEntity.getActHours()) ? accessTaskEntity.getActHours().toString() : null);
operDefectEntity.setActHours(ObjectUtil.isNotEmpty(accessTaskEntity.getActHours()) ? accessTaskEntity.getActHours() : null);
operDefectEntity.setHandleStatus(RepairConstant.CONCLUSION_PROBLEM);
operDefectEntity.setDisposeDesc(accessTaskEntity.getDescripiton());
defectService.updateById(operDefectEntity);

88
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java

@ -3,17 +3,15 @@ package com.hnac.hzims.operational.defect.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.google.common.collect.Lists;
import com.hnac.hzims.common.invalid.DictInvalid;
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid;
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.fdp.entity.FdpTaskEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO;
import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper;
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@ -25,14 +23,10 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.flow.core.entity.BladeFlow;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
/**
* 控制器
*
@ -45,6 +39,7 @@ import java.util.Date;
@Validated
public class OperPhenomenonController extends BladeController {
private final IOperAppearanceService operAppearanceService;
private final IOperPhenomenonService phenomenonService;
/**
@ -54,10 +49,9 @@ public class OperPhenomenonController extends BladeController {
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入phenomenon")
public R<OperPhenomenonVO> detail(OperPhenomenonEntity phenomenon) {
OperPhenomenonEntity detail = phenomenonService.getOne(Condition.getQueryWrapper(phenomenon));
OperPhenomenonVO vo = OperPhenomenonWrapper.build().entityVO(detail);
return R.data(vo);
public R<OperAppearanceEntity> detail(OperAppearanceEntity phenomenon) {
OperAppearanceEntity appearanceEntity = operAppearanceService.getOne(Condition.getQueryWrapper(phenomenon));
return R.data(appearanceEntity);
}
/**
@ -72,58 +66,24 @@ public class OperPhenomenonController extends BladeController {
@OperationAnnotation(moduleName = "缺陷管理", title = "现象库", operatorType = OperatorType.MOBILE, businessType =
BusinessType.GENCODE, action
= "分页")
public R<IPage<OperPhenomenonVO>> list(OperPhenomenonEntity entity, String taskIds, Query query, Date findTimeEnd) {
LambdaQueryWrapper<OperPhenomenonEntity> queryWrapper = Condition.getQueryWrapper(new OperPhenomenonEntity(), entity);
if (StringUtil.isNotBlank(taskIds)) {
queryWrapper.in(OperPhenomenonEntity::getId, Lists.newArrayList(taskIds.split(",")));
}
if (Func.isNotEmpty(entity.getFindTime())) {
queryWrapper.ge(OperPhenomenonEntity::getFindTime, entity.getFindTime());
}
if (Func.isNotEmpty(findTimeEnd)) {
queryWrapper.le(OperPhenomenonEntity::getFindTime, findTimeEnd);
}
if (Func.isNotEmpty(entity.getDiscriminateStatus())) {
queryWrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, entity.getDiscriminateStatus());
}
if (Func.isNotEmpty(entity.getCreateDept())) {
queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getCreateDept());
}
// // 区域Id
// if (Func.isNotEmpty(entity.getAreaId())) {
// queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getAreaId());
// }
//
// // 年份
// if (Func.isNotEmpty(entity.getYearMonth())) {
// queryWrapper.apply("date_format(t.CREATE_TIME, '%Y-%m') = '"
// + (entity.getYearMonth() + "'"));
// }
//
//
// // 是否为缺陷 已定论1
// if (Func.isNotEmpty(entity.getDefect()) && Func.isNotEmpty(entity.getConclusionStatusNum())) {
// queryWrapper.eq(OperPhenomenonEntity::getIsDefect, entity.getDefect());
// queryWrapper.or().eq(OperPhenomenonEntity::getConclusionStatus, entity.getConclusionStatusNum());
// }
queryWrapper.orderByDesc(OperPhenomenonEntity::getUpdateTime);
IPage<OperPhenomenonEntity> pages = phenomenonService.page(Condition.getPage(query), queryWrapper);
IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages);
return R.data(vos);
public R<IPage<OperAppearanceEntity>> list(OperAppearanceVO phenomenon, Query query) {
LambdaQueryWrapper<OperAppearanceEntity> queryWrapper = operAppearanceService.getQueryWrapper(phenomenon);
IPage<OperAppearanceEntity> pages = operAppearanceService.page(Condition.getPage(query), queryWrapper);
// IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages);
return R.data(pages);
}
/**
* 新增 代码自定义代号
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "提交现象,现象提交后不能修改", notes = "传入phenomenon")
public R save(@Valid @RequestBody OperPhenomenonEntity phenomenon) {
return R.data(phenomenonService.submit(phenomenon));
}
//此端口弃用20230621
// /**
// * 新增 代码自定义代号
// */
// @PostMapping("/save")
// @ApiOperationSupport(order = 4)
// @ApiOperation(value = "提交现象,现象提交后不能修改", notes = "传入phenomenon")
// public R save(@Valid @RequestBody OperPhenomenonEntity phenomenon) {
// return R.data(phenomenonService.submit(phenomenon));
// }
/* */ /**
* 修改 代码自定义代号
@ -153,7 +113,7 @@ public class OperPhenomenonController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(phenomenonService.deleteLogic(Func.toLongList(ids)));
return R.status(operAppearanceService.deleteLogic(Func.toLongList(ids)));
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java

@ -1,6 +1,8 @@
package com.hnac.hzims.operational.defect.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
import org.springblade.core.mp.base.BaseService;
/**
@ -9,5 +11,5 @@ import org.springblade.core.mp.base.BaseService;
* @author Chill
*/
public interface IOperAppearanceService extends BaseService<OperAppearanceEntity> {
LambdaQueryWrapper<OperAppearanceEntity> getQueryWrapper(OperAppearanceVO operAppearanceVO);
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.defect.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
@ -99,4 +100,6 @@ public interface IOperDefectService extends BaseService<OperDefectEntity> {
* @return
*/
IPage<OperDefectEntity> selectPage(Page<OperDefectEntity> operDefectEntityPage, OperDefectEntity defect);
LambdaQueryWrapper<OperDefectEntity> getQueryWrapper(OperDefectVO defectVO);
}

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

@ -137,6 +137,8 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
entity.setFindTime(new Date());
// 现象更新时间
entity.setUpdateTime(new Date());
entity.setCreateUser(AuthUtil.getUserId());
entity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
// 现在最后甄别时间
// Date discriminateDeadline = DateUtil.plusHours(entity.getUpdateTime(), DefectConfiguration.discriminateDeadline);
// entity.setDiscriminateDeadline(discriminateDeadline);
@ -152,10 +154,10 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
*/
private void startDefectCheckV2(OperPhenomenonEntity entity) {
// 获取机构下执行定论缺陷角色用户
List<User> list = this.getAliasUser(entity.getTenantId(), entity.getCreateDept(), TreatMethodConstant.PHENOMENON_SCREEN_ALIAS);
if (CollectionUtil.isEmpty(list)) {
throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!");
}
// List<User> list = this.getAliasUser(entity.getTenantId(), entity.getCreateDept(), TreatMethodConstant.PHENOMENON_SCREEN_ALIAS);
// if (CollectionUtil.isEmpty(list)) {
// throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!");
// }
// 现象发起人名字
String userName = Optional.ofNullable(UserCache.getUser(entity.getFinder()).getName()).orElse("");
// 现象发起来源
@ -165,7 +167,7 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
// 开启新的缺陷流程
String businessKey = FlowUtil.getBusinessKey("hzims_oper_phenomenon", "" + entity.getId());
Map<String, Object> variable = entityToMap(entity);
R<BladeFlow> result = processClient.startProcessInstanceContainNameByKey(TreatMethodConstant.DEFECT_CHECK_PRIMARY_KEY_TY, businessKey, processName, variable);
R<BladeFlow> result = processClient.startProcessInstanceContainNameByKey(TreatMethodConstant.DEFECT_CHECK, businessKey, processName, variable);
// 流程开启失败
if (!result.isSuccess()) {
throw new ServiceException("缺陷流程开启失败,错误描述 : " + result.getCode());
@ -181,7 +183,6 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
OperAppearanceEntity operAppearanceEntity = new OperAppearanceEntity();
BeanUtil.copy(entity, operAppearanceEntity);
operAppearanceService.save(operAppearanceEntity);
this.save(entity);
}
/**
@ -244,19 +245,20 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
/**
* @param processWorkFlowResponse
*
*/
@Override
public R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse) {
String variables = processWorkFlowResponse.getVariables().toString();
OperPhenomenonEntity operPhenomenonEntity;
try {
Map<String, Object> variables =(Map<String, Object>) processWorkFlowResponse.getVariables();
//现象缺陷全表更新
operPhenomenonEntity = JSONObject.parseObject(variables, OperPhenomenonEntity.class);
operPhenomenonEntity = mapToEntity(OperPhenomenonEntity.class, variables);
} catch (Exception e) {
log.info("消息转换失败");
return R.fail("消息转换失败");
}
if (processWorkFlowResponse.getTaskId() != null || processWorkFlowResponse.getUserId() != null) {
operPhenomenonEntity.setCurrentOperator(processWorkFlowResponse.getNextStepOperator());
operPhenomenonEntity.setCurrentLinkHandler(processWorkFlowResponse.getProcessDefinitionKey());
@ -269,12 +271,15 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
OperAppearanceEntity appearanceEntity = operAppearanceService.getOne(new LambdaUpdateWrapper<OperAppearanceEntity>() {{
eq(OperAppearanceEntity::getDefectCode, operPhenomenonEntity.getDefectCode());
}});
if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getIsWarehousing()) && operPhenomenonEntity.getIsWarehousing()) {
OperDefectEntity operDefectEntity=new OperDefectEntity();
BeanUtil.copy(operPhenomenonEntity,operDefectEntity);
if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getIsWarehousing()) && "1".equals(operPhenomenonEntity.getIsWarehousing())) {
OperDefectEntity operDefectEntity = new OperDefectEntity();
BeanUtil.copy(operPhenomenonEntity, operDefectEntity);
operDefectEntity.setProcessInstanceId(operPhenomenonEntity.getHandleTaskId().toString());
if(ObjectUtil.isNotEmpty(operPhenomenonEntity.getCheckHours())){
operDefectEntity.setActHours(operPhenomenonEntity.getCheckHours());
}
defectService.save(operDefectEntity);
log.info("缺陷ID:"+operPhenomenonEntity.getDefectCode()+"入库成功");
log.info("缺陷ID:" + operPhenomenonEntity.getDefectCode() + "入库成功");
operPhenomenonEntity.setCurrentOperator("定论");
operPhenomenonEntity.setCurrentLinkHandler(null);
}
@ -306,9 +311,8 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
message.setTenantId("200000");
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY);
//您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent =
"您的消缺流程待审批!现象名称:".concat(operPhenomenonEntity.getDefectName())
"您的消缺流程待审批!现象名称:".concat(operPhenomenonEntity.getFaultName())
.concat(",审批环节:")
.concat(processWorkFlowResponse.getTaskName());
message.setContent(countent);
@ -330,7 +334,6 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
message.setPusherName(user.getName());
}
message.setAccount(userId);
message.setCreateUser(NumberUtils.toLong(userId));
messageClient.sendMessage(message);
}

45
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java

@ -1,9 +1,15 @@
package com.hnac.hzims.operational.defect.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.mapper.OperAppearanceMapper;
import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
/**
@ -13,4 +19,43 @@ import org.springframework.stereotype.Service;
*/
@Service
public class OperAppearanceServiceImpl extends BaseServiceImpl<OperAppearanceMapper, OperAppearanceEntity> implements IOperAppearanceService {
@Override
public LambdaQueryWrapper<OperAppearanceEntity> getQueryWrapper(OperAppearanceVO operAppearanceVO) {
LambdaQueryWrapper<OperAppearanceEntity> queryWrapper = Condition.getQueryWrapper(new OperAppearanceEntity(), operAppearanceVO);
if (ObjectUtils.isEmpty(operAppearanceVO)) {
if (StringUtil.isNotBlank(operAppearanceVO.getDefectCode())) {
queryWrapper.eq(OperAppearanceEntity::getId, operAppearanceVO.getDefectCode());
}
if (StringUtil.isNotBlank(operAppearanceVO.getEmCode())) {
queryWrapper.eq(OperAppearanceEntity::getEmCode, operAppearanceVO.getEmCode());
}
if (Func.isNotEmpty(operAppearanceVO.getFindTime())) {
queryWrapper.ge(OperAppearanceEntity::getFindTime, operAppearanceVO.getFindTime());
}
if (Func.isNotEmpty(operAppearanceVO.getFindEndTime())) {
queryWrapper.le(OperAppearanceEntity::getFindTime, operAppearanceVO.getFindEndTime());
}
if (Func.isNotEmpty(operAppearanceVO.getFinder())) {
queryWrapper.eq(OperAppearanceEntity::getFinder, operAppearanceVO.getFinder());
}
if (Func.isNotEmpty(operAppearanceVO.getName())) {
queryWrapper.like(OperAppearanceEntity::getName, operAppearanceVO.getName());
}
if (Func.isNotEmpty(operAppearanceVO.getDiscriminator())) {
queryWrapper.eq(OperAppearanceEntity::getDiscriminator, operAppearanceVO.getDiscriminator());
}
if (Func.isNotEmpty(operAppearanceVO.getIsDefect())) {
queryWrapper.eq(OperAppearanceEntity::getIsDefect, operAppearanceVO.getIsDefect());
}
if (Func.isNotEmpty(operAppearanceVO.getCreateDept())) {
queryWrapper.eq(OperAppearanceEntity::getCreateDept, operAppearanceVO.getCreateDept());
}
if (Func.isNotEmpty(operAppearanceVO.getIsDiagnosis())) {
queryWrapper.eq(OperAppearanceEntity::getIsDiagnosis, operAppearanceVO.getIsDiagnosis());
}
queryWrapper.orderByDesc(OperAppearanceEntity::getUpdateTime);
}
return queryWrapper;
}
}

67
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -13,7 +13,6 @@ import com.hnac.hzims.operational.access.service.IOperAccessPlanService;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.access.service.impl.OperAccessPlanServiceImpl;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
import com.hnac.hzims.operational.defect.constants.RepairConstant;
import com.hnac.hzims.operational.defect.dto.*;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
@ -24,10 +23,9 @@ import com.hnac.hzims.operational.defect.vo.OperDefectVO;
import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper;
import com.hnac.hzims.operational.report.vo.DefectReportsVO;
import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.ticket.repair.entity.RepairEntity;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
import com.sun.javafx.binding.StringFormatter;
import lombok.AllArgsConstructor;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
@ -55,7 +53,6 @@ import org.springblade.system.cache.DictCache;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
@ -69,7 +66,6 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -122,8 +118,65 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
}
}
@Override
public LambdaQueryWrapper<OperDefectEntity> getQueryWrapper(OperDefectVO defectVO) {
LambdaQueryWrapper<OperDefectEntity> queryWrapper = Condition.getQueryWrapper(new OperDefectEntity(), defectVO);
if (ObjectUtils.isEmpty(defectVO)) {
if (defectVO.getActStartTime() != null) {
queryWrapper.ge(OperDefectEntity::getActStartTime, defectVO.getActStartTime());
}
if (defectVO.getActEndTime() != null) {
queryWrapper.le(OperDefectEntity::getActEndTime, defectVO.getActEndTime());
}
if (defectVO.getStartTime() != null) {
queryWrapper.ge(OperDefectEntity::getCreateTime, defectVO.getStartTime());
}
if (defectVO.getEndTime() != null) {
queryWrapper.le(OperDefectEntity::getCreateTime, defectVO.getEndTime());
}
if (defectVO.getCreateDept() != null) {
queryWrapper.eq(OperDefectEntity::getCreateDept, defectVO.getCreateDept());
}
if (StringUtil.isNotBlank(defectVO.getDefectCode())) {
queryWrapper.eq(OperDefectEntity::getId, defectVO.getDefectCode());
}
if (ObjectUtils.isNotEmpty(defectVO.getIsDiagnosis())) {
queryWrapper.eq(OperDefectEntity::getIsDiagnosis, defectVO.getIsDiagnosis());
}
if (Func.isNotEmpty(defectVO.getDefectGrading())) {
queryWrapper.like(OperDefectEntity::getDefectGrading, defectVO.getDefectGrading());
}
if (Func.isNotEmpty(defectVO.getConclusionLabel())) {
queryWrapper.like(OperDefectEntity::getConclusionLabel, defectVO.getConclusionLabel());
}
if (Func.isNotEmpty(defectVO.getDiagnosisId())) {
queryWrapper.eq(OperDefectEntity::getDiagnosisId, defectVO.getDiagnosisId());
}
if (Func.isNotEmpty(defectVO.getConclusionPeople())) {
queryWrapper.like(OperDefectEntity::getConclusionPeople, defectVO.getConclusionPeople());
}
if (Func.isNotEmpty(defectVO.getExistDefectId())) {
queryWrapper.eq(OperDefectEntity::getExistDefectId, defectVO.getExistDefectId());
}
if (Func.isNotEmpty(defectVO.getConclusionTime())) {
queryWrapper.le(OperDefectEntity::getConclusionTime, defectVO.getConclusionTime());
}
if (Func.isNotEmpty(defectVO.getConclusionEndTime())) {
queryWrapper.ge(OperDefectEntity::getConclusionTime, defectVO.getConclusionEndTime());
}
if (Func.isNotEmpty(defectVO.getConclusion())) {
queryWrapper.like(OperDefectEntity::getConclusion, defectVO.getConclusion());
}
if (Func.isNotEmpty(defectVO.getCreateDept())) {
queryWrapper.eq(OperDefectEntity::getCreateDept, defectVO.getCreateDept());
}
if (Func.isNotEmpty(defectVO.getIsDiagnosis())) {
queryWrapper.eq(OperDefectEntity::getIsDiagnosis, defectVO.getIsDiagnosis());
}
queryWrapper.orderByDesc(OperDefectEntity::getUpdateTime);
}
return queryWrapper;
}
/**
* 处理问题
*

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java

@ -355,7 +355,7 @@ public class OperRepairServiceImpl extends BaseServiceImpl<OperRepairMapper, Rep
// 更新缺陷实际信息
OperDefectEntity defect = new OperDefectEntity();
SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATETIME);
defect.setActHours(String.valueOf(variables.get("implementHours")));
defect.setActHours((Integer) variables.get("implementHours"));
defect.setDisposeDesc(String.valueOf(variables.get("implementDesc")));
String actStartTime = String.valueOf(variables.get("implementStartTime"));
String actEndTime = String.valueOf(variables.get("implementEndTime"));

Loading…
Cancel
Save