From 58f63d0e061123b15f780d294272d8a461f183db Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期三, 23 七月 2025 17:41:59 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml | 2 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java | 1 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeStatusEnum.java | 22 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusChangeServiceImpl.java | 89 +++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusChangeDetail.java | 3 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java | 19 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceChangeService.java | 41 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateServiceImpl.java | 2 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceChangeController.java | 140 ++++- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeRequest.java | 81 +++ lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceChange.java | 40 + lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeReasonEnum.java | 20 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderChangeServiceImpl.java | 2 db/430设备管理数据库设计.pdma.json | 134 +++++ lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java | 2 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateController.java | 22 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceOrderService.java | 8 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeDetailController.java | 25 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamThirdMaintenanceChangeMapper.java | 6 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java | 2 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java | 30 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java | 2 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusEvaluationApplication.java | 7 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceChangeServiceImpl.java | 484 +++++++++++++++++++++ lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java | 4 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeController.java | 41 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationApplicationController.java | 23 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusChangeService.java | 8 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationApplicationServiceImpl.java | 3 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeQuery.java | 28 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceChangeMapper.xml | 12 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamWeekInsDetailUserResponse.java | 2 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/job/InspectionOrderGenerateJob.java | 1 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java | 25 - lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivate.java | 1 35 files changed, 1,216 insertions(+), 116 deletions(-) diff --git "a/db/430\350\256\276\345\244\207\347\256\241\347\220\206\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.pdma.json" "b/db/430\350\256\276\345\244\207\347\256\241\347\220\206\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.pdma.json" index 99ef71c..9aedf87 100644 --- "a/db/430\350\256\276\345\244\207\347\256\241\347\220\206\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.pdma.json" +++ "b/db/430\350\256\276\345\244\207\347\256\241\347\220\206\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.pdma.json" @@ -2,9 +2,9 @@ "name": "430璁惧绠$悊鏁版嵁搴撹璁�", "describe": "鎻忚堪璁惧绠$悊鏁版嵁搴撹璁℃枃妗�", "avatar": "", - "version": "4.9.2", + "version": "4.9.4", "createdTime": "2025-3-10 16:38:19", - "updatedTime": "2025-7-21 18:29:46", + "updatedTime": "2025-7-23 11:43:01", "dbConns": [], "profile": { "default": { @@ -2328,7 +2328,7 @@ "id": "951E3090-8A27-4E30-A5F0-308B3E9F8E6D" }, { - "defKey": "technology_genarate_flag", + "defKey": "technology_generate_flag", "defName": "鎶�鏈姸鎬侀壌瀹氱敓鎴愭爣璁�", "comment": "1 宸茬敓鎴� 0 涓嬫寰呯敓鎴�", "type": "", @@ -2346,7 +2346,7 @@ "id": "0F8E5A79-4399-42B0-B893-254A6D9DEFAD" }, { - "defKey": "third_maintenance_genarate_flag", + "defKey": "third_maintenance_generate_flag", "defName": "涓変繚鐢熸垚鏍囪", "comment": "1 宸茬敓鎴� 0 涓嬫寰呯敓鎴�", "type": "", @@ -10132,6 +10132,42 @@ "id": "D81F9B85-1C0C-4B24-B8F3-E12C13E62501" }, { + "defKey": "equipment_manager_signature_result", + "defName": "涓荤棰嗗绛惧瓧缁撴灉", + "comment": "", + "type": "NVARCHAR", + "len": 64, + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "", + "id": "F8C4D679-08C0-407E-B321-3B1FC289237B" + }, + { + "defKey": "equipment_manager_comment", + "defName": "涓荤棰嗗鎰忚", + "comment": "", + "type": "", + "len": "", + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", + "id": "EB648C12-9872-4CBF-89D9-A46EE19D3F02" + }, + { "defKey": "depart_manager_signature", "defName": "閮ㄩ棬棰嗗绛惧瓧", "comment": "鏍规嵁寤朵繚鍘熷洜绫诲瀷鍖哄垎涓嶅悓鐨勪汉瀹℃壒", @@ -10166,6 +10202,24 @@ "extProps": {}, "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", "id": "42DF30B4-04DD-4B40-98A6-C4FF34927AEA" + }, + { + "defKey": "depart_manager_signature_result", + "defName": "閮ㄩ棬棰嗗绛惧瓧缁撴灉", + "comment": "", + "type": "NVARCHAR", + "len": 64, + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "", + "id": "55FCD810-CE0F-4481-8A5E-5DCFA886CEC6" }, { "defKey": "depart_manager_comment", @@ -10220,6 +10274,24 @@ "extProps": {}, "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", "id": "9FEDFFD2-B600-461D-8D7C-4F38A7621502" + }, + { + "defKey": "production_support_signature_result", + "defName": "鐢熶骇淇濋殰閮ㄩ瀵肩瀛楃粨鏋�", + "comment": "", + "type": "NVARCHAR", + "len": 64, + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "", + "id": "E56812A5-062D-480B-A6A9-EF4E4B926D56" }, { "defKey": "production_support_comment", @@ -30332,6 +30404,24 @@ "extProps": {}, "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", "id": "589C45F0-0F8C-4497-8999-A8314DE5D601" + }, + { + "defKey": "acceptance_check_comment", + "defName": "楠屾敹鎰忚", + "comment": "", + "type": "", + "len": "", + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", + "id": "0177078A-470B-44DE-8196-D8013935A223" } ], "correlations": [], @@ -30699,6 +30789,24 @@ "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" }, { + "defKey": "equipment_id", + "defName": "璁惧ID", + "comment": "", + "type": "", + "len": "", + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "16120F75-6AA7-4483-868D-F07F511BB081", + "id": "013BD2A8-0A95-4AC3-BF62-11D03C96304F" + }, + { "defKey": "application_status", "defName": "鐢宠鍗曠姸鎬�", "comment": "寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚", @@ -30915,6 +31023,24 @@ "attr9": "", "id": "1FDD4335-E2A5-4925-B353-DFB1518E8893", "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" + }, + { + "defKey": "remark", + "defName": "澶囨敞", + "comment": "", + "type": "", + "len": "", + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", + "id": "77353547-B01B-4592-BCF4-04635339597F" } ], "correlations": [], 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 bf95163..a2a8393 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 @@ -19,6 +19,8 @@ String SECOND_MAINTENANCE_CODE_RULE = "SecondMaintenanceCodeRule"; //涓変繚缂栫爜瑙勫垯 String THIRD_MAINTENANCE_CODE_RULE = "ThirdMaintenanceCodeRule"; + //涓変繚鍙樻洿缂栫爜瑙勫垯 + String THIRD_MAINTENANCE_CHANGE_CODE_RULE = "ThirdMaintenanceChangeCodeRule"; //璁惧鍊熷嚭褰掕繕 String LEAN_OUT_CODE_RULE = "EquipmentLeanOutCodeRule"; //璁惧灏佸瓨鍚皝 diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java index 2870124..c3c0a07 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java @@ -5,6 +5,7 @@ SECOND_MAINTENANCE, //浜屼繚 THIRD_MAINTENANCE_HANDOVER, //涓変繚绉讳氦鍗� THIRD_MAINTENANCE_ACCEPTANCE, //涓変繚楠屾敹鍗� + THIRD_MAINTENANCE_CHANGE, //涓変繚鍙樻洿鍗� TECHNICAL_STATUS_EVALUATION, //鎶�鏈姸鎬侀壌瀹氳〃 TECHNICAL_STATUS_EVALUATION_SAFETY_CHECK, //璁惧瀹夊叏瑁呯疆妫�鏌ュ崟 TECHNICAL_STATUS_EVALUATION_OTHER_CHECK, //鍏朵粬妫�鏌ラ」鐩� diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeReasonEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeReasonEnum.java new file mode 100644 index 0000000..d3be0e2 --- /dev/null +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeReasonEnum.java @@ -0,0 +1,20 @@ +package org.jeecg.modules.eam.constant; + +public enum ThirdMaintenanceChangeReasonEnum { + PRODUCTION_WORK_ORDER_EXPEDITED, //鐢熶骇浠诲姟鎬ユ棤娉曞仠鏈� + EQUIPMENT_BREAKDOWN_REPAIR, //璁惧鏁呴殰姝e浜庣淮淇姸鎬� + EQUIPMENT_SCRAPPED, //璁惧宸叉姤搴� + EQUIPMENT_MAJOR, //璁惧澶т慨銆侀」淇� + EQUIPMENT_RETROFITTING, //璁惧鏀归�� + ; + + public static ThirdMaintenanceChangeReasonEnum getInstance(String code) { + ThirdMaintenanceChangeReasonEnum[] values = ThirdMaintenanceChangeReasonEnum.values(); + for (ThirdMaintenanceChangeReasonEnum 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/constant/ThirdMaintenanceChangeStatusEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeStatusEnum.java new file mode 100644 index 0000000..3b08d40 --- /dev/null +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/ThirdMaintenanceChangeStatusEnum.java @@ -0,0 +1,22 @@ +package org.jeecg.modules.eam.constant; + +public enum ThirdMaintenanceChangeStatusEnum { + WAIT_SUBMIT, //寰呮彁浜� + EQUIPMENT_MANAGER_SIGNING, //涓荤棰嗗绛惧瓧涓� + DEPART_MANAGER_SIGNING, //閮ㄩ棬棰嗗绛惧瓧涓� + PRODUCTION_SUPPORT_SIGNING, //淇濋殰閮ㄩ瀵肩瀛椾腑 + ABOLISH, //宸蹭綔搴� + REJECTED, //宸查┏鍥� + COMPLETED, //宸插畬鎴� + ; + + public static ThirdMaintenanceChangeStatusEnum getInstance(String code) { + ThirdMaintenanceChangeStatusEnum[] values = ThirdMaintenanceChangeStatusEnum.values(); + for (ThirdMaintenanceChangeStatusEnum 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/entity/EamThirdMaintenanceChange.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceChange.java index 06065f9..28b0887 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceChange.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceChange.java @@ -1,5 +1,6 @@ package org.jeecg.modules.eam.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -41,6 +42,7 @@ */ @Excel(name = "涓変繚宸ュ崟ID", width = 15) @ApiModelProperty(value = "涓変繚宸ュ崟ID") + @Dict(dictTable = "eam_third_maintenance_order", dicCode = "id", dicText = "order_num") private String orderId; /** * 鍙樻洿鍗曞彿 @@ -53,13 +55,14 @@ */ @Excel(name = "鐢宠浜�", width = 15) @ApiModelProperty(value = "鐢宠浜�") - @Dict(dicCode = "sys_user, realname, username") + @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") private String applicant; /** * 鐢宠閮ㄩ棬 */ @Excel(name = "鐢宠閮ㄩ棬", width = 15) @ApiModelProperty(value = "鐢宠閮ㄩ棬") + @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code") private String factoryOrgCode; /** * 鐢宠鏃ユ湡 @@ -74,18 +77,21 @@ */ @Excel(name = "鐢宠绫诲瀷;鎶ュ簾銆佸欢淇�", width = 15) @ApiModelProperty(value = "鐢宠绫诲瀷;鎶ュ簾銆佸欢淇�") + @Dict(dicCode = "third_maintenance_change_category") private String applyCategory; /** * 鍙樻洿鐘舵��;寰呮彁浜ゃ�佸緟涓荤瀹℃牳銆佸緟閮ㄩ棬纭銆佸緟淇濋殰閮ㄧ‘璁ゃ�佸凡浣滃簾銆佸凡瀹屾垚 */ @Excel(name = "鍙樻洿鐘舵��;寰呮彁浜ゃ�佸緟涓荤瀹℃牳銆佸緟閮ㄩ棬纭銆佸緟淇濋殰閮ㄧ‘璁ゃ�佸凡浣滃簾銆佸凡瀹屾垚", width = 15) @ApiModelProperty(value = "鍙樻洿鐘舵��;寰呮彁浜ゃ�佸緟涓荤瀹℃牳銆佸緟閮ㄩ棬纭銆佸緟淇濋殰閮ㄧ‘璁ゃ�佸凡浣滃簾銆佸凡瀹屾垚") + @Dict(dicCode = "third_maintenance_change_status") private String changeStatus; /** * 寤朵繚鍘熷洜绫诲瀷;鐢熶骇浠诲姟銆佽澶囨晠闅溿�佹姤搴熴�佸ぇ淇」淇�佹惉杩� */ @Excel(name = "寤朵繚鍘熷洜绫诲瀷;鐢熶骇浠诲姟銆佽澶囨晠闅溿�佹姤搴熴�佸ぇ淇」淇�佹惉杩�", width = 15) @ApiModelProperty(value = "寤朵繚鍘熷洜绫诲瀷;鐢熶骇浠诲姟銆佽澶囨晠闅溿�佹姤搴熴�佸ぇ淇」淇�佹惉杩�") + @Dict(dicCode = "third_maintenance_change_reason") private String applyReasonType; /** * 寤朵繚(鍙樻洿)鍘熷洜 @@ -106,7 +112,7 @@ */ @Excel(name = "涓荤棰嗗绛惧瓧", width = 15) @ApiModelProperty(value = "涓荤棰嗗绛惧瓧") - @Dict(dicCode = "sys_user, realname, username") + @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") private String equipmentManagerSignature; /** * 涓荤棰嗗绛惧瓧鏃堕棿 @@ -116,12 +122,22 @@ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date equipmentManagerSignatureTime; + /**涓荤棰嗗绛惧瓧缁撴灉*/ + @ApiModelProperty(value = "涓荤棰嗗绛惧瓧缁撴灉") + @Dict(dicCode = "approve_reject") + private String equipmentManagerSignatureResult; + /** + * 閮ㄩ棬棰嗗鎰忚 + */ + @Excel(name = "涓荤棰嗗鎰忚", width = 15) + @ApiModelProperty(value = "涓荤棰嗗鎰忚") + private String equipmentManagerComment; /** * 閮ㄩ棬棰嗗绛惧瓧;鏍规嵁寤朵繚鍘熷洜绫诲瀷鍖哄垎涓嶅悓鐨勪汉瀹℃壒 */ @Excel(name = "閮ㄩ棬棰嗗绛惧瓧;鏍规嵁寤朵繚鍘熷洜绫诲瀷鍖哄垎涓嶅悓鐨勪汉瀹℃壒", width = 15) @ApiModelProperty(value = "閮ㄩ棬棰嗗绛惧瓧;鏍规嵁寤朵繚鍘熷洜绫诲瀷鍖哄垎涓嶅悓鐨勪汉瀹℃壒") - @Dict(dicCode = "sys_user, realname, username") + @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") private String departManagerSignature; /** * 閮ㄩ棬棰嗗绛惧瓧鏃堕棿 @@ -131,6 +147,10 @@ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date departManagerSignatureTime; + /**閮ㄩ棬棰嗗绛惧瓧缁撴灉*/ + @ApiModelProperty(value = "閮ㄩ棬棰嗗绛惧瓧缁撴灉") + @Dict(dicCode = "approve_reject") + private String departManagerSignatureResult; /** * 閮ㄩ棬棰嗗鎰忚 */ @@ -142,7 +162,7 @@ */ @Excel(name = "鐢熶骇淇濋殰閮ㄩ瀵肩瀛�", width = 15) @ApiModelProperty(value = "鐢熶骇淇濋殰閮ㄩ瀵肩瀛�") - @Dict(dicCode = "sys_user, realname, username") + @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") private String productionSupportSignature; /** * 鐢熶骇淇濋殰閮ㄩ瀵肩瀛楁椂闂� @@ -152,6 +172,10 @@ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date productionSupportSignatureTime; + /**鐢熶骇淇濋殰閮ㄩ瀵肩瀛楃粨鏋�*/ + @ApiModelProperty(value = "鐢熶骇淇濋殰閮ㄩ瀵肩瀛楃粨鏋�") + @Dict(dicCode = "approve_reject") + private String productionSupportSignatureResult; /** * 鐢熶骇淇濋殰閮ㄩ瀵兼剰瑙� */ @@ -164,4 +188,12 @@ @Excel(name = "HF缂栫爜", width = 15) @ApiModelProperty(value = "HF缂栫爜") private String hfCode; + + //鍒楄〃灞曠ず + @TableField(exist = false) + private String equipmentCode; + @TableField(exist = false) + private String equipmentName; + @TableField(exist = false) + private String equipmentModel; } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java index 93562d0..6ac9ec8 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java @@ -243,4 +243,6 @@ private String equipmentCode; @TableField(exist = false) private String equipmentName; + @TableField(exist = false) + private String equipmentModel; } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamWeekInsDetailUserResponse.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamWeekInsDetailUserResponse.java index 9af0af0..02825b9 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamWeekInsDetailUserResponse.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamWeekInsDetailUserResponse.java @@ -28,7 +28,7 @@ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "鐐规鏃ユ湡") - private Date inspectionDate; + private Date planInspectionDate; /**鐐规浜�*/ @ApiModelProperty(value = "鐐规浜�-鏄鍙栦汉") diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java index 8ce714f..5dbd7b1 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java @@ -261,7 +261,7 @@ list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); if(!CollectionUtils.isEmpty(baseFactoryUserList)){ Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); - Set<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); + Set<String> factoryCode = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); queryWrapper.in("e.factory_org_code", factoryCode); } else { return Collections.emptyList(); @@ -273,7 +273,7 @@ queryWrapper.or().like("e.equipment_name", keyword); } if(StringUtils.isNotBlank(factoryOrgCode)){ - queryWrapper.eq("e.factory_org_code", factoryOrgCode); + queryWrapper.likeRight("e.factory_org_code", factoryOrgCode); } queryWrapper.eq("e.del_flag", CommonConstant.DEL_FLAG_0); IPage<EamEquipment> pageResult = eamEquipmentMapper.queryPageList(page, queryWrapper); diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java index 7fd0901..958f9fc 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java @@ -305,31 +305,6 @@ } /** - * 瀵煎嚭excel - * - * @param request - * @param eamInspectionOrder - */ - //@RequiresPermissions("org.jeecg.modules:鐐规宸ュ崟:exportXls") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, EamInspectionOrder eamInspectionOrder) { - return super.exportXls(request, eamInspectionOrder, EamInspectionOrder.class, "鐐规宸ュ崟"); - } - - /** - * 閫氳繃excel瀵煎叆鏁版嵁 - * - * @param request - * @param response - * @return - */ - //@RequiresPermissions("鐐规宸ュ崟:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, EamInspectionOrder.class); - } - - /** * 瀵煎嚭鑾峰彇鍩烘湰淇℃伅 * @param equipmentCode 缁熶竴缂栫爜 * @param inspectionDate 鏃ユ湡 diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeController.java index 23634fb..88579eb 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeController.java @@ -2,16 +2,22 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.util.TranslateDictTextUtils; import org.jeecg.modules.eam.constant.TechnicalStatusChangeOrderStatusEnum; import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; +import org.jeecg.modules.eam.entity.EamTechnicalStatusChangeDetail; import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeService; @@ -31,6 +37,10 @@ public class EamTechnicalStatusChangeController extends JeecgController<EamTechnicalStatusChange, IEamTechnicalStatusChangeService> { @Autowired private IEamTechnicalStatusChangeService eamTechnicalStatusChangeService; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; /** * 鍒嗛〉鍒楄〃鏌ヨ @@ -149,7 +159,36 @@ @GetMapping(value = "/queryById") public Result<?> queryById(@RequestParam(name="id",required=true) String id) { EamTechnicalStatusChange eamTechnicalStatusChange = eamTechnicalStatusChangeService.getById(id); - return Result.OK(eamTechnicalStatusChange); + if (eamTechnicalStatusChange == null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + try { + String json = objectMapper.writeValueAsString(eamTechnicalStatusChange); + JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); + translateDictTextUtils.translateField("designer", eamTechnicalStatusChange.getDesigner(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("factoryOrgCode", eamTechnicalStatusChange.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); + return Result.OK(item); + } catch (JsonProcessingException e) { + return Result.error("鏁版嵁杞瘧澶辫触锛�"); + } } + /** + * 楠屾敹 + * @param request + * @return + */ + @ApiOperation(value = "鎶�鏈姸鎬佸彉鏇寸敵璇锋槑缁�-楠屾敹", notes = "鎶�鏈姸鎬佸彉鏇寸敵璇锋槑缁�-楠屾敹") + @PostMapping(value = "/acceptance") + public Result<?> acceptance(@RequestBody EamTechnicalStatusChangeDetail request) { + if (request == null) { + return Result.error("楠屾敹缁撴灉瀵硅薄涓嶈兘涓虹┖锛�"); + } + boolean b = eamTechnicalStatusChangeService.acceptance(request); + if (!b) { + return Result.error("鎿嶄綔澶辫触锛�"); + } + return Result.OK("鎿嶄綔鎴愬姛锛�"); + } + } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeDetailController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeDetailController.java index 8c6f98b..41274d7 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeDetailController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeDetailController.java @@ -1,10 +1,14 @@ package org.jeecg.modules.eam.controller; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; +import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.util.TranslateDictTextUtils; import org.jeecg.modules.eam.entity.EamTechnicalStatusChangeDetail; import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeDetailService; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.List; /** @@ -28,6 +33,10 @@ public class EamTechnicalStatusChangeDetailController extends JeecgController<EamTechnicalStatusChangeDetail, IEamTechnicalStatusChangeDetailService> { @Autowired private IEamTechnicalStatusChangeDetailService orderDetailService; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; /** * 涓�娆″姞杞� @@ -39,6 +48,20 @@ @GetMapping(value = "/queryList") public Result<?> queryList(@RequestParam("orderId") String orderId) { List<EamTechnicalStatusChangeDetail> list = orderDetailService.queryList(orderId); - return Result.OK(list); + List<JSONObject> items = new ArrayList<>(); + try { + for(EamTechnicalStatusChangeDetail vo : list) { + String json = objectMapper.writeValueAsString(vo); + JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); + translateDictTextUtils.translateField("acceptanceChecker", vo.getAcceptanceChecker(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("changeCategory", vo.getChangeCategory(), item, "technical_status_change_reason"); + translateDictTextUtils.translateField("changeTechnicalStatus", vo.getChangeTechnicalStatus(), item, "equipment_technology_status"); + translateDictTextUtils.translateField("acceptanceCheckResult", vo.getAcceptanceCheckResult(), item, "equipment_technology_status"); + items.add(item); + } + return Result.OK(items); + }catch (Exception e) { + return Result.error("鏁版嵁杞瘧澶辫触锛�"); + } } } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateController.java index 397bab3..5a3cbc5 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateController.java @@ -2,14 +2,19 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.util.TranslateDictTextUtils; import org.jeecg.modules.eam.constant.TechnicalStatusDeactivateStatusEnum; import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivate; import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateQuery; @@ -31,6 +36,10 @@ public class EamTechnicalStatusDeactivateController extends JeecgController<EamTechnicalStatusDeactivate, IEamTechnicalStatusDeactivateService> { @Autowired private IEamTechnicalStatusDeactivateService eamTechnicalStatusDeactivateService; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; /** * 鍒嗛〉鍒楄〃鏌ヨ @@ -149,6 +158,17 @@ @GetMapping(value = "/queryById") public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate = eamTechnicalStatusDeactivateService.getById(id); - return Result.OK(eamTechnicalStatusDeactivate); + if (eamTechnicalStatusDeactivate == null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + try { + String json = objectMapper.writeValueAsString(eamTechnicalStatusDeactivate); + JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); + translateDictTextUtils.translateField("applicant", eamTechnicalStatusDeactivate.getApplicant(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("factoryOrgCode", eamTechnicalStatusDeactivate.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); + return Result.OK(item); + } catch (JsonProcessingException e) { + return Result.error("鏁版嵁杞瘧澶辫触锛�"); + } } } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationApplicationController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationApplicationController.java index f402727..9b4ecd9 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationApplicationController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationApplicationController.java @@ -1,14 +1,19 @@ package org.jeecg.modules.eam.controller; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.util.TranslateDictTextUtils; import org.jeecg.modules.eam.constant.TechnicalStatusEvaluationApplicationStatusEnum; import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationApplication; import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationApplicationQuery; @@ -32,7 +37,10 @@ public class EamTechnicalStatusEvaluationApplicationController extends JeecgController<EamTechnicalStatusEvaluationApplication, IEamTechnicalStatusEvaluationApplicationService> { @Autowired private IEamTechnicalStatusEvaluationApplicationService eamTechnicalStatusEvaluationApplicationService; - + @Autowired + private ObjectMapper objectMapper; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; /** * 鍒嗛〉鍒楄〃鏌ヨ * @@ -149,7 +157,18 @@ @GetMapping(value = "/queryById") public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { EamTechnicalStatusEvaluationApplication eamTechnicalStatusEvaluationApplication = eamTechnicalStatusEvaluationApplicationService.getById(id); - return Result.OK(eamTechnicalStatusEvaluationApplication); + if (eamTechnicalStatusEvaluationApplication == null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + try { + String json = objectMapper.writeValueAsString(eamTechnicalStatusEvaluationApplication); + JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); + translateDictTextUtils.translateField("applicant", eamTechnicalStatusEvaluationApplication.getApplicant(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("factoryOrgCode", eamTechnicalStatusEvaluationApplication.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); + return Result.OK(item); + } catch (JsonProcessingException e) { + return Result.error("鏁版嵁杞瘧澶辫触锛�"); + } } } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceChangeController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceChangeController.java index 4e96dd1..6688ef7 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceChangeController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceChangeController.java @@ -1,23 +1,30 @@ package org.jeecg.modules.eam.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.TranslateDictTextUtils; +import org.jeecg.modules.eam.constant.ThirdMaintenanceChangeStatusEnum; +import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationOrderChange; import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; +import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderChangeRequest; +import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeQuery; +import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeRequest; import org.jeecg.modules.eam.service.IEamThirdMaintenanceChangeService; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.util.Arrays; /** @@ -34,11 +41,15 @@ @Resource private IEamThirdMaintenanceChangeService eamThirdMaintenanceChangeService; + @Resource + private ObjectMapper objectMapper; + @Resource + private TranslateDictTextUtils translateDictTextUtils; /** * 鍒嗛〉鍒楄〃鏌ヨ * - * @param eamThirdMaintenanceChange + * @param query * @param pageNo * @param pageSize * @param req @@ -47,41 +58,52 @@ @AutoLog(value = "涓変繚鍙樻洿-鍒嗛〉鍒楄〃鏌ヨ") @ApiOperation(value = "涓変繚鍙樻洿-鍒嗛〉鍒楄〃鏌ヨ", notes = "涓変繚鍙樻洿-鍒嗛〉鍒楄〃鏌ヨ") @GetMapping(value = "/list") - public Result<?> queryPageList(EamThirdMaintenanceChange eamThirdMaintenanceChange, + public Result<?> queryPageList(EamThirdMaintenanceChangeQuery query, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - QueryWrapper<EamThirdMaintenanceChange> queryWrapper = QueryGenerator.initQueryWrapper(eamThirdMaintenanceChange, req.getParameterMap()); Page<EamThirdMaintenanceChange> page = new Page<EamThirdMaintenanceChange>(pageNo, pageSize); - IPage<EamThirdMaintenanceChange> pageList = eamThirdMaintenanceChangeService.page(page, queryWrapper); + IPage<EamThirdMaintenanceChange> pageList = eamThirdMaintenanceChangeService.queryPageList(page, query); return Result.OK(pageList); } /** * 娣诲姞 * - * @param eamThirdMaintenanceChange + * @param request * @return */ @AutoLog(value = "涓変繚鍙樻洿-娣诲姞") @ApiOperation(value = "涓変繚鍙樻洿-娣诲姞", notes = "涓変繚鍙樻洿-娣诲姞") @PostMapping(value = "/add") - public Result<?> add(@RequestBody EamThirdMaintenanceChange eamThirdMaintenanceChange) { - eamThirdMaintenanceChangeService.save(eamThirdMaintenanceChange); - return Result.OK("娣诲姞鎴愬姛锛�"); + public Result<?> add(@RequestBody EamThirdMaintenanceChange request) { + if (request == null) { + return Result.error("娣诲姞鐨勫璞′笉鑳戒负绌猴紒"); + } + boolean b = eamThirdMaintenanceChangeService.saveThirdMaintenanceChange(request); + if (!b) { + return Result.error("鍙樻洿澶辫触锛�"); + } + return Result.OK("鍙樻洿鎴愬姛锛�"); } /** * 缂栬緫 * - * @param eamThirdMaintenanceChange + * @param request * @return */ @AutoLog(value = "涓変繚鍙樻洿-缂栬緫") @ApiOperation(value = "涓変繚鍙樻洿-缂栬緫", notes = "涓変繚鍙樻洿-缂栬緫") @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result<?> edit(@RequestBody EamThirdMaintenanceChange eamThirdMaintenanceChange) { - eamThirdMaintenanceChangeService.updateById(eamThirdMaintenanceChange); + public Result<?> edit(@RequestBody EamThirdMaintenanceChange request) { + if (request == null) { + return Result.error("缂栬緫鐨勫璞′笉鑳戒负绌猴紒"); + } + boolean b = eamThirdMaintenanceChangeService.editThirdMaintenanceChange(request); + if (!b) { + return Result.error("缂栬緫澶辫触锛�"); + } return Result.OK("缂栬緫鎴愬姛!"); } @@ -113,6 +135,51 @@ return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�"); } + @AutoLog(value = "涓変繚鍙樻洿-鎻愪氦") + @ApiOperation(value = "涓変繚鍙樻洿-鎻愪氦", notes = "涓変繚鍙樻洿-鎻愪氦") + @GetMapping("/submit") + public Result<?> submit(@RequestParam(name = "id") String id) { + boolean b = eamThirdMaintenanceChangeService.submit(id); + if (!b) { + return Result.error("鎻愪氦澶辫触锛�"); + } + return Result.OK("鎻愪氦鎴愬姛!"); + } + + @AutoLog(value = "涓変繚鍙樻洿-浣滃簾") + @ApiOperation(value = "涓変繚鍙樻洿-浣滃簾", notes = "涓変繚鍙樻洿-浣滃簾") + @GetMapping("/abolish") + public Result<?> abolish(@RequestParam(name = "id") String id) { + EamThirdMaintenanceChange entity = eamThirdMaintenanceChangeService.getById(id); + if (entity == null) { + return Result.error("瑕佷綔搴熺殑鏁版嵁涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + if (!ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name().equals(entity.getChangeStatus())) { + return Result.error("璇ョ姸鎬佺殑鏁版嵁涓嶅厑璁歌繘琛屼綔搴燂紒"); + } + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.ABOLISH.name()); + eamThirdMaintenanceChangeService.updateById(entity); + return Result.OK("浣滃簾鎴愬姛!"); + } + + @AutoLog(value = "涓変繚鍙樻洿-瀹℃壒") + @ApiOperation(value = "涓変繚鍙樻洿-瀹℃壒", notes = "涓変繚鍙樻洿-瀹℃壒") + @PostMapping("/approval") + public Result<?> approval(@RequestBody EamThirdMaintenanceChangeRequest request) { + if (request == null) { + return Result.error("瀹℃壒鐨勫璞′笉鑳戒负绌猴紒"); + } + // 妫�鏌ヨ姹傚弬鏁� + if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) { + return Result.error("瀹℃壒浠诲姟閿欒鎴栦笉瀛樺湪锛�"); + } + EamThirdMaintenanceChange b = eamThirdMaintenanceChangeService.approval(request); + if (b == null) { + return Result.error("鎿嶄綔澶辫触锛�"); + } + return Result.ok("鎿嶄綔鎴愬姛锛�"); + } + /** * 閫氳繃id鏌ヨ * @@ -123,31 +190,24 @@ @ApiOperation(value = "涓変繚鍙樻洿-閫氳繃id鏌ヨ", notes = "涓変繚鍙樻洿-閫氳繃id鏌ヨ") @GetMapping(value = "/queryById") public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { - EamThirdMaintenanceChange eamThirdMaintenanceChange = eamThirdMaintenanceChangeService.getById(id); - return Result.OK(eamThirdMaintenanceChange); - } - - /** - * 瀵煎嚭excel - * - * @param request - * @param eamThirdMaintenanceChange - */ - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, EamThirdMaintenanceChange eamThirdMaintenanceChange) { - return super.exportXls(request, eamThirdMaintenanceChange, EamThirdMaintenanceChange.class, "涓変繚鍙樻洿"); - } - - /** - * 閫氳繃excel瀵煎叆鏁版嵁 - * - * @param request - * @param response - * @return - */ - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, EamThirdMaintenanceChange.class); + EamThirdMaintenanceChange entity = eamThirdMaintenanceChangeService.getById(id); + if (entity == null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + try { + String json = objectMapper.writeValueAsString(entity); + JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); + translateDictTextUtils.translateField("orderId", entity.getOrderId(), item, "eam_third_maintenance_order,order_num,id"); + translateDictTextUtils.translateField("applicant", entity.getApplicant(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("changeStatus", entity.getChangeStatus(), item, "third_maintenance_change_status"); + translateDictTextUtils.translateField("applyReasonType", entity.getApplyReasonType(), item, "third_maintenance_change_reason"); + translateDictTextUtils.translateField("equipmentManagerSignature", entity.getEquipmentManagerSignature(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("departManagerSignature", entity.getDepartManagerSignature(), item, "sys_user,realname,username"); + translateDictTextUtils.translateField("productionSupportSignature", entity.getProductionSupportSignature(), item, "sys_user,realname,username"); + return Result.OK(item); + } catch (JsonProcessingException e) { + return Result.error("鏁版嵁杞瘧澶辫触锛�"); + } } } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusChangeDetail.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusChangeDetail.java index 15d9139..57973e2 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusChangeDetail.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusChangeDetail.java @@ -69,6 +69,9 @@ /**楠屾敹妫�鏌ョ粨鏋�;澶т慨銆佹敼閫� 闇�瑕佸~鍐欓獙鏀剁粨鏋滐紝鎼縼鎸夌収鎶�鏈姸鎬侀壌瀹氬伐鍗曠淮鎶わ紝鍏朵粬鏆傛湭浣跨敤鍒帮紝鍙鐣欐绫诲瀷*/ @ApiModelProperty(value = "楠屾敹妫�鏌ョ粨鏋�;澶т慨銆佹敼閫� 闇�瑕佸~鍐欓獙鏀剁粨鏋滐紝鎼縼鎸夌収鎶�鏈姸鎬侀壌瀹氬伐鍗曠淮鎶わ紝鍏朵粬鏆傛湭浣跨敤鍒帮紝鍙鐣欐绫诲瀷") private String acceptanceCheckResult; + /**楠屾敹鎰忚*/ + @ApiModelProperty(value = "楠屾敹鎰忚") + private String acceptanceCheckComment; //鍒楄〃灞曠ず @TableField(exist = false) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivate.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivate.java index 7413132..58d268f 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivate.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivate.java @@ -64,6 +64,7 @@ private Date applyDate; /**鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚*/ @ApiModelProperty(value = "鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚") + @Dict(dicCode = "technical_status_deactivate_status") private String applicationStatus; /**浣跨敤鍗曚綅瀹や富绠$瀛�*/ @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠$瀛�") diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusEvaluationApplication.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusEvaluationApplication.java index 13e614c..e3e69ae 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusEvaluationApplication.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusEvaluationApplication.java @@ -73,6 +73,7 @@ private Date evaluationDate; /**鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚*/ @ApiModelProperty(value = "鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚") + @Dict(dicCode = "technical_status_evaluation_application_status") private String applicationStatus; /**鐢宠鍗曚綅瀹ょ骇棰嗗绛惧瓧*/ @ApiModelProperty(value = "鐢宠鍗曚綅瀹ょ骇棰嗗绛惧瓧") @@ -85,7 +86,7 @@ private Date departHeaderSignatureTime; /**鐢宠鍗曚綅瀹ょ骇棰嗗绛惧瓧缁撴灉*/ @ApiModelProperty(value = "鐢宠鍗曚綅瀹ょ骇棰嗗绛惧瓧缁撴灉") - @Dict(dicCode = "approved_rejected") + @Dict(dicCode = "approve_reject") private String departHeaderSignatureResult; /**鐢宠鍗曚綅瀹ょ骇棰嗗鎰忚*/ @ApiModelProperty(value = "鐢宠鍗曚綅瀹ょ骇棰嗗鎰忚") @@ -101,7 +102,7 @@ private Date productionHeaderSignatureTime; /**鐢熶骇璁惧绠$悊涓荤绛惧瓧缁撴灉*/ @ApiModelProperty(value = "鐢熶骇璁惧绠$悊涓荤绛惧瓧缁撴灉") - @Dict(dicCode = "approved_rejected") + @Dict(dicCode = "approve_reject") private String productionHeaderSignatureResult; /**鐢熶骇璁惧绠$悊涓荤鎰忚*/ @ApiModelProperty(value = "鐢熶骇璁惧绠$悊涓荤鎰忚") @@ -117,7 +118,7 @@ private Date productionSupportSignatureTime; /**鐢熶骇淇濋殰閮ㄩ瀵肩瀛楄В缁撴灉*/ @ApiModelProperty(value = "鐢熶骇淇濋殰閮ㄩ瀵肩瀛楄В缁撴灉") - @Dict(dicCode = "approved_rejected") + @Dict(dicCode = "approve_reject") private String productionSupportSignatureResult; /**鐢熶骇淇濋殰閮ㄩ瀵兼剰瑙�*/ @ApiModelProperty(value = "鐢熶骇淇濋殰閮ㄩ瀵兼剰瑙�") diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/job/InspectionOrderGenerateJob.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/job/InspectionOrderGenerateJob.java index b2f9d57..631bf9a 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/job/InspectionOrderGenerateJob.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/job/InspectionOrderGenerateJob.java @@ -8,7 +8,6 @@ import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; import org.jeecg.modules.eam.entity.EamInspectionOrder; -import org.jeecg.modules.eam.entity.EamInspectionOrderDetail; import org.jeecg.modules.eam.entity.EamMaintenanceStandard; import org.jeecg.modules.eam.entity.EamMaintenanceStandardDetail; import org.jeecg.modules.eam.request.EamInspectionOrderRequest; diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamThirdMaintenanceChangeMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamThirdMaintenanceChangeMapper.java index 35587e9..718ee26 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamThirdMaintenanceChangeMapper.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamThirdMaintenanceChangeMapper.java @@ -1,6 +1,11 @@ package org.jeecg.modules.eam.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; /** @@ -11,4 +16,5 @@ */ public interface EamThirdMaintenanceChangeMapper extends BaseMapper<EamThirdMaintenanceChange> { + IPage<EamThirdMaintenanceChange> queryPageList(Page<EamThirdMaintenanceChange> page, @Param(Constants.WRAPPER) QueryWrapper<EamThirdMaintenanceChange> queryWrapper); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceChangeMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceChangeMapper.xml index 5da01a2..5d97e01 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceChangeMapper.xml +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceChangeMapper.xml @@ -2,4 +2,16 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.jeecg.modules.eam.mapper.EamThirdMaintenanceChangeMapper"> + <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceChange"> + SELECT + tmc.*, + e.equipment_code, + e.equipment_name, + e.equipment_model + FROM + eam_third_maintenance_change tmc + INNER JOIN eam_third_maintenance_order tmo ON tmc.order_id = tmo.id + INNER JOIN eam_equipment e ON tmo.equipment_id = e.id + ${ew.customSqlSegment} + </select> </mapper> \ No newline at end of file diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml index abcb111..e75d5da 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml @@ -3,7 +3,7 @@ <mapper namespace="org.jeecg.modules.eam.mapper.EamThirdMaintenanceOrderMapper"> <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder"> - select wmo.*, e.equipment_code, e.equipment_name + select wmo.*, e.equipment_code, e.equipment_name, e.equipment_model from eam_third_maintenance_order wmo inner join eam_equipment e on wmo.equipment_id = e.id diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeQuery.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeQuery.java new file mode 100644 index 0000000..4ab0dc7 --- /dev/null +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeQuery.java @@ -0,0 +1,28 @@ +package org.jeecg.modules.eam.request; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @Author: Lius + * @CreateTime: 2025-07-21 + * @Description: + */ +@Data +public class EamThirdMaintenanceChangeQuery { + private String equipmentId; + private String changeOrderNum; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date applyDateBegin; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date applyDateEnd; + + private String changeStatus; + private String column; + private String order; +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeRequest.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeRequest.java new file mode 100644 index 0000000..f3801bc --- /dev/null +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamThirdMaintenanceChangeRequest.java @@ -0,0 +1,81 @@ +package org.jeecg.modules.eam.request; + +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.jeecg.modules.flowable.domain.vo.FlowTaskVo; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author: Lius + * @CreateTime: 2025-07-21 + * @Description: + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "涓変繚鍙樻洿瀵硅薄", description = "涓変繚鍙樻洿") +public class EamThirdMaintenanceChangeRequest extends FlowTaskVo implements Serializable { + + private static final long serialVersionUID = 80020193253190375L; + + /** + * 涓婚敭 + */ + @ApiModelProperty(value = "涓婚敭") + private String id; + /** + * 宸ュ崟鍙� + */ + @ApiModelProperty(value = "宸ュ崟鍙�") + private String orderId; + /** + * 鐢宠绫诲瀷;鎶ュ簾銆佸欢淇� + */ + @ApiModelProperty(value = "鐢宠绫诲瀷;鎶ュ簾銆佸欢淇�") + private String applyCategory; + /** + * 寤朵繚鍘熷洜绫诲瀷;鐢熶骇浠诲姟銆佽澶囨晠闅溿�佹姤搴熴�佸ぇ淇」淇�佹惉杩� + */ + @ApiModelProperty(value = "寤朵繚鍘熷洜绫诲瀷;鐢熶骇浠诲姟銆佽澶囨晠闅溿�佹姤搴熴�佸ぇ淇」淇�佹惉杩�") + private String applyReasonType; + /** + * 寤朵繚(鍙樻洿)鍘熷洜 + */ + @ApiModelProperty(value = "寤朵繚(鍙樻洿)鍘熷洜") + private String applyReason; + /** + * 寤惰繜淇濆吇鏃ユ湡 + */ + @ApiModelProperty(value = "寤惰繜淇濆吇鏃ユ湡") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date deferredMaintenanceDate; + /**涓荤棰嗗绛惧瓧缁撴灉*/ + @ApiModelProperty(value = "涓荤棰嗗绛惧瓧缁撴灉") + private String equipmentManagerSignatureResult; + /**涓荤棰嗗鎰忚*/ + @ApiModelProperty(value = "涓荤棰嗗鎰忚") + private String equipmentManagerComment; + /**閮ㄩ棬棰嗗鎰忚*/ + @ApiModelProperty(value = "閮ㄩ棬棰嗗鎰忚") + private String departManagerComment; + /**閮ㄩ棬棰嗗绛惧瓧缁撴灉*/ + @ApiModelProperty(value = "閮ㄩ棬棰嗗绛惧瓧缁撴灉") + private String departManagerSignatureResult; + /**鐢熶骇淇濋殰閮ㄩ瀵肩瀛楃粨鏋�*/ + @ApiModelProperty(value = "鐢熶骇淇濋殰閮ㄩ瀵肩瀛楃粨鏋�") + private String productionSupportSignatureResult; + /**鐢熶骇淇濋殰閮ㄩ瀵兼剰瑙�*/ + @ApiModelProperty(value = "鐢熶骇淇濋殰閮ㄩ瀵兼剰瑙�") + private String productionSupportComment; + +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusChangeService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusChangeService.java index dd90936..15f33ba 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusChangeService.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusChangeService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.eam.entity.EamTechnicalStatusChangeDetail; import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; @@ -48,4 +49,11 @@ * @return */ EamTechnicalStatusChange approval(EamTechnicalStatusChangeRequest request); + + /** + * 楠屾敹 + * @param request + * @return + */ + boolean acceptance(EamTechnicalStatusChangeDetail request); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceChangeService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceChangeService.java index a14ddaa..a606fce 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceChangeService.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceChangeService.java @@ -1,7 +1,12 @@ package org.jeecg.modules.eam.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.common.api.vo.Result; import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; +import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeQuery; +import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeRequest; /** * @Description: 涓変繚鍙樻洿 @@ -11,4 +16,40 @@ */ public interface IEamThirdMaintenanceChangeService extends IService<EamThirdMaintenanceChange> { + /** + * 鍒嗛〉鏌ヨ + * @param page + * @param query + * @return + */ + IPage<EamThirdMaintenanceChange> queryPageList(Page<EamThirdMaintenanceChange> page, EamThirdMaintenanceChangeQuery query); + + /** + * 娣诲姞 + * @param request + * @return + */ + boolean saveThirdMaintenanceChange(EamThirdMaintenanceChange request); + + /** + * 缂栬緫 + * @param request + * @return + */ + boolean editThirdMaintenanceChange(EamThirdMaintenanceChange request); + + /** + * 鎻愪氦 寮�鍚祦绋嬪鎵� + * @param id + * @return + */ + boolean submit(String id); + + /** + * 娴佺▼瀹℃壒 + * @param request + * @return + */ + EamThirdMaintenanceChange approval(EamThirdMaintenanceChangeRequest request); + } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceOrderService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceOrderService.java index d214a27..23870f9 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceOrderService.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamThirdMaintenanceOrderService.java @@ -58,4 +58,12 @@ * @return */ Result<?> selectVoById(String id); + + /** + * 鏇存柊涓変繚宸ュ崟鐘舵�� + * @param orderId + * @param maintenanceStatus + * @return + */ + boolean updateMaintenanceStatus(String orderId, String maintenanceStatus); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java index bd393ff..fb90334 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java @@ -371,17 +371,19 @@ resultMap.put("itemCode", weekInsDetailResultResponse.getItemCode()); resultMap.put("itemName", weekInsDetailResultResponse.getItemName()); resultMap.put("itemDemand", weekInsDetailResultResponse.getItemDemand()); - // 浣跨敤AtomicInteger浣滀负璁℃暟鍣紝浠�1寮�濮� - AtomicInteger counter = new AtomicInteger(1); Map<Integer, EamWeekInsDetailResultResponse> collect = weekInsDetailResultResponseList .stream() .collect(Collectors.toMap( - // 鍒嗙粍閿細浣跨敤鑷搴忓彿锛堜粠1寮�濮嬶級 - item -> counter.getAndIncrement(), + // 鍒嗙粍閿細浣跨敤planInspectionDate瀛楁钀藉湪鏈湀鐨勫懆鏁� + item -> { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(item.getPlanInspectionDate()); + return calendar.get(Calendar.WEEK_OF_MONTH); + }, // 鍊硷細鐩存帴浣跨敤褰撳墠瀵硅薄 item -> item, - // 鍚堝苟鍑芥暟锛氬綋鍚屼竴搴忓彿鏈夊涓璞℃椂锛堢悊璁轰笂涓嶄細鍙戠敓锛夛紝濡備綍澶勭悊 - (existing, replacement) -> existing, // 鑻ユ湁閲嶅閿紝淇濈暀宸插瓨鍦ㄧ殑瀵硅薄 + // 鍚堝苟鍑芥暟锛氬綋鍚屼竴鍛ㄦ湁澶氫釜瀵硅薄鏃讹紙鏍规嵁闇�姹備笉浼氬彂鐢燂紝浣嗕粛闇�鎻愪緵锛� + (existing, replacement) -> existing, // 鎸囧畾Map鐨勫叿浣撳疄鐜帮紙鍙�夛級 LinkedHashMap::new // 淇濇寔鎻掑叆椤哄簭 )); @@ -442,12 +444,18 @@ Map<Integer, EamWeekInsDetailUserResponse> groupMap = eamWeekInsDetailUserResponseList .stream() .collect(Collectors.toMap( - // 鍒嗙粍閿細浣跨敤鑷搴忓彿锛堜粠1寮�濮嬶級 - item -> counter.getAndIncrement(), - // 鍊硷細鐩存帴浣跨敤褰撳墠瀵硅薄锛堜綔涓哄垵濮嬪�硷級 + // 鍒嗙粍閿細浣跨敤 planInspectionDate 瀛楁钀藉湪鏈湀鐨勫懆鏁� + item -> { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(item.getPlanInspectionDate()); + return calendar.get(Calendar.WEEK_OF_MONTH); + }, + // 鍊硷細鐩存帴浣跨敤褰撳墠瀵硅薄 item -> item, - // 鍚堝苟鍑芥暟锛氬綋鍚屼竴鈥滃ぉ鈥濇湁澶氫釜瀵硅薄鏃讹紝濡備綍澶勭悊锛堣繖閲岀ず渚嬪彇绗竴涓級 - (existing, replacement) -> existing // 鑻ユ湁閲嶅閿紝淇濈暀宸插瓨鍦ㄧ殑瀵硅薄 + // 鍚堝苟鍑芥暟锛氬綋鍚屼竴鍛ㄦ湁澶氫釜瀵硅薄鏃讹紙鏍规嵁闇�姹備笉浼氬彂鐢燂級 + (existing, replacement) -> existing, + // 浣跨敤 LinkedHashMap 淇濇寔鎻掑叆椤哄簭 + LinkedHashMap::new )); Map<String, Object> resultMap = new LinkedHashMap<>(); for (int i = 1; i <= 5; i++) { diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusChangeServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusChangeServiceImpl.java index 2b5aac5..6688c40 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusChangeServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusChangeServiceImpl.java @@ -15,22 +15,16 @@ import org.jeecg.common.constant.DataBaseConstant; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.TranslateDictTextUtils; import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.eam.constant.BusinessCodeConst; -import org.jeecg.modules.eam.constant.HfTemplateCategoryEnum; -import org.jeecg.modules.eam.constant.TechnicalStatusChangeOrderStatusEnum; -import org.jeecg.modules.eam.constant.TechnicalStatusEvaluationOrderChangeStatusEnum; -import org.jeecg.modules.eam.entity.EamBaseHFCode; -import org.jeecg.modules.eam.entity.EamEquipment; -import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; +import org.jeecg.modules.eam.constant.*; +import org.jeecg.modules.eam.entity.*; import org.jeecg.modules.eam.mapper.EamTechnicalStatusChangeMapper; import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; -import org.jeecg.modules.eam.service.IEamBaseHFCodeService; -import org.jeecg.modules.eam.service.IEamEquipmentService; -import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeDetailService; -import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeService; +import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderRequest; +import org.jeecg.modules.eam.service.*; 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; @@ -48,6 +42,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -83,6 +78,12 @@ private IFlowTaskService flowTaskService; @Autowired private TranslateDictTextUtils translateDictTextUtils; + @Autowired + private IEamEquipmentExtendService equipmentExtendService; + @Autowired + private IEamTechnicalStatusEvaluationStandardService evaluationStandardService; + @Autowired + private IEamTechnicalStatusEvaluationOrderService evaluationOrderService; @Override public IPage<EamTechnicalStatusChange> queryPageList(Page<EamTechnicalStatusChange> page, EamTechnicalStatusChangeQuery query) { @@ -175,6 +176,7 @@ detail.setCreateTime(null); detail.setUpdateBy(null); detail.setUpdateTime(null); + detail.setChangeOrderId(order.getId()); }); changeDetailService.saveBatch(request.getTableDetailList()); return true; @@ -211,6 +213,7 @@ detail.setCreateTime(null); detail.setUpdateBy(null); detail.setUpdateTime(null); + detail.setChangeOrderId(entity.getId()); }); changeDetailService.saveBatch(request.getTableDetailList()); return true; @@ -370,6 +373,70 @@ } @Override + @Transactional(rollbackFor = Exception.class) + public boolean acceptance(EamTechnicalStatusChangeDetail request) { + // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (user == null || StrUtil.isBlank(user.getId())) { + throw new JeecgBootException("鏈幏鍙栧埌鐧诲綍鐢ㄦ埛锛岃閲嶆柊鐧诲綍鍚庡啀璇曪紒"); + } + EamTechnicalStatusChange order = this.getBaseMapper().selectById(request.getChangeOrderId()); + if(order == null) { + throw new JeecgBootException("鍙樻洿宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + if(!TechnicalStatusChangeOrderStatusEnum.COMPLETED.name().equals(order.getChangeStatus())) { + throw new JeecgBootException("鍙樻洿宸ュ崟鏈畬鎴愶紝鏃犳硶鎻愪氦楠屾敹锛�"); + } + TechnicalStatusChangeReasonEnum instance = TechnicalStatusChangeReasonEnum.getInstance(request.getChangeCategory()); + if(instance == null) { + throw new JeecgBootException("鍙樻洿鍘熷洜鏃犳晥锛屾搷浣滃け璐ワ紒"); + } + EamEquipment equipment = equipmentService.getById(request.getEquipmentId()); + if(equipment == null) { + throw new JeecgBootException("璁惧淇℃伅涓嶅瓨鍦紝鎿嶄綔澶辫触锛�"); + } + EamEquipmentExtend extend = equipmentExtendService.getById(request.getEquipmentId()); + if(extend == null) { + throw new JeecgBootException("璁惧淇℃伅涓嶅瓨鍦紝鎿嶄綔澶辫触锛�"); + } + switch (instance) { + case EQUIPMENT_MAJOR: + case EQUIPMENT_RETROFITTING: + case OTHER: + //璁惧澶т慨銆佹敼閫犮�佸叾浠栫殑閫昏緫 + request.setAcceptanceChecker(user.getUsername()); + request.setAcceptanceCheckTime(new Date()); + changeDetailService.updateById(request); + //鏇存柊璁惧鎶�鏈壌瀹氱姸鎬� + equipmentExtendService.updateTechnologyParam(request.getEquipmentId(), request.getAcceptanceCheckResult(), DateUtils.localDateToDate(LocalDate.now()), null); + break; + case EQUIPMENT_RELOCATION: + //璁惧鎼縼閫昏緫 + request.setAcceptanceChecker(user.getUsername()); + request.setAcceptanceCheckTime(new Date()); + request.setAcceptanceCheckResult(null); + changeDetailService.updateById(request); + //鐢熸垚鎶�鏈姸鎬侀壌瀹氬伐鍗� + EamTechnicalStatusEvaluationStandard standard = evaluationStandardService.queryEnableStandard(request.getEquipmentId()); + if (standard == null) { + throw new JeecgBootException("璁惧锛歿"+equipment.getEquipmentCode()+"}锛屾湭閰嶇疆鎶�鏈姸鎬侀壌瀹氳鑼冿紝鏃犳硶鐢熸垚鎶�鏈壌瀹氬伐鍗曪紒"); + } + EamTechnicalStatusEvaluationOrderRequest orderRequest = new EamTechnicalStatusEvaluationOrderRequest(); + orderRequest.setEquipmentId(extend.getId()); + orderRequest.setStandardId(standard.getId()); + orderRequest.setEvaluationDate(DateUtils.localDateToDate(LocalDate.now())); + orderRequest.setFreezeOrderDate(null); + orderRequest.setOrderExpirationDate(null); + orderRequest.setCreationMethod(OrderCreationMethodEnum.AUTO.name()); + evaluationOrderService.addTechnicalStatusEvaluationOrder(orderRequest); + //鏇存柊鎵╁睍琛ㄤ腑鐨勭敓鎴愭爣璇� + equipmentExtendService.updateTechnologyParam(equipment.getId(), null, null, CommonConstant.STATUS_1); + break; + } + return true; + } + + @Override public void afterFlowHandle(FlowMyBusiness business) { business.getTaskNameId();//鎺ヤ笅鏉ュ鎵圭殑鑺傜偣 business.getValues();//鍓嶇浼犺繘鏉ョ殑鍙傛暟 diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateServiceImpl.java index 4a50a08..3a01942 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateServiceImpl.java @@ -175,6 +175,7 @@ detail.setCreateTime(null); detail.setUpdateBy(null); detail.setUpdateTime(null); + detail.setApplicationId(order.getId()); }); deactivateDetailService.saveBatch(request.getTableDetailList()); return true; @@ -211,6 +212,7 @@ detail.setCreateTime(null); detail.setUpdateBy(null); detail.setUpdateTime(null); + detail.setApplicationId(entity.getId()); }); deactivateDetailService.saveBatch(request.getTableDetailList()); return true; diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationApplicationServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationApplicationServiceImpl.java index 865ab2e..e87990b 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationApplicationServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationApplicationServiceImpl.java @@ -228,7 +228,7 @@ //鏇存柊瀹炰綋 this.getBaseMapper().updateById(entity); //鍚姩娴佺▼ - flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getApplicationOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(), + flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getApplicationOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode(), entity.getId(), "IEamTechnicalStatusEvaluationApplicationService", "technical_status_evaluation_apply_process", null); Map<String, Object> variables = new HashMap<>(); variables.put("dataId", entity.getId()); @@ -344,6 +344,7 @@ entity.setProductionHeaderSignatureTime(new Date()); entity.setProductionHeaderSignatureResult(request.getProductionHeaderSignatureResult()); entity.setProductionHeaderComment(request.getProductionHeaderComment()); + values.put("productionHeaderConfirmFlag", request.getProductionHeaderSignatureResult()); if(BusinessCodeConst.APPROVED.equals(request.getProductionHeaderSignatureResult())) { //閫氳繃 entity.setApplicationStatus(TechnicalStatusEvaluationApplicationStatusEnum.PRODUCTION_SUPPORT_SIGNING.name()); diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderChangeServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderChangeServiceImpl.java index ae2a5c8..f43d12d 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderChangeServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderChangeServiceImpl.java @@ -234,7 +234,7 @@ //鏇存柊瀹炰綋 this.getBaseMapper().updateById(entity); //鍚姩娴佺▼ - flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getChangeOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(), + flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getChangeOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode(), entity.getId(), "IEamTechnicalStatusEvaluationOrderChangeService", "evaluation_order_change_process", null); Map<String, Object> variables = new HashMap<>(); variables.put("dataId", entity.getId()); diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java index 4fa6923..6a9a4f7 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java @@ -252,7 +252,7 @@ this.getBaseMapper().updateById(entity); //鍚姩娴佺▼ - flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(), + flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode(), entity.getId(), "IEamTechnicalStatusEvaluationOrderService", "technical_status_evaluation_process", null); Map<String, Object> variables = new HashMap<>(); variables.put("dataId", entity.getId()); diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceChangeServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceChangeServiceImpl.java index 11c5a5e..ced2b3b 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceChangeServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceChangeServiceImpl.java @@ -1,10 +1,56 @@ 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.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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.TranslateDictTextUtils; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.eam.constant.*; +import org.jeecg.modules.eam.entity.EamBaseHFCode; +import org.jeecg.modules.eam.entity.EamEquipment; import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; +import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; import org.jeecg.modules.eam.mapper.EamThirdMaintenanceChangeMapper; +import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeQuery; +import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeRequest; +import org.jeecg.modules.eam.service.IEamBaseHFCodeService; +import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.service.IEamThirdMaintenanceChangeService; +import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderService; +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.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.ISysBusinessCodeRuleService; +import org.jeecg.modules.system.service.ISysUserService; +import org.jeecg.modules.system.vo.UserSelector; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; /** * @Description: 涓変繚鍙樻洿 @@ -15,4 +61,442 @@ @Service public class EamThirdMaintenanceChangeServiceImpl extends ServiceImpl<EamThirdMaintenanceChangeMapper, EamThirdMaintenanceChange> implements IEamThirdMaintenanceChangeService { + @Resource + private EamThirdMaintenanceChangeMapper eamThirdMaintenanceChangeMapper; + @Resource + private IBaseFactoryUserService baseFactoryUserService; + @Resource + private IBaseFactoryService baseFactoryService; + @Resource + private IEamThirdMaintenanceOrderService thirdMaintenanceOrderService; + @Resource + private IEamEquipmentService equipmentService; + @Resource + private ISysBusinessCodeRuleService businessCodeRuleService; + @Resource + private IEamBaseHFCodeService hfCodeService; + @Resource + private ISysUserService sysUserService; + @Resource + private FlowCommonService flowCommonService; + @Resource + private TranslateDictTextUtils translateDictTextUtils; + @Resource + private IFlowDefinitionService flowDefinitionService; + @Resource + private IFlowMyBusinessService flowMyBusinessService; + @Resource + private TaskService taskService; + @Resource + private IEamEquipmentService eamEquipmentService; + @Resource + private IFlowTaskService flowTaskService; + + @Override + public IPage<EamThirdMaintenanceChange> queryPageList(Page<EamThirdMaintenanceChange> page, EamThirdMaintenanceChangeQuery query) { + QueryWrapper<EamThirdMaintenanceChange> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("tmc.del_flag", CommonConstant.DEL_FLAG_0); + //鐢ㄦ埛鏁版嵁鏉冮檺 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser == null) { + return page; + } + if (StringUtils.isNotBlank(sysUser.getEquipmentIds())) { + //閫夋嫨浜嗚澶囷紝鏍规嵁璁惧id杩囨护璁惧 + List<String> equipArr = Arrays.asList(sysUser.getEquipmentIds().split(",")); + queryWrapper.in("e.equipment_code", equipArr); + } else { + //娌℃湁閫夋嫨璁惧锛屾牴鎹腑蹇冭繃婊よ澶� + List<BaseFactoryUser> baseFactoryUserList = baseFactoryUserService. + list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId, sysUser.getId())); + if (!CollectionUtils.isEmpty(baseFactoryUserList)) { + Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); + Set<String> factoryCode = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); + queryWrapper.in("e.factory_org_code", factoryCode); + } else { + return page; + } + } + //鏌ヨ鏉′欢杩囨护 + if (query != null) { + if (StringUtils.isNotBlank(query.getEquipmentId())) { + queryWrapper.eq("tmc.equipment_id", query.getEquipmentId()); + } + if (StringUtils.isNotBlank(query.getChangeOrderNum())) { + queryWrapper.like("tmc.order_num", query.getChangeOrderNum()); + } + if (StringUtils.isNotBlank(query.getChangeStatus())) { + queryWrapper.eq("tmc.change_status", query.getChangeStatus()); + } + if (query.getApplyDateBegin() != null && query.getApplyDateEnd() != null) { + queryWrapper.between("tmc.apply_date", query.getApplyDateBegin(), query.getApplyDateEnd()); + } + //鎺掑簭 + if (StringUtils.isNotBlank(query.getColumn()) && StringUtils.isNotBlank(query.getOrder())) { + String column = query.getColumn(); + if (column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) { + column = column.substring(0, column.lastIndexOf(CommonConstant.DICT_TEXT_SUFFIX)); + } + if (DataBaseConstant.SQL_ASC.equalsIgnoreCase(query.getOrder())) { + queryWrapper.orderByAsc("tmc." + oConvertUtils.camelToUnderline(column)); + } else { + queryWrapper.orderByDesc("tmc." + oConvertUtils.camelToUnderline(column)); + } + } else { + queryWrapper.orderByDesc("tmc.create_time"); + } + } else { + queryWrapper.orderByDesc("tmc.create_time"); + } + return eamThirdMaintenanceChangeMapper.queryPageList(page, queryWrapper); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveThirdMaintenanceChange(EamThirdMaintenanceChange request) { + //鏌ヨ宸ュ崟 + EamThirdMaintenanceOrder order = thirdMaintenanceOrderService.getById(request.getOrderId()); + if (order == null) { + throw new JeecgBootException("涓変繚宸ュ崟涓嶅瓨鍦紝鎿嶄綔澶辫触锛�"); + } + //鏌ヨ璁惧 + EamEquipment equipment = equipmentService.getById(order.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧淇℃伅涓嶅瓨鍦紝鎿嶄綔澶辫触锛�"); + } + //鐢ㄦ埛鏁版嵁鏉冮檺 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser == null) { + throw new JeecgBootException("鐧诲綍鐢ㄦ埛淇℃伅涓虹┖锛屾搷浣滃け璐ワ紒"); + } + String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.THIRD_MAINTENANCE_CHANGE_CODE_RULE); + request.setChangeOrderNum(codeSeq); + request.setId(null); + request.setChangeStatus(ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name()); + request.setDelFlag(CommonConstant.DEL_FLAG_0); + request.setApplicant(sysUser.getUsername()); + request.setApplyDate(new Date()); + request.setFactoryOrgCode(equipment.getFactoryOrgCode()); + // 涓変繚鍙樻洿宸ュ崟HF + EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.THIRD_MAINTENANCE_CHANGE.name()); + if (eamBaseHFCode == null) { + throw new JeecgBootException("鏈厤缃妧鏈姸鎬侀壌瀹氬彉鏇寸殑HF缂栫爜锛屾坊鍔犲け璐ワ紒"); + } + request.setHfCode(eamBaseHFCode.getHfCode()); + this.getBaseMapper().insert(request); + boolean b = thirdMaintenanceOrderService.updateMaintenanceStatus(request.getOrderId(), ThirdMaintenanceStatusEnum.CHANGE.name()); + if (!b) { + throw new JeecgBootException("涓変繚宸ュ崟鐘舵�佸彉鏇村け璐ワ紝鏃犳硶鍙樻洿锛�"); + } + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean editThirdMaintenanceChange(EamThirdMaintenanceChange request) { + EamThirdMaintenanceChange entity = this.getBaseMapper().selectById(request); + if(entity == null) { + throw new JeecgBootException("缂栬緫鐨勬暟鎹凡鍒犻櫎锛岃鍒锋柊閲嶈瘯锛�"); + } + if(!ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name().equals(entity.getChangeStatus())) { + throw new JeecgBootException("鍙湁寰呮彁浜ょ姸鎬佹墠鍙紪杈戯紒"); + } + entity.setApplyReasonType(request.getApplyReasonType()); + entity.setApplyReason(request.getApplyReason()); + this.getBaseMapper().updateById(entity); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(String id) { + EamThirdMaintenanceChange entity = this.getBaseMapper().selectById(id); + if (entity == null) { + throw new JeecgBootException("瑕佹彁浜ょ殑宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + if (!ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name().equals(entity.getChangeStatus())) { + throw new JeecgBootException("璇ュ伐鍗曞凡杩涜杩囨彁浜わ紒"); + } + EamThirdMaintenanceOrder order = thirdMaintenanceOrderService.getById(entity.getOrderId()); + if(order == null) { + throw new JeecgBootException("瑕佸彉鏇寸殑涓変繚宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + EamEquipment equipment = equipmentService.getById(order.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧涓嶅瓨鍦紝鎻愪氦澶辫触锛�"); + } + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if(sysUser == null || !sysUser.getUsername().equals(entity.getApplicant())) { + throw new JeecgBootException("涓嶆槸鏈汉锛屼笉鑳芥彁浜ゆ宸ュ崟锛�"); + } + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.EQUIPMENT_MANAGER_SIGNING.name()); + //鏌ヨ涓嬬骇瀹℃壒浜哄憳 + List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0011); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗锛屾棤娉曟彁浜わ紒"); + } + List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); + //鏇存柊瀹炰綋 + this.getBaseMapper().updateById(entity); + //鍚姩娴佺▼ + flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getChangeOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode(), + entity.getId(), "IEamThirdMaintenanceChangeService", "third_maintenance_change", null); + Map<String, Object> variables = new HashMap<>(); + variables.put("dataId", entity.getId()); + String applyReasonTypeText = translateDictTextUtils.translateField("applyReasonType", entity.getApplyReasonType(), "third_maintenance_change_reason"); + if (StrUtil.isEmpty(applyReasonTypeText)) { + variables.put("organization", "鏂板涓変繚宸ュ崟鍙樻洿榛樿鍚姩娴佺▼"); + variables.put("comment", "鏂板涓変繚宸ュ崟鍙樻洿榛樿鍚姩娴佺▼"); + } else { + variables.put("organization", applyReasonTypeText); + variables.put("comment", applyReasonTypeText); + } + variables.put("proofreading", true); + variables.put("NextAssignee", userApprovalList); + Result<?> result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_change", variables); + if(result == null || !result.isSuccess()) { + throw new JeecgBootException("鍚姩娴佺▼澶辫触锛�"); + } + //鏇存柊宸ュ崟鐘舵�佷负鍙樻洿涓� + order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.CHANGE.name()); + boolean b = thirdMaintenanceOrderService.updateById(order); + if(!b) { + throw new JeecgBootException("涓変繚宸ュ崟鐘舵�佹洿鏂板け璐ワ紒"); + } + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public EamThirdMaintenanceChange approval(EamThirdMaintenanceChangeRequest request) { + EamThirdMaintenanceChange entity = this.getBaseMapper().selectById(request.getId()); + if (entity == null) { + throw new JeecgBootException("瀹℃壒鐨勬暟鎹凡鍒犻櫎锛岃鍒锋柊閲嶈瘯锛�"); + } + EamThirdMaintenanceOrder order = thirdMaintenanceOrderService.getById(entity.getOrderId()); + if(order == null) { + throw new JeecgBootException("瑕佸彉鏇寸殑涓変繚宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (user == null || StrUtil.isBlank(user.getId())) { + throw new JeecgBootException("鏈幏鍙栧埌鐧诲綍鐢ㄦ埛锛岃閲嶆柊鐧诲綍鍚庡啀璇曪紒"); + } + request.setAssignee(user.getUsername()); + // 鑾峰彇娴佺▼涓氬姟璁板綍 + FlowMyBusiness flowMyBusiness = flowMyBusinessService.getFlowMyBusiness(request.getInstanceId(), request.getTaskId()); + if (flowMyBusiness == null) { + throw new JeecgBootException("娴佺▼瀹炰緥涓嶅瓨鍦紝璇峰埛鏂板悗閲嶈瘯锛�"); + } + + if (!isUserAuthorized(flowMyBusiness, user)) { + throw new JeecgBootException("鐢ㄦ埛鏃犳潈鎿嶄綔姝や换鍔★紝璇峰埛鏂板悗閲嶈瘯锛�"); + } + // 璁ら浠诲姟 + if (!claimTask(flowMyBusiness.getTaskId(), user)) { + throw new JeecgBootException("浠诲姟涓嶅瓨鍦ㄣ�佸凡瀹屾垚鎴栧凡琚粬浜鸿棰嗭紒"); + } + EamEquipment equipment = eamEquipmentService.getById(order.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧涓嶅瓨鍦紝璇锋鏌ワ紒"); + } + + // 璁剧疆娴佺▼鍙橀噺 + setupProcessVariables(request, entity, user, equipment); + + // 瀹屾垚娴佺▼浠诲姟 + Result result = flowTaskService.complete(request); + + // 鏍规嵁浠诲姟瀹屾垚缁撴灉鏇存柊宸ュ崟鐘舵�� + updateOrderStatus(result, request, entity, order, user); + + //鏇存柊宸ュ崟淇℃伅 + this.getBaseMapper().updateById(entity); + return entity; + } + + /** + * 璁剧疆娴佺▼鍙橀噺 + */ + private void setupProcessVariables(EamThirdMaintenanceChangeRequest request, EamThirdMaintenanceChange entity, LoginUser user, EamEquipment equipment) { + //娴佺▼鍙橀噺 + Map<String, Object> values = new HashMap<>(); + List<String> userApprovalList; + List<UserSelector> userSelectors; + ThirdMaintenanceChangeStatusEnum status = ThirdMaintenanceChangeStatusEnum.getInstance(entity.getChangeStatus()); + switch (status) { + case EQUIPMENT_MANAGER_SIGNING: + // 浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗瀹℃牳 + values.put("dataId", entity.getId()); + if(StringUtils.isBlank(request.getEquipmentManagerComment())) { + values.put("organization", "涓変繚宸ュ崟鍙樻洿浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗"); + values.put("comment", "涓変繚宸ュ崟鍙樻洿浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗"); + request.setComment("涓変繚宸ュ崟鍙樻洿閮ㄩ棬棰嗗瀹℃牳"); + } else { + values.put("organization", request.getEquipmentManagerComment()); + values.put("comment", request.getEquipmentManagerComment()); + request.setComment(request.getEquipmentManagerComment()); + } + if (BusinessCodeConst.APPROVED.equals(request.getEquipmentManagerSignatureResult())) { + values.put("confirmation", request.getEquipmentManagerSignatureResult()); + ThirdMaintenanceChangeReasonEnum applyReasonType = ThirdMaintenanceChangeReasonEnum.getInstance(request.getApplyReasonType()); + switch (applyReasonType) { + case PRODUCTION_WORK_ORDER_EXPEDITED: + //鐢熶骇浠诲姟 + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0012); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰鐢熶骇鎸囨尌閮ㄥ绾ч瀵硷紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�"); + } + break; + case EQUIPMENT_BREAKDOWN_REPAIR: + //璁惧鏁呴殰 + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0013); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰缁翠慨鍖洪暱锛屾棤娉曡繘鍏ヤ笅绾у鎵癸紒"); + } + break; + case EQUIPMENT_SCRAPPED: + //璁惧鎶ュ簾 + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0014); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰璧勪骇绠$悊閮紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�"); + } + break; + case EQUIPMENT_MAJOR: + //璁惧澶т慨銆侀」淇� + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0016); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰杩愮淮鍟嗗姟瀹や富浠伙紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�"); + } + break; + case EQUIPMENT_RETROFITTING: + //璁惧鎼縼銆佹敼閫� + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0015); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰椤圭洰涓荤閮紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�"); + } + break; + default: + throw new JeecgBootException("鍙樻洿鐢宠鍘熷洜鏃犳硶璇嗗埆锛屽鎵瑰け璐ワ紒"); + } + userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); + values.put("NextAssignee", userApprovalList); + } else { + values.put("confirmation", request.getEquipmentManagerSignatureResult()); + } + break; + case DEPART_MANAGER_SIGNING: + //閮ㄩ棬棰嗗瀹℃牳 + values.put("confirmation", request.getDepartManagerSignatureResult()); + values.put("dataId", entity.getId()); + if(StringUtils.isBlank(request.getDepartManagerComment())) { + values.put("organization", "涓変繚宸ュ崟鍙樻洿閮ㄩ棬棰嗗瀹℃牳"); + values.put("comment", "涓変繚宸ュ崟鍙樻洿閮ㄩ棬棰嗗瀹℃牳"); + request.setComment("涓変繚宸ュ崟鍙樻洿閮ㄩ棬棰嗗瀹℃牳"); + } else { + values.put("organization", request.getDepartManagerComment()); + values.put("comment", request.getDepartManagerComment()); + request.setComment(request.getDepartManagerComment()); + } + if (BusinessCodeConst.APPROVED.equals(request.getDepartManagerSignatureResult())) { + // 鑾峰彇涓嬩竴姝ユ墽琛屼汉 + userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0017); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰杩愮淮绠$悊瀹ゅ涓讳换锛屾棤娉曡繘鍏ヤ笅绾у鎵癸紒"); + } + userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); + values.put("NextAssignee", userApprovalList); + + } else { + values.put("confirmation", request.getDepartManagerSignatureResult()); + } + break; + case PRODUCTION_SUPPORT_SIGNING: + // 缁翠慨瀹や富浠荤瀛� + values.put("dataId", entity.getId()); + if(StringUtils.isBlank(request.getDepartManagerComment())) { + values.put("organization", "涓変繚宸ュ崟鍙樻洿鐢熶骇淇濋殰閮ㄥ鏍�"); + values.put("comment", "涓変繚宸ュ崟鍙樻洿鐢熶骇淇濋殰閮ㄥ鏍�"); + request.setComment("涓変繚宸ュ崟鍙樻洿鐢熶骇淇濋殰閮ㄥ鏍�"); + } else { + values.put("organization", request.getProductionSupportComment()); + values.put("comment", request.getProductionSupportComment()); + request.setComment(request.getProductionSupportComment()); + } + break; + } + request.setValues(values); + } + + /** + * 鏇存柊宸ュ崟鐘舵�� + */ + private void updateOrderStatus(Result result, EamThirdMaintenanceChangeRequest request, EamThirdMaintenanceChange entity, EamThirdMaintenanceOrder order, LoginUser user) { + if (result.isSuccess()) { + ThirdMaintenanceChangeStatusEnum status = ThirdMaintenanceChangeStatusEnum.getInstance(entity.getChangeStatus()); + switch (status) { + case EQUIPMENT_MANAGER_SIGNING: + // 璁剧疆entity + entity.setEquipmentManagerSignature(user.getUsername()); + entity.setEquipmentManagerSignatureTime(new Date()); + entity.setEquipmentManagerComment(request.getEquipmentManagerComment()); + entity.setEquipmentManagerSignatureResult(request.getEquipmentManagerSignatureResult()); + if(BusinessCodeConst.APPROVED.equals(request.getEquipmentManagerSignatureResult())) { + //閫氳繃 + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.DEPART_MANAGER_SIGNING.name()); + } else { + //椹冲洖 + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.REJECTED.name()); + } + break; + case DEPART_MANAGER_SIGNING: + entity.setDepartManagerSignature(user.getUsername()); + entity.setDepartManagerSignatureTime(new Date()); + entity.setDepartManagerComment(request.getDepartManagerComment()); + entity.setDepartManagerSignatureResult(request.getDepartManagerSignatureResult()); + if(BusinessCodeConst.APPROVED.equals(request.getDepartManagerSignatureResult())) { + // 閫氳繃 + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.PRODUCTION_SUPPORT_SIGNING.name()); + } else { + //椹冲洖 + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.REJECTED.name()); + } + break; + case PRODUCTION_SUPPORT_SIGNING: + entity.setProductionSupportSignature(user.getUsername()); + entity.setProductionSupportSignatureTime(new Date()); + entity.setProductionSupportSignatureResult(request.getProductionSupportSignatureResult()); + entity.setProductionSupportComment(request.getProductionSupportComment()); + if(BusinessCodeConst.APPROVED.equals(request.getProductionSupportSignatureResult())) { + //閫氳繃 + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.COMPLETED.name()); + order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_MAINTENANCE.name()); + order.setMaintenanceDate(entity.getDeferredMaintenanceDate()); + thirdMaintenanceOrderService.updateById(order); + }else { + //椹冲洖 + entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.REJECTED.name()); + } + break; + } + } + } + + private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) { + List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); + return todoUsers != null && todoUsers.contains(user.getUsername()); + } + + 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; + } + } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java index 18c3350..ef15217 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java @@ -5,6 +5,7 @@ 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.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -22,12 +23,8 @@ import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; import org.jeecg.modules.eam.constant.*; -import org.jeecg.modules.eam.entity.EamBaseHFCode; -import org.jeecg.modules.eam.entity.EamEquipment; -import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; -import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrderDetail; +import org.jeecg.modules.eam.entity.*; import org.jeecg.modules.eam.mapper.EamThirdMaintenanceOrderMapper; -import org.jeecg.modules.eam.request.EamInspectionOrderRequest; import org.jeecg.modules.eam.request.EamThirdMaintenanceQuery; import org.jeecg.modules.eam.request.EamThirdMaintenanceRequest; import org.jeecg.modules.eam.service.*; @@ -360,6 +357,18 @@ return Result.ok(eamThirdMaintenanceRequestList); } + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateMaintenanceStatus(String orderId, String maintenanceStatus) { + LambdaUpdateWrapper<EamThirdMaintenanceOrder> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(EamThirdMaintenanceOrder::getId, orderId); + updateWrapper.set(EamThirdMaintenanceOrder::getMaintenanceStatus, maintenanceStatus); + updateWrapper.eq(EamThirdMaintenanceOrder::getDelFlag, CommonConstant.DEL_FLAG_0); + updateWrapper.in(EamThirdMaintenanceOrder::getMaintenanceStatus, Arrays.asList(ThirdMaintenanceStatusEnum.WAIT_MAINTENANCE.name(), ThirdMaintenanceStatusEnum.FREEZE.name())); + int update = this.getBaseMapper().update(null, updateWrapper); + return update > 0; + } + /** * 璁剧疆娴佺▼鍙橀噺 */ -- Gitblit v1.9.3