| | |
| | | |
| | | @Override |
| | | public List<DownWorkstation> queryWorkStationIsFull() { |
| | | |
| | | //查询可以落架的玻璃信息且已绑定流程卡的工位信息 |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getEnableState, Const.SLOT_ON) |
| | | .isNotNull(DownWorkstation::getFlowCardId).ne(DownWorkstation::getFlowCardId, "")); |
| | |
| | | //可以落架的玻璃信息且已绑定流程卡的所有的工位 - 玻璃未满流程卡及层数的工位 = 已满工位 |
| | | workstationFull = list.stream().filter(item -> !flowCardIdList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | //是否需要将已满的工位置为不可落架 |
| | | if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | } |
| | | // if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | // List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | // downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | // .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | // } |
| | | } |
| | | return workstationFull; |
| | | } |
| | |
| | | log.info("打印参数:{}", downGlassInfo); |
| | | QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | queryWrapper.eq("flow_card_id", downGlassInfo.getFlowCardId()) |
| | | .eq("layer", downGlassInfo.getLayer()) |
| | | .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity") |
| | | .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id") |
| | | .orderByAsc("id"); |
| | | int printLayer = 1; |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | queryWrapper.select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity"); |
| | | queryWrapper.groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id"); |
| | | queryWrapper.eq("layer", downGlassInfo.getLayer()); |
| | | printLayer = downGlassInfo.getLayer(); |
| | | } else { |
| | | queryWrapper.select("flow_card_id", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity"); |
| | | queryWrapper.groupBy("flow_card_id", "width", "height", "filmsid", "thickness", "glass_type", "id"); |
| | | } |
| | | List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("MES落架数据:{}", resultList); |
| | | |
| | | List<Map<String, Object>> projectInfo = flowCardService.selectProject(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> projectInfo = flowCardService.selectProject(downGlassInfo.getFlowCardId(), printLayer); |
| | | log.info("流程卡头部数据:{}", projectInfo); |
| | | List<Map<String, Object>> flowCardInfo = flowCardService.selectFlowCard(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | log.info("流程卡玻璃数据:{}", flowCardInfo); |
| | | for (Map<String, Object> row : flowCardInfo) { |
| | | int order_number = (int) row.get("order_number"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | |
| | | int quantity1 = 0; |
| | | for (Map<String, Object> row1 : resultList) { |
| | | int glass_type = (int) row1.get("glass_type"); |
| | | int layer = (int) row1.get("layer"); |
| | | // String child_width = (String) row1.get("child_width"); |
| | | // Long quantity = (Long) row1.get("quantity"); |
| | | // BigDecimal total_area = (BigDecimal) row1.get("total_area"); |
| | | // String separation = (String) row1.get("separation"); |
| | | // String perimeter = (String) row1.get("perimeter"); |
| | | // BigDecimal width = (BigDecimal) row1.get("width"); |
| | | // String other_columns = (String) row1.get("other_columns"); |
| | | // String remarks = (String) row1.get("remarks"); |
| | | // BigDecimal height = (BigDecimal) row1.get("height"); |
| | | if (order_number == glass_type && technology_number == layer) { |
| | | quantity1 += 1; |
| | | // row.put("quantity", quantity); |
| | | // row.put("order_number", order_number); |
| | | // row.put("technology_number", technology_number); |
| | | // row.put("child_width", child_width); |
| | | // row.put("total_area", total_area); |
| | | // row.put("separation", separation); |
| | | // row.put("perimeter", perimeter); |
| | | // row.put("width", width); |
| | | // row.put("other_columns", other_columns); |
| | | // row.put("remarks", remarks); |
| | | // row.put("height", height); |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | int layer = (int) row1.get("layer"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | if (order_number == glass_type && technology_number == layer) { |
| | | quantity1 += 1; |
| | | } |
| | | } else { |
| | | if (order_number == glass_type) { |
| | | quantity1 += 1; |
| | | } |
| | | } |
| | | } |
| | | row.put("quantity1", quantity1); |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> downGlassLabelPrint(DownGlassInfo downGlassInfo) { |
| | | //获取下片玻璃的顺序 |
| | | // QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | // queryWrapper |
| | | // .eq("flow_card_id", downGlassInfo.getFlowCardId()) |
| | | // .eq("layer", downGlassInfo.getLayer()) |
| | | // .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity") |
| | | // .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id") |
| | | // .orderByAsc("id"); |
| | | // List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | List<Map<String, Object>> resultList = baseMapper.downGlassLabelPrint(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | log.info("MES落架数据:{}", resultList); |
| | | //获取ERP标签所需的信息 |
| | | List<Map<String, Object>> labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> labelInfo; |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | } else { |
| | | labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), 1); |
| | | } |
| | | log.info("标签数据:{}", labelInfo); |
| | | |
| | | for (Map<String, Object> row : resultList) { |
| | |
| | | for (Map<String, Object> row1 : labelInfo) { |
| | | int orderNumber = (int) row1.get("orderNumber"); |
| | | int technologyNumber = (int) row1.get("technologyNumber"); |
| | | if (orderNumber == glass_type && technologyNumber == layer) { |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | if (orderNumber == glass_type && technologyNumber == layer) { |
| | | |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | } |
| | | } else { |
| | | if (orderNumber == glass_type) { |
| | | |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | } |
| | | } |
| | | } |
| | | } |