Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
8d9ff4a9
Commit
8d9ff4a9
authored
Oct 11, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
a909e51b
57aa1978
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
379 additions
and
187 deletions
+379
-187
CustomerServiceBiz.java
...ain/java/com/xxfc/platform/im/biz/CustomerServiceBiz.java
+42
-41
DailyTravelOrderStatisticsBiz.java
...xfc/platform/order/biz/DailyTravelOrderStatisticsBiz.java
+9
-11
DailyVehicleOrderStatisticsBiz.java
...fc/platform/order/biz/DailyVehicleOrderStatisticsBiz.java
+10
-12
DailyMembersOrderStatisticsMapper.xml
...in/resources/mapper/DailyMembersOrderStatisticsMapper.xml
+2
-2
DepartureLogVo.java
...n/java/com/xxfc/platform/vehicle/pojo/DepartureLogVo.java
+10
-0
VehicleCountRecordBiz.java
.../com/xxfc/platform/vehicle/biz/VehicleCountRecordBiz.java
+229
-119
VehicleDepartureService.java
...om/xxfc/platform/vehicle/biz/VehicleDepartureService.java
+5
-0
VehicleCountRecordMapper.java
...xfc/platform/vehicle/mapper/VehicleCountRecordMapper.java
+1
-0
VehicleDepartureLogMapper.java
...fc/platform/vehicle/mapper/VehicleDepartureLogMapper.java
+3
-0
VehicleCountRecordController.java
...c/platform/vehicle/rest/VehicleCountRecordController.java
+7
-1
VehicleCountRecordMapper.xml
...er/src/main/resources/mapper/VehicleCountRecordMapper.xml
+8
-0
VehicleDepartureLogMapper.xml
...r/src/main/resources/mapper/VehicleDepartureLogMapper.xml
+53
-1
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/CustomerServiceBiz.java
View file @
8d9ff4a9
...
@@ -11,6 +11,7 @@ import com.xxfc.platform.im.entity.CustomerService;
...
@@ -11,6 +11,7 @@ import com.xxfc.platform.im.entity.CustomerService;
import
com.xxfc.platform.im.mapper.CustomerServiceMapper
;
import
com.xxfc.platform.im.mapper.CustomerServiceMapper
;
import
com.xxfc.platform.im.vo.CustomerServiceVO
;
import
com.xxfc.platform.im.vo.CustomerServiceVO
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -54,32 +55,32 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -54,32 +55,32 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
CustomerService
customerService
=
new
CustomerService
();
CustomerService
customerService
=
new
CustomerService
();
BeanUtils
.
copyProperties
(
customerServiceDTO
,
customerService
);
BeanUtils
.
copyProperties
(
customerServiceDTO
,
customerService
);
if
(
Objects
.
isNull
(
customerServiceDTO
.
getId
()))
{
if
(
Objects
.
isNull
(
customerServiceDTO
.
getId
()))
{
customerService
.
setCreateTime
(
Instant
.
now
().
toEpochMilli
());
customerService
.
setCreateTime
(
Instant
.
now
().
toEpochMilli
());
customerService
.
setName
(
String
.
format
(
"%s%s"
,
NICK_PRE_NAME
,
customerServiceDTO
.
getTelphone
()));
customerService
.
setName
(
String
.
format
(
"%s%s"
,
NICK_PRE_NAME
,
customerServiceDTO
.
getTelphone
()));
customerService
.
setIsDel
(
false
);
customerService
.
setIsDel
(
false
);
customerService
.
setPassword
(
INIT_PASSWORD
);
customerService
.
setPassword
(
StringUtils
.
isEmpty
(
customerServiceDTO
.
getPassword
())
?
INIT_PASSWORD
:
customerServiceDTO
.
getPassword
().
trim
().
length
()
>
0
?
customerServiceDTO
.
getPassword
()
:
INIT_PASSWORD
);
Map
<
String
,
Object
>
imMap
=
new
HashMap
<>(
2
);
Map
<
String
,
Object
>
imMap
=
new
HashMap
<>(
2
);
imMap
.
put
(
"telephone"
,
customerServiceDTO
.
getTelphone
());
imMap
.
put
(
"telephone"
,
customerServiceDTO
.
getTelphone
());
imMap
.
put
(
"password"
,
INIT_PASSWORD
);
imMap
.
put
(
"password"
,
DigestUtils
.
md5Hex
(
customerService
.
getPassword
())
);
imMap
.
put
(
"nickname"
,
customerService
.
getName
());
imMap
.
put
(
"nickname"
,
customerService
.
getName
());
BaseResponse
imResponse
=
userBiz
.
register
(
imMap
);
BaseResponse
imResponse
=
userBiz
.
register
(
imMap
);
String
imResult
=
imResponse
.
getMessage
();
String
imResult
=
imResponse
.
getMessage
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
imResult
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
imResult
);
Map
<
String
,
Object
>
data
=
(
Map
<
String
,
Object
>)
jsonObject
.
get
(
"data"
);
Map
<
String
,
Object
>
data
=
(
Map
<
String
,
Object
>)
jsonObject
.
get
(
"data"
);
Object
userId
=
data
.
get
(
"userId"
);
Object
userId
=
data
.
get
(
"userId"
);
if
(
Objects
.
isNull
(
userId
))
{
if
(
Objects
.
isNull
(
userId
))
{
throw
new
BaseException
(
"注册失败"
);
throw
new
BaseException
(
"注册失败"
);
}
}
customerService
.
setImUserId
((
Integer
)
userId
);
customerService
.
setImUserId
((
Integer
)
userId
);
mapper
.
insertSelective
(
customerService
);
mapper
.
insertSelective
(
customerService
);
}
else
{
}
else
{
customerService
.
setUpdateTime
(
Instant
.
now
().
toEpochMilli
());
customerService
.
setUpdateTime
(
Instant
.
now
().
toEpochMilli
());
if
(!
StringUtils
.
isEmpty
(
customerServiceDTO
.
getPassword
()))
{
if
(!
StringUtils
.
isEmpty
(
customerServiceDTO
.
getPassword
()))
{
userBiz
.
updatePasswordByPhone
(
customerServiceDTO
.
getTelphone
(),
customerServiceDTO
.
getPassword
());
userBiz
.
updatePasswordByPhone
(
customerServiceDTO
.
getTelphone
(),
customerServiceDTO
.
getPassword
());
}
}
mapper
.
updateByPrimaryKeySelective
(
customerService
);
mapper
.
updateByPrimaryKeySelective
(
customerService
);
}
}
}
}
...
@@ -121,24 +122,24 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -121,24 +122,24 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
public
void
updatePasswordByPhone
(
String
telphone
,
String
password
)
{
public
void
updatePasswordByPhone
(
String
telphone
,
String
password
)
{
Example
example
=
new
Example
(
CustomerService
.
class
);
Example
example
=
new
Example
(
CustomerService
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"telphone"
,
telphone
);
criteria
.
andEqualTo
(
"telphone"
,
telphone
);
CustomerService
customerService
=
new
CustomerService
();
CustomerService
customerService
=
new
CustomerService
();
customerService
.
setPassword
(
password
);
customerService
.
setPassword
(
DigestUtils
.
md5Hex
(
password
)
);
customerService
.
setUpdateTime
(
Instant
.
now
().
toEpochMilli
());
customerService
.
setUpdateTime
(
Instant
.
now
().
toEpochMilli
());
mapper
.
updateByExampleSelective
(
customerService
,
example
);
mapper
.
updateByExampleSelective
(
customerService
,
example
);
}
}
public
PageDataVO
<
CustomerServiceVO
>
findCustomerServiceWithPage
(
Integer
page
,
Integer
limit
)
{
public
PageDataVO
<
CustomerServiceVO
>
findCustomerServiceWithPage
(
Integer
page
,
Integer
limit
)
{
PageDataVO
<
CustomerServiceVO
>
dataVO
=
new
PageDataVO
<>();
PageDataVO
<
CustomerServiceVO
>
dataVO
=
new
PageDataVO
<>();
Example
example
=
new
Example
(
CustomerService
.
class
);
Example
example
=
new
Example
(
CustomerService
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
false
);
criteria
.
andEqualTo
(
"isDel"
,
false
);
PageDataVO
<
CustomerService
>
pageDataVO
=
PageDataVO
.
pageInfo
(
page
,
limit
,()->
mapper
.
selectByExample
(
example
));
PageDataVO
<
CustomerService
>
pageDataVO
=
PageDataVO
.
pageInfo
(
page
,
limit
,
()
->
mapper
.
selectByExample
(
example
));
List
<
CustomerService
>
data
=
pageDataVO
.
getData
();
List
<
CustomerService
>
data
=
pageDataVO
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
data
)){
if
(
CollectionUtils
.
isEmpty
(
data
))
{
return
dataVO
;
return
dataVO
;
}
}
...
@@ -146,22 +147,22 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -146,22 +147,22 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
CustomerServiceVO
customerServiceVO
;
CustomerServiceVO
customerServiceVO
;
for
(
CustomerService
customerService
:
data
)
{
for
(
CustomerService
customerService
:
data
)
{
customerServiceVO
=
new
CustomerServiceVO
();
customerServiceVO
=
new
CustomerServiceVO
();
BeanUtils
.
copyProperties
(
customerService
,
customerServiceVO
);
BeanUtils
.
copyProperties
(
customerService
,
customerServiceVO
);
customerServiceVOS
.
add
(
customerServiceVO
);
customerServiceVOS
.
add
(
customerServiceVO
);
}
}
dataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
dataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
dataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
dataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
dataVO
.
setTotalPage
(
pageDataVO
.
getTotalPage
());
dataVO
.
setTotalPage
(
pageDataVO
.
getTotalPage
());
dataVO
.
setTotalCount
(
pageDataVO
.
getTotalCount
());
dataVO
.
setTotalCount
(
pageDataVO
.
getTotalCount
());
dataVO
.
setData
(
customerServiceVOS
);
dataVO
.
setData
(
customerServiceVOS
);
return
dataVO
;
return
dataVO
;
}
}
public
CustomerServiceDTO
findCustomerServiceById
(
Long
id
)
{
public
CustomerServiceDTO
findCustomerServiceById
(
Long
id
)
{
CustomerServiceDTO
customerServiceDTO
=
new
CustomerServiceDTO
();
CustomerServiceDTO
customerServiceDTO
=
new
CustomerServiceDTO
();
CustomerService
customerService
=
mapper
.
selectByPrimaryKey
(
id
);
CustomerService
customerService
=
mapper
.
selectByPrimaryKey
(
id
);
BeanUtils
.
copyProperties
(
customerService
,
customerServiceDTO
);
BeanUtils
.
copyProperties
(
customerService
,
customerServiceDTO
);
return
customerServiceDTO
;
return
customerServiceDTO
;
}
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/DailyTravelOrderStatisticsBiz.java
View file @
8d9ff4a9
...
@@ -7,9 +7,9 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -7,9 +7,9 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.order.contant.enumerate.AccountTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.RefundTypeEnum
;
import
com.xxfc.platform.order.entity.DailyTravelOrderStatistics
;
import
com.xxfc.platform.order.entity.DailyTravelOrderStatistics
;
import
com.xxfc.platform.order.entity.OrderAccount
;
import
com.xxfc.platform.order.entity.OrderAccount
;
import
com.xxfc.platform.order.entity.OrderStatistics
;
import
com.xxfc.platform.order.entity.OrderStatistics
;
...
@@ -197,7 +197,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
...
@@ -197,7 +197,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
private
void
refundAndDeductions
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
,
DailyTravelOrderStatistics
orderStatistics
)
{
private
void
refundAndDeductions
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
,
DailyTravelOrderStatistics
orderStatistics
)
{
ArrayList
<
OrderAccountDTO
>
arrayList
=
Lists
.
newArrayList
();
ArrayList
<
OrderAccountDTO
>
arrayList
=
Lists
.
newArrayList
();
for
(
Integer
key
:
map
.
keySet
())
{
for
(
Integer
key
:
map
.
keySet
())
{
if
(!
key
.
equals
(
RefundTypeEnum
.
ORDER_FUND
.
getCode
()))
{
if
(!
key
.
equals
(
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
()))
{
arrayList
.
addAll
(
map
.
get
(
key
));
arrayList
.
addAll
(
map
.
get
(
key
));
}
}
}
}
...
@@ -222,7 +222,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
...
@@ -222,7 +222,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
private
DailyTravelOrderStatistics
getGmvAndSecurityDeposit
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
)
{
private
DailyTravelOrderStatistics
getGmvAndSecurityDeposit
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
)
{
DailyTravelOrderStatistics
orderStatistics
=
new
DailyTravelOrderStatistics
();
DailyTravelOrderStatistics
orderStatistics
=
new
DailyTravelOrderStatistics
();
List
<
OrderAccountDTO
>
orderAccountDTOS
=
map
.
get
(
RefundTypeEnum
.
ORDER_FUND
.
getCode
());
List
<
OrderAccountDTO
>
orderAccountDTOS
=
map
.
get
(
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
());
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDTOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDTOS
))
{
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
=
getOrderAccountDetail
(
orderAccountDTOS
);
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
=
getOrderAccountDetail
(
orderAccountDTOS
);
...
@@ -276,9 +276,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
...
@@ -276,9 +276,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
*/
*/
private
List
<
OrderAccountDeduction
>
gettDeductions
(
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
)
{
private
List
<
OrderAccountDeduction
>
gettDeductions
(
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
)
{
ArrayList
<
OrderAccountDeduction
>
arrayList
=
Lists
.
newArrayList
();
ArrayList
<
OrderAccountDeduction
>
arrayList
=
Lists
.
newArrayList
();
for
(
OrderAccountDetail
orderAccountDetail
:
orderAccountDetails
)
{
orderAccountDetails
.
parallelStream
().
map
(
OrderAccountDetail:
:
getDeductions
).
forEach
(
e
->
arrayList
.
addAll
(
e
));
arrayList
.
addAll
(
orderAccountDetail
.
getDeductions
());
}
return
arrayList
;
return
arrayList
;
}
}
...
@@ -286,14 +284,14 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
...
@@ -286,14 +284,14 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
/**
/**
* 根据type获取对应的金额总和
* 根据type获取对应的金额总和
*
*
* @param
OrderAccountDeduction
* @param
list
* @param type 金额类型
* @param type 金额类型
* @return
* @return
*/
*/
private
BigDecimal
get
(
List
<
OrderAccountDeduction
>
OrderAccountDeduction
,
List
<
Integer
>
type
)
{
private
BigDecimal
get
(
List
<
OrderAccountDeduction
>
list
,
List
<
Integer
>
type
)
{
return
OrderAccountDeduction
.
parallelStream
()
return
list
.
parallelStream
()
.
filter
(
el
->
el
.
getType
().
equals
(
type
))
.
filter
(
el
->
type
.
contains
(
el
.
getType
()
))
.
map
(
com
.
xxfc
.
platform
.
order
.
pojo
.
account
.
OrderAccountDeduction
::
getAmount
)
.
map
(
OrderAccountDeduction:
:
getAmount
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/DailyVehicleOrderStatisticsBiz.java
View file @
8d9ff4a9
...
@@ -4,9 +4,9 @@ import cn.hutool.json.JSONUtil;
...
@@ -4,9 +4,9 @@ import cn.hutool.json.JSONUtil;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.order.contant.enumerate.AccountTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.RefundTypeEnum
;
import
com.xxfc.platform.order.entity.DailyVehicleOrderStatistics
;
import
com.xxfc.platform.order.entity.DailyVehicleOrderStatistics
;
import
com.xxfc.platform.order.entity.OrderAccount
;
import
com.xxfc.platform.order.entity.OrderAccount
;
import
com.xxfc.platform.order.entity.OrderStatistics
;
import
com.xxfc.platform.order.entity.OrderStatistics
;
...
@@ -208,14 +208,14 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
...
@@ -208,14 +208,14 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
/**
/**
* 根据type获取对应的金额总和
* 根据type获取对应的金额总和
*
*
* @param
OrderAccountDeduction
* @param
list
* @param types 金额类型
* @param types 金额类型
* @return
* @return
*/
*/
private
BigDecimal
get
(
List
<
OrderAccountDeduction
>
OrderAccountDeduction
,
List
<
Integer
>
types
)
{
private
BigDecimal
get
(
List
<
OrderAccountDeduction
>
list
,
List
<
Integer
>
types
)
{
return
OrderAccountDeduction
.
parallelStream
()
return
list
.
parallelStream
()
.
filter
(
el
->
types
.
contains
(
el
))
.
filter
(
el
->
types
.
contains
(
el
.
getType
()
))
.
map
(
com
.
xxfc
.
platform
.
order
.
pojo
.
account
.
OrderAccountDeduction
::
getAmount
)
.
map
(
OrderAccountDeduction:
:
getAmount
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
}
}
...
@@ -241,7 +241,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
...
@@ -241,7 +241,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
* @return
* @return
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveDailyVehicleOrderRecord
()
{
public
boolean
saveDailyVehicleOrderRecord
()
{
try
{
try
{
//获取每日订单统计
//获取每日订单统计
...
@@ -342,7 +342,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
...
@@ -342,7 +342,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
private
void
refundAndDeductions
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
,
DailyVehicleOrderStatistics
orderStatistics
)
{
private
void
refundAndDeductions
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
,
DailyVehicleOrderStatistics
orderStatistics
)
{
ArrayList
<
OrderAccountDTO
>
arrayList
=
Lists
.
newArrayList
();
ArrayList
<
OrderAccountDTO
>
arrayList
=
Lists
.
newArrayList
();
for
(
Integer
key
:
map
.
keySet
())
{
for
(
Integer
key
:
map
.
keySet
())
{
if
(!
key
.
equals
(
RefundTypeEnum
.
ORDER_FUND
.
getCode
()))
{
if
(!
key
.
equals
(
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
()))
{
arrayList
.
addAll
(
map
.
get
(
key
));
arrayList
.
addAll
(
map
.
get
(
key
));
}
}
}
}
...
@@ -387,7 +387,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
...
@@ -387,7 +387,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
*/
*/
private
DailyVehicleOrderStatistics
getGmvAndSecurityDeposit
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
)
{
private
DailyVehicleOrderStatistics
getGmvAndSecurityDeposit
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
)
{
DailyVehicleOrderStatistics
orderStatistics
=
new
DailyVehicleOrderStatistics
();
DailyVehicleOrderStatistics
orderStatistics
=
new
DailyVehicleOrderStatistics
();
List
<
OrderAccountDTO
>
orderAccountDTOS
=
map
.
get
(
RefundTypeEnum
.
ORDER_FUND
.
getCode
());
List
<
OrderAccountDTO
>
orderAccountDTOS
=
map
.
get
(
AccountTypeEnum
.
IN_ORDER_PAY
.
getCode
());
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDTOS
))
{
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDTOS
))
{
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
=
getOrderAccountDetail
(
orderAccountDTOS
);
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
=
getOrderAccountDetail
(
orderAccountDTOS
);
...
@@ -437,9 +437,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
...
@@ -437,9 +437,7 @@ public class DailyVehicleOrderStatisticsBiz extends BaseBiz<DailyVehicleOrderSta
*/
*/
private
List
<
OrderAccountDeduction
>
gettDeductions
(
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
)
{
private
List
<
OrderAccountDeduction
>
gettDeductions
(
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
)
{
ArrayList
<
OrderAccountDeduction
>
arrayList
=
Lists
.
newArrayList
();
ArrayList
<
OrderAccountDeduction
>
arrayList
=
Lists
.
newArrayList
();
for
(
OrderAccountDetail
orderAccountDetail
:
orderAccountDetails
)
{
orderAccountDetails
.
parallelStream
().
map
(
OrderAccountDetail:
:
getDeductions
).
forEach
(
e
->
arrayList
.
addAll
(
e
));
arrayList
.
addAll
(
orderAccountDetail
.
getDeductions
());
}
return
arrayList
;
return
arrayList
;
}
}
...
...
xx-order/xx-order-server/src/main/resources/mapper/DailyMembersOrderStatisticsMapper.xml
View file @
8d9ff4a9
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
resultMap=
"order"
>
resultMap=
"order"
>
SELECT
SELECT
<if
test=
"type==2"
>
<if
test=
"type==2"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%
Y
-%v') AS period,
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%
x
-%v') AS period,
</if>
</if>
<if
test=
"type==3"
>
<if
test=
"type==3"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m') AS period,
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m') AS period,
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
</if>
</if>
GROUP BY
GROUP BY
<if
test=
"type==2"
>
<if
test=
"type==2"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%
Y
-%v'),
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%
x
-%v'),
</if>
</if>
<if
test=
"type==3"
>
<if
test=
"type==3"
>
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m'),
DATE_FORMAT(date( FROM_UNIXTIME( a.account_time / 1000 ) ),'%Y-%m'),
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/DepartureLogVo.java
0 → 100644
View file @
8d9ff4a9
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleDepartureLog
;
import
lombok.Data
;
@Data
public
class
DepartureLogVo
extends
VehicleDepartureLog
{
VehicleBookRecord
vehicleBookRecord
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleCountRecordBiz.java
View file @
8d9ff4a9
This diff is collapsed.
Click to expand it.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleDepartureService.java
View file @
8d9ff4a9
...
@@ -12,6 +12,7 @@ import com.xxfc.platform.vehicle.entity.Vehicle;
...
@@ -12,6 +12,7 @@ import com.xxfc.platform.vehicle.entity.Vehicle;
import
com.xxfc.platform.vehicle.entity.VehicleDepartureLog
;
import
com.xxfc.platform.vehicle.entity.VehicleDepartureLog
;
import
com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.pojo.DepartureLogVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleDepartureStatisticDataVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleDepartureStatisticDataVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -24,6 +25,7 @@ import tk.mybatis.mapper.weekend.WeekendSqls;
...
@@ -24,6 +25,7 @@ import tk.mybatis.mapper.weekend.WeekendSqls;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -103,6 +105,9 @@ public class VehicleDepartureService extends BaseBiz<VehicleDepartureLogMapper,
...
@@ -103,6 +105,9 @@ public class VehicleDepartureService extends BaseBiz<VehicleDepartureLogMapper,
}
}
public
Integer
selectAllDepartureLog
(
Map
<
String
,
Object
>
param
)
{
return
mapper
.
selectAllDepartureLog
(
param
);
}
public
ObjectRestResponse
findOne
(
Integer
vid
)
throws
Exception
{
public
ObjectRestResponse
findOne
(
Integer
vid
)
throws
Exception
{
Example
exm
=
Example
.
builder
(
VehicleDepartureLog
.
class
)
Example
exm
=
Example
.
builder
(
VehicleDepartureLog
.
class
)
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleCountRecordMapper.java
View file @
8d9ff4a9
...
@@ -10,4 +10,5 @@ public interface VehicleCountRecordMapper extends Mapper<VehicleCountRecord> {
...
@@ -10,4 +10,5 @@ public interface VehicleCountRecordMapper extends Mapper<VehicleCountRecord> {
List
<
VehicleCountRecord
>
countDepartureVehicle
(
VehicleCountRecord
vehicleCountRecord
);
List
<
VehicleCountRecord
>
countDepartureVehicle
(
VehicleCountRecord
vehicleCountRecord
);
List
<
VehicleCountRecord
>
selectByTypeAndTime
(
Map
<
String
,
Object
>
param
);
List
<
VehicleCountRecord
>
selectByTypeAndTime
(
Map
<
String
,
Object
>
param
);
List
<
VehicleCountRecord
>
selectByTime
(
Map
<
String
,
Object
>
param
);
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleDepartureLogMapper.java
View file @
8d9ff4a9
package
com
.
xxfc
.
platform
.
vehicle
.
mapper
;
package
com
.
xxfc
.
platform
.
vehicle
.
mapper
;
import
com.xxfc.platform.vehicle.entity.VehicleDepartureLog
;
import
com.xxfc.platform.vehicle.entity.VehicleDepartureLog
;
import
com.xxfc.platform.vehicle.pojo.DepartureLogVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
import
tk.mybatis.mapper.common.BaseMapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
VehicleDepartureLogMapper
extends
BaseMapper
<
VehicleDepartureLog
>,
Mapper
<
VehicleDepartureLog
>
{
public
interface
VehicleDepartureLogMapper
extends
BaseMapper
<
VehicleDepartureLog
>,
Mapper
<
VehicleDepartureLog
>
{
...
@@ -32,4 +34,5 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo
...
@@ -32,4 +34,5 @@ public interface VehicleDepartureLogMapper extends BaseMapper<VehicleDepartureLo
String
selectDayByVehicleId
(
String
vehicleId
);
String
selectDayByVehicleId
(
String
vehicleId
);
VehicleDepartureLogVo
selectByBookRecordId
(
Long
bookRecordId
);
VehicleDepartureLogVo
selectByBookRecordId
(
Long
bookRecordId
);
Integer
selectAllDepartureLog
(
Map
<
String
,
Object
>
param
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleCountRecordController.java
View file @
8d9ff4a9
...
@@ -30,7 +30,7 @@ public class VehicleCountRecordController {
...
@@ -30,7 +30,7 @@ public class VehicleCountRecordController {
@GetMapping
(
"/app/unauth/get"
)
@GetMapping
(
"/app/unauth/get"
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
getByTypeAndDate
(
VehicleCountRecord
vehicleCountRecord
)
{
public
ObjectRestResponse
getByTypeAndDate
(
VehicleCountRecord
vehicleCountRecord
)
{
return
vehicleCountRecordBiz
.
countDepartureVehicl
e
(
vehicleCountRecord
);
return
vehicleCountRecordBiz
.
selectByTim
e
(
vehicleCountRecord
);
}
}
@PostMapping
(
"/app/unauth/export"
)
@PostMapping
(
"/app/unauth/export"
)
...
@@ -43,4 +43,10 @@ public class VehicleCountRecordController {
...
@@ -43,4 +43,10 @@ public class VehicleCountRecordController {
public
void
download
(
ExcelParamDto
excelParamDto
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
download
(
ExcelParamDto
excelParamDto
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
DownloadUtil
.
downloadFile
(
excelParamDto
.
getPath
(),
"export.xls"
,
response
,
request
);
DownloadUtil
.
downloadFile
(
excelParamDto
.
getPath
(),
"export.xls"
,
response
,
request
);
}
}
@GetMapping
(
"/app/unauth/selectByTime"
)
public
ObjectRestResponse
selectByTime
(
VehicleCountRecord
vehicleCountRecord
)
{
return
vehicleCountRecordBiz
.
selectByTime
(
vehicleCountRecord
);
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleCountRecordMapper.xml
View file @
8d9ff4a9
...
@@ -35,4 +35,12 @@
...
@@ -35,4 +35,12 @@
order by id DESC
order by id DESC
</select>
</select>
<select
id=
"selectByTime"
parameterType =
"Map"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleCountRecord"
>
select * from vehicle_count_record
where count_date
>
= #{startTime} and count_date
<
= #{endTime}
<if
test=
"type != null"
>
and type = #{type}
</if>
order by id DESC
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleDepartureLogMapper.xml
View file @
8d9ff4a9
...
@@ -2,7 +2,11 @@
...
@@ -2,7 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper"
>
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleDepartureLogMapper"
>
<resultMap
id=
"searchBookRecord"
type=
"com.xxfc.platform.vehicle.pojo.DepartureLogVo"
>
<result
column=
"book_record_id"
property=
"bookRecordId"
jdbcType=
"INTEGER"
javaType=
"java.lang.Integer"
/>
<association
property=
"vehicleBookRecord"
column=
"id"
select=
"com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper.selectOne"
/>
</resultMap>
<select
id=
"selectLastByVehicleId"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleDepartureLog"
>
<select
id=
"selectLastByVehicleId"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleDepartureLog"
>
select * from vehicle_departure_log
select * from vehicle_departure_log
where vehicle_id = #{vehicleId}
where vehicle_id = #{vehicleId}
...
@@ -30,7 +34,55 @@
...
@@ -30,7 +34,55 @@
where vehicle_departure_log.book_record_id = #{id}
where vehicle_departure_log.book_record_id = #{id}
order by create_time desc
order by create_time desc
</select>
</select>
<select
id=
"selectAllDepartureLog"
resultType=
"java.lang.Integer"
parameterType=
"Map"
>
SELECT
count(*)
FROM
vehicle_departure_log v1
LEFT JOIN vehicle_book_record v2 on v1.book_record_id = v2.id
<where>
<if
test=
"startTime != null and status == 1"
>
and (v1.departure_time between #{startTime} and #{endTime})
</if>
<if
test=
"startTime != null and status == 2"
>
and (v1.arrival_time between #{startTime} and #{endTime})
</if>
<!--正常出车-->
<if
test=
"startTime != null and status == 1 and type == 1"
>
and (v2.book_start_date between #{startTime} and #{endTime})
</if>
<!--提前出车-->
<if
test=
"endTime != null and status == 1 and type == 2"
>
and v2.book_start_date
>
= #{endTime}
</if>
<!--延期出车-->
<if
test=
"startTime != null and status == 1 and type == 3"
>
and v2.book_start_date
<
= #{startTime}
</if>
<!--正常还车-->
<if
test=
"startTime != null and status == 2 and type == 1"
>
and (v2.book_start_date between #{startTime} and #{endTime})
</if>
<!--提前还车-->
<if
test=
"endTime != null and status == 2 and type == 2"
>
and v2.book_start_date
>
= #{endTime}
</if>
<!--延期还车-->
<if
test=
"startTime != null and status == 2 and type == 3"
>
and v2.book_start_date
<
= #{startTime}
</if>
<!--统计客户用车-->
<if
test=
"bookUser != null"
>
and v2.book_user = #{bookUser}
</if>
<if
test=
"bookUser == null"
>
and v2.book_user != -2
</if>
</where>
</select>
<select
id=
"selectVoAll"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo"
>
<select
id=
"selectVoAll"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo"
>
select vehicle_departure_log.*,vehicle.number_plate,
select vehicle_departure_log.*,vehicle.number_plate,
/* IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/
/* IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/
...
...
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