Commit 80013ae5 by zhouhaibao

feat(excel): 优化门店审批Excel导入功能

- 在监听器中添加storeWithProducts和storeProductDetailDTOList的数据收集逻辑
- 将业务模式字段bizMode替换为产品类别字段productCategory进行数据处理
- 更新测试文件路径从批量上架模板切换到单店模式模板
- 调整货架类型参数从2改为1以适配新的业务场景
- 添加商户ID和商户名称参数支持
- 更新会话ID为新的测试标识符
1 parent 42e7b27b
......@@ -208,10 +208,12 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
if (storeDTO == null) {
storeDTO = createStoreWithProductsDTO(data,merchantId,merchantName);
storeMap.put(storeCode, storeDTO);
storeWithProducts.add(storeDTO);
}
StoreProductDetailDTO productDTO = createStoreProductDetailDTO(data);
storeDTO.getProductDetails().add(productDTO);
storeProductDetailDTOList.add(productDTO);
this.context.incrementSuccessRows();
} catch (Exception e) {
......@@ -321,8 +323,8 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
String firstCellStr = "";
if (data instanceof SingleStoreExcelDTO) {
SingleStoreExcelDTO dto = (SingleStoreExcelDTO) data;
if (dto.getBizMode() != null) {
firstCellStr = dto.getBizMode().trim();
if (dto.getProductCategory() != null) {
firstCellStr = dto.getProductCategory().trim();
}
} else if (data instanceof BatchStoreExcelDTO) {
BatchStoreExcelDTO dto = (BatchStoreExcelDTO) data;
......
package cn.com.glsx.dj.oaapproval.controller;
import com.rop.request.UploadFile;
import io.swagger.annotations.ApiModelProperty;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
......@@ -54,7 +55,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\\模版\\门店上架模版-单店模式 - 副本.xlsx"));
String file = "xlsx@" + Base64.encodeBase64String(uploadFile.getContent());
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(10);
params.add("v", "1.0.0");
......@@ -62,13 +63,17 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest {
params.add("file", file);
params.add("basicApproveInfo", "{\"storeCode\":\"10001\",\"storeName\":\"测试门店\",\"merchantId\":1,\"merchantName\":\"测试商户\"}");
params.add("approveType", "1");
params.add("shelfType", "2");
params.add("shelfType", "1");
params.add("sceneType", "1");
params.add("merchantId","44217772" );
params.add("merchantName", "打嗝");
params.add("approveType", "1");
params.add("baseSceneCode", "110101");
params.add("sessionId", "eb96ef78-fcd3-4996-9ba7-22edb510c0f9");
params.add("sessionId", "7149728b-71da-446e-9a89-b9cc50b05a15");
params.add("submitFlag", "0");
System.out.println(post(params));
}
@Test
public void testCreateDraft1() throws Exception {
UploadFile uploadFile = new UploadFile(new File("F:\\360MoveData\\Users\\11\\Desktop\\企微SAAS\\门店上架模版-项目制批量上架 (1).xlsx"));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!