From 3dec0b861939b8784c66ac7371e98645f1847e68 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 27 Jun 2023 10:05:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BsMerPlatformNoController.java | 30 ++++++++++++++----- .../java/com/hfkj/entity/BsMerPlatformNo.java | 12 +++++++- .../impl/BsMerPlatformNoServiceImpl.java | 6 +++- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/cweb/src/main/java/com/cweb/controller/BsMerPlatformNoController.java b/cweb/src/main/java/com/cweb/controller/BsMerPlatformNoController.java index 5bb6cc0..19c78ce 100644 --- a/cweb/src/main/java/com/cweb/controller/BsMerPlatformNoController.java +++ b/cweb/src/main/java/com/cweb/controller/BsMerPlatformNoController.java @@ -1,8 +1,11 @@ package com.cweb.controller; import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsMerPlatformNo; +import com.hfkj.entity.BsMerPlatformTerm; import com.hfkj.model.ResponseData; import com.hfkj.service.BsMerPlatformNoService; +import com.hfkj.service.BsMerPlatformTermService; import com.hfkj.sysenum.PlatformTypeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -15,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @className: BsMerPlatformNo @@ -22,23 +28,33 @@ import javax.annotation.Resource; * @date: 2023/5/23 **/ @Controller -@Api(value = "设备管理") -@RequestMapping(value = "/merPlatformNo") +@Api(value = "商户渠道管理") +@RequestMapping(value = "/merPlatform") public class BsMerPlatformNoController { private static Logger log = LoggerFactory.getLogger(BsMerLedgerController.class); @Resource private BsMerPlatformNoService merPlatformNoService; + @Resource + private BsMerPlatformTermService merPlatformTermService; - @RequestMapping(value="/getMerPlatformNo",method = RequestMethod.GET) + @RequestMapping(value="/getMerPlatformList",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询商户分账功能") - public ResponseData getMerPlatformNo(@RequestParam(name = "merId", required = true) Long merId, - @RequestParam(name = "platformType", required = true) Integer platformType) { + @ApiOperation(value = "查询商户渠道平台列表") + public ResponseData getMerPlatformList(@RequestParam(name = "merId", required = true) Long merId, + @RequestParam(name = "platformType", required = false) Integer platformType) { try { - return ResponseMsgUtil.success(merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.getDataByNumber(platformType))); + Map param = new HashMap<>(); + param.put("merId", merId); + param.put("platformType", platformType); + + List merPlatformNoList = merPlatformNoService.getMerPlatformNoList(param); + for (BsMerPlatformNo merPlatformNo : merPlatformNoList) { + merPlatformNo.setMerPlatformTerm(merPlatformTermService.getMerPlatformTerm(merPlatformNo.getId(), "WECHAT_PAY")); + } + return ResponseMsgUtil.success(merPlatformNoList); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/service/src/main/java/com/hfkj/entity/BsMerPlatformNo.java b/service/src/main/java/com/hfkj/entity/BsMerPlatformNo.java index cae2904..95a8b19 100644 --- a/service/src/main/java/com/hfkj/entity/BsMerPlatformNo.java +++ b/service/src/main/java/com/hfkj/entity/BsMerPlatformNo.java @@ -109,6 +109,16 @@ public class BsMerPlatformNo implements Serializable { private String ext3; + BsMerPlatformTerm merPlatformTerm; + + public BsMerPlatformTerm getMerPlatformTerm() { + return merPlatformTerm; + } + + public void setMerPlatformTerm(BsMerPlatformTerm merPlatformTerm) { + this.merPlatformTerm = merPlatformTerm; + } + private static final long serialVersionUID = 1L; public Long getId() { @@ -373,4 +383,4 @@ public class BsMerPlatformNo implements Serializable { sb.append("]"); return sb.toString(); } -} \ No newline at end of file +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerPlatformNoServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerPlatformNoServiceImpl.java index bc703a2..a784fc8 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerPlatformNoServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsMerPlatformNoServiceImpl.java @@ -67,11 +67,15 @@ public class BsMerPlatformNoServiceImpl implements BsMerPlatformNoService { criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId")); } + if (MapUtils.getLong(param, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); + } + if (MapUtils.getInteger(param, "platformType") != null) { criteria.andPlatformTypeEqualTo(MapUtils.getInteger(param, "platformType")); } - + example.setOrderByClause("create_time desc"); return merPlatformNoMapper.selectByExample(example); } }