Commit 42e7b27b by zhouhaibao

[+]审批接口

1 parent 1853c7a8
...@@ -22,7 +22,7 @@ public class SingleStoreExcelDTO { ...@@ -22,7 +22,7 @@ public class SingleStoreExcelDTO {
@ExcelMergeRow(columIndex = 3) @ExcelMergeRow(columIndex = 3)
@ExcelProperty(value = "服务商2/F公司", index = 3) @ExcelProperty(value = "服务商2/F公司", index = 3)
private String serviceProvider2f; private String fCompany;
@ExcelMergeRow(columIndex = 4) @ExcelMergeRow(columIndex = 4)
@ExcelProperty(value = "*服务商", index = 4) @ExcelProperty(value = "*服务商", index = 4)
......
...@@ -60,7 +60,7 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob ...@@ -60,7 +60,7 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
this.mergedCellHandler = mergedCellHandler; this.mergedCellHandler = mergedCellHandler;
} }
public CreateBusinessApproveExcelListener(CreateBusinessApproveImportExcelContext context, boolean isSingleStoreMode, MergedCellHandler mergedCellHandler,Integer merchantId, String merchantName) { public CreateBusinessApproveExcelListener(CreateBusinessApproveImportExcelContext context, boolean isSingleStoreMode, Integer merchantId, String merchantName) {
this.context = context; this.context = context;
this.isSingleStoreMode = isSingleStoreMode; this.isSingleStoreMode = isSingleStoreMode;
this.merchantId = merchantId; this.merchantId = merchantId;
...@@ -202,17 +202,16 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob ...@@ -202,17 +202,16 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
private void processSingleStoreMode(SingleStoreExcelDTO data, Integer rowIndex) { private void processSingleStoreMode(SingleStoreExcelDTO data, Integer rowIndex) {
try { try {
StoreWithProductsDTO storeDTO = storeMap.get(merchantName); String storeCode = merchantId+"";
StoreWithProductsDTO storeDTO = storeMap.get(storeCode);
if (storeDTO == null) { if (storeDTO == null) {
storeDTO = createStoreWithProductsDTO(data,merchantId,merchantName); storeDTO = createStoreWithProductsDTO(data,merchantId,merchantName);
storeMap.put(merchantName, storeDTO); storeMap.put(storeCode, storeDTO);
storeWithProducts.add(storeDTO);
} }
mergedCellHandler.fillMergedCellValues(data);
StoreProductDetailDTO productDTO = createStoreProductDetailDTO(data); StoreProductDetailDTO productDTO = createStoreProductDetailDTO(data);
storeProductDetailDTOList.add(productDTO); storeDTO.getProductDetails().add(productDTO);
this.context.incrementSuccessRows(); this.context.incrementSuccessRows();
} catch (Exception e) { } catch (Exception e) {
...@@ -322,8 +321,8 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob ...@@ -322,8 +321,8 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
String firstCellStr = ""; String firstCellStr = "";
if (data instanceof SingleStoreExcelDTO) { if (data instanceof SingleStoreExcelDTO) {
SingleStoreExcelDTO dto = (SingleStoreExcelDTO) data; SingleStoreExcelDTO dto = (SingleStoreExcelDTO) data;
if (dto.getProductCategory() != null) { if (dto.getBizMode() != null) {
firstCellStr = dto.getProductCategory().trim(); firstCellStr = dto.getBizMode().trim();
} }
} else if (data instanceof BatchStoreExcelDTO) { } else if (data instanceof BatchStoreExcelDTO) {
BatchStoreExcelDTO dto = (BatchStoreExcelDTO) data; BatchStoreExcelDTO dto = (BatchStoreExcelDTO) data;
...@@ -365,7 +364,7 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob ...@@ -365,7 +364,7 @@ public class CreateBusinessApproveExcelListener extends AnalysisEventListener<Ob
storeDTO.setBizMode(data.getBizMode()); storeDTO.setBizMode(data.getBizMode());
storeDTO.setSigningEntity(data.getSigningEntity()); storeDTO.setSigningEntity(data.getSigningEntity());
storeDTO.setOpMode(data.getOpMode()); storeDTO.setOpMode(data.getOpMode());
storeDTO.setFCompany(data.getServiceProvider2f()); storeDTO.setFCompany(data.getFCompany());
storeDTO.setServiceProvider(data.getServiceProvider()); storeDTO.setServiceProvider(data.getServiceProvider());
storeDTO.setSuperiorProvider(data.getSuperiorProvider()); storeDTO.setSuperiorProvider(data.getSuperiorProvider());
storeDTO.setParkingStore(data.getParkingStore()); storeDTO.setParkingStore(data.getParkingStore());
......
...@@ -129,7 +129,7 @@ public class StoreApproveService { ...@@ -129,7 +129,7 @@ public class StoreApproveService {
CreateBusinessApproveExcelListener listener; CreateBusinessApproveExcelListener listener;
if (isSingleStoreMode) { if (isSingleStoreMode) {
listener = new CreateBusinessApproveExcelListener(context, isSingleStoreMode, listener = new CreateBusinessApproveExcelListener(context, isSingleStoreMode,
mergedCellHandler, storeApproveDTO.getMerchantId(), storeApproveDTO.getMerchantName()); mergedCellHandler);
EasyExcel.read(inputStream, SingleStoreExcelDTO.class, listener) EasyExcel.read(inputStream, SingleStoreExcelDTO.class, listener)
.sheet() .sheet()
.headRowNumber(2) .headRowNumber(2)
......
...@@ -54,7 +54,7 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest { ...@@ -54,7 +54,7 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest {
@Test @Test
public void testCreateDraft() throws Exception { 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()); String file = "xlsx@" + Base64.encodeBase64String(uploadFile.getContent());
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(10); MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(10);
params.add("v", "1.0.0"); params.add("v", "1.0.0");
...@@ -62,12 +62,10 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest { ...@@ -62,12 +62,10 @@ public class CreateBussinessApproveControllerTest extends BaseControllerTest {
params.add("file", file); params.add("file", file);
params.add("basicApproveInfo", "{\"storeCode\":\"10001\",\"storeName\":\"测试门店\",\"merchantId\":1,\"merchantName\":\"测试商户\"}"); params.add("basicApproveInfo", "{\"storeCode\":\"10001\",\"storeName\":\"测试门店\",\"merchantId\":1,\"merchantName\":\"测试商户\"}");
params.add("approveType", "1"); params.add("approveType", "1");
params.add("shelfType", "1"); params.add("shelfType", "2");
params.add("merchantId", "44217777");
params.add("merchantName", "搭嘎121啊");
params.add("sceneType", "1"); params.add("sceneType", "1");
params.add("baseSceneCode", "110101"); params.add("baseSceneCode", "110101");
params.add("sessionId", "0ae26405-366a-4e58-9981-820c8aee5e36"); params.add("sessionId", "eb96ef78-fcd3-4996-9ba7-22edb510c0f9");
params.add("submitFlag", "0"); params.add("submitFlag", "0");
System.out.println(post(params)); 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!