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 7fac033d..200c60b4 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 @@ -4064,16 +4064,19 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //通过「O销售出库单表头」匹配「底表O销售出库单明细行」 if (allTocofsSaleoutEntityList.size() > 0) { + Map> stringListMap = convertToMap(tocofsSaleoutDetailedEntityList); + for (int i = 0; i < allTocofsSaleoutEntityList.size(); i++) { TocofsSaleoutEntity tocofsSaleoutEntity = allTocofsSaleoutEntityList.get(i); - List tocofsSaleoutDetailedEntityList1 = new ArrayList<>(); - for (int j = 0; j < tocofsSaleoutDetailedEntityList.size(); j++) { - TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity1 = tocofsSaleoutDetailedEntityList.get(j); - if (tocofsSaleoutDetailedEntity1.getMaintableid().equals(tocofsSaleoutEntity.getId())) { - tocofsSaleoutDetailedEntityList1.add(tocofsSaleoutDetailedEntity1); - } - } - tocofsSaleoutEntity.setTocofsSaleoutDetailedEntityList(tocofsSaleoutDetailedEntityList1); +// List tocofsSaleoutDetailedEntityList1 = new ArrayList<>(); +// for (int j = 0; j < tocofsSaleoutDetailedEntityList.size(); j++) { +// TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity1 = tocofsSaleoutDetailedEntityList.get(j); +// if (tocofsSaleoutDetailedEntity1.getMaintableid().equals(tocofsSaleoutEntity.getId())) { +// tocofsSaleoutDetailedEntityList1.add(tocofsSaleoutDetailedEntity1); +// } +// } + List tocofsSaleoutDetailedEntities = stringListMap.get(tocofsSaleoutEntity.getId()); + tocofsSaleoutEntity.setTocofsSaleoutDetailedEntityList(tocofsSaleoutDetailedEntities); } } @@ -4107,6 +4110,15 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { return headerDetailsDtoList; } + public static Map> convertToMap(List list) { + Map> map = new HashMap<>(); + for (TocofsSaleoutDetailedEntity entity : list) { + String maintableid = entity.getMaintableid(); + map.computeIfAbsent(maintableid, k -> new ArrayList<>()).add(entity); + } + return map; + } + /** * 过滤掉没有交易成功时间的明细行数据 * 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 18e8e5da..4e5607f8 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 @@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.WebappApplication; import com.hzya.frame.plugin.lets.constant.OverallConstant; import com.hzya.frame.plugin.lets.dao.ISoSaleinvoiceDao; +import com.hzya.frame.plugin.lets.entity.BdBusitypeEntity; import com.hzya.frame.plugin.lets.entity.SoSaleinvoiceEntity; import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao; import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity; @@ -15,6 +16,7 @@ import com.hzya.frame.plugin.lets.u8cdto.ErrorHeaderDetailsDtoDto; import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto; import com.hzya.frame.plugin.lets.u8cdto.SoSaleResultRootDto; import com.hzya.frame.plugin.lets.util.OfsStandardUtil; +import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +49,9 @@ class SoSaleOutPluginInitializerToCTest { @Autowired private OfsStandardUtil ofsStandardUtil; + @Autowired + private QueryBdBusitypeUtil queryBdBusitypeUtil; + @Test void startImplement() throws Exception { // soSaleOutPluginInitializerToC.startImplement(null, null); @@ -109,7 +114,7 @@ class SoSaleOutPluginInitializerToCTest { // String code = "LETS-SH2024052100015139"; // soSaleOutPluginInitializerToC.startImplementStockByCode(code, "tran"); -// soSaleOutPluginInitializerToC.startImplementStockByTimeAndTran("2024-10-22 00:00:00", "2024-10-22 23:59:59"); + soSaleOutPluginInitializerToC.startImplementStockByTime("2025-01-01 22:25:21", "2025-01-01 22:25:21","1"); // JSONObject jsonObject = new JSONObject(); // soSaleOutPluginInitializerToC.executeBusiness(jsonObject); @@ -120,7 +125,7 @@ class SoSaleOutPluginInitializerToCTest { // String aaa = "LETS-SH2024102800021196"; // soSaleOutPluginInitializerToC.startImplementTranByTime("2025-01-04 15:48:02", "2025-01-04 15:48:02", "0"); - soSaleOutPluginInitializerToC.startImplementTranByTime("2025-01-04 15:48:02", "2025-01-04 15:48:02", "2"); +// soSaleOutPluginInitializerToC.startImplementTranByTime("2025-01-04 15:48:02", "2025-01-04 15:48:02", "2"); } catch (Exception e) { e.printStackTrace(); } @@ -132,6 +137,10 @@ class SoSaleOutPluginInitializerToCTest { // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2025011300024220", "tran"); // soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2025012300026949", "tran"); + +// String processName = "TOC确认收入"; +// BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName); +// System.out.println(bdBusitypeEntity.getPkBusitype()); } catch (Exception e) { e.printStackTrace(); }