From 7d2ae4c2fd8d45f0896b9accf84ff4177638fbcd Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 17 七月 2025 20:38:01 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java | 1 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusChangeController.java | 6 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivateDetail.java | 20 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateServiceImpl.java | 383 +++++++++++++++++++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateDetailServiceImpl.java | 19 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamTechnicalStatusDeactivateDetailMapper.xml | 9 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateService.java | 39 + db/430设备管理数据库设计.pdma.json | 122 ++++- 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 | 251 ++++++------ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateQuery.java | 23 + lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/TechnicalStatusDeactivateStatusEnum.java | 21 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateDetailController.java | 149 +------ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateRequest.java | 43 ++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateDetailService.java | 13 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivate.java | 32 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamTechnicalStatusDeactivateDetailMapper.java | 8 17 files changed, 842 insertions(+), 299 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 621ea76..5e5694b 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.4", + "version": "4.9.2", "createdTime": "2025-3-10 16:38:19", - "updatedTime": "2025-7-17 16:59:40", + "updatedTime": "2025-7-17 19:49:48", "dbConns": [], "profile": { "default": { @@ -13631,7 +13631,9 @@ "attr8": "", "attr9": "", "id": "1CC43FB0-98B8-4000-91A3-E077BD7EA4E8", - "baseType": "" + "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098", + "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", + "type": "" } ], "correlations": [], @@ -13992,7 +13994,9 @@ "attr8": "", "attr9": "", "id": "5B168FA5-7457-48C0-BD48-0D892AE5EBAF", - "baseType": "" + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", + "type": "" }, { "defKey": "training_user_time", @@ -14018,7 +14022,9 @@ "attr8": "", "attr9": "", "id": "6AE68254-FA3D-4CBE-94B4-1A13BDC7DE19", - "baseType": "" + "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098", + "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", + "type": "" }, { "defKey": "report_id", @@ -31111,7 +31117,7 @@ "scale": "", "primaryKey": false, "notNull": false, - "autoIncrement": true, + "autoIncrement": false, "defaultValue": "", "hideInGraph": true, "refDict": "", @@ -31334,7 +31340,25 @@ "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" }, { - "defKey": "depart_header_signature_comment", + "defKey": "depart_header_signature_result", + "defName": "浣跨敤鍗曚綅瀹や富绠$瀛楃粨鏋�", + "comment": "", + "type": "", + "len": "", + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", + "id": "491BB748-36C9-4CD5-8FA5-5C7AA60327B2" + }, + { + "defKey": "depart_header_comment", "defName": "浣跨敤鍗曚綅瀹や富绠℃剰瑙�", "comment": "", "type": "", @@ -31418,8 +31442,26 @@ "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" }, { - "defKey": "depart_leader_signature_comment", - "defName": "浣跨敤鍗曚綅閮ㄤ富绠$瀛�", + "defKey": "depart_leader_signature_result", + "defName": "浣跨敤鍗曚綅閮ㄤ富绠$瀛楃粨鏋�", + "comment": "", + "type": "", + "len": "", + "scale": "", + "primaryKey": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "", + "hideInGraph": false, + "refDict": "", + "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", + "extProps": {}, + "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", + "id": "577D41D0-1925-4629-A179-E3F0BB23E3F7" + }, + { + "defKey": "depart_leader_comment", + "defName": "浣跨敤鍗曚綅閮ㄤ富绠℃剰瑙�", "comment": "", "type": "", "len": "", @@ -31472,6 +31514,24 @@ "attr9": "", "id": "403E2E22-E3B6-4385-8438-50D2548E2766", "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": "26D9A490-CD27-4C33-893B-962EA8DFCF2F" } ], "correlations": [], @@ -31719,6 +31779,24 @@ "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" }, { + "defKey": "application_id", + "defName": "鐢宠鍗旾D", + "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": "BF662050-3C75-4F7A-8784-6C0E0DBEC5DD" + }, + { "defKey": "equipment_id", "defName": "璁惧ID", "comment": "", @@ -31756,26 +31834,8 @@ }, { "defKey": "deactivate_duration", - "defName": "鍋滅敤鏃堕暱", + "defName": "宸插仠鐢ㄦ椂闀�", "comment": "", - "type": "", - "len": "", - "scale": "", - "primaryKey": false, - "notNull": false, - "autoIncrement": false, - "defaultValue": "", - "hideInGraph": false, - "refDict": "", - "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E", - "extProps": {}, - "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", - "id": "2E37AD51-B4B4-4122-99D5-8552F099EF2A" - }, - { - "defKey": "deactivate_duration_unit", - "defName": "鍋滅敤鏃堕暱鍗曚綅", - "comment": "澶┿�佹湀銆佸勾", "type": "", "len": "", "scale": "", @@ -31787,8 +31847,8 @@ "refDict": "", "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", "extProps": {}, - "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", - "id": "583D0E63-78AF-46F4-BD7A-4224161872CF" + "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", + "id": "2E37AD51-B4B4-4122-99D5-8552F099EF2A" } ], "correlations": [], @@ -33156,4 +33216,4 @@ "enable": true } ] -} \ No newline at end of file +} 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 7c792bc..9627596 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 @@ -37,6 +37,8 @@ String TECHNICAL_STATUS_CHANGE_CODE_RULE = "TechnicalStatusChangeCodeRule"; //鎶�鏈姸鎬佸彉鏇寸紪鐮佽鍒� String TECHNICAL_STATUS_EVALUATION_APPLY_CODE_RULE = "TechnicalStatusEvaluationApplyCodeRule"; + //鍋滅敤鍔犲伐璁惧鐢宠缂栫爜瑙勫垯 + String TECHNICAL_STATUS_DEACTIVATE_CODE_RULE = "TechnicalStatusDeactivateCodeRule"; /** * 澶囦欢璇疯喘鍗曠姸鎬� 1:宸插垱寤� 2:宸叉彁浜� 3:宸查�氳繃 4:宸查┏鍥� 5:宸插畬鎴� */ 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 f0b00e2..2870124 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 @@ -12,5 +12,6 @@ TECHNICAL_STATUS_EVALUATION_ORDER_CHANGE, //鎶�鏈姸鎬侀壌瀹氬伐鍗曞彉鏇� TECHNICAL_STATUS_CHANGE, //鎶�鏈姸鎬佸彉鏇寸敵璇� TECHNICAL_STATUS_EVALUATION_APPLY, //鎶�鏈姸鎬侀壌瀹氱敵璇� + TECHNICAL_STATUS_DEACTIVATE, //鍋滅敤鍔犲伐璁惧鐢宠鍗� ; } diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/TechnicalStatusDeactivateStatusEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/TechnicalStatusDeactivateStatusEnum.java new file mode 100644 index 0000000..42ee704 --- /dev/null +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/TechnicalStatusDeactivateStatusEnum.java @@ -0,0 +1,21 @@ +package org.jeecg.modules.eam.constant; + +public enum TechnicalStatusDeactivateStatusEnum { + WAIT_SUBMIT, //寰呮彁浜� + DEPART_HEADER_SIGNING, //浣跨敤鍗曚綅瀹ょ骇涓荤绛惧瓧涓� + DEPART_LEADER_SIGNING, //浣跨敤鍗曚綅閮ㄧ骇涓荤绛惧瓧涓� + ABOLISH, //宸蹭綔搴� + REJECTED, //宸查┏鍥� + COMPLETED, //宸插畬鎴� + ; + + public static TechnicalStatusDeactivateStatusEnum getInstance(String code) { + TechnicalStatusDeactivateStatusEnum[] values = TechnicalStatusDeactivateStatusEnum.values(); + for (TechnicalStatusDeactivateStatusEnum value : values) { + if (value.name().equals(code)) { + return value; + } + } + return null; + } +} 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 81dc19e..5e63993 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 @@ -19,8 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; - /** * @Description: 鎶�鏈姸鎬佸彉鏇寸敵璇� * @Author: jeecg-boot @@ -41,15 +39,13 @@ * @param query * @param pageNo * @param pageSize - * @param req * @return */ @ApiOperation(value="鎶�鏈姸鎬佸彉鏇寸敵璇�-鍒嗛〉鍒楄〃鏌ヨ", notes="鎶�鏈姸鎬佸彉鏇寸敵璇�-鍒嗛〉鍒楄〃鏌ヨ") @GetMapping(value = "/list") public Result<?> queryPageList(EamTechnicalStatusChangeQuery query, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { Page<EamTechnicalStatusChange> page = new Page<EamTechnicalStatusChange>(pageNo, pageSize); IPage<EamTechnicalStatusChange> pageList = eamTechnicalStatusChangeService.queryPageList(page, query); return Result.OK(pageList); 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 f39d463..397bab3 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 @@ -1,6 +1,7 @@ package org.jeecg.modules.eam.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; @@ -9,143 +10,145 @@ 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.modules.eam.constant.TechnicalStatusDeactivateStatusEnum; import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivate; +import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateQuery; +import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateRequest; import org.jeecg.modules.eam.service.IEamTechnicalStatusDeactivateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; - - /** +/** * @Description: 鍋滅敤鍔犲伐璁惧鐢宠鍗� * @Author: jeecg-boot - * @Date: 2025-07-09 + * @Date: 2025-07-09 * @Version: V1.0 */ @Slf4j -@Api(tags="鍋滅敤鍔犲伐璁惧鐢宠鍗�") +@Api(tags = "鍋滅敤鍔犲伐璁惧鐢宠鍗�") @RestController @RequestMapping("/eam/eamTechnicalStatusDeactivate") public class EamTechnicalStatusDeactivateController extends JeecgController<EamTechnicalStatusDeactivate, IEamTechnicalStatusDeactivateService> { - @Autowired - private IEamTechnicalStatusDeactivateService eamTechnicalStatusDeactivateService; - - /** - * 鍒嗛〉鍒楄〃鏌ヨ - * - * @param eamTechnicalStatusDeactivate - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗�-鍒嗛〉鍒楄〃鏌ヨ", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗�-鍒嗛〉鍒楄〃鏌ヨ") - @GetMapping(value = "/list") - public Result<?> queryPageList(EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper<EamTechnicalStatusDeactivate> queryWrapper = QueryGenerator.initQueryWrapper(eamTechnicalStatusDeactivate, req.getParameterMap()); - Page<EamTechnicalStatusDeactivate> page = new Page<EamTechnicalStatusDeactivate>(pageNo, pageSize); - IPage<EamTechnicalStatusDeactivate> pageList = eamTechnicalStatusDeactivateService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 娣诲姞 - * - * @param eamTechnicalStatusDeactivate - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-娣诲姞") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗�-娣诲姞", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗�-娣诲姞") - @PostMapping(value = "/add") - public Result<?> add(@RequestBody EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate) { - eamTechnicalStatusDeactivateService.save(eamTechnicalStatusDeactivate); - return Result.OK("娣诲姞鎴愬姛锛�"); - } - - /** - * 缂栬緫 - * - * @param eamTechnicalStatusDeactivate - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-缂栬緫") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗�-缂栬緫", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗�-缂栬緫") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result<?> edit(@RequestBody EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate) { - eamTechnicalStatusDeactivateService.updateById(eamTechnicalStatusDeactivate); - return Result.OK("缂栬緫鎴愬姛!"); - } - - /** - * 閫氳繃id鍒犻櫎 - * - * @param id - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鍒犻櫎") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鍒犻櫎", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鍒犻櫎") - @DeleteMapping(value = "/delete") - public Result<?> delete(@RequestParam(name="id",required=true) String id) { - eamTechnicalStatusDeactivateService.removeById(id); - return Result.OK("鍒犻櫎鎴愬姛!"); - } - - /** - * 鎵归噺鍒犻櫎 - * - * @param ids - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-鎵归噺鍒犻櫎") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗�-鎵归噺鍒犻櫎", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗�-鎵归噺鍒犻櫎") - @DeleteMapping(value = "/deleteBatch") - public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.eamTechnicalStatusDeactivateService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�"); - } - - /** - * 閫氳繃id鏌ヨ - * - * @param id - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鏌ヨ") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鏌ヨ", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鏌ヨ") - @GetMapping(value = "/queryById") - public Result<?> queryById(@RequestParam(name="id",required=true) String id) { - EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate = eamTechnicalStatusDeactivateService.getById(id); - return Result.OK(eamTechnicalStatusDeactivate); - } + @Autowired + private IEamTechnicalStatusDeactivateService eamTechnicalStatusDeactivateService; - /** - * 瀵煎嚭excel - * - * @param request - * @param eamTechnicalStatusDeactivate - */ - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate) { - return super.exportXls(request, eamTechnicalStatusDeactivate, EamTechnicalStatusDeactivate.class, "鍋滅敤鍔犲伐璁惧鐢宠鍗�"); - } + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param query + * @param pageNo + * @param pageSize + * @return + */ + @ApiOperation(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-鍒嗛〉鍒楄〃鏌ヨ", notes = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<?> queryPageList(EamTechnicalStatusDeactivateQuery query, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + Page<EamTechnicalStatusDeactivate> page = new Page<>(pageNo, pageSize); + IPage<EamTechnicalStatusDeactivate> pageList = eamTechnicalStatusDeactivateService.queryPageList(page, query); + return Result.OK(pageList); + } - /** - * 閫氳繃excel瀵煎叆鏁版嵁 - * - * @param request - * @param response - * @return - */ - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, EamTechnicalStatusDeactivate.class); - } + /** + * 娣诲姞 + * + * @param request + * @return + */ + @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-娣诲姞") + @ApiOperation(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-娣诲姞", notes = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-娣诲姞") + @PostMapping(value = "/add") + public Result<?> add(@RequestBody EamTechnicalStatusDeactivateRequest request) { + if (request == null) { + return Result.error("娣诲姞鐨勫璞′笉鑳戒负绌猴紒"); + } + if (CollectionUtil.isEmpty(request.getTableDetailList())) { + return Result.error("璁惧鏄庣粏涓嶈兘涓虹┖锛�"); + } + boolean b = eamTechnicalStatusDeactivateService.addTechnicalStatusDeactivate(request); + if (!b) { + return Result.error("娣诲姞澶辫触锛�"); + } + return Result.OK("娣诲姞鎴愬姛锛�"); + } + /** + * 缂栬緫 + * + * @param request + * @return + */ + @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-缂栬緫") + @ApiOperation(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-缂栬緫", notes = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-缂栬緫") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result<?> edit(@RequestBody EamTechnicalStatusDeactivateRequest request) { + if (request == null) { + return Result.error("缂栬緫鐨勫璞′笉鑳戒负绌猴紒"); + } + boolean b = eamTechnicalStatusDeactivateService.editTechnicalStatusDeactivate(request); + if (!b) { + return Result.error("缂栬緫澶辫触锛�"); + } + return Result.OK("缂栬緫鎴愬姛!"); + } + + @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-鎻愪氦") + @ApiOperation(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-鎻愪氦", notes = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-鎻愪氦") + @GetMapping("/submit") + public Result<?> submit(@RequestParam(name = "id") String id) { + boolean b = eamTechnicalStatusDeactivateService.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) { + EamTechnicalStatusDeactivate entity = eamTechnicalStatusDeactivateService.getById(id); + if (entity == null) { + return Result.error("瑕佷綔搴熺殑鏁版嵁涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + if (!TechnicalStatusDeactivateStatusEnum.WAIT_SUBMIT.name().equals(entity.getApplicationStatus())) { + return Result.error("璇ョ姸鎬佺殑鏁版嵁涓嶅厑璁歌繘琛屼綔搴燂紒"); + } + entity.setApplicationStatus(TechnicalStatusDeactivateStatusEnum.ABOLISH.name()); + eamTechnicalStatusDeactivateService.updateById(entity); + return Result.OK("浣滃簾鎴愬姛!"); + } + + @AutoLog(value = "鎶�鏈姸鎬佸彉鏇寸敵璇�-瀹℃壒") + @ApiOperation(value = "鎶�鏈姸鎬佸彉鏇寸敵璇�-瀹℃壒", notes = "鎶�鏈姸鎬佸彉鏇寸敵璇�-瀹℃壒") + @PostMapping("/approval") + public Result<?> approval(@RequestBody EamTechnicalStatusDeactivateRequest request) { + if (request == null) { + return Result.error("瀹℃壒鐨勫璞′笉鑳戒负绌猴紒"); + } + // 妫�鏌ヨ姹傚弬鏁� + if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) { + return Result.error("瀹℃壒浠诲姟閿欒鎴栦笉瀛樺湪锛�"); + } + EamTechnicalStatusDeactivate b = eamTechnicalStatusDeactivateService.approval(request); + if (b == null) { + return Result.error("鎿嶄綔澶辫触锛�"); + } + return Result.ok("鎿嶄綔鎴愬姛锛�"); + } + + /** + * 閫氳繃id鏌ヨ + * + * @param id + * @return + */ + @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鏌ヨ") + @ApiOperation(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鏌ヨ", notes = "鍋滅敤鍔犲伐璁惧鐢宠鍗�-閫氳繃id鏌ヨ") + @GetMapping(value = "/queryById") + public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { + EamTechnicalStatusDeactivate eamTechnicalStatusDeactivate = eamTechnicalStatusDeactivateService.getById(id); + return Result.OK(eamTechnicalStatusDeactivate); + } } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateDetailController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateDetailController.java index 13dd569..91ae811 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateDetailController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusDeactivateDetailController.java @@ -1,151 +1,46 @@ package org.jeecg.modules.eam.controller; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.modules.eam.entity.EamTechnicalStatusDeactivateDetail; import org.jeecg.modules.eam.service.IEamTechnicalStatusDeactivateDetailService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; +import java.util.List; - /** +/** * @Description: 鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁� * @Author: jeecg-boot - * @Date: 2025-07-09 + * @Date: 2025-07-09 * @Version: V1.0 */ @Slf4j -@Api(tags="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�") +@Api(tags = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�") @RestController @RequestMapping("/eam/eamTechnicalStatusDeactivateDetail") public class EamTechnicalStatusDeactivateDetailController extends JeecgController<EamTechnicalStatusDeactivateDetail, IEamTechnicalStatusDeactivateDetailService> { - @Autowired - private IEamTechnicalStatusDeactivateDetailService eamTechnicalStatusDeactivateDetailService; - - /** - * 鍒嗛〉鍒楄〃鏌ヨ - * - * @param eamTechnicalStatusDeactivateDetail - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鍒嗛〉鍒楄〃鏌ヨ", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鍒嗛〉鍒楄〃鏌ヨ") - @GetMapping(value = "/list") - public Result<?> queryPageList(EamTechnicalStatusDeactivateDetail eamTechnicalStatusDeactivateDetail, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper<EamTechnicalStatusDeactivateDetail> queryWrapper = QueryGenerator.initQueryWrapper(eamTechnicalStatusDeactivateDetail, req.getParameterMap()); - Page<EamTechnicalStatusDeactivateDetail> page = new Page<EamTechnicalStatusDeactivateDetail>(pageNo, pageSize); - IPage<EamTechnicalStatusDeactivateDetail> pageList = eamTechnicalStatusDeactivateDetailService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 娣诲姞 - * - * @param eamTechnicalStatusDeactivateDetail - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-娣诲姞") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-娣诲姞", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-娣诲姞") - @PostMapping(value = "/add") - public Result<?> add(@RequestBody EamTechnicalStatusDeactivateDetail eamTechnicalStatusDeactivateDetail) { - eamTechnicalStatusDeactivateDetailService.save(eamTechnicalStatusDeactivateDetail); - return Result.OK("娣诲姞鎴愬姛锛�"); - } - - /** - * 缂栬緫 - * - * @param eamTechnicalStatusDeactivateDetail - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-缂栬緫") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-缂栬緫", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-缂栬緫") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result<?> edit(@RequestBody EamTechnicalStatusDeactivateDetail eamTechnicalStatusDeactivateDetail) { - eamTechnicalStatusDeactivateDetailService.updateById(eamTechnicalStatusDeactivateDetail); - return Result.OK("缂栬緫鎴愬姛!"); - } - - /** - * 閫氳繃id鍒犻櫎 - * - * @param id - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-閫氳繃id鍒犻櫎") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-閫氳繃id鍒犻櫎", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-閫氳繃id鍒犻櫎") - @DeleteMapping(value = "/delete") - public Result<?> delete(@RequestParam(name="id",required=true) String id) { - eamTechnicalStatusDeactivateDetailService.removeById(id); - return Result.OK("鍒犻櫎鎴愬姛!"); - } - - /** - * 鎵归噺鍒犻櫎 - * - * @param ids - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鎵归噺鍒犻櫎") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鎵归噺鍒犻櫎", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鎵归噺鍒犻櫎") - @DeleteMapping(value = "/deleteBatch") - public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.eamTechnicalStatusDeactivateDetailService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�"); - } - - /** - * 閫氳繃id鏌ヨ - * - * @param id - * @return - */ - @AutoLog(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-閫氳繃id鏌ヨ") - @ApiOperation(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-閫氳繃id鏌ヨ", notes="鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-閫氳繃id鏌ヨ") - @GetMapping(value = "/queryById") - public Result<?> queryById(@RequestParam(name="id",required=true) String id) { - EamTechnicalStatusDeactivateDetail eamTechnicalStatusDeactivateDetail = eamTechnicalStatusDeactivateDetailService.getById(id); - return Result.OK(eamTechnicalStatusDeactivateDetail); - } + @Autowired + private IEamTechnicalStatusDeactivateDetailService deactivateDetailService; - /** - * 瀵煎嚭excel - * - * @param request - * @param eamTechnicalStatusDeactivateDetail - */ - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, EamTechnicalStatusDeactivateDetail eamTechnicalStatusDeactivateDetail) { - return super.exportXls(request, eamTechnicalStatusDeactivateDetail, EamTechnicalStatusDeactivateDetail.class, "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�"); - } + /** + * 鍒楄〃鏌ヨ + * + * @param applicationId + * @return + */ + @ApiOperation(value = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鍒楄〃鏌ヨ", notes = "鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁�-鍒楄〃鏌ヨ") + @GetMapping(value = "/queryList") + public Result<?> queryList(@RequestParam("applicationId") String applicationId) { + List<EamTechnicalStatusDeactivateDetail> list = deactivateDetailService.queryList(applicationId); + return Result.OK(list); + } - /** - * 閫氳繃excel瀵煎叆鏁版嵁 - * - * @param request - * @param response - * @return - */ - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, EamTechnicalStatusDeactivateDetail.class); - } } 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 3d25acc..7413132 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 @@ -3,11 +3,14 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +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.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -48,35 +51,56 @@ private String deactivateOrderNum; /**鐢宠浜�*/ @ApiModelProperty(value = "鐢宠浜�") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String applicant; /**鐢宠閮ㄩ棬*/ @ApiModelProperty(value = "鐢宠閮ㄩ棬") + @Dict(dictTable = "eam_base_factory", dicText = "factory_name", dicCode = "org_code") private String factoryOrgCode; /**鐢宠鏃ユ湡*/ @ApiModelProperty(value = "鐢宠鏃ユ湡") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date applyDate; /**鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚*/ @ApiModelProperty(value = "鐢宠鍗曠姸鎬�;寰呮彁浜ゃ�佸緟鍗曚綅瀹ょ骇棰嗗瀹℃牳銆佺敓浜ц澶囩鐞嗕富绠″鏍搞�佸緟淇濋殰閮ㄩ瀵煎鏍搞�佸凡浣滃簾銆佸凡瀹屾垚") private String applicationStatus; /**浣跨敤鍗曚綅瀹や富绠$瀛�*/ @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠$瀛�") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String departHeaderSignature; + /**浣跨敤鍗曚綅瀹や富绠$瀛楃粨鏋�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠$瀛楃粨鏋�") + @Dict(dicCode = "approved_rejected") + private String departHeaderSignatureResult; /**浣跨敤鍗曚綅瀹や富绠$瀛楁椂闂�*/ @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠$瀛楁椂闂�") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date departHeaderSignatureTime; /**浣跨敤鍗曚綅瀹や富绠℃剰瑙�*/ @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠℃剰瑙�") - private String departHeaderSignatureComment; + private String departHeaderComment; /**浣跨敤鍗曚綅閮ㄤ富绠$瀛�*/ @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠$瀛�") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String departLeaderSignature; + /**浣跨敤鍗曚綅閮ㄤ富绠$瀛楃粨鏋�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠$瀛楃粨鏋�") + @Dict(dicCode = "approved_rejected") + private String departLeaderSignatureResult; /**浣跨敤鍗曚綅閮ㄤ富绠$瀛楁椂闂�*/ @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠$瀛楁椂闂�") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date departLeaderSignatureTime; - /**浣跨敤鍗曚綅閮ㄤ富绠$瀛�*/ - @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠$瀛�") - private String departLeaderSignatureComment; + /**浣跨敤鍗曚綅閮ㄤ富绠℃剰瑙�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠℃剰瑙�") + private String departLeaderComment; /**HF缂栫爜*/ @ApiModelProperty(value = "HF缂栫爜") private String hfCode; + /**澶囨敞*/ + @ApiModelProperty(value = "澶囨敞") + private String remark; } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivateDetail.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivateDetail.java index c63655c..4d47d33 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivateDetail.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamTechnicalStatusDeactivateDetail.java @@ -1,6 +1,7 @@ package org.jeecg.modules.eam.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; @@ -40,6 +41,9 @@ /**鏇存柊鏃堕棿*/ @ApiModelProperty(value = "鏇存柊鏃堕棿") private Date updateTime; + /**鐢宠鍗旾D*/ + @ApiModelProperty(value = "鐢宠鍗旾D") + private String applicationId; /**璁惧ID*/ @ApiModelProperty(value = "璁惧ID") private String equipmentId; @@ -48,8 +52,16 @@ private String deactivateReason; /**鍋滅敤鏃堕暱*/ @ApiModelProperty(value = "鍋滅敤鏃堕暱") - private java.math.BigDecimal deactivateDuration; - /**鍋滅敤鏃堕暱鍗曚綅;澶┿�佹湀銆佸勾*/ - @ApiModelProperty(value = "鍋滅敤鏃堕暱鍗曚綅;澶┿�佹湀銆佸勾") - private String deactivateDurationUnit; + private String deactivateDuration; + + //鍒楄〃灞曠ず + @TableField(exist = false) + private String equipmentCode; + @TableField(exist = false) + private String equipmentName; + @TableField(exist = false) + private String equipmentModel; + @TableField(exist = false) + private String factoryName; + } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamTechnicalStatusDeactivateDetailMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamTechnicalStatusDeactivateDetailMapper.java index 8086042..f5476b7 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamTechnicalStatusDeactivateDetailMapper.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamTechnicalStatusDeactivateDetailMapper.java @@ -2,6 +2,8 @@ import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivateDetail; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -14,4 +16,10 @@ */ public interface EamTechnicalStatusDeactivateDetailMapper extends BaseMapper<EamTechnicalStatusDeactivateDetail> { + /** + * 鍒楄〃鏌ヨ + * @param queryWrapper + * @return + */ + List<EamTechnicalStatusDeactivateDetail> queryList(@Param(Constants.WRAPPER) QueryWrapper<EamTechnicalStatusDeactivateDetail> queryWrapper); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamTechnicalStatusDeactivateDetailMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamTechnicalStatusDeactivateDetailMapper.xml index 730966a..bcb210e 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamTechnicalStatusDeactivateDetailMapper.xml +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamTechnicalStatusDeactivateDetailMapper.xml @@ -2,4 +2,13 @@ <!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.EamTechnicalStatusDeactivateDetailMapper"> + <select id="queryList" resultType="org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivateDetail"> + select ems.*, e.equipment_code, e.equipment_name, e.equipment_model, f.factory_name + from dbo.eam_technical_status_deactivate_detail ems + inner join eam_equipment e + on ems.equipment_id = e.id + left join eam_base_factory f + on e.factory_org_code = f.org_code + ${ew.customSqlSegment} + </select> </mapper> \ No newline at end of file diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateQuery.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateQuery.java new file mode 100644 index 0000000..795c5d2 --- /dev/null +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateQuery.java @@ -0,0 +1,23 @@ +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; + +@Data +public class EamTechnicalStatusDeactivateQuery { + private String deactivateOrderNum; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date dateBegin; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date dateEnd; + private String applicationStatus; + private String factoryOrgCode; + + private String column; + private String order; +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateRequest.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateRequest.java new file mode 100644 index 0000000..a41f590 --- /dev/null +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamTechnicalStatusDeactivateRequest.java @@ -0,0 +1,43 @@ +package org.jeecg.modules.eam.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivateDetail; +import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; + +import java.io.Serializable; +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="鍋滅敤鍔犲伐璁惧鐢宠鍗曞鎵瑰璞�", description="鍋滅敤鍔犲伐璁惧鐢宠鍗�") +public class EamTechnicalStatusDeactivateRequest extends FlowTaskVo implements Serializable { + /**涓婚敭*/ + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鐢宠鍗曚綅*/ + @ApiModelProperty(value = "鐢宠鍗曚綅") + private String factoryOrgCode; + /**浣跨敤鍗曚綅瀹や富绠$瀛楃粨鏋�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠$瀛楃粨鏋�") + private String departHeaderSignatureResult; + /**浣跨敤鍗曚綅瀹や富绠℃剰瑙�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅瀹や富绠℃剰瑙�") + private String departHeaderComment; + /**浣跨敤鍗曚綅閮ㄤ富绠$瀛楃粨鏋�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠$瀛楃粨鏋�") + private String departLeaderSignatureResult; + /**浣跨敤鍗曚綅閮ㄤ富绠$瀛�*/ + @ApiModelProperty(value = "浣跨敤鍗曚綅閮ㄤ富绠$瀛�") + private String departLeaderComment; + /**澶囨敞*/ + @ApiModelProperty(value = "澶囨敞") + private String remark; + /**鍒楄〃 璁惧鏄庣粏*/ + @ApiModelProperty(value = "鍒楄〃 璁惧鏄庣粏") + private List<EamTechnicalStatusDeactivateDetail> tableDetailList; +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateDetailService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateDetailService.java index a55357e..7d3a7f4 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateDetailService.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateDetailService.java @@ -3,6 +3,8 @@ import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivateDetail; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁� * @Author: jeecg-boot @@ -11,4 +13,15 @@ */ public interface IEamTechnicalStatusDeactivateDetailService extends IService<EamTechnicalStatusDeactivateDetail> { + /** + * 鍒楄〃鏌ヨ + * @param applicationId + * @return + */ + List<EamTechnicalStatusDeactivateDetail> queryList(String applicationId); + /** + * 鍒犻櫎鐢宠鍗曚笅鐨勮澶囨槑缁� + * @param applicationId + */ + void removeByChangeId(String applicationId); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateService.java index ef420bd..39f0b58 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateService.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamTechnicalStatusDeactivateService.java @@ -1,7 +1,11 @@ package org.jeecg.modules.eam.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivate; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateQuery; +import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateRequest; /** * @Description: 鍋滅敤鍔犲伐璁惧鐢宠鍗� @@ -11,4 +15,39 @@ */ public interface IEamTechnicalStatusDeactivateService extends IService<EamTechnicalStatusDeactivate> { + /** + * 鍒嗛〉鏌ヨ + * @param page + * @param query + * @return + */ + IPage<EamTechnicalStatusDeactivate> queryPageList(Page<EamTechnicalStatusDeactivate> page, EamTechnicalStatusDeactivateQuery query); + + /** + * 鏂板 + * @param request + * @return + */ + boolean addTechnicalStatusDeactivate(EamTechnicalStatusDeactivateRequest request); + + /** + * 缂栬緫 + * @param request + * @return + */ + boolean editTechnicalStatusDeactivate(EamTechnicalStatusDeactivateRequest request); + + /** + * 鎻愪氦 + * @param id + * @return + */ + boolean submit(String id); + + /** + * 瀹℃壒娴佺▼ + * @param request + * @return + */ + EamTechnicalStatusDeactivate approval(EamTechnicalStatusDeactivateRequest request); } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateDetailServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateDetailServiceImpl.java index dcac698..98e15fc 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateDetailServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusDeactivateDetailServiceImpl.java @@ -1,11 +1,14 @@ package org.jeecg.modules.eam.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.modules.eam.entity.EamTechnicalStatusDeactivateDetail; import org.jeecg.modules.eam.mapper.EamTechnicalStatusDeactivateDetailMapper; import org.jeecg.modules.eam.service.IEamTechnicalStatusDeactivateDetailService; import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; /** * @Description: 鍋滅敤鍔犲伐璁惧鐢宠鍗曟槑缁� @@ -16,4 +19,18 @@ @Service public class EamTechnicalStatusDeactivateDetailServiceImpl extends ServiceImpl<EamTechnicalStatusDeactivateDetailMapper, EamTechnicalStatusDeactivateDetail> implements IEamTechnicalStatusDeactivateDetailService { + @Override + public List<EamTechnicalStatusDeactivateDetail> queryList(String applicationId) { + QueryWrapper<EamTechnicalStatusDeactivateDetail> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("ems.application_id", applicationId); + queryWrapper.orderByAsc("ems.create_time"); + return this.getBaseMapper().queryList(queryWrapper); + } + + @Override + public void removeByChangeId(String applicationId) { + LambdaQueryWrapper<EamTechnicalStatusDeactivateDetail> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(EamTechnicalStatusDeactivateDetail::getApplicationId, applicationId); + this.remove(queryWrapper); + } } 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 0aabdba..4a50a08 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 @@ -1,11 +1,55 @@ package org.jeecg.modules.eam.service.impl; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +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.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.BusinessCodeConst; +import org.jeecg.modules.eam.constant.HfTemplateCategoryEnum; +import org.jeecg.modules.eam.constant.TechnicalStatusDeactivateStatusEnum; +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.EamTechnicalStatusDeactivate; import org.jeecg.modules.eam.mapper.EamTechnicalStatusDeactivateMapper; +import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateQuery; +import org.jeecg.modules.eam.request.EamTechnicalStatusDeactivateRequest; +import org.jeecg.modules.eam.service.IEamBaseHFCodeService; +import org.jeecg.modules.eam.service.IEamEquipmentService; +import org.jeecg.modules.eam.service.IEamTechnicalStatusDeactivateDetailService; import org.jeecg.modules.eam.service.IEamTechnicalStatusDeactivateService; +import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; +import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; +import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; +import org.jeecg.modules.flowable.apithird.service.FlowCommonService; +import org.jeecg.modules.flowable.service.IFlowDefinitionService; +import org.jeecg.modules.flowable.service.IFlowTaskService; +import org.jeecg.modules.system.entity.BaseFactory; +import org.jeecg.modules.system.entity.BaseFactoryUser; +import org.jeecg.modules.system.service.IBaseFactoryService; +import org.jeecg.modules.system.service.IBaseFactoryUserService; +import org.jeecg.modules.system.service.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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.*; +import java.util.stream.Collectors; /** * @Description: 鍋滅敤鍔犲伐璁惧鐢宠鍗� @@ -13,7 +57,340 @@ * @Date: 2025-07-09 * @Version: V1.0 */ -@Service -public class EamTechnicalStatusDeactivateServiceImpl extends ServiceImpl<EamTechnicalStatusDeactivateMapper, EamTechnicalStatusDeactivate> implements IEamTechnicalStatusDeactivateService { +@Service("IEamTechnicalStatusDeactivateService") +public class EamTechnicalStatusDeactivateServiceImpl extends ServiceImpl<EamTechnicalStatusDeactivateMapper, EamTechnicalStatusDeactivate> implements IEamTechnicalStatusDeactivateService, FlowCallBackServiceI { + @Autowired + private IBaseFactoryUserService baseFactoryUserService; + @Autowired + private IBaseFactoryService baseFactoryService; + @Autowired + private ISysBusinessCodeRuleService businessCodeRuleService; + @Autowired + private IEamBaseHFCodeService hfCodeService; + @Autowired + private IEamTechnicalStatusDeactivateDetailService deactivateDetailService; + @Autowired + private IEamEquipmentService equipmentService; + @Autowired + private ISysUserService sysUserService; + @Autowired + private FlowCommonService flowCommonService; + @Autowired + private IFlowDefinitionService flowDefinitionService; + @Autowired + private IFlowMyBusinessService flowMyBusinessService; + @Autowired + private IFlowTaskService flowTaskService; + @Autowired + private TranslateDictTextUtils translateDictTextUtils; + @Override + public IPage<EamTechnicalStatusDeactivate> queryPageList(Page<EamTechnicalStatusDeactivate> page, EamTechnicalStatusDeactivateQuery query) { + QueryWrapper<EamTechnicalStatusDeactivate> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); + //鐢ㄦ埛鏁版嵁鏉冮檺 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser == null) { + return page; + } + //鏍规嵁涓績杩囨护鏁版嵁鏉冮檺 + 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> factoryCodeList = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); + queryWrapper.in("factory_org_code", factoryCodeList); + } else { + return page; + } + if (query != null) { + //缂栫爜 妯$硦鏌ヨ + if (StringUtils.isNotBlank(query.getDeactivateOrderNum())) { + queryWrapper.like("deactivate_order_num", query.getDeactivateOrderNum()); + } + //淇濆吇鍒嗙被 + if (StringUtils.isNotBlank(query.getApplicationStatus())) { + queryWrapper.eq("application_status", query.getApplicationStatus()); + } + if (query.getDateBegin() != null && query.getDateEnd() != null) { + queryWrapper.between("apply_date", query.getDateBegin(), query.getDateEnd()); + } + //鐢宠鍗曚綅 + if (StringUtils.isNotBlank(query.getFactoryOrgCode())) { + queryWrapper.eq("factory_org_code", query.getFactoryOrgCode()); + } + //鎺掑簭 + 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(oConvertUtils.camelToUnderline(column)); + } else { + queryWrapper.orderByDesc(oConvertUtils.camelToUnderline(column)); + } + } else { + queryWrapper.orderByDesc("create_time"); + } + } else { + queryWrapper.orderByDesc("create_time"); + } + return this.getBaseMapper().selectPage(page, queryWrapper); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean addTechnicalStatusDeactivate(EamTechnicalStatusDeactivateRequest request) { + //鐢ㄦ埛鏁版嵁鏉冮檺 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser == null) { + throw new JeecgBootException("鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅澶辫触锛�"); + } + EamTechnicalStatusDeactivate order = new EamTechnicalStatusDeactivate(); + order.setApplicant(sysUser.getUsername()); + order.setApplyDate(new Date()); + order.setRemark(request.getRemark()); + order.setApplicationStatus(TechnicalStatusDeactivateStatusEnum.WAIT_SUBMIT.name()); + order.setFactoryOrgCode(request.getFactoryOrgCode()); + String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.TECHNICAL_STATUS_DEACTIVATE_CODE_RULE); + order.setDeactivateOrderNum(codeSeq); + //鍒犻櫎鏍囪 + order.setDelFlag(CommonConstant.DEL_FLAG_0); + //鍋滅敤鍔犲伐璁惧鐢宠鍗� + EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.TECHNICAL_STATUS_DEACTIVATE.name()); + if (eamBaseHFCode == null) { + throw new JeecgBootException("鏈厤缃仠鐢ㄥ姞宸ヨ澶囩敵璇峰崟鐨凥F缂栫爜锛屾坊鍔犲け璐ワ紒"); + } + order.setHfCode(eamBaseHFCode.getHfCode()); + this.getBaseMapper().insert(order); + //澶勭悊鏄庣粏鏁版嵁 + request.getTableDetailList().forEach(detail -> { + EamEquipment equipment = equipmentService.getById(detail.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧[" + detail.getEquipmentCode() + "]涓嶅瓨鍦紒"); + } + detail.setId(null); + detail.setCreateBy(null); + detail.setCreateTime(null); + detail.setUpdateBy(null); + detail.setUpdateTime(null); + }); + deactivateDetailService.saveBatch(request.getTableDetailList()); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean editTechnicalStatusDeactivate(EamTechnicalStatusDeactivateRequest request) { + EamTechnicalStatusDeactivate entity = this.getBaseMapper().selectById(request.getId()); + if(entity == null) { + throw new JeecgBootException("瑕佺紪杈戠殑鏁版嵁涓嶅瓨鍦紒"); + } + if(!TechnicalStatusDeactivateStatusEnum.WAIT_SUBMIT.name().equals(entity.getApplicationStatus())) { + throw new JeecgBootException("鍙湁寰呮彁浜ょ殑鐘舵�佹墠鏀寔缂栬緫锛�"); + } + //鐢ㄦ埛鏁版嵁鏉冮檺 + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser == null) { + throw new JeecgBootException("鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅澶辫触锛�"); + } + entity.setRemark(request.getRemark()); + entity.setFactoryOrgCode(request.getFactoryOrgCode()); + this.getBaseMapper().updateById(entity); + //鍒犻櫎鍘熸潵鐨勮澶囨槑缁� + deactivateDetailService.removeByChangeId(entity.getId()); + //澶勭悊鏄庣粏鏁版嵁 + request.getTableDetailList().forEach(detail -> { + EamEquipment equipment = equipmentService.getById(detail.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧[" + detail.getEquipmentCode() + "]涓嶅瓨鍦紒"); + } + detail.setId(null); + detail.setCreateBy(null); + detail.setCreateTime(null); + detail.setUpdateBy(null); + detail.setUpdateTime(null); + }); + deactivateDetailService.saveBatch(request.getTableDetailList()); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean submit(String id) { + EamTechnicalStatusDeactivate entity = this.getBaseMapper().selectById(id); + if (entity == null) { + throw new JeecgBootException("瑕佹彁浜ょ殑宸ュ崟涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); + } + if (!TechnicalStatusDeactivateStatusEnum.WAIT_SUBMIT.name().equals(entity.getApplicationStatus())) { + throw new JeecgBootException("璇ュ伐鍗曞凡杩涜杩囨彁浜わ紒"); + } + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if(sysUser == null || !sysUser.getUsername().equals(entity.getApplicant())) { + throw new JeecgBootException("涓嶆槸鏈汉锛屼笉鑳芥彁浜ゆ宸ュ崟锛�"); + } + entity.setApplicationStatus(TechnicalStatusDeactivateStatusEnum.DEPART_HEADER_SIGNING.name()); + //鏌ヨ涓嬬骇瀹℃壒浜哄憳 + List<UserSelector> userSelectors = sysUserService.selectOperatorList(null, entity.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); + //浣跨敤鍗曚綅缈昏瘧 + String factoryName = translateDictTextUtils.translateField("factory_org_code", entity.getFactoryOrgCode(), "eam_base_factory, factory_name, org_code"); + //鍚姩娴佺▼ + flowCommonService.initActBusiness("宸ュ崟鍙�: " + entity.getDeactivateOrderNum() + ";鐢宠鍗曚綅: " + factoryName, + entity.getId(), "IEamTechnicalStatusDeactivateService", "technical_status_deactivate_process", null); + Map<String, Object> variables = new HashMap<>(); + variables.put("dataId", entity.getId()); + if (StrUtil.isEmpty(entity.getRemark())) { + variables.put("organization", "鏂板鍋滅敤鍔犲伐璁惧鐢宠榛樿鍚姩娴佺▼"); + variables.put("comment", "鏂板鍋滅敤鍔犲伐璁惧鐢宠榛樿鍚姩娴佺▼"); + } else { + variables.put("organization", entity.getRemark()); + variables.put("comment", entity.getRemark()); + } + variables.put("proofreading", true); + variables.put("NextAssignee", userApprovalList); + Result<?> result = flowDefinitionService.startProcessInstanceByKey("technical_status_deactivate_process", variables); + if(result == null || !result.isSuccess()) { + throw new JeecgBootException("鍚姩娴佺▼澶辫触锛�"); + } + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public EamTechnicalStatusDeactivate approval(EamTechnicalStatusDeactivateRequest request) { + EamTechnicalStatusDeactivate entity = this.getBaseMapper().selectById(request.getId()); + if (entity == 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("娴佺▼瀹炰緥涓嶅瓨鍦紝璇峰埛鏂板悗閲嶈瘯锛�"); + } + + boolean userAuthorized = flowMyBusinessService.isUserAuthorized(flowMyBusiness, user); + if (!userAuthorized) { + throw new JeecgBootException("鐢ㄦ埛鏃犳潈鎿嶄綔姝や换鍔★紝璇峰埛鏂板悗閲嶈瘯锛�"); + } + // 璁ら浠诲姟 + if (!flowMyBusinessService.claimTask(flowMyBusiness.getTaskId(), user)) { + throw new JeecgBootException("浠诲姟涓嶅瓨鍦ㄣ�佸凡瀹屾垚鎴栧凡琚粬浜鸿棰嗭紒"); + } + + TechnicalStatusDeactivateStatusEnum status = TechnicalStatusDeactivateStatusEnum.getInstance(entity.getApplicationStatus()); + if (status == null) { + return null; + } + //娴佺▼鍙橀噺 + Map<String, Object> values = new HashMap<>(); + List<String> userApprovalList; + List<UserSelector> userSelectors; + switch (status) { + case DEPART_HEADER_SIGNING: + userSelectors = sysUserService.selectOperatorList(null, entity.getFactoryOrgCode(), BusinessCodeConst.PCR0018); + if (CollectionUtil.isEmpty(userSelectors)) { + throw new JeecgBootException("璁惧鏈垎閰嶇粰浣跨敤鍗曚綅涓荤閮ㄧ骇棰嗗锛屾棤娉曡繘鍏ヤ笅绾у鎵癸紒"); + } + userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); + values.put("dataId", entity.getId()); + if(StringUtils.isBlank(request.getDepartHeaderComment())) { + values.put("organization", "鍋滅敤鍔犲伐璁惧鐢宠浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗"); + values.put("comment", "鍋滅敤鍔犲伐璁惧鐢宠浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗"); + request.setComment("鍋滅敤鍔犲伐璁惧鐢宠浣跨敤鍗曚綅涓荤瀹ょ骇棰嗗"); + } else { + values.put("organization", request.getDepartHeaderComment()); + values.put("comment", request.getDepartHeaderComment()); + request.setComment(request.getDepartHeaderComment()); + } + + //璁剧疆entity + entity.setDepartHeaderSignature(user.getUsername()); + entity.setDepartHeaderSignatureTime(new Date()); + entity.setDepartHeaderComment(request.getDepartHeaderComment()); + entity.setDepartHeaderSignatureResult(request.getDepartHeaderSignatureResult()); + values.put("departHeaderConfirmFlag", request.getDepartHeaderSignatureResult()); + if(BusinessCodeConst.APPROVED.equals(request.getDepartHeaderSignatureResult())) { + //閫氳繃 + entity.setApplicationStatus(TechnicalStatusDeactivateStatusEnum.DEPART_LEADER_SIGNING.name()); + values.put("NextAssignee", userApprovalList); + }else { + //椹冲洖 + entity.setApplicationStatus(TechnicalStatusDeactivateStatusEnum.REJECTED.name()); + } + break; + case DEPART_LEADER_SIGNING: + //閮ㄩ棬棰嗗瀹℃牳 + values.put("dataId", entity.getId()); + if(StringUtils.isBlank(request.getDepartLeaderComment())) { + values.put("organization", "鍋滅敤鍔犲伐璁惧鐢宠閮ㄧ骇棰嗗瀹℃牳"); + values.put("comment", "鍋滅敤鍔犲伐璁惧鐢宠閮ㄧ骇棰嗗瀹℃牳"); + request.setComment("鍋滅敤鍔犲伐璁惧鐢宠閮ㄧ骇棰嗗瀹℃牳"); + } else { + values.put("organization", request.getDepartLeaderComment()); + values.put("comment", request.getDepartLeaderComment()); + request.setComment(request.getDepartLeaderComment()); + } + //璁剧疆entity + entity.setDepartLeaderSignature(user.getUsername()); + entity.setDepartLeaderSignatureTime(new Date()); + entity.setDepartLeaderSignatureResult(request.getDepartLeaderSignatureResult()); + entity.setDepartLeaderComment(request.getDepartLeaderComment()); + if(BusinessCodeConst.APPROVED.equals(request.getDepartLeaderSignatureResult())) { + //閫氳繃 + entity.setApplicationStatus(TechnicalStatusEvaluationOrderChangeStatusEnum.COMPLETED.name()); + }else { + //椹冲洖 + entity.setApplicationStatus(TechnicalStatusEvaluationOrderChangeStatusEnum.REJECTED.name()); + } + break; + } + request.setValues(values); + + // 瀹屾垚娴佺▼浠诲姟 + Result<?> result = flowTaskService.complete(request); + if (!result.isSuccess()) { + throw new JeecgBootException("瀹℃壒澶辫触锛岃鍒锋柊鏌ョ湅锛�"); + } + //淇濆瓨宸ュ崟 + this.getBaseMapper().updateById(entity); + return entity; + } + + @Override + public void afterFlowHandle(FlowMyBusiness business) { + business.getTaskNameId();//鎺ヤ笅鏉ュ鎵圭殑鑺傜偣 + business.getValues();//鍓嶇浼犺繘鏉ョ殑鍙傛暟 + business.getActStatus(); + } + + @Override + public Object getBusinessDataById(String dataId) { + return this.getById(dataId); + } + + @Override + public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) { + return null; + } + + @Override + public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { + //涓氬姟鏄惁骞查娴佺▼锛屼笟鍔″共棰勶紝娴佺▼骞查锛屾寚瀹氫汉鍛樿繘琛屽鐞� + //鑾峰彇涓嬩竴姝ュ鐞嗕汉 + Object object = values.get("NextAssignee"); + return (List<String>) object; + } } -- Gitblit v1.9.3