From 3ca99a04cff5dc72a8f1a4b4448ca592f915237f Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期六, 09 八月 2025 17:47:28 +0800 Subject: [PATCH] 生产管控 排产功能接口调整 --- src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java | 146 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 99 insertions(+), 47 deletions(-) diff --git a/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java b/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java index 13fc9dd..7b72e9e 100644 --- a/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java +++ b/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java @@ -13,10 +13,12 @@ import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.modules.base.model.FactoryIdModel; import org.jeecg.modules.mdc.entity.MdcEquipment; import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; import org.jeecg.modules.mdc.model.MdcEquipmentTree; import org.jeecg.modules.mdc.model.ProductionIdModel; +import org.jeecg.modules.mdc.service.IFactoryEquipmentService; import org.jeecg.modules.mdc.service.IMdcEquipmentDepartService; import org.jeecg.modules.mdc.service.IMdcEquipmentService; import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; @@ -55,7 +57,10 @@ private IMdcEquipmentDepartService mdcEquipmentDepartService; @Resource - private IMdcProductionEquipmentService mdcProductionEquipmentService; + private IFactoryEquipmentService factoryEquipmentService; + +// @Resource +// private IMdcProductionEquipmentService mdcProductionEquipmentService; /** * 鍒嗛〉鍒楄〃鏌ヨ @@ -203,34 +208,34 @@ return Result.OK("鎵归噺绉婚櫎鎴愬姛锛�"); } - /** - * 鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯� - */ - @AutoLog(value = "璁惧浜х嚎琛�-鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯�") - @ApiOperation(value = "璁惧浜х嚎琛�-鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯�", notes = "璁惧浜х嚎琛�-鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯�") - @PostMapping(value = "/removeEquipmentsForProduction") - public Result<?> removeEquipmentsForProduction(@RequestParam(name = "productionId", required = true) String productionId, - @RequestParam(name = "equipmentIds", required = true) String equipmentIds) { - if (StringUtils.isNotBlank(productionId) && StringUtils.isNotBlank(equipmentIds)) { - List<String> equipmentIdList = Arrays.asList(equipmentIds.split(",")); - mdcEquipmentService.removeEquipmentsForProduction(productionId, equipmentIdList); - } - return Result.OK("鎵归噺绉婚櫎鎴愬姛锛�"); - } +// /** +// * 鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯� +// */ +// @AutoLog(value = "璁惧浜х嚎琛�-鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯�") +// @ApiOperation(value = "璁惧浜х嚎琛�-鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯�", notes = "璁惧浜х嚎琛�-鎵归噺绉婚櫎浜х嚎鍜岃澶囧叧绯�") +// @PostMapping(value = "/removeEquipmentsForProduction") +// public Result<?> removeEquipmentsForProduction(@RequestParam(name = "productionId", required = true) String productionId, +// @RequestParam(name = "equipmentIds", required = true) String equipmentIds) { +// if (StringUtils.isNotBlank(productionId) && StringUtils.isNotBlank(equipmentIds)) { +// List<String> equipmentIdList = Arrays.asList(equipmentIds.split(",")); +// mdcEquipmentService.removeEquipmentsForProduction(productionId, equipmentIdList); +// } +// return Result.OK("鎵归噺绉婚櫎鎴愬姛锛�"); +// } - /** - * 绉婚櫎浜х嚎鍜岃澶囧叧绯� - */ - @AutoLog(value = "璁惧浜х嚎琛�-绉婚櫎浜х嚎鍜岃澶囧叧绯�") - @ApiOperation(value = "璁惧浜х嚎琛�-绉婚櫎浜х嚎鍜岃澶囧叧绯�", notes = "璁惧浜х嚎琛�-绉婚櫎浜х嚎鍜岃澶囧叧绯�") - @PostMapping(value = "/removeEquipmentForProduction") - public Result<?> removeEquipmentForProduction(@RequestParam(name = "productionId", required = true) String productionId, - @RequestParam(name = "equipmentId", required = true) String equipmentId) { - if (StringUtils.isNotBlank(productionId) && StringUtils.isNotBlank(equipmentId)) { - mdcEquipmentService.removeEquipmentForProduction(productionId, equipmentId); - } - return Result.OK("绉婚櫎鎴愬姛锛�"); - } +// /** +// * 绉婚櫎浜х嚎鍜岃澶囧叧绯� +// */ +// @AutoLog(value = "璁惧浜х嚎琛�-绉婚櫎浜х嚎鍜岃澶囧叧绯�") +// @ApiOperation(value = "璁惧浜х嚎琛�-绉婚櫎浜х嚎鍜岃澶囧叧绯�", notes = "璁惧浜х嚎琛�-绉婚櫎浜х嚎鍜岃澶囧叧绯�") +// @PostMapping(value = "/removeEquipmentForProduction") +// public Result<?> removeEquipmentForProduction(@RequestParam(name = "productionId", required = true) String productionId, +// @RequestParam(name = "equipmentId", required = true) String equipmentId) { +// if (StringUtils.isNotBlank(productionId) && StringUtils.isNotBlank(equipmentId)) { +// mdcEquipmentService.removeEquipmentForProduction(productionId, equipmentId); +// } +// return Result.OK("绉婚櫎鎴愬姛锛�"); +// } /** * 娣诲姞 @@ -244,7 +249,7 @@ public Result<MdcEquipment> add(@RequestBody MdcEquipment mdcEquipment) { Result<MdcEquipment> result = new Result<>(); String selectedDeparts = mdcEquipment.getSelectedDeparts(); - String selectedProduction = mdcEquipment.getSelectedProduction(); + String selectedProduction = mdcEquipment.getSelectedFactory(); mdcEquipment.setEquipmentStatus(CommonConstant.STATUS_NORMAL); try { mdcEquipmentService.saveMdcEquipment(mdcEquipment, selectedDeparts, selectedProduction); @@ -367,11 +372,11 @@ */ @AutoLog(value = "璁惧琛�-鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁") @ApiOperation(value = "璁惧琛�-鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁", notes = "璁惧琛�-鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁") - @GetMapping(value = "/equipmentProductionList") - public Result<List<ProductionIdModel>> getEquipmentProductionList(@RequestParam(name = "equipmentId", required = true) String equipmentId) { - Result<List<ProductionIdModel>> result = new Result<>(); + @GetMapping(value = "/equipmentFactoryList") + public Result<List<FactoryIdModel>> equipmentFactoryList(@RequestParam(name = "equipmentId", required = true) String equipmentId) { + Result<List<FactoryIdModel>> result = new Result<>(); try { - List<ProductionIdModel> proIdModelList = this.mdcProductionEquipmentService.queryProductionIdsOfEquipment(equipmentId); + List<FactoryIdModel> proIdModelList = this.factoryEquipmentService.queryFactoryIdsOfEquipment(equipmentId); if (proIdModelList != null && !proIdModelList.isEmpty()) { result.setSuccess(true); result.setMessage("鏌ユ壘鎴愬姛"); @@ -388,6 +393,33 @@ return result; } } + +// /** +// * 鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁 +// */ +// @AutoLog(value = "璁惧琛�-鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁") +// @ApiOperation(value = "璁惧琛�-鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁", notes = "璁惧琛�-鏌ヨ鎸囧畾璁惧鍜屼骇绾垮叧鑱旂殑鏁版嵁") +// @GetMapping(value = "/equipmentProductionList") +// public Result<List<ProductionIdModel>> getEquipmentProductionList(@RequestParam(name = "equipmentId", required = true) String equipmentId) { +// Result<List<ProductionIdModel>> result = new Result<>(); +// try { +// List<ProductionIdModel> proIdModelList = this.mdcProductionEquipmentService.queryProductionIdsOfEquipment(equipmentId); +// if (proIdModelList != null && !proIdModelList.isEmpty()) { +// result.setSuccess(true); +// result.setMessage("鏌ユ壘鎴愬姛"); +// result.setResult(proIdModelList); +// } else { +// result.setSuccess(false); +// result.setMessage("鏌ユ壘澶辫触"); +// } +// return result; +// } catch (Exception e) { +// log.error(e.getMessage(), e); +// result.setSuccess(false); +// result.setMessage("鏌ユ壘杩囩▼涓嚭鐜颁簡寮傚父: " + e.getMessage()); +// return result; +// } +// } /** * 鍔犺浇閮ㄩ棬璁惧鏍� @@ -416,6 +448,26 @@ @ApiOperation(value = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�", notes = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�") @GetMapping(value = "/queryTreeListByProduction") public Result<List<MdcEquipmentTree>> queryTreeListByProduction() { + Result<List<MdcEquipmentTree>> result = new Result<>(); + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String userId = user.getId(); + try { + List<MdcEquipmentTree> mdcEquipmentTreeList = mdcEquipmentService.loadTreeListByProduction(userId); + result.setSuccess(true); + result.setResult(mdcEquipmentTreeList); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return result; + } + + /** + * 鍔犺浇浜х嚎璁惧鏍� + */ + @AutoLog(value = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�") + @ApiOperation(value = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�", notes = "璁惧琛�-鍔犺浇浜х嚎璁惧鏍�") + @GetMapping(value = "/queryTreeListByFactory") + public Result<List<MdcEquipmentTree>> queryTreeListByFactory() { Result<List<MdcEquipmentTree>> result = new Result<>(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String userId = user.getId(); @@ -537,18 +589,18 @@ } - @AutoLog(value = "璁惧琛�-閫氳繃杞﹂棿ids鑾峰彇璁惧鏍�") - @ApiOperation(value = "璁惧琛�-閫氳繃杞﹂棿ids鑾峰彇璁惧鏍�", notes = "璁惧琛�-閫氳繃杞﹂棿ids鑾峰彇璁惧鏍�") - @GetMapping(value = "/loadTreeListByProductionIds") - public Result<?> loadTreeListByProductionIds(@RequestParam(name = "ids", required = true) String ids) { - Result<List<MdcEquipmentTree>> result = new Result<>(); - try { - List<MdcEquipmentTree> mdcEquipmentTreeList = mdcEquipmentService.loadTreeListByProductionIds(ids); - result.setSuccess(true); - result.setResult(mdcEquipmentTreeList); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return result; - } +// @AutoLog(value = "璁惧琛�-閫氳繃杞﹂棿ids鑾峰彇璁惧鏍�") +// @ApiOperation(value = "璁惧琛�-閫氳繃杞﹂棿ids鑾峰彇璁惧鏍�", notes = "璁惧琛�-閫氳繃杞﹂棿ids鑾峰彇璁惧鏍�") +// @GetMapping(value = "/loadTreeListByProductionIds") +// public Result<?> loadTreeListByProductionIds(@RequestParam(name = "ids", required = true) String ids) { +// Result<List<MdcEquipmentTree>> result = new Result<>(); +// try { +// List<MdcEquipmentTree> mdcEquipmentTreeList = mdcEquipmentService.loadTreeListByProductionIds(ids); +// result.setSuccess(true); +// result.setResult(mdcEquipmentTreeList); +// } catch (Exception e) { +// log.error(e.getMessage(), e); +// } +// return result; +// } } -- Gitblit v1.9.3