feat(entity): 增加存货基本档案和存货管理档案的批量查询功能
- 在 BdInvbasdocEntity 和 BdInvmandocEntity 中添加批量查询相关的字段 - 在对应的 XML 文件中添加批量查询的 SQL 语句 -优化查询条件,支持多参数查询
This commit is contained in:
parent
d8eda38c49
commit
4e474ac940
|
@ -170,6 +170,7 @@
|
|||
,weitunitnum
|
||||
,width
|
||||
</sql>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-BdInvbasdocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity">
|
||||
select
|
||||
|
@ -262,6 +263,8 @@
|
|||
|
||||
<if test="modifytime_start_time!=null and modifytime_start_time!=''">and ts >= #{modifytime_start_time}</if>
|
||||
<if test="modifytime_end_time!=null and modifytime_end_time!=''">and ts <= #{modifytime_end_time}</if>
|
||||
|
||||
<if test="invcodes!=null and invcodes!=''">and invcode in (${invcodes})</if>
|
||||
and dr=0
|
||||
</trim>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
|
|
|
@ -120,5 +120,10 @@ public class BdInvmandocEntity extends BaseEntity {
|
|||
* 查询多个存货编码
|
||||
*/
|
||||
private String invcodes;
|
||||
|
||||
/**
|
||||
* 批量根据存货基本档案主键查询
|
||||
*/
|
||||
private String pkInvbasdocs;
|
||||
}
|
||||
|
||||
|
|
|
@ -195,6 +195,7 @@
|
|||
,ts
|
||||
,wholemanaflag
|
||||
</sql>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-BdInvmandocEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BdInvmandocEntity">
|
||||
select
|
||||
|
@ -294,6 +295,8 @@
|
|||
<if test="serialmanaflag != null and serialmanaflag != ''"> and serialmanaflag = #{serialmanaflag} </if>
|
||||
<if test="ts != null and ts != ''"> and ts = #{ts} </if>
|
||||
<if test="wholemanaflag != null and wholemanaflag != ''"> and wholemanaflag = #{wholemanaflag} </if>
|
||||
|
||||
<if test="pkInvbasdocs != null and pkInvbasdocs != ''"> and pk_invbasdoc in (${pkInvbasdocs}) </if>
|
||||
and dr='0'
|
||||
</trim>
|
||||
</select>
|
||||
|
|
|
@ -858,12 +858,16 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("202");
|
||||
//初始化所有存货管理档案对应的结存价+采购价
|
||||
// List<Map> mapList = initAllBalancePricePurchasePrice();
|
||||
//查询「平台运费」存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = queryStockBasicArchives();
|
||||
//查询「平台运费」、「平台优惠」、「支付优惠」、「达人优惠」存货基本档案(注意没有商家优惠)
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntities = queryStockBasicArchives();
|
||||
Map<String, BdInvbasdocEntity> mapBdInvbasdocEntity = bdInvbasdocEntities.stream().collect(Collectors.toMap(BdInvbasdocEntity::getInvcode, entity -> entity));
|
||||
String pkInvbasdocStr = bdInvbasdocEntities.stream().map(entity -> "'" + entity.getInvcode() + "'").collect(Collectors.joining(","));
|
||||
//查询存货对应的税目
|
||||
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityMap = queryBatchBdTaxitems(pkInvbasdocStr);
|
||||
//查询「平台运费」对应的税率
|
||||
// BdTaxitemsEntity bdTaxitemsEntity = queryBdTaxitems(bdInvbasdocEntity1.getInvcode());
|
||||
//查询「平台运费」所有公司的存货管理档案
|
||||
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = queryInventoryMan(bdInvbasdocEntity1.getPkInvbasdoc());
|
||||
//查询「平台运费」、「平台优惠」、「支付优惠」、「达人优惠」所有公司的存货管理档案
|
||||
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = queryInventoryMan(bdInvbasdocEntities);
|
||||
|
||||
if (bdBusitypeEntity != null && summaryDimensionMap != null) {
|
||||
Iterator<Map.Entry<String, List<SonDetailsDto>>> iterator = summaryDimensionMap.entrySet().iterator();
|
||||
|
@ -1012,22 +1016,22 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// saleorderRequestChildrenDto.setVdef2(bdCostsubjEntity.getCostname());//收支项目
|
||||
// saleorderRequestChildrenDto.setPk_defdoc2(bdCostsubjEntity.getPkCostsubj());
|
||||
//如果优惠金额为0,则传0
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef4() != null) {
|
||||
if (sonDetailsDto.getVdef4() != null) {
|
||||
saleorderRequestChildrenDto.setVdef4(new BigDecimal(sonDetailsDto.getVdef4()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef4("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef5() != null) {
|
||||
if (sonDetailsDto.getVdef5() != null) {
|
||||
saleorderRequestChildrenDto.setVdef5(new BigDecimal(sonDetailsDto.getVdef5()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef5("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef6() != null) {
|
||||
if (sonDetailsDto.getVdef6() != null) {
|
||||
saleorderRequestChildrenDto.setVdef6(new BigDecimal(sonDetailsDto.getVdef6()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef6("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef7() != null) {
|
||||
if (sonDetailsDto.getVdef7() != null) {
|
||||
saleorderRequestChildrenDto.setVdef7(new BigDecimal(sonDetailsDto.getVdef7()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef7("0");
|
||||
|
@ -1036,7 +1040,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
|
||||
//判断是否增加邮费这个存货,accumulatedPostage
|
||||
BigDecimal accumulatedPostage = checkPostageFee(oldValue);
|
||||
if (accumulatedPostage != null && accumulatedPostage.compareTo(BigDecimal.ZERO) > 0) {
|
||||
if (accumulatedPostage.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//获取「平台运维」对应的税率
|
||||
// String tax2 = new BigDecimal(bdTaxitemsEntity.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
|
||||
// BigDecimal noriginalcurprice2 = null;//无税单价
|
||||
|
@ -1056,38 +1060,89 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// Assert.state(false, "邮费TOC金额计算错误,原因:{}" + e.getMessage());
|
||||
// }
|
||||
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(deliverGoodsCorp.getPkCorp());
|
||||
//增加「平台运费」这个存货
|
||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto2 = new SaleorderRequestChildrenDto();
|
||||
saleorderRequestChildrenDto2.setBlargessflag(false);//是否赠品
|
||||
saleorderRequestChildrenDto2.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
|
||||
saleorderRequestChildrenDto2.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
|
||||
saleorderRequestChildrenDto2.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用
|
||||
saleorderRequestChildrenDto2.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
|
||||
saleorderRequestChildrenDto2.setCcurrencytypeid("00010000000000000001");//币种
|
||||
saleorderRequestChildrenDto2.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());//存货id
|
||||
saleorderRequestChildrenDto2.setCinventorycode(bdInvbasdocEntity1.getInvcode());//存货编码
|
||||
saleorderRequestChildrenDto2.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
saleorderRequestChildrenDto2.setDconsigndate(generateBusinessDate);//计划发货日期
|
||||
saleorderRequestChildrenDto2.setDdeliverdate(generateBusinessDate);//要求收货日期
|
||||
saleorderRequestChildrenDto2.setNexchangeotobrate("1.00000000");//折本汇率
|
||||
saleorderRequestChildrenDto2.setNitemdiscountrate("100.000000");//单品折扣
|
||||
saleorderRequestChildrenDto2.setNnumber("1");//数量
|
||||
saleorderRequestChildrenDto2.setNoriginalcurdiscountmny("0");//折扣额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurmny(noriginalcurmny2.stripTrailingZeros().toPlainString());//无税金额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcursummny(noriginalcursummny2.stripTrailingZeros().toPlainString());//价税合计
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxmny(noriginalcurtaxmny2.stripTrailingZeros().toPlainString());//税额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxnetprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税净价
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税单价
|
||||
// //存货管理档案
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(deliverGoodsCorp.getPkCorp());
|
||||
// //增加「平台运费」这个存货
|
||||
// SaleorderRequestChildrenDto saleorderRequestChildrenDto2 = new SaleorderRequestChildrenDto();
|
||||
// saleorderRequestChildrenDto2.setBlargessflag(false);//是否赠品
|
||||
// saleorderRequestChildrenDto2.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
|
||||
// saleorderRequestChildrenDto2.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
|
||||
// saleorderRequestChildrenDto2.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用
|
||||
// saleorderRequestChildrenDto2.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
|
||||
// saleorderRequestChildrenDto2.setCcurrencytypeid("00010000000000000001");//币种
|
||||
// saleorderRequestChildrenDto2.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());//存货id
|
||||
// saleorderRequestChildrenDto2.setCinventorycode(bdInvbasdocEntity1.getInvcode());//存货编码
|
||||
// saleorderRequestChildrenDto2.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
// saleorderRequestChildrenDto2.setDconsigndate(generateBusinessDate);//计划发货日期
|
||||
// saleorderRequestChildrenDto2.setDdeliverdate(generateBusinessDate);//要求收货日期
|
||||
// saleorderRequestChildrenDto2.setNexchangeotobrate("1.00000000");//折本汇率
|
||||
// saleorderRequestChildrenDto2.setNitemdiscountrate("100.000000");//单品折扣
|
||||
// saleorderRequestChildrenDto2.setNnumber("1");//数量
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurdiscountmny("0");//折扣额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurmny(noriginalcurmny2.stripTrailingZeros().toPlainString());//无税金额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcursummny(noriginalcursummny2.stripTrailingZeros().toPlainString());//价税合计
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxmny(noriginalcurtaxmny2.stripTrailingZeros().toPlainString());//税额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxnetprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税净价
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税单价
|
||||
//
|
||||
// saleorderRequestChildrenDto2.setNoriginalcursummny(accumulatedPostage.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());//价税合计新
|
||||
//// saleorderRequestChildrenDto2.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());//税率,对应运维存货的税率
|
||||
// saleorderRequestChildrenDto2.setVdef4("0");
|
||||
// saleorderRequestChildrenDto2.setVdef5("0");
|
||||
// saleorderRequestChildrenDto2.setVdef6("0");
|
||||
// saleorderRequestChildrenDto2.setVdef7("0");
|
||||
// saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto2);
|
||||
|
||||
saleorderRequestChildrenDto2.setNoriginalcursummny(accumulatedPostage.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());//价税合计新
|
||||
// saleorderRequestChildrenDto2.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());//税率,对应运维存货的税率
|
||||
saleorderRequestChildrenDto2.setVdef4("0");
|
||||
saleorderRequestChildrenDto2.setVdef5("0");
|
||||
saleorderRequestChildrenDto2.setVdef6("0");
|
||||
saleorderRequestChildrenDto2.setVdef7("0");
|
||||
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto2);
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY05");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY05");
|
||||
//补充:平台运费-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, accumulatedPostage, "1", bdTaxitemsEntity);
|
||||
}
|
||||
//平台优惠
|
||||
if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) {
|
||||
BigDecimal bigDecimalVdef4 = new BigDecimal(sonDetailsDto.getVdef4());
|
||||
if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01");
|
||||
//补充:平台优惠-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, bigDecimalVdef4, "1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//达人优惠
|
||||
if (sonDetailsDto.getVdef6() != null && !"".equals(sonDetailsDto.getVdef6())) {
|
||||
BigDecimal bigDecimalVdef6 = new BigDecimal(sonDetailsDto.getVdef6());
|
||||
if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02");
|
||||
//补充:达人优惠-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, bigDecimalVdef6, "1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//支付优惠
|
||||
if (sonDetailsDto.getVdef5() != null && !"".equals(sonDetailsDto.getVdef5())) {
|
||||
BigDecimal bigDecimalVdef5 = new BigDecimal(sonDetailsDto.getVdef5());
|
||||
if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04");
|
||||
//补充:支付优惠-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, bigDecimalVdef5, "1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
//销售订单单据推送到u8c
|
||||
|
@ -1963,11 +2018,15 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
//初始化所有存货管理档案对应的结存价+采购价
|
||||
// List<Map> mapList = initAllBalancePricePurchasePrice();
|
||||
//查询「平台运费」存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = queryStockBasicArchives();
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntities = queryStockBasicArchives();
|
||||
Map<String, BdInvbasdocEntity> mapBdInvbasdocEntity = bdInvbasdocEntities.stream().collect(Collectors.toMap(BdInvbasdocEntity::getInvcode, entity -> entity));
|
||||
String pkInvbasdocStr = bdInvbasdocEntities.stream().map(entity -> "'" + entity.getInvcode() + "'").collect(Collectors.joining(","));
|
||||
//查询存货对应的税目
|
||||
Map<String, BdTaxitemsEntity> stringBdTaxitemsEntityMap = queryBatchBdTaxitems(pkInvbasdocStr);
|
||||
//查询「平台运费」对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = queryBdTaxitems(bdInvbasdocEntity1.getInvcode());
|
||||
//查询「平台运费」所有公司的存货管理档案
|
||||
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = queryInventoryMan(bdInvbasdocEntity1.getPkInvbasdoc());
|
||||
// BdTaxitemsEntity bdTaxitemsEntity = queryBdTaxitems(bdInvbasdocEntity1.getInvcode());
|
||||
//查询「平台运费」、「平台优惠」、「支付优惠」、「达人优惠」所有公司的存货管理档案
|
||||
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = queryInventoryMan(bdInvbasdocEntities);
|
||||
|
||||
if (bdBusitypeEntity != null && summaryDimensionMap != null) {
|
||||
Iterator<Map.Entry<String, List<SonDetailsDto>>> iterator = summaryDimensionMap.entrySet().iterator();
|
||||
|
@ -2106,22 +2165,22 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// saleorderRequestChildrenDto.setVdef2(bdCostsubjEntity.getCostname());//收支项目
|
||||
// saleorderRequestChildrenDto.setPk_defdoc2(bdCostsubjEntity.getPkCostsubj());
|
||||
//如果优惠金额为0,则传0
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef4() != null) {
|
||||
if (sonDetailsDto.getVdef4() != null) {
|
||||
saleorderRequestChildrenDto.setVdef4("-" + new BigDecimal(sonDetailsDto.getVdef4()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef4("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef5() != null) {
|
||||
if (sonDetailsDto.getVdef5() != null) {
|
||||
saleorderRequestChildrenDto.setVdef5("-" + new BigDecimal(sonDetailsDto.getVdef5()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef5("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef6() != null) {
|
||||
if (sonDetailsDto.getVdef6() != null) {
|
||||
saleorderRequestChildrenDto.setVdef6("-" + new BigDecimal(sonDetailsDto.getVdef6()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef6("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef7() != null) {
|
||||
if (sonDetailsDto.getVdef7() != null) {
|
||||
saleorderRequestChildrenDto.setVdef7("-" + new BigDecimal(sonDetailsDto.getVdef7()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef7("0");
|
||||
|
@ -2130,7 +2189,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
|
||||
//判断是否增加邮费这个存货,accumulatedPostage
|
||||
BigDecimal accumulatedPostage = checkPostageFee(oldValue);
|
||||
if (accumulatedPostage != null && accumulatedPostage.compareTo(BigDecimal.ZERO) > 0) {
|
||||
if (accumulatedPostage.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//获取「平台运费」对应的税率
|
||||
// String tax2 = "0." + new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString();
|
||||
// BigDecimal noriginalcurprice2 = null;//无税单价
|
||||
|
@ -2151,36 +2210,92 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// }
|
||||
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(deliverGoodsCorp.getPkCorp());
|
||||
//增加「平台运费」这个存货
|
||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto2 = new SaleorderRequestChildrenDto();
|
||||
saleorderRequestChildrenDto2.setBlargessflag(false);//是否赠品
|
||||
saleorderRequestChildrenDto2.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
|
||||
saleorderRequestChildrenDto2.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
|
||||
saleorderRequestChildrenDto2.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用
|
||||
saleorderRequestChildrenDto2.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
|
||||
saleorderRequestChildrenDto2.setCcurrencytypeid("00010000000000000001");//币种
|
||||
saleorderRequestChildrenDto2.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());//存货id
|
||||
saleorderRequestChildrenDto2.setCinventorycode(bdInvbasdocEntity1.getInvcode());//存货编码
|
||||
saleorderRequestChildrenDto2.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
saleorderRequestChildrenDto2.setDconsigndate(generateBusinessDate);//计划发货日期
|
||||
saleorderRequestChildrenDto2.setDdeliverdate(generateBusinessDate);//要求收货日期
|
||||
saleorderRequestChildrenDto2.setNexchangeotobrate("1.00000000");//折本汇率
|
||||
saleorderRequestChildrenDto2.setNitemdiscountrate("100.000000");//单品折扣
|
||||
saleorderRequestChildrenDto2.setNnumber("-1");//数量
|
||||
saleorderRequestChildrenDto2.setNoriginalcurdiscountmny("0");//折扣额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurmny("-" + noriginalcurmny2.stripTrailingZeros().toPlainString());//无税金额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcursummny("-" + noriginalcursummny2.stripTrailingZeros().toPlainString());//价税合计
|
||||
saleorderRequestChildrenDto2.setNoriginalcursummny("-" + accumulatedPostage.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());//价税合计
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxmny("-" + noriginalcurtaxmny2.stripTrailingZeros().toPlainString());//税额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxnetprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税净价
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税单价
|
||||
// saleorderRequestChildrenDto2.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());//税率,对应运维存货的税率
|
||||
saleorderRequestChildrenDto2.setVdef4("0");
|
||||
saleorderRequestChildrenDto2.setVdef5("0");
|
||||
saleorderRequestChildrenDto2.setVdef6("0");
|
||||
saleorderRequestChildrenDto2.setVdef7("0");
|
||||
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto2);
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(deliverGoodsCorp.getPkCorp());
|
||||
// //增加「平台运费」这个存货
|
||||
// SaleorderRequestChildrenDto saleorderRequestChildrenDto2 = new SaleorderRequestChildrenDto();
|
||||
// saleorderRequestChildrenDto2.setBlargessflag(false);//是否赠品
|
||||
// saleorderRequestChildrenDto2.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
|
||||
// saleorderRequestChildrenDto2.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
|
||||
// saleorderRequestChildrenDto2.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用
|
||||
// saleorderRequestChildrenDto2.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
|
||||
// saleorderRequestChildrenDto2.setCcurrencytypeid("00010000000000000001");//币种
|
||||
// saleorderRequestChildrenDto2.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());//存货id
|
||||
// saleorderRequestChildrenDto2.setCinventorycode(bdInvbasdocEntity1.getInvcode());//存货编码
|
||||
// saleorderRequestChildrenDto2.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
// saleorderRequestChildrenDto2.setDconsigndate(generateBusinessDate);//计划发货日期
|
||||
// saleorderRequestChildrenDto2.setDdeliverdate(generateBusinessDate);//要求收货日期
|
||||
// saleorderRequestChildrenDto2.setNexchangeotobrate("1.00000000");//折本汇率
|
||||
// saleorderRequestChildrenDto2.setNitemdiscountrate("100.000000");//单品折扣
|
||||
// saleorderRequestChildrenDto2.setNnumber("-1");//数量
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurdiscountmny("0");//折扣额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurmny("-" + noriginalcurmny2.stripTrailingZeros().toPlainString());//无税金额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcursummny("-" + noriginalcursummny2.stripTrailingZeros().toPlainString());//价税合计
|
||||
// saleorderRequestChildrenDto2.setNoriginalcursummny("-" + accumulatedPostage.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());//价税合计
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxmny("-" + noriginalcurtaxmny2.stripTrailingZeros().toPlainString());//税额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxnetprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税净价
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税单价
|
||||
//// saleorderRequestChildrenDto2.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());//税率,对应运维存货的税率
|
||||
// saleorderRequestChildrenDto2.setVdef4("0");
|
||||
// saleorderRequestChildrenDto2.setVdef5("0");
|
||||
// saleorderRequestChildrenDto2.setVdef6("0");
|
||||
// saleorderRequestChildrenDto2.setVdef7("0");
|
||||
// saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto2);
|
||||
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY05");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY05");
|
||||
//补充:平台运费-存货
|
||||
//accumulatedPostage应该是负数
|
||||
BigDecimal absAccumulatedPostage = accumulatedPostage.abs();
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absAccumulatedPostage, "-1", bdTaxitemsEntity);
|
||||
}
|
||||
//平台优惠
|
||||
if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) {
|
||||
BigDecimal bigDecimalVdef4 = new BigDecimal(sonDetailsDto.getVdef4());
|
||||
if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01");
|
||||
//补充:平台优惠-存货
|
||||
BigDecimal absBigDecimalVdef4 = bigDecimalVdef4.abs();
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absBigDecimalVdef4, "-1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//达人优惠
|
||||
if (sonDetailsDto.getVdef6() != null && !"".equals(sonDetailsDto.getVdef6())) {
|
||||
BigDecimal bigDecimalVdef6 = new BigDecimal(sonDetailsDto.getVdef6());
|
||||
if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02");
|
||||
//补充:达人优惠-存货
|
||||
BigDecimal absBigDecimalVdef6 = bigDecimalVdef6.abs();
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absBigDecimalVdef6, "-1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//支付优惠
|
||||
if (sonDetailsDto.getVdef5() != null && !"".equals(sonDetailsDto.getVdef5())) {
|
||||
BigDecimal bigDecimalVdef5 = new BigDecimal(sonDetailsDto.getVdef5());
|
||||
if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04");
|
||||
//补充:支付优惠-存货
|
||||
BigDecimal absBigDecimalVdef5 = bigDecimalVdef5.abs();
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, absBigDecimalVdef5, "-1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
//销售订单单据推送到u8c
|
||||
|
@ -2319,22 +2434,22 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// saleorderRequestChildrenDto.setCreccalbodyid(bdCalbodyEntity1.getPkCalbody());//收货库存组织:2024年8月7日 16:21:48 和佳妮、道品一起测试,收货库存组织、收货仓库 是不需要传递的
|
||||
// saleorderRequestChildrenDto.setCrecwareid(bdStordocEntity1.getPkStordoc());//收货仓库
|
||||
//如果优惠金额为0,则传0
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef4() != null) {
|
||||
if (sonDetailsDto.getVdef4() != null) {
|
||||
saleorderRequestChildrenDto.setVdef4(new BigDecimal(sonDetailsDto.getVdef4()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef4("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef5() != null) {
|
||||
if (sonDetailsDto.getVdef5() != null) {
|
||||
saleorderRequestChildrenDto.setVdef5(new BigDecimal(sonDetailsDto.getVdef5()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef5("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef6() != null) {
|
||||
if (sonDetailsDto.getVdef6() != null) {
|
||||
saleorderRequestChildrenDto.setVdef6(new BigDecimal(sonDetailsDto.getVdef6()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef6("0");
|
||||
}
|
||||
if (sonDetailsDto != null && sonDetailsDto.getVdef7() != null) {
|
||||
if (sonDetailsDto.getVdef7() != null) {
|
||||
saleorderRequestChildrenDto.setVdef7(new BigDecimal(sonDetailsDto.getVdef7()).stripTrailingZeros().toPlainString());
|
||||
} else {
|
||||
saleorderRequestChildrenDto.setVdef7("0");
|
||||
|
@ -2364,36 +2479,87 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
// }
|
||||
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(deliverGoodsCorp.getPkCorp());
|
||||
//增加「平台运费」这个存货
|
||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto2 = new SaleorderRequestChildrenDto();
|
||||
saleorderRequestChildrenDto2.setBlargessflag(false);//是否赠品
|
||||
saleorderRequestChildrenDto2.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
|
||||
saleorderRequestChildrenDto2.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
|
||||
saleorderRequestChildrenDto2.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用
|
||||
saleorderRequestChildrenDto2.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
|
||||
saleorderRequestChildrenDto2.setCcurrencytypeid("00010000000000000001");//币种
|
||||
saleorderRequestChildrenDto2.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());//存货id
|
||||
saleorderRequestChildrenDto2.setCinventorycode(bdInvbasdocEntity1.getInvcode());//存货编码
|
||||
saleorderRequestChildrenDto2.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
saleorderRequestChildrenDto2.setDconsigndate(generateBusinessDate);//计划发货日期
|
||||
saleorderRequestChildrenDto2.setDdeliverdate(generateBusinessDate);//要求收货日期
|
||||
saleorderRequestChildrenDto2.setNexchangeotobrate("1.00000000");//折本汇率
|
||||
saleorderRequestChildrenDto2.setNitemdiscountrate("100.000000");//单品折扣
|
||||
saleorderRequestChildrenDto2.setNnumber("1");//数量
|
||||
saleorderRequestChildrenDto2.setNoriginalcurdiscountmny("0");//折扣额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurmny(noriginalcurmny2.stripTrailingZeros().toPlainString());//无税金额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcursummny(noriginalcursummny2.stripTrailingZeros().toPlainString());//价税合计
|
||||
saleorderRequestChildrenDto2.setNoriginalcursummny(accumulatedPostage.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());//价税合计 新逻辑
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxmny(noriginalcurtaxmny2.stripTrailingZeros().toPlainString());//税额
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxnetprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税净价
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurtaxprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税单价
|
||||
// saleorderRequestChildrenDto2.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());//税率,对应运维存货的税率
|
||||
saleorderRequestChildrenDto2.setVdef4("0");
|
||||
saleorderRequestChildrenDto2.setVdef5("0");
|
||||
saleorderRequestChildrenDto2.setVdef6("0");
|
||||
saleorderRequestChildrenDto2.setVdef7("0");
|
||||
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto2);
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(deliverGoodsCorp.getPkCorp());
|
||||
// //增加「平台运费」这个存货
|
||||
// SaleorderRequestChildrenDto saleorderRequestChildrenDto2 = new SaleorderRequestChildrenDto();
|
||||
// saleorderRequestChildrenDto2.setBlargessflag(false);//是否赠品
|
||||
// saleorderRequestChildrenDto2.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织
|
||||
// saleorderRequestChildrenDto2.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库
|
||||
// saleorderRequestChildrenDto2.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用
|
||||
// saleorderRequestChildrenDto2.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司
|
||||
// saleorderRequestChildrenDto2.setCcurrencytypeid("00010000000000000001");//币种
|
||||
// saleorderRequestChildrenDto2.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());//存货id
|
||||
// saleorderRequestChildrenDto2.setCinventorycode(bdInvbasdocEntity1.getInvcode());//存货编码
|
||||
// saleorderRequestChildrenDto2.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位
|
||||
// saleorderRequestChildrenDto2.setDconsigndate(generateBusinessDate);//计划发货日期
|
||||
// saleorderRequestChildrenDto2.setDdeliverdate(generateBusinessDate);//要求收货日期
|
||||
// saleorderRequestChildrenDto2.setNexchangeotobrate("1.00000000");//折本汇率
|
||||
// saleorderRequestChildrenDto2.setNitemdiscountrate("100.000000");//单品折扣
|
||||
// saleorderRequestChildrenDto2.setNnumber("1");//数量
|
||||
// saleorderRequestChildrenDto2.setNoriginalcurdiscountmny("0");//折扣额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurmny(noriginalcurmny2.stripTrailingZeros().toPlainString());//无税金额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcursummny(noriginalcursummny2.stripTrailingZeros().toPlainString());//价税合计
|
||||
// saleorderRequestChildrenDto2.setNoriginalcursummny(accumulatedPostage.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());//价税合计 新逻辑
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxmny(noriginalcurtaxmny2.stripTrailingZeros().toPlainString());//税额
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxnetprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税净价
|
||||
//// saleorderRequestChildrenDto2.setNoriginalcurtaxprice(noriginalcurtaxprice2.stripTrailingZeros().toPlainString());//含税单价
|
||||
//// saleorderRequestChildrenDto2.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());//税率,对应运维存货的税率
|
||||
// saleorderRequestChildrenDto2.setVdef4("0");
|
||||
// saleorderRequestChildrenDto2.setVdef5("0");
|
||||
// saleorderRequestChildrenDto2.setVdef6("0");
|
||||
// saleorderRequestChildrenDto2.setVdef7("0");
|
||||
// saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto2);
|
||||
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY05");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY05");
|
||||
//补充:平台运费-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, accumulatedPostage, "1", bdTaxitemsEntity);
|
||||
}
|
||||
//平台优惠
|
||||
if (sonDetailsDto.getVdef4() != null && !"".equals(sonDetailsDto.getVdef4())) {
|
||||
BigDecimal bigDecimalVdef4 = new BigDecimal(sonDetailsDto.getVdef4());
|
||||
if (bigDecimalVdef4.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01");
|
||||
//补充:平台优惠-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, bigDecimalVdef4, "1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//达人优惠
|
||||
if (sonDetailsDto.getVdef6() != null && !"".equals(sonDetailsDto.getVdef6())) {
|
||||
BigDecimal bigDecimalVdef6 = new BigDecimal(sonDetailsDto.getVdef6());
|
||||
if (bigDecimalVdef6.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02");
|
||||
//补充:达人优惠-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, bigDecimalVdef6, "1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//支付优惠
|
||||
if (sonDetailsDto.getVdef5() != null && !"".equals(sonDetailsDto.getVdef5())) {
|
||||
BigDecimal bigDecimalVdef5 = new BigDecimal(sonDetailsDto.getVdef5());
|
||||
if (bigDecimalVdef5.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04");
|
||||
//补充:支付优惠-存货
|
||||
additional(saleorderRequestChildrenDtoList, bdInvmandocEntity1, bdInvbasdocEntity1, bigDecimalVdef5, "1", bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
//销售订单单据推送到u8c
|
||||
|
@ -3243,11 +3409,14 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
/**
|
||||
* 累加偏远地区的邮费,如果累加后的邮费大于0,则会追加一个存货用于记录平台邮费
|
||||
*
|
||||
* @param oldValue 出库单明细行
|
||||
* @author liuyang
|
||||
*/
|
||||
private BigDecimal checkPostageFee(List<SonDetailsDto> oldValue) throws Exception {
|
||||
Assert.notNull(oldValue, "oldValue不能为空!");
|
||||
|
||||
BigDecimal shareTargetFreightTotalDiscounts = new BigDecimal("0");
|
||||
if (oldValue != null && oldValue.size() > 0) {
|
||||
if (oldValue.size() > 0) {
|
||||
for (int i = 0; i < oldValue.size(); i++) {
|
||||
SonDetailsDto sonDetailsDto = oldValue.get(i);
|
||||
//查找O出库单某行明细对应的OFS销售订单明细行
|
||||
|
@ -3362,27 +3531,40 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
/**
|
||||
* 查询存货管理档案,key为公司id、value为存货管理档案对象
|
||||
*
|
||||
* @param pk_invbasdoc 存货管理档案
|
||||
* @param bdInvbasdocEntities 存货基本档案
|
||||
* @author liuyang
|
||||
*/
|
||||
private Map<String, BdInvmandocEntity> queryInventoryMan(String pk_invbasdoc) throws Exception {
|
||||
Assert.notNull(pk_invbasdoc, "pk_invbasdoc不能为空!");
|
||||
Assert.state(!"".equals(pk_invbasdoc.trim()), "pk_invbasdoc不能为空!");
|
||||
private Map<String, BdInvmandocEntity> queryInventoryMan(List<BdInvbasdocEntity> bdInvbasdocEntities) throws Exception {
|
||||
Assert.notNull(bdInvbasdocEntities, "pk_invbasdoc不能为空!");
|
||||
|
||||
Map<String, BdInvmandocEntity> stringBdInvmandocEntityMap = new HashMap<>();
|
||||
for (int i = 0; i < bdInvbasdocEntities.size(); i++) {
|
||||
BdInvbasdocEntity bdInvbasdocEntity = bdInvbasdocEntities.get(i);
|
||||
|
||||
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
bdInvmandocEntity.setPkInvbasdoc(pk_invbasdoc);
|
||||
bdInvmandocEntity.setPkInvbasdoc(bdInvbasdocEntity.getPkInvbasdoc());
|
||||
bdInvmandocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||
List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.query(bdInvmandocEntity);
|
||||
if (bdInvmandocEntity2 == null || bdInvmandocEntity2.size() == 0) {
|
||||
Assert.state(false, "无法查询到所有公司对应的存货管理档案 存货管理档案主键:{}", pk_invbasdoc);
|
||||
}
|
||||
if (bdInvmandocEntity2 != null && bdInvmandocEntity2.size() > 0) {
|
||||
for (int i = 0; i < bdInvmandocEntity2.size(); i++) {
|
||||
BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(i);
|
||||
stringBdInvmandocEntityMap.put(bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1);
|
||||
for (int j = 0; j < bdInvmandocEntity2.size(); j++) {
|
||||
BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(j);
|
||||
stringBdInvmandocEntityMap.put(bdInvbasdocEntity.getInvcode() + bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
|
||||
// bdInvmandocEntity.setPkInvbasdocs(pk_invbasdocs);
|
||||
// bdInvmandocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||
// List<BdInvmandocEntity> bdInvmandocEntity2 = iBdInvmandocDao.query(bdInvmandocEntity);
|
||||
// if (bdInvmandocEntity2 == null || bdInvmandocEntity2.size() == 0) {
|
||||
// Assert.state(false, "无法查询到所有公司对应的存货管理档案 存货基本档案主键:{}", pk_invbasdocs);
|
||||
// }
|
||||
// if (bdInvmandocEntity2 != null && bdInvmandocEntity2.size() > 0) {
|
||||
// for (int i = 0; i < bdInvmandocEntity2.size(); i++) {
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(i);
|
||||
// stringBdInvmandocEntityMap.put(bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1);
|
||||
// }
|
||||
// }
|
||||
return stringBdInvmandocEntityMap;
|
||||
}
|
||||
|
||||
|
@ -3392,18 +3574,21 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdInvbasdocEntity queryStockBasicArchives() throws Exception {
|
||||
String invcode = "FY05";
|
||||
private List<BdInvbasdocEntity> queryStockBasicArchives() throws Exception {
|
||||
// String invcode = "FY05";
|
||||
String invcodes = "'FY05','FY02','FY04','FY01'";
|
||||
BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity();
|
||||
bdInvbasdocEntity.setInvcode(invcode);
|
||||
// bdInvbasdocEntity.setInvcode(invcode);
|
||||
bdInvbasdocEntity.setInvcodes(invcodes);
|
||||
bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntity2 = iBdInvbasdocDao.query(bdInvbasdocEntity);
|
||||
if (bdInvbasdocEntity2.size() == 0) {
|
||||
Assert.state(false, "根据存货编码:{},无法匹配到U8C存货基本档案", invcode);
|
||||
} else if (bdInvbasdocEntity2.size() >= 2) {
|
||||
Assert.state(false, "根据存货编码:{},无法匹配到U8C存货基本档案", invcode);
|
||||
List<BdInvbasdocEntity> bdInvbasdocEntities = iBdInvbasdocDao.query(bdInvbasdocEntity);
|
||||
if (bdInvbasdocEntities == null || bdInvbasdocEntities.size() == 0) {
|
||||
Assert.state(false, "根据存货编码:{},无法匹配到U8C存货基本档案", invcodes);
|
||||
}
|
||||
return bdInvbasdocEntity2.get(0);
|
||||
if (bdInvbasdocEntities.size() != 4) {
|
||||
Assert.state(false, "没有满足符合条数的存货数量,请检查《平台运费-FY05》、《平台优惠-FY01》、《达人优惠-FY02》、《支付优惠-FY04》是否在U8C全部都配置完毕!");
|
||||
}
|
||||
return bdInvbasdocEntities;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3426,6 +3611,24 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
return bdTaxitemsEntityList.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024年8月7日 14:58:34
|
||||
* 查询存货对应的税目档案
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private Map<String, BdTaxitemsEntity> queryBatchBdTaxitems(String invcode) throws Exception {
|
||||
Assert.notNull(invcode, "存货编码不能为空");
|
||||
|
||||
BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity();
|
||||
bdTaxitemsEntity.setInvcodes(invcode);
|
||||
List<BdTaxitemsEntity> bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity);
|
||||
if (bdTaxitemsEntityList.size() == 0) {
|
||||
Assert.state(false, "根据存货编码{}没有查询到U8C税目档案", invcode);
|
||||
}
|
||||
return bdTaxitemsEntityList.stream().collect(Collectors.toMap(BdTaxitemsEntity::getInvcode, entity -> entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 累加应收金额=实付金额+达人优惠+支付优惠+平台优惠
|
||||
*
|
||||
|
@ -3596,4 +3799,53 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
|||
calculationFormulaStr.append(format);
|
||||
return amountOfMoney.stripTrailingZeros().toPlainString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加平台运费,优惠金额这些存货一起保存进U8C销售订单
|
||||
*
|
||||
* @param bdInvmandocEntity1 存货管理档案
|
||||
* @param bdInvbasdocEntity1 存货基本档案
|
||||
* @param saleorderRequestChildrenDtoList 需要推送给U8C销售订单明细行表体
|
||||
* @param noriginalcursummny 价税合计,只能传金额
|
||||
* @param nnumber 数量
|
||||
* @author liuyang
|
||||
*/
|
||||
private void additional(List<SaleorderRequestChildrenDto> saleorderRequestChildrenDtoList, BdInvmandocEntity bdInvmandocEntity1, BdInvbasdocEntity bdInvbasdocEntity1, BigDecimal noriginalcursummny, String nnumber, BdTaxitemsEntity bdTaxitemsEntity) throws Exception {
|
||||
Assert.notNull(saleorderRequestChildrenDtoList, "saleorderRequestChildrenDtoList不能为空!");
|
||||
Assert.notNull(bdInvmandocEntity1, "bdInvmandocEntity1不能为空");
|
||||
Assert.notNull(bdInvbasdocEntity1, "bdInvbasdocEntity1不能为空");
|
||||
Assert.notNull(noriginalcursummny, "noriginalcursummny不能为空");
|
||||
Assert.notNull(nnumber, "nnumber不能为空!");
|
||||
|
||||
//如果size=0则不正常
|
||||
if (saleorderRequestChildrenDtoList.size() > 0) {
|
||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto = saleorderRequestChildrenDtoList.get(0);
|
||||
|
||||
//拷贝SaleorderRequestChildrenDto对象
|
||||
SaleorderRequestChildrenDto saleorderRequestChildrenDto1 = new SaleorderRequestChildrenDto();
|
||||
BeanUtil.copyPropertiesV2(saleorderRequestChildrenDto, saleorderRequestChildrenDto1);
|
||||
|
||||
//修改存货、数量、税率、价税合计、优惠金额设置为0
|
||||
//存货id、存货编码
|
||||
saleorderRequestChildrenDto1.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());
|
||||
saleorderRequestChildrenDto1.setCinventorycode(bdInvbasdocEntity1.getInvcode());
|
||||
|
||||
//价税合计
|
||||
saleorderRequestChildrenDto1.setNoriginalcursummny(noriginalcursummny.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());
|
||||
|
||||
//数量
|
||||
saleorderRequestChildrenDto1.setNnumber(nnumber);
|
||||
|
||||
//税率
|
||||
saleorderRequestChildrenDto1.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());
|
||||
|
||||
//优惠字段
|
||||
saleorderRequestChildrenDto1.setVdef4("0");
|
||||
saleorderRequestChildrenDto1.setVdef5("0");
|
||||
saleorderRequestChildrenDto1.setVdef6("0");
|
||||
saleorderRequestChildrenDto1.setVdef7("0");
|
||||
|
||||
saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue