Commit 618ac34a by zhouhaibao

fix(excel): 修复门店数据映射和测试文件路径问题

- 修复单店模式Excel处理中使用错误的商户ID作为map键值的问题
- 更新测试用例中的Excel模板文件路径和session ID
- 为多个Excel字段添加@FillFromPreviousRow注解以支持跨行数据填充功能
- 解决流量方、服务商、资源费等分账相关字段的数据继承问题
- 修复装修设备成本和月度成本字段的数据填充机制
1 parent d6358830
......@@ -55,10 +55,12 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 11)
@ExcelProperty(value = "*流量方是否线上自动分账", index = 11)
@FillFromPreviousRow
private String trafficPartyAutoSettlement;
@ExcelMergeRow(columIndex = 12)
@ExcelProperty(value = "*线上分账对象", index = 12)
@FillFromPreviousRow
private String trafficPartySettlementTarget;
@ExcelMergeRow(columIndex = 13)
......@@ -79,10 +81,12 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 17)
@ExcelProperty(value = "*服务商是否线上自动分账", index = 17)
@FillFromPreviousRow
private String serviceProviderAutoSettlement;
@ExcelMergeRow(columIndex = 18)
@ExcelProperty(value = "*线上分账对象", index = 18)
@FillFromPreviousRow
private String serviceProviderSettlementTarget;
@ExcelMergeRow(columIndex = 19)
......@@ -99,10 +103,12 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 22)
@ExcelProperty(value = "*资源费是否线上自动分账", index = 22)
@FillFromPreviousRow
private String resourceFeeAutoSettlement;
@ExcelMergeRow(columIndex = 23)
@ExcelProperty(value = "*线上分账对象", index = 23)
@FillFromPreviousRow
private String resourceFeeSettlementTarget;
@ExcelMergeRow(columIndex = 24)
......@@ -131,10 +137,12 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 30)
@ExcelProperty(value = "*线上分账对象", index = 30)
@FillFromPreviousRow
private String otherFeeSettlementTarget;
@ExcelMergeRow(columIndex = 31)
@ExcelProperty(value = "*管理层市场费是否前置", index = 31)
@FillFromPreviousRow
private String managementMarketFeePrepaid;
@ExcelMergeRow(columIndex = 32)
......@@ -163,10 +171,12 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 38)
@ExcelProperty(value = "*一线阳光是否前置", index = 38)
@FillFromPreviousRow
private String sunshinePrepaid;
@ExcelMergeRow(columIndex = 39)
@ExcelProperty(value = "*一线阳光是否开启线上积分", index = 39)
@FillFromPreviousRow
private String sunshineOnlinePoints;
@ExcelMergeRow(columIndex = 40)
......@@ -183,6 +193,7 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 43)
@ExcelProperty(value = "*一线阳光2是否开启线上积分", index = 43)
@FillFromPreviousRow
private String sunshine2OnlinePoints;
@ExcelMergeRow(columIndex = 44)
......@@ -199,10 +210,12 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 47)
@ExcelProperty(value = "*装修、设备总投入", index = 47, converter = NumberStringConverter.class)
@FillFromPreviousRow
private BigDecimal renovationEquipmentCost;
@ExcelMergeRow(columIndex = 48)
@ExcelProperty(value = "*当月产生(房租、水电、耗材等)", index = 48, converter = NumberStringConverter.class)
@FillFromPreviousRow
private BigDecimal otherCostPerMonth;
}
\ No newline at end of file
......@@ -186,12 +186,11 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
private void processSingleStoreMode(SingleStoreExcelDTO data, Integer rowIndex) {
try {
String storeName = merchantName;
StoreWithProductsDTO storeDTO = storeMap.get(merchantId);
StoreWithProductsDTO storeDTO = storeMap.get(merchantName);
if (storeDTO == null) {
storeDTO = createStoreWithProductsDTO(data);
storeMap.put(merchantId+"", storeDTO);
storeMap.put(merchantName, storeDTO);
storeWithProducts.add(storeDTO);
}
StoreWithProductsDTO.ProductCategoryRuleDTO ruleDTO = createProductCategoryRuleDTO(data);
......
......@@ -54,7 +54,7 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest {
@Test
public void testCreateDraft() throws Exception {
UploadFile uploadFile = new UploadFile(new File("F:\\360MoveData\\Users\\11\\Desktop\\模版\\门店上架模版-单店模式 - 副本.xlsx"));
UploadFile uploadFile = new UploadFile(new File("F:\\360MoveData\\Users\\11\\Desktop\\模版\\0721\\门店上架模版-单店模式.xlsx"));
String file = "xlsx@" + Base64.encodeBase64String(uploadFile.getContent());
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(10);
params.add("v", "1.0.0");
......@@ -68,7 +68,7 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest {
params.add("sceneFiles[0].baseSceneCode", "110101");
params.add("sceneFiles[0].file", file);
params.add("baseSceneCodes", "110101");
params.add("sessionId", "fd81e86a-d47b-49b8-8f4b-5c0a971d6a27");
params.add("sessionId", "28edb0c9-7af5-4663-a61e-b00d8236fe86");
params.add("submitFlag", "0");
System.out.println(post(params));
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!