Commit eab47cb0 by 何文超

更新

parent 664ee1d5
package com.gic.plug.web.controller.goods;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
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;
......@@ -17,6 +20,7 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.GoodsCordDTO;
import com.gic.goods.api.dto.SpecCordDTO;
import com.gic.goods.api.service.CordApiService;
import com.gic.goods.api.service.MallGoodsBusinessApiService;
import com.gic.goods.api.util.Constant;
import com.gic.mall.base.api.enums.ErrorCodeEnums;
import com.gic.mall.share.api.dto.shop.ShopDTO;
......@@ -53,6 +57,9 @@ public class AppletConfigGoodsController {
@Autowired
private EsBusinessOperaApiService esBusinessOperaApiService;
@Autowired
private MallGoodsBusinessApiService mallGoodsBusinessApiService;
@RequestMapping("get-mall-cord-list")
public RestResponse getMallCordList(String appConfigId, Long shopId) {
Long areaId = null;
......@@ -124,6 +131,21 @@ public class AppletConfigGoodsController {
ServiceResponse<ESResponseQueryBatchDTO> serviceResponse = searchGoods(currentPage, pageSize, areaId, search,
Constant.CHANNEL_CODE_MALL, cordJSON);
if (serviceResponse.isSuccess()) {
List<Long> goodsIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(serviceResponse.getResult().getRes())) {
serviceResponse.getResult().getRes().forEach(json -> {
Long goodsId = json.getLong("goodsId");
goodsIds.add(goodsId);
});
}
ServiceResponse<Map<Long, BigDecimal>> mapServiceResponse = mallGoodsBusinessApiService.getLowestSkuPrice(goodsIds, 1129);
if (mapServiceResponse.isSuccess()) {
Map<Long, BigDecimal> map = mapServiceResponse.getResult();
serviceResponse.getResult().getRes().forEach(json -> {
Long goodsId = json.getLong("goodsId");
json.put("minSkuPrice", map.getOrDefault(goodsId, BigDecimal.valueOf(0)));
});
}
return RestResponse.success(serviceResponse.getResult());
}
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
......@@ -200,7 +222,6 @@ public class AppletConfigGoodsController {
JSONObject status = QueryConditionAssemblyUtil.createSimpleQueryNode("status", OperateEnum.OPERATE_EQ, 2);
if (Constant.CHANNEL_CODE_MALL.equals(channelCode)) {
List<JSONObject> jsonObjectList = new ArrayList<>();
status = QueryConditionAssemblyUtil.addQueryNodeForSiblin(status, QueryConditionAssemblyUtil.createSimpleQueryNode("upShelfTime", OperateEnum.OPERATE_LTE, new Date().getTime()), OperateEnum.OPERATE_AND);
}
......
......@@ -47,6 +47,7 @@
<dubbo:reference id="tagApiService" interface="com.gic.goods.api.service.TagApiService" timeout="60000" retries="0" check="false" />
<dubbo:reference id="cordApiService" interface="com.gic.goods.api.service.CordApiService" timeout="60000" retries="0" check="false"/>
<dubbo:reference id="goodsApiService" interface="com.gic.goods.api.service.GoodsApiService" timeout="60000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.goods.api.service.MallGoodsBusinessApiService" id="mallGoodsBusinessApiService" timeout="60000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.search.business.api.service.EsBusinessOperaApiService" id="esBusinessOperaApiService" timeout="60000" retries="0" />
......@@ -56,4 +57,5 @@
<dubbo:reference interface="com.gic.store.service.StoreWidgetApiService" id="storeWidgetApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="10000" retries="0" />
<dubbo:reference interface="com.gic.member.config.api.service.AppletsConfigApiService" id="appletsConfigApiService" timeout="10000" 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