'修改代理商优惠券二维码内容'

dev-discount
199901012 4 years ago
parent 6095762522
commit c58f940015
  1. 10
      hai-bweb/src/main/java/com/bweb/config/SysConfig.java
  2. 6
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java
  3. 1
      hai-bweb/src/main/resources/dev/config.properties
  4. 1
      hai-bweb/src/main/resources/prod/config.properties
  5. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  6. 17
      hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java
  7. 10
      hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java
  8. 6
      hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java

@ -15,6 +15,16 @@ public class SysConfig {
private String agentQrCode; private String agentQrCode;
private String agentQrCodeWxUrl;
public String getAgentQrCodeWxUrl() {
return agentQrCodeWxUrl;
}
public void setAgentQrCodeWxUrl(String agentQrCodeWxUrl) {
this.agentQrCodeWxUrl = agentQrCodeWxUrl;
}
public String getFileUrl() { public String getFileUrl() {
return fileUrl; return fileUrl;
} }

@ -108,10 +108,8 @@ public class HighDiscountAgentRelController {
String qrCodeUrl = SysConst.getSysConfig().getAgentQrCode() + "/" + qrCodeImg; String qrCodeUrl = SysConst.getSysConfig().getAgentQrCode() + "/" + qrCodeImg;
//参数 //参数
Map<String, Object> map = new HashMap<>(); String url = SysConst.getSysConfig().getAgentQrCodeWxUrl() + highDiscountAgentRel.getId();
map.put("type", QrCodeType.AGENT_QR_CODE); QRCodeGenerator.generateQRCodeImage(url, 350, 350, qrCodeUrl);
map.put("code", Base64Util.encode(AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString())));
QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl);
highDiscountAgentRel.setQrCode(qrCodeImg); highDiscountAgentRel.setQrCode(qrCodeImg);
highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel); highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel);

@ -1,3 +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/test?id=

@ -1,3 +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/test?id=

@ -96,6 +96,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/discount/getDiscountByQrCode") .excludePathPatterns("/discount/getDiscountByQrCode")
.excludePathPatterns("/discount/getDiscountById") .excludePathPatterns("/discount/getDiscountById")
.excludePathPatterns("/discount/getCouponByDiscount") .excludePathPatterns("/discount/getCouponByDiscount")
.excludePathPatterns("/discount/getDiscountByDiscountAgentId")
.excludePathPatterns("/highMerchantStore/getMerchantStoreById") .excludePathPatterns("/highMerchantStore/getMerchantStoreById")
.excludePathPatterns("/highMerchantStore/getStoreListByCoupon") .excludePathPatterns("/highMerchantStore/getStoreListByCoupon")
.excludePathPatterns("/highMerchantStore/getMerchantList") .excludePathPatterns("/highMerchantStore/getMerchantList")

@ -6,12 +6,10 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil; import com.hai.common.security.AESEncodeUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighDiscount;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.HighDiscountAgentRelService; import com.hai.service.HighDiscountAgentRelService;
import com.hai.service.HighDiscountCouponRelService; import com.hai.service.HighDiscountCouponRelService;
import com.hai.service.HighDiscountService; import com.hai.service.HighDiscountService;
import com.hai.service.HighDiscountUserRelService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -62,6 +60,21 @@ public class HighDiscountController {
} }
} }
@RequestMapping(value="/getDiscountByDiscountAgentId",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据优惠券和代理商id 查询")
public ResponseData getDiscountByDiscountAgentId(@RequestParam(name = "discountAgentId", required = true) Long discountAgentId) {
try {
return ResponseMsgUtil.success(highDiscountAgentRelService.getRelById(discountAgentId));
} catch (Exception e) {
log.error("HighDiscountController -> getDiscountByDiscountAgentId() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDiscountById",method = RequestMethod.GET) @RequestMapping(value="/getDiscountById",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "根据id 查询优惠券详情") @ApiOperation(value = "根据id 查询优惠券详情")

@ -44,20 +44,14 @@ public class SynchronizeCNPC {
bodyMap.put("appId", "jsVpwDoHZfR2rrpjhA"); bodyMap.put("appId", "jsVpwDoHZfR2rrpjhA");
bodyMap.put("pageNo", 1); bodyMap.put("pageNo", 1);
bodyMap.put("pageSize", 10); bodyMap.put("pageSize", 10);
bodyMap.put("startTime", "2021-3-31 00:00:00"); bodyMap.put("startTime", new Date());
bodyMap.put("endTime", "2021-3-31 23:00:00"); bodyMap.put("endTime", new Date());
bodyMap.put("customerCode", "48464274"); bodyMap.put("customerCode", "48464274");
String signature = "hAFO76ZqXmIqosNw3PTAP4wxGJTN7MPawSU0QFDzzNioLjKMEaVFDlNKRIQX6n0DgyoVMy170T0b13P8uUTAQsbk9UNRPFO5i0fWp1hHOhNdaaQ2BdC0WXQz5QQ5epyK"; String signature = "hAFO76ZqXmIqosNw3PTAP4wxGJTN7MPawSU0QFDzzNioLjKMEaVFDlNKRIQX6n0DgyoVMy170T0b13P8uUTAQsbk9UNRPFO5i0fWp1hHOhNdaaQ2BdC0WXQz5QQ5epyK";
Long date = new Date().getTime(); Long date = new Date().getTime();
String sha256 = encodeBySHA256(signature + JSON.toJSONString(bodyMap) + date); String sha256 = encodeBySHA256(signature + JSON.toJSONString(bodyMap) + date);
/* Map<String,Object> headerMap = new HashMap<>();
headerMap.put("token", token);
headerMap.put("sign", sha256);
headerMap.put("ts", date);*/
//map2.put("sign", sha256);
JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date); JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date);
log.error(object.toJSONString()); log.error(object.toJSONString());
} }

@ -317,9 +317,9 @@ public class HttpsUtils {
try { try {
HttpPost httpPost = new HttpPost(apiUrl); HttpPost httpPost = new HttpPost(apiUrl);
httpPost.setConfig(requestConfig); httpPost.setConfig(requestConfig);
//httpPost.setHeader("token", token); httpPost.setHeader("token", token);
//httpPost.setHeader("sign", sign); httpPost.setHeader("sign", sign);
//httpPost.setHeader("ts", ts.toString()); httpPost.setHeader("ts", ts.toString());
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题 StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8"); stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json"); stringEntity.setContentType("application/json");

Loading…
Cancel
Save