| | |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.jcdm.common.annotation.Log; |
| | | import com.jcdm.common.core.controller.BaseController; |
| | | import com.jcdm.common.core.domain.AjaxResult; |
| | |
| | | WriteSheet sheet1 = EasyExcel.writerSheet(1, "拧紧数据") |
| | | .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .build(); |
| | | WriteSheet sheet2 = EasyExcel.writerSheet(2, "相机检测") |
| | | .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .build(); |
| | | // WriteSheet sheet2 = EasyExcel.writerSheet(2, "相机检测") |
| | | // .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | // .build(); |
| | | WriteSheet sheet3 = EasyExcel.writerSheet(3, "外漏检测") |
| | | .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .build(); |
| | |
| | | .build(); |
| | | excelWriter.write(followReportList.getMainList(),mainSheet); |
| | | excelWriter.write(followReportList.getList1(),sheet1); |
| | | excelWriter.write(followReportList.getList2(),sheet2); |
| | | // excelWriter.write(followReportList.getList2(),sheet2); |
| | | excelWriter.write(followReportList.getList3(),sheet3); |
| | | excelWriter.write(followReportList.getList4(),sheet4); |
| | | excelWriter.write(followReportList.getList5(),sheet5); |
| | |
| | | /** |
| | | * 查询下线数量 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:orderScheduling:list')") |
| | | @GetMapping("/getOffLineNum") |
| | | public TableDataInfo getOffLineNum(BsOrderScheduling bsOrderScheduling) |
| | | { |
| | |
| | | { |
| | | startPage(); |
| | | List<BsOrderScheduling> list = new ArrayList<>(); |
| | | long total = 0; |
| | | if (StringUtils.isNotEmpty(bsOrderScheduling.getOrderNo())){ |
| | | list = bsOrderSchedulingService.selectBsOrderSchedulingPage(bsOrderScheduling); |
| | | if (CollUtil.isNotEmpty(list)){ |
| | | total = new PageInfo(list).getTotal(); |
| | | List<String> allEngineNoList = list.stream().map(BsOrderScheduling::getEngineNo).collect(Collectors.toList()); |
| | | List<ProductNewPassStation> productPassStationListByEngineList = productNewPassStationService.getProductPassStationListByEngineList(allEngineNoList); |
| | | list.forEach(x -> { |
| | | if (StrUtil.isNotBlank(x.getWorkingHours())){ |
| | | x.setWorkingHoursInt(Integer.parseInt(x.getWorkingHours())); |
| | | } else { |
| | | x.setWorkingHoursInt(0); |
| | | } |
| | | if (CollUtil.isNotEmpty(productPassStationListByEngineList)){ |
| | | List<ProductNewPassStation> collect = productPassStationListByEngineList.stream().filter(y -> x.getEngineNo().equals(y.getSfcCode())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(collect)){ |
| | | ProductNewPassStation productNewPassStation = collect.get(0); |
| | | x.setBoxCode(productNewPassStation.getBoxCode()); |
| | | } |
| | | } |
| | | }); |
| | | list = list.stream().sorted(Comparator.comparing(BsOrderScheduling::getWorkingHoursInt)).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<BsOrderScheduling> collect = list.stream().filter(x -> Constants.UN_QUALIFIED.equals(x.getQualityStatus())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(collect)){ |
| | | String.valueOf(collect.size()); |
| | | } |
| | | return getDataTable(list); |
| | | // List<BsOrderScheduling> collect = list.stream().filter(x -> Constants.UN_QUALIFIED.equals(x.getQualityStatus())).collect(Collectors.toList()); |
| | | // if (CollUtil.isNotEmpty(collect)){ |
| | | // String.valueOf(collect.size()); |
| | | // } |
| | | TableDataInfo dataTable = getDataTable(list); |
| | | dataTable.setTotal(total); |
| | | return dataTable; |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (StringUtils.isEmpty(engineNo)){ |
| | | return R.fail(500,"箱体码不能为空,请重试"); |
| | | } |
| | | if (!engineNo.contains(",")){ |
| | | return R.fail(500,"箱体码格式有误,请重试"); |
| | | } |
| | | ProductNewPassStation checkStation = new ProductNewPassStation(); |
| | | checkStation.setBoxCode(engineNo); |
| | |
| | | OrderScheduling.setProductionStatus("2"); |
| | | bsOrderSchedulingService.updateBsOrderScheduling(OrderScheduling); |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail(500,"超出计划数量,请检查后重试"); |
| | | } |
| | | |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/changeBoxCode") |
| | | public R changeBoxCode(String sfcCode,String newBoxCode){ |
| | | if (StringUtils.isEmpty(newBoxCode)){ |
| | | return R.fail(500,"箱体码不能为空,请重试"); |
| | | } |
| | | if (StringUtils.isEmpty(sfcCode)){ |
| | | return R.fail(500,"发动机号不能为空,请重试"); |
| | | } |
| | | if (!newBoxCode.contains(",")){ |
| | | return R.fail(500,"箱体码格式有误,请重试"); |
| | | } |
| | | ProductNewPassStation checkStation = new ProductNewPassStation(); |
| | | checkStation.setSfcCode(sfcCode); |
| | | List<ProductNewPassStation> productPassStationList = productNewPassStationService.getProductPassStationList(checkStation); |
| | | if (CollUtil.isNotEmpty(productPassStationList)){ |
| | | productNewPassStationService.updateBoxCodeBySfcCode(sfcCode, newBoxCode); |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail("未查找到该发动机号对应的箱体"); |
| | | } |
| | | } |
| | | } |