/** * 联营交易信息 * * @param context * @param task * @throws Exception */ private void writeJointRecord(Context context, CheckinSheetTask sheet) throws Exception { List<JointVentureTaskItem> items = new ArrayList<JointVentureTaskItem>(); for (CheckInSheetItem det : sheet.getItems()) { JointVentureTaskItem item = new JointVentureTaskItem(); item.setGoodsId(det.getGoodsId()); item.setSheetId(sheet.getEntity().getRECID()); item.setSheetNo(sheet.getEntity().getSheetNo()); item.setCount(DoubleUtil.sub(0, det.getRealCount())); items.add(item); } context.handle(new CreateJointVentureTask(items)); }
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(); } }