chenlu
2025-02-26 e9e776e4ad2f191496defcca1a0250b2c49c9f4f
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -1061,7 +1061,7 @@
        Float shelfThickness =  Float.parseFloat(object.get("shelfThickness").toString())*1000;
        Float spacerThickness =  Float.parseFloat(object.get("spacerThickness").toString());
        */
        Integer inMaxQuantity = 30;
        Integer inMaxQuantity = 1;
        Float inWeight = 100.0f;
        Float shelfThickness = 2000.0f;
        /*垫片厚度*/
@@ -1100,10 +1100,11 @@
                double flowCardWeight = 0.0;
                for (OrderDetail orderDetail1 : orderDetailList) {
                    if (orderDetail1.getFlowCardId().equals(FlowCardId)) {
                        flowCardWeight = orderDetail1.getHeight()*orderDetail1.getQuantity()* orderDetail1.getWidth()* glassThickness* 2.5 / 1000000;
                        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()
@@ -1112,6 +1113,7 @@
                                    * 2.5 / 1000000));
                    if (shelfQuantity == 0) {
                        shelfQuantity = shelfQuantityByWeight;
                        flowCardNo += 1;
                    }
                }
@@ -1161,6 +1163,25 @@
    }
    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;
        }
    }
}