| @@ -56,8 +56,8 @@ public class WxPayOrder implements Serializable { | |||||
| /*用户ID**/ | /*用户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | ||||
| private Long cUserId; | private Long cUserId; | ||||
| /*支付IP**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付IP",name="ip") | |||||
| /*ip地址**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="ip地址",name="ip") | |||||
| private String ip; | private String ip; | ||||
| /*支付金额(分)**/ | /*支付金额(分)**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分)",name="payAmount") | @io.swagger.annotations.ApiModelProperty(value="支付金额(分)",name="payAmount") | ||||
| @@ -68,8 +68,11 @@ public class WxPayOrder implements Serializable { | |||||
| /*支付结束时间(秒)**/ | /*支付结束时间(秒)**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="支付结束时间(秒)",name="payTimeEnd") | @io.swagger.annotations.ApiModelProperty(value="支付结束时间(秒)",name="payTimeEnd") | ||||
| private Integer payTimeEnd; | private Integer payTimeEnd; | ||||
| /*支付渠道: 0-微信小程序 1--支付宝 2--银联 **/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道: 0-微信小程序 1--支付宝 2--银联 ",name="payVendor") | |||||
| /*微信生成的订单号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="微信生成的订单号",name="transactionId") | |||||
| private String transactionId; | |||||
| /*支付渠道: 0-微信 1-支付宝 2-银联 **/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道: 0-微信 1-支付宝 2-银联 ",name="payVendor") | |||||
| private Integer payVendor; | private Integer payVendor; | ||||
| /*支付订单号**/ | /*支付订单号**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="支付订单号",name="payOrderNo") | @io.swagger.annotations.ApiModelProperty(value="支付订单号",name="payOrderNo") | ||||
| @@ -110,15 +113,12 @@ public class WxPayOrder implements Serializable { | |||||
| public void setCUserId(Long _cUserId) { | public void setCUserId(Long _cUserId) { | ||||
| cUserId = _cUserId; | cUserId = _cUserId; | ||||
| } | } | ||||
| public String getIp() { | |||||
| public String getIp() { | |||||
| return ip; | return ip; | ||||
| } | } | ||||
| public void setIp(String _ip) { | public void setIp(String _ip) { | ||||
| this.ip = _ip; | |||||
| ip = _ip; | |||||
| } | } | ||||
| public Integer getPayAmount() { | public Integer getPayAmount() { | ||||
| return payAmount; | return payAmount; | ||||
| } | } | ||||
| @@ -137,6 +137,12 @@ public class WxPayOrder implements Serializable { | |||||
| public void setPayTimeEnd(Integer _payTimeEnd) { | public void setPayTimeEnd(Integer _payTimeEnd) { | ||||
| payTimeEnd = _payTimeEnd; | payTimeEnd = _payTimeEnd; | ||||
| } | } | ||||
| public String getTransactionId() { | |||||
| return transactionId; | |||||
| } | |||||
| public void setTransactionId(String _transactionId) { | |||||
| transactionId = _transactionId; | |||||
| } | |||||
| public Integer getPayVendor() { | public Integer getPayVendor() { | ||||
| return payVendor; | return payVendor; | ||||
| } | } | ||||
| @@ -172,10 +178,11 @@ public class WxPayOrder implements Serializable { | |||||
| ,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC") | ,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC") | ||||
| ,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC") | ,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC") | ||||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | ||||
| ,IP_ASC("`ip` ASC"),IP_DESC("`ip` DESC") | |||||
| ,Ip_ASC("`ip` ASC"),Ip_DESC("`ip` DESC") | |||||
| ,PayAmount_ASC("`payAmount` ASC"),PayAmount_DESC("`payAmount` DESC") | ,PayAmount_ASC("`payAmount` ASC"),PayAmount_DESC("`payAmount` DESC") | ||||
| ,PayTimeStart_ASC("`payTimeStart` ASC"),PayTimeStart_DESC("`payTimeStart` DESC") | ,PayTimeStart_ASC("`payTimeStart` ASC"),PayTimeStart_DESC("`payTimeStart` DESC") | ||||
| ,PayTimeEnd_ASC("`payTimeEnd` ASC"),PayTimeEnd_DESC("`payTimeEnd` DESC") | ,PayTimeEnd_ASC("`payTimeEnd` ASC"),PayTimeEnd_DESC("`payTimeEnd` DESC") | ||||
| ,TransactionId_ASC("`transactionId` ASC"),TransactionId_DESC("`transactionId` DESC") | |||||
| ,PayVendor_ASC("`payVendor` ASC"),PayVendor_DESC("`payVendor` DESC") | ,PayVendor_ASC("`payVendor` ASC"),PayVendor_DESC("`payVendor` DESC") | ||||
| ,PayOrderNo_ASC("`payOrderNo` ASC"),PayOrderNo_DESC("`payOrderNo` DESC") | ,PayOrderNo_ASC("`payOrderNo` ASC"),PayOrderNo_DESC("`payOrderNo` DESC") | ||||
| ,PayOrderStatus_ASC("`payOrderStatus` ASC"),PayOrderStatus_DESC("`payOrderStatus` DESC") | ,PayOrderStatus_ASC("`payOrderStatus` ASC"),PayOrderStatus_DESC("`payOrderStatus` DESC") | ||||
| @@ -16,7 +16,7 @@ public interface WxPayOrderService { | |||||
| */ | */ | ||||
| ResultData createPayOrder(WxPayOrder record, EnumPayWay payWay); | ResultData createPayOrder(WxPayOrder record, EnumPayWay payWay); | ||||
| void handleOrderPaySuccess(WxPayOrder record, String tradeNo); | |||||
| void handleOrderPaySuccess(WxPayOrder record, String transactionId); | |||||
| /** | /** | ||||
| * 异步通知 | * 异步通知 | ||||
| @@ -166,7 +166,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void handleOrderPaySuccess(WxPayOrder record, String tradeNo) { | |||||
| public void handleOrderPaySuccess(WxPayOrder record, String transactionId) { | |||||
| EnumPayStatus payStatus = EnumPayStatus.getEnum(record.getPayOrderStatus()); | EnumPayStatus payStatus = EnumPayStatus.getEnum(record.getPayOrderStatus()); | ||||
| // 判断支付状态 | // 判断支付状态 | ||||
| if (payStatus != EnumPayStatus.PAY_WAY_WAIT) { | if (payStatus != EnumPayStatus.PAY_WAY_WAIT) { | ||||
| @@ -190,7 +190,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| updatePayOrder.setOrderId(record.getOrderId()); | updatePayOrder.setOrderId(record.getOrderId()); | ||||
| updatePayOrder.setUpdateTime(currentDate); | updatePayOrder.setUpdateTime(currentDate); | ||||
| updatePayOrder.setPayOrderStatus(EnumPayStatus.PAY_WAY_SUCCESS.getCode()); | updatePayOrder.setPayOrderStatus(EnumPayStatus.PAY_WAY_SUCCESS.getCode()); | ||||
| //updatePayOrder.setTradeNo(tradeNo); | |||||
| updatePayOrder.setTransactionId(transactionId); | |||||
| wxPayOrderMapper.updateByPrimaryKeySelective(updatePayOrder); | wxPayOrderMapper.updateByPrimaryKeySelective(updatePayOrder); | ||||
| Map<String, String> msgMap = new HashMap<>(); | Map<String, String> msgMap = new HashMap<>(); | ||||
| @@ -199,6 +199,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| msgMap.put("orderNo", String.valueOf(order.getId())); | msgMap.put("orderNo", String.valueOf(order.getId())); | ||||
| msgMap.put("createTime", Utility.getDataFormatString3(order.getCreateDate())); | msgMap.put("createTime", Utility.getDataFormatString3(order.getCreateDate())); | ||||
| msgMap.put("standingTime", order.getCreateDate() + "-" + currentDate ); | msgMap.put("standingTime", order.getCreateDate() + "-" + currentDate ); | ||||
| // 短信 通知 商户 | |||||
| //smsSenderHandler.sendSms("SMS_18195394", order.getMobile(), msgMap); | //smsSenderHandler.sendSms("SMS_18195394", order.getMobile(), msgMap); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("pay success handle, sms send exception, payOrderi: " + updatePayOrder+ ", msgMap: " + msgMap.toString() + ", e: " + e.getMessage()); | logger.error("pay success handle, sms send exception, payOrderi: " + updatePayOrder+ ", msgMap: " + msgMap.toString() + ", e: " + e.getMessage()); | ||||
| @@ -12,6 +12,7 @@ | |||||
| <result column="pay_amount" jdbcType="INTEGER" property="payAmount" /> | <result column="pay_amount" jdbcType="INTEGER" property="payAmount" /> | ||||
| <result column="pay_time_start" jdbcType="INTEGER" property="payTimeStart" /> | <result column="pay_time_start" jdbcType="INTEGER" property="payTimeStart" /> | ||||
| <result column="pay_time_end" jdbcType="INTEGER" property="payTimeEnd" /> | <result column="pay_time_end" jdbcType="INTEGER" property="payTimeEnd" /> | ||||
| <result column="transaction_id" jdbcType="VARCHAR" property="transactionId" /> | |||||
| <result column="pay_vendor" jdbcType="INTEGER" property="payVendor" /> | <result column="pay_vendor" jdbcType="INTEGER" property="payVendor" /> | ||||
| <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo" /> | <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo" /> | ||||
| <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus" /> | <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus" /> | ||||
| @@ -19,7 +20,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`pay_amount`,`pay_time_start`,`pay_time_end`,`pay_vendor`,`pay_order_no`,`pay_order_status`,`fail_reason` | |||||
| `id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`ip`,`pay_amount`,`pay_time_start`,`pay_time_end`,`transaction_id`,`pay_vendor`,`pay_order_no`,`pay_order_status`,`fail_reason` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -53,12 +54,12 @@ | |||||
| <if test=" null != cUserId "> | <if test=" null != cUserId "> | ||||
| and `c_user_id` = #{cUserId} | and `c_user_id` = #{cUserId} | ||||
| </if> | |||||
| <if test=" null != ip "> | |||||
| and `ip` = #{ip} | |||||
| </if> | |||||
| </if> | |||||
| <if test=" null != ip "> | |||||
| and `ip` like concat('%', #{ip},'%') | |||||
| </if> | |||||
| <if test=" null != payAmount "> | <if test=" null != payAmount "> | ||||
| and `pay_amount` = #{payAmount} | and `pay_amount` = #{payAmount} | ||||
| @@ -75,6 +76,11 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != transactionId "> | |||||
| and `transaction_id` like concat('%', #{transactionId},'%') | |||||
| </if> | |||||
| <if test=" null != payVendor "> | <if test=" null != payVendor "> | ||||
| and `pay_vendor` = #{payVendor} | and `pay_vendor` = #{payVendor} | ||||