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
7f2e8a79
Commit
7f2e8a79
authored
Aug 09, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
0b98127f
bfc9fe0a
Changes
37
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
210 additions
and
129 deletions
+210
-129
pom.xml
ace-common/pom.xml
+5
-0
ResultCode.java
...thub/wxiaoqi/security/common/util/process/ResultCode.java
+11
-0
resultcod.properties
...common/src/main/resources/properties/resultcod.properties
+15
-1
AccessGatewayFilter.java
...hub/wxiaoqi/security/gate/filter/AccessGatewayFilter.java
+4
-8
ResponseRecordFilter.java
...ub/wxiaoqi/security/gate/filter/ResponseRecordFilter.java
+0
-1
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+1
-1
IntegralRuleBiz.java
.../java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
+4
-4
IntegralUserStatusBiz.java
...com/xxfc/platform/activity/biz/IntegralUserStatusBiz.java
+11
-11
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+6
-0
IntegralUserStatusMapper.java
...fc/platform/activity/mapper/IntegralUserStatusMapper.java
+3
-2
UserCouponMapper.java
...a/com/xxfc/platform/activity/mapper/UserCouponMapper.java
+2
-0
UserCouponAdminController.java
...atform/activity/rest/admin/UserCouponAdminController.java
+7
-2
IntegralSignRecordMapper.xml
...er/src/main/resources/mapper/IntegralSignRecordMapper.xml
+1
-1
IntegralUserStatusMapper.xml
...er/src/main/resources/mapper/IntegralUserStatusMapper.xml
+5
-2
UserCouponMapper.xml
...ity-server/src/main/resources/mapper/UserCouponMapper.xml
+4
-0
AppHomeController.java
...in/java/com/xxfc/platform/app/rest/AppHomeController.java
+1
-0
CampsiteShopController.java
...m/xxfc/platform/campsite/rest/CampsiteShopController.java
+4
-5
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+0
-2
UserBiz.java
...erver/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
+20
-0
UserController.java
...c/main/java/com/xxfc/platform/im/rest/UserController.java
+6
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+5
-4
OrderDepositRefundRecordBiz.java
.../xxfc/platform/order/biz/OrderDepositRefundRecordBiz.java
+5
-1
OrderTourVerificationBiz.java
...com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
+6
-9
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+11
-7
TourGoodDTO.java
...src/main/java/com/xxfc/platform/tour/dto/TourGoodDTO.java
+3
-1
TourGood.java
...src/main/java/com/xxfc/platform/tour/entity/TourGood.java
+4
-1
ResCode.java
...a/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
+11
-5
VehicleModel.java
...n/java/com/xxfc/platform/vehicle/entity/VehicleModel.java
+4
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+1
-1
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+9
-4
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+10
-15
VehicleBookHourInfoBiz.java
...com/xxfc/platform/vehicle/biz/VehicleBookHourInfoBiz.java
+6
-4
VehicleDepartureService.java
...om/xxfc/platform/vehicle/biz/VehicleDepartureService.java
+1
-1
VehicleDispatchInfoBiz.java
...com/xxfc/platform/vehicle/biz/VehicleDispatchInfoBiz.java
+1
-2
VehicleModelBiz.java
...n/java/com/xxfc/platform/vehicle/biz/VehicleModelBiz.java
+5
-8
VehiclePlatCataBiz.java
...ava/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
+7
-14
VehicleModelController.java
...om/xxfc/platform/vehicle/rest/VehicleModelController.java
+11
-12
No files found.
ace-common/pom.xml
View file @
7f2e8a79
...
...
@@ -204,6 +204,11 @@
<groupId>
org.springframework.amqp
</groupId>
<artifactId>
spring-amqp
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot
</artifactId>
<version>
2.1.3.RELEASE
</version>
</dependency>
</dependencies>
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/process/ResultCode.java
View file @
7f2e8a79
...
...
@@ -15,6 +15,17 @@ public class ResultCode {
public
static
int
SUCCESS_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"SUCCESS_CODE"
));
// 操作失败
public
static
int
FAILED_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"FAILED_CODE"
));
// 车辆预定失败,请重试
public
static
int
BOOKED_FAILED_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"BOOKED_FAILED_CODE"
));
// 车辆预定失败,请重试
public
static
int
ONLY_BOOK_FROM_TODAY
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"BOOKED_FAILED_CODE"
));
// 添加车辆失败,请重试
public
static
int
ADD_VEHICLE_FAIL
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ADD_VEHICLE_FAIL"
));
// 修改车辆失败,请重试
public
static
int
UPDATE_VEHICLE_FAIL
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"UPDATE_VEHICLE_FAIL"
));
// 操作失败
public
static
int
NULL_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"NULL_CODE"
));
// 操作出现异常
...
...
ace-common/src/main/resources/properties/resultcod.properties
View file @
7f2e8a79
...
...
@@ -209,3 +209,17 @@ WRONG_FORMAT_OF_ID_CARD=4005
#资料不全
INCOMPLETE_DATA
=
4006
4006
=
资料不齐全!
BOOKED_FAILED_CODE
=
4007
4007
=
车辆预定失败,请重试!
ONLY_BOOK_FROM_TODAY
=
4008
4008
=
预定时间不能小于当前时间
ADD_VEHICLE_FAIL
=
4009
4009
=
添加车辆失败,请重试
UPDATE_VEHICLE_FAIL
=
4010
4010
=
修改车辆失败,请重试
ace-gate/src/main/java/com/github/wxiaoqi/security/gate/filter/AccessGatewayFilter.java
View file @
7f2e8a79
...
...
@@ -2,8 +2,6 @@ package com.github.wxiaoqi.security.gate.filter;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.api.vo.authority.PermissionInfo
;
import
com.github.wxiaoqi.security.api.vo.log.LogInfo
;
import
com.github.wxiaoqi.security.auth.client.config.ServiceAuthConfig
;
...
...
@@ -27,25 +25,23 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.gateway.filter.GatewayFilterChain
;
import
org.springframework.cloud.gateway.filter.GlobalFilter
;
import
org.springframework.cloud.gateway.support.DefaultServerRequest
;
import
org.springframework.cloud.gateway.support.ServerWebExchangeUtils
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.core.io.buffer.DataBuffer
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.server.reactive.ServerHttpRequest
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.reactive.function.server.ServerRequest
;
import
org.springframework.web.server.ServerWebExchange
;
import
reactor.core.publisher.Flux
;
import
reactor.core.publisher.Mono
;
import
java.net.URI
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.function.Predicate
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
...
...
ace-gate/src/main/java/com/github/wxiaoqi/security/gate/filter/ResponseRecordFilter.java
View file @
7f2e8a79
...
...
@@ -19,7 +19,6 @@ import org.springframework.http.codec.ClientCodecConfigurer;
import
org.springframework.http.codec.json.Jackson2JsonDecoder
;
import
org.springframework.http.codec.json.Jackson2JsonEncoder
;
import
org.springframework.http.server.reactive.ServerHttpResponseDecorator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.reactive.function.BodyInserter
;
import
org.springframework.web.reactive.function.BodyInserters
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
7f2e8a79
...
...
@@ -156,11 +156,11 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
AppUserRelationTemp
relationTemp
=
new
AppUserRelationTemp
();
relationTemp
.
setUserId
(
pid
);
relationTemp
.
setTempId
(
userid
);
relationTemp
.
setIsDel
(
0
);
relationTemp
.
setType
(
1
);
AppUserRelationTemp
relationTemp1
=
relationTempBiz
.
selectOne
(
relationTemp
);
if
(
relationTemp1
==
null
){
relationTemp
.
setTempId
(
userid
);
relationTempBiz
.
insertSelective
(
relationTemp
);
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralRuleBiz.java
View file @
7f2e8a79
...
...
@@ -103,9 +103,9 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
public
void
getIntegralStatus
(
AppUserDTO
appUserDTO
,
IntegralRule
integralRule
)
{
IntegralUserStatus
integralUserStatus1
=
integralUserStatusBiz
.
selectByUserAndCode
(
integralRule
.
getCode
(),
appUserDTO
.
getUserid
());
if
(
integralUserStatus1
!=
null
)
{
integralRule
.
setIntegralStatus
(
integralUserStatus1
.
getIntegralStatus
());
List
<
IntegralUserStatus
>
oldValue
=
integralUserStatusBiz
.
selectByUserAndCode
(
integralRule
.
getCode
(),
appUserDTO
.
getUserid
());
if
(
oldValue
!=
null
&&
oldValue
.
size
()
>
0
)
{
integralRule
.
setIntegralStatus
(
oldValue
.
get
(
0
)
.
getIntegralStatus
());
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserStatusBiz.java
View file @
7f2e8a79
...
...
@@ -6,12 +6,13 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.entity.IntegralUserStatus
;
import
com.xxfc.platform.activity.mapper.IntegralUserStatusMapper
;
import
com.xxfc.platform.activity.util.IntegralToolsUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.
TimeZone
;
import
java.util.
List
;
@Service
@Transactional
...
...
@@ -20,26 +21,25 @@ public class IntegralUserStatusBiz extends BaseBiz<IntegralUserStatusMapper, Int
public
ObjectRestResponse
save
(
IntegralUserStatus
integralUserStatus
)
{
if
(
integralUserStatus
!=
null
)
{
IntegralUserStatus
oldValue
=
mapper
.
selectByUserAndCode
(
integralUserStatus
);
if
(
oldValue
!=
null
)
{
BeanUtil
.
copyProperties
(
integralUserStatus
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveById
(
oldValue
);
List
<
IntegralUserStatus
>
oldValue
=
selectByUserAndCode
(
integralUserStatus
.
getIntegralRuleCode
(),
integralUserStatus
.
getUserId
()
);
if
(
oldValue
!=
null
&&
oldValue
.
size
()
>
0
)
{
BeanUtil
.
copyProperties
(
integralUserStatus
,
oldValue
.
get
(
0
)
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
updateSelectiveById
(
oldValue
.
get
(
0
)
);
}
insertSelective
(
integralUserStatus
);
}
return
ObjectRestResponse
.
succ
();
}
public
IntegralUserStatus
selectByUserAndCode
(
String
code
,
Integer
userId
)
{
public
List
<
IntegralUserStatus
>
selectByUserAndCode
(
String
code
,
Integer
userId
)
{
if
(!
StringUtils
.
isAllBlank
(
code
,
userId
+
""
))
{
long
current
=
System
.
currentTimeMillis
();
long
startTime
=
current
/
(
1000
*
3600
*
24
)
*
(
1000
*
3600
*
24
)
-
TimeZone
.
getDefault
().
getRawOffset
();
IntegralUserStatus
integralUserStatus
=
new
IntegralUserStatus
();
integralUserStatus
.
setIntegralRuleCode
(
code
);
integralUserStatus
.
setUserId
(
userId
);
integralUserStatus
.
setStartTime
(
startTime
);
integralUserStatus
.
setEndTime
(
startTime
+
24
*
60
*
60
*
1000
-
1
);
if
(!
"REGISTER"
.
equals
(
code
)
&&
!
"CRETIFICATION"
.
equals
(
code
)
&&
!
"BINDWECHAT"
.
equals
(
code
))
{
integralUserStatus
.
setStartTime
(
IntegralToolsUtils
.
getDayStart
());
integralUserStatus
.
setEndTime
(
IntegralToolsUtils
.
getDayStart
()
+
24
*
60
*
60
*
1000
);
}
log
.
info
(
"获取用户积分状态:"
+
integralUserStatus
.
toString
());
return
mapper
.
selectByUserAndCode
(
integralUserStatus
);
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
7f2e8a79
...
...
@@ -308,6 +308,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
userCoupon
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
userCoupon
.
setStartTime
(
couponVo
.
getValidStartTime
());
userCoupon
.
setExpireTime
(
couponVo
.
getValidEndTime
());
userCoupon
.
setTickerNo
(
Snowflake
.
build
()+
""
);
userCoupons
.
add
(
userCoupon
);
}
return
mapper
.
inserBatch
(
userCoupons
);
...
...
@@ -328,6 +329,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
userCoupon
.
setExpireTime
(
couponVo
.
getValidEndTime
());
userCoupon
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
userCoupon
.
setUserId
(
phoneAndAppUserLoginMap
.
get
(
userCounponData
.
get
(
i
)[
0
]));
userCoupon
.
setTickerNo
(
Snowflake
.
build
()+
""
);
userCoupons
.
add
(
userCoupon
);
}
...
...
@@ -359,4 +361,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
criteria
.
andIn
(
"userId"
,
userIds
);
mapper
.
deleteByExample
(
example
);
}
public
void
updateUserCouponStatusById
(
Integer
id
)
{
mapper
.
updateUserCouponStatusById
(
id
);
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/IntegralUserStatusMapper.java
View file @
7f2e8a79
...
...
@@ -3,8 +3,9 @@ package com.xxfc.platform.activity.mapper;
import
com.xxfc.platform.activity.entity.IntegralUserStatus
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
IntegralUserStatusMapper
extends
Mapper
<
IntegralUserStatus
>
{
import
java.util.List
;
IntegralUserStatus
selectByUserAndCode
(
IntegralUserStatus
integralUserStatus
);
public
interface
IntegralUserStatusMapper
extends
Mapper
<
IntegralUserStatus
>
{
List
<
IntegralUserStatus
>
selectByUserAndCode
(
IntegralUserStatus
integralUserStatus
);
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/UserCouponMapper.java
View file @
7f2e8a79
...
...
@@ -34,4 +34,6 @@ public interface UserCouponMapper extends Mapper<UserCoupon> , InsertListMapper<
List
<
UserCouponDTO
>
findUserCoupons
(
UserCouponFindDTO
userCouponFindDTO
);
int
inserBatch
(
@Param
(
"userCoupons"
)
List
<
UserCoupon
>
userCoupons
);
void
updateUserCouponStatusById
(
@Param
(
"id"
)
Integer
id
);
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/admin/UserCouponAdminController.java
View file @
7f2e8a79
package
com
.
xxfc
.
platform
.
activity
.
rest
.
admin
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
...
@@ -78,4 +76,11 @@ public class UserCouponAdminController {
}
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
null
);
}
@DeleteMapping
(
"/{id}"
)
public
ObjectRestResponse
<
Void
>
deleteUserConuponById
(
@PathVariable
(
"id"
)
Integer
id
)
{
userCouponBiz
.
updateUserCouponStatusById
(
id
);
return
ObjectRestResponse
.
succ
();
}
}
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralSignRecordMapper.xml
View file @
7f2e8a79
...
...
@@ -12,7 +12,7 @@
<result
column=
"last_time"
property=
"lastTime"
jdbcType=
"BIGINT"
/>
</resultMap>
<select
id=
"
selectByUser
Id"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.activity.entity.IntegralSignRecord"
>
<select
id=
"Id"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.activity.entity.IntegralSignRecord"
>
select * from integral_sign_record
where user_id = #{userId} and isdel = 0
order by last_time
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/IntegralUserStatusMapper.xml
View file @
7f2e8a79
...
...
@@ -10,7 +10,10 @@
<select
id=
"selectByUserAndCode"
resultType=
"com.xxfc.platform.activity.entity.IntegralUserStatus"
parameterType=
"com.xxfc.platform.activity.entity.IntegralUserStatus"
>
select * from integral_user_status
where integral_rule_code = #{integralRuleCode} and user_id = #{userId}
and crt_time between #{startTime} and #{endTime} and integral_status =1
where integral_rule_code = #{integralRuleCode} and user_id = #{userId} and integral_status =1
<if
test=
"startTime != null"
>
and crt_time between #{startTime} and #{endTime}
</if>
order by upd_time DESC
</select>
</mapper>
\ No newline at end of file
xx-activity/xx-activity-server/src/main/resources/mapper/UserCouponMapper.xml
View file @
7f2e8a79
...
...
@@ -109,4 +109,8 @@
(#{userCoupon.userId},#{userCoupon.couponId},#{userCoupon.startTime},#{userCoupon.expireTime},#{userCoupon.crtTime} )
</foreach>
</insert>
<update
id=
"updateUserCouponStatusById"
>
update `user_coupon` set `is_del`=1 where `id`=#{id}
</update>
</mapper>
\ No newline at end of file
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppHomeController.java
View file @
7f2e8a79
...
...
@@ -9,6 +9,7 @@ import com.xxfc.platform.app.biz.CofigBiz;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.campsite.feign.CampsiteFeign
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/rest/CampsiteShopController.java
View file @
7f2e8a79
package
com
.
xxfc
.
platform
.
campsite
.
rest
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.sun.org.apache.regexp.internal.RE
;
import
com.xxfc.platform.campsite.biz.CampsiteShopBiz
;
import
com.xxfc.platform.campsite.entity.CampsiteShop
;
import
com.xxfc.platform.campsite.vo.CampsiteShopDetailVo
;
...
...
@@ -13,11 +11,12 @@ import com.xxfc.platform.campsite.vo.CampsiteShopPageVo;
import
com.xxfc.platform.campsite.vo.CampsiteShopVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
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
java.util.List
;
import
java.util.Map
;
/**
* @author libin
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
7f2e8a79
...
...
@@ -50,7 +50,6 @@ public class MsgBiz {
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
,
type
);
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
Pageable
pageable
=
PageRequest
.
of
(--
page
,
limit
);
...
...
@@ -88,7 +87,6 @@ public class MsgBiz {
if
(
appUserDTO
!=
null
)
{
userId
=
appUserDTO
.
getImUserid
();
}
log
.
info
(
"获取消息列表: page = {}, limit = {}, type = {}"
,
page
,
limit
);
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
Pageable
pageable
=
PageRequest
.
of
(--
page
,
limit
);
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
7f2e8a79
...
...
@@ -5,14 +5,18 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.mongodb.client.result.UpdateResult
;
import
com.xxfc.platform.im.model.User
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -112,6 +116,22 @@ public class UserBiz {
return
json
.
toJSONString
();
}
public
ObjectRestResponse
updateUserInfo
(
String
nickname
)
{
AppUserDTO
appUserDTO
=
getUserInfo
();
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"token失效"
);
}
if
(
StringUtils
.
isBlank
(
nickname
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
String
phone
=
appUserDTO
.
getUsername
();
Query
query
=
new
Query
(
Criteria
.
where
(
"phone"
).
is
(
phone
));
Update
update
=
Update
.
update
(
"nickname"
,
nickname
);
UpdateResult
updateResult
=
mongoTemplate
.
updateFirst
(
query
,
update
,
Map
.
class
,
"user"
);
return
ObjectRestResponse
.
succ
(
updateResult
);
}
/**
* 远程请求
* @param path
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/UserController.java
View file @
7f2e8a79
...
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.im.rest;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.im.biz.UserBiz
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -42,4 +43,9 @@ public class UserController {
baseResponse
.
setMessage
(
result
);
return
baseResponse
;
}
@PostMapping
(
value
=
"/update"
)
public
ObjectRestResponse
updateUserInfo
(
String
nickname
)
{
return
mtBiz
.
updateUserInfo
(
nickname
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
7f2e8a79
...
...
@@ -28,6 +28,7 @@ import com.xxfc.platform.universal.entity.Dictionary;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleUserLicense
;
...
...
@@ -126,17 +127,17 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
public
ObjectRestResponse
<
OrderPageVO
>
getOrderDetail
(
String
no
,
UserDTO
userDTO
)
{
OrderPageVO
orderPageVo
=
mapper
.
getOrderDetail
(
no
);
if
(
orderPageVo
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"订单不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
ORDER_IS_NOT_EXIST
.
getCode
(),
ResCode
.
ORDER_IS_NOT_EXIST
.
getDesc
()
);
}
if
(
orderPageVo
.
getStatus
()
<=
3
&&
orderPageVo
.
getStatus
()
!=
2
&&
orderPageVo
.
getStatus
()
!=
-
1
)
{
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"订单不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
ORDER_DETAIL_IS_NOT_EXIST
.
getCode
(),
ResCode
.
ORDER_DETAIL_IS_NOT_EXIST
.
getDesc
()
);
}
List
<
BranchCompany
>
branchCompanies
=
vehicleFeign
.
companyAll
(
userDTO
.
getDataAll
(),
userDTO
.
getDataCompany
(),
userDTO
.
getDataZone
());
List
<
Integer
>
companyIds
=
branchCompanies
.
stream
().
map
(
BranchCompany:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
orderPageVo
.
getOrderRentVehicleDetail
()
!=
null
)
{
if
(!
companyIds
.
contains
(
orderPageVo
.
getOrderRentVehicleDetail
().
getStartCompanyId
())
&&
!
companyIds
.
contains
(
orderPageVo
.
getOrderRentVehicleDetail
().
getEndCompanyId
()))
{
return
ObjectRestResponse
.
createFailedResult
(
2563
,
"您无权限查看此订单!"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
YOU_AUTH_FAIL
.
getCode
(),
ResCode
.
YOU_AUTH_FAIL
.
getDesc
()
);
}
if
(
userDTO
.
getCompanyId
()
==
orderPageVo
.
getOrderRentVehicleDetail
().
getEndCompanyId
())
{
orderPageVo
.
setUserCompanyStatus
(
true
);
...
...
@@ -228,7 +229,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
public
ObjectRestResponse
<
OrderPageVO
>
getOrderDetail
(
String
no
)
{
OrderPageVO
orderPageVo
=
mapper
.
getOrderDetail
(
no
);
if
(
orderPageVo
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
3501
,
"订单不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
ORDER_IS_NOT_EXIST
.
getCode
(),
ResCode
.
ORDER_IS_NOT_EXIST
.
getDesc
()
);
}
if
(
orderPageVo
.
getOrderRentVehicleDetail
()
!=
null
)
{
if
(
orderPageVo
.
getStatus
()
==
4
)
{
//未交车
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderDepositRefundRecordBiz.java
View file @
7f2e8a79
...
...
@@ -86,6 +86,10 @@ public class OrderDepositRefundRecordBiz extends BaseBiz<DepositRefundRecordMapp
}
}
public
void
save
(
DepositRefundRecord
depositRefundRecord
)
{
mapper
.
insert
(
depositRefundRecord
);
}
public
List
<
DepositRefundRecord
>
selectByCrossId
(
Integer
cross
)
{
List
<
DepositRefundRecord
>
list
=
mapper
.
selectByCrossId
(
cross
);
...
...
@@ -149,7 +153,7 @@ public class OrderDepositRefundRecordBiz extends BaseBiz<DepositRefundRecordMapp
newValue
.
setRestAmount
(
depositRefundRecord
.
getTotalAmount
().
subtract
(
orderViolation
.
getPrice
()));
//减去违章金之后的押金
newValue
.
setIscomplete
(
false
);
newValue
.
setId
(
null
);
insertSelectiveRe
(
newValue
);
mapper
.
insert
(
newValue
);
depositRefundRecord
.
setIsshow
(
false
);
updateSelectiveByIdRe
(
depositRefundRecord
);
}
else
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
View file @
7f2e8a79
...
...
@@ -2,7 +2,6 @@ package com.xxfc.platform.order.biz;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.contant.enumerate.OrderStatusEnum
;
import
com.xxfc.platform.order.entity.BaseOrder
;
...
...
@@ -12,14 +11,11 @@ import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import
com.xxfc.platform.order.pojo.order.OrderTourVerificationVO
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.tour.vo.TourGoodOrderFindVo
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.Instant
;
import
java.time.LocalTime
;
import
java.time.temporal.ChronoUnit
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -66,10 +62,10 @@ public class OrderTourVerificationBiz{
baseOrder
.
setNo
(
no
);
baseOrder
=
baseOrderBiz
.
selectOne
(
baseOrder
);
if
(
baseOrder
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
Res
ultCode
.
NULL_CODE
,
"订单不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
Res
Code
.
ORDER_IS_NOT_EXIST
.
getCode
(),
ResCode
.
ORDER_IS_NOT_EXIST
.
getDesc
()
);
}
if
(
baseOrder
.
getStatus
()!=
OrderStatusEnum
.
ORDER_TOSTART
.
getCode
()){
return
ObjectRestResponse
.
createFailedResult
(
Res
ultCode
.
NULL_CODE
,
"订单不是已支付状态"
);
return
ObjectRestResponse
.
createFailedResult
(
Res
Code
.
ORDER_IS_NOT_PAY
.
getCode
(),
ResCode
.
ORDER_IS_NOT_PAY
.
getDesc
()
);
}
Integer
orderId
=
baseOrder
.
getId
();
Integer
version
=
baseOrder
.
getVersion
();
...
...
@@ -77,7 +73,7 @@ public class OrderTourVerificationBiz{
tourDetail
.
setOrderId
(
orderId
);
tourDetail
=
tourDetailBiz
.
selectOne
(
tourDetail
);
if
(
tourDetail
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
Res
ultCode
.
NULL_CODE
,
"订单不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
Res
Code
.
ORDER_IS_NOT_EXIST
.
getCode
(),
ResCode
.
ORDER_IS_NOT_EXIST
.
getDesc
()
);
}
Integer
verificationId
=
tourDetail
.
getVerificationId
();
Integer
total_number
=
tourDetail
.
getTotalNumber
();
...
...
@@ -86,7 +82,8 @@ public class OrderTourVerificationBiz{
if
(
companyId
!=
null
){
boolean
falg
=
isPower
(
list
,
companyId
);
if
(!
falg
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"无权限操作"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
YOU_AUTH_FAIL
.
getCode
(),
ResCode
.
YOU_AUTH_FAIL
.
getDesc
());
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
7f2e8a79
...
...
@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.order.contant.enumerate.CrosstownTypeEnum
;
import
com.xxfc.platform.order.contant.enumerate.DepositRefundStatus
;
...
...
@@ -23,6 +24,7 @@ import com.xxfc.platform.universal.constant.DictionaryKey;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.VehicleArrivalVo
;
...
...
@@ -138,15 +140,15 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
log
.
info
(
"添加的参数:orderVehicaleCrosstown = {}"
,
orderVehicleCrosstownDto
);
UserDTO
userDTO
=
userInfoBiz
.
getAdminUserInfo
();
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
"token is null or invalid"
);
}
if
(
orderVehicleCrosstownDto
==
null
||
orderVehicleCrosstownDto
.
getOrderId
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数为空!"
);
return
ObjectRestResponse
.
paramIsEmpty
(
);
}
orderVehicleCrosstownDto
.
setOrperaterId
(
userDTO
.
getId
());
BaseOrder
baseOrder
=
baseOrderBiz
.
selectById
(
orderVehicleCrosstownDto
.
getOrderId
());
if
(
baseOrder
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"订单不存在!"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
ORDER_IS_NOT_EXIST
.
getCode
(),
ResCode
.
ORDER_IS_NOT_EXIST
.
getDesc
()
);
}
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
...
...
@@ -281,8 +283,10 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
depositRefundRecord
.
setTotalAmount
(
totalAmount
.
subtract
(
getAmount
()));
depositRefundRecord
.
setCrosstownId
(
orderVehicleCrosstown
.
getId
());
orderDepositRefundRecordBiz
.
saveNormalRecord
(
depositRefundRecord
);
//修改订单状态为已完成
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FINISH
.
getCode
());
baseOrderBiz
.
updateSelectiveById
(
baseOrder
);
//修改订单详情是否押金全部退还
orderRentVehicleDetail
.
setFixedLossStatus
(
0
);
orderRentVehicleBiz
.
updateSelectiveByIdRe
(
orderRentVehicleDetail
);
baseOrderBiz
.
sendOrderMq
(
orderRentVehicleDetail
,
null
,
null
,
baseOrder
,
OrderMQDTO
.
ORDER_FINISH
);
...
...
@@ -307,12 +311,12 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
depositRefundRecord
.
setIsshow
(
false
);
orderDepositRefundRecordBiz
.
updateSelectiveByIdRe
(
depositRefundRecord
);
newValue
.
setIscomplete
(
true
);
//发起退款显示
depositRefundRecord
.
setAmount
(
orderVehicleCrosstown
.
getDeductionCost
());
depositRefundRecord
.
setRestAmount
(
totalAmount
.
subtract
(
getAmount
()).
subtract
(
orderVehicleCrosstown
.
getDeductionCost
()));
depositRefundRecord
.
setTotalAmount
(
totalAmount
.
subtract
(
getAmount
()));
newValue
.
setAmount
(
orderVehicleCrosstown
.
getDeductionCost
());
newValue
.
setRestAmount
(
totalAmount
.
subtract
(
getAmount
()).
subtract
(
orderVehicleCrosstown
.
getDeductionCost
()));
newValue
.
setTotalAmount
(
totalAmount
.
subtract
(
getAmount
()));
newValue
.
setCrosstownId
(
orderVehicleCrosstown
.
getId
());
newValue
.
setId
(
null
);
orderDepositRefundRecordBiz
.
insertSelectiveR
e
(
newValue
);
orderDepositRefundRecordBiz
.
sav
e
(
newValue
);
}
else
{
throw
new
BaseException
(
"定损记录不存在!请联系客服"
);
}
...
...
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/dto/TourGoodDTO.java
View file @
7f2e8a79
...
...
@@ -109,5 +109,7 @@ public class TourGoodDTO {
@ApiModelProperty
(
value
=
"商品标签"
)
List
<
GoodTagDTO
>
tagDTOS
;
@ApiModelProperty
(
value
=
"海报背景"
)
private
String
posterBackground
;
}
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/entity/TourGood.java
View file @
7f2e8a79
...
...
@@ -131,5 +131,8 @@ public class TourGood implements Serializable {
@ApiModelProperty
(
value
=
"是否删除,0否,1是"
)
private
Integer
isDel
;
@Column
(
name
=
"poster_background"
)
@ApiModelProperty
(
value
=
"海报背景"
)
private
String
posterBackground
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
View file @
7f2e8a79
...
...
@@ -9,7 +9,7 @@ public enum ResCode {
//车辆信息相关返回码-预定信息
VEHICLE_BOOKED_INFO_ALREADY_CHANGED
(
101001
,
"车辆预定信息已更改
,请刷新后继续操作
"
),
VEHICLE_BOOKED_INFO_ALREADY_CHANGED
(
101001
,
"车辆预定信息已更改"
),
//车辆信息相关返回码-车辆信息
VEHICLE_INFO_SAME_NUM_PLATE_EXISTS
(
102001
,
"该车牌已经存在"
),
...
...
@@ -20,8 +20,8 @@ public enum ResCode {
VEHICLE_INFO_IS_BOOKED
(
102004
,
"车辆已经被预定"
),
//车辆信息相关返回码-预定申请信息
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
(
103001
,
"车辆预定申请已被审批
,请刷新后继续操作
"
),
VEHICLE_BOOKED_RECORD_STATUS_CHANGED
(
103002
,
"车辆预定申请状态已变更
,请刷新后继续操作
"
),
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
(
103001
,
"车辆预定申请已被审批"
),
VEHICLE_BOOKED_RECORD_STATUS_CHANGED
(
103002
,
"车辆预定申请状态已变更"
),
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
(
103003
,
"请输入仪表盘内当前显示的公里数"
),
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
(
104001
,
"车辆不存在"
),
...
...
@@ -44,9 +44,15 @@ public enum ResCode {
VEHICLE_UPKEEP_ITEM_UNEXIST
(
106003
,
"保养项目不存在"
),
VEHICLE_UPKEEP_VEHICLE_UNUPKEEP
(
106004
,
"车辆不在保养中"
),
VEHICLE_IS_BOOKED_TODAY
(
106006
,
"车辆当前时段已经被预定"
),
FIND_VEHICLE_PLAT_FAILE
(
106007
,
"获取车型列表失败"
),
UPDATE_VEHICLE_RANK_FAIL
(
106008
,
"修改车型列表失败"
),
FIND_DATA_NOT_EXIST
(
106005
,
"查询的数据不存在"
),
ORDER_IS_NOT_EXIST
(
10000
,
"订单不存在"
),
ORDER_DETAIL_IS_NOT_EXIST
(
10001
,
"订单详情不可查询"
),
YOU_AUTH_FAIL
(-
2
,
"无权限查看此信息"
),
ORDER_IS_NOT_PAY
(
10002
,
"订单未支付"
),
;
/**
* 返回码
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleModel.java
View file @
7f2e8a79
...
...
@@ -152,4 +152,8 @@ public class VehicleModel implements Serializable {
@Column
(
name
=
"cover_pic"
)
@ApiModelProperty
(
value
=
"封面图"
)
private
String
coverPic
;
@Column
(
name
=
"poster_background"
)
@ApiModelProperty
(
value
=
"海报背景"
)
private
String
posterBackground
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
7f2e8a79
...
...
@@ -85,7 +85,7 @@ public interface VehicleFeign {
* @param limit
* @return 返回
*/
@GetMapping
(
value
=
"/vehicleModel/goodList"
)
@GetMapping
(
"/vehicleModel/goodList"
)
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
value
=
"page"
)
Integer
page
,
@RequestParam
(
"limit"
)
Integer
limit
);
/**
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
7f2e8a79
...
...
@@ -82,7 +82,7 @@ public class VehicleActiveService {
}
//修改预约记录状态
if
(
departureVo
.
getBookRecordId
()
!=
null
)
{
updateBookRecordStatus
(
departureVo
.
getBookRecordId
());
updateBookRecordStatus
(
departureVo
.
getBookRecordId
()
,
1
);
}
VehicleDepartureLogVo
vehicleDepartureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
departureVo
.
getBookRecordId
());
if
(
vehicleDepartureLogVo
!=
null
)
{
...
...
@@ -154,7 +154,7 @@ public class VehicleActiveService {
}
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
updateBookRecordStatus
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
arrivalVo
.
getBookRecordId
()
,
2
);
}
...
...
@@ -192,10 +192,15 @@ public class VehicleActiveService {
}
}
public
void
updateBookRecordStatus
(
Integer
bookRecordId
)
{
public
void
updateBookRecordStatus
(
Integer
bookRecordId
,
Integer
type
)
{
VehicleBookRecord
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
bookRecordId
);
if
(
vehicleBookRecord
!=
null
)
{
vehicleBookRecord
.
setStatus
(
VehicleBookRecordStatus
.
LIFTED
.
getCode
());
if
(
type
==
1
)
{
vehicleBookRecord
.
setActualStartDate
(
new
Date
());
}
else
{
vehicleBookRecord
.
setActualEndDate
(
new
Date
());
}
vehicleBookRecordBiz
.
updateSelectiveByIdRe
(
vehicleBookRecord
);
}
else
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOK_RECORD_IS_NOT_EXIST
.
getDesc
(),
...
...
@@ -218,7 +223,7 @@ public class VehicleActiveService {
}
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
// 车辆非正常状态
throw
new
BaseException
(
ResCode
.
VEHICLE_UPKEEP_VEHICLE_DISABLE
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_UPKEEP_VEHICLE_DISABLE
.
getDesc
()
+
vehicle
.
getStatus
()
,
ResCode
.
VEHICLE_UPKEEP_VEHICLE_DISABLE
.
getCode
());
}
Integer
lastMileage
=
vehicleUpkeepVo
.
getMileage
();
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
7f2e8a79
...
...
@@ -208,7 +208,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public
RestResponse
add
(
List
<
AddOrUpdateVehicleVo
>
addOrUpdateVehicleVoList
)
throws
Exception
{
if
(
addOrUpdateVehicleVoList
.
size
()>
MAX_BATCH_SIZE_VEHICLE
){
throw
new
CustomIllegalParamException
(
"
exceed max batch size
"
);
throw
new
CustomIllegalParamException
(
"
添加的车辆数量过多!
"
);
}
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo:
addOrUpdateVehicleVoList
)
{
...
...
@@ -217,7 +217,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
if
(
addOrUpdateVehicleVo
.
getParkBranchCompanyId
()==
null
)
{
throw
new
CustomIllegalParamException
(
"
Stop at branch office cannot be empty
"
);
throw
new
CustomIllegalParamException
(
"
停靠公司不能为空
"
);
}
vehicle
.
setId
(
UUID
.
randomUUID
().
toString
());
...
...
@@ -251,7 +251,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
// }
if
(
addOrUpdateVehicleVo
.
getNumberPlate
()
==
null
){
throw
new
CustomIllegalParamException
(
"
Without a license plate number
"
);
throw
new
CustomIllegalParamException
(
"
车牌不能为空
"
);
}
List
<
Vehicle
>
vehicles
=
mapper
.
lockByCode
(
addOrUpdateVehicleVo
);
return
vehicles
;
...
...
@@ -342,7 +342,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry:
yearMonthAndDate
.
entrySet
()){
Boolean
rsEach
=
applyVehicle4EmployeePerMonth
(
bookVehicleVo
.
getVehicleId
(),
entry
.
getValue
(),
entry
.
getKey
());
if
(
Boolean
.
FALSE
.
equals
(
rsEach
)){
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
VEHICLE_IS_BOOKED
);
}
}
...
...
@@ -377,7 +377,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
//修改相关车辆预定记录
Boolean
hasSuc
=
bookedVehicle
(
bookVehicleVo
);
if
(!
hasSuc
){
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
BOOKED_
FAILED_CODE
);
}
//添加随车物品
...
...
@@ -504,11 +504,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
CustomIllegalParamException
(
" 只可以预约两个月内的车辆"
);
}
//检查车辆是否可以预定
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry:
yearMonthAndDate
.
entrySet
()){
Boolean
rsEach
=
applyVehicle4EmployeePerMonth
(
bookVehicleVo
.
getVehicleId
(),
entry
.
getValue
(),
entry
.
getKey
());
if
(
Boolean
.
FALSE
.
equals
(
rsEach
)){
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
VEHICLE_IS_BOOKED
);
}
}
...
...
@@ -545,7 +544,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
//修改相关车辆预定记录
Boolean
hasSuc
=
bookedVehicle
(
bookVehicleVo
);
if
(!
hasSuc
){
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
BOOKED_
FAILED_CODE
);
}
//添加随车物品
...
...
@@ -1178,7 +1177,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
@Transactional
public
ObjectRestResponse
save
(
Vehicle
vehicle
){
if
(
vehicle
==
null
)
{
ObjectRestResponse
.
createDefaultFail
();
ObjectRestResponse
.
paramIsEmpty
();
}
String
id
=
vehicle
.
getId
();
...
...
@@ -1208,7 +1207,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
(
);
log
.
info
(
"获取车辆列表转换对象失败: vehicleVo = {}"
,
vehicleVo
);
}
...
...
@@ -1262,8 +1261,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
public
List
<
VehicleCountVo
>
countVehicleByParam
(
VehiclePlanDto
vehiclePlanDto
)
{
return
mapper
.
countVehicleByParam
(
vehiclePlanDto
);
}
...
...
@@ -1281,7 +1278,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
vehiclePlanDto
.
setLimit
(
limit
);
UserDTO
userDTO
=
getAdminUserInfo
();
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
235
,
"token失效"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
"token失效"
);
}
List
<
Integer
>
companyList
=
Lists
.
newArrayList
();
List
<
BranchCompany
>
branchCompany
=
branchCompanyBiz
.
getListByUser
(
userDTO
);
...
...
@@ -1299,7 +1296,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
companyList
.
add
(
vehiclePlanDto
.
getParkBranchCompanyId
());
}
}
log
.
info
(
"用户权限公司ID: companyList = {}"
,
companyList
);
vehiclePlanDto
.
setCompanyIds
(
companyList
);
Query
query
=
new
Query
(
vehiclePlanDto
);
...
...
@@ -1323,7 +1319,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
for
(
int
i
=
0
;
i
<
24
-
result
.
length
();
i
++)
{
stringBuffer
.
append
(
"0"
);
}
log
.
info
(
stringBuffer
.
toString
());
}
stringBuffer
.
append
(
result
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookHourInfoBiz.java
View file @
7f2e8a79
...
...
@@ -4,8 +4,10 @@ import com.ace.cache.annotation.Cache;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.vehicle.common.CustomIllegalParamException
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.VehicleBookHourInfo
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookHourInfoMapper
;
import
com.xxfc.platform.vehicle.pojo.VehicleBookHourInfoDto
;
...
...
@@ -42,7 +44,7 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
//判定时间是否合法
if
(
bookStartDate
.
compareTo
(
DateTime
.
now
().
toString
(
DEFAULT_DATE_TIME_FORMATTER
))
<
0
)
{
throw
new
CustomIllegalParamException
(
"you can only book from today"
);
throw
new
CustomIllegalParamException
(
ResultCode
.
getMsg
(
ResultCode
.
ONLY_BOOK_FROM_TODAY
)
);
}
if
(
bookStartDate
.
compareTo
(
bookEndDate
)
>
0
)
{
throw
new
CustomIllegalParamException
(
"预定开始日期不能大于结束日期!"
);
...
...
@@ -100,14 +102,14 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
@CacheClear
(
key
=
"vehicle.hourInfo"
)
public
ObjectRestResponse
save
(
VehicleBookHourInfoDto
vehicleBookHourInfoDto
)
{
if
(
vehicleBookHourInfoDto
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
502
,
"参数为空"
);
return
ObjectRestResponse
.
paramIsEmpty
(
);
}
List
<
VehicleBookHourInfo
>
vehicleBookHourInfos
=
mapper
.
selectByVehicleAndDate
(
vehicleBookHourInfoDto
);
//有数据直接更新
if
(
vehicleBookHourInfos
.
size
()
>=
1
)
{
for
(
VehicleBookHourInfo
vehicleBookHourInfo
:
vehicleBookHourInfos
)
{
if
(
vehicleBookHourInfo
.
getBookedHour
().
equals
(
vehicleBookHourInfoDto
.
getBookedHour
()))
{
return
ObjectRestResponse
.
createFailedResult
(
504
,
"当天时间段已经被预定"
);
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
VEHICLE_IS_BOOKED_TODAY
.
getCode
(),
ResCode
.
VEHICLE_IS_BOOKED_TODAY
.
getDesc
()
);
}
else
{
vehicleBookHourInfo
.
setBookedHour
(
vehicleBookHourInfo
.
getBookedHour
()
|
vehicleBookHourInfoDto
.
getBookedHour
());
updateSelectiveByIdRe
(
vehicleBookHourInfo
);
...
...
@@ -130,7 +132,7 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
@CacheClear
(
key
=
"vehicle.hourInfo"
)
public
ObjectRestResponse
delete
(
String
vehicleId
,
List
<
String
>
dateList
)
{
if
(
StringUtils
.
isBlank
(
vehicleId
)
||
dateList
.
size
()
<=
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
502
,
"删除信息车辆Id为空"
);
return
ObjectRestResponse
.
paramIsEmpty
(
);
}
Map
<
String
,
Object
>
param
=
Maps
.
newHashMap
();
param
.
put
(
"vehicleId"
,
vehicleId
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleDepartureService.java
View file @
7f2e8a79
...
...
@@ -116,7 +116,7 @@ public class VehicleDepartureService extends BaseBiz<VehicleDepartureLogMapper,
return
ObjectRestResponse
.
succ
(
vehicleDepartureLog
);
}
}
return
ObjectRestResponse
.
create
DefaultFail
(
);
return
ObjectRestResponse
.
create
FailedResult
(
ResCode
.
FIND_DATA_NOT_EXIST
.
getCode
(),
ResCode
.
FIND_DATA_NOT_EXIST
.
getDesc
()
);
}
@Transactional
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleDispatchInfoBiz.java
View file @
7f2e8a79
...
...
@@ -8,7 +8,6 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.entity.VehicleDispatchInfo
;
import
com.xxfc.platform.vehicle.mapper.VehicleDispatchInfoMapper
;
...
...
@@ -45,7 +44,7 @@ public class VehicleDispatchInfoBiz extends BaseBiz<VehicleDispatchInfoMapper,Ve
//提交调度申请表单
public
ObjectRestResponse
addDisspatchInfo
(
VehicleDispatchInfo
vehicleDispatchInfo
){
if
(
vehicleDispatchInfo
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
return
ObjectRestResponse
.
paramIsEmpty
(
);
}
insertSelective
(
vehicleDispatchInfo
);
return
ObjectRestResponse
.
succ
();
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelBiz.java
View file @
7f2e8a79
...
...
@@ -3,28 +3,25 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.mapper.VehicleModelMapper
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.mapper.VehicleModelMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 车型
...
...
@@ -60,7 +57,7 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ObjectRestResponse
.
create
DefaultFail
(
);
return
ObjectRestResponse
.
create
FailedResult
(
ResCode
.
FIND_DATA_NOT_EXIST
.
getCode
(),
ResCode
.
FIND_DATA_NOT_EXIST
.
getDesc
()
);
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
View file @
7f2e8a79
...
...
@@ -7,11 +7,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.
entity.Vehicl
e
;
import
com.xxfc.platform.vehicle.
constant.ResCode.ResCod
e
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper
;
...
...
@@ -20,14 +19,9 @@ import com.xxfc.platform.vehicle.pojo.CataVo;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.assertj.core.util.Arrays
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.aop.framework.AopProxyUtils
;
import
org.springframework.aop.support.AopUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
...
...
@@ -215,7 +209,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ObjectRestResponse
.
create
DefaultFail
(
);
return
ObjectRestResponse
.
create
FailedResult
(
ResCode
.
FIND_VEHICLE_PLAT_FAILE
.
getCode
(),
ResCode
.
FIND_VEHICLE_PLAT_FAILE
.
getDesc
()
);
}
...
...
@@ -310,7 +304,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
public
ObjectRestResponse
updateAndAdd
(
Cascade
<
VehiclePlatCata
>
cas
)
{
if
(
cas
==
null
||
cas
.
getParent
()
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
//通过判断一级标签是否有id来判断是更新还是添加
...
...
@@ -337,7 +331,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
VehiclePlatCata
parentVPC
=
cas
.
getParent
();
List
<
VehiclePlatCata
>
children
=
cas
.
getChildren
();
if
(
children
==
null
||
parentVPC
==
null
)
{
throw
new
BaseException
(
"
The tag name cannot be empty!
"
);
throw
new
BaseException
(
"
标签名不能为空!
"
);
}
//设置更新时间
parentVPC
.
setUpdTime
(
System
.
currentTimeMillis
());
...
...
@@ -353,7 +347,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
.
collect
(
Collectors
.
toList
());
//判断有效数据是否为空
if
(
VehiclePlatCatas
.
size
()
==
0
)
{
throw
new
BaseException
(
"
No valid subtag!
"
);
throw
new
BaseException
(
"
父标签无效
"
);
}
//遍历
for
(
VehiclePlatCata
VehiclePlatCata
:
VehiclePlatCatas
)
{
...
...
@@ -385,9 +379,8 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
return
ObjectRestResponse
.
succ
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
}
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
UPDATE_VEHICLE_RANK_FAIL
.
getCode
(),
ResCode
.
UPDATE_VEHICLE_RANK_FAIL
.
getDesc
());
}
/**
...
...
@@ -407,7 +400,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
return
ObjectRestResponse
.
succ
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
create
DefaultFail
(
);
return
ObjectRestResponse
.
create
FailedResult
(
ResCode
.
UPDATE_VEHICLE_RANK_FAIL
.
getCode
(),
ResCode
.
UPDATE_VEHICLE_RANK_FAIL
.
getDesc
()
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleModelController.java
View file @
7f2e8a79
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
...
@@ -17,8 +18,8 @@ import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VModelDetailVO
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition
;
import
com.xxfc.platform.vehicle.pojo.VehicleModelVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -32,11 +33,10 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
/**
* @author Administrator
*/
...
...
@@ -117,7 +117,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
// vmqc.setStatus(SYS_TRUE);
// }
if
(
vmqc
==
null
||
vmqc
.
getPage
()
==
null
||
vmqc
.
getLimit
()
==
null
||
vmqc
.
getPage
()
<
0
||
vmqc
.
getLimit
()
<=
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
//结合车型
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
vmqc
.
getCatasStr
()))
{
...
...
@@ -139,7 +139,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
@Transactional
public
ObjectRestResponse
<
VehicleModel
>
add
(
@RequestBody
VehicleModel
vm
,
HttpServletRequest
request
)
{
if
(
vm
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
paramIsEmpty
();
}
if
(
StringUtils
.
isBlank
(
vm
.
getName
()))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车名不能为空"
);
...
...
@@ -192,7 +192,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
ADD_VEHICLE_FAIL
);
}
}
...
...
@@ -245,7 +245,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
UPDATE_VEHICLE_FAIL
);
}
}
...
...
@@ -296,11 +296,10 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
*/
@ApiOperation
(
"优质车型"
)
@GetMapping
(
value
=
"/goodList"
)
public
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
"page"
)
Integer
page
,
@RequestParam
(
"limit"
)
Integer
limit
)
{
@IgnoreUserToken
public
List
<
GoodDataVO
>
goodList
(
@RequestParam
(
value
=
"page"
)
Integer
page
,
@RequestParam
(
value
=
"limit"
)
Integer
limit
)
{
return
baseBiz
.
goodList
(
page
,
limit
);
}
@ApiOperation
(
"上下架"
)
@PutMapping
(
value
=
"/setStatus/{id}/{status}"
)
@Transactional
...
...
@@ -332,7 +331,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
ResultCode
.
UPDATE_VEHICLE_FAIL
);
}
}
...
...
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