| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package beans.stockbill.bills;
- import common.Controller;
- import common.YosException;
- import common.data.Row;
- import common.data.RowsMap;
- import java.util.ArrayList;
- public class QTCK extends BasicBill {
- long sys_enterpriseid;
- public QTCK(Controller controller, long st_stockbillid) throws YosException {
- super(controller, st_stockbillid);
- sys_enterpriseid = billRow.getLong("sys_enterpriseid");
- }
- @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);
- }
- @Override
- public ArrayList<String> getCheckSql(boolean ischeck) throws YosException {
- return super.getCheckSql(ischeck);
- }
- @Override
- public boolean isInStock(boolean fischeck) {
- if (fischeck && rb == 0 || !fischeck && rb == 1) {
- return true;
- }
- return false;
- }
- }
|