|
|
|
@ -17,6 +17,7 @@ import com.hai.service.HighDiscountCouponRelService; |
|
|
|
|
import com.hai.service.HighDiscountService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
@ -89,6 +90,7 @@ public class HighDiscountController { |
|
|
|
|
@ApiOperation(value = "根据Code查询优惠券") |
|
|
|
|
public ResponseData getDiscountByCode(@RequestParam(name = "code", required = true) String code) { |
|
|
|
|
try { |
|
|
|
|
System.out.println(code); |
|
|
|
|
String discountAgentId; |
|
|
|
|
try { |
|
|
|
|
discountAgentId = AESEncodeUtil.aesDecrypt(URLDecoder.decode(code, "UTF-8")); |
|
|
|
@ -96,7 +98,10 @@ public class HighDiscountController { |
|
|
|
|
log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(discountAgentId)) { |
|
|
|
|
log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误"); |
|
|
|
|
} |
|
|
|
|
// 查询优惠券与代理商关系id
|
|
|
|
|
HighDiscountAgentRel discountAgentRel = highDiscountAgentRelService.getRelById(Long.parseLong(discountAgentId)); |
|
|
|
|
if (discountAgentRel == null) { |
|
|
|
|