From 6151c3f335ec7f4263f775d2bf8c607f07c7464c Mon Sep 17 00:00:00 2001 From: Wei Lin Date: Wed, 6 Mar 2024 15:24:01 +0800 Subject: [PATCH] Fix propInfo.Key missing --- samples/xlsx/TestIssue24020201.xlsx | Bin 0 -> 8964 bytes .../OpenXml/ExcelOpenXmlTemplate.Impl.cs | 12 +++-- tests/MiniExcelTests/MiniExcelIssueTests.cs | 45 ++++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 samples/xlsx/TestIssue24020201.xlsx diff --git a/samples/xlsx/TestIssue24020201.xlsx b/samples/xlsx/TestIssue24020201.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..c1098b2f3fbf36e3d33a76b2a24ae34da74b30fb GIT binary patch literal 8964 zcmeHtg_x4D4Bc0MA&49FoFr8p z*WIjRNCo8S=-Os(BBO|P)O)d)NkS#fM`2_XX^{#@cBpF86qJL@fC?!gr1vF#m(ypu zo)Io|*5G{B%MA-bMC&2;U^7-=UVKh znl+A>Ny?2*Y}Eo2#%4(0d4r-G@a6{>(CQk2w5o!XrTJmUpY=MUZ8)2}UV3>nvAqpH z*0`({CWRPr>t{&&G5C*80W@sF%kLNQ+YP;Lmm>YB(zoAAKYzsxC#G&+pfaz`h>A8> zBWJYbTKv?NA*U`12>hV zV)qX*&+Xw={eazr#2-HVw`c&s-5oMO<8QRA(BXY>jKG=-f_2ykS{gZmp-wyxf7|{` z$Nymt{^iySV^!7LcyWUE6t9E3&nD)h2_7rE$|%+`XnXrA&EZ!>eq^GWZ(^k;(54JP ze&W;Mecd}dFCMws&2YLTSQt)3BKDxtwJ0d*(%}_42a98(fr{R5-SoWp-o#_AouZ(UDq!Yj z+)%2|WMa+_T&WOImF>|K(rzbH%jsgTZYaaa1*MJ_MAWLpG{f-`qq~tgwE0LbwTbw~ zi(4(NTa!_c=$wD(Nf&eGiH}~n;6Y!ydpi)bt)P3q$3L7d?>j=F{z;OqhK_Ik$N)ee zLdx(FPsR<(;|g=MF@?c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Key(propNames[1])) + { + v.InnerText = v.InnerText.Replace($"{{{{{propNames[0]}.{propNames[1]}}}}}", ""); + continue; + throw new InvalidDataException($"{propNames[0]} doesn't have {propNames[1]} property"); + } // auto check type https://github.com/shps951023/MiniExcel/issues/177 var prop = xRowInfo.PropsMap[propNames[1]]; var type = prop.UnderlyingTypePropType; //avoid nullable - // - if (!xRowInfo.PropsMap.ContainsKey(propNames[1])) - throw new InvalidDataException($"{propNames[0]} doesn't have {propNames[1]} property"); if (isMultiMatch) { diff --git a/tests/MiniExcelTests/MiniExcelIssueTests.cs b/tests/MiniExcelTests/MiniExcelIssueTests.cs index 862d46b4..5965a243 100644 --- a/tests/MiniExcelTests/MiniExcelIssueTests.cs +++ b/tests/MiniExcelTests/MiniExcelIssueTests.cs @@ -35,6 +35,51 @@ public MiniExcelIssueTests(ITestOutputHelper output) } + [Fact] + public void TestIssue24020201() + { + { + var json = "{\"enChecker\":null,\"enCheckTime\":null,\"poChecker\":null,\"poCheckTime\":null,\"busChecker\":null,\"busCheckTime\":null,\"createrName\":\"张贝贝\",\"prd_no\":\"\",\"qty\":0,\"RMB\":\"4.22\",\"USD\":\"0.639\",\"FX\":6.6,\"img_id\":\"5fa2b87a-504b-425f-a511-cb301ad54386\",\"bil_date\":\"2024-02-29\",\"version\":1,\"cst_material\":\"2.52514\",\"cst_man\":\"0.74209\",\"cst_eqp\":\"0.66373\",\"cst_os\":\"0\",\"cst\":0,\"markupPercent\":0,\"SaleUSD\":\"0.804\",\"GP\":\"25.82\",\"prdt_snm\":\"Pure 7 ML\",\"prdt_spc\":\"21.86*103.90\",\"saleman\":\"Kelly\",\"product_type\":\"Gloss\",\"Messrs\":\"HCT-CA\",\"Items\":\"PET Chubby 7ml\",\"Attn\":\"Jenna Peskin\",\"upGroups\":[{\"group\":1,\"cst_material\":\"2.52514\",\"cst_man\":\"0.74209\",\"cst_eqp\":\"0.66373\",\"cst_os\":\"0\",\"cst_material_percent\":\"60%\",\"cst_man_percent\":\"18%\",\"cst_eqp_percent\":\"22%\",\"cst_os_percent\":\"0%\",\"cst_cost\":\"3.93096\",\"RMB\":\"4.22\",\"USD\":\"0.639\",\"SaleUSD\":\"0.804\",\"GP\":\"25.82\",\"select\":true,\"mo1_crafts\":\"2.4891\",\"mo1_crafts_cost_markup\":\"2.6117\",\"mo1_crafts_scrap_usd\":\"0.3957\",\"mo1_crafts_markup_usd\":\"0.4948\",\"build_crafts\":\"0.114\",\"build_crafts_cost_markup\":\"0.1174\",\"build_crafts_scrap_usd\":\"0.018\",\"build_crafts_markup_usd\":\"0.027\",\"waiGouJian\":\"0.115\",\"waiGouJian_cost_markup\":\"0.1185\",\"waiGouJian_scrap_usd\":\"0.018\",\"waiGouJian_markup_usd\":\"0.0225\",\"packaging_materials\":\"0.0615\",\"packaging_materials_cost_markup\":\"0.0615\",\"packaging_materials_scrap_usd\":\"0.0093\",\"packaging_materials_markup_usd\":\"0.0125\",\"mo2_crafts\":\"0.272334\",\"mo2_crafts_cost_markup\":\"0.2805\",\"mo2_crafts_scrap_usd\":\"0.042\",\"mo2_crafts_markup_usd\":\"0.0525\",\"mo3_crafts\":\"1.0006\",\"mo3_crafts_cost_markup\":\"1.0306\",\"mo3_crafts_scrap_usd\":\"0.156\"}],\"scrapGroups\":[{\"group\":1,\"rem\":\"注塑 PET\",\"scrap_percent\":\"5\"},{\"group\":2,\"rem\":\"注塑 LDPE\",\"scrap_percent\":\"2\"},{\"group\":3,\"rem\":\"电镀\",\"scrap_percent\":\"3\"},{\"group\":4,\"rem\":\"喷漆\",\"scrap_percent\":\"3\"},{\"group\":5,\"rem\":\"外购件\",\"scrap_percent\":\"3\"},{\"group\":6,\"rem\":\"丝印/烫金\",\"scrap_percent\":\"3\"},{\"group\":7,\"rem\":\"组装\",\"scrap_percent\":\"3\"},{\"group\":8,\"rem\":\"包装\",\"scrap_percent\":\"0\"}],\"mo1_crafts\":[{\"group\":\"common\",\"部件名称\":\"cap\",\"物料描述\":\"PET 252\",\"配比\":\"100%\",\"产品单重\":\"0.0060\",\"预估流道总重量\":\"0.06800\",\"预估流道平均单重\":0.0085,\"计划注塑消耗流道比例\":\"15\",\"计划消耗水口占产品比例\":21.25,\"实际报价水口重量\":0.0072,\"物料单价\":\"20.850\",\"色粉成本\":\"0.0174\",\"穴位\":\"8\",\"周期\":\"53\",\"机台费用\":\"1600\",\"物料费\":0.28,\"注塑费\":0.08,\"人工费\":0.05,\"人数\":\"1\",\"ScrapGroup\":1,\"实际金额\":\"0.4212\",\"小计金额\":\"0.4423\",\"小计美金\":\"0.0670\",\"MarkupPercent\":25,\"售价美金\":\"0.0838\",\"rowid\":\"id286a0bb52df2b\",\"人工金额\":\"0.04600694444444445\",\"物料金额\":\"0.29314125\",\"制造金额\":\"0.08201237922705314\",\"priceGroup\":[1]},{\"group\":\"common\",\"部件名称\":\"cap\",\"物料描述\":\"PET 8818\",\"配比\":\"100%\",\"产品单重\":\"0.0060\",\"预估流道总重量\":\"0.06800\",\"预估流道平均单重\":0.0085,\"计划注塑消耗流道比例\":\"15\",\"计划消耗水口占产品比例\":21.25,\"实际报价水口重量\":0.0072,\"物料单价\":\"10.650\",\"色粉成本\":\"0.0174\",\"穴位\":\"8\",\"周期\":\"55\",\"机台费用\":\"1600\",\"物料费\":0.14,\"注塑费\":0.09,\"人工费\":0.05,\"人数\":\"1\",\"ScrapGroup\":1,\"实际金额\":\"0.2911\",\"小计金额\":\"0.3057\",\"小计美金\":\"0.0463\",\"MarkupPercent\":25,\"售价美金\":\"0.0579\",\"rowid\":\"id654aae8af42ff\",\"人工金额\":\"0.04774305555555555\",\"物料金额\":\"0.15824625\",\"制造金额\":\"0.08510718599033816\",\"priceGroup\":[\"N/A\"]},{\"group\":\"common\",\"部件名称\":\"stem\",\"物料描述\":\"PET 252\",\"配比\":\"100%\",\"产品单重\":\"0.0036\",\"预估流道总重量\":\"0.01600\",\"预估流道平均单重\":0.002,\"计划注塑消耗流道比例\":\"40\",\"计划消耗水口占产品比例\":22.22,\"实际报价水口重量\":0.0012,\"物料单价\":\"20.850\",\"色粉成本\":\"0.00672\",\"穴位\":\"8\",\"周期\":\"38\",\"机台费用\":\"1600\",\"物料费\":0.10,\"注塑费\":0.06,\"人工费\":0.03,\"人数\":\"0.5\",\"ScrapGroup\":1,\"实际金额\":\"0.1986\",\"小计金额\":\"0.2085\",\"小计美金\":\"0.0316\",\"MarkupPercent\":25,\"售价美金\":\"0.0395\",\"rowid\":\"id4307fdb7a6e09\",\"人工金额\":\"0.03298611111111111\",\"物料金额\":\"0.1068\",\"制造金额\":\"0.058801328502415456\",\"priceGroup\":[2]},{\"group\":\"common\",\"部件名称\":\"stem\",\"物料描述\":\"PET 8818\",\"配比\":\"100%\",\"产品单重\":\"0.0036\",\"预估流道总重量\":\"0.01600\",\"预估流道平均单重\":0.002,\"计划注塑消耗流道比例\":\"40\",\"计划消耗水口占产品比例\":22.22,\"实际报价水口重量\":0.0012,\"物料单价\":\"10.650\",\"色粉成本\":\"0.00672\",\"穴位\":\"8\",\"周期\":\"40\",\"机台费用\":\"1600\",\"物料费\":0.05,\"注塑费\":0.06,\"人工费\":0.03,\"人数\":\"0.5\",\"ScrapGroup\":1,\"实际金额\":\"0.1545\",\"小计金额\":\"0.1622\",\"小计美金\":\"0.0246\",\"MarkupPercent\":25,\"售价美金\":\"0.0308\",\"rowid\":\"id272c74c7e89cd\",\"人工金额\":\"0.034722222222222224\",\"物料金额\":\"0.05784\",\"制造金额\":\"0.06189613526570048\",\"priceGroup\":[2]},{\"group\":\"common\",\"部件名称\":\"wiper\",\"物料描述\":\"LDPE(951-050)\",\"配比\":\"100%\",\"产品单重\":\"0.0008\",\"预估流道总重量\":\"0.00535\",\"预估流道平均单重\":0.0007,\"计划注塑消耗流道比例\":\"35\",\"计划消耗水口占产品比例\":29.26,\"实际报价水口重量\":0.0004,\"物料单价\":\"9.36\",\"色粉成本\":\"0.0017625\",\"穴位\":\"8\",\"周期\":\"20\",\"机台费用\":\"1600\",\"物料费\":0.01,\"注塑费\":0.03,\"人工费\":0.02,\"人数\":\"0.5\",\"ScrapGroup\":2,\"实际金额\":\"0.0616\",\"小计金额\":\"0.0628\",\"小计美金\":\"0.0095\",\"MarkupPercent\":25,\"售价美金\":\"0.0119\",\"rowid\":\"idd0fd637f22719\",\"人工金额\":\"0.017361111111111112\",\"物料金额\":\"0.013319175\",\"制造金额\":\"0.03094806763285024\",\"priceGroup\":[11]},{\"group\":\"common\",\"部件名称\":\"BOTTLE\",\"物料描述\":\"PET 252\",\"配比\":\"100%\",\"产品单重\":\"0.0265\",\"预估流道总重量\":\"0.0265\",\"预估流道平均单重\":0.0033,\"计划注塑消耗流道比例\":\"100\",\"计划消耗水口占产品比例\":12.5,\"实际报价水口重量\":0.0,\"物料单价\":\"20.850\",\"色粉成本\":\"0.035775\",\"穴位\":\"8\",\"周期\":\"65\",\"机台费用\":\"1600\",\"物料费\":0.55,\"注塑费\":0.10,\"人工费\":0.06,\"人数\":\"1\",\"ScrapGroup\":1,\"实际金额\":\"0.7453\",\"小计金额\":\"0.7826\",\"小计美金\":\"0.1186\",\"MarkupPercent\":25,\"售价美金\":\"0.1483\",\"rowid\":\"ida8c98ddb12484\",\"人工金额\":\"0.05642361111111111\",\"物料金额\":\"0.5883\",\"制造金额\":\"0.10058121980676328\",\"priceGroup\":[7]},{\"group\":\"common\",\"部件名称\":\"BOTTLE\",\"物料描述\":\"PET 256\",\"配比\":\"100%\",\"产品单重\":\"0.0265\",\"预估流道总重量\":\"0.0265\",\"预估流道平均单重\":0.0033,\"计划注塑消耗流道比例\":\"100\",\"计划消耗水口占产品比例\":12.5,\"实际报价水口重量\":0.0,\"物料单价\":\"16\",\"色粉成本\":\"0.035775\",\"穴位\":\"8\",\"周期\":\"65\",\"机台费用\":\"1600\",\"物料费\":0.42,\"注塑费\":0.10,\"人工费\":0.06,\"人数\":\"1\",\"ScrapGroup\":1,\"实际金额\":\"0.6168\",\"小计金额\":\"0.6476\",\"小计美金\":\"0.0981\",\"MarkupPercent\":25,\"售价美金\":\"0.1226\",\"rowid\":\"id26166479d52a2\",\"人工金额\":\"0.05642361111111111\",\"物料金额\":\"0.459775\",\"制造金额\":\"0.10058121980676328\",\"priceGroup\":[]}],\"mo2_crafts\":[{\"group\":\"common\",\"部件名\":\"CAP\",\"工序名\":\"S/S\",\"单价\":\"0.018\",\"产能\":\"600\",\"印刷工序数\":\"1\",\"设备费用\":\"20\",\"设备费件\":0.03,\"人工费件\":0.08,\"人数\":\"2\",\"ScrapGroup\":6,\"实际金额\":\"0.134667\",\"小计金额\":\"0.1387\",\"小计美金\":\"0.021\",\"MarkupPercent\":25,\"售价美金\":\"0.02625\",\"人工金额\":\"0.08333333333333333\",\"物料金额\":\"0.018\",\"制造金额\":\"0.03333333333333333\",\"priceGroup\":[4]},{\"group\":\"common\",\"部件名\":\"BOTTLE\",\"工序名\":\"S/S H/T\",\"单价\":\"0.021\",\"产能\":\"600\",\"印刷工序数\":\"1\",\"设备费用\":\"20\",\"设备费件\":0.03,\"人工费件\":0.08,\"人数\":\"2\",\"ScrapGroup\":6,\"实际金额\":\"0.137667\",\"小计金额\":\"0.1418\",\"小计美金\":\"0.021\",\"MarkupPercent\":25,\"售价美金\":\"0.02625\",\"人工金额\":\"0.08333333333333333\",\"物料金额\":\"0.021\",\"制造金额\":\"0.03333333333333333\",\"priceGroup\":[]}],\"mo3_crafts\":[{\"group\":\"common\",\"部件名称\":\"cap\",\"物料描述\":\"Primer\",\"材料重量\":\"1.8\",\"物料单价\":\"39.8\",\"人数\":\"16\",\"人工费\":0.05,\"喷涂费每道\":\"450\",\"生产数\":\"7700\",\"治具费\":\"0.05\",\"物料费\":\"0.07164\",\"喷涂费\":0.01,\"注塑部件费用\":\"0.4423\",\"部件损耗率\":\"13\",\"部件损耗\":\"0.08090960259740259733\",\"ScrapGroup\":3,\"实际金额\":\"0.2610\",\"小计金额\":\"0.2688\",\"小计美金\":\"0.041\",\"MarkupPercent\":25,\"售价美金\":\"0.05125\",\"人工金额\":\"0.05194805194805195\",\"物料金额\":\"0.2025496025974026\",\"制造金额\":\"0.006493506493506491\",\"部件id\":\"id286a0bb52df2b\",\"priceGroup\":[3]},{\"group\":\"common\",\"部件名称\":\"cap\",\"物料描述\":\"VM\",\"材料重量\":\"0.1\",\"物料单价\":\"270\",\"人数\":\"1\",\"人工费\":0.00,\"喷涂费每道\":\"100\",\"生产数\":\"7700\",\"物料费\":\"0.027\",\"喷涂费\":0.01,\"注塑部件费用\":\"0.4423\",\"部件损耗率\":\"13\",\"部件损耗\":\"0.06269731168831168831\",\"ScrapGroup\":3,\"实际金额\":\"0.1027\",\"小计金额\":\"0.1058\",\"小计美金\":\"0.016\",\"MarkupPercent\":25,\"售价美金\":\"0.02\",\"人工金额\":\"0.003246753246753247\",\"物料金额\":\"0.08969731168831169\",\"制造金额\":\"0.00974025974025974\",\"部件id\":\"id286a0bb52df2b\",\"priceGroup\":[3]},{\"group\":\"common\",\"部件名称\":\"cap\",\"物料描述\":\"UV\",\"材料重量\":\"1.8\",\"物料单价\":\"39.8\",\"人数\":\"16\",\"人工费\":0.05,\"喷涂费每道\":\"450\",\"生产数\":\"7700\",\"物料费\":\"0.07164\",\"喷涂费\":0.01,\"注塑部件费用\":\"0.4423\",\"部件损耗率\":\"13\",\"部件损耗\":\"0.07440960259740259733\",\"ScrapGroup\":3,\"实际金额\":\"0.2045\",\"小计金额\":\"0.2106\",\"小计美金\":\"0.032\",\"MarkupPercent\":25,\"售价美金\":\"0.04\",\"人工金额\":\"0.05194805194805195\",\"物料金额\":\"0.14604960259740259\",\"制造金额\":\"0.006493506493506491\",\"部件id\":\"id286a0bb52df2b\",\"priceGroup\":[3]},{\"group\":\"common\",\"部件名称\":\"BOTTLE\",\"物料描述\":\"UV\",\"材料重量\":\"2.2\",\"物料单价\":\"39.8\",\"人数\":\"16\",\"人工费\":0.05,\"喷涂费每道\":\"500\",\"生产数\":\"7700\",\"治具费\":\"0.05\",\"物料费\":\"0.08756\",\"喷涂费\":0.01,\"注塑部件费用\":\"0.7826\",\"部件损耗率\":\"3\",\"部件损耗\":\"0.02955285194805194802\",\"ScrapGroup\":4,\"实际金额\":\"0.2320\",\"小计金额\":\"0.2390\",\"小计美金\":\"0.036\",\"MarkupPercent\":25,\"售价美金\":\"0.045\",\"人工金额\":\"0.05194805194805195\",\"物料金额\":\"0.167112851948051947\",\"制造金额\":\"0.012987012987012984\",\"部件id\":\"ida8c98ddb12484\",\"priceGroup\":[14]},{\"group\":\"common\",\"部件名称\":\"cap\",\"物料描述\":\"UV\",\"材料重量\":\"2\",\"物料单价\":\"39.8\",\"人数\":\"16\",\"人工费\":0.04,\"喷涂费每道\":\"500\",\"生产数\":\"9600\",\"治具费\":\"0.05\",\"物料费\":\"0.0796\",\"喷涂费\":0.01,\"注塑部件费用\":\"0.4423\",\"部件损耗率\":\"3\",\"部件损耗\":\"0.01871950000000000002\",\"ScrapGroup\":4,\"实际金额\":\"0.2004\",\"小计金额\":\"0.2064\",\"小计美金\":\"0.031\",\"MarkupPercent\":25,\"售价美金\":\"0.03875\",\"人工金额\":\"0.041666666666666664\",\"物料金额\":\"0.1483195\",\"制造金额\":\"0.01041666666666667\",\"部件id\":\"id286a0bb52df2b\",\"priceGroup\":[]}],\"build_crafts\":[{\"group\":\"common\",\"产线类型\":\"盖流水线\",\"工序数\":\"4\",\"作业人数\":\"6\",\"时薪\":\"25\",\"人工费用\":\"150.000\",\"产能\":\"1800\",\"设备费用\":\"55\",\"ScrapGroup\":7,\"实际金额\":\"0.114\",\"小计金额\":\"0.1174\",\"小计美金\":\"0.018\",\"MarkupPercent\":\"50\",\"售价美金\":\"0.027\",\"人工金额\":\"0.083\",\"物料金额\":\"0\",\"制造金额\":\"0.031\",\"priceGroup\":[15]}],\"waiGouJian\":[{\"group\":\"common\",\"物件名称\":\"Foot\",\"规格\":\"0\",\"单价\":\"0.115\",\"用量\":\"1\",\"物料费\":\"0.115\",\"ScrapGroup\":5,\"实际金额\":\"0.115\",\"小计金额\":\"0.1185\",\"小计美金\":\"0.018\",\"MarkupPercent\":25,\"售价美金\":\"0.0225\",\"人工金额\":\"0\",\"物料金额\":\"0.115\",\"制造金额\":\"0\",\"priceGroup\":[\"N/A\"]}],\"packaging_materials\":[{\"group\":\"common\",\"物件名称\":\"成品外箱 outer box\",\"规格\":\"48.5*33.5*22.5CM(K=A)\",\"单价\":\"3.98\",\"装箱数\":\"616\",\"每一箱用量\":1.0,\"单位\":\"PCS\",\"物料费\":0.01,\"ScrapGroup\":8,\"实际金额\":0.01,\"小计金额\":\"0.0065\",\"小计美金\":\"0.000985\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.00132975\",\"物料金额\":\"0.006461038961038961039\",\"制造金额\":0,\"priceGroup\":[15]},{\"group\":\"common\",\"物件名称\":\"防水袋 waterproof bag\",\"规格\":\"0.3*(13+21)*26MM\",\"单价\":\"0.44\",\"装箱数\":\"616\",\"每一箱用量\":1.0,\"单位\":\"PCS\",\"物料费\":0.00,\"ScrapGroup\":8,\"实际金额\":0.00,\"小计金额\":\"0.0007\",\"小计美金\":\"0.000106\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.0001431\",\"物料金额\":\"0.00071428571428571428571\",\"制造金额\":0,\"priceGroup\":[15]},{\"group\":\"common\",\"物件名称\":\"波浪板 wave board\",\"规格\":\"47.5*32.5CM*28坑\",\"单价\":\"0.44\",\"装箱数\":\"616\",\"每一箱用量\":13.0,\"单位\":\"PCS\",\"物料费\":0.01,\"ScrapGroup\":8,\"实际金额\":0.01,\"小计金额\":\"0.0093\",\"小计美金\":\"0.001409\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.00190215\",\"物料金额\":\"0.0092857142857142857142\",\"制造金额\":0,\"priceGroup\":[15]},{\"group\":\"common\",\"物件名称\":\"PO膜 PO film\",\"规格\":\"65*45\",\"单价\":\"0.30\",\"装箱数\":\"616\",\"每一箱用量\":24.0,\"单位\":\"PCS\",\"物料费\":0.01,\"ScrapGroup\":8,\"实际金额\":0.01,\"小计金额\":\"0.0117\",\"小计美金\":\"0.001773\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.00239355\",\"物料金额\":\"0.011688311688311688312\",\"制造金额\":0,\"priceGroup\":[15]},{\"group\":\"common\",\"物件名称\":\"成品外箱 outer box\",\"规格\":\"48.5*33.5*22.5CM(K=A)\",\"单价\":\"3.98\",\"装箱数\":\"528\",\"每一箱用量\":1.0,\"单位\":\"PCS\",\"物料费\":0.01,\"ScrapGroup\":8,\"实际金额\":0.01,\"小计金额\":\"0.0075\",\"小计美金\":\"0.001136\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.0015336\",\"物料金额\":\"0.0075378787878787878788\",\"制造金额\":0,\"priceGroup\":[9]},{\"group\":\"common\",\"物件名称\":\"防水袋 waterproof bag\",\"规格\":\"0.3*(13+21)*26MM\",\"单价\":\"0.44\",\"装箱数\":\"528\",\"每一箱用量\":1.0,\"单位\":\"PCS\",\"物料费\":0.00,\"ScrapGroup\":8,\"实际金额\":0.00,\"小计金额\":\"0.0008\",\"小计美金\":\"0.000121\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.00016335\",\"物料金额\":\"0.00083333333333333333333\",\"制造金额\":0,\"priceGroup\":[9]},{\"group\":\"common\",\"物件名称\":\"波浪板 wave board\",\"规格\":\"47.5*32.5CM*28坑\",\"单价\":\"0.44\",\"装箱数\":\"528\",\"每一箱用量\":13.0,\"单位\":\"PCS\",\"物料费\":0.01,\"ScrapGroup\":8,\"实际金额\":0.01,\"小计金额\":\"0.0108\",\"小计美金\":\"0.001636\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.0022086\",\"物料金额\":\"0.010833333333333333333\",\"制造金额\":0,\"priceGroup\":[9]},{\"group\":\"common\",\"物件名称\":\"PO膜 PO film\",\"规格\":\"65*45\",\"单价\":\"0.30\",\"装箱数\":\"528\",\"每一箱用量\":24.0,\"单位\":\"PCS\",\"物料费\":0.01,\"ScrapGroup\":8,\"实际金额\":0.01,\"小计金额\":\"0.0136\",\"小计美金\":\"0.002061\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.00278235\",\"物料金额\":\"0.013636363636363636364\",\"制造金额\":0,\"priceGroup\":[9]},{\"group\":\"common\",\"物件名称\":\"成品外箱 outer box\",\"规格\":\"48.5*33.5*22.5CM(K=A)\",\"单价\":\"3.98\",\"装箱数\":\"8000\",\"每一箱用量\":1.0,\"单位\":\"PCS\",\"物料费\":0.00,\"ScrapGroup\":8,\"实际金额\":0.00,\"小计金额\":\"0.0005\",\"小计美金\":\"0.000076\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.0001026\",\"物料金额\":\"0.0004975\",\"制造金额\":0,\"priceGroup\":[12]},{\"group\":\"common\",\"物件名称\":\"防水袋 waterproof bag\",\"规格\":\"0.3*(13+21)*26MM\",\"单价\":\"0.44\",\"装箱数\":\"8000\",\"每一箱用量\":1.0,\"单位\":\"PCS\",\"物料费\":0.00,\"ScrapGroup\":8,\"实际金额\":0.00,\"小计金额\":\"0.0001\",\"小计美金\":\"0.000015\",\"MarkupPercent\":\"35\",\"售价美金\":\"0.00002025\",\"物料金额\":\"0.000055\",\"制造金额\":0,\"priceGroup\":[12]}],\"quotationPartsGroup\":[{\"group\":\"1\",\"rem\":\"10K-24K\",\"discount_percent\":\"105\"},{\"group\":\"2\",\"rem\":\"25-49K\",\"discount_percent\":100},{\"group\":\"3\",\"rem\":\"50K-99K\",\"discount_percent\":98},{\"group\":\"4\",\"rem\":\"100-149K\",\"discount_percent\":96},{\"group\":\"5\",\"rem\":\"150-249K\",\"discount_percent\":94},{\"group\":\"6\",\"rem\":\"Over 250K\",\"discount_percent\":92}],\"quotationParts\":[{\"0\":\"0.0880\",\"1\":\"0.0838\",\"2\":\"0.0821\",\"3\":\"0.0804\",\"4\":\"0.0788\",\"5\":\"0.0771\",\"group\":1,\"custom\":false,\"partgroup\":1,\"specialMark\":false,\"part\":\"Cap-PET\",\"cost\":\"0.0670\",\"markup\":\"25\",\"cost_markup\":\"0.0838\"},{\"0\":\"0.0738\",\"1\":\"0.0703\",\"2\":\"0.0689\",\"3\":\"0.0675\",\"4\":\"0.0661\",\"5\":\"0.0647\",\"group\":2,\"partgroup\":1,\"part\":\"Stem-PET\",\"cost\":\"0.0562\",\"markup\":\"25\",\"cost_markup\":\"0.0703\"},{\"0\":\"0.1169\",\"1\":\"0.1113\",\"2\":\"0.1091\",\"3\":\"0.1068\",\"4\":\"0.1046\",\"5\":\"0.1024\",\"group\":3,\"partgroup\":1,\"part\":\"Vac met on Cap\",\"cost\":\"0.0890\",\"markup\":\"25\",\"cost_markup\":\"0.1113\"},{\"0\":\"0.0300\",\"1\":\"0.0300\",\"2\":\"0.0300\",\"3\":\"0.0300\",\"4\":\"0.0300\",\"5\":\"0.0300\",\"group\":4,\"custom\":true,\"partgroup\":1,\"part\":\"SS on Cap\",\"cost\":\"0.021\",\"markup\":\"0\",\"cost_markup\":\"0.021\"},{\"0\":\"0.0800\",\"1\":\"0.0800\",\"2\":\"0.0800\",\"3\":\"0.0800\",\"4\":\"0.0800\",\"5\":\"0.0800\",\"group\":5,\"custom\":true,\"partgroup\":1,\"part\":\"Applicator\",\"cost\":\"0\",\"markup\":\"0\",\"cost_markup\":\"0\"},{\"0\":\"0.0045\",\"1\":\"0.0045\",\"2\":\"0.0045\",\"3\":\"0.0045\",\"4\":\"0.0045\",\"5\":\"0.0045\",\"group\":6,\"custom\":true,\"partgroup\":1,\"part\":\"Palletization\",\"cost\":\"0\",\"markup\":\"0\",\"cost_markup\":\"0\"},{\"0\":\"0.0343\",\"1\":\"0.0327\",\"2\":\"0.0320\",\"3\":\"0.0314\",\"4\":\"0.0307\",\"5\":\"0.0301\",\"group\":15,\"partgroup\":1,\"part\":\"Assembly & Packing out\",\"cost\":\"0.0223\",\"markup\":\"47\",\"cost_markup\":\"0.0327\"},{\"part\":\"summary* Unit Price\",\"group\":\"Unit Price\",\"cost\":\"Unit Price\",\"cost_markup\":\"Unit Price\",\"markup\":\"markup\",\"partgroup\":\"partgroup\",\"0\":0.4275,\"1\":0.4126,\"2\":0.4066,\"3\":0.4006,\"4\":0.3947,\"5\":0.3888},{\"0\":\"0.1557\",\"1\":\"0.1483\",\"2\":\"0.1453\",\"3\":\"0.1424\",\"4\":\"0.1394\",\"5\":\"0.1364\",\"group\":7,\"partgroup\":2,\"part\":\"Bottle-PET\",\"cost\":\"0.1186\",\"markup\":\"25\",\"cost_markup\":\"0.1483\"},{\"0\":\"0.0300\",\"1\":\"0.0300\",\"2\":\"0.0300\",\"3\":\"0.0300\",\"4\":\"0.0300\",\"5\":\"0.0300\",\"group\":8,\"custom\":true,\"partgroup\":2,\"part\":\"1 Pass SS on Bottle\",\"cost\":\"0\",\"markup\":\"0\",\"cost_markup\":\"0\"},{\"0\":\"0.0070\",\"1\":\"0.0067\",\"2\":\"0.0066\",\"3\":\"0.0064\",\"4\":\"0.0063\",\"5\":\"0.0062\",\"group\":9,\"custom\":false,\"partgroup\":2,\"part\":\"Packing cost\",\"cost\":\"0.0049\",\"markup\":\"37\",\"cost_markup\":\"0.0067\"},{\"0\":\"0.0045\",\"1\":\"0.0045\",\"2\":\"0.0045\",\"3\":\"0.0045\",\"4\":\"0.0045\",\"5\":\"0.0045\",\"group\":10,\"custom\":true,\"partgroup\":2,\"part\":\"Palletization\",\"cost\":\"0\",\"markup\":\"0\",\"cost_markup\":\"0\"},{\"0\":\"0.0473\",\"1\":\"0.0450\",\"2\":\"0.0441\",\"3\":\"0.0432\",\"4\":\"0.0423\",\"5\":\"0.0414\",\"group\":14,\"partgroup\":2,\"part\":\"UV coating on Bottle\",\"cost\":\"0.0360\",\"markup\":\"25\",\"cost_markup\":\"0.0450\"},{\"part\":\"summary* Unit Price\",\"group\":\"Unit Price\",\"cost\":\"Unit Price\",\"cost_markup\":\"Unit Price\",\"markup\":\"markup\",\"partgroup\":\"partgroup\",\"0\":0.2445,\"1\":0.2345,\"2\":0.2305,\"3\":0.2265,\"4\":0.2225,\"5\":0.2185},{\"0\":\"0.0394\",\"1\":\"0.0375\",\"2\":\"0.0368\",\"3\":\"0.036\",\"4\":\"0.0353\",\"5\":\"0.0346\",\"group\":11,\"custom\":true,\"partgroup\":3,\"part\":\"Wiper\",\"cost\":\"0\",\"markup\":\"0\",\"cost_markup\":\"0\"},{\"0\":\"0.0001\",\"1\":\"0.0001\",\"2\":\"0.0001\",\"3\":\"0.0001\",\"4\":\"0.0001\",\"5\":\"0.0001\",\"group\":12,\"custom\":false,\"partgroup\":3,\"part\":\"Packing cost\",\"cost\":\"0.0001\",\"markup\":\"0\",\"cost_markup\":\"0.0001\"},{\"0\":\"0.0045\",\"1\":\"0.0045\",\"2\":\"0.0045\",\"3\":\"0.0045\",\"4\":\"0.0045\",\"5\":\"0.0045\",\"group\":13,\"custom\":true,\"partgroup\":3,\"part\":\"Palletization\",\"cost\":\"0\",\"markup\":\"0\",\"cost_markup\":\"0\"},{\"part\":\"summary* Unit Price\",\"group\":\"Unit Price\",\"cost\":\"Unit Price\",\"cost_markup\":\"Unit Price\",\"markup\":\"markup\",\"partgroup\":\"partgroup\",\"0\":0.0440,\"1\":0.0421,\"2\":0.0414,\"3\":0.0406,\"4\":0.0399,\"5\":0.0392}],\"modelQuotation\":[{\"group\":\"1\",\"parts\":\"Cap\",\"material\":\"PET\",\"cavitation\":\"1*8\",\"cost\":\"183520\",\"price\":\"20,974\"},{\"group\":2,\"parts\":\"Stem\",\"material\":\"PET\",\"cavitation\":\"1*8\",\"cost\":\"121815\",\"price\":\"13,922\"},{\"group\":3,\"parts\":\"Bottle\",\"material\":\"PET\",\"cavitation\":\"1*8\",\"cost\":\"119815\",\"price\":\"13,693\"}],\"range0\":\"10K-24K\",\"range1\":\"25-49K\",\"range2\":\"50K-99K\",\"range3\":\"100-149K\",\"range4\":\"150-249K\",\"range5\":\"Over 250K\",\"PrintDate\":\"03/06/2024\"}"; + var data = new Dictionary() + { + ["title"] = "This's title", + ["quotationParts"] = new List>() + { + new Dictionary(){ { "specialMark", false } }, + new Dictionary(){ { "specialMark", false } }, + new Dictionary(){ { "specialMark", true } }, + } + }; + var path = PathHelper.GetTempFilePath(); + var templatePath = PathHelper.GetFile("xlsx/TestIssue24020201.xlsx"); + MiniExcel.SaveAsByTemplate(path, templatePath, data); + } + { + var path = PathHelper.GetTempFilePath(); + var templatePath = ""; + var data = new + { + B = new[] {new{ ITM=1 },new{ ITM=2 }, new{ ITM=3 },} + }; + MiniExcel.SaveAsByTemplate(path, templatePath, data); + } + { + var path = PathHelper.GetTempFilePath(); + var templatePath = PathHelper.GetFile("xlsx/TestIssue24020201.xlsx"); + var data = new Dictionary() + { + ["title"]="This's title", + ["B"] = new List>() + { + new Dictionary(){ { "specialMark", 1 } }, + new Dictionary(){ { "specialMark", 2 } }, + new Dictionary(){ { "specialMark", 3 } }, + } + }; + MiniExcel.SaveAsByTemplate(path, templatePath, data); + } + } + [Fact] public void TestIssue553() {