- 清理被错误提交的 target
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
swagger:
|
||||
enable: true
|
||||
title: 支付子系统
|
||||
description: 支付子系统
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.mall.pay.application.controller
|
||||
@@ -1,28 +0,0 @@
|
||||
spring:
|
||||
application:
|
||||
name: pay-application
|
||||
cloud:
|
||||
sentinel:
|
||||
transport:
|
||||
port: 8719
|
||||
dashboard: localhost:12088
|
||||
metric:
|
||||
charset: UTF-8
|
||||
eager: false
|
||||
|
||||
# server
|
||||
server:
|
||||
port: 18084
|
||||
servlet:
|
||||
context-path: /pay-api/
|
||||
|
||||
swagger:
|
||||
enable: false
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,env,metrics,prometheus
|
||||
metrics:
|
||||
enabled: true
|
||||
@@ -1,57 +0,0 @@
|
||||
package cn.iocoder.mall.pay.application.convert;
|
||||
|
||||
import cn.iocoder.mall.pay.api.bo.refund.PayRefundBO;
|
||||
import cn.iocoder.mall.pay.application.vo.admins.AdminsPayRefundDetailVO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2019-05-24T11:47:14+0800",
|
||||
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
|
||||
)
|
||||
public class PayRefundConvertImpl implements PayRefundConvert {
|
||||
|
||||
@Override
|
||||
public List<AdminsPayRefundDetailVO> convertList(List<PayRefundBO> refunds) {
|
||||
if ( refunds == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AdminsPayRefundDetailVO> list = new ArrayList<AdminsPayRefundDetailVO>( refunds.size() );
|
||||
for ( PayRefundBO payRefundBO : refunds ) {
|
||||
list.add( payRefundBOToAdminsPayRefundDetailVO( payRefundBO ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
protected AdminsPayRefundDetailVO payRefundBOToAdminsPayRefundDetailVO(PayRefundBO payRefundBO) {
|
||||
if ( payRefundBO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminsPayRefundDetailVO adminsPayRefundDetailVO = new AdminsPayRefundDetailVO();
|
||||
|
||||
adminsPayRefundDetailVO.setId( payRefundBO.getId() );
|
||||
adminsPayRefundDetailVO.setTransactionId( payRefundBO.getTransactionId() );
|
||||
adminsPayRefundDetailVO.setRefundCode( payRefundBO.getRefundCode() );
|
||||
adminsPayRefundDetailVO.setAppId( payRefundBO.getAppId() );
|
||||
adminsPayRefundDetailVO.setOrderId( payRefundBO.getOrderId() );
|
||||
adminsPayRefundDetailVO.setCreateIp( payRefundBO.getCreateIp() );
|
||||
adminsPayRefundDetailVO.setOrderDescription( payRefundBO.getOrderDescription() );
|
||||
adminsPayRefundDetailVO.setPrice( payRefundBO.getPrice() );
|
||||
adminsPayRefundDetailVO.setStatus( payRefundBO.getStatus() );
|
||||
adminsPayRefundDetailVO.setFinishTime( payRefundBO.getFinishTime() );
|
||||
adminsPayRefundDetailVO.setNotifyUrl( payRefundBO.getNotifyUrl() );
|
||||
adminsPayRefundDetailVO.setExtensionData( payRefundBO.getExtensionData() );
|
||||
adminsPayRefundDetailVO.setRefundChannel( payRefundBO.getRefundChannel() );
|
||||
adminsPayRefundDetailVO.setRefundTime( payRefundBO.getRefundTime() );
|
||||
adminsPayRefundDetailVO.setNotifyTime( payRefundBO.getNotifyTime() );
|
||||
adminsPayRefundDetailVO.setTradeNo( payRefundBO.getTradeNo() );
|
||||
adminsPayRefundDetailVO.setCreateTime( payRefundBO.getCreateTime() );
|
||||
|
||||
return adminsPayRefundDetailVO;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.88.14:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: ${MALL_MYSQL_PASSWORD}
|
||||
|
||||
# xxl-job
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://127.0.0.1:18079/
|
||||
executor:
|
||||
appname: pay-job-executor
|
||||
ip:
|
||||
port: 0
|
||||
logpath: /Users/yunai/logs/xxl-job/
|
||||
logretentiondays: 1
|
||||
accessToken:
|
||||
|
||||
# rocketmq
|
||||
rocketmq:
|
||||
name-server: 192.168.88.14:9876
|
||||
producer:
|
||||
group: pay-producer-group
|
||||
@@ -1 +0,0 @@
|
||||
##################### 业务模块 #####################
|
||||
@@ -1,41 +0,0 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://180.167.213.26:13306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: ${MALL_MYSQL_PASSWORD}
|
||||
|
||||
# mybatis
|
||||
mybatis-plus:
|
||||
config-location: classpath:mybatis-config.xml
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.pay.biz.dataobject
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
application:
|
||||
name: pay-service
|
||||
registry:
|
||||
address: zookeeper://127.0.0.1:2181
|
||||
protocol:
|
||||
port: -1
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.pay.biz.service
|
||||
provider:
|
||||
filter: -exception
|
||||
PayTransactionService:
|
||||
version: 1.0.0
|
||||
PayRefundService:
|
||||
version: 1.0.0
|
||||
|
||||
# rocketmq
|
||||
rocketmq:
|
||||
name-server: 127.0.0.1:9876
|
||||
producer:
|
||||
group: pay-producer-group
|
||||
|
||||
# seata
|
||||
seata:
|
||||
tx-service-group: my_test_tx_group
|
||||
@@ -1,69 +0,0 @@
|
||||
transport {
|
||||
# tcp udt unix-domain-socket
|
||||
type = "TCP"
|
||||
#NIO NATIVE
|
||||
server = "NIO"
|
||||
#enable heartbeat
|
||||
heartbeat = true
|
||||
#thread factory for netty
|
||||
thread-factory {
|
||||
boss-thread-prefix = "NettyBoss"
|
||||
worker-thread-prefix = "NettyServerNIOWorker"
|
||||
server-executor-thread-prefix = "NettyServerBizHandler"
|
||||
share-boss-worker = false
|
||||
client-selector-thread-prefix = "NettyClientSelector"
|
||||
client-selector-thread-size = 1
|
||||
client-worker-thread-prefix = "NettyClientWorkerThread"
|
||||
# netty boss thread size,will not be used for UDT
|
||||
boss-thread-size = 1
|
||||
#auto default pin or 8
|
||||
worker-thread-size = 8
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
#vgroup->rgroup
|
||||
vgroup_mapping.my_test_tx_group = "default"
|
||||
#only support single node
|
||||
default.grouplist = "180.167.213.26:8091"
|
||||
#degrade current not support
|
||||
enableDegrade = false
|
||||
#disable
|
||||
disable = false
|
||||
}
|
||||
|
||||
client {
|
||||
async.commit.buffer.limit = 10000
|
||||
lock {
|
||||
retry.internal = 10
|
||||
retry.times = 30
|
||||
}
|
||||
}
|
||||
## transaction log store
|
||||
store {
|
||||
## store mode: file、db
|
||||
mode = "file"
|
||||
|
||||
## file store
|
||||
file {
|
||||
dir = "file_store/data"
|
||||
|
||||
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
|
||||
max-branch-session-size = 16384
|
||||
# globe session size , if exceeded throws exceptions
|
||||
max-global-session-size = 512
|
||||
# file buffer size , if exceeded allocate new buffer
|
||||
file-write-buffer-cache-size = 16384
|
||||
# when recover batch read size
|
||||
session.reload.read_size = 100
|
||||
}
|
||||
|
||||
## database store
|
||||
db {
|
||||
driver_class = ""
|
||||
url = ""
|
||||
user = ""
|
||||
password = ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayAppMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, name, notify_url, refund_notify_url, status, create_time
|
||||
</sql>
|
||||
|
||||
<!--<insert id="insert" parameterType="RoleDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">-->
|
||||
<!--INSERT INTO role (-->
|
||||
<!--name, create_time, deleted-->
|
||||
<!--) VALUES (-->
|
||||
<!--#{name}, #{createTime}, #{deleted}-->
|
||||
<!--)-->
|
||||
<!--</insert>-->
|
||||
|
||||
<!--<update id="update" parameterType="RoleDO">-->
|
||||
<!--UPDATE role-->
|
||||
<!--<set>-->
|
||||
<!--<if test="name != null">-->
|
||||
<!--, name = #{name}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="deleted != null">-->
|
||||
<!--, deleted = #{deleted}-->
|
||||
<!--</if>-->
|
||||
<!--</set>-->
|
||||
<!--WHERE id = #{id}-->
|
||||
<!--</update>-->
|
||||
|
||||
<select id="selectById" parameterType="String" resultType="PayAppDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM app
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayNotifyLogMapper">
|
||||
|
||||
<!--<sql id="FIELDS">-->
|
||||
<!--id, transaction_id, transaction_extension_id, app_id, order_id,-->
|
||||
<!--status, next_notify_time, last_execute_time, notify_times, max_notify_times,-->
|
||||
<!--create_time-->
|
||||
<!--</sql>-->
|
||||
|
||||
<insert id="insert" parameterType="PayNotifyLogDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO notify_log (
|
||||
notify_id, request, response, status
|
||||
) VALUES (
|
||||
#{notifyId}, #{request}, #{response}, #{status}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!--<update id="update" parameterType="PayTransactionNotifyTaskDO">-->
|
||||
<!--UPDATE transaction_notify_task-->
|
||||
<!--<set>-->
|
||||
<!--<if test="status != null">-->
|
||||
<!--, status = #{status}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="nextNotifyTime != null">-->
|
||||
<!--, last_notify_time = #{nextNotifyTime}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="lastExecuteTime != null">-->
|
||||
<!--, last_execute_time = #{lastExecuteTime}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="notifyTimes != null">-->
|
||||
<!--, notify_times = #{notifyTimes}-->
|
||||
<!--</if>-->
|
||||
<!--</set>-->
|
||||
<!--WHERE id = #{id}-->
|
||||
<!--</update>-->
|
||||
|
||||
<!--<select id="selectByTransactionCode" parameterType="String" resultType="PayTransactionExtensionDO">-->
|
||||
<!--SELECT-->
|
||||
<!--<include refid="FIELDS"/>-->
|
||||
<!--FROM transaction_extension-->
|
||||
<!--WHERE transaction_code = #{transactionCode}-->
|
||||
<!--LIMIT 1-->
|
||||
<!--</select>-->
|
||||
|
||||
</mapper>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayNotifyTaskMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, app_id, type,
|
||||
status, next_notify_time, last_execute_time, notify_times, max_notify_times,
|
||||
create_time
|
||||
</sql>
|
||||
|
||||
<resultMap id="PayNotifyTaskResultMap" type="PayNotifyTaskDO">
|
||||
<result property="transaction" column="transaction"
|
||||
javaType="cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO$Transaction"
|
||||
typeHandler="cn.iocoder.common.framework.mybatis.JSONTypeHandler"/>
|
||||
<result property="refund" column="refund"
|
||||
javaType="cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO$Refund"
|
||||
typeHandler="cn.iocoder.common.framework.mybatis.JSONTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert" parameterType="PayNotifyTaskDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO notify_task (
|
||||
app_id, type,
|
||||
status, next_notify_time, notify_times, max_notify_times,
|
||||
`transaction`, refund
|
||||
) VALUES (
|
||||
#{appId}, #{type},
|
||||
#{status}, #{nextNotifyTime}, #{notifyTimes}, #{maxNotifyTimes},
|
||||
#{transaction, typeHandler=cn.iocoder.common.framework.mybatis.JSONTypeHandler},
|
||||
#{refund, typeHandler=cn.iocoder.common.framework.mybatis.JSONTypeHandler}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="PayNotifyTaskDO">
|
||||
UPDATE notify_task
|
||||
<set>
|
||||
<if test="status != null">
|
||||
, status = #{status}
|
||||
</if>
|
||||
<if test="nextNotifyTime != null">
|
||||
, next_notify_time = #{nextNotifyTime}
|
||||
</if>
|
||||
<if test="lastExecuteTime != null">
|
||||
, last_execute_time = #{lastExecuteTime}
|
||||
</if>
|
||||
<if test="notifyTimes != null">
|
||||
, notify_times = #{notifyTimes}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectByNotify" resultMap="PayNotifyTaskResultMap">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM notify_task
|
||||
WHERE status IN (1, 4, 5)
|
||||
AND next_notify_time <![CDATA[ <= ]]> NOW()
|
||||
AND last_execute_time > next_notify_time
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,122 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayRefundMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, transaction_id, refund_code, app_id, create_ip, order_id,
|
||||
order_description, price, status,
|
||||
finish_time, notify_url, extension_data, refund_channel, refund_time, notify_time,
|
||||
trade_no, create_time
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="PayRefundDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO refund (
|
||||
transaction_id, refund_code, app_id, create_ip, order_id,
|
||||
order_description, price, status,
|
||||
finish_time, notify_url, extension_data, refund_channel, refund_time, notify_time,
|
||||
trade_no, create_time
|
||||
) VALUES (
|
||||
#{transactionId}, #{refundCode}, #{appId}, #{createIp}, #{orderId},
|
||||
#{orderDescription}, #{price}, #{status},
|
||||
#{finishTime}, #{notifyUrl}, #{extensionData}, #{refundChannel}, #{refundTime}, #{notifyTime},
|
||||
#{tradeNo}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE refund
|
||||
<set>
|
||||
<if test="entity.status != null">
|
||||
, status = #{entity.status}
|
||||
</if>
|
||||
<if test="entity.finishTime != null">
|
||||
, finish_time = #{entity.finishTime}
|
||||
</if>
|
||||
<if test="entity.extensionData != null">
|
||||
, extension_data = #{entity.extensionData}
|
||||
</if>
|
||||
<if test="entity.refundTime != null">
|
||||
, refund_time = #{entity.refundTime}
|
||||
</if>
|
||||
<if test="entity.notifyTime != null">
|
||||
, notify_time = #{entity.notifyTime}
|
||||
</if>
|
||||
<if test="entity.tradeNo != null">
|
||||
, trade_no = #{entity.tradeNo}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{entity.id}
|
||||
<if test="whereStatus != null">
|
||||
AND status = #{whereStatus}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<select id="selectByRefundCode" parameterType="String" resultType="PayRefundDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM refund
|
||||
WHERE refund_code = #{refundCode}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="PayRefundDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM refund
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectListByPage" resultType="PayRefundDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM refund
|
||||
<where>
|
||||
<if test="createBeginTime != null">
|
||||
AND create_time >= #{createBeginTime}
|
||||
</if>
|
||||
<if test="createEndTime != null">
|
||||
AND #{createEndTime} >= create_time
|
||||
</if>
|
||||
<if test="finishBeginTime != null">
|
||||
AND finish_time >= #{finishBeginTime}
|
||||
</if>
|
||||
<if test="finishEndTime != null">
|
||||
AND #{finishEndTime} >= finish_time
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="payChannel != null">
|
||||
AND pay_channel = #{payChannel}
|
||||
</if>
|
||||
</where>
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByPage" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM refund
|
||||
<where>
|
||||
<if test="createBeginTime != null">
|
||||
AND create_time >= #{createBeginTime}
|
||||
</if>
|
||||
<if test="createEndTime != null">
|
||||
AND #{createEndTime} >= create_time
|
||||
</if>
|
||||
<if test="finishBeginTime != null">
|
||||
AND finish_time >= #{finishBeginTime}
|
||||
</if>
|
||||
<if test="finishEndTime != null">
|
||||
AND #{finishEndTime} >= finish_time
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="payChannel != null">
|
||||
AND pay_channel = #{payChannel}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayTransactionExtensionMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, transaction_id, pay_channel, transaction_code, extension_data,
|
||||
create_ip, status, create_time
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="PayTransactionExtensionDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO transaction_extension (
|
||||
transaction_id, pay_channel, transaction_code, extension_data,
|
||||
create_ip, status
|
||||
) VALUES (
|
||||
#{transactionId}, #{payChannel}, #{transactionCode}, #{extensionData},
|
||||
#{createIp}, #{status}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE transaction_extension
|
||||
<set>
|
||||
<if test="entity.extensionData != null">
|
||||
, extension_data = #{entity.extensionData}
|
||||
</if>
|
||||
<if test="entity.status != null">
|
||||
, status = #{entity.status}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{entity.id}
|
||||
<if test="whereStatus != null">
|
||||
AND status = #{whereStatus}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<select id="selectByTransactionCode" parameterType="String" resultType="PayTransactionExtensionDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM transaction_extension
|
||||
WHERE transaction_code = #{transactionCode}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="PayTransactionExtensionDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM transaction_extension
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,159 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.pay.biz.dao.PayTransactionMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, app_id, create_ip, order_id, order_subject,
|
||||
order_description, order_memo, price, status, expire_time,
|
||||
finish_time, notify_url, extension_id, pay_channel, payment_time,
|
||||
notify_time, trade_no, refund_total, create_time
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="PayTransactionDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO transaction (
|
||||
app_id, create_ip, order_id, order_subject,
|
||||
order_description, order_memo, price, status, expire_time,
|
||||
finish_time, notify_url, extension_id, pay_channel, payment_time,
|
||||
notify_time, trade_no, create_time
|
||||
) VALUES (
|
||||
#{appId}, #{createIp}, #{orderId}, #{orderSubject},
|
||||
#{orderDescription}, #{orderMemo}, #{price}, #{status}, #{expireTime},
|
||||
#{finishTime}, #{notifyUrl}, #{extensionId}, #{payChannel}, #{paymentTime},
|
||||
#{notifyTime}, #{tradeNo}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE transaction
|
||||
<set>
|
||||
<if test="entity.status != null">
|
||||
, status = #{entity.status}
|
||||
</if>
|
||||
<if test="entity.extensionId != null">
|
||||
, extension_id = #{entity.extensionId}
|
||||
</if>
|
||||
<if test="entity.payChannel != null">
|
||||
, pay_channel = #{entity.payChannel}
|
||||
</if>
|
||||
<if test="entity.paymentTime != null">
|
||||
, payment_time = #{entity.paymentTime}
|
||||
</if>
|
||||
<if test="entity.finishTime != null">
|
||||
, finish_time = #{entity.finishTime}
|
||||
</if>
|
||||
<if test="entity.notifyTime != null">
|
||||
, notify_time = #{entity.notifyTime}
|
||||
</if>
|
||||
<if test="entity.tradeNo != null">
|
||||
, trade_no = #{entity.tradeNo}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{entity.id}
|
||||
<if test="whereStatus != null">
|
||||
AND status = #{whereStatus}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="updateForRefundTotal">
|
||||
UPDATE `transaction`
|
||||
SET refund_total = refund_total + ${refundTotalIncr}
|
||||
WHERE price >= refund_total + ${refundTotalIncr}
|
||||
</update>
|
||||
|
||||
<select id="selectByAppIdAndOrderId" resultType="PayTransactionDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM transaction
|
||||
WHERE app_id = #{appId}
|
||||
AND order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="PayTransactionDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM transaction
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectListByIds" resultType="PayTransactionDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM transaction
|
||||
WHERE id IN
|
||||
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectListByPage" resultType="PayTransactionDO">
|
||||
SELECT
|
||||
<include refid="FIELDS"/>
|
||||
FROM transaction
|
||||
<where>
|
||||
<if test="createBeginTime != null">
|
||||
AND create_time >= #{createBeginTime}
|
||||
</if>
|
||||
<if test="createEndTime != null">
|
||||
AND #{createEndTime} >= create_time
|
||||
</if>
|
||||
<if test="paymentBeginTime != null">
|
||||
AND payment_time >= #{paymentBeginTime}
|
||||
</if>
|
||||
<if test="paymentEndTime != null">
|
||||
AND #{paymentEndTime} >= payment_time
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="hasRefund == true">
|
||||
AND refund_total > 0
|
||||
</if>
|
||||
<if test="hasRefund == false">
|
||||
AND refund_total = 0
|
||||
</if>
|
||||
<if test="payChannel != null">
|
||||
AND pay_channel = #{payChannel}
|
||||
</if>
|
||||
<if test="orderSubject != null">
|
||||
order_subject LIKE "%"#{orderSubject}"%"
|
||||
</if>
|
||||
</where>
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByPage" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM transaction
|
||||
<where>
|
||||
<if test="createBeginTime != null">
|
||||
AND create_time >= #{createBeginTime}
|
||||
</if>
|
||||
<if test="createEndTime != null">
|
||||
AND #{createEndTime} >= create_time
|
||||
</if>
|
||||
<if test="paymentBeginTime != null">
|
||||
AND payment_time >= #{paymentBeginTime}
|
||||
</if>
|
||||
<if test="paymentEndTime != null">
|
||||
AND #{paymentEndTime} >= payment_time
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="hasRefund == true">
|
||||
AND refund_total > 0
|
||||
</if>
|
||||
<if test="hasRefund == false">
|
||||
AND refund_total = 0
|
||||
</if>
|
||||
<if test="payChannel != null">
|
||||
AND pay_channel = #{payChannel}
|
||||
</if>
|
||||
<if test="orderSubject != null">
|
||||
order_subject LIKE "%"#{orderSubject}"%"
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
|
||||
<settings>
|
||||
<!-- 使用驼峰命名法转换字段。 -->
|
||||
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||
</settings>
|
||||
|
||||
<typeAliases>
|
||||
<typeAlias alias="Integer" type="java.lang.Integer"/>
|
||||
<typeAlias alias="Long" type="java.lang.Long"/>
|
||||
<typeAlias alias="HashMap" type="java.util.HashMap"/>
|
||||
<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap"/>
|
||||
<typeAlias alias="ArrayList" type="java.util.ArrayList"/>
|
||||
<typeAlias alias="LinkedList" type="java.util.LinkedList"/>
|
||||
</typeAliases>
|
||||
|
||||
</configuration>
|
||||
@@ -1,14 +0,0 @@
|
||||
registry {
|
||||
type = "file"
|
||||
|
||||
file {
|
||||
name = "file.conf"
|
||||
}
|
||||
|
||||
zk {
|
||||
cluster = "default"
|
||||
serverAddr = "192.168.88.10:2181"
|
||||
session.timeout = 6000
|
||||
connect.timeout = 2000
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package cn.iocoder.mall.pay.biz.convert;
|
||||
|
||||
import cn.iocoder.mall.pay.api.message.PayRefundSuccessMessage;
|
||||
import cn.iocoder.mall.pay.api.message.PayTransactionSuccessMessage;
|
||||
import cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO;
|
||||
import cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO.Refund;
|
||||
import cn.iocoder.mall.pay.biz.dataobject.PayNotifyTaskDO.Transaction;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2019-05-24T11:39:00+0800",
|
||||
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
|
||||
)
|
||||
public class PayNotifyConvertImpl implements PayNotifyConvert {
|
||||
|
||||
@Override
|
||||
public PayTransactionSuccessMessage convertTransaction(PayNotifyTaskDO payTransactionNotifyTaskDO) {
|
||||
if ( payTransactionNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayTransactionSuccessMessage payTransactionSuccessMessage = new PayTransactionSuccessMessage();
|
||||
|
||||
payTransactionSuccessMessage.setOrderId( payTransactionNotifyTaskDOTransactionOrderId( payTransactionNotifyTaskDO ) );
|
||||
payTransactionSuccessMessage.setTransactionId( payTransactionNotifyTaskDOTransactionTransactionId( payTransactionNotifyTaskDO ) );
|
||||
payTransactionSuccessMessage.setId( payTransactionNotifyTaskDO.getId() );
|
||||
payTransactionSuccessMessage.setAppId( payTransactionNotifyTaskDO.getAppId() );
|
||||
payTransactionSuccessMessage.setNotifyTimes( payTransactionNotifyTaskDO.getNotifyTimes() );
|
||||
payTransactionSuccessMessage.setNotifyUrl( payTransactionNotifyTaskDO.getNotifyUrl() );
|
||||
|
||||
return payTransactionSuccessMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayRefundSuccessMessage convertRefund(PayNotifyTaskDO payTransactionNotifyTaskDO) {
|
||||
if ( payTransactionNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayRefundSuccessMessage payRefundSuccessMessage = new PayRefundSuccessMessage();
|
||||
|
||||
payRefundSuccessMessage.setOrderId( payTransactionNotifyTaskDORefundOrderId( payTransactionNotifyTaskDO ) );
|
||||
payRefundSuccessMessage.setTransactionId( payTransactionNotifyTaskDORefundTransactionId( payTransactionNotifyTaskDO ) );
|
||||
payRefundSuccessMessage.setRefundId( payTransactionNotifyTaskDORefundRefundId( payTransactionNotifyTaskDO ) );
|
||||
payRefundSuccessMessage.setId( payTransactionNotifyTaskDO.getId() );
|
||||
payRefundSuccessMessage.setAppId( payTransactionNotifyTaskDO.getAppId() );
|
||||
payRefundSuccessMessage.setNotifyTimes( payTransactionNotifyTaskDO.getNotifyTimes() );
|
||||
payRefundSuccessMessage.setNotifyUrl( payTransactionNotifyTaskDO.getNotifyUrl() );
|
||||
|
||||
return payRefundSuccessMessage;
|
||||
}
|
||||
|
||||
private String payTransactionNotifyTaskDOTransactionOrderId(PayNotifyTaskDO payNotifyTaskDO) {
|
||||
if ( payNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
Transaction transaction = payNotifyTaskDO.getTransaction();
|
||||
if ( transaction == null ) {
|
||||
return null;
|
||||
}
|
||||
String orderId = transaction.getOrderId();
|
||||
if ( orderId == null ) {
|
||||
return null;
|
||||
}
|
||||
return orderId;
|
||||
}
|
||||
|
||||
private Integer payTransactionNotifyTaskDOTransactionTransactionId(PayNotifyTaskDO payNotifyTaskDO) {
|
||||
if ( payNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
Transaction transaction = payNotifyTaskDO.getTransaction();
|
||||
if ( transaction == null ) {
|
||||
return null;
|
||||
}
|
||||
Integer transactionId = transaction.getTransactionId();
|
||||
if ( transactionId == null ) {
|
||||
return null;
|
||||
}
|
||||
return transactionId;
|
||||
}
|
||||
|
||||
private String payTransactionNotifyTaskDORefundOrderId(PayNotifyTaskDO payNotifyTaskDO) {
|
||||
if ( payNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
Refund refund = payNotifyTaskDO.getRefund();
|
||||
if ( refund == null ) {
|
||||
return null;
|
||||
}
|
||||
String orderId = refund.getOrderId();
|
||||
if ( orderId == null ) {
|
||||
return null;
|
||||
}
|
||||
return orderId;
|
||||
}
|
||||
|
||||
private Integer payTransactionNotifyTaskDORefundTransactionId(PayNotifyTaskDO payNotifyTaskDO) {
|
||||
if ( payNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
Refund refund = payNotifyTaskDO.getRefund();
|
||||
if ( refund == null ) {
|
||||
return null;
|
||||
}
|
||||
Integer transactionId = refund.getTransactionId();
|
||||
if ( transactionId == null ) {
|
||||
return null;
|
||||
}
|
||||
return transactionId;
|
||||
}
|
||||
|
||||
private Integer payTransactionNotifyTaskDORefundRefundId(PayNotifyTaskDO payNotifyTaskDO) {
|
||||
if ( payNotifyTaskDO == null ) {
|
||||
return null;
|
||||
}
|
||||
Refund refund = payNotifyTaskDO.getRefund();
|
||||
if ( refund == null ) {
|
||||
return null;
|
||||
}
|
||||
Integer refundId = refund.getRefundId();
|
||||
if ( refundId == null ) {
|
||||
return null;
|
||||
}
|
||||
return refundId;
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package cn.iocoder.mall.pay.biz.convert;
|
||||
|
||||
import cn.iocoder.mall.pay.api.bo.refund.PayRefundBO;
|
||||
import cn.iocoder.mall.pay.api.dto.refund.PayRefundSubmitDTO;
|
||||
import cn.iocoder.mall.pay.biz.dataobject.PayRefundDO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2019-05-24T11:39:00+0800",
|
||||
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
|
||||
)
|
||||
public class PayRefundConvertImpl implements PayRefundConvert {
|
||||
|
||||
@Override
|
||||
public PayRefundDO convert(PayRefundSubmitDTO payRefundSubmitDTO) {
|
||||
if ( payRefundSubmitDTO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayRefundDO payRefundDO = new PayRefundDO();
|
||||
|
||||
payRefundDO.setAppId( payRefundSubmitDTO.getAppId() );
|
||||
payRefundDO.setOrderId( payRefundSubmitDTO.getOrderId() );
|
||||
payRefundDO.setCreateIp( payRefundSubmitDTO.getCreateIp() );
|
||||
payRefundDO.setOrderDescription( payRefundSubmitDTO.getOrderDescription() );
|
||||
payRefundDO.setPrice( payRefundSubmitDTO.getPrice() );
|
||||
|
||||
return payRefundDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayRefundBO convert(PayRefundDO refund) {
|
||||
if ( refund == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayRefundBO payRefundBO = new PayRefundBO();
|
||||
|
||||
payRefundBO.setId( refund.getId() );
|
||||
payRefundBO.setTransactionId( refund.getTransactionId() );
|
||||
payRefundBO.setRefundCode( refund.getRefundCode() );
|
||||
payRefundBO.setAppId( refund.getAppId() );
|
||||
payRefundBO.setOrderId( refund.getOrderId() );
|
||||
payRefundBO.setCreateIp( refund.getCreateIp() );
|
||||
payRefundBO.setOrderDescription( refund.getOrderDescription() );
|
||||
payRefundBO.setPrice( refund.getPrice() );
|
||||
payRefundBO.setStatus( refund.getStatus() );
|
||||
payRefundBO.setFinishTime( refund.getFinishTime() );
|
||||
payRefundBO.setNotifyUrl( refund.getNotifyUrl() );
|
||||
payRefundBO.setExtensionData( refund.getExtensionData() );
|
||||
payRefundBO.setRefundChannel( refund.getRefundChannel() );
|
||||
payRefundBO.setRefundTime( refund.getRefundTime() );
|
||||
payRefundBO.setNotifyTime( refund.getNotifyTime() );
|
||||
payRefundBO.setTradeNo( refund.getTradeNo() );
|
||||
payRefundBO.setCreateTime( refund.getCreateTime() );
|
||||
|
||||
return payRefundBO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PayRefundBO> convertList(List<PayRefundDO> refunds) {
|
||||
if ( refunds == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<PayRefundBO> list = new ArrayList<PayRefundBO>( refunds.size() );
|
||||
for ( PayRefundDO payRefundDO : refunds ) {
|
||||
list.add( convert( payRefundDO ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package cn.iocoder.mall.pay.biz.convert;
|
||||
|
||||
import cn.iocoder.mall.pay.api.bo.transaction.PayTransactionBO;
|
||||
import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionCreateDTO;
|
||||
import cn.iocoder.mall.pay.api.dto.transaction.PayTransactionSubmitDTO;
|
||||
import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO;
|
||||
import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2019-05-24T11:39:00+0800",
|
||||
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
|
||||
)
|
||||
public class PayTransactionConvertImpl implements PayTransactionConvert {
|
||||
|
||||
@Override
|
||||
public PayTransactionDO convert(PayTransactionCreateDTO payTransactionCreateDTO) {
|
||||
if ( payTransactionCreateDTO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayTransactionDO payTransactionDO = new PayTransactionDO();
|
||||
|
||||
payTransactionDO.setAppId( payTransactionCreateDTO.getAppId() );
|
||||
payTransactionDO.setOrderId( payTransactionCreateDTO.getOrderId() );
|
||||
payTransactionDO.setCreateIp( payTransactionCreateDTO.getCreateIp() );
|
||||
payTransactionDO.setOrderSubject( payTransactionCreateDTO.getOrderSubject() );
|
||||
payTransactionDO.setOrderDescription( payTransactionCreateDTO.getOrderDescription() );
|
||||
payTransactionDO.setOrderMemo( payTransactionCreateDTO.getOrderMemo() );
|
||||
payTransactionDO.setPrice( payTransactionCreateDTO.getPrice() );
|
||||
payTransactionDO.setExpireTime( payTransactionCreateDTO.getExpireTime() );
|
||||
|
||||
return payTransactionDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayTransactionBO convert(PayTransactionDO payTransactionDO) {
|
||||
if ( payTransactionDO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayTransactionBO payTransactionBO = new PayTransactionBO();
|
||||
|
||||
payTransactionBO.setId( payTransactionDO.getId() );
|
||||
payTransactionBO.setAppId( payTransactionDO.getAppId() );
|
||||
payTransactionBO.setCreateIp( payTransactionDO.getCreateIp() );
|
||||
payTransactionBO.setOrderId( payTransactionDO.getOrderId() );
|
||||
payTransactionBO.setOrderSubject( payTransactionDO.getOrderSubject() );
|
||||
payTransactionBO.setOrderDescription( payTransactionDO.getOrderDescription() );
|
||||
payTransactionBO.setOrderMemo( payTransactionDO.getOrderMemo() );
|
||||
payTransactionBO.setPrice( payTransactionDO.getPrice() );
|
||||
payTransactionBO.setStatus( payTransactionDO.getStatus() );
|
||||
payTransactionBO.setExpireTime( payTransactionDO.getExpireTime() );
|
||||
payTransactionBO.setFinishTime( payTransactionDO.getFinishTime() );
|
||||
payTransactionBO.setExtensionId( payTransactionDO.getExtensionId() );
|
||||
payTransactionBO.setPayChannel( payTransactionDO.getPayChannel() );
|
||||
payTransactionBO.setPaymentTime( payTransactionDO.getPaymentTime() );
|
||||
payTransactionBO.setNotifyTime( payTransactionDO.getNotifyTime() );
|
||||
payTransactionBO.setTradeNo( payTransactionDO.getTradeNo() );
|
||||
payTransactionBO.setCreateTime( payTransactionDO.getCreateTime() );
|
||||
payTransactionBO.setRefundTotal( payTransactionDO.getRefundTotal() );
|
||||
|
||||
return payTransactionBO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PayTransactionBO> convertList(List<PayTransactionDO> list) {
|
||||
if ( list == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<PayTransactionBO> list1 = new ArrayList<PayTransactionBO>( list.size() );
|
||||
for ( PayTransactionDO payTransactionDO : list ) {
|
||||
list1.add( convert( payTransactionDO ) );
|
||||
}
|
||||
|
||||
return list1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayTransactionExtensionDO convert(PayTransactionSubmitDTO payTransactionSubmitDTO) {
|
||||
if ( payTransactionSubmitDTO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PayTransactionExtensionDO payTransactionExtensionDO = new PayTransactionExtensionDO();
|
||||
|
||||
payTransactionExtensionDO.setPayChannel( payTransactionSubmitDTO.getPayChannel() );
|
||||
payTransactionExtensionDO.setCreateIp( payTransactionSubmitDTO.getCreateIp() );
|
||||
|
||||
return payTransactionExtensionDO;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user