提交代码

dev-discount
胡锐 2 years ago
parent aacd7867e5
commit eda85fdd27
  1. 20
      hai-bweb/src/main/resources/prod/logback.xml
  2. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  3. 8
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  4. 21
      hai-cweb/src/main/resources/prod-9401/logback.xml
  5. 21
      hai-cweb/src/main/resources/prod/logback.xml
  6. 20
      hai-order/src/main/resources/prod/logback.xml
  7. 2
      hai-service/src/main/java/com/hai/config/ChongQingCNPCService.java
  8. 3
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  9. 8
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  10. 34
      hai-service/src/main/java/com/hai/config/StreamUtil.java
  11. 1
      hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java
  12. 1
      hai-service/src/main/resources/dev/commonConfig.properties
  13. 1
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  14. 2
      hai-service/src/main/resources/prod/commonConfig.properties
  15. 55
      hai-user/src/main/java/com/web/controller/DiscountController.java

@ -109,6 +109,23 @@
</encoder>
</appender>
<appender name="chongQingCNPC" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/chongQingCNPC.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/ChongQingCNPC/ChongQingCNPC.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
@ -134,4 +151,7 @@
<logger name="com.hai.service.impl.OutRechargeOrderServiceImpl" level="INFO">
<appender-ref ref="RechargeLog" />
</logger>
<logger name="com.hai.config.ChongQingCNPCService" level="INFO">
<appender-ref ref="chongQingCNPC" />
</logger>
</configuration>

@ -128,6 +128,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/notify/*")
.excludePathPatterns("/highOrder/getOrderByOrderNo")
.excludePathPatterns("/coupon/getUserCouponByOrderNo")
.excludePathPatterns("/activity/getActivityByCoupon")
.excludePathPatterns("/unionPay/*")
.excludePathPatterns("/highGas/*")
.excludePathPatterns("/common/*")

@ -1,5 +1,6 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.github.pagehelper.PageHelper;
@ -220,17 +221,12 @@ public class HighCouponController {
@ApiOperation(value = "根据订单号 查询用户卡券")
public ResponseData getUserCouponByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
HighOrder order = orderService.getOrderByOrderNo(orderNo);
if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单");
}
// 查询最新一张可用的卡券
HighUserCoupon newCoupon = highUserCouponService.getUserCouponByOrder(userInfoModel.getHighUser().getId(), order.getId());
HighUserCoupon newCoupon = highUserCouponService.getUserCouponByOrder(order.getMemId(), order.getId());
if (newCoupon != null) {
Map<String, Object> map = new HashMap<>();

@ -57,6 +57,24 @@
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="chongQingCNPC" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/chongQingCNPC.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/ChongQingCNPC/ChongQingCNPC.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
@ -69,4 +87,7 @@
<logger name="com.hai" level="ERROR">
<appender-ref ref="errorlog" />
</logger>
<logger name="com.hai.config.ChongQingCNPCService" level="INFO">
<appender-ref ref="chongQingCNPC" />
</logger>
</configuration>

@ -57,6 +57,24 @@
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<appender name="chongQingCNPC" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/chongQingCNPC.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/ChongQingCNPC/ChongQingCNPC.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
@ -69,4 +87,7 @@
<logger name="com.hai" level="ERROR">
<appender-ref ref="errorlog" />
</logger>
<logger name="com.hai.config.ChongQingCNPCService" level="INFO">
<appender-ref ref="chongQingCNPC" />
</logger>
</configuration>

@ -143,6 +143,22 @@
</encoder>
</appender>
<appender name="chongQingCNPC" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/chongQingCNPC.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/ChongQingCNPC/ChongQingCNPC.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
@ -175,4 +191,8 @@
<appender-ref ref="wechatPayLog" />
</logger>
<logger name="com.hai.config.ChongQingCNPCService" level="INFO">
<appender-ref ref="chongQingCNPC" />
</logger>
</configuration>

@ -144,7 +144,7 @@ public class ChongQingCNPCService {
public static void main(String[] args) {
//System.out.println(AESTool.Decrypt("A9D356D4614F874586EAF8678C8C3E7D8CD0EEF031ADA44DDAA3B342CE4BBE44F115AABE27324A6A1F049619139A1A889FCA0FB48EB6E1EA4B1B50F041961B2D686FE8B9696C02DF95BA99B342747D67ECC7847646C87993CF924F33C1308829","n2j30jxhl3rhuoci"));
System.out.println(AESTool.Decrypt("FD65F7651FF24F67FCCC2690F03650ABEEEFA7681C9C98A45BF82C7E17776A728B68E6E6C87A4C9F444A6D64CCB025604AC6E8CD4ACB2D2EF266857191370B205FFBAA95958C4801050E3B4AE2057220","n2j30jxhl3rhuoci"));
System.out.println(AESTool.Decrypt("0E14C37B5657B48857A7D3AEFB8E24BACCA40AFF00B073FC22B4116FC97BAED3CBF38FDC5196FDF595637701FDEC1CDDA0AE518707D91B16DA65A63848AF6DB117D2F6E31A09074EB0E42422C6B3B15B96D230680D9E97E4324A384AA8E60F6E","5ojd0nkdqb1ff84t"));
//System.out.println(AESTool.Decrypt("3549AD565800370205265D7518D26E5F40C90A61FDEB5DD73966126A5D25F5E9","5ojldakiz343a6yk"));
}
}

@ -13,6 +13,8 @@ public class CommonSysConfig {
// 嗨森逛域名
private String hsgDomainName;
// 惠支付
private String hzfDomainName;
// 加油站默认图片
private String gasDefaultOilStationImg;
@ -61,6 +63,7 @@ public class CommonSysConfig {
private String huiliantongAppNo;
private String huiliantongAppkey;
private String huiliantongAppsecret;
private String huiliantongSinopecDistributorId;
private String huiliantongDistributorId;
private String huiliantongSinopecUrl;

@ -57,7 +57,7 @@ public class HuiLianTongConfig {
public static JSONObject getHltFuelCoupList() throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("serviceType", "01");
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId());
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongSinopecDistributorId() );
return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl() + "/getHltFuelCoupList", map);
}
@ -76,7 +76,7 @@ public class HuiLianTongConfig {
map.put("distCouCount", distCouCount);
map.put("couTypeCode", couTypeCode);
map.put("phone", phone);
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId());
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongSinopecDistributorId());
log.info("============请求任务Start=============");
log.info("下单购买加油券-请求参数: " + JSON.toJSONString(map));
@ -96,7 +96,7 @@ public class HuiLianTongConfig {
public static JSONObject getPayOrderByCouNo(String couNo) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("couNo", couNo);
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId());
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongSinopecDistributorId());
log.info("============请求任务Start=============");
log.info("购买加油券充值订单-请求参数: " + JSON.toJSONString(map));
@ -116,7 +116,7 @@ public class HuiLianTongConfig {
public static JSONObject costRechargeOrder(String rechargeOrderId) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("rechargeOrderId", rechargeOrderId);
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId());
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongSinopecDistributorId());
log.info("============请求任务Start=============");

@ -0,0 +1,34 @@
package com.hai.config;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
/**
*
* @ClassName: StreamUtil
* @Description:TODO(List Steam)
* @author: 胡锐
* @date: 2019年3月25日 下午4:14:00
*
* @Copyright: 2019 www.shinwoten.com Inc. All rights reserved.
*/
public class StreamUtil {
/**
*
* @Title: distinctByKey
* @Description: TODO(对象 去重)
* @author: 胡锐
* @param: @param keyExtractor
* @param: @return
* @return: Predicate<T>
* @throws
*/
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object,Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
}

