| | |
| | | import com.consum.base.core.service.LWhWarningCoreServiceImpl; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.LockManage; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.LGoodsUserRecord; |
| | | import com.consum.model.po.LWarehouseFlow; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhGoodsRecordDetails; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | /** |
| | | * @ClassName LWhFormTransferCoreService |
| | |
| | | public class LWhFormTransferCoreService { |
| | | |
| | | @Resource |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | @Resource |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | @Resource |
| | |
| | | String nickName = currentUser.getNick_name(); |
| | | // 出库单流水id |
| | | Long outWarehouseFlowId = lWhFormTransfer.getOutWarehouseFlowId(); |
| | | if (outWarehouseFlowId == null){ |
| | | if (outWarehouseFlowId == null) { |
| | | log.error("调拨失败!未找到出库单"); |
| | | return; |
| | | } |
| | |
| | | synchronized (warehouseModelLockObj) { |
| | | // 根据出库流水ID 查询 出库的物品ID |
| | | outGoodsIds = getGoodsidByFlowId(outWarehouseFlowId, oldRecordId); |
| | | if (CollectionUtils.isEmpty(outGoodsIds)){ |
| | | if (CollectionUtils.isEmpty(outGoodsIds)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | throw new RuntimeException("入库单失败,未查询到物品!"); |
| | | } |
| | |
| | | lWhProcureModelUser.setTransBusinessId(whFormTransferId); |
| | | lWhProcureModelUser.setBaseGoodsModelsId(baseGoodsModelsId); |
| | | List<LWhProcureModelUser> goodsUserInfo = goodsBaseService.select(lWhProcureModelUser); |
| | | if (CollectionUtils.isEmpty(goodsUserInfo)){ |
| | | if (CollectionUtils.isEmpty(goodsUserInfo)) { |
| | | continue; |
| | | } |
| | | int totalGoodsNum = goodsUserInfo.stream().filter(item -> item.getGoodsNum() != null).mapToInt(LWhProcureModelUser::getGoodsNum).sum(); |
| | |
| | | //将保管仓库信息更新到 物品仓库保管记录【L_GOODS_WH_RECORD】 |
| | | lGoodsWhRecordService.insertNewRecord(outGoodsIds, inWarehouseFlowId, dealTime); |
| | | |
| | | |
| | | LWhGoodsRecordDetails lWhGoodsRecordDetails = new LWhGoodsRecordDetails(); |
| | | lWhGoodsRecordDetails.setWhGoodsRecordId(oldRecordId); |
| | | List<LWhGoodsRecordDetails> goodsRecordDetailsList = lWhGoodsRecordDetailsService.select(lWhGoodsRecordDetails); |
| | |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | |
| | | //当库存变动时调用该方法 |
| | | if (inWarehouseType == 0){ |
| | | if (inWarehouseType == 0) { |
| | | lWhWarningCoreService.updateKuCun(Convert.toShort(inWarehouseType, (short) 0), inWarehouseId, allChangModelList, null, dealTime); |
| | | } |
| | | log.info("调拨单:{} 入库完成", whFormTransferId); |