用户状态部分修改
This commit is contained in:
@@ -3,8 +3,12 @@ package cn.pluss.platform.appletStore.impl;
|
||||
import cn.pluss.platform.appletStore.AppletStoreService;
|
||||
import cn.pluss.platform.entity.AppletStore;
|
||||
import cn.pluss.platform.entity.AppletStoreUser;
|
||||
import cn.pluss.platform.entity.MerchantStore;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.mapper.AppletStoreMapper;
|
||||
import cn.pluss.platform.mapper.AppletStoreUserMapper;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.BeanUtils;
|
||||
import cn.pluss.platform.vo.AppletStoreVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -26,6 +30,10 @@ public class AppletStoreServiceImpl extends ServiceImpl<AppletStoreMapper, Apple
|
||||
|
||||
@Resource
|
||||
private AppletStoreUserMapper appletStoreUserMapper;
|
||||
@Resource
|
||||
private UserAppService userAppService;
|
||||
@Resource
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
@Override
|
||||
public List<AppletStoreVO> getList(Integer userId) {
|
||||
@@ -33,24 +41,34 @@ public class AppletStoreServiceImpl extends ServiceImpl<AppletStoreMapper, Apple
|
||||
queryWrapper.eq("type", 1);
|
||||
queryWrapper.orderByAsc("sort");
|
||||
List<AppletStore> appletStores = getBaseMapper().selectList(queryWrapper);
|
||||
|
||||
UserApp userApp = userAppService.queryUserAppByToken();
|
||||
userApp.getMerchantCode();
|
||||
MerchantStore storeByMerchantCode = merchantStoreService.getStoreByMerchantCode(userApp.getMerchantCode());
|
||||
//组装数据
|
||||
return menuList(appletStores,userId, storeByMerchantCode.getId());
|
||||
}
|
||||
private List<AppletStoreVO> menuList(List<AppletStore> appletStores, Integer userId, Integer storeId){
|
||||
List<AppletStoreUser> appletStoreByUser = appletStoreUserMapper.getAppletStoreByUser(userId);
|
||||
//Map<Integer, AppletStoreUser> maps = appletStoreByUser.stream().collect(Collectors.toMap(AppletStoreUser::getId, Function.identity()));
|
||||
ArrayList<AppletStoreVO> appletStoreVOList = new ArrayList<>();
|
||||
for (AppletStore appletStore : appletStores) {
|
||||
AppletStoreVO appletStoreVO = new AppletStoreVO();
|
||||
for (AppletStoreUser value : appletStoreByUser) {
|
||||
if (value.getAppleStoreId().equals(appletStore.getId())){
|
||||
appletStoreVO.setIsOpen(1);
|
||||
appletStoreVO.setAppletStoreId(value.getId());
|
||||
}
|
||||
}
|
||||
if ("餐饮商超".equals(appletStore.getStoreName())){
|
||||
appletStoreVO.setIsOpen(1);
|
||||
appletStoreVO.setAppletStoreId(storeId);
|
||||
}
|
||||
appletStoreVO.setId(appletStore.getId());
|
||||
appletStoreVO.setStoreName(appletStore.getStoreName());
|
||||
appletStoreVO.setIcon(appletStore.getIcon());
|
||||
appletStoreVO.setUrl(appletStore.getUrl());
|
||||
appletStoreVO.setAppId(appletStore.getAppId());
|
||||
appletStoreVO.setPath(appletStore.getUrl());
|
||||
appletStoreVO.setGhappId(appletStore.getAppId());
|
||||
appletStoreVO.setWxType(appletStore.getWxType() == null?0:appletStore.getWxType());
|
||||
appletStoreVOList.add(appletStoreVO);
|
||||
}
|
||||
return appletStoreVOList;
|
||||
|
||||
@@ -1933,7 +1933,7 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
||||
public void applyMarker(UserApp userApp,String code) throws Exception{
|
||||
UserInfo userInfo=new UserInfo();
|
||||
userInfo.setId(userApp.getUserId());
|
||||
UserInfo userInfos= userInfoService.queryUserInfo(userInfo);
|
||||
UserInfo userInfos = userInfoService.queryUserInfo(userInfo);
|
||||
if(ObjectUtil.isEmpty(userInfos)){
|
||||
MsgException.checkNull(null,"用户信息不存在");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.pluss.platform.userInfo.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.jiguang.common.utils.StringUtils;
|
||||
import cn.pluss.platform.channel.MchChannelRateNewService;
|
||||
@@ -114,6 +115,8 @@ public abstract class BaseUserInfoService extends ServiceImpl<UserInfoMapper, Us
|
||||
|
||||
@Setter(onMethod_ = {@Autowired})
|
||||
private UserInfoMapper userInfoMapper;
|
||||
@Resource
|
||||
protected UserPromotionMapper userPromotionMapper;
|
||||
|
||||
@Override
|
||||
public void bindInviteCode(String inviteCode) {
|
||||
@@ -152,9 +155,9 @@ public abstract class BaseUserInfoService extends ServiceImpl<UserInfoMapper, Us
|
||||
throw new MsgException("当前推广服务商存在违规行为, 已被关闭推广权限, 请联系收银呗客服申诉");
|
||||
}
|
||||
|
||||
if (!"1".equals(pUserApp.getSpreadFlag())) {
|
||||
throw new MsgException("该服务商已注册多个账户,该推广码无效");
|
||||
}
|
||||
// if (!"1".equals(pUserApp.getSpreadFlag())) {
|
||||
// throw new MsgException("该服务商已注册多个账户,该推广码无效");
|
||||
// }
|
||||
}
|
||||
|
||||
UserInfo userInfo = new UserInfo();
|
||||
@@ -349,6 +352,16 @@ public abstract class BaseUserInfoService extends ServiceImpl<UserInfoMapper, Us
|
||||
|
||||
MsgException.checkNull(checkUserInfo, "无此用户!");
|
||||
|
||||
QueryWrapper<UserPromotion> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", checkUserInfo.getId());
|
||||
UserPromotion promotion= userPromotionMapper.selectOne(queryWrapper);
|
||||
if(ObjectUtil.isEmpty(promotion)){
|
||||
MsgException.checkNull(null,"用户状态错误");
|
||||
}
|
||||
|
||||
if("MG".equals(promotion.getTypeCode())||"FO".equals(promotion.getTypeCode())||"SO".equals(promotion.getTypeCode())){
|
||||
MsgException.checkNull(null,"此用户不允许登录");
|
||||
}
|
||||
// 原则上不能以原密码进行对比,这里只是给后台登录页面一个方便
|
||||
if (password.equalsIgnoreCase(checkUserInfo.getPassword())) {
|
||||
UserApp queryUserApp;
|
||||
|
||||
@@ -76,10 +76,10 @@ public class UserInfoServiceImpl extends BaseUserInfoService {
|
||||
if (Objects.equals(ui.getStatus(), UserInfo.STATUS_NO_SPREAD)) {
|
||||
throw new MsgException("当前推广服务商存在违规行为, 已被关闭推广权限, 请联系收银呗客服申诉");
|
||||
}
|
||||
|
||||
if (!"1".equals(parentApp.getSpreadFlag())) {
|
||||
throw new MsgException("该服务商已注册多个账户,该推广码无效");
|
||||
}
|
||||
//
|
||||
// if (!"1".equals(parentApp.getSpreadFlag())) {
|
||||
// throw new MsgException("该服务商已注册多个账户,该推广码无效");
|
||||
// }
|
||||
}
|
||||
|
||||
inviteCode = userInfo.getInviteCode();
|
||||
@@ -156,6 +156,10 @@ public class UserInfoServiceImpl extends BaseUserInfoService {
|
||||
MsgException.checkNull(null,"错误的费率信息");
|
||||
}
|
||||
}
|
||||
//如果是普通商户默认费率0.38
|
||||
if (userInfo.getTypeCode().equals("MC")){
|
||||
promotion.setCurrentFee("0.38");
|
||||
}
|
||||
|
||||
promotion.setIsExtend(userInfo.getTypeCode().equals("MC")?"0":"1");
|
||||
promotion.setCreateTime(new Date());
|
||||
|
||||
@@ -132,6 +132,10 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
|
||||
MsgException.checkNull(null,"错误的费率信息");
|
||||
}
|
||||
}
|
||||
//如果是普通商户默认费率0.38
|
||||
if (userInfo.getTypeCode().equals("MC")){
|
||||
promotion.setCurrentFee("0.38");
|
||||
}
|
||||
promotionNew.setCurrentFee(promotion.getCurrentFee());
|
||||
promotionNew.setTypeCode(userInfo.getTypeCode());
|
||||
promotionNew.setIsExtend(userInfo.getTypeCode().equals("MC")?"0":"1");
|
||||
|
||||
Reference in New Issue
Block a user