| | |
| | | * @return 出库单Id |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long createOutFormByTransId(Long whFormTransferId, S_user_core currentUser, Long dealTime) { |
| | | public Long createOutFormByTransId(Long whFormTransferId, WhBusinessEnum businessEnum, S_user_core currentUser, Long dealTime) { |
| | | if (whFormTransferId == null) { |
| | | return null; |
| | | } |
| | |
| | | } |
| | | |
| | | //申请调拨的物品 |
| | | List<LWhProcureModel> goodsModelNumList = lWhProcureModelService.getModelByForm(WhBusinessEnum.DIAOBO, whFormTransferId); |
| | | List<LWhProcureModel> goodsModelNumList = lWhProcureModelService.getModelByForm(businessEnum, whFormTransferId); |
| | | if (CollectionUtils.isEmpty(goodsModelNumList)) { |
| | | log.error("没有要入库的物品"); |
| | | return null; |
| | | throw new RuntimeException("没有要入库的物品"); |
| | | // return null; |
| | | } |
| | | Long outWarehouseId = lWhFormTransfer.getOutWarehouseId(); |
| | | String outWarehouseName = lWhFormTransfer.getOutWarehouseName(); |
| | |
| | | Integer buyTypeT = null; |
| | | Integer modGoodsTransferingStatusT = null; |
| | | short businessTypeValue = businessType.getValue(); |
| | | if (BaseWarehouseParam1.In_OutPutTypeEnum.Transfer_Output.getValue() == businessTypeValue) { |
| | | if (BaseWarehouseParam1.In_OutPutTypeEnum.Transfer_Output.getValue() == businessTypeValue) { |
| | | //调拨出库 |
| | | queryModelStatusT = 1; |
| | | buyTypeT = 1; |
| | | lWarehouseFlowBusinessId = lWhFormOutput.getTransBusinessId(); |
| | | modGoodsTransferingStatusT = 0; |
| | | } else if (BaseWarehouseParam1.In_OutPutTypeEnum.Dept_Lending_Out.getValue() == businessTypeValue) { |
| | | } else if (BaseWarehouseParam1.In_OutPutTypeEnum.Dept_Lending_Out.getValue() == businessTypeValue) { |
| | | // 部门仓库 分发出库 |
| | | // queryModelStatusT = 2; |
| | | } else if (BaseWarehouseParam1.In_OutPutTypeEnum.Fragmentary_Output.getValue() == businessTypeValue) { |
| | | lWarehouseFlowBusinessId = lWhFormOutput.getTransBusinessId(); |
| | | } else if (BaseWarehouseParam1.In_OutPutTypeEnum.Fragmentary_Output.getValue() == businessTypeValue) { |
| | | // 零星出库 |
| | | queryModelStatusT = 1; |
| | | buyTypeT = null; |
| | | modGoodsTransferingStatusT = 4; |
| | | }else if (BaseWarehouseParam1.In_OutPutTypeEnum.Inventory_Output.getValue() == businessTypeValue) { |
| | | } else if (BaseWarehouseParam1.In_OutPutTypeEnum.Inventory_Output.getValue() == businessTypeValue) { |
| | | // 盘点出库 |
| | | queryModelStatusT = 1; |
| | | buyTypeT = null; |
| | |
| | | lWhFormOutputService.update(lWhFormOutput); |
| | | |
| | | //当库存变动时调用该方法 |
| | | lWhWarningCoreService.updateKuCun(Convert.toShort(outWarehouseType, (short) 0), outWarehouseId, allChangModelList, null, dealTime); |
| | | if (outWarehouseType == 0){ |
| | | lWhWarningCoreService.updateKuCun(Convert.toShort(outWarehouseType, (short) 0), outWarehouseId, allChangModelList, null, dealTime); |
| | | } |
| | | return lWarehouseFlowId; |
| | | } |
| | | |