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 7862949d..4fea5148 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 @@ -849,7 +849,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) { try { // 查询基本档案 - List sonDetailsDtoList = queryBasicArchivesStock(headerDetailsDtos); + String sceneType = "stock"; + List sonDetailsDtoList = queryBasicArchivesStock(headerDetailsDtos, sceneType); // 分组汇总 Map> summaryDimensionMap = groupSummaryStock(sonDetailsDtoList); // 查询U8C业务流程 @@ -1201,7 +1202,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { * * @author liuyang */ - private List queryBasicArchivesStock(List headerDetailsDtoList) { + private List queryBasicArchivesStock(List headerDetailsDtoList, String sceneType) { + Assert.notNull(headerDetailsDtoList, "headerDetailsDtoList不能为空!"); + Assert.notNull(sceneType, "sceneType不能为空!"); + List sonDetailsDtoList = new ArrayList<>(); List errorHeaderDetailsDtoDtoList = new ArrayList<>(); @@ -1243,7 +1247,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { // String corpName = "上海丽知品牌管理有限公司"; String companyCode = header.getCompanyCode(); Assert.notNull(companyCode, "O出库单表头货主不能为空!"); - + //查找是否替换公司 String targetCorp = comparisonCompanyArchives.get(companyCode); if (targetCorp != null) { @@ -1407,10 +1411,16 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { } else { logger.info("queryBasicArchives方法headerDetailsDtoList.size为0"); } - + //批量把错误写入到日志信息表 if (errorHeaderDetailsDtoDtoList.size() > 0) { - updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiryV2(errorHeaderDetailsDtoDtoList); + if (sceneType.equals("stock")) { + updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry(errorHeaderDetailsDtoDtoList); + } else if (sceneType.equals("tran")) { + updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiryV2(errorHeaderDetailsDtoDtoList); + } else { + Assert.state(false, "无法识别的场景类型:stock、tran"); + } } return sonDetailsDtoList; } @@ -1801,7 +1811,8 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { if (headerDetailsDtos != null && headerDetailsDtos.size() > 0) { try { //查询基本档案 - List sonDetailsDtoList = queryBasicArchivesStock(headerDetailsDtos); + String sceneType = "tran"; + List sonDetailsDtoList = queryBasicArchivesStock(headerDetailsDtos, sceneType); //分组汇总:红蓝 Map> summaryDimensionMap = groupSummaryStock(sonDetailsDtoList); //分组汇总:蓝 diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java index 6ec295c5..93a44c8a 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java @@ -109,8 +109,8 @@ class SoSaleOutPluginInitializerToCTest { // String aaa = "LETS-SH2024101900022025"; // soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran"); - String aaa = "LETS-SH2024102200217857"; - soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "stock"); + String aaa = "LETS-SH2024102900016893"; + soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran"); // soSaleOutPluginInitializerToC.startImplementTranByTime("2024-10-26 18:20:09","2024-10-26 18:20:09"); } catch (Exception e) { diff --git a/service/src/main/java/com/hzya/frame/report/lets/dao/ITocofsSaleoutDetailedDao.java b/service/src/main/java/com/hzya/frame/report/lets/dao/ITocofsSaleoutDetailedDao.java index 20df612b..c9d8a2a9 100644 --- a/service/src/main/java/com/hzya/frame/report/lets/dao/ITocofsSaleoutDetailedDao.java +++ b/service/src/main/java/com/hzya/frame/report/lets/dao/ITocofsSaleoutDetailedDao.java @@ -1,6 +1,8 @@ package com.hzya.frame.report.lets.dao; import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.report.lets.dto.TobofsSaleoutDetailedDto; +import com.hzya.frame.report.lets.dto.TocofsSaleoutDetailedDto; import com.hzya.frame.report.lets.entity.TocofsSaleoutDetailedEntity; import java.util.List; @@ -12,5 +14,18 @@ import java.util.List; * @since 2024-09-04 17:48:28 */ public interface ITocofsSaleoutDetailedDao extends IBaseDao { + /** + * TOC销售报表导出 + * + * @author liuyang + */ + List queryEntityListBaseToc(TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity) throws Exception; + + /** + * TOB销售报表导出 + * + * @author liuyang + */ + List queryEntityListBaseTob(TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity) throws Exception; } diff --git a/service/src/main/java/com/hzya/frame/report/lets/dao/impl/TocofsSaleoutDetailedDaoImpl.java b/service/src/main/java/com/hzya/frame/report/lets/dao/impl/TocofsSaleoutDetailedDaoImpl.java index dd8dd923..cb8b8a0a 100644 --- a/service/src/main/java/com/hzya/frame/report/lets/dao/impl/TocofsSaleoutDetailedDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/report/lets/dao/impl/TocofsSaleoutDetailedDaoImpl.java @@ -2,9 +2,13 @@ package com.hzya.frame.report.lets.dao.impl; import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.report.lets.dao.ITocofsSaleoutDetailedDao; +import com.hzya.frame.report.lets.dto.TobofsSaleoutDetailedDto; +import com.hzya.frame.report.lets.dto.TocofsSaleoutDetailedDto; import com.hzya.frame.report.lets.entity.TocofsSaleoutDetailedEntity; import org.springframework.stereotype.Repository; +import java.util.List; + /** * O出库单明细表(TOC、TOB业务底表)(TocofsSaleoutDetailed)表数据库访问层 * @@ -13,4 +17,13 @@ import org.springframework.stereotype.Repository; */ @Repository(value = "tocofsSaleoutDetailedDaoImplReport") public class TocofsSaleoutDetailedDaoImpl extends MybatisGenericDao implements ITocofsSaleoutDetailedDao { + @Override + public List queryEntityListBaseToc(TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity) throws Exception { + return (List) selectList("com.hzya.frame.report.lets.dao.impl.TocofsSaleoutDetailedDaoImpl.entity_list_base_toc", tocofsSaleoutDetailedEntity); + } + + @Override + public List queryEntityListBaseTob(TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity) throws Exception { + return (List) selectList("com.hzya.frame.report.lets.dao.impl.TocofsSaleoutDetailedDaoImpl.entity_list_base_tob", tocofsSaleoutDetailedEntity); + } } \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/report/lets/dto/TobofsSaleoutDetailedDto.java b/service/src/main/java/com/hzya/frame/report/lets/dto/TobofsSaleoutDetailedDto.java new file mode 100644 index 00000000..d6810603 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/report/lets/dto/TobofsSaleoutDetailedDto.java @@ -0,0 +1,82 @@ +package com.hzya.frame.report.lets.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * TOB销售Excel报表导出 + * + * @Author:liuyang + * @Package:com.hzya.frame.report.lets.dto + * @Project:kangarooDataCenterV3 + * @name:TocofsSaleoutDetailedDto + * @Date:2024/10/30 14:59 + * @Filename:TocofsSaleoutDetailedDto + */ +@Data +public class TobofsSaleoutDetailedDto { + + @ExcelProperty(value = "O出库明细主键") + private String id; + + @ExcelProperty(value = "O货主编码") + private String headCompanyCode; + + @ExcelProperty(value = "O仓库编码") + private String headFacilityCode; + + @ExcelProperty(value = "O平台编码") + private String headSourcePlatformCode; + + @ExcelProperty(value = "O店铺编码") + private String headStoreCode; + + @ExcelProperty(value = "O销售出库编码") + private String headCode; + + @ExcelProperty(value = "O货品sku") + private String skucode; + + @ExcelProperty(value = "O货品名称") + private String skuname; + + @ExcelProperty(value = "O实发数量") + private String shipqty; + + @ExcelProperty(value = "O中台业务类型") + private String businesstype; + + //库存 开始 + @ExcelProperty(value = "库存-推送状态") + private String newstate; + + @ExcelProperty(value = "库存-推送时间") + private String newpushdate; + + @ExcelProperty(value = "库存-报错详情") + private String newtransmitinfo; + + @ExcelProperty(value = "库存-U8C单号") + private String newsystemnumber; + + @ExcelProperty(value = "库存-U8C主键") + private String newsystemprimary; + //库存 结束 + + //TOB交易红 开始 + @ExcelProperty(value = "交易-推送状态") + private String newstate4; + + @ExcelProperty(value = "交易-推送时间") + private String def5; + + @ExcelProperty(value = "交易-报错详情") + private String def6; + + @ExcelProperty(value = "交易-U8C单号") + private String newsystemnumber4; + + @ExcelProperty(value = "交易-U8C主键") + private String newsystemprimary4; + //TOB交易红 结束 +} \ No newline at end of file diff --git a/service/src/main/java/com/hzya/frame/report/lets/dto/TocofsSaleoutDetailedDto.java b/service/src/main/java/com/hzya/frame/report/lets/dto/TocofsSaleoutDetailedDto.java new file mode 100644 index 00000000..1416a704 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/report/lets/dto/TocofsSaleoutDetailedDto.java @@ -0,0 +1,99 @@ +package com.hzya.frame.report.lets.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +/** + * TOC销售Excel报表导出 + * + * @Author:liuyang + * @Package:com.hzya.frame.report.lets.dto + * @Project:kangarooDataCenterV3 + * @name:TocofsSaleoutDetailedDto + * @Date:2024/10/30 14:59 + * @Filename:TocofsSaleoutDetailedDto + */ +@Data +public class TocofsSaleoutDetailedDto { + + @ExcelProperty(value = "O出库明细主键") + private String id; + + @ExcelProperty(value = "O货主编码") + private String headCompanyCode; + + @ExcelProperty(value = "O仓库编码") + private String headFacilityCode; + + @ExcelProperty(value = "O平台编码") + private String headSourcePlatformCode; + + @ExcelProperty(value = "O店铺编码") + private String headStoreCode; + + @ExcelProperty(value = "O销售出库编码") + private String headCode; + + @ExcelProperty(value = "O货品sku") + private String skucode; + + @ExcelProperty(value = "O货品名称") + private String skuname; + + @ExcelProperty(value = "O实发数量") + private String shipqty; + + @ExcelProperty(value = "O中台业务类型") + private String businesstype; + + //库存 开始 + @ExcelProperty(value = "库存-推送状态") + private String newstate; + + @ExcelProperty(value = "库存-推送时间") + private String newpushdate; + + @ExcelProperty(value = "库存-报错详情") + private String newtransmitinfo; + + @ExcelProperty(value = "库存-U8C单号") + private String newsystemnumber; + + @ExcelProperty(value = "库存-U8C主键") + private String newsystemprimary; + //库存 结束 + + //交易红 开始 + @ExcelProperty(value = "交易红-推送状态") + private String newstate2; + + @ExcelProperty(value = "交易红-推送时间") + private String def1; + + @ExcelProperty(value = "交易红-报错详情") + private String def2; + + @ExcelProperty(value = "交易红-U8C单号") + private String newsystemnumber2; + + @ExcelProperty(value = "交易红-U8C主键") + private String newsystemprimary2; + //交易红 结束 + + //交易蓝 开始 + @ExcelProperty(value = "交易蓝-推送状态") + private String newstate3; + + @ExcelProperty(value = "交易蓝-推送时间") + private String def3; + + @ExcelProperty(value = "交易蓝-报错详情") + private String def4; + + @ExcelProperty(value = "交易蓝-U8C单号") + private String newsystemnumber4; + + @ExcelProperty(value = "交易蓝-U8C主键") + private String newsystemprimary4; + //交易蓝 结束 +} diff --git a/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.java b/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.java index b5d38445..9eb08e7f 100644 --- a/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.java +++ b/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.java @@ -1,5 +1,6 @@ package com.hzya.frame.report.lets.entity; +import com.alibaba.excel.annotation.ExcelProperty; import com.hzya.frame.web.entity.BaseEntity; import lombok.Data; diff --git a/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.xml b/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.xml index 2354b0c4..e96e6bec 100644 --- a/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.xml +++ b/service/src/main/java/com/hzya/frame/report/lets/entity/TocofsSaleoutDetailedEntity.xml @@ -191,7 +191,9 @@ ,def39 ,def40 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +