no message
							parent
							
								
									1ad1e96b95
								
							
						
					
					
						commit
						f4d01455be
					
				| 
						 | 
				
			
			@ -24,6 +24,7 @@ import com.youchain.basicdata.service.mapstruct.ItemMapper;
 | 
			
		|||
import com.youchain.businessdata.domain.*;
 | 
			
		||||
import com.youchain.businessdata.repository.*;
 | 
			
		||||
import com.youchain.businessdata.service.dto.InventoryDto;
 | 
			
		||||
import com.youchain.exception.BadRequestException;
 | 
			
		||||
import com.youchain.modules.quartz.utils.TimeNumberUtils;
 | 
			
		||||
import com.youchain.modules.system.domain.Dept;
 | 
			
		||||
import com.youchain.service.LogService;
 | 
			
		||||
| 
						 | 
				
			
			@ -265,7 +266,7 @@ public class PickDetailServiceImpl implements PickDetailService {
 | 
			
		|||
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public void allocatePick(Pick pick) {
 | 
			
		||||
    public  void allocatePick(Pick pick) {
 | 
			
		||||
 | 
			
		||||
        //目标库位
 | 
			
		||||
        Point endPoint = null;
 | 
			
		||||
| 
						 | 
				
			
			@ -275,11 +276,14 @@ public class PickDetailServiceImpl implements PickDetailService {
 | 
			
		|||
                areaCode = AreaNameDic.XJFBQ;
 | 
			
		||||
            } else if (BaseStatus.GD_TYPE_DP.equals(pick.getOrderType())) {
 | 
			
		||||
                areaCode = AreaNameDic.DJFBQ;
 | 
			
		||||
            }else{
 | 
			
		||||
                throw new BadRequestException("出库单类型错误!");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            List<Point> pointList = pointRepository.findByCode(null, BaseStatus.FREE, BaseStatus.BOX, areaCode, null, null);
 | 
			
		||||
            if (pointList.isEmpty()) {
 | 
			
		||||
                logService.saveLogInfo(pick.getCode(), pick.getCode(), "/pick/allocatePick", "分配失败,翻包区没有空闲点位!", "出库单分配", 200, "info");
 | 
			
		||||
                throw new IllegalArgumentException(pick.getCode() + "分配失败,翻包区没有空闲点位!");
 | 
			
		||||
                throw new BadRequestException(pick.getCode() + "分配失败,翻包区没有空闲点位!");
 | 
			
		||||
            }
 | 
			
		||||
            endPoint = pointList.get(0);
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -294,11 +298,8 @@ public class PickDetailServiceImpl implements PickDetailService {
 | 
			
		|||
            msgList.add(allocate(pickDetail.getId(), pickDetail.getOrderQty(), endPoint));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        boolean containsSuccess = msgList.stream().anyMatch(s -> s.contains("分配成功"));
 | 
			
		||||
        if (containsSuccess) {
 | 
			
		||||
            /* 更新出库单状态并写入目标点位*/
 | 
			
		||||
            refreshPickStatus(pick, endPoint);
 | 
			
		||||
        }
 | 
			
		||||
        /* 更新出库单状态并写入目标点位*/
 | 
			
		||||
        refreshPickStatus(pick, endPoint);
 | 
			
		||||
 | 
			
		||||
        //保存日志
 | 
			
		||||
        logService.saveLogInfo(pick.getCode(), pick.getCode(), "/pick/allocatePick", msgList.toString(), "出库单分配", 200, "info");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -180,7 +180,7 @@ public class PickServiceImpl implements PickService {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void materialBl(Yclbl yclbl) {
 | 
			
		||||
    public synchronized void materialBl(Yclbl yclbl) {
 | 
			
		||||
 | 
			
		||||
        /** 验证参数有效性 */
 | 
			
		||||
        validatePick(yclbl);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue