增加角色相关,进件相关修改,后台增加用户默认通道,前台默认通道

This commit is contained in:
liuyingfang
2023-06-28 10:05:28 +08:00
parent e26d85f4c9
commit fe7e9f2074
11 changed files with 183 additions and 9 deletions

View File

@@ -0,0 +1,71 @@
package cn.pluss.platform.controller;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.entity.MerchantChannelStatus;
import cn.pluss.platform.enums.ZfbChannel;
import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author lyf
*/
@RestController
@RequestMapping("/zxfAttestation")
public class ZfbAttestationController {
@Resource
private MerchantChannelStatusService merchantChannelStatusService;
/**
* 支付认证
* @param params
* @return
*/
@PostMapping
public Result<Object> Attestation(@RequestBody Map<String, String> params) {
List<MerchantChannelStatus> merchantCode = merchantChannelStatusService.getMerchantCodeByInfo(params.get("merchantCode"));
List<Object> result = new ArrayList<>();
for (MerchantChannelStatus channelStatus : merchantCode) {
switch (channelStatus.getChannel()){
case 1:
HashMap<Object, Object> merchantCodeMap = new HashMap<>();
merchantCodeMap.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap.put("url", ZfbChannel.SXF_CHANNEL.getUrl());
merchantCodeMap.put("nameChannel",ZfbChannel.SXF_CHANNEL.getName());
result.add(merchantCodeMap);
break;
case 4:
HashMap<Object, Object> merchantCodeMap4 = new HashMap<>();
merchantCodeMap4.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap4.put("url", ZfbChannel.YS_CHANNEL.getUrl());
merchantCodeMap4.put("nameChannel",ZfbChannel.YS_CHANNEL.getName());
result.add(merchantCodeMap4);
break;
case 5:
HashMap<Object, Object> merchantCodeMap5 = new HashMap<>();
merchantCodeMap5.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap5.put("url", ZfbChannel.LKL_CHANNEL.getUrl());
merchantCodeMap5.put("nameChannel",ZfbChannel.LKL_CHANNEL.getName());
result.add(merchantCodeMap5);
break;
case 6:
HashMap<Object, Object> merchantCodeMap6 = new HashMap<>();
merchantCodeMap6.put("virChannelFlag", channelStatus.getVirChannelFlag());
merchantCodeMap6.put("url", ZfbChannel.YS_CHANNEL.getUrl());
merchantCodeMap6.put("nameChannel",ZfbChannel.YS_CHANNEL.getName());
result.add(merchantCodeMap6);
break;
default:
throw new MsgException("未知通道");
}
}
return ResultGenerator.genSuccessResult(result);
}
}

View File

