| | |
| | | CheckWarehouseParam param = new CheckWarehouseParam(); |
| | | param.setIsCheckIn(false); |
| | | param.setWarehouseId(output.getWarehouseId()); |
| | | param.setModelId(goods.getBaseGoodsModelsId()); |
| | | param.setCount(goods.getCounts()); |
| | | |
| | | List<CheckWarehouseResult> results = coreService.unifyCheck(param); |
| | |
| | | insertBatch(warningList); |
| | | } |
| | | |
| | | public void doDepBack(DepFormBack back){ |
| | | String sql = "SELECT\n" + |
| | | " * \n" + |
| | | "FROM\n" + |
| | | " DEP_FORM_BACK_GOODS A \n" + |
| | | "WHERE\n" + |
| | | " A.DEP_FORM_BACK_ID = :BACK_ID \n"; |
| | | |
| | | List<DepFormBackGoods> goodsList = this.select(sql,new SqlParameter() |
| | | .put("BACK_ID",back.getId()),new DepFormBackGoods()); |
| | | |
| | | for (DepFormBackGoods goods : goodsList) { |
| | | CheckUsingParam param = new CheckUsingParam(); |
| | | param.setIsCheckIn(false); |
| | | param.setLending_id(back.getDepFormLendingId()); |
| | | param.setOutputCount(goods.getBackCounts()); |
| | | //型号 |
| | | // param.setModel_id(model.); |
| | | |
| | | //字表设计有问题,需要重新设计,参考报废表。 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 部门物品分发 |
| | | */ |
| | | public void doDepLending(){ |
| | | public void doDepLending(DepFormLending lending){ |
| | | String sql = "SELECT\n" + |
| | | " * \n" + |
| | | "FROM\n" + |
| | | " DEP_FORM_LENDING_GOODS A \n" + |
| | | "WHERE\n" + |
| | | " A.DEP_FORM_LENDING_ID = :LENDING_ID"; |
| | | |
| | | List<DepFormLendingGoods> goodsList = this.select(sql,new SqlParameter() |
| | | .put("LENDING_ID",lending.getId()),new DepFormLendingGoods()); |
| | | |
| | | for (DepFormLendingGoods goods : goodsList){ |
| | | CheckWarehouseParam param = new CheckWarehouseParam(); |
| | | param.setIsCheckIn(false); |
| | | param.setWarehouseId(lending.getWarehouseId()); |
| | | param.setModelId(goods.getBaseGoodsModelsId()); |
| | | param.setCount(goods.getCounts()); |
| | | |
| | | //首先从机构仓库出库 |
| | | List<CheckWarehouseResult> results = coreService.unifyCheck(param); |
| | | for (CheckWarehouseResult result : results){ |
| | | WhGoodsDetails details = new WhGoodsDetails(); |
| | | details.setId(NumberGenerator.getLongSequenceNumber()); |
| | | details.setBusinessFormId(lending.getId()); |
| | | details.setBusinessFormCode(lending.getBusinessFormCode()); |
| | | details.setBusinessFormName("分发单:" + lending.getBusinessFormCode()); |
| | | details.setInitialCount(result.getInitial_count()); |
| | | details.setThisType(2); |
| | | details.setThisCount(result.getInitial_count() - result.getEnd_count()); |
| | | details.setEndCount(result.getEnd_count()); |
| | | details.setWarehouseId(result.getWhGoods().getWarehouseId()); |
| | | details.setWarehouseName(result.getWhGoods().getWarehouseName()); |
| | | details.setClassification(11); |
| | | details.setOperatorId(lending.getOperatorId()); |
| | | details.setOperatorName(lending.getOperatorName()); |
| | | details.setDealTime(lending.getDealTime()); |
| | | details.setWhGoodsId(result.getWhGoods().getId()); |
| | | this.insert(details); |
| | | |
| | | //回填出库流水ID,用于分发时使用 |
| | | result.setWh_goods_detail_id(details.getId()); |
| | | } |
| | | |
| | | CheckUsingParam usingParam = new CheckUsingParam(); |
| | | usingParam.setIsCheckIn(true); |
| | | usingParam.setInput_type(1); |
| | | usingParam.setOutputList(results); |
| | | |
| | | List<CheckUsingResult> usingResults = coreService.unifyUsingCheck(usingParam); |
| | | for (CheckUsingResult usingResult : usingResults) { |
| | | UsingGoodsHis his = new UsingGoodsHis(); |
| | | his.setId(NumberGenerator.getLongSequenceNumber()); |
| | | his.setBusinessFormId(lending.getId()); |
| | | his.setBusinessFormCode(lending.getBusinessFormCode()); |
| | | his.setBusinessFormName("分发单:" + lending.getBusinessFormCode()); |
| | | his.setClassification(1); |
| | | his.setOperatorId(lending.getOperatorId()); |
| | | his.setOperatorName(lending.getOperatorName()); |
| | | his.setDealTime(lending.getDealTime()); |
| | | his.setDepFormLendingModelId(usingResult.getLendingModel().getId()); |
| | | his.setDepFormLendingGoodsId(usingResult.getLendingModel().getDepFormLendingGoodsId()); |
| | | his.setDepFormLendingId(lending.getId()); |
| | | his.setWhGoodsId(usingResult.getLendingModel().getWhGoodsId()); |
| | | his.setInitialCount(usingResult.getInitial_count()); |
| | | his.setEndCount(usingResult.getEnd_count()); |
| | | his.setWarehouseId(lending.getWarehouseId()); |
| | | his.setWarehouseName(lending.getWarehouseName()); |
| | | his.setDepartmentId(lending.getDepartmentId()); |
| | | his.setDepartmentName(lending.getDepartmentName()); |
| | | insert(his); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |