diff --git a/hai-bweb/src/main/java/com/bweb/config/SysConfig.java b/hai-bweb/src/main/java/com/bweb/config/SysConfig.java index 6fed29c0..d12c9b26 100644 --- a/hai-bweb/src/main/java/com/bweb/config/SysConfig.java +++ b/hai-bweb/src/main/java/com/bweb/config/SysConfig.java @@ -15,6 +15,16 @@ public class SysConfig { private String agentQrCode; + private String agentQrCodeWxUrl; + + public String getAgentQrCodeWxUrl() { + return agentQrCodeWxUrl; + } + + public void setAgentQrCodeWxUrl(String agentQrCodeWxUrl) { + this.agentQrCodeWxUrl = agentQrCodeWxUrl; + } + public String getFileUrl() { return fileUrl; } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index 3a5acae4..ac0964d2 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -108,10 +108,8 @@ public class HighDiscountAgentRelController { String qrCodeUrl = SysConst.getSysConfig().getAgentQrCode() + "/" + qrCodeImg; //参数 - Map map = new HashMap<>(); - map.put("type", QrCodeType.AGENT_QR_CODE); - map.put("code", Base64Util.encode(AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString()))); - QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl); + String url = SysConst.getSysConfig().getAgentQrCodeWxUrl() + highDiscountAgentRel.getId(); + QRCodeGenerator.generateQRCodeImage(url, 350, 350, qrCodeUrl); highDiscountAgentRel.setQrCode(qrCodeImg); highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel); diff --git a/hai-bweb/src/main/resources/dev/config.properties b/hai-bweb/src/main/resources/dev/config.properties index cbdda6bb..6e43f1df 100644 --- a/hai-bweb/src/main/resources/dev/config.properties +++ b/hai-bweb/src/main/resources/dev/config.properties @@ -1,3 +1,4 @@ fileUrl=/home/project/hsg/filesystem cmsPath=/home/project/hsg/filesystem/cmsPath agentQrCode=/home/project/hsg/filesystem/agentQrCode +agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/test?id= diff --git a/hai-bweb/src/main/resources/prod/config.properties b/hai-bweb/src/main/resources/prod/config.properties index cbdda6bb..6e43f1df 100644 --- a/hai-bweb/src/main/resources/prod/config.properties +++ b/hai-bweb/src/main/resources/prod/config.properties @@ -1,3 +1,4 @@ fileUrl=/home/project/hsg/filesystem cmsPath=/home/project/hsg/filesystem/cmsPath agentQrCode=/home/project/hsg/filesystem/agentQrCode +agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/test?id= diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index 9ad7684b..ee9f0d38 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -96,6 +96,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/discount/getDiscountByQrCode") .excludePathPatterns("/discount/getDiscountById") .excludePathPatterns("/discount/getCouponByDiscount") + .excludePathPatterns("/discount/getDiscountByDiscountAgentId") .excludePathPatterns("/highMerchantStore/getMerchantStoreById") .excludePathPatterns("/highMerchantStore/getStoreListByCoupon") .excludePathPatterns("/highMerchantStore/getMerchantList") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java index 90021a4e..51bfafdd 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java @@ -6,12 +6,10 @@ import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.AESEncodeUtil; import com.hai.common.utils.ResponseMsgUtil; -import com.hai.entity.HighDiscount; import com.hai.model.ResponseData; import com.hai.service.HighDiscountAgentRelService; import com.hai.service.HighDiscountCouponRelService; import com.hai.service.HighDiscountService; -import com.hai.service.HighDiscountUserRelService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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) @ResponseBody @ApiOperation(value = "根据id 查询优惠券详情") diff --git a/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java b/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java index 21d355fe..98c5fdd1 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java +++ b/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java @@ -44,20 +44,14 @@ public class SynchronizeCNPC { bodyMap.put("appId", "jsVpwDoHZfR2rrpjhA"); bodyMap.put("pageNo", 1); bodyMap.put("pageSize", 10); - bodyMap.put("startTime", "2021-3-31 00:00:00"); - bodyMap.put("endTime", "2021-3-31 23:00:00"); + bodyMap.put("startTime", new Date()); + bodyMap.put("endTime", new Date()); bodyMap.put("customerCode", "48464274"); String signature = "hAFO76ZqXmIqosNw3PTAP4wxGJTN7MPawSU0QFDzzNioLjKMEaVFDlNKRIQX6n0DgyoVMy170T0b13P8uUTAQsbk9UNRPFO5i0fWp1hHOhNdaaQ2BdC0WXQz5QQ5epyK"; Long date = new Date().getTime(); String sha256 = encodeBySHA256(signature + JSON.toJSONString(bodyMap) + date); - -/* Map 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); log.error(object.toJSONString()); } diff --git a/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java b/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java index cbf115c6..a9cd8910 100644 --- a/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java @@ -317,9 +317,9 @@ public class HttpsUtils { try { HttpPost httpPost = new HttpPost(apiUrl); httpPost.setConfig(requestConfig); - //httpPost.setHeader("token", token); - //httpPost.setHeader("sign", sign); - //httpPost.setHeader("ts", ts.toString()); + httpPost.setHeader("token", token); + httpPost.setHeader("sign", sign); + httpPost.setHeader("ts", ts.toString()); StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题 stringEntity.setContentEncoding("UTF-8"); stringEntity.setContentType("application/json");