@@ -2,9 +2,14 @@ package cn.pluss.platform.mapper;
import cn.pluss.platform.entity.UserManageProfit;
import cn.pluss.platform.entity.UserPromotion;
import cn.pluss.platform.vo.MerchantChannelStatusVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface UserPromotionMapper extends BaseMapper<UserPromotion> {
List<UserPromotion> selectListByUserId(@Param("userIdList") List<Integer> userIdList);
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.UserPromotionMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="BaseResultMap" type="cn.pluss.platform.entity.UserVoice">-->
<!-- <id column="id" property="id" />-->
<!-- <result column="userId" property="userId" />-->
<!-- <result column="paySuccess" property="paySuccess" />-->
<!-- <result column="payCancel" property="payCancel" />-->
<!-- <result column="memberCharge" property="memberCharge" />-->
<!-- <result column="memberConsume" property="memberConsume" />-->
<!-- <result column="deliveryOrder" property="deliveryOrder" />-->
<!-- <result column="storeOrder" property="storeOrder" />-->
<!-- <result column="urge" property="urge" />-->
<!-- </resultMap>-->
<select id="selectListByUserId" resultType="cn.pluss.platform.entity.UserProfit">
SELECT * FROM tb_pluss_user_promotion WHERE `user_id` IN
<foreach open="(" separator="," close=")" collection="userIdList" item="item">
#{item}
</foreach>
</select>
</mapper>

View File

@@ -620,11 +620,14 @@ public class PromoterController {
request.setAttribute("listMerchantRejectDesc", listMerchantRejectDesc);
UserApp appInfo = uaService.queryUserAppJoinById(userId);
QueryWrapper<Account> qWrapper = new QueryWrapper<Account>()
.eq("userId", userId).eq("valid", 1);
Account accountOne = accountService.getOne(qWrapper);
request.setAttribute("ppStatus", appInfo.getPpStatus());
request.setAttribute("ppThirdStatus", appInfo.getPpThirdStatus());
request.setAttribute("userId", userId);
request.setAttribute("mbi", mbi);
request.setAttribute("account", accountOne == null?"null":accountOne.getChannelType());
return "promoter/channelAuditInfo";
}

View File

@@ -84,6 +84,16 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">默认结算方式</label>
<div class="layui-input-inline">
<input type="text" class="layui-input layui-font-black"
value="${account}"/>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">审核状态</label>

View File

@@ -0,0 +1,29 @@
package cn.pluss.platform.enums;
import lombok.Getter;
/**
* @author 12847
*/
public enum ZfbChannel {
SXF_CHANNEL("随行付","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E9%9A%8F%E8%A1%8C%E4%BB%98.png"),
YS_CHANNEL("银盛","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E9%93%B6%E7%9B%9B.png"),
LKL_CHANNEL("拉卡拉","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/app/statics/%E6%8B%89%E5%8D%A1%E6%8B%89.jpg");
/**
* 通道值
*/
@Getter
String name;
/**
* 图片url
*/
@Getter
String url;
ZfbChannel(String name, String url){
this.name = name;
this.url = url;
}
}

View File

@@ -130,6 +130,7 @@ public class UserInfoVO {
*/
private String isPushWxMessage;
private String typeCode;
/**
* 是否在黑名单中
*/

View File

@@ -122,6 +122,7 @@ public interface AccountService extends IService<Account> {
* @return
*/
AccountDTO getRealAccount(String userId);
AccountDTO getReaLAccountD0(String userId);
/**
* 获取用户指定结算通道类型下的结算信息

View File

@@ -395,8 +395,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
bankCardService.save(accountDTO.getBankCard());
account.setBankCardId(accountDTO.getBankCard().getId() + "");
save(account);
this.baseMapper.insert(account);
//如果注册了一个通道给他默认
LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
qWrapperAccountD1.eq(Account::getUserId, accountDTO.getUserId());
int count = baseMapper.selectCount(qWrapperAccountD1);
if (count == 1) {
account.setValid(1);
this.baseMapper.updateById(account);
}
// if (!accountDTO.getChannelType().equals(Account.CHANNEL_TYPE_D1)) {
// return;
// }
@@ -565,8 +572,14 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
AccountDTO d0 = getRealAccount(userId, Account.CHANNEL_TYPE_D0);
storeSummaryVO.setD0(d0);
//现在只要进件一个通道就是已录入
if (d1 != null || d0 != null){
storeSummaryVO.setD0Status("1");
if ("1".equals(merchantType)) {
if (d1.getBankCard() != null || d0.getBankCard() != null) {
storeSummaryVO.setD0Status("1");
}
}else {
if (d1 != null || d0 != null) {
storeSummaryVO.setD0Status("1");
}
}
MerchantChannelStatus mcsCurrent = mcsService.getValidData(mbi.getMerchantCode());
@@ -1063,6 +1076,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
public AccountDTO getRealAccount(String userId) {
return getRealAccount(userId, Account.CHANNEL_TYPE_D1);
}
@Override
public AccountDTO getReaLAccountD0(String userId){
return getRealAccount(userId, Account.CHANNEL_TYPE_D0);
}
@Override
public void delAccount(String userId, String channelType) {

View File

@@ -52,6 +52,12 @@ public interface MerchantChannelStatusService extends IService<MerchantChannelSt
return getBaseMapper().selectOne(qWrapper);
}
default List<MerchantChannelStatus> getMerchantCodeByInfo(String merchantCode) {
QueryWrapper<MerchantChannelStatus> qWrapper = new QueryWrapper<>();
qWrapper.eq("merchantCode", merchantCode)
.eq("status",3);
return getBaseMapper().selectList(qWrapper);
}
/**
* 获取当前启用的渠道下商户的渠道信息

View File

@@ -248,14 +248,14 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
return pageResult;
}
List<String> merchantCodeList = new ArrayList<>();
List<Integer> userIdList = new ArrayList<>();
for (UserInfoVO userInfoVO : result) {
merchantCodeList.add(userInfoVO.getMerchantCode() + "");
userIdList.add(Integer.valueOf(userInfoVO.getUserId() + ""));
}
List<MerchantChannelStatusVO> channelStatusList = mcsService.listByMerchantCodeList(merchantCodeList);
Map<String, Integer> mapMerchantId = new HashMap<>();
for (UserInfoVO userInfoVO : result) {
List<MerchantChannelStatus> statusList = userInfoVO.getChannelStatusList();
if (statusList == null) {
@@ -271,7 +271,6 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
statusList.add(item);
mapMerchantId.put(item.getChannel() + item.getMerchantId() + item.getMerchantCode(), 1);
}
if (Objects.equals(4, item.getChannel())) {
if (userInfoVO.getWxMercNoD0() == null) {
userInfoVO.setWxMercNoD0(item.getWxMercNo());
@@ -823,7 +822,16 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
UserApp userApp = queryUserAppByToken();
MsgException.checkBlank(userApp.getMerchantCode(), "请完善经营信息");
AccountDTO realAccount = accountService.getRealAccount(userApp.getUserId() + "");
QueryWrapper<Account> QueryWrapper = new QueryWrapper<Account>()
.eq("userId", userApp.getUserId())
.eq("valid", 1);
Account account = accountService.getOne(QueryWrapper);
AccountDTO realAccount = null;
if (Objects.equals(account.getChannelType(), "D1")) {
realAccount = accountService.getRealAccount(userApp.getUserId() + "");
}else {
realAccount = accountService.getReaLAccountD0(userApp.getUserId()+"");
}
MsgException.checkNull(realAccount, "请完善商户结算信息");