fix(delivery): 修复收货确认功能中的空值和零值处理问题
- 移除scanCodes为空的收货参数项,避免后续处理异常 - 修复receiptNum字段的零值比较逻辑,使用compareTo方法替代equals方法 - 移除receiptNum字段的@NotNull注解以允许零值传递
This commit is contained in:
parent
339620ab9e
commit
ac440cb861
|
|
@ -189,6 +189,7 @@ public class NormalPGIController extends BaseController {
|
||||||
@ApiMark(moduleName = "送货单管理", apiName = "收货确认")
|
@ApiMark(moduleName = "送货单管理", apiName = "收货确认")
|
||||||
public ApiResult<Void> takeDelivery(@Valid @RequestBody List<SrmMaterialReceiptQO> request) {
|
public ApiResult<Void> takeDelivery(@Valid @RequestBody List<SrmMaterialReceiptQO> request) {
|
||||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(request)).throwMessage("收货参数为空");
|
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(request)).throwMessage("收货参数为空");
|
||||||
|
request.removeIf(it -> CollectionUtil.isEmpty(it.getScanCodes()));
|
||||||
WmsSrmOrder order = wmsSrmOrderService.lambdaQuery().eq(WmsSrmOrder::getNoteNum, request.get(0).getNoteNum()).one();
|
WmsSrmOrder order = wmsSrmOrderService.lambdaQuery().eq(WmsSrmOrder::getNoteNum, request.get(0).getNoteNum()).one();
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("收货单不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("收货单不存在");
|
||||||
List<SAPSyncParamsDTO> sapSyncParamsDTOS = getSapSyncParamsDTOS(request, order);
|
List<SAPSyncParamsDTO> sapSyncParamsDTOS = getSapSyncParamsDTOS(request, order);
|
||||||
|
|
@ -223,7 +224,7 @@ public class NormalPGIController extends BaseController {
|
||||||
|
|
||||||
for (SrmMaterialReceiptQO item : request) {
|
for (SrmMaterialReceiptQO item : request) {
|
||||||
|
|
||||||
if (item.getReceiptNum().equals(BigDecimal.ZERO))
|
if (item.getReceiptNum().compareTo(BigDecimal.ZERO)==0)
|
||||||
continue;
|
continue;
|
||||||
// 处理二维码
|
// 处理二维码
|
||||||
List<PDAScanCodeQO> autoFindChildCodes = Lists.newArrayList();
|
List<PDAScanCodeQO> autoFindChildCodes = Lists.newArrayList();
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ public class SrmMaterialReceiptQO {
|
||||||
/**
|
/**
|
||||||
* 实际收货数量
|
* 实际收货数量
|
||||||
*/
|
*/
|
||||||
@NotNull
|
|
||||||
private BigDecimal receiptNum;
|
private BigDecimal receiptNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue