no message

main
HUOJIN\92525 2024-09-02 11:27:59 +08:00
parent 1ad1e96b95
commit f4d01455be
2 changed files with 9 additions and 8 deletions

View File

@ -24,6 +24,7 @@ import com.youchain.basicdata.service.mapstruct.ItemMapper;
import com.youchain.businessdata.domain.*; import com.youchain.businessdata.domain.*;
import com.youchain.businessdata.repository.*; import com.youchain.businessdata.repository.*;
import com.youchain.businessdata.service.dto.InventoryDto; import com.youchain.businessdata.service.dto.InventoryDto;
import com.youchain.exception.BadRequestException;
import com.youchain.modules.quartz.utils.TimeNumberUtils; import com.youchain.modules.quartz.utils.TimeNumberUtils;
import com.youchain.modules.system.domain.Dept; import com.youchain.modules.system.domain.Dept;
import com.youchain.service.LogService; import com.youchain.service.LogService;
@ -265,7 +266,7 @@ public class PickDetailServiceImpl implements PickDetailService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void allocatePick(Pick pick) { public void allocatePick(Pick pick) {
//目标库位 //目标库位
Point endPoint = null; Point endPoint = null;
@ -275,11 +276,14 @@ public class PickDetailServiceImpl implements PickDetailService {
areaCode = AreaNameDic.XJFBQ; areaCode = AreaNameDic.XJFBQ;
} else if (BaseStatus.GD_TYPE_DP.equals(pick.getOrderType())) { } else if (BaseStatus.GD_TYPE_DP.equals(pick.getOrderType())) {
areaCode = AreaNameDic.DJFBQ; areaCode = AreaNameDic.DJFBQ;
}else{
throw new BadRequestException("出库单类型错误!");
} }
List<Point> pointList = pointRepository.findByCode(null, BaseStatus.FREE, BaseStatus.BOX, areaCode, null, null); List<Point> pointList = pointRepository.findByCode(null, BaseStatus.FREE, BaseStatus.BOX, areaCode, null, null);
if (pointList.isEmpty()) { if (pointList.isEmpty()) {
logService.saveLogInfo(pick.getCode(), pick.getCode(), "/pick/allocatePick", "分配失败,翻包区没有空闲点位!", "出库单分配", 200, "info"); logService.saveLogInfo(pick.getCode(), pick.getCode(), "/pick/allocatePick", "分配失败,翻包区没有空闲点位!", "出库单分配", 200, "info");
throw new IllegalArgumentException(pick.getCode() + "分配失败,翻包区没有空闲点位!"); throw new BadRequestException(pick.getCode() + "分配失败,翻包区没有空闲点位!");
} }
endPoint = pointList.get(0); endPoint = pointList.get(0);
} else { } else {
@ -294,11 +298,8 @@ public class PickDetailServiceImpl implements PickDetailService {
msgList.add(allocate(pickDetail.getId(), pickDetail.getOrderQty(), endPoint)); 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"); logService.saveLogInfo(pick.getCode(), pick.getCode(), "/pick/allocatePick", msgList.toString(), "出库单分配", 200, "info");

View File

@ -180,7 +180,7 @@ public class PickServiceImpl implements PickService {
} }
@Override @Override
public void materialBl(Yclbl yclbl) { public synchronized void materialBl(Yclbl yclbl) {
/** 验证参数有效性 */ /** 验证参数有效性 */
validatePick(yclbl); validatePick(yclbl);