fix(sales): 修复红字销售订单和发票推送逻辑
- 在 SoSaleOutPluginInitializerToB 和 SoSaleReturnPluginInitializerToB 中增加 SKU 编码空格处理 - 在 ProxyPurchaseWarehousWarehouse 和 SoSaleReturnPluginInitializerToB 中增加实收/实退数量为 0 时的过滤逻辑 - 优化红字销售订单和发票的推送逻辑,避免重复推送 - 调整测试用例执行方式
This commit is contained in:
parent
1e18edd0a4
commit
a8e0d79bc4
|
@ -1376,7 +1376,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
|
|||
Assert.notNull(pkCorp, "发货公司主键不能为空");
|
||||
|
||||
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
bdInvmandocEntity.setInvcode(detailsDto.getSkuCode());
|
||||
bdInvmandocEntity.setInvcode(detailsDto.getSkuCode().trim());
|
||||
bdInvmandocEntity.setPkCorp(pkCorp);
|
||||
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
||||
if (bdInvmandocEntity2.size() == 0) {
|
||||
|
|
|
@ -835,6 +835,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
// BdInvclEntity bdInvclEntity = queryU8CEntityUtil.queryBdInvbasdocByBdInvcl(bdInvbasdocEntity);
|
||||
// BdCostsubjEntity bdCostsubjEntity = queryU8CEntityUtil.queryBdCostsubj(bdInvclEntity);
|
||||
|
||||
//如果实退数量=0,则过滤掉,不增加到明细列表中
|
||||
if ("0".equals(new BigDecimal(stockinB.getReceivedQty()).stripTrailingZeros().toPlainString())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 如果是海外的店铺,则税率为零
|
||||
String exportVaue = ExportConstant.exportConstant.get(header.getStoreCode());
|
||||
if (exportVaue != null) {
|
||||
|
@ -912,6 +917,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
saleorderRequestDtoList.add(saleorderRequestDto);
|
||||
|
||||
synchronized (PUSH_LOCK1) {
|
||||
if (saleorderRequestChildrenDtoList.size() > 0) {
|
||||
Boolean aBoolean = checkTobOrder(header.getId(), header.getCode());
|
||||
if (!aBoolean) {
|
||||
logger.error("经过SQL查询判断,在U8C(红字)销售订单不存在OFS入库单号为:{} OFS入库主键为:{}的单据,将调用U8C接口执行推送!", header.getCode(), header.getId());
|
||||
|
@ -935,6 +941,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
logger.error("经过SQL查询判断,在U8C(红字)销售订单存在OFS入库单号为:{} OFS入库主键为:{}的单据,为了避免造成单据重复,不推送到U8C!", header.getCode(), header.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("TOB售后收入推送U8C失败", e);
|
||||
//记录失败
|
||||
|
@ -1643,7 +1650,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
Assert.notNull(pkCorp, "发货公司主键不能为空");
|
||||
|
||||
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
bdInvmandocEntity.setInvcode(detailsDto.getSkuCode());
|
||||
bdInvmandocEntity.setInvcode(detailsDto.getSkuCode().trim());
|
||||
bdInvmandocEntity.setPkCorp(pkCorp);
|
||||
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity);
|
||||
if (bdInvmandocEntity2.size() == 0) {
|
||||
|
@ -1924,6 +1931,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
// BdInvclEntity bdInvclEntity = queryU8CEntityUtil.queryBdInvbasdocByBdInvcl(bdInvbasdocEntity);
|
||||
// BdCostsubjEntity bdCostsubjEntity = queryU8CEntityUtil.queryBdCostsubj(bdInvclEntity);
|
||||
|
||||
//如果实入数量为0则过滤掉
|
||||
if ("0".equals(new BigDecimal(stockinB.getReceivedQty()).stripTrailingZeros().toPlainString())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//计算公式
|
||||
StringBuffer calculationFormula = new StringBuffer();
|
||||
// calculationFormula.append("O实退金额");
|
||||
|
@ -1980,6 +1992,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
|
||||
//推送到U8C生成销售发票
|
||||
synchronized (PUSH_LOCK2) {
|
||||
if (salesInvoiceBodyDtoList.size() > 0) {
|
||||
Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode());
|
||||
if (!aBoolean) {
|
||||
logger.error("经过SQL查询判断,在U8C红字销售发票中不存在OFS入库单号为:{} OFS入库主键为:{}的单据,将调用U8C接口执行推送!", header.getCode(), header.getId());
|
||||
|
@ -2001,6 +2014,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
|
|||
logger.error("经过SQL查询判断,在U8C红字销售发票中已经存在OFS入库单号为:{} OFS入库主键为:{}的单据,为了避免造成单据重复,不推送到U8C!", header.getCode(), header.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("TOB售后到账完成推送U8C抛出异常", e);
|
||||
// 记录失败
|
||||
|
|
|
@ -37,7 +37,9 @@ public class SoSaleReturnPluginInitializerToBTest {
|
|||
|
||||
// soSaleReturnPluginInitializerToB.startImplementByCode("LETS-RE2024112200000301", "tran");
|
||||
|
||||
soSaleReturnPluginInitializerToB.startImplementByStockTime("2024-11-29 00:00:00", "2024-11-30 23:59:59");
|
||||
// soSaleReturnPluginInitializerToB.startImplementByStockTime("2024-11-29 00:00:00", "2024-11-30 23:59:59");
|
||||
|
||||
soSaleReturnPluginInitializerToB.startImplementByCode("LETS-RE2025042200001200", "stock");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue