Commit 1b3f8854 authored by shiyu's avatar shiyu

查询商品不强制登录

parent d651eb99
......@@ -49,6 +49,11 @@ public interface CommConsts {
public static final Long SYSTEM_ACCOUNT = 8888888888L;
/**
* 用户未登录的默认账号
*/
public static final Long SYSTEM_ACCOUNT_FOR_UNLOGIN = 999999999999L;
public static final String DEFAULT_SHARE_ID= "DA" + SYSTEM_ACCOUNT;
......
......@@ -45,7 +45,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/returnOrder/**", "/wx/distributionOrder/confirmSigned", "/wx/distributionOrder/delivery", "/wx/distributionOrder/cancel",
"/wx/distributionOrder/refund",
"/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/selfPage/updateSwitch", "/wx/supplierItem/findHomePage",
"/wx/specialPerformance/sendMsg", "/wx/specialPerformance/sendMsgTest", "/wx/groupPurchase/systemAddRecord","/wx/officialAccount/**"
"/wx/specialPerformance/sendMsg", "/wx/specialPerformance/sendMsgTest", "/wx/groupPurchase/systemAddRecord","/wx/officialAccount/**",
"/wx/supplierItem/**"
//下列路径上线注释
/* ,"/wx/specialPerformance/**"
, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**",
......
......@@ -1091,9 +1091,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
List<SupplierItemVo> supplierItemVos = new ArrayList<>();
//为了小程序过审,关闭列表展示,0关闭,1打开,展示一个默认
Switch sswitch = switchDao.find();
//当前用户
Long userId = dto.getUserId();
if (sswitch.getState() == 0) {
/* if (sswitch.getState() == 0) {
//开关关闭状态,检查是否有用户id,有的话检查是否有浏览记录
if (ObjectUtils.isEmpty(userId)) {
SupplierItem supplierItem = supplierItemDao.findById(3289012L);
......@@ -1115,7 +1113,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if (ObjectUtils.isEmpty(userId)) {
return Result.failed(ResultCode.UNLOGIN);
}
}
}*/
//从首页的分享链接进入,保存分享记录
if (!ObjectUtils.isEmpty(dto.getIntroducerId())) {
if (!introduceRecordDao.isExisted(dto.getUserId())) {
......@@ -1154,7 +1152,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
searchDto.setIsDeleted(false);
searchDto.setPage(dto.getPage());
searchDto.setLimit(dto.getLimit());
String viewKey = userId + ":homepage";
String viewKey = dto.getUserId() + ":homepage";
if (dto.getPage() == 1) {
if (redisUtils.hasKey(viewKey)) {
redisUtils.delete(viewKey);
......
package com.wwdz.ch.wx.web.distribution;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
......@@ -36,6 +37,9 @@ public class SupplierItemController {
@PostMapping("/findList")
public Result findList(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询供货商品列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findList(dto);
}
......@@ -43,6 +47,9 @@ public class SupplierItemController {
@PostMapping("/findDiscountList")
public Result findDiscountList(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询首页促销商品列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findDiscountList(dto);
}
......@@ -51,6 +58,9 @@ public class SupplierItemController {
@PostMapping("/findDetail")
public Result findDetail(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询供货商品详情,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findDetail(dto);
}
......@@ -86,6 +96,9 @@ public class SupplierItemController {
@PostMapping("/findAuctionDetail")
public Result findAuctionDetail(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询竞拍商品详情,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findAuctionDetail(dto);
}
......@@ -123,7 +136,7 @@ public class SupplierItemController {
return Result.failed(ResultCode.PARAM_ERROR);
}
if (dto.getUserId() == null) {
return Result.failed("用户id不能为空");
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findCollectionItemDetail(dto);
}
......@@ -144,6 +157,9 @@ public class SupplierItemController {
@PostMapping("/findHomePage")
public Result findHomePage(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询主页列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findHomePage(dto);
}
......@@ -152,6 +168,9 @@ public class SupplierItemController {
@PostMapping("/getExpectAmount")
public Result getExpectAmount(@RequestBody SupplierItemRequestDto dto) {
logger.info("获取商品预计分佣金额,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return distributorProfitService.getExpectAmount(dto);
}
......@@ -160,6 +179,9 @@ public class SupplierItemController {
@PostMapping("/findItemList")
public Result findItemList(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询商品列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findItemList(dto);
}
......@@ -169,7 +191,7 @@ public class SupplierItemController {
public Result findItemCommission(@RequestBody SupplierItemRequestDto dto) {
logger.info("查询商品服务费和佣金,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
dto.setUserId(CommConsts.SYSTEM_ACCOUNT_FOR_UNLOGIN);
}
return supplierItemService.findItemCommission(dto);
}
......
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