'提交diam'

dev-discount
胡锐 4 years ago
parent cda958fe6e
commit 841959a666
  1. 3
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java
  2. 3
      hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.bweb.config.SysConst; 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.Base64Util;
import com.hai.common.QRCodeGenerator; import com.hai.common.QRCodeGenerator;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
@ -109,7 +110,7 @@ public class HighDiscountAgentRelController {
//参数 //参数
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("type", QrCodeType.AGENT_QR_CODE); map.put("type", QrCodeType.AGENT_QR_CODE);
map.put("code", AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString())); map.put("code", AESEncodeUtil.aesEncrypt(Base64Util.encode(highDiscountAgentRel.getId().toString())));
QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl); QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl);
highDiscountAgentRel.setQrCode(qrCodeImg); highDiscountAgentRel.setQrCode(qrCodeImg);
highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel); highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel);

@ -1,5 +1,6 @@
package com.cweb.controller; package com.cweb.controller;
import com.hai.common.Base64Util;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
@ -46,7 +47,7 @@ public class HighDiscountController {
try { try {
String relId; String relId;
try { try {
relId = AESEncodeUtil.aesDecrypt(code); relId = AESEncodeUtil.aesDecrypt(Base64Util.decode(code));
} catch (Exception e) { } catch (Exception e) {
log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误"); log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误");

@ -71,7 +71,7 @@ public class HighUserDiscountController {
} }
// 领取 // 领取
highDiscountUserRelService.receiveDiscount(userInfoModel.getHighUser().getId(), discountAgentId); highDiscountUserRelService.receiveDiscount(userInfoModel.getHighUser().getId(), discountAgentId);
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("领取成功");
} catch (Exception e) { } catch (Exception e) {
log.error("HighDiscountController -> receiveDiscount() error!",e); log.error("HighDiscountController -> receiveDiscount() error!",e);

Loading…
Cancel
Save