| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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, "台账统计"); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 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())); |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |