From 60326d842d92d9bf71cf8aad42e7199a32cf0024 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 13 Jun 2021 17:32:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?'=E5=85=85=E5=80=BC=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E4=BB=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/cweb/config/AuthConfig.java | 2 + .../cweb/controller/HighTestController.java | 75 +++++++++ .../OutRechargeOrderController.java | 157 +++++++++++++++++- .../com/hai/common/pay/entity/OrderType.java | 3 +- .../java/com/hai/common/utils/WxUtils.java | 36 ++++ .../java/com/hai/entity/OutRechargeOrder.java | 2 +- .../pay/impl/GoodsOrderServiceImpl.java | 6 +- .../pay/impl/rechargeOrderServiceImpl.java | 73 ++++++++ .../privatekey/1289663601_apiclient_cert.p12 | Bin 0 -> 2710 bytes 9 files changed, 346 insertions(+), 8 deletions(-) create mode 100644 hai-cweb/src/main/java/com/cweb/controller/HighTestController.java create mode 100644 hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java create mode 100644 hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12 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 b0c9c921..6a8509dc 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -108,6 +108,8 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/user/getUnionId") .excludePathPatterns("/order/orderToH5Pay") .excludePathPatterns("/order/orderToPay") + .excludePathPatterns("/test/*") + .excludePathPatterns("/outRechargeOrder/refundOrder") .excludePathPatterns("/wechat/*") ; } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java new file mode 100644 index 00000000..a36a0749 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -0,0 +1,75 @@ +package com.cweb.controller; + +import com.alibaba.fastjson.JSON; +import com.github.pagehelper.PageHelper; +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.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.*; +import com.hai.entity.*; +import com.hai.model.HighUserModel; +import com.hai.model.ResponseData; +import com.hai.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @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); + + + @RequestMapping(value = "/getOrderById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询订单详情") + public ResponseData getOrderById() { + try { + + Map map = new HashMap<>(); + map.put("app_key", "208241666939552"); + //map.put("app_secret", "adecc3cff077834cb8632c8ab3bec0e6"); + map.put("timestamp", new Date().getTime()); + map.put("pageIndex", 1); + map.put("pageSize", 10); + String signStr = "adecc3cff077834cb8632c8ab3bec0e6" + WxUtils.generateSignature(map,"adecc3cff077834cb8632c8ab3bec0e6") + "adecc3cff077834cb8632c8ab3bec0e6"; + + System.out.println("加密前:" + signStr); + String sign = MD5Util.encode(signStr.getBytes()).toLowerCase(); + System.out.println("加密后:" + sign); + map.put("sign", sign); + + return ResponseMsgUtil.success(HttpsUtils.doPost("https://test02-motorcade-hcs.czb365.com/services/vp/openapi/queryGasInfoListByPage", JSON.toJSONString(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getOrderById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java index 55c224df..46b98b03 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java @@ -1,25 +1,37 @@ package com.cweb.controller; import com.alibaba.fastjson.JSONObject; +import com.cweb.config.SysConst; import com.github.pagehelper.PageHelper; 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.pay.WechatPayUtil; +import com.hai.common.pay.entity.WeChatPayReqInfo; +import com.hai.common.pay.util.MD5Util; +import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; -import com.hai.common.utils.DateUtil; -import com.hai.common.utils.IDGenerator; -import com.hai.common.utils.ResponseMsgUtil; +import com.hai.common.utils.*; +import com.hai.entity.HighChildOrder; +import com.hai.entity.HighCoupon; import com.hai.entity.HighOrder; import com.hai.entity.OutRechargeOrder; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.OutRechargeOrderService; import com.hai.service.TelApiService; +import com.hai.service.pay.impl.GoodsOrderServiceImpl; 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.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -28,9 +40,12 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.Map; +import java.util.SortedMap; +import java.util.concurrent.ThreadLocalRandom; @Controller @RequestMapping(value = "/outRechargeOrder") @@ -47,6 +62,12 @@ public class OutRechargeOrderController { @Resource private TelApiService telApiService; + @Resource + private WechatPayUtil wechatPayUtil; + + @Resource + private GoodsOrderServiceImpl goodsOrderService; + @RequestMapping(value="/addOrder",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "增加订单") @@ -160,4 +181,134 @@ public class OutRechargeOrderController { return ResponseMsgUtil.exception(e); } } + + + @RequestMapping(value="/orderToPay",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "订单支付发起支付") + public ResponseData orderToPay(@RequestBody String reqBodyStr) { + try { + if (StringUtils.isBlank(reqBodyStr)) { + log.error("orderToPay error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + JSONObject jsonObject = JSONObject.parseObject(reqBodyStr); + Long orderId = jsonObject.getLong("orderId"); + String openId = jsonObject.getString("openId"); // openId + if (orderId == null || StringUtils.isBlank(openId)) { + log.error("orderToPay error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 订单 + OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId); + if (order == null) { + log.error("orderToPay error!", "未找到订单信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息"); + } + + // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已退款 5.已取消 + if (order.getStatus() != 1) { + log.error("orderToPay error!", "无法支付,订单不处于待支付状态"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,订单不处于待支付状态"); + } + + Map map = new HashMap<>(); + map.put("orderNo", order.getOrderNo()); + map.put("payPrice", order.getPayPrice()); + map.put("orderScene", "RECHARGE_ORDER"); + map.put("body","购买产品"); + map.put("subject","购买产品"); + + //微信支付 + String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8"); + int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue(); + WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo(); + weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxMchAppId()); //公众号id + weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxMchId()); //商户号 + weChatPayReqInfo.setSub_appid(SysConst.getSysConfig().getWxSubAppId()); //商户号 + weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxSubMchId()); //子商户号 + + // weChatPayReqInfo.setOpenid(openId); + weChatPayReqInfo.setSub_openid(openId); + weChatPayReqInfo.setNonce_str(nonce_str); //随机字符串 + weChatPayReqInfo.setBody(map.get("body").toString()); //商品描述 + weChatPayReqInfo.setOut_trade_no(map.get("orderNo").toString()); //商户订单号 + weChatPayReqInfo.setTotal_fee(total_fee); //总金额 + weChatPayReqInfo.setSpbill_create_ip("139.159.177.244"); //终端ip + weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getNotifyUrl()); //通知url + weChatPayReqInfo.setTrade_type("JSAPI"); //交易类型 + weChatPayReqInfo.setAttach(map.get("orderScene").toString()); + weChatPayReqInfo.setProfit_sharing("Y"); + //附加数据,区分订单类型 + Map payMap = new HashMap<>(); + + payMap.put("app_id",SysConst.getSysConfig().getWxSubAppId()); + payMap.put("api_key",SysConst.getSysConfig().getWxApiKey()); + payMap.put("unified_order_url",SysConst.getSysConfig().getWxUnifiedOrderUrl()); + SortedMap sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap); + return ResponseMsgUtil.success(sortedMap); + } catch (Exception e) { + log.error("orderToPay error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "订单退款") + public ResponseData orderToRefund(HttpServletRequest request) { + try { + + Map param = new HashMap<>(); + param.put("appid", "wx637bd6f7314daa46"); + param.put("mch_id", "1289663601"); + param.put("sub_mch_id" , "1609882817"); + param.put("nonce_str", WxUtils.makeNonStr()); + param.put("transaction_id", "4200001165202106112686446080"); + param.put("out_refund_no", "HFR"+new Date().getTime()); + param.put("total_fee", "1"); + param.put("refund_fee", "1"); + param.put("sign_type", "HMAC-SHA256"); + + String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256); + param.put("sign", signStr); + + return ResponseMsgUtil.success(doRefundRequest(param.get("mch_id"),null,WxUtils.mapToXml(param))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + public String doRefundRequest(String mchId, String url, String data) throws Exception { + + //小程序退款需要调用双向证书的认证 + CloseableHttpClient httpClient = goodsOrderService.readCertificate(mchId); + try { + HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/refund"); // 设置响应头信息 + httpost.addHeader("Connection", "keep-alive"); + httpost.addHeader("Accept", "*/*"); + httpost.addHeader("Content-Type", "text/xml"); + httpost.addHeader("Host", "api.mch.weixin.qq.com"); + httpost.addHeader("X-Requested-With", "XMLHttpRequest"); + httpost.addHeader("Cache-Control", "max-age=0"); + httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); + httpost.setEntity(new StringEntity(data, "UTF-8")); + CloseableHttpResponse response = httpClient.execute(httpost); + try { + HttpEntity entity = response.getEntity(); + String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); + EntityUtils.consume(entity); + return jsonStr; + } finally { + response.close(); + } + } catch (Exception e){ + throw new RuntimeException(e); + } finally { + httpClient.close(); + } + } } diff --git a/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java b/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java index 11eea92d..ea702d5d 100644 --- a/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java +++ b/hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java @@ -3,7 +3,8 @@ package com.hai.common.pay.entity; public enum OrderType { // 建议将支付频率高的模块放在前面 GOODS_ORDER("GOODS_ORDER", "goodsOrderService", "购买商品"), - TEST("TEST", "testPayService", "支付测试") + RECHARGE_ORDER("RECHARGE_ORDER", "rechargeOrderService", "充值订单"), + TEST("TEST", "testPayService", "支付测试"), ; private String moduleCode; diff --git a/hai-service/src/main/java/com/hai/common/utils/WxUtils.java b/hai-service/src/main/java/com/hai/common/utils/WxUtils.java index f2d62f68..266fae06 100644 --- a/hai-service/src/main/java/com/hai/common/utils/WxUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/WxUtils.java @@ -247,6 +247,42 @@ public class WxUtils { } } + public static String generateSignature(final Map data, String key) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k) != null) // 参数值为空,则不参与签名 + sb.append(k).append("").append(data.get(k)).append(""); + } + if (key != null) { + //sb.append("app_secret=").append(key); + } + return sb.toString(); + } + + public static String generateSignature2(final Map data, String sign, String key) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k) != null) // 参数值为空,则不参与签名 + sb.append(k).append("=").append(data.get(k)).append("&"); + } + if (key != null) { + sb.append("app_secret=").append(key); + } + return sb.toString(); + } + /** * 生成 MD5 * diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java index f79c47b7..1e944f45 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java @@ -12,7 +12,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class OutRechargeOrder implements Serializable { +public class OutRechargeOrder extends HighOrder implements Serializable { /** * 主键 */ 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 b342cc4d..e4fed8ea 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 @@ -187,14 +187,14 @@ public class GoodsOrderServiceImpl implements PayService { } } - //微信小程序读取双向证书 - private static CloseableHttpClient readCertificate(String mchId) throws Exception{ + + public CloseableHttpClient readCertificate(String mchId) throws Exception{ /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 - FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); + FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java new file mode 100644 index 00000000..c91a282e --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java @@ -0,0 +1,73 @@ +package com.hai.service.pay.impl; + +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.WxUtils; +import com.hai.dao.HighUserCouponMapper; +import com.hai.entity.*; +import com.hai.model.ResultProfitSharing; +import com.hai.service.*; +import com.hai.service.pay.PayService; +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.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.net.ssl.SSLContext; +import java.io.FileInputStream; +import java.math.BigDecimal; +import java.security.KeyStore; +import java.util.*; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/27 00:35 + */ +@Service("rechargeOrderService") +public class rechargeOrderServiceImpl implements PayService { + + private static Logger log = LoggerFactory.getLogger(rechargeOrderServiceImpl.class); + + @Resource + private OutRechargeOrderService outRechargeOrderService; + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW) + public void paySuccess(Map map, String payType) throws Exception { + if (payType.equals("Alipay")) { + // 支付宝支付 todo 暂未开发 + return; + } + if (payType.equals("WechatPay")) { + // 查询订单信息 + OutRechargeOrder order = outRechargeOrderService.findByOrderNo(map.get("out_trade_no")); + if (order == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); + } + if (order.getOrderStatus() == 1) { + order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 + order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 + order.setPayTime(new Date()); // 支付时间 + order.setOrderStatus(2); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 + outRechargeOrderService.updateOrder(order); + } + } + } + +} diff --git a/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12 b/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..1bb73687ca12962f6a25417017463a8ea189dacb GIT binary patch literal 2710 zcmY+^c{~(~76Br{`|s8kPKE9HaH35zyX$jc=O@TDHcu^ zG6`Y=BtZ;L;u~-huL@8S^Hi|f zD%bBvv+YK{A)LsZ4yI#97*o-yQO_GsPLx9|<%DcEf91S<4bqzO%fPWGMNK;|Qg?o3 zGcLlsH!0rcpd~j}uzuIw4HYJlSUEw(9`1j$m#J{QYd|9VpLsISJzy8Kq~ zYdcKUxf09s>NH0c5r$D?-P<%N5d%g}x2xRzakPf1>*@<31v7{GjX7xVKAz_1c{m=Z zViX)A%*U7>uc`PNE+r50@*Cr(t^$@cw8|#6IgNK)F)sF@e@dB#Ubu#0goKCHnc>y3 zVq-QFXYR(TZs$UeVp&Z09|WNt*3q4YUXz(W>adAKLfMp)!kxUSOY##$axnpCSjj2l zui-4$&(9cen>_QxOZhx8-VUW?)seN7tZU}fzNl2~1&=PxO1ex+FHXJ3>q^D-hCPpB zLUm!EJbcJc_b~O%p`%sdq!s4S$in0GM)J{4buq5Te_!M=KQH)T&(TCJh~qAsNZhA2 z2~L6E#1sKvntUgpO$Qaw!mRKjQ_+>p{BIoIsZDRVcq2cMo}Z zEh@~JXsHO8iVoupAv#2uD~e2RPjlqycj}j+2yXcU+Xhdnb}A=8ywyE;^9RkAN#0(s z%I7pm?{^v}m?ge+@3F^X--cNHwx4BM4x4jOoVeFw6}5HD_mgURmvshH2u3|0et$Ib zEFLPk*+a!0s(-IO6;GkZh;$8%*J!;~LA4604Xl`-&2xE3`);Kmb*_#?v6JgEXs~;z zzSbPDGm{}4AsmjlDy@FQrFlXS@MUa_^9_P0RJNeY^eD3Cz4LJa-AZ#qrd8CMUBG^E zcRgynt&{75h9NAyVxh=*z|laYtEFQ@+U{(WuRQQ7T1Uv&om;r>t!wzedA!N2>DxR_ zA?=8Ci4Cbj8-ts>)!DUg!zPUfz(f@Wm+(LD{q)sk z;}^mI@JIotVV3j_3f@!>Fg+s+S1F_IvcP^>M)9GA%LD@kIUpAei>_>cDyNUcB=Zw0 z;&@`HsaG-zP|Ny8q)DeV!^{vWW&Bz7E-#O`(yJDrq02iJf2g0QfjIJbEM+}i)C#`d>r z;^GVa((|b|{#Ff00#ZkopMLFVVm#_9Q?aEUXhOCSMTr|6a(`Mp#_awW4*G@k=6ad7 z%57rQO?DhP=g(NvwUZM30oDn?V2CeH+1$D@9(hG-Uvl^6yb^XfW666Y+c86cgupD4NINNsLy~m5*NQC+l1=X2>dIQcw^h%aT=Z%_Q){FPc`B* zV@Wn>*;&gXY1|;D$o3a|H86A3tmV&c`or5>>|r$(=Aa3>w)!`Z@&a6ys zOhT-)u9Df{+~OZazMI@xOKS}&tF+dIw9~my@tn<-1Mdpld1N3o6}o`pYsWnCw0OJb2i~ap{~l; zOD|{o7m@{c3XI#kTNbA9+lwOkgnV-rMshaN5!!0V(K3DWGX%YfX>ADK|8Y6KcbHhYeZ>!X@+SKj>8NfZC&g72TOF!a7+63K;A`X z*!K4px6nCk$f9*$?Bj`9AEpL|4Qp9z%|C_}EmW&m6D5_K1QJ_5T6*19`$#x0~%-{qh<6Z0Z3gwt!?-YK`6 zouOj&Or{f1b5D1Pl`(`5nEMdD;?u9XUKYzu_8-9^=PC6g=vKm(U0wOMDy8tC1(*_^ z?y!1|99bH@*QY2*9=nHMy?(A7x9`_i=7fh`y${Kc{%Q#Q?w=V5>PI#DNtCJ$R#vZ$ zhaHa0A-e_aswp?X*N;6U6GGd{<~w9H_6e-z!>_19aIOzTqvEQO5=uGR!oECS@idRv zN{=j)ws6nj^q;$Tfag1Ro#;C5~5H8B<|{hT1LE@Sv)A9y`WhYIJFwpFI) zCKyH_6^@8W_a5|P+K;hOV)w-zO#&cJ<|yWC>C&y+vH4aDp4LKNVsQOqzJW>|+4qV) zgQl#d5KctDlK6x}U$hNu1rWOG9ayWcW@1$U`|(HM#haqy)Ys8NZ{EuWlf;j}odK8b zWA1w9Hut_Ke(ao*$L;^`^$)M{;#@AzF@`hp%NANtnf1kC9#Q%sTTQH%=O+RSm-?@cU?@TmC@>P~ z)i{ro88<+s1)Qp;uhn|rd;wSf=STn{BPI>70(by?0e%1%Ko~#*pm#D60D%BJ;Lb_8 zouq*P54ZyS0vyc24m-`pdX60c6qtu4Key?O&Gc+TVJRU185>^4G7zLi{qY=neb)Cc DnO6n3 literal 0 HcmV?d00001 From f67c6dd39d2f7da2149ef914c86c29d1ec90ffdc Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 13 Jun 2021 20:54:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutRechargeOrderController.java | 38 +- .../src/main/resources/dev/application.yml | 2 +- .../java/com/hai/dao/OutRechargeOrder.java | 418 ++++ .../com/hai/dao/OutRechargeOrderExample.java | 1704 +++++++++++++++++ .../com/hai/dao/OutRechargeOrderMapper.java | 10 +- .../hai/dao/OutRechargeOrderSqlProvider.java | 28 + .../java/com/hai/entity/OutRechargeOrder.java | 36 +- .../hai/entity/OutRechargeOrderExample.java | 130 ++ .../java/com/hai/model/OrderRefundModel.java | 186 ++ .../pay/impl/GoodsOrderServiceImpl.java | 3 +- ...mpl.java => RechargeOrderServiceImpl.java} | 26 +- 11 files changed, 2549 insertions(+), 32 deletions(-) create mode 100644 hai-service/src/main/java/com/hai/dao/OutRechargeOrder.java create mode 100644 hai-service/src/main/java/com/hai/dao/OutRechargeOrderExample.java create mode 100644 hai-service/src/main/java/com/hai/model/OrderRefundModel.java rename hai-service/src/main/java/com/hai/service/pay/impl/{rechargeOrderServiceImpl.java => RechargeOrderServiceImpl.java} (61%) diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java index 28568cdb..cb175bde 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java @@ -10,6 +10,7 @@ import com.hai.common.exception.SysCode; import com.hai.common.pay.WechatPayUtil; import com.hai.common.pay.entity.WeChatPayReqInfo; import com.hai.common.pay.util.MD5Util; +import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; @@ -19,12 +20,15 @@ import com.hai.entity.HighCoupon; import com.hai.entity.HighOrder; import com.hai.entity.OutRechargeOrder; import com.hai.model.HighUserModel; +import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; +import com.hai.model.ResultProfitSharing; import com.hai.service.OutRechargeOrderService; import com.hai.service.TelApiService; import com.hai.service.pay.impl.GoodsOrderServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -287,24 +291,48 @@ public class OutRechargeOrderController { @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单退款") - public ResponseData orderToRefund(HttpServletRequest request) { + public ResponseData orderToRefund(@RequestParam(name = "orderId", required = false) Long orderId, + HttpServletRequest request) { try { + OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId); + if (order == null) { + log.error("orderToPay error!", "未找到充值订单"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到充值订单"); + } + + // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 + if (order.getStatus() != 2) { + log.error("orderToPay error!", "无法退款,订单不处于已支付状态"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法退款,订单不处于已支付状态"); + } + Map param = new HashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id" , "1609882817"); param.put("nonce_str", WxUtils.makeNonStr()); - param.put("transaction_id", "4200001165202106112686446080"); + param.put("transaction_id", order.getPaySerialNo()); param.put("out_refund_no", "HFR"+new Date().getTime()); - param.put("total_fee", "1"); - param.put("refund_fee", "1"); + param.put("total_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue())); + param.put("refund_fee", String.valueOf(order.getPayRealPrice().multiply(new BigDecimal("100")).intValue())); param.put("sign_type", "HMAC-SHA256"); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); - return ResponseMsgUtil.success(doRefundRequest(param.get("mch_id"),null,WxUtils.mapToXml(param))); + String resultXmL = doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); + OrderRefundModel orderRefundModel = XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { + order.setStatus(5); + order.setRefundTime(new Date()); + order.setOutRefundNo(orderRefundModel.getOut_refund_no()); + order.setRefundId(orderRefundModel.getRefund_id()); + order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100"))); + outRechargeOrderService.updateOrder(order); + return ResponseMsgUtil.success("退款成功"); + } + return ResponseMsgUtil.success("退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des()); } catch (Exception e) { log.error("HighOrderController --> getUserOrderList() error!", e); diff --git a/hai-cweb/src/main/resources/dev/application.yml b/hai-cweb/src/main/resources/dev/application.yml index dcf08e5d..eed35273 100644 --- a/hai-cweb/src/main/resources/dev/application.yml +++ b/hai-cweb/src/main/resources/dev/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrder.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrder.java new file mode 100644 index 00000000..e7b9d377 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrder.java @@ -0,0 +1,418 @@ +package com.hai.dao; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * out_recharge_order + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class OutRechargeOrder implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 订单流水号 + */ + private String orderNo; + + /** + * 用户表ID + */ + private Long userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 用户电话 + */ + private String userPhone; + + /** + * 充值模式:1 话费充值 2. 中石化 3. 中石油 + */ + private Integer rechargeModel; + + /** + * 1.微信 + */ + private Integer payType; + + /** + * 支付金额 + */ + private BigDecimal payPrice; + + /** + * 订单充值金额 + */ + private BigDecimal orderPrice; + + /** + * 实际金额 + */ + private BigDecimal payRealPrice; + + /** + * 支付流水号 + */ + private String paySerialNo; + + /** + * 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 + */ + private Integer status; + + /** + * 充值内容(电话号码, 卡号) + */ + private String rechargeContent; + + /** + * 中石油需要的持卡人姓名 + */ + private String rechargeName; + + /** + * 中石油需要持卡人身份证 + */ + private String idCard; + + /** + * 生成时间 + */ + private Date createTimed; + + /** + * 支付时间 + */ + private Date payTime; + + /** + * 取消时间 + */ + private Date cancelTime; + + /** + * 完成时间 + */ + private Date finishTime; + + /** + * 备注 + */ + private String remarks; + + /** + * 内部退款订单号 + */ + private String outRefundNo; + + /** + * 第三方退款订单号 + */ + private String refundId; + + /** + * 退款金额 + */ + private BigDecimal refundFee; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public Integer getRechargeModel() { + return rechargeModel; + } + + public void setRechargeModel(Integer rechargeModel) { + this.rechargeModel = rechargeModel; + } + + public Integer getPayType() { + return payType; + } + + public void setPayType(Integer payType) { + this.payType = payType; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + + public BigDecimal getOrderPrice() { + return orderPrice; + } + + public void setOrderPrice(BigDecimal orderPrice) { + this.orderPrice = orderPrice; + } + + public BigDecimal getPayRealPrice() { + return payRealPrice; + } + + public void setPayRealPrice(BigDecimal payRealPrice) { + this.payRealPrice = payRealPrice; + } + + public String getPaySerialNo() { + return paySerialNo; + } + + public void setPaySerialNo(String paySerialNo) { + this.paySerialNo = paySerialNo; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getRechargeContent() { + return rechargeContent; + } + + public void setRechargeContent(String rechargeContent) { + this.rechargeContent = rechargeContent; + } + + public String getRechargeName() { + return rechargeName; + } + + public void setRechargeName(String rechargeName) { + this.rechargeName = rechargeName; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public Date getCreateTimed() { + return createTimed; + } + + public void setCreateTimed(Date createTimed) { + this.createTimed = createTimed; + } + + public Date getPayTime() { + return payTime; + } + + public void setPayTime(Date payTime) { + this.payTime = payTime; + } + + public Date getCancelTime() { + return cancelTime; + } + + public void setCancelTime(Date cancelTime) { + this.cancelTime = cancelTime; + } + + public Date getFinishTime() { + return finishTime; + } + + public void setFinishTime(Date finishTime) { + this.finishTime = finishTime; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getOutRefundNo() { + return outRefundNo; + } + + public void setOutRefundNo(String outRefundNo) { + this.outRefundNo = outRefundNo; + } + + public String getRefundId() { + return refundId; + } + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + + public BigDecimal getRefundFee() { + return refundFee; + } + + public void setRefundFee(BigDecimal refundFee) { + this.refundFee = refundFee; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + OutRechargeOrder other = (OutRechargeOrder) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getRechargeModel() == null ? other.getRechargeModel() == null : this.getRechargeModel().equals(other.getRechargeModel())) + && (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType())) + && (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice())) + && (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice())) + && (this.getPayRealPrice() == null ? other.getPayRealPrice() == null : this.getPayRealPrice().equals(other.getPayRealPrice())) + && (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getRechargeContent() == null ? other.getRechargeContent() == null : this.getRechargeContent().equals(other.getRechargeContent())) + && (this.getRechargeName() == null ? other.getRechargeName() == null : this.getRechargeName().equals(other.getRechargeName())) + && (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard())) + && (this.getCreateTimed() == null ? other.getCreateTimed() == null : this.getCreateTimed().equals(other.getCreateTimed())) + && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) + && (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime())) + && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) + && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) + && (this.getOutRefundNo() == null ? other.getOutRefundNo() == null : this.getOutRefundNo().equals(other.getOutRefundNo())) + && (this.getRefundId() == null ? other.getRefundId() == null : this.getRefundId().equals(other.getRefundId())) + && (this.getRefundFee() == null ? other.getRefundFee() == null : this.getRefundFee().equals(other.getRefundFee())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getRechargeModel() == null) ? 0 : getRechargeModel().hashCode()); + result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode()); + result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode()); + result = prime * result + ((getOrderPrice() == null) ? 0 : getOrderPrice().hashCode()); + result = prime * result + ((getPayRealPrice() == null) ? 0 : getPayRealPrice().hashCode()); + result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getRechargeContent() == null) ? 0 : getRechargeContent().hashCode()); + result = prime * result + ((getRechargeName() == null) ? 0 : getRechargeName().hashCode()); + result = prime * result + ((getIdCard() == null) ? 0 : getIdCard().hashCode()); + result = prime * result + ((getCreateTimed() == null) ? 0 : getCreateTimed().hashCode()); + result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); + result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode()); + result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); + result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); + result = prime * result + ((getOutRefundNo() == null) ? 0 : getOutRefundNo().hashCode()); + result = prime * result + ((getRefundId() == null) ? 0 : getRefundId().hashCode()); + result = prime * result + ((getRefundFee() == null) ? 0 : getRefundFee().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", orderNo=").append(orderNo); + sb.append(", userId=").append(userId); + sb.append(", userName=").append(userName); + sb.append(", userPhone=").append(userPhone); + sb.append(", rechargeModel=").append(rechargeModel); + sb.append(", payType=").append(payType); + sb.append(", payPrice=").append(payPrice); + sb.append(", orderPrice=").append(orderPrice); + sb.append(", payRealPrice=").append(payRealPrice); + sb.append(", paySerialNo=").append(paySerialNo); + sb.append(", status=").append(status); + sb.append(", rechargeContent=").append(rechargeContent); + sb.append(", rechargeName=").append(rechargeName); + sb.append(", idCard=").append(idCard); + sb.append(", createTimed=").append(createTimed); + sb.append(", payTime=").append(payTime); + sb.append(", cancelTime=").append(cancelTime); + sb.append(", finishTime=").append(finishTime); + sb.append(", remarks=").append(remarks); + sb.append(", outRefundNo=").append(outRefundNo); + sb.append(", refundId=").append(refundId); + sb.append(", refundFee=").append(refundFee); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderExample.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderExample.java new file mode 100644 index 00000000..7a8569da --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderExample.java @@ -0,0 +1,1704 @@ +package com.hai.dao; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class OutRechargeOrderExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public OutRechargeOrderExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNull() { + addCriterion("order_no is null"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNotNull() { + addCriterion("order_no is not null"); + return (Criteria) this; + } + + public Criteria andOrderNoEqualTo(String value) { + addCriterion("order_no =", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotEqualTo(String value) { + addCriterion("order_no <>", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThan(String value) { + addCriterion("order_no >", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("order_no >=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThan(String value) { + addCriterion("order_no <", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThanOrEqualTo(String value) { + addCriterion("order_no <=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLike(String value) { + addCriterion("order_no like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotLike(String value) { + addCriterion("order_no not like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoIn(List values) { + addCriterion("order_no in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotIn(List values) { + addCriterion("order_no not in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoBetween(String value1, String value2) { + addCriterion("order_no between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotBetween(String value1, String value2) { + addCriterion("order_no not between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserNameIsNull() { + addCriterion("user_name is null"); + return (Criteria) this; + } + + public Criteria andUserNameIsNotNull() { + addCriterion("user_name is not null"); + return (Criteria) this; + } + + public Criteria andUserNameEqualTo(String value) { + addCriterion("user_name =", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotEqualTo(String value) { + addCriterion("user_name <>", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameGreaterThan(String value) { + addCriterion("user_name >", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameGreaterThanOrEqualTo(String value) { + addCriterion("user_name >=", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameLessThan(String value) { + addCriterion("user_name <", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameLessThanOrEqualTo(String value) { + addCriterion("user_name <=", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameLike(String value) { + addCriterion("user_name like", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotLike(String value) { + addCriterion("user_name not like", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameIn(List values) { + addCriterion("user_name in", values, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotIn(List values) { + addCriterion("user_name not in", values, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameBetween(String value1, String value2) { + addCriterion("user_name between", value1, value2, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotBetween(String value1, String value2) { + addCriterion("user_name not between", value1, value2, "userName"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andRechargeModelIsNull() { + addCriterion("recharge_model is null"); + return (Criteria) this; + } + + public Criteria andRechargeModelIsNotNull() { + addCriterion("recharge_model is not null"); + return (Criteria) this; + } + + public Criteria andRechargeModelEqualTo(Integer value) { + addCriterion("recharge_model =", value, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelNotEqualTo(Integer value) { + addCriterion("recharge_model <>", value, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelGreaterThan(Integer value) { + addCriterion("recharge_model >", value, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelGreaterThanOrEqualTo(Integer value) { + addCriterion("recharge_model >=", value, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelLessThan(Integer value) { + addCriterion("recharge_model <", value, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelLessThanOrEqualTo(Integer value) { + addCriterion("recharge_model <=", value, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelIn(List values) { + addCriterion("recharge_model in", values, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelNotIn(List values) { + addCriterion("recharge_model not in", values, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelBetween(Integer value1, Integer value2) { + addCriterion("recharge_model between", value1, value2, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andRechargeModelNotBetween(Integer value1, Integer value2) { + addCriterion("recharge_model not between", value1, value2, "rechargeModel"); + return (Criteria) this; + } + + public Criteria andPayTypeIsNull() { + addCriterion("pay_type is null"); + return (Criteria) this; + } + + public Criteria andPayTypeIsNotNull() { + addCriterion("pay_type is not null"); + return (Criteria) this; + } + + public Criteria andPayTypeEqualTo(Integer value) { + addCriterion("pay_type =", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotEqualTo(Integer value) { + addCriterion("pay_type <>", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeGreaterThan(Integer value) { + addCriterion("pay_type >", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("pay_type >=", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLessThan(Integer value) { + addCriterion("pay_type <", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLessThanOrEqualTo(Integer value) { + addCriterion("pay_type <=", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeIn(List values) { + addCriterion("pay_type in", values, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotIn(List values) { + addCriterion("pay_type not in", values, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeBetween(Integer value1, Integer value2) { + addCriterion("pay_type between", value1, value2, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotBetween(Integer value1, Integer value2) { + addCriterion("pay_type not between", value1, value2, "payType"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNull() { + addCriterion("pay_price is null"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNotNull() { + addCriterion("pay_price is not null"); + return (Criteria) this; + } + + public Criteria andPayPriceEqualTo(BigDecimal value) { + addCriterion("pay_price =", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotEqualTo(BigDecimal value) { + addCriterion("pay_price <>", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThan(BigDecimal value) { + addCriterion("pay_price >", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price >=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThan(BigDecimal value) { + addCriterion("pay_price <", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price <=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceIn(List values) { + addCriterion("pay_price in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotIn(List values) { + addCriterion("pay_price not in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price not between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceIsNull() { + addCriterion("order_price is null"); + return (Criteria) this; + } + + public Criteria andOrderPriceIsNotNull() { + addCriterion("order_price is not null"); + return (Criteria) this; + } + + public Criteria andOrderPriceEqualTo(BigDecimal value) { + addCriterion("order_price =", value, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceNotEqualTo(BigDecimal value) { + addCriterion("order_price <>", value, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceGreaterThan(BigDecimal value) { + addCriterion("order_price >", value, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("order_price >=", value, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceLessThan(BigDecimal value) { + addCriterion("order_price <", value, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("order_price <=", value, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceIn(List values) { + addCriterion("order_price in", values, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceNotIn(List values) { + addCriterion("order_price not in", values, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("order_price between", value1, value2, "orderPrice"); + return (Criteria) this; + } + + public Criteria andOrderPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("order_price not between", value1, value2, "orderPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceIsNull() { + addCriterion("pay_real_price is null"); + return (Criteria) this; + } + + public Criteria andPayRealPriceIsNotNull() { + addCriterion("pay_real_price is not null"); + return (Criteria) this; + } + + public Criteria andPayRealPriceEqualTo(BigDecimal value) { + addCriterion("pay_real_price =", value, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceNotEqualTo(BigDecimal value) { + addCriterion("pay_real_price <>", value, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceGreaterThan(BigDecimal value) { + addCriterion("pay_real_price >", value, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("pay_real_price >=", value, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceLessThan(BigDecimal value) { + addCriterion("pay_real_price <", value, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("pay_real_price <=", value, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceIn(List values) { + addCriterion("pay_real_price in", values, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceNotIn(List values) { + addCriterion("pay_real_price not in", values, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_real_price between", value1, value2, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPayRealPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_real_price not between", value1, value2, "payRealPrice"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIsNull() { + addCriterion("pay_serial_no is null"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIsNotNull() { + addCriterion("pay_serial_no is not null"); + return (Criteria) this; + } + + public Criteria andPaySerialNoEqualTo(String value) { + addCriterion("pay_serial_no =", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotEqualTo(String value) { + addCriterion("pay_serial_no <>", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoGreaterThan(String value) { + addCriterion("pay_serial_no >", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoGreaterThanOrEqualTo(String value) { + addCriterion("pay_serial_no >=", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLessThan(String value) { + addCriterion("pay_serial_no <", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLessThanOrEqualTo(String value) { + addCriterion("pay_serial_no <=", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLike(String value) { + addCriterion("pay_serial_no like", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotLike(String value) { + addCriterion("pay_serial_no not like", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIn(List values) { + addCriterion("pay_serial_no in", values, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotIn(List values) { + addCriterion("pay_serial_no not in", values, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoBetween(String value1, String value2) { + addCriterion("pay_serial_no between", value1, value2, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotBetween(String value1, String value2) { + addCriterion("pay_serial_no not between", value1, value2, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andRechargeContentIsNull() { + addCriterion("recharge_content is null"); + return (Criteria) this; + } + + public Criteria andRechargeContentIsNotNull() { + addCriterion("recharge_content is not null"); + return (Criteria) this; + } + + public Criteria andRechargeContentEqualTo(String value) { + addCriterion("recharge_content =", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentNotEqualTo(String value) { + addCriterion("recharge_content <>", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentGreaterThan(String value) { + addCriterion("recharge_content >", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentGreaterThanOrEqualTo(String value) { + addCriterion("recharge_content >=", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentLessThan(String value) { + addCriterion("recharge_content <", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentLessThanOrEqualTo(String value) { + addCriterion("recharge_content <=", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentLike(String value) { + addCriterion("recharge_content like", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentNotLike(String value) { + addCriterion("recharge_content not like", value, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentIn(List values) { + addCriterion("recharge_content in", values, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentNotIn(List values) { + addCriterion("recharge_content not in", values, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentBetween(String value1, String value2) { + addCriterion("recharge_content between", value1, value2, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeContentNotBetween(String value1, String value2) { + addCriterion("recharge_content not between", value1, value2, "rechargeContent"); + return (Criteria) this; + } + + public Criteria andRechargeNameIsNull() { + addCriterion("recharge_name is null"); + return (Criteria) this; + } + + public Criteria andRechargeNameIsNotNull() { + addCriterion("recharge_name is not null"); + return (Criteria) this; + } + + public Criteria andRechargeNameEqualTo(String value) { + addCriterion("recharge_name =", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotEqualTo(String value) { + addCriterion("recharge_name <>", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameGreaterThan(String value) { + addCriterion("recharge_name >", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameGreaterThanOrEqualTo(String value) { + addCriterion("recharge_name >=", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameLessThan(String value) { + addCriterion("recharge_name <", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameLessThanOrEqualTo(String value) { + addCriterion("recharge_name <=", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameLike(String value) { + addCriterion("recharge_name like", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotLike(String value) { + addCriterion("recharge_name not like", value, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameIn(List values) { + addCriterion("recharge_name in", values, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotIn(List values) { + addCriterion("recharge_name not in", values, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameBetween(String value1, String value2) { + addCriterion("recharge_name between", value1, value2, "rechargeName"); + return (Criteria) this; + } + + public Criteria andRechargeNameNotBetween(String value1, String value2) { + addCriterion("recharge_name not between", value1, value2, "rechargeName"); + return (Criteria) this; + } + + public Criteria andIdCardIsNull() { + addCriterion("id_card is null"); + return (Criteria) this; + } + + public Criteria andIdCardIsNotNull() { + addCriterion("id_card is not null"); + return (Criteria) this; + } + + public Criteria andIdCardEqualTo(String value) { + addCriterion("id_card =", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardNotEqualTo(String value) { + addCriterion("id_card <>", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardGreaterThan(String value) { + addCriterion("id_card >", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardGreaterThanOrEqualTo(String value) { + addCriterion("id_card >=", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardLessThan(String value) { + addCriterion("id_card <", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardLessThanOrEqualTo(String value) { + addCriterion("id_card <=", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardLike(String value) { + addCriterion("id_card like", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardNotLike(String value) { + addCriterion("id_card not like", value, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardIn(List values) { + addCriterion("id_card in", values, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardNotIn(List values) { + addCriterion("id_card not in", values, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardBetween(String value1, String value2) { + addCriterion("id_card between", value1, value2, "idCard"); + return (Criteria) this; + } + + public Criteria andIdCardNotBetween(String value1, String value2) { + addCriterion("id_card not between", value1, value2, "idCard"); + return (Criteria) this; + } + + public Criteria andCreateTimedIsNull() { + addCriterion("create_timed is null"); + return (Criteria) this; + } + + public Criteria andCreateTimedIsNotNull() { + addCriterion("create_timed is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimedEqualTo(Date value) { + addCriterion("create_timed =", value, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedNotEqualTo(Date value) { + addCriterion("create_timed <>", value, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedGreaterThan(Date value) { + addCriterion("create_timed >", value, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedGreaterThanOrEqualTo(Date value) { + addCriterion("create_timed >=", value, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedLessThan(Date value) { + addCriterion("create_timed <", value, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedLessThanOrEqualTo(Date value) { + addCriterion("create_timed <=", value, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedIn(List values) { + addCriterion("create_timed in", values, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedNotIn(List values) { + addCriterion("create_timed not in", values, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedBetween(Date value1, Date value2) { + addCriterion("create_timed between", value1, value2, "createTimed"); + return (Criteria) this; + } + + public Criteria andCreateTimedNotBetween(Date value1, Date value2) { + addCriterion("create_timed not between", value1, value2, "createTimed"); + return (Criteria) this; + } + + public Criteria andPayTimeIsNull() { + addCriterion("pay_time is null"); + return (Criteria) this; + } + + public Criteria andPayTimeIsNotNull() { + addCriterion("pay_time is not null"); + return (Criteria) this; + } + + public Criteria andPayTimeEqualTo(Date value) { + addCriterion("pay_time =", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotEqualTo(Date value) { + addCriterion("pay_time <>", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeGreaterThan(Date value) { + addCriterion("pay_time >", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeGreaterThanOrEqualTo(Date value) { + addCriterion("pay_time >=", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeLessThan(Date value) { + addCriterion("pay_time <", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeLessThanOrEqualTo(Date value) { + addCriterion("pay_time <=", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeIn(List values) { + addCriterion("pay_time in", values, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotIn(List values) { + addCriterion("pay_time not in", values, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeBetween(Date value1, Date value2) { + addCriterion("pay_time between", value1, value2, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotBetween(Date value1, Date value2) { + addCriterion("pay_time not between", value1, value2, "payTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeIsNull() { + addCriterion("cancel_time is null"); + return (Criteria) this; + } + + public Criteria andCancelTimeIsNotNull() { + addCriterion("cancel_time is not null"); + return (Criteria) this; + } + + public Criteria andCancelTimeEqualTo(Date value) { + addCriterion("cancel_time =", value, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeNotEqualTo(Date value) { + addCriterion("cancel_time <>", value, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeGreaterThan(Date value) { + addCriterion("cancel_time >", value, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeGreaterThanOrEqualTo(Date value) { + addCriterion("cancel_time >=", value, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeLessThan(Date value) { + addCriterion("cancel_time <", value, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeLessThanOrEqualTo(Date value) { + addCriterion("cancel_time <=", value, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeIn(List values) { + addCriterion("cancel_time in", values, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeNotIn(List values) { + addCriterion("cancel_time not in", values, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeBetween(Date value1, Date value2) { + addCriterion("cancel_time between", value1, value2, "cancelTime"); + return (Criteria) this; + } + + public Criteria andCancelTimeNotBetween(Date value1, Date value2) { + addCriterion("cancel_time not between", value1, value2, "cancelTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeIsNull() { + addCriterion("finish_time is null"); + return (Criteria) this; + } + + public Criteria andFinishTimeIsNotNull() { + addCriterion("finish_time is not null"); + return (Criteria) this; + } + + public Criteria andFinishTimeEqualTo(Date value) { + addCriterion("finish_time =", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeNotEqualTo(Date value) { + addCriterion("finish_time <>", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeGreaterThan(Date value) { + addCriterion("finish_time >", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeGreaterThanOrEqualTo(Date value) { + addCriterion("finish_time >=", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeLessThan(Date value) { + addCriterion("finish_time <", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeLessThanOrEqualTo(Date value) { + addCriterion("finish_time <=", value, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeIn(List values) { + addCriterion("finish_time in", values, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeNotIn(List values) { + addCriterion("finish_time not in", values, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeBetween(Date value1, Date value2) { + addCriterion("finish_time between", value1, value2, "finishTime"); + return (Criteria) this; + } + + public Criteria andFinishTimeNotBetween(Date value1, Date value2) { + addCriterion("finish_time not between", value1, value2, "finishTime"); + return (Criteria) this; + } + + public Criteria andRemarksIsNull() { + addCriterion("remarks is null"); + return (Criteria) this; + } + + public Criteria andRemarksIsNotNull() { + addCriterion("remarks is not null"); + return (Criteria) this; + } + + public Criteria andRemarksEqualTo(String value) { + addCriterion("remarks =", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotEqualTo(String value) { + addCriterion("remarks <>", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksGreaterThan(String value) { + addCriterion("remarks >", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksGreaterThanOrEqualTo(String value) { + addCriterion("remarks >=", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksLessThan(String value) { + addCriterion("remarks <", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksLessThanOrEqualTo(String value) { + addCriterion("remarks <=", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksLike(String value) { + addCriterion("remarks like", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotLike(String value) { + addCriterion("remarks not like", value, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksIn(List values) { + addCriterion("remarks in", values, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotIn(List values) { + addCriterion("remarks not in", values, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksBetween(String value1, String value2) { + addCriterion("remarks between", value1, value2, "remarks"); + return (Criteria) this; + } + + public Criteria andRemarksNotBetween(String value1, String value2) { + addCriterion("remarks not between", value1, value2, "remarks"); + return (Criteria) this; + } + + public Criteria andOutRefundNoIsNull() { + addCriterion("out_refund_no is null"); + return (Criteria) this; + } + + public Criteria andOutRefundNoIsNotNull() { + addCriterion("out_refund_no is not null"); + return (Criteria) this; + } + + public Criteria andOutRefundNoEqualTo(String value) { + addCriterion("out_refund_no =", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoNotEqualTo(String value) { + addCriterion("out_refund_no <>", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoGreaterThan(String value) { + addCriterion("out_refund_no >", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoGreaterThanOrEqualTo(String value) { + addCriterion("out_refund_no >=", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoLessThan(String value) { + addCriterion("out_refund_no <", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoLessThanOrEqualTo(String value) { + addCriterion("out_refund_no <=", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoLike(String value) { + addCriterion("out_refund_no like", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoNotLike(String value) { + addCriterion("out_refund_no not like", value, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoIn(List values) { + addCriterion("out_refund_no in", values, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoNotIn(List values) { + addCriterion("out_refund_no not in", values, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoBetween(String value1, String value2) { + addCriterion("out_refund_no between", value1, value2, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andOutRefundNoNotBetween(String value1, String value2) { + addCriterion("out_refund_no not between", value1, value2, "outRefundNo"); + return (Criteria) this; + } + + public Criteria andRefundIdIsNull() { + addCriterion("refund_id is null"); + return (Criteria) this; + } + + public Criteria andRefundIdIsNotNull() { + addCriterion("refund_id is not null"); + return (Criteria) this; + } + + public Criteria andRefundIdEqualTo(String value) { + addCriterion("refund_id =", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotEqualTo(String value) { + addCriterion("refund_id <>", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdGreaterThan(String value) { + addCriterion("refund_id >", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdGreaterThanOrEqualTo(String value) { + addCriterion("refund_id >=", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdLessThan(String value) { + addCriterion("refund_id <", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdLessThanOrEqualTo(String value) { + addCriterion("refund_id <=", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdLike(String value) { + addCriterion("refund_id like", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotLike(String value) { + addCriterion("refund_id not like", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdIn(List values) { + addCriterion("refund_id in", values, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotIn(List values) { + addCriterion("refund_id not in", values, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdBetween(String value1, String value2) { + addCriterion("refund_id between", value1, value2, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotBetween(String value1, String value2) { + addCriterion("refund_id not between", value1, value2, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundFeeIsNull() { + addCriterion("refund_fee is null"); + return (Criteria) this; + } + + public Criteria andRefundFeeIsNotNull() { + addCriterion("refund_fee is not null"); + return (Criteria) this; + } + + public Criteria andRefundFeeEqualTo(BigDecimal value) { + addCriterion("refund_fee =", value, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeNotEqualTo(BigDecimal value) { + addCriterion("refund_fee <>", value, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeGreaterThan(BigDecimal value) { + addCriterion("refund_fee >", value, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("refund_fee >=", value, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeLessThan(BigDecimal value) { + addCriterion("refund_fee <", value, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeLessThanOrEqualTo(BigDecimal value) { + addCriterion("refund_fee <=", value, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeIn(List values) { + addCriterion("refund_fee in", values, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeNotIn(List values) { + addCriterion("refund_fee not in", values, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("refund_fee between", value1, value2, "refundFee"); + return (Criteria) this; + } + + public Criteria andRefundFeeNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("refund_fee not between", value1, value2, "refundFee"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java index e4137911..d8d3ea73 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java @@ -49,6 +49,7 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "create_timed, pay_time, ", "cancel_time, finish_time, ", "remarks, out_refund_no, ", + "refund_time, refund_id, ", "refund_fee)", "values (#{orderNo,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ", "#{userName,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, ", @@ -60,6 +61,7 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "#{createTimed,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ", "#{cancelTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", "#{remarks,jdbcType=VARCHAR}, #{outRefundNo,jdbcType=VARCHAR}, ", + "#{refundTime,jdbcType=TIMESTAMP}, #{refundId,jdbcType=VARCHAR}, ", "#{refundFee,jdbcType=DECIMAL})" }) @Options(useGeneratedKeys=true,keyProperty="id") @@ -92,6 +94,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR), @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL) }) List selectByExample(OutRechargeOrderExample example); @@ -101,7 +105,7 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "id, order_no, user_id, user_name, user_phone, recharge_model, pay_type, pay_price, ", "order_price, pay_real_price, pay_serial_no, `status`, recharge_content, recharge_name, ", "id_card, create_timed, pay_time, cancel_time, finish_time, remarks, out_refund_no, ", - "refund_fee", + "refund_time, refund_id, refund_fee", "from out_recharge_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -127,6 +131,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR), @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL) }) OutRechargeOrder selectByPrimaryKey(Long id); @@ -162,6 +168,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "finish_time = #{finishTime,jdbcType=TIMESTAMP},", "remarks = #{remarks,jdbcType=VARCHAR},", "out_refund_no = #{outRefundNo,jdbcType=VARCHAR},", + "refund_time = #{refundTime,jdbcType=TIMESTAMP},", + "refund_id = #{refundId,jdbcType=VARCHAR},", "refund_fee = #{refundFee,jdbcType=DECIMAL}", "where id = #{id,jdbcType=BIGINT}" }) diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java index 6283b67c..70d95c41 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java @@ -108,6 +108,14 @@ public class OutRechargeOrderSqlProvider { sql.VALUES("out_refund_no", "#{outRefundNo,jdbcType=VARCHAR}"); } + if (record.getRefundTime() != null) { + sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundId() != null) { + sql.VALUES("refund_id", "#{refundId,jdbcType=VARCHAR}"); + } + if (record.getRefundFee() != null) { sql.VALUES("refund_fee", "#{refundFee,jdbcType=DECIMAL}"); } @@ -142,6 +150,8 @@ public class OutRechargeOrderSqlProvider { sql.SELECT("finish_time"); sql.SELECT("remarks"); sql.SELECT("out_refund_no"); + sql.SELECT("refund_time"); + sql.SELECT("refund_id"); sql.SELECT("refund_fee"); sql.FROM("out_recharge_order"); applyWhere(sql, example, false); @@ -244,6 +254,14 @@ public class OutRechargeOrderSqlProvider { sql.SET("out_refund_no = #{record.outRefundNo,jdbcType=VARCHAR}"); } + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundId() != null) { + sql.SET("refund_id = #{record.refundId,jdbcType=VARCHAR}"); + } + if (record.getRefundFee() != null) { sql.SET("refund_fee = #{record.refundFee,jdbcType=DECIMAL}"); } @@ -277,6 +295,8 @@ public class OutRechargeOrderSqlProvider { sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); sql.SET("out_refund_no = #{record.outRefundNo,jdbcType=VARCHAR}"); + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + sql.SET("refund_id = #{record.refundId,jdbcType=VARCHAR}"); sql.SET("refund_fee = #{record.refundFee,jdbcType=DECIMAL}"); OutRechargeOrderExample example = (OutRechargeOrderExample) parameter.get("example"); @@ -368,6 +388,14 @@ public class OutRechargeOrderSqlProvider { sql.SET("out_refund_no = #{outRefundNo,jdbcType=VARCHAR}"); } + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundId() != null) { + sql.SET("refund_id = #{refundId,jdbcType=VARCHAR}"); + } + if (record.getRefundFee() != null) { sql.SET("refund_fee = #{refundFee,jdbcType=DECIMAL}"); } diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java index 4e391fc4..21747de5 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java @@ -13,7 +13,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class OutRechargeOrder extends HighOrder implements Serializable { +public class OutRechargeOrder implements Serializable { /** * 主键 */ @@ -115,10 +115,20 @@ public class OutRechargeOrder extends HighOrder implements Serializable { private String remarks; /** - * 退款订单号 + * 内部退款订单号 */ private String outRefundNo; + /** + * 退款时间 + */ + private Date refundTime; + + /** + * 第三方退款订单号 + */ + private String refundId; + /** * 退款金额 */ @@ -294,6 +304,22 @@ public class OutRechargeOrder extends HighOrder implements Serializable { this.outRefundNo = outRefundNo; } + public Date getRefundTime() { + return refundTime; + } + + public void setRefundTime(Date refundTime) { + this.refundTime = refundTime; + } + + public String getRefundId() { + return refundId; + } + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + public BigDecimal getRefundFee() { return refundFee; } @@ -335,6 +361,8 @@ public class OutRechargeOrder extends HighOrder implements Serializable { && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) && (this.getOutRefundNo() == null ? other.getOutRefundNo() == null : this.getOutRefundNo().equals(other.getOutRefundNo())) + && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) + && (this.getRefundId() == null ? other.getRefundId() == null : this.getRefundId().equals(other.getRefundId())) && (this.getRefundFee() == null ? other.getRefundFee() == null : this.getRefundFee().equals(other.getRefundFee())); } @@ -363,6 +391,8 @@ public class OutRechargeOrder extends HighOrder implements Serializable { result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); result = prime * result + ((getOutRefundNo() == null) ? 0 : getOutRefundNo().hashCode()); + result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); + result = prime * result + ((getRefundId() == null) ? 0 : getRefundId().hashCode()); result = prime * result + ((getRefundFee() == null) ? 0 : getRefundFee().hashCode()); return result; } @@ -394,6 +424,8 @@ public class OutRechargeOrder extends HighOrder implements Serializable { sb.append(", finishTime=").append(finishTime); sb.append(", remarks=").append(remarks); sb.append(", outRefundNo=").append(outRefundNo); + sb.append(", refundTime=").append(refundTime); + sb.append(", refundId=").append(refundId); sb.append(", refundFee=").append(refundFee); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java index 17061aaa..83071e1a 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java @@ -1476,6 +1476,136 @@ public class OutRechargeOrderExample { return (Criteria) this; } + public Criteria andRefundTimeIsNull() { + addCriterion("refund_time is null"); + return (Criteria) this; + } + + public Criteria andRefundTimeIsNotNull() { + addCriterion("refund_time is not null"); + return (Criteria) this; + } + + public Criteria andRefundTimeEqualTo(Date value) { + addCriterion("refund_time =", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotEqualTo(Date value) { + addCriterion("refund_time <>", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThan(Date value) { + addCriterion("refund_time >", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThanOrEqualTo(Date value) { + addCriterion("refund_time >=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThan(Date value) { + addCriterion("refund_time <", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThanOrEqualTo(Date value) { + addCriterion("refund_time <=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeIn(List values) { + addCriterion("refund_time in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotIn(List values) { + addCriterion("refund_time not in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeBetween(Date value1, Date value2) { + addCriterion("refund_time between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotBetween(Date value1, Date value2) { + addCriterion("refund_time not between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundIdIsNull() { + addCriterion("refund_id is null"); + return (Criteria) this; + } + + public Criteria andRefundIdIsNotNull() { + addCriterion("refund_id is not null"); + return (Criteria) this; + } + + public Criteria andRefundIdEqualTo(String value) { + addCriterion("refund_id =", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotEqualTo(String value) { + addCriterion("refund_id <>", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdGreaterThan(String value) { + addCriterion("refund_id >", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdGreaterThanOrEqualTo(String value) { + addCriterion("refund_id >=", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdLessThan(String value) { + addCriterion("refund_id <", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdLessThanOrEqualTo(String value) { + addCriterion("refund_id <=", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdLike(String value) { + addCriterion("refund_id like", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotLike(String value) { + addCriterion("refund_id not like", value, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdIn(List values) { + addCriterion("refund_id in", values, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotIn(List values) { + addCriterion("refund_id not in", values, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdBetween(String value1, String value2) { + addCriterion("refund_id between", value1, value2, "refundId"); + return (Criteria) this; + } + + public Criteria andRefundIdNotBetween(String value1, String value2) { + addCriterion("refund_id not between", value1, value2, "refundId"); + return (Criteria) this; + } + public Criteria andRefundFeeIsNull() { addCriterion("refund_fee is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/model/OrderRefundModel.java b/hai-service/src/main/java/com/hai/model/OrderRefundModel.java new file mode 100644 index 00000000..eb830801 --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/OrderRefundModel.java @@ -0,0 +1,186 @@ +package com.hai.model; + +public class OrderRefundModel { + + private String err_code; + private String err_code_des; + + private String return_code; + private String return_msg; + private String appid; + private String mch_id; + private String sub_mch_id; + private String sign; + private String result_code; + private String transaction_id; + private String out_trade_no; + private String out_refund_no; + private String refund_id; + private String refund_channel; + private String refund_fee; + private String coupon_refund_fee; + private String total_fee; + private String cash_fee; + private String coupon_refund_count; + private String cash_refund_fee; + + public String getErr_code() { + return err_code; + } + + public void setErr_code(String err_code) { + this.err_code = err_code; + } + + public String getErr_code_des() { + return err_code_des; + } + + public void setErr_code_des(String err_code_des) { + this.err_code_des = err_code_des; + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getSub_mch_id() { + return sub_mch_id; + } + + public void setSub_mch_id(String sub_mch_id) { + this.sub_mch_id = sub_mch_id; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getTransaction_id() { + return transaction_id; + } + + public void setTransaction_id(String transaction_id) { + this.transaction_id = transaction_id; + } + + public String getOut_trade_no() { + return out_trade_no; + } + + public void setOut_trade_no(String out_trade_no) { + this.out_trade_no = out_trade_no; + } + + public String getOut_refund_no() { + return out_refund_no; + } + + public void setOut_refund_no(String out_refund_no) { + this.out_refund_no = out_refund_no; + } + + public String getRefund_id() { + return refund_id; + } + + public void setRefund_id(String refund_id) { + this.refund_id = refund_id; + } + + public String getRefund_channel() { + return refund_channel; + } + + public void setRefund_channel(String refund_channel) { + this.refund_channel = refund_channel; + } + + public String getRefund_fee() { + return refund_fee; + } + + public void setRefund_fee(String refund_fee) { + this.refund_fee = refund_fee; + } + + public String getCoupon_refund_fee() { + return coupon_refund_fee; + } + + public void setCoupon_refund_fee(String coupon_refund_fee) { + this.coupon_refund_fee = coupon_refund_fee; + } + + public String getTotal_fee() { + return total_fee; + } + + public void setTotal_fee(String total_fee) { + this.total_fee = total_fee; + } + + public String getCash_fee() { + return cash_fee; + } + + public void setCash_fee(String cash_fee) { + this.cash_fee = cash_fee; + } + + public String getCoupon_refund_count() { + return coupon_refund_count; + } + + public void setCoupon_refund_count(String coupon_refund_count) { + this.coupon_refund_count = coupon_refund_count; + } + + public String getCash_refund_fee() { + return cash_refund_fee; + } + + public void setCash_refund_fee(String cash_refund_fee) { + this.cash_refund_fee = cash_refund_fee; + } +} 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 e4fed8ea..a3d79cd6 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 @@ -194,7 +194,8 @@ public class GoodsOrderServiceImpl implements PayService { */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 - FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); + FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); + // FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java similarity index 61% rename from hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java rename to hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java index c91a282e..3e7aabc2 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/rechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java @@ -1,26 +1,11 @@ package com.hai.service.pay.impl; -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.WxUtils; -import com.hai.dao.HighUserCouponMapper; import com.hai.entity.*; -import com.hai.model.ResultProfitSharing; import com.hai.service.*; import com.hai.service.pay.PayService; -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.stereotype.Service; @@ -28,10 +13,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import javax.net.ssl.SSLContext; -import java.io.FileInputStream; import java.math.BigDecimal; -import java.security.KeyStore; import java.util.*; /** @@ -40,9 +22,9 @@ import java.util.*; * @Date: 2021/3/27 00:35 */ @Service("rechargeOrderService") -public class rechargeOrderServiceImpl implements PayService { +public class RechargeOrderServiceImpl implements PayService { - private static Logger log = LoggerFactory.getLogger(rechargeOrderServiceImpl.class); + private static Logger log = LoggerFactory.getLogger(RechargeOrderServiceImpl.class); @Resource private OutRechargeOrderService outRechargeOrderService; @@ -60,11 +42,11 @@ public class rechargeOrderServiceImpl implements PayService { if (order == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); } - if (order.getOrderStatus() == 1) { + if (order.getStatus() == 1) { order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 order.setPayTime(new Date()); // 支付时间 - order.setOrderStatus(2); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 + order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 outRechargeOrderService.updateOrder(order); } }