Commit 0525100b by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-webapp-plug into developer
parents 0789a348 deccd845
......@@ -34,7 +34,7 @@ public class GoodsBrandController {
@RequestMapping("/goods-brand-list")
public RestResponse goodsBrandList(int pageSize, int currentPage, String search, Long goodsDomainId, String channelCode) {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID, Constant.TEST_ENTERPRISE_ID);
if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null ||
selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) {
return RestResponse.success(Collections.EMPTY_LIST);
......@@ -56,7 +56,7 @@ public class GoodsBrandController {
}
}
}
return findBrandListByParams(currentPage, pageSize,goodsDomainId, search);
return findBrandListByParams(currentPage, pageSize,goodsDomainId, search, Constant.TEST_ENTERPRISE_ID);
}
......@@ -70,12 +70,12 @@ public class GoodsBrandController {
*/
@RequestMapping("/goods-brand-list-for-rights")
public RestResponse goodsBrandListForRights(int pageSize, int currentPage, String search, Long goodsDomainId) {
return findBrandListByParams(currentPage, pageSize,goodsDomainId, search);
return findBrandListByParams(currentPage, pageSize,goodsDomainId, search, Constant.TEST_ENTERPRISE_ID);
}
private RestResponse findBrandListByParams(int currentPage, int pageSize, Long goodsDomainId, String search) {
private RestResponse findBrandListByParams(int currentPage, int pageSize, Long goodsDomainId, String search, Integer enterpriseId) {
List<Long> branIdList = new ArrayList<>();
ServiceResponse<Page<BrandDTO>> serviceResponse = brandApiService.findBrandPage(currentPage, pageSize, goodsDomainId, search, branIdList, SortType.sortDescType);
ServiceResponse<Page<BrandDTO>> serviceResponse = brandApiService.findBrandPage(currentPage, pageSize, goodsDomainId, search, branIdList, SortType.sortDescType, enterpriseId);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......
package com.gic.plug.web.controller.goods;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.goods.api.dto.CategoryDTO;
import com.gic.goods.api.dto.ErrorCode;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.CategoryVO;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.CategoryDTO;
import com.gic.goods.api.dto.ErrorCode;
import com.gic.goods.api.service.CategoryApiService;
import java.util.List;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.CategoryVO;
@RestController
public class GoodsCategoryController {
......@@ -33,7 +33,7 @@ public class GoodsCategoryController {
if (goodsDomainId == null || StringUtils.isBlank(channelCode)) {
return RestResponse.failure(ErrorCode.UNKNOW_ERROR.getCode(), "参数不全");
}
ServiceResponse<List<CategoryDTO>> serviceResponse = categoryApiSerivce.listParentAll(channelCode, goodsDomainId,null);
ServiceResponse<List<CategoryDTO>> serviceResponse = categoryApiSerivce.listParentAll(channelCode, goodsDomainId, null, Constant.TEST_ENTERPRISE_ID);
List<CategoryDTO> result = serviceResponse.getResult();
if (CollectionUtils.isEmpty(result)) {
return RestResponse.success();
......@@ -52,7 +52,7 @@ public class GoodsCategoryController {
if (specParentId == null || StringUtils.isBlank(channelCode)) {
return RestResponse.failure(ErrorCode.UNKNOW_ERROR.getCode(), "参数不全");
}
ServiceResponse<List<CategoryDTO>> serviceResponse = categoryApiSerivce.listChildAll(channelCode, specParentId,null);
ServiceResponse<List<CategoryDTO>> serviceResponse = categoryApiSerivce.listChildAll(channelCode, specParentId, null, Constant.TEST_ENTERPRISE_ID);
List<CategoryDTO> result = serviceResponse.getResult();
if (CollectionUtils.isEmpty(result)) {
return RestResponse.success();
......
package com.gic.plug.web.controller.goods;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.curator.shaded.com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.GoodsSkuDTO;
import com.gic.goods.api.service.GoodsApiService;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.GoodsVO;
import com.gic.search.business.api.constant.enums.OperateEnum;
import com.gic.search.business.api.dto.DynamicSearchDTO;
......@@ -13,16 +25,6 @@ import com.gic.search.business.api.dto.ESResponseQueryBatchDTO;
import com.gic.search.business.api.service.EsBusinessOperaApiService;
import com.gic.search.business.api.utils.QueryConditionAssemblyUtil;
import com.gic.widget.screening.api.service.EsScreeningSearchService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.curator.shaded.com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @ClassName: GoodsTagController
......@@ -82,7 +84,7 @@ public class GoodsController {
}
//2、获取商品ID信息
List<Long> goodsIds = goodsVOS.stream().mapToLong(GoodsVO::getGoodsId).boxed().collect(Collectors.toList());
ServiceResponse<List<GoodsSkuDTO>> skuResponse = goodsApiService.listSkuByGoods(goodsIds);
ServiceResponse<List<GoodsSkuDTO>> skuResponse = goodsApiService.listSku(goodsIds, channelCode, Constant.TEST_ENTERPRISE_ID);
if (!skuResponse.isSuccess()) {
return RestResponse.failure(skuResponse.getCode(), skuResponse.getMessage());
......
......@@ -53,7 +53,7 @@ public class GoodsDomainController {
*/
@RequestMapping("/get-all-goods-domain-list")
public RestResponse getAllGoodsDomianList() {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID, Constant.TEST_ENTERPRISE_ID);
if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null ||
selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) {
return RestResponse.success(Collections.EMPTY_LIST);
......
......@@ -3,7 +3,6 @@ package com.gic.plug.web.controller.goods;
import java.util.ArrayList;
import java.util.List;
import com.gic.goods.api.dto.FullPropertyDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -13,7 +12,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.contants.SortType;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.PropertyDTO;
import com.gic.goods.api.dto.FullPropertyDTO;
import com.gic.goods.api.dto.PropertyValueDTO;
import com.gic.goods.api.service.PropertyApiService;
import com.gic.goods.api.service.PropertyValueApiService;
......@@ -39,7 +38,7 @@ public class GoodsPropertyController {
arrayList.add(Constant.PROPERTY_TYPE_PERCENT);
arrayList.add(Constant.PROPERTY_TYPE_NUM);
arrayList.add(Constant.PROPERTY_TYPE_REAL_NUM);
ServiceResponse<Page<FullPropertyDTO>> serviceResponse = propertyApiService.findPropertyExceptType(currentPage, pageSize, goodsDomainId, arrayList,search);
ServiceResponse<Page<FullPropertyDTO>> serviceResponse = propertyApiService.findPropertyExceptType(currentPage, pageSize, goodsDomainId, arrayList,search, Constant.TEST_ENTERPRISE_ID);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......@@ -50,7 +49,7 @@ public class GoodsPropertyController {
@RequestMapping("/property-value-list")
public RestResponse propertyValueList(int pageSize, int currentPage, String search, Long specPropertyId) {
ServiceResponse<Page<PropertyValueDTO>> serviceResponse = propertyValueApiService
.pagePropertyValue(currentPage, pageSize, specPropertyId, search, SortType.sortDescType);
.pagePropertyValue(currentPage, pageSize, specPropertyId, search, SortType.sortDescType, Constant.TEST_ENTERPRISE_ID);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......
......@@ -34,6 +34,7 @@ public class GoodsRightsSelectorController {
if (goodsRightsSelectorDTO.getHasRights() == null) {
goodsRightsSelectorDTO.setHasRights(Constant.NO);
}
goodsRightsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.saveGoodsRightsSelector(goodsRightsSelectorDTO);
if (serviceResponse.isSuccess()) {
goodsRightsSelectorDTO = serviceResponse.getResult();
......@@ -56,6 +57,7 @@ public class GoodsRightsSelectorController {
if (goodsRightsSelectorDTO.getHasRights() == null) {
goodsRightsSelectorDTO.setHasRights(Constant.NO);
}
goodsRightsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.showGoodsRightsSelectorResult(goodsRightsSelectorDTO);
if (serviceResponse.isSuccess()) {
goodsRightsSelectorDTO = serviceResponse.getResult();
......@@ -67,6 +69,7 @@ public class GoodsRightsSelectorController {
@RequestMapping("/goods-rights-selector-update")
public RestResponse goodsRightsSelectorSave(GoodsRightsSelectorUpdateQO goodsRightsSelectorUpdateQO) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsRightsSelectorDTO.class, goodsRightsSelectorUpdateQO);
goodsRightsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.updateGoodsRightsSelector(goodsRightsSelectorDTO);
if (serviceResponse.isSuccess()) {
goodsRightsSelectorDTO = serviceResponse.getResult();
......@@ -77,7 +80,7 @@ public class GoodsRightsSelectorController {
@RequestMapping("/get-goods-rights-selector")
public RestResponse getGoodsRightsSelector(Long goodsRightsSelectorId) {
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(goodsRightsSelectorId);
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(goodsRightsSelectorId, Constant.TEST_ENTERPRISE_ID);
if (serviceResponse.isSuccess()) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = serviceResponse.getResult();
return RestResponse.success(EntityUtil.changeEntityByOrika(GoodsRightsSelectorVO.class, goodsRightsSelectorDTO));
......
......@@ -27,7 +27,7 @@ public class GoodsSelectorController {
@RequestMapping("goods-selector-show-back")
public RestResponse goodsSelectorShowBack(Long goodsSelectorId) {
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.getGoodsSelector(goodsSelectorId);
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.getGoodsSelector(goodsSelectorId, Constant.TEST_ENTERPRISE_ID);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult().getGoodsSearchValue());
}
......@@ -36,7 +36,7 @@ public class GoodsSelectorController {
@RequestMapping("get-goods-selector")
public RestResponse getGoodsSelector(Long goodsSelectorId) {
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.getGoodsSelector(goodsSelectorId);
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.getGoodsSelector(goodsSelectorId, Constant.TEST_ENTERPRISE_ID);
if (serviceResponse.isSuccess()) {
GoodsSelectorVO goodsSelectorVO = EntityUtil.changeEntityByOrika(GoodsSelectorVO.class, serviceResponse.getResult());
return RestResponse.success(goodsSelectorVO);
......@@ -47,7 +47,7 @@ public class GoodsSelectorController {
@RequestMapping("goods-selector-edit-show-back")
public RestResponse goodsSelectorEditShowBack(Long goodsSelectorId) {
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.getGoodsSelector(goodsSelectorId);
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.getGoodsSelector(goodsSelectorId, Constant.TEST_ENTERPRISE_ID);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult().getGoodsSearchEdit());
}
......@@ -58,7 +58,7 @@ public class GoodsSelectorController {
public RestResponse goodsSelectorSave(GoodsSelectorSaveQO goodsSelectorSaveQO) {
GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO);
goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID, Constant.TEST_ENTERPRISE_ID);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
......@@ -79,7 +79,7 @@ public class GoodsSelectorController {
public RestResponse goodsSelectorShow(GoodsSelectorSaveQO goodsSelectorSaveQO) {
GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO);
goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID, Constant.TEST_ENTERPRISE_ID);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
......@@ -99,7 +99,7 @@ public class GoodsSelectorController {
@RequestMapping("change-goods-rights-for-selector")
public RestResponse changeGoodsRightsForSelector(Long goodsSelectorId) {
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID, Constant.TEST_ENTERPRISE_ID);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
......@@ -112,7 +112,7 @@ public class GoodsSelectorController {
}
GoodsRightsSelectorDTO goodsRightsSelectorDTO = goodsRightsSelectorDTOServiceResponse.getResult();
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.updateGoodsSelectorRights(goodsSelectorId,
goodsRightsSelectorDTO.getGoodsRightsSearchText(), goodsRightsSelectorDTO.getGoodsRightsSearchValue(), goodsRightsSelectorDTO.getHasRights());
goodsRightsSelectorDTO.getGoodsRightsSearchText(), goodsRightsSelectorDTO.getGoodsRightsSearchValue(), goodsRightsSelectorDTO.getHasRights(), Constant.TEST_ENTERPRISE_ID);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......@@ -124,6 +124,7 @@ public class GoodsSelectorController {
@RequestMapping("goods-selector-update")
public RestResponse goodsSelectorUpdate(GoodsSelectorUpdateQO goodsSelectorUpdateQO) {
GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorUpdateQO);
goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.updateGoodsSelector(goodsSelectorDTO);
if (serviceResponse.isSuccess()) {
goodsSelectorDTO = serviceResponse.getResult();
......
......@@ -15,6 +15,7 @@ import com.gic.goods.api.dto.StandardValueGroupDTO;
import com.gic.goods.api.service.StandardApiService;
import com.gic.goods.api.service.StandardValueApiService;
import com.gic.goods.api.service.StandardValueGroupApiService;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.GoodsStandardVO;
import com.gic.plug.web.vo.goods.GoodsStandardValueGroupVO;
import com.gic.plug.web.vo.goods.GoodsStandardValueVO;
......@@ -33,7 +34,7 @@ public class GoodsStandardController {
@RequestMapping("/list-standard")
public RestResponse listStandard(int currentPage, int pageSize, String search, Long goodsDomainId) {
ServiceResponse<Page<StandardDTO>> serviceResponse = standardApiService.listByPage(currentPage, pageSize, goodsDomainId, search);
ServiceResponse<Page<StandardDTO>> serviceResponse = standardApiService.listByPage(currentPage, pageSize, goodsDomainId, search, Constant.TEST_ENTERPRISE_ID);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......@@ -45,7 +46,7 @@ public class GoodsStandardController {
@RequestMapping("/list-standard-value-group")
public RestResponse listStandardValueGroup(int currentPage, int pageSize, Long specStandardId, String search) {
ServiceResponse<Page<StandardValueGroupDTO>> serviceResponse =
standardValueGroupApiService.listByPage(currentPage, pageSize, specStandardId, search, SortType.sortDescType);
standardValueGroupApiService.listByPage(currentPage, pageSize, specStandardId, search, SortType.sortDescType, Constant.TEST_ENTERPRISE_ID);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......@@ -56,7 +57,7 @@ public class GoodsStandardController {
@RequestMapping("/list-standard-value")
public RestResponse listStandardValue(int currentPage, int pageSize, Long specStandardId, String search, Long specStandardValueGroupId) {
ServiceResponse<Page<StandardValueDTO>> serviceResponse =
standardValueApiService.listByPage(currentPage, pageSize, specStandardId, search, SortType.sortDescType, specStandardValueGroupId);
standardValueApiService.listByPage(currentPage, pageSize, specStandardId, search, SortType.sortDescType, specStandardValueGroupId, Constant.TEST_ENTERPRISE_ID);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......
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