|
|
@ -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); |
|
|
|