提交代码

dev-discount
胡锐 2 years ago
parent be6beb508d
commit 75ca151c40
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 16
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  3. 44
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  4. 16
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  5. 89
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  6. 115
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  7. 74
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  8. 2
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  9. 2
      hai-service/src/main/resources/prod/commonConfig.properties

File diff suppressed because one or more lines are too long

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

@ -78,50 +78,8 @@ public class HighCouponSchedule {
HighCouponCodeOtherExample example = new HighCouponCodeOtherExample(); HighCouponCodeOtherExample example = new HighCouponCodeOtherExample();
example.createCriteria().andStatusEqualTo(20).andTypeEqualTo(1); example.createCriteria().andStatusEqualTo(20).andTypeEqualTo(1);
List<HighCouponCodeOther> otherList = highCouponCodeOtherMapper.selectByExample(example); List<HighCouponCodeOther> otherList = highCouponCodeOtherMapper.selectByExample(example);
// 获取token
String token = huiLianTongConfig.getToken();
for (HighCouponCodeOther couponCodeOther : otherList) { 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()); JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(couponCodeOther.getCouNo());
if (jsonObject.getString("respCode").equals("0000")) { if (jsonObject.getString("respCode").equals("0000")) {
@ -163,7 +121,7 @@ public class HighCouponSchedule {
} }
} }
}*/ }
} }
} }

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

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

