From 189c22920f56eccf89090197e82de8dae57c4a01 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期五, 12 九月 2025 17:32:08 +0800 Subject: [PATCH] 根据车间筛选设备调整 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 47 insertions(+), 4 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java index b704de3..cca786c 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java @@ -10,6 +10,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; @@ -18,6 +19,7 @@ import org.jeecg.modules.eam.entity.EamEquipment; import org.jeecg.modules.eam.entity.EamEquipmentExtend; import org.jeecg.modules.eam.request.EamEquipmentQuery; +import org.jeecg.modules.eam.dto.EquipmentCategoryStatistics; import org.jeecg.modules.eam.service.IEamEquipmentExtendService; import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.vo.EamEquipmentTree; @@ -82,6 +84,29 @@ IPage<EamEquipment> page = new Page<>(pageNo, pageSize); IPage<EamEquipment> pageList = eamEquipmentService.queryPageList(page, eamEquipment); return Result.OK(pageList); + } + + /** + * 璁惧鍙拌处-鍙拌处缁熻 + * + * @return + */ +// @AutoLog(value = "璁惧鍙拌处-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value = "璁惧鍙拌处-鍙拌处缁熻", notes = "璁惧鍙拌处-鍙拌处缁熻") + @GetMapping(value = "/queryLedgerStatistics") + public Result<?> queryLedgerStatistics() { + List<EquipmentCategoryStatistics> list = eamEquipmentService.queryLedgerStatistics(); + return Result.OK(list); + } + + /** + * 瀵煎嚭鍙拌处缁熻excel + * + * @param request + */ + @RequestMapping(value = "/exportLedgerStatisticsXls") + public ModelAndView exportLedgerStatisticsXls(HttpServletRequest request) { + return eamEquipmentService.exportLedgerStatisticsXls(request, EquipmentCategoryStatistics.class, "鍙拌处缁熻"); } /** @@ -251,10 +276,10 @@ // sb.append(String.format("璁惧缂栫爜[%s]楠屾敹涓虹┖锛屾棤娉曞鍏n\r", eamEquipment.getEquipmentCode())); // continue; // } - if (StringUtils.isBlank(eamEquipment.getTechnologyStatus())) { - sb.append(String.format("璁惧缂栫爜[%s]鎶�鏈姸鎬佷负绌猴紝鏃犳硶瀵煎叆\n\r", eamEquipment.getEquipmentCode())); - continue; - } +// if (StringUtils.isBlank(eamEquipment.getTechnologyStatus())) { +// sb.append(String.format("璁惧缂栫爜[%s]鎶�鏈姸鎬佷负绌猴紝鏃犳硶瀵煎叆\n\r", eamEquipment.getEquipmentCode())); +// continue; +// } EamEquipment one = eamEquipmentService.getOne(new LambdaQueryWrapper<EamEquipment>().eq(EamEquipment::getEquipmentCode, eamEquipment.getEquipmentCode()).eq(EamEquipment::getDelFlag, CommonConstant.DEL_FLAG_0)); if (one != null) { sb.append(String.format("璁惧缂栫爜[%s]宸插瓨鍦紝鏃犳硶閲嶅瀵煎叆\n\r", eamEquipment.getEquipmentCode())); @@ -338,4 +363,22 @@ return Result.ok(resultList); } + /** + * 鏍规嵁鐢宠杞﹂棿鏌ヨ + * @param productionId 杞﹂棿id + * @return + */ + @ApiOperation(value = "璁惧琛�-寮傛鍔犺浇璁惧鍒楄〃", notes = "璁惧琛�-寮傛鍔犺浇璁惧鍒楄〃") + @GetMapping(value = "/asyncLoadEquipmentByProduction") + public Result<?> asyncLoadEquipmentByProduction(@RequestParam(name="productionId",required = false) String productionId) { + List<String> partProduction = Lists.newArrayList(); + if (StringUtils.isNotEmpty(productionId)) { + //key涓嶄负绌猴紝鏌ヨ鎵�鏈変笅绾т骇绾縤d + partProduction = mdcEquipmentService.findAllProductions(productionId); + partProduction.add(productionId); + } + List<EquipmentSearchResult> resultList = eamEquipmentService.asyncLoadEquipmentByProduction(partProduction); + return Result.ok(resultList); + } + } -- Gitblit v1.9.3