bug-1510 发货管理-条码打印-物料码打印

This commit is contained in:
曹鹏飞 2026-05-25 14:07:23 +08:00
parent b15b3cb55b
commit 9a54619974
3 changed files with 45 additions and 1 deletions

View File

@ -62,7 +62,7 @@ public class WmsShipmentMaterialCode implements Serializable {
private String orderDate;
/**
* 状态0开始1打包中2已完成
* 状态0装货1已装货2已装车3已发车4已收货
*/
private Integer status;

View File

@ -719,12 +719,24 @@ public class MaterialCodeController extends BaseController {
WmsShipmentPackagingCode info = packagingCodeService.getById(qo.getPackagingCodeId());
VUtil.trueThrowBusinessError(Objects.isNull(info)).throwMessage("包装箱不存在");
VUtil.trueThrowBusinessError(info.getStatus() > 1).throwMessage("包装箱已装车");
Set<Long> materialCodeIds = materialCodeForwardService.lambdaQuery()
.select(WmsShipmentMaterialCodeForward::getMaterialCodeId)
.in(WmsShipmentMaterialCodeForward::getId, qo.getIds())
.list()
.stream()
.map(WmsShipmentMaterialCodeForward::getMaterialCodeId)
.collect(Collectors.toSet());
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(materialCodeIds)).throwMessage("没有需要装箱的数据");
materialCodeForwardService.lambdaUpdate()
.set(WmsShipmentMaterialCodeForward::getStatus, 2)
.set(WmsShipmentMaterialCodeForward::getPackagingCodeId, qo.getPackagingCodeId())
.isNull(WmsShipmentMaterialCodeForward::getPackagingCodeId)
.in(WmsShipmentMaterialCodeForward::getId, qo.getIds())
.update();
materialCodeService.lambdaUpdate()
.set(WmsShipmentMaterialCode::getStatus,2)
.in(WmsShipmentMaterialCode::getId, materialCodeIds)
.update();
return ApiResult.success();
}

View File

@ -65,6 +65,9 @@ public class PackagingCodeController extends BaseController {
@Resource
private IDictionaryItemService dictionaryItemService;
@Resource
private IWmsShipmentMaterialCodeService materialCodeService;
@Resource
private BasdeSerialNumberControllerService serialNumberControllerService;
@ -225,6 +228,20 @@ public class PackagingCodeController extends BaseController {
materialCodeItemQrService.updateBatchById(itemQrs);
materialCodeItemService.updateStatusAndBoxNoAndActualNum(items, 2, info.getNo(), null, itemId2ActualNumMap);
// 更新WmsShipmentMaterialCode状态为1已装货
Set<Long> materialCodeIds = items.stream()
.map(WmsShipmentMaterialCodeItem::getMaterialCodeId)
.collect(Collectors.toSet());
if (CollectionUtil.isNotEmpty(materialCodeIds)) {
materialCodeService.lambdaUpdate()
.set(WmsShipmentMaterialCode::getStatus, 1)
.set(WmsShipmentMaterialCode::getUpdateBy, UserUtil.getUserName())
.set(WmsShipmentMaterialCode::getUpdateTime, LocalDateTime.now())
.in(WmsShipmentMaterialCode::getId, materialCodeIds)
.eq(WmsShipmentMaterialCode::getStatus, 0)
.update();
}
addMaterialCodeItemIfNumBigThenActualNum(materialCodeItemKey2NewActualNumMap, items);
}
return ApiResult.success();
@ -361,6 +378,21 @@ public class PackagingCodeController extends BaseController {
);
materialCodeItemQrService.updateBatchById(itemQrs);
materialCodeItemService.updateStatusAndBoxNoAndActualNum(items, 2, info.getNo(),null, itemId2ActualNumMap);
// 更新WmsShipmentMaterialCode状态为1已装货
Set<Long> materialCodeIds = items.stream()
.map(WmsShipmentMaterialCodeItem::getMaterialCodeId)
.collect(Collectors.toSet());
if (CollectionUtil.isNotEmpty(materialCodeIds)) {
materialCodeService.lambdaUpdate()
.set(WmsShipmentMaterialCode::getStatus, 1)
.set(WmsShipmentMaterialCode::getUpdateBy, UserUtil.getUserName())
.set(WmsShipmentMaterialCode::getUpdateTime, LocalDateTime.now())
.in(WmsShipmentMaterialCode::getId, materialCodeIds)
.eq(WmsShipmentMaterialCode::getStatus, 0)
.update();
}
addMaterialCodeItemIfNumBigThenActualNum(materialCodeItemKey2NewActualNumMap, items);
return ApiResult.success();