|
@@ -10,12 +10,14 @@ import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.exception.CustomPromptException;
|
|
import com.sckw.core.exception.CustomPromptException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.enums.ClientTypeEnum;
|
|
import com.sckw.core.model.enums.ClientTypeEnum;
|
|
|
|
|
+import com.sckw.core.model.enums.EntTypeEnum;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.model.vo.TableBottom;
|
|
import com.sckw.core.model.vo.TableBottom;
|
|
|
import com.sckw.core.model.vo.TableStatisticRes;
|
|
import com.sckw.core.model.vo.TableStatisticRes;
|
|
|
import com.sckw.core.model.vo.TableTop;
|
|
import com.sckw.core.model.vo.TableTop;
|
|
|
import com.sckw.core.utils.*;
|
|
import com.sckw.core.utils.*;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
|
|
+import com.sckw.core.web.context.LoginEntHolder;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.excel.utils.DateUtil;
|
|
import com.sckw.excel.utils.DateUtil;
|
|
|
import com.sckw.payment.api.dubbo.PayCenterDubboService;
|
|
import com.sckw.payment.api.dubbo.PayCenterDubboService;
|
|
@@ -39,6 +41,7 @@ import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.KwsUserResDto;
|
|
import com.sckw.system.api.model.dto.res.KwsUserResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
|
|
+import jakarta.servlet.http.HttpServletRequest;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
@@ -886,7 +889,7 @@ public class KwpGoodsService {
|
|
|
* @Param params:
|
|
* @Param params:
|
|
|
* @return: com.sckw.core.model.page.PageResult
|
|
* @return: com.sckw.core.model.page.PageResult
|
|
|
*/
|
|
*/
|
|
|
- public PageResult buildingMaterialsMarketList(BuildingMaterialsMarketListParam params) {
|
|
|
|
|
|
|
+ public PageResult buildingMaterialsMarketList(BuildingMaterialsMarketListParam params, HttpServletRequest request) {
|
|
|
Page<KwpGoods> page = new Page<>(params.getPage(), params.getPageSize());
|
|
Page<KwpGoods> page = new Page<>(params.getPage(), params.getPageSize());
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode()).eq(KwpGoods::getDelFlag, Global.NO);
|
|
wrapper.eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode()).eq(KwpGoods::getDelFlag, Global.NO);
|
|
@@ -915,6 +918,16 @@ public class KwpGoodsService {
|
|
|
wrapper.like(KwpGoods::getName, params.getKeywords());
|
|
wrapper.like(KwpGoods::getName, params.getKeywords());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //专场逻辑
|
|
|
|
|
+ String accessSpecial = request.getHeader("Access-Special");
|
|
|
|
|
+ //是否主平台
|
|
|
|
|
+ boolean mainPlatform = remoteSystemService.queryMainPlatform(accessSpecial);
|
|
|
|
|
+ if (!mainPlatform) {
|
|
|
|
|
+ List<Long> entIds = remoteSystemService.queryEntIdsByCode(accessSpecial, String.valueOf(EntTypeEnum.SUPPLIER.getCode()));
|
|
|
|
|
+ wrapper.in(KwpGoods::getEntId, entIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
wrapper.last("order by RAND()");
|
|
wrapper.last("order by RAND()");
|
|
|
Page<KwpGoods> kwpGoodsPage = kwpGoodsMapper.selectPage(page, wrapper);
|
|
Page<KwpGoods> kwpGoodsPage = kwpGoodsMapper.selectPage(page, wrapper);
|
|
|
List<KwpGoods> list = kwpGoodsPage.getRecords();
|
|
List<KwpGoods> list = kwpGoodsPage.getRecords();
|
|
@@ -965,7 +978,6 @@ public class KwpGoodsService {
|
|
|
return PageResult.build(params.getPage(), params.getPageSize(), kwpGoodsPage.getTotal(), result);
|
|
return PageResult.build(params.getPage(), params.getPageSize(), kwpGoodsPage.getTotal(), result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @desc: 商品下拉列表
|
|
* @desc: 商品下拉列表
|
|
|
* @author: yzc
|
|
* @author: yzc
|
|
@@ -973,7 +985,7 @@ public class KwpGoodsService {
|
|
|
* @Param params:
|
|
* @Param params:
|
|
|
* @return: java.util.List<com.sckw.product.model.vo.res.GoodsDropList>
|
|
* @return: java.util.List<com.sckw.product.model.vo.res.GoodsDropList>
|
|
|
*/
|
|
*/
|
|
|
- public List<GoodsDropList> dropList(GoodsDropListReq params) {
|
|
|
|
|
|
|
+ public List<GoodsDropList> dropList(GoodsDropListReq params, HttpServletRequest request) {
|
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<KwpGoods> wrapper = new LambdaQueryWrapper<>();
|
|
|
if (Objects.equals(params.getOrderType(), 2)) {
|
|
if (Objects.equals(params.getOrderType(), 2)) {
|
|
|
Long supplyEntId = params.getSupplyEntId();
|
|
Long supplyEntId = params.getSupplyEntId();
|
|
@@ -985,6 +997,16 @@ public class KwpGoodsService {
|
|
|
wrapper.like(StringUtils.isNotBlank(params.getName()), KwpGoods::getName, params.getName())
|
|
wrapper.like(StringUtils.isNotBlank(params.getName()), KwpGoods::getName, params.getName())
|
|
|
.eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode())
|
|
.eq(KwpGoods::getStatus, GoodsStatusEnum.PUT_ON_SHELVES.getCode())
|
|
|
.eq(KwpGoods::getDelFlag, Global.NO).orderByDesc(KwpGoods::getAddedTime);
|
|
.eq(KwpGoods::getDelFlag, Global.NO).orderByDesc(KwpGoods::getAddedTime);
|
|
|
|
|
+
|
|
|
|
|
+ //专场逻辑
|
|
|
|
|
+ String accessSpecial = request.getHeader("Access-Special");
|
|
|
|
|
+ //是否主平台
|
|
|
|
|
+ boolean mainPlatform = remoteSystemService.queryMainPlatform(accessSpecial);
|
|
|
|
|
+ if (!mainPlatform) {
|
|
|
|
|
+ List<Long> entIds = remoteSystemService.queryEntIdsByCode(accessSpecial, String.valueOf(EntTypeEnum.SUPPLIER.getCode()));
|
|
|
|
|
+ wrapper.in(KwpGoods::getEntId, entIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
|
|
List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|