Merge branch 'pre' into jzc

dev-discount
胡锐 2 years ago
commit 5c45bc7d06
  1. 2
      hai-bweb/src/main/java/com/bweb/excelListener/ImportStoreListener.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 16
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  4. 44
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  5. 16
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  6. 89
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  7. 109
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  8. 37
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  9. 2
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  10. 2
      hai-service/src/main/resources/prod/commonConfig.properties

@ -73,7 +73,6 @@ public class ImportStoreListener extends AnalysisEventListener<ImportStoreModel>
highMerchantStore.setLatitude(importStoreModel.getLatitude());
highMerchantStore.setLongitude(importStoreModel.getLongitude());
highMerchantStore.setRegionId(Long.parseLong(importStoreModel.getRegionId()));
highMerchantStore.setRegionName(regionName);
highMerchantStore.setCompanyId(highMerchant.getCompanyId());
highMerchantStore.setMerchantId(highMerchant.getId());
@ -82,6 +81,7 @@ public class ImportStoreListener extends AnalysisEventListener<ImportStoreModel>
highMerchantStore.setStatus(1);
highMerchantStore.setCreateTime(new Date());
highMerchantStore.setUpdateTime(new Date());
highMerchantStore.setPrestoreType(0);
successData.add(highMerchantStore);
allStoreData.add(highMerchantStore);

File diff suppressed because one or more lines are too long

@ -194,20 +194,18 @@ public class UnionPayController {
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId());
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(),coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -216,11 +214,11 @@ public class UnionPayController {
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户

@ -78,50 +78,8 @@ public class HighCouponSchedule {
HighCouponCodeOtherExample example = new HighCouponCodeOtherExample();
example.createCriteria().andStatusEqualTo(20).andTypeEqualTo(1);
List<HighCouponCodeOther> otherList = highCouponCodeOtherMapper.selectByExample(example);
// 获取token
String token = huiLianTongConfig.getToken();
for (HighCouponCodeOther couponCodeOther : otherList) {
JSONObject data = HuiLianTongConfig.getCouState(token, couponCodeOther.getCouNo());
if (data.getString("result").equals("success")) {
if (data.getJSONObject("data").getInteger("state") != 20) {
couponCodeOther.setStatus(data.getJSONObject("data").getInteger("state"));
highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther);
if (couponCodeOther.getCouponAgentCodeId() != null) {
HighCouponAgentCode agentCode = highCouponAgentCodeMapper.selectByPrimaryKey(couponCodeOther.getCouponAgentCodeId());
if (agentCode == null) {
agentCode.setStatus(3);
highCouponAgentCodeMapper.updateByPrimaryKey(agentCode);
}
}
if (couponCodeOther.getChildOrderId() != null) {
HighUserCouponExample userCouponExample = new HighUserCouponExample();
userCouponExample.createCriteria().andQrCodeImgEqualTo(couponCodeOther.getCouNo()).andStatusEqualTo(1);
List<HighUserCoupon> list = highUserCouponMapper.selectByExample(userCouponExample);
if (list.size() > 0) {
HighUserCoupon userCoupon = list.get(0);
if (data.getJSONObject("data").getInteger("state") == 40) {
userCoupon.setStatus(2);
userCoupon.setConsumeTime(new Date());
} else {
userCoupon.setStatus(0);
}
highUserCouponMapper.updateByPrimaryKey(userCoupon);
}
// 查询订单中的汇联通卡券全部已处理
HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample();
otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1);
if (highCouponCodeOtherMapper.selectByExample(otherExample).size() == 0) {
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId());
}
}
}
}
}
/* for (HighCouponCodeOther couponCodeOther : otherList) {
JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(couponCodeOther.getCouNo());
if (jsonObject.getString("respCode").equals("0000")) {
@ -163,7 +121,7 @@ public class HighCouponSchedule {
}
}
}*/
}
}
}

