From 8e0583b460631c1e4074931d8f7b0805709f3439 Mon Sep 17 00:00:00 2001 From: liuyingfang <1357764963@qq.com> Date: Sat, 1 Jul 2023 11:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=EF=BC=8C=E5=88=87=E6=8D=A2=E6=94=AF=E4=BB=98=E9=80=9A=E9=81=93?= =?UTF-8?q?=E6=96=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E5=90=8E=E5=8F=B0=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=97=E8=A1=A8=EF=BC=8C=E6=8E=A8=E5=B9=BF=E4=B8=89?= =?UTF-8?q?=E5=BC=A0=E5=9B=BE=E8=AF=A6=E6=83=85=EF=BC=8C=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=90=91=E5=85=85=E5=80=BC=E6=9C=8D=E5=8A=A1=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IntroduceController.java | 49 ++++- .../controller/ZfbAttestationController.java | 78 +++---- .../MerchantChannelStatusController.java | 17 ++ .../mapper/MerchantChannelStatusMapper.java | 4 + .../mapper/MerchantChannelStatusMapper.xml | 15 ++ .../channelCheck/ChannelController.java | 57 +++++ .../jsp/agreement/agreementBaseInfo.jsp | 5 +- .../WEB-INF/jsp/channel/merchantIndex.jsp | 194 ++++++++++++++++++ .../pluss/platform/vo/AccountChannelVO.java | 31 +++ .../cn/pluss/platform/vo/ChannelStatusVO.java | 1 + .../cn/pluss/platform/vo/WxCertInfoVO.java | 4 +- .../pluss/platform/vo/merchantChannelVO.java | 32 +++ .../impl/account/AccountServiceImpl.java | 3 +- .../MerchantChannelStatusService.java | 27 ++- .../MerchantChannelStatusServiceImpl.java | 124 +++++++++++ .../userInfo/impl/BaseUserInfoService.java | 48 ++--- .../platform/wx/impl/WxCertServiceImpl.java | 5 +- 17 files changed, 617 insertions(+), 77 deletions(-) create mode 100644 pluss-manage-page/src/main/java/cn/pluss/platform/controller/channelCheck/ChannelController.java create mode 100644 pluss-manage-page/src/main/webapp/WEB-INF/jsp/channel/merchantIndex.jsp create mode 100644 pluss-model-bundle/src/main/java/cn/pluss/platform/vo/AccountChannelVO.java create mode 100644 pluss-model-bundle/src/main/java/cn/pluss/platform/vo/merchantChannelVO.java diff --git a/pluss-api-page/src/main/java/cn/pluss/platform/controller/IntroduceController.java b/pluss-api-page/src/main/java/cn/pluss/platform/controller/IntroduceController.java index fa98410..9de2c4f 100644 --- a/pluss-api-page/src/main/java/cn/pluss/platform/controller/IntroduceController.java +++ b/pluss-api-page/src/main/java/cn/pluss/platform/controller/IntroduceController.java @@ -5,13 +5,14 @@ import cn.pluss.platform.api.Result; import cn.pluss.platform.api.ResultGenerator; import cn.pluss.platform.appGuide.AppGuideService; import cn.pluss.platform.entity.AppGuide; +import cn.pluss.platform.enums.image; +import com.alipay.api.domain.UserVo; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; /** @@ -26,7 +27,8 @@ public class IntroduceController { private AppGuideService appGuideService; @GetMapping({"/common", "/common/{code}"}) - public Result billIntro(@PathVariable(value = "code", required = false) String code, HttpServletRequest httpServletRequest) { + public Result billIntro(@PathVariable(value = "code", required = false) String code, HttpServletRequest httpServletRequest, + @RequestParam String typeCode) { if (StringUtils.isEmpty(code)) { String html = "


"; return ResultGenerator.genSuccessResult(html); @@ -36,10 +38,12 @@ public class IntroduceController { if (!"SHTGKT".equals(code)){ return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent()); } + //如果是推广宽图则看宽图是否开放 if (Objects.equals(entity.getType(), "1")) { String type = httpServletRequest.getHeader("type"); + //TODO 暂时安卓开发IOS不开 if ("1".equals(type)){ - return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent()); + return ResultGenerator.genSuccessResult(image(typeCode)); }else if ("2".equals(type)){ return ResultGenerator.genFailResult(""); } @@ -48,4 +52,37 @@ public class IntroduceController { return ResultGenerator.genFailResult(""); } } + private String image(String typeCode){ + switch (typeCode){ + case "AG": + return image.PROMOTION_IMAGE.getImageUrl(); + case "XW": + return image.SMALL_IMAGE.getImageUrl(); + default: + return image.OTHER_IMAGE.getImageUrl(); + } + } + + @PostMapping ({"/common"}) + public Result billIntro(HttpServletRequest httpServletRequest, + @RequestBody Map params) { + AppGuide entity = appGuideService.getByCode(params.get("code")); + if (!"SHTGKT".equals(params.get("code"))){ + return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent()); + } + //如果是推广宽图则看宽图是否开放 + if (Objects.equals(entity.getType(), "1")) { + String type = httpServletRequest.getHeader("type"); + //TODO 暂时安卓开发IOS不开 + if ("1".equals(type)){ + return ResultGenerator.genSuccessResult(image(params.get("typeCode"))); + }else if ("2".equals(type)){ + return ResultGenerator.genFailResult(""); + } + return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent()); + }else { + return ResultGenerator.genFailResult(""); + } + } + } \ No newline at end of file diff --git a/pluss-api-page/src/main/java/cn/pluss/platform/controller/ZfbAttestationController.java b/pluss-api-page/src/main/java/cn/pluss/platform/controller/ZfbAttestationController.java index f21abd1..aad51d2 100644 --- a/pluss-api-page/src/main/java/cn/pluss/platform/controller/ZfbAttestationController.java +++ b/pluss-api-page/src/main/java/cn/pluss/platform/controller/ZfbAttestationController.java @@ -2,10 +2,14 @@ package cn.pluss.platform.controller; import cn.pluss.platform.api.Result; import cn.pluss.platform.api.ResultGenerator; +import cn.pluss.platform.entity.Account; import cn.pluss.platform.entity.MerchantChannelStatus; import cn.pluss.platform.enums.ZfbChannel; import cn.pluss.platform.exception.MsgException; +import cn.pluss.platform.mapper.AccountMapper; +import cn.pluss.platform.merchant.AccountService; import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -22,6 +26,10 @@ import java.util.Map; public class ZfbAttestationController { @Resource private MerchantChannelStatusService merchantChannelStatusService; + @Resource + private AccountService accountService; + @Resource + private AccountMapper accountMapper; /** * 支付认证 @@ -30,42 +38,40 @@ public class ZfbAttestationController { */ @PostMapping public Result Attestation(@RequestBody Map params) { - List merchantCode = merchantChannelStatusService.getMerchantCodeByInfo(params.get("merchantCode")); - List result = new ArrayList<>(); - for (MerchantChannelStatus channelStatus : merchantCode) { - switch (channelStatus.getChannel()){ - case 1: - HashMap 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 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 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 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("未知通道"); - } + + QueryWrapper QueryWrapper = new QueryWrapper() + .eq("userId", Integer.valueOf(params.get("userId"))) + .eq("valid", 1); + Account one = accountService.getOne(QueryWrapper); + if (one == null){ + throw new MsgException("账号异常"); } - return ResultGenerator.genSuccessResult(result); + MerchantChannelStatus merchantCode = merchantChannelStatusService.getMerchantCodeByInfo(params.get("merchantCode"), one.getChannelType()); + HashMap merchantCodeMap = new HashMap<>(); + switch (merchantCode.getChannel()){ + case 1: + merchantCodeMap.put("virChannelFlag", merchantCode.getVirChannelFlag()); + merchantCodeMap.put("url", ZfbChannel.SXF_CHANNEL.getUrl()); + merchantCodeMap.put("nameChannel",ZfbChannel.SXF_CHANNEL.getName()); + break; + case 4: + merchantCodeMap.put("virChannelFlag", merchantCode.getVirChannelFlag()); + merchantCodeMap.put("url", ZfbChannel.YS_CHANNEL.getUrl()); + merchantCodeMap.put("nameChannel",ZfbChannel.YS_CHANNEL.getName()); + break; + case 5: + merchantCodeMap.put("virChannelFlag", merchantCode.getVirChannelFlag()); + merchantCodeMap.put("url", ZfbChannel.LKL_CHANNEL.getUrl()); + merchantCodeMap.put("nameChannel",ZfbChannel.LKL_CHANNEL.getName()); + break; + case 6: + merchantCodeMap.put("virChannelFlag", merchantCode.getVirChannelFlag()); + merchantCodeMap.put("url", ZfbChannel.YS_CHANNEL.getUrl()); + merchantCodeMap.put("nameChannel",ZfbChannel.YS_CHANNEL.getName()); + break; + default: + throw new MsgException("未知通道"); + } + return ResultGenerator.genSuccessResult(merchantCodeMap); } } diff --git a/pluss-api-page/src/main/java/cn/pluss/platform/controller/merchant/MerchantChannelStatusController.java b/pluss-api-page/src/main/java/cn/pluss/platform/controller/merchant/MerchantChannelStatusController.java index b92822f..dd8a38d 100644 --- a/pluss-api-page/src/main/java/cn/pluss/platform/controller/merchant/MerchantChannelStatusController.java +++ b/pluss-api-page/src/main/java/cn/pluss/platform/controller/merchant/MerchantChannelStatusController.java @@ -3,6 +3,7 @@ package cn.pluss.platform.controller.merchant; import cn.pluss.platform.api.Result; import cn.pluss.platform.api.ResultGenerator; import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService; +import cn.pluss.platform.vo.AccountChannelVO; import cn.pluss.platform.vo.ChannelStatusVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -31,6 +32,16 @@ public class MerchantChannelStatusController { return ResultGenerator.genSuccessResult(csVO); } + /** + * 结算类型切换 + * @return + */ + @GetMapping("/channelCheck") + public Result channelCheck(){ + return ResultGenerator.genSuccessResult(channelStatusService.channelCheck()); + } + + /** * 快速到账通道和常规通道切换 * @param params 通道标识,目前是0:常规通道, 1: 快速到账通道 @@ -42,4 +53,10 @@ public class MerchantChannelStatusController { ChannelStatusVO channelStatusVO = channelStatusService.appSwitchChannel(Integer.parseInt(flag)); return ResultGenerator.genSuccessResult(channelStatusVO); } + @PostMapping("/request") + public Result request(@RequestBody Map params){ + String flag = (String) params.get("flag"); + ChannelStatusVO channelStatusVO = channelStatusService.appSwitchRequest(Integer.parseInt(flag)); + return ResultGenerator.genSuccessResult(channelStatusVO); + } } diff --git a/pluss-dao-bundle/src/main/java/cn/pluss/platform/mapper/MerchantChannelStatusMapper.java b/pluss-dao-bundle/src/main/java/cn/pluss/platform/mapper/MerchantChannelStatusMapper.java index 4229eba..940cb35 100644 --- a/pluss-dao-bundle/src/main/java/cn/pluss/platform/mapper/MerchantChannelStatusMapper.java +++ b/pluss-dao-bundle/src/main/java/cn/pluss/platform/mapper/MerchantChannelStatusMapper.java @@ -1,8 +1,10 @@ package cn.pluss.platform.mapper; import cn.pluss.platform.entity.MerchantChannelStatus; +import cn.pluss.platform.vo.ChannelStatusVO; import cn.pluss.platform.vo.MerchantChannelStatusVO; import cn.pluss.platform.vo.UserNumVO; +import cn.pluss.platform.vo.merchantChannelVO; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.toolkit.Constants; @@ -11,6 +13,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; @Mapper public interface MerchantChannelStatusMapper extends BaseMapper { @@ -49,4 +52,5 @@ public interface MerchantChannelStatusMapper extends BaseMapper */ UserNumVO getUserNumInfo(@Param("userId") Long userId, @Param("date")String date, @Param("dateType")Integer dateType); + List pageDate(@Param("pageSize")Integer size, @Param("offset")Integer page); } diff --git a/pluss-dao-bundle/src/main/resources/mapper/MerchantChannelStatusMapper.xml b/pluss-dao-bundle/src/main/resources/mapper/MerchantChannelStatusMapper.xml index 375d8cf..7c8ac2b 100644 --- a/pluss-dao-bundle/src/main/resources/mapper/MerchantChannelStatusMapper.xml +++ b/pluss-dao-bundle/src/main/resources/mapper/MerchantChannelStatusMapper.xml @@ -74,4 +74,19 @@ WHERE channel = 4 AND `status` = 3 AND (extra ->> '$.sysFlowId') = #{sysFlowId} + diff --git a/pluss-manage-page/src/main/java/cn/pluss/platform/controller/channelCheck/ChannelController.java b/pluss-manage-page/src/main/java/cn/pluss/platform/controller/channelCheck/ChannelController.java new file mode 100644 index 0000000..cad3092 --- /dev/null +++ b/pluss-manage-page/src/main/java/cn/pluss/platform/controller/channelCheck/ChannelController.java @@ -0,0 +1,57 @@ +package cn.pluss.platform.controller.channelCheck; + + +import cn.pluss.platform.api.PageInfo; +import cn.pluss.platform.api.Result; +import cn.pluss.platform.api.ResultGenerator; +import cn.pluss.platform.controller.BaseNoModelController; +import cn.pluss.platform.entity.AppVersionInfo; +import cn.pluss.platform.entity.BestNewActivity; +import cn.pluss.platform.entity.MerchantChannelStatus; +import cn.pluss.platform.entity.UserApp; +import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService; +import cn.pluss.platform.util.PageUtils; +import cn.pluss.platform.vo.ChannelStatusVO; +import cn.pluss.platform.vo.merchantChannelVO; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.models.auth.In; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author lyf + */ +@Controller +@RequestMapping("/channel") +public class ChannelController extends BaseNoModelController { + @Resource + private MerchantChannelStatusService merchantChannelStatusService; + @GetMapping("/merchantIndex") + public String permissionIndex() { + return "/channel/merchantIndex"; + } + + @GetMapping("/page") + @ResponseBody + public Result> page(Integer size, Integer page) { + List pageData= merchantChannelStatusService.pageDate(size, page); + return ResultGenerator.genSuccessResult(pageData); + } + +// @GetMapping("/update/{merchantCode}") +// @ResponseBody +// public Result update(@PathVariable(value = "merchantCode") String merchantCode){ +// UpdateWrapper UpdateWrapper = new UpdateWrapper(); +// UpdateWrapper.eq("merchantCode", merchantCode); +// UpdateWrapper.set("") +// +// merchantChannelStatusService.update(); +// } +} diff --git a/pluss-manage-page/src/main/webapp/WEB-INF/jsp/agreement/agreementBaseInfo.jsp b/pluss-manage-page/src/main/webapp/WEB-INF/jsp/agreement/agreementBaseInfo.jsp index 95a74fd..b1874af 100644 --- a/pluss-manage-page/src/main/webapp/WEB-INF/jsp/agreement/agreementBaseInfo.jsp +++ b/pluss-manage-page/src/main/webapp/WEB-INF/jsp/agreement/agreementBaseInfo.jsp @@ -36,7 +36,7 @@
- @@ -45,6 +45,9 @@ + + +
diff --git a/pluss-manage-page/src/main/webapp/WEB-INF/jsp/channel/merchantIndex.jsp b/pluss-manage-page/src/main/webapp/WEB-INF/jsp/channel/merchantIndex.jsp new file mode 100644 index 0000000..c86a4e3 --- /dev/null +++ b/pluss-manage-page/src/main/webapp/WEB-INF/jsp/channel/merchantIndex.jsp @@ -0,0 +1,194 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2020/8/3 + Time: 14:29 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html; charset=utf-8" + pageEncoding="utf-8" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + diff --git a/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/AccountChannelVO.java b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/AccountChannelVO.java new file mode 100644 index 0000000..5b3b742 --- /dev/null +++ b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/AccountChannelVO.java @@ -0,0 +1,31 @@ +package cn.pluss.platform.vo; + +import lombok.Data; + +/** + * @author lyf + */ +@Data +public class AccountChannelVO { + /** + * 当前通道D1,D0 + */ + private String currentChannel; +// /** +// * 当前通道 status 0或无、待审核,1、审核中 2、审核失败 3、审核通过', +// */ +// private String currentStatus; + /** + * 其他通道D1,D0, 1未选择通道 + */ + private String otherChannel; +// /** +// * 其他通道 status 0或无、待审核,1、审核中 2、审核失败 3、审核通过 +// */ +// private String otherStatus; + +// /** +// * 切换通道状态 0未有切换 -1切换审核中 1已切换为当前通道 +// */ +// private Integer valid; +} diff --git a/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/ChannelStatusVO.java b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/ChannelStatusVO.java index 26cfda8..47965c2 100644 --- a/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/ChannelStatusVO.java +++ b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/ChannelStatusVO.java @@ -38,4 +38,5 @@ public class ChannelStatusVO extends MerchantChannelStatus { return signUrl; } + private Integer statusD1; } diff --git a/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/WxCertInfoVO.java b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/WxCertInfoVO.java index 52f9df5..cf44a42 100644 --- a/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/WxCertInfoVO.java +++ b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/WxCertInfoVO.java @@ -113,11 +113,11 @@ public class WxCertInfoVO { */ private String altImgUrl; - public static WxCertInfoVO empty(String channelType) { + public static WxCertInfoVO empty(String channelType, String channelId) { WxCertInfoVO wxCertInfoVO = new WxCertInfoVO(); wxCertInfoVO.setChannelType(channelType); wxCertInfoVO.setStatus(SubMerchantApplyOrder.STATUS_NO_AUDIT); - + wxCertInfoVO.setChannelId(channelId); return wxCertInfoVO; } } diff --git a/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/merchantChannelVO.java b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/merchantChannelVO.java new file mode 100644 index 0000000..d8db5e4 --- /dev/null +++ b/pluss-model-bundle/src/main/java/cn/pluss/platform/vo/merchantChannelVO.java @@ -0,0 +1,32 @@ +package cn.pluss.platform.vo; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lyf + */ +@Data +public class merchantChannelVO { + private String merchantCode; + + private Integer valid; + + private Integer status; + + private String merchantName; + + private String contactName; + + private String alias; + @JSONField(format = "yyyy-MM-dd hh:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") + private Date updateTime; + + private String virChannelFlag; + + private Integer channel; +} diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchant/impl/account/AccountServiceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchant/impl/account/AccountServiceImpl.java index e3333ce..70305f3 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchant/impl/account/AccountServiceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchant/impl/account/AccountServiceImpl.java @@ -1395,7 +1395,8 @@ public class AccountServiceImpl extends ServiceImpl impl UpdateWrapper updateWrapper0 = new UpdateWrapper<>(); updateWrapper0.eq("userId", userId) .eq("channelType", channel==0?"D0":"D1") - .set("valid", 1); + .set("valid", 1) + .set("updateTime",new Date()); boolean update0 = update(updateWrapper0); //更改另一个 UpdateWrapper updateWrapper1 = new UpdateWrapper<>(); diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/MerchantChannelStatusService.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/MerchantChannelStatusService.java index e951d67..4c0c4f3 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/MerchantChannelStatusService.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/MerchantChannelStatusService.java @@ -2,13 +2,13 @@ package cn.pluss.platform.merchantChannelStatus; import cn.pluss.platform.entity.MerchantChannelStatus; import cn.pluss.platform.mapper.MerchantChannelStatusMapper; -import cn.pluss.platform.vo.ChannelStatusVO; -import cn.pluss.platform.vo.MerchantChannelStatusVO; -import cn.pluss.platform.vo.UserNumVO; +import cn.pluss.platform.vo.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import org.apache.commons.lang3.StringUtils; @@ -52,11 +52,12 @@ public interface MerchantChannelStatusService extends IService getMerchantCodeByInfo(String merchantCode) { + default MerchantChannelStatus getMerchantCodeByInfo(String merchantCode, String channel) { QueryWrapper qWrapper = new QueryWrapper<>(); qWrapper.eq("merchantCode", merchantCode) - .eq("status",3); - return getBaseMapper().selectList(qWrapper); + .eq("status",3) + .eq("virChannelFlag", channel); + return getBaseMapper().selectOne(qWrapper); } /** @@ -164,12 +165,19 @@ public interface MerchantChannelStatusService extends IService pageDate(Integer size, Integer page); + + default void update(String merchantCode){ + UpdateWrapper objectUpdateWrapper = new UpdateWrapper() + .eq("merchantCode",merchantCode); + } } diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/impl/MerchantChannelStatusServiceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/impl/MerchantChannelStatusServiceImpl.java index f9779e6..32fc245 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/impl/MerchantChannelStatusServiceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/merchantChannelStatus/impl/MerchantChannelStatusServiceImpl.java @@ -16,13 +16,17 @@ import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService; import cn.pluss.platform.notice.NoticeService; import cn.pluss.platform.userApp.UserAppService; import cn.pluss.platform.user.impl.GeneralPushUtil; +import cn.pluss.platform.vo.AccountChannelVO; import cn.pluss.platform.vo.ChannelStatusVO; import cn.pluss.platform.vo.UserNumVO; +import cn.pluss.platform.vo.merchantChannelVO; import cn.pluss.platform.wx.WxTalkService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.Setter; import org.apache.commons.lang3.StringUtils; @@ -85,6 +89,8 @@ public class MerchantChannelStatusServiceImpl extends ServiceImpl qWrapper = Wrappers.lambdaQuery(); + if (flag == 1){ + qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, Account.CHANNEL_TYPE_D0) + .eq(MerchantChannelStatus::getMerchantCode, userApp.getMerchantCode()); + + MerchantChannelStatus quickChannel = getOne(qWrapper); + MsgException.checkNull(quickChannel, "暂未开通快速通道"); + + MsgException.checkEquals(quickChannel.getValid(), MerchantChannelStatus.VALID_STATUS_BAN, quickChannel.getRemark()); + + if (!MerchantChannelStatus.isAudited(quickChannel)) { + throw new MsgException("当前状态暂不允许切换通道"); + } + + MsgException.checkNull(quickChannel, "暂未开通快速通道"); + UpdateWrapper uWrapper = new UpdateWrapper(); + uWrapper.eq("merchantCode", userApp.getMerchantCode()) + .eq("virChannelFlag","D0") + .set("valid", -1); + update(uWrapper); + quickChannel.setValid(-1); + return Converter.INSTANCE.toVO(quickChannel); + }else { + qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, Account.CHANNEL_TYPE_D1) + .eq(MerchantChannelStatus::getMerchantCode, userApp.getMerchantCode()); + + MerchantChannelStatus channelStatus = getOne(qWrapper); + + MsgException.checkNull(channelStatus, "暂未进件"); + + String status = channelStatus.getStatus(); + + MsgException.checkEquals(channelStatus.getValid(), MerchantChannelStatus.VALID_STATUS_BAN, channelStatus.getRemark()); + + if (!MerchantChannelStatus.AUDIT_STATUS_SUCCESS.equals(status) && !MerchantChannelStatus.AUDIT_STATUS_DATA_EDIT.equals(status)) { + throw new MsgException("进件暂未通过"); + } + UpdateWrapper uWrapper = new UpdateWrapper(); + uWrapper.eq("merchantCode", userApp.getMerchantCode()) + .eq("virChannelFlag","D1") + .set("valid", -1); + update(uWrapper); + channelStatus.setValid(-1); + return Converter.INSTANCE.toVO(channelStatus); + } + } + @Override public ChannelStatusVO appCurrent() { UserApp userApp = userAppService.queryUserAppByToken(); @@ -373,9 +429,71 @@ public class MerchantChannelStatusServiceImpl extends ServiceImpl queryWrappers = new QueryWrapper() + .eq("merchantCode",entity.getMerchantCode()) + .ne("virChannelFlag","D0") + .last("LIMIT "+1); + MerchantChannelStatus one = getOne(queryWrappers); + + if (one == null) { + channelStatusVO.setStatusD1(1); + }else if ("3".equals(one.getStatus())){ + //进件完成 + channelStatusVO.setStatusD1(3); + }else if ("1".equals(one.getStatus())) { + //审核中 + channelStatusVO.setStatusD1(2); + }else { + channelStatusVO.setStatusD1(2); + } + return channelStatusVO; } + @Override + public AccountChannelVO channelCheck() { + UserApp userApp = userAppService.queryUserAppByToken(); + //当前通道 + MerchantChannelStatus entity = getValidData(userApp.getMerchantCode()); + + AccountChannelVO accountChannelVO = new AccountChannelVO(); + accountChannelVO.setCurrentChannel(entity.getVirChannelFlag()); + + if (Objects.equals(entity.getStatus(), "3")){ + if ("D0".equals(entity.getVirChannelFlag())){ + accountChannelVO.setCurrentChannel("0"); + }else if ("D1".equals(entity.getVirChannelFlag())){ + accountChannelVO.setCurrentChannel("1"); + }else { + accountChannelVO.setCurrentChannel("2"); + } + } + //另一个通道 + LambdaQueryWrapper qWrapper = new LambdaQueryWrapper() + .eq(MerchantChannelStatus::getMerchantCode, entity.getMerchantCode()) + .eq(MerchantChannelStatus::getValid,0) + .ne(MerchantChannelStatus::getVirChannelFlag, entity.getVirChannelFlag()) + .orderByAsc(MerchantChannelStatus::getValid) + .orderByDesc(MerchantChannelStatus::getId) + .last("limit 1"); + MerchantChannelStatus one = getOne(qWrapper); + if (one == null) { + accountChannelVO.setOtherChannel("0"); + }else if (one.getValid() == -1){ + accountChannelVO.setOtherChannel("2"); + }else if (one.getChannel() == null){ + accountChannelVO.setOtherChannel("3"); + }else if (Objects.equals(one.getStatus(), "3")){ + accountChannelVO.setOtherChannel("4"); + }else if(Objects.equals(one.getStatus(), "2")) { + accountChannelVO.setOtherChannel("0"); + }else { + accountChannelVO.setOtherChannel("5"); + } + return accountChannelVO; + } + @Override public MerchantChannelStatus getChannelByMerchantId(String merchantId) { @@ -451,4 +569,10 @@ public class MerchantChannelStatusServiceImpl extends ServiceImpl pageDate(Integer size, Integer page) { + + return merchantChannelStatus.pageDate(size, page-1); + } } diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/userInfo/impl/BaseUserInfoService.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/userInfo/impl/BaseUserInfoService.java index 66a1c2e..57c1e34 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/userInfo/impl/BaseUserInfoService.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/userInfo/impl/BaseUserInfoService.java @@ -454,30 +454,30 @@ public abstract class BaseUserInfoService extends ServiceImpl multiValueMap = new LinkedMultiValueMap<>(); - multiValueMap.add("mobile", loginName); - - RestTemplate restTemplate = new RestTemplate(); - // 设置为UTF8编码 - restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8)); - - String tokenInfo = restTemplate.postForObject( - "https://cz-2133569-1313226949.ap-shanghai.run.tcloudbase.com/login/kyMobilelogin", multiValueMap, - String.class); - - ObjectMapper mapper = new ObjectMapper(); - JsonNode jsonNode = mapper.readTree(tokenInfo); - JsonNode code = jsonNode.get("code"); - - if (code.asText().equals("0")) { - JsonNode token = jsonNode.get("data").get("token"); - resultMap.put("rechargeToken", token.asText()); - } - } catch (Exception e) { - - } +// resultMap.put("rechargeToken", ""); +// try { +// MultiValueMap multiValueMap = new LinkedMultiValueMap<>(); +// multiValueMap.add("mobile", loginName); +// +// RestTemplate restTemplate = new RestTemplate(); +// // 设置为UTF8编码 +// restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8)); +// +// String tokenInfo = restTemplate.postForObject( +// "https://cz-2133569-1313226949.ap-shanghai.run.tcloudbase.com/login/kyMobilelogin", multiValueMap, +// String.class); +// +// ObjectMapper mapper = new ObjectMapper(); +// JsonNode jsonNode = mapper.readTree(tokenInfo); +// JsonNode code = jsonNode.get("code"); +// +// if (code.asText().equals("0")) { +// JsonNode token = jsonNode.get("data").get("token"); +// resultMap.put("rechargeToken", token.asText()); +// } +// } catch (Exception e) { +// +// } clearJpushAlias(queryUserApp.getUserId() + ""); diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/wx/impl/WxCertServiceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/wx/impl/WxCertServiceImpl.java index 36e20db..c2489ea 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/wx/impl/WxCertServiceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/wx/impl/WxCertServiceImpl.java @@ -210,18 +210,21 @@ public class WxCertServiceImpl implements WxCertService { } private WxCertInfoVO wxCertInfo(MerchantBaseInfo mbi, String channelType) { + String channelId=null; if (StringUtils.isEmpty(channelType)) { MerchantChannelStatus mcs = mcsService.getValidData(mbi.getMerchantCode()); if (Objects.equals(mcs.getChannel(), 4)) { channelType = "D0"; + channelId = String.valueOf(mcs.getChannel()); } else { channelType = "D1"; + channelId = String.valueOf(mcs.getChannel()); } } MerchantChannelStatus mcs = mcsService.getByMerchantCodeAndChannelType(mbi.getMerchantCode(), channelType); - WxCertInfoVO result = WxCertInfoVO.empty(channelType); + WxCertInfoVO result = WxCertInfoVO.empty(channelType, channelId); result.setMerchantCode(mbi.getMerchantCode()); if (mcs == null || !(MerchantChannelStatus.AUDIT_STATUS_SUCCESS.equals(mcs.getStatus()) || MerchantChannelStatus.AUDIT_STATUS_DATA_EDIT.equals(mcs.getStatus()))) {