diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index 9092780b..09c05878 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -111,6 +111,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/test/*") .excludePathPatterns("/highGas/*") .excludePathPatterns("/wechat/*") + .excludePathPatterns("/tuanyou/*") ; } diff --git a/hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java b/hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java index 8a070b90..ae9093c6 100644 --- a/hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java @@ -115,7 +115,7 @@ public class TuanYouConfig { paramMap.put("timestamp", new Date().getTime()); paramMap.put("thirdSerialNo", thirdSerialNo); paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryThirdOrderDretail", JSON.toJSONString(paramMap)); + return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryThirdOrderDetail", JSON.toJSONString(paramMap)); } /** diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 0d6b43ad..d11e05cf 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -1,11 +1,13 @@ package com.cweb.controller; import com.alibaba.fastjson.JSONObject; +import com.cweb.config.SysConst; import com.cweb.config.TuanYouConfig; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; +import com.hai.common.security.AESEncodeUtil; import com.hai.common.utils.CoordCommonUtil; import com.hai.common.utils.PageUtil; import com.hai.common.utils.ResponseMsgUtil; @@ -36,6 +38,7 @@ public class HighGasController { @Resource private HighGasOilPriceService highGasOilPriceService; + @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询加油站列表") @@ -154,14 +157,31 @@ public class HighGasController { } } + + @RequestMapping(value="/refuelingOrderRefund",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "订单退款") + public ResponseData refuelingOrderRefund() { + try { + + return ResponseMsgUtil.success(TuanYouConfig.refuelingOrderRefund("17726395120","1624611159129","测试退款")); + //return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("HighGasController -> refuelingOrderPush() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryThirdOrderDretail",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "推送订单") + @ApiOperation(value = "查询订单信息") public ResponseData queryThirdOrderDretail() { try { - return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624541593196")); + return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624611159129")); //return ResponseMsgUtil.success(map); @@ -171,4 +191,21 @@ public class HighGasController { } } + @RequestMapping(value="/test",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "测试") + public ResponseData test() { + try { + + String data = "{\"data\":\"ui2KbK5jpLtw7YaA52uSt1TzDpaE5OjeW5O6xg+saM4nN4aVnpoT1aTgJwQt/DuNSbs7LrX6q1B0cpW5T531ltYl1ERxyKXqZyMKBNWzDFuB5QSww22VGfypchGNm+oW\",\"timestamp\":1624611912047,\"companyCode\":\"208241666939552\"}"; + + JSONObject jsonObject = JSONObject.parseObject(data, JSONObject.class); + return ResponseMsgUtil.success(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(jsonObject.getString("data")), SysConst.getSysConfig().getTuanYouAppSecret())); + + } catch (Exception e) { + log.error("HighGasController -> queryThirdOrderDretail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java index 22cbfddd..96263135 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java @@ -1,38 +1,16 @@ package com.cweb.controller.pay; -import com.alibaba.fastjson.JSONObject; -import com.cweb.config.SysConst; -import com.hai.common.pay.WechatPayUtil; -import com.hai.common.pay.util.IOUtil; -import com.hai.common.pay.util.XmlUtil; -import com.hai.common.pay.util.sdk.WXPayConstants; -import com.hai.common.utils.HttpsUtils; -import com.hai.common.utils.ResponseMsgUtil; -import com.hai.common.utils.WxUtils; -import com.hai.model.ResponseData; -import com.hai.model.WxSharingReceiversVO; -import com.hai.service.HighProfitSharingRecordService; -import com.hai.service.TelApiService; -import com.hai.service.pay.NotifyService; -import com.hai.service.pay.PayRecordService; -import com.wechat.pay.contrib.apache.httpclient.util.PemUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.BufferedOutputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.security.*; import java.util.Base64; import java.util.HashMap; @@ -40,7 +18,7 @@ import java.util.Map; import java.util.SortedMap; @Controller -@RequestMapping(value = "/ty") +@RequestMapping(value = "/tuanyou") @Api(value = "团油回调") public class TuanYouController { @@ -57,4 +35,25 @@ public class TuanYouController { log.error("WechatPayController --> wechatNotify() error!", e); } } + + + @RequestMapping(value = "/orderRefundNotify", method = RequestMethod.POST) + @ApiOperation(value = "订单退款回调") + @ResponseBody + public void orderRefundNotify(@RequestBody String reqBodyStr,HttpServletRequest request, HttpServletResponse response) { + try { + + System.out.println(reqBodyStr); + + response.setCharacterEncoding("UTF-8"); + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer= response.getWriter(); + writer.write("success"); + + log.error("request", request); + + } catch (Exception e) { + log.error("WechatPayController --> wechatNotify() error!", e); + } + } }