@ -45,7 +45,6 @@ public class HuiLianTongConfig {
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
/**
* 获取电子券类型列表
* @return
@ -58,7 +57,7 @@ public class HuiLianTongConfig {
return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl() + "/getHltFuelCoupList", map);
}
/* *//**
/**
* 下单购买加油券
* @param orderNo
* @param distCouCount
@ -66,7 +65,7 @@ public class HuiLianTongConfig {
* @param phone
* @return
* @throws Exception
*//*
*/
public static JSONObject recharge(String orderNo, Integer distCouCount, String couTypeCode, String phone) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("orderNo", orderNo);
@ -77,12 +76,12 @@ public class HuiLianTongConfig {
return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl()+"/recharge", map);
}
*//**
/**
* 购买加油券充值订单
* @param couNo 订单号
* @return
* @throws Exception
*//*
*/
public static JSONObject getPayOrderByCouNo(String couNo) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("couNo", couNo);
@ -90,19 +89,18 @@ public class HuiLianTongConfig {
return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl()+"/getPayOrderByCouNo", map);
}
*//**
/**
* 购买加油券充值订单
* @param rechargeOrderId 订单号
* @return
* @throws Exception
*//*
*/
public static JSONObject costRechargeOrder(String rechargeOrderId) throws Exception {
Map<String,Object> map = new HashMap<>();
map.put("rechargeOrderId", rechargeOrderId);
map.put("distributorId", CommonSysConst.getSysConfig().getHuiliantongDistributorId());
return HuiLianTongUnionCardConfig.request(CommonSysConst.getSysConfig().getHuiliantongSinopecUrl()+"/costRechargeOrder", map);
}*/
}
/**
* 获取token

@ -498,28 +498,25 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
}
convertCode.setConvertUserPhone(phone);
convertCode.setCouponCode(System.currentTimeMillis()+"");
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("orderNo", convertCode.getConvertCode());
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", 1);
push.put("userPhone", phone);
push.put("thirdUserId", phone);
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token,
MapUtils.getString(push, "orderNo"),
MapUtils.getString(push, "couTypeCode"),
MapUtils.getInteger(push, "distCouCount"),
MapUtils.getString(push, "userPhone"),
MapUtils.getString(push, "userPhone")
);
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
// 下单请求
JSONObject rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(),
1,
coupon.getCouponKey(),
phone);
if (!rechargeObject.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败");
}
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data"));
convertCode.setExt1(response.getJSONObject("data").getString("rechargeOrderId"));
highCouponAgentCodeMapper.updateByPrimaryKey(convertCode);
// 购买卡券
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(convertCode.getExt1());
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -540,8 +537,8 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(convertCode.getCouponCode());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("result"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
highGasOrderPush.setCode(returnParam.getString("respCode"));
highGasOrderPush.setRequestContent(convertCode.getExt2());
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
@ -609,28 +606,24 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
couponAgent.setSalesCount(couponAgent.getSalesCount() + 1);
highCouponAgentRelMapper.updateByPrimaryKey(couponAgent);
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("orderNo", convertCode.getConvertCode());
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", 1);
push.put("userPhone", phone);
push.put("thirdUserId", phone);
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token,
MapUtils.getString(push, "orderNo"),
MapUtils.getString(push, "couTypeCode"),
MapUtils.getInteger(push, "distCouCount"),
MapUtils.getString(push, "userPhone"),
MapUtils.getString(push, "userPhone")
);
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
// 下单请求
JSONObject rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(),
1,
coupon.getCouponKey(),
phone);
if (!rechargeObject.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败");
}
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data"));
convertCode.setExt1(response.getJSONObject("data").getString("rechargeOrderId"));
highCouponAgentCodeMapper.updateByPrimaryKey(convertCode);
// 购买卡券
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(convertCode.getExt1());
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -651,8 +644,8 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(convertCode.getCouponCode());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("result"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
highGasOrderPush.setCode(returnParam.getString("respCode"));
highGasOrderPush.setRequestContent(convertCode.getExt2());
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);

@ -210,19 +210,23 @@ public class HighOrderServiceImpl implements HighOrderService {
highChildOrderMapper.updateByPrimaryKey(childOrder);
}
/* if (couponDetail.getCouponSource().equals(4)) {
if (couponDetail.getCouponSource().equals(4)) {
// 下单请求
JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(),
childOrder.getSaleCount(),
couponDetail.getCouponKey(),
highOrder.getMemPhone());
System.out.println(jsonObject);
if (!jsonObject.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败");
}
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
if (!response.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("msg"));
}
childOrder.setExt2(response.getJSONObject("data").getString("rechargeOrderId"));
highChildOrderMapper.updateByPrimaryKey(childOrder);
}*/
}
if (!childOrder.getGiveawayType()) {
// 查看是否需要赠送卡卷
@ -300,6 +304,10 @@ public class HighOrderServiceImpl implements HighOrderService {
}
}
public static void main(String[] args) {
System.out.println(HuiLianTongUnionCardConfig.resolveResponse("Gbkl57c3fEBg+E3HfPuQ52xYXxRnbPnT1CFoWj0AaUCBA2W/qzLuaUXplapIu/Avzt0AmzA/oCA=\\n"));
}
@Override
public void updateChildOrder(HighChildOrder highChildOrder) {
highChildOrderMapper.updateByPrimaryKey(highChildOrder);
@ -358,49 +366,7 @@ public class HighOrderServiceImpl implements HighOrderService {
}
// 贵州高速
if (coupon.getCouponSource() == 4) {
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId());
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, highOrder.getOrderNo(), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(1);
couponCodeOther.setOrderId(highOrder.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
HighUserCoupon highUserCoupon = new HighUserCoupon();
highUserCoupon.setMerchantId(coupon.getMerchantId());
highUserCoupon.setCouponId(coupon.getId());
highUserCoupon.setUserId(highOrder.getMemId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setQrCodeImg(dataObject.getString("couNo"));
highUserCoupon.setUseEndTime(dataObject.getDate("validEndDate"));
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
}
/* Map<String,Object> push = new HashMap<>();
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone());
@ -408,6 +374,17 @@ public class HighOrderServiceImpl implements HighOrderService {
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
System.out.println(returnParam);
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(highOrder.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("respCode"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
@ -438,17 +415,7 @@ public class HighOrderServiceImpl implements HighOrderService {
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
}
}*/
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(highOrder.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("respCode"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
}
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -685,20 +652,18 @@ public class HighOrderServiceImpl implements HighOrderService {
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId());
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -707,11 +672,11 @@ public class HighOrderServiceImpl implements HighOrderService {
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
@ -994,20 +959,18 @@ public class HighOrderServiceImpl implements HighOrderService {
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId());
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -1016,11 +979,11 @@ public class HighOrderServiceImpl implements HighOrderService {
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户

@ -185,20 +185,29 @@ public class GoodsOrderServiceImpl implements PayService {
}
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token
String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId());
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(),coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
System.out.println(returnParam);
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("result"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -207,11 +216,11 @@ public class GoodsOrderServiceImpl implements PayService {
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户
@ -227,15 +236,7 @@ public class GoodsOrderServiceImpl implements PayService {
}
}
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("result"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
} else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());

@ -40,7 +40,7 @@ huiliantongUrl=https://gzapi.deepermobile.com.cn
huiliantongAppNo=guizhouhuilt
huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D
huiliantongAppsecret=52662415DDCE55C7BA34223BCF53877A
huiliantongDistributorId=test
huiliantongDistributorId=1JnL8YMV
huiliantongSinopecUrl=fuelCoupons
HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json

@ -38,7 +38,7 @@ huiliantongUrl=https://gzapi.deepermobile.com.cn
huiliantongAppNo=guizhouhuilt
huiliantongAppkey=e0ja2Ex%2BmQ2hIPF6x%2BHA%3D
huiliantongAppsecret=52662415DDCE55C7BA34223BCF53877A
huiliantongDistributorId=test
huiliantongDistributorId=1JnL8YMV
huiliantongSinopecUrl=fuelCoupons
HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json

Loading…
Cancel
Save