Commit 9d04736e authored by shiyu's avatar shiyu

删除玩物得志商家默认是藏家的逻辑,只根据藏家白名单判断是否是藏家

parent f65e0f7c
...@@ -211,12 +211,16 @@ public class UserServiceImpl implements UserService { ...@@ -211,12 +211,16 @@ public class UserServiceImpl implements UserService {
user.setMobile(phone); user.setMobile(phone);
result.put("phone", phone); result.put("phone", phone);
boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(dto.getUserId()); boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(dto.getUserId());
if (collectorWhiteListFlag) {
result.put("isCollector", true);
} else {
result.put("isCollector", false);
}
int userLevel = UserEnum.LevelEnum.COMMON.getCode(); int userLevel = UserEnum.LevelEnum.COMMON.getCode();
//判断登录用户是否是分销商 //判断登录用户是否是分销商
if (shopWhiteListDao.isExisted(dto.getUserId())) { if (shopWhiteListDao.isExisted(dto.getUserId())) {
ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId()); ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId());
result.put("isShop", true); result.put("isShop", true);
result.put("isCollector", true);
result.put("shopId", shopWhiteList.getShopId() == null ? dto.getUserId() : shopWhiteList.getShopId()); result.put("shopId", shopWhiteList.getShopId() == null ? dto.getUserId() : shopWhiteList.getShopId());
userLevel = UserEnum.LevelEnum.DISTRIBUTOR.getCode(); userLevel = UserEnum.LevelEnum.DISTRIBUTOR.getCode();
if (collectorWhiteListFlag) { if (collectorWhiteListFlag) {
...@@ -229,7 +233,6 @@ public class UserServiceImpl implements UserService { ...@@ -229,7 +233,6 @@ public class UserServiceImpl implements UserService {
ShopDTO shopDTO = cloudServerResponse.getResult(); ShopDTO shopDTO = cloudServerResponse.getResult();
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) { if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) {
result.put("isShop", true); result.put("isShop", true);
result.put("isCollector", true);
result.put("shopId", shopDTO.getShopId()); result.put("shopId", shopDTO.getShopId());
//新商家登录,在表中记录 //新商家登录,在表中记录
ShopWhiteList shopWhiteList = new ShopWhiteList(); ShopWhiteList shopWhiteList = new ShopWhiteList();
......
...@@ -469,8 +469,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -469,8 +469,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
map.put("prepayId", prepayId); map.put("prepayId", prepayId);
//计算分销商的利润 //计算分销商的利润
DistributorProfit distributorProfit = new DistributorProfit(); DistributorProfit distributorProfit = new DistributorProfit();
//平台服务费 //平台服务费,默认15%
double channelServiceCost = distributionOrder.getAmount().doubleValue() * 0.05; double channelServiceCost = distributionOrder.getAmount().doubleValue() * 0.15;
//介绍人分佣,自己推荐获得的订单无需计算介绍佣金 //介绍人分佣,自己推荐获得的订单无需计算介绍佣金
// double introduceCost = 0; // double introduceCost = 0;
// if (supplierItem.getCreatorId() != introducerId) { // if (supplierItem.getCreatorId() != introducerId) {
......
...@@ -9,6 +9,7 @@ import com.wwdz.ch.core.util.CacheUtil; ...@@ -9,6 +9,7 @@ import com.wwdz.ch.core.util.CacheUtil;
import com.wwdz.ch.core.util.PriceUtil; import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.core.util.RedisUtils; import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.db.bean.DistributionOrderNum; import com.wwdz.ch.db.bean.DistributionOrderNum;
import com.wwdz.ch.db.dao.CollectorWhiteListDao;
import com.wwdz.ch.db.dao.FollowFansRecordDao; import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.dao.SwitchDao; import com.wwdz.ch.db.dao.SwitchDao;
import com.wwdz.ch.db.dao.UserDao; import com.wwdz.ch.db.dao.UserDao;
...@@ -89,6 +90,9 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -89,6 +90,9 @@ public class SelfPageServiceImpl implements SelfPageService {
@Autowired @Autowired
ShopWhiteListDao shopWhiteListDao; ShopWhiteListDao shopWhiteListDao;
@Autowired
CollectorWhiteListDao collectorWhiteListDao;
@Override @Override
public Result getDistributorPageInfo(SelfPageRequestDto dto) { public Result getDistributorPageInfo(SelfPageRequestDto dto) {
...@@ -255,9 +259,14 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -255,9 +259,14 @@ public class SelfPageServiceImpl implements SelfPageService {
map.put("count", count); map.put("count", count);
//判断是否是藏家 //判断是否是藏家
boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(itemUserId);
if (collectorWhiteListFlag) {
map.put("isCollector", true);
} else {
map.put("isCollector", false);
}
if (shopWhiteListDao.isExisted(itemUserId)) { if (shopWhiteListDao.isExisted(itemUserId)) {
map.put("isShop", true); map.put("isShop", true);
map.put("isCollector", true);
} else { } else {
try { try {
CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(itemUserId, new ShopQueryOption()); CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(itemUserId, new ShopQueryOption());
...@@ -265,13 +274,11 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -265,13 +274,11 @@ public class SelfPageServiceImpl implements SelfPageService {
ShopDTO shopDTO = cloudServerResponse.getResult(); ShopDTO shopDTO = cloudServerResponse.getResult();
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) { if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) {
map.put("isShop", true); map.put("isShop", true);
map.put("isCollector", true);
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("根据用户id查询店铺信息失败error:{}", e); logger.error("根据用户id查询店铺信息失败error:{}", e);
map.put("isShop", false); map.put("isShop", false);
map.put("isCollector", false);
} }
} }
return Result.success(map); return Result.success(map);
......
...@@ -11,6 +11,7 @@ import com.wwdz.ch.core.util.CacheUtil; ...@@ -11,6 +11,7 @@ import com.wwdz.ch.core.util.CacheUtil;
import com.wwdz.ch.core.util.MediaUtil; import com.wwdz.ch.core.util.MediaUtil;
import com.wwdz.ch.core.util.PriceUtil; import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.dao.CollectionBookSortDao; import com.wwdz.ch.db.dao.CollectionBookSortDao;
import com.wwdz.ch.db.dao.CollectorWhiteListDao;
import com.wwdz.ch.db.dao.FollowFansRecordDao; import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.dao.SwitchDao; import com.wwdz.ch.db.dao.SwitchDao;
import com.wwdz.ch.db.dao.distribution.*; import com.wwdz.ch.db.dao.distribution.*;
...@@ -134,6 +135,9 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -134,6 +135,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Autowired @Autowired
ShopWhiteListDao shopWhiteListDao; ShopWhiteListDao shopWhiteListDao;
@Autowired
CollectorWhiteListDao collectorWhiteListDao;
@Override @Override
public Result findList(SupplierItemRequestDto dto) { public Result findList(SupplierItemRequestDto dto) {
...@@ -823,22 +827,11 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -823,22 +827,11 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo.setWechatQrCode(user.getWechatQrCode()); supplierItemVo.setWechatQrCode(user.getWechatQrCode());
} }
//判断是否是藏家 //判断是否是藏家
if (shopWhiteListDao.isExisted(supplierItem.getCreatorId())) { boolean collectorWhiteListFlag = collectorWhiteListDao.isExisted(supplierItem.getCreatorId());
if (collectorWhiteListFlag) {
supplierItemVo.setIsCollector(true); supplierItemVo.setIsCollector(true);
} else { } else {
supplierItemVo.setIsCollector(false); supplierItemVo.setIsCollector(false);
try {
CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(supplierItem.getCreatorId(), new ShopQueryOption());
if (cloudServerResponse.isSuccess()) {
ShopDTO shopDTO = cloudServerResponse.getResult();
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getPayStatus() == 1 && shopDTO.getCheckStatus() == 1 && shopDTO.getType() == 4) {
supplierItemVo.setIsCollector(true);
}
}
} catch (Exception e) {
logger.error("根据用户id查询店铺信息失败error:{}", e);
supplierItemVo.setIsCollector(false);
}
} }
} else { } else {
supplierItemVo.setIsMine(true); supplierItemVo.setIsMine(true);
......
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