hyingbo
10 小时以前 189c22920f56eccf89090197e82de8dae57c4a01
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, "台账统计");
    }
    /**
@@ -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不为空,查询所有下级产线id
            partProduction = mdcEquipmentService.findAllProductions(productionId);
            partProduction.add(productionId);
        }
        List<EquipmentSearchResult> resultList = eamEquipmentService.asyncLoadEquipmentByProduction(partProduction);
        return Result.ok(resultList);
    }
}