diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IOnlyAfterSalesBDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IOnlyAfterSalesBDao.java new file mode 100644 index 00000000..31a9ab99 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IOnlyAfterSalesBDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.lets.dao; + +import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesBEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 售后订单表_仅退款_子表(only_after_sales_b: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-23 10:43:46 + */ +public interface IOnlyAfterSalesBDao extends IBaseDao { + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IOnlyAfterSalesHDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IOnlyAfterSalesHDao.java new file mode 100644 index 00000000..a1c79738 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IOnlyAfterSalesHDao.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.lets.dao; + +import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesHEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; + +/** + * 售后订单表_仅退款_主表(only_after_sales_h: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-23 10:43:07 + */ +public interface IOnlyAfterSalesHDao extends IBaseDao { +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/OnlyAfterSalesBDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/OnlyAfterSalesBDaoImpl.java new file mode 100644 index 00000000..90681622 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/OnlyAfterSalesBDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.lets.dao.impl; + +import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesBEntity; +import com.hzya.frame.plugin.lets.dao.IOnlyAfterSalesBDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 售后订单表_仅退款_子表(OnlyAfterSalesB)表数据库访问层 + * + * @author makejava + * @since 2024-09-23 10:43:46 + */ +public class OnlyAfterSalesBDaoImpl extends MybatisGenericDao implements IOnlyAfterSalesBDao{ + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/OnlyAfterSalesHDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/OnlyAfterSalesHDaoImpl.java new file mode 100644 index 00000000..bf7b71b7 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/OnlyAfterSalesHDaoImpl.java @@ -0,0 +1,18 @@ +package com.hzya.frame.plugin.lets.dao.impl; + +import com.hzya.frame.plugin.lets.entity.OnlyAfterSalesHEntity; +import com.hzya.frame.plugin.lets.dao.IOnlyAfterSalesHDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + +/** + * 售后订单表_仅退款_主表(OnlyAfterSalesH)表数据库访问层 + * + * @author makejava + * @since 2024-09-23 10:43:07 + */ +public class OnlyAfterSalesHDaoImpl extends MybatisGenericDao implements IOnlyAfterSalesHDao{ +} + 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 new file mode 100644 index 00000000..3b617e3d --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.java @@ -0,0 +1,74 @@ +package com.hzya.frame.plugin.lets.entity; + +import com.hzya.frame.web.entity.BaseEntity; +import lombok.Data; + +/** + * 售后订单表_仅退款_子表(OnlyAfterSalesB)实体类 + * + * @author makejava + * @since 2024-09-23 10:43:46 + */ +@Data +public class OnlyAfterSalesBEntity extends BaseEntity { + + private String hid; + private String ofsid; + /** 退货单ID */ + private Long returnorderid; + /** 退货单号 */ + private String returnordercode; + /** SKU编码 */ + private String skucode; + /** SKU名称 */ + private String skuname; + /** 货主编码 */ + private String companycode; + /** 组织 */ + private String clientcode; + /** 店铺 */ + private String storecode; + /** 退货类型 */ + private String returntype; + /** 是否退款 */ + private String refundind; + /** 请求数量 */ + private String requestqty; + /** 实际退货数量 */ + private String fulfillqty; + /** 货品单位 */ + private String quantityum; + /** 商品零售价 */ + private String msrprice; + /** 总重量 */ + private String totalweight; + /** 总体积 */ + private String totalvolume; + /** 重量单位 */ + private String weightum; + /** 体积单位 */ + private String volumeum; + /** 退货金额 */ + private String totalamount; + /** 平台订单行号 */ + private String sourcelinenum; + /** 原订单号 */ + private String sourceordercode; + /** 原支付单价 */ + private String sourcediscountprice; + /** 原支付金额 */ + private String sourcepayamount; + /** 原购买数量 */ + private String sourcerequestqty; + /** bom类型 */ + private String bomtype; + /** 拆分bom前的明细id */ + private Long originaldetailid; + /** 处理原因 */ + private String reasoncode; + /** 处理备注 */ + private String reasondesc; + + +} + 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 new file mode 100644 index 00000000..cace8b42 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesBEntity.xml @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,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 + + + + + + + + + + + + + + + + insert into only_after_sales_b( + + id , + 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 , + + )values( + + #{id} , + #{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} , + + ) + + + + 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, reasonDescs) + values + + (#{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}) + + + + + 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) + values + + (#{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}) + + on duplicate key update + hid = values(hid), + ofsid = values(ofsid), + returnOrderId = values(returnOrderId), + returnOrderCode = values(returnOrderCode), + skuCode = values(skuCode), + skuName = values(skuName), + companyCode = values(companyCode), + clientCode = values(clientCode), + storeCode = values(storeCode), + returnType = values(returnType), + refundInd = values(refundInd), + requestQty = values(requestQty), + fulfillQty = values(fulfillQty), + quantityUM = values(quantityUM), + msrPrice = values(msrPrice), + totalWeight = values(totalWeight), + totalVolume = values(totalVolume), + weightUM = values(weightUM), + volumeUM = values(volumeUM), + totalAmount = values(totalAmount), + sourceLineNum = values(sourceLineNum), + sourceOrderCode = values(sourceOrderCode), + sourceDiscountPrice = values(sourceDiscountPrice), + sourcePayAmount = values(sourcePayAmount), + sourceRequestQty = values(sourceRequestQty), + bomType = values(bomType), + originalDetailId = values(originalDetailId), + reasonCode = values(reasonCode), + reasonDesc = values(reasonDesc) + + +update only_after_sales_b set + + hid = #{hid}, + ofsid = #{ofsid}, + returnOrderId = #{returnorderid}, + returnOrderCode = #{returnordercode}, + skuCode = #{skucode}, + skuName = #{skuname}, + companyCode = #{companycode}, + clientCode = #{clientcode}, + storeCode = #{storecode}, + returnType = #{returntype}, + refundInd = #{refundind}, + requestQty = #{requestqty}, + fulfillQty = #{fulfillqty}, + quantityUM = #{quantityum}, + msrPrice = #{msrprice}, + totalWeight = #{totalweight}, + totalVolume = #{totalvolume}, + weightUM = #{weightum}, + volumeUM = #{volumeum}, + totalAmount = #{totalamount}, + sourceLineNum = #{sourcelinenum}, + sourceOrderCode = #{sourceordercode}, + sourceDiscountPrice = #{sourcediscountprice}, + sourcePayAmount = #{sourcepayamount}, + sourceRequestQty = #{sourcerequestqty}, + bomType = #{bomtype}, + originalDetailId = #{originaldetailid}, + reasonCode = #{reasoncode}, + reasonDesc = #{reasondesc}, + +where id = #{id} + + + +update only_after_sales_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update only_after_sales_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and hid = #{hid} + and ofsid = #{ofsid} + and returnOrderId = #{returnorderid} + and returnOrderCode = #{returnordercode} + and skuCode = #{skucode} + and skuName = #{skuname} + and companyCode = #{companycode} + and clientCode = #{clientcode} + and storeCode = #{storecode} + and returnType = #{returntype} + and refundInd = #{refundind} + and requestQty = #{requestqty} + and fulfillQty = #{fulfillqty} + and quantityUM = #{quantityum} + and msrPrice = #{msrprice} + and totalWeight = #{totalweight} + and totalVolume = #{totalvolume} + and weightUM = #{weightum} + and volumeUM = #{volumeum} + and totalAmount = #{totalamount} + and sourceLineNum = #{sourcelinenum} + and sourceOrderCode = #{sourceordercode} + and sourceDiscountPrice = #{sourcediscountprice} + and sourcePayAmount = #{sourcepayamount} + and sourceRequestQty = #{sourcerequestqty} + and bomType = #{bomtype} + and originalDetailId = #{originaldetailid} + and reasonCode = #{reasoncode} + and reasonDesc = #{reasondesc} + + + + + + delete from only_after_sales_b where id = #{id} + + + + 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 new file mode 100644 index 00000000..71c87024 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.java @@ -0,0 +1,150 @@ +package com.hzya.frame.plugin.lets.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +import lombok.Data; + +/** + * 售后订单表_仅退款_主表(OnlyAfterSalesH)实体类 + * + * @author makejava + * @since 2024-09-23 10:43:08 + */ +@Data +public class OnlyAfterSalesHEntity extends BaseEntity { + + private String ofsid; + + /** 退货类型 */ + private String returntype; + /** 换货方式 */ + private String exchangetype; + /** 是否退款 */ + private String refundind; + /** 系统内部类型 */ + private String internalordertype; + /** 业务发生渠道 */ + private String bizchannel; + /** 售后凭证单号 */ + private String code; + /** 商家编码 */ + private String companycode; + /** 组织 */ + private String clientcode; + /** 店铺编码 */ + private String storecode; + /** 平台客户账号 */ + private String sourceuseraccount; + /** 平台客户昵称 */ + private String sourceusername; + /** 退货状态 */ + private String returnstatus; + /** 发货状态 */ + private String shipstatus; + /** 退款状态 */ + private String refundstatus; + /** 退回仓库 */ + private String facilitycode; + /** 销售订单编号 */ + private String refordercode; + /** 销售订单ID */ + private Long reforderid; + /** 销售订单类型 */ + private String refordertype; + /** 生成售后订单时的订单状态 */ + private String reforderstatuswhenreturned; + /** 来源平台 */ + private String sourceplatformcode; + /** 平台订单号 */ + private String sourceordercode; + /** 平台订单状态 */ + private String sourceorderstatuswhenreturned; + /** 平台退货单号 */ + private String sourcereturncode; + /** 平台退货单状态 */ + private String sourcereturnstatus; + /** 退货原因 */ + private String reasoncode; + /** 客服备注 */ + private String returnnote; + /** 卖家备注 */ + private String sellernote; + /** 应退金额 */ + private String requestrefundamount; + /** 实退金额 */ + private String actualrefundamount; + /** 应退商品总数 */ + private String totalqty; + /** 实退总数 */ + private String totalfulfillqty; + /** 发货人 */ + private String shipfromattentionto; + /** 地址 */ + private String shipfromaddress; + /** 国家 */ + private String shipfromcountry; + /** 省份 */ + private String shipfromstate; + /** 城市 */ + private String shipfromcity; + /** 区域 */ + private String shipfromdistrict; + /** 邮编 */ + private String shipfrompostalcode; + /** 电话 */ + private String shipfromphone; + /** 手机 */ + private String shipfrommobile; + /** 传真 */ + private String shipfromfax; + /** 电子邮箱 */ + private String shipfromemail; + /** 发货快递公司 */ + private String shipcarrier; + /** 发货快递单号 */ + private String shipwaybillcode; + /** 发货物流状态 */ + private String shiplogisticsstatus; + /** 退回快递公司 */ + private String returncarrier; + /** 退回快递单号 */ + private String returnwaybillcode; + /** 退货物流状态 */ + private String returnlogisticsstatus; + /** 支付账号 */ + private String payaccount; + /** 退款支付交易单号 */ + private String payorderno; + /** 审核人 */ + private String auditby; + /** 审核时间 */ + private Date auditat; + /** 退款方式 */ + private String refundthru; + /** 客服工号 */ + private String csstuff; + /** 仓库备注 */ + private String returnwarehousenote; + /** 锁定原因 */ + private String holdcode; + /** 锁定用户 */ + private String holduser; + /** 锁定时间 */ + private Date holdat; + /** 异常类型 */ + private String errorcode; + /** 异常消息 */ + private String errordesc; + /** 核销状态 */ + private String verificationstatus; + /** 核销异常描述 */ + private String verificationerrordesc; + /** 退款时间 */ + private Date refundedat; + /** 状态 */ + private String status; + /** 处理类型 */ + private String processtype; + +} + 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 new file mode 100644 index 00000000..e145557c --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/OnlyAfterSalesHEntity.xml @@ -0,0 +1,844 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,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 + + + + + + + + + + + + + + + + insert into only_after_sales_h( + + id , + 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 , + + )values( + + #{id} , + #{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} , + + ) + + + + insert into only_after_sales_h(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) + values + + (#{entity.ofsid},#{entity.returntype},#{entity.exchangetype},#{entity.refundind},#{entity.internalordertype},#{entity.bizchannel},#{entity.code},#{entity.companycode},#{entity.clientcode},#{entity.storecode},#{entity.sourceuseraccount},#{entity.sourceusername},#{entity.returnstatus},#{entity.shipstatus},#{entity.refundstatus},#{entity.facilitycode},#{entity.refordercode},#{entity.reforderid},#{entity.refordertype},#{entity.reforderstatuswhenreturned},#{entity.sourceplatformcode},#{entity.sourceordercode},#{entity.sourceorderstatuswhenreturned},#{entity.sourcereturncode},#{entity.sourcereturnstatus},#{entity.reasoncode},#{entity.returnnote},#{entity.sellernote},#{entity.requestrefundamount},#{entity.actualrefundamount},#{entity.totalqty},#{entity.totalfulfillqty},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromcountry},#{entity.shipfromstate},#{entity.shipfromcity},#{entity.shipfromdistrict},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.shipcarrier},#{entity.shipwaybillcode},#{entity.shiplogisticsstatus},#{entity.returncarrier},#{entity.returnwaybillcode},#{entity.returnlogisticsstatus},#{entity.payaccount},#{entity.payorderno},#{entity.auditby},#{entity.auditat},#{entity.refundthru},#{entity.csstuff},#{entity.returnwarehousenote},#{entity.holdcode},#{entity.holduser},#{entity.holdat},#{entity.errorcode},#{entity.errordesc},#{entity.verificationstatus},#{entity.verificationerrordesc},#{entity.refundedat},#{entity.status},#{entity.processtype}) + + + + + insert into only_after_sales_h(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) + values + + (#{entity.ofsid},#{entity.returntype},#{entity.exchangetype},#{entity.refundind},#{entity.internalordertype},#{entity.bizchannel},#{entity.code},#{entity.companycode},#{entity.clientcode},#{entity.storecode},#{entity.sourceuseraccount},#{entity.sourceusername},#{entity.returnstatus},#{entity.shipstatus},#{entity.refundstatus},#{entity.facilitycode},#{entity.refordercode},#{entity.reforderid},#{entity.refordertype},#{entity.reforderstatuswhenreturned},#{entity.sourceplatformcode},#{entity.sourceordercode},#{entity.sourceorderstatuswhenreturned},#{entity.sourcereturncode},#{entity.sourcereturnstatus},#{entity.reasoncode},#{entity.returnnote},#{entity.sellernote},#{entity.requestrefundamount},#{entity.actualrefundamount},#{entity.totalqty},#{entity.totalfulfillqty},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromcountry},#{entity.shipfromstate},#{entity.shipfromcity},#{entity.shipfromdistrict},#{entity.shipfrompostalcode},#{entity.shipfromphone},#{entity.shipfrommobile},#{entity.shipfromfax},#{entity.shipfromemail},#{entity.shipcarrier},#{entity.shipwaybillcode},#{entity.shiplogisticsstatus},#{entity.returncarrier},#{entity.returnwaybillcode},#{entity.returnlogisticsstatus},#{entity.payaccount},#{entity.payorderno},#{entity.auditby},#{entity.auditat},#{entity.refundthru},#{entity.csstuff},#{entity.returnwarehousenote},#{entity.holdcode},#{entity.holduser},#{entity.holdat},#{entity.errorcode},#{entity.errordesc},#{entity.verificationstatus},#{entity.verificationerrordesc},#{entity.refundedat},#{entity.status},#{entity.processtype}) + + on duplicate key update + ofsid = values(ofsid), + returnType = values(returnType), + exchangeType = values(exchangeType), + refundInd = values(refundInd), + internalOrderType = values(internalOrderType), + bizChannel = values(bizChannel), + code = values(code), + companyCode = values(companyCode), + clientCode = values(clientCode), + storeCode = values(storeCode), + sourceUserAccount = values(sourceUserAccount), + sourceUserName = values(sourceUserName), + returnStatus = values(returnStatus), + shipStatus = values(shipStatus), + refundStatus = values(refundStatus), + facilityCode = values(facilityCode), + refOrderCode = values(refOrderCode), + refOrderId = values(refOrderId), + refOrderType = values(refOrderType), + refOrderStatusWhenReturned = values(refOrderStatusWhenReturned), + sourcePlatformCode = values(sourcePlatformCode), + sourceOrderCode = values(sourceOrderCode), + sourceOrderStatusWhenReturned = values(sourceOrderStatusWhenReturned), + sourceReturnCode = values(sourceReturnCode), + sourceReturnStatus = values(sourceReturnStatus), + reasonCode = values(reasonCode), + returnNote = values(returnNote), + sellerNote = values(sellerNote), + requestRefundAmount = values(requestRefundAmount), + actualRefundAmount = values(actualRefundAmount), + totalQty = values(totalQty), + totalFulfillQty = values(totalFulfillQty), + shipFromAttentionTo = values(shipFromAttentionTo), + shipFromAddress = values(shipFromAddress), + shipFromCountry = values(shipFromCountry), + shipFromState = values(shipFromState), + shipFromCity = values(shipFromCity), + shipFromDistrict = values(shipFromDistrict), + shipFromPostalCode = values(shipFromPostalCode), + shipFromPhone = values(shipFromPhone), + shipFromMobile = values(shipFromMobile), + shipFromFax = values(shipFromFax), + shipFromEmail = values(shipFromEmail), + shipCarrier = values(shipCarrier), + shipWaybillCode = values(shipWaybillCode), + shipLogisticsStatus = values(shipLogisticsStatus), + returnCarrier = values(returnCarrier), + returnWaybillCode = values(returnWaybillCode), + returnLogisticsStatus = values(returnLogisticsStatus), + payAccount = values(payAccount), + payOrderNo = values(payOrderNo), + auditBy = values(auditBy), + auditAt = values(auditAt), + refundThru = values(refundThru), + csStuff = values(csStuff), + returnWarehouseNote = values(returnWarehouseNote), + holdCode = values(holdCode), + holdUser = values(holdUser), + holdAt = values(holdAt), + errorCode = values(errorCode), + errorDesc = values(errorDesc), + verificationStatus = values(verificationStatus), + verificationErrorDesc = values(verificationErrorDesc), + refundedAt = values(refundedAt), + status = values(status), + processType = values(processType) + + +update only_after_sales_h set + + ofsid = #{ofsid}, + returnType = #{returntype}, + exchangeType = #{exchangetype}, + refundInd = #{refundind}, + internalOrderType = #{internalordertype}, + bizChannel = #{bizchannel}, + code = #{code}, + companyCode = #{companycode}, + clientCode = #{clientcode}, + storeCode = #{storecode}, + sourceUserAccount = #{sourceuseraccount}, + sourceUserName = #{sourceusername}, + returnStatus = #{returnstatus}, + shipStatus = #{shipstatus}, + refundStatus = #{refundstatus}, + facilityCode = #{facilitycode}, + refOrderCode = #{refordercode}, + refOrderId = #{reforderid}, + refOrderType = #{refordertype}, + refOrderStatusWhenReturned = #{reforderstatuswhenreturned}, + sourcePlatformCode = #{sourceplatformcode}, + sourceOrderCode = #{sourceordercode}, + sourceOrderStatusWhenReturned = #{sourceorderstatuswhenreturned}, + sourceReturnCode = #{sourcereturncode}, + sourceReturnStatus = #{sourcereturnstatus}, + reasonCode = #{reasoncode}, + returnNote = #{returnnote}, + sellerNote = #{sellernote}, + requestRefundAmount = #{requestrefundamount}, + actualRefundAmount = #{actualrefundamount}, + totalQty = #{totalqty}, + totalFulfillQty = #{totalfulfillqty}, + shipFromAttentionTo = #{shipfromattentionto}, + shipFromAddress = #{shipfromaddress}, + shipFromCountry = #{shipfromcountry}, + shipFromState = #{shipfromstate}, + shipFromCity = #{shipfromcity}, + shipFromDistrict = #{shipfromdistrict}, + shipFromPostalCode = #{shipfrompostalcode}, + shipFromPhone = #{shipfromphone}, + shipFromMobile = #{shipfrommobile}, + shipFromFax = #{shipfromfax}, + shipFromEmail = #{shipfromemail}, + shipCarrier = #{shipcarrier}, + shipWaybillCode = #{shipwaybillcode}, + shipLogisticsStatus = #{shiplogisticsstatus}, + returnCarrier = #{returncarrier}, + returnWaybillCode = #{returnwaybillcode}, + returnLogisticsStatus = #{returnlogisticsstatus}, + payAccount = #{payaccount}, + payOrderNo = #{payorderno}, + auditBy = #{auditby}, + auditAt = #{auditat}, + refundThru = #{refundthru}, + csStuff = #{csstuff}, + returnWarehouseNote = #{returnwarehousenote}, + holdCode = #{holdcode}, + holdUser = #{holduser}, + holdAt = #{holdat}, + errorCode = #{errorcode}, + errorDesc = #{errordesc}, + verificationStatus = #{verificationstatus}, + verificationErrorDesc = #{verificationerrordesc}, + refundedAt = #{refundedat}, + status = #{status}, + processType = #{processtype}, + +where id = #{id} + + + +update only_after_sales_h set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +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} + and exchangeType = #{exchangetype} + and refundInd = #{refundind} + and internalOrderType = #{internalordertype} + and bizChannel = #{bizchannel} + and code = #{code} + and companyCode = #{companycode} + and clientCode = #{clientcode} + and storeCode = #{storecode} + and sourceUserAccount = #{sourceuseraccount} + and sourceUserName = #{sourceusername} + and returnStatus = #{returnstatus} + and shipStatus = #{shipstatus} + and refundStatus = #{refundstatus} + and facilityCode = #{facilitycode} + and refOrderCode = #{refordercode} + and refOrderId = #{reforderid} + and refOrderType = #{refordertype} + and refOrderStatusWhenReturned = #{reforderstatuswhenreturned} + and sourcePlatformCode = #{sourceplatformcode} + and sourceOrderCode = #{sourceordercode} + and sourceOrderStatusWhenReturned = #{sourceorderstatuswhenreturned} + and sourceReturnCode = #{sourcereturncode} + and sourceReturnStatus = #{sourcereturnstatus} + and reasonCode = #{reasoncode} + and returnNote = #{returnnote} + and sellerNote = #{sellernote} + and requestRefundAmount = #{requestrefundamount} + and actualRefundAmount = #{actualrefundamount} + and totalQty = #{totalqty} + and totalFulfillQty = #{totalfulfillqty} + and shipFromAttentionTo = #{shipfromattentionto} + and shipFromAddress = #{shipfromaddress} + and shipFromCountry = #{shipfromcountry} + and shipFromState = #{shipfromstate} + and shipFromCity = #{shipfromcity} + and shipFromDistrict = #{shipfromdistrict} + and shipFromPostalCode = #{shipfrompostalcode} + and shipFromPhone = #{shipfromphone} + and shipFromMobile = #{shipfrommobile} + and shipFromFax = #{shipfromfax} + and shipFromEmail = #{shipfromemail} + and shipCarrier = #{shipcarrier} + and shipWaybillCode = #{shipwaybillcode} + and shipLogisticsStatus = #{shiplogisticsstatus} + and returnCarrier = #{returncarrier} + and returnWaybillCode = #{returnwaybillcode} + and returnLogisticsStatus = #{returnlogisticsstatus} + and payAccount = #{payaccount} + and payOrderNo = #{payorderno} + and auditBy = #{auditby} + and auditAt = #{auditat} + and refundThru = #{refundthru} + and csStuff = #{csstuff} + and returnWarehouseNote = #{returnwarehousenote} + and holdCode = #{holdcode} + and holdUser = #{holduser} + and holdAt = #{holdat} + and errorCode = #{errorcode} + and errorDesc = #{errordesc} + and verificationStatus = #{verificationstatus} + and verificationErrorDesc = #{verificationerrordesc} + and refundedAt = #{refundedat} + and status = #{status} + and processType = #{processtype} + + + + + + delete from only_after_sales_h where id = #{id} + + + + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryReturnOrderRequestVO.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryReturnOrderRequestVO.java new file mode 100644 index 00000000..c8a29b17 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofsvo/QueryReturnOrderRequestVO.java @@ -0,0 +1,40 @@ +package com.hzya.frame.plugin.lets.ofsvo; + +import lombok.Data; + +/** + * ofs 销售退货单查询 请求类 + */ +@Data +public class QueryReturnOrderRequestVO { + /** 开始时间 */ + private String created_start; + /** 结束时间 */ + private String created_end; + /** 退款开始时间 */ + private String refundedAt_start; + /** 退款结束时间 */ + private String refundedAt_end; + /** 组织 */ + private String clientCode; + /** 调拨订单 */ + private String code; + /** 状态 */ + private String status; + /** 订单类型 OFS数据字典 INTERNAL_ORDER_TYPE*/ + private String internalOrderType; + /** 销售订单类型 OFS数据字典 INTERNAL_ORDER_TYPE*/ + private String refOrderType; + + /** 销售订单编号 */ + private String refOrderCode; + + /** 货主 */ + private String companyCode; + /** 库存地点 */ + private String facilityCode; + /** 分页页数 */ + private Long pageNo; + /** 每页条数 1-500,默认50 */ + private Long pageSize; +} 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 84eca303..4d4d1ff4 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 @@ -1,32 +1,55 @@ package com.hzya.frame.plugin.lets.plugin.sales; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.lets.constant.OverallConstant; import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +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.QueryReturnOrderRequestVO; +import com.hzya.frame.plugin.lets.u8cdto.ArapDjzbVO; +import com.hzya.frame.plugin.lets.u8cdto.BillVO; import com.hzya.frame.plugin.lets.util.QueryU8CEntityUtil; import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode; 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.returngoodordersearch.RerturnGoodsOrderSearchData; +import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchDetails; +import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchHeader; +import com.hzya.frame.ttxofs.dto.returngoodordersearch.RerturnGoodsOrderSearchJsonRootBean; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.web.entity.JsonResultEntity; 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; /** + * add by zyd * O售后订单(仅退款) -> U8C红字应收单 * - * @Author:liuyang - * @Package:com.hzya.frame.plugin.lets.plugin.sales - * @Project:kangarooDataCenterV3 - * @name:RefundOnly - * @Date:2024/9/3 17:19 - * @Filename:RefundOnly + * returnType:0 不退货 + * exchangeType:0 不换货 + * refundInd:1 退款 + * + * 按天推送 + * + * @Date:2024/9/21 17:19 */ public class RefundOnlyPluginInitializer extends PluginBaseEntity { @@ -62,6 +85,9 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity { return "3"; } + + @Autowired + private OfsUnifiedService ofsUnifiedService; @Autowired private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; @Autowired @@ -71,6 +97,11 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity { @Autowired private QueryU8CEntityUtil queryU8CEntityUtil; + @Autowired + private IOnlyAfterSalesHDao onlyAfterSalesHDao; + @Autowired + private IOnlyAfterSalesBDao onlyAfterSalesBDao; + @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { @@ -114,22 +145,46 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity { //获取当前时间 Date currentDate = new Date(); Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10); - Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -4); + Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -3); String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"); String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); + QueryReturnOrderRequestVO queryReturnOrderRequestVO = new QueryReturnOrderRequestVO(); + queryReturnOrderRequestVO.setRefundedAt_start(startTimeStr); + queryReturnOrderRequestVO.setRefundedAt_end(endTimeStr); +// queryOfsOnlyReturnOrders(queryReturnOrderRequestVO); + }catch (Exception e){ logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start()方法报错:"+e); } } - public void start(String vbillcode){ - try { + /** + * @param ofsCode 售后订单号 + */ + public void start(String ofsCode){ + try { + QueryReturnOrderRequestVO queryReturnOrderRequestVO = new QueryReturnOrderRequestVO(); + queryReturnOrderRequestVO.setCode(ofsCode); + List returnGoodsOrders = queryOfsOnlyReturnOrders(queryReturnOrderRequestVO); + if (returnGoodsOrders == null || returnGoodsOrders.size() == 0) { + Assert.state(false, "丽知:售后订单(仅退款):{} --->U8C红字应收单,未查询到OFS售后订单(仅退款)", ofsCode); + } + + //底表存数据库 + saveOrUpdate(returnGoodsOrders); + //过滤日志 + List filterReturnGoodsOrders = filterData(returnGoodsOrders); + if(filterReturnGoodsOrders==null||filterReturnGoodsOrders.size()==0){ + Assert.state(false, "丽知:售后订单(仅退款):{} --->U8C红字应收单,该售后订单(仅退款)已被推送成功,请勿重新推送", ofsCode); + } + //推送 +// implement(filterReturnGoodsOrders); }catch (Exception e){ - logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start()方法报错:"+e); + logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start(String ofsCode)方法报错:"+e); } } public void start(String startTime, String endTime){ @@ -139,11 +194,212 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity { String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00"; String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; + QueryReturnOrderRequestVO queryReturnOrderRequestVO = new QueryReturnOrderRequestVO(); + queryReturnOrderRequestVO.setRefundedAt_start(start); + queryReturnOrderRequestVO.setRefundedAt_end(end); +// queryOfsOnlyReturnOrders(queryReturnOrderRequestVO); }catch (Exception e){ - logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start()方法报错:"+e); + logger.error("丽知:售后订单(仅退款)--->U8C红字应收单,start(String startTime, String endTime)方法报错:"+e); } } + /** + * 过滤成功日志 + */ + 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; + } + if (!isExis) { + filterReturnGoodsOrders.add(returnGoodsOrder); + } + } + return filterReturnGoodsOrders; + } + + /** + * 具体实现推送U8C红字应收单 + * + * 公司+店铺+仓库+SKU+收发类别+部门 分组 + * + * 因为优惠金额在表头,先按单据便利一变,具体分摊金额拆到每行,在去汇总 + * + */ + public void implement(List filterReturnGoodsOrders){ + + //分摊后的明细 + List ofsDetails=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(); +// +// try { +// +// ArapDjzbVO arapDjzbVO = new ArapDjzbVO(); +// //主表 , 在表头先 +// RerturnGoodsOrderSearchHeader header = returnGoodsOrder.getHeader(); +// ArapDjzbVO.Parentt parentvo = new ArapDjzbVO.Parentt(); +// +// //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); +// //失败 +// } +// +// } + + } + + /** + * ofs仅退款数据,存中台mysql数据库 + * 表头表体分别存,忽略大小写 BeanUtil.copyPropreties(a,b,Copyoptions.create().ignoreCase()) + * @param returnGoodsOrders + */ + public void saveOrUpdate(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()); +// allH.add(onlyAfterSalesHEntity); + onlyAfterSalesHEntity.setId(null); + onlyAfterSalesHEntity.setOfsid(header.getId()); + OnlyAfterSalesHEntity save = onlyAfterSalesHDao.save(onlyAfterSalesHEntity); + String HId = save.getId(); + + List details = returnGoodsOrder.getDetails(); + for (RerturnGoodsOrderSearchDetails detail : details) { + OnlyAfterSalesBEntity onlyAfterSalesBEntity = new OnlyAfterSalesBEntity(); + BeanUtil.copyProperties(detail,onlyAfterSalesBEntity, CopyOptions.create().ignoreCase()); +// allB.add(onlyAfterSalesBEntity); + onlyAfterSalesBEntity.setId(null); + onlyAfterSalesBEntity.setHid(HId); + onlyAfterSalesBEntity.setOfsid(detail.getId()); + onlyAfterSalesBDao.save(onlyAfterSalesBEntity); + } + } + } + + + /** + * 查询ofs仅退款订单 销售退货单查询(ofs.returnOrder. search) + * + * 查询条件:refundedAt_start、refundedAt_end、code + * returnType:0 不退货 + * exchangeType:0 不换货 + * refundInd:1 退款 + */ + public List queryOfsOnlyReturnOrders(QueryReturnOrderRequestVO queryReturnOrderRequestVO) throws Exception { + Long pageNo = 1L; + + List all=new ArrayList<>(); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.returnOrder.search"); + queryReturnOrderRequestVO.setClientCode("LETS"); + //100订单池 500待同步 510已同步 900售后成功 400待合单 800已入库 999作废 700收货中 0待完善 +// queryReturnOrderRequestVO.setStatus("900"); + queryReturnOrderRequestVO.setPageNo(pageNo); + queryReturnOrderRequestVO.setPageSize(500L); + interfaceParamDto.setData(JSON.toJSONString(queryReturnOrderRequestVO)); + + RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean =(RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto); + if (rerturnGoodsOrderSearchJsonRootBean.getData() == null || rerturnGoodsOrderSearchJsonRootBean.getData().size() == 0) { + return null; + } + all.addAll(rerturnGoodsOrderSearchJsonRootBean.getData()); + + int count = rerturnGoodsOrderSearchJsonRootBean.getData().size(); + while (count >= 500) {//>=500,可能还有下一页。 + //还有下一页 + pageNo++; + queryReturnOrderRequestVO.setPageNo(pageNo); + interfaceParamDto.setData(JSON.toJSONString(queryReturnOrderRequestVO)); + RerturnGoodsOrderSearchJsonRootBean rerturnGoodsOrderSearchJsonRootBean1 =(RerturnGoodsOrderSearchJsonRootBean) ofsUnifiedService.unified(interfaceParamDto); + all.addAll(rerturnGoodsOrderSearchJsonRootBean1.getData()); + count = rerturnGoodsOrderSearchJsonRootBean1.getData().size(); + } + return all; + } + + } \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ArapDjzbVO.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ArapDjzbVO.java new file mode 100644 index 00000000..94490fc6 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ArapDjzbVO.java @@ -0,0 +1,163 @@ +package com.hzya.frame.plugin.lets.u8cdto; + +import lombok.Data; + +import java.util.List; + +/** + * 单据主表-应收应付 + */ +@Data +public class ArapDjzbVO { + private Parentt parentvo; + private List children; + + @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/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml index e755ce59..224aae8c 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml @@ -61,4 +61,7 @@ + + + \ No newline at end of file diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java index 1063c24f..4cbfb032 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/BaseTest.java @@ -29,7 +29,9 @@ public class BaseTest { } @Test public void t01(){ - skuPluginInitializer.start("test0717001"); +// skuPluginInitializer.start("test0717001"); + skuPluginInitializer.start("gdkfc778"); +// skuPluginInitializer.start("6971229882248"); } @Test public void t02(){ @@ -67,7 +69,7 @@ public class BaseTest { /////////////////////////////////////////////////////////////////////////////////////实物组套 @Test public void t30(){ - kitPluginInitializer.start("test0717001"); + kitPluginInitializer.start("666888"); } 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 c8ba699b..b129eb66 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 @@ -2,6 +2,7 @@ package com.hzya.frame.plugin.lets.plugin.transfer; import com.hzya.frame.WebappApplication; import com.hzya.frame.plugin.lets.plugin.adjust.*; +import com.hzya.frame.plugin.lets.plugin.sales.RefundOnlyPluginInitializer; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -28,6 +29,8 @@ public class TransferTest { private OtherOutPluginInitializer otherOutPluginInitializer; @Autowired private OtherInPluginInitializer otherInPluginInitializer; + @Autowired + private RefundOnlyPluginInitializer refundOnlyPluginInitializer; ////////////////////////////////////////////////////////////////////////////////////调拨订单 // @Test @@ -45,12 +48,12 @@ public class TransferTest { @Test public void t10(){ - transferOutPluginInitializer.start("LETS-SH2024090400000005"); + transferOutPluginInitializer.start("LETS-SH2024092000000005"); } @Test public void t11(){ - transferOutPluginInitializer.start("2024-08-06","2024-08-11"); + transferOutPluginInitializer.start("2024-09-20","2024-09-20"); } @Test public void t12() throws Exception { @@ -78,11 +81,11 @@ public class TransferTest { @Test public void t31(){ // adjustInPluginInitializer.start("LETS-RE2024091100000001"); - adjustInPluginInitializer.start("LETS-RE2024091100000002"); + adjustInPluginInitializer.start("LETS-RE2024092000000012"); } @Test public void t32(){ - adjustInPluginInitializer.start("2024-08-14","2024-08-20"); + adjustInPluginInitializer.start("2024-09-20","2024-09-20"); } ////////////////////////////////////////////////////////////////////////////////////调整出库单 @@ -92,7 +95,7 @@ public class TransferTest { } @Test public void t41(){ - adjustOutPluginInitializer.start("LETS-SH2024090400000005"); + adjustOutPluginInitializer.start("LETS-SH2024092000000004"); } @Test public void t42(){ @@ -121,7 +124,15 @@ public class TransferTest { ////////////////////////////////////////////////////////////////////////////////////入库审核 @Test public void t70(){ - otherInPluginInitializer.start("TR2409130007"); + otherInPluginInitializer.start("TR2409200003"); } ////////////////////////////////////////////////////////////////////////////////////入库审核 + + ////////////////////////////////////////////////////////////////////////////////////仅退款 + @Test + public void t80(){ + refundOnlyPluginInitializer.start("LETS-RO2024012600005007"); + } + ////////////////////////////////////////////////////////////////////////////////////仅退款 + } diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchDetails.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchDetails.java index 04f8681f..31530862 100755 --- a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchDetails.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodordersearch/RerturnGoodsOrderSearchDetails.java @@ -1,9 +1,10 @@ +/** + * Copyright 2024 bejson.com + */ package com.hzya.frame.ttxofs.dto.returngoodordersearch; import lombok.Data; -import java.math.BigDecimal; - /** * Auto-generated: 2024-08-19 11:31:49 *