Merge remote-tracking branch 'origin/master'

This commit is contained in:
韩鹏辉 2023-07-13 16:41:14 +08:00
commit 22179ce8de
13 changed files with 136 additions and 37 deletions

View File

@ -41,18 +41,19 @@ public class IntroduceController {
if (Objects.equals(entity.getType(), "1")) {
String type = httpServletRequest.getHeader("type");
//TODO 暂时安卓开发IOS不开
if ("1".equals(type)){
if ("1".equals(type) || "2".equals(type)){
return ResultGenerator.genSuccessResult(entity.getContent());
}else if ("2".equals(type)){
return ResultGenerator.genFailResult("");
}
// else if ("2".equals(type)){
// return ResultGenerator.genFailResult("");
// }
return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent());
}else {
return ResultGenerator.genFailResult("");
}
}
private String image(String typeCode, String merchantType){
if ("AG".equals(typeCode)){
if ("AG".equals(typeCode) || "FB".equals(typeCode) || "SB".equals(typeCode)){
return image.PROMOTION_IMAGE.getImageUrl();
}
if ("1".equals(merchantType)){
@ -72,11 +73,11 @@ public class IntroduceController {
if (Objects.equals(entity.getType(), "1")) {
String type = httpServletRequest.getHeader("type");
//TODO 暂时安卓开发IOS不开
if ("1".equals(type)){
return ResultGenerator.genSuccessResult(image(params.get("typeCode"), params.get("merchantType")));
}else if ("2".equals(type)){
return ResultGenerator.genFailResult("");
}
if ("1".equals(type) || "2".equals(type)){
return ResultGenerator.genSuccessResult(image(params.get("typeCode"), params.get("merchantType")));}
// }else if ("2".equals(type)){
// return ResultGenerator.genFailResult("");
// }
return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent());
}else {
return ResultGenerator.genFailResult("");

View File

@ -15,10 +15,7 @@ import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.leshua.*;
import cn.pluss.platform.leshua.impl.LeshuaMerchantAuditService;
import cn.pluss.platform.level.LevelService;
import cn.pluss.platform.mapper.MerchantImageMapper;
import cn.pluss.platform.mapper.MerchantOrderMapper;
import cn.pluss.platform.mapper.MerchantRateMapper;
import cn.pluss.platform.mapper.UserPromotionMapper;
import cn.pluss.platform.mapper.*;
import cn.pluss.platform.merchant.AccountService;
import cn.pluss.platform.merchant.MerchantBaseInfoService;
import cn.pluss.platform.merchantBankCard.MerchantBankCardService;
@ -42,6 +39,8 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.gson.reflect.TypeToken;
import io.swagger.annotations.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
@ -120,6 +119,8 @@ public class UserAppController {
private MerchantChannelStatusService mcsService;
@Resource
private UserPromotionService userPromotionService;
@Resource
private CashMapper cashMapper;
private static String keyStoreUrl =
"/home/syb/resources/wechatCert/apiclient_cert.p12"; // 验证证书路径
@ -382,14 +383,14 @@ public class UserAppController {
QueryWrapper<UserPromotion> QueryWrapper = new QueryWrapper<>();
QueryWrapper.eq("user_id", result.getUserId());
UserPromotion userPromotion = userPromotionService.getOne(QueryWrapper);
if (userPromotion== null) {
MsgException.checkBlank("", "用户状态异常");
}
result.setTypeCode(userPromotion == null?"null":userPromotion.getTypeCode());
result.setMinFee(userPromotion == null?"null":userPromotion.getCurrentFee());
QueryWrapper.clear();
QueryWrapper.eq("user_id","244");
userPromotion = userPromotionService.getOne(QueryWrapper);
result.setMaxFee(userPromotion == null?"null":userPromotion.getCurrentFee());
result.setMaxFee("0.32");
result.setIsExtend(userPromotion.getIsExtend());
return ResultGenerator.genSuccessResult(result);
}
@ -552,6 +553,9 @@ public class UserAppController {
noCashMoney = totalShareMoneyToday;
allowCashMoney = totalAccumulateShareMoney - cashedMoney - noCashMoney;
//审核中的提现金额
BigDecimal bigDecimal = cashMapper.selectCashAmtTotal(String.valueOf(userId), Cash.STATUS_CHECKING);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put(
"totalShareMoneyToday",
@ -587,6 +591,7 @@ public class UserAppController {
);
resultMap.put("noCashMoney", StringUtil.bigDecimal(noCashMoney));
resultMap.put("cashedMoney", StringUtil.bigDecimal(cashedMoney));
resultMap.put("examineMoney", bigDecimal);
return ResultGenerator.genSuccessResult(resultMap);
}

View File

@ -0,0 +1,40 @@
package cn.pluss.platform.controller.store;
import cn.pluss.platform.AppletStoreUser.AppletStoreUserService;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.appletStore.AppletStoreService;
import cn.pluss.platform.entity.AppletStore;
import cn.pluss.platform.entity.AppletStoreUser;
import cn.pluss.platform.vo.AppletStoreVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author lyf
*/
@RestController
@RequestMapping("/MercApplet")
public class MercAppletController {
@Resource
private AppletStoreService appletStoreService;
@Resource
private AppletStoreUserService appletStoreUserService;
@GetMapping("/list")
public Result<Object> menuList(Integer userId){
List<AppletStoreVO> list = appletStoreService.getList(userId);
return ResultGenerator.genSuccessResult(list);
}
@PostMapping("/add")
public Result<Object> addStore(@RequestBody AppletStoreUser appletStoreUser){
Integer integer = appletStoreUserService.addAppletStoreUser(appletStoreUser);
if (integer > 0){
return ResultGenerator.genSuccessResult("");
}
return ResultGenerator.genFailResult("");
}
}

View File

@ -44,4 +44,8 @@ public class AppletStore {
*小程序appId
*/
private String appId;
/**
* 微信版本 0-正式版 1-测试版 2-体验版
*/
private Integer WxType;
}

View File

@ -342,6 +342,9 @@ public class UserApp {
@TableField(exist = false)
private String minFee;
@TableField(exist = false)
private String isExtend;
// /**
// * 有效状态 1有效 -1无效
// */

View File

@ -5,8 +5,7 @@ import lombok.Getter;
public enum image {
SMALL_IMAGE("小微","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E5%B0%8F%E5%BE%AE.png",""),
PROMOTION_IMAGE("推广","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E5%95%86%E6%88%B7%E6%8E%A8%E5%B9%BF.png",""),
OTHER_IMAGE("其他","\n" +
"https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E6%99%AE%E9%80%9A%E5%95%86%E6%88%B7%E6%8E%A8%E5%B9%BF.png","");
OTHER_IMAGE("其他","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E6%99%AE%E9%80%9A%E5%95%86%E6%88%B7%E6%8E%A8%E5%B9%BF.png","");
/**
* 通道值

View File

@ -24,7 +24,7 @@ public class AppletStoreVO {
/**
* 小程序跳转地址
*/
private String url;
private String path;
/**
* 用户是否开通 0未开通 1已开通
*/
@ -32,5 +32,13 @@ public class AppletStoreVO {
/**
*小程序appId
*/
private String appId;
private String ghappId;
/**
* 微信版本 0-正式版 1-测试版 2-体验版
*/
private Integer wxType = 0;
/**
* 小程序店铺Id
*/
private Integer appletStoreId;
}

View File

@ -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;

View File

@ -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;

View File

@ -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());

View File

@ -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");

View File

@ -2517,9 +2517,9 @@ public class MerchantController {
throw new MsgException("当前推广服务商存在违规行为, 已被关闭推广权限, 请联系收银呗客服申诉");
}
if (!"1".equals(parentInfo.getSpreadFlag())) {
throw new MsgException("该服务商已注册多个账户,该推广码无效");
}
// if (!"1".equals(parentInfo.getSpreadFlag())) {
// throw new MsgException("该服务商已注册多个账户,该推广码无效");
// }
UserInfo queryUserInfo = new UserInfo().setLoginName(phone);
List<UserInfo> existUserInfoList = userInfoMapper.queryUserInfoList(queryUserInfo);