提交 1749ccbe authored 作者: YunaiV's avatar YunaiV

- 清理被错误提交的 target

上级 92d8eec7
...@@ -69,4 +69,5 @@ functions/mock ...@@ -69,4 +69,5 @@ functions/mock
# screenshot # screenshot
screenshot screenshot
.firebase .firebase
\ No newline at end of file sessionStore
swagger:
enable: true
title: 支付子系统
description: 支付子系统
version: 1.0.0
base-package: cn.iocoder.mall.pay.application.controller
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
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;
}
}
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
##################### 业务模块 #####################
\ No newline at end of file
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
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 = ""
}
}
<?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>
<?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>
<?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>
<?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>
<?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>
<?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>
<?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>
\ No newline at end of file
registry {
type = "file"
file {
name = "file.conf"
}
zk {
cluster = "default"
serverAddr = "192.168.88.10:2181"
session.timeout = 6000
connect.timeout = 2000
}
}
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;
}
}
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;
}
}
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;
}
}
swagger:
enable: true
title: 商品子系统
description: 商品子系统
version: 1.0.0
base-package: cn.iocoder.mall.product.application.controller
spring:
application:
name: product-application
cloud:
sentinel:
transport:
port: 8719
dashboard: localhost:12088
metric:
charset: UTF-8
eager: false
# server
server:
port: 18081
servlet:
context-path: /product-api/
management:
endpoints:
web:
exposure:
include: health,info,env,metrics,prometheus
metrics:
enabled: true
swagger:
enable: true
title: 商品子系统
description: 商品子系统
version: 1.0.0
base-package: cn.iocoder.mall.product.application.controller
\ No newline at end of file
package cn.iocoder.mall.product.application.convert;
import cn.iocoder.mall.product.api.bo.ProductAttrBO;
import cn.iocoder.mall.product.api.bo.ProductAttrDetailBO;
import cn.iocoder.mall.product.api.bo.ProductAttrPageBO;
import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO;
import cn.iocoder.mall.product.api.bo.ProductAttrValueBO;
import cn.iocoder.mall.product.api.bo.ProductAttrValueDetailBO;
import cn.iocoder.mall.product.api.bo.ProductAttrValueSimpleBO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrDetailVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueDetailVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueSimpleVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:47:10+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductAttrConvertImpl implements ProductAttrConvert {
@Override
public AdminsProductAttrPageVO convert2(ProductAttrPageBO result) {
if ( result == null ) {
return null;
}
AdminsProductAttrPageVO adminsProductAttrPageVO = new AdminsProductAttrPageVO();
adminsProductAttrPageVO.setAttrs( productAttrDetailBOListToAdminsProductAttrDetailVOList( result.getAttrs() ) );
adminsProductAttrPageVO.setCount( result.getCount() );
return adminsProductAttrPageVO;
}
@Override
public List<AdminsProductAttrSimpleVO> convert(List<ProductAttrSimpleBO> result) {
if ( result == null ) {
return null;
}
List<AdminsProductAttrSimpleVO> list = new ArrayList<AdminsProductAttrSimpleVO>( result.size() );
for ( ProductAttrSimpleBO productAttrSimpleBO : result ) {
list.add( productAttrSimpleBOToAdminsProductAttrSimpleVO( productAttrSimpleBO ) );
}
return list;
}
@Override
public AdminsProductAttrVO convert3(ProductAttrBO productAttrBO) {
if ( productAttrBO == null ) {
return null;
}
AdminsProductAttrVO adminsProductAttrVO = new AdminsProductAttrVO();
adminsProductAttrVO.setId( productAttrBO.getId() );
adminsProductAttrVO.setName( productAttrBO.getName() );
adminsProductAttrVO.setStatus( productAttrBO.getStatus() );
adminsProductAttrVO.setCreateTime( productAttrBO.getCreateTime() );
return adminsProductAttrVO;
}
@Override
public AdminsProductAttrValueVO convert4(ProductAttrValueBO productAttrValueBO) {
if ( productAttrValueBO == null ) {
return null;
}
AdminsProductAttrValueVO adminsProductAttrValueVO = new AdminsProductAttrValueVO();
adminsProductAttrValueVO.setId( productAttrValueBO.getId() );
adminsProductAttrValueVO.setAttrId( productAttrValueBO.getAttrId() );
adminsProductAttrValueVO.setName( productAttrValueBO.getName() );
adminsProductAttrValueVO.setStatus( productAttrValueBO.getStatus() );
adminsProductAttrValueVO.setCreateTime( productAttrValueBO.getCreateTime() );
return adminsProductAttrValueVO;
}
protected AdminsProductAttrValueDetailVO productAttrValueDetailBOToAdminsProductAttrValueDetailVO(ProductAttrValueDetailBO productAttrValueDetailBO) {
if ( productAttrValueDetailBO == null ) {
return null;
}
AdminsProductAttrValueDetailVO adminsProductAttrValueDetailVO = new AdminsProductAttrValueDetailVO();
adminsProductAttrValueDetailVO.setId( productAttrValueDetailBO.getId() );
adminsProductAttrValueDetailVO.setName( productAttrValueDetailBO.getName() );
adminsProductAttrValueDetailVO.setStatus( productAttrValueDetailBO.getStatus() );
adminsProductAttrValueDetailVO.setCreateTime( productAttrValueDetailBO.getCreateTime() );
return adminsProductAttrValueDetailVO;
}
protected List<AdminsProductAttrValueDetailVO> productAttrValueDetailBOListToAdminsProductAttrValueDetailVOList(List<ProductAttrValueDetailBO> list) {
if ( list == null ) {
return null;
}
List<AdminsProductAttrValueDetailVO> list1 = new ArrayList<AdminsProductAttrValueDetailVO>( list.size() );
for ( ProductAttrValueDetailBO productAttrValueDetailBO : list ) {
list1.add( productAttrValueDetailBOToAdminsProductAttrValueDetailVO( productAttrValueDetailBO ) );
}
return list1;
}
protected AdminsProductAttrDetailVO productAttrDetailBOToAdminsProductAttrDetailVO(ProductAttrDetailBO productAttrDetailBO) {
if ( productAttrDetailBO == null ) {
return null;
}
AdminsProductAttrDetailVO adminsProductAttrDetailVO = new AdminsProductAttrDetailVO();
adminsProductAttrDetailVO.setId( productAttrDetailBO.getId() );
adminsProductAttrDetailVO.setName( productAttrDetailBO.getName() );
adminsProductAttrDetailVO.setStatus( productAttrDetailBO.getStatus() );
adminsProductAttrDetailVO.setCreateTime( productAttrDetailBO.getCreateTime() );
adminsProductAttrDetailVO.setValues( productAttrValueDetailBOListToAdminsProductAttrValueDetailVOList( productAttrDetailBO.getValues() ) );
return adminsProductAttrDetailVO;
}
protected List<AdminsProductAttrDetailVO> productAttrDetailBOListToAdminsProductAttrDetailVOList(List<ProductAttrDetailBO> list) {
if ( list == null ) {
return null;
}
List<AdminsProductAttrDetailVO> list1 = new ArrayList<AdminsProductAttrDetailVO>( list.size() );
for ( ProductAttrDetailBO productAttrDetailBO : list ) {
list1.add( productAttrDetailBOToAdminsProductAttrDetailVO( productAttrDetailBO ) );
}
return list1;
}
protected AdminsProductAttrValueSimpleVO productAttrValueSimpleBOToAdminsProductAttrValueSimpleVO(ProductAttrValueSimpleBO productAttrValueSimpleBO) {
if ( productAttrValueSimpleBO == null ) {
return null;
}
AdminsProductAttrValueSimpleVO adminsProductAttrValueSimpleVO = new AdminsProductAttrValueSimpleVO();
adminsProductAttrValueSimpleVO.setId( productAttrValueSimpleBO.getId() );
adminsProductAttrValueSimpleVO.setName( productAttrValueSimpleBO.getName() );
return adminsProductAttrValueSimpleVO;
}
protected List<AdminsProductAttrValueSimpleVO> productAttrValueSimpleBOListToAdminsProductAttrValueSimpleVOList(List<ProductAttrValueSimpleBO> list) {
if ( list == null ) {
return null;
}
List<AdminsProductAttrValueSimpleVO> list1 = new ArrayList<AdminsProductAttrValueSimpleVO>( list.size() );
for ( ProductAttrValueSimpleBO productAttrValueSimpleBO : list ) {
list1.add( productAttrValueSimpleBOToAdminsProductAttrValueSimpleVO( productAttrValueSimpleBO ) );
}
return list1;
}
protected AdminsProductAttrSimpleVO productAttrSimpleBOToAdminsProductAttrSimpleVO(ProductAttrSimpleBO productAttrSimpleBO) {
if ( productAttrSimpleBO == null ) {
return null;
}
AdminsProductAttrSimpleVO adminsProductAttrSimpleVO = new AdminsProductAttrSimpleVO();
adminsProductAttrSimpleVO.setId( productAttrSimpleBO.getId() );
adminsProductAttrSimpleVO.setName( productAttrSimpleBO.getName() );
adminsProductAttrSimpleVO.setValues( productAttrValueSimpleBOListToAdminsProductAttrValueSimpleVOList( productAttrSimpleBO.getValues() ) );
return adminsProductAttrSimpleVO;
}
}
package cn.iocoder.mall.product.application.convert;
import cn.iocoder.mall.product.api.bo.ProductBrandBO;
import cn.iocoder.mall.product.api.bo.ProductBrangPageBO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrandVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrangPageVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T18:12:33+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductBrandConvertImpl implements ProductBrandConvert {
@Override
public AdminsProductBrandVO convert(ProductBrandBO result) {
if ( result == null ) {
return null;
}
AdminsProductBrandVO adminsProductBrandVO = new AdminsProductBrandVO();
adminsProductBrandVO.setId( result.getId() );
adminsProductBrandVO.setName( result.getName() );
adminsProductBrandVO.setDescription( result.getDescription() );
adminsProductBrandVO.setPicUrl( result.getPicUrl() );
adminsProductBrandVO.setStatus( result.getStatus() );
return adminsProductBrandVO;
}
@Override
public AdminsProductBrangPageVO convert(ProductBrangPageBO result) {
if ( result == null ) {
return null;
}
AdminsProductBrangPageVO adminsProductBrangPageVO = new AdminsProductBrangPageVO();
adminsProductBrangPageVO.setBrands( productBrandBOListToAdminsProductBrandVOList( result.getBrands() ) );
adminsProductBrangPageVO.setCount( result.getCount() );
return adminsProductBrangPageVO;
}
protected List<AdminsProductBrandVO> productBrandBOListToAdminsProductBrandVOList(List<ProductBrandBO> list) {
if ( list == null ) {
return null;
}
List<AdminsProductBrandVO> list1 = new ArrayList<AdminsProductBrandVO>( list.size() );
for ( ProductBrandBO productBrandBO : list ) {
list1.add( convert( productBrandBO ) );
}
return list1;
}
}
package cn.iocoder.mall.product.application.convert;
import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
import cn.iocoder.mall.product.application.convert.ProductCategoryConvert.Admins;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryTreeNodeVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryVO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:47:09+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductCategoryConvert$AdminsImpl implements Admins {
@Override
public AdminsProductCategoryTreeNodeVO convert(ProductCategoryBO category) {
if ( category == null ) {
return null;
}
AdminsProductCategoryTreeNodeVO adminsProductCategoryTreeNodeVO = new AdminsProductCategoryTreeNodeVO();
adminsProductCategoryTreeNodeVO.setId( category.getId() );
adminsProductCategoryTreeNodeVO.setPid( category.getPid() );
adminsProductCategoryTreeNodeVO.setName( category.getName() );
adminsProductCategoryTreeNodeVO.setDescription( category.getDescription() );
adminsProductCategoryTreeNodeVO.setPicUrl( category.getPicUrl() );
adminsProductCategoryTreeNodeVO.setSort( category.getSort() );
adminsProductCategoryTreeNodeVO.setStatus( category.getStatus() );
adminsProductCategoryTreeNodeVO.setCreateTime( category.getCreateTime() );
return adminsProductCategoryTreeNodeVO;
}
@Override
public AdminsProductCategoryVO convert2(ProductCategoryBO result) {
if ( result == null ) {
return null;
}
AdminsProductCategoryVO adminsProductCategoryVO = new AdminsProductCategoryVO();
adminsProductCategoryVO.setId( result.getId() );
adminsProductCategoryVO.setPid( result.getPid() );
adminsProductCategoryVO.setName( result.getName() );
adminsProductCategoryVO.setDescription( result.getDescription() );
adminsProductCategoryVO.setPicUrl( result.getPicUrl() );
adminsProductCategoryVO.setSort( result.getSort() );
adminsProductCategoryVO.setStatus( result.getStatus() );
adminsProductCategoryVO.setCreateTime( result.getCreateTime() );
return adminsProductCategoryVO;
}
}
package cn.iocoder.mall.product.application.convert;
import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
import cn.iocoder.mall.product.application.convert.ProductCategoryConvert.Users;
import cn.iocoder.mall.product.application.vo.users.UsersProductCategoryVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:47:10+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductCategoryConvert$UsersImpl implements Users {
@Override
public UsersProductCategoryVO convertToVO(ProductCategoryBO category) {
if ( category == null ) {
return null;
}
UsersProductCategoryVO usersProductCategoryVO = new UsersProductCategoryVO();
usersProductCategoryVO.setId( category.getId() );
usersProductCategoryVO.setName( category.getName() );
usersProductCategoryVO.setPicUrl( category.getPicUrl() );
return usersProductCategoryVO;
}
@Override
public List<UsersProductCategoryVO> convertToVO(List<ProductCategoryBO> categoryList) {
if ( categoryList == null ) {
return null;
}
List<UsersProductCategoryVO> list = new ArrayList<UsersProductCategoryVO>( categoryList.size() );
for ( ProductCategoryBO productCategoryBO : categoryList ) {
list.add( convertToVO( productCategoryBO ) );
}
return list;
}
}
spring:
# datasource
datasource:
url: jdbc:mysql://192.168.88.14:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: ${MALL_MYSQL_PASSWORD}
# rocketmq
rocketmq:
name-server: 192.168.88.14:9876
producer:
group: product-producer-group
spring:
# datasource
datasource:
url: jdbc:mysql://180.167.213.26:13306/mall_product?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.product.dataobject
# dubbo
dubbo:
application:
name: product-service
registry:
address: zookeeper://127.0.0.1:2181
protocol:
port: -1
name: dubbo
scan:
base-packages: cn.iocoder.mall.product.service
provider:
filter: -exception
ProductAttrService:
version: 1.0.0
ProductCategoryService:
version: 1.0.0
ProductSpuService:
version: 1.0.0
ProductBrandService:
version: 1.0.0
OAuth2Service:
version: 1.0.0
# rocketmq
rocketmq:
name-server: 127.0.0.1:9876
producer:
group: product-producer-group
# seata
seata:
tx-service-group: my_test_tx_group
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 = ""
}
}
<?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.product.dao.ProductAttrMapper">
<sql id="FIELDS">
id, name, status, create_time
</sql>
<!--<select id="selectList" resultType="ProductCategoryDO">-->
<!--SELECT-->
<!--<include refid="FIELDS" />-->
<!--FROM product_category-->
<!--WHERE deleted = 0-->
<!--</select>-->
<select id="selectById" parameterType="Integer" resultType="ProductAttrDO">
SELECT
<include refid="FIELDS" />
FROM product_attr
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByName" parameterType="String" resultType="ProductAttrDO">
SELECT
<include refid="FIELDS" />
FROM product_attr
WHERE name = #{name}
AND deleted = 0
LIMIT 1
</select>
<insert id="insert" parameterType="ProductAttrDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_attr (
name, status, create_time, deleted
) VALUES (
#{name}, #{status}, #{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="ProductAttrDO">
UPDATE product_attr
<set>
<if test="name != null">
name = #{name},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
<select id="selectListByIds" resultType="ProductAttrDO">
SELECT
<include refid="FIELDS" />
FROM product_attr
WHERE id IN
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
AND deleted = 0
</select>
<select id="selectListByNameLike" resultType="ProductAttrDO">
SELECT
<include refid="FIELDS" />
FROM product_attr
<where>
<if test="name != null">
name LIKE "%"#{name}"%"
</if>
AND deleted = 0
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectCountByNameLike" resultType="Integer">
SELECT
COUNT(1)
FROM product_attr
<where>
<if test="name != null">
name LIKE "%"#{name}"%"
</if>
AND deleted = 0
</where>
</select>
<select id="selectListByStatus" parameterType="Integer" resultType="ProductAttrDO">
SELECT
<include refid="FIELDS" />
FROM product_attr
<where>
<if test="status != null">
status = #{status}
</if>
AND deleted = 0
</where>
</select>
</mapper>
\ No newline at end of file
<?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.product.dao.ProductAttrValueMapper">
<sql id="FIELDS">
id, attr_id, name, status, create_time
</sql>
<!--<select id="selectList" resultType="ProductCategoryDO">-->
<!--SELECT-->
<!--<include refid="FIELDS" />-->
<!--FROM product_category-->
<!--WHERE deleted = 0-->
<!--</select>-->
<select id="selectById" parameterType="Integer" resultType="ProductAttrValueDO">
SELECT
<include refid="FIELDS" />
FROM product_attr_value
WHERE id = #{id}
AND deleted = 0
</select>
<!--<insert id="insert" parameterType="ProductCategoryDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">-->
<!--INSERT INTO product_category (-->
<!--pid, name, description, pic_url, sort,-->
<!--status, create_time, deleted-->
<!--) VALUES (-->
<!--#{pid}, #{name}, #{description}, #{picUrl}, #{sort},-->
<!--#{status}, #{createTime}, #{deleted}-->
<!--)-->
<!--</insert>-->
<!--<update id="update" parameterType="ProductCategoryDO">-->
<!--UPDATE product_category-->
<!--<set>-->
<!--<if test="pid != null">-->
<!--pid = #{pid},-->
<!--</if>-->
<!--<if test="name != null">-->
<!--name = #{name},-->
<!--</if>-->
<!--<if test="description != null">-->
<!--description = #{description},-->
<!--</if>-->
<!--<if test="picUrl != null">-->
<!--pic_url = #{picUrl},-->
<!--</if>-->
<!--<if test="sort != null">-->
<!--sort = #{sort},-->
<!--</if>-->
<!--<if test="status != null">-->
<!--status = #{status},-->
<!--</if>-->
<!--<if test="deleted != null">-->
<!--deleted = #{deleted}-->
<!--</if>-->
<!--</set>-->
<!--WHERE id = #{id}-->
<!--</update>-->
<select id="selectListByIds" resultType="ProductAttrValueDO">
SELECT
<include refid="FIELDS" />
FROM product_attr_value
WHERE id IN
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
AND deleted = 0
</select>
<select id="selectListByAttrIds" resultType="ProductAttrValueDO">
SELECT
<include refid="FIELDS" />
FROM product_attr_value
WHERE attr_id IN
<foreach item="attrId" collection="attrIds" separator="," open="(" close=")" index="">
#{attrId}
</foreach>
AND deleted = 0
</select>
<select id="selectListByStatus" resultType="ProductAttrValueDO">
SELECT
<include refid="FIELDS" />
FROM product_attr_value
<where>
<if test="status != null">
status = #{status}
</if>
AND deleted = 0
</where>
</select>
<select id="selectByAttrIdAndName" resultType="ProductAttrValueDO">
SELECT
<include refid="FIELDS" />
FROM product_attr_value
WHERE name = #{name}
AND deleted = 0
LIMIT 1
</select>
<insert id="insert" parameterType="ProductAttrValueDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_attr_value (
attr_id, name, status, create_time, deleted
) VALUES (
#{attrId}, #{name}, #{status}, #{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="ProductAttrValueDO">
UPDATE product_attr_value
<set>
<if test="name != null">
name = #{name},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
<?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.product.dao.ProductBrandMapper">
<sql id="FIELDS">
id, name, description, pic_url, status, create_time
</sql>
<select id="selectById" parameterType="Integer" resultType="ProductBrandDO">
SELECT
<include refid="FIELDS" />
FROM product_brand
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByName" parameterType="String" resultType="ProductBrandDO">
SELECT
<include refid="FIELDS" />
FROM product_brand
WHERE name = #{name}
AND deleted = 0
</select>
<insert id="insert" parameterType="ProductBrandDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_brand (
name, description, pic_url, status, create_time, deleted
) VALUES (
#{name}, #{description}, #{picUrl}, #{status}, #{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="ProductBrandDO">
UPDATE product_brand
<set>
<if test="name != null">
name = #{name},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="picUrl != null">
pic_url = #{picUrl},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
<select id="selectListByParams" resultType="ProductBrandDO">
SELECT
<include refid="FIELDS" />
FROM product_brand
<where>
deleted = 0
<if test="name != null">
AND name LIKE "%"#{name}"%"
</if>
<if test="description != null">
AND description LIKE "%"#{description}"%"
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectListCountByParams" resultType="Integer">
SELECT
COUNT(1)
FROM product_brand
<where>
deleted = 0
<if test="name != null">
AND name LIKE "%"#{name}"%"
</if>
<if test="description != null">
AND description LIKE "%"#{description}"%"
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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.product.dao.ProductCategoryMapper">
<sql id="FIELDS">
id, pid, name, description, pic_url,
sort, status, create_time
</sql>
<select id="selectListByPidAndStatusOrderBySort" resultType="ProductCategoryDO">
SELECT
<include refid="FIELDS" />
FROM product_category
WHERE pid = #{pid}
AND status = #{status}
AND deleted = 0
ORDER BY sort ASC
</select>
<select id="selectList" resultType="ProductCategoryDO">
SELECT
<include refid="FIELDS" />
FROM product_category
WHERE deleted = 0
</select>
<select id="selectById" parameterType="Integer" resultType="ProductCategoryDO">
SELECT
<include refid="FIELDS" />
FROM product_category
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByIds" resultType="ProductCategoryDO">
SELECT
<include refid="FIELDS" />
FROM product_category
WHERE id IN
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
AND deleted = 0
</select>
<insert id="insert" parameterType="ProductCategoryDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_category (
pid, name, description, pic_url, sort,
status, create_time, deleted
) VALUES (
#{pid}, #{name}, #{description}, #{picUrl}, #{sort},
#{status}, #{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="ProductCategoryDO">
UPDATE product_category
<set>
<if test="pid != null">
pid = #{pid},
</if>
<if test="name != null">
name = #{name},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="picUrl != null">
pic_url = #{picUrl},
</if>
<if test="sort != null">
sort = #{sort},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
</mapper>
<?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.product.dao.ProductSkuMapper">
<sql id="FIELDS">
id, spu_id, status, pic_url, attrs,
price, quantity, create_time
</sql>
<select id="selectById" parameterType="Integer" resultType="ProductSkuDO">
SELECT
<include refid="FIELDS" />
FROM product_sku
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByIds" resultType="ProductSkuDO">
SELECT
<include refid="FIELDS" />
FROM product_sku
WHERE id IN
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
AND deleted = 0
</select>
<insert id="insertList" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_sku (
spu_id, status, pic_url, attrs, price,
quantity, deleted, create_time
) VALUES
<foreach collection="productSkuDOs" item="productSkuDO" separator=",">
(#{productSkuDO.spuId}, #{productSkuDO.status}, #{productSkuDO.picUrl}, #{productSkuDO.attrs}, #{productSkuDO.price},
#{productSkuDO.quantity}, #{productSkuDO.deleted}, #{productSkuDO.createTime}
)
</foreach>
</insert>
<select id="selectListBySpuIdAndStatus" resultType="ProductSkuDO">
SELECT
<include refid="FIELDS" />
FROM product_sku
WHERE spu_id = #{spuId}
AND status = #{status}
AND deleted = 0
</select>
<update id="update" parameterType="ProductSpuDO">
UPDATE product_sku
<set>
<if test="spuId != null">
spu_id = #{spuId},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="picUrl != null">
pic_url = #{picUrl},
</if>
<if test="attrs != null">
attrs = #{attrs},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
<update id="updateToDeleted" parameterType="Integer">
UPDATE product_sku
SET deleted = 1
WHERE id IN
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
</update>
</mapper>
<?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.product.dao.ProductSpuMapper">
<sql id="FIELDS">
id, name, sell_point, description, cid,
pic_urls, visible, sort, price, quantity,
create_time
</sql>
<select id="selectById" parameterType="Integer" resultType="ProductSpuDO">
SELECT
<include refid="FIELDS" />
FROM product_spu
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByIds" resultType="ProductSpuDO">
SELECT
<include refid="FIELDS" />
FROM product_spu
WHERE id IN
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
AND deleted = 0
</select>
<select id="selectIdListByIdGt" parameterType="Integer" resultType="Integer">
SELECT
<include refid="FIELDS" />
FROM product_spu
<where>
<if test="id != null">
id > #{id}
</if>
AND deleted = 0
</where>
ORDER BY id ASC
LIMIT #{limit}
</select>
<insert id="insert" parameterType="ProductSpuDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_spu (
name, sell_point, description, cid, pic_urls,
visible, sort, price, quantity,
deleted, create_time
) VALUES (
#{name}, #{sellPoint}, #{description}, #{cid}, #{picUrls},
#{visible}, #{sort}, #{price}, #{quantity},
#{deleted}, #{createTime}
)
</insert>
<update id="update" parameterType="ProductSpuDO">
UPDATE product_spu
<set>
<if test="name != null">
name = #{name},
</if>
<if test="sellPoint != null">
sell_point = #{sellPoint},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="cid != null">
cid = #{cid},
</if>
<if test="picUrls != null">
pic_urls = #{picUrls},
</if>
<if test="visible != null">
visible = #{visible},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="sort != null">
sort = #{sort},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
<select id="selectListByNameLikeOrderBySortAsc" resultType="ProductSpuDO">
SELECT
<include refid="FIELDS" />
FROM product_spu
<where>
<if test="name != null">
name LIKE "%"#{name}"%"
</if>
<if test="cid != null">
AND cid = #{cid}
</if>
<if test="visible != null">
AND visible = #{visible}
</if>
<if test="hasQuantity == true">
AND quantity > 0
</if>
<if test="hasQuantity == false">
AND quantity = 0
</if>
AND deleted = 0
</where>
ORDER BY sort ASC
<if test="offset != null and limit != null">
LIMIT #{offset}, #{limit}
</if>
</select>
<select id="selectCountByNameLike" resultType="Integer">
SELECT
COUNT(1)
FROM product_spu
<where>
<if test="name != null">
name LIKE "%"#{name}"%"
</if>
<if test="cid != null">
AND cid = #{cid}
</if>
<if test="visible != null">
AND visible = #{visible}
</if>
<if test="hasQuantity == true">
AND quantity > 0
</if>
<if test="hasQuantity == false">
AND quantity = 0
</if>
AND deleted = 0
</where>
</select>
</mapper>
<?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>
\ No newline at end of file
registry {
type = "file"
file {
name = "file.conf"
}
zk {
cluster = "default"
serverAddr = "192.168.88.10:2181"
session.timeout = 6000
connect.timeout = 2000
}
}
package cn.iocoder.mall.product.convert;
import cn.iocoder.mall.product.api.bo.ProductAttrBO;
import cn.iocoder.mall.product.api.bo.ProductAttrDetailBO;
import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO;
import cn.iocoder.mall.product.api.bo.ProductAttrValueBO;
import cn.iocoder.mall.product.api.bo.ProductAttrValueDetailBO;
import cn.iocoder.mall.product.api.bo.ProductAttrValueSimpleBO;
import cn.iocoder.mall.product.api.dto.ProductAttrAddDTO;
import cn.iocoder.mall.product.api.dto.ProductAttrUpdateDTO;
import cn.iocoder.mall.product.api.dto.ProductAttrValueAddDTO;
import cn.iocoder.mall.product.api.dto.ProductAttrValueUpdateDTO;
import cn.iocoder.mall.product.dataobject.ProductAttrDO;
import cn.iocoder.mall.product.dataobject.ProductAttrValueDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductAttrConvertImpl implements ProductAttrConvert {
@Override
public List<ProductAttrDetailBO> convert(List<ProductAttrDO> attrs) {
if ( attrs == null ) {
return null;
}
List<ProductAttrDetailBO> list = new ArrayList<ProductAttrDetailBO>( attrs.size() );
for ( ProductAttrDO productAttrDO : attrs ) {
list.add( productAttrDOToProductAttrDetailBO( productAttrDO ) );
}
return list;
}
@Override
public ProductAttrValueDetailBO convert(ProductAttrValueDO value) {
if ( value == null ) {
return null;
}
ProductAttrValueDetailBO productAttrValueDetailBO = new ProductAttrValueDetailBO();
productAttrValueDetailBO.setId( value.getId() );
productAttrValueDetailBO.setName( value.getName() );
productAttrValueDetailBO.setStatus( value.getStatus() );
productAttrValueDetailBO.setCreateTime( value.getCreateTime() );
return productAttrValueDetailBO;
}
@Override
public List<ProductAttrValueDetailBO> convert2(List<ProductAttrValueDO> values) {
if ( values == null ) {
return null;
}
List<ProductAttrValueDetailBO> list = new ArrayList<ProductAttrValueDetailBO>( values.size() );
for ( ProductAttrValueDO productAttrValueDO : values ) {
list.add( convert( productAttrValueDO ) );
}
return list;
}
@Override
public List<ProductAttrSimpleBO> convert3(List<ProductAttrDO> attrs) {
if ( attrs == null ) {
return null;
}
List<ProductAttrSimpleBO> list = new ArrayList<ProductAttrSimpleBO>( attrs.size() );
for ( ProductAttrDO productAttrDO : attrs ) {
list.add( productAttrDOToProductAttrSimpleBO( productAttrDO ) );
}
return list;
}
@Override
public ProductAttrValueSimpleBO convert3(ProductAttrValueDO value) {
if ( value == null ) {
return null;
}
ProductAttrValueSimpleBO productAttrValueSimpleBO = new ProductAttrValueSimpleBO();
productAttrValueSimpleBO.setId( value.getId() );
productAttrValueSimpleBO.setName( value.getName() );
return productAttrValueSimpleBO;
}
@Override
public List<ProductAttrValueSimpleBO> convert4(List<ProductAttrValueDO> values) {
if ( values == null ) {
return null;
}
List<ProductAttrValueSimpleBO> list = new ArrayList<ProductAttrValueSimpleBO>( values.size() );
for ( ProductAttrValueDO productAttrValueDO : values ) {
list.add( convert3( productAttrValueDO ) );
}
return list;
}
@Override
public ProductAttrDO convert(ProductAttrAddDTO productAttrAddDTO) {
if ( productAttrAddDTO == null ) {
return null;
}
ProductAttrDO productAttrDO = new ProductAttrDO();
productAttrDO.setName( productAttrAddDTO.getName() );
return productAttrDO;
}
@Override
public ProductAttrDO convert(ProductAttrUpdateDTO productAttrUpdateDTO) {
if ( productAttrUpdateDTO == null ) {
return null;
}
ProductAttrDO productAttrDO = new ProductAttrDO();
productAttrDO.setId( productAttrUpdateDTO.getId() );
productAttrDO.setName( productAttrUpdateDTO.getName() );
return productAttrDO;
}
@Override
public ProductAttrValueDO convert(ProductAttrValueAddDTO productAttrValueAddDTO) {
if ( productAttrValueAddDTO == null ) {
return null;
}
ProductAttrValueDO productAttrValueDO = new ProductAttrValueDO();
productAttrValueDO.setAttrId( productAttrValueAddDTO.getAttrId() );
productAttrValueDO.setName( productAttrValueAddDTO.getName() );
return productAttrValueDO;
}
@Override
public ProductAttrValueDO convert(ProductAttrValueUpdateDTO productAttrValueUpdateDTO) {
if ( productAttrValueUpdateDTO == null ) {
return null;
}
ProductAttrValueDO productAttrValueDO = new ProductAttrValueDO();
productAttrValueDO.setId( productAttrValueUpdateDTO.getId() );
productAttrValueDO.setName( productAttrValueUpdateDTO.getName() );
return productAttrValueDO;
}
@Override
public ProductAttrBO convert(ProductAttrDO productAttrDO) {
if ( productAttrDO == null ) {
return null;
}
ProductAttrBO productAttrBO = new ProductAttrBO();
productAttrBO.setId( productAttrDO.getId() );
productAttrBO.setName( productAttrDO.getName() );
productAttrBO.setStatus( productAttrDO.getStatus() );
productAttrBO.setCreateTime( productAttrDO.getCreateTime() );
return productAttrBO;
}
@Override
public ProductAttrValueBO convert2(ProductAttrValueDO productAttrValueDO) {
if ( productAttrValueDO == null ) {
return null;
}
ProductAttrValueBO productAttrValueBO = new ProductAttrValueBO();
productAttrValueBO.setId( productAttrValueDO.getId() );
productAttrValueBO.setAttrId( productAttrValueDO.getAttrId() );
productAttrValueBO.setName( productAttrValueDO.getName() );
productAttrValueBO.setStatus( productAttrValueDO.getStatus() );
productAttrValueBO.setCreateTime( productAttrValueDO.getCreateTime() );
return productAttrValueBO;
}
protected ProductAttrDetailBO productAttrDOToProductAttrDetailBO(ProductAttrDO productAttrDO) {
if ( productAttrDO == null ) {
return null;
}
ProductAttrDetailBO productAttrDetailBO = new ProductAttrDetailBO();
productAttrDetailBO.setId( productAttrDO.getId() );
productAttrDetailBO.setName( productAttrDO.getName() );
productAttrDetailBO.setStatus( productAttrDO.getStatus() );
productAttrDetailBO.setCreateTime( productAttrDO.getCreateTime() );
return productAttrDetailBO;
}
protected ProductAttrSimpleBO productAttrDOToProductAttrSimpleBO(ProductAttrDO productAttrDO) {
if ( productAttrDO == null ) {
return null;
}
ProductAttrSimpleBO productAttrSimpleBO = new ProductAttrSimpleBO();
productAttrSimpleBO.setId( productAttrDO.getId() );
productAttrSimpleBO.setName( productAttrDO.getName() );
return productAttrSimpleBO;
}
}
package cn.iocoder.mall.product.convert;
import cn.iocoder.mall.product.api.bo.ProductBrandBO;
import cn.iocoder.mall.product.api.dto.ProductBrandAddDTO;
import cn.iocoder.mall.product.api.dto.ProductBrandUpdateDTO;
import cn.iocoder.mall.product.dataobject.ProductBrandDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-31T18:12:30+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductBrandConvertImpl implements ProductBrandConvert {
@Override
public List<ProductBrandBO> convert(List<ProductBrandDO> brands) {
if ( brands == null ) {
return null;
}
List<ProductBrandBO> list = new ArrayList<ProductBrandBO>( brands.size() );
for ( ProductBrandDO productBrandDO : brands ) {
list.add( convert( productBrandDO ) );
}
return list;
}
@Override
public ProductBrandBO convert(ProductBrandDO brand) {
if ( brand == null ) {
return null;
}
ProductBrandBO productBrandBO = new ProductBrandBO();
productBrandBO.setId( brand.getId() );
productBrandBO.setName( brand.getName() );
productBrandBO.setDescription( brand.getDescription() );
productBrandBO.setPicUrl( brand.getPicUrl() );
productBrandBO.setStatus( brand.getStatus() );
return productBrandBO;
}
@Override
public ProductBrandDO convert(ProductBrandUpdateDTO brand) {
if ( brand == null ) {
return null;
}
ProductBrandDO productBrandDO = new ProductBrandDO();
productBrandDO.setId( brand.getId() );
productBrandDO.setName( brand.getName() );
productBrandDO.setDescription( brand.getDescription() );
productBrandDO.setPicUrl( brand.getPicUrl() );
productBrandDO.setStatus( brand.getStatus() );
return productBrandDO;
}
@Override
public ProductBrandDO convert(ProductBrandAddDTO brand) {
if ( brand == null ) {
return null;
}
ProductBrandDO productBrandDO = new ProductBrandDO();
productBrandDO.setName( brand.getName() );
productBrandDO.setDescription( brand.getDescription() );
productBrandDO.setPicUrl( brand.getPicUrl() );
productBrandDO.setStatus( brand.getStatus() );
return productBrandDO;
}
}
package cn.iocoder.mall.product.convert;
import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
import cn.iocoder.mall.product.api.dto.ProductCategoryAddDTO;
import cn.iocoder.mall.product.api.dto.ProductCategoryUpdateDTO;
import cn.iocoder.mall.product.dataobject.ProductCategoryDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:55+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductCategoryConvertImpl implements ProductCategoryConvert {
@Override
public ProductCategoryBO convertToBO(ProductCategoryDO category) {
if ( category == null ) {
return null;
}
ProductCategoryBO productCategoryBO = new ProductCategoryBO();
productCategoryBO.setId( category.getId() );
productCategoryBO.setPid( category.getPid() );
productCategoryBO.setName( category.getName() );
productCategoryBO.setDescription( category.getDescription() );
productCategoryBO.setPicUrl( category.getPicUrl() );
productCategoryBO.setSort( category.getSort() );
productCategoryBO.setStatus( category.getStatus() );
productCategoryBO.setCreateTime( category.getCreateTime() );
return productCategoryBO;
}
@Override
public List<ProductCategoryBO> convertToBO(List<ProductCategoryDO> categoryList) {
if ( categoryList == null ) {
return null;
}
List<ProductCategoryBO> list = new ArrayList<ProductCategoryBO>( categoryList.size() );
for ( ProductCategoryDO productCategoryDO : categoryList ) {
list.add( convertToBO( productCategoryDO ) );
}
return list;
}
@Override
public ProductCategoryDO convert(ProductCategoryAddDTO productCategoryAddDTO) {
if ( productCategoryAddDTO == null ) {
return null;
}
ProductCategoryDO productCategoryDO = new ProductCategoryDO();
productCategoryDO.setPid( productCategoryAddDTO.getPid() );
productCategoryDO.setName( productCategoryAddDTO.getName() );
productCategoryDO.setDescription( productCategoryAddDTO.getDescription() );
productCategoryDO.setPicUrl( productCategoryAddDTO.getPicUrl() );
productCategoryDO.setSort( productCategoryAddDTO.getSort() );
return productCategoryDO;
}
@Override
public ProductCategoryDO convert(ProductCategoryUpdateDTO productCategoryUpdateDTO) {
if ( productCategoryUpdateDTO == null ) {
return null;
}
ProductCategoryDO productCategoryDO = new ProductCategoryDO();
productCategoryDO.setId( productCategoryUpdateDTO.getId() );
productCategoryDO.setPid( productCategoryUpdateDTO.getPid() );
productCategoryDO.setName( productCategoryUpdateDTO.getName() );
productCategoryDO.setDescription( productCategoryUpdateDTO.getDescription() );
productCategoryDO.setPicUrl( productCategoryUpdateDTO.getPicUrl() );
productCategoryDO.setSort( productCategoryUpdateDTO.getSort() );
return productCategoryDO;
}
}
package cn.iocoder.mall.product.convert;
import cn.iocoder.mall.product.api.bo.ProductSkuBO;
import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO;
import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO.Spu;
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
import cn.iocoder.mall.product.api.bo.ProductSpuDetailBO;
import cn.iocoder.mall.product.api.bo.ProductSpuDetailBO.Sku;
import cn.iocoder.mall.product.api.dto.ProductSkuAddOrUpdateDTO;
import cn.iocoder.mall.product.api.dto.ProductSpuAddDTO;
import cn.iocoder.mall.product.api.dto.ProductSpuUpdateDTO;
import cn.iocoder.mall.product.dataobject.ProductSkuDO;
import cn.iocoder.mall.product.dataobject.ProductSpuDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:56+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductSpuConvertImpl implements ProductSpuConvert {
@Override
public ProductSpuBO convert(ProductSpuDO spu) {
if ( spu == null ) {
return null;
}
ProductSpuBO productSpuBO = new ProductSpuBO();
productSpuBO.setPicUrls( translatePicUrlsFromString( spu.getPicUrls() ) );
productSpuBO.setId( spu.getId() );
productSpuBO.setName( spu.getName() );
productSpuBO.setSellPoint( spu.getSellPoint() );
productSpuBO.setDescription( spu.getDescription() );
productSpuBO.setCid( spu.getCid() );
productSpuBO.setVisible( spu.getVisible() );
productSpuBO.setSort( spu.getSort() );
productSpuBO.setPrice( spu.getPrice() );
productSpuBO.setQuantity( spu.getQuantity() );
return productSpuBO;
}
@Override
public List<ProductSpuBO> convert(List<ProductSpuDO> spus) {
if ( spus == null ) {
return null;
}
List<ProductSpuBO> list = new ArrayList<ProductSpuBO>( spus.size() );
for ( ProductSpuDO productSpuDO : spus ) {
list.add( convert( productSpuDO ) );
}
return list;
}
@Override
public ProductSpuDO convert(ProductSpuAddDTO productSpuAddDTO) {
if ( productSpuAddDTO == null ) {
return null;
}
ProductSpuDO productSpuDO = new ProductSpuDO();
productSpuDO.setName( productSpuAddDTO.getName() );
productSpuDO.setSellPoint( productSpuAddDTO.getSellPoint() );
productSpuDO.setDescription( productSpuAddDTO.getDescription() );
productSpuDO.setCid( productSpuAddDTO.getCid() );
productSpuDO.setVisible( productSpuAddDTO.getVisible() );
return productSpuDO;
}
@Override
public ProductSkuDO convert(ProductSkuAddOrUpdateDTO productSkuAddDTO) {
if ( productSkuAddDTO == null ) {
return null;
}
ProductSkuDO productSkuDO = new ProductSkuDO();
productSkuDO.setPrice( productSkuAddDTO.getPrice() );
productSkuDO.setQuantity( productSkuAddDTO.getQuantity() );
return productSkuDO;
}
@Override
public ProductSpuDO convert(ProductSpuUpdateDTO productSpuUpdateDTO) {
if ( productSpuUpdateDTO == null ) {
return null;
}
ProductSpuDO productSpuDO = new ProductSpuDO();
productSpuDO.setId( productSpuUpdateDTO.getId() );
productSpuDO.setName( productSpuUpdateDTO.getName() );
productSpuDO.setSellPoint( productSpuUpdateDTO.getSellPoint() );
productSpuDO.setDescription( productSpuUpdateDTO.getDescription() );
productSpuDO.setCid( productSpuUpdateDTO.getCid() );
productSpuDO.setVisible( productSpuUpdateDTO.getVisible() );
return productSpuDO;
}
@Override
public ProductSpuDetailBO convert(ProductSpuBO spu) {
if ( spu == null ) {
return null;
}
ProductSpuDetailBO productSpuDetailBO = new ProductSpuDetailBO();
productSpuDetailBO.setId( spu.getId() );
productSpuDetailBO.setName( spu.getName() );
productSpuDetailBO.setSellPoint( spu.getSellPoint() );
productSpuDetailBO.setDescription( spu.getDescription() );
productSpuDetailBO.setCid( spu.getCid() );
List<String> list = spu.getPicUrls();
if ( list != null ) {
productSpuDetailBO.setPicUrls( new ArrayList<String>( list ) );
}
productSpuDetailBO.setVisible( spu.getVisible() );
productSpuDetailBO.setSort( spu.getSort() );
return productSpuDetailBO;
}
@Override
public ProductSpuDetailBO convert2(ProductSpuDO spu) {
if ( spu == null ) {
return null;
}
ProductSpuDetailBO productSpuDetailBO = new ProductSpuDetailBO();
productSpuDetailBO.setId( spu.getId() );
productSpuDetailBO.setName( spu.getName() );
productSpuDetailBO.setSellPoint( spu.getSellPoint() );
productSpuDetailBO.setDescription( spu.getDescription() );
productSpuDetailBO.setCid( spu.getCid() );
productSpuDetailBO.setVisible( spu.getVisible() );
productSpuDetailBO.setSort( spu.getSort() );
return productSpuDetailBO;
}
@Override
public Spu convert3(ProductSpuDO spu) {
if ( spu == null ) {
return null;
}
Spu spu1 = new Spu();
spu1.setId( spu.getId() );
spu1.setName( spu.getName() );
spu1.setSellPoint( spu.getSellPoint() );
spu1.setDescription( spu.getDescription() );
spu1.setCid( spu.getCid() );
spu1.setVisible( spu.getVisible() );
spu1.setSort( spu.getSort() );
return spu1;
}
@Override
public Sku convert2(ProductSkuDO sku) {
if ( sku == null ) {
return null;
}
Sku sku1 = new Sku();
sku1.setId( sku.getId() );
sku1.setSpuId( sku.getSpuId() );
sku1.setPrice( sku.getPrice() );
sku1.setQuantity( sku.getQuantity() );
return sku1;
}
@Override
public ProductSkuDetailBO convert3(ProductSkuDO sku) {
if ( sku == null ) {
return null;
}
ProductSkuDetailBO productSkuDetailBO = new ProductSkuDetailBO();
productSkuDetailBO.setId( sku.getId() );
productSkuDetailBO.setPrice( sku.getPrice() );
productSkuDetailBO.setQuantity( sku.getQuantity() );
return productSkuDetailBO;
}
@Override
public ProductSkuBO convert4(ProductSkuDO sku) {
if ( sku == null ) {
return null;
}
ProductSkuBO productSkuBO = new ProductSkuBO();
productSkuBO.setId( sku.getId() );
productSkuBO.setSpuId( sku.getSpuId() );
productSkuBO.setStatus( sku.getStatus() );
productSkuBO.setPrice( sku.getPrice() );
productSkuBO.setQuantity( sku.getQuantity() );
return productSkuBO;
}
}
swagger:
enable: false
title: 营销子系统
description: 营销子系统
version: 1.0.0
base-package: cn.iocoder.mall.promotion.application.controller
spring:
application:
name: promotion-application
cloud:
sentinel:
transport:
port: 8719
dashboard: localhost:12088
metric:
charset: UTF-8
eager: false
# server
server:
port: 18085
servlet:
context-path: /promotion-api/
swagger:
enable: false
management:
endpoints:
web:
exposure:
include: health,info,env,metrics,prometheus
metrics:
enabled: true
package cn.iocoder.mall.promotion.application.convert;
import cn.iocoder.mall.promotion.api.bo.BannerBO;
import cn.iocoder.mall.promotion.api.bo.BannerPageBO;
import cn.iocoder.mall.promotion.application.convert.BannerConvert.Admins;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerPageVO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:16+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class BannerConvert$AdminsImpl implements Admins {
@Override
public AdminsBannerVO convert(BannerBO bannerBO) {
if ( bannerBO == null ) {
return null;
}
AdminsBannerVO adminsBannerVO = new AdminsBannerVO();
adminsBannerVO.setId( bannerBO.getId() );
adminsBannerVO.setTitle( bannerBO.getTitle() );
adminsBannerVO.setUrl( bannerBO.getUrl() );
adminsBannerVO.setPicUrl( bannerBO.getPicUrl() );
adminsBannerVO.setSort( bannerBO.getSort() );
adminsBannerVO.setStatus( bannerBO.getStatus() );
adminsBannerVO.setMemo( bannerBO.getMemo() );
adminsBannerVO.setCreateTime( bannerBO.getCreateTime() );
return adminsBannerVO;
}
@Override
public AdminsBannerPageVO convert3(BannerPageBO bannerPageBO) {
if ( bannerPageBO == null ) {
return null;
}
AdminsBannerPageVO adminsBannerPageVO = new AdminsBannerPageVO();
adminsBannerPageVO.setList( bannerBOListToAdminsBannerVOList( bannerPageBO.getList() ) );
adminsBannerPageVO.setTotal( bannerPageBO.getTotal() );
return adminsBannerPageVO;
}
protected List<AdminsBannerVO> bannerBOListToAdminsBannerVOList(List<BannerBO> list) {
if ( list == null ) {
return null;
}
List<AdminsBannerVO> list1 = new ArrayList<AdminsBannerVO>( list.size() );
for ( BannerBO bannerBO : list ) {
list1.add( convert( bannerBO ) );
}
return list1;
}
}
package cn.iocoder.mall.promotion.application.convert;
import cn.iocoder.mall.promotion.api.bo.BannerBO;
import cn.iocoder.mall.promotion.application.convert.BannerConvert.Users;
import cn.iocoder.mall.promotion.application.vo.users.UsersBannerVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:15+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class BannerConvert$UsersImpl implements Users {
@Override
public List<UsersBannerVO> convertList(List<BannerBO> banners) {
if ( banners == null ) {
return null;
}
List<UsersBannerVO> list = new ArrayList<UsersBannerVO>( banners.size() );
for ( BannerBO bannerBO : banners ) {
list.add( bannerBOToUsersBannerVO( bannerBO ) );
}
return list;
}
protected UsersBannerVO bannerBOToUsersBannerVO(BannerBO bannerBO) {
if ( bannerBO == null ) {
return null;
}
UsersBannerVO usersBannerVO = new UsersBannerVO();
usersBannerVO.setUrl( bannerBO.getUrl() );
usersBannerVO.setPicUrl( bannerBO.getPicUrl() );
return usersBannerVO;
}
}
package cn.iocoder.mall.promotion.application.convert;
import cn.iocoder.mall.promotion.api.bo.CouponCardBO;
import cn.iocoder.mall.promotion.api.bo.CouponCardPageBO;
import cn.iocoder.mall.promotion.application.vo.users.UsersCouponCardPageVO;
import cn.iocoder.mall.promotion.application.vo.users.UsersCouponCardVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:15+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class CouponCardConvertImpl implements CouponCardConvert {
@Override
public UsersCouponCardVO convert(CouponCardBO result) {
if ( result == null ) {
return null;
}
UsersCouponCardVO usersCouponCardVO = new UsersCouponCardVO();
usersCouponCardVO.setId( result.getId() );
usersCouponCardVO.setTemplateId( result.getTemplateId() );
usersCouponCardVO.setTitle( result.getTitle() );
usersCouponCardVO.setStatus( result.getStatus() );
usersCouponCardVO.setPriceAvailable( result.getPriceAvailable() );
usersCouponCardVO.setValidStartTime( result.getValidStartTime() );
usersCouponCardVO.setValidEndTime( result.getValidEndTime() );
usersCouponCardVO.setPreferentialType( result.getPreferentialType() );
usersCouponCardVO.setPercentOff( result.getPercentOff() );
usersCouponCardVO.setPriceOff( result.getPriceOff() );
usersCouponCardVO.setDiscountPriceLimit( result.getDiscountPriceLimit() );
return usersCouponCardVO;
}
@Override
public UsersCouponCardPageVO convert2(CouponCardPageBO result) {
if ( result == null ) {
return null;
}
UsersCouponCardPageVO usersCouponCardPageVO = new UsersCouponCardPageVO();
usersCouponCardPageVO.setList( couponCardBOListToUsersCouponCardVOList( result.getList() ) );
usersCouponCardPageVO.setTotal( result.getTotal() );
return usersCouponCardPageVO;
}
protected List<UsersCouponCardVO> couponCardBOListToUsersCouponCardVOList(List<CouponCardBO> list) {
if ( list == null ) {
return null;
}
List<UsersCouponCardVO> list1 = new ArrayList<UsersCouponCardVO>( list.size() );
for ( CouponCardBO couponCardBO : list ) {
list1.add( convert( couponCardBO ) );
}
return list1;
}
}
package cn.iocoder.mall.promotion.application.convert;
import cn.iocoder.mall.promotion.api.bo.CouponTemplateBO;
import cn.iocoder.mall.promotion.api.bo.CouponTemplatePageBO;
import cn.iocoder.mall.promotion.application.convert.CouponTemplateConvert.Admins;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplatePageVO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplateVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:15+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class CouponTemplateConvert$AdminsImpl implements Admins {
@Override
public AdminsCouponTemplateVO convert(CouponTemplateBO template) {
if ( template == null ) {
return null;
}
AdminsCouponTemplateVO adminsCouponTemplateVO = new AdminsCouponTemplateVO();
adminsCouponTemplateVO.setId( template.getId() );
adminsCouponTemplateVO.setTitle( template.getTitle() );
adminsCouponTemplateVO.setDescription( template.getDescription() );
adminsCouponTemplateVO.setType( template.getType() );
adminsCouponTemplateVO.setCodeType( template.getCodeType() );
adminsCouponTemplateVO.setStatus( template.getStatus() );
adminsCouponTemplateVO.setQuota( template.getQuota() );
adminsCouponTemplateVO.setTotal( template.getTotal() );
adminsCouponTemplateVO.setPriceAvailable( template.getPriceAvailable() );
adminsCouponTemplateVO.setRangeType( template.getRangeType() );
adminsCouponTemplateVO.setRangeValues( template.getRangeValues() );
adminsCouponTemplateVO.setDateType( template.getDateType() );
adminsCouponTemplateVO.setValidStartTime( template.getValidStartTime() );
adminsCouponTemplateVO.setValidEndTime( template.getValidEndTime() );
adminsCouponTemplateVO.setFixedStartTerm( template.getFixedStartTerm() );
adminsCouponTemplateVO.setFixedEndTerm( template.getFixedEndTerm() );
adminsCouponTemplateVO.setPreferentialType( template.getPreferentialType() );
adminsCouponTemplateVO.setPercentOff( template.getPercentOff() );
adminsCouponTemplateVO.setPriceOff( template.getPriceOff() );
adminsCouponTemplateVO.setDiscountPriceLimit( template.getDiscountPriceLimit() );
adminsCouponTemplateVO.setStatFetchNum( template.getStatFetchNum() );
adminsCouponTemplateVO.setCreateTime( template.getCreateTime() );
return adminsCouponTemplateVO;
}
@Override
public AdminsCouponTemplatePageVO convertPage(CouponTemplatePageBO result) {
if ( result == null ) {
return null;
}
AdminsCouponTemplatePageVO adminsCouponTemplatePageVO = new AdminsCouponTemplatePageVO();
adminsCouponTemplatePageVO.setList( convertList( result.getList() ) );
adminsCouponTemplatePageVO.setTotal( result.getTotal() );
return adminsCouponTemplatePageVO;
}
@Override
public List<AdminsCouponTemplateVO> convertList(List<CouponTemplateBO> templates) {
if ( templates == null ) {
return null;
}
List<AdminsCouponTemplateVO> list = new ArrayList<AdminsCouponTemplateVO>( templates.size() );
for ( CouponTemplateBO couponTemplateBO : templates ) {
list.add( convert( couponTemplateBO ) );
}
return list;
}
}
package cn.iocoder.mall.promotion.application.convert;
import cn.iocoder.mall.promotion.api.bo.CouponTemplateBO;
import cn.iocoder.mall.promotion.application.convert.CouponTemplateConvert.Users;
import cn.iocoder.mall.promotion.application.vo.users.UsersCouponTemplateVO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:15+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class CouponTemplateConvert$UsersImpl implements Users {
@Override
public UsersCouponTemplateVO convert2(CouponTemplateBO template) {
if ( template == null ) {
return null;
}
UsersCouponTemplateVO usersCouponTemplateVO = new UsersCouponTemplateVO();
usersCouponTemplateVO.setId( template.getId() );
usersCouponTemplateVO.setTitle( template.getTitle() );
usersCouponTemplateVO.setStatus( template.getStatus() );
usersCouponTemplateVO.setPriceAvailable( template.getPriceAvailable() );
usersCouponTemplateVO.setRangeType( template.getRangeType() );
usersCouponTemplateVO.setRangeValues( template.getRangeValues() );
usersCouponTemplateVO.setDateType( template.getDateType() );
usersCouponTemplateVO.setValidStartTime( template.getValidStartTime() );
usersCouponTemplateVO.setValidEndTime( template.getValidEndTime() );
usersCouponTemplateVO.setFixedStartTerm( template.getFixedStartTerm() );
usersCouponTemplateVO.setFixedEndTerm( template.getFixedEndTerm() );
usersCouponTemplateVO.setPreferentialType( template.getPreferentialType() );
usersCouponTemplateVO.setPercentOff( template.getPercentOff() );
usersCouponTemplateVO.setPriceOff( template.getPriceOff() );
usersCouponTemplateVO.setDiscountPriceLimit( template.getDiscountPriceLimit() );
return usersCouponTemplateVO;
}
}
package cn.iocoder.mall.promotion.application.convert;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:15+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class CouponTemplateConvertImpl implements CouponTemplateConvert {
}
package cn.iocoder.mall.promotion.application.convert;
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendPageVO;
import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendVO;
import cn.iocoder.mall.promotion.application.vo.users.UsersProductRecommendVO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:39:16+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductRecommendConvertImpl implements ProductRecommendConvert {
@Override
public AdminsProductRecommendVO convert(ProductRecommendBO bannerBO) {
if ( bannerBO == null ) {
return null;
}
AdminsProductRecommendVO adminsProductRecommendVO = new AdminsProductRecommendVO();
adminsProductRecommendVO.setId( bannerBO.getId() );
adminsProductRecommendVO.setType( bannerBO.getType() );
adminsProductRecommendVO.setProductSpuId( bannerBO.getProductSpuId() );
adminsProductRecommendVO.setSort( bannerBO.getSort() );
adminsProductRecommendVO.setStatus( bannerBO.getStatus() );
adminsProductRecommendVO.setMemo( bannerBO.getMemo() );
adminsProductRecommendVO.setCreateTime( bannerBO.getCreateTime() );
return adminsProductRecommendVO;
}
@Override
public AdminsProductRecommendPageVO convert(ProductRecommendPageBO result) {
if ( result == null ) {
return null;
}
AdminsProductRecommendPageVO adminsProductRecommendPageVO = new AdminsProductRecommendPageVO();
adminsProductRecommendPageVO.setList( productRecommendBOListToAdminsProductRecommendVOList( result.getList() ) );
adminsProductRecommendPageVO.setTotal( result.getTotal() );
return adminsProductRecommendPageVO;
}
@Override
public UsersProductRecommendVO convert(ProductSpuBO productSpu) {
if ( productSpu == null ) {
return null;
}
UsersProductRecommendVO usersProductRecommendVO = new UsersProductRecommendVO();
usersProductRecommendVO.setId( productSpu.getId() );
usersProductRecommendVO.setName( productSpu.getName() );
usersProductRecommendVO.setSellPoint( productSpu.getSellPoint() );
List<String> list = productSpu.getPicUrls();
if ( list != null ) {
usersProductRecommendVO.setPicUrls( new ArrayList<String>( list ) );
}
usersProductRecommendVO.setPrice( productSpu.getPrice() );
return usersProductRecommendVO;
}
protected List<AdminsProductRecommendVO> productRecommendBOListToAdminsProductRecommendVOList(List<ProductRecommendBO> list) {
if ( list == null ) {
return null;
}
List<AdminsProductRecommendVO> list1 = new ArrayList<AdminsProductRecommendVO>( list.size() );
for ( ProductRecommendBO productRecommendBO : list ) {
list1.add( convert( productRecommendBO ) );
}
return list1;
}
}
spring:
# datasource
datasource:
url: jdbc:mysql://192.168.88.14:3306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: ${MALL_MYSQL_PASSWORD}
spring:
# datasource
datasource:
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://180.167.213.26:13306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name: com.mysql.jdbc.Driver
username: root
password: ${MALL_MYSQL_PASSWORD}
# TODO 芋艿, 后续优化下 druid 参数
druid:
initial-size: 5
max-active: 5
max-wait: 10000
# mybatis-plus
mybatis-plus:
configuration:
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
global-config:
db-config:
id-type: auto
mapper-locations: classpath*:mapper/*.xml
type-aliases-package: cn.iocoder.mall.promotion.biz.dataobject
# dubbo
dubbo:
application:
name: promotion-service
registry:
address: zookeeper://127.0.0.1:2181
protocol:
port: -1
name: dubbo
scan:
base-packages: cn.iocoder.mall.promotion.biz.service
consumer:
ProductSpuService:
version: 1.0.0
provider:
filter: -exception
BannerService:
version: 1.0.0
CouponService:
version: 1.0.0
ProductRecommendService:
version: 1.0.0
PromotionActivityService:
version: 1.0.0
# logging
logging:
level:
cn.iocoder.mall.promotion.dao: debug
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 = ""
}
}
<?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.promotion.biz.dao.BannerMapper">
<sql id="FIELDS">
id, title, url, pic_url, sort,
status, memo, create_time
</sql>
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="BannerDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM banner-->
<!-- WHERE pid = #{pid}-->
<!-- AND status = #{status}-->
<!-- AND deleted = 0-->
<!-- ORDER BY sort ASC-->
<!-- </select>-->
<!-- <select id="selectList" resultType="BannerDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM banner-->
<!-- WHERE deleted = 0-->
<!-- </select>-->
<select id="selectById" parameterType="Integer" resultType="BannerDO">
SELECT
<include refid="FIELDS" />
FROM banner
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectListByStatus" parameterType="Integer" resultType="BannerDO">
SELECT
<include refid="FIELDS" />
FROM banner
<where>
<if test="status != null">
status = #{status}
</if>
AND deleted = 0
</where>
</select>
<select id="selectListByTitleLike" resultType="BannerDO">
SELECT
<include refid="FIELDS" />
FROM banner
<where>
<if test="title != null">
title LIKE "%"#{title}"%"
</if>
AND deleted = 0
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectCountByTitleLike" resultType="Integer">
SELECT
COUNT(1)
FROM banner
<where>
<if test="title != null">
title LIKE "%"#{title}"%"
</if>
AND deleted = 0
</where>
</select>
<insert id="insert" parameterType="BannerDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO banner (
title, url, pic_url, sort, status,
memo, create_time, deleted
) VALUES (
#{title}, #{url}, #{picUrl}, #{sort}, #{status},
#{memo}, #{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="BannerDO">
UPDATE banner
<set>
<if test="title != null">
title = #{title},
</if>
<if test="url != null">
url = #{url},
</if>
<if test="picUrl != null">
pic_url = #{picUrl} ,
</if>
<if test="sort != null">
sort = #{sort},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="memo != null">
memo = #{memo},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
<?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.promotion.biz.dao.CouponCardMapper">
<sql id="FIELDS">
id, template_id, title, status, user_id, take_type,
price_available, valid_start_time, valid_end_time, preferential_type, percent_off, price_off,
discount_price_limit, used_time,
create_time
</sql>
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="CouponCardDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM coupon_card-->
<!-- WHERE pid = #{pid}-->
<!-- AND status = #{status}-->
<!-- AND deleted = 0-->
<!-- ORDER BY sort ASC-->
<!-- </select>-->
<!-- <select id="selectList" resultType="CouponCardDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM coupon_card-->
<!-- WHERE deleted = 0-->
<!-- </select>-->
<select id="selectById" parameterType="Integer" resultType="CouponCardDO">
SELECT
<include refid="FIELDS" />
FROM coupon_card
WHERE id = #{id}
</select>
<select id="selectListByUserIdAndStatus" resultType="CouponCardDO">
SELECT
<include refid="FIELDS" />
FROM coupon_card
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
</select>
<select id="selectListByPage" resultType="CouponCardDO">
SELECT
<include refid="FIELDS" />
FROM coupon_card
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectCountByPage" resultType="Integer">
SELECT
COUNT(1)
FROM coupon_card
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="status != null">
AND status = #{status}
</if>
</where>
</select>
<select id="selectCountByUserIdAndTemplateId" resultType="Integer">
SELECT
COUNT(1)
FROM coupon_card
<where>
<if test="userId != null">
AND user_id = #{userId}
</if>
<if test="templateId != null">
AND template_id = #{templateId}
</if>
</where>
</select>
<insert id="insert" parameterType="CouponCardDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO coupon_card (
template_id, title, status, user_id, take_type,
price_available, valid_start_time, valid_end_time, preferential_type, percent_off, price_off,
discount_price_limit, used_time,
create_time
) VALUES (
#{templateId}, #{title}, #{status}, #{userId}, #{takeType},
#{priceAvailable}, #{validStartTime}, #{validEndTime}, #{preferentialType}, #{percentOff}, #{priceOff},
#{discountPriceLimit}, #{usedTime},
#{createTime}
)
</insert>
<update id="update" parameterType="CouponCardDO">
UPDATE coupon_card
<set>
<if test="status != null">
status = #{status},
</if>
<if test="usedTime != null">
used_time = #{usedTime},
</if>
</set>
WHERE id = #{id}
</update>
<update id="updateByIdAndStatus">
UPDATE coupon_card
<set>
<if test="updateObj.status != null">
status = #{updateObj.status},
</if>
<if test="updateObj.usedTime != null">
used_time = #{updateObj.usedTime},
</if>
</set>
WHERE id = #{id}
AND status = #{status}
</update>
</mapper>
<?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.promotion.biz.dao.CouponTemplateMapper">
<sql id="FIELDS">
id, title, description, type, code_type,
status, quota, total, price_available, range_type,
range_values, date_type, valid_start_time, valid_end_time, fixed_start_term, fixed_end_term,
preferential_type, percent_off, price_off, discount_price_limit, stat_fetch_num,
create_time
</sql>
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="CouponTemplateDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM coupon_template-->
<!-- WHERE pid = #{pid}-->
<!-- AND status = #{status}-->
<!-- AND deleted = 0-->
<!-- ORDER BY sort ASC-->
<!-- </select>-->
<!-- <select id="selectList" resultType="CouponTemplateDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM coupon_template-->
<!-- WHERE deleted = 0-->
<!-- </select>-->
<select id="selectById" parameterType="Integer" resultType="CouponTemplateDO">
SELECT
<include refid="FIELDS" />
FROM coupon_template
WHERE id = #{id}
</select>
<select id="selectListByIds" resultType="CouponTemplateDO">
SELECT
<include refid="FIELDS"/>
FROM coupon_template
WHERE id IN
<foreach item="id" collection="ids" separator="," open="(" close=")" index="">
#{id}
</foreach>
</select>
<select id="selectListByPage" resultType="CouponTemplateDO">
SELECT
<include refid="FIELDS" />
FROM coupon_template
<where>
<if test="type != null">
AND type = #{type}
</if>
<if test="title != null">
AND title LIKE "%"#{title}"%"
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="preferentialType != null">
AND preferential_type = #{preferentialType}
</if>
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectCountByPage" resultType="Integer">
SELECT
COUNT(1)
FROM coupon_template
<where>
<if test="type != null">
AND type = #{type}
</if>
<if test="title != null">
AND title LIKE "%"#{title}"%"
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="preferentialType != null">
AND preferential_type = #{preferentialType}
</if>
</where>
</select>
<insert id="insert" parameterType="CouponTemplateDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO coupon_template (
title, description, type, code_type,
status, quota, total, price_available, range_type,
range_values, date_type, valid_start_time, valid_end_time, fixed_start_term, fixed_end_term,
preferential_type, percent_off, price_off, discount_price_limit, stat_fetch_num,
create_time
) VALUES (
#{title}, #{description}, #{type}, #{codeType},
#{status}, #{quota}, #{total}, #{priceAvailable}, #{rangeType},
#{rangeValues}, #{dateType}, #{validStartTime}, #{validEndTime}, #{fixedStartTerm}, #{fixedEndTerm}
#{preferentialType}, #{percentOff}, #{priceOff}, #{discountPriceLimit}, #{statFetchNum},
#{createTime}
)
</insert>
<update id="update" parameterType="CouponTemplateDO">
UPDATE coupon_template
<set>
<if test="title != null">
title = #{title},
</if>
<if test="description != null">
description = #{description},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="quota != null">
quota = #{quota},
</if>
<if test="total != null">
total = #{total},
</if>
<if test="priceAvailable != null">
price_available = #{priceAvailable},
</if>
<if test="rangeType != null">
range_type = #{rangeType},
</if>
<if test="rangeValues != null">
range_values = #{rangeValues},
</if>
<if test="dateType != null">
date_type = #{dateType},
</if>
<if test="validStartTime != null">
valid_start_time = #{validStartTime},
</if>
<if test="validEndTime != null">
valid_end_time = #{validEndTime},
</if>
<if test="fixedStartTerm != null">
fixed_start_term = #{fixedStartTerm},
</if>
<if test="fixedEndTerm != null">
fixed_end_term = #{fixedEndTerm},
</if>
<if test="preferentialType != null">
preferential_type = #{preferentialType},
</if>
<if test="percentOff != null">
percent_off = #{percentOff},
</if>
<if test="priceOff != null">
price_off = #{priceOff},
</if>
<if test="discountPriceLimit != null">
discount_price_limit = #{discountPriceLimit},
</if>
</set>
WHERE id = #{id}
</update>
<update id="updateStatFetchNumIncr" parameterType="Integer">
UPDATE coupon_template
SET stat_fetch_Num = stat_fetch_Num + 1
WHERE id = #{id}
AND total > stat_fetch_Num
</update>
</mapper>
<?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.promotion.biz.dao.ProductRecommendMapper">
<sql id="FIELDS">
id, type, product_spu_id, sort,
status, memo, create_time
</sql>
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="ProductRecommendDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM product_recommend-->
<!-- WHERE pid = #{pid}-->
<!-- AND status = #{status}-->
<!-- AND deleted = 0-->
<!-- ORDER BY sort ASC-->
<!-- </select>-->
<!-- <select id="selectList" resultType="ProductRecommendDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM product_recommend-->
<!-- WHERE deleted = 0-->
<!-- </select>-->
<select id="selectById" parameterType="Integer" resultType="ProductRecommendDO">
SELECT
<include refid="FIELDS" />
FROM product_recommend
WHERE id = #{id}
AND deleted = 0
</select>
<select id="selectByProductSpuIdAndType" resultType="ProductRecommendDO">
SELECT
<include refid="FIELDS" />
FROM product_recommend
<where>
<if test="productSpuId != null">
product_spu_id = #{productSpuId}
</if>
<if test="type != null">
AND type = #{type}
</if>
AND deleted = 0
</where>
</select>
<select id="selectListByTypeAndStatus" parameterType="Integer" resultType="ProductRecommendDO">
SELECT
<include refid="FIELDS" />
FROM product_recommend
<where>
<if test="type != null">
type = #{type}
</if>
<if test="status != null">
AND status = #{status}
</if>
AND deleted = 0
</where>
</select>
<select id="selectPageByType" resultType="ProductRecommendDO">
SELECT
<include refid="FIELDS" />
FROM product_recommend
<where>
<if test="type != null">
type = #{type}
</if>
AND deleted = 0
</where>
LIMIT #{offset}, #{limit}
</select>
<select id="selectCountByType" resultType="Integer">
SELECT
COUNT(1)
FROM product_recommend
<where>
<if test="type != null">
type = #{type}
</if>
AND deleted = 0
</where>
</select>
<insert id="insert" parameterType="ProductRecommendDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO product_recommend (
type, product_spu_id, sort, status, memo,
create_time, deleted
) VALUES (
#{type}, #{productSpuId}, #{sort}, #{status}, #{memo},
#{createTime}, #{deleted}
)
</insert>
<update id="update" parameterType="ProductRecommendDO">
UPDATE product_recommend
<set>
<if test="type != null">
type = #{type},
</if>
<if test="productSpuId != null">
product_spu_id = #{productSpuId},
</if>
<if test="sort != null">
sort = #{sort},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="memo != null">
memo = #{memo},
</if>
<if test="deleted != null">
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
<?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.promotion.biz.dao.PromotionActivityMapper">
<sql id="FIELDS">
id, title, activity_type, status, start_time,
end_time, invalid_time, delete_time, time_limited_discount, full_privilege,
create_time, update_time
</sql>
<resultMap id="PromotionActivityResultMap" type="PromotionActivityDO">
<result property="timeLimitedDiscount" column="time_limited_discount" javaType="cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO$TimeLimitedDiscount" typeHandler="cn.iocoder.common.framework.mybatis.JSONTypeHandler"/>
<result property="fullPrivilege" column="full_privilege" javaType="cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO$FullPrivilege" typeHandler="cn.iocoder.common.framework.mybatis.JSONTypeHandler"/>
</resultMap>
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="PromotionActivityDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM banner-->
<!-- WHERE pid = #{pid}-->
<!-- AND status = #{status}-->
<!-- AND deleted = 0-->
<!-- ORDER BY sort ASC-->
<!-- </select>-->
<!-- <select id="selectList" resultType="PromotionActivityDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM banner-->
<!-- WHERE deleted = 0-->
<!-- </select>-->
<select id="selectById" parameterType="Integer" resultMap="PromotionActivityResultMap">
SELECT
<include refid="FIELDS" />
FROM promotion_activity
WHERE id = #{id}
</select>
<select id="selectListByStatus" resultMap="PromotionActivityResultMap">
SELECT
<include refid="FIELDS" />
FROM promotion_activity
WHERE status IN
<foreach item="status" collection="statuses" separator="," open="(" close=")" index="">
#{status}
</foreach>
</select>
<!-- <select id="selectListByStatus" parameterType="Integer" resultType="PromotionActivityDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM banner-->
<!-- <where>-->
<!-- <if test="status != null">-->
<!-- status = #{status}-->
<!-- </if>-->
<!-- AND deleted = 0-->
<!-- </where>-->
<!-- </select>-->
<select id="selectListByPage" resultMap="PromotionActivityResultMap">
SELECT
<include refid="FIELDS" />
FROM promotion_activity
WHERE activity_type = #{activityType}
<if test="title != null">
AND title LIKE "%"#{title}"%"
</if>
AND status IN
<foreach item="status" collection="statuses" separator="," open="(" close=")" index="">
#{status}
</foreach>
LIMIT #{offset}, #{limit}
</select>
<select id="selectCountByPage" resultType="Integer">
SELECT
COUNT(1)
FROM promotion_activity
WHERE activity_type = #{activityType}
<if test="title != null">
AND title LIKE "%"#{title}"%"
</if>
AND status IN
<foreach item="status" collection="statuses" separator="," open="(" close=")" index="">
#{status}
</foreach>
</select>
<insert id="insert" parameterType="PromotionActivityDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO promotion_activity (
title, activity_type, status, start_time,
end_time, invalid_time, delete_time,
time_limited_discount,
full_privilege,
create_time
) VALUES (
#{title}, #{activityType}, #{status}, #{startTime},
#{endTime}, #{invalidTime}, #{deleteTime},
#{timeLimitedDiscount, typeHandler=cn.iocoder.common.framework.mybatis.JSONTypeHandler},
#{fullPrivilege, typeHandler=cn.iocoder.common.framework.mybatis.JSONTypeHandler},
#{createTime}
)
</insert>
<!-- <update id="update" parameterType="PromotionActivityDO">-->
<!-- UPDATE banner-->
<!-- <set>-->
<!-- <if test="title != null">-->
<!-- title = #{title},-->
<!-- </if>-->
<!-- <if test="url != null">-->
<!-- url = #{url},-->
<!-- </if>-->
<!-- <if test="picUrl != null">-->
<!-- pic_url = #{picUrl} ,-->
<!-- </if>-->
<!-- <if test="sort != null">-->
<!-- sort = #{sort},-->
<!-- </if>-->
<!-- <if test="status != null">-->
<!-- status = #{status},-->
<!-- </if>-->
<!-- <if test="memo != null">-->
<!-- memo = #{memo},-->
<!-- </if>-->
<!-- <if test="deleted != null">-->
<!-- deleted = #{deleted}-->
<!-- </if>-->
<!-- </set>-->
<!-- WHERE id = #{id}-->
<!-- </update>-->
</mapper>
registry {
type = "file"
file {
name = "file.conf"
}
zk {
cluster = "default"
serverAddr = "192.168.88.10:2181"
session.timeout = 6000
connect.timeout = 2000
}
}
package cn.iocoder.mall.promotion.biz.convert;
import cn.iocoder.mall.promotion.api.bo.BannerBO;
import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
import cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO;
import cn.iocoder.mall.promotion.biz.dataobject.BannerDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:52+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class BannerConvertImpl implements BannerConvert {
@Override
public BannerBO convertToBO(BannerDO banner) {
if ( banner == null ) {
return null;
}
BannerBO bannerBO = new BannerBO();
bannerBO.setId( banner.getId() );
bannerBO.setTitle( banner.getTitle() );
bannerBO.setUrl( banner.getUrl() );
bannerBO.setPicUrl( banner.getPicUrl() );
bannerBO.setSort( banner.getSort() );
bannerBO.setStatus( banner.getStatus() );
bannerBO.setMemo( banner.getMemo() );
bannerBO.setCreateTime( banner.getCreateTime() );
return bannerBO;
}
@Override
public List<BannerBO> convertToBO(List<BannerDO> bannerList) {
if ( bannerList == null ) {
return null;
}
List<BannerBO> list = new ArrayList<BannerBO>( bannerList.size() );
for ( BannerDO bannerDO : bannerList ) {
list.add( convertToBO( bannerDO ) );
}
return list;
}
@Override
public BannerDO convert(BannerAddDTO bannerAddDTO) {
if ( bannerAddDTO == null ) {
return null;
}
BannerDO bannerDO = new BannerDO();
bannerDO.setTitle( bannerAddDTO.getTitle() );
bannerDO.setUrl( bannerAddDTO.getUrl() );
bannerDO.setPicUrl( bannerAddDTO.getPicUrl() );
bannerDO.setSort( bannerAddDTO.getSort() );
bannerDO.setMemo( bannerAddDTO.getMemo() );
return bannerDO;
}
@Override
public BannerDO convert(BannerUpdateDTO bannerUpdateDTO) {
if ( bannerUpdateDTO == null ) {
return null;
}
BannerDO bannerDO = new BannerDO();
bannerDO.setId( bannerUpdateDTO.getId() );
bannerDO.setTitle( bannerUpdateDTO.getTitle() );
bannerDO.setUrl( bannerUpdateDTO.getUrl() );
bannerDO.setPicUrl( bannerUpdateDTO.getPicUrl() );
bannerDO.setSort( bannerUpdateDTO.getSort() );
bannerDO.setMemo( bannerUpdateDTO.getMemo() );
return bannerDO;
}
}
package cn.iocoder.mall.promotion.biz.convert;
import cn.iocoder.mall.promotion.api.bo.CouponCardAvailableBO;
import cn.iocoder.mall.promotion.api.bo.CouponCardBO;
import cn.iocoder.mall.promotion.api.bo.CouponCardDetailBO;
import cn.iocoder.mall.promotion.biz.dataobject.CouponCardDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:52+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class CouponCardConvertImpl implements CouponCardConvert {
@Override
public List<CouponCardBO> convertToBO(List<CouponCardDO> cardList) {
if ( cardList == null ) {
return null;
}
List<CouponCardBO> list = new ArrayList<CouponCardBO>( cardList.size() );
for ( CouponCardDO couponCardDO : cardList ) {
list.add( convert( couponCardDO ) );
}
return list;
}
@Override
public CouponCardBO convert(CouponCardDO card) {
if ( card == null ) {
return null;
}
CouponCardBO couponCardBO = new CouponCardBO();
couponCardBO.setId( card.getId() );
couponCardBO.setTemplateId( card.getTemplateId() );
couponCardBO.setTitle( card.getTitle() );
couponCardBO.setStatus( card.getStatus() );
couponCardBO.setUserId( card.getUserId() );
couponCardBO.setTakeType( card.getTakeType() );
couponCardBO.setPriceAvailable( card.getPriceAvailable() );
couponCardBO.setValidStartTime( card.getValidStartTime() );
couponCardBO.setValidEndTime( card.getValidEndTime() );
couponCardBO.setPreferentialType( card.getPreferentialType() );
couponCardBO.setPercentOff( card.getPercentOff() );
couponCardBO.setPriceOff( card.getPriceOff() );
couponCardBO.setDiscountPriceLimit( card.getDiscountPriceLimit() );
couponCardBO.setUsedTime( card.getUsedTime() );
couponCardBO.setCreateTime( card.getCreateTime() );
return couponCardBO;
}
@Override
public CouponCardDetailBO convert2(CouponCardDO card) {
if ( card == null ) {
return null;
}
CouponCardDetailBO couponCardDetailBO = new CouponCardDetailBO();
couponCardDetailBO.setId( card.getId() );
couponCardDetailBO.setTemplateId( card.getTemplateId() );
couponCardDetailBO.setTitle( card.getTitle() );
couponCardDetailBO.setStatus( card.getStatus() );
couponCardDetailBO.setUserId( card.getUserId() );
couponCardDetailBO.setTakeType( card.getTakeType() );
couponCardDetailBO.setPriceAvailable( card.getPriceAvailable() );
couponCardDetailBO.setValidStartTime( card.getValidStartTime() );
couponCardDetailBO.setValidEndTime( card.getValidEndTime() );
couponCardDetailBO.setPreferentialType( card.getPreferentialType() );
couponCardDetailBO.setPercentOff( card.getPercentOff() );
couponCardDetailBO.setPriceOff( card.getPriceOff() );
couponCardDetailBO.setDiscountPriceLimit( card.getDiscountPriceLimit() );
couponCardDetailBO.setUsedTime( card.getUsedTime() );
couponCardDetailBO.setCreateTime( card.getCreateTime() );
return couponCardDetailBO;
}
@Override
public CouponCardAvailableBO convert2(CouponCardDO card, boolean x) {
if ( card == null ) {
return null;
}
CouponCardAvailableBO couponCardAvailableBO = new CouponCardAvailableBO();
if ( card != null ) {
couponCardAvailableBO.setId( card.getId() );
couponCardAvailableBO.setTemplateId( card.getTemplateId() );
couponCardAvailableBO.setTitle( card.getTitle() );
couponCardAvailableBO.setStatus( card.getStatus() );
couponCardAvailableBO.setUserId( card.getUserId() );
couponCardAvailableBO.setTakeType( card.getTakeType() );
couponCardAvailableBO.setPriceAvailable( card.getPriceAvailable() );
couponCardAvailableBO.setValidStartTime( card.getValidStartTime() );
couponCardAvailableBO.setValidEndTime( card.getValidEndTime() );
couponCardAvailableBO.setPreferentialType( card.getPreferentialType() );
couponCardAvailableBO.setPercentOff( card.getPercentOff() );
couponCardAvailableBO.setPriceOff( card.getPriceOff() );
couponCardAvailableBO.setDiscountPriceLimit( card.getDiscountPriceLimit() );
couponCardAvailableBO.setUsedTime( card.getUsedTime() );
couponCardAvailableBO.setCreateTime( card.getCreateTime() );
}
return couponCardAvailableBO;
}
}
package cn.iocoder.mall.promotion.biz.convert;
import cn.iocoder.mall.promotion.api.bo.CouponTemplateBO;
import cn.iocoder.mall.promotion.api.dto.CouponCardTemplateAddDTO;
import cn.iocoder.mall.promotion.api.dto.CouponCardTemplateUpdateDTO;
import cn.iocoder.mall.promotion.api.dto.CouponCodeTemplateAddDTO;
import cn.iocoder.mall.promotion.api.dto.CouponCodeTemplateUpdateDTO;
import cn.iocoder.mall.promotion.biz.dataobject.CouponTemplateDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:52+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class CouponTemplateConvertImpl implements CouponTemplateConvert {
@Override
public List<CouponTemplateBO> convertToBO(List<CouponTemplateDO> templateList) {
if ( templateList == null ) {
return null;
}
List<CouponTemplateBO> list = new ArrayList<CouponTemplateBO>( templateList.size() );
for ( CouponTemplateDO couponTemplateDO : templateList ) {
list.add( convert( couponTemplateDO ) );
}
return list;
}
@Override
public CouponTemplateDO convert(CouponCodeTemplateUpdateDTO template) {
if ( template == null ) {
return null;
}
CouponTemplateDO couponTemplateDO = new CouponTemplateDO();
return couponTemplateDO;
}
@Override
public CouponTemplateDO convert(CouponCardTemplateAddDTO template) {
if ( template == null ) {
return null;
}
CouponTemplateDO couponTemplateDO = new CouponTemplateDO();
couponTemplateDO.setTitle( template.getTitle() );
couponTemplateDO.setDescription( template.getDescription() );
couponTemplateDO.setQuota( template.getQuota() );
couponTemplateDO.setTotal( template.getTotal() );
couponTemplateDO.setPriceAvailable( template.getPriceAvailable() );
couponTemplateDO.setRangeType( template.getRangeType() );
couponTemplateDO.setRangeValues( template.getRangeValues() );
couponTemplateDO.setDateType( template.getDateType() );
couponTemplateDO.setValidStartTime( template.getValidStartTime() );
couponTemplateDO.setValidEndTime( template.getValidEndTime() );
couponTemplateDO.setFixedEndTerm( template.getFixedEndTerm() );
couponTemplateDO.setPreferentialType( template.getPreferentialType() );
couponTemplateDO.setPercentOff( template.getPercentOff() );
couponTemplateDO.setPriceOff( template.getPriceOff() );
couponTemplateDO.setDiscountPriceLimit( template.getDiscountPriceLimit() );
return couponTemplateDO;
}
@Override
public CouponTemplateDO convert(CouponCardTemplateUpdateDTO template) {
if ( template == null ) {
return null;
}
CouponTemplateDO couponTemplateDO = new CouponTemplateDO();
couponTemplateDO.setId( template.getId() );
couponTemplateDO.setTitle( template.getTitle() );
couponTemplateDO.setDescription( template.getDescription() );
couponTemplateDO.setQuota( template.getQuota() );
couponTemplateDO.setTotal( template.getTotal() );
couponTemplateDO.setRangeType( template.getRangeType() );
couponTemplateDO.setRangeValues( template.getRangeValues() );
return couponTemplateDO;
}
@Override
public CouponTemplateDO convert(CouponCodeTemplateAddDTO template) {
if ( template == null ) {
return null;
}
CouponTemplateDO couponTemplateDO = new CouponTemplateDO();
return couponTemplateDO;
}
@Override
public CouponTemplateBO convert(CouponTemplateDO template) {
if ( template == null ) {
return null;
}
CouponTemplateBO couponTemplateBO = new CouponTemplateBO();
couponTemplateBO.setId( template.getId() );
couponTemplateBO.setTitle( template.getTitle() );
couponTemplateBO.setDescription( template.getDescription() );
couponTemplateBO.setType( template.getType() );
couponTemplateBO.setCodeType( template.getCodeType() );
couponTemplateBO.setStatus( template.getStatus() );
couponTemplateBO.setQuota( template.getQuota() );
couponTemplateBO.setTotal( template.getTotal() );
couponTemplateBO.setPriceAvailable( template.getPriceAvailable() );
couponTemplateBO.setRangeType( template.getRangeType() );
couponTemplateBO.setRangeValues( template.getRangeValues() );
couponTemplateBO.setDateType( template.getDateType() );
couponTemplateBO.setValidStartTime( template.getValidStartTime() );
couponTemplateBO.setValidEndTime( template.getValidEndTime() );
couponTemplateBO.setFixedStartTerm( template.getFixedStartTerm() );
couponTemplateBO.setFixedEndTerm( template.getFixedEndTerm() );
couponTemplateBO.setPreferentialType( template.getPreferentialType() );
couponTemplateBO.setPercentOff( template.getPercentOff() );
couponTemplateBO.setPriceOff( template.getPriceOff() );
couponTemplateBO.setDiscountPriceLimit( template.getDiscountPriceLimit() );
couponTemplateBO.setStatFetchNum( template.getStatFetchNum() );
couponTemplateBO.setCreateTime( template.getCreateTime() );
return couponTemplateBO;
}
}
package cn.iocoder.mall.promotion.biz.convert;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;
import cn.iocoder.mall.promotion.biz.dataobject.ProductRecommendDO;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:52+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class ProductRecommendConvertImpl implements ProductRecommendConvert {
@Override
public ProductRecommendBO convertToBO(ProductRecommendDO recommend) {
if ( recommend == null ) {
return null;
}
ProductRecommendBO productRecommendBO = new ProductRecommendBO();
productRecommendBO.setId( recommend.getId() );
productRecommendBO.setType( recommend.getType() );
productRecommendBO.setProductSpuId( recommend.getProductSpuId() );
productRecommendBO.setSort( recommend.getSort() );
productRecommendBO.setStatus( recommend.getStatus() );
productRecommendBO.setMemo( recommend.getMemo() );
productRecommendBO.setCreateTime( recommend.getCreateTime() );
return productRecommendBO;
}
@Override
public List<ProductRecommendBO> convertToBO(List<ProductRecommendDO> recommendList) {
if ( recommendList == null ) {
return null;
}
List<ProductRecommendBO> list = new ArrayList<ProductRecommendBO>( recommendList.size() );
for ( ProductRecommendDO productRecommendDO : recommendList ) {
list.add( convertToBO( productRecommendDO ) );
}
return list;
}
@Override
public ProductRecommendDO convert(ProductRecommendAddDTO recommendAddDTO) {
if ( recommendAddDTO == null ) {
return null;
}
ProductRecommendDO productRecommendDO = new ProductRecommendDO();
productRecommendDO.setType( recommendAddDTO.getType() );
productRecommendDO.setProductSpuId( recommendAddDTO.getProductSpuId() );
productRecommendDO.setSort( recommendAddDTO.getSort() );
productRecommendDO.setMemo( recommendAddDTO.getMemo() );
return productRecommendDO;
}
@Override
public ProductRecommendDO convert(ProductRecommendUpdateDTO recommendUpdateDTO) {
if ( recommendUpdateDTO == null ) {
return null;
}
ProductRecommendDO productRecommendDO = new ProductRecommendDO();
productRecommendDO.setId( recommendUpdateDTO.getId() );
productRecommendDO.setType( recommendUpdateDTO.getType() );
productRecommendDO.setProductSpuId( recommendUpdateDTO.getProductSpuId() );
productRecommendDO.setSort( recommendUpdateDTO.getSort() );
productRecommendDO.setMemo( recommendUpdateDTO.getMemo() );
return productRecommendDO;
}
}
package cn.iocoder.mall.promotion.biz.convert;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.FullPrivilege.Privilege;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount;
import cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO;
import cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO.FullPrivilege;
import cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO.TimeLimitedDiscount.Item;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2019-05-24T11:38:52+0800",
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_121 (Oracle Corporation)"
)
public class PromotionActivityConvertImpl implements PromotionActivityConvert {
@Override
public PromotionActivityBO convertToBO(PromotionActivityDO activity) {
if ( activity == null ) {
return null;
}
PromotionActivityBO promotionActivityBO = new PromotionActivityBO();
promotionActivityBO.setId( activity.getId() );
promotionActivityBO.setTitle( activity.getTitle() );
promotionActivityBO.setActivityType( activity.getActivityType() );
promotionActivityBO.setStatus( activity.getStatus() );
promotionActivityBO.setStartTime( activity.getStartTime() );
promotionActivityBO.setEndTime( activity.getEndTime() );
promotionActivityBO.setTimeLimitedDiscount( timeLimitedDiscountToTimeLimitedDiscount( activity.getTimeLimitedDiscount() ) );
promotionActivityBO.setFullPrivilege( fullPrivilegeToFullPrivilege( activity.getFullPrivilege() ) );
return promotionActivityBO;
}
@Override
public List<PromotionActivityBO> convertToBO(List<PromotionActivityDO> activityList) {
if ( activityList == null ) {
return null;
}
List<PromotionActivityBO> list = new ArrayList<PromotionActivityBO>( activityList.size() );
for ( PromotionActivityDO promotionActivityDO : activityList ) {
list.add( convertToBO( promotionActivityDO ) );
}
return list;
}
protected cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount.Item itemToItem(Item item) {
if ( item == null ) {
return null;
}
cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount.Item item1 = new cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount.Item();
item1.setSpuId( item.getSpuId() );
item1.setPreferentialType( item.getPreferentialType() );
item1.setPreferentialValue( item.getPreferentialValue() );
return item1;
}
protected List<cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount.Item> itemListToItemList(List<Item> list) {
if ( list == null ) {
return null;
}
List<cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount.Item> list1 = new ArrayList<cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.TimeLimitedDiscount.Item>( list.size() );
for ( Item item : list ) {
list1.add( itemToItem( item ) );
}
return list1;
}
protected TimeLimitedDiscount timeLimitedDiscountToTimeLimitedDiscount(cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO.TimeLimitedDiscount timeLimitedDiscount) {
if ( timeLimitedDiscount == null ) {
return null;
}
TimeLimitedDiscount timeLimitedDiscount1 = new TimeLimitedDiscount();
timeLimitedDiscount1.setQuota( timeLimitedDiscount.getQuota() );
timeLimitedDiscount1.setItems( itemListToItemList( timeLimitedDiscount.getItems() ) );
return timeLimitedDiscount1;
}
protected Privilege privilegeToPrivilege(cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO.FullPrivilege.Privilege privilege) {
if ( privilege == null ) {
return null;
}
Privilege privilege1 = new Privilege();
privilege1.setMeetType( privilege.getMeetType() );
privilege1.setMeetValue( privilege.getMeetValue() );
privilege1.setPreferentialType( privilege.getPreferentialType() );
privilege1.setPreferentialValue( privilege.getPreferentialValue() );
return privilege1;
}
protected List<Privilege> privilegeListToPrivilegeList(List<cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO.FullPrivilege.Privilege> list) {
if ( list == null ) {
return null;
}
List<Privilege> list1 = new ArrayList<Privilege>( list.size() );
for ( cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO.FullPrivilege.Privilege privilege : list ) {
list1.add( privilegeToPrivilege( privilege ) );
}
return list1;
}
protected cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.FullPrivilege fullPrivilegeToFullPrivilege(FullPrivilege fullPrivilege) {
if ( fullPrivilege == null ) {
return null;
}
cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.FullPrivilege fullPrivilege1 = new cn.iocoder.mall.promotion.api.bo.PromotionActivityBO.FullPrivilege();
fullPrivilege1.setRangeType( fullPrivilege.getRangeType() );
List<Integer> list = fullPrivilege.getRangeValues();
if ( list != null ) {
fullPrivilege1.setRangeValues( new ArrayList<Integer>( list ) );
}
fullPrivilege1.setCycled( fullPrivilege.getCycled() );
fullPrivilege1.setPrivileges( privilegeListToPrivilegeList( fullPrivilege.getPrivileges() ) );
return fullPrivilege1;
}
}
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论