@ -207,19 +207,23 @@ public class HighOrderServiceImpl implements HighOrderService {
highChildOrderMapper.updateByPrimaryKey(childOrder); highChildOrderMapper.updateByPrimaryKey(childOrder);
} }
/* if (couponDetail.getCouponSource().equals(4)) { if (couponDetail.getCouponSource().equals(4)) {
// 下单请求 // 下单请求
JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(), JSONObject jsonObject = HuiLianTongConfig.recharge(highOrder.getOrderNo(),
childOrder.getSaleCount(), childOrder.getSaleCount(),
couponDetail.getCouponKey(), couponDetail.getCouponKey(),
highOrder.getMemPhone()); highOrder.getMemPhone());
System.out.println(jsonObject);
if (!jsonObject.getString("respCode").equals("0000")) { if (!jsonObject.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败");
} }
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); 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")); childOrder.setExt2(response.getJSONObject("data").getString("rechargeOrderId"));
highChildOrderMapper.updateByPrimaryKey(childOrder); highChildOrderMapper.updateByPrimaryKey(childOrder);
}*/ }
if (!childOrder.getGiveawayType()) { if (!childOrder.getGiveawayType()) {
// 查看是否需要赠送卡卷 // 查看是否需要赠送卡卷
@ -269,6 +273,10 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
} }
public static void main(String[] args) {
System.out.println(HuiLianTongUnionCardConfig.resolveResponse("Gbkl57c3fEBg+E3HfPuQ52xYXxRnbPnT1CFoWj0AaUCBA2W/qzLuaUXplapIu/Avzt0AmzA/oCA=\\n"));
}
@Override @Override
public void updateChildOrder(HighChildOrder highChildOrder) { public void updateChildOrder(HighChildOrder highChildOrder) {
highChildOrderMapper.updateByPrimaryKey(highChildOrder); highChildOrderMapper.updateByPrimaryKey(highChildOrder);
@ -327,49 +335,7 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
// 贵州高速 // 贵州高速
if (coupon.getCouponSource() == 4) { if (coupon.getCouponSource() == 4) {
// 获取token Map<String,Object> push = new HashMap<>();
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("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount()); push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone()); push.put("userPhone", highUser.getPhone());
@ -377,6 +343,17 @@ public class HighOrderServiceImpl implements HighOrderService {
// 推送给高速 // 推送给高速
JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2()); 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")) { if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// 解密 // 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
@ -407,17 +384,7 @@ public class HighOrderServiceImpl implements HighOrderService {
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon); 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 { } else {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
@ -644,20 +611,18 @@ public class HighOrderServiceImpl implements HighOrderService {
// 贵州中石化 // 贵州中石化
if (coupon.getCouponSource() == 4) { if (coupon.getCouponSource() == 4) {
// 获取token Map<String,Object> push = new HashMap<>();
String token = huiLianTongConfig.getToken();
Map<String, Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey()); push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount()); push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone()); push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId()); push.put("thirdUserId", highUser.getUnionId());
// 推送给高速 // 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
if (returnParam != null && returnParam.getString("result").equals("success")) { if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
JSONArray dataArray = returnParam.getJSONArray("data"); // 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) { for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data; JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -666,11 +631,11 @@ public class HighOrderServiceImpl implements HighOrderService {
couponCodeOther.setChildOrderId(highChildOrder.getId()); couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo")); couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther); highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户 // 卡卷关联用户
@ -953,20 +918,18 @@ public class HighOrderServiceImpl implements HighOrderService {
// 贵州中石化 // 贵州中石化
if (coupon.getCouponSource() == 4) { if (coupon.getCouponSource() == 4) {
// 获取token Map<String,Object> push = new HashMap<>();
String token = huiLianTongConfig.getToken();
Map<String, Object> push = new HashMap<>();
push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey()); push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount()); push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone()); push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId()); push.put("thirdUserId", highUser.getUnionId());
// 推送给高速 // 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
if (returnParam != null && returnParam.getString("result").equals("success")) { if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
JSONArray dataArray = returnParam.getJSONArray("data"); // 解密
JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
for (Object data : dataArray) { for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data; JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
@ -975,11 +938,11 @@ public class HighOrderServiceImpl implements HighOrderService {
couponCodeOther.setChildOrderId(highChildOrder.getId()); couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo")); couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther); highCouponCodeOtherMapper.insert(couponCodeOther);
// 卡卷关联用户 // 卡卷关联用户

@ -185,56 +185,54 @@ public class GoodsOrderServiceImpl implements PayService {
} }
// 贵州中石化 // 贵州中石化
if (coupon.getCouponSource() == 4) { if (coupon.getCouponSource() == 4) {
// 获取token
// String token = huiLianTongConfig.getToken();
Map<String,Object> push = new HashMap<>(); Map<String,Object> push = new HashMap<>();
// push.put("token", token);
push.put("couTypeCode", coupon.getCouponKey()); push.put("couTypeCode", coupon.getCouponKey());
push.put("distCouCount", highChildOrder.getSaleCount()); push.put("distCouCount", highChildOrder.getSaleCount());
push.put("userPhone", highUser.getPhone()); push.put("userPhone", highUser.getPhone());
push.put("thirdUserId", highUser.getUnionId()); push.put("thirdUserId", highUser.getUnionId());
// // 推送给高速 // 推送给高速
// JSONObject returnParam = HuiLianTongConfig.couJointDist(token, order.getOrderNo(),coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId()); JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(highChildOrder.getExt2());
// if (returnParam != null && returnParam.getString("result").equals("success")) { if (returnParam != null && returnParam.getString("respCode").equals("0000")) {
// JSONArray dataArray = returnParam.getJSONArray("data"); // 解密
// for (Object data : dataArray) { JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data"));
// JSONObject dataObject = (JSONObject) data; JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class);
// HighCouponCodeOther couponCodeOther = new HighCouponCodeOther(); for (Object data : dataArray) {
// couponCodeOther.setType(1); JSONObject dataObject = (JSONObject) data;
// couponCodeOther.setOrderId(order.getId()); HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
// couponCodeOther.setChildOrderId(highChildOrder.getId()); couponCodeOther.setType(1);
// couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode")); couponCodeOther.setOrderId(order.getId());
// couponCodeOther.setCouNo(dataObject.getString("couNo")); couponCodeOther.setChildOrderId(highChildOrder.getId());
// couponCodeOther.setStatus(20); couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
// couponCodeOther.setCreateTime(new Date()); couponCodeOther.setCouNo(dataObject.getString("couNo"));
// couponCodeOther.setActiveTime(dataObject.getDate("activeTime")); couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
// couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate")); couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
// couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate")); couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
// highCouponCodeOtherMapper.insert(couponCodeOther); couponCodeOther.setStatus(20);
// couponCodeOther.setCreateTime(new Date());
// // 卡卷关联用户 highCouponCodeOtherMapper.insert(couponCodeOther);
// HighUserCoupon highUserCoupon = new HighUserCoupon();
// highUserCoupon.setMerchantId(coupon.getMerchantId()); // 卡卷关联用户
// highUserCoupon.setCouponId(coupon.getId()); HighUserCoupon highUserCoupon = new HighUserCoupon();
// highUserCoupon.setUserId(order.getMemId()); highUserCoupon.setMerchantId(coupon.getMerchantId());
// highUserCoupon.setCreateTime(new Date()); highUserCoupon.setCouponId(coupon.getId());
// highUserCoupon.setQrCodeImg(dataObject.getString("couNo")); highUserCoupon.setUserId(order.getMemId());
// highUserCoupon.setUseEndTime(dataObject.getDate("validEndDate")); highUserCoupon.setCreateTime(new Date());
// highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCoupon.setQrCodeImg(dataObject.getString("couNo"));
// highUserCouponMapper.insert(highUserCoupon); highUserCoupon.setUseEndTime(dataObject.getDate("validEndDate"));
// } highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
// } highUserCouponMapper.insert(highUserCoupon);
}
}
// 推送记录 // 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type6.getType()); highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(order.getOrderNo()); highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date()); highGasOrderPush.setCreateTime(new Date());
// highGasOrderPush.setCode(returnParam.getString("result")); highGasOrderPush.setCode(returnParam.getString("result"));
// highGasOrderPush.setRequestContent(JSONObject.toJSONString(push)); highGasOrderPush.setRequestContent(JSONObject.toJSONString(push));
// highGasOrderPush.setReturnContent(returnParam.toJSONString()); highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush); highGasOrderPushMapper.insert(highGasOrderPush);
} else { } else {

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

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

Loading…
Cancel
Save