|
|
@ -12,10 +12,7 @@ import com.hai.common.utils.*; |
|
|
|
import com.hai.config.*; |
|
|
|
import com.hai.config.*; |
|
|
|
import com.hai.dao.HighGasOrderPushMapper; |
|
|
|
import com.hai.dao.HighGasOrderPushMapper; |
|
|
|
import com.hai.entity.*; |
|
|
|
import com.hai.entity.*; |
|
|
|
import com.hai.model.HighMerchantModel; |
|
|
|
import com.hai.model.*; |
|
|
|
import com.hai.model.HighMerchantStoreModel; |
|
|
|
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
|
|
|
import com.hai.model.ResultProfitSharing; |
|
|
|
|
|
|
|
import com.hai.service.*; |
|
|
|
import com.hai.service.*; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -185,12 +182,12 @@ public class HighTestController { |
|
|
|
return ResponseMsgUtil.success("初始化完成"); |
|
|
|
return ResponseMsgUtil.success("初始化完成"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/pushTuanYouOrder", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "查询团油账户") |
|
|
|
@ApiOperation(value = "推送团油订单") |
|
|
|
public ResponseData queryCompanyAccountInfo2JD() { |
|
|
|
public ResponseData pushTuanYouOrder() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
/*HighOrder order = highOrderService.getOrderByOrderNo("HF2021091414532044405"); |
|
|
|
HighOrder order = highOrderService.getOrderByOrderNo("HF2021100910141059900"); |
|
|
|
for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { |
|
|
|
for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { |
|
|
|
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); |
|
|
|
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); |
|
|
|
// 推送团油订单
|
|
|
|
// 推送团油订单
|
|
|
@ -203,6 +200,7 @@ public class HighTestController { |
|
|
|
paramMap.put("priceGun", priceGun); // 枪单价
|
|
|
|
paramMap.put("priceGun", priceGun); // 枪单价
|
|
|
|
paramMap.put("priceVip", priceVip); // 优惠价
|
|
|
|
paramMap.put("priceVip", priceVip); // 优惠价
|
|
|
|
paramMap.put("driverPhone", order.getMemPhone()); |
|
|
|
paramMap.put("driverPhone", order.getMemPhone()); |
|
|
|
|
|
|
|
// paramMap.put("driverPhone", "17726395120");
|
|
|
|
paramMap.put("thirdSerialNo", order.getOrderNo()); |
|
|
|
paramMap.put("thirdSerialNo", order.getOrderNo()); |
|
|
|
paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); |
|
|
|
paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); |
|
|
|
|
|
|
|
|
|
|
@ -224,53 +222,31 @@ public class HighTestController { |
|
|
|
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { |
|
|
|
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { |
|
|
|
highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); |
|
|
|
highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
highOrderService.updateOrder(order); |
|
|
|
return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return ResponseMsgUtil.success(order); |
|
|
|
@RequestMapping(value = "/test2", method = RequestMethod.GET) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "获取汇联通Token") |
|
|
|
|
|
|
|
public ResponseData test2() { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(huiLianTongConfig.getToken()); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getCorpCouTypes", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "测试") |
|
|
|
@ApiOperation(value = "查询团油余额") |
|
|
|
public ResponseData getCorpCouTypes(@RequestParam(name = "token", required = true) String token) { |
|
|
|
public ResponseData queryCompanyAccountInfo2JD() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
return ResponseMsgUtil.success(HuiLianTongConfig.getCorpCouTypes(token)); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getCouState", method = RequestMethod.GET) |
|
|
|
return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); |
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "测试") |
|
|
|
|
|
|
|
public ResponseData getCouState(@RequestParam(name = "token", required = true) String token, |
|
|
|
|
|
|
|
@RequestParam(name = "couNo", required = true) String couNo) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(HuiLianTongConfig.getCouState(token,couNo)); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/couJointDist", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/couJointDist", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "测试") |
|
|
|
@ApiOperation(value = "派发贵州卡券") |
|
|
|
public ResponseData couJointDist(@RequestParam(name = "token", required = true) String token) { |
|
|
|
public ResponseData couJointDist(@RequestParam(name = "token", required = true) String token) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
return ResponseMsgUtil.success(HuiLianTongConfig.couJointDist(token,"HF"+System.currentTimeMillis(),"20JY000251",2,"17726395120", "oArhO6XxKSvjI9wLP3cTK-iSG8yY")); |
|
|
|
return ResponseMsgUtil.success(HuiLianTongConfig.couJointDist(token,"HF"+System.currentTimeMillis(),"20JY000251",2,"17726395120", "oArhO6XxKSvjI9wLP3cTK-iSG8yY")); |
|
|
@ -280,42 +256,12 @@ public class HighTestController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/splitSccount", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/unionPay", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "测试") |
|
|
|
@ApiOperation(value = "银联支付") |
|
|
|
public ResponseData splitSccount() { |
|
|
|
public ResponseData unionPay() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
//List<HighOrder> list = highOrderService.getErrorOrder();
|
|
|
|
return ResponseMsgUtil.success(UnionPayConfig.apppayacc()); |
|
|
|
/* HighOrder order = highOrderService.getOrderByOrderNo("20210827003355621063330"); |
|
|
|
|
|
|
|
BigDecimal rake = new BigDecimal("0.01"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
|
|
|
|
|
|
|
|
BigDecimal wxHandlingFee = order.getPayRealPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN); |
|
|
|
|
|
|
|
BigDecimal price = order.getPayRealPrice().subtract(wxHandlingFee); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
|
|
|
|
|
|
|
|
BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN); |
|
|
|
|
|
|
|
this.wxProfitsharing(order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount);*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取token
|
|
|
|
|
|
|
|
String token = huiLianTongConfig.getToken(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*Map<String, Object> push = new HashMap<>(); |
|
|
|
|
|
|
|
push.put("token", tokenObject.getString("data")); |
|
|
|
|
|
|
|
push.put("couTypeCode", "20JY000575"); |
|
|
|
|
|
|
|
push.put("distCouCount", 1); |
|
|
|
|
|
|
|
push.put("userPhone", "13985049936"); |
|
|
|
|
|
|
|
push.put("thirdUserId", "oArhO6VXHf4hUENO2Mkwm6BAiy0A");*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 推送给高速
|
|
|
|
|
|
|
|
JSONObject returnParam = HuiLianTongConfig.couJointDist( |
|
|
|
|
|
|
|
token, |
|
|
|
|
|
|
|
"HF20210926163742075051", |
|
|
|
|
|
|
|
"20JY000573", |
|
|
|
|
|
|
|
1, |
|
|
|
|
|
|
|
"18585414282", |
|
|
|
|
|
|
|
"oArhO6YcG2zQNdvTV-FktVaZ-bEw"); |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(returnParam); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
log.error("HighOrderController --> getOrderById() error!", e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
@ -368,7 +314,6 @@ public class HighTestController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CloseableHttpClient readCertificate(String mchId) throws Exception{ |
|
|
|
public CloseableHttpClient readCertificate(String mchId) throws Exception{ |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 |
|
|
|
* 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 |
|
|
@ -393,7 +338,7 @@ public class HighTestController { |
|
|
|
//小程序退款需要调用双向证书的认证
|
|
|
|
//小程序退款需要调用双向证书的认证
|
|
|
|
CloseableHttpClient httpClient = readCertificate(mchId); |
|
|
|
CloseableHttpClient httpClient = readCertificate(mchId); |
|
|
|
try { |
|
|
|
try { |
|
|
|
HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息
|
|
|
|
HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/refund"); // 设置响应头信息
|
|
|
|
httpost.addHeader("Connection", "keep-alive"); |
|
|
|
httpost.addHeader("Connection", "keep-alive"); |
|
|
|
httpost.addHeader("Accept", "*/*"); |
|
|
|
httpost.addHeader("Accept", "*/*"); |
|
|
|
httpost.addHeader("Content-Type", "text/xml"); |
|
|
|
httpost.addHeader("Content-Type", "text/xml"); |
|
|
|