diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java index 0760506..fc26179 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java +++ b/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- 检修计划处理 diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java index 38bb8e1..7549a14 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java +++ b/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; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java index ac995bc..f600186 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java +++ b/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; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java index 68779a2..ea245e5 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java +++ b/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; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java index e4ced33..8c4ecc6 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java +++ b/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; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperAppearanceVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperAppearanceVO.java new file mode 100644 index 0000000..8732dce --- /dev/null +++ b/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; +} diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java index 91c67da..401bc90 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectVO.java +++ b/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; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java index 88cde48..26bdfd5 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java @@ -459,7 +459,7 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpllambdaQuery().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); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java index cb94c94..9da2925 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperPhenomenonController.java +++ b/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 detail(OperPhenomenonEntity phenomenon) { - OperPhenomenonEntity detail = phenomenonService.getOne(Condition.getQueryWrapper(phenomenon)); - OperPhenomenonVO vo = OperPhenomenonWrapper.build().entityVO(detail); - return R.data(vo); + public R 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> list(OperPhenomenonEntity entity, String taskIds, Query query, Date findTimeEnd) { - LambdaQueryWrapper 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 pages = phenomenonService.page(Condition.getPage(query), queryWrapper); - IPage vos = OperPhenomenonWrapper.build().pageVO(pages); - return R.data(vos); + public R> list(OperAppearanceVO phenomenon, Query query) { + LambdaQueryWrapper queryWrapper = operAppearanceService.getQueryWrapper(phenomenon); + IPage pages = operAppearanceService.page(Condition.getPage(query), queryWrapper); +// IPage 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))); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java index 0b28cbb..625dad3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java +++ b/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 { - + LambdaQueryWrapper getQueryWrapper(OperAppearanceVO operAppearanceVO); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java index 6968b1d..7142578 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java +++ b/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 { * @return */ IPage selectPage(Page operDefectEntityPage, OperDefectEntity defect); + + LambdaQueryWrapper getQueryWrapper(OperDefectVO defectVO); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java index 54d09c8..7a278e2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java @@ -137,6 +137,8 @@ public class DefectCheckServiceImpl extends BaseServiceImpl list = this.getAliasUser(entity.getTenantId(), entity.getCreateDept(), TreatMethodConstant.PHENOMENON_SCREEN_ALIAS); - if (CollectionUtil.isEmpty(list)) { - throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!"); - } +// List 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 variable = entityToMap(entity); - R result = processClient.startProcessInstanceContainNameByKey(TreatMethodConstant.DEFECT_CHECK_PRIMARY_KEY_TY, businessKey, processName, variable); + R 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 variables =(Map) 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() {{ 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 implements IOperAppearanceService { + + @Override + public LambdaQueryWrapper getQueryWrapper(OperAppearanceVO operAppearanceVO) { + LambdaQueryWrapper 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; + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java index 26cad87..9adc2e3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java +++ b/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 getQueryWrapper(OperDefectVO defectVO) { + LambdaQueryWrapper 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; + } /** * 处理问题 * diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java index f18fb8c..4f5976c 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/OperRepairServiceImpl.java @@ -355,7 +355,7 @@ public class OperRepairServiceImpl extends BaseServiceImpl