예제 #1
0
 @Override
 protected void handle(Context context, CheckinSheetTask task) throws Throwable {
   InsertSqlBuilder ib = new InsertSqlBuilder(context);
   ib.setTable(ERPTableNames.Inventory.CheckinSheet.getTableName());
   ib.addColumn("RECID", ib.guid, task.getEntity().getRECID());
   ib.addColumn("sheetNo", ib.STRING, task.getEntity().getSheetNo());
   ib.addColumn("sheetType", ib.STRING, task.getEntity().getSheetType());
   ib.addColumn("partnerId", ib.guid, task.getEntity().getPartnerId());
   ib.addColumn("partnerName", ib.STRING, task.getEntity().getPartnerName());
   ib.addColumn("namePY", ib.STRING, task.getEntity().getNamePY());
   ib.addColumn("partnerShortName", ib.STRING, task.getEntity().getPartnerShortName());
   ib.addColumn("relaBillsId", ib.guid, task.getEntity().getRelaBillsId());
   ib.addColumn("relaBillsNo", ib.STRING, task.getEntity().getRelaBillsNo());
   ib.addColumn("storeId", ib.guid, task.getEntity().getStoreId());
   ib.addColumn("storeName", ib.STRING, task.getEntity().getStoreName());
   ib.addColumn("storeNamePY", ib.STRING, task.getEntity().getStoreNamePY());
   ib.addColumn("goodsFrom", ib.STRING, task.getEntity().getGoodsFrom());
   ib.addColumn("remark", ib.STRING, task.getEntity().getRemark());
   ib.addColumn("buyPerson", ib.STRING, task.getEntity().getBuyPerson());
   ib.addColumn("buyDate", ib.DATE, task.getEntity().getBuyDate());
   ib.addColumn("amount", ib.DOUBLE, task.getEntity().getAmount());
   ib.addColumn("askedAmount", ib.DOUBLE, task.getEntity().getAskedAmount());
   ib.addColumn("paidAmount", ib.DOUBLE, task.getEntity().getPaidAmount());
   ib.addColumn("disAmount", ib.DOUBLE, task.getEntity().getDisAmount());
   ib.addColumn("checkinDate", ib.DATE, task.getEntity().getCheckinDate());
   ib.addColumn("checkinPerson", ib.guid, task.getEntity().getCheckinPerson());
   ib.addColumn("checkinPersonName", ib.STRING, task.getEntity().getCheckinPersonName());
   ib.addColumn("deptId", ib.guid, task.getEntity().getDeptId());
   ib.addColumn("creatorId", ib.guid, task.getEntity().getCreatorId());
   ib.addColumn("creator", ib.STRING, task.getEntity().getCreator());
   if (null != task.getEntity().getDeptId()) {
     Department depart = context.find(Department.class, task.getEntity().getDeptId());
     if (null != depart) {
       ib.addColumn("deptName", ib.STRING, depart.getName());
     } else {
       throw new Exception("获取用户部门信息出错!");
     }
   }
   if (null != task.getEntity().getPartnerId()) {
     Partner p = context.find(Partner.class, task.getEntity().getPartnerId());
     ib.addColumn("partnerCode", ib.STRING, p.getCode());
   }
   if (ib.execute() == 1) {
     doSaveDetails(context, task);
     task.setSuccess(true);
   }
   if (task.getEntity().getSheetType().equals(CheckingInType.Joint.getCode())
       || task.getEntity().getSheetType().equals(CheckingInType.RealGoods.getCode())
       || task.getEntity().getSheetType().equals(CheckingInType.Kit.getCode())) {
     return;
   }
   writeJointRecord(context, task);
 }
예제 #2
0
 public void doSaveDetails(Context context, CheckinSheetTask task) {
   for (CheckInSheetItem item : task.getItems()) {
     InsertSqlBuilder ib = new InsertSqlBuilder(context);
     ib.setTable(ERPTableNames.Inventory.CheckinSheet_Det.getTableName());
     ib.addColumn("RECID", ib.guid, item.getRECID());
     ib.addColumn("sheetId", ib.guid, item.getSheetId());
     ib.addColumn("goodsId", ib.guid, item.getGoodsId());
     ib.addColumn("goodsCode", ib.STRING, item.getGoodsCode());
     ib.addColumn("goodsNo", ib.STRING, item.getGoodsNo());
     ib.addColumn("goodsName", ib.STRING, item.getGoodsName());
     ib.addColumn("goodsSpec", ib.STRING, item.getGoodsSpec());
     ib.addColumn("unit", ib.STRING, item.getUnit());
     ib.addColumn("scale", ib.INT, item.getScale());
     ib.addColumn("price", ib.DOUBLE, item.getPrice());
     ib.addColumn("amount", ib.DOUBLE, item.getAmount());
     ib.addColumn("realCount", ib.DOUBLE, item.getRealCount());
     ib.execute();
   }
 }