Commit d6a91876 by 何文超

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-webapp-plug into developer

# Conflicts:
#	src/main/java/com/gic/plug/web/controller/goods/GoodsCategoryController.java
#	src/main/java/com/gic/plug/web/controller/goods/GoodsPropertyController.java
parents 466e9416 a8f1a799
......@@ -165,6 +165,7 @@
<version>2.1.5.RELEASE</version>
<configuration>
<mainClass>com.gic.plug.web.Main</mainClass>
<excludeGroupIds>ch.qos.logback</excludeGroupIds>
</configuration>
<executions>
<execution>
......
......@@ -5,6 +5,10 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.plug.web.vo.StoreResourceVO;
import com.gic.store.dto.StoreWidgetDTO;
import com.gic.store.service.StoreWidgetApiService;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -43,6 +47,8 @@ public class ScreeningController {
private EsScreeningTemplateService esScreeningTemplateService;
@Autowired
private StrategyInit strategyInit;
@Autowired
private StoreWidgetApiService storeWidgetApiService;
/**
* @return
......@@ -119,6 +125,28 @@ public class ScreeningController {
@RequestMapping("screen-back")
@ResponseBody
public Object screenBack(String param) throws ClassNotFoundException {
return RestResponse.success(this.getScreenBack(param));
}
@RequestMapping("get-user-store-resource")
@ResponseBody
public RestResponse getUserStoreResouce() throws ClassNotFoundException {
Long storeResource = UserDetailUtils.getUserDetail().getUserResourceInfo().getStoreResource();
if(storeResource == null){
return RestResponse.success(new StoreResourceVO());
}
ServiceResponse<StoreWidgetDTO> storeWidget = this.storeWidgetApiService.getStoreWidget(storeResource.intValue());
if(storeWidget.isSuccess() && storeWidget.getResult() != null){
StoreResourceVO vo = new StoreResourceVO();
vo.setAuthMode(storeWidget.getResult().getAuthMode());
vo.setSearchJson(storeWidget.getResult().getSearchParam());
vo.setSceenBack(this.getScreenBack(storeWidget.getResult().getSearchParam()));
return RestResponse.success(vo);
}
return RestResponse.success(new StoreResourceVO());
}
private String getScreenBack(String param) throws ClassNotFoundException {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
JSONArray array = JSON.parseArray(param);
StringBuilder backMessage = new StringBuilder();
......@@ -148,12 +176,6 @@ public class ScreeningController {
}
backMessage.append(stringBuilder);
}
return RestResponse.success(backMessage.toString());
}
@RequestMapping("save-store-widget")
@ResponseBody
public RestResponse saveStoreWidget(String searchParam, String writeBackParam){
return null;
return backMessage.toString();
}
}
......@@ -4,15 +4,19 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.plug.web.qo.StoreWidgetQO;
import com.gic.plug.web.vo.StoreRegionVO;
import com.gic.plug.web.vo.StoreVO;
import com.gic.store.constant.StoreESFieldsEnum;
import com.gic.store.dto.StoreInfoDTO;
import com.gic.store.dto.StoreRegionDTO;
import com.gic.store.dto.StoreSearchDTO;
import com.gic.store.dto.StoreWidgetDTO;
import com.gic.store.service.StoreApiService;
import com.gic.store.service.StoreRegionApiService;
import com.gic.store.service.StoreWidgetApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -30,6 +34,8 @@ public class StoreController {
@Autowired
private StoreApiService storeApiService;
@Autowired
private StoreWidgetApiService storeWidgetApiService;
@RequestMapping("/list-store-region")
public RestResponse listStoreRegion(String search) {
......@@ -60,4 +66,34 @@ public class StoreController {
}
}
@RequestMapping("get-store-count")
public RestResponse getStoreCount(String authSearchJson, String searchJson){
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(enterpriseId);
storeSearchDTO.setSearchJson(searchJson);
storeSearchDTO.setAuthSearchJson(authSearchJson);
ServiceResponse<Long> response = storeApiService.queryStoreCountFromES(storeSearchDTO);
return RestResponse.success(response.getResult());
}
@RequestMapping("save-store-widget")
public RestResponse saveStoreWidget(@RequestBody StoreWidgetQO storeWidgetQO){
StoreWidgetDTO storeWidgetDTO = new StoreWidgetDTO();
storeWidgetDTO.setAuthSearchParam(storeWidgetQO.getAuthSearchParam());
storeWidgetDTO.setSearchParam(storeWidgetQO.getSearchParam());
storeWidgetDTO.setStoreWidgetId(storeWidgetQO.getStoreWidgetId());
storeWidgetDTO.setWriteBackParam(storeWidgetQO.getWriteBackParam());
ServiceResponse<Integer> storeWidgetResponse = this.storeWidgetApiService.saveAuthStoreWidget(storeWidgetDTO);
if(storeWidgetResponse.isSuccess()){
return RestResponse.success(storeWidgetResponse.getResult());
}
return RestResponse.success();
}
@RequestMapping("get-store-widget")
public RestResponse getStoreWidget(Integer storeWidgetId){
ServiceResponse<StoreWidgetDTO> response = this.storeWidgetApiService.getStoreWidget(storeWidgetId);
return RestResponse.success(response.getResult());
}
}
......@@ -91,9 +91,7 @@ public class StoreFieldController {
@RequestMapping("/list-store-field")
public RestResponse listStoreField(String search) {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<StoreFieldDTO>> result = storeFieldApiService
.listStoreField(UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseId(), search);
ServiceResponse<List<StoreFieldDTO>> result = storeFieldApiService.listStoreField(enterpriseId, search);
if (result.isSuccess()) {
return RestResponse.success(transferDtoToVo(result.getResult(), enterpriseId));
} else {
......
package com.gic.plug.web.qo;
import java.io.Serializable;
public class StoreWidgetQO implements Serializable {
private Integer storeWidgetId;
private String authSearchParam;
private String searchParam;
private String writeBackParam;
public Integer getStoreWidgetId() {
return storeWidgetId;
}
public void setStoreWidgetId(Integer storeWidgetId) {
this.storeWidgetId = storeWidgetId;
}
public String getAuthSearchParam() {
return authSearchParam;
}
public void setAuthSearchParam(String authSearchParam) {
this.authSearchParam = authSearchParam;
}
public String getSearchParam() {
return searchParam;
}
public void setSearchParam(String searchParam) {
this.searchParam = searchParam;
}
public String getWriteBackParam() {
return writeBackParam;
}
public void setWriteBackParam(String writeBackParam) {
this.writeBackParam = writeBackParam;
}
}
package com.gic.plug.web.vo;
public class StoreResourceVO {
private Integer authMode;
private String searchJson;
private String sceenBack;
public Integer getAuthMode() {
return authMode;
}
public void setAuthMode(Integer authMode) {
this.authMode = authMode;
}
public String getSearchJson() {
return searchJson;
}
public void setSearchJson(String searchJson) {
this.searchJson = searchJson;
}
public String getSceenBack() {
return sceenBack;
}
public void setSceenBack(String sceenBack) {
this.sceenBack = sceenBack;
}
}
......@@ -53,5 +53,6 @@
<dubbo:reference interface="com.gic.search.business.api.service.EsBusinessManageApiService" id="esBusinessManageApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.widget.screening.api.service.EsScreeningSearchService" id="esScreeningSearchService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.store.service.StoreWidgetApiService" id="storeWidgetApiService" timeout="60000" retries="0" />
</beans>
\ No newline at end of file
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