From 6374eb91a8834603a85a2d754011fd2784b169d0 Mon Sep 17 00:00:00 2001 From: liuy <37787198+LiuyCodes@users.noreply.github.com> Date: Fri, 9 Aug 2024 22:38:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4TOC=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lets/ofs/dao/ITocofsReturngoodsDao.java | 22 + .../dao/ITocofsReturngoodsDetailedDao.java | 22 + .../dao/impl/TocofsReturngoodsDaoImpl.java | 22 + .../TocofsReturngoodsDetailedDaoImpl.java | 22 + .../TocofsReturngoodsDetailedEntity.java | 445 ++++++++++++ .../TocofsReturngoodsDetailedEntity.xml | 526 ++++++++++++++ .../ofs/entity/TocofsReturngoodsEntity.java | 603 ++++++++++++++++ .../ofs/entity/TocofsReturngoodsEntity.xml | 670 ++++++++++++++++++ .../ITocofsReturngoodsDetailedService.java | 12 + .../service/ITocofsReturngoodsService.java | 12 + .../TocofsReturngoodsDetailedServiceImpl.java | 25 + .../impl/TocofsReturngoodsServiceImpl.java | 25 + .../sales/SoSaleOutPluginInitializerToC.java | 36 +- .../SoSaleReturnPluginInitializerToC.java | 386 +++++----- .../lets/u8cdto/GoodsRertunSonDetailsDto.java | 96 +++ ...va => TocOrderBasicArchivesCacheUtil.java} | 5 +- .../util/TocReturnBasicArchivesCacheUtil.java | 312 ++++++++ .../plugin/lets/spring/spring-sowow-dao.xml | 6 +- .../lets/spring/spring-sowow-service.xml | 3 + .../SoSaleReturnPluginInitializerToCTest.java | 2 - .../frame/ttxofs/basics/ApiDtoCacheMap.java | 5 +- .../returngoodsearch/RertunGoodsRootBean.java | 22 + .../ReturnGoodHeaderDetailsDataDto.java | 22 + .../ReturnGoodSearchDetailsDto.java | 46 ++ .../ReturnGoodSearchHeaderDto.java | 67 ++ 25 files changed, 3198 insertions(+), 216 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsDetailedService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsDetailedServiceImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsServiceImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GoodsRertunSonDetailsDto.java rename buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/{BasicArchivesCacheUtil.java => TocOrderBasicArchivesCacheUtil.java} (99%) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java create mode 100755 service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/RertunGoodsRootBean.java create mode 100755 service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodHeaderDetailsDataDto.java create mode 100755 service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchDetailsDto.java create mode 100755 service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchHeaderDto.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java new file mode 100644 index 00000000..6a9a65e4 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.lets.ofs.dao; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; + +/** + * OFS售后入库单(tocofs_returngoods: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-09 11:08:40 + */ +public interface ITocofsReturngoodsDao extends IBaseDao { + + /** + * 批量插入 + * + * @author liuyang + */ + void entityInsertBatchV2(List tocofsReturngoodsEntityList) throws Exception; +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java new file mode 100644 index 00000000..9275a893 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.lets.ofs.dao; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; + +import java.util.List; + +/** + * root(tocofs_returngoods_detailed: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-09 13:45:47 + */ +public interface ITocofsReturngoodsDetailedDao extends IBaseDao { + /** + * 批量插入 + * + * @author liuyang + */ + void entityInsertBatchV2(List tocofsReturngoodsEntityList) throws Exception; +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java new file mode 100644 index 00000000..c5829a8f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.lets.ofs.dao.impl; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; +import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + +/** + * OFS售后入库单(TocofsReturngoods)表数据库访问层 + * + * @author makejava + * @since 2024-08-09 11:08:40 + */ +public class TocofsReturngoodsDaoImpl extends MybatisGenericDao implements ITocofsReturngoodsDao { + + @Override + public void entityInsertBatchV2(List tocofsReturngoodsEntityList) throws Exception { + this.insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDaoImpl.entityInsertBatchV2", tocofsReturngoodsEntityList); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java new file mode 100644 index 00000000..e87fd8d9 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.lets.ofs.dao.impl; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity; +import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao; +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + +/** + * root(TocofsReturngoodsDetailed)表数据库访问层 + * + * @author makejava + * @since 2024-08-09 13:45:47 + */ +public class TocofsReturngoodsDetailedDaoImpl extends MybatisGenericDao implements ITocofsReturngoodsDetailedDao { + @Override + public void entityInsertBatchV2(List tocofsReturngoodsDetailedEntityList) throws Exception { + this.insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertBatchV2", tocofsReturngoodsDetailedEntityList); + } +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java new file mode 100644 index 00000000..04e4b418 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java @@ -0,0 +1,445 @@ +package com.hzya.frame.plugin.lets.ofs.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * root(TocofsReturngoodsDetailed)实体类 + * + * @author makejava + * @since 2024-08-09 13:45:47 + */ +public class TocofsReturngoodsDetailedEntity extends BaseEntity { + /** + * 81159 + */ + private String receiptId; + /** + * LETS-RE2024071600000001 + */ + private String receiptCode; + /** + * 128 + */ + private String refOrderId; + /** + * 299 + */ + private String refOrderDetailId; + /** + * LETS-SO2024070500000001 + */ + private String sourceOrderCode; + /** + * LETS + */ + private String clientCode; + /** + * SHLZ + */ + private String companyCode; + /** + * intoyou-tmxs + */ + private String facilityCode; + /** + * 6973391730617 + */ + private String skuCode; + /** + * INTOYOU心慕与你水感裸雾唇釉W01 + */ + private String skuName; + /** + * 2 + */ + private String requestQty; + /** + * 2 + */ + private String receivedQty; + /** + * 0 + */ + private String openQty; + /** + * EA + */ + private String quantityUM; + /** + * 0 + */ + private String totalWeight; + /** + * 0 + */ + private String totalVolume; + /** + * 0 + */ + private String totalVolumeWeight; + /** + * 118 + */ + private String totalAmount; + /** + * G + */ + private String weightUM; + /** + * CM3 + */ + private String volumeUM; + /** + * AVAILABLE + */ + private String inventorySts; + /** + * 30796 + */ + private String inTransInvId; + /** + * 0 + */ + private String closed; + /** + * 2024-07-16 15:35:36 + */ + private String created; + /** + * admin + */ + private String createdBy; + /** + * 2024-07-16 16:44:01 + */ + private String lastUpdated; + /** + * api + */ + private String lastUpdatedBy; + /** + * 59 + */ + private String discountPrice; + /** + * 报错内容 + */ + private String newTransmitinfo; + /** + * 推送时间 + */ + private String newPushdate; + /** + * 是否成功 + */ + private String newState; + /** + * 下游系统编码 + */ + private String newSystemNumber; + /** + * 下游系统主键 + */ + private String newSystemPrimary; + /** + * 主表主键 + */ + private String primaryKey; + /** + * 业务日期 + */ + private String businessDate; + /** + * 主表主键 + */ + private String returngoodsId; + + public String getReceiptId() { + return receiptId; + } + + public void setReceiptId(String receiptId) { + this.receiptId = receiptId; + } + + public String getReceiptCode() { + return receiptCode; + } + + public void setReceiptCode(String receiptCode) { + this.receiptCode = receiptCode; + } + + public String getRefOrderId() { + return refOrderId; + } + + public void setRefOrderId(String refOrderId) { + this.refOrderId = refOrderId; + } + + public String getRefOrderDetailId() { + return refOrderDetailId; + } + + public void setRefOrderDetailId(String refOrderDetailId) { + this.refOrderDetailId = refOrderDetailId; + } + + public String getSourceOrderCode() { + return sourceOrderCode; + } + + public void setSourceOrderCode(String sourceOrderCode) { + this.sourceOrderCode = sourceOrderCode; + } + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getFacilityCode() { + return facilityCode; + } + + public void setFacilityCode(String facilityCode) { + this.facilityCode = facilityCode; + } + + public String getSkuCode() { + return skuCode; + } + + public void setSkuCode(String skuCode) { + this.skuCode = skuCode; + } + + public String getSkuName() { + return skuName; + } + + public void setSkuName(String skuName) { + this.skuName = skuName; + } + + public String getRequestQty() { + return requestQty; + } + + public void setRequestQty(String requestQty) { + this.requestQty = requestQty; + } + + public String getReceivedQty() { + return receivedQty; + } + + public void setReceivedQty(String receivedQty) { + this.receivedQty = receivedQty; + } + + public String getOpenQty() { + return openQty; + } + + public void setOpenQty(String openQty) { + this.openQty = openQty; + } + + public String getQuantityUM() { + return quantityUM; + } + + public void setQuantityUM(String quantityUM) { + this.quantityUM = quantityUM; + } + + public String getTotalWeight() { + return totalWeight; + } + + public void setTotalWeight(String totalWeight) { + this.totalWeight = totalWeight; + } + + public String getTotalVolume() { + return totalVolume; + } + + public void setTotalVolume(String totalVolume) { + this.totalVolume = totalVolume; + } + + public String getTotalVolumeWeight() { + return totalVolumeWeight; + } + + public void setTotalVolumeWeight(String totalVolumeWeight) { + this.totalVolumeWeight = totalVolumeWeight; + } + + public String getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(String totalAmount) { + this.totalAmount = totalAmount; + } + + public String getWeightUM() { + return weightUM; + } + + public void setWeightUM(String weightUM) { + this.weightUM = weightUM; + } + + public String getVolumeUM() { + return volumeUM; + } + + public void setVolumeUM(String volumeUM) { + this.volumeUM = volumeUM; + } + + public String getInventorySts() { + return inventorySts; + } + + public void setInventorySts(String inventorySts) { + this.inventorySts = inventorySts; + } + + public String getInTransInvId() { + return inTransInvId; + } + + public void setInTransInvId(String inTransInvId) { + this.inTransInvId = inTransInvId; + } + + public String getClosed() { + return closed; + } + + public void setClosed(String closed) { + this.closed = closed; + } + + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getLastUpdated() { + return lastUpdated; + } + + public void setLastUpdated(String lastUpdated) { + this.lastUpdated = lastUpdated; + } + + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + public String getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(String discountPrice) { + this.discountPrice = discountPrice; + } + + public String getNewTransmitinfo() { + return newTransmitinfo; + } + + public void setNewTransmitinfo(String newTransmitinfo) { + this.newTransmitinfo = newTransmitinfo; + } + + public String getNewPushdate() { + return newPushdate; + } + + public void setNewPushdate(String newPushdate) { + this.newPushdate = newPushdate; + } + + public String getNewState() { + return newState; + } + + public void setNewState(String newState) { + this.newState = newState; + } + + public String getNewSystemNumber() { + return newSystemNumber; + } + + public void setNewSystemNumber(String newSystemNumber) { + this.newSystemNumber = newSystemNumber; + } + + public String getNewSystemPrimary() { + return newSystemPrimary; + } + + public void setNewSystemPrimary(String newSystemPrimary) { + this.newSystemPrimary = newSystemPrimary; + } + + public String getPrimaryKey() { + return primaryKey; + } + + public void setPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + } + + public String getBusinessDate() { + return businessDate; + } + + public void setBusinessDate(String businessDate) { + this.businessDate = businessDate; + } + + public String getReturngoodsId() { + return returngoodsId; + } + + public void setReturngoodsId(String returngoodsId) { + this.returngoodsId = returngoodsId; + } + +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml new file mode 100644 index 00000000..d9390e4a --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml @@ -0,0 +1,526 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,receipt_id + ,receipt_code + ,ref_order_id + ,ref_order_detail_id + ,source_order_code + ,client_code + ,company_code + ,facility_code + ,sku_code + ,sku_name + ,request_qty + ,received_qty + ,open_qty + ,quantity_u_m + ,total_weight + ,total_volume + ,total_volume_weight + ,total_amount + ,weight_u_m + ,volume_u_m + ,inventory_sts + ,in_trans_inv_id + ,closed + ,created + ,created_by + ,last_updated + ,last_updated_by + ,discount_price + ,new_transmitInfo + ,new_pushDate + ,new_state + ,new_system_number + ,new_system_primary + ,primary_key + ,business_date + ,returngoods_id + + + + + + + + + + + + + + + + insert into tocofs_returngoods_detailed( + + id , + receipt_id , + receipt_code , + ref_order_id , + ref_order_detail_id , + source_order_code , + client_code , + company_code , + facility_code , + sku_code , + sku_name , + request_qty , + received_qty , + open_qty , + quantity_u_m , + total_weight , + total_volume , + total_volume_weight , + total_amount , + weight_u_m , + volume_u_m , + inventory_sts , + in_trans_inv_id , + closed , + created , + created_by , + last_updated , + last_updated_by , + discount_price , + new_transmitInfo , + new_pushDate , + new_state , + new_system_number , + new_system_primary , + primary_key , + business_date , + returngoods_id , + sorts, + sts, + + )values( + + #{id} , + #{receiptId} , + #{receiptCode} , + #{refOrderId} , + #{refOrderDetailId} , + #{sourceOrderCode} , + #{clientCode} , + #{companyCode} , + #{facilityCode} , + #{skuCode} , + #{skuName} , + #{requestQty} , + #{receivedQty} , + #{openQty} , + #{quantityUM} , + #{totalWeight} , + #{totalVolume} , + #{totalVolumeWeight} , + #{totalAmount} , + #{weightUM} , + #{volumeUM} , + #{inventorySts} , + #{inTransInvId} , + #{closed} , + #{created} , + #{createdBy} , + #{lastUpdated} , + #{lastUpdatedBy} , + #{discountPrice} , + #{newTransmitinfo} , + #{newPushdate} , + #{newState} , + #{newSystemNumber} , + #{newSystemPrimary} , + #{primaryKey} , + #{businessDate} , + #{returngoodsId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods_detailed a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date, returngoods_id, sts) + values + + (#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.returngoodsId}, 'Y') + + + + + + insert IGNORE into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date, returngoods_id) + values + + (#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.returngoodsId}) + + + + + + insert into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date, returngoods_id) + values + + (#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.returngoodsId}) + + on duplicate key update + receipt_id = values(receipt_id), + receipt_code = values(receipt_code), + ref_order_id = values(ref_order_id), + ref_order_detail_id = values(ref_order_detail_id), + source_order_code = values(source_order_code), + client_code = values(client_code), + company_code = values(company_code), + facility_code = values(facility_code), + sku_code = values(sku_code), + sku_name = values(sku_name), + request_qty = values(request_qty), + received_qty = values(received_qty), + open_qty = values(open_qty), + quantity_u_m = values(quantity_u_m), + total_weight = values(total_weight), + total_volume = values(total_volume), + total_volume_weight = values(total_volume_weight), + total_amount = values(total_amount), + weight_u_m = values(weight_u_m), + volume_u_m = values(volume_u_m), + inventory_sts = values(inventory_sts), + in_trans_inv_id = values(in_trans_inv_id), + closed = values(closed), + created = values(created), + created_by = values(created_by), + last_updated = values(last_updated), + last_updated_by = values(last_updated_by), + discount_price = values(discount_price), + new_transmitInfo = values(new_transmitInfo), + new_pushDate = values(new_pushDate), + new_state = values(new_state), + new_system_number = values(new_system_number), + new_system_primary = values(new_system_primary), + primary_key = values(primary_key), + business_date = values(business_date), + returngoods_id = values(returngoods_id) + + +update tocofs_returngoods_detailed set + + receipt_id = #{receiptId}, + receipt_code = #{receiptCode}, + ref_order_id = #{refOrderId}, + ref_order_detail_id = #{refOrderDetailId}, + source_order_code = #{sourceOrderCode}, + client_code = #{clientCode}, + company_code = #{companyCode}, + facility_code = #{facilityCode}, + sku_code = #{skuCode}, + sku_name = #{skuName}, + request_qty = #{requestQty}, + received_qty = #{receivedQty}, + open_qty = #{openQty}, + quantity_u_m = #{quantityUM}, + total_weight = #{totalWeight}, + total_volume = #{totalVolume}, + total_volume_weight = #{totalVolumeWeight}, + total_amount = #{totalAmount}, + weight_u_m = #{weightUM}, + volume_u_m = #{volumeUM}, + inventory_sts = #{inventorySts}, + in_trans_inv_id = #{inTransInvId}, + closed = #{closed}, + created = #{created}, + created_by = #{createdBy}, + last_updated = #{lastUpdated}, + last_updated_by = #{lastUpdatedBy}, + discount_price = #{discountPrice}, + new_transmitInfo = #{newTransmitinfo}, + new_pushDate = #{newPushdate}, + new_state = #{newState}, + new_system_number = #{newSystemNumber}, + new_system_primary = #{newSystemPrimary}, + primary_key = #{primaryKey}, + business_date = #{businessDate}, + returngoods_id = #{returngoodsId}, + +where id = #{id} + + + +update tocofs_returngoods_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update tocofs_returngoods_detailed set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and receipt_id = #{receiptId} + and receipt_code = #{receiptCode} + and ref_order_id = #{refOrderId} + and ref_order_detail_id = #{refOrderDetailId} + and source_order_code = #{sourceOrderCode} + and client_code = #{clientCode} + and company_code = #{companyCode} + and facility_code = #{facilityCode} + and sku_code = #{skuCode} + and sku_name = #{skuName} + and request_qty = #{requestQty} + and received_qty = #{receivedQty} + and open_qty = #{openQty} + and quantity_u_m = #{quantityUM} + and total_weight = #{totalWeight} + and total_volume = #{totalVolume} + and total_volume_weight = #{totalVolumeWeight} + and total_amount = #{totalAmount} + and weight_u_m = #{weightUM} + and volume_u_m = #{volumeUM} + and inventory_sts = #{inventorySts} + and in_trans_inv_id = #{inTransInvId} + and closed = #{closed} + and created = #{created} + and created_by = #{createdBy} + and last_updated = #{lastUpdated} + and last_updated_by = #{lastUpdatedBy} + and discount_price = #{discountPrice} + and new_transmitInfo = #{newTransmitinfo} + and new_pushDate = #{newPushdate} + and new_state = #{newState} + and new_system_number = #{newSystemNumber} + and new_system_primary = #{newSystemPrimary} + and primary_key = #{primaryKey} + and business_date = #{businessDate} + and returngoods_id = #{returngoodsId} + and sts='Y' + + + + + delete from tocofs_returngoods_detailed where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java new file mode 100644 index 00000000..3931856f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java @@ -0,0 +1,603 @@ +package com.hzya.frame.plugin.lets.ofs.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * OFS售后入库单(TocofsReturngoods)实体类 + * + * @author makejava + * @since 2024-08-09 11:08:40 + */ +public class TocofsReturngoodsEntity extends BaseEntity { + /** + * LETS + */ + private String clientCode; + /** + * SHLZ + */ + private String companyCode; + /** + * tm-intoyou + */ + private String storeCode; + /** + * intoyou-tmxs + */ + private String facilityCode; + /** + * LETS-RE2024071600000001 + */ + private String code; + /** + * RETURN + */ + private String internalInstructionType; + /** + * B2C + */ + private String bizChannel; + /** + * 128 + */ + private String refOrderId; + /** + * LETS-RO2024071600000001 + */ + private String refOrderCode; + /** + * RETURN + */ + private String refOrderType; + /** + * 1 + */ + private String closed; + /** + * api + */ + private String closedBy; + /** + * 900 + */ + private String status; + /** + * 0 + */ + private String allowOverReceive; + /** + * 张三 + */ + private String shipFromAttentionTo; + /** + * 测试售后流程 + */ + private String shipFromAddress; + /** + * 中国 + */ + private String shipFromCountry; + /** + * 上海市 + */ + private String shipFromState; + /** + * 上海市 + */ + private String shipFromCity; + /** + * 金山区 + */ + private String shipFromDistrict; + /** + * 17878787878 + */ + private String shipFromMobile; + /** + * 2 + */ + private String totalLines; + /** + * 4 + */ + private String totalQty; + /** + * 236 + */ + private String totalAmount; + /** + * 0 + */ + private String totalWeight; + /** + * 0 + */ + private String totalVolume; + /** + * 0 + */ + private String totalVolumeWeight; + /** + * 236 + */ + private String totalFulfillAmount; + /** + * 0 + */ + private String totalFulfillWeight; + /** + * 0 + */ + private String totalFulfillVolume; + /** + * 0 + */ + private String totalFulfillVolumeWeight; + /** + * 4 + */ + private String totalFulfillQty; + /** + * 0 + */ + private String totalCases; + /** + * 0 + */ + private String totalContainers; + /** + * 0 + */ + private String closeAtQty; + /** + * EA + */ + private String quantityUM; + /** + * G + */ + private String weightUM; + /** + * CM3 + */ + private String volumeUM; + /** + * 2024-07-16 16:44:00 + */ + private String checkInFrom; + /** + * 2024-07-16 16:44:01 + */ + private String checkInTo; + /** + * 2024-07-16 16:44:01 + */ + private String closedAt; + /** + * OFS + */ + private String sourcePlatformCode; + /** + * LETS-SO2024070500000001 + */ + private String sourceOrderCode; + /** + * 2024-07-16 15:35:36 + */ + private String created; + /** + * admin + */ + private String createdBy; + /** + * 2024-07-16 16:44:01 + */ + private String lastUpdated; + /** + * api + */ + private String lastUpdatedBy; + /** + * YT7478903028607 + */ + private String returnWaybillCode; + /** + * YTO + */ + private String returnCarrier; + + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getStoreCode() { + return storeCode; + } + + public void setStoreCode(String storeCode) { + this.storeCode = storeCode; + } + + public String getFacilityCode() { + return facilityCode; + } + + public void setFacilityCode(String facilityCode) { + this.facilityCode = facilityCode; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getInternalInstructionType() { + return internalInstructionType; + } + + public void setInternalInstructionType(String internalInstructionType) { + this.internalInstructionType = internalInstructionType; + } + + public String getBizChannel() { + return bizChannel; + } + + public void setBizChannel(String bizChannel) { + this.bizChannel = bizChannel; + } + + public String getRefOrderId() { + return refOrderId; + } + + public void setRefOrderId(String refOrderId) { + this.refOrderId = refOrderId; + } + + public String getRefOrderCode() { + return refOrderCode; + } + + public void setRefOrderCode(String refOrderCode) { + this.refOrderCode = refOrderCode; + } + + public String getRefOrderType() { + return refOrderType; + } + + public void setRefOrderType(String refOrderType) { + this.refOrderType = refOrderType; + } + + public String getClosed() { + return closed; + } + + public void setClosed(String closed) { + this.closed = closed; + } + + public String getClosedBy() { + return closedBy; + } + + public void setClosedBy(String closedBy) { + this.closedBy = closedBy; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getAllowOverReceive() { + return allowOverReceive; + } + + public void setAllowOverReceive(String allowOverReceive) { + this.allowOverReceive = allowOverReceive; + } + + public String getShipFromAttentionTo() { + return shipFromAttentionTo; + } + + public void setShipFromAttentionTo(String shipFromAttentionTo) { + this.shipFromAttentionTo = shipFromAttentionTo; + } + + public String getShipFromAddress() { + return shipFromAddress; + } + + public void setShipFromAddress(String shipFromAddress) { + this.shipFromAddress = shipFromAddress; + } + + public String getShipFromCountry() { + return shipFromCountry; + } + + public void setShipFromCountry(String shipFromCountry) { + this.shipFromCountry = shipFromCountry; + } + + public String getShipFromState() { + return shipFromState; + } + + public void setShipFromState(String shipFromState) { + this.shipFromState = shipFromState; + } + + public String getShipFromCity() { + return shipFromCity; + } + + public void setShipFromCity(String shipFromCity) { + this.shipFromCity = shipFromCity; + } + + public String getShipFromDistrict() { + return shipFromDistrict; + } + + public void setShipFromDistrict(String shipFromDistrict) { + this.shipFromDistrict = shipFromDistrict; + } + + public String getShipFromMobile() { + return shipFromMobile; + } + + public void setShipFromMobile(String shipFromMobile) { + this.shipFromMobile = shipFromMobile; + } + + public String getTotalLines() { + return totalLines; + } + + public void setTotalLines(String totalLines) { + this.totalLines = totalLines; + } + + public String getTotalQty() { + return totalQty; + } + + public void setTotalQty(String totalQty) { + this.totalQty = totalQty; + } + + public String getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(String totalAmount) { + this.totalAmount = totalAmount; + } + + public String getTotalWeight() { + return totalWeight; + } + + public void setTotalWeight(String totalWeight) { + this.totalWeight = totalWeight; + } + + public String getTotalVolume() { + return totalVolume; + } + + public void setTotalVolume(String totalVolume) { + this.totalVolume = totalVolume; + } + + public String getTotalVolumeWeight() { + return totalVolumeWeight; + } + + public void setTotalVolumeWeight(String totalVolumeWeight) { + this.totalVolumeWeight = totalVolumeWeight; + } + + public String getTotalFulfillAmount() { + return totalFulfillAmount; + } + + public void setTotalFulfillAmount(String totalFulfillAmount) { + this.totalFulfillAmount = totalFulfillAmount; + } + + public String getTotalFulfillWeight() { + return totalFulfillWeight; + } + + public void setTotalFulfillWeight(String totalFulfillWeight) { + this.totalFulfillWeight = totalFulfillWeight; + } + + public String getTotalFulfillVolume() { + return totalFulfillVolume; + } + + public void setTotalFulfillVolume(String totalFulfillVolume) { + this.totalFulfillVolume = totalFulfillVolume; + } + + public String getTotalFulfillVolumeWeight() { + return totalFulfillVolumeWeight; + } + + public void setTotalFulfillVolumeWeight(String totalFulfillVolumeWeight) { + this.totalFulfillVolumeWeight = totalFulfillVolumeWeight; + } + + public String getTotalFulfillQty() { + return totalFulfillQty; + } + + public void setTotalFulfillQty(String totalFulfillQty) { + this.totalFulfillQty = totalFulfillQty; + } + + public String getTotalCases() { + return totalCases; + } + + public void setTotalCases(String totalCases) { + this.totalCases = totalCases; + } + + public String getTotalContainers() { + return totalContainers; + } + + public void setTotalContainers(String totalContainers) { + this.totalContainers = totalContainers; + } + + public String getCloseAtQty() { + return closeAtQty; + } + + public void setCloseAtQty(String closeAtQty) { + this.closeAtQty = closeAtQty; + } + + public String getQuantityUM() { + return quantityUM; + } + + public void setQuantityUM(String quantityUM) { + this.quantityUM = quantityUM; + } + + public String getWeightUM() { + return weightUM; + } + + public void setWeightUM(String weightUM) { + this.weightUM = weightUM; + } + + public String getVolumeUM() { + return volumeUM; + } + + public void setVolumeUM(String volumeUM) { + this.volumeUM = volumeUM; + } + + public String getCheckInFrom() { + return checkInFrom; + } + + public void setCheckInFrom(String checkInFrom) { + this.checkInFrom = checkInFrom; + } + + public String getCheckInTo() { + return checkInTo; + } + + public void setCheckInTo(String checkInTo) { + this.checkInTo = checkInTo; + } + + public String getClosedAt() { + return closedAt; + } + + public void setClosedAt(String closedAt) { + this.closedAt = closedAt; + } + + public String getSourcePlatformCode() { + return sourcePlatformCode; + } + + public void setSourcePlatformCode(String sourcePlatformCode) { + this.sourcePlatformCode = sourcePlatformCode; + } + + public String getSourceOrderCode() { + return sourceOrderCode; + } + + public void setSourceOrderCode(String sourceOrderCode) { + this.sourceOrderCode = sourceOrderCode; + } + + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getLastUpdated() { + return lastUpdated; + } + + public void setLastUpdated(String lastUpdated) { + this.lastUpdated = lastUpdated; + } + + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + public String getReturnWaybillCode() { + return returnWaybillCode; + } + + public void setReturnWaybillCode(String returnWaybillCode) { + this.returnWaybillCode = returnWaybillCode; + } + + public String getReturnCarrier() { + return returnCarrier; + } + + public void setReturnCarrier(String returnCarrier) { + this.returnCarrier = returnCarrier; + } + +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml new file mode 100644 index 00000000..fdb6a6af --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml @@ -0,0 +1,670 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,client_code + ,company_code + ,store_code + ,facility_code + ,code + ,internal_instruction_type + ,biz_channel + ,ref_order_id + ,ref_order_code + ,ref_order_type + ,closed + ,closed_by + ,status + ,allow_over_receive + ,ship_from_attention_to + ,ship_from_address + ,ship_from_country + ,ship_from_state + ,ship_from_city + ,ship_from_district + ,ship_from_mobile + ,total_lines + ,total_qty + ,total_amount + ,total_weight + ,total_volume + ,total_volume_weight + ,total_fulfill_amount + ,total_fulfill_weight + ,total_fulfill_volume + ,total_fulfill_volume_weight + ,total_fulfill_qty + ,total_cases + ,total_containers + ,close_at_qty + ,quantity_u_m + ,weight_u_m + ,volume_u_m + ,check_in_from + ,check_in_to + ,closed_at + ,source_platform_code + ,source_order_code + ,created + ,created_by + ,last_updated + ,last_updated_by + ,return_waybill_code + ,return_carrier + + + + + + + + + + + + + + + + insert into tocofs_returngoods( + + id , + client_code , + company_code , + store_code , + facility_code , + code , + internal_instruction_type , + biz_channel , + ref_order_id , + ref_order_code , + ref_order_type , + closed , + closed_by , + status , + allow_over_receive , + ship_from_attention_to , + ship_from_address , + ship_from_country , + ship_from_state , + ship_from_city , + ship_from_district , + ship_from_mobile , + total_lines , + total_qty , + total_amount , + total_weight , + total_volume , + total_volume_weight , + total_fulfill_amount , + total_fulfill_weight , + total_fulfill_volume , + total_fulfill_volume_weight , + total_fulfill_qty , + total_cases , + total_containers , + close_at_qty , + quantity_u_m , + weight_u_m , + volume_u_m , + check_in_from , + check_in_to , + closed_at , + source_platform_code , + source_order_code , + created , + created_by , + last_updated , + last_updated_by , + return_waybill_code , + return_carrier , + sorts, + sts, + + )values( + + #{id} , + #{clientCode} , + #{companyCode} , + #{storeCode} , + #{facilityCode} , + #{code} , + #{internalInstructionType} , + #{bizChannel} , + #{refOrderId} , + #{refOrderCode} , + #{refOrderType} , + #{closed} , + #{closedBy} , + #{status} , + #{allowOverReceive} , + #{shipFromAttentionTo} , + #{shipFromAddress} , + #{shipFromCountry} , + #{shipFromState} , + #{shipFromCity} , + #{shipFromDistrict} , + #{shipFromMobile} , + #{totalLines} , + #{totalQty} , + #{totalAmount} , + #{totalWeight} , + #{totalVolume} , + #{totalVolumeWeight} , + #{totalFulfillAmount} , + #{totalFulfillWeight} , + #{totalFulfillVolume} , + #{totalFulfillVolumeWeight} , + #{totalFulfillQty} , + #{totalCases} , + #{totalContainers} , + #{closeAtQty} , + #{quantityUM} , + #{weightUM} , + #{volumeUM} , + #{checkInFrom} , + #{checkInTo} , + #{closedAt} , + #{sourcePlatformCode} , + #{sourceOrderCode} , + #{created} , + #{createdBy} , + #{lastUpdated} , + #{lastUpdatedBy} , + #{returnWaybillCode} , + #{returnCarrier} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + + insert into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier, sts) + values + + (#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier}, 'Y') + + + + + + insert IGNORE into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier,id) + values + + (#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier},#{entity.id}) + + + + + + insert into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier) + values + + (#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier}) + + on duplicate key update + client_code = values(client_code), + company_code = values(company_code), + store_code = values(store_code), + facility_code = values(facility_code), + code = values(code), + internal_instruction_type = values(internal_instruction_type), + biz_channel = values(biz_channel), + ref_order_id = values(ref_order_id), + ref_order_code = values(ref_order_code), + ref_order_type = values(ref_order_type), + closed = values(closed), + closed_by = values(closed_by), + status = values(status), + allow_over_receive = values(allow_over_receive), + ship_from_attention_to = values(ship_from_attention_to), + ship_from_address = values(ship_from_address), + ship_from_country = values(ship_from_country), + ship_from_state = values(ship_from_state), + ship_from_city = values(ship_from_city), + ship_from_district = values(ship_from_district), + ship_from_mobile = values(ship_from_mobile), + total_lines = values(total_lines), + total_qty = values(total_qty), + total_amount = values(total_amount), + total_weight = values(total_weight), + total_volume = values(total_volume), + total_volume_weight = values(total_volume_weight), + total_fulfill_amount = values(total_fulfill_amount), + total_fulfill_weight = values(total_fulfill_weight), + total_fulfill_volume = values(total_fulfill_volume), + total_fulfill_volume_weight = values(total_fulfill_volume_weight), + total_fulfill_qty = values(total_fulfill_qty), + total_cases = values(total_cases), + total_containers = values(total_containers), + close_at_qty = values(close_at_qty), + quantity_u_m = values(quantity_u_m), + weight_u_m = values(weight_u_m), + volume_u_m = values(volume_u_m), + check_in_from = values(check_in_from), + check_in_to = values(check_in_to), + closed_at = values(closed_at), + source_platform_code = values(source_platform_code), + source_order_code = values(source_order_code), + created = values(created), + created_by = values(created_by), + last_updated = values(last_updated), + last_updated_by = values(last_updated_by), + return_waybill_code = values(return_waybill_code), + return_carrier = values(return_carrier) + + +update tocofs_returngoods set + + client_code = #{clientCode}, + company_code = #{companyCode}, + store_code = #{storeCode}, + facility_code = #{facilityCode}, + code = #{code}, + internal_instruction_type = #{internalInstructionType}, + biz_channel = #{bizChannel}, + ref_order_id = #{refOrderId}, + ref_order_code = #{refOrderCode}, + ref_order_type = #{refOrderType}, + closed = #{closed}, + closed_by = #{closedBy}, + status = #{status}, + allow_over_receive = #{allowOverReceive}, + ship_from_attention_to = #{shipFromAttentionTo}, + ship_from_address = #{shipFromAddress}, + ship_from_country = #{shipFromCountry}, + ship_from_state = #{shipFromState}, + ship_from_city = #{shipFromCity}, + ship_from_district = #{shipFromDistrict}, + ship_from_mobile = #{shipFromMobile}, + total_lines = #{totalLines}, + total_qty = #{totalQty}, + total_amount = #{totalAmount}, + total_weight = #{totalWeight}, + total_volume = #{totalVolume}, + total_volume_weight = #{totalVolumeWeight}, + total_fulfill_amount = #{totalFulfillAmount}, + total_fulfill_weight = #{totalFulfillWeight}, + total_fulfill_volume = #{totalFulfillVolume}, + total_fulfill_volume_weight = #{totalFulfillVolumeWeight}, + total_fulfill_qty = #{totalFulfillQty}, + total_cases = #{totalCases}, + total_containers = #{totalContainers}, + close_at_qty = #{closeAtQty}, + quantity_u_m = #{quantityUM}, + weight_u_m = #{weightUM}, + volume_u_m = #{volumeUM}, + check_in_from = #{checkInFrom}, + check_in_to = #{checkInTo}, + closed_at = #{closedAt}, + source_platform_code = #{sourcePlatformCode}, + source_order_code = #{sourceOrderCode}, + created = #{created}, + created_by = #{createdBy}, + last_updated = #{lastUpdated}, + last_updated_by = #{lastUpdatedBy}, + return_waybill_code = #{returnWaybillCode}, + return_carrier = #{returnCarrier}, + +where id = #{id} + + + +update tocofs_returngoods set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update tocofs_returngoods set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and client_code = #{clientCode} + and company_code = #{companyCode} + and store_code = #{storeCode} + and facility_code = #{facilityCode} + and code = #{code} + and internal_instruction_type = #{internalInstructionType} + and biz_channel = #{bizChannel} + and ref_order_id = #{refOrderId} + and ref_order_code = #{refOrderCode} + and ref_order_type = #{refOrderType} + and closed = #{closed} + and closed_by = #{closedBy} + and status = #{status} + and allow_over_receive = #{allowOverReceive} + and ship_from_attention_to = #{shipFromAttentionTo} + and ship_from_address = #{shipFromAddress} + and ship_from_country = #{shipFromCountry} + and ship_from_state = #{shipFromState} + and ship_from_city = #{shipFromCity} + and ship_from_district = #{shipFromDistrict} + and ship_from_mobile = #{shipFromMobile} + and total_lines = #{totalLines} + and total_qty = #{totalQty} + and total_amount = #{totalAmount} + and total_weight = #{totalWeight} + and total_volume = #{totalVolume} + and total_volume_weight = #{totalVolumeWeight} + and total_fulfill_amount = #{totalFulfillAmount} + and total_fulfill_weight = #{totalFulfillWeight} + and total_fulfill_volume = #{totalFulfillVolume} + and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} + and total_fulfill_qty = #{totalFulfillQty} + and total_cases = #{totalCases} + and total_containers = #{totalContainers} + and close_at_qty = #{closeAtQty} + and quantity_u_m = #{quantityUM} + and weight_u_m = #{weightUM} + and volume_u_m = #{volumeUM} + and check_in_from = #{checkInFrom} + and check_in_to = #{checkInTo} + and closed_at = #{closedAt} + and source_platform_code = #{sourcePlatformCode} + and source_order_code = #{sourceOrderCode} + and created = #{created} + and created_by = #{createdBy} + and last_updated = #{lastUpdated} + and last_updated_by = #{lastUpdatedBy} + and return_waybill_code = #{returnWaybillCode} + and return_carrier = #{returnCarrier} + and sts='Y' + + + + + delete from tocofs_returngoods where id = #{id} + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsDetailedService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsDetailedService.java new file mode 100644 index 00000000..f7940941 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsDetailedService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.lets.ofs.service; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * root(TocofsReturngoodsDetailed)表服务接口 + * + * @author makejava + * @since 2024-08-09 13:45:47 + */ +public interface ITocofsReturngoodsDetailedService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsService.java new file mode 100644 index 00000000..db653b98 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/ITocofsReturngoodsService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.lets.ofs.service; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * OFS售后入库单(TocofsReturngoods)表服务接口 + * + * @author makejava + * @since 2024-08-09 11:08:40 + */ +public interface ITocofsReturngoodsService extends IBaseService{ +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsDetailedServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsDetailedServiceImpl.java new file mode 100644 index 00000000..ab264fc4 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsDetailedServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.lets.ofs.service.impl; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity; +import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao; +import com.hzya.frame.plugin.lets.ofs.service.ITocofsReturngoodsDetailedService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * root(TocofsReturngoodsDetailed)表服务实现类 + * + * @author makejava + * @since 2024-08-09 13:45:47 + */ +public class TocofsReturngoodsDetailedServiceImpl extends BaseService implements ITocofsReturngoodsDetailedService { + + private ITocofsReturngoodsDetailedDao tocofsReturngoodsDetailedDao; + + @Autowired + public void setTocofsReturngoodsDetailedDao(ITocofsReturngoodsDetailedDao dao) { + this.tocofsReturngoodsDetailedDao = dao; + this.dao = dao; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsServiceImpl.java new file mode 100644 index 00000000..e5c16c46 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/service/impl/TocofsReturngoodsServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.lets.ofs.service.impl; + +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; +import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao; +import com.hzya.frame.plugin.lets.ofs.service.ITocofsReturngoodsService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * OFS售后入库单(TocofsReturngoods)表服务实现类 + * + * @author makejava + * @since 2024-08-09 11:08:40 + */ +public class TocofsReturngoodsServiceImpl extends BaseService implements ITocofsReturngoodsService { + + private ITocofsReturngoodsDao tocofsReturngoodsDao; + + @Autowired + public void setTocofsReturngoodsDao(ITocofsReturngoodsDao dao) { + this.tocofsReturngoodsDao = dao; + this.dao = dao; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java index 6a75fadd..062fd300 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java @@ -18,7 +18,7 @@ import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.u8cdto.*; -import com.hzya.frame.plugin.lets.util.BasicArchivesCacheUtil; +import com.hzya.frame.plugin.lets.util.TocOrderBasicArchivesCacheUtil; import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import com.hzya.frame.split.SplitListByCountUtil; @@ -89,7 +89,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { private OfsUnifiedService ofsUnifiedService; @Autowired - private BasicArchivesCacheUtil basicArchivesCacheUtil; + private TocOrderBasicArchivesCacheUtil basicArchivesCacheUtil; @Autowired private ITocofsSaleoutService iTocofsSaleoutService; @@ -205,7 +205,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { List headerDtoList = ofssaleorderoutsearchList.get(i); List tocofsSaleoutEntityList = copyHeaderDto(headerDtoList); if (tocofsSaleoutEntityList.size() > 0) { + logger.info("tocofsSaleoutDetailedEntities:插入底表{}个对象(表头)", tocofsSaleoutEntityList.size()); iTocofsSaleoutDao.entityInsertBatchV2(tocofsSaleoutEntityList); + } else { + logger.info("tocofsSaleoutEntityList:没有对象被插入表头底表"); } } @@ -215,7 +218,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { List detailsDtos = detailsDtoList.get(i); List tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos); if (tocofsSaleoutDetailedEntities.size() > 0) { + logger.info("tocofsSaleoutDetailedEntities:插入底表{}个对象(表体)", tocofsSaleoutDetailedEntities.size()); iTocofsSaleoutDetailedDao.entityInsertBatchV2(tocofsSaleoutDetailedEntities); + } else { + logger.info("tocofsSaleoutDetailedEntities:没有对象被插入表头底表"); } } } @@ -398,8 +404,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { saleorderRequestChildrenDto.setNnumber(String.valueOf(sonDetailsDto.getGroupShipQty()));//数量 saleorderRequestChildrenDto.setNoriginalcurdiscountmny("0");//折扣额 saleorderRequestChildrenDto.setNoriginalcurmny(noriginalcurmny.stripTrailingZeros().toPlainString());//无税金额 - saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价 - saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价 +// saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价 +// saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价 saleorderRequestChildrenDto.setNoriginalcursummny(noriginalcursummny.stripTrailingZeros().toPlainString());//价税合计 saleorderRequestChildrenDto.setNoriginalcurtaxmny(noriginalcurtaxmny.stripTrailingZeros().toPlainString());//税额 saleorderRequestChildrenDto.setNoriginalcurtaxnetprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税净价 @@ -480,11 +486,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //表头公司:通过名称匹配U8C公司 String corpName = "上海丽知品牌管理有限公司"; - BdCorpEntity bdCorpEntity = BasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName); + BdCorpEntity bdCorpEntity = TocOrderBasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName); Assert.notNull(bdCorpEntity, "根据公司名称({})没有匹配到U8C公司档案", corpName); //发货库存组织 - BdCalbodyEntity bdCalbodyEntity = BasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp()); + BdCalbodyEntity bdCalbodyEntity = TocOrderBasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp()); Assert.notNull(bdCalbodyEntity, "根据公司主键没有查询到发货库存组织 公司主键:{}", bdCorpEntity.getPkCorp()); //发货公司,暂时把O表头公司作为发货公司,正常情况下需要把O库存地点对于的公司作为发货公司 @@ -493,7 +499,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //2024年8月5日 15:06:38 仓库O与U两边仓库编码是一致的,和妮姐确认过了 String facilityCode = header.getFacilityCode(); Assert.notNull(facilityCode, "O仓库编码不能为空"); - BdStordocEntity bdStordocEntity = BasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody()); + BdStordocEntity bdStordocEntity = TocOrderBasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody()); Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码:{}", facilityCode, bdCalbodyEntity.getPkCalbody()); //2024年8月5日 15:25:07 收货库存组织、收货仓库、默认和发货库存组织、发货仓库一致,已经和佳妮确认 @@ -501,27 +507,27 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //收货仓库:通过收货库存组织+仓库编码,确定收货仓库 //销售组织2024年8月5日 15:33:40 和妮姐确认,销售组织和表头公司,作为一对一的关系, - BdSalestruEntity bdSalestruEntity = BasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname()); + BdSalestruEntity bdSalestruEntity = TocOrderBasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname()); Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname()); //业务部门:暂定的部门名称:其他,2024年8月5日 15:39:42 已经和妮姐确认 - BdDeptdocEntity bdDeptdocEntity = BasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp()); + BdDeptdocEntity bdDeptdocEntity = TocOrderBasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp()); Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp()); //客商基本档案 //TODO 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1,O没有店铺信息查询接口,因此无法通过出库单的店铺编码,查询到O店铺档案对应的业务编码,接口上线之后需要补充这一部分逻辑 String custName = "天猫intoyou旗舰店-自营"; - BdCubasdocEntity bdCubasdocEntity = BasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName); + BdCubasdocEntity bdCubasdocEntity = TocOrderBasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName); Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", custName); //客商管理档案:2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案,已经和妮姐确认 //2024年8月5日 15:49:49 先根据O店铺编码,得到店铺档案信息,取到名称,通过U8C接口查询出来 //目前O店铺信息查询接口还没有,等待开发,所以我这里先写所一个名字 - BdCumandocEntity bdCumandocEntity = BasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp()); + BdCumandocEntity bdCumandocEntity = TocOrderBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp()); Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营"); //查找平台 - BdDefdocEntity bdDefdocEntity = BasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode()); + BdDefdocEntity bdDefdocEntity = TocOrderBasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode()); Assert.notNull(bdDefdocEntity, "根据O平台编码({})无法匹配到平台", header.getSourcePlatformCode()); //字段拷贝 @@ -707,7 +713,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { Assert.notNull(sonDetailsDto.getSkuCode(), "O存货商家编码不能为空"); Assert.notNull(pkCorp, "发货公司主键不能为空"); - BdInvmandocEntity bdInvmandocEntity = BasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(sonDetailsDto.getSkuCode() + pkCorp); + BdInvmandocEntity bdInvmandocEntity = TocOrderBasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(sonDetailsDto.getSkuCode() + pkCorp); Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 存货商家编码:{} 存货发货公司:{}", sonDetailsDto.getSkuCode(), pkCorp); return bdInvmandocEntity; } @@ -755,7 +761,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { private BdInvbasdocEntity queryStockBasicArchives(String pkInvmandoc, String pkCorp) { Assert.notNull(pkInvmandoc, "存货管理档案不能为空"); Assert.notNull(pkCorp, "公司档案不能为空"); - BdInvbasdocEntity bdInvbasdocEntity = BasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp); + BdInvbasdocEntity bdInvbasdocEntity = TocOrderBasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp); Assert.notNull(bdInvbasdocEntity, "根据公司主键:{} 和存货管理档案主键:{} 没有查询到存货基本档案", pkCorp, pkInvmandoc); return bdInvbasdocEntity; } @@ -768,7 +774,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { */ private BdTaxitemsEntity queryBdTaxitems(String invcode) { Assert.notNull(invcode, "存货编码不能为空"); - BdTaxitemsEntity bdTaxitemsEntity = BasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode); + BdTaxitemsEntity bdTaxitemsEntity = TocOrderBasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode); Assert.notNull(bdTaxitemsEntity, "根据存货编码({}),无法匹配到税率!", invcode); return bdTaxitemsEntity; } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java index 93f40939..32b4376b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java @@ -10,23 +10,22 @@ import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.beanutil.BeanUtil; import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; import com.hzya.frame.plugin.lets.entity.*; -import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDao; -import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao; -import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity; -import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutEntity; -import com.hzya.frame.plugin.lets.ofs.service.ITocofsSaleoutService; +import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDao; +import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao; +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity; +import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo; import com.hzya.frame.plugin.lets.u8cdto.*; -import com.hzya.frame.plugin.lets.util.BasicArchivesCacheUtil; +import com.hzya.frame.plugin.lets.util.TocReturnBasicArchivesCacheUtil; import com.hzya.frame.plugin.lets.util.DateStrUtil; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import com.hzya.frame.split.SplitListByCountUtil; import com.hzya.frame.ttxofs.dto.InterfaceParamDto; -import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.DetailsDto; -import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto; -import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto; -import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; +import com.hzya.frame.ttxofs.dto.returngoodsearch.RertunGoodsRootBean; +import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodHeaderDetailsDataDto; +import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto; +import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto; import com.hzya.frame.ttxofs.service.OfsUnifiedService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -88,18 +87,6 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { @Autowired private OfsUnifiedService ofsUnifiedService; - @Autowired - private BasicArchivesCacheUtil basicArchivesCacheUtil; - - @Autowired - private ITocofsSaleoutService iTocofsSaleoutService; - - @Autowired - private ITocofsSaleoutDao iTocofsSaleoutDao; - - @Autowired - private ITocofsSaleoutDetailedDao iTocofsSaleoutDetailedDao; - @Autowired private QueryBdBusitypeUtil queryBdBusitypeUtil; @@ -107,6 +94,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { private static final String ADD = "+"; + @Autowired + private ITocofsReturngoodsDao iTocofsReturngoodsDao; + + @Autowired + private ITocofsReturngoodsDetailedDao iTocofsReturngoodsDetailedDao; + + @Autowired + private TocReturnBasicArchivesCacheUtil tocReturnBasicArchivesCacheUtil; + /** * 按指定时间拉取 * @@ -124,7 +120,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { // TODO 注意过滤TOC店铺 CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); - List headerDetailsDtoList = new ArrayList<>(); + List returnGoodHeaderDetailsDataDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); queryOfsSoSaleOutVo.setCreated_start("2024-07-16 15:35:35"); queryOfsSoSaleOutVo.setCreated_end("2024-07-16 15:35:37"); @@ -135,15 +132,15 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001"); - queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L); - logger.info("数据返回行数:{}", headerDetailsDtoList.size()); - if (headerDetailsDtoList.size() > 0) { + queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L); + logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size()); + if (returnGoodHeaderDetailsDataDtoList.size() > 0) { //保存到mysql - batchInsert(headerDetailsDtoList); + batchInsert(returnGoodHeaderDetailsDataDtoList); //过滤成功的数据 - List headerDetailsDtos = filterData(headerDetailsDtoList); + List returnGoodHeaderDetailsDataDtoList1 = filterData(returnGoodHeaderDetailsDataDtoList); //执行推送主逻辑 - implement(headerDetailsDtos); + implement(returnGoodHeaderDetailsDataDtoList1); } else { logger.info("没有查询到任何数据!不需要同步"); } @@ -151,7 +148,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { logger.error("startImplement方法抛出异常", e); } finally { try { - basicArchivesCacheUtil.clearCache(); + tocReturnBasicArchivesCacheUtil.clearCache(); } catch (Exception e) { logger.info("清理档案缓存失败", e); } @@ -172,11 +169,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * * @author liuyang */ - private List filterData(List headerDetailsDtoList) { - List headerDetailsDtoList1 = new ArrayList<>(); - if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) { + private List filterData(List returnGoodHeaderDetailsDataDtoList) { + List headerDetailsDtoList1 = new ArrayList<>(); + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { //TODO 出库单明细主键,需要O返回,目前没有,已经提需求 - headerDetailsDtoList1.addAll(headerDetailsDtoList); + headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoList); } return headerDetailsDtoList1; } @@ -184,51 +181,56 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { /** * 保存抓取到的数据到mysql底表,如果底表里已经存在,则会忽略 * - * @param headerDetailsDtoList 数据行 + * @param returnGoodHeaderDetailsDataDtoList 数据行 */ - private void batchInsert(List headerDetailsDtoList) throws Exception { - if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) { - List headerDetailsDtoList1 = new ArrayList<>(); - List headerDetailsDtoList2 = new ArrayList<>(); - - for (HeaderDetailsDto index : headerDetailsDtoList) { - HeaderDto header = index.getHeader();// 主表 - List details = index.getDetails();//明细表 + private void batchInsert(List returnGoodHeaderDetailsDataDtoList) throws Exception { + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { + List headerDetailsDtoList1 = new ArrayList<>(); + List headerDetailsDtoList2 = new ArrayList<>(); + for (ReturnGoodHeaderDetailsDataDto index : returnGoodHeaderDetailsDataDtoList) { + ReturnGoodSearchHeaderDto header = index.getHeader();// 主表 + List details = index.getDetails();//明细表 headerDetailsDtoList1.add(header); headerDetailsDtoList2.addAll(details); } //每250作为一个批次插入主表,根据主键(id)判断是否重复,如果重复的,则不进行插入 - List> ofssaleorderoutsearchList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 250); - for (int i = 0; i < ofssaleorderoutsearchList.size(); i++) { - List headerDtoList = ofssaleorderoutsearchList.get(i); - List tocofsSaleoutEntityList = copyHeaderDto(headerDtoList); - if (tocofsSaleoutEntityList.size() > 0) { - iTocofsSaleoutDao.entityInsertBatchV2(tocofsSaleoutEntityList); + List> lists = SplitListByCountUtil.splitListByCount(headerDetailsDtoList1, 100); + for (int i = 0; i < lists.size(); i++) { + List returnGoodSearchHeaderDtos = lists.get(i); + List tocofsReturngoodsEntities = copyHeaderDto(returnGoodSearchHeaderDtos); + if (tocofsReturngoodsEntities.size() > 0) { + logger.info("插入底表{}个对象(表头)", tocofsReturngoodsEntities.size()); + iTocofsReturngoodsDao.entityInsertBatchV2(tocofsReturngoodsEntities); + } else { + logger.info("tocofsReturngoodsEntities:没有对象被插入表头底表"); } } //插入明细表 - List> detailsDtoList = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 250); - for (int i = 0; i < detailsDtoList.size(); i++) { - List detailsDtos = detailsDtoList.get(i); - List tocofsSaleoutDetailedEntities = copyDetailsDto(detailsDtos); - if (tocofsSaleoutDetailedEntities.size() > 0) { - iTocofsSaleoutDetailedDao.entityInsertBatchV2(tocofsSaleoutDetailedEntities); + List> lists1 = SplitListByCountUtil.splitListByCount(headerDetailsDtoList2, 100); + for (int i = 0; i < lists1.size(); i++) { + List returnGoodSearchDetailsDtos = lists1.get(i); + List tocofsReturngoodsDetailedEntities = copyDetailsDto(returnGoodSearchDetailsDtos); + if (tocofsReturngoodsDetailedEntities.size() > 0) { + logger.info("插入底表{}个对象(表体)", tocofsReturngoodsDetailedEntities.size()); + iTocofsReturngoodsDetailedDao.entityInsertBatchV2(tocofsReturngoodsDetailedEntities); + } else { + logger.info("tocofsReturngoodsDetailedEntities:没有对象被插入表头底表"); } } } } /** - * 查询OFS结果集 + * 查询OFS售后退货入库单 * * @param queryOfsSoSaleOutVo 查询参数 * @param headerDetailsDtoList 查询结果集 * @param pageNo 从第pageNo页开始查询 */ - private void queryOfsSaleOrder(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List headerDetailsDtoList, Long pageNo) throws Exception { + private void queryOfsReturnGoods(QueryOfsSoSaleOutVo queryOfsSoSaleOutVo, List headerDetailsDtoList, Long pageNo) throws Exception { Long pageSize = 200L; queryOfsSoSaleOutVo.setPageNo(pageNo); @@ -237,21 +239,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); interfaceParamDto.setApi("ofs.receipt.search"); interfaceParamDto.setData(JSON.toJSONString(queryOfsSoSaleOutVo)); - SaleOutReturnMessageDto saleOutReturnMessageDto = (SaleOutReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); - if (saleOutReturnMessageDto != null) { - if ("false".equals(saleOutReturnMessageDto.getError()) && "0".equals(saleOutReturnMessageDto.getCode()) && "Success".equals(saleOutReturnMessageDto.getMsg())) { - List headerDetailsDtoList1 = saleOutReturnMessageDto.getData(); - if (headerDetailsDtoList1 != null && headerDetailsDtoList1.size() > 0) { - headerDetailsDtoList.addAll(headerDetailsDtoList1); + RertunGoodsRootBean rertunGoodsRootBean = (RertunGoodsRootBean) ofsUnifiedService.unified(interfaceParamDto); + if (rertunGoodsRootBean != null) { + if ("false".equals(rertunGoodsRootBean.getError()) && "0".equals(rertunGoodsRootBean.getCode()) && "Success".equals(rertunGoodsRootBean.getMsg())) { + List returnGoodHeaderDetailsDataDtoList = rertunGoodsRootBean.getData(); + if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) { + headerDetailsDtoList.addAll(returnGoodHeaderDetailsDataDtoList); - //TODO OFS没有提供分页字段 + //TODO OFS没有提供分页字段,等待开发 } } else { - //2024年7月30日 13:47:04 查询失败 - logger.error("查询失败,失败原因:{}", JSON.toJSON(saleOutReturnMessageDto)); + logger.error("查询失败,失败原因:{}", JSON.toJSON(interfaceParamDto)); } } else { - logger.error("returnMessageBasics为空!queryOfsSoSaleOutVo对象结果:{}", JSON.toJSON(queryOfsSoSaleOutVo)); + logger.error("rertunGoodsRootBean为空!interfaceParamDto对象的结果集json:{}", JSON.toJSON(interfaceParamDto)); } } @@ -277,26 +278,27 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { /** * 代码同步逻辑 * - * @param headerDetailsDtos 查询得到的O出库单对象 + * @param returnGoodHeaderDetailsDataDtoList1 查询得到的O出库单对象 * @author liuyang */ - private void implement(List headerDetailsDtos) throws Exception { - if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) { + private void implement(List returnGoodHeaderDetailsDataDtoList1) throws Exception { + if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) { try { // 查询基本档案 - List sonDetailsDtoList = queryBasicArchives(headerDetailsDtos); + List goodsRertunSonDetailsDtos = queryBasicArchives(returnGoodHeaderDetailsDataDtoList1); // 分组汇总 - Map> summaryDimensionMap = groupSummary(sonDetailsDtoList); + Map> summaryDimensionMap = groupSummary(goodsRertunSonDetailsDtos); // 查询U8C业务流程 BdBusitypeEntity bdBusitypeEntity = u8cOperationFlow(); if (bdBusitypeEntity != null && summaryDimensionMap != null) { - Iterator>> iterator = summaryDimensionMap.entrySet().iterator(); + Iterator>> iterator = summaryDimensionMap.entrySet().iterator(); while (iterator.hasNext()) { - Map.Entry> entry = iterator.next(); + Map.Entry> entry = iterator.next(); String keyGroup = entry.getKey(); - List oldValue = entry.getValue(); - HeaderDto header = oldValue.get(0).getHeader(); + List oldValue = entry.getValue(); + + ReturnGoodSearchHeaderDto header = oldValue.get(0).getHeader(); BdCorpEntity bdCorpEntity = oldValue.get(0).getBdCorpEntity();//表头销售公司 BdCorpEntity deliverGoodsCorp = oldValue.get(0).getDeliverGoodsCorp();//发货公司 BdCalbodyEntity bdCalbodyEntity = oldValue.get(0).getBdCalbodyEntity();//发货仓库组织 @@ -317,7 +319,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { SaleorderRequestDto saleorderRequestDto = new SaleorderRequestDto(); SaleorderRequestParentDto saleorderRequestParentDto = new SaleorderRequestParentDto(); saleorderRequestParentDto.setDbilldate(generateBusinessDate);//单据日期 - saleorderRequestParentDto.setBretinvflag("N");//退货标记 + saleorderRequestParentDto.setBretinvflag("Y");//退货标记 saleorderRequestParentDto.setCbiztype(bdBusitypeEntity.getPkBusitype());//业务流程 saleorderRequestParentDto.setCcalbodyid(bdCalbodyEntity.getPkCalbody());//库存组织 saleorderRequestParentDto.setCcustomerid(bdCumandocEntity.getPkCumandoc());//客户=开票单位=收货单位=表体收货单位=收货单位 @@ -331,10 +333,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { saleorderRequestParentDto.setDapprovedate(generateBusinessDate);//审核日期 saleorderRequestParentDto.setNdiscountrate("100.000000");//整单折扣 saleorderRequestParentDto.setPk_corp(bdCorpEntity.getPkCorp());//公司id - //汇总单号=汇总维度 saleorderRequestParentDto.setVdef18(keyGroup); - //平台 saleorderRequestParentDto.setPk_defdoc2(platformArchives.getPkDefdoc()); saleorderRequestParentDto.setVdef2(platformArchives.getDocname()); @@ -347,10 +347,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { saleorderRequestDto.setChildrenvo(saleorderRequestChildrenDtoList); //把汇总好的出库单明细行合并成一行 - SonDetailsDto sonDetailsDto = groupMergeDetailedRows(oldValue); + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = groupMergeDetailedRows(oldValue); //存货管理档案:取发货公司的存货管理档案 - BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(sonDetailsDto, bdCalbodyEntity.getPkCorp()); + BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(goodsRertunSonDetailsDto, bdCalbodyEntity.getPkCorp()); //存货基础档案 BdInvbasdocEntity bdInvbasdocEntity = queryStockBasicArchives(bdInvmandocEntity.getPkInvmandoc(), deliverGoodsCorp.getPkCorp()); @@ -363,16 +363,16 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { BigDecimal noriginalcurmny = null;//无税金额 BigDecimal noriginalcurtaxprice = null;//含税单价 BigDecimal noriginalcursummny = null;//价税合计 - BigDecimal noriginalcurtaxmny = null;//税额 + BigDecimal noriginalcurtaxmny = null;//税额=价税合计-无税金额 try { - noriginalcurtaxprice = sonDetailsDto.getGroupTotalPayAmount().divide(sonDetailsDto.getGroupShipQty(), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP); + noriginalcurtaxprice = goodsRertunSonDetailsDto.getGroupTotalPayAmount().divide(goodsRertunSonDetailsDto.getGroupShipQty(), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP); noriginalcurprice = noriginalcurtaxprice.divide(new BigDecimal(1).add(new BigDecimal(tax)), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP); - noriginalcurmny = noriginalcurprice.multiply(sonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP); - noriginalcursummny = noriginalcurtaxprice.multiply(sonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP); + noriginalcurmny = noriginalcurprice.multiply(goodsRertunSonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP); + noriginalcursummny = noriginalcurtaxprice.multiply(goodsRertunSonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP); noriginalcurtaxmny = noriginalcursummny.subtract(noriginalcurmny).setScale(2, BigDecimal.ROUND_HALF_UP); } catch (Exception e) { logger.error("TOC金额计算错误", e); - Assert.state(false, "金额计算错误,原因:{}" + e.getMessage()); + Assert.state(false, "U8C红字销售订单,金额计算错误,原因:{}", e.getMessage()); } //判断是否为赠品 @@ -385,41 +385,36 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { saleorderRequestChildrenDto.setBlargessflag(isblargessflag);//是否赠品 saleorderRequestChildrenDto.setCadvisecalbodyid(bdCalbodyEntity.getPkCalbody());//发货库存组织 saleorderRequestChildrenDto.setCbodywarehouseid(bdStordocEntity.getPkStordoc());//发货仓库 - saleorderRequestChildrenDto.setCbodywarehousecode(bdStordocEntity.getStorcode());//发货仓库编码:这个字段不需要给openapi接口,而是提供给下游方法使用 saleorderRequestChildrenDto.setCconsigncorpid(deliverGoodsCorp.getPkCorp());//发货公司 saleorderRequestChildrenDto.setCcurrencytypeid("00010000000000000001");//币种 saleorderRequestChildrenDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());//存货id - saleorderRequestChildrenDto.setCinventorycode(bdInvbasdocEntity.getInvcode());//存货编码 saleorderRequestChildrenDto.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());//收货单位 saleorderRequestChildrenDto.setDconsigndate(generateBusinessDate);//计划发货日期 - saleorderRequestChildrenDto.setDdeliverdate(generateBusinessDate);//要求收货日期 + saleorderRequestChildrenDto.setDdeliverdate(generateBusinessDate);// 要求收货日期 saleorderRequestChildrenDto.setNexchangeotobrate("1.00000000");//折本汇率 saleorderRequestChildrenDto.setNitemdiscountrate("100.000000");//单品折扣 - saleorderRequestChildrenDto.setNnumber(String.valueOf(sonDetailsDto.getGroupShipQty()));//数量 + saleorderRequestChildrenDto.setNnumber("-" + goodsRertunSonDetailsDto.getGroupShipQty().stripTrailingZeros().toPlainString());//数量 saleorderRequestChildrenDto.setNoriginalcurdiscountmny("0");//折扣额 - saleorderRequestChildrenDto.setNoriginalcurmny(noriginalcurmny.stripTrailingZeros().toPlainString());//无税金额 - saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价 - saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价 - saleorderRequestChildrenDto.setNoriginalcursummny(noriginalcursummny.stripTrailingZeros().toPlainString());//价税合计 - saleorderRequestChildrenDto.setNoriginalcurtaxmny(noriginalcurtaxmny.stripTrailingZeros().toPlainString());//税额 + saleorderRequestChildrenDto.setNoriginalcurmny("-" + noriginalcurmny.stripTrailingZeros().toPlainString());//无税金额 +// saleorderRequestChildrenDto.setNoriginalcurnetprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税净价 +// saleorderRequestChildrenDto.setNoriginalcurprice(noriginalcurprice.stripTrailingZeros().toPlainString());//无税单价 + saleorderRequestChildrenDto.setNoriginalcursummny("-" + noriginalcursummny.stripTrailingZeros().toPlainString());//价税合计 + saleorderRequestChildrenDto.setNoriginalcurtaxmny("-" + noriginalcurtaxmny.stripTrailingZeros().toPlainString());//税额 saleorderRequestChildrenDto.setNoriginalcurtaxnetprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税净价 saleorderRequestChildrenDto.setNoriginalcurtaxprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税单价 saleorderRequestChildrenDto.setNtaxrate(new BigDecimal(bdTaxitemsEntity1.getTaxratio()).stripTrailingZeros().toPlainString());//税率 -// saleorderRequestChildrenDto.setCreccalbodyid(bdCalbodyEntity1.getPkCalbody());//收货库存组织:2024年8月7日 16:21:48 和佳妮、道品一起测试,收货库存组织、收货仓库 是不需要传递的 -// saleorderRequestChildrenDto.setCrecwareid(bdStordocEntity1.getPkStordoc());//收货仓库 saleorderRequestChildrenDtoList.add(saleorderRequestChildrenDto); //销售订单单据推送到u8c List saleorderRequestDtoList = new ArrayList<>(); saleorderRequestDtoList.add(saleorderRequestDto); - Map> stringStringMap = new HashMap<>(); stringStringMap.put("saleorder", saleorderRequestDtoList); SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap)); logger.info("销售订单编号:{} 销售公司:{}", soSaleResultRootDto.getParentvo().getVreceiptcode(), soSaleResultRootDto.getParentvo().getPk_corp()); //记录成功 } catch (Exception e) { - logger.error("TOC业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e); + logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e); //记录失败 } } @@ -435,18 +430,18 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { } /** - * 2024年7月31日 10:34:09 - * 生成业务日期,以发货时间作为业务日期 + * 2024年8月9日 15:43:13 + * 生成业务日期:取「入库时间」、还是取「结束收货时间」 * * @author liuyang */ - private String createGenerateBusinessDate(HeaderDto header) { - if (header != null && header.getShipAt() != null) { + private String createGenerateBusinessDate(ReturnGoodSearchHeaderDto header) { + if (header != null && header.getCheckInTo() != null) { //TOC以出库日期作为业务日期 - String shipAt = header.getShipAt(); + String checkInTo = header.getCheckInTo(); String businessFormat = null; try { - Date dbill = DateUtil.parse(shipAt); + Date dbill = DateUtil.parse(checkInTo); businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); } catch (Exception e) { e.printStackTrace(); @@ -454,8 +449,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { } return businessFormat; } else { - logger.error("生成出库日期失败,或者shipAt为空! json:{}", JSON.toJSON(header)); - Assert.state(false, "生成出库日期失败,或者shipAt为空! json:{}", JSON.toJSON(header)); + logger.error("生成入库日期失败,或者checkInTo为空! json:{}", JSON.toJSON(header)); + Assert.state(false, "生成入库日期失败,或者checkInTo为空! json:{}", JSON.toJSON(header)); return null; } } @@ -465,26 +460,27 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * * @author liuyang */ - private List queryBasicArchives(List headerDetailsDtoList) { - List sonDetailsDtoList = new ArrayList<>(); + private List queryBasicArchives(List returnGoodHeaderDetailsDataDtoList1) { + List sonDetailsDtoList = new ArrayList<>(); - if (headerDetailsDtoList != null && headerDetailsDtoList.size() > 0) { + if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) { try { //初始化档案缓存 - basicArchivesCacheUtil.initCache(); + tocReturnBasicArchivesCacheUtil.initCache(); - for (int i = 0; i < headerDetailsDtoList.size(); i++) { - HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i); - HeaderDto header = headerDetailsDto.getHeader(); - List details = headerDetailsDto.getDetails(); + for (int i = 0; i < returnGoodHeaderDetailsDataDtoList1.size(); i++) { + ReturnGoodHeaderDetailsDataDto returnGoodHeaderDetailsDataDto = returnGoodHeaderDetailsDataDtoList1.get(i); + ReturnGoodSearchHeaderDto header = returnGoodHeaderDetailsDataDto.getHeader(); + List details = returnGoodHeaderDetailsDataDto.getDetails(); //表头公司:通过名称匹配U8C公司 - String corpName = "上海丽知品牌管理有限公司"; - BdCorpEntity bdCorpEntity = BasicArchivesCacheUtil.stringBdCorpEntityMap.get(corpName); - Assert.notNull(bdCorpEntity, "根据公司名称({})没有匹配到U8C公司档案", corpName); +// String corpName = "上海丽知品牌管理有限公司"; + Assert.notNull(header.getCompanyCode(), "O货主编码不能为空"); + BdCorpEntity bdCorpEntity = TocReturnBasicArchivesCacheUtil.stringBdCorpEntityMap.get(header.getCompanyCode()); + Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode()); //发货库存组织 - BdCalbodyEntity bdCalbodyEntity = BasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp()); + BdCalbodyEntity bdCalbodyEntity = TocReturnBasicArchivesCacheUtil.stringBdCalbodyEntityMap.get(bdCorpEntity.getPkCorp()); Assert.notNull(bdCalbodyEntity, "根据公司主键没有查询到发货库存组织 公司主键:{}", bdCorpEntity.getPkCorp()); //发货公司,暂时把O表头公司作为发货公司,正常情况下需要把O库存地点对于的公司作为发货公司 @@ -493,7 +489,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { //2024年8月5日 15:06:38 仓库O与U两边仓库编码是一致的,和妮姐确认过了 String facilityCode = header.getFacilityCode(); Assert.notNull(facilityCode, "O仓库编码不能为空"); - BdStordocEntity bdStordocEntity = BasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody()); + BdStordocEntity bdStordocEntity = TocReturnBasicArchivesCacheUtil.stringBdStordocEntityMap.get(facilityCode + bdCalbodyEntity.getPkCalbody()); Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码:{}", facilityCode, bdCalbodyEntity.getPkCalbody()); //2024年8月5日 15:25:07 收货库存组织、收货仓库、默认和发货库存组织、发货仓库一致,已经和佳妮确认 @@ -501,51 +497,51 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { //收货仓库:通过收货库存组织+仓库编码,确定收货仓库 //销售组织2024年8月5日 15:33:40 和妮姐确认,销售组织和表头公司,作为一对一的关系, - BdSalestruEntity bdSalestruEntity = BasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname()); + BdSalestruEntity bdSalestruEntity = TocReturnBasicArchivesCacheUtil.stringBdSalestruEntityMap.get(bdCorpEntity.getUnitname()); Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname()); //业务部门:暂定的部门名称:其他,2024年8月5日 15:39:42 已经和妮姐确认 - BdDeptdocEntity bdDeptdocEntity = BasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp()); + BdDeptdocEntity bdDeptdocEntity = TocReturnBasicArchivesCacheUtil.stringBdDeptdocEntityMap.get(bdCorpEntity.getPkCorp()); Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp()); //客商基本档案 //TODO 2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1,O没有店铺信息查询接口,因此无法通过出库单的店铺编码,查询到O店铺档案对应的业务编码,接口上线之后需要补充这一部分逻辑 String custName = "天猫intoyou旗舰店-自营"; - BdCubasdocEntity bdCubasdocEntity = BasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName); + BdCubasdocEntity bdCubasdocEntity = TocReturnBasicArchivesCacheUtil.stringBdCubasdocEntityHashMap.get(custName); Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", custName); //客商管理档案:2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案,已经和妮姐确认 //2024年8月5日 15:49:49 先根据O店铺编码,得到店铺档案信息,取到名称,通过U8C接口查询出来 //目前O店铺信息查询接口还没有,等待开发,所以我这里先写所一个名字 - BdCumandocEntity bdCumandocEntity = BasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp()); + BdCumandocEntity bdCumandocEntity = TocReturnBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp()); Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营"); //查找平台 - BdDefdocEntity bdDefdocEntity = BasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode()); + BdDefdocEntity bdDefdocEntity = TocReturnBasicArchivesCacheUtil.stringBdDefdocEntityHashMap.get(header.getSourcePlatformCode()); Assert.notNull(bdDefdocEntity, "根据O平台编码({})无法匹配到平台", header.getSourcePlatformCode()); //字段拷贝 for (int j = 0; j < details.size(); j++) { - DetailsDto detailsDto = details.get(j); + ReturnGoodSearchDetailsDto returnGoodSearchDetailsDto = details.get(j); //2024年8月6日 10:16:22 通过O出库单的表头,查询得出U8C档案,放在表体的原因是方便分组汇总 //下一个步骤的分组汇总,是通过表体明细完成的 - SonDetailsDto sonDetailsDto = new SonDetailsDto(); - sonDetailsDto.setHeader(header); - sonDetailsDto.setBdCorpEntity(bdCorpEntity); - sonDetailsDto.setDeliverGoodsCorp(bdCorpEntity); - sonDetailsDto.setBdCalbodyEntity(bdCalbodyEntity); - sonDetailsDto.setBdStordocEntity(bdStordocEntity); - sonDetailsDto.setBdCalbodyEntity1(bdCalbodyEntity); - sonDetailsDto.setBdStordocEntity1(bdStordocEntity); - sonDetailsDto.setBdSalestruEntity(bdSalestruEntity); - sonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity); - sonDetailsDto.setBdCumandocEntity(bdCumandocEntity); - sonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity); - sonDetailsDto.setPlatformArchives(bdDefdocEntity); + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = new GoodsRertunSonDetailsDto(); + goodsRertunSonDetailsDto.setHeader(header); + goodsRertunSonDetailsDto.setBdCorpEntity(bdCorpEntity); + goodsRertunSonDetailsDto.setDeliverGoodsCorp(bdCorpEntity); + goodsRertunSonDetailsDto.setBdCalbodyEntity(bdCalbodyEntity); + goodsRertunSonDetailsDto.setBdStordocEntity(bdStordocEntity); + goodsRertunSonDetailsDto.setBdCalbodyEntity1(bdCalbodyEntity); + goodsRertunSonDetailsDto.setBdStordocEntity1(bdStordocEntity); + goodsRertunSonDetailsDto.setBdSalestruEntity(bdSalestruEntity); + goodsRertunSonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity); + goodsRertunSonDetailsDto.setBdCumandocEntity(bdCumandocEntity); + goodsRertunSonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity); + goodsRertunSonDetailsDto.setPlatformArchives(bdDefdocEntity); - BeanUtil.copyPropertiesV2(detailsDto, sonDetailsDto); - sonDetailsDtoList.add(sonDetailsDto); + BeanUtil.copyPropertiesV2(returnGoodSearchDetailsDto, goodsRertunSonDetailsDto); + sonDetailsDtoList.add(goodsRertunSonDetailsDto); } } //成功 @@ -561,36 +557,40 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { /** * bean copy - * 2024年7月31日 10:34:09 + * 2024年8月9日 11:23:57 */ - private List copyHeaderDto(List headerDtoList) { - List tocofsSaleoutEntityList = new ArrayList<>(); - if (headerDtoList != null && headerDtoList.size() > 0) { - for (int i = 0; i < headerDtoList.size(); i++) { - HeaderDto headerDto = headerDtoList.get(i); - TocofsSaleoutEntity tocofsSaleoutEntity = new TocofsSaleoutEntity(); -// BeanUtils.copyProperties(headerDto, tocofsSaleoutEntity); - BeanUtil.copyPropertiesV2(headerDto, tocofsSaleoutEntity); - tocofsSaleoutEntityList.add(tocofsSaleoutEntity); + private List copyHeaderDto(List returnGoodSearchHeaderDtos) { + List tocofsReturngoodsEntityArrayList = new ArrayList<>(); + if (returnGoodSearchHeaderDtos != null && returnGoodSearchHeaderDtos.size() > 0) { + for (int i = 0; i < returnGoodSearchHeaderDtos.size(); i++) { + ReturnGoodSearchHeaderDto headerDto = returnGoodSearchHeaderDtos.get(i); + + TocofsReturngoodsEntity tocofsReturngoodsEntity = new TocofsReturngoodsEntity(); + BeanUtil.copyPropertiesV2(headerDto, tocofsReturngoodsEntity); + tocofsReturngoodsEntityArrayList.add(tocofsReturngoodsEntity); } + } else { + logger.info("需要复制{}个bean对象(O表头)", returnGoodSearchHeaderDtos.size()); } - return tocofsSaleoutEntityList; + return tocofsReturngoodsEntityArrayList; } /** * bean copy - * 2024年8月2日 16:04:11 + * 2024年8月9日 11:24:01 */ - private List copyDetailsDto(List detailsDtos) { - List tocofsSaleoutDetailedEntityArrayList = new ArrayList<>(); - if (detailsDtos != null && detailsDtos.size() > 0) { - for (int i = 0; i < detailsDtos.size(); i++) { - DetailsDto detailsDto = detailsDtos.get(i); - TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity(); -// BeanUtils.copyProperties(detailsDto, tocofsSaleoutDetailedEntity); - BeanUtil.copyPropertiesV2(detailsDto, tocofsSaleoutDetailedEntity); - tocofsSaleoutDetailedEntityArrayList.add(tocofsSaleoutDetailedEntity); + private List copyDetailsDto(List headerDetailsDtoList2) { + List tocofsSaleoutDetailedEntityArrayList = new ArrayList<>(); + if (headerDetailsDtoList2 != null && headerDetailsDtoList2.size() > 0) { + for (int i = 0; i < headerDetailsDtoList2.size(); i++) { + ReturnGoodSearchDetailsDto returnGoodSearchDetailsDto = headerDetailsDtoList2.get(i); + + TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity(); + BeanUtil.copyPropertiesV2(returnGoodSearchDetailsDto, tocofsReturngoodsDetailedEntity); + tocofsSaleoutDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity); } + } else { + logger.info("需要复制{}个bean对象(O表体)", tocofsSaleoutDetailedEntityArrayList.size()); } return tocofsSaleoutDetailedEntityArrayList; } @@ -600,21 +600,21 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * * @author liuyang */ - private Map> groupSummary(List sonDetailsDtoList) { - if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) { - for (int i = 0; i < sonDetailsDtoList.size(); i++) { - SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i); + private Map> groupSummary(List goodsRertunSonDetailsDtos) { + if (goodsRertunSonDetailsDtos != null && goodsRertunSonDetailsDtos.size() > 0) { + for (int i = 0; i < goodsRertunSonDetailsDtos.size(); i++) { + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = goodsRertunSonDetailsDtos.get(i); //2024年8月6日 10:35:25表头对象用于带出表头相关的分组汇总信息 - HeaderDto header = sonDetailsDto.getHeader(); + ReturnGoodSearchHeaderDto header = goodsRertunSonDetailsDto.getHeader(); //公司 - BdCorpEntity bdCorpEntity = sonDetailsDto.getBdCorpEntity(); + BdCorpEntity bdCorpEntity = goodsRertunSonDetailsDto.getBdCorpEntity(); //店铺(主要是店铺编码) String storeCode = header.getStoreCode(); //仓库 String facilityCode = header.getFacilityCode(); //SKU - String skuCode = sonDetailsDto.getSkuCode(); + String skuCode = goodsRertunSonDetailsDto.getSkuCode(); //出库类型 String refOrderType = header.getRefOrderType(); @@ -653,10 +653,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { summaryDimensionStr.append(NOTHING); } - sonDetailsDto.setSummaryDimensionStr(summaryDimensionStr.toString()); + goodsRertunSonDetailsDto.setSummaryDimensionStr(summaryDimensionStr.toString()); } - logger.info("TOC:{}个出库单对象需要汇总", sonDetailsDtoList.size()); - return sonDetailsDtoList.stream().collect(Collectors.groupingBy(SonDetailsDto::getSummaryDimensionStr)); + logger.info("TOC:{} 个出库单对象需要汇总", goodsRertunSonDetailsDtos.size()); + return goodsRertunSonDetailsDtos.stream().collect(Collectors.groupingBy(GoodsRertunSonDetailsDto::getSummaryDimensionStr)); } logger.info("TOC:0个对象需要汇总"); return null; @@ -682,7 +682,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * * @author liuyang */ - private void checkArchives(SonDetailsDto sonDetailsDto) { + private void checkArchives(GoodsRertunSonDetailsDto sonDetailsDto) { Assert.notNull(sonDetailsDto, "sonDetailsDto不能为空 对象json:{}", JSON.toJSONString(sonDetailsDto)); Assert.notNull(sonDetailsDto.getHeader(), "header对象不能为空 对象json:{}", JSON.toJSONString(sonDetailsDto)); Assert.notNull(sonDetailsDto.getBdCorpEntity(), "表头公司不能为空 对象json:{}", JSON.toJSONString(sonDetailsDto)); @@ -698,17 +698,17 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { /** * 查询存货管理档案 * - * @param pkCorp 发货公司主键 - * @param sonDetailsDto 出库单存货明细行 + * @param pkCorp 发货公司主键 + * @param goodsRertunSonDetailsDto 出库单存货明细行 * @author liuyang */ - private BdInvmandocEntity queryInventoryMan(SonDetailsDto sonDetailsDto, String pkCorp) { - Assert.notNull(sonDetailsDto, "sonDetailsDto不能为空"); - Assert.notNull(sonDetailsDto.getSkuCode(), "O存货商家编码不能为空"); + private BdInvmandocEntity queryInventoryMan(GoodsRertunSonDetailsDto goodsRertunSonDetailsDto, String pkCorp) { + Assert.notNull(goodsRertunSonDetailsDto, "sonDetailsDto不能为空"); + Assert.notNull(goodsRertunSonDetailsDto.getSkuCode(), "O存货商家编码不能为空"); Assert.notNull(pkCorp, "发货公司主键不能为空"); - BdInvmandocEntity bdInvmandocEntity = BasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(sonDetailsDto.getSkuCode() + pkCorp); - Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 存货商家编码:{} 存货发货公司:{}", sonDetailsDto.getSkuCode(), pkCorp); + BdInvmandocEntity bdInvmandocEntity = TocReturnBasicArchivesCacheUtil.stringBdInvmandocEntityMap.get(goodsRertunSonDetailsDto.getSkuCode() + pkCorp); + Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 存货商家编码:{} 存货发货公司:{}", goodsRertunSonDetailsDto.getSkuCode(), pkCorp); return bdInvmandocEntity; } @@ -716,30 +716,31 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * 合并明细行 * 单价计算公式:sum(实付金额/实发数量) 最后除以条数 * + * @param sonDetailsDtoList 汇总过后的售后入库单明细 * @author liuyang */ - private SonDetailsDto groupMergeDetailedRows(List sonDetailsDtoList) throws Exception { + private GoodsRertunSonDetailsDto groupMergeDetailedRows(List sonDetailsDtoList) throws Exception { if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) { BigDecimal groupTotalPayAmount = new BigDecimal("0"); BigDecimal groupShipQty = new BigDecimal("0"); for (int i = 0; i < sonDetailsDtoList.size(); i++) { - SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(i); + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = sonDetailsDtoList.get(i); //实付金额/实发数量 - Assert.notNull(sonDetailsDto.getTotalPayAmount(), "实付金额不能为空 明细行对象:{}", JSON.toJSONString(sonDetailsDto)); - Assert.notNull(sonDetailsDto.getShipQty(), "实发数量不能为空 明细行对象:{}", JSON.toJSONString(sonDetailsDto)); - BigDecimal totalPayAmountBigDecimal = new BigDecimal(sonDetailsDto.getTotalPayAmount()); - BigDecimal shipQtyBigDecimal = new BigDecimal(sonDetailsDto.getShipQty()); + Assert.notNull(goodsRertunSonDetailsDto.getTotalAmount(), "退货入库单总金额不能为空 明细行对象:{}", JSON.toJSONString(goodsRertunSonDetailsDto)); + Assert.notNull(goodsRertunSonDetailsDto.getReceivedQty(), "实收数量不能为空 明细行对象:{}", JSON.toJSONString(goodsRertunSonDetailsDto)); + BigDecimal totalPayAmountBigDecimal = new BigDecimal(goodsRertunSonDetailsDto.getTotalAmount()); + BigDecimal shipQtyBigDecimal = new BigDecimal(goodsRertunSonDetailsDto.getReceivedQty()); groupTotalPayAmount = groupTotalPayAmount.add(totalPayAmountBigDecimal); groupShipQty = groupShipQty.add(shipQtyBigDecimal); } - SonDetailsDto sonDetailsDto = sonDetailsDtoList.get(0); - sonDetailsDto.setGroupShipQty(groupShipQty); - sonDetailsDto.setGroupTotalPayAmount(groupTotalPayAmount); + GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = sonDetailsDtoList.get(0); + goodsRertunSonDetailsDto.setGroupShipQty(groupShipQty); + goodsRertunSonDetailsDto.setGroupTotalPayAmount(groupTotalPayAmount); logger.info("{}个明细行发生了合并!", sonDetailsDtoList.size()); - return sonDetailsDto; + return goodsRertunSonDetailsDto; } else { logger.info("sonDetailsDtoList集合是空的!"); } @@ -755,7 +756,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { private BdInvbasdocEntity queryStockBasicArchives(String pkInvmandoc, String pkCorp) { Assert.notNull(pkInvmandoc, "存货管理档案不能为空"); Assert.notNull(pkCorp, "公司档案不能为空"); - BdInvbasdocEntity bdInvbasdocEntity = BasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp); + BdInvbasdocEntity bdInvbasdocEntity = TocReturnBasicArchivesCacheUtil.stringBdInvbasdocEntityHashMap.get(pkInvmandoc + pkCorp); Assert.notNull(bdInvbasdocEntity, "根据公司主键:{} 和存货管理档案主键:{} 没有查询到存货基本档案", pkCorp, pkInvmandoc); return bdInvbasdocEntity; } @@ -768,7 +769,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { */ private BdTaxitemsEntity queryBdTaxitems(String invcode) { Assert.notNull(invcode, "存货编码不能为空"); - BdTaxitemsEntity bdTaxitemsEntity = BasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode); + BdTaxitemsEntity bdTaxitemsEntity = TocReturnBasicArchivesCacheUtil.stringBdTaxitemsEntityHashMap.get(invcode); Assert.notNull(bdTaxitemsEntity, "根据存货编码({}),无法匹配到税率!", invcode); return bdTaxitemsEntity; } @@ -832,5 +833,4 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { return null; } - } \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GoodsRertunSonDetailsDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GoodsRertunSonDetailsDto.java new file mode 100644 index 00000000..ceb512c4 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/GoodsRertunSonDetailsDto.java @@ -0,0 +1,96 @@ +package com.hzya.frame.plugin.lets.u8cdto; + +import com.hzya.frame.plugin.lets.entity.*; +import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDto; +import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchDetailsDto; +import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author:liuyang + * @Package:com.hzya.frame.ttxofs.dto.u8cson + * @Project:kangarooDataCenterV3 + * @name:SonDetailsDto + * @Date:2024/8/5 16:07 + * @Filename:SonDetailsDto + */ +@Data +public class GoodsRertunSonDetailsDto extends ReturnGoodSearchDetailsDto { + + /** + * 表头对象 + */ + private ReturnGoodSearchHeaderDto header; + + /** + * 表头公司(销售公司) + */ + private BdCorpEntity bdCorpEntity; + + /** + * 发货库存组织 + */ + private BdCalbodyEntity bdCalbodyEntity; + + /** + * 发货仓库 + */ + private BdStordocEntity bdStordocEntity; + + /** + * 收货库存组织 + */ + private BdCalbodyEntity bdCalbodyEntity1; + + /** + * 收货仓库 + */ + private BdStordocEntity bdStordocEntity1; + + /** + * 销售组织 + */ + private BdSalestruEntity bdSalestruEntity; + + /** + * 业务部门 + */ + private BdDeptdocEntity bdDeptdocEntity; + + /** + * 客商管理档案 + */ + private BdCumandocEntity bdCumandocEntity; + + /** + * 客商基本档案 + */ + private BdCubasdocEntity bdCubasdocEntity; + + /** + * 生成汇总维度字符串 + */ + private String summaryDimensionStr; + + /** + * 汇总总金额 + */ + private BigDecimal groupTotalPayAmount; + + /** + * 汇总实发数量 + */ + private BigDecimal groupShipQty; + + /** + * 发货公司 + */ + private BdCorpEntity deliverGoodsCorp; + + /** + * U8C平台档案 + */ + private BdDefdocEntity platformArchives; +} \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BasicArchivesCacheUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java similarity index 99% rename from buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BasicArchivesCacheUtil.java rename to buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java index 006b1d10..d0710398 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BasicArchivesCacheUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java @@ -10,7 +10,7 @@ import java.util.List; import java.util.Map; /** - * 档案类缓存,TOC转换 + * 档案类缓存,TOC销售订单转换 * * @Author:liuyang * @Package:com.hzya.frame.plugin.lets.util @@ -20,7 +20,7 @@ import java.util.Map; * @Filename:BasicArchivesCacheUtil */ @Component -public class BasicArchivesCacheUtil { +public class TocOrderBasicArchivesCacheUtil { @Autowired private IBdCorpDao iBdCorpDao; @@ -309,5 +309,4 @@ public class BasicArchivesCacheUtil { initBdCubasdoc(); initSourcePlatform(); } - } \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java new file mode 100644 index 00000000..cdd2aacc --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java @@ -0,0 +1,312 @@ +package com.hzya.frame.plugin.lets.util; + +import com.hzya.frame.plugin.lets.dao.*; +import com.hzya.frame.plugin.lets.entity.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 档案类缓存,TOC销售订单转换 + * + * @Author:liuyang + * @Package:com.hzya.frame.plugin.lets.util + * @Project:kangarooDataCenterV3 + * @name:BasicArchivesCacheUtil + * @Date:2024/7/31 11:27 + * @Filename:BasicArchivesCacheUtil + */ +@Component +public class TocReturnBasicArchivesCacheUtil { + + @Autowired + private IBdCorpDao iBdCorpDao; + + @Autowired + private IBdStordocDao iBdStordocDao; + + @Autowired + private IBdCalbodyDao iBdCalbodyDao; + + @Autowired + private IBdSalestruDao iBdSalestruDao; + + @Autowired + private IBdDeptdocDao iBdDeptdocDao; + + @Autowired + private IBdCumandocDao iBdCumandocDao; + + @Autowired + private IBdInvmandocDao iBdInvmandocDao; + + @Autowired + private IBdInvbasdocDao iBdInvbasdocDao; + + @Autowired + private IBdTaxitemsDao iBdTaxitemsDao; + + @Autowired + private IBdCubasdocDao iBdCubasdocDao; + + @Autowired + private IBdDefdocDao iBdDefdocDao; + + /** + * 初始化公司档案-表头公司 + * 2024年7月31日 11:16:23 + */ + public static Map stringBdCorpEntityMap = new HashMap<>(); + + private void initShop() throws Exception { + BdCorpEntity bdCorpEntity = new BdCorpEntity(); + bdCorpEntity.setDr(0); + bdCorpEntity.setDataSourceCode("lets_u8c"); + List bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); + if (bdCorpEntityList != null && bdCorpEntityList.size() > 0) { + for (int i = 0; i < bdCorpEntityList.size(); i++) { + BdCorpEntity bdCorpEntity1 = bdCorpEntityList.get(i); + stringBdCorpEntityMap.put(bdCorpEntity1.getUnitcode(), bdCorpEntity1); + } + } + } + + /** + * 初始化发货仓库 + * 2024年7月31日 11:16:27 + * 202403011513:仓库根据仓库编码+库存组织编码去查询,之前是仓库编码+公司主键,和李佳妮确认好了 + */ + public static Map stringBdStordocEntityMap = new HashMap<>(); + + private void initBdStordoc() throws Exception { + BdStordocEntity bdStordocEntity = new BdStordocEntity(); + bdStordocEntity.setDr(0L); + bdStordocEntity.setDataSourceCode("lets_u8c"); + List bdStordocEntityList = iBdStordocDao.query(bdStordocEntity); + if (bdStordocEntityList != null && bdStordocEntityList.size() > 0) { + for (int i = 0; i < bdStordocEntityList.size(); i++) { + BdStordocEntity bdStordocEntity1 = bdStordocEntityList.get(i); + stringBdStordocEntityMap.put(bdStordocEntity1.getStorcode() + bdStordocEntity1.getPkCalbody(), bdStordocEntity1); + } + } + } + + /** + * 2024年7月31日 11:09:12 查询发货库存组织 + */ + public static Map stringBdCalbodyEntityMap = new HashMap<>(); + + private void initBdCalbody() throws Exception { + BdCalbodyEntity bdCalbodyEntity = new BdCalbodyEntity(); + bdCalbodyEntity.setDr(0); + bdCalbodyEntity.setDataSourceCode("lets_u8c"); + List bdCalbodyEntities = iBdCalbodyDao.query(bdCalbodyEntity); + if (bdCalbodyEntities != null && bdCalbodyEntities.size() > 0) { + for (int i = 0; i < bdCalbodyEntities.size(); i++) { + BdCalbodyEntity bdCalbodyEntity1 = bdCalbodyEntities.get(i); + stringBdCalbodyEntityMap.put(bdCalbodyEntity1.getPkCorp(), bdCalbodyEntity1); + } + } + } + + /** + * 初始化销售组织 + */ + public static Map stringBdSalestruEntityMap = new HashMap<>(); + + private void initBdSalestru() throws Exception { + BdSalestruEntity bdSalestruEntity = new BdSalestruEntity(); + bdSalestruEntity.setDr(0); + bdSalestruEntity.setDataSourceCode("lets_u8c"); + List bdSalestruEntityList = iBdSalestruDao.query(bdSalestruEntity); + if (bdSalestruEntityList != null && bdSalestruEntityList.size() > 0) { + for (int i = 0; i < bdSalestruEntityList.size(); i++) { + BdSalestruEntity bdSalestruEntity1 = bdSalestruEntityList.get(i); + stringBdSalestruEntityMap.put(bdSalestruEntity1.getVsalestruname(), bdSalestruEntity1); + } + } + } + + /** + * 初始化业务部门 + * + * @author liuyang + */ + public static Map stringBdDeptdocEntityMap = new HashMap<>(); + + private void initDept() { + BdDeptdocEntity bdDeptdocEntity = new BdDeptdocEntity(); + bdDeptdocEntity.setDataSourceCode("lets_u8c"); + bdDeptdocEntity.setDr(0); + bdDeptdocEntity.setDeptname("其他部门"); + List bdDeptdocEntityList = iBdDeptdocDao.query(bdDeptdocEntity); + if (bdDeptdocEntityList != null && bdDeptdocEntityList.size() > 0) { + for (int i = 0; i < bdDeptdocEntityList.size(); i++) { + BdDeptdocEntity bdDeptdocEntity1 = bdDeptdocEntityList.get(i); + stringBdDeptdocEntityMap.put(bdDeptdocEntity1.getPkCorp(), bdDeptdocEntity1); + } + } + } + + /** + * 初始化客商基本档案 + * + * @author liuyang + */ + public static Map stringBdCubasdocEntityHashMap = new HashMap<>(); + + private void initBdCubasdoc() { + BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); + bdCubasdocEntity.setDataSourceCode("lets_u8c"); + bdCubasdocEntity.setDr(0L); + List bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); + if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) { + for (int i = 0; i < bdCumandocEntityList.size(); i++) { + BdCubasdocEntity bdCubasdocEntity1 = bdCumandocEntityList.get(i); + stringBdCubasdocEntityHashMap.put(bdCubasdocEntity1.getCustname(), bdCubasdocEntity1); + } + } + } + + /** + * 初始化客商管理档案 + * + * @author liuyang + */ + public static Map stringBdCumandocEntityMap = new HashMap<>(); + + private void initBdCumandoc() { + BdCumandocEntity bdCumandocEntity1 = new BdCumandocEntity(); + bdCumandocEntity1.setDataSourceCode("lets_u8c"); + bdCumandocEntity1.setDr(0L); +// bdCumandocEntity1.setCustflags(ProfilesActiveConstant.CUSTOMER);//客商:2客户 + List bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity1); + if (bdCumandocEntityList != null && bdCumandocEntityList.size() > 0) { + for (int i = 0; i < bdCumandocEntityList.size(); i++) { + BdCumandocEntity bdCumandocEntity = bdCumandocEntityList.get(i); + stringBdCumandocEntityMap.put(bdCumandocEntity.getPkCubasdoc() + bdCumandocEntity.getPkCorp(), bdCumandocEntity); + } + } + } + + /** + * 初始化存货管理档案 + */ + public static Map stringBdInvmandocEntityMap = new HashMap<>(); + + private void initInventoryFile() throws Exception { + BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity(); +// bdInvmandocEntity.setInvcode(copyRowDetailsListVo.getSpec_no()); +// bdInvmandocEntity.setPkCorp(shippingCompanyBdCorpEntity.getPkCorp()); + List bdInvmandocEntity2 = iBdInvmandocDao.queryBdInvmandocByInvcodeList(bdInvmandocEntity); + if (bdInvmandocEntity2 != null && bdInvmandocEntity2.size() > 0) { + for (int i = 0; i < bdInvmandocEntity2.size(); i++) { + BdInvmandocEntity bdInvmandocEntity1 = bdInvmandocEntity2.get(i); + //2024年8月6日 14:27:45 通过存货编码+公司缓存 + stringBdInvmandocEntityMap.put(bdInvmandocEntity1.getInvcode() + bdInvmandocEntity1.getPkCorp(), bdInvmandocEntity1); + } + } + } + + /** + * 初始化存货基本档案 + * 2024年8月7日 10:57:55 + */ + public static Map stringBdInvbasdocEntityHashMap = new HashMap<>(); + + private void initBasicInventoryFile() throws Exception { + BdInvbasdocEntity bdInvbasdocEntity = new BdInvbasdocEntity(); +// bdInvbasdocEntity.setPk_invmandoc(bdInvmandocEntity1.getPkInvmandoc()); +// bdInvbasdocEntity.setPk_corp(shippingCompanyBdCorpEntity.getPkCorp()); + List bdInvbasdocEntity2 = iBdInvbasdocDao.queryBdInvbasdocByPkInvmandocV2(bdInvbasdocEntity); + if (bdInvbasdocEntity2 != null && bdInvbasdocEntity2.size() > 0) { + for (int i = 0; i < bdInvbasdocEntity2.size(); i++) { + BdInvbasdocEntity bdInvbasdocEntity1 = bdInvbasdocEntity2.get(i); + stringBdInvbasdocEntityHashMap.put(bdInvbasdocEntity1.getPk_invmandoc() + bdInvbasdocEntity1.getPk_corp_man(), bdInvbasdocEntity1); + } + } + } + + /** + * 2024年8月7日 10:59:30 + * 初始化存货税率 + * + * @author liuyang + */ + public static Map stringBdTaxitemsEntityHashMap = new HashMap<>(); + + private void initBdTaxitemsEntity() throws Exception { + BdTaxitemsEntity bdTaxitemsEntity = new BdTaxitemsEntity(); + List bdTaxitemsEntityList = iBdTaxitemsDao.queryBdInvbasdocByInvcodeV2(bdTaxitemsEntity); + if (bdTaxitemsEntityList != null && bdTaxitemsEntityList.size() > 0) { + for (int i = 0; i < bdTaxitemsEntityList.size(); i++) { + BdTaxitemsEntity bdTaxitemsEntity1 = bdTaxitemsEntityList.get(i); + stringBdTaxitemsEntityHashMap.put(bdTaxitemsEntity1.getInvcode(), bdTaxitemsEntity1); + } + } + } + + /** + * 缓存来源平台逻辑 + * + * @author liuyang + */ + public static Map stringBdDefdocEntityHashMap = new HashMap<>(); + + private void initSourcePlatform() { + BdDefdocEntity bdDefdocEntity = new BdDefdocEntity(); + bdDefdocEntity.setPkDefdoclist("0001A210000000000JUD"); + bdDefdocEntity.setDr(0); + bdDefdocEntity.setDataSourceCode("lets_u8c"); + List bdDefdocEntityList = iBdDefdocDao.query(bdDefdocEntity); + if (bdDefdocEntityList != null && bdDefdocEntityList.size() > 0) { + for (int i = 0; i < bdDefdocEntityList.size(); i++) { + BdDefdocEntity bdDefdocEntity1 = bdDefdocEntityList.get(i); + stringBdDefdocEntityHashMap.put(bdDefdocEntity1.getDoccode(), bdDefdocEntity1); + } + } + } + + /** + * 清理缓存 + * + * @author liuyang + */ + public void clearCache() throws Exception { + stringBdCorpEntityMap.clear(); + stringBdStordocEntityMap.clear(); + stringBdCalbodyEntityMap.clear(); + stringBdSalestruEntityMap.clear(); + stringBdDeptdocEntityMap.clear(); + stringBdCumandocEntityMap.clear(); + stringBdInvmandocEntityMap.clear(); + stringBdInvbasdocEntityHashMap.clear(); + stringBdTaxitemsEntityHashMap.clear(); + stringBdCubasdocEntityHashMap.clear(); + stringBdDefdocEntityHashMap.clear(); + } + + /** + * 初始化缓存 + * + * @author liuyang + */ + public void initCache() throws Exception { + clearCache(); + + initShop(); + initBdStordoc(); + initBdCalbody(); + initBdSalestru(); + initDept(); + initBdCumandoc(); + initInventoryFile(); + initBasicInventoryFile(); + initBdTaxitemsEntity(); + initBdCubasdoc(); + initSourcePlatform(); + } +} \ No newline at end of file diff --git a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-dao.xml index 8ab565b9..4ccb3ef3 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-dao.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-dao.xml @@ -43,6 +43,8 @@ - - + + + + \ No newline at end of file diff --git a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-service.xml index 672b652c..a0035994 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-service.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-service.xml @@ -3,4 +3,7 @@ + + + \ No newline at end of file diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java index 0779f3b9..a506b7b7 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToCTest.java @@ -7,8 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import static org.junit.jupiter.api.Assertions.*; - /** * @Author:liuyang * @Package:com.hzya.frame.plugin.lets.plugin.sales diff --git a/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java b/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java index bfff6757..ed8033b9 100644 --- a/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java +++ b/service/src/main/java/com/hzya/frame/ttxofs/basics/ApiDtoCacheMap.java @@ -2,8 +2,10 @@ package com.hzya.frame.ttxofs.basics; import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.SaleOutReturnMessageDto; import com.hzya.frame.ttxofs.dto.ofssalesordersearch.SaleReturnMessageDto; +import com.hzya.frame.ttxofs.dto.returngoodsearch.RertunGoodsRootBean; import java.util.HashMap; +import java.util.Map; /** * api与dto的对应关系 @@ -17,10 +19,11 @@ import java.util.HashMap; */ public class ApiDtoCacheMap { - public static final HashMap apiDtoCacheMap = new HashMap(); + public static final Map apiDtoCacheMap = new HashMap(); static { apiDtoCacheMap.put("ofs.salesOrder.search", new SaleReturnMessageDto()); apiDtoCacheMap.put("ofs.shipment.search", new SaleOutReturnMessageDto()); + apiDtoCacheMap.put("ofs.receipt.search", new RertunGoodsRootBean()); } } diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/RertunGoodsRootBean.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/RertunGoodsRootBean.java new file mode 100755 index 00000000..1f92c0f0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/RertunGoodsRootBean.java @@ -0,0 +1,22 @@ +/** + * Copyright 2024 bejson.com + */ +package com.hzya.frame.ttxofs.dto.returngoodsearch; + +import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; +import lombok.Data; + +import java.util.List; + +/** + * Auto-generated: 2024-08-09 10:15:6 + * + * @author bejson.com (i@bejson.com) + * @website http://www.bejson.com/java2pojo/ + */ +@Data +public class RertunGoodsRootBean extends ReturnMessageBasics { + + private List data; + +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodHeaderDetailsDataDto.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodHeaderDetailsDataDto.java new file mode 100755 index 00000000..82e281e4 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodHeaderDetailsDataDto.java @@ -0,0 +1,22 @@ +/** + * Copyright 2024 bejson.com + */ +package com.hzya.frame.ttxofs.dto.returngoodsearch; + +import lombok.Data; + +import java.util.List; + +/** + * Auto-generated: 2024-08-09 10:15:6 + * + * @author bejson.com (i@bejson.com) + * @website http://www.bejson.com/java2pojo/ + */ +@Data +public class ReturnGoodHeaderDetailsDataDto { + + private ReturnGoodSearchHeaderDto header; + private List details; + +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchDetailsDto.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchDetailsDto.java new file mode 100755 index 00000000..5cc3b7d4 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchDetailsDto.java @@ -0,0 +1,46 @@ +/** + * Copyright 2024 bejson.com + */ +package com.hzya.frame.ttxofs.dto.returngoodsearch; + +import lombok.Data; + +/** + * Auto-generated: 2024-08-09 10:15:6 + * + * @author bejson.com (i@bejson.com) + * @website http://www.bejson.com/java2pojo/ + */ +@Data +public class ReturnGoodSearchDetailsDto { + + private String id; + private String receiptId; + private String receiptCode; + private String refOrderId; + private String refOrderDetailId; + private String sourceOrderCode; + private String clientCode; + private String companyCode; + private String facilityCode; + private String skuCode; + private String skuName; + private String requestQty; + private String receivedQty; + private String openQty; + private String quantityUM; + private String totalWeight; + private String totalVolume; + private String totalVolumeWeight; + private String totalAmount; + private String weightUM; + private String volumeUM; + private String inventorySts; + private String inTransInvId; + private String closed; + private String created; + private String createdBy; + private String lastUpdated; + private String lastUpdatedBy; + private String discountPrice; +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchHeaderDto.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchHeaderDto.java new file mode 100755 index 00000000..771ef316 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/returngoodsearch/ReturnGoodSearchHeaderDto.java @@ -0,0 +1,67 @@ +/** + * Copyright 2024 bejson.com + */ +package com.hzya.frame.ttxofs.dto.returngoodsearch; + +import lombok.Data; + +/** + * Auto-generated: 2024-08-09 10:15:6 + * + * @author bejson.com (i@bejson.com) + * @website http://www.bejson.com/java2pojo/ + */ +@Data +public class ReturnGoodSearchHeaderDto { + + private String id; + private String clientCode; + private String companyCode; + private String storeCode; + private String facilityCode; + private String code; + private String internalInstructionType; + private String bizChannel; + private String refOrderId; + private String refOrderCode; + private String refOrderType; + private String closed; + private String closedBy; + private String status; + private String allowOverReceive; + private String shipFromAttentionTo; + private String shipFromAddress; + private String shipFromCountry; + private String shipFromState; + private String shipFromCity; + private String shipFromDistrict; + private String shipFromMobile; + private String totalLines; + private String totalQty; + private String totalAmount; + private String totalWeight; + private String totalVolume; + private String totalVolumeWeight; + private String totalFulfillAmount; + private String totalFulfillWeight; + private String totalFulfillVolume; + private String totalFulfillVolumeWeight; + private String totalFulfillQty; + private String totalCases; + private String totalContainers; + private String closeAtQty; + private String quantityUM; + private String weightUM; + private String volumeUM; + private String checkInFrom; + private String checkInTo; + private String closedAt; + private String sourcePlatformCode; + private String sourceOrderCode; + private String created; + private String createdBy; + private String lastUpdated; + private String lastUpdatedBy; + private String returnWaybillCode; + private String returnCarrier; +} \ No newline at end of file