@ -72,7 +72,6 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ
// 生成二维码
String qrCodeUrl = CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=0000011&key=&code=" + Base64Util.encode(AESEncodeUtil.aesEncrypt(JSON.toJSONString(map)));
code.setExt1(qrCodeUrl);
code.setExt2("2");
// 生成二维码地址
highDiscountAgentCodeService.updateCode(code);
}

@ -1,4 +1,5 @@
hsgDomainName=https://hsgcs.dctpay.com
hzfDomainName=https://gratia-pay.dctpay.com
gasDefaultOilStationImg=https://hsgcs.dctpay.com/filesystem/default/default_oil_station.jpg
# ChongQingCNPC configuration parameters

@ -1,4 +1,5 @@
hsgDomainName=https://hsg.dctpay.com
hzfDomainName=https://pay.dctpay.com
gasDefaultOilStationImg=https://hsg.dctpay.com/filesystem/default/default_oil_station.jpg
# ChongQingCNPC configuration parameters

@ -1,4 +1,5 @@
hsgDomainName=https://hsg.dctpay.com
hzfDomainName=https://pay.dctpay.com
gasDefaultOilStationImg=https://hsg.dctpay.com/filesystem/default/default_oil_station.jpg
gasDefaultOilStationImg2=https://hsg.dctpay.com/filesystem/default/default_oil_station2.jpg
@ -49,6 +50,7 @@ huiliantongUrl=https://gzapi.deepermobile.com.cn
huiliantongAppNo=guizhouhuilt
huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D
huiliantongAppsecret=52662415DDCE55C7BA34223BCF53877A
huiliantongSinopecDistributorId=aNId4A3X
huiliantongDistributorId=1JnL8YMV
huiliantongSinopecUrl=fuelCoupons

@ -7,7 +7,9 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.entity.HighDiscountUserRel;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
@ -190,4 +192,57 @@ public class DiscountController {
}
}
@RequestMapping(value="/queryHzfDiscountList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询【惠支付】优惠列表")
public ResponseData queryHzfDiscountList(@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
Map<String, Object> param = new HashMap<>();
param.put("phone", userInfoModel.getHighUser().getPhone());
param.put("status", status);
param.put("pageNum", pageNum);
param.put("pageSize", pageSize);
JSONObject response = HttpsUtils.doGet(CommonSysConst.getSysConfig().getHzfDomainName()+"/crest/storeDiscountActivityPartakeUser/getDiscountListByPhone", param);
if (!response.getString("return_code").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg"));
}
return ResponseMsgUtil.success(response.getJSONObject("return_data"));
} catch (Exception e) {
log.error("HighDiscountController -> queryHzfDiscountList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryHzfDiscountTotalNum",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询【惠支付】优惠总次数")
public ResponseData queryHzfDiscountTotalNum() {
try {
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
}
Map<String, Object> param = new HashMap<>();
param.put("phone", userInfoModel.getHighUser().getPhone());
JSONObject response = HttpsUtils.doGet(CommonSysConst.getSysConfig().getHzfDomainName() + "/crest/storeDiscountActivityPartakeUser/getDiscountSurplusTotalNum", param);
if (!response.getString("return_code").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg"));
}
return ResponseMsgUtil.success(response.getInteger("return_data"));
} catch (Exception e) {
log.error("HighDiscountController -> queryHzfDiscountList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

Loading…
Cancel
Save