diff --git a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java index b77c63f9..f9919592 100644 --- a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -96,7 +96,6 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/coupon/getGuizhouSinopec") .excludePathPatterns("/cmsContent/get*") .excludePathPatterns("/highGoldRec/*") - .excludePathPatterns("/test/*") .excludePathPatterns("/openApi/*") ; } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index d11caa9b..47ecfa94 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ -package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; 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 javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HltUnionCardVipService hltUnionCardVipService; @Resource private HighTestService highTestService; @Resource private OutRechargeOrderService outRechargeOrderService; @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/GetMembershipLevel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData GetMembershipLevel(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "regionId", required = true) String regionId ) { try { return ResponseMsgUtil.success(hltUnionCardVipService.GetMembershipLevel(phone , regionId)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/submitSms", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求短信") public ResponseData submitSms(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "sms", required = true) String sms ) { try { return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.submitSms(phone , sms)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getReadFile",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "存入用户信息") public ResponseData getReadFile() { try { highTestService.getReadFile(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } // @RequestMapping(value="/getUserDiscount",method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "赠送优惠券") // public ResponseData getUserDiscount(@RequestParam(name = "id", required = true) Long id) { // try { // highTestService.getUserDiscount(id); // return ResponseMsgUtil.success(null); // } catch (Exception e) { // log.error("getUserByTelephone",e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value="/queryAmount",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询余额") public ResponseData queryAmount() { try { // outRechargeOrderService.queryAmount(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } // @RequestMapping(value = "/getMobile", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "话费充值") // public ResponseData getMobile( // @RequestParam(name = "orderNo", required = true) String orderNo, // @RequestParam(name = "amount", required = true) Integer amount, // @RequestParam(name = "isFast", required = true) Integer isFast, // @RequestParam(name = "phone", required = true) String phone) { // try { // JSONObject object = outRechargeOrderService.getMobile(phone,amount,orderNo , isFast); // return ResponseMsgUtil.success(object.getInteger("code")); // } catch (Exception e) { // log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data"))); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; 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 javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HltUnionCardVipService hltUnionCardVipService; @Resource private HighTestService highTestService; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/GetMembershipLevel", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData GetMembershipLevel(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "regionId", required = true) String regionId ) { try { return ResponseMsgUtil.success(hltUnionCardVipService.GetMembershipLevel(phone , regionId)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/submitSms", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求短信") public ResponseData submitSms(@RequestParam(name = "phone", required = true) String phone , @RequestParam(name = "sms", required = true) String sms ) { try { return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.submitSms(phone , sms)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getReadFile",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "存入用户信息") public ResponseData getReadFile() { try { highTestService.getReadFile(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } // @RequestMapping(value="/getUserDiscount",method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "赠送优惠券") // public ResponseData getUserDiscount(@RequestParam(name = "id", required = true) Long id) { // try { // highTestService.getUserDiscount(id); // return ResponseMsgUtil.success(null); // } catch (Exception e) { // log.error("getUserByTelephone",e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value="/queryAmount",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询余额") public ResponseData queryAmount() { try { // outRechargeOrderService.queryAmount(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } // @RequestMapping(value = "/getMobile", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "话费充值") // public ResponseData getMobile( // @RequestParam(name = "orderNo", required = true) String orderNo, // @RequestParam(name = "amount", required = true) Integer amount, // @RequestParam(name = "isFast", required = true) Integer isFast, // @RequestParam(name = "phone", required = true) String phone) { // try { // JSONObject object = outRechargeOrderService.getMobile(phone,amount,orderNo , isFast); // return ResponseMsgUtil.success(object.getInteger("code")); // } catch (Exception e) { // log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data"))); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 1, 3, highOrder.getId()); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundWx", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "微信退款") public ResponseData orderToRefundWx(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { order.setStatus(5); order.setRefundTime(new Date()); order.setRefundFee(order.getPayRealPrice()); outRechargeOrderService.updateOrder(order); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java index 9a5bbff9..e9277341 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java @@ -369,7 +369,11 @@ public class OutRechargeOrderController { // 积分退款 if (order.getPayType() == 3) { - highUserService.goldHandle(order.getUserId(), order.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 1, 3, order.getId()); + if (highUserService.findGoldRepeat(3 , order.getId())) { + highUserService.goldHandle(order.getUserId(), order.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 1, 3, order.getId()); + }else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); + } order.setStatus(5); order.setRefundTime(new Date()); order.setOutRefundNo("HFR"+new Date().getTime() ); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java index 360ee523..2c99a0dd 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java @@ -86,6 +86,8 @@ public class CzOrderController { highGasOrderRefund.setCreateTime(new Date()); highGasOrderRefund.setReturnContent(String.valueOf(dataObject)); + highGasOrderRefundMapper.insert(highGasOrderRefund); + if (dataObject.getInteger("status") == 3) { OutRechargeOrder order; OutRechargeOrderRecord rechargeOrderRecord = rechargeOrderRecordService.findByOrderNo(dataObject.getString("out_order_id")); @@ -188,6 +190,7 @@ public class CzOrderController { String resultXmL = doRefundRequest(param.get("mch_id"), WxUtils.mapToXml(param)); OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { order.setStatus(5); order.setRefundTime(new Date()); @@ -229,7 +232,7 @@ public class CzOrderController { // 积分退款 if (order.getPayType() == 3) { - if (!highUserService.findGoldRepeat(3 , order.getId())) { + if (highUserService.findGoldRepeat(3 , order.getId())) { highUserService.goldHandle(order.getUserId(), order.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 1, 3, order.getId()); }else { log.error("orderToPay error!", "已有退款记录"); diff --git a/hai-cweb/src/main/java/com/cweb/controller/testController.java b/hai-cweb/src/main/java/com/cweb/controller/testController.java deleted file mode 100644 index e7265920..00000000 --- a/hai-cweb/src/main/java/com/cweb/controller/testController.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.cweb.controller; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.hai.model.MtSmsMessageModel; -import com.hai.model.ResponseData; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -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 java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.net.URL; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -@Controller -@Api(value = "华为云短信发送") -@RequestMapping(value = "/test1") -public class testController { - /** - * 设置不验证主机 - */ - private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - - @RequestMapping(value = "/sendSmsCode", method = RequestMethod.GET) - @ApiOperation(value = "发送短信验证码") - @ResponseBody - public String sendSmsCode(@RequestParam(value = "phone", required = true) String phone) throws Exception { - // ip:port根据实际情况填写 - String url = "https://139.9.32.119:18312/common/sms/sendTemplateMessage"; - String msisdn = "18090580471"; - String smsTemplateId = "SMS_21092300061"; - Map templateParas = new HashMap(); - templateParas.put("code", "123456"); - String account = "760887"; //实际账号 - String password = "Z.o'&mO%7_?5M,Br"; //实际密码 - - // If the request body does not contain the signature name, set signature to null. - Map body = buildRequestBody(msisdn, smsTemplateId, templateParas, account, password); - if (null == body || body.isEmpty()) { - System.out.println("body is null."); - return ""; - } - - - HttpsURLConnection connection = null; - InputStream is = null; - BufferedReader br = null; - trustAllHttpsCertificates(); - try { - - - URL realUrl = new URL(url); - connection = (HttpsURLConnection) realUrl.openConnection(); - connection.setHostnameVerifier(DO_NOT_VERIFY); - connection.setDoInput(true); // 设置可输入 - connection.setDoOutput(true); // 设置该连接是可以输出的 - connection.setRequestMethod("POST"); // 设置请求方式 - connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); - // connection.connect(); - ObjectMapper objectMapper = new ObjectMapper(); - PrintWriter pw = new PrintWriter(new OutputStreamWriter(connection.getOutputStream(), "UTF-8")); - pw.write(objectMapper.writeValueAsString(body)); - pw.flush(); - pw.close(); - - - br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8")); - int status = connection.getResponseCode(); - if (200 == status) { // 200 - is = connection.getInputStream(); - } else { // 400/401 - is = connection.getErrorStream(); - } - br = new BufferedReader(new InputStreamReader(is, "UTF-8")); - String line = null; - StringBuilder result = new StringBuilder(); - while ((line = br.readLine()) != null) { // 读取数据 - result.append(line + ""); - } - connection.disconnect(); - System.out.println(result.toString()); - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - - - if (null != is) { - is.close(); - } - if (null != br) { - br.close(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - return ""; - } - - // msisdn, smsTemplateId, paramValues, countryID - public static Map buildRequestBody(String msisdn, String smsTemplateId, - Map paramValues, String accout, String passward) { - if (null == msisdn || null == smsTemplateId || null == accout || null == passward) { - System.out.println( - "buildRequestBody(): mobiles, templateId or templateParas or account or password is null."); - return null; - } - - - Map map = new HashMap(); - List requestLists = new ArrayList(); - MtSmsMessageModel mtSmsMessage = new MtSmsMessageModel(); - List mobiles = new ArrayList(); - mobiles.add(msisdn); - mtSmsMessage.setMobiles(mobiles); - mtSmsMessage.setTemplateId(smsTemplateId); - mtSmsMessage.setTemplateParas(paramValues); - mtSmsMessage.setSignature("【嗨森逛】"); - requestLists.add(mtSmsMessage); - map.put("account", accout); - map.put("password", passward); - map.put("requestLists", requestLists); - return map; - } - - - static void trustAllHttpsCertificates() throws Exception { - TrustManager[] trustAllCerts = new TrustManager[] { - new X509TrustManager() { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { - return; - } - - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { - return; - } - - @Override - public X509Certificate[] getAcceptedIssuers() { - return null; - } - } - }; - SSLContext sc = SSLContext.getInstance("SSL"); - sc.init(null, trustAllCerts, null); - HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); - } - -} diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index fdba5f3e..0e68385f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -690,12 +690,12 @@ public interface HighOrderMapperExt { @Select(value = { "" }) @Results({ - @Result(column="payPrice", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="payRealPrice", property="payRealPrice", jdbcType=JdbcType.DECIMAL), @Result(column="orderPrice", property="orderPrice", jdbcType=JdbcType.DECIMAL), @Result(column="count", property="count", jdbcType=JdbcType.BIGINT), }) diff --git a/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java b/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java index 69cbf691..32897ac9 100644 --- a/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java +++ b/hai-service/src/main/java/com/hai/enum_type/OrderPushType.java @@ -13,6 +13,7 @@ public enum OrderPushType { type4(4 , "电影票订单"), type5(5 , "汇联通会员卡"), type6(6 , "汇联通卡券"), + type7(7 , "汇联通会员充值订单"), ; private Integer type; diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index f34d8d5a..dbe01991 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -234,6 +234,6 @@ public class HighUserServiceImpl implements HighUserService { public Boolean findGoldRepeat(Integer resType, Long resId) { HighGoldRecExample example = new HighGoldRecExample(); example.createCriteria().andResIdEqualTo(resId).andResTypeEqualTo(resType); - return highGoldRecMapper.selectByExample(example) != null; + return highGoldRecMapper.selectByExample(example).size() == 0; } } diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index 6bce671e..587320ce 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -506,7 +506,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { // 金币退款 if (order.getPayType() == 3) { - if (!highUserService.findGoldRepeat(3 , order.getId())) { + if (highUserService.findGoldRepeat(3 , order.getId())) { highUserService.goldHandle(order.getUserId(), order.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 1, 3, order.getId()); }else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index 04df7221..9e846f4f 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -355,7 +355,7 @@ public class GoodsOrderServiceImpl implements PayService { dataMap.put("goodsDesc", goodsDesc); dataMap.put("tranDesc", tranDesc); HighGasOrderPush payPush = new HighGasOrderPush(); - payPush.setType(OrderPushType.type5.getType()); + payPush.setType(OrderPushType.type7.getType()); payPush.setOrderNo(order.getOrderNo()); payPush.setCreateTime(new Date()); payPush.setCode(deposit.getString("respCode")); diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 9d975195..ac35f2e5 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -31,11 +31,11 @@ HltMembershipLevelSignCode = 7854B96C # ?????? unionPayUrl=https://open.eycard.cn:8443/WorthTech_Access_AppPaySystemV2/apppayacc unionPayChannelid=D01X00000801226 -unionPayMerid=531000009488145 -unionPayTermid=39339061 +unionPayMerid=83169055983W000 +unionPayTermid=XS000103 unionPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0 -unionPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notify -unionPayTelNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notifyTel +unionPayNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notify +unionPayTelNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notifyTel unionStagingPayUrl=https://mtest.eycard.cn/ unionStagingPayOrgId=ORG000000000001