'修复已知问题'

dev-discount
199901012 4 years ago
parent da19bc056e
commit b82344f3af
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java
  2. 3
      hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java
  3. 2
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -97,7 +97,7 @@ public class HighDiscountAgentRelController {
// 是否已分配
if (highDiscountAgentRelService.getRelByDiscountAgent(highDiscountAgentRel.getDiscountId(), highDiscountAgentRel.getAgentId()) != null) {
log.error("HighDiscountAgentRelController -> insertDiscountAgent() error!", discount.getDiscountName() + "重复分配给" + agent.getAgentName());
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, discount.getDiscountName() + "重复分配给" + agent.getAgentName());
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, discount.getDiscountName() + "重复分配给" + agent.getAgentName());
}
highDiscountAgentRel.setCreateTime(new Date());
highDiscountAgentRel.setStatus(1);
@ -110,7 +110,7 @@ public class HighDiscountAgentRelController {
//参数
Map<String, Object> map = new HashMap<>();
map.put("type", QrCodeType.AGENT_QR_CODE);
map.put("code", AESEncodeUtil.aesEncrypt(Base64Util.encode(highDiscountAgentRel.getId().toString())));
map.put("code", Base64Util.encode(AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString())));
QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl);
highDiscountAgentRel.setQrCode(qrCodeImg);
highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel);

@ -52,6 +52,9 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
if (rel == null || rel.getHighDiscount() == null || rel.getAgentId() == null){
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, "");
}
rel.setStockCount(rel.getStockCount() - 1);
highDiscountAgentRelService.updateDiscountAgentRel(rel);
// 校验卡卷状态
if (rel.getHighDiscount().getStatus() != 2) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卡券已下架");

@ -367,7 +367,7 @@ public class HighOrderServiceImpl implements HighOrderService {
HighDiscountUserRel rel = highDiscountUserRelService.getRelById(order.getMemDiscountId());
if (rel != null) {
rel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
rel.setUseTime(new Date());
rel.setUseTime(null);
highDiscountUserRelService.updateDiscountUserRel(rel);
}
}

Loading…
Cancel
Save