| | |
| | | private SimpleJdbcCall simpleJdbcCall; |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | private LWhGoodsService lWhGoodsService; |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | |
| | | @Autowired |
| | | public LWarehouseFlowCoreService(JdbcTemplate jdbcTemplate, LWarehouseFlowService lWarehouseFlowService, LWhGoodsService lWhGoodsService, BaseGoodsTemplateServiceImpl baseGoodsTemplateService) { |
| | | public LWarehouseFlowCoreService(JdbcTemplate jdbcTemplate, LWarehouseFlowService lWarehouseFlowService, LWhGoodsService lWhGoodsService, LWhFormTransferService lWhFormTransferService, LWhFormOutputCoreService lWhFormOutputCoreService, BaseGoodsTemplateServiceImpl baseGoodsTemplateService) { |
| | | this.jdbcTemplate = jdbcTemplate; |
| | | this.lWarehouseFlowService = lWarehouseFlowService; |
| | | this.baseGoodsTemplateService = baseGoodsTemplateService; |
| | | this.lWhFormTransferService = lWhFormTransferService; |
| | | this.lWhFormOutputCoreService = lWhFormOutputCoreService; |
| | | this.lWhGoodsService = lWhGoodsService; |
| | | this.simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("InsertL_WH_GOODS"); |
| | | } |
| | |
| | | * @param warehouseFlow |
| | | * @return |
| | | */ |
| | | public int insertWareFlow(List<LWhProcureModel> goodsModelNumList, LWhFormProcure lWhFormProcure, LWarehouseFlow warehouseFlow) { |
| | | public int buyInsertWareFlow(List<LWhProcureModel> goodsModelNumList, LWhFormProcure lWhFormProcure, LWarehouseFlow warehouseFlow) { |
| | | if (CollectionUtils.isEmpty(goodsModelNumList)) { |
| | | log.error("没有要入库的物品"); |
| | | return 0; |
| | |
| | | Object warehouseModelLockObj = LockManage.acquireLock(warehouseId, baseGoodsModelsId); |
| | | synchronized (warehouseModelLockObj) { |
| | | // 获得锁后查询该型号的期初数量 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseId, baseGoodsModelsId, (short) 1); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setThisCount(modelCount); |
| | | whGoodsRecord.setEndCount(goodsModelNum + modelCount); |
| | |
| | | Map<String, Object> out = simpleJdbcCall.execute(in); |
| | | System.out.println("Procedure result: " + out); |
| | | } |
| | | |
| | | /** |
| | | * 调拨出库 |
| | | * |
| | | * @param outWarehouseId 出库单 |
| | | * @return |
| | | */ |
| | | public int outInsertWareFlow(Long outWarehouseId) { |
| | | // 出库时候,按 先入库的先出库,同时入库的,按价格高的先出库 |
| | | // List<Long> outGoodsId = lWhGoodsService.queryOutGoodsId(outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType, goodsModelNum); |
| | | // 修改物品的状态为 状态(0=在途调拨;1=入库未分发;2=已下发;3=报废) |
| | | // 修改 所属仓库仓库编号WAREHOUSE_ID、仓库名称WAREHOUSE_NAME,此时不要同步进 物品仓库保管记录【L_GOODS_WH_RECORD】!入库时再同步 |
| | | |
| | | |
| | | // 新增记录 进出库流水总表[L_WAREHOUSE_FLOW] 各规格物品的进出库【L_WH_GOODS_RECORD】进出库流水明细[L_WH_GOODS_RECORD_DETAILS] |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | } |