| | |
| | | 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; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |