|
@@ -51,6 +51,7 @@ import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
@@ -66,6 +67,7 @@ import java.util.stream.Collectors;
|
|
|
* @author ruoyi
|
|
|
* @date 2022-10-18
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
@Autowired
|
|
@@ -812,6 +814,46 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
// return wmsDocOrderHeaderMapper.selectCheckOutList(orderNoList);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<CheckOutVO> checkOutListBh(List<String> orderNoList) {
|
|
|
+ List<CheckOutVO> endCheckOutVOList = new ArrayList<>();
|
|
|
+ Set<String> locationSet = new HashSet<>();
|
|
|
+ for (String orderNo : orderNoList) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
|
+ if (!wmsDocOrderHeader.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
|
|
|
+ log.error("出库单类型必须为备货!" + wmsDocOrderHeader.getSoReference1());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (String orderNo : orderNoList) {
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
|
|
|
+ // 胖蛋是备货单
|
|
|
+ boolean isBh = wmsDocOrderHeader.getOrderType().equals(Constant.ORDER_TYP.BH.getValue());
|
|
|
+ InvLocIdSearchFrom invLocIdSearchFrom = new InvLocIdSearchFrom();
|
|
|
+ if (isBh) {
|
|
|
+ invLocIdSearchFrom.setLotatt14(orderNo);
|
|
|
+ } else {
|
|
|
+ invLocIdSearchFrom.setLotatt15(orderNo);
|
|
|
+ }
|
|
|
+ List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattList(invLocIdSearchFrom);
|
|
|
+ for (InvLotLocIdLotattVO v : invLotLocIdLotattVOS) {
|
|
|
+ if (v.getStockStatus().equals(Constant.STOCK_STATUS.STOCK00.getValue())
|
|
|
+ && v.getIsEmpty().equals(Constant.IS_YES.N.name())
|
|
|
+ && v.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue().toString())) {
|
|
|
+ if (!locationSet.contains(v.getLocationNo())) {
|
|
|
+ CheckOutVO checkOutVO = new CheckOutVO();
|
|
|
+ checkOutVO.setOrderNo(wmsDocOrderHeader.getSoReference1());
|
|
|
+ checkOutVO.setLocationNo(v.getLocationNo());
|
|
|
+ checkOutVO.setPalletNo(v.getLotatt07());
|
|
|
+ endCheckOutVOList.add(checkOutVO);
|
|
|
+ locationSet.add(v.getLocationNo());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return endCheckOutVOList;
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
@Override
|
|
|
public AjaxResult doCheckout(CheckOutInfoForm check) {
|