feat(buildpackage): 新增交易时间字段并优化销售订单推送逻辑- 在 OfsPassiveorderDetailEntity 中添加 transactionDate 字段,用于记录交易时间
- 更新OfsPassiveorderDetailEntity.xml,增加 transactionDate 字段的数据库映射 - 修改 SoSaleReturnPluginInitializerToC 中的 filterForSale 方法,增加对 returnNode 的空值检查 - 在 ArapDjzbVO 中添加 def1、def2、def3 和 def16 字段,用于扩展自定义项 - 更新 QueryAdditionUtil,增加 additionalV2 方法,用于处理 TOC 业务的销售订单推送 - 在 PassiveStorageResponse 中添加 refundedAt 字段,用于记录退款完成时间
This commit is contained in:
parent
ed4d8f3e94
commit
3c5c54a5f7
|
@ -53,6 +53,10 @@ public class OfsPassiveorderDetailEntity extends BaseEntity {
|
|||
* 业务日期
|
||||
*/
|
||||
private String businessdate;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
private String transactionDate;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
|
@ -387,5 +391,12 @@ public class OfsPassiveorderDetailEntity extends BaseEntity {
|
|||
this.newsystemprimary2 = newsystemprimary2;
|
||||
}
|
||||
|
||||
public String getTransactionDate() {
|
||||
return transactionDate;
|
||||
}
|
||||
|
||||
public void setTransactionDate(String transactionDate) {
|
||||
this.transactionDate = transactionDate;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -287,10 +287,10 @@
|
|||
|
||||
<!-- 批量更新入库或者退款完成的状态-->
|
||||
<insert id="entityInsertOrUpdateBatchV2" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into ofs_passiveorder_detail(id,newPushDate, newTransmitInfo, newState, newsystemnumber, newsystemprimary,def1,def2,def3,def4,def5,def6,def7,def8,def9,def10)
|
||||
insert into ofs_passiveorder_detail(id,newPushDate, newTransmitInfo, newState, newsystemnumber, newsystemprimary,transactionDate,def1,def2,def3,def4,def5,def6,def7,def8,def9,def10)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.newpushdate},#{entity.newtransmitinfo},#{entity.newstate},#{entity.newsystemnumber},#{entity.newsystemprimary},#{entity.def1},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10})
|
||||
(#{entity.id},#{entity.newpushdate},#{entity.newtransmitinfo},#{entity.newstate},#{entity.newsystemnumber},#{entity.newsystemprimary},#{entity.transactionDate},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
id = values(id),
|
||||
|
@ -299,6 +299,7 @@
|
|||
newState = values(newState),
|
||||
newsystemnumber = values(newsystemnumber),
|
||||
newsystemprimary = values(newsystemprimary),
|
||||
transactionDate = values(transactionDate),
|
||||
def1 = values(def1),
|
||||
def2 = values(def2),
|
||||
def3 = values(def3),
|
||||
|
@ -313,10 +314,10 @@
|
|||
|
||||
<!-- 批量更新入库或者退款完成的状态-->
|
||||
<insert id="entityInsertOrUpdateBatchV3" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into ofs_passiveorder_detail(id,newPushDate2, newTransmitInfo2, newState2, newsystemnumber2, newsystemprimary2,def1,def2,def3,def4,def5,def6,def7,def8,def9,def10)
|
||||
insert into ofs_passiveorder_detail(id,newPushDate2, newTransmitInfo2, newState2, newsystemnumber2, newsystemprimary2,transactionDate,def1,def2,def3,def4,def5,def6,def7,def8,def9,def10)
|
||||
values
|
||||
<foreach collection="list" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.newpushdate2},#{entity.newtransmitinfo2},#{entity.newstate2},#{entity.newsystemnumber2},#{entity.newsystemprimary2},#{entity.def1},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10})
|
||||
(#{entity.id},#{entity.newpushdate2},#{entity.newtransmitinfo2},#{entity.newstate2},#{entity.newsystemnumber2},#{entity.newsystemprimary2},#{entity.transactionDate},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
id = values(id),
|
||||
|
@ -325,6 +326,7 @@
|
|||
newState2 = values(newState2),
|
||||
newsystemnumber2 = values(newsystemnumber2),
|
||||
newsystemprimary2 = values(newsystemprimary2),
|
||||
transactionDate = values(transactionDate),
|
||||
def1 = values(def1),
|
||||
def2 = values(def2),
|
||||
def3 = values(def3),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3236,9 +3236,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
/**
|
||||
* 如果售后入库单对应的售后订单状态为售中节点,则过滤掉不传递
|
||||
*
|
||||
* @throws Exception 抛出可能的异常
|
||||
* @author liuyang
|
||||
*/
|
||||
public List<StockinOrderSearchResponse.StockinOrder> filterForSale(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) {
|
||||
public List<StockinOrderSearchResponse.StockinOrder> filterForSale(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) throws Exception {
|
||||
List<StockinOrderSearchResponse.StockinOrder> filteredList = null;
|
||||
if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
|
||||
filteredList = returnGoodHeaderDetailsDataDtoList1.stream().filter(stockinOrder -> {
|
||||
|
@ -3247,9 +3248,12 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
|||
// 如果 StockinH 为空,保留该对象
|
||||
return true;
|
||||
}
|
||||
// 获取 RerturnGoodsOrderSearchData 对象
|
||||
RerturnGoodsOrderSearchData returnData = header.getRerturnGoodsOrderSearchData();
|
||||
if (returnData == null) {
|
||||
if (returnData == null || returnData.getHeader() == null) {
|
||||
// 如果 RerturnGoodsOrderSearchData 为空,保留该对象
|
||||
return true;
|
||||
}
|
||||
if (returnData.getHeader().getReturnNode() == null) {
|
||||
// 如果 RerturnGoodsOrderSearchData 为空,保留该对象
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,11 @@ public class ArapDjzbVO {
|
|||
private String zyx7;//自定义项7(档案类型的传pk)
|
||||
private String zyx8;//自定义项8(档案类型的传pk)
|
||||
private String zyx9;//自定义项9(档案类型的传pk)
|
||||
|
||||
private String def1;
|
||||
private String def2;
|
||||
private String def3;
|
||||
private String def16;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
|
|
@ -40,4 +40,6 @@ public class ErrorHeaderDetailsDtoDtoV3 extends PassiveStorageResponse.Data {
|
|||
private String newsystemnumber;
|
||||
//下游主键
|
||||
private String newsystemprimary;
|
||||
//交易成功时间
|
||||
// private String transactionDate;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,11 @@ import com.hzya.frame.plugin.lets.dao.IBdTaxitemsDao;
|
|||
import com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity;
|
||||
import com.hzya.frame.plugin.lets.entity.BdInvmandocEntity;
|
||||
import com.hzya.frame.plugin.lets.entity.BdTaxitemsEntity;
|
||||
import com.hzya.frame.plugin.lets.plugin.sales.PassiveWarehouseReceiptToC;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.ArapDjzbVO;
|
||||
import com.hzya.frame.plugin.lets.u8cdto.SaleorderRequestChildrenDto;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -30,6 +34,8 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
public class QueryAdditionUtil {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(QueryAdditionUtil.class);
|
||||
|
||||
@Autowired
|
||||
private IBdInvbasdocDao iBdInvbasdocDao;
|
||||
|
||||
|
@ -110,7 +116,7 @@ public class QueryAdditionUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* 增加平台运费,优惠金额这些存货一起保存进U8C销售订单
|
||||
* 增加平台运费,优惠金额这些存货一起保存进U8C销售订单,TOC业务
|
||||
*
|
||||
* @param bdInvmandocEntity1 存货管理档案
|
||||
* @param bdInvbasdocEntity1 存货基本档案
|
||||
|
@ -149,7 +155,7 @@ public class QueryAdditionUtil {
|
|||
|
||||
//税率
|
||||
saleorderRequestChildrenDto1.setNtaxrate(new BigDecimal(bdTaxitemsEntity.getTaxratio()).stripTrailingZeros().toPlainString());
|
||||
|
||||
|
||||
//优惠字段
|
||||
saleorderRequestChildrenDto1.setVdef4("0");
|
||||
saleorderRequestChildrenDto1.setVdef5("0");
|
||||
|
@ -166,4 +172,60 @@ public class QueryAdditionUtil {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加平台运费,优惠金额这些存货一起保存进U8C销售订单
|
||||
*
|
||||
* @param bdInvmandocEntity1 存货管理档案
|
||||
* @param bdInvbasdocEntity1 存货基本档案
|
||||
* @param pushScenarioType 需要推送给U8C红字应收单明细行表体
|
||||
* @param noriginalcursummny 价税合计(只能传金额)
|
||||
* @param bdTaxitemsEntity 存货对应的税率
|
||||
* @author liuyang
|
||||
*/
|
||||
public void additionalV2(List<ArapDjzbVO.Childrenn> pushScenarioType, BdInvmandocEntity bdInvmandocEntity1, BdInvbasdocEntity bdInvbasdocEntity1, BigDecimal noriginalcursummny, BdTaxitemsEntity bdTaxitemsEntity) {
|
||||
Assert.notNull(pushScenarioType, "pushScenarioType不能为空!");
|
||||
Assert.notNull(bdInvmandocEntity1, "bdInvmandocEntity1不能为空");
|
||||
Assert.notNull(bdInvbasdocEntity1, "bdInvbasdocEntity1不能为空");
|
||||
Assert.notNull(noriginalcursummny, "noriginalcursummny不能为空");
|
||||
|
||||
//如果size=0则不正常
|
||||
if (pushScenarioType.size() > 0) {
|
||||
ArapDjzbVO.Childrenn childrenn = pushScenarioType.get(0);
|
||||
|
||||
//拷贝SaleorderRequestChildrenDto对象
|
||||
ArapDjzbVO.Childrenn arapDjzbVOChildrenn = new ArapDjzbVO.Childrenn();
|
||||
BeanUtil.copyPropertiesV2(childrenn, arapDjzbVOChildrenn);
|
||||
|
||||
//修改存货、数量、税率、价税合计、优惠金额设置为0
|
||||
//存货id、存货编码
|
||||
arapDjzbVOChildrenn.setCinventoryid(bdInvmandocEntity1.getPkInvmandoc());
|
||||
|
||||
String tax = null;//税率
|
||||
BigDecimal noriginalcurmny = null;//无税金额
|
||||
BigDecimal noriginalcurtaxmny = null;//税额
|
||||
try {
|
||||
tax = new BigDecimal(bdTaxitemsEntity.getTaxratio()).divide(new BigDecimal(100), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
|
||||
noriginalcurmny = noriginalcursummny.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
noriginalcurtaxmny = noriginalcursummny.subtract(noriginalcurmny).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
} catch (Exception e) {
|
||||
logger.error("金额计算失败", e);
|
||||
Assert.state(false, "金额计算失败 异常:{}", e.getMessage());
|
||||
}
|
||||
|
||||
//金额计算
|
||||
arapDjzbVOChildrenn.setJfbbje("-" + noriginalcursummny.stripTrailingZeros().toPlainString());//借方本币金额
|
||||
arapDjzbVOChildrenn.setJfybje("-" + noriginalcursummny.stripTrailingZeros().toPlainString());//借方原币金额
|
||||
arapDjzbVOChildrenn.setJfbbsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方本币税金
|
||||
arapDjzbVOChildrenn.setJfybsj("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//借方原币税金
|
||||
arapDjzbVOChildrenn.setWbfbbje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方本币无税金额
|
||||
arapDjzbVOChildrenn.setJfybwsje("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//借方原币无税金额
|
||||
|
||||
//2025年2月17日 10:37:37 如果四舍五入保留2位后,如果为0,则不推送U8C,处理0.0033保留2位为0的问题
|
||||
//和李佳妮、还有丽知-山海沟通确定的
|
||||
if (!"0".equals(noriginalcursummny.setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString())) {
|
||||
pushScenarioType.add(arapDjzbVOChildrenn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,9 @@ public class PassiveStorageResponse extends ReturnMessageBasics {
|
|||
private String createdBy;
|
||||
private String lastUpdated;
|
||||
private String lastUpdatedBy;
|
||||
//无源件表头
|
||||
private PassiveStorageResponse.Header header;
|
||||
//退款完成时间
|
||||
private String refundedAt;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue