fix: 修改文件名大小写
This commit is contained in:
parent
40e7383554
commit
c2b10a8c40
|
@ -971,9 +971,9 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
//合并后如果数量为0,则过滤掉
|
//合并后如果数量为0,则过滤掉
|
||||||
if ("0".equals(passiveStorageSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
// if ("0".equals(passiveStorageSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//推送u8c
|
//推送u8c
|
||||||
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
||||||
|
@ -1080,7 +1080,7 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
BigDecimal groupShipQty = passiveStorageSonDetailsDto2.getGroupShipQty();
|
BigDecimal groupShipQty = passiveStorageSonDetailsDto2.getGroupShipQty();
|
||||||
|
|
||||||
//当金额>0,但数量为0时,推送红字应收单
|
//当金额>0,但数量为0时,推送红字应收单
|
||||||
if (groupTotalPayAmount1 != null && groupShipQty != null && groupTotalPayAmount1.compareTo(BigDecimal.ZERO) > 0 && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
// if (groupTotalPayAmount1 != null && groupShipQty != null && groupTotalPayAmount1.compareTo(BigDecimal.ZERO) > 0 && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
try {
|
try {
|
||||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV4();
|
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV4();
|
||||||
// 生成业务日期
|
// 生成业务日期
|
||||||
|
@ -1127,9 +1127,9 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
// 如果合并后的金额为0,则不传到U8C
|
// 如果合并后的金额为0,则不传到U8C
|
||||||
Assert.notNull(passiveStorageSonDetailsDto2.getGroupTotalPayAmount(), "passiveStorageSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
Assert.notNull(passiveStorageSonDetailsDto2.getGroupTotalPayAmount(), "passiveStorageSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
||||||
BigDecimal groupTotalPayAmount = passiveStorageSonDetailsDto2.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
BigDecimal groupTotalPayAmount = passiveStorageSonDetailsDto2.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
if ("0".equals(groupTotalPayAmount.stripTrailingZeros().toPlainString())) {
|
// if ("0".equals(groupTotalPayAmount.stripTrailingZeros().toPlainString())) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
String tax = null;//税率
|
String tax = null;//税率
|
||||||
BigDecimal noriginalcurmny = null;//无税金额
|
BigDecimal noriginalcurmny = null;//无税金额
|
||||||
|
@ -1148,12 +1148,17 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
ArapDjzbVO.Childrenn arapDjzbVOChildrenn = new ArapDjzbVO.Childrenn();
|
ArapDjzbVO.Childrenn arapDjzbVOChildrenn = new ArapDjzbVO.Childrenn();
|
||||||
pushScenarioType.add(arapDjzbVOChildrenn);
|
pushScenarioType.add(arapDjzbVOChildrenn);
|
||||||
arapDjzbVOChildrenn.setCinventoryid(bdInvbasdocEntity.getInvcode());//存货管理档案
|
arapDjzbVOChildrenn.setCinventoryid(bdInvbasdocEntity.getInvcode());//存货管理档案
|
||||||
|
if (groupTotalPayAmount.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
arapDjzbVOChildrenn.setJfbbje("0");//借方本币金额
|
||||||
|
arapDjzbVOChildrenn.setJfybje("0");//借方原币金额
|
||||||
|
} else {
|
||||||
arapDjzbVOChildrenn.setJfbbje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方本币金额
|
arapDjzbVOChildrenn.setJfbbje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方本币金额
|
||||||
arapDjzbVOChildrenn.setJfybje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方原币金额
|
arapDjzbVOChildrenn.setJfybje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方原币金额
|
||||||
arapDjzbVOChildrenn.setJfbbsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方本币税金
|
}
|
||||||
arapDjzbVOChildrenn.setJfybsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方原币税金
|
// arapDjzbVOChildrenn.setJfbbsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方本币税金
|
||||||
arapDjzbVOChildrenn.setWbfbbje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方本币无税金额
|
// arapDjzbVOChildrenn.setJfybsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方原币税金
|
||||||
arapDjzbVOChildrenn.setJfybwsje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方原币无税金额
|
// arapDjzbVOChildrenn.setWbfbbje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方本币无税金额
|
||||||
|
// arapDjzbVOChildrenn.setJfybwsje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方原币无税金额
|
||||||
|
|
||||||
//退货没有邮费金额,已经向万万确认
|
//退货没有邮费金额,已经向万万确认
|
||||||
//平台优惠
|
//平台优惠
|
||||||
|
@ -1205,11 +1210,19 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 推送U8C
|
//如果实推总金额>0、单数量等于0
|
||||||
|
// for (int i = 0; i < pushScenarioType.size(); i++) {
|
||||||
|
// ArapDjzbVO.Childrenn childrenn = pushScenarioType.get(i);
|
||||||
|
// childrenn.setJfbbje("1");
|
||||||
|
// }
|
||||||
|
// groupShipQty = new BigDecimal("0");
|
||||||
|
if ((filterJfbbjeIncludingTax(pushScenarioType)) && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
List<ArapDjzbVO.Childrenn> childrenns = filterZeroJfbbje(pushScenarioType);
|
||||||
|
// 推送U8C
|
||||||
List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
||||||
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
||||||
arapDjzbVO.setParentvo(parentVo);
|
arapDjzbVO.setParentvo(parentVo);
|
||||||
arapDjzbVO.setChildren(pushScenarioType);
|
arapDjzbVO.setChildren(childrenns);
|
||||||
arapDjzbVOList.add(arapDjzbVO);
|
arapDjzbVOList.add(arapDjzbVO);
|
||||||
|
|
||||||
Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
||||||
|
@ -1226,6 +1239,7 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
logger.info("TOC红字应收单:{} 应收单主键:{} 销售公司:{}", djbh, vouchid, dwbm);
|
logger.info("TOC红字应收单:{} 应收单主键:{} 销售公司:{}", djbh, vouchid, dwbm);
|
||||||
// 记录同步状态
|
// 记录同步状态
|
||||||
updateSuccessOrFail3(value, "Y", "success", djbh, vouchid, value.get(0).getStorageTimeStamp());
|
updateSuccessOrFail3(value, "Y", "success", djbh, vouchid, value.get(0).getStorageTimeStamp());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC红字应收单转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
logger.error("TOC红字应收单转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
//记录失败
|
//记录失败
|
||||||
|
@ -1235,10 +1249,10 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
updateSuccessOrFail3(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
updateSuccessOrFail3(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
//当金额大于或者等于0,数量大于0推送销售订单
|
//当金额大于或者等于0,数量大于0推送销售订单
|
||||||
if (groupTotalPayAmount1 != null && groupShipQty != null && groupTotalPayAmount1.compareTo(BigDecimal.ZERO) >= 0 && groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
// if (groupTotalPayAmount1 != null && groupShipQty != null && groupTotalPayAmount1.compareTo(BigDecimal.ZERO) >= 0 && groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
try {
|
try {
|
||||||
String generateBusinessDate = value.get(0).getTargetBusinessDate().substring(0, 10);
|
String generateBusinessDate = value.get(0).getTargetBusinessDate().substring(0, 10);
|
||||||
|
|
||||||
|
@ -1328,9 +1342,9 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
//合并后如果数量为0,则过滤掉
|
//合并后如果数量为0,则过滤掉
|
||||||
if ("0".equals(passiveStorageSonDetailsDto2.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
// if ("0".equals(passiveStorageSonDetailsDto2.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto = new SaleorderRequestChildrenDto();
|
SaleorderRequestChildrenDto saleorderRequestChildrenDto = new SaleorderRequestChildrenDto();
|
||||||
saleorderRequestChildrenDto.setBlargessflag(isblargessflag);//是否赠品
|
saleorderRequestChildrenDto.setBlargessflag(isblargessflag);//是否赠品
|
||||||
|
@ -1441,6 +1455,8 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//数量大于0,推送销售订单
|
||||||
|
if (groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
boolean oneSuccess = false;
|
boolean oneSuccess = false;
|
||||||
if (!"Y".equals(newState)) {
|
if (!"Y".equals(newState)) {
|
||||||
//推送U8C红字销售订单,如果推送失败,抛出异常,那么就会外围的try catch捕获,代码不会往下执行
|
//推送U8C红字销售订单,如果推送失败,抛出异常,那么就会外围的try catch捕获,代码不会往下执行
|
||||||
|
@ -1496,6 +1512,7 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
updateSuccessOrFail4(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
updateSuccessOrFail4(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//记录红字销售订单异常失败
|
//记录红字销售订单异常失败
|
||||||
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
|
@ -1505,7 +1522,7 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
updateSuccessOrFail3(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
updateSuccessOrFail3(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//2024年8月6日 11:28:54此处不记录失败,不认为是错误
|
//2024年8月6日 11:28:54此处不记录失败,不认为是错误
|
||||||
|
@ -5002,4 +5019,48 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
||||||
throw new Exception("子线程执行失败: " + childException.getMessage(), childException);
|
throw new Exception("子线程执行失败: " + childException.getMessage(), childException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断红字应收单
|
||||||
|
*/
|
||||||
|
private boolean filterJfbbjeIncludingTax(List<ArapDjzbVO.Childrenn> childrennArrayList) {
|
||||||
|
// 处理空列表或null:视为"全部为0",返回false
|
||||||
|
if (childrennArrayList == null || childrennArrayList.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (ArapDjzbVO.Childrenn dto : childrennArrayList) {
|
||||||
|
String jfbbje = dto.getJfbbje();
|
||||||
|
if (jfbbje == null || jfbbje.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal amount = new BigDecimal(jfbbje);
|
||||||
|
if (amount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
// 发现非0值,立即返回true
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤掉集合中jfbbje为0的元素
|
||||||
|
*
|
||||||
|
* @return 过滤后的新集合(不包含jfbbje=0的元素)
|
||||||
|
*/
|
||||||
|
private List<ArapDjzbVO.Childrenn> filterZeroJfbbje(List<ArapDjzbVO.Childrenn> childrennArrayList) {
|
||||||
|
// 处理空输入
|
||||||
|
if (childrennArrayList == null || childrennArrayList.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用Stream API过滤0值
|
||||||
|
return childrennArrayList.stream().filter(dto -> {
|
||||||
|
String jfbbje = dto.getJfbbje();
|
||||||
|
if (jfbbje == null || jfbbje.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return new BigDecimal(jfbbje).compareTo(BigDecimal.ZERO) != 0;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -888,9 +888,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
//合并后如果数量为0,则过滤掉
|
//合并后如果数量为0,则过滤掉
|
||||||
if ("0".equals(goodsRertunSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
// if ("0".equals(goodsRertunSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto = new SaleorderRequestChildrenDto();
|
SaleorderRequestChildrenDto saleorderRequestChildrenDto = new SaleorderRequestChildrenDto();
|
||||||
saleorderRequestChildrenDto.setBlargessflag(isblargessflag);//是否赠品
|
saleorderRequestChildrenDto.setBlargessflag(isblargessflag);//是否赠品
|
||||||
|
@ -989,6 +989,12 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果所有明细行价税合计都为0,则过滤
|
||||||
|
//2025年8月22日09:33:03 生成销售订单如果总金额为0(但存在数量)不需要过滤,已经和闫旭沟通
|
||||||
|
// if (!filterTotalAmountIncludingTax(saleorderRequestChildrenDtoList)) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
//推送u8c生成红字销售订单
|
//推送u8c生成红字销售订单
|
||||||
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
||||||
|
@ -1104,7 +1110,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
BigDecimal groupTotalPayAmount = goodsRertunSonDetailsDto.getGroupTotalPayAmount();
|
BigDecimal groupTotalPayAmount = goodsRertunSonDetailsDto.getGroupTotalPayAmount();
|
||||||
|
|
||||||
//当金额>0,但数量为0时,推送红字应收单
|
//当金额>0,但数量为0时,推送红字应收单
|
||||||
if (groupTotalPayAmount != null && groupShipQty != null && groupTotalPayAmount.compareTo(BigDecimal.ZERO) > 0 && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
// if (groupTotalPayAmount != null && groupShipQty != null && groupTotalPayAmount.compareTo(BigDecimal.ZERO) > 0 && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
try {
|
try {
|
||||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV4();
|
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV4();
|
||||||
//生成业务日期
|
//生成业务日期
|
||||||
|
@ -1146,9 +1152,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
//如果合并后的金额为0,则不传到U8C
|
//如果合并后的金额为0,则不传到U8C
|
||||||
Assert.notNull(goodsRertunSonDetailsDto.getGroupTotalPayAmount(), "goodsRertunSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
Assert.notNull(goodsRertunSonDetailsDto.getGroupTotalPayAmount(), "goodsRertunSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
||||||
BigDecimal groupTotalPayAmount2 = goodsRertunSonDetailsDto.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
BigDecimal groupTotalPayAmount2 = goodsRertunSonDetailsDto.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
if ("0".equals(groupTotalPayAmount2.stripTrailingZeros().toPlainString())) {
|
// if ("0".equals(groupTotalPayAmount2.stripTrailingZeros().toPlainString())) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//修改为生成红字应收单表体
|
//修改为生成红字应收单表体
|
||||||
List<ArapDjzbVO.Childrenn> childrennArrayList = new ArrayList<>();
|
List<ArapDjzbVO.Childrenn> childrennArrayList = new ArrayList<>();
|
||||||
|
@ -1212,12 +1218,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果总金额不为0,并且数量=0,生成红字应收单
|
||||||
|
// for (int i = 0; i < childrennArrayList.size(); i++) {
|
||||||
|
// ArapDjzbVO.Childrenn childrenn = childrennArrayList.get(i);
|
||||||
|
// childrenn.setJfbbje("0");
|
||||||
|
// }
|
||||||
|
// groupShipQty = new BigDecimal("0");
|
||||||
|
if ((filterJfbbjeIncludingTax(childrennArrayList)) && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
List<ArapDjzbVO.Childrenn> childrenns = filterZeroJfbbje(childrennArrayList);
|
||||||
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
//推送U8C生成红字应收单
|
//推送U8C生成红字应收单
|
||||||
List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
||||||
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
||||||
arapDjzbVO.setParentvo(parentVo);
|
arapDjzbVO.setParentvo(parentVo);
|
||||||
arapDjzbVO.setChildren(childrennArrayList);
|
arapDjzbVO.setChildren(childrenns);
|
||||||
arapDjzbVOList.add(arapDjzbVO);
|
arapDjzbVOList.add(arapDjzbVO);
|
||||||
|
|
||||||
Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
||||||
|
@ -1245,6 +1259,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
} else {
|
} else {
|
||||||
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
//记录失败
|
//记录失败
|
||||||
|
@ -1254,10 +1269,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
updateSuccessOrFail2(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
updateSuccessOrFail2(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
//当金额大于或者等于0,数量大于0推送销售订单
|
//当金额大于或者等于0,数量大于0推送销售订单
|
||||||
if (groupShipQty != null && groupTotalPayAmount != null && groupTotalPayAmount.compareTo(BigDecimal.ZERO) >= 0 && groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
// if (groupShipQty != null && groupTotalPayAmount != null && groupTotalPayAmount.compareTo(BigDecimal.ZERO) >= 0 && groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
try {
|
try {
|
||||||
// checkArchives(oldValue.get(0));
|
// checkArchives(oldValue.get(0));
|
||||||
//生成业务日期
|
//生成业务日期
|
||||||
|
@ -1340,9 +1355,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
// BdCostsubjEntity bdCostsubjEntity = queryU8CEntityUtil.queryBdCostsubj(bdInvclEntity);
|
// BdCostsubjEntity bdCostsubjEntity = queryU8CEntityUtil.queryBdCostsubj(bdInvclEntity);
|
||||||
|
|
||||||
//合并后如果数量为0,则过滤掉
|
//合并后如果数量为0,则过滤掉
|
||||||
if ("0".equals(goodsRertunSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
// if ("0".equals(goodsRertunSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString())) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// String tax = new BigDecimal(bdTaxitemsEntity1.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
|
// String tax = new BigDecimal(bdTaxitemsEntity1.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
|
||||||
|
|
||||||
|
@ -1489,6 +1504,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//存货数量>0生成红字销售订单
|
||||||
|
if (groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
//判断入库时间(关单时间)与交易成功时间,推送u8c生成蓝字销售订单,仅满足情况二的条件才生成这张蓝字销售订单
|
||||||
boolean oneSuccess = false;
|
boolean oneSuccess = false;
|
||||||
if (!"Y".equals(newstate4)) {
|
if (!"Y".equals(newstate4)) {
|
||||||
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
|
@ -1545,7 +1563,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
oneSuccess = true;
|
oneSuccess = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断入库时间(关单时间)与交易成功时间,推送u8c生成蓝字销售订单,仅满足情况二的条件才生成这张蓝字销售订单
|
|
||||||
try {
|
try {
|
||||||
if (!"Y".equals(def15) && oneSuccess && "2".equals(oldValue.get(0).getStorageTimeStamp())) {
|
if (!"Y".equals(def15) && oneSuccess && "2".equals(oldValue.get(0).getStorageTimeStamp())) {
|
||||||
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||||
|
@ -1590,6 +1607,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
updateSuccessOrFail3(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
updateSuccessOrFail3(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//记录红字销售订单异常失败
|
//记录红字销售订单异常失败
|
||||||
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||||
|
@ -1599,7 +1617,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
updateSuccessOrFail2(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
updateSuccessOrFail2(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//2024年8月6日 11:28:54此处不记录失败,不认为是错误
|
//2024年8月6日 11:28:54此处不记录失败,不认为是错误
|
||||||
|
@ -4275,4 +4293,88 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
throw new Exception("子线程执行失败: " + childException.getMessage(), childException);
|
throw new Exception("子线程执行失败: " + childException.getMessage(), childException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果所有明细行价税合计都为0,则过滤
|
||||||
|
*
|
||||||
|
* @author liuyang
|
||||||
|
*/
|
||||||
|
// private boolean filterTotalAmountIncludingTax(List<SaleorderRequestChildrenDto> saleorderRequestChildrenDtoList) {
|
||||||
|
// if (saleorderRequestChildrenDtoList != null && saleorderRequestChildrenDtoList.size() > 0) {
|
||||||
|
// for (int i = 0; i < saleorderRequestChildrenDtoList.size(); i++) {
|
||||||
|
// SaleorderRequestChildrenDto saleorderRequestChildrenDto = saleorderRequestChildrenDtoList.get(i);
|
||||||
|
// String noriginalcursummny = saleorderRequestChildrenDto.getNoriginalcursummny();
|
||||||
|
// BigDecimal noriginalcursummnyBigDecimal = new BigDecimal(noriginalcursummny);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断销售订单
|
||||||
|
*/
|
||||||
|
private boolean filterTotalAmountIncludingTax(List<SaleorderRequestChildrenDto> saleorderRequestChildrenDtoList) {
|
||||||
|
// 处理空列表或null:视为"全部为0",返回false
|
||||||
|
if (saleorderRequestChildrenDtoList == null || saleorderRequestChildrenDtoList.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (SaleorderRequestChildrenDto dto : saleorderRequestChildrenDtoList) {
|
||||||
|
String amountStr = dto.getNoriginalcursummny();
|
||||||
|
if (amountStr == null || amountStr.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal amount = new BigDecimal(amountStr);
|
||||||
|
if (amount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
// 发现非0值,立即返回true
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断红字应收单
|
||||||
|
*/
|
||||||
|
private boolean filterJfbbjeIncludingTax(List<ArapDjzbVO.Childrenn> childrennArrayList) {
|
||||||
|
// 处理空列表或null:视为"全部为0",返回false
|
||||||
|
if (childrennArrayList == null || childrennArrayList.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (ArapDjzbVO.Childrenn dto : childrennArrayList) {
|
||||||
|
String jfbbje = dto.getJfbbje();
|
||||||
|
if (jfbbje == null || jfbbje.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal amount = new BigDecimal(jfbbje);
|
||||||
|
if (amount.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
// 发现非0值,立即返回true
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤掉集合中jfbbje为0的元素
|
||||||
|
*
|
||||||
|
* @return 过滤后的新集合(不包含jfbbje=0的元素)
|
||||||
|
*/
|
||||||
|
private List<ArapDjzbVO.Childrenn> filterZeroJfbbje(List<ArapDjzbVO.Childrenn> childrennArrayList) {
|
||||||
|
// 处理空输入
|
||||||
|
if (childrennArrayList == null || childrennArrayList.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用Stream API过滤0值
|
||||||
|
return childrennArrayList.stream().filter(dto -> {
|
||||||
|
String jfbbje = dto.getJfbbje();
|
||||||
|
if (jfbbje == null || jfbbje.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return new BigDecimal(jfbbje).compareTo(BigDecimal.ZERO) != 0;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -35,12 +35,12 @@ public class PassiveWarehouseReceiptToCTest {
|
||||||
//情况一
|
//情况一
|
||||||
// passiveWarehouseReceiptToC.startImplementByCode("RH20250722000231", "stock");
|
// passiveWarehouseReceiptToC.startImplementByCode("RH20250722000231", "stock");
|
||||||
//情况二
|
//情况二
|
||||||
// passiveWarehouseReceiptToC.startImplementByCode("RH20250731000423", "tran");
|
passiveWarehouseReceiptToC.startImplementByCode("RH20250731000423", "tran");
|
||||||
//情况三
|
//情况三
|
||||||
// passiveWarehouseReceiptToC.startImplementByCode("RH20250731000613", "tran");
|
// passiveWarehouseReceiptToC.startImplementByCode("RH20250731000613", "tran");
|
||||||
// passiveWarehouseReceiptToC.startImplementByCode("RH20250723000754", "tran");
|
// passiveWarehouseReceiptToC.startImplementByCode("RH20250723000754", "tran");
|
||||||
|
|
||||||
passiveWarehouseReceiptToC.startImplementByCode("RH20250731000017", "stock");
|
// passiveWarehouseReceiptToC.startImplementByCode("RH20250731000017", "stock");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,14 +69,14 @@ public class SoSaleReturnPluginInitializerToCTest {
|
||||||
try {
|
try {
|
||||||
// soSaleReturnPluginInitializerToC.startImplementByTradeTime("2025-04-28 00:00:00", "2025-04-28 23:59:59", "0");
|
// soSaleReturnPluginInitializerToC.startImplementByTradeTime("2025-04-28 00:00:00", "2025-04-28 23:59:59", "0");
|
||||||
|
|
||||||
soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072900002315", "stock");
|
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072900002315", "stock");
|
||||||
|
|
||||||
//满足红字应收单
|
//满足红字应收单
|
||||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072200001324", "tran");
|
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072200001324", "tran");
|
||||||
//情况一
|
//情况一
|
||||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072900000460", "stock");
|
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072900000460", "stock");
|
||||||
//情况二
|
//情况二
|
||||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072800000594", "tran");
|
soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072800000594", "tran");
|
||||||
//情况三
|
//情况三
|
||||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025080200002257", "tran");
|
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025080200002257", "tran");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue