dev-discount
胡锐 3 years ago
commit 5d53a0c674
  1. 11
      hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java
  2. 2
      hai-bweb/src/main/resources/dev/config.properties
  3. 2
      hai-bweb/src/main/resources/prod/config.properties

@ -1,5 +1,6 @@
package com.bweb.controller; package com.bweb.controller;
import com.bweb.config.SysConst;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.QRCodeGenerator; import com.hai.common.QRCodeGenerator;
@ -160,21 +161,21 @@ public class HighAgentController {
@RequestMapping(value = "/generateRechargeAgentQrCode", method = RequestMethod.GET) @RequestMapping(value = "/generateRechargeAgentQrCode", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "生成【充值代理商】二维码") @ApiOperation(value = "生成【代理商】二维码")
public ResponseData generateRechargeAgentQrCode(@RequestParam(value = "agentId", required = true) Long agentId) { public ResponseData generateRechargeAgentQrCode(@RequestParam(value = "agentId", required = true) Long agentId) {
try { try {
HighAgent highAgent = highAgentService.findByAgentMsgId(agentId); HighAgent highAgent = highAgentService.findByAgentMsgId(agentId);
// 代理商类型 1:卡券代理商 2:充值代理商 // 代理商类型 1:卡券代理商 2:充值代理商
if (highAgent == null || highAgent.getType() != 2) { if (highAgent == null) {
log.error("HighAgentController --> generateRechargeAgentQrCode() error!", "此代理商暂无法生成二维码"); log.error("HighAgentController --> generateRechargeAgentQrCode() error!", "此代理商暂无法生成二维码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此代理商暂无法生成二维码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此代理商暂无法生成二维码");
} }
// 生成二维码 // 生成二维码
String url = "https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue="; String url = SysConst.getSysConfig().getAgentQrCodeWxUrl();
String qrCodeImg = "rechargeAgentQrCode/" + highAgent.getAgentKey()+".png"; String qrCodeImg = "agentQrCode/" + highAgent.getId()+".png";
String qrCodeUrl = "/home/project/hsg/filesystem/" + qrCodeImg; String qrCodeUrl = "/home/project/hsg/filesystem/" + qrCodeImg;
QRCodeGenerator.generateQRCodeImage(url+highAgent.getAgentKey(), 350, 350, qrCodeUrl); QRCodeGenerator.generateQRCodeImage(url+highAgent.getId(), 350, 350, qrCodeUrl);
highAgent.setExt1(qrCodeImg); highAgent.setExt1(qrCodeImg);
highAgentService.updateAgentDetail(highAgent); highAgentService.updateAgentDetail(highAgent);
return ResponseMsgUtil.success(qrCodeImg); return ResponseMsgUtil.success(qrCodeImg);

@ -1,4 +1,4 @@
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/hsg/filesystem/cmsPath
agentQrCode=/home/project/hsg/filesystem/agentQrCode agentQrCode=/home/project/hsg/filesystem/agentQrCode
agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=gogogo&id= agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=ic&id=

@ -1,4 +1,4 @@
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/hsg/filesystem/cmsPath
agentQrCode=/home/project/hsg/filesystem/agentQrCode agentQrCode=/home/project/hsg/filesystem/agentQrCode
agentQrCodeWxUrl=https://hsg.dctpay.com/wx/?action=gogogo&id= agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=ic&id=

Loading…
Cancel
Save