Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
7254e1c8
Commit
7254e1c8
authored
Dec 01, 2020
by
ysongq
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dm_dev' of
http://gitlab.ioubuy.cn/yaobenzhang/dm_project
into dm_dev
parents
38367acd
2775c7d9
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
493 additions
and
133 deletions
+493
-133
pom.xml
jz-dm-apigateway/pom.xml
+12
-3
ApiGatewayApplication.java
...rc/main/java/com/jz/dm/gateway/ApiGatewayApplication.java
+2
-3
WebUtils.java
...src/main/java/com/jz/dm/gateway/common/util/WebUtils.java
+1
-0
CheckTimestampFilter.java
...n/java/com/jz/dm/gateway/filter/CheckTimestampFilter.java
+1
-1
SignatureFilter.java
...c/main/java/com/jz/dm/gateway/filter/SignatureFilter.java
+2
-2
VerifySignFilter.java
.../main/java/com/jz/dm/gateway/filter/VerifySignFilter.java
+1
-1
application-dev.yml
jz-dm-apigateway/src/main/resources/application-dev.yml
+74
-34
application.yml
jz-dm-apigateway/src/main/resources/application.yml
+13
-45
DatabaseConfig.java
...l/src/main/java/com/jz/dm/mall/config/DatabaseConfig.java
+1
-1
OrderController.java
...m/jz/dm/mall/moduls/controller/order/OrderController.java
+18
-13
OrderDto.java
...com/jz/dm/mall/moduls/controller/order/bean/OrderDto.java
+296
-0
OrderDao.java
.../src/main/java/com/jz/dm/mall/moduls/mapper/OrderDao.java
+5
-3
OrderService.java
...main/java/com/jz/dm/mall/moduls/service/OrderService.java
+5
-4
OrderServiceImpl.java
.../com/jz/dm/mall/moduls/service/impl/OrderServiceImpl.java
+40
-6
application-test.yml
jz-dm-mall/src/main/resources/application-test.yml
+3
-3
OrderDao.xml
jz-dm-mall/src/main/resources/mapperconf/OrderDao.xml
+19
-14
No files found.
jz-dm-apigateway/pom.xml
View file @
7254e1c8
...
@@ -51,15 +51,24 @@
...
@@ -51,15 +51,24 @@
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpcore
</artifactId>
<artifactId>
httpcore
</artifactId>
<version>
4.4.10
</version>
<version>
4.4.10
</version>
</dependency>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
6.0.6
</version>
</dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<artifactId>
HikariCP
</artifactId>
<version>
3.1.0
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<groupId>
org.apache.httpcomponents
</groupId>
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/ApiGatewayApplication.java
View file @
7254e1c8
...
@@ -9,12 +9,11 @@ import org.springframework.context.annotation.ComponentScan;
...
@@ -9,12 +9,11 @@ import org.springframework.context.annotation.ComponentScan;
* @author key
* @author key
*/
*/
@SpringBootApplication
@SpringBootApplication
@ComponentScan
(
basePackages
=
{
"com.jz.dm"
})
//
@ComponentScan(basePackages = {"com.jz.dm"})
@MapperScan
(
"com.jz.dm.mapper"
)
@MapperScan
(
"com.jz.dm.
gateway.
mapper"
)
public
class
ApiGatewayApplication
{
public
class
ApiGatewayApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ApiGatewayApplication
.
class
,
args
);
SpringApplication
.
run
(
ApiGatewayApplication
.
class
,
args
);
}
}
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/common/util/WebUtils.java
View file @
7254e1c8
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.*
;
import
org.apache.http.client.HttpRequestRetryHandler
;
import
org.apache.http.client.HttpRequestRetryHandler
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
import
org.apache.http.client.entity.UrlEncodedFormEntity
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/filter/CheckTimestampFilter.java
View file @
7254e1c8
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Component;
@Component
@Component
public
class
CheckTimestampFilter
extends
AbstractFilter
{
public
class
CheckTimestampFilter
extends
AbstractFilter
{
@Value
(
"${api.skipFilter}"
)
//
@Value("${api.skipFilter}")
private
boolean
skipFilter
;
private
boolean
skipFilter
;
/**
/**
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/filter/SignatureFilter.java
View file @
7254e1c8
...
@@ -28,8 +28,8 @@ public class SignatureFilter extends AbstractFilter {
...
@@ -28,8 +28,8 @@ public class SignatureFilter extends AbstractFilter {
// @Autowired
// @Autowired
// private IApiWhiteService apiWhiteService;
// private IApiWhiteService apiWhiteService;
@Value
(
"${secret_private}"
)
//
@Value("${secret_private}")
private
String
secretPrivate
;
//
private String secretPrivate;
private
String
encryptData
;
private
String
encryptData
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/filter/VerifySignFilter.java
View file @
7254e1c8
...
@@ -20,7 +20,7 @@ public class VerifySignFilter extends AbstractFilter {
...
@@ -20,7 +20,7 @@ public class VerifySignFilter extends AbstractFilter {
//@Autowired
//@Autowired
//private IApiWhiteService apiWhiteService;
//private IApiWhiteService apiWhiteService;
@Value
(
"${api.skipFilter}"
)
//
@Value("${api.skipFilter}")
private
boolean
skipFilter
;
private
boolean
skipFilter
;
private
final
static
String
CHARSET
=
"UTF-8"
;
private
final
static
String
CHARSET
=
"UTF-8"
;
...
...
jz-dm-apigateway/src/main/resources/application-dev.yml
View file @
7254e1c8
#开发环境配置
# 测试环境配置
#spring:
server
:
# #缓存会话
port
:
8088
# redis:
#contextPath: /resource
# host: 120.76.132.142
# password: redis@123
management
:
# port: 6379
port
:
54001
# timeout: 10000
health
:
# lettuce:
mail
:
# pool:
enabled
:
false
# max-active: 8
# max-wait: -1ms
spring
:
# min-idle: 0
profiles
:
test
# max-idle: 8
#
数据库
datasource
:
datasource
:
url
:
jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com/wj-mkt-project?serverTimezone=GMT%2B8&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false
url
:
jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project?characterEncoding=utf8&useSSL=false
driverClassName
:
com.mysql.jdbc.Driver
username
:
root
username
:
root
password
:
I%ou$buy!ok
password
:
I%ou$buy!ok
type
:
com.zaxxer.hikari.HikariDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
#监控统计拦截的filters
hikari
:
filters
:
stat
minimum-idle
:
20
#配置初始化大小/最小/最大
maximum-pool-size
:
100
initialSize
:
1
auto-commit
:
true
minIdle
:
1
idle-timeout
:
30000
maxActive
:
20
pool-name
:
MyHikariCP
#获取连接等待超时时间
max-lifetime
:
1800000
maxWait
:
60000
connection-timeout
:
30000
#间隔多久进行一次检测,检测需要关闭的空闲连接
connection-test-query
:
SELECT 1
timeBetweenEvictionRunsMillis
:
60000
#一个连接在池中最小生存的时间
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 'x'
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
#打开PSCache,并指定每个连接上PSCache的大小。
#oracle设为true,mysql设为false。分库分表较多推荐设置为false
poolPreparedStatements
:
false
maxPoolPreparedStatementPerConnectionSize
:
20
cache
:
type
:
CAFFEINE
caffeine
:
spec
:
maximumSize=1000,expireAfterWrite=30s
public-key
:
rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
redis
:
#database: 0
#host: 119.23.13.83
#port: 8007
#timeout: 5000
cluster
:
nodes
:
-
192.168.31.167:6379
-
192.168.31.167:6380
-
192.168.31.167:6381
-
192.168.31.167:6382
-
192.168.31.167:6383
-
192.168.31.167:6384
#使用redis管理session设置为redis,否则none
session
:
store-type
:
none
#mybatis的配置
mybatis
:
#配置mapper.xml文件所在路径
mapper-locations
:
classpath:mapper.*/*.xml
#配置映射类所在的包名
type-aliases-package
:
com.jz.manage.moduls.entity
logging
:
level
:
com.jz.manage
:
debug
# 跳过签名
# 跳过签名
api
:
api
:
...
...
jz-dm-apigateway/src/main/resources/application.yml
View file @
7254e1c8
#服务端口和项目名称
# 系统信息
server
:
info
:
port
:
8088
app
:
servlet
:
name
:
"
@project.name@"
context-path
:
/
description
:
"
@project.description@"
version
:
"
@project.version@"
spring-boot-version
:
"
@project.parent.version@"
##Djasypt.encryptor.password
#jasypt:
# encryptor:
# password: btcpay.com
#日志打印
logging
:
level
:
com.netflix.discovery
:
'
OFF'
org.springframework.cloud
:
'
DEBUG'
#SPRING配置文件
spring
:
spring
:
application
:
name
:
九章数据平台
aop
:
proxy-target-class
:
true
profiles
:
profiles
:
active
:
dev
#默认使用的配置文件
active
:
test
http
:
encoding
:
charset
:
UTF-8
jackson
:
time-zone
:
GMT+8
date-format
:
yyyy-MM-dd HH:mm:ss
default-property-inclusion
:
NON_NULL
#MyBatis
mybatis-plus
:
mapper-locations
:
classpath:/mapper/**/*.xml
# typeAliasesPackage: com.btcpay.account.domain;com.btcpay.shopping.domain;com.btcpay.order.domain;com.btcpay.merchant.domain;com.btcpay.system.domain
# type-handlers-package: com.btcpay.commons.typehandler
global-config
:
id-type
:
1
field-strategy
:
2
db-column-underline
:
true
refresh-mapper
:
true
configuration
:
map-underscore-to-camel-case
:
true
cache-enabled
:
false
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
sysProperties
:
session-timeout
:
3600
developerList
:
-
name
:
九章
value
:
jz-dm-mall/src/main/java/com/jz/dm/mall/config/DatabaseConfig.java
View file @
7254e1c8
...
@@ -35,7 +35,7 @@ public class DatabaseConfig {
...
@@ -35,7 +35,7 @@ public class DatabaseConfig {
/**
/**
* mapper文件的相对路径
* mapper文件的相对路径
*/
*/
private
static
final
String
MAPPER_LOCATION
=
"classpath:mapperconf
.*
/*.xml"
;
private
static
final
String
MAPPER_LOCATION
=
"classpath:mapperconf/*.xml"
;
private
String
filters
;
private
String
filters
;
private
String
url
;
private
String
url
;
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/order/OrderController.java
View file @
7254e1c8
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
order
;
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
order
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.utils.Result
;
import
com.jz.dm.mall.moduls.controller.order.bean.OrderDto
;
import
com.jz.dm.mall.moduls.entity.Order
;
import
com.jz.dm.mall.moduls.service.OrderService
;
import
com.jz.dm.mall.moduls.service.OrderService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -30,13 +27,21 @@ public class OrderController{
...
@@ -30,13 +27,21 @@ public class OrderController{
@Autowired
@Autowired
private
OrderService
tOrderService
;
private
OrderService
tOrderService
;
@
Ge
tMapping
(
value
=
"/list"
)
@
Pos
tMapping
(
value
=
"/list"
)
@ApiOperation
(
value
=
"订单管理列表(分页查询)"
,
notes
=
"订单列表(分页查询)"
)
@ApiOperation
(
value
=
"订单管理列表(分页查询)"
,
notes
=
"订单列表(分页查询)"
)
public
Result
<
IPage
<
Order
>>
queryPageList
(
Order
order
,
HttpServletRequest
req
)
throws
Exception
{
public
PageInfoResponse
<
OrderDto
>
queryPageList
(
@RequestBody
OrderDto
OrderDto
,
HttpServletRequest
req
)
throws
Exception
{
Result
<
IPage
<
Order
>>
result
=
new
Result
<
IPage
<
Order
>>();
PageInfoResponse
<
OrderDto
>
pageInfo
=
new
PageInfoResponse
<
OrderDto
>();
IPage
<
Order
>
pageList
=
tOrderService
.
queryPage
(
new
Page
<
Order
>(
1
,
2
),
order
);
try
{
pageInfo
=
tOrderService
.
findList
(
OrderDto
,
req
);
}
catch
(
Exception
e
)
{
pageInfo
.
setMessage
(
"查询失败"
);
pageInfo
.
setCode
(
Constants
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
/* Result<IPage<OrderDto>> result = new Result<IPage<OrderDto>>();
IPage<OrderDto> pageList = tOrderService.queryPage(new Page<OrderDto>(1, 2), order);
result.setSuccess(true);
result.setSuccess(true);
result
.
setResult
(
pageList
);
result.setResult(pageList);
*/
return
result
;
return
pageInfo
;
}
}
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/order/bean/OrderDto.java
0 → 100644
View file @
7254e1c8
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
order
.
bean
;
import
com.jz.common.bean.BasePageBean
;
import
io.swagger.annotations.ApiModel
;
import
java.util.Date
;
/**
* 订单表(TOrder)实体类
*
* @author makejava
* @since 2020-12-01 10:41:40
*/
@ApiModel
public
class
OrderDto
extends
BasePageBean
{
private
static
final
long
serialVersionUID
=
651546246975691600L
;
/**
* 订单id
*/
private
Long
orderId
;
/**
* 订单编号
*/
private
String
orderNumber
;
/**
* 用户id
*/
private
Long
customerId
;
/**
* 订单状态:01待支付,02已支付,03已取消
*/
private
String
orderStatus
;
/**
* 订单金额
*/
private
Double
orderMoney
;
/**
* 订单时间
*/
private
Date
orderTime
;
/**
* 卖家id
*/
private
Long
sellerId
;
/**
* 支付金额
*/
private
Double
paymentMoney
;
/**
* 支付时间
*/
private
Date
paymentTime
;
/**
* 支付方式:01余额
*/
private
String
paymentMethod
;
/**
* 优惠金额
*/
private
Double
districtMoney
;
/**
* 购买方式:01年,02季,03月,04次(服务类型)
*/
private
String
purchaseMethod
;
/**
* 商品token
*/
private
String
goodsToken
;
/**
* 盐值
*/
private
String
saltValue
;
/**
* apikey
*/
private
String
apiKey
;
/**
* 生效日期
*/
private
Date
takeEffectTime
;
/**
* 失效日期
*/
private
Date
invalidTime
;
/**
* 价格类型:01免费,02收费
*/
private
String
priceType
;
/**
* 创建人
*/
private
String
crePerson
;
/**
* 创建时间
*/
private
Date
creTime
;
/**
* 更新时间
*/
private
Date
uptTime
;
/**
* 更新人
*/
private
String
uptPerson
;
/**
* 删除标识
*/
private
String
delFlag
;
public
Long
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
Long
orderId
)
{
this
.
orderId
=
orderId
;
}
public
String
getOrderNumber
()
{
return
orderNumber
;
}
public
void
setOrderNumber
(
String
orderNumber
)
{
this
.
orderNumber
=
orderNumber
;
}
public
Long
getCustomerId
()
{
return
customerId
;
}
public
void
setCustomerId
(
Long
customerId
)
{
this
.
customerId
=
customerId
;
}
public
String
getOrderStatus
()
{
return
orderStatus
;
}
public
void
setOrderStatus
(
String
orderStatus
)
{
this
.
orderStatus
=
orderStatus
;
}
public
Double
getOrderMoney
()
{
return
orderMoney
;
}
public
void
setOrderMoney
(
Double
orderMoney
)
{
this
.
orderMoney
=
orderMoney
;
}
public
Date
getOrderTime
()
{
return
orderTime
;
}
public
void
setOrderTime
(
Date
orderTime
)
{
this
.
orderTime
=
orderTime
;
}
public
Long
getSellerId
()
{
return
sellerId
;
}
public
void
setSellerId
(
Long
sellerId
)
{
this
.
sellerId
=
sellerId
;
}
public
Double
getPaymentMoney
()
{
return
paymentMoney
;
}
public
void
setPaymentMoney
(
Double
paymentMoney
)
{
this
.
paymentMoney
=
paymentMoney
;
}
public
Date
getPaymentTime
()
{
return
paymentTime
;
}
public
void
setPaymentTime
(
Date
paymentTime
)
{
this
.
paymentTime
=
paymentTime
;
}
public
String
getPaymentMethod
()
{
return
paymentMethod
;
}
public
void
setPaymentMethod
(
String
paymentMethod
)
{
this
.
paymentMethod
=
paymentMethod
;
}
public
Double
getDistrictMoney
()
{
return
districtMoney
;
}
public
void
setDistrictMoney
(
Double
districtMoney
)
{
this
.
districtMoney
=
districtMoney
;
}
public
String
getPurchaseMethod
()
{
return
purchaseMethod
;
}
public
void
setPurchaseMethod
(
String
purchaseMethod
)
{
this
.
purchaseMethod
=
purchaseMethod
;
}
public
String
getGoodsToken
()
{
return
goodsToken
;
}
public
void
setGoodsToken
(
String
goodsToken
)
{
this
.
goodsToken
=
goodsToken
;
}
public
String
getSaltValue
()
{
return
saltValue
;
}
public
void
setSaltValue
(
String
saltValue
)
{
this
.
saltValue
=
saltValue
;
}
public
String
getApiKey
()
{
return
apiKey
;
}
public
void
setApiKey
(
String
apiKey
)
{
this
.
apiKey
=
apiKey
;
}
public
Date
getTakeEffectTime
()
{
return
takeEffectTime
;
}
public
void
setTakeEffectTime
(
Date
takeEffectTime
)
{
this
.
takeEffectTime
=
takeEffectTime
;
}
public
Date
getInvalidTime
()
{
return
invalidTime
;
}
public
void
setInvalidTime
(
Date
invalidTime
)
{
this
.
invalidTime
=
invalidTime
;
}
public
String
getPriceType
()
{
return
priceType
;
}
public
void
setPriceType
(
String
priceType
)
{
this
.
priceType
=
priceType
;
}
public
String
getCrePerson
()
{
return
crePerson
;
}
public
void
setCrePerson
(
String
crePerson
)
{
this
.
crePerson
=
crePerson
;
}
public
Date
getCreTime
()
{
return
creTime
;
}
public
void
setCreTime
(
Date
creTime
)
{
this
.
creTime
=
creTime
;
}
public
Date
getUptTime
()
{
return
uptTime
;
}
public
void
setUptTime
(
Date
uptTime
)
{
this
.
uptTime
=
uptTime
;
}
public
String
getUptPerson
()
{
return
uptPerson
;
}
public
void
setUptPerson
(
String
uptPerson
)
{
this
.
uptPerson
=
uptPerson
;
}
public
String
getDelFlag
()
{
return
delFlag
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/OrderDao.java
View file @
7254e1c8
package
com
.
jz
.
dm
.
mall
.
moduls
.
mapper
;
package
com
.
jz
.
dm
.
mall
.
moduls
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.dm.mall.moduls.controller.order.bean.OrderDto
;
import
com.jz.dm.mall.moduls.entity.Order
;
import
com.jz.dm.mall.moduls.entity.Order
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 订单表(TOrder)表数据库访问层
* 订单表(TOrder)表数据库访问层
*
*
...
@@ -14,5 +16,5 @@ import com.jz.dm.mall.moduls.entity.Order;
...
@@ -14,5 +16,5 @@ import com.jz.dm.mall.moduls.entity.Order;
public
interface
OrderDao
extends
BaseMapper
<
Order
>
{
public
interface
OrderDao
extends
BaseMapper
<
Order
>
{
IPage
<
Order
>
queryPage
(
Page
<
Order
>
orderPage
,
Order
order
)
;
List
<
OrderDto
>
findList
(
Map
<
String
,
Object
>
param
)
throws
Exception
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/OrderService.java
View file @
7254e1c8
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
;
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jz.dm.mall.moduls.controller.order.bean.OrderDto
;
import
com.jz.dm.mall.moduls.entity.Order
;
import
javax.servlet.http.HttpServletRequest
;
/**
/**
* 订单表(TOrder)表服务接口
* 订单表(TOrder)表服务接口
...
@@ -13,5 +14,5 @@ import com.jz.dm.mall.moduls.entity.Order;
...
@@ -13,5 +14,5 @@ import com.jz.dm.mall.moduls.entity.Order;
public
interface
OrderService
{
public
interface
OrderService
{
IPage
<
Order
>
queryPage
(
Page
<
Order
>
orderPage
,
Order
order
)
;
PageInfoResponse
<
OrderDto
>
findList
(
OrderDto
order
,
HttpServletRequest
req
)
throws
Exception
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/OrderServiceImpl.java
View file @
7254e1c8
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.github.pagehelper.PageHelper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.entity.User
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dm.mall.moduls.entity.Order
;
import
com.jz.common.constant.Constants
;
import
com.jz.dm.mall.moduls.controller.order.bean.OrderDto
;
import
com.jz.dm.mall.moduls.mapper.OrderDao
;
import
com.jz.dm.mall.moduls.mapper.OrderDao
;
import
com.jz.dm.mall.moduls.service.OrderService
;
import
com.jz.dm.mall.moduls.service.OrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 订单表(TOrder)表服务实现类
* 订单表(TOrder)表服务实现类
*
*
...
@@ -19,11 +25,39 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -19,11 +25,39 @@ import org.springframework.transaction.annotation.Transactional;
@Service
(
"orderService"
)
@Service
(
"orderService"
)
@Transactional
@Transactional
public
class
OrderServiceImpl
implements
OrderService
{
public
class
OrderServiceImpl
implements
OrderService
{
@Autowired
@Autowired
private
OrderDao
tOrderDao
;
private
OrderDao
tOrderDao
;
@Override
@Override
public
IPage
<
Order
>
queryPage
(
Page
<
Order
>
orderPage
,
Order
order
)
{
public
PageInfoResponse
<
OrderDto
>
findList
(
OrderDto
order
,
HttpServletRequest
req
)
throws
Exception
{
return
tOrderDao
.
queryPage
(
orderPage
,
order
);
PageInfoResponse
<
OrderDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//数据商品id
if
(
order
.
getOrderNumber
()
!=
null
)
{
param
.
put
(
"orderNumber"
,
order
.
getOrderNumber
());
}
//商品分类id(行业)
if
(
order
.
getPurchaseMethod
()
!=
null
)
{
param
.
put
(
"purchaseMethod"
,
order
.
getPurchaseMethod
());
}
/* //数据商户id
if (order.getUserId() != null) {
param.put("userId", order.getUserId());
}
//数据商品名称
if (!StringUtils.isEmpty(order.getDataName())) {
param.put("dataName", order.getDataName());
}*/
PageHelper
.
startPage
(
order
.
getPageNum
(),
order
.
getPageSize
());
List
<
OrderDto
>
list
=
tOrderDao
.
findList
(
param
);
PageInfo
<
OrderDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
Constants
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
}
}
}
\ No newline at end of file
jz-dm-mall/src/main/resources/application-test.yml
View file @
7254e1c8
...
@@ -12,10 +12,10 @@ management:
...
@@ -12,10 +12,10 @@ management:
spring
:
spring
:
profiles
:
test
profiles
:
test
datasource
:
datasource
:
url
:
jdbc:mysql://
119.23.32.151:3306/dm_demo
?characterEncoding=utf8&useSSL=false
url
:
jdbc:mysql://
rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project
?characterEncoding=utf8&useSSL=false
driverClassName
:
com.mysql.jdbc.Driver
driverClassName
:
com.mysql.jdbc.Driver
username
:
dmp
username
:
root
password
:
I
oubuy@2019@!
password
:
I
%ou$buy!ok
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
#监控统计拦截的filters
#监控统计拦截的filters
filters
:
stat
filters
:
stat
...
...
jz-dm-mall/src/main/resources/mapperconf/OrderDao.xml
View file @
7254e1c8
...
@@ -223,36 +223,41 @@
...
@@ -223,36 +223,41 @@
delete from t_order where order_id = #{orderId}
delete from t_order where order_id = #{orderId}
</delete>
</delete>
<select
id=
"
queryPage"
resultType=
"com.jz.dm.mall.moduls.entity.Order
"
>
<select
id=
"
findList"
resultType=
"com.jz.dm.mall.moduls.controller.order.bean.OrderDto"
parameterType=
"map
"
>
select
select
t.order_id as orderId,
t.order_id as orderId,
t.order_number as orderNumber,
t.order_number as orderNumber,
t.customer_id as customerId,
t.customer_id as customerId,
t.order_status as orderStatus,
(case when t.order_status ='01' then '待支付'
when t.order_status ='02' then '已支付'
when t.order_status ='03' then '已取消'
end) as orderStatus,
t.order_money as orderMoney,
t.order_money as orderMoney,
t.order_time as orderTime,
t.order_time as orderTime,
t.payment_money as paymentMoney,
t.payment_money as paymentMoney,
t.payment_time as paymentTime,
t.payment_time as paymentTime,
t.payment_method AS paymentMethod,
t.payment_method AS paymentMethod,
t.purchase_method AS purchaseMethod,
(case when t.purchase_method ='01' then '年'
when t.purchase_method ='02' then '季'
when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次'
end) as purchaseMethod,
t.price_type as priceType,
t.price_type as priceType,
t.cre_time as creTime,
t.cre_time as creTime,
t2.data_name as dataName,
t2.data_name as dataName,
t2.data_type
as dataType
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end)
as dataType
from t_order t
from t_order t
left join t_order_goods_info t1 on t.order_id=t1.order_id
left join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id
where 1=1
where 1=1
<if
test=
"orderId != null"
>
and order_id = #{orderId}
</if>
<if
test=
"orderId != null"
>
and t.order_id = #{orderId}
</if>
<if
test=
"orderNumber != null and orderNumber != ''"
>
and order_number = #{orderNumber}
</if>
<if
test=
"dataType != null and dataType != ''"
>
and t2.data_type = #{dataType}
</if>
<if
test=
"customerId != null"
>
and customer_id = #{customerId}
</if>
<if
test=
"orderNumber != null and orderNumber != ''"
>
and t.order_number = #{orderNumber}
</if>
<if
test=
"orderStatus != null and orderStatus != ''"
>
and order_status = #{orderStatus}
</if>
<if
test=
"dataName != null and dataName != ''"
>
and t2.data_name like concat('%',#{dataName},'%')
</if>
<if
test=
"orderMoney != null"
>
and order_money = #{orderMoney}
</if>
<if
test=
"purchaseMethod != null and purchaseMethod != ''"
>
and t.purchase_method = #{purchaseMethod}
</if>
<if
test=
"orderTime != null"
>
and order_time = #{orderTime}
</if>
<if
test=
"categoryId != null"
>
and t2.category_id = #{categoryId}
</if>
<if
test=
"sellerId != null"
>
and seller_id = #{sellerId}
</if>
<if
test=
"orderStatus != null and orderStatus != ''"
>
and t.order_status = #{orderStatus}
</if>
<if
test=
"paymentMethod != null and paymentMethod != ''"
>
and payment_method = #{paymentMethod}
</if>
<if
test=
"orderTime != null"
>
and t.order_time = #{orderTime}
</if>
<if
test=
"districtMoney != null"
>
and district_money = #{districtMoney}
</if>
<if
test=
"purchaseMethod != null and purchaseMethod != ''"
>
and purchase_method = #{purchaseMethod}
</if>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment