Merge branch 'pre' into order

dev-discount
胡锐 2 years ago
commit d8b9db3b6b
  1. 6
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  2. 6
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java
  3. 18
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  4. 3
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -457,13 +457,15 @@ public class HighOrderController {
} }
} }
if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) { if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) {
SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId"))); SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId")));
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
if (bsCompany != null) {
highOrder.setCompanyId(bsCompany.getId()); highOrder.setCompanyId(bsCompany.getId());
} }
}
}
highOrder.setMerchId(request.getHeader("mchId")); highOrder.setMerchId(request.getHeader("mchId"));
highOrder.setWhetherRebate(false); highOrder.setWhetherRebate(false);

@ -296,6 +296,12 @@ public class HuiLianTongUnionCardConfig {
return request("fuelCoupons/syncPayOrder", map); return request("fuelCoupons/syncPayOrder", map);
} }
public static void main(String[] args) {
String data = "Gbkl57c3fEBg+E3HfPuQ55SDLVyAf2Ys3VN1cifAfXIoT1gnbFR0NaiH/z1OIZZiuqlFwDLLu6mt\\nuTcVJuO1hhr5QW09U1uIfz1mQwCBwvx4/PKxXQ7rR7/rnbvnsMxRupCMjc1vBdq902CiXq8RZVEq\\n8LrnkFZ9R+9IokVEc5nGG7XvKCmikEH80xtkvw0EwuPl1mEGp92uUbpxTahhwy5M9SAnIBZIjN5D\\nxi3F4tZ0kOhiuNNTO/CECE9sWZfO".replace("\\n", "");
String decodeData = DesUtil.decode("F8E91A3C", data, Charset.forName("UTF-8"));
JSONObject.parseObject(decodeData);
}
} }

@ -606,15 +606,31 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
couponAgent.setSalesCount(couponAgent.getSalesCount() + 1); couponAgent.setSalesCount(couponAgent.getSalesCount() + 1);
highCouponAgentRelMapper.updateByPrimaryKey(couponAgent); highCouponAgentRelMapper.updateByPrimaryKey(couponAgent);
// 下单请求 // 第一次,下单请求
JSONObject rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(), JSONObject rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(),
1, 1,
coupon.getCouponKey(), coupon.getCouponKey(),
phone); phone);
System.out.println("第一次下单" + rechargeObject.toJSONString());
if (!rechargeObject.getString("respCode").equals("0000")) { if (!rechargeObject.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败");
} }
JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data")); JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data"));
if (response == null || response.getJSONObject("data") == null) {
// 第二次,下单请求
// 重新生成兑换码
convertCode.setConvertCode(generateConvertCode(couponAgent.getId()));
rechargeObject = HuiLianTongConfig.recharge(convertCode.getConvertCode(),
1,
coupon.getCouponKey(),
phone);
System.out.println("第二次下单" + rechargeObject.toJSONString());
response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data"));
if (response == null || response.getJSONObject("data") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败");
}
}
convertCode.setExt1(response.getJSONObject("data").getString("rechargeOrderId")); convertCode.setExt1(response.getJSONObject("data").getString("rechargeOrderId"));
highCouponAgentCodeMapper.updateByPrimaryKey(convertCode); highCouponAgentCodeMapper.updateByPrimaryKey(convertCode);

@ -2289,8 +2289,7 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
// 下单 // 下单
// jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile")); jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile"));
jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), "50562", List.toString().replace(" ", ""), object.getString("customerMobile"));
// 判断下单是否成功 // 判断下单是否成功
if (!Objects.equals(jsonObject.getString("code"), "200")) { if (!Objects.equals(jsonObject.getString("code"), "200")) {

Loading…
Cancel
Save