feat(sales): 过滤实入数量为零的销售退货单明细行
- 新增 filterReceivedQtyZero 方法,用于过滤实入数量为 0 的明细行- 在处理销售退货单时,调用该方法过滤掉无效的明细行 - 优化了代码结构,提高了数据处理的准确性
This commit is contained in:
parent
1633bef047
commit
919cc07177
|
@ -737,6 +737,13 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
String keyGroup = entry.getKey();
|
||||
List<GoodsRertunSonDetailsDto> oldValue = entry.getValue();
|
||||
|
||||
//如果oldValue存在实入数量=0的明细行则过滤掉
|
||||
//2025年5月6日10:12:21 和丽知闫旭、妮姐沟通,如果oldValue存在实入数量=0的明细行则过滤掉
|
||||
filterReceivedQtyZero(oldValue);
|
||||
if (oldValue == null || oldValue.size() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
StockinOrderSearchResponse.StockinOrder.StockinH header = oldValue.get(0).getHeader();
|
||||
BdCorpEntity bdCorpEntity = oldValue.get(0).getBdCorpEntity();//表头销售公司
|
||||
BdCorpEntity deliverGoodsCorp = oldValue.get(0).getDeliverGoodsCorp();//发货公司
|
||||
|
@ -3469,10 +3476,19 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
return JSON.parseObject(resultData, ArapDjzb.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
logger.error("解析返回参数失败的错误", e);
|
||||
//如果解析失败,记录原因,但是不能影响结果的记录
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤掉实入数量为0的List
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private void filterReceivedQtyZero(List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtoList) {
|
||||
goodsRertunSonDetailsDtoList.removeIf(dto -> dto != null && ("0".equals(dto.getReceivedQty()) || dto.getReceivedQty() == null));
|
||||
}
|
||||
}
|
|
@ -43,20 +43,20 @@ public class SoSaleReturnPluginInitializerToCTest {
|
|||
// soSaleReturnPluginInitializerToC.startImplement(null, null);
|
||||
try {
|
||||
//带优惠金额场景
|
||||
// String code = "LETS-RE2025030100000112";
|
||||
// soSaleReturnPluginInitializerToC.startImplementByCode(code, "tran");
|
||||
String code = "LETS-RE2025042100000200";
|
||||
soSaleReturnPluginInitializerToC.startImplementByCode(code, "stock");
|
||||
|
||||
//无优惠金额场景
|
||||
// String code = "LETS-RE2025031900000002";
|
||||
// soSaleReturnPluginInitializerToC.startImplementByCode(code, "tran");
|
||||
|
||||
List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoArrayList = new ArrayList<>();
|
||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||
queryOfsSoSaleOutVo.setCode("LETS-SO2025040100000698");
|
||||
ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L);
|
||||
if (headerDetailsDtoArrayList.size() > 0) {
|
||||
System.out.println(headerDetailsDtoArrayList.get(0));
|
||||
}
|
||||
// List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoArrayList = new ArrayList<>();
|
||||
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||
// queryOfsSoSaleOutVo.setCode("LETS-SO2025040100000698");
|
||||
// ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L);
|
||||
// if (headerDetailsDtoArrayList.size() > 0) {
|
||||
// System.out.println(headerDetailsDtoArrayList.get(0));
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue