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
Show 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,14 +55,14 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -54,14 +55,14 @@ 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
();
...
@@ -73,10 +74,10 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -73,10 +74,10 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
}
}
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,12 +122,12 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -121,12 +122,12 @@ 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
)
{
...
@@ -134,11 +135,11 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -134,11 +135,11 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
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,7 +147,7 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -146,7 +147,7 @@ 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
);
}
}
...
@@ -161,7 +162,7 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
...
@@ -161,7 +162,7 @@ public class CustomerServiceBiz extends BaseBiz<CustomerServiceMapper, CustomerS
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
);
}
}
...
@@ -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
...
@@ -15,6 +15,7 @@ import com.xxfc.platform.vehicle.constant.VehicleCountType;
...
@@ -15,6 +15,7 @@ import com.xxfc.platform.vehicle.constant.VehicleCountType;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleCountRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleCountRecord
;
import
com.xxfc.platform.vehicle.mapper.VehicleCountRecordMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleCountRecordMapper
;
import
com.xxfc.platform.vehicle.pojo.DepartureLogVo
;
import
com.xxfc.platform.vehicle.pojo.ExcelParamDto
;
import
com.xxfc.platform.vehicle.pojo.ExcelParamDto
;
import
com.xxfc.platform.vehicle.pojo.VehicleBookRecordVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleBookRecordVo
;
import
com.xxfc.platform.vehicle.util.excel.ExcelExport
;
import
com.xxfc.platform.vehicle.util.excel.ExcelExport
;
...
@@ -68,8 +69,8 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -68,8 +69,8 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
if
(
StringUtils
.
isBlank
(
vehicleCountRecord
.
getEndTime
()))
{
if
(
StringUtils
.
isBlank
(
vehicleCountRecord
.
getEndTime
()))
{
vehicleCountRecord
.
setEndTime
(
vehicleCountRecord
.
getStartTime
());
vehicleCountRecord
.
setEndTime
(
vehicleCountRecord
.
getStartTime
());
}
}
map
.
put
(
"startTime"
,
DateTime
.
parse
(
vehicleCountRecord
.
getStartTime
(),
DEFAULT_DATE_TIME_FORMATTER
).
toDate
());
map
.
put
(
"startTime"
,
DateTime
.
parse
(
vehicleCountRecord
.
getStartTime
(),
DEFAULT_DATE_TIME_FORMATTER
).
getMillis
());
map
.
put
(
"endTime"
,
DateTime
.
parse
(
vehicleCountRecord
.
getEndTime
(),
DEFAULT_DATE_TIME_FORMATTER
).
toDate
());
map
.
put
(
"endTime"
,
DateTime
.
parse
(
vehicleCountRecord
.
getEndTime
(),
DEFAULT_DATE_TIME_FORMATTER
).
getMillis
());
}
}
if
(
MapUtils
.
isNotEmpty
(
map
))
{
if
(
MapUtils
.
isNotEmpty
(
map
))
{
...
@@ -82,6 +83,29 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -82,6 +83,29 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
return
ObjectRestResponse
.
succ
(
new
ArrayList
<>());
return
ObjectRestResponse
.
succ
(
new
ArrayList
<>());
}
}
public
ObjectRestResponse
selectByTime
(
VehicleCountRecord
vehicleCountRecord
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
vehicleCountRecord
.
getType
()
!=
null
)
{
map
.
put
(
"type"
,
vehicleCountRecord
.
getType
());
}
if
(
StringUtils
.
isNotBlank
(
vehicleCountRecord
.
getStartTime
()))
{
if
(
StringUtils
.
isBlank
(
vehicleCountRecord
.
getEndTime
()))
{
vehicleCountRecord
.
setEndTime
(
vehicleCountRecord
.
getStartTime
());
}
map
.
put
(
"startTime"
,
DateTime
.
parse
(
vehicleCountRecord
.
getStartTime
(),
DEFAULT_DATE_TIME_FORMATTER
).
toDate
());
map
.
put
(
"endTime"
,
DateTime
.
parse
(
vehicleCountRecord
.
getEndTime
(),
DEFAULT_DATE_TIME_FORMATTER
).
toDate
());
}
if
(
MapUtils
.
isNotEmpty
(
map
))
{
List
<
VehicleCountRecord
>
list
=
mapper
.
selectByTime
(
map
);
if
(
list
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
FIND_DATA_NOT_EXIST
.
getCode
(),
ResCode
.
FIND_DATA_NOT_EXIST
.
getDesc
());
}
return
ObjectRestResponse
.
succ
(
list
);
}
return
ObjectRestResponse
.
succ
(
new
ArrayList
<>());
}
/**
/**
* 添加统计记录
* 添加统计记录
*
*
...
@@ -116,31 +140,46 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -116,31 +140,46 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
VehicleCountRecord
vehicleCountRecord
=
new
VehicleCountRecord
();
VehicleCountRecord
vehicleCountRecord
=
new
VehicleCountRecord
();
VehicleCountRecord
tourCountRecord
=
new
VehicleCountRecord
();
VehicleCountRecord
tourCountRecord
=
new
VehicleCountRecord
();
VehicleCountRecord
innerCountRecord
=
new
VehicleCountRecord
();
VehicleCountRecord
innerCountRecord
=
new
VehicleCountRecord
();
SimpleDateFormat
simpleDateFormat1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
startDate
=
simpleDateFormat1
.
format
(
startTime
);
endDate
=
simpleDateFormat1
.
format
(
endTime
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//租车应出车数量
//租车应出车数量
List
<
OrderPageVO
>
vehicleDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
1
).
getData
();
List
<
OrderPageVO
>
vehicleDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
1
).
getData
();
if
(
vehicleDepartureList
!=
null
&&
vehicleDepartureList
.
size
()
>
0
)
{
if
(
vehicleDepartureList
!=
null
&&
vehicleDepartureList
.
size
()
>
0
)
{
vehicleCountRecord
.
setDepartureNum
(
vehicleDepartureList
.
size
());
vehicleCountRecord
.
setDepartureNum
(
vehicleDepartureList
.
size
());
List
<
OrderRentVehicleDetail
>
orderRentVehicleDetails
=
vehicleDepartureList
.
stream
().
map
(
OrderPageVO:
:
getOrderRentVehicleDetail
).
collect
(
Collectors
.
toList
());
if
(
orderRentVehicleDetails
!=
null
&&
orderRentVehicleDetails
.
size
()
>
0
)
{
List
<
Long
>
bookRecordIds
=
orderRentVehicleDetails
.
stream
().
map
(
OrderRentVehicleDetail:
:
getBookRecordId
).
collect
(
Collectors
.
toList
());
if
(
bookRecordIds
!=
null
&&
bookRecordIds
.
size
()
>
0
)
{
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByIds
(
bookRecordIds
).
getData
();
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleBookRecordVos
,
1
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前交车数量 已经还车且交车时间小于出车时间,
vehicleCountRecord
.
setBeforeDepartureNum
(
map
.
get
(
2
));
//延后交车,还未交车
vehicleCountRecord
.
setAfterDepartureNum
(
map
.
get
(
1
));
//正常交车,在当天时间内交车
vehicleCountRecord
.
setActualDepartureNum
(
map
.
get
(
3
));
}
}
}
}
}
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"startTime"
,
DateTime
.
parse
(
startDate
,
DATE_TIME_FORMATTER
).
toDate
());
param
.
put
(
"endTime"
,
DateTime
.
parse
(
endDate
,
DATE_TIME_FORMATTER
).
toDate
());
//1代表出车 2代表还车
param
.
put
(
"status"
,
1
);
param
.
put
(
"bookUser"
,
-
2
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//租车提前出车数量
Integer
beforeDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
beforeDepartureNum
!=
null
&&
beforeDepartureNum
>
0
)
{
vehicleCountRecord
.
setBeforeDepartureNum
(
beforeDepartureNum
);
}
//租车正常出车数量
param
.
put
(
"type"
,
1
);
Integer
normalDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
normalDepartureNum
!=
null
&&
normalDepartureNum
>
0
)
{
vehicleCountRecord
.
setActualDepartureNum
(
normalDepartureNum
);
}
//租车延期出车数量
param
.
put
(
"type"
,
3
);
Integer
afterDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
afterDepartureNum
!=
null
&&
afterDepartureNum
>
0
)
{
vehicleCountRecord
.
setAfterDepartureNum
(
afterDepartureNum
);
}
}
vehicleCountRecord
.
setType
(
VehicleCountType
.
RENT_VEHICLE
.
getCode
());
vehicleCountRecord
.
setType
(
VehicleCountType
.
RENT_VEHICLE
.
getCode
());
//旅游应出车数量
//旅游应出车数量
List
<
OrderPageVO
>
tourDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
1
).
getData
();
List
<
OrderPageVO
>
tourDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
1
).
getData
();
if
(
tourDepartureList
!=
null
&&
tourDepartureList
.
size
()
>
0
)
{
if
(
tourDepartureList
!=
null
&&
tourDepartureList
.
size
()
>
0
)
{
...
@@ -152,42 +191,60 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -152,42 +191,60 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
List
<
VehicleBookRecordVo
>
vehicleDepartureBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
1
).
getData
();
List
<
VehicleBookRecordVo
>
vehicleDepartureBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
1
).
getData
();
if
(
vehicleDepartureBookRecordList
!=
null
&&
vehicleDepartureBookRecordList
.
size
()
>
0
)
{
if
(
vehicleDepartureBookRecordList
!=
null
&&
vehicleDepartureBookRecordList
.
size
()
>
0
)
{
innerCountRecord
.
setDepartureNum
(
vehicleDepartureBookRecordList
.
size
());
innerCountRecord
.
setDepartureNum
(
vehicleDepartureBookRecordList
.
size
());
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleDepartureBookRecordList
,
1
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前交车数量 已经出车且交车时间小于出车时间,
innerCountRecord
.
setBeforeDepartureNum
(
map
.
get
(
2
));
//延后交车,还未交车
innerCountRecord
.
setAfterDepartureNum
(
map
.
get
(
1
));
//正常交车,在当天时间内交车
innerCountRecord
.
setActualDepartureNum
(
map
.
get
(
3
));
}
}
//1代表出车 2代表还车
param
.
put
(
"status"
,
1
);
param
.
remove
(
"bookUser"
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//内部用车提前出车数量
Integer
innerBeforeDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerBeforeDepartureNum
!=
null
&&
innerBeforeDepartureNum
>
0
)
{
innerCountRecord
.
setBeforeDepartureNum
(
innerBeforeDepartureNum
);
}
param
.
put
(
"type"
,
1
);
//内部用车正常出车数量
Integer
innerNormalDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerNormalDepartureNum
!=
null
&&
innerNormalDepartureNum
>
0
)
{
innerCountRecord
.
setActualDepartureNum
(
innerNormalDepartureNum
);
}
param
.
put
(
"type"
,
3
);
//内部用车提前出车数量
Integer
innerAfterDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerAfterDepartureNum
!=
null
&&
innerAfterDepartureNum
>
0
)
{
innerCountRecord
.
setAfterDepartureNum
(
innerAfterDepartureNum
);
}
}
innerCountRecord
.
setType
(
VehicleCountType
.
INNER
.
getCode
());
innerCountRecord
.
setType
(
VehicleCountType
.
INNER
.
getCode
());
//租车应还车数量
//租车应还车数量
List
<
OrderPageVO
>
vehicleArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
2
).
getData
();
List
<
OrderPageVO
>
vehicleArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
2
).
getData
();
if
(
vehicleArrivalList
!=
null
&&
vehicleArrivalList
.
size
()
>
0
)
{
if
(
vehicleArrivalList
!=
null
&&
vehicleArrivalList
.
size
()
>
0
)
{
vehicleCountRecord
.
setArrivalNum
(
vehicleArrivalList
.
size
());
vehicleCountRecord
.
setArrivalNum
(
vehicleArrivalList
.
size
());
List
<
OrderRentVehicleDetail
>
orderRentVehicleDetails
=
vehicleDepartureList
.
stream
().
map
(
OrderPageVO:
:
getOrderRentVehicleDetail
).
collect
(
Collectors
.
toList
());
if
(
orderRentVehicleDetails
!=
null
&&
orderRentVehicleDetails
.
size
()
>
0
)
{
List
<
Long
>
bookRecordIds
=
orderRentVehicleDetails
.
stream
().
map
(
OrderRentVehicleDetail:
:
getBookRecordId
).
collect
(
Collectors
.
toList
());
if
(
bookRecordIds
!=
null
&&
bookRecordIds
.
size
()
>
0
)
{
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByIds
(
bookRecordIds
).
getData
();
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleBookRecordVos
,
2
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前还车数量 已经出车且还车时间小于还车时间,
vehicleCountRecord
.
setBeforeArrivalNum
(
map
.
get
(
2
));
//延后还车,还未还车
vehicleCountRecord
.
setAfterArrivalNum
(
map
.
get
(
1
));
//正常还车,在当天时间内还车
vehicleCountRecord
.
setActualArrivalNum
(
map
.
get
(
3
));
}
}
}
}
}
//1代表出车 2代表还车
param
.
put
(
"status"
,
2
);
param
.
put
(
"bookUser"
,
-
2
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//租车提前还车数量
Integer
beforeArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
beforeArrivalNum
!=
null
&&
beforeArrivalNum
>
0
)
{
vehicleCountRecord
.
setBeforeArrivalNum
(
beforeArrivalNum
);
}
param
.
put
(
"type"
,
1
);
//租车正常还车数量
Integer
normalArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
normalArrivalNum
!=
null
&&
normalArrivalNum
>
0
)
{
vehicleCountRecord
.
setActualArrivalNum
(
normalArrivalNum
);
}
param
.
put
(
"type"
,
3
);
//租车正常还车数量
Integer
afterArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
afterArrivalNum
!=
null
&&
afterArrivalNum
>
0
)
{
vehicleCountRecord
.
setAfterArrivalNum
(
afterArrivalNum
);
}
}
//旅游应还车数量
//旅游应还车数量
List
<
OrderPageVO
>
tourArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
2
).
getData
();
List
<
OrderPageVO
>
tourArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
2
).
getData
();
...
@@ -199,17 +256,30 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -199,17 +256,30 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
List
<
VehicleBookRecordVo
>
vehicleArrivalBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
2
).
getData
();
List
<
VehicleBookRecordVo
>
vehicleArrivalBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
2
).
getData
();
if
(
vehicleArrivalBookRecordList
!=
null
&&
vehicleArrivalBookRecordList
.
size
()
>
0
)
{
if
(
vehicleArrivalBookRecordList
!=
null
&&
vehicleArrivalBookRecordList
.
size
()
>
0
)
{
innerCountRecord
.
setArrivalNum
(
vehicleArrivalBookRecordList
.
size
());
innerCountRecord
.
setArrivalNum
(
vehicleArrivalBookRecordList
.
size
());
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleDepartureBookRecordList
,
2
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前交车数量 已经出车且还车时间小于还车时间,
innerCountRecord
.
setBeforeArrivalNum
(
map
.
get
(
2
));
//延后还车,还未还车
innerCountRecord
.
setAfterArrivalNum
(
map
.
get
(
1
));
//正常还车,在当天时间内还车
innerCountRecord
.
setActualArrivalNum
(
map
.
get
(
3
));
}
}
//1代表出车 2代表还车
param
.
put
(
"status"
,
2
);
param
.
remove
(
"bookUser"
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//内部用车提前出车数量
Integer
innerBeforeArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerBeforeArrivalNum
!=
null
&&
innerBeforeArrivalNum
>
0
)
{
innerCountRecord
.
setAfterArrivalNum
(
innerBeforeArrivalNum
);
}
param
.
put
(
"type"
,
1
);
//内部用车正常出车数量
Integer
innerNormalArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerNormalArrivalNum
!=
null
&&
innerNormalArrivalNum
>
0
)
{
innerCountRecord
.
setActualArrivalNum
(
innerNormalArrivalNum
);
}
param
.
put
(
"type"
,
3
);
//内部用车提前出车数量
Integer
innerAfterArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerAfterArrivalNum
!=
null
&&
innerAfterArrivalNum
>
0
)
{
innerCountRecord
.
setAfterArrivalNum
(
innerAfterArrivalNum
);
}
}
innerCountRecord
.
setType
(
VehicleCountType
.
INNER
.
getCode
());
vehicleCountRecord
.
setCountDate
(
nowDate
);
vehicleCountRecord
.
setCountDate
(
nowDate
);
tourCountRecord
.
setCountDate
(
nowDate
);
tourCountRecord
.
setCountDate
(
nowDate
);
innerCountRecord
.
setCountDate
(
nowDate
);
innerCountRecord
.
setCountDate
(
nowDate
);
...
@@ -225,7 +295,7 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -225,7 +295,7 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
*
*
* @return
* @return
*/
*/
@Scheduled
(
cron
=
"0 0
2 * * ?
"
)
@Scheduled
(
cron
=
"0 0
*/2 * * *
"
)
public
void
add
()
{
public
void
add
()
{
Long
nowTime
=
getDayStart
();
Long
nowTime
=
getDayStart
();
Long
lastTime
=
nowTime
+
24
*
3600
*
1000
-
1
;
Long
lastTime
=
nowTime
+
24
*
3600
*
1000
-
1
;
...
@@ -235,8 +305,10 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -235,8 +305,10 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
endTime
.
setTime
(
lastTime
);
endTime
.
setTime
(
lastTime
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
startDate
=
null
;
String
startDate
=
null
;
String
endDate
=
null
;
try
{
try
{
startDate
=
simpleDateFormat
.
format
(
startTime
);
startDate
=
simpleDateFormat
.
format
(
startTime
);
endDate
=
simpleDateFormat
.
format
(
endTime
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -249,27 +321,35 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -249,27 +321,35 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
List
<
OrderPageVO
>
vehicleDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
1
).
getData
();
List
<
OrderPageVO
>
vehicleDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
1
).
getData
();
if
(
vehicleDepartureList
!=
null
&&
vehicleDepartureList
.
size
()
>
0
)
{
if
(
vehicleDepartureList
!=
null
&&
vehicleDepartureList
.
size
()
>
0
)
{
vehicleCountRecord
.
setDepartureNum
(
vehicleDepartureList
.
size
());
vehicleCountRecord
.
setDepartureNum
(
vehicleDepartureList
.
size
());
List
<
OrderRentVehicleDetail
>
orderRentVehicleDetails
=
vehicleDepartureList
.
stream
().
map
(
OrderPageVO:
:
getOrderRentVehicleDetail
).
collect
(
Collectors
.
toList
());
if
(
orderRentVehicleDetails
!=
null
&&
orderRentVehicleDetails
.
size
()
>
0
)
{
List
<
Long
>
bookRecordIds
=
orderRentVehicleDetails
.
stream
().
map
(
OrderRentVehicleDetail:
:
getBookRecordId
).
collect
(
Collectors
.
toList
());
if
(
bookRecordIds
!=
null
&&
bookRecordIds
.
size
()
>
0
)
{
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByIds
(
bookRecordIds
).
getData
();
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleBookRecordVos
,
1
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前交车数量 已经还车且交车时间小于出车时间,
vehicleCountRecord
.
setBeforeDepartureNum
(
map
.
get
(
2
));
//延后交车,还未交车
vehicleCountRecord
.
setAfterDepartureNum
(
map
.
get
(
1
));
//正常交车,在当天时间内交车
vehicleCountRecord
.
setActualDepartureNum
(
map
.
get
(
3
));
}
}
}
}
}
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"startTime"
,
DateTime
.
parse
(
startDate
,
DATE_TIME_FORMATTER
).
toDate
());
param
.
put
(
"endTime"
,
DateTime
.
parse
(
endDate
,
DATE_TIME_FORMATTER
).
toDate
());
//1代表出车 2代表还车
param
.
put
(
"status"
,
1
);
param
.
put
(
"bookUser"
,
-
2
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//租车提前出车数量
Integer
beforeDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
beforeDepartureNum
!=
null
&&
beforeDepartureNum
>
0
)
{
vehicleCountRecord
.
setBeforeDepartureNum
(
beforeDepartureNum
);
}
//租车正常出车数量
param
.
put
(
"type"
,
1
);
Integer
normalDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
normalDepartureNum
!=
null
&&
normalDepartureNum
>
0
)
{
vehicleCountRecord
.
setActualDepartureNum
(
normalDepartureNum
);
}
//租车延期出车数量
param
.
put
(
"type"
,
3
);
Integer
afterDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
afterDepartureNum
!=
null
&&
afterDepartureNum
>
0
)
{
vehicleCountRecord
.
setAfterDepartureNum
(
afterDepartureNum
);
}
}
vehicleCountRecord
.
setType
(
VehicleCountType
.
RENT_VEHICLE
.
getCode
());
vehicleCountRecord
.
setType
(
VehicleCountType
.
RENT_VEHICLE
.
getCode
());
//旅游应出车数量
//旅游应出车数量
List
<
OrderPageVO
>
tourDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
1
).
getData
();
List
<
OrderPageVO
>
tourDepartureList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
1
).
getData
();
if
(
tourDepartureList
!=
null
&&
tourDepartureList
.
size
()
>
0
)
{
if
(
tourDepartureList
!=
null
&&
tourDepartureList
.
size
()
>
0
)
{
...
@@ -281,42 +361,60 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -281,42 +361,60 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
List
<
VehicleBookRecordVo
>
vehicleDepartureBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
1
).
getData
();
List
<
VehicleBookRecordVo
>
vehicleDepartureBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
1
).
getData
();
if
(
vehicleDepartureBookRecordList
!=
null
&&
vehicleDepartureBookRecordList
.
size
()
>
0
)
{
if
(
vehicleDepartureBookRecordList
!=
null
&&
vehicleDepartureBookRecordList
.
size
()
>
0
)
{
innerCountRecord
.
setDepartureNum
(
vehicleDepartureBookRecordList
.
size
());
innerCountRecord
.
setDepartureNum
(
vehicleDepartureBookRecordList
.
size
());
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleDepartureBookRecordList
,
1
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前交车数量 已经出车且交车时间小于出车时间,
innerCountRecord
.
setBeforeDepartureNum
(
map
.
get
(
2
));
//延后交车,还未交车
innerCountRecord
.
setAfterDepartureNum
(
map
.
get
(
1
));
//正常交车,在当天时间内交车
innerCountRecord
.
setActualDepartureNum
(
map
.
get
(
3
));
}
}
//1代表出车 2代表还车
param
.
put
(
"status"
,
1
);
param
.
remove
(
"bookUser"
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//内部用车提前出车数量
Integer
innerBeforeDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerBeforeDepartureNum
!=
null
&&
innerBeforeDepartureNum
>
0
)
{
innerCountRecord
.
setBeforeDepartureNum
(
innerBeforeDepartureNum
);
}
param
.
put
(
"type"
,
1
);
//内部用车正常出车数量
Integer
innerNormalDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerNormalDepartureNum
!=
null
&&
innerNormalDepartureNum
>
0
)
{
innerCountRecord
.
setActualDepartureNum
(
innerNormalDepartureNum
);
}
param
.
put
(
"type"
,
3
);
//内部用车提前出车数量
Integer
innerAfterDepartureNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerAfterDepartureNum
!=
null
&&
innerAfterDepartureNum
>
0
)
{
innerCountRecord
.
setAfterDepartureNum
(
innerAfterDepartureNum
);
}
}
innerCountRecord
.
setType
(
VehicleCountType
.
INNER
.
getCode
());
innerCountRecord
.
setType
(
VehicleCountType
.
INNER
.
getCode
());
//租车应还车数量
//租车应还车数量
List
<
OrderPageVO
>
vehicleArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
2
).
getData
();
List
<
OrderPageVO
>
vehicleArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
(),
2
).
getData
();
if
(
vehicleArrivalList
!=
null
&&
vehicleArrivalList
.
size
()
>
0
)
{
if
(
vehicleArrivalList
!=
null
&&
vehicleArrivalList
.
size
()
>
0
)
{
vehicleCountRecord
.
setArrivalNum
(
vehicleArrivalList
.
size
());
vehicleCountRecord
.
setArrivalNum
(
vehicleArrivalList
.
size
());
List
<
OrderRentVehicleDetail
>
orderRentVehicleDetails
=
vehicleDepartureList
.
stream
().
map
(
OrderPageVO:
:
getOrderRentVehicleDetail
).
collect
(
Collectors
.
toList
());
if
(
orderRentVehicleDetails
!=
null
&&
orderRentVehicleDetails
.
size
()
>
0
)
{
List
<
Long
>
bookRecordIds
=
orderRentVehicleDetails
.
stream
().
map
(
OrderRentVehicleDetail:
:
getBookRecordId
).
collect
(
Collectors
.
toList
());
if
(
bookRecordIds
!=
null
&&
bookRecordIds
.
size
()
>
0
)
{
List
<
VehicleBookRecordVo
>
vehicleBookRecordVos
=
vehicleBookRecordBiz
.
selectByIds
(
bookRecordIds
).
getData
();
if
(
vehicleBookRecordVos
!=
null
&&
vehicleBookRecordVos
.
size
()
>
0
)
{
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleBookRecordVos
,
2
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前还车数量 已经出车且还车时间小于还车时间,
vehicleCountRecord
.
setBeforeArrivalNum
(
map
.
get
(
2
));
//延后还车,还未还车
vehicleCountRecord
.
setAfterArrivalNum
(
map
.
get
(
1
));
//正常还车,在当天时间内还车
vehicleCountRecord
.
setActualArrivalNum
(
map
.
get
(
3
));
}
}
}
}
}
//1代表出车 2代表还车
param
.
put
(
"status"
,
2
);
param
.
put
(
"bookUser"
,
-
2
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//租车提前还车数量
Integer
beforeArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
beforeArrivalNum
!=
null
&&
beforeArrivalNum
>
0
)
{
vehicleCountRecord
.
setBeforeArrivalNum
(
beforeArrivalNum
);
}
param
.
put
(
"type"
,
1
);
//租车正常还车数量
Integer
normalArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
normalArrivalNum
!=
null
&&
normalArrivalNum
>
0
)
{
vehicleCountRecord
.
setActualArrivalNum
(
normalArrivalNum
);
}
param
.
put
(
"type"
,
3
);
//租车正常还车数量
Integer
afterArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
afterArrivalNum
!=
null
&&
afterArrivalNum
>
0
)
{
vehicleCountRecord
.
setAfterArrivalNum
(
afterArrivalNum
);
}
}
//旅游应还车数量
//旅游应还车数量
List
<
OrderPageVO
>
tourArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
2
).
getData
();
List
<
OrderPageVO
>
tourArrivalList
=
orderFeign
.
getOrderList
(
nowTime
,
OrderTypeEnum
.
TOUR
.
getCode
(),
2
).
getData
();
...
@@ -328,17 +426,30 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -328,17 +426,30 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
List
<
VehicleBookRecordVo
>
vehicleArrivalBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
2
).
getData
();
List
<
VehicleBookRecordVo
>
vehicleArrivalBookRecordList
=
vehicleBookRecordBiz
.
selectAllBookRecord
(
startTime
,
endTime
,
2
).
getData
();
if
(
vehicleArrivalBookRecordList
!=
null
&&
vehicleArrivalBookRecordList
.
size
()
>
0
)
{
if
(
vehicleArrivalBookRecordList
!=
null
&&
vehicleArrivalBookRecordList
.
size
()
>
0
)
{
innerCountRecord
.
setArrivalNum
(
vehicleArrivalBookRecordList
.
size
());
innerCountRecord
.
setArrivalNum
(
vehicleArrivalBookRecordList
.
size
());
Map
<
Integer
,
Integer
>
map
=
getDeparture
(
vehicleDepartureBookRecordList
,
2
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
// 租车提前交车数量 已经出车且还车时间小于还车时间,
innerCountRecord
.
setBeforeArrivalNum
(
map
.
get
(
2
));
//延后还车,还未还车
innerCountRecord
.
setAfterArrivalNum
(
map
.
get
(
1
));
//正常还车,在当天时间内还车
innerCountRecord
.
setActualArrivalNum
(
map
.
get
(
3
));
}
}
//1代表出车 2代表还车
param
.
put
(
"status"
,
2
);
param
.
remove
(
"bookUser"
);
//1代表正常出车,2代表提前出车,3代表延期出车
param
.
put
(
"type"
,
2
);
//内部用车提前出车数量
Integer
innerBeforeArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerBeforeArrivalNum
!=
null
&&
innerBeforeArrivalNum
>
0
)
{
innerCountRecord
.
setAfterArrivalNum
(
innerBeforeArrivalNum
);
}
param
.
put
(
"type"
,
1
);
//内部用车正常出车数量
Integer
innerNormalArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerNormalArrivalNum
!=
null
&&
innerNormalArrivalNum
>
0
)
{
innerCountRecord
.
setActualArrivalNum
(
innerNormalArrivalNum
);
}
param
.
put
(
"type"
,
3
);
//内部用车提前出车数量
Integer
innerAfterArrivalNum
=
vehicleDepartureService
.
selectAllDepartureLog
(
param
);
if
(
innerAfterArrivalNum
!=
null
&&
innerAfterArrivalNum
>
0
)
{
innerCountRecord
.
setAfterArrivalNum
(
innerAfterArrivalNum
);
}
}
innerCountRecord
.
setType
(
VehicleCountType
.
INNER
.
getCode
());
vehicleCountRecord
.
setCountDate
(
nowDate
);
vehicleCountRecord
.
setCountDate
(
nowDate
);
tourCountRecord
.
setCountDate
(
nowDate
);
tourCountRecord
.
setCountDate
(
nowDate
);
innerCountRecord
.
setCountDate
(
nowDate
);
innerCountRecord
.
setCountDate
(
nowDate
);
...
@@ -351,8 +462,7 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
...
@@ -351,8 +462,7 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
if
(
vehicleCountRecord
!=
null
)
{
if
(
vehicleCountRecord
!=
null
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
vehicleCountRecord
.
getType
());
map
.
put
(
"type"
,
vehicleCountRecord
.
getType
());
map
.
put
(
"startTime"
,
getDayStart
(
vehicleCountRecord
.
getCountDate
().
getTime
()));
map
.
put
(
"startTime"
,
vehicleCountRecord
.
getCountDate
());
map
.
put
(
"endTime"
,
getDayStart
(
vehicleCountRecord
.
getCountDate
().
getTime
())
+
24
*
3600
*
1000
);
List
<
VehicleCountRecord
>
list
=
mapper
.
selectByTypeAndTime
(
map
);
List
<
VehicleCountRecord
>
list
=
mapper
.
selectByTypeAndTime
(
map
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
BeanUtil
.
copyProperties
(
vehicleCountRecord
,
list
.
get
(
0
),
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
BeanUtil
.
copyProperties
(
vehicleCountRecord
,
list
.
get
(
0
),
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
...
...
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