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
67ece478
Commit
67ece478
authored
Oct 25, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
900e4562
ab95a5bd
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
455 additions
and
92 deletions
+455
-92
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+11
-0
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+6
-0
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+4
-0
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+26
-0
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+23
-0
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+14
-6
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+23
-0
MyWalletCathMapper.xml
...ce-admin/src/main/resources/mapper/MyWalletCathMapper.xml
+1
-1
VehicleItemDTO.java
...va/com/xxfc/platform/order/pojo/order/VehicleItemDTO.java
+8
-3
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+2
-2
OrderItemBiz.java
...c/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
+3
-2
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+3
-3
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+2
-2
RentDepositJobHandler.java
...xxfc/platform/order/jobhandler/RentDepositJobHandler.java
+3
-3
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+3
-2
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+7
-4
UserBiz.java
...r/src/main/java/com/xxfc/platform/summit/biz/UserBiz.java
+11
-10
pom.xml
xx-vehicle/xx-vehicle-api/pom.xml
+0
-1
Vehicle.java
...c/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
+18
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+2
-2
ResultVehicleVo.java
.../java/com/xxfc/platform/vehicle/pojo/ResultVehicleVo.java
+15
-1
VehicleBookRecordQueryVo.java
.../xxfc/platform/vehicle/pojo/VehicleBookRecordQueryVo.java
+2
-0
VehicleExcelVo.java
...n/java/com/xxfc/platform/vehicle/pojo/VehicleExcelVo.java
+40
-0
VehicleInformationDownloadBiz.java
...c/platform/vehicle/biz/VehicleInformationDownloadBiz.java
+95
-0
VehicleModelCalendarPriceBiz.java
...fc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
+7
-7
VehicleModelHolidayPriceBiz.java
...xfc/platform/vehicle/biz/VehicleModelHolidayPriceBiz.java
+2
-1
VehicleMapper.java
.../java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
+4
-2
VehicleModelCalendarPriceController.java
...orm/vehicle/rest/VehicleModelCalendarPriceController.java
+9
-5
VehicleInformationDownloadController.java
...icle/rest/admin/VehicleInformationDownloadController.java
+70
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+41
-35
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
67ece478
...
@@ -247,4 +247,15 @@ public class AuthController {
...
@@ -247,4 +247,15 @@ public class AuthController {
return
authService
.
checkToken
(
token
);
return
authService
.
checkToken
(
token
);
}
}
@RequestMapping
(
value
=
"/updUsername"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
updUsername
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
HttpServletRequest
request
)
throws
Exception
{
log
.
info
(
username
+
"----require updUsername..."
);
String
token
=
request
.
getHeader
(
tokenHeader
);
return
appAuthService
.
updUsername
(
username
,
mobilecode
,
token
);
}
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
67ece478
...
@@ -5,6 +5,8 @@ import com.github.wxiaoqi.security.api.vo.user.AppUserInfo;
...
@@ -5,6 +5,8 @@ import com.github.wxiaoqi.security.api.vo.user.AppUserInfo;
import
com.github.wxiaoqi.security.api.vo.user.UserInfo
;
import
com.github.wxiaoqi.security.api.vo.user.UserInfo
;
import
com.github.wxiaoqi.security.auth.configuration.FeignConfiguration
;
import
com.github.wxiaoqi.security.auth.configuration.FeignConfiguration
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -78,4 +80,8 @@ public interface IUserService {
...
@@ -78,4 +80,8 @@ public interface IUserService {
@PostMapping
(
"/api/app/imi/login"
)
@PostMapping
(
"/api/app/imi/login"
)
String
loginImiWithToken
();
String
loginImiWithToken
();
@ApiModelProperty
(
"修改手机号码"
)
@GetMapping
(
"/api/app/updUsername"
)
public
ObjectRestResponse
updUsername
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"userId"
,
defaultValue
=
"0"
)
Integer
userId
);
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
67ece478
...
@@ -6,6 +6,8 @@ import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
...
@@ -6,6 +6,8 @@ import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.servlet.http.HttpServletRequest
;
public
interface
AuthService
{
public
interface
AuthService
{
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
...
@@ -39,4 +41,6 @@ public interface AuthService {
...
@@ -39,4 +41,6 @@ public interface AuthService {
String
loginImiWithToken
();
String
loginImiWithToken
();
ObjectRestResponse
checkToken
(
String
token
);
ObjectRestResponse
checkToken
(
String
token
);
ObjectRestResponse
updUsername
(
String
username
,
String
mobilecode
,
String
token
);
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
67ece478
...
@@ -13,10 +13,13 @@ import com.github.wxiaoqi.security.common.constant.RequestTypeConstants;
...
@@ -13,10 +13,13 @@ import com.github.wxiaoqi.security.common.constant.RequestTypeConstants;
import
com.github.wxiaoqi.security.common.exception.auth.UserInvalidException
;
import
com.github.wxiaoqi.security.common.exception.auth.UserInvalidException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
io.swagger.models.auth.In
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
/**
/**
* @author keliii
* @author keliii
*/
*/
...
@@ -138,4 +141,27 @@ public class AppAuthServiceImpl implements AuthService {
...
@@ -138,4 +141,27 @@ public class AppAuthServiceImpl implements AuthService {
}
}
@Override
public
ObjectRestResponse
updUsername
(
String
username
,
String
mobilecode
,
String
token
)
{
if
(
StringUtils
.
isEmpty
(
token
)){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"token不能为空"
);
}
try
{
IJWTInfo
ijwtInfo
=
jwtTokenUtil
.
getInfoFromToken
(
token
);
if
(
ijwtInfo
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
10009
,
"token失效"
);
}
Integer
userId
=
Integer
.
parseInt
(
ijwtInfo
.
getId
());
ObjectRestResponse
objectRestResponse
=
userService
.
updUsername
(
username
,
mobilecode
,
userId
);
if
(
objectRestResponse
.
getStatus
()==
ResultCode
.
SUCCESS_CODE
){
token
=
getToken
(
username
,
userId
);
objectRestResponse
.
setData
(
token
);
}
return
objectRestResponse
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"操作失败"
);
}
}
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
67ece478
...
@@ -134,4 +134,27 @@ public class AuthServiceImpl implements AuthService {
...
@@ -134,4 +134,27 @@ public class AuthServiceImpl implements AuthService {
}
}
}
}
@Override
public
ObjectRestResponse
updUsername
(
String
username
,
String
mobilecode
,
String
token
)
{
if
(
StringUtils
.
isEmpty
(
token
)){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"token不能为空"
);
}
try
{
IJWTInfo
ijwtInfo
=
jwtTokenUtil
.
getInfoFromToken
(
token
);
if
(
ijwtInfo
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
10009
,
"token失效"
);
}
Integer
userId
=
Integer
.
parseInt
(
ijwtInfo
.
getId
());
ObjectRestResponse
objectRestResponse
=
userService
.
updUsername
(
username
,
mobilecode
,
userId
);
if
(
objectRestResponse
.
getStatus
()==
ResultCode
.
SUCCESS_CODE
){
token
=
getToken
(
username
,
userId
);
objectRestResponse
.
setData
(
token
);
}
return
objectRestResponse
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"操作失败"
);
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
67ece478
...
@@ -5,11 +5,9 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,11 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import
com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService
;
import
com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService
;
import
com.github.wxiaoqi.security.admin.rpc.service.PermissionService
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.api.vo.authority.PermissionInfo
;
import
com.github.wxiaoqi.security.api.vo.authority.PermissionInfo
;
import
com.github.wxiaoqi.security.api.vo.user.AppUserInfo
;
import
com.github.wxiaoqi.security.api.vo.user.AppUserInfo
;
import
com.github.wxiaoqi.security.api.vo.user.UserInfo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
...
@@ -257,15 +255,25 @@ public class AppUserRest {
...
@@ -257,15 +255,25 @@ public class AppUserRest {
@ApiModelProperty
(
"检查手机号验证码"
)
@ApiModelProperty
(
"检查手机号验证码"
)
@GetMapping
(
"/unauth/checkMobilecode"
)
@GetMapping
(
"/unauth/checkMobilecode"
)
public
ObjectRestResponse
checkMobilecode
(
@RequestParam
(
value
=
"phone"
)
String
phone
,
public
ObjectRestResponse
checkMobilecode
(
@RequestParam
(
value
=
"phone"
)
String
phone
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
){
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
)
{
if
(
StringUtils
.
isBlank
(
phone
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
if
(
StringUtils
.
isBlank
(
phone
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
}
String
redisKey
=
appPermissionService
.
checkCodeByUsername
(
phone
,
mobilecode
);
String
redisKey
=
appPermissionService
.
checkCodeByUsername
(
phone
,
mobilecode
);
if
(
StringUtils
.
isBlank
(
redisKey
)){
if
(
StringUtils
.
isBlank
(
redisKey
))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"验证码错误"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"验证码错误"
);
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
@ApiModelProperty
(
"修改手机号码"
)
@GetMapping
(
"/updUsername"
)
public
ObjectRestResponse
updUsername
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"userId"
,
defaultValue
=
"0"
)
Integer
userId
){
return
appPermissionService
.
updUsername
(
userId
,
username
,
mobilecode
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
67ece478
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rpc
.
service
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rpc
.
service
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.ace.cache.annotation.CacheClear
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.constant.RedisKey
;
import
com.github.wxiaoqi.security.admin.constant.RedisKey
;
...
@@ -1134,4 +1135,26 @@ public class AppPermissionService {
...
@@ -1134,4 +1135,26 @@ public class AppPermissionService {
public
static
final
String
CITY_NAME
=
"city"
;
public
static
final
String
CITY_NAME
=
"city"
;
}
}
//修改手机号码
public
ObjectRestResponse
updUsername
(
Integer
userId
,
String
username
,
String
mobileCode
){
if
(
StringUtils
.
isBlank
(
username
)||
StringUtils
.
isBlank
(
mobileCode
)||
userId
==
0
||
userId
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
if
(
StringUtils
.
isBlank
(
checkCodeByUsername
(
username
,
mobileCode
))){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"验证码错误"
);
}
log
.
info
(
"----updUsername----userId==="
+
userId
+
"---username==="
+
username
);
// 是否已存在
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
if
(
null
!=
user
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户已存在"
);
}
AppUserLogin
userLogin
=
new
AppUserLogin
();
userLogin
.
setId
(
userId
);
userLogin
.
setUsername
(
username
);
appUserLoginBiz
.
disable
(
userLogin
);
return
ObjectRestResponse
.
succ
();
}
}
}
ace-modules/ace-admin/src/main/resources/mapper/MyWalletCathMapper.xml
View file @
67ece478
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
AND `stauts`=#{state}
AND `stauts`=#{state}
i
i
</if>
</if>
<if
test=
"orderNo"
>
<if
test=
"orderNo
!=null and orderNo !=''
"
>
AND `order_no` = #{orderNo}
AND `order_no` = #{orderNo}
</if>
</if>
<if
test=
"startTime !=null and endTime !=null"
>
<if
test=
"startTime !=null and endTime !=null"
>
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/VehicleItemDTO.java
View file @
67ece478
...
@@ -19,13 +19,18 @@ import java.util.List;
...
@@ -19,13 +19,18 @@ import java.util.List;
public
class
VehicleItemDTO
extends
OrderItem
{
public
class
VehicleItemDTO
extends
OrderItem
{
public
static
final
int
topNum
=
2
;
public
static
final
int
topNum
=
2
;
public
BigDecimal
calculateVehicleUnitPrice
(
BigDecimal
vehicleAmount
,
BigDecimal
metaVehicleAmount
,
Boolean
isSetRealAmount
)
{
public
BigDecimal
calculateVehicleUnitPrice
(
BigDecimal
vehicleAmount
,
BigDecimal
metaVehicleAmount
,
Boolean
isSetRealAmount
)
{
BigDecimal
unitPrice
=
vehicleAmount
.
divide
(
new
BigDecimal
(
getCalculateNum
()+
""
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
metaUnitPrice
=
metaVehicleAmount
.
divide
(
new
BigDecimal
(
getCalculateNum
()+
""
),
2
,
RoundingMode
.
HALF_UP
);
if
(
isSetRealAmount
)
{
if
(
isSetRealAmount
)
{
setRealAmount
(
vehicleAmount
);
setRealAmount
(
vehicleAmount
);
}
}
BigDecimal
unitPrice
=
BigDecimal
.
ZERO
;
BigDecimal
metaUnitPrice
=
BigDecimal
.
ZERO
;
if
(
getCalculateNum
()
>
0
)
{
unitPrice
=
vehicleAmount
.
divide
(
new
BigDecimal
(
getCalculateNum
()+
""
),
2
,
RoundingMode
.
HALF_UP
);
metaUnitPrice
=
metaVehicleAmount
.
divide
(
new
BigDecimal
(
getCalculateNum
()+
""
),
2
,
RoundingMode
.
HALF_UP
);
}
setUnitPrice
(
unitPrice
);
setUnitPrice
(
unitPrice
);
setMetaUnitPrice
(
metaUnitPrice
);
setMetaUnitPrice
(
metaUnitPrice
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
67ece478
...
@@ -347,10 +347,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -347,10 +347,10 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
setType
(
crosstownTypeEnum
);
setType
(
crosstownTypeEnum
);
}});
}});
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
orderMQDTO
.
getId
());
setOrderId
(
orderMQDTO
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
if
(
null
==
crosstown
)
{
if
(
null
==
crosstown
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
StrUtil
.
format
(
"退款第一部分押金失败,获取不了还车/定损记录,订单号:{}, crosstownTypeEnum: {}"
,
orderMQDTO
.
getId
(),
crosstownTypeEnum
)));
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
StrUtil
.
format
(
"退款第一部分押金失败,获取不了还车/定损记录,订单号:{}, crosstownTypeEnum: {}"
,
orderMQDTO
.
getId
(),
crosstownTypeEnum
)));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
View file @
67ece478
package
com
.
xxfc
.
platform
.
order
.
biz
;
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.xxfc.platform.order.contant.enumerate.ItemTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.ItemTypeEnum
;
...
@@ -55,10 +56,10 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
...
@@ -55,10 +56,10 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
//根据延期的天数算出 对应的日期价格
//根据延期的天数算出 对应的日期价格
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
Date
overEnd
=
DateUtil
.
offsetDay
(
endDate
,
overDays
);
Date
overEnd
=
DateUtil
.
offsetDay
(
endDate
,
overDays
);
List
<
VehicleModelCalendarPriceDTO
>
overlist
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
overStart
,
overEnd
,
modelId
,
userId
).
getData
();
List
<
VehicleModelCalendarPriceDTO
>
overlist
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
overStart
.
getTime
(),
overEnd
.
getTime
()
,
modelId
,
userId
).
getData
();
for
(
VehicleModelCalendarPriceDTO
vmcpd
:
overlist
)
{
for
(
VehicleModelCalendarPriceDTO
vmcpd
:
overlist
)
{
overAmountList
.
add
(
(
VMCalendarPriceCostDTO
)
vmcpd
);
overAmountList
.
add
(
BeanUtil
.
toBean
(
vmcpd
,
VMCalendarPriceCostDTO
.
class
)
);
}
}
return
overAmountList
;
return
overAmountList
;
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
67ece478
...
@@ -178,7 +178,7 @@ public class OrderCalculateBiz {
...
@@ -178,7 +178,7 @@ public class OrderCalculateBiz {
if
(
residueDays
>
0
)
{
if
(
residueDays
>
0
)
{
//设置消耗费用列表
//设置消耗费用列表
for
(
int
i
=
0
;
i
<
useDays
;
i
++)
{
for
(
int
i
=
0
;
i
<
useDays
;
i
++)
{
useAmountList
.
add
(
(
VMCalendarPriceCostDTO
)
vmcpds
.
get
(
i
));
useAmountList
.
add
(
BeanUtil
.
toBean
(
vmcpds
.
get
(
i
),
VMCalendarPriceCostDTO
.
class
));
}
}
//"{}元/天 x{}天"
//"{}元/天 x{}天"
...
@@ -245,10 +245,10 @@ public class OrderCalculateBiz {
...
@@ -245,10 +245,10 @@ public class OrderCalculateBiz {
}
}
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
Integer
useDays
)
{
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
Integer
freeDays
=
(
null
==
vehicleItemDTO
.
getCutNum
())?
0
:
vehicleItemDTO
.
getCutNum
();
Integer
freeDays
=
(
null
==
vehicleItemDTO
.
getCutNum
())?
0
:
vehicleItemDTO
.
getCutNum
();
return
inProgressCalculate
(
baseOrder
,
vehicleItemDTO
,
freeDays
,
useDays
,
new
OrderAccountDetail
(),
Boolean
.
FALSE
);
return
inProgressCalculate
(
baseOrder
,
vehicleItemDTO
,
freeDays
,
useDays
,
new
OrderAccountDetail
(),
Boolean
.
FALSE
);
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
67ece478
...
@@ -139,10 +139,10 @@ public class OrderCancelBiz {
...
@@ -139,10 +139,10 @@ public class OrderCancelBiz {
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}});
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
baseOrder
.
getId
());
setOrderId
(
baseOrder
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
//如果超过出发时间,不能取消订单
//如果超过出发时间,不能取消订单
//根据时间处理goodsAmount
//根据时间处理goodsAmount
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/jobhandler/RentDepositJobHandler.java
View file @
67ece478
...
@@ -72,7 +72,7 @@ public class RentDepositJobHandler extends IJobHandler {
...
@@ -72,7 +72,7 @@ public class RentDepositJobHandler extends IJobHandler {
@Override
@Override
public
ReturnT
<
String
>
execute
(
String
idLastNumInterval
)
{
public
ReturnT
<
String
>
execute
(
String
idLastNumInterval
)
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Integer
rentDepositAutoRefundTime
=
new
Integer
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_DEPOSIT_AUTO_REFUND_TIME
).
getDetail
());
Long
rentDepositAutoRefundTime
=
new
Long
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_DEPOSIT_AUTO_REFUND_TIME
).
getDetail
());
try
{
try
{
List
<
BaseOrder
>
lists
=
baseOrderBiz
.
selectByExample
(
new
Example
.
Builder
(
BaseOrder
.
class
)
List
<
BaseOrder
>
lists
=
baseOrderBiz
.
selectByExample
(
new
Example
.
Builder
(
BaseOrder
.
class
)
...
@@ -80,7 +80,7 @@ public class RentDepositJobHandler extends IJobHandler {
...
@@ -80,7 +80,7 @@ public class RentDepositJobHandler extends IJobHandler {
.
where
(
WeekendSqls
.<
BaseOrder
>
custom
().
andEqualTo
(
BaseOrder:
:
getType
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
())
.
where
(
WeekendSqls
.<
BaseOrder
>
custom
().
andEqualTo
(
BaseOrder:
:
getType
,
OrderTypeEnum
.
RENT_VEHICLE
.
getCode
())
.
andEqualTo
(
BaseOrder:
:
getStatus
,
OrderStatusEnum
.
ORDER_FINISH
.
getCode
())
//已完成的订单
.
andEqualTo
(
BaseOrder:
:
getStatus
,
OrderStatusEnum
.
ORDER_FINISH
.
getCode
())
//已完成的订单
.
andEqualTo
(
BaseOrder:
:
getRefundStatus
,
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
())
//已归还了部分押金
.
andEqualTo
(
BaseOrder:
:
getRefundStatus
,
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
())
//已归还了部分押金
.
andLessThanOrEqualTo
(
BaseOrder:
:
getCrtTime
,
DateUtil
.
date
(
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60
*
1000
)))
.
andLessThanOrEqualTo
(
BaseOrder:
:
getCrtTime
,
DateUtil
.
date
(
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60
L
*
1000L
)))
// .andLike(BaseOrder::getId, "%"+ i)
// .andLike(BaseOrder::getId, "%"+ i)
).
build
());
).
build
());
...
@@ -102,7 +102,7 @@ public class RentDepositJobHandler extends IJobHandler {
...
@@ -102,7 +102,7 @@ public class RentDepositJobHandler extends IJobHandler {
setType
(
crosstownTypeEnum
);
setType
(
crosstownTypeEnum
);
}});
}});
if
(
crosstown
.
getCrtTime
().
compareTo
(
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60
*
1000
))
<
0
)
{
if
(
crosstown
.
getCrtTime
().
compareTo
(
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60
L
*
1000L
))
<
0
)
{
OrderViolation
orderViolation
=
orderViolationBiz
.
selectOne
(
new
OrderViolation
(){{
OrderViolation
orderViolation
=
orderViolationBiz
.
selectOne
(
new
OrderViolation
(){{
setDetailId
(
orvd
.
getId
());
setDetailId
(
orvd
.
getId
());
setIsDel
(
SYS_FALSE
);
setIsDel
(
SYS_FALSE
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
67ece478
package
com
.
xxfc
.
platform
.
order
.
rest
;
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
...
@@ -93,10 +94,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -93,10 +94,10 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
Long
timeLag
=
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
();
Long
timeLag
=
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()
-
System
.
currentTimeMillis
();
VehicleItemDTO
vehicleItemDTO
=
(
VehicleItemDTO
)
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
VehicleItemDTO
vehicleItemDTO
=
BeanUtil
.
toBean
(
orderItemBiz
.
selectOne
(
new
OrderItem
(){{
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setType
(
ItemTypeEnum
.
VEHICLE_MODEL
.
getCode
());
setOrderId
(
orderPageVO
.
getId
());
setOrderId
(
orderPageVO
.
getId
());
}});
}})
,
VehicleItemDTO
.
class
)
;
if
(
timeLag
<
0
)
{
if
(
timeLag
<
0
)
{
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
67ece478
...
@@ -238,11 +238,14 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -238,11 +238,14 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
detail
.
initDate
();
detail
.
initDate
();
List
<
VehicleModelCalendarPriceDTO
>
vmcpds
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
detail
.
getStart
Date
(),
detail
.
getEndDat
e
(),
detail
.
getModelId
(),
dto
.
getUserid
()).
getData
();
List
<
VehicleModelCalendarPriceDTO
>
vmcpds
=
vehicleFeign
.
findVehicleModelCalendarPriceByDate
(
detail
.
getStart
Time
(),
detail
.
getEndTim
e
(),
detail
.
getModelId
(),
dto
.
getUserid
()).
getData
();
//设置Item
//设置Item
VehicleItemDTO
vehicleOrderItem
=
(
VehicleItemDTO
)
orderItemBiz
.
initOrderItem
(
vehicleModel
.
getPrice
(),
detail
.
getDayNum
(),
vehicleModel
.
getName
(),
vehicleModel
.
getId
(),
ItemTypeEnum
.
VEHICLE_MODEL
,
JSONUtil
.
parseArray
(
vmcpds
).
toString
());
VehicleItemDTO
vehicleOrderItem
=
BeanUtil
.
toBean
(
orderItemBiz
.
initOrderItem
(
vehicleModel
.
getPrice
(),
detail
.
getDayNum
(),
vehicleModel
.
getName
()
,
vehicleModel
.
getId
(),
ItemTypeEnum
.
VEHICLE_MODEL
,
JSONUtil
.
parseArray
(
vmcpds
).
toString
())
,
VehicleItemDTO
.
class
);
OrderItem
driverOrderItem
=
orderItemBiz
.
initOrderItem
(
DRIVER_PRICE
,
detail
.
getDayNum
(),
"平台司机"
,
null
,
ItemTypeEnum
.
DRIVER
);
OrderItem
driverOrderItem
=
orderItemBiz
.
initOrderItem
(
DRIVER_PRICE
,
detail
.
getDayNum
(),
"平台司机"
,
null
,
ItemTypeEnum
.
DRIVER
);
OrderItem
damageSafeOrderItem
=
orderItemBiz
.
initOrderItem
(
DAMAGE_SAFE
,
detail
.
getDayNum
(),
"免赔费用"
,
null
,
ItemTypeEnum
.
DAMAGE_SAFE
);
OrderItem
damageSafeOrderItem
=
orderItemBiz
.
initOrderItem
(
DAMAGE_SAFE
,
detail
.
getDayNum
(),
"免赔费用"
,
null
,
ItemTypeEnum
.
DAMAGE_SAFE
);
...
@@ -313,8 +316,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -313,8 +316,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//计算价格
//计算价格
if
(
vehicleDayNum
>
0
)
{
if
(
vehicleDayNum
>
0
)
{
for
(
int
i
=
cutDayNum
;
i
<
vmcpds
.
size
();
i
++)
{
for
(
int
i
=
cutDayNum
;
i
<
vmcpds
.
size
();
i
++)
{
vehicleAmount
.
add
(
vmcpds
.
get
(
i
).
getPrice
());
vehicleAmount
=
vehicleAmount
.
add
(
vmcpds
.
get
(
i
).
getPrice
());
metaVehicleAmount
.
add
(
vmcpds
.
get
(
i
).
getNo_discount_price
());
metaVehicleAmount
=
metaVehicleAmount
.
add
(
vmcpds
.
get
(
i
).
getNo_discount_price
());
}
}
}
else
{
}
else
{
vehicleOrderItem
.
setUnitPrice
(
BigDecimal
.
ZERO
);
vehicleOrderItem
.
setUnitPrice
(
BigDecimal
.
ZERO
);
...
...
xx-summit/xx-summit-server/src/main/java/com/xxfc/platform/summit/biz/UserBiz.java
View file @
67ece478
...
@@ -81,6 +81,7 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -81,6 +81,7 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
userId
=
uses
.
get
(
0
).
getId
();
userId
=
uses
.
get
(
0
).
getId
();
user
.
setId
(
userId
);
user
.
setId
(
userId
);
}
else
{
}
else
{
user
.
setId
(
null
);
Long
time
=
System
.
currentTimeMillis
()/
1000L
;
Long
time
=
System
.
currentTimeMillis
()/
1000L
;
user
.
setWeId
(
weId
);
user
.
setWeId
(
weId
);
user
.
setRId
(
rId
);
user
.
setRId
(
rId
);
...
@@ -97,12 +98,12 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -97,12 +98,12 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
log
.
info
(
"----code为空---"
);
log
.
info
(
"----code为空---"
);
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"code为空"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"code为空"
));
}
}
String
openid
=
"oXDd91MppH9i5F7xzPwigiMj--5w"
;
String
openid
=
null
;
/*
String access_token = null;
String
access_token
=
null
;
try
{
try
{
JSONObject
jsonData
=
weixinService
.
getAccessToken
(
code
);
JSONObject
jsonData
=
weixinService
.
getAccessToken
(
code
);
openid = jsonData.getString("openid");
openid
=
jsonData
.
getString
(
"openid"
);
access_token = jsonData.getString("access_token");
access_token
=
jsonData
.
getString
(
"access_token"
);
String
refresh_token
=
jsonData
.
getString
(
"refresh_token"
);
String
refresh_token
=
jsonData
.
getString
(
"refresh_token"
);
log
.
info
(
"-----微信回调userInfo---openid=="
+
openid
+
"----access_token==="
+
access_token
);
log
.
info
(
"-----微信回调userInfo---openid=="
+
openid
+
"----access_token==="
+
access_token
);
//验证access_token是否失效
//验证access_token是否失效
...
@@ -116,15 +117,15 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -116,15 +117,15 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"网络异常"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"网络异常"
));
}
*/
}
try
{
try
{
// 获取微信用户基本信息
// 获取微信用户基本信息
/*
JSONObject userinfo_json = weixinService.getUserInfo(access_token,openid);
JSONObject
userinfo_json
=
weixinService
.
getUserInfo
(
access_token
,
openid
);
if
(
userinfo_json
==
null
||
StringUtils
.
isNotBlank
(
userinfo_json
.
getString
(
"errcode"
)))
{
if
(
userinfo_json
==
null
||
StringUtils
.
isNotBlank
(
userinfo_json
.
getString
(
"errcode"
)))
{
log
.
info
(
"调用微信用户基本信息接口失败"
);
log
.
info
(
"调用微信用户基本信息接口失败"
);
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"调用微信用户基本信息接口失败"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"调用微信用户基本信息接口失败"
));
}
}
log.info("微信用户基本信息---user===" +userinfo_json.toJSONString());
*/
log
.
info
(
"微信用户基本信息---user==="
+
userinfo_json
.
toJSONString
());
if
(
activityId
==
null
||
activityId
==
0
){
if
(
activityId
==
null
||
activityId
==
0
){
ActivityBm
activityBm
=
activityBmBiz
.
userInfo
(
key
);
ActivityBm
activityBm
=
activityBmBiz
.
userInfo
(
key
);
if
(
activityBm
==
null
){
if
(
activityBm
==
null
){
...
@@ -138,9 +139,9 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
...
@@ -138,9 +139,9 @@ public class UserBiz extends BaseBiz<UserMapper, User> {
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"redis的报名信息activityId---为空"
));
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"redis的报名信息activityId---为空"
));
}
}
User
userInfo
=
new
User
();
User
userInfo
=
new
User
();
String
nickName
=
"苹果呀"
;
//
userinfo_json.getString("nickname");
String
nickName
=
userinfo_json
.
getString
(
"nickname"
);
String
headimgurl
=
"http://thirdwx.qlogo.cn/mmopen/4eFHvhmOX6XuiaG6ib7wxkLa8AwMLFIbW9BSJ7EmwC3kRMUdgCrobdRUbhjMXbkY7aBc2CazjXFJiap5ianMH6yQnH2UQ4TfkXJw/132"
;
//
userinfo_json.getString("headimgurl");
String
headimgurl
=
userinfo_json
.
getString
(
"headimgurl"
);
String
sex
=
"2"
;
//
userinfo_json.getString("sex");
String
sex
=
userinfo_json
.
getString
(
"sex"
);
if
(
StringUtils
.
isBlank
(
sex
)){
if
(
StringUtils
.
isBlank
(
sex
)){
sex
=
"0"
;
sex
=
"0"
;
}
}
...
...
xx-vehicle/xx-vehicle-api/pom.xml
View file @
67ece478
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
View file @
67ece478
...
@@ -151,6 +151,24 @@ public class Vehicle {
...
@@ -151,6 +151,24 @@ public class Vehicle {
@Column
(
name
=
"travel_status"
)
@Column
(
name
=
"travel_status"
)
private
Integer
travelStatus
;
private
Integer
travelStatus
;
/**
* 终端号
*/
@Column
(
name
=
"terminal_number"
)
private
String
terminalNumber
;
/**
* SIM卡号
*/
@Column
(
name
=
"sim_number"
)
private
String
simNumber
;
/**
* 通讯类型
*/
@Column
(
name
=
"communication_type"
)
private
String
communicationType
;
/**
/**
* 是否删除;0-正常;1-删除
* 是否删除;0-正常;1-删除
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
67ece478
...
@@ -189,8 +189,8 @@ public interface VehicleFeign {
...
@@ -189,8 +189,8 @@ public interface VehicleFeign {
* @return
* @return
*/
*/
@GetMapping
(
value
=
"/vehicle_model/calendar_price/app/unauth/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@GetMapping
(
value
=
"/vehicle_model/calendar_price/app/unauth/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Date
startDate
,
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
)
Date
endDate
,
@RequestParam
(
value
=
"endDate"
)
Long
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
);
@RequestParam
(
value
=
"userId"
)
Integer
userId
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/ResultVehicleVo.java
View file @
67ece478
...
@@ -5,7 +5,7 @@ import lombok.Data;
...
@@ -5,7 +5,7 @@ import lombok.Data;
import
java.util.Date
;
import
java.util.Date
;
@Data
@Data
public
class
ResultVehicleVo
{
public
class
ResultVehicleVo
{
/**
/**
* 主键(uuid)
* 主键(uuid)
*/
*/
...
@@ -26,6 +26,12 @@ public class ResultVehicleVo {
...
@@ -26,6 +26,12 @@ public class ResultVehicleVo {
*/
*/
private
String
numberPlate
;
private
String
numberPlate
;
/**
* 车型
*/
private
String
vehicleType
;
/**
/**
* 品牌(编码,对应关系见相关常量),0-未填写
* 品牌(编码,对应关系见相关常量),0-未填写
*/
*/
...
@@ -49,6 +55,8 @@ public class ResultVehicleVo {
...
@@ -49,6 +55,8 @@ public class ResultVehicleVo {
*/
*/
private
String
parkBranchCompanyName
;
private
String
parkBranchCompanyName
;
/**
/**
* 目的地分支机构(id)
* 目的地分支机构(id)
*/
*/
...
@@ -64,6 +72,12 @@ public class ResultVehicleVo {
...
@@ -64,6 +72,12 @@ public class ResultVehicleVo {
*/
*/
private
Integer
useType
;
private
Integer
useType
;
/**
* 用途名称
*/
private
String
useTypeName
;
/**
/**
* 备注信息
* 备注信息
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleBookRecordQueryVo.java
View file @
67ece478
...
@@ -59,4 +59,6 @@ public class VehicleBookRecordQueryVo extends PageParam {
...
@@ -59,4 +59,6 @@ public class VehicleBookRecordQueryVo extends PageParam {
private
List
<
Integer
>
companyIds
;
private
List
<
Integer
>
companyIds
;
private
String
upkeepIds
;
private
String
upkeepIds
;
private
Integer
userCompany
;
private
Integer
userCompany
;
private
Integer
zoneId
;
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleExcelVo.java
0 → 100644
View file @
67ece478
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
lombok.Data
;
@Data
public
class
VehicleExcelVo
{
/**
* 车牌号,空字符串-没有
*/
private
String
numberPlate
;
/**
* 车辆编号,0-没有
*/
private
Integer
code
;
/**
* 车型
*/
private
String
vehicleType
;
/**
* 用途名称
*/
private
String
useTypeName
;
/**
* 停靠分支机构(名)
*/
private
String
parkBranchCompanyName
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleInformationDownloadBiz.java
0 → 100644
View file @
67ece478
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.alibaba.fastjson.JSON
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.pojo.ResultVehicleVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
import
org.apache.commons.beanutils.PropertyUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Slf4j
public
class
VehicleInformationDownloadBiz
extends
BaseBiz
<
VehicleMapper
,
Vehicle
>
{
@Autowired
private
VehicleBiz
vehicleBiz
;
public
List
getByPageNotAllData
(
VehiclePageQueryVo
vehiclePageQueryVo
,
List
<
Integer
>
companyList
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
//处理预定日期相关参数
vehicleBiz
.
adjustBookedInfoParam
(
params
,
vehiclePageQueryVo
);
if
(
companyList
!=
null
&&
companyList
.
size
()
>
0
)
{
params
.
put
(
"companyList"
,
companyList
);
}
else
{
params
.
put
(
"companyList"
,
Arrays
.
asList
(-
1
));
}
return
mapper
.
getByPageNotAllData
(
params
);
}
public
List
getByPage
(
VehiclePageQueryVo
vehiclePageQueryVo
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
//处理预定日期相关参数
vehicleBiz
.
adjustBookedInfoParam
(
params
,
vehiclePageQueryVo
);
params
.
get
(
"yearMonthAndParam"
);
if
(
vehiclePageQueryVo
.
getModelId
()
==
null
)
{
params
.
remove
(
"modelId"
);
}
return
mapper
.
getByPage
(
params
);
}
//getResultVehicleVoList
public
List
<
ResultVehicleVo
>
getResultVehicleVoList
(
String
vehiclePageQueryVoJson
,
UserDTO
userDTO
)
{
VehiclePageQueryVo
vehiclePageQueryVo
=
new
VehiclePageQueryVo
();
try
{
if
(
StringUtils
.
isNotBlank
(
vehiclePageQueryVoJson
)){
vehiclePageQueryVo
=
JSON
.
parseObject
(
vehiclePageQueryVoJson
,
VehiclePageQueryVo
.
class
);
}
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
return
getByPageNotAllData
(
vehiclePageQueryVo
,
companyList
);
}
return
getByPage
(
vehiclePageQueryVo
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
new
ArrayList
();
}
public
List
<
VehicleExcelVo
>
getList
(
String
vehiclePageQueryVoJson
,
UserDTO
userDTO
)
throws
Exception
{
List
<
ResultVehicleVo
>
resultVehicleVoList
=
getResultVehicleVoList
(
vehiclePageQueryVoJson
,
userDTO
);
ArrayList
<
VehicleExcelVo
>
arrayList
=
Lists
.
newArrayList
();
resultVehicleVoList
.
parallelStream
().
forEach
(
result
->{
try
{
VehicleExcelVo
vehicleExcelVo
=
new
VehicleExcelVo
();
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicleExcelVo
,
result
);
arrayList
.
add
(
vehicleExcelVo
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
e
.
printStackTrace
();
}
});
return
arrayList
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
View file @
67ece478
...
@@ -261,7 +261,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -261,7 +261,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
//价格重置
//价格重置
vehicle_price
=
vehicle_base_price
;
vehicle_price
=
vehicle_base_price
;
//未乘以会员折扣的价格
//未乘以会员折扣的价格
BigDecimal
no_discount_price
=
new
BigDecimal
(
vehicle_price
.
doubleValue
(
));
BigDecimal
no_discount_price
=
new
BigDecimal
(
Objects
.
toString
(
vehicle_price
.
doubleValue
()
));
//免费天数重置
//免费天数重置
Integer
free_days
=
DEFAULT_FREE_DAYS
;
Integer
free_days
=
DEFAULT_FREE_DAYS
;
//节假日对应的价格和免费天数
//节假日对应的价格和免费天数
...
@@ -275,17 +275,17 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -275,17 +275,17 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
}
else
{
}
else
{
switch
(
vehicleModelCalendarPrice
.
getType
())
{
switch
(
vehicleModelCalendarPrice
.
getType
())
{
case
VehicleModelPriceType
.
MULTIPLE
:
case
VehicleModelPriceType
.
MULTIPLE
:
no_discount_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
vehicleModelCalendarPrice
.
getMultiple
().
doubleValue
(
)));
no_discount_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
String
.
valueOf
(
vehicleModelCalendarPrice
.
getMultiple
().
doubleValue
()
)));
vehicle_price
=
no_discount_price
.
multiply
(
new
BigDecimal
(
discount
/
100.00
));
vehicle_price
=
no_discount_price
.
multiply
(
new
BigDecimal
(
Objects
.
toString
(
discount
/
100.00
)
));
break
;
break
;
case
VehicleModelPriceType
.
ABS
:
case
VehicleModelPriceType
.
ABS
:
no_discount_price
=
vehicleModelCalendarPrice
.
getPrice
();
no_discount_price
=
vehicleModelCalendarPrice
.
getPrice
();
vehicle_price
=
no_discount_price
.
multiply
(
new
BigDecimal
(
discount
/
100.00
));
vehicle_price
=
no_discount_price
.
multiply
(
new
BigDecimal
(
Objects
.
toString
(
discount
/
100.00
)
));
break
;
break
;
case
VehicleModelPriceType
.
MEMBER
:
case
VehicleModelPriceType
.
MEMBER
:
memberLevel
=
vehicleModelCalendarPrice
.
getLevel
()
>
memberLevel
?
vehicleModelCalendarPrice
.
getLevel
()
:
memberLevel
;
memberLevel
=
vehicleModelCalendarPrice
.
getLevel
()
>
memberLevel
?
vehicleModelCalendarPrice
.
getLevel
()
:
memberLevel
;
Integer
level_discount
=
levelAndDiscountMap
.
get
(
memberLevel
);
Integer
level_discount
=
levelAndDiscountMap
.
get
(
memberLevel
);
vehicle_price
=
level_discount
==
null
?
vehicle_price
:
vehicle_price
.
multiply
(
new
BigDecimal
(
level_discount
/
100.00
));
vehicle_price
=
level_discount
==
null
?
vehicle_price
:
vehicle_price
.
multiply
(
new
BigDecimal
(
Objects
.
toString
(
level_discount
/
100.00
)
));
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -301,7 +301,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -301,7 +301,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
no_discount_price
=
(
BigDecimal
)
price_freeDays_map
.
get
(
BASE_PRICE_VAL
);
no_discount_price
=
(
BigDecimal
)
price_freeDays_map
.
get
(
BASE_PRICE_VAL
);
}
}
vehicleModelCalendarPriceDTO
.
setNo_discount_price
(
no_discount_price
);
vehicleModelCalendarPriceDTO
.
setNo_discount_price
(
no_discount_price
);
vehicleModelCalendarPriceDTO
.
setPrice
(
vehicle_price
.
setScale
(
2
,
RoundingMode
.
HALF_UP
)
);
vehicleModelCalendarPriceDTO
.
setPrice
(
vehicle_price
);
vehicleModelCalendarPriceDTO
.
setFreeDays
(
free_days
);
vehicleModelCalendarPriceDTO
.
setFreeDays
(
free_days
);
final_startLocalDate
=
final_startLocalDate
.
plusDays
(
1
);
final_startLocalDate
=
final_startLocalDate
.
plusDays
(
1
);
vehicleModelCalendarPriceVos
.
add
(
vehicleModelCalendarPriceDTO
);
vehicleModelCalendarPriceVos
.
add
(
vehicleModelCalendarPriceDTO
);
...
@@ -330,7 +330,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -330,7 +330,7 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
free_days
=
vehicleModelHolidayPriceDTO
.
getFreeDays
()
==
null
?
free_days
:
vehicleModelHolidayPriceDTO
.
getFreeDays
();
free_days
=
vehicleModelHolidayPriceDTO
.
getFreeDays
()
==
null
?
free_days
:
vehicleModelHolidayPriceDTO
.
getFreeDays
();
}
}
}
}
vehicle_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
discount
/
100.00
));
vehicle_price
=
vehicle_price
.
multiply
(
new
BigDecimal
(
Objects
.
toString
(
discount
/
100.00
)
));
vehicle_price_days_map
.
put
(
PRICE_VAL
,
vehicle_price
);
vehicle_price_days_map
.
put
(
PRICE_VAL
,
vehicle_price
);
vehicle_price_days_map
.
put
(
DAYS_VAL
,
free_days
);
vehicle_price_days_map
.
put
(
DAYS_VAL
,
free_days
);
log
.
info
(
"(节假日|非节假日未设置的)价格和免费天数 处理【{}】"
,
vehicle_price_days_map
);
log
.
info
(
"(节假日|非节假日未设置的)价格和免费天数 处理【{}】"
,
vehicle_price_days_map
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelHolidayPriceBiz.java
View file @
67ece478
...
@@ -154,6 +154,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -154,6 +154,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
Example
example
=
new
Example
(
VehicleModelHolidayPrice
.
class
);
Example
example
=
new
Example
(
VehicleModelHolidayPrice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andBetween
(
"festivalDay"
,
startDate
,
endDate
);
criteria
.
andBetween
(
"festivalDay"
,
startDate
,
endDate
);
criteria
.
andEqualTo
(
"isDel"
,
0
);
List
<
VehicleModelHolidayPrice
>
modelHolidayPrices
=
mapper
.
selectByExample
(
example
);
List
<
VehicleModelHolidayPrice
>
modelHolidayPrices
=
mapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
modelHolidayPrices
))
{
if
(
CollectionUtils
.
isEmpty
(
modelHolidayPrices
))
{
return
vehicleModelHolidayPriceDTOS
;
return
vehicleModelHolidayPriceDTOS
;
...
@@ -164,7 +165,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
...
@@ -164,7 +165,7 @@ public class VehicleModelHolidayPriceBiz extends BaseBiz<VehicleModelHolidayPric
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
modelHolidayPrices
)
{
for
(
VehicleModelHolidayPrice
modelHolidayPrice
:
modelHolidayPrices
)
{
vehicleModelHolidayPriceDTO
=
new
VehicleModelHolidayPriceDTO
();
vehicleModelHolidayPriceDTO
=
new
VehicleModelHolidayPriceDTO
();
BeanUtils
.
copyProperties
(
modelHolidayPrice
,
vehicleModelHolidayPriceDTO
);
BeanUtils
.
copyProperties
(
modelHolidayPrice
,
vehicleModelHolidayPriceDTO
);
vehicleModelHolidayPriceDTO
.
setFestival
(
festivalMap
==
null
?
""
:
festivalMap
.
get
(
modelHolidayPrice
.
getFestivalId
()).
getName
());
vehicleModelHolidayPriceDTO
.
setFestival
(
(
festivalMap
==
null
||
null
==
festivalMap
.
get
(
modelHolidayPrice
.
getFestivalId
()))
?
""
:
festivalMap
.
get
(
modelHolidayPrice
.
getFestivalId
()).
getName
());
vehicleModelHolidayPriceDTOS
.
add
(
vehicleModelHolidayPriceDTO
);
vehicleModelHolidayPriceDTOS
.
add
(
vehicleModelHolidayPriceDTO
);
}
}
return
vehicleModelHolidayPriceDTOS
;
return
vehicleModelHolidayPriceDTOS
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
View file @
67ece478
...
@@ -12,9 +12,11 @@ import java.util.Map;
...
@@ -12,9 +12,11 @@ import java.util.Map;
public
interface
VehicleMapper
extends
Mapper
<
Vehicle
>
{
public
interface
VehicleMapper
extends
Mapper
<
Vehicle
>
{
public
List
<
ResultVehicleVo
>
getByPage
(
Map
<
String
,
Object
>
params
);
public
List
<
ResultVehicleVo
>
getByPage
(
Map
<
String
,
Object
>
params
);
public
List
<
ResultVehicleVo
>
getByPageNotAllData
(
Map
<
String
,
Object
>
params
);
public
List
<
ResultVehicleVo
>
getByPageNotAllData
(
Map
<
String
,
Object
>
params
);
public
int
updateStatusById
(
Map
<
String
,
Object
>
params
);
public
int
updateStatusById
(
Map
<
String
,
Object
>
params
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelCalendarPriceController.java
View file @
67ece478
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.date.DateUtil
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
@@ -53,12 +54,15 @@ public class VehicleModelCalendarPriceController {
...
@@ -53,12 +54,15 @@ public class VehicleModelCalendarPriceController {
}
}
@GetMapping
(
value
=
"/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@GetMapping
(
value
=
"/price"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Date
startDate
,
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
findVehicleModelCalendarPriceByDate
(
@RequestParam
(
value
=
"startDate"
)
Long
startDate
,
@RequestParam
(
value
=
"endDate"
)
Date
endDate
,
@RequestParam
(
value
=
"endDate"
)
Long
endDate
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"vehicleModelId"
)
Integer
vehicleModelId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
)
{
@RequestParam
(
value
=
"userId"
)
Integer
userId
)
{
startDate
=
Date
.
from
(
startDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
().
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
endDate
=
Date
.
from
(
endDate
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
().
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
());
Date
startDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
startDate
));
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDate
,
endDate
,
vehicleModelId
,
userId
));
//Date.from(startDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
Date
endDateDay
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
endDate
));
//Date.from(endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant());
return
ObjectRestResponse
.
succ
(
vehicleModelCalendarPriceBiz
.
findVehicleModelCalendarPriceByDateAndVehilceIdAndUserId
(
startDateDay
,
endDateDay
,
vehicleModelId
,
userId
));
}
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/VehicleInformationDownloadController.java
0 → 100644
View file @
67ece478
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleInformationDownloadBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.pojo.VehicleExcelVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
@RestController
@RequestMapping
(
"VehicleInformationDownload"
)
@Slf4j
public
class
VehicleInformationDownloadController
extends
BaseController
<
VehicleInformationDownloadBiz
>
{
@Autowired
UserFeign
userFeign
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
@Autowired
private
VehicleBiz
vehicleBiz
;
@Autowired
HttpServletResponse
response
;
@GetMapping
(
"/excel"
)
public
void
downloadExcel
(
@RequestParam
(
value
=
"vehiclePageQueryVoJson"
,
required
=
false
)
String
vehiclePageQueryVoJson
)
throws
Exception
{
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
if
(
userDTO
==
null
)
{
throw
new
BaseException
(
"token已失效"
);
}
List
<
VehicleExcelVo
>
rows
=
baseBiz
.
getList
(
vehiclePageQueryVoJson
,
userDTO
);
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
writer
.
addHeaderAlias
(
"numberPlate"
,
"车牌号"
);
writer
.
addHeaderAlias
(
"code"
,
"车辆编码"
);
writer
.
addHeaderAlias
(
"vehicleType"
,
"车型"
);
writer
.
addHeaderAlias
(
"useTypeName"
,
"用途"
);
writer
.
addHeaderAlias
(
"parkBranchCompanyName"
,
"停靠分公司"
);
// 一次性写出内容,使用默认样式,强制输出标题
writer
.
write
(
rows
,
true
);
//response为HttpServletResponse对象
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename=clxx.xlsx"
);
//out为OutputStream,需要写出到的目标流
ServletOutputStream
out
=
response
.
getOutputStream
();
writer
.
flush
(
out
,
true
);
// 关闭writer,释放内存
writer
.
close
();
//此处记得关闭输出Servlet流
IoUtil
.
close
(
out
);
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
67ece478
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
SELECT r.* FROM (
SELECT r.* FROM (
select DISTINCT v.`id`,
select DISTINCT v.`id`,
v.`code`,
v.`code`,
(CASE WHEN #{status}
!=
null THEN #{status}
(CASE WHEN #{status}
is not
null THEN #{status}
ELSE v.status END) status ,
ELSE v.status END) status ,
v.number_plate,
v.number_plate,
v.brand,
v.brand,
...
@@ -70,7 +70,9 @@
...
@@ -70,7 +70,9 @@
v.receive_time,
v.receive_time,
v.update_time,
v.update_time,
v.model_id,
v.model_id,
v.mileage_last_update as mileage
v.mileage_last_update as mileage,
c.val as useTypeName,
vm.name as vehicleType
<if
test=
" yearMonthAndParam != null "
>
<if
test=
" yearMonthAndParam != null "
>
,vbi.booked_date
,vbi.booked_date
</if>
</if>
...
@@ -87,6 +89,8 @@
...
@@ -87,6 +89,8 @@
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where
where
v.is_del=0
v.is_del=0
<if
test=
"mRangeDateEnd !=null"
>
<if
test=
"mRangeDateEnd !=null"
>
...
@@ -174,12 +178,13 @@
...
@@ -174,12 +178,13 @@
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
<select
id=
"getByPageNotAllData"
parameterType=
"java.util.Map"
<select
id=
"getByPageNotAllData"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.pojo.ResultVehicleVo"
>
resultType=
"com.xxfc.platform.vehicle.pojo.ResultVehicleVo"
>
SELECT r.* FROM (
SELECT r.* FROM (
select DISTINCT v.`id`,
select DISTINCT v.`id`,
v.`code`,
v.`code`,
(CASE WHEN #{status}
!=
null THEN #{status}
(CASE WHEN #{status}
is not
null THEN #{status}
ELSE v.status END) status ,
ELSE v.status END) status ,
v.number_plate,
v.number_plate,
v.brand,
v.brand,
...
@@ -210,7 +215,9 @@
...
@@ -210,7 +215,9 @@
v.receive_time,
v.receive_time,
v.update_time,
v.update_time,
v.model_id,
v.model_id,
v.mileage_last_update as mileage
v.mileage_last_update as mileage,
c.val as useTypeName,
vm.name as vehicleType
<if
test=
" yearMonthAndParam !=null "
>
<if
test=
" yearMonthAndParam !=null "
>
,vbi.booked_date
,vbi.booked_date
</if>
</if>
...
@@ -227,29 +234,31 @@
...
@@ -227,29 +234,31 @@
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN branch_company bc2 ON v.subordinate_branch = bc2.id
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where
where
v.is_del=0
v.is_del=0
<if
test=
"companyList != null"
>
<if
test=
"companyList != null"
>
and ( v.park_branch_company_id in (
and ( v.park_branch_company_id in (
<trim
suffixOverrides=
","
>
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
#{companyId},
</foreach>
</foreach>
</trim>
</trim>
)
)
<!--or v.expect_destination_branch_company_id in (
<!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=",">
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
<foreach collection="companyList" item="companyId">
#{companyId},
#{companyId},
</foreach>
</foreach>
</trim>
</trim>
)-->
)-->
<!-- or v.subordinate_branch in (-->
<!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">-->
<!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},-->
<!-- #{companyId},-->
<!-- </foreach>-->
<!-- </foreach>-->
<!-- </trim>-->
<!-- </trim>-->
)
)
</if>
</if>
<if
test=
"mRangeDateEnd !=null"
>
<if
test=
"mRangeDateEnd !=null"
>
...
@@ -276,27 +285,21 @@
...
@@ -276,27 +285,21 @@
<if
test=
"insuranceCompany !=null"
>
<if
test=
"insuranceCompany !=null"
>
and v.insurance_company = #{insuranceCompany}
and v.insurance_company = #{insuranceCompany}
</if>
</if>
<if
test=
"belongToName !=null
and belongToName != ''
"
>
<if
test=
"belongToName !=null"
>
and v.belong_to_name
like concat('%',#{belongToName},'%')
and v.belong_to_name
= #{belongToName}
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
and v.vin = #{vin}
</if>
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<!-- </if>-->
<if
test=
"code !=null"
>
<if
test=
"code !=null"
>
and v.code = #{code}
and v.code = #{code}
</if>
</if>
<if
test=
"status !=null
and status != 6 and status != 7
"
>
<if
test=
"status !=null"
>
and v.status = #{status}
and v.status = #{status}
</if>
</if>
<if
test=
"status !=null and status == 6"
>
and v3.id is not NULL and v2.book_type = 3 and v3.state = 0
</if>
<if
test=
"status !=null and status == 7"
>
and v3.id is not NULL and v2.book_type = 6 and v3.state = 0
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate like concat('%',#{numberPlate},'%')
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
</if>
...
@@ -334,9 +337,12 @@
...
@@ -334,9 +337,12 @@
and bc.zone_id=#{zoneId}
and bc.zone_id=#{zoneId}
</if>
</if>
</if>
</if>
order by v.code
) r ORDER BY r.parkBranchCompanyName
) r ORDER BY r.parkBranchCompanyName
</select>
</select>
<select
id=
"lockByCode"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
<select
id=
"lockByCode"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
parameterType=
"com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo"
>
parameterType=
"com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo"
>
select
select
...
...
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