diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java
index 5ed82eac..1047a478 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java
@@ -67,6 +67,10 @@ public class OverallConstant {
prodOverPublic.put("bddefdoclistsaveCode", "8000370061");//自定义档案内容查询
prodOverPublic.put("bddefdoclistsave", "/u8cloud/api/uapbd/bddefdoc/insert");//自定义档案内容查询
+ //应收单
+ prodOverPublic.put("arapYsInsertApproveCode", "8000370069");//自定义档案内容查询
+
+
prodOverPublic.put("appId", "800037");//数智中台
prodOverPublic.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");//数智中台
prodOverPublic.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");//数智中台
@@ -121,7 +125,8 @@ public class OverallConstant {
prodOverAll.put("u8c自定义项档案-存货分类对应收支项目主键", "0001A210000000008FBN");
//中台地址
- prodOverAll.put("u8c_url", "http://127.0.0.1:8081/kangarooDataCenterV3/entranceController/externalCallInterface");
+// prodOverAll.put("u8c_url", "http://127.0.0.1:8081/kangarooDataCenterV3/entranceController/externalCallInterface");
+ prodOverAll.put("u8c_url", "http://ufidahz.com.cn:9067/kangarooDataCenterV3/entranceController/externalCallInterface");
}
/**
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.java
index 3b617e3d..1f6159cf 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.java
@@ -70,5 +70,15 @@ public class OnlyAfterSalesBEntity extends BaseEntity {
private String reasondesc;
+ //平台优惠,表头的
+ private String platformDiscounts;
+ //商家优惠,表头的
+ private String merchantDiscounts;
+ //达人优惠,表头的
+ private String expertDiscounts;
+ //支付优惠,表头的
+ private String payDiscounts;
+
+
}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.xml
index cace8b42..152072e1 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.xml
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.xml
@@ -33,6 +33,10 @@
+
+
+
+
@@ -66,6 +70,10 @@
,originalDetailId
,reasonCode
,reasonDesc
+ ,platformDiscounts
+ ,merchantDiscounts
+ ,expertDiscounts
+ ,payDiscounts
@@ -266,6 +290,10 @@
originalDetailId ,
reasonCode ,
reasonDesc ,
+ platformDiscounts ,
+ merchantDiscounts ,
+ expertDiscounts ,
+ payDiscounts ,
)values(
@@ -299,6 +327,10 @@
#{originaldetailid} ,
#{reasoncode} ,
#{reasondesc} ,
+ #{platformDiscounts} ,
+ #{merchantDiscounts} ,
+ #{expertDiscounts} ,
+ #{payDiscounts} ,
)
@@ -380,6 +412,10 @@ update only_after_sales_b set
originalDetailId = #{originaldetailid},
reasonCode = #{reasoncode},
reasonDesc = #{reasondesc},
+ platformDiscounts = #{platformDiscounts},
+ merchantDiscounts = #{merchantDiscounts},
+ expertDiscounts = #{expertDiscounts},
+ payDiscounts = #{payDiscounts},
where id = #{id}
@@ -422,7 +458,11 @@ update only_after_sales_b set sts= 'N' ,modify_time = #{modify_time},modify_use
and originalDetailId = #{originaldetailid}
and reasonCode = #{reasoncode}
and reasonDesc = #{reasondesc}
-
+ and platformDiscounts = #{platformDiscounts}
+ and merchantDiscounts = #{merchantDiscounts}
+ and expertDiscounts = #{expertDiscounts}
+ and payDiscounts = #{payDiscounts}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.java
index 71c87024..f8a0bae4 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.java
@@ -146,5 +146,15 @@ public class OnlyAfterSalesHEntity extends BaseEntity {
/** 处理类型 */
private String processtype;
+
+ //平台优惠
+ private String platformDiscounts;
+ //商家优惠
+ private String merchantDiscounts;
+ //达人优惠
+ private String expertDiscounts;
+ //支付优惠
+ private String payDiscounts;
+
}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.xml
index e145557c..e9201e9f 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.xml
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.xml
@@ -70,6 +70,10 @@
+
+
+
+
@@ -77,76 +81,80 @@
,ofsid
,returnType
,exchangeType
- ,refundInd
- ,internalOrderType
- ,bizChannel
- ,code
- ,companyCode
- ,clientCode
- ,storeCode
- ,sourceUserAccount
- ,sourceUserName
- ,returnStatus
- ,shipStatus
- ,refundStatus
- ,facilityCode
- ,refOrderCode
- ,refOrderId
- ,refOrderType
- ,refOrderStatusWhenReturned
- ,sourcePlatformCode
- ,sourceOrderCode
- ,sourceOrderStatusWhenReturned
- ,sourceReturnCode
- ,sourceReturnStatus
- ,reasonCode
- ,returnNote
- ,sellerNote
- ,requestRefundAmount
- ,actualRefundAmount
- ,totalQty
- ,totalFulfillQty
- ,shipFromAttentionTo
- ,shipFromAddress
- ,shipFromCountry
- ,shipFromState
- ,shipFromCity
- ,shipFromDistrict
- ,shipFromPostalCode
- ,shipFromPhone
- ,shipFromMobile
- ,shipFromFax
- ,shipFromEmail
- ,shipCarrier
- ,shipWaybillCode
- ,shipLogisticsStatus
- ,returnCarrier
- ,returnWaybillCode
- ,returnLogisticsStatus
- ,payAccount
- ,payOrderNo
- ,auditBy
- ,auditAt
- ,refundThru
- ,csStuff
- ,returnWarehouseNote
- ,holdCode
- ,holdUser
- ,holdAt
- ,errorCode
- ,errorDesc
- ,verificationStatus
- ,verificationErrorDesc
- ,refundedAt
- ,status
- ,processType
+ ,refundInd
+ ,internalOrderType
+ ,bizChannel
+ ,code
+ ,companyCode
+ ,clientCode
+ ,storeCode
+ ,sourceUserAccount
+ ,sourceUserName
+ ,returnStatus
+ ,shipStatus
+ ,refundStatus
+ ,facilityCode
+ ,refOrderCode
+ ,refOrderId
+ ,refOrderType
+ ,refOrderStatusWhenReturned
+ ,sourcePlatformCode
+ ,sourceOrderCode
+ ,sourceOrderStatusWhenReturned
+ ,sourceReturnCode
+ ,sourceReturnStatus
+ ,reasonCode
+ ,returnNote
+ ,sellerNote
+ ,requestRefundAmount
+ ,actualRefundAmount
+ ,totalQty
+ ,totalFulfillQty
+ ,shipFromAttentionTo
+ ,shipFromAddress
+ ,shipFromCountry
+ ,shipFromState
+ ,shipFromCity
+ ,shipFromDistrict
+ ,shipFromPostalCode
+ ,shipFromPhone
+ ,shipFromMobile
+ ,shipFromFax
+ ,shipFromEmail
+ ,shipCarrier
+ ,shipWaybillCode
+ ,shipLogisticsStatus
+ ,returnCarrier
+ ,returnWaybillCode
+ ,returnLogisticsStatus
+ ,payAccount
+ ,payOrderNo
+ ,auditBy
+ ,auditAt
+ ,refundThru
+ ,csStuff
+ ,returnWarehouseNote
+ ,holdCode
+ ,holdUser
+ ,holdAt
+ ,errorCode
+ ,errorDesc
+ ,verificationStatus
+ ,verificationErrorDesc
+ ,refundedAt
+ ,status
+ ,processType
+ ,platformDiscounts
+ ,merchantDiscounts
+ ,expertDiscounts
+ ,payDiscounts
-
+
@@ -302,7 +318,7 @@
select
from only_after_sales_h
-
+
and id like concat('%',#{id},'%')
and ofsid like concat('%',#{ofsid},'%')
and returnType like concat('%',#{returntype},'%')
@@ -370,10 +386,13 @@
and refundedAt like concat('%',#{refundedat},'%')
and status like concat('%',#{status},'%')
and processType like concat('%',#{processtype},'%')
-
+ and platformDiscounts like concat('%',#{platformDiscounts},'%')
+ and merchantDiscounts like concat('%',#{merchantDiscounts},'%')
+ and expertDiscounts like concat('%',#{expertDiscounts},'%')
+ and payDiscounts like concat('%',#{payDiscounts},'%')
-
-
+
+
@@ -381,7 +400,7 @@
select
from only_after_sales_h
-
+
or id = #{id}
or ofsid = #{ofsid}
or returnType = #{returntype}
@@ -449,9 +468,13 @@
or refundedAt = #{refundedat}
or status = #{status}
or processType = #{processtype}
-
+ or platformDiscounts = #{platformDiscounts}
+ or merchantDiscounts = #{merchantDiscounts}
+ or expertDiscounts = #{expertDiscounts}
+ or payDiscounts = #{payDiscounts}
+
-
+
@@ -525,6 +548,10 @@
refundedAt ,
status ,
processType ,
+ platformDiscounts ,
+ merchantDiscounts ,
+ expertDiscounts ,
+ payDiscounts ,
)values(
@@ -595,8 +622,12 @@
#{refundedat} ,
#{status} ,
#{processtype} ,
+ #{platformDiscounts} ,
+ #{merchantDiscounts} ,
+ #{expertDiscounts} ,
+ #{payDiscounts} ,
- )
+ )
@@ -750,6 +781,10 @@ update only_after_sales_h set
refundedAt = #{refundedat},
status = #{status},
processType = #{processtype},
+ platformDiscounts = #{platformDiscounts},
+ merchantDiscounts = #{merchantDiscounts},
+ expertDiscounts = #{expertDiscounts},
+ payDiscounts = #{payDiscounts},
where id = #{id}
@@ -761,7 +796,7 @@ where id = #{id}
update only_after_sales_h set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
-
+
and id = #{id}
and ofsid = #{ofsid}
and returnType = #{returntype}
@@ -829,7 +864,11 @@ update only_after_sales_h set sts= 'N' ,modify_time = #{modify_time},modify_use
and refundedAt = #{refundedat}
and status = #{status}
and processType = #{processtype}
-
+ and platformDiscounts = #{platformDiscounts}
+ and merchantDiscounts = #{merchantDiscounts}
+ and expertDiscounts = #{expertDiscounts}
+ and payDiscounts = #{payDiscounts}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java
index 4d4d1ff4..c0526933 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java
@@ -15,16 +15,20 @@ import com.hzya.frame.plugin.lets.dao.IOnlyAfterSalesBDao;
import com.hzya.frame.plugin.lets.dao.IOnlyAfterSalesHDao;
import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesBEntity;
import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesHEntity;
+import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
import com.hzya.frame.plugin.lets.ofsvo.QueryReturnOrderRequestVO;
-import com.hzya.frame.plugin.lets.u8cdto.ArapDjzbVO;
-import com.hzya.frame.plugin.lets.u8cdto.BillVO;
+import com.hzya.frame.plugin.lets.u8cdto.*;
+import com.hzya.frame.plugin.lets.util.OfsOrderAfterSalesAmountAllocationUtil;
import com.hzya.frame.plugin.lets.util.QueryU8CEntityUtil;
import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil;
+import com.hzya.frame.plugin.lets.util.pushData.Attribute;
import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode;
+import com.hzya.frame.plugin.lets.util.pushData.ZTResult;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.ttxofs.basics.ReturnMessageBasics;
import com.hzya.frame.ttxofs.dto.InterfaceParamDto;
+import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleOrderMessageDto;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchData;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchDetails;
import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader;
@@ -35,18 +39,19 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
/**
* add by zyd
* O售后订单(仅退款) -> U8C红字应收单
- *
+ *
* returnType:0 不退货
* exchangeType:0 不换货
* refundInd:1 退款
- *
+ *
* 按天推送
*
* @Date:2024/9/21 17:19
@@ -102,6 +107,9 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
@Autowired
private IOnlyAfterSalesBDao onlyAfterSalesBDao;
+ @Autowired
+ private OfsOrderAfterSalesAmountAllocationUtil ofsOrderAfterSalesAmountAllocationUtil;
+
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
@@ -140,7 +148,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
return null;
}
- public void start(){
+ public void start() {
try {
//获取当前时间
Date currentDate = new Date();
@@ -155,15 +163,15 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
// queryOfsOnlyReturnOrders(queryReturnOrderRequestVO);
- }catch (Exception e){
- logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start()方法报错:"+e);
+ } catch (Exception e) {
+ logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start()方法报错:" + e);
}
}
/**
* @param ofsCode 售后订单号
*/
- public void start(String ofsCode){
+ public void start(String ofsCode) {
try {
QueryReturnOrderRequestVO queryReturnOrderRequestVO = new QueryReturnOrderRequestVO();
queryReturnOrderRequestVO.setCode(ofsCode);
@@ -172,22 +180,49 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
Assert.state(false, "丽知:售后订单(仅退款):{} --->U8C红字应收单,未查询到OFS售后订单(仅退款)", ofsCode);
}
+ //过滤原始表
+ List filterOriginalOrders = filterOriginal(returnGoodsOrders);
//底表存数据库
- saveOrUpdate(returnGoodsOrders);
+ if (filterOriginalOrders.size() != 0) {
+ save(filterOriginalOrders);
+ }
+// save(returnGoodsOrders);
//过滤日志
List filterReturnGoodsOrders = filterData(returnGoodsOrders);
- if(filterReturnGoodsOrders==null||filterReturnGoodsOrders.size()==0){
+ if (filterReturnGoodsOrders == null || filterReturnGoodsOrders.size() == 0) {
Assert.state(false, "丽知:售后订单(仅退款):{} --->U8C红字应收单,该售后订单(仅退款)已被推送成功,请勿重新推送", ofsCode);
}
//推送
-// implement(filterReturnGoodsOrders);
+ implement(filterReturnGoodsOrders);
- }catch (Exception e){
- logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start(String ofsCode)方法报错:"+e);
+ } catch (Exception e) {
+ logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start(String ofsCode)方法报错:" + e);
}
}
- public void start(String startTime, String endTime){
+
+ /**
+ * 过滤元数据底表,只过滤表头
+ *
+ * @param returnGoodsOrders
+ * @return
+ */
+ private List filterOriginal(List returnGoodsOrders) {
+ List filterOriginal = new ArrayList<>();
+ for (RerturnGoodsOrderSearchData goodsOrder : returnGoodsOrders) {
+ OnlyAfterSalesHEntity onlyAfterSalesHEntity = new OnlyAfterSalesHEntity();
+ onlyAfterSalesHEntity.setCode(goodsOrder.getHeader().getCode());
+ List query = onlyAfterSalesHDao.query(onlyAfterSalesHEntity);
+ if (query.size() != 0) {
+ continue;
+ } else {
+ filterOriginal.add(goodsOrder);
+ }
+ }
+ return filterOriginal;
+ }
+
+ public void start(String startTime, String endTime) {
try {
Date business_start = DateUtil.parse(startTime);
Date business_end = DateUtil.parse(endTime);
@@ -200,29 +235,45 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
// queryOfsOnlyReturnOrders(queryReturnOrderRequestVO);
- }catch (Exception e){
- logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start(String startTime, String endTime)方法报错:"+e);
+ } catch (Exception e) {
+ logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start(String startTime, String endTime)方法报错:" + e);
}
}
/**
- * 过滤成功日志
+ * 单据号+skuCode
+ * 过滤成功日志,并且过滤子表退款金额==0的数据
*/
- public List filterData(List returnGoodsOrders){
- List filterReturnGoodsOrders=new ArrayList<>();
+ public List filterData(List returnGoodsOrders) {
+ List filterReturnGoodsOrders = new ArrayList<>();
for (RerturnGoodsOrderSearchData returnGoodsOrder : returnGoodsOrders) {
RerturnGoodsOrderSearchHeader header = returnGoodsOrder.getHeader();
- String rootAppPk=header.getCode();
- boolean isExis = true;
- IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
- integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
- integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
- integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
- List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
- if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
- isExis = false;
+
+
+ List filterDetails=new ArrayList<>();
+ List details = returnGoodsOrder.getDetails();
+ for (RerturnGoodsOrderSearchDetails detail : details) {
+ if(detail.getTotalAmount()==null||"0".equals(detail.getTotalAmount())||0==Double.parseDouble(detail.getTotalAmount())){
+ continue;
+ }
+ String rootAppPk = header.getCode()+"_"+detail.getSkuCode();
+ boolean isExis = true;
+ IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
+ integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
+ integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
+ integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
+ List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
+ if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) {
+ isExis = false;
+ }
+ if (!isExis) {
+ filterDetails.add(detail);
+ }
}
- if (!isExis) {
+ if(filterDetails.size()==0){
+ continue;
+ }else {
+ returnGoodsOrder.setDetails(filterDetails);
filterReturnGoodsOrders.add(returnGoodsOrder);
}
}
@@ -231,115 +282,278 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
/**
* 具体实现推送U8C红字应收单
- *
+ *
* 公司+店铺+仓库+SKU+收发类别+部门 分组
- *
+ *
* 因为优惠金额在表头,先按单据便利一变,具体分摊金额拆到每行,在去汇总
- *
*/
- public void implement(List filterReturnGoodsOrders){
+ public void implement(List filterReturnGoodsOrders) throws Exception {
+ //分摊分摊后的子表
+ List allDetail = new ArrayList<>();
+ List allHeader = new ArrayList<>();
+ //分摊
+ for (RerturnGoodsOrderSearchData filterReturnGoodsOrder : filterReturnGoodsOrders) {
+ ofsOrderAfterSalesAmountAllocationUtil.tocSalesAmountAllocation(filterReturnGoodsOrder);
+ System.out.println(filterReturnGoodsOrder);
+ //查询部门
+ String refOrderCode = filterReturnGoodsOrder.getHeader().getRefOrderCode();
+ SaleOrderMessageDto ofsSaleOrder = getOfsOrder(refOrderCode);
+ String deptCode = "002";
+ if (ofsSaleOrder != null) {
+// Assert.state(false,"根据仅退款:{},查询销售订单:{},失败!未查询到对应销售订单",filterReturnGoodsOrder.getHeader().getCode(),refOrderCode);
+ if(ofsSaleOrder.getData().get(0).getHeader().getDepartmentType()!=null&&!"".equals((ofsSaleOrder.getData().get(0).getHeader().getDepartmentType()))){
+ deptCode = ofsSaleOrder.getData().get(0).getHeader().getDepartmentType();
+ }
+ }
+ filterReturnGoodsOrder.getHeader().setSaleDeptCode(deptCode);
+ allHeader.add(filterReturnGoodsOrder.getHeader());
+ allDetail.addAll(filterReturnGoodsOrder.getDetails());
+ }
- //分摊后的明细
- List ofsDetails=new ArrayList<>();
+ //分组:公司+店铺+部门+单据日期,仅退款没有仓库,固不去
+ Map> collect =
+ allHeader.stream().collect(Collectors.groupingBy(index -> index.getCompanyCode() + "_" + index.getStoreCode() + "_" + index.getSaleDeptCode() + "_" + index.getCreated().substring(0,10)));
+
+ collect.forEach((k, v) -> {
+ String[] split = k.split("_");//[0]公司 [1]店铺 [2]部门 [3]单据日期
+ //v:header列表, header.code == details.returnOrderCode
+
+ String mapStr = "";
+ String format = "";//暂时取创建时间,refundAt没返回
+ String response = "";
+// String ofsCode = v.get(0).getCode();
+// String ofsId = v.get(0).getId();
+ //日志记录使用
+ List logDetails=new ArrayList<>();
+
+ try {
+ ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
+ //主表 , 在表头先
+ ArapDjzbVO.Parentt parentvo = new ArapDjzbVO.Parentt();
+ //djrq 单据日期
+ format = split[3];//暂时取创建时间,refundAt没返回
+ format = "2024-09-25";
+ parentvo.setDjrq(format);
+ //dwbm 公司
+ parentvo.setDwbm(split[0]);
+ //lrr 录入人
+ parentvo.setLrr(OverallConstant.getOverAllValue("u8cApiZdrCode"));
+ //wldx 往来对象标识 (0 客户 2部门 3业务员)
+ parentvo.setWldx("2");
+ //hbbm 客商==店铺
+ parentvo.setHbbm(split[1]);
+ //deptid 部门
+ parentvo.setDeptid(split[2]);
+ //ywybm 业务员编码 ,不传喽
+
+ //shr 审核人
+ parentvo.setShr(OverallConstant.getOverAllValue("u8cApiZdrCode"));
+ //shrq 审核日
+ parentvo.setShrq(format);
+ //scomment 备注 returnNote 客服备注 sellerNote 卖家备注
+ //parentvo.setScomment(header.getReturnNote());
+
+ //djlxbm 单据类型编码(交易类型编码使用此字段,如D0、D1、D2)
+ parentvo.setDjlxbm("D0");
+ //xslxbm 业务流程
+ parentvo.setXslxbm("JTK");//TOC仅退款
+
+ //zyx1店铺
+ parentvo.setZyx1(split[1]);
+ //zyx2来源平台
+ parentvo.setZyx2(v.get(0).getSourcePlatformCode());
+ //zyx3 收发类别 销售出库,写死:SALES
+ parentvo.setZyx3("SALES");
+
+ //子表,需要通过多个主表的id找到多个子表,且退货金额==0的不要
+ List children=new ArrayList<>();
+ List ofsDetails=new ArrayList<>();
+ for (RerturnGoodsOrderSearchHeader rerturnGoodsOrderSearchHeader : v) {
+ allDetail.stream().forEach(index->{
+ if(rerturnGoodsOrderSearchHeader.getCode().equals(index.getReturnOrderCode())&&index.getTotalAmount()!=null&&!"0".equals(index.getTotalAmount())){
+ ofsDetails.add(index);
+ }
+ });
+ }
+ logDetails.addAll(ofsDetails);
+ for (RerturnGoodsOrderSearchDetails ofsDetail : ofsDetails) {
+ ArapDjzbVO.Childrenn childrenn = new ArapDjzbVO.Childrenn();
+ //cinventoryid 存货
+ childrenn.setCinventoryid(ofsDetail.getSkuCode());
+ //jfbbje jfybje 借方本币金额/借方原币金额
+ childrenn.setJfbbje("-"+ofsDetail.getTotalAmount());
+ childrenn.setJfybje("-"+ofsDetail.getTotalAmount());
+ //jfbbsj jfybsj 借方本币税金/借方原币税金 默认(0.13)
+ BigDecimal sj=new BigDecimal(ofsDetail.getTotalAmount()).multiply(new BigDecimal(0.13)).setScale(2, RoundingMode.FLOOR);
+ childrenn.setJfbbsj("-"+String.valueOf(sj));
+ childrenn.setJfybsj("-"+String.valueOf(sj));
+ //wbfbbje jfybwsje 借方本币无税金额/借方原币无税金额
+ BigDecimal ws=new BigDecimal(ofsDetail.getTotalAmount()).subtract(sj);
+ childrenn.setWbfbbje("-"+ws);
+ childrenn.setJfybwsje("-"+ws);
+ //zyx4 平台优惠
+ childrenn.setZyx4(String.valueOf(ofsDetail.getShareTargetPlatformDiscounts()));
+ //zyx5 支付优惠
+ childrenn.setZyx5(String.valueOf(ofsDetail.getShareTargetPlatformDiscounts()));
+ //zyx6 达人优惠
+ childrenn.setZyx6(String.valueOf(ofsDetail.getShareTargetPlatformDiscounts()));
+ //zyx7 商家优惠
+ childrenn.setZyx7(String.valueOf(ofsDetail.getShareTargetPlatformDiscounts()));
+ children.add(childrenn);
+ }
+
+ arapDjzbVO.setParentvo(parentvo);
+ arapDjzbVO.setChildren(children);
+ System.out.println(arapDjzbVO);
+ mapStr="{\"djzbvo\":["+ JSONUtil.toJsonStr(arapDjzbVO) +"]}";
+ System.out.println(mapStr);
+
+ //推送
+ ZTResult ztResult = pushU8CByApiCode.pushByCode(OverallConstant.getOverAllValue("arapYsInsertApproveCode"), mapStr);
+ //两层判断,一层中台转发,一层u8c返回
+ if ("false".equals(ztResult.getFlag())) {
+ //转发失败
+ response = JSONUtil.toJsonStr(ztResult.getAttribute());
+ Assert.state(false, "丽知:售后订单(仅退款)--->U8C红字应收单,中台转发失败,失败原因:{}", ztResult.getAttribute());
+ }
+ Attribute attribute = ztResult.getAttribute();
+ System.out.println(attribute);
+ boolean isSuccess = false;
+ String djbh = "";
+ String vouchid = "";
+ if ("success".equals(attribute.getStatus())) {
+ isSuccess = true;
+ String data = attribute.getData();
+ ArapDjzb arapDj = resultDataHandle(data);
+ System.out.println(arapDj);
+ djbh = arapDj.getParentvo().getDjbh();
+ vouchid = arapDj.getParentvo().getVouchid();
+ }
+ if (!isSuccess) {
+ Assert.state(false, "推送U8C--> 丽知:售后订单(仅退款)--->U8C红字应收单 失败 接口返回结果:{} 接口入参:{}", response, mapStr);
+ }
+
+ //成功 批量新增 ofsDetails
+ for (RerturnGoodsOrderSearchDetails ofsDetail : ofsDetails) {
+ IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
+ integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
+ integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
+ integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
+ integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
+ integrationTaskLivingDetailsEntity.setBusinessDate(format);
+ integrationTaskLivingDetailsEntity.setRootAppPk(ofsDetail.getReturnOrderCode()+"_"+ofsDetail.getSkuCode());
+ integrationTaskLivingDetailsEntity.setRootAppBill(ofsDetail.getReturnOrderCode());//仅退款单号
+ integrationTaskLivingDetailsEntity.setNewSystemNumber(djbh);
+ integrationTaskLivingDetailsEntity.setNewSystemPrimary(vouchid);
+ integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
+ saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
+ }
+
+ } catch (Exception e) {
+ logger.error("推送U8C,丽知:售后订单(仅退款)--->U8C红字应收单失败,失败原因:" + e);
+ //失败
+
+ ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
+ String ErrMessage="";
+ if (reusltStrDto != null) {
+ ErrMessage = "推送U8C,丽知:OFS调整入库(组装入库)--->U8C组装订单失败,失败原因:" + reusltStrDto.getErrormsg();
+ }else {
+ ErrMessage = "推送U8C,丽知:OFS调整入库(组装入库)--->U8C组装订单失败,失败原因:" + e.getMessage();
+ }
+ //失败 批量新增 ofsDetails
+ for (RerturnGoodsOrderSearchDetails logDetail : logDetails) {
+ IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
+ integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
+ integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
+ integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
+ integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
+ integrationTaskLivingDetailsEntity.setBusinessDate(format);
+ integrationTaskLivingDetailsEntity.setRootAppPk(logDetail.getReturnOrderCode()+"_"+logDetail.getSkuCode());
+ integrationTaskLivingDetailsEntity.setRootAppBill(logDetail.getReturnOrderCode());
+ integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
+ saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
+ }
+ }
+ });
+
+// //分摊后的明细
+// List ofsDetailsAll=new ArrayList<>();
+//
+//
// for (RerturnGoodsOrderSearchData returnGoodsOrder : filterReturnGoodsOrders) {
-// System.out.println(returnGoodsOrder);
//
-// String mapStr = "";
-// String format = "";//暂时取创建时间,refundAt没返回
-// String response = "";
-// String ofsCode = returnGoodsOrder.getHeader().getCode();
-// String ofsId = returnGoodsOrder.getHeader().getId();
+// RerturnGoodsOrderSearchHeader ofsHeader = returnGoodsOrder.getHeader();
//
-// try {
+// //平台优惠 platformDiscounts
+// BigDecimal platform = new BigDecimal(ofsHeader.getPlatformDiscounts());
+// //商家优惠 merchantDiscounts
+// BigDecimal merchant = new BigDecimal(ofsHeader.getMerchantDiscounts());
+// //达人优惠 expertDiscounts
+// BigDecimal expert = new BigDecimal(ofsHeader.getExpertDiscounts());
+// //支付优惠 payDiscounts
+// BigDecimal pay = new BigDecimal(ofsHeader.getPayDiscounts());
//
-// ArapDjzbVO arapDjzbVO = new ArapDjzbVO();
-// //主表 , 在表头先
-// RerturnGoodsOrderSearchHeader header = returnGoodsOrder.getHeader();
-// ArapDjzbVO.Parentt parentvo = new ArapDjzbVO.Parentt();
+// List ofsDetails = returnGoodsOrder.getDetails();
+// ofsDetails.stream().forEach(detail->{//表头的四个优惠放到表体
+//// detail.setOriginalTargetPlatformDiscounts(platform);
+//// detail.setOriginalTargetMerchantDiscounts(merchant);
+//// detail.setOriginalTargetExpertDiscounts(expert);
+//// detail.setOriginalTargetPayDiscounts(pay);
+// detail.setOriginalTargetPlatformDiscounts(BigDecimal.valueOf(4));
+// detail.setOriginalTargetMerchantDiscounts(BigDecimal.valueOf(5));
+// detail.setOriginalTargetExpertDiscounts(BigDecimal.valueOf(6));
+// detail.setOriginalTargetPayDiscounts(BigDecimal.valueOf(7));
+// });
//
-// //djrq 单据日期
-// format = returnGoodsOrder.getHeader().getCreated();//暂时取创建时间,refundAt没返回
-// parentvo.setDjrq(format.substring(0,10));
-// //dwbm 公司
-// parentvo.setDwbm(header.getCompanyCode());
-// //lrr 录入人
-// parentvo.setLrr(OverallConstant.getOverAllValue("u8cApiZdrCode"));
-//
-// //wldx 往来对象标识 (0 客户 2部门 3业务员)
-// //hbbm 客商
-// //deptid 部门
-// //ywybm 业务员编码
-//
-//
-// //shr 审核人
-// parentvo.setShr(OverallConstant.getOverAllValue("u8cApiZdrCode"));
-// //shrq 审核日
-// parentvo.setShrq(format.substring(0,10));
-// //scomment 备注 returnNote 客服备注 sellerNote 卖家备注
-// parentvo.setScomment(header.getReturnNote());
-//
-//
-// //zyx1店铺
-// parentvo.setZyx1(header.getStoreCode());
-// //zyx2来源平台
-// parentvo.setZyx2(header.getSourcePlatformCode());
-// //zyx3 收发类别 ????
-//
-//
-// //子表
-// List children=new ArrayList<>();
-// List details = returnGoodsOrder.getDetails();
-// for (RerturnGoodsOrderSearchDetails ofsDetail : details) {
-// ArapDjzbVO.Childrenn childrenn = new ArapDjzbVO.Childrenn();
-//
-// //cinventoryid 存货
-//
-// //jfbbje jfybje 借方本币金额/借方原币金额
-// //jfbbsj jfybsj存货 借方本币税金/借方原币税金
-// //wbfbbje jfybwsje 借方本币无税金额/借方原币无税金额
-//
-//
-//
-// //zyx4 平台优惠
-// //zyx5 支付优惠
-// //zyx6 达人优惠
-// //zyx7 商家优惠
-// children.add(childrenn);
-// }
-// arapDjzbVO.setParentvo(parentvo);
-// arapDjzbVO.setChildren(children);
-// System.out.println(arapDjzbVO);
-// mapStr="{\"djzbvo\":["+ JSONUtil.toJsonStr(arapDjzbVO) +"]}";
-//
-//
-//
-//
-// }catch (Exception e){
-// e.printStackTrace();
-// logger.error("推送U8C,丽知:售后订单(仅退款)--->U8C红字应收单失败,失败原因:" + e);
-// //失败
+// //总金额
+// BigDecimal totalCount = new BigDecimal(0);
+// for (RerturnGoodsOrderSearchDetails ofsDetail : ofsDetails) {
+// //请求数量*商品零售价
+// BigDecimal count=new BigDecimal(ofsDetail.getRequestQty()).multiply(new BigDecimal(ofsDetail.getMsrPrice()));
+// totalCount.add(count);
// }
//
+// //分摊,总比重1,最后货品时,分摊比例= 1-之前的
+// BigDecimal ratioSurplus= new BigDecimal(1);
+// for (int i = 0; i < ofsDetails.size(); i++) {
+// if(i!=ofsDetails.size()){//最后一个直接取
+// //给存货分摊比例,总金额/(数量*单价)
+// BigDecimal ratio
+// = totalCount.divide(new BigDecimal(ofsDetails.get(i).getRequestQty()).multiply(new BigDecimal(ofsDetails.get(i).getMsrPrice())));
+// ratioSurplus.subtract(ratio);
+// }
+// //四个分摊优惠 按零售价摊
+// //shareTargetPlatformDiscounts 分摊平台优惠
+//// ofsDetails.get(i).setShareTargetPlatformDiscounts();
+// //shareTargetMerchantDiscounts 分摊商家优惠
+// //shareTargetExpertDiscounts 分摊达人优惠
+// //shareTargetPayDiscounts 分摊支付优惠
+//
+//
+// }
// }
-
+//
+
+ System.out.println(1);
}
/**
* ofs仅退款数据,存中台mysql数据库
* 表头表体分别存,忽略大小写 BeanUtil.copyPropreties(a,b,Copyoptions.create().ignoreCase())
+ *
* @param returnGoodsOrders
*/
- public void saveOrUpdate(List returnGoodsOrders){
+ public void save(List returnGoodsOrders) {
// List allH=new ArrayList<>();
// List allB=new ArrayList<>();
for (RerturnGoodsOrderSearchData returnGoodsOrder : returnGoodsOrders) {
RerturnGoodsOrderSearchHeader header = returnGoodsOrder.getHeader();
OnlyAfterSalesHEntity onlyAfterSalesHEntity = new OnlyAfterSalesHEntity();
- BeanUtil.copyProperties(header,onlyAfterSalesHEntity, CopyOptions.create().ignoreCase());
+ BeanUtil.copyProperties(header, onlyAfterSalesHEntity, CopyOptions.create().ignoreCase());
// allH.add(onlyAfterSalesHEntity);
onlyAfterSalesHEntity.setId(null);
onlyAfterSalesHEntity.setOfsid(header.getId());
@@ -349,20 +563,48 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
List details = returnGoodsOrder.getDetails();
for (RerturnGoodsOrderSearchDetails detail : details) {
OnlyAfterSalesBEntity onlyAfterSalesBEntity = new OnlyAfterSalesBEntity();
- BeanUtil.copyProperties(detail,onlyAfterSalesBEntity, CopyOptions.create().ignoreCase());
+ BeanUtil.copyProperties(detail, onlyAfterSalesBEntity, CopyOptions.create().ignoreCase());
// allB.add(onlyAfterSalesBEntity);
onlyAfterSalesBEntity.setId(null);
onlyAfterSalesBEntity.setHid(HId);
onlyAfterSalesBEntity.setOfsid(detail.getId());
+ //四个优惠,platformDiscounts 平台优惠、merchantDiscounts 商家优惠、expertDiscounts 达人优惠、payDiscounts 支付优惠
+ onlyAfterSalesBEntity.setPlatformDiscounts(header.getPlatformDiscounts());
+ onlyAfterSalesBEntity.setMerchantDiscounts(header.getMerchantDiscounts());
+ onlyAfterSalesBEntity.setExpertDiscounts(header.getExpertDiscounts());
+ onlyAfterSalesBEntity.setPayDiscounts(header.getPayDiscounts());
onlyAfterSalesBDao.save(onlyAfterSalesBEntity);
}
}
}
+ /**
+ * 查询OFS销售订单
+ */
+ public SaleOrderMessageDto getOfsOrder(String code) throws Exception {
+ Long pageSize = 200L;
+ Long pageNo = 1L;
+
+ QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
+ queryOfsSoSaleOutVo.setPageNo(pageNo);
+ queryOfsSoSaleOutVo.setPageSize(pageSize);
+ queryOfsSoSaleOutVo.setCode(code);
+
+ InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
+ interfaceParamDto.setApi("ofs.salesOrder.search");
+ interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo));
+ SaleOrderMessageDto saleOrderMessageDto = (SaleOrderMessageDto) ofsUnifiedService.unified(interfaceParamDto);
+ if (saleOrderMessageDto.getData().size() == 0) {
+ return null;
+ }
+ return saleOrderMessageDto;
+ }
+
+
/**
* 查询ofs仅退款订单 销售退货单查询(ofs.returnOrder. search)
- *
+ *
* 查询条件:refundedAt_start、refundedAt_end、code
* returnType:0 不退货
* exchangeType:0 不换货
@@ -371,7 +613,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
public List queryOfsOnlyReturnOrders(QueryReturnOrderRequestVO queryReturnOrderRequestVO) throws Exception {
Long pageNo = 1L;
- List all=new ArrayList<>();
+ List all = new ArrayList<>();
InterfaceParamDto interfaceParamDto = new InterfaceParamDto();
interfaceParamDto.setApi("ofs.returnOrder.search");
@@ -382,7 +624,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
queryReturnOrderRequestVO.setPageSize(500L);
interfaceParamDto.setData(JSON.toJSONString(queryReturnOrderRequestVO));
- RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean =(RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto);
+ RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean = (RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto);
if (rerturnGoodsOrderSearchJsonRootBean.getData() == null || rerturnGoodsOrderSearchJsonRootBean.getData().size() == 0) {
return null;
}
@@ -394,12 +636,27 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
pageNo++;
queryReturnOrderRequestVO.setPageNo(pageNo);
interfaceParamDto.setData(JSON.toJSONString(queryReturnOrderRequestVO));
- RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean1 =(RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto);
+ RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean1 = (RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto);
all.addAll(rerturnGoodsOrderSearchJsonRootBean1.getData());
count = rerturnGoodsOrderSearchJsonRootBean1.getData().size();
}
return all;
}
+ private ArapDjzb resultDataHandle(String resultData) {
+ try {
+ if (resultData != null && !"".equals(resultData)) {
+ if (resultData.contains("[")) {
+ resultData = resultData.substring(1, resultData.length() - 1);
+ }
+ return JSON.parseObject(resultData, ArapDjzb.class);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ logger.error("解析返回参数失败的错误", e);
+ //如果解析失败,记录原因,但是不能影响结果的记录
+ }
+ return null;
+ }
}
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ArapDjzb.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ArapDjzb.java
new file mode 100644
index 00000000..652d1d70
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ArapDjzb.java
@@ -0,0 +1,163 @@
+package com.hzya.frame.plugin.lets.u8cdto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 单据主表-应收应付
+ */
+@Data
+public class ArapDjzb {
+ private Parentt parentvo;
+ private List childrenvo;
+
+ @Data
+ public static class Parentt {
+ private String bfyhzh;//本方银行帐号(付结单:付款银行账号;收结单:收款银行账号)
+ private String bzbm;//币种
+ private String deinvdate;//开票日期
+ private String deptid;//部门
+ private String dfyhzh;//对方银行账号(付结单:收款银行账号;收结单:付款银行账号)
+ private String djbh;//单据号
+ private String djlxbm;//单据类型编码(交易类型编码使用此字段,如D0、D1、D2)
+ private String djrq;//单据日期
+ private String dwbm;//公司
+ private String effectdate;//起算日期
+ private String feinvstatus;//开票状态
+ private String finvoicetype;//发票类型(0 增值税专用发票 1 增值税普通发票 2 营业税发票 3 收据 4 其他发票 5 增值税电子普通发票)
+ private String hbbm;//客商
+ private String isreded;//红冲
+ private String isselectedpay;//选择付款(1选择付款 0非选择付款)
+ private String kmbm;//科目编码(v5.1开始传科目编码,之前只能传主键)
+ private String lrr;//录入人
+ private String lybz;//来源标志(0 应收系统 1应付系统 3 销售系统 4 采购系统 5 资金结算 6 网上银行 8 票据管理 9 协同单据 10 信贷系统 11 汇兑损益系统 12 项目管理 13 全面预算 14 签字确认 15 发运管理 16 内部交易 17 外部交换平台 18 资金计息 19 库存管理)
+ private String pj_jsfs;//结算方式
+ private String pj_num;//票据号
+ private String pk_glorgbook;//账簿编码(v5.1开始支持)
+ private String prepay;//预收付款标志
+ private String qcbz;//期初
+ private String scomment;//备注
+ private String shr;//审核人(审批时必填)
+ private String shrq;//审核日期(审批时必填)
+ private String szxmid;//收支项目
+ private String tradertype;//交易对象类型(0 客商 1 部门 2 人员 3 散户)
+ private String veinvcode;//发票代码
+ private String veinvnumber;//发票号码
+ private String vouchid;//表头主键(修改必填)
+ private String wldx;//往来对象标识(0 客户 1供应商 2部门 3业务员 )
+ private String xslxbm;//业务流程
+ private String ywybm;//业务员编码
+ private String zgyf;//暂估应付标志
+ private String zyx1;//自定义项1(档案类型的传pk)
+ private String zyx10;//自定义项10(档案类型的传pk)
+ private String zyx11;//自定义11(档案类型的传pk)
+ private String zyx12;//自定义12(档案类型的传pk)
+ private String zyx13;//自定义13(档案类型的传pk)
+ private String zyx14;//自定义14(档案类型的传pk)
+ private String zyx15;//自定义15(档案类型的传pk)
+ private String zyx16;//自定义16(档案类型的传pk)
+ private String zyx17;//自定义17(档案类型的传pk)
+ private String zyx18;//自定义18(档案类型的传pk)
+ private String zyx19;//自定义19(档案类型的传pk)
+ private String zyx2;//自定义项2(档案类型的传pk)
+ private String zyx20;//自定义20(档案类型的传pk)
+ private String zyx21;//自定义项21(档案类型的传pk)
+ private String zyx22;//自定义项22(档案类型的传pk)
+ private String zyx23;//自定义项23(档案类型的传pk)
+ private String zyx24;//自定义项24(档案类型的传pk)
+ private String zyx25;//自定义项25(档案类型的传pk)
+ private String zyx26;//自定义项26(档案类型的传pk)
+ private String zyx27;//自定义项27(档案类型的传pk)
+ private String zyx28;//自定义项28(档案类型的传pk)
+ private String zyx29;//自定义项29(档案类型的传pk)
+ private String zyx3;//自定义项3(档案类型的传pk)
+ private String zyx30;//自定义项30(档案类型的传pk)
+ private String zyx4;//自定义项4(档案类型的传pk)
+ private String zyx5;//自定义项5(档案类型的传pk)
+ private String zyx6;//自定义项6(档案类型的传pk)
+ private String zyx7;//自定义项7(档案类型的传pk)
+ private String zyx8;//自定义项8(档案类型的传pk)
+ private String zyx9;//自定义项9(档案类型的传pk)
+ }
+
+ @Data
+ public static class Childrenn {
+ private String bankrollprojet;//计划项目编码(5.1开始支持)
+ private String bfyhzh;//本方银行帐号
+ private String cashitem;//现金流量项目
+ private String cinventoryid;//存货
+ private String cksqsh;//源头单据表体主键
+ private String ddh;//订单号
+ private String ddhh;//上层来源单据表体主键
+ private String ddlx;//上层来源单据表头主键
+ private String deptid;//部门
+ private String dfbbje;//贷方本币金额
+ private String dfbbsj;//贷方本币税金
+ private String dfbbwsje;//贷方本币无税金额
+ private String dfshl;//贷方数量
+ private String dfybje;//贷方原币金额(应付、收款时必填)
+ private String dfybsj;//贷方原币税金
+ private String dfybwsje;//贷方原币无税金额
+ private String dfyhzh;//对方银行帐号
+ private String dj;//单价
+ private String fb_oid;//表体主键(修改必填)
+ private String fph;//发票号
+ private String hbbm;//合作伙伴(客商编码)
+ private String hsdj;//含税单价
+ private String item_bill_pk;//事项审批单PK
+ private String jfbbje;//借方本币金额
+ private String jfbbsj;//借方本币税金
+ private String jfshl;//借方数量
+ private String jfybje;//借方原币金额(应收、付款时必填,注意传参时加双引号)
+ private String jfybsj;//借方原币税金
+ private String jfybwsje;//借方原币无税金额
+ private String jobid;//专项
+ private String jsfsbm;//上层来源单据类型(应付单类型:D1,应收单类型:D0)
+ private String kmbm;//科目编码(v5.1开始传科目编码,之前只能传主键)
+ private String kslb;//扣税类别
+ private String notetype;//票据类型(5.0sp添加)
+ private String occupationmny;//预占用核销原币余额
+ private String ordercusmandoc;//订单客商
+ private String ph;//源头单据类型
+ private String sfkxyh;//收付款协议
+ private String sl;//税率
+ private String szxmid;//收支项目
+ private String wbfbbje;//借方本币无税金额
+ private String wldx;//往来对象标识(0 客户 1供应商 2部门 3业务员 )
+ private String xyzh;//源头单据表头主键
+ private String ywybm;//业务员编码(5.0及以上支持)
+ private String zy;//摘要
+ private String zyx1;//自定义项1(档案类型的传pk)
+ private String zyx10;//自定义项10(档案类型的传pk)
+ private String zyx11;//自定义项11(档案类型的传pk)
+ private String zyx12;//自定义项12(档案类型的传pk)
+ private String zyx13;//自定义项13(档案类型的传pk)
+ private String zyx14;//自定义项14(档案类型的传pk)
+ private String zyx15;//自定义项15(档案类型的传pk)
+ private String zyx16;//自定义项16(档案类型的传pk)
+ private String zyx17;//自定义项17(档案类型的传pk)
+ private String zyx18;//自定义项18(档案类型的传pk)
+ private String zyx19;//自定义项19(档案类型的传pk)
+ private String zyx2;//自定义项2(档案类型的传pk)
+ private String zyx20;//自定义项20(档案类型的传pk)
+ private String zyx21;//自定义项21(档案类型的传pk)
+ private String zyx22;//自定义项22(档案类型的传pk)
+ private String zyx23;//自定义项23(档案类型的传pk)
+ private String zyx24;//自定义项24(档案类型的传pk)
+ private String zyx25;//自定义项25(档案类型的传pk)
+ private String zyx26;//自定义项26(档案类型的传pk)
+ private String zyx27;//自定义项27(档案类型的传pk)
+ private String zyx28;//自定义项28(档案类型的传pk)
+ private String zyx29;//自定义项29(档案类型的传pk)
+ private String zyx3;//自定义项3(档案类型的传pk)
+ private String zyx30;//自定义项30(档案类型的传pk)
+ private String zyx4;//自定义项4(档案类型的传pk)
+ private String zyx5;//自定义项5(档案类型的传pk)
+ private String zyx6;//自定义项6(档案类型的传pk)
+ private String zyx7;//自定义项7(档案类型的传pk)
+ private String zyx8;//自定义项8(档案类型的传pk)
+ private String zyx9;//自定义项9(档案类型的传pk)
+ }
+
+}
diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java
index 51e73930..983784a2 100644
--- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java
+++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferTest.java
@@ -131,7 +131,9 @@ public class TransferTest {
////////////////////////////////////////////////////////////////////////////////////仅退款
@Test
public void t80(){
- refundOnlyPluginInitializer.start("LETS-RO2024091900000001");
+// refundOnlyPluginInitializer.start("LETS-RO2024091900000001");
+// refundOnlyPluginInitializer.start("LETS-RO2023060900005007");
+ refundOnlyPluginInitializer.start("LETS-RO2023082300000045");
}
////////////////////////////////////////////////////////////////////////////////////仅退款
diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchHeader.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchHeader.java
index 01dd6e4a..a109d539 100755
--- a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchHeader.java
+++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchHeader.java
@@ -72,4 +72,8 @@ public class RerturnGoodsOrderSearchHeader {
private String expertDiscounts;
//支付优惠
private String payDiscounts;
+
+ //部门-来自销售订单
+ private String saleDeptCode;
+ private String saleDeptDame;
}
\ No newline at end of file