QTCK.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package beans.stockbill.bills;
  2. import common.Controller;
  3. import common.YosException;
  4. import common.data.Row;
  5. import common.data.RowsMap;
  6. import java.util.ArrayList;
  7. public class QTCK extends BasicBill {
  8. long sys_enterpriseid;
  9. public QTCK(Controller controller, long st_stockbillid) throws YosException {
  10. super(controller, st_stockbillid);
  11. sys_enterpriseid = billRow.getLong("sys_enterpriseid");
  12. }
  13. @Override
  14. public void checkValidate(boolean ischeck) throws YosException {
  15. if(ischeck){
  16. RowsMap codeRowsMap = codeRows.toRowsMap("st_stockbill_itemsid");
  17. for(Row row:itemRows){
  18. if(row.getBoolean("skucontrol")){
  19. if(codeRowsMap.containsKey(row.getString("st_stockbill_itemsid"))){
  20. if(codeRowsMap.get(row.getString("st_stockbill_itemsid")).size()!=row.getInteger("qty")){
  21. throw new YosException("行号:"+row.getString("rowno")+"序列号数量和出库数量不一致");
  22. }
  23. }else{
  24. throw new YosException("受序列号管控的商品,审核时必须有序列号");
  25. }
  26. }
  27. }
  28. }
  29. super.checkValidate(ischeck);
  30. }
  31. @Override
  32. public ArrayList<String> getCheckSql(boolean ischeck) throws YosException {
  33. return super.getCheckSql(ischeck);
  34. }
  35. @Override
  36. public boolean isInStock(boolean fischeck) {
  37. if (fischeck && rb == 0 || !fischeck && rb == 1) {
  38. return true;
  39. }
  40. return false;
  41. }
  42. }