Commit 56239398 by 陶光胜

查询门店选择器配置

parent a59a1351
......@@ -107,7 +107,16 @@
<artifactId>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>widget-screening-api</artifactId>
<version>${widget-screening-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-enterprise-base-api</artifactId>
<version>${gic-enterprise-base-api}</version>
</dependency>
</dependencies>
<build>
......
package com.gic.plug.web.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.constants.Constants;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.widget.screening.api.dto.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.gic.widget.screening.api.service.EsScreeningInitService;
import com.gic.widget.screening.api.service.EsScreeningSearchService;
import com.gic.widget.screening.api.service.EsScreeningTemplateService;
/**
*
*/
@Controller
public class ScreeningController {
private Logger LOGGER = LogManager.getLogger(ScreeningController.class);
@Autowired
private EsScreeningInitService esScreeningInitService;
@Autowired
private EsScreeningTemplateService esScreeningTemplateService;
@Autowired
private EsScreeningSearchService esScreeningSearchService;
/**
*
* @Title: getScreeningTemplate
* @Description: 获取模板
* @author xugh
* @return
* @throws
*/
@RequestMapping("get-screening-template")
@ResponseBody
public RestResponse getScreeningTemplate() {
List<EsScreeningTemplateDTO> list = this.esScreeningTemplateService.queryEsScreeningTemplateList();
return RestResponse.success(list);
}
/**
*
* @Title: getScreeningInitData
* @Description: 获取初始化筛选条件
* @author xugh
* @param sceneCode
* @return
* @throws
*/
@RequestMapping("get-screening-init-data")
@ResponseBody
public RestResponse getScreeningInitData(@RequestParam(defaultValue = "member") String sceneCode) {
String enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId().toString();
if(Constants.STORE_SCENECODE.equals(sceneCode)){
enterpriseId = Constants.INDEX_ENTERPRISEID;
}
List<EsScreeningEnterpriseCategorySceneInfoDTO> list = this.esScreeningInitService
.queryEsScreeningByEnterpriseAndScene(enterpriseId, sceneCode);
List<EsScreeningChainDetailDTO> all = new ArrayList<>();
for (EsScreeningEnterpriseCategorySceneInfoDTO dto : list) {
String categoryId = dto.getSceneCategoryId();
EsScreeningChainDetailDTO item = this.esScreeningInitService.findRootChainByCategoryId(categoryId);
all.add(item);
}
return RestResponse.success(all);
}
@RequestMapping("get-screening-data")
@ResponseBody
public RestResponse getScreeningData(String widgetChainId) {
List<EsScreeningChainDetailDTO> list = this.esScreeningInitService
.queryEsScreeningByParentChainId(widgetChainId);
return RestResponse.success(list);
}
@RequestMapping("get-screening-chain-detail")
@ResponseBody
public RestResponse getScreeningChainDetail(String parentChainId, String widgetFieldKey) {
EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(parentChainId, widgetFieldKey);
return RestResponse.success(dto);
}
@RequestMapping("get-screening-widget-chain-detail")
@ResponseBody
public Object getScreeningWidgetDetail(String widgetChainId){
EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(widgetChainId);
return RestResponse.success(dto);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment