Преглед на файлове

其他入库管控序列号

hu преди 5 месеца
родител
ревизия
2f5149da78
променени са 2 файла, в които са добавени 26 реда и са изтрити 1 реда
  1. 20 0
      src/custom/beans/stockbill/bills/QTRK.java
  2. 6 1
      src/custom/beans/stockbill/bills/XSCK.java

+ 20 - 0
src/custom/beans/stockbill/bills/QTRK.java

@@ -2,6 +2,9 @@ package beans.stockbill.bills;
 
 import common.Controller;
 import common.YosException;
+import common.data.Row;
+import common.data.Rows;
+import common.data.RowsMap;
 
 import java.util.ArrayList;
 
@@ -13,6 +16,23 @@ public class QTRK extends BasicBill {
 
     @Override
     public void checkValidate(boolean ischeck) throws YosException {
+        if(ischeck){
+            RowsMap codeRowsMap = codeRows.toRowsMap("st_stockbill_itemsid");
+            for(Row row:itemRows){
+                if(row.getBoolean("skucontrol")){
+                    if(codeRowsMap.containsKey(row.getString("st_stockbill_itemsid"))){
+                        if(codeRowsMap.get(row.getString("st_stockbill_itemsid")).size()!=row.getInteger("qty")){
+                            throw new YosException("行号:"+row.getString("rowno")+"序列号数量和入库数量不一致");
+                        }
+                    }else{
+                        throw new YosException("受序列号管控的商品,审核时必须有序列号");
+                    }
+                }
+
+            }
+        }
+
+
         super.checkValidate(ischeck);
     }
 

+ 6 - 1
src/custom/beans/stockbill/bills/XSCK.java

@@ -82,7 +82,12 @@ public class XSCK extends BasicBill {
             if(!billRow.getString("sourceobject").equals("tpartreimbursement")){
                 Rows rowsjudge = dbConnect.runSqlQuery("select * from (select sa_orderitemsid,sum(qty) qty from st_stockbill_items where st_stockbillid ='" + st_stockbillid + "' group by sa_orderitemsid) t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid where t1.qty>t2.undeliqty");
                 if (rowsjudge.isNotEmpty()) {
-                    throw new YosException("存在商品已完全出库,无法反审核");
+                    if(ischeck){
+                        throw new YosException("存在商品已完全出库,无法审核");
+                    }else{
+                        throw new YosException("存在商品已完全出库,无法反审核");
+                    }
+
                 }
             }