'提交代码'

dev-discount
胡锐 3 years ago
parent 74068c0870
commit bc51a9cfb4
  1. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 2
      hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java
  3. 41
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  4. 49
      hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java

@ -111,6 +111,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/test/*") .excludePathPatterns("/test/*")
.excludePathPatterns("/highGas/*") .excludePathPatterns("/highGas/*")
.excludePathPatterns("/wechat/*") .excludePathPatterns("/wechat/*")
.excludePathPatterns("/tuanyou/*")
; ;
} }

@ -115,7 +115,7 @@ public class TuanYouConfig {
paramMap.put("timestamp", new Date().getTime()); paramMap.put("timestamp", new Date().getTime());
paramMap.put("thirdSerialNo", thirdSerialNo); paramMap.put("thirdSerialNo", thirdSerialNo);
paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); 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));
} }
/** /**

@ -1,11 +1,13 @@
package com.cweb.controller; package com.cweb.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.cweb.config.TuanYouConfig; import com.cweb.config.TuanYouConfig;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.utils.CoordCommonUtil; import com.hai.common.utils.CoordCommonUtil;
import com.hai.common.utils.PageUtil; import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
@ -36,6 +38,7 @@ public class HighGasController {
@Resource @Resource
private HighGasOilPriceService highGasOilPriceService; private HighGasOilPriceService highGasOilPriceService;
@RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询加油站列表") @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) @RequestMapping(value="/queryThirdOrderDretail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "推送订单") @ApiOperation(value = "查询订单信息")
public ResponseData queryThirdOrderDretail() { public ResponseData queryThirdOrderDretail() {
try { try {
return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624541593196")); return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624611159129"));
//return ResponseMsgUtil.success(map); //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);
}
}
} }

@ -1,38 +1,16 @@
package com.cweb.controller.pay; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream; import java.io.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.security.*; import java.security.*;
import java.util.Base64; import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
@ -40,7 +18,7 @@ import java.util.Map;
import java.util.SortedMap; import java.util.SortedMap;
@Controller @Controller
@RequestMapping(value = "/ty") @RequestMapping(value = "/tuanyou")
@Api(value = "团油回调") @Api(value = "团油回调")
public class TuanYouController { public class TuanYouController {
@ -57,4 +35,25 @@ public class TuanYouController {
log.error("WechatPayController --> wechatNotify() error!", e); 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);
}
}
} }

Loading…
Cancel
Save