From 1772afb069b75871572c9c438bbd2bc403f864df Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 13 十二月 2023 11:43:51 +0800 Subject: [PATCH] 修改bug --- ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 102 insertions(+), 4 deletions(-) diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java index 735cd40..3ef9587 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java @@ -1,5 +1,6 @@ package com.ruoyi.shop.controller.management; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.poi.ExcelUtil; @@ -7,12 +8,15 @@ import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.shop.domain.dto.*; +import com.ruoyi.shop.domain.pojo.shop.BankBranchCode; import com.ruoyi.shop.domain.vo.*; import com.ruoyi.shop.service.shop.*; import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; import com.ruoyi.system.api.domain.vo.MgtSimpleShopVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,7 +25,10 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; import java.util.List; +import java.util.Map; /** * @author jqs34 @@ -34,6 +41,8 @@ @RestController @RequestMapping("/mgt/shop") public class MgtShopController { + + Logger logger = LoggerFactory.getLogger(MgtShopController.class); @Resource private ShopService shopService; @@ -49,6 +58,12 @@ @Resource private ShopCertificateService shopCertificateService; + + @Resource + private BankBranchCodeService bankBranchCodeService; + + + @RequestMapping(value = "/listMgtShopSimpleVo", method = RequestMethod.POST) @ApiOperation(value = "获取简易商户列表") @@ -281,6 +296,7 @@ return R.ok(); } + @RequestMapping(value = "/getMgtShopAuth", method = RequestMethod.POST) @ApiOperation(value = "获取商户进件信息") public R<MgtShopAuthGetVo> getMgtShopAuth(@RequestBody MgtShopAuthGetDto mgtShopAuthGetDto) { @@ -295,13 +311,95 @@ return R.ok(mgtShopAuthCodeVo); } - @RequestMapping(value = "/mgtShopAuth", method = RequestMethod.POST) - @Log(title = "商户进件管理", businessType = BusinessType.UPDATE,operContent = "商户进件") - @ApiOperation(value = "平台商户进件") - public R mgtShopAuth(@RequestBody MgtShopAuthGetDto mgtShopAuthGetDto){ + @RequestMapping(value = "/mgtAddProfitSharingReceiver", method = RequestMethod.POST) + @Log(title = "商户进件管理", businessType = BusinessType.UPDATE,operContent = "商户添加分账方") + @ApiOperation(value = "平台商户添加分账方") + public R mgtAddProfitSharingReceiver(@RequestBody MgtShopAuthGetDto mgtShopAuthGetDto){ Long userId = SecurityUtils.getUserId(); mgtShopAuthGetDto.setUserId(userId); shopService.addProfitSharingReceiver(mgtShopAuthGetDto); return R.ok(); } + + + @RequestMapping(value = "/pageMgtShopHFTXAuth", method = RequestMethod.POST) + @ApiOperation(value = "分页获取商户进件列表(汇付天下)") + public R<Page<MgtShopHFTXAuthPageVo>> pageMgtShopHFTXAuth(@RequestBody MgtShopHFTXAuthPageDto mgtShopAuthPageDto) { + Page<MgtShopHFTXAuthPageVo> page = new Page<>(); + page.setSize(mgtShopAuthPageDto.getPageSize()); + page.setCurrent(mgtShopAuthPageDto.getPageNum()); + List<MgtShopHFTXAuthPageVo> mgtShopHFTXAuthPageVos = shopService.pageMgtShopHFTXAuth(page, mgtShopAuthPageDto); + return R.ok(page.setRecords(mgtShopHFTXAuthPageVos)); + } + + + @RequestMapping(value = "/mgtShopHFTXAuth", method = RequestMethod.POST) + @Log(title = "商户进件管理", businessType = BusinessType.UPDATE,operContent = "商户进件") + @ApiOperation(value = "平台商户进件(汇付天下)") + public R mgtShopHFTXAuth(@RequestBody MgtShopHFTXAuthDto mgtShopHFTXAuthDto) { + Long userId = SecurityUtils.getUserId(); + mgtShopHFTXAuthDto.setUserId(userId); + shopService.mgtShopHFTXAuth(mgtShopHFTXAuthDto); + return R.ok(); + } + + + @RequestMapping(value = "/merchantBasicdataNotify", method = RequestMethod.POST) + @Log(title = "商户进件回调通知(汇付天下)", businessType = BusinessType.UPDATE,operContent = "商户进件") + public void merchantBasicdataNotify(MerchantBasicDataNotifyDto dto, HttpServletResponse response){ + R<String> r = shopService.merchantBasicdataNotify(dto); + if(r.getCode() == 200){ + response.setStatus(200); + PrintWriter out = null; + try { + out = response.getWriter(); + out.print("RECV_ORD_ID_" + r.getData()); + out.flush(); + } catch (IOException e) { + e.printStackTrace(); + }finally { + out.close(); + } + } + } + + + + + @RequestMapping(value = "/getMgtShopHFTXAuthInfo", method = RequestMethod.POST) + @ApiOperation(value = "获取商户进件信息(汇付天下)") + public R<MgtShopHFTXAuthGetVo> getMgtShopHFTXAuthInfo(@Validated @RequestBody MgtShopHFTXAuthGetDto mgtShopHFTXAuthGetDto){ + MgtShopHFTXAuthGetVo mgtShopHFTXAuthInfo = shopService.getMgtShopHFTXAuthInfo(mgtShopHFTXAuthGetDto.getShopId()); + return R.ok(mgtShopHFTXAuthInfo); + } + + + @RequestMapping(value = "/setMgtShopShareRatio", method = RequestMethod.POST) + @ApiOperation(value = "设置分账比例(汇付天下)") + public R setMgtShopShareRatio(@Validated @RequestBody MgtShopShareRatioSetDto mgtShopShareRatioSetDto){ + return shopService.setMgtShopShareRatio(mgtShopShareRatioSetDto); + } + + + @RequestMapping(value = "/getMerchantBasicDataSettlement", method = RequestMethod.POST) + @ApiOperation(value = "获取提现记录(汇付天下)") + public R<List<MerchantBasicdataSettlementVo>> getMerchantBasicDataSettlement(@Validated @RequestBody MerchantBasicdataSettlementDto mgtShopShareRatioSetDto){ + return shopService.getMerchantBasicDataSettlement(mgtShopShareRatioSetDto); + } + + + @RequestMapping(value = "/getBankList", method = RequestMethod.POST) + @ApiOperation(value = "获取银行列表(汇付天下)") + public R<List<Map<String, String>>> getBankList(@Validated @RequestBody BankListGetDto dto){ + List<Map<String, String>> bankList = bankBranchCodeService.getBankList(dto.getName()); + return R.ok(bankList); + } + + + @RequestMapping(value = "/getBankBranchCode", method = RequestMethod.POST) + @ApiOperation(value = "获取银行分行列表(汇付天下)") + public R<List<Map<String, String>>> getBankBranchCode(@Validated @RequestBody BankBranchCodeGetDto dto){ + List<Map<String, String>> bankBranchCode = bankBranchCodeService.getBankBranchCode(dto.getBankNumber()); + return R.ok(bankBranchCode); + } } -- Gitblit v1.7.1