| | |
| | | return map; |
| | | } |
| | | |
| | | public Object selectPrintFlowCardSv(Date selectTime1, Date selectTime2, String orderId, String project, String userId, FlowCard flowCard) { |
| | | public Object selectPrintFlowCardSv(Date selectTime1, Date selectTime2, String orderId, String project, String userId, Integer state, FlowCard flowCard) { |
| | | if ("null".equals(orderId)) { |
| | | orderId = ""; |
| | | } |
| | |
| | | project = ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.selectPrintFlowCardMp(selectTime1, selectTime2, orderId, project, flowCard)); |
| | | map.put("data", flowCardMapper.selectPrintFlowCardMp(selectTime1, selectTime2, orderId, project,state, flowCard)); |
| | | String roleId = flowCardMapper.selectUserMp(userId); |
| | | map.put("user", roleId); |
| | | return map; |
| | |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | if (type == 1) { |
| | | if (type == 1) {//明细打印 |
| | | itemmap.put("detail", flowCardMapper.selectPrintDetailsMp(flowCard.getOrderId())); |
| | | } else if (type == 2) { |
| | | } else if (type == 2) {//明细分架打印 |
| | | itemmap.put("detail", flowCardMapper.selectPrintDetailsMp1(flowCard.getOrderId())); |
| | | }else if (type == 3) {//订单打印 |
| | | itemmap.put("detail", flowCardMapper.selectPrintDetailsMp2(flowCard.getOrderId())); |
| | | } |
| | | |
| | | list.add(itemmap); |
| | |
| | | |
| | | if (lableType != 2) {//成品标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | String orderId = flowCard.getOrderId(); |
| | | String processId = flowCard.getProcessId(); |
| | | String orderNumber = flowCard.getOrderNumber().toString(); |
| | | if (processId!=null){ |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(processId) && processedProcessIds.contains(orderNumber)) { |
| | | continue; |
| | | } |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataDetails(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getPrintQuantity())); |
| | | list.add(itemmap); |
| | | |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(processId) && processedProcessIds.contains(orderNumber)) { |
| | | continue; |
| | | } |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataDetails(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getPrintQuantity())); |
| | | list.add(itemmap); |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(processId); |
| | | processedProcessIds.add(orderNumber); |
| | | } else{ |
| | | |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(processId); |
| | | processedProcessIds.add(orderNumber); |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintOrderDataDetails(flowCard.getOrderId(), flowCard.getOrderNumber(), flowCard.getPrintQuantity())); |
| | | list.add(itemmap); |
| | | } |
| | | |
| | | } |
| | | } else {//小片标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | |
| | | Float shelfThickness = Float.parseFloat(object.get("shelfThickness").toString())*1000; |
| | | Float spacerThickness = Float.parseFloat(object.get("spacerThickness").toString()); |
| | | */ |
| | | Integer inMaxQuantity = 30; |
| | | Float inWeight = 50.0f; |
| | | //Integer inMaxQuantity = 1; |
| | | Float inWeight = 100.0f; |
| | | Float shelfThickness = 2000.0f; |
| | | /*垫片厚度*/ |
| | | Float spacerThickness = 0.0f; |
| | | Map<String, Object> thickness = flowCardMapper.getGlassThicknessByProdutionId(orderId, productionId); |
| | | |
| | | //成品玻璃总厚度 |
| | | Float glassTotalThickness = Float.parseFloat(thickness.get("totalThickness").toString()); |
| | | //成品玻璃厚度 |
| | | Float glassThickness = Float.parseFloat(thickness.get("thickness").toString()); |
| | | |
| | | //获取此工程号订单明细信息 |
| | |
| | | //当前订单明细剩余数量 |
| | | if (shelfQuantity == 0) { |
| | | shelfQuantity = shelfQuantityByWeight; |
| | | }else if(shelfQuantity>0){ |
| | | }else if(shelfQuantity>0){//架子剩余数量大于0时,判断当前架子剩余重量,是否支持最新序号的的成品重量 |
| | | String FlowCardId = orderDetailList.get(orderDetailList.size() - 1).getFlowCardId(); |
| | | double flowCardWeight = 0.0; |
| | | for (OrderDetail orderDetail1 : orderDetailList) { |
| | | if (orderDetail1.getFlowCardId().equals(FlowCardId)) { |
| | | flowCardWeight += orderDetail1.getHeight()*orderDetail1.getQuantity()* orderDetail1.getWidth()* glassThickness* 2.5 / 1000000; |
| | | } |
| | | |
| | | } |
| | | if(flowCardWeight>0){ |
| | | //System.out.println(inWeight+","+flowCardWeight); |
| | | flowCardWeight = inWeight - flowCardWeight; |
| | | shelfQuantity = (int) (flowCardWeight / |
| | | (orderDetail.getHeight() |
| | |
| | | } |
| | | String processId = productionId + String.format("%05d", flowCardNo); |
| | | //取最小值 |
| | | maxQuantity = Math.min(shelfQuantity, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)); |
| | | // maxQuantity = Math.min(shelfQuantity, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)); |
| | | maxQuantity = Math.min(shelfQuantity, shelfMaxQuantityByThickness); |
| | | |
| | | /*System.out.println(shelfQuantity + "," + inMaxQuantity + "," + shelfMaxQuantityByThickness); |
| | | System.out.println(flowCardNo + "," + maxQuantity); |
| | | System.out.println("------");*/ |
| | |
| | | } |
| | | |
| | | |
| | | public Boolean revokeComposingSv(Map<String, Object> object) { |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("composing")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | //获取没有工程号的条数,已生成工程号不能撤回 |
| | | Integer count = flowCardMapper.selectProjectNo(flowCard.getProcessId()); |
| | | if (count == 0){ |
| | | flowCardMapper.revokeComposing(flowCard.getProcessId()); |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |