Commit 01fb98f2 by guojuxing

tab_store&tab_store_field_rel&tab_store_region_rel&tab_store_brand_ref own_type改成owner_flag

parent c864ef22
......@@ -97,9 +97,9 @@ public class ScreeningController {
EsScreeningChainDetailDTO item = this.esScreeningInitService.findRootChainByCategoryId(categoryId);
String widgetValues = item.getWidget().getWidgetValues();
if (StringUtils.isNotBlank(widgetValues)) {
List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(widgetValues, WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
item.getWidget().setWidgetValues(JSON.toJSONString(newVOList));
List<WidgetValuesOldVO> oldVos = JSONObject.parseArray(widgetValues, WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVoList = oldVos.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
item.getWidget().setWidgetValues(JSON.toJSONString(newVoList));
}
all.add(item);
}
......@@ -114,9 +114,9 @@ public class ScreeningController {
if (CollectionUtils.isNotEmpty(list)) {
list = list.stream().peek(item -> {
if (StringUtils.isNotBlank(item.getWidget().getWidgetValues())) {
List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(item.getWidget().getWidgetValues(), WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
item.getWidget().setWidgetValues(JSON.toJSONString(newVOList));
List<WidgetValuesOldVO> oldVos = JSONObject.parseArray(item.getWidget().getWidgetValues(), WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVoList = oldVos.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
item.getWidget().setWidgetValues(JSON.toJSONString(newVoList));
}
}).collect(Collectors.toList());
}
......@@ -141,9 +141,9 @@ public class ScreeningController {
public Object getScreeningWidgetDetail(String widgetChainId) {
EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(widgetChainId);
if (dto != null && dto.getWidget() != null && StringUtils.isNotBlank(dto.getWidget().getWidgetValues())) {
List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(dto.getWidget().getWidgetValues(), WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
dto.getWidget().setWidgetValues(JSON.toJSONString(newVOList));
List<WidgetValuesOldVO> oldVos = JSONObject.parseArray(dto.getWidget().getWidgetValues(), WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVoList = oldVos.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
dto.getWidget().setWidgetValues(JSON.toJSONString(newVoList));
}
return RestResponse.success(dto);
}
......
......@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.service.EnterpriseApiService;
import com.gic.plug.web.vo.widget.StoreWidgetInterfaceShareVO;
import com.gic.store.constant.StoreOwnerFlagEnum;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -47,7 +48,7 @@ public class StoreBrandController {
List<StoreWidgetInterfaceShareVO> voList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(list)) {
//共享类型
List<Integer> brandIdList = list.stream().filter(e -> Objects.equals(e.getType(), 2))
List<Integer> brandIdList = list.stream().filter(e -> Objects.equals(e.getOwnerFlag(), StoreOwnerFlagEnum.OTHER.getCode()))
.mapToInt(e -> e.getStoreBrandId())
.boxed()
.collect(Collectors.toList());
......@@ -59,10 +60,10 @@ public class StoreBrandController {
if (brandResponse.isSuccess() && CollectionUtils.isNotEmpty(brandResponse.getResult())) {
List<StoreBrandDTO> brandList = brandResponse.getResult();
List<Integer> enterpriseIdList = brandList.stream()
.filter(e -> Objects.equals(e.getType(), 1))
.filter(e -> Objects.equals(e.getOwnerFlag(), StoreOwnerFlagEnum.OWNER.getCode()))
.mapToInt(e -> e.getEnterpriseId()).boxed()
.collect(Collectors.toList());
brandIdMap = brandList.stream().filter(e -> Objects.equals(e.getType(), 1))
brandIdMap = brandList.stream().filter(e -> Objects.equals(e.getOwnerFlag(), StoreOwnerFlagEnum.OWNER.getCode()))
.collect(Collectors.toMap(e -> e.getStoreBrandId(), e -> e.getEnterpriseId()));
ServiceResponse<List<EnterpriseDTO>> enterpriseResponse = enterpriseApiService.listEnterpriseByIds(enterpriseIdList);
......@@ -79,7 +80,7 @@ public class StoreBrandController {
vo.setLabel(e.getStoreBrandName());
vo.setValue(e.getStoreBrandId().toString());
//共享类型
if (Objects.equals(e.getType(), 2)) {
if (Objects.equals(e.getOwnerFlag(), StoreOwnerFlagEnum.OTHER.getCode())) {
Integer tempEnterpriseId = finalBrandIdMap.get(e.getStoreBrandId());
vo.setEnterpriseName(finalEnterpriseMap.get(tempEnterpriseId));
}
......
......@@ -252,7 +252,6 @@ public class StoreController {
public RestResponse getStoreWidget(Integer storeWidgetId) throws ClassNotFoundException {
ServiceResponse<StoreWidgetDTO> response = this.storeWidgetApiService.getStoreWidget(storeWidgetId);
StoreWidgetVO storeWidgetVO = EntityUtil.changeEntityByJSON(StoreWidgetVO.class, response.getResult());
// storeWidgetVO.setScreenBack(this.getScreenBack(storeWidgetVO.getSearchParam()));
return RestResponse.success(storeWidgetVO);
}
......@@ -289,7 +288,6 @@ public class StoreController {
StoreResourceVO vo = EntityUtil.changeEntityNew(StoreResourceVO.class, storeWidgetDTO);
vo.setSearchJson(storeWidgetDTO.getSearchParam());
// vo.setSceenBack(getScreenBack(storeWidgetDTO.getSearchParam()));
return vo;
}
}
......
......@@ -15,7 +15,13 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 门店类型
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/7/28 10:37 AM

*/
@RestController
@RequestMapping("/store-type")
public class StoreTypeController {
......
package com.gic.plug.web.controller.goods;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
......@@ -13,18 +23,8 @@ import com.gic.goods.api.dto.GoodsRightsSelectorDTO;
import com.gic.goods.api.dto.GoodsSelectorDTO;
import com.gic.goods.api.service.BrandApiService;
import com.gic.goods.api.service.GoodsRightsSelectorApiService;
import com.gic.goods.api.service.GoodsSelectorApiService;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.GoodsBrandVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* 商品
* @ClassName: GoodsBrandController

......@@ -41,9 +41,6 @@ public class GoodsBrandController extends BaseGoodsController {
@Autowired
private GoodsRightsSelectorApiService goodsRightsSelectorApiService;
@Autowired
private GoodsSelectorApiService goodsSelectorApiService;
private static final int DEFAULT_PAGE_SIZE = 999;
@RequestMapping("/goods-brand-list")
......@@ -51,13 +48,8 @@ public class GoodsBrandController extends BaseGoodsController {
pageSize = DEFAULT_PAGE_SIZE;
String goodsRightsBrands = null;
if (goodsSelectorId != null) {
ServiceResponse<GoodsSelectorDTO> selectorServiceResponse = goodsSelectorApiService
.getGoodsSelector(goodsSelectorId, getEnterpriseId());
if (selectorServiceResponse.getResult() != null) {
goodsRightsBrands = selectorServiceResponse.getResult().getGoodsRightsBrands();
} else {
return RestResponse.success(Collections.EMPTY_LIST);
}
return RestResponse.success(Collections.EMPTY_LIST);
} else {
Long resourceId = UserDetailUtils.getUserDetail().getGoodsResourceInfo() == null ? null :
UserDetailUtils.getUserDetail().getGoodsResourceInfo().getGoodsResourceId();
......
package com.gic.plug.web.controller.goods;
import java.util.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
......@@ -10,17 +18,9 @@ import com.gic.goods.api.dto.GoodsRightsSelectorDTO;
import com.gic.goods.api.dto.GoodsSelectorDTO;
import com.gic.goods.api.service.GoodsDomainApiService;
import com.gic.goods.api.service.GoodsRightsSelectorApiService;
import com.gic.goods.api.service.GoodsSelectorApiService;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.GoodsChannelVO;
import com.gic.plug.web.vo.goods.GoodsDomainVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
/**
* 门店
* @ClassName: GoodsDomainController

......@@ -37,8 +37,6 @@ public class GoodsDomainController extends BaseGoodsController {
@Autowired
private GoodsRightsSelectorApiService goodsRightsSelectorApiService;
@Autowired
private GoodsSelectorApiService goodsSelectorApiService;
/**
* @return com.gic.commons.webapi.reponse.RestResponse
......@@ -69,14 +67,7 @@ public class GoodsDomainController extends BaseGoodsController {
String goodsDomian = null;
Integer hasRights = 0;
if (goodsSelectorId != null) {
ServiceResponse<GoodsSelectorDTO> selectorServiceResponse = goodsSelectorApiService
.getGoodsSelector(goodsSelectorId, getEnterpriseId());
if (selectorServiceResponse.getResult() != null) {
goodsDomian = selectorServiceResponse.getResult().getGoodsRightsBrands();
hasRights = selectorServiceResponse.getResult().getHasRights();
} else {
return RestResponse.success(Collections.EMPTY_LIST);
}
return RestResponse.success(Collections.EMPTY_LIST);
} else {
Long resourceId = UserDetailUtils.getUserDetail().getGoodsResourceInfo() == null ? null :
UserDetailUtils.getUserDetail().getGoodsResourceInfo().getGoodsResourceId();
......
......@@ -27,7 +27,7 @@ public class GoodsRightsSelectorController extends BaseGoodsController {
@Autowired
private GoodsRightsSelectorApiService goodsRightsSelectorApiService;
private Logger log = LogManager.getLogger(GoodsSelectorController.class);
private Logger log = LogManager.getLogger(GoodsRightsSelectorController.class);
/**
* @Title: BaseGoodsController
......
......@@ -46,4 +46,13 @@ public class WidgetValuesNewVO implements Serializable {
public void setValue(String value) {
this.value = value;
}
@Override
public String toString() {
return "WidgetValuesNewVO{" +
"key='" + key + '\'' +
", label='" + label + '\'' +
", value='" + value + '\'' +
'}';
}
}
......@@ -37,4 +37,13 @@ public class WidgetValuesOldVO implements Serializable {
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "WidgetValuesOldVO{" +
"key='" + key + '\'' +
", value='" + value + '\'' +
", name='" + name + '\'' +
'}';
}
}
......@@ -50,7 +50,12 @@ public class StoreWidgetInterfaceVO implements Serializable{
return this;
}
public static long getSerialVersionUID() {
return serialVersionUID;
@Override
public String toString() {
return "StoreWidgetInterfaceVO{" +
"value='" + value + '\'' +
", label='" + label + '\'' +
", key='" + key + '\'' +
'}';
}
}
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