'提交代码'

dev-discount
= 4 years ago
parent 59dcfb42c5
commit f67c6dd39d
  1. 38
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  2. 2
      hai-cweb/src/main/resources/dev/application.yml
  3. 418
      hai-service/src/main/java/com/hai/dao/OutRechargeOrder.java
  4. 1704
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderExample.java
  5. 10
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java
  6. 28
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java
  7. 36
      hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
  8. 130
      hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java
  9. 186
      hai-service/src/main/java/com/hai/model/OrderRefundModel.java
  10. 3
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  11. 26
      hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.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<String,String> 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);

@ -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

@ -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();
}
}

@ -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<OutRechargeOrder> 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}"
})

@ -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}");
}

@ -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("]");

@ -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<Date> values) {
addCriterion("refund_time in", values, "refundTime");
return (Criteria) this;
}
public Criteria andRefundTimeNotIn(List<Date> 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<String> values) {
addCriterion("refund_id in", values, "refundId");
return (Criteria) this;
}
public Criteria andRefundIdNotIn(List<String> 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;

@ -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;
}
}

@ -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 {

@ -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);
}
}
Loading…
Cancel
Save