| | |
| | | * 第一步:通过采购单ID查询采购单型号【L_WH_PROCURE_MODEL】得到商品型号以及数量 |
| | | * 第二步:记录进出库流水:L_WAREHOUSE_FLOW |
| | | */ |
| | | public void doProcure(Long whFormProcureId, S_user_core currentUser) { |
| | | public String doProcure(Long whFormProcureId, S_user_core currentUser) { |
| | | if (whFormProcureId == null) { |
| | | return "采购单id为空"; |
| | | } |
| | | //采购单信息 |
| | | LWhFormProcure whFormProcure = new LWhFormProcure(whFormProcureId); |
| | | LWhFormProcure lWhFormProcure = lWhFormProcureService.get(whFormProcure); |
| | | if (lWhFormProcure == null || lWhFormProcure.getStates() != 0) { |
| | | if (lWhFormProcure == null || lWhFormProcure.getStates() != 1) { |
| | | log.error("入库失败!请检查入库单状态"); |
| | | return; |
| | | return "入库失败!请检查入库单状态"; |
| | | } |
| | | Long userId = currentUser.getId(); |
| | | String nickName = currentUser.getNick_name(); |
| | |
| | | int flowInsertFlag = lWarehouseFlowService.buyInsertWareFlow(goodsModelNum, lWhFormProcure, warehouseFlow); |
| | | if (flowInsertFlag == 1) { |
| | | // 更新采购单【L_WH_FORM_PROCURE】 |
| | | whFormProcure.setStates(1); |
| | | whFormProcure = new LWhFormProcure(whFormProcureId); |
| | | whFormProcure.setStates(2); |
| | | whFormProcure.setLWarehouseFlowId(lWarehouseFlowId); |
| | | whFormProcure.setIncomeId(userId); |
| | | whFormProcure.setIncomeName(nickName); |
| | |
| | | lWhFormProcureService.update(whFormProcure); |
| | | } |
| | | log.info("入库单:{} 入库完成", whFormProcureId); |
| | | return; |
| | | return null; |
| | | |
| | | } |
| | | } |