feat(buildpackage): 新增售后类型标识并更新相关实体
- 在 OverallConstant 中添加 TOC 无源件的售后类型标识编码- 更新 OnlyAfterSalesBEntity、OfsPassiveorderDetailEntity 和 TocofsReturngoodsDetailedEntity 实体的数据库操作映射 - 修改数据库连接配置,注释掉本地测试用的 URL 和用户名密码 - 更新测试用例中的实施代码
This commit is contained in:
parent
e513b6431a
commit
d3ceb69a36
|
@ -158,6 +158,9 @@ public class OverallConstant {
|
|||
prodOverAll.put("售后类型标识-TOC无源件-主键", "0001A110000000ADSWWJ");
|
||||
prodOverAll.put("售后类型标识-TOC无源件-名称", "TOC无源件");
|
||||
|
||||
//售后类型标识-TOC无源件-编码
|
||||
prodOverAll.put("售后类型标识-TOC无源件-编码", "02");
|
||||
|
||||
prodOverAll.put("售后类型标识-TOB售后-主键", "0001A110000000AFFT7M");
|
||||
prodOverAll.put("售后类型标识-TOB售后-名称", "TOB售后");
|
||||
|
||||
|
|
|
@ -421,10 +421,10 @@
|
|||
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into only_after_sales_b(hid,ofsid,returnOrderId, returnOrderCode, skuCode, skuName, companyCode, clientCode, storeCode, returnType, refundInd, requestQty, fulfillQty, quantityUM, msrPrice, totalWeight, totalVolume, weightUM, volumeUM, totalAmount, sourceLineNum, sourceOrderCode, sourceDiscountPrice, sourcePayAmount, sourceRequestQty, bomType, originalDetailId, reasonCode, reasonDesc,businessType,transactionDate)
|
||||
insert into only_after_sales_b(hid,ofsid,returnOrderId, returnOrderCode, skuCode, skuName, companyCode, clientCode, storeCode, returnType, refundInd, requestQty, fulfillQty, quantityUM, msrPrice, totalWeight, totalVolume, weightUM, volumeUM, totalAmount, sourceLineNum, sourceOrderCode, sourceDiscountPrice, sourcePayAmount, sourceRequestQty, bomType, originalDetailId, reasonCode, reasonDesc,businessType,transactionDate,def7,def13)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.hid},#{entity.ofsid},#{entity.returnorderid},#{entity.returnordercode},#{entity.skucode},#{entity.skuname},#{entity.companycode},#{entity.clientcode},#{entity.storecode},#{entity.returntype},#{entity.refundind},#{entity.requestqty},#{entity.fulfillqty},#{entity.quantityum},#{entity.msrprice},#{entity.totalweight},#{entity.totalvolume},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.sourcelinenum},#{entity.sourceordercode},#{entity.sourcediscountprice},#{entity.sourcepayamount},#{entity.sourcerequestqty},#{entity.bomtype},#{entity.originaldetailid},#{entity.reasoncode},#{entity.reasondesc},#{entity.businessType},#{entity.transactionDate})
|
||||
(#{entity.hid},#{entity.ofsid},#{entity.returnorderid},#{entity.returnordercode},#{entity.skucode},#{entity.skuname},#{entity.companycode},#{entity.clientcode},#{entity.storecode},#{entity.returntype},#{entity.refundind},#{entity.requestqty},#{entity.fulfillqty},#{entity.quantityum},#{entity.msrprice},#{entity.totalweight},#{entity.totalvolume},#{entity.weightum},#{entity.volumeum},#{entity.totalamount},#{entity.sourcelinenum},#{entity.sourceordercode},#{entity.sourcediscountprice},#{entity.sourcepayamount},#{entity.sourcerequestqty},#{entity.bomtype},#{entity.originaldetailid},#{entity.reasoncode},#{entity.reasondesc},#{entity.businessType},#{entity.transactionDate},#{entity.def7},#{entity.def13})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
hid = values(hid),
|
||||
|
@ -457,7 +457,9 @@
|
|||
reasonCode = values(reasonCode),
|
||||
reasonDesc = values(reasonDesc),
|
||||
businessType = values(businessType),
|
||||
transactionDate = values(transactionDate)
|
||||
transactionDate = values(transactionDate),
|
||||
def7 = def7,
|
||||
def13 = def13
|
||||
</insert>
|
||||
|
||||
<!-- 批量新增或者修改-->
|
||||
|
@ -515,10 +517,10 @@
|
|||
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatchBySuccessOrFail2" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into only_after_sales_b(ofsid,def8,def9,def10,def11,def12,def1,def2,def3,def4,def5,def6,def7)
|
||||
insert into only_after_sales_b(ofsid,def8,def9,def10,def11,def12,def13,def1,def2,def3,def4,def5,def6,def7)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.ofsid},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7})
|
||||
(#{entity.ofsid},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
ofsid = values(ofsid),
|
||||
|
@ -527,6 +529,7 @@
|
|||
def10 = values(def10),
|
||||
def11 = values(def11),
|
||||
def12 = values(def12),
|
||||
def13 = values(def13),
|
||||
def1 = values(def1),
|
||||
def2 = values(def2),
|
||||
def3 = values(def3),
|
||||
|
|
|
@ -264,10 +264,10 @@
|
|||
|
||||
<!-- 批量新增或者修改底表数据-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into ofs_passiveorder_detail(id,headerId, receiptCode, skuCode, skuName, quantity, inventorySts, created, createdBy, lastUpdated, lastUpdatedBy, businessDate, businessType)
|
||||
insert into ofs_passiveorder_detail(id,headerId, receiptCode, skuCode, skuName, quantity, inventorySts, created, createdBy, lastUpdated, lastUpdatedBy, businessDate, businessType,def11)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.headerid},#{entity.receiptcode},#{entity.skucode},#{entity.skuname},#{entity.quantity},#{entity.inventorysts},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.businessdate},#{entity.businesstype})
|
||||
(#{entity.id},#{entity.headerid},#{entity.receiptcode},#{entity.skucode},#{entity.skuname},#{entity.quantity},#{entity.inventorysts},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.businessdate},#{entity.businesstype},#{entity.def11})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
id = values(id),
|
||||
|
@ -282,7 +282,8 @@
|
|||
lastUpdated = values(lastUpdated),
|
||||
lastUpdatedBy = values(lastUpdatedBy),
|
||||
businessDate = values(businessDate),
|
||||
businessType = values(businessType)
|
||||
businessType = values(businessType),
|
||||
def11 = values(def11)
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新入库或者退款完成的状态-->
|
||||
|
|
|
@ -847,10 +847,10 @@
|
|||
|
||||
<!-- 批量新增或者修改,TOC、TOB 退货-同步基本底表数据-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tocofs_returngoods_detailed(id,receiptId, receiptCode, refOrderId, refOrderDetailId, sourceOrderCode, sourceLineNum, clientCode, companyCode, facilityCode, skuCode, skuName, requestQty, receivedQty, openQty, quantityUM, totalWeight, totalVolume, totalVolumeWeight, totalAmount, weightUM, volumeUM, inventorySts, inTransInvId, closed, created, createdBy, lastUpdated, lastUpdatedBy, discountPrice, mainTableId, businessDate, refundedAt, businessType)
|
||||
insert into tocofs_returngoods_detailed(id,receiptId, receiptCode, refOrderId, refOrderDetailId, sourceOrderCode, sourceLineNum, clientCode, companyCode, facilityCode, skuCode, skuName, requestQty, receivedQty, openQty, quantityUM, totalWeight, totalVolume, totalVolumeWeight, totalAmount, weightUM, volumeUM, inventorySts, inTransInvId, closed, created, createdBy, lastUpdated, lastUpdatedBy, discountPrice, mainTableId, businessDate, refundedAt, businessType,def23,def24)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.receiptid},#{entity.receiptcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.skucode},#{entity.skuname},#{entity.requestqty},#{entity.receivedqty},#{entity.openqty},#{entity.quantityum},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalamount},#{entity.weightum},#{entity.volumeum},#{entity.inventorysts},#{entity.intransinvid},#{entity.closed},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.discountprice},#{entity.maintableid},#{entity.businessdate},#{entity.refundedat},#{entity.businesstype})
|
||||
(#{entity.id},#{entity.receiptid},#{entity.receiptcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.skucode},#{entity.skuname},#{entity.requestqty},#{entity.receivedqty},#{entity.openqty},#{entity.quantityum},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalamount},#{entity.weightum},#{entity.volumeum},#{entity.inventorysts},#{entity.intransinvid},#{entity.closed},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.discountprice},#{entity.maintableid},#{entity.businessdate},#{entity.refundedat},#{entity.businesstype},#{entity.def23},#{entity.def24})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
id = values(id),
|
||||
|
@ -886,7 +886,9 @@
|
|||
mainTableId = values(mainTableId),
|
||||
businessDate = values(businessDate),
|
||||
refundedAt = values(refundedAt),
|
||||
businessType = values(businessType)
|
||||
businessType = values(businessType),
|
||||
def23 = values(def23),
|
||||
def24 = values(def24)
|
||||
</insert>
|
||||
|
||||
<!-- 批量新增或者修改,TOC退货-库存-->
|
||||
|
|
|
@ -1072,165 +1072,172 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
String newState = value.get(0).getNewState();//红字订单推送状态
|
||||
String def10 = value.get(0).getDef10();//蓝字订单推送状态
|
||||
|
||||
// try {
|
||||
//生成业务日期
|
||||
// String generateBusinessDate = createSuccessFulTradeDate(header);
|
||||
// String generateBusinessDate = value.get(0).getTargetBusinessDate().substring(0, 10);
|
||||
// 验证是否为指定的店铺,如果为true,则取结存价
|
||||
Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
// 把汇总好的出库单明细行合并成一行
|
||||
PassiveStorageSonDetailsDto2 passiveStorageSonDetailsDto2 = groupMergeDetailedRows2(value, isCheckShopChoose);
|
||||
BigDecimal groupTotalPayAmount1 = passiveStorageSonDetailsDto2.getGroupTotalPayAmount();
|
||||
BigDecimal groupShipQty = passiveStorageSonDetailsDto2.getGroupShipQty();
|
||||
//当金额>0,但数量为0时,推送红字应收单
|
||||
if (groupTotalPayAmount1 != null && groupShipQty != null && groupTotalPayAmount1.compareTo(BigDecimal.ZERO) > 0 && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||
try {
|
||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV4();
|
||||
// 生成业务日期
|
||||
String generateBusinessDate = value.get(0).getTargetBusinessDate().substring(0, 10);
|
||||
|
||||
//组装应收单表头
|
||||
// ArapDjzbVO.Parentt parentVo = new ArapDjzbVO.Parentt();
|
||||
// parentVo.setDjrq(generateBusinessDate);//单据日期
|
||||
// parentVo.setDwbm(bdCorpEntity.getUnitcode());//公司
|
||||
// parentVo.setLrr(OverallConstant.getOverAllValue("u8cApiZdrCode"));//录入人
|
||||
// parentVo.setWldx("0");//往来对象标识 固定为:客户
|
||||
// parentVo.setDeptid(bdDeptdocEntity.getDeptcode());//部门
|
||||
// parentVo.setShr(OverallConstant.getOverAllValue("u8cApiZdrCode"));//审批人
|
||||
// parentVo.setShrq(generateBusinessDate);//审核日期
|
||||
// parentVo.setDjlxbm("D0");//单据类型编码
|
||||
// parentVo.setXslxbm(bdBusitypeEntity.getBusicode());//业务流程
|
||||
// parentVo.setFeinvstatus("0");//开票状态
|
||||
// parentVo.setHbbm(bdCubasdocEntity.getCustcode());//客商主键
|
||||
// //店铺档案
|
||||
// parentVo.setZyx1(shopArchives.getDoccode());
|
||||
//// parentVo.setDef1(shopArchives.getDocname());
|
||||
// //来源平台
|
||||
// parentVo.setZyx2(platformArchives.getDoccode());
|
||||
//// parentVo.setDef2(platformArchives.getDocname());
|
||||
// //收发类别
|
||||
// parentVo.setZyx3(bdRdclEntity.getRdcode());
|
||||
//// parentVo.setDef3(bdRdclEntity.getRdname());
|
||||
// //单据红字标识
|
||||
// parentVo.setZyx16("1");
|
||||
//// parentVo.setDef16(OverallConstant.getOverAllValue("u8c自定义项档案-单据红字标识-Y名称"));
|
||||
//// parentVo.setZyx19();//自定义项19 OFS单号不传,因为是汇总的
|
||||
// parentVo.setZyx17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
// parentVo.setZyx18(key);
|
||||
// 组装应收单表头
|
||||
ArapDjzbVO.Parentt parentVo = new ArapDjzbVO.Parentt();
|
||||
parentVo.setDjrq(generateBusinessDate);//单据日期
|
||||
parentVo.setDwbm(bdCorpEntity.getUnitcode());//公司
|
||||
parentVo.setLrr(OverallConstant.getOverAllValue("u8cApiZdrCode"));//录入人
|
||||
parentVo.setWldx("0");//往来对象标识 固定为:客户
|
||||
parentVo.setDeptid(bdDeptdocEntity.getDeptcode());//部门
|
||||
parentVo.setShr(OverallConstant.getOverAllValue("u8cApiZdrCode"));//审批人
|
||||
parentVo.setShrq(generateBusinessDate);//审核日期
|
||||
parentVo.setDjlxbm("D0");//单据类型编码
|
||||
parentVo.setXslxbm(bdBusitypeEntity.getBusicode());//业务流程
|
||||
parentVo.setFeinvstatus("0");//开票状态
|
||||
parentVo.setHbbm(bdCubasdocEntity.getCustcode());//客商主键
|
||||
//店铺档案
|
||||
parentVo.setZyx1(shopArchives.getDoccode());
|
||||
// parentVo.setDef1(shopArchives.getDocname());
|
||||
//来源平台
|
||||
parentVo.setZyx2(platformArchives.getDoccode());
|
||||
// parentVo.setDef2(platformArchives.getDocname());
|
||||
//收发类别
|
||||
parentVo.setZyx3(bdRdclEntity.getRdcode());
|
||||
// parentVo.setDef3(bdRdclEntity.getRdname());
|
||||
|
||||
//验证是否为指定的店铺,如果为true,则取结存价
|
||||
// Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
//把汇总好的出库单明细行合并成一行
|
||||
// PassiveStorageSonDetailsDto2 passiveStorageSonDetailsDto2 = groupMergeDetailedRows2(value, isCheckShopChoose);
|
||||
//存货管理档案:取发货公司的存货管理档案
|
||||
// BdInvmandocEntity bdInvmandocEntity = value.get(0).getBdInvmandocEntity();
|
||||
//存货基础档案
|
||||
// BdInvbasdocEntity bdInvbasdocEntity = value.get(0).getBdInvbasdocEntity();
|
||||
//根据存货基础档案编码,查询当前存货的税率
|
||||
// BdTaxitemsEntity bdTaxitemsEntity1 = value.get(0).getBdTaxitemsEntity();
|
||||
parentVo.setZyx8(OverallConstant.getOverAllValue("售后类型标识-TOC无源件-编码"));
|
||||
//单据红字标识
|
||||
parentVo.setZyx16("1");
|
||||
// parentVo.setDef16(OverallConstant.getOverAllValue("u8c自定义项档案-单据红字标识-Y名称"));
|
||||
// parentVo.setZyx19();//自定义项19 OFS单号不传,因为是汇总的
|
||||
parentVo.setZyx17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
parentVo.setZyx18(key);
|
||||
|
||||
//如果合并后的金额为0,则不传到U8C
|
||||
// Assert.notNull(passiveStorageSonDetailsDto2.getGroupTotalPayAmount(), "passiveStorageSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
||||
// BigDecimal groupTotalPayAmount = passiveStorageSonDetailsDto2.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
// if ("0".equals(groupTotalPayAmount.stripTrailingZeros().toPlainString())) {
|
||||
// continue;
|
||||
// }
|
||||
// 存货管理档案:取发货公司的存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = value.get(0).getBdInvmandocEntity();
|
||||
// 存货基础档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity = value.get(0).getBdInvbasdocEntity();
|
||||
// 根据存货基础档案编码,查询当前存货的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity1 = value.get(0).getBdTaxitemsEntity();
|
||||
|
||||
// String tax = null;//税率
|
||||
// BigDecimal noriginalcurmny = null;//无税金额
|
||||
// BigDecimal noriginalcurtaxmny = null;//税额
|
||||
// try {
|
||||
// tax = new BigDecimal(bdTaxitemsEntity1.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
|
||||
// noriginalcurmny = groupTotalPayAmount.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
// noriginalcurtaxmny = groupTotalPayAmount.subtract(noriginalcurmny).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("金额计算失败", e);
|
||||
// Assert.state(false, "金额计算失败 跑出异常:{}", e.getMessage());
|
||||
// }
|
||||
// 如果合并后的金额为0,则不传到U8C
|
||||
Assert.notNull(passiveStorageSonDetailsDto2.getGroupTotalPayAmount(), "passiveStorageSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
||||
BigDecimal groupTotalPayAmount = passiveStorageSonDetailsDto2.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
if ("0".equals(groupTotalPayAmount.stripTrailingZeros().toPlainString())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//组装应收单表体
|
||||
// List<ArapDjzbVO.Childrenn> pushScenarioType = new ArrayList<>();
|
||||
// ArapDjzbVO.Childrenn arapDjzbVOChildrenn = new ArapDjzbVO.Childrenn();
|
||||
// pushScenarioType.add(arapDjzbVOChildrenn);
|
||||
// arapDjzbVOChildrenn.setCinventoryid(bdInvbasdocEntity.getInvcode());//存货管理档案
|
||||
// arapDjzbVOChildrenn.setJfbbje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方本币金额
|
||||
// arapDjzbVOChildrenn.setJfybje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方原币金额
|
||||
// arapDjzbVOChildrenn.setJfbbsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方本币税金
|
||||
// arapDjzbVOChildrenn.setJfybsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方原币税金
|
||||
// arapDjzbVOChildrenn.setWbfbbje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方本币无税金额
|
||||
// arapDjzbVOChildrenn.setJfybwsje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方原币无税金额
|
||||
String tax = null;//税率
|
||||
BigDecimal noriginalcurmny = null;//无税金额
|
||||
BigDecimal noriginalcurtaxmny = null;//税额
|
||||
try {
|
||||
tax = new BigDecimal(bdTaxitemsEntity1.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
|
||||
noriginalcurmny = groupTotalPayAmount.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
noriginalcurtaxmny = groupTotalPayAmount.subtract(noriginalcurmny).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("金额计算失败", e);
|
||||
Assert.state(false, "金额计算失败 跑出异常:{}", e.getMessage());
|
||||
}
|
||||
|
||||
// //退货没有邮费金额,已经向万万确认
|
||||
// //平台优惠
|
||||
// if (passiveStorageSonDetailsDto2.getVdef4() != null) {
|
||||
// BigDecimal vdef4 = passiveStorageSonDetailsDto2.getVdef4();
|
||||
// if (vdef4.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// //发货运费-存货基本档案
|
||||
// BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01");
|
||||
// //存货管理档案
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
// //存货对应的税率
|
||||
// BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01");
|
||||
// //补充:平台优惠-存货
|
||||
// BigDecimal absAccumulatedPostage = vdef4.abs();
|
||||
// BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
// queryAdditionUtil.additionalV2(pushScenarioType, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
// }
|
||||
// }
|
||||
// //达人优惠
|
||||
// if (passiveStorageSonDetailsDto2.getVdef6() != null) {
|
||||
// BigDecimal vdef6 = passiveStorageSonDetailsDto2.getVdef6();
|
||||
// if (vdef6.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// //发货运费-存货基本档案
|
||||
// BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02");
|
||||
// //存货管理档案
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
// //存货对应的税率
|
||||
// BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02");
|
||||
// //补充:达人优惠-存货
|
||||
// BigDecimal absAccumulatedPostage = vdef6.abs();
|
||||
// BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
// queryAdditionUtil.additionalV2(pushScenarioType, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
// }
|
||||
// }
|
||||
//支付优惠
|
||||
// if (passiveStorageSonDetailsDto2.getVdef5() != null) {
|
||||
// BigDecimal vdef5 = passiveStorageSonDetailsDto2.getVdef5();
|
||||
// if (vdef5.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// //发货运费-存货基本档案
|
||||
// BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04");
|
||||
// //存货管理档案
|
||||
// BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
// //存货对应的税率
|
||||
// BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04");
|
||||
// //补充:支付优惠-存货
|
||||
// BigDecimal absAccumulatedPostage = vdef5.abs();
|
||||
// BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
// queryAdditionUtil.additionalV2(pushScenarioType, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
// }
|
||||
// }
|
||||
// 组装应收单表体
|
||||
List<ArapDjzbVO.Childrenn> pushScenarioType = new ArrayList<>();
|
||||
ArapDjzbVO.Childrenn arapDjzbVOChildrenn = new ArapDjzbVO.Childrenn();
|
||||
pushScenarioType.add(arapDjzbVOChildrenn);
|
||||
arapDjzbVOChildrenn.setCinventoryid(bdInvbasdocEntity.getInvcode());//存货管理档案
|
||||
arapDjzbVOChildrenn.setJfbbje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方本币金额
|
||||
arapDjzbVOChildrenn.setJfybje("-" + groupTotalPayAmount.stripTrailingZeros().toPlainString());//借方原币金额
|
||||
arapDjzbVOChildrenn.setJfbbsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方本币税金
|
||||
arapDjzbVOChildrenn.setJfybsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方原币税金
|
||||
arapDjzbVOChildrenn.setWbfbbje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方本币无税金额
|
||||
arapDjzbVOChildrenn.setJfybwsje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方原币无税金额
|
||||
|
||||
//推送U8C
|
||||
// List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
||||
// ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
||||
// arapDjzbVO.setParentvo(parentVo);
|
||||
// arapDjzbVO.setChildren(pushScenarioType);
|
||||
// arapDjzbVOList.add(arapDjzbVO);
|
||||
//
|
||||
// Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
||||
// listMap.put("djzbvo", arapDjzbVOList);
|
||||
// ArapDjzb arapDjzb = sendU8cRedReceivable(JSON.toJSONString(listMap));
|
||||
// String djbh = null;
|
||||
// String dwbm = null;
|
||||
// String vouchid = null;
|
||||
// if (arapDjzb != null && arapDjzb.getParentvo() != null) {
|
||||
// djbh = arapDjzb.getParentvo().getDjbh();
|
||||
// dwbm = arapDjzb.getParentvo().getDwbm();
|
||||
// vouchid = arapDjzb.getParentvo().getVouchid();
|
||||
// }
|
||||
// logger.info("TOC红字应收单:{} 应收单主键:{} 销售公司:{}", djbh, vouchid, dwbm);
|
||||
//生成业务日期
|
||||
//退货没有邮费金额,已经向万万确认
|
||||
//平台优惠
|
||||
if (passiveStorageSonDetailsDto2.getVdef4() != null) {
|
||||
BigDecimal vdef4 = passiveStorageSonDetailsDto2.getVdef4();
|
||||
if (vdef4.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01");
|
||||
//补充:平台优惠-存货
|
||||
BigDecimal absAccumulatedPostage = vdef4.abs();
|
||||
BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
queryAdditionUtil.additionalV2(pushScenarioType, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//达人优惠
|
||||
if (passiveStorageSonDetailsDto2.getVdef6() != null) {
|
||||
BigDecimal vdef6 = passiveStorageSonDetailsDto2.getVdef6();
|
||||
if (vdef6.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02");
|
||||
//补充:达人优惠-存货
|
||||
BigDecimal absAccumulatedPostage = vdef6.abs();
|
||||
BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
queryAdditionUtil.additionalV2(pushScenarioType, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
// 支付优惠
|
||||
if (passiveStorageSonDetailsDto2.getVdef5() != null) {
|
||||
BigDecimal vdef5 = passiveStorageSonDetailsDto2.getVdef5();
|
||||
if (vdef5.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04");
|
||||
//补充:支付优惠-存货
|
||||
BigDecimal absAccumulatedPostage = vdef5.abs();
|
||||
BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
queryAdditionUtil.additionalV2(pushScenarioType, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
// 推送U8C
|
||||
List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
||||
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
||||
arapDjzbVO.setParentvo(parentVo);
|
||||
arapDjzbVO.setChildren(pushScenarioType);
|
||||
arapDjzbVOList.add(arapDjzbVO);
|
||||
|
||||
// updateSuccessOrFail3(value, "Y", "success", djbh, vouchid);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("TOC红字应收单转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||
// //记录失败
|
||||
// String message = e.getMessage();
|
||||
// if (message == null) {
|
||||
// message = "未知错误";
|
||||
// }
|
||||
// updateSuccessOrFail3(value, "N", message, null, null);
|
||||
// }
|
||||
Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
||||
listMap.put("djzbvo", arapDjzbVOList);
|
||||
ArapDjzb arapDjzb = sendU8cRedReceivable(JSON.toJSONString(listMap));
|
||||
String djbh = null;
|
||||
String dwbm = null;
|
||||
String vouchid = null;
|
||||
if (arapDjzb != null && arapDjzb.getParentvo() != null) {
|
||||
djbh = arapDjzb.getParentvo().getDjbh();
|
||||
dwbm = arapDjzb.getParentvo().getDwbm();
|
||||
vouchid = arapDjzb.getParentvo().getVouchid();
|
||||
}
|
||||
logger.info("TOC红字应收单:{} 应收单主键:{} 销售公司:{}", djbh, vouchid, dwbm);
|
||||
// 记录同步状态
|
||||
updateSuccessOrFail3(value, "Y", "success", djbh, vouchid, value.get(0).getStorageTimeStamp());
|
||||
} catch (Exception e) {
|
||||
logger.error("TOC红字应收单转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||
//记录失败
|
||||
String message = e.getMessage();
|
||||
if (message == null) {
|
||||
message = "未知错误";
|
||||
}
|
||||
updateSuccessOrFail3(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
||||
}
|
||||
}
|
||||
|
||||
//当金额大于或者等于0,数量大于0推送销售订单
|
||||
if (groupTotalPayAmount1 != null && groupShipQty != null && groupTotalPayAmount1.compareTo(BigDecimal.ZERO) >= 0 && groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
||||
try {
|
||||
String generateBusinessDate = value.get(0).getTargetBusinessDate().substring(0, 10);
|
||||
|
||||
|
@ -1281,9 +1288,9 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
saleorderRequestDto.setChildrenvo(saleorderRequestChildrenDtoList);
|
||||
|
||||
//验证是否为指定的店铺,如果为true,则取结存价
|
||||
Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
// Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
//把汇总好的出库单明细行合并成一行
|
||||
PassiveStorageSonDetailsDto2 passiveStorageSonDetailsDto2 = groupMergeDetailedRows2(value, isCheckShopChoose);
|
||||
// PassiveStorageSonDetailsDto2 passiveStorageSonDetailsDto2 = groupMergeDetailedRows2(value, isCheckShopChoose);
|
||||
|
||||
//存货管理档案:取发货公司的存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = value.get(0).getBdInvmandocEntity();
|
||||
|
@ -1436,7 +1443,6 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
boolean oneSuccess = false;
|
||||
if (!"Y".equals(newState)) {
|
||||
//推送U8C红字销售订单,如果推送失败,抛出异常,那么就会外围的try catch捕获,代码不会往下执行
|
||||
|
||||
List<SaleorderRequestDto> saleorderRequestDtoList = new ArrayList<>();
|
||||
saleorderRequestDtoList.add(saleorderRequestDto);
|
||||
Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
|
||||
|
@ -1499,6 +1505,7 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
updateSuccessOrFail3(value, "N", message, null, null, value.get(0).getStorageTimeStamp());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//2024年8月6日 11:28:54此处不记录失败,不认为是错误
|
||||
logger.info("summaryDimensionMap变量或者bdBusitypeEntity变量为空,因此主要的推送逻辑不会被执行!");
|
||||
|
@ -2537,6 +2544,20 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
return bdBusitypeEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2025年8月15日15:58:55 查询U8C业务流程
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdBusitypeEntity u8cOperationFlowV4() throws Exception {
|
||||
//查询业务流程
|
||||
//2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
||||
String processName = "TOC销售退款";
|
||||
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
|
||||
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
|
||||
return bdBusitypeEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查参数是否为空
|
||||
* 2024年8月6日 11:40:19 保险的做法,最好还是验证一下
|
||||
|
@ -2911,6 +2932,16 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
if (header.getRelatedAt() != null) {
|
||||
ofsPassiveorderDetailEntity.setBusinessdate(header.getRelatedAt());
|
||||
}
|
||||
//交易成功时间
|
||||
HeaderDetailsDto headerDetailsDto = header.getHeaderDetailsDto();
|
||||
if (headerDetailsDto != null && headerDetailsDto.getHeader() != null) {
|
||||
HeaderDto header1 = headerDetailsDto.getHeader();
|
||||
String tradeSuccessAt = header1.getTradeSuccessAt();
|
||||
if (tradeSuccessAt != null) {
|
||||
ofsPassiveorderDetailEntity.setDef11(tradeSuccessAt);
|
||||
}
|
||||
}
|
||||
|
||||
//业务类型
|
||||
ofsPassiveorderDetailEntity.setBusinesstype("TOC_ORDER");
|
||||
}
|
||||
|
@ -2949,6 +2980,19 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
String relatedAt = header2.getRelatedAt();
|
||||
DateTime relatedAtDate = DateUtil.parse(relatedAt);
|
||||
|
||||
HeaderDetailsDto headerDetailsDto1 = header.getHeaderDetailsDto();
|
||||
if (headerDetailsDto1 != null && headerDetailsDto1.getHeader() != null) {
|
||||
HeaderDto header3 = headerDetailsDto1.getHeader();
|
||||
if (header3.getTradeSuccessAt() != null) {
|
||||
ofsPassiveorderDetailEntity.setDef13(header3.getTradeSuccessAt());
|
||||
}
|
||||
}
|
||||
|
||||
String storageTimeStamp = header.getStorageTimeStamp();
|
||||
if (storageTimeStamp != null) {
|
||||
ofsPassiveorderDetailEntity.setDef7(storageTimeStamp);
|
||||
}
|
||||
|
||||
//售后订单-退款时间
|
||||
// String refundedAt = header.getRefundedAt();
|
||||
// DateTime refundedAtDate = DateUtil.parse(refundedAt);
|
||||
|
@ -3463,10 +3507,19 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
for (int i = 0; i < sonDetailsDtoList.size(); i++) {
|
||||
PassiveStorageSonDetailsDto passiveStorageSonDetailsDto = sonDetailsDtoList.get(i);
|
||||
|
||||
String tradeSuccessAt = null;
|
||||
PassiveStorageResponse.Header header = passiveStorageSonDetailsDto.getHeader();
|
||||
if (header != null && header.getHeaderDetailsDto() != null) {
|
||||
HeaderDetailsDto headerDetailsDto = header.getHeaderDetailsDto();
|
||||
HeaderDto header1 = headerDetailsDto.getHeader();
|
||||
tradeSuccessAt = header1.getTradeSuccessAt();
|
||||
}
|
||||
|
||||
OfsPassiveorderDetailEntity ofsPassiveorderDetailEntity = new OfsPassiveorderDetailEntity();
|
||||
ofsPassiveorderDetailEntity.setId(passiveStorageSonDetailsDto.getId());
|
||||
//2025年8月7日15:51:21 不需要这个字段,保存原始底表的mysql会处理这个字段
|
||||
// ofsPassiveorderDetailEntity.setTransactionDate(passiveStorageSonDetailsDto.getRefundedAt());
|
||||
ofsPassiveorderDetailEntity.setDef11(tradeSuccessAt);
|
||||
ofsPassiveorderDetailEntity.setNewpushdate(getNewDateStr());
|
||||
ofsPassiveorderDetailEntity.setNewtransmitinfo(finalNewTransmitInfo);
|
||||
ofsPassiveorderDetailEntity.setNewstate(newstate);
|
||||
|
@ -3677,9 +3730,19 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
|
|||
List<OnlyAfterSalesBEntity> onlyAfterSalesBEntityArrayList = new ArrayList<>();
|
||||
for (int i = 0; i < value.size(); i++) {
|
||||
PassiveStorageSonDetailsDto2 passiveStorageSonDetailsDto2 = value.get(i);
|
||||
String tradeSuccessAt = null;
|
||||
RerturnGoodsOrderSearchHeader rerturnGoodsOrderSearchHeader = passiveStorageSonDetailsDto2.getRerturnGoodsOrderSearchHeader();
|
||||
if (rerturnGoodsOrderSearchHeader != null) {
|
||||
HeaderDetailsDto headerDetailsDto = rerturnGoodsOrderSearchHeader.getHeaderDetailsDto();
|
||||
if (headerDetailsDto != null) {
|
||||
HeaderDto header = headerDetailsDto.getHeader();
|
||||
tradeSuccessAt = header.getTradeSuccessAt();
|
||||
}
|
||||
}
|
||||
|
||||
OnlyAfterSalesBEntity ofsPassiveorderDetailEntity = new OnlyAfterSalesBEntity();
|
||||
ofsPassiveorderDetailEntity.setOfsid(passiveStorageSonDetailsDto2.getId());
|
||||
ofsPassiveorderDetailEntity.setDef13(tradeSuccessAt);
|
||||
|
||||
ofsPassiveorderDetailEntity.setDef8(getNewDateStr());
|
||||
ofsPassiveorderDetailEntity.setDef9(finalNewTransmitInfo);
|
||||
|
|
|
@ -1004,7 +1004,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
||||
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
||||
}
|
||||
logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||
logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{} 公司:{}", vreceiptcode, csaleid, pk_corp, bdCorpEntity.getUnitname());
|
||||
updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
|
||||
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
|
||||
//选择暂存等待下次发起
|
||||
|
@ -1095,6 +1095,168 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
String newstate4 = oldValue.get(0).getNewstate4();
|
||||
String def15 = oldValue.get(0).getDef15();
|
||||
|
||||
//验证是否为指定的店铺,如果为true,则取结存价
|
||||
Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
//把汇总好的出库单明细行合并成一行
|
||||
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, sceneType);
|
||||
Assert.notNull(goodsRertunSonDetailsDto, "合并明细行失败!");
|
||||
BigDecimal groupShipQty = goodsRertunSonDetailsDto.getGroupShipQty();
|
||||
BigDecimal groupTotalPayAmount = goodsRertunSonDetailsDto.getGroupTotalPayAmount();
|
||||
|
||||
//当金额>0,但数量为0时,推送红字应收单
|
||||
if (groupTotalPayAmount != null && groupShipQty != null && groupTotalPayAmount.compareTo(BigDecimal.ZERO) > 0 && groupShipQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||
try {
|
||||
BdBusitypeEntity bdBusitypeEntity = u8cOperationFlowV4();
|
||||
//生成业务日期
|
||||
String generateBusinessDate = createSuccessFulTradeDate(header);
|
||||
|
||||
//红字应收单表头
|
||||
ArapDjzbVO.Parentt parentVo = new ArapDjzbVO.Parentt();
|
||||
parentVo.setDjrq(generateBusinessDate);//单据日期
|
||||
parentVo.setDwbm(bdCorpEntity.getUnitcode());//公司
|
||||
parentVo.setLrr(OverallConstant.getOverAllValue("u8cApiZdrCode"));//录入人
|
||||
parentVo.setWldx("0");//往来对象标识 固定为:客户
|
||||
parentVo.setDeptid(bdDeptdocEntity.getDeptcode());//部门
|
||||
parentVo.setShr(OverallConstant.getOverAllValue("u8cApiZdrCode"));//审批人
|
||||
parentVo.setShrq(generateBusinessDate);//审核日期
|
||||
parentVo.setDjlxbm("D0");//单据类型编码
|
||||
parentVo.setXslxbm(bdBusitypeEntity.getBusicode());//业务流程
|
||||
parentVo.setFeinvstatus("0");//开票状态
|
||||
parentVo.setHbbm(bdCubasdocEntity.getCustcode());//客商主键
|
||||
parentVo.setZyx1(shopArchives.getDoccode());//店铺档案
|
||||
parentVo.setZyx2(platformArchives.getDoccode());//来源平台
|
||||
parentVo.setZyx3(bdRdclEntity.getRdcode());//收发类别
|
||||
parentVo.setZyx16("1");//单据红字标识
|
||||
parentVo.setZyx17(ProfilesActiveConstant.sourceSystem1);//来源系统
|
||||
parentVo.setZyx18(keyGroup);//汇总维度
|
||||
|
||||
//验证是否为指定的店铺,如果为true,则取结存价
|
||||
// Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
//把汇总好的出库单明细行合并成一行
|
||||
// GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, sceneType);
|
||||
|
||||
//存货管理档案:取发货公司的存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = oldValue.get(0).getBdInvmandocEntity();
|
||||
//存货基础档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity = oldValue.get(0).getBdInvbasdocEntity();
|
||||
//根据存货基础档案编码,查询当前存货的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity1 = oldValue.get(0).getBdTaxitemsEntity();
|
||||
|
||||
//如果合并后的金额为0,则不传到U8C
|
||||
Assert.notNull(goodsRertunSonDetailsDto.getGroupTotalPayAmount(), "goodsRertunSonDetailsDto.getGroupTotalPayAmount()不能为空!");
|
||||
BigDecimal groupTotalPayAmount2 = goodsRertunSonDetailsDto.getGroupTotalPayAmount().setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
if ("0".equals(groupTotalPayAmount2.stripTrailingZeros().toPlainString())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//修改为生成红字应收单表体
|
||||
List<ArapDjzbVO.Childrenn> childrennArrayList = new ArrayList<>();
|
||||
ArapDjzbVO.Childrenn arapDjzbVOChildrenn = new ArapDjzbVO.Childrenn();
|
||||
childrennArrayList.add(arapDjzbVOChildrenn);
|
||||
arapDjzbVOChildrenn.setCinventoryid(bdInvbasdocEntity.getInvcode());//存货管理档案
|
||||
arapDjzbVOChildrenn.setJfbbje("-" + groupTotalPayAmount2.stripTrailingZeros().toPlainString());//借方本币金额
|
||||
arapDjzbVOChildrenn.setJfybje("-" + groupTotalPayAmount2.stripTrailingZeros().toPlainString());//借方原币金额
|
||||
// arapDjzbVOChildrenn.setJfbbsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方本币税金
|
||||
// arapDjzbVOChildrenn.setJfybsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方原币税金
|
||||
// arapDjzbVOChildrenn.setWbfbbje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方本币无税金额
|
||||
// arapDjzbVOChildrenn.setJfybwsje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方原币无税金额
|
||||
|
||||
//退货没有邮费金额,已经向万万确认
|
||||
//平台优惠
|
||||
if (goodsRertunSonDetailsDto.getVdef4() != null) {
|
||||
BigDecimal vdef4 = goodsRertunSonDetailsDto.getVdef4();
|
||||
if (vdef4.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY01");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY01");
|
||||
//补充:平台优惠-存货
|
||||
BigDecimal absAccumulatedPostage = vdef4.abs();
|
||||
BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
queryAdditionUtil.additionalV3(childrennArrayList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//达人优惠
|
||||
if (goodsRertunSonDetailsDto.getVdef6() != null) {
|
||||
BigDecimal vdef6 = goodsRertunSonDetailsDto.getVdef6();
|
||||
if (vdef6.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY02");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY02");
|
||||
//补充:达人优惠-存货
|
||||
BigDecimal absAccumulatedPostage = vdef6.abs();
|
||||
BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
queryAdditionUtil.additionalV3(childrennArrayList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
//支付优惠
|
||||
if (goodsRertunSonDetailsDto.getVdef5() != null) {
|
||||
BigDecimal vdef5 = goodsRertunSonDetailsDto.getVdef5();
|
||||
if (vdef5.compareTo(BigDecimal.ZERO) > 0) {
|
||||
//发货运费-存货基本档案
|
||||
BdInvbasdocEntity bdInvbasdocEntity1 = mapBdInvbasdocEntity.get("FY04");
|
||||
//存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity1 = stringBdInvmandocEntityMap.get(bdInvbasdocEntity1.getInvcode() + deliverGoodsCorp.getPkCorp());
|
||||
//存货对应的税率
|
||||
BdTaxitemsEntity bdTaxitemsEntity = stringBdTaxitemsEntityMap.get("FY04");
|
||||
//补充:支付优惠-存货
|
||||
BigDecimal absAccumulatedPostage = vdef5.abs();
|
||||
BigDecimal negativeValue = absAccumulatedPostage.negate();
|
||||
queryAdditionUtil.additionalV3(childrennArrayList, bdInvmandocEntity1, bdInvbasdocEntity1, negativeValue, bdTaxitemsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType) || ProfilesActiveConstant.PUSH_SCENE_TYPE_2.equals(pushScenarioType)) {
|
||||
//推送U8C生成红字应收单
|
||||
List<ArapDjzbVO> arapDjzbVOList = new ArrayList<>();
|
||||
ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
|
||||
arapDjzbVO.setParentvo(parentVo);
|
||||
arapDjzbVO.setChildren(childrennArrayList);
|
||||
arapDjzbVOList.add(arapDjzbVO);
|
||||
|
||||
Map<String, List<ArapDjzbVO>> listMap = new HashMap<>();
|
||||
listMap.put("djzbvo", arapDjzbVOList);
|
||||
|
||||
ArapDjzb arapDjzb = sendU8cRedReceivable(JSON.toJSONString(listMap));
|
||||
String djbh = null;
|
||||
String dwbm = null;
|
||||
String vouchid = null;
|
||||
if (arapDjzb != null && arapDjzb.getParentvo() != null) {
|
||||
djbh = arapDjzb.getParentvo().getDjbh();
|
||||
dwbm = arapDjzb.getParentvo().getDwbm();
|
||||
vouchid = arapDjzb.getParentvo().getVouchid();
|
||||
}
|
||||
logger.info("TOC红字应收单:{} 销售订单主键:{} 销售公司:{} 公司:{}", djbh, vouchid, dwbm, bdCorpEntity.getUnitname());
|
||||
|
||||
updateSuccessOrFail2(oldValue, "Y", "success", djbh, vouchid, oldValue.get(0).getStorageTimeStamp());
|
||||
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_0.equals(pushScenarioType)) {
|
||||
//不推送U8C,单据暂存
|
||||
String vreceiptcode = "暂存";
|
||||
String csaleid = "暂存";
|
||||
String newstate = "S";
|
||||
String newTransmitInfo = "暂存";
|
||||
updateSuccessOrFail2(oldValue, newstate, newTransmitInfo, vreceiptcode, csaleid, oldValue.get(0).getStorageTimeStamp());
|
||||
} else {
|
||||
Assert.state(false, "未知的场景类型 pushScenarioType={}", pushScenarioType);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
|
||||
//记录失败
|
||||
String message = e.getMessage();
|
||||
if (message == null) {
|
||||
message = "未知错误";
|
||||
}
|
||||
updateSuccessOrFail2(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
||||
}
|
||||
}
|
||||
|
||||
//当金额大于或者等于0,数量大于0推送销售订单
|
||||
if (groupShipQty != null && groupTotalPayAmount != null && groupTotalPayAmount.compareTo(BigDecimal.ZERO) >= 0 && groupShipQty.compareTo(BigDecimal.ZERO) > 0) {
|
||||
try {
|
||||
// checkArchives(oldValue.get(0));
|
||||
//生成业务日期
|
||||
|
@ -1166,11 +1328,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
List<SaleorderRequestChildrenDto> saleorderRequestChildrenDtoList = new ArrayList<>();
|
||||
saleorderRequestDto.setChildrenvo(saleorderRequestChildrenDtoList);
|
||||
|
||||
//验证是否为指定的店铺,如果为true,则取结存价
|
||||
Boolean isCheckShopChoose = balanceUnitPriceUtil.checkOfsShop(header.getStoreCode());
|
||||
//把汇总好的出库单明细行合并成一行
|
||||
GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue, isCheckShopChoose, sceneType);
|
||||
|
||||
//存货管理档案:取发货公司的存货管理档案
|
||||
BdInvmandocEntity bdInvmandocEntity = oldValue.get(0).getBdInvmandocEntity();
|
||||
//存货基础档案
|
||||
|
@ -1348,7 +1505,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
|
||||
csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
|
||||
}
|
||||
logger.info("TOC红字销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
|
||||
logger.info("TOC红字销售订单编号:{} 销售订单主键:{} 销售公司:{} 公司:{}", vreceiptcode, csaleid, pk_corp, bdCorpEntity.getUnitname());
|
||||
updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid, oldValue.get(0).getStorageTimeStamp());
|
||||
oneSuccess = true;
|
||||
|
||||
|
@ -1442,6 +1599,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
updateSuccessOrFail2(oldValue, "N", message, null, null, oldValue.get(0).getStorageTimeStamp());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//2024年8月6日 11:28:54此处不记录失败,不认为是错误
|
||||
logger.info("summaryDimensionMap变量或者bdBusitypeEntity变量为空,因此主要的推送逻辑不会被执行!");
|
||||
|
@ -1656,6 +1814,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
// StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details2.get(i);
|
||||
// stockinB.setReceivedQty(stockinB.getRequestQty());
|
||||
// }
|
||||
// headerDetailsDtos.get(0).getHeader().setTradeSuccessAt("2025-08-18 17:20:00");
|
||||
|
||||
markTimeInMorningEvening(returnGoodHeaderDetailsDataDtoList1);
|
||||
if ("stock".equals(sceneType)) {
|
||||
returnGoodHeaderDetailsDataDtoList1 = filtrationTransactionSuccessTime(returnGoodHeaderDetailsDataDtoList1);
|
||||
|
@ -2085,6 +2245,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
// return bdBusitypeEntity;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 2025年8月15日15:58:55 查询U8C业务流程
|
||||
*
|
||||
* @author liuyang
|
||||
*/
|
||||
private BdBusitypeEntity u8cOperationFlowV4() throws Exception {
|
||||
//查询业务流程
|
||||
//2024年8月6日 11:33:07 具体的业务流程名称,还需要实施提供
|
||||
String processName = "TOC销售退款";
|
||||
BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
|
||||
Assert.notNull(bdBusitypeEntity, "根据业务流程名称({})没有查询到业务流程", processName);
|
||||
return bdBusitypeEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查参数是否为空
|
||||
* 2024年8月6日 11:40:19 保险的做法,最好还是验证一下
|
||||
|
@ -2182,6 +2356,9 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
//测试
|
||||
// goodsRertunSonDetailsDto.setReceivedQty("1");
|
||||
|
||||
//2025年8月18日16:13:12 如果
|
||||
|
||||
|
||||
Assert.notNull(totalAmount, "实退金额不能为空 明细行主键:{}", goodsRertunSonDetailsDto.getId());
|
||||
Assert.notNull(goodsRertunSonDetailsDto.getReceivedQty(), "实收数量不能为空 明细行主键:{}", goodsRertunSonDetailsDto.getId());
|
||||
|
||||
|
@ -2325,6 +2502,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
// if (returnGoodSearchHeaderDto.getRefundedAt() != null) {
|
||||
// tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt());
|
||||
// }
|
||||
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto = returnGoodSearchHeaderDto.getHeaderDetailsDto();
|
||||
if (headerDetailsDto != null && headerDetailsDto.getHeader() != null) {
|
||||
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header = headerDetailsDto.getHeader();
|
||||
if (header != null && header.getTradeSuccessAt() != null) {
|
||||
tocofsReturngoodsDetailedEntity.setDef23(header.getTradeSuccessAt());
|
||||
}
|
||||
}
|
||||
|
||||
//入库类型标记
|
||||
String storageTimeStamp = returnGoodSearchHeaderDto.getStorageTimeStamp();
|
||||
if (storageTimeStamp != null && !"".equals(storageTimeStamp)) {
|
||||
tocofsReturngoodsDetailedEntity.setDef24(storageTimeStamp);
|
||||
}
|
||||
|
||||
//业务类型
|
||||
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
||||
}
|
||||
|
@ -2667,6 +2858,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header2 = headerDetailsDto.getHeader();
|
||||
tradeSuccessAt = header2.getTradeSuccessAt();
|
||||
}
|
||||
// tradeSuccessAt = "2025-08-18 17:13:35";
|
||||
|
||||
//如果报错内容太长了,则仅保留500个长度
|
||||
if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
|
||||
|
@ -2793,6 +2985,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
tocofsReturngoodsDetailedEntity.setNewsystemprimary3(newsystemprimary);
|
||||
}
|
||||
tocofsReturngoodsDetailedEntity.setDef23(tradeSuccessAt);
|
||||
tocofsReturngoodsDetailedEntity.setDef24(goodsRertunSonDetailsDto.getStorageTimeStamp());
|
||||
tocofsReturngoodsDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@ spring:
|
|||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=600000000&socketTimeout=600000000&autoReconnectForPools=true&keepAlive=true
|
||||
username: root
|
||||
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
#url: jdbc:mysql://127.0.0.1:3307/businesscenter?useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=600000000&socketTimeout=600000000&autoReconnectForPools=true&keepAlive=true
|
||||
#username: root
|
||||
#password: a0d71920b8d3e5cf376fcecc2a23012f
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
|
|
|
@ -37,7 +37,7 @@ public class PassiveWarehouseReceiptToCTest {
|
|||
//情况二
|
||||
// passiveWarehouseReceiptToC.startImplementByCode("RH20250731000423", "tran");
|
||||
//情况三
|
||||
passiveWarehouseReceiptToC.startImplementByCode("RH20250722000231", "stock");
|
||||
passiveWarehouseReceiptToC.startImplementByCode("RH20250731000613", "tran");
|
||||
// passiveWarehouseReceiptToC.startImplementByCode("RH20250723000754", "tran");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -69,7 +69,14 @@ public class SoSaleReturnPluginInitializerToCTest {
|
|||
try {
|
||||
// soSaleReturnPluginInitializerToC.startImplementByTradeTime("2025-04-28 00:00:00", "2025-04-28 23:59:59", "0");
|
||||
|
||||
soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072800003381", "tran");
|
||||
//满足红字应收单
|
||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072200001324", "tran");
|
||||
//情况一
|
||||
soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072900000460", "stock");
|
||||
//情况二
|
||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025072800000594", "tran");
|
||||
//情况三
|
||||
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025080200002257", "tran");
|
||||
|
||||
// soSaleReturnPluginInitializerToC.startImplementStockByTime("2025-01-31 00:00:00", "2025-01-31 23:59:59", "0");
|
||||
|
||||
|
|
Loading…
Reference in New Issue