From b16d7f9fd029bf9d37bcc3c6f3cf8472a0081888 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期六, 26 七月 2025 16:34:46 +0800 Subject: [PATCH] 设备故障登记修改与产品安全确认 --- lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java | 12 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java | 8 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java | 4 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java | 4 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamReportProductHazardsService.java | 6 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportProductHazardsServiceImpl.java | 233 +++++++++++++++++++++++++ lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java | 27 +++ lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EamReportProductHazardsEnum.java | 24 ++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportProductHazardsController.java | 47 +++++ lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportProductHazardsMapper.xml | 3 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java | 107 +++++++---- lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportAccidentsRegisterServiceImpl.java | 23 + 12 files changed, 440 insertions(+), 58 deletions(-) diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java index 8a8fcc7..6995673 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java @@ -116,6 +116,10 @@ String PCR0022 = "PCR0022"; //涓荤閮ㄧ骇棰嗗 String PCR0023 = "PCR0023"; + //涓荤宸ヨ壓 + String PCR0024 = "PCR0024"; + //鍓儴绾ч瀵� + String PCR0025 = "PCR0025"; //閫氳繃銆侀┏鍥� String APPROVED = "1"; String REJECTED = "2"; diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EamReportProductHazardsEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EamReportProductHazardsEnum.java new file mode 100644 index 0000000..b1a23d1 --- /dev/null +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EamReportProductHazardsEnum.java @@ -0,0 +1,24 @@ +package org.jeecg.modules.eam.constant; + +public enum EamReportProductHazardsEnum { + //寰呮彁浜� + PENDING_SUBMIT, + //寰呬富绠″伐鑹虹‘璁� + PENDING_SUPERIOR_TECHNICAL_CONFIRMATION, + //寰呴儴绾ч瀵肩‘璁� + PENDING_DEPARTMENT_LEADER_CONFIRMATION, + //宸插畬鎴� + REPAIR_COMPLETED, + //宸查┏鍥� + REJECTED; + + public static EamReportProductHazardsEnum getInstance(String code) { + EamReportProductHazardsEnum[] values = EamReportProductHazardsEnum.values(); + for (EamReportProductHazardsEnum value : values) { + if (value.name().equals(code)) { + return value; + } + } + return null; + } +} diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java index 572fd4f..996fee1 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -26,7 +27,7 @@ @TableName("eam_report_product_hazards") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -public class EamReportProductHazardsDto { +public class EamReportProductHazardsDto extends FlowTaskVo implements Serializable { /**涓婚敭*/ @TableId(type = IdType.ASSIGN_ID) @@ -88,6 +89,10 @@ @Excel(name = "涓荤宸ヨ壓纭鎰忚", width = 15) @ApiModelProperty(value = "涓荤宸ヨ壓纭鎰忚") private String technologistComment; + /**涓荤宸ヨ壓纭缁撴灉*/ + @Excel(name = "涓荤宸ヨ壓纭缁撴灉", width = 15) + @ApiModelProperty(value = "涓荤宸ヨ壓纭缁撴灉") + private String technologistResult; /**閮ㄧ骇棰嗗*/ @Excel(name = "閮ㄧ骇棰嗗", width = 15) @ApiModelProperty(value = "閮ㄧ骇棰嗗") @@ -102,6 +107,10 @@ @Excel(name = "閮ㄧ骇棰嗗纭鎰忚", width = 15) @ApiModelProperty(value = "閮ㄧ骇棰嗗纭鎰忚") private String deputyDepartmentComment; + /**閮ㄧ骇棰嗗纭缁撴灉*/ + @Excel(name = "閮ㄧ骇棰嗗纭缁撴灉", width = 15) + @ApiModelProperty(value = "閮ㄧ骇棰嗗纭缁撴灉") + private String deputyDepartmentResult; //鍒楄〃灞曠ず @TableField(exist = false) private String equipmentCode; @@ -111,4 +120,5 @@ private String equipmentModel; @TableField(exist = false) private String installationPosition; + } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java index 588c64b..80967e0 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java @@ -50,6 +50,11 @@ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "鏇存柊鏃ユ湡") private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag; /**鎶ヤ慨ID*/ @Excel(name = "鎶ヤ慨ID", width = 15) @ApiModelProperty(value = "鎶ヤ慨ID") @@ -58,6 +63,11 @@ @Excel(name = "璁惧ID", width = 15) @ApiModelProperty(value = "璁惧ID") private String equipmentId; + /**纭鐘舵��*/ + @Excel(name = "纭鐘舵��", width = 15) + @ApiModelProperty(value = "纭鐘舵��") + @Dict(dicCode = "confirm_status") + private String confirmStatus; /**鎿嶄綔宸�*/ @Excel(name = "鎿嶄綔宸�", width = 15) @ApiModelProperty(value = "鎿嶄綔宸�") @@ -90,6 +100,10 @@ @Excel(name = "涓荤宸ヨ壓纭鎰忚", width = 15) @ApiModelProperty(value = "涓荤宸ヨ壓纭鎰忚") private String technologistComment; + /**涓荤宸ヨ壓纭缁撴灉*/ + @Excel(name = "涓荤宸ヨ壓纭缁撴灉", width = 15) + @ApiModelProperty(value = "涓荤宸ヨ壓纭缁撴灉") + private String technologistResult; /**閮ㄧ骇棰嗗*/ @Excel(name = "閮ㄧ骇棰嗗", width = 15) @ApiModelProperty(value = "閮ㄧ骇棰嗗") @@ -104,6 +118,10 @@ @Excel(name = "閮ㄧ骇棰嗗纭鎰忚", width = 15) @ApiModelProperty(value = "閮ㄧ骇棰嗗纭鎰忚") private String deputyDepartmentComment; + /**閮ㄧ骇棰嗗纭缁撴灉*/ + @Excel(name = "閮ㄧ骇棰嗗纭缁撴灉", width = 15) + @ApiModelProperty(value = "閮ㄧ骇棰嗗纭缁撴灉") + private String deputyDepartmentResult; //鍒楄〃灞曠ず @TableField(exist = false) private String equipmentCode; @@ -113,4 +131,13 @@ private String equipmentModel; @TableField(exist = false) private String installationPosition; + /**鎵规鍙�*/ + @TableField(exist = false) + private String batchNumber; + /**鍔犲伐闆朵欢鍙�*/ + @TableField(exist = false) + private String processingPart; + /**浠舵暟*/ + @TableField(exist = false) + private String quantity; } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportProductHazardsMapper.xml b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportProductHazardsMapper.xml index ed94b1c..01d5dab 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportProductHazardsMapper.xml +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportProductHazardsMapper.xml @@ -3,7 +3,8 @@ <mapper namespace="org.jeecg.modules.eam.mapper.EamReportProductHazardsMapper"> <select id="queryPageList" resultType="org.jeecg.modules.eam.request.EamReportProductHazardsQuery"> - select erph.*, e.equipment_code, e.equipment_name,e.equipment_model, e.installation_position + select erph.*, e.equipment_code, e.equipment_name,e.equipment_model, e.installation_position, + arr.processing_part,arr.batch_number,arr.quantity from eam_report_product_hazards erph inner join eam_equipment e on erph.equipment_id = e.id diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java index f4dbee7..dd2a481 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java @@ -1,15 +1,13 @@ package org.jeecg.modules.eam.request; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -30,80 +28,102 @@ public class EamReportProductHazardsQuery implements Serializable { private static final long serialVersionUID = 1L; - /**涓婚敭*/ - @TableId(type = IdType.ASSIGN_ID) + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "涓婚敭") private String id; - /**鍒涘缓浜�*/ + /**鍒涘缓浜�*/ @ApiModelProperty(value = "鍒涘缓浜�") private String createBy; - /**鍒涘缓鏃ユ湡*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + /**鍒涘缓鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "鍒涘缓鏃ユ湡") private Date createTime; - /**鏇存柊浜�*/ + /**鏇存柊浜�*/ @ApiModelProperty(value = "鏇存柊浜�") private String updateBy; - /**鏇存柊鏃ユ湡*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + /**鏇存柊鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "鏇存柊鏃ユ湡") private Date updateTime; - /**鎶ヤ慨ID*/ - @Excel(name = "鎶ヤ慨ID", width = 15) + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag; + /**鎶ヤ慨ID*/ + @Excel(name = "鎶ヤ慨ID", width = 15) @ApiModelProperty(value = "鎶ヤ慨ID") private String reportId; - /**璁惧ID*/ - @Excel(name = "璁惧ID", width = 15) + /**璁惧ID*/ + @Excel(name = "璁惧ID", width = 15) @ApiModelProperty(value = "璁惧ID") private String equipmentId; - /**鎿嶄綔宸�*/ - @Excel(name = "鎿嶄綔宸�", width = 15) + /**纭鐘舵��*/ + @Excel(name = "纭鐘舵��", width = 15) + @ApiModelProperty(value = "纭鐘舵��") + @Dict(dicCode = "confirm_status") + private String confirmStatus; + /**鎿嶄綔宸�*/ + @Excel(name = "鎿嶄綔宸�", width = 15) @ApiModelProperty(value = "鎿嶄綔宸�") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String confirmer; - /**鎿嶄綔宸ョ‘璁ゆ椂闂�*/ - @Excel(name = "鎿嶄綔宸ョ‘璁ゆ椂闂�", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + /**鎿嶄綔宸ョ‘璁ゆ椂闂�*/ + @Excel(name = "鎿嶄綔宸ョ‘璁ゆ椂闂�", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "鎿嶄綔宸ョ‘璁ゆ椂闂�") private Date confirmTime; - /**浜у搧鎹熷け鎯呭喌*/ - @Excel(name = "浜у搧鎹熷け鎯呭喌", width = 15) + /**浜у搧鎹熷け鎯呭喌*/ + @Excel(name = "浜у搧鎹熷け鎯呭喌", width = 15) @ApiModelProperty(value = "浜у搧鎹熷け鎯呭喌") + @Dict(dicCode = "yn") private String productLoss; - /**浜у搧鎹熷け璐ㄩ噺褰卞搷鍒嗘瀽*/ - @Excel(name = "浜у搧鎹熷け璐ㄩ噺褰卞搷鍒嗘瀽", width = 15) + /**浜у搧鎹熷け璐ㄩ噺褰卞搷鍒嗘瀽*/ + @Excel(name = "浜у搧鎹熷け璐ㄩ噺褰卞搷鍒嗘瀽", width = 15) @ApiModelProperty(value = "浜у搧鎹熷け璐ㄩ噺褰卞搷鍒嗘瀽") private String qualityAnalysis; - /**涓荤宸ヨ壓*/ - @Excel(name = "涓荤宸ヨ壓", width = 15) + /**涓荤宸ヨ壓*/ + @Excel(name = "涓荤宸ヨ壓", width = 15) @ApiModelProperty(value = "涓荤宸ヨ壓") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String technologist; - /**涓荤宸ヨ壓纭鏃堕棿*/ - @Excel(name = "涓荤宸ヨ壓纭鏃堕棿", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + /**涓荤宸ヨ壓纭鏃堕棿*/ + @Excel(name = "涓荤宸ヨ壓纭鏃堕棿", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "涓荤宸ヨ壓纭鏃堕棿") private Date technologistTime; - /**涓荤宸ヨ壓纭鎰忚*/ - @Excel(name = "涓荤宸ヨ壓纭鎰忚", width = 15) + /**涓荤宸ヨ壓纭鎰忚*/ + @Excel(name = "涓荤宸ヨ壓纭鎰忚", width = 15) @ApiModelProperty(value = "涓荤宸ヨ壓纭鎰忚") private String technologistComment; - /**閮ㄧ骇棰嗗*/ - @Excel(name = "閮ㄧ骇棰嗗", width = 15) + /**涓荤宸ヨ壓纭缁撴灉*/ + @Excel(name = "涓荤宸ヨ壓纭缁撴灉", width = 15) + @ApiModelProperty(value = "涓荤宸ヨ壓纭缁撴灉") + private String technologistResult; + /**閮ㄧ骇棰嗗*/ + @Excel(name = "閮ㄧ骇棰嗗", width = 15) @ApiModelProperty(value = "閮ㄧ骇棰嗗") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String deputyDepartment; - /**閮ㄧ骇棰嗗纭鏃堕棿*/ - @Excel(name = "閮ㄧ骇棰嗗纭鏃堕棿", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + /**閮ㄧ骇棰嗗纭鏃堕棿*/ + @Excel(name = "閮ㄧ骇棰嗗纭鏃堕棿", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "閮ㄧ骇棰嗗纭鏃堕棿") private Date deputyDepartmentTime; - /**閮ㄧ骇棰嗗纭鎰忚*/ - @Excel(name = "閮ㄧ骇棰嗗纭鎰忚", width = 15) + /**閮ㄧ骇棰嗗纭鎰忚*/ + @Excel(name = "閮ㄧ骇棰嗗纭鎰忚", width = 15) @ApiModelProperty(value = "閮ㄧ骇棰嗗纭鎰忚") private String deputyDepartmentComment; + /**閮ㄧ骇棰嗗纭缁撴灉*/ + @Excel(name = "閮ㄧ骇棰嗗纭缁撴灉", width = 15) + @ApiModelProperty(value = "閮ㄧ骇棰嗗纭缁撴灉") + private String deputyDepartmentResult; //鍒楄〃灞曠ず @TableField(exist = false) private String equipmentCode; @@ -115,4 +135,13 @@ private String installationPosition; private String column; private String order; + /**鎵规鍙�*/ + @TableField(exist = false) + private String batchNumber; + /**鍔犲伐闆朵欢鍙�*/ + @TableField(exist = false) + private String processingPart; + /**浠舵暟*/ + @TableField(exist = false) + private String quantity; } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamReportProductHazardsService.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamReportProductHazardsService.java index 69f4213..c432146 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamReportProductHazardsService.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamReportProductHazardsService.java @@ -40,6 +40,12 @@ Result<?> submit(String id); /** + * 娴佺▼瀹℃牳 + * @param eamReportProductHazardsDto + */ + Result<?> audit(EamReportProductHazardsDto eamReportProductHazardsDto); + + /** * 鍒犻櫎 * @param id * @return diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportAccidentsRegisterServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportAccidentsRegisterServiceImpl.java index 0003f16..02af5d5 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportAccidentsRegisterServiceImpl.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportAccidentsRegisterServiceImpl.java @@ -129,6 +129,9 @@ if (StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getEquipmentName())) { queryWrapper.like("e.equipment_name", eamReportAccidentsRegisterQuery.getEquipmentName()); } + if (StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getRegisterStatus())) { + queryWrapper.eq("aar.register_status", eamReportAccidentsRegisterQuery.getRegisterStatus()); + } queryWrapper.eq("aar.del_flag", CommonConstant.DEL_FLAG_0); //鎺掑簭 if (StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getColumn()) && StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getOrder())) { @@ -223,7 +226,7 @@ public Result<?> audit(EamReportAccidentsRegisterDto eamReportAccidentsRegisterDto){ EamReportAccidentsRegister eamReportAccidentsRegister = this.baseMapper.selectById(eamReportAccidentsRegisterDto.getId()); if (eamReportAccidentsRegister == null) { - throw new JeecgBootException("缁翠慨宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + throw new JeecgBootException("宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); } // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛 LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); @@ -271,6 +274,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getDistrictConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getDistrictConfirm()); + values.put("districtResult", eamReportAccidentsRegisterDto.getDistrictResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getDistrictConfirm()); eamReportAccidentsRegister.setDistrict(user.getUsername()); eamReportAccidentsRegister.setDistrictTime(new Date()); @@ -298,6 +302,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getCenterDirectorConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getCenterDirectorConfirm()); + values.put("centerDirectorResult", eamReportAccidentsRegisterDto.getCenterDirectorResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getCenterDirectorConfirm()); eamReportAccidentsRegister.setCenterDirector(user.getUsername()); eamReportAccidentsRegister.setCenterDirectorTime(new Date()); @@ -325,6 +330,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getRepairConfirmComment()); values.put("comment", eamReportAccidentsRegisterDto.getRepairConfirmComment()); + values.put("repairConfirmResult", eamReportAccidentsRegisterDto.getRepairConfirmResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getRepairConfirmComment()); eamReportAccidentsRegister.setRepairConfirm(user.getUsername()); eamReportAccidentsRegister.setRepairConfirmTime(new Date()); @@ -338,7 +344,7 @@ eamReportAccidentsRegister.setSuggestionTakeSteps(eamReportAccidentsRegisterDto.getSuggestionTakeSteps()); eamReportAccidentsRegister.setSuggestionTakeStepsTime(eamReportAccidentsRegisterDto.getSuggestionTakeStepsTime()); if ("2".equals(eamReportAccidentsRegisterDto.getRepairConfirmResult())){ - //缁翠慨缁勯暱鎷掔粷 + //缁翠慨宸ユ嫆缁� eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.PENDING_REPAIR_TEAM_LEADER.name()); @@ -358,6 +364,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getRepairGroupLeaderComment()); values.put("comment", eamReportAccidentsRegisterDto.getRepairGroupLeaderComment()); + values.put("repairGroupLeaderResult", eamReportAccidentsRegisterDto.getRepairGroupLeaderResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getRepairGroupLeaderComment()); eamReportAccidentsRegister.setRepairGroupLeader(user.getUsername()); eamReportAccidentsRegister.setRepairGroupLeaderTime(new Date()); @@ -383,12 +390,13 @@ } values.put("organization",eamReportAccidentsRegisterDto.getRepairDistrictComment()); values.put("comment", eamReportAccidentsRegisterDto.getRepairDistrictComment()); + values.put("repairDistrictResult", eamReportAccidentsRegisterDto.getRepairDistrictResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getRepairDistrictComment()); eamReportAccidentsRegister.setRepairDistrict(user.getUsername()); eamReportAccidentsRegister.setRepairDistrictTime(new Date()); eamReportAccidentsRegister.setRepairDistrictResult(eamReportAccidentsRegisterDto.getRepairDistrictResult()); eamReportAccidentsRegister.setRepairDistrictComment(eamReportAccidentsRegisterDto.getRepairDistrictComment()); - if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ + if ("2".equals(eamReportAccidentsRegisterDto.getRepairDistrictResult())){ //缁翠慨鍖洪暱鎷掔粷 eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { @@ -408,6 +416,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); + values.put("technicalDirectorResult", eamReportAccidentsRegisterDto.getTechnicalDirectorResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); eamReportAccidentsRegister.setCheckAgree(eamReportAccidentsRegisterDto.getCheckAgree()); eamReportAccidentsRegister.setDisagreeReason(eamReportAccidentsRegisterDto.getDisagreeReason()); @@ -417,7 +426,7 @@ eamReportAccidentsRegister.setTechnicalDirectorTime(new Date()); eamReportAccidentsRegister.setTechnicalDirectorResult(eamReportAccidentsRegisterDto.getTechnicalDirectorResult()); eamReportAccidentsRegister.setTechnicalDirectorConfirm(eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); - if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ + if ("2".equals(eamReportAccidentsRegisterDto.getTechnicalDirectorResult())){ //鎶�鏈礋璐d汉鎷掔粷 eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { @@ -437,12 +446,13 @@ } values.put("organization",eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); + values.put("technicalDirectorLeaderResult", eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); eamReportAccidentsRegister.setTechnicalDirectorLeader(user.getUsername()); eamReportAccidentsRegister.setTechnicalDirectorLeaderTime(new Date()); eamReportAccidentsRegister.setTechnicalDirectorLeaderResult(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderResult()); eamReportAccidentsRegister.setTechnicalDirectorLeaderConfirm(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); - if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ + if ("2".equals(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderResult())){ //鎶�鏈富绠″绾ч瀵兼嫆缁� eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { @@ -456,12 +466,13 @@ } values.put("organization",eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); + values.put("technicalDirectorPartResult", eamReportAccidentsRegisterDto.getTechnicalDirectorPartResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); eamReportAccidentsRegister.setTechnicalDirectorPart(user.getUsername()); eamReportAccidentsRegister.setTechnicalDirectorPartTime(new Date()); eamReportAccidentsRegister.setTechnicalDirectorPartResult(eamReportAccidentsRegisterDto.getTechnicalDirectorPartResult()); eamReportAccidentsRegister.setTechnicalDirectorPartConfirm(eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); - if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ + if ("2".equals(eamReportAccidentsRegisterDto.getTechnicalDirectorPartResult())){ //鎶�鏈富绠″绾ч瀵兼嫆缁� eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportProductHazardsServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportProductHazardsServiceImpl.java index 2d0e9f1..21645f0 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportProductHazardsServiceImpl.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportProductHazardsServiceImpl.java @@ -1,5 +1,8 @@ package org.jeecg.modules.eam.service.impl; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -8,22 +11,39 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; +import org.flowable.engine.TaskService; +import org.flowable.task.api.Task; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.DataBaseConstant; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.eam.constant.BusinessCodeConst; +import org.jeecg.modules.eam.constant.EamReportAccidentsRegisterEnum; +import org.jeecg.modules.eam.constant.EamReportProductHazardsEnum; import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; +import org.jeecg.modules.eam.entity.EamEquipment; +import org.jeecg.modules.eam.entity.EamReportAccidentsRegister; import org.jeecg.modules.eam.entity.EamReportProductHazards; import org.jeecg.modules.eam.entity.EamReportRepair; import org.jeecg.modules.eam.mapper.EamReportProductHazardsMapper; import org.jeecg.modules.eam.request.EamReportProductHazardsQuery; +import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.service.IEamReportProductHazardsService; import org.jeecg.modules.eam.service.IEamReportRepairService; +import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; +import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; +import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; +import org.jeecg.modules.flowable.apithird.service.FlowCommonService; +import org.jeecg.modules.flowable.service.IFlowDefinitionService; +import org.jeecg.modules.flowable.service.IFlowTaskService; import org.jeecg.modules.system.entity.BaseFactory; import org.jeecg.modules.system.entity.BaseFactoryUser; import org.jeecg.modules.system.service.IBaseFactoryService; import org.jeecg.modules.system.service.IBaseFactoryUserService; +import org.jeecg.modules.system.service.ISysUserService; +import org.jeecg.modules.system.vo.UserSelector; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -31,9 +51,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import java.util.Arrays; -import java.util.List; -import java.util.Set; +import javax.annotation.Resource; +import java.util.*; import java.util.stream.Collectors; /** @@ -43,7 +62,7 @@ * @Version: V1.0 */ @Service("IEamReportProductHazardsService") -public class EamReportProductHazardsServiceImpl extends ServiceImpl<EamReportProductHazardsMapper, EamReportProductHazards> implements IEamReportProductHazardsService { +public class EamReportProductHazardsServiceImpl extends ServiceImpl<EamReportProductHazardsMapper, EamReportProductHazards> implements IEamReportProductHazardsService, FlowCallBackServiceI { @Autowired private IBaseFactoryUserService baseFactoryUserService; @@ -52,7 +71,25 @@ @Autowired @Lazy private IEamReportRepairService iEamReportRepairService; + @Resource + private IFlowMyBusinessService flowMyBusinessService; + @Resource + private TaskService taskService; + + @Resource + private IFlowTaskService flowTaskService; + + @Autowired + private ISysUserService sysUserService; + + @Resource + private FlowCommonService flowCommonService; + + @Resource + private IFlowDefinitionService flowDefinitionService; + @Resource + private IEamEquipmentService eamEquipmentService; /** * 鍒嗛〉鍒楄〃 * @param page @@ -94,6 +131,13 @@ if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getEquipmentName())) { queryWrapper.like("e.equipment_name", eamReportProductHazardsQuery.getEquipmentName()); } + if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getConfirmStatus())) { + queryWrapper.eq("erph.confirm_status", eamReportProductHazardsQuery.getConfirmStatus()); + } + if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getProductLoss())) { + queryWrapper.eq("erph.product_loss", eamReportProductHazardsQuery.getProductLoss()); + } + queryWrapper.eq("erph.del_flag", CommonConstant.DEL_FLAG_0); //鎺掑簭 if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getColumn()) && StringUtils.isNotBlank(eamReportProductHazardsQuery.getOrder())) { String column = eamReportProductHazardsQuery.getColumn(); @@ -137,7 +181,164 @@ */ @Override public Result<?> submit(String id){ - return null; + EamReportProductHazards eamReportProductHazards=this.getById(id); + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + EamEquipment eamEquipment = eamEquipmentService.getById(eamReportProductHazards.getEquipmentId()); + List<UserSelector> userSelectorList = sysUserService.selectOperatorList(eamEquipment.getEquipmentCode(), eamEquipment.getFactoryOrgCode(), BusinessCodeConst.PCR0024); + // 鍚姩璁惧浜嬫晠鐧昏娴佺▼ + flowCommonService.initActBusiness("璁惧缂栧彿锛�" + eamEquipment.getEquipmentCode() + ", 璁惧鍚嶇О锛�" + eamEquipment.getEquipmentName()+"鍙戣捣浜у搧瀹夊叏闅愭偅纭娴佺▼", + eamReportProductHazards.getId(), + "IEamReportProductHazardsService", + "eam_report_product_hazards", + null); + Map<String, Object> variables = new HashMap<>(); + variables.put("dataId", eamReportProductHazards.getId()); + variables.put("organization", "鎿嶄綔宸ユ彁浜ゅ惎鍔ㄦ祦绋�"); + variables.put("comment", "鎿嶄綔宸ユ彁浜ゅ崟鍚姩娴佺▼"); + variables.put("proofreading", true); + if (CollectionUtils.isEmpty(userSelectorList)) { + throw new JeecgBootException("璁惧鏈瓨鍦ㄤ富绠″伐鑹猴紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�"); + }else { + List<String> usernameList = userSelectorList.stream().map(UserSelector::getUsername).collect(Collectors.toList()); + variables.put("NextAssignee", usernameList); + } + Result result = flowDefinitionService.startProcessInstanceByKey("eam_report_product_hazards", variables); + if (!result.isSuccess()) { + return Result.error("娴佺▼鍚姩澶辫触"); + } else { + eamReportProductHazards.setConfirmer(user.getUsername()); + eamReportProductHazards.setConfirmTime(new Date()); + eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUPERIOR_TECHNICAL_CONFIRMATION.name()); + this.updateById(eamReportProductHazards); + return result; + } + } + + /** + * 娴佺▼瀹℃牳 + * @param eamReportProductHazardsDto + */ + @Override + public Result<?> audit(EamReportProductHazardsDto eamReportProductHazardsDto){ + EamReportProductHazards eamReportProductHazards = this.baseMapper.selectById(eamReportProductHazardsDto.getId()); + if (eamReportProductHazards == null) { + throw new JeecgBootException("宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (user == null || StrUtil.isBlank(user.getId())) { + throw new JeecgBootException("鏈幏鍙栧埌鐧诲綍鐢ㄦ埛锛岃閲嶆柊鐧诲綍鍚庡啀璇曪紒"); + } + eamReportProductHazardsDto.setAssignee(user.getUsername()); + // 鑾峰彇娴佺▼涓氬姟璁板綍 + FlowMyBusiness flowMyBusiness = flowMyBusinessService.getFlowMyBusiness(eamReportProductHazardsDto.getInstanceId()); + if (flowMyBusiness == null) { + throw new JeecgBootException("娴佺▼瀹炰緥涓嶅瓨鍦紝璇峰埛鏂板悗閲嶈瘯锛�"); + } + boolean userAuthorized = isUserAuthorized(flowMyBusiness, user); + if (!userAuthorized) { + throw new JeecgBootException("鐢ㄦ埛鏃犳潈鎿嶄綔姝や换鍔★紝璇峰埛鏂板悗閲嶈瘯锛�"); + } + // 璁ら浠诲姟 + if (!claimTask(flowMyBusiness.getTaskId(), user)) { + throw new JeecgBootException("浠诲姟涓嶅瓨鍦ㄣ�佸凡瀹屾垚鎴栧凡琚粬浜鸿棰嗭紒"); + } + EamEquipment equipment = eamEquipmentService.getById(eamReportProductHazardsDto.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧涓嶅瓨鍦紝璇锋鏌ワ紒"); + } + EamReportProductHazardsEnum status = EamReportProductHazardsEnum.getInstance(eamReportProductHazards.getConfirmStatus()); + if (status == null) { + return null; + } + //娴佺▼鍙橀噺 + Map<String, Object> values = new HashMap<>(); + List<String> userApprovalList; + List<UserSelector> userSelectors; + switch (status) { + //寰呬富绠″伐鑹虹‘璁� + case PENDING_SUPERIOR_TECHNICAL_CONFIRMATION: + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0025); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈瓨鍦ㄥ壇閮ㄧ骇棰嗗锛屾棤娉曡繘鍏ヤ笅绾у鎵癸紒"); + }else{ + userApprovalList= userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); + values.put("NextAssignee", userApprovalList); + values.put("dataId", eamReportProductHazardsDto.getId()); + if (StrUtil.isEmpty(eamReportProductHazardsDto.getTechnologistComment())){ + eamReportProductHazardsDto.setTechnologistComment(""); + } + values.put("organization",eamReportProductHazardsDto.getTechnologistComment()); + values.put("comment", eamReportProductHazardsDto.getTechnologistComment()); + values.put("technologistResult", eamReportProductHazardsDto.getTechnologistResult()); + eamReportProductHazardsDto.setComment(eamReportProductHazardsDto.getTechnologistComment()); + eamReportProductHazards.setTechnologist(user.getUsername()); + eamReportProductHazards.setTechnologistTime(new Date()); + eamReportProductHazards.setTechnologistResult(eamReportProductHazardsDto.getTechnologistResult()); + eamReportProductHazards.setTechnologistComment(eamReportProductHazardsDto.getTechnologistComment()); + if ("2".equals(eamReportProductHazardsDto.getTechnologistResult())){ + //涓荤宸ヨ壓鎷掔粷 + eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REJECTED.name()); + }else { + eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_DEPARTMENT_LEADER_CONFIRMATION.name()); + } + } + break; + //寰呭壇閮ㄧ骇棰嗗纭 + case PENDING_DEPARTMENT_LEADER_CONFIRMATION: + values.put("dataId", eamReportProductHazardsDto.getId()); + if (StrUtil.isEmpty(eamReportProductHazardsDto.getDeputyDepartmentComment())){ + eamReportProductHazardsDto.setDeputyDepartmentComment(""); + } + values.put("organization",eamReportProductHazardsDto.getDeputyDepartmentComment()); + values.put("comment", eamReportProductHazardsDto.getDeputyDepartmentComment()); + values.put("deputyDepartmentResult", eamReportProductHazardsDto.getDeputyDepartmentResult()); + eamReportProductHazardsDto.setComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); + eamReportProductHazards.setDeputyDepartment(user.getUsername()); + eamReportProductHazards.setDeputyDepartmentTime(new Date()); + eamReportProductHazards.setDeputyDepartmentResult(eamReportProductHazardsDto.getDeputyDepartmentResult()); + eamReportProductHazards.setDeputyDepartmentComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); + if ("2".equals(eamReportProductHazardsDto.getDeputyDepartmentResult())){ + //鍓儴绾ч瀵兼嫆缁� + eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REJECTED.name()); + }else { + eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REPAIR_COMPLETED.name()); + } + break; + default: + throw new JeecgBootException("瀹℃壒澶辫触"); + } + eamReportProductHazardsDto.setValues(values); + //淇濆瓨宸ュ崟 + this.updateById(eamReportProductHazards); + Result result = flowTaskService.complete(eamReportProductHazardsDto); + if (!result.isSuccess()) { + throw new JeecgBootException("瀹℃壒澶辫触锛岃鍒锋柊鏌ョ湅锛�"); + } + return Result.ok("瀹℃壒鎴愬姛"); + } + + private boolean claimTask(String taskId, LoginUser user) { + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); + if (task == null) { + return false; + } + if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { + return false; + } + taskService.claim(taskId, user.getUsername()); + return true; + } + + /** + * 鍒ゆ柇鐢ㄦ埛鏄惁鎷ユ湁姝ゆ潈闄� + * @param flowMyBusiness + * @param user + * @return + */ + private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) { + List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); + return todoUsers != null && todoUsers.contains(user.getUsername()); } /** @@ -166,4 +367,26 @@ this.removeById(id); return true; } + + @Override + public void afterFlowHandle(FlowMyBusiness business) { + + } + + @Override + public Object getBusinessDataById(String dataId) { + return null; + } + + @Override + public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) { + return Collections.emptyMap(); + } + + @Override + public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { + //鑾峰彇涓嬩竴姝ュ鐞嗕汉 + Object object = values.get("NextAssignee"); + return (List<String>) object; + } } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java index 12fdd0f..a544284 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java @@ -197,6 +197,8 @@ EamReportProductHazards eamReportProductHazards=new EamReportProductHazards(); eamReportProductHazards.setEquipmentId(eamReportRepair.getEquipmentId()); eamReportProductHazards.setReportId(eamReportRepair.getId()); + eamReportProductHazards.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0)); + eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUBMIT.name()); iEamReportProductHazardsService.save(eamReportProductHazards); } if (StrUtil.isNotEmpty(eamReportRepair.getIsAccidentsRegister())&&("1").equals(eamReportRepair.getIsAccidentsRegister())) { @@ -208,7 +210,7 @@ eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.PENDING_SUBMIT.name()); iEamReportAccidentsRegisterService.save(eamReportAccidentsRegister); } - //鐢熸垚缁翠慨宸ュ崟,鍙兘浼氭湁棰嗗彇鎿嶄綔 + //鐢熸垚缁翠慨宸ュ崟 EamRepairOrder eamRepairOrder=new EamRepairOrder(); BeanUtils.copyProperties(eamReportRepairRequest, eamRepairOrder); String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.REPAIR_ORDER_CODE_RULE); diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java index 32b7fd5..c0e8f2e 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java @@ -68,10 +68,10 @@ private IEamReportAccidentsRegisterService eamReportAccidentsRegisterService; @Autowired private IEamReportRepairService eamReportRepairService; - @Autowired - private ObjectMapper objectMapper; - @Autowired - private TranslateDictTextUtils translateDictTextUtils; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; /** * 鍒嗛〉鍒楄〃鏌ヨ * diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportProductHazardsController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportProductHazardsController.java index a874675..2c25443 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportProductHazardsController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportProductHazardsController.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import cn.hutool.core.util.StrUtil; import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; @@ -19,6 +20,7 @@ import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; import org.jeecg.modules.eam.dto.EamReportRepairDto; import org.jeecg.modules.eam.entity.EamReportProductHazards; +import org.jeecg.modules.eam.entity.EamReportRepair; import org.jeecg.modules.eam.request.EamReportProductHazardsQuery; import org.jeecg.modules.eam.service.IEamReportProductHazardsService; @@ -27,6 +29,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.modules.eam.service.IEamReportRepairService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -50,7 +53,8 @@ public class EamReportProductHazardsController extends JeecgController<EamReportProductHazards, IEamReportProductHazardsService> { @Autowired private IEamReportProductHazardsService eamReportProductHazardsService; - + @Autowired + private IEamReportRepairService eamReportRepairService; /** * 鍒嗛〉鍒楄〃鏌ヨ * @@ -86,6 +90,43 @@ eamReportProductHazardsService.save(eamReportProductHazards); return Result.OK("娣诲姞鎴愬姛锛�"); } + + /** + * 鎿嶄綔宸ユ彁浜�-鍙戣捣娴佺▼ + * @param id + * @return + */ + @ApiOperation(value = "璁惧浜嬫晠鐧昏琛�-鎻愪氦", notes = "璁惧浜嬫晠鐧昏琛�-鎻愪氦") + @GetMapping(value = "/submit") + public Result<?> submit(String id){ + // 鏍¢獙棰嗗彇鏉冮檺 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (!BusinessCodeConst.PCR0001.equals(user.getPost())) { + return Result.error("鎻愪氦澶辫触,娌℃湁鎻愪氦鏉冮檺锛�,闇�鎿嶄綔宸ユ彁浜�"); + } + eamReportProductHazardsService.submit(id); + return Result.OK("鎻愪氦鎴愬姛锛�"); + } + + /** + * 鎴戠殑寰呭姙 鎵ц/瀹℃壒 + * + * @param eamReportProductHazardsDto + * @return + */ + @AutoLog(value = "璁惧浜嬫晠鐧昏琛�-鎵ц/瀹℃壒") + @ApiOperation(value = "璁惧浜嬫晠鐧昏琛�-鎵ц/瀹℃壒", notes = "璁惧浜嬫晠鐧昏琛�-鎵ц/瀹℃壒") + @PostMapping(value = "/perform") + public Result<?> audit(@RequestBody EamReportProductHazardsDto eamReportProductHazardsDto){ + if (eamReportProductHazardsDto == null) { + return Result.error("瀹℃壒鐨勫璞′笉鑳戒负绌猴紒"); + } + // 妫�鏌ヨ姹傚弬鏁� + if (StrUtil.isBlank(eamReportProductHazardsDto.getTaskId()) || StrUtil.isBlank(eamReportProductHazardsDto.getDataId()) || StrUtil.isBlank(eamReportProductHazardsDto.getInstanceId())) { + return Result.error("瀹℃壒浠诲姟閿欒鎴栦笉瀛樺湪锛�"); + } + return eamReportProductHazardsService.audit(eamReportProductHazardsDto); + } /** * 缂栬緫 @@ -148,6 +189,10 @@ if(eamReportProductHazards==null) { return Result.error("鏈壘鍒板搴旀暟鎹�"); } + EamReportRepair eamReportRepair=eamReportRepairService.getById(eamReportProductHazards.getReportId()); + eamReportProductHazards.setBatchNumber(eamReportRepair.getBatchNumber()); + eamReportProductHazards.setProcessingPart(eamReportRepair.getProcessingPart()); + eamReportProductHazards.setQuantity(eamReportRepair.getQuantity()); return Result.OK(eamReportProductHazards); } -- Gitblit v1.9.3