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
81a14283
Commit
81a14283
authored
Jun 28, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
7c6df77d
ce2ae719
Changes
72
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
1183 additions
and
341 deletions
+1183
-341
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+10
-8
BaseException.java
...thub/wxiaoqi/security/common/exception/BaseException.java
+11
-0
EntityUtils.java
.../com/github/wxiaoqi/security/common/util/EntityUtils.java
+12
-2
ResultCode.java
...thub/wxiaoqi/security/common/util/process/ResultCode.java
+9
-5
resultcod.properties
...common/src/main/resources/properties/resultcod.properties
+12
-4
AppUserManage.java
...m/github/wxiaoqi/security/admin/entity/AppUserManage.java
+15
-0
AppUserCollectBiz.java
.../github/wxiaoqi/security/admin/biz/AppUserCollectBiz.java
+2
-0
AppUserManageBiz.java
...m/github/wxiaoqi/security/admin/biz/AppUserManageBiz.java
+100
-0
BaseUserMemberBiz.java
.../github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
+1
-0
AppUserDetailMapper.java
...ub/wxiaoqi/security/admin/mapper/AppUserDetailMapper.java
+2
-1
AppUserLoginMapper.java
...hub/wxiaoqi/security/admin/mapper/AppUserLoginMapper.java
+1
-0
AppUserMapper.java
...m/github/wxiaoqi/security/admin/mapper/AppUserMapper.java
+3
-0
AppUsersManageController.java
...wxiaoqi/security/admin/rest/AppUsersManageController.java
+55
-0
MemberLevelController.java
...ub/wxiaoqi/security/admin/rest/MemberLevelController.java
+6
-0
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+1
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+18
-9
AppUserDetailMapper.xml
...e-admin/src/main/resources/mapper/AppUserDetailMapper.xml
+87
-1
AppUserMapper.xml
...les/ace-admin/src/main/resources/mapper/AppUserMapper.xml
+2
-0
HeaderConfig.java
...m/github/wxiaoqi/security/api/vo/config/HeaderConfig.java
+0
-2
BannerVo.java
...c/main/java/com/xxfc/platform/app/entity/vo/BannerVo.java
+24
-0
BannerBiz.java
...er/src/main/java/com/xxfc/platform/app/biz/BannerBiz.java
+12
-6
BannerController.java
...ain/java/com/xxfc/platform/app/rest/BannerController.java
+2
-2
CampsiteShopPageDTO.java
...a/com/xxfc/platform/campsite/dto/CampsiteShopPageDTO.java
+17
-2
pom.xml
xx-campsite/xx-campsite-server/pom.xml
+12
-0
CampsiteShopBiz.java
.../java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
+2
-0
CampsiteShopMapper.xml
...e-server/src/main/resources/mapper/CampsiteShopMapper.xml
+2
-2
UserBiz.java
...erver/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
+1
-0
AddRentVehicleDTO.java
.../java/com/xxfc/platform/order/pojo/AddRentVehicleDTO.java
+17
-11
AddTourDTO.java
...rc/main/java/com/xxfc/platform/order/pojo/AddTourDTO.java
+6
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+4
-3
RabbitUserConfig.java
...java/com/xxfc/platform/order/config/RabbitUserConfig.java
+14
-4
RabbitConsumer.java
...ava/com/xxfc/platform/order/mqhandler/RabbitConsumer.java
+1
-1
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+4
-1
OrderTourVerificationController.java
.../platform/order/rest/OrderTourVerificationController.java
+1
-1
AbstractOrderHandle.java
.../com/xxfc/platform/order/service/AbstractOrderHandle.java
+4
-23
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+12
-5
OrderTourService.java
...ava/com/xxfc/platform/order/service/OrderTourService.java
+3
-4
GoodSiteDTO.java
...src/main/java/com/xxfc/platform/tour/dto/GoodSiteDTO.java
+1
-1
TourGoodSite.java
...main/java/com/xxfc/platform/tour/entity/TourGoodSite.java
+3
-3
TourFeign.java
...src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
+1
-1
TourGoodDetailBiz.java
...in/java/com/xxfc/platform/tour/biz/TourGoodDetailBiz.java
+2
-0
TourTagBannerBiz.java
...ain/java/com/xxfc/platform/tour/biz/TourTagBannerBiz.java
+5
-4
TourTagBiz.java
.../src/main/java/com/xxfc/platform/tour/biz/TourTagBiz.java
+1
-1
TourGoodSpePriceMapper.java
...com/xxfc/platform/tour/mapper/TourGoodSpePriceMapper.java
+3
-0
TourTagBannerController.java
.../com/xxfc/platform/tour/rest/TourTagBannerController.java
+6
-4
TourUserController.java
.../java/com/xxfc/platform/tour/rest/TourUserController.java
+2
-2
TourGoodMapper.xml
...-tour-server/src/main/resources/mapper/TourGoodMapper.xml
+1
-1
TourGoodSpePriceMapper.xml
...rver/src/main/resources/mapper/TourGoodSpePriceMapper.xml
+5
-0
ITrafficViolationsFeign.java
.../xxfc/platform/universal/api/ITrafficViolationsFeign.java
+16
-0
ITrafficViolationsService.java
...xfc/platform/universal/api/ITrafficViolationsService.java
+0
-46
LicensePlateType.java
.../com/xxfc/platform/universal/entity/LicensePlateType.java
+73
-0
SearchableCity.java
...va/com/xxfc/platform/universal/entity/SearchableCity.java
+40
-0
ThirdFeign.java
...in/java/com/xxfc/platform/universal/feign/ThirdFeign.java
+23
-4
TrafficViolations.java
...ava/com/xxfc/platform/universal/vo/TrafficViolations.java
+23
-0
pom.xml
xx-universal/xx-universal-server/pom.xml
+4
-0
UniversalApplication.java
...ava/com/xxfc/platform/universal/UniversalApplication.java
+1
-1
LicensePlateTypeBiz.java
.../com/xxfc/platform/universal/biz/LicensePlateTypeBiz.java
+62
-0
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+8
-1
SearchableCityBiz.java
...va/com/xxfc/platform/universal/biz/SearchableCityBiz.java
+15
-0
TrafficViolationsController.java
...orm/universal/controller/TrafficViolationsController.java
+51
-33
LicensePlateTypeMapper.java
...xfc/platform/universal/mapper/LicensePlateTypeMapper.java
+12
-0
SearchableCityMapper.java
.../xxfc/platform/universal/mapper/SearchableCityMapper.java
+12
-0
TrafficViolationsService.java
.../platform/universal/service/TrafficViolationsService.java
+176
-76
application.properties
...niversal-server/src/main/resources/application.properties
+10
-11
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+3
-2
AccompanyingItemController.java
...xfc/platform/vehicle/rest/AccompanyingItemController.java
+17
-11
AreaController.java
...n/java/com/xxfc/platform/vehicle/rest/AreaController.java
+7
-1
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+8
-9
LicensePlateType.xml
...cle-server/src/main/resources/mapper/LicensePlateType.xml
+10
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+3
-2
RegionTest.java
...r/src/test/java/com/xxfc/platform/vehicle/RegionTest.java
+59
-29
TimeTest.java
...ver/src/test/java/com/xxfc/platform/vehicle/TimeTest.java
+35
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
81a14283
...
@@ -102,7 +102,7 @@ public class AuthController {
...
@@ -102,7 +102,7 @@ public class AuthController {
if
(
result
==
null
){
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
data
.
put
(
"status"
,
1001
);
}
else
{
}
else
{
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
i
d"
));
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
I
d"
));
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
}
}
}
}
...
@@ -122,7 +122,7 @@ public class AuthController {
...
@@ -122,7 +122,7 @@ public class AuthController {
if
(
result
==
null
){
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
data
.
put
(
"status"
,
1001
);
}
else
{
}
else
{
String
token
=
appAuthService
.
getToken
(
result
.
getString
(
"username"
),
result
.
getInteger
(
"user
i
d"
));
String
token
=
appAuthService
.
getToken
(
result
.
getString
(
"username"
),
result
.
getInteger
(
"user
I
d"
));
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
}
}
}
}
...
@@ -141,7 +141,7 @@ public class AuthController {
...
@@ -141,7 +141,7 @@ public class AuthController {
if
(
result
==
null
){
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
data
.
put
(
"status"
,
1001
);
}
else
{
}
else
{
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
i
d"
));
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
I
d"
));
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
}
}
}
}
...
@@ -154,11 +154,13 @@ public class AuthController {
...
@@ -154,11 +154,13 @@ public class AuthController {
log
.
info
(
username
+
"----require reset..."
);
log
.
info
(
username
+
"----require reset..."
);
JSONObject
data
=
appAuthService
.
reset
(
username
,
mobilecode
,
password
);
JSONObject
data
=
appAuthService
.
reset
(
username
,
mobilecode
,
password
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JwtAuthenticationRequest
authenticationRequest
=
new
JwtAuthenticationRequest
();
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
authenticationRequest
.
setUsername
(
username
);
if
(
result
==
null
){
authenticationRequest
.
setPassword
(
password
);
data
.
put
(
"status"
,
1001
);
String
token
=
appAuthService
.
login
(
authenticationRequest
);
}
else
{
data
.
put
(
"token"
,
token
);
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"userId"
));
data
.
put
(
"token"
,
token
);
}
}
}
return
data
;
return
data
;
}
}
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/BaseException.java
View file @
81a14283
...
@@ -3,6 +3,8 @@ package com.github.wxiaoqi.security.common.exception;
...
@@ -3,6 +3,8 @@ package com.github.wxiaoqi.security.common.exception;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
java.util.Map
;
/**
/**
* Created by ace on 2017/9/8.
* Created by ace on 2017/9/8.
*/
*/
...
@@ -50,4 +52,13 @@ public class BaseException extends RuntimeException {
...
@@ -50,4 +52,13 @@ public class BaseException extends RuntimeException {
super
(
ResultCode
.
getMsg
(
code
));
super
(
ResultCode
.
getMsg
(
code
));
this
.
status
=
code
;
this
.
status
=
code
;
}
}
// public BaseException(int code, Map<String, Object> map) {
// String msg = ResultCode.getMsg(code);
// if(null != map && map.size() > 0){
// for(String)
//
// }
// this.status = code;
// }
}
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/EntityUtils.java
View file @
81a14283
...
@@ -40,7 +40,12 @@ public class EntityUtils {
...
@@ -40,7 +40,12 @@ public class EntityUtils {
* @author 王浩彬
* @author 王浩彬
*/
*/
public
static
<
T
>
void
setCreateInfo
(
T
entity
){
public
static
<
T
>
void
setCreateInfo
(
T
entity
){
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
;
try
{
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
}
catch
(
Exception
e
)
{
request
=
null
;
}
String
hostIp
=
""
;
String
hostIp
=
""
;
String
name
=
""
;
String
name
=
""
;
String
id
=
""
;
String
id
=
""
;
...
@@ -81,7 +86,12 @@ public class EntityUtils {
...
@@ -81,7 +86,12 @@ public class EntityUtils {
* @author 王浩彬
* @author 王浩彬
*/
*/
public
static
<
T
>
void
setUpdatedInfo
(
T
entity
){
public
static
<
T
>
void
setUpdatedInfo
(
T
entity
){
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
;
try
{
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
}
catch
(
Exception
e
)
{
request
=
null
;
}
String
hostIp
=
""
;
String
hostIp
=
""
;
String
name
=
""
;
String
name
=
""
;
String
id
=
""
;
String
id
=
""
;
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/process/ResultCode.java
View file @
81a14283
...
@@ -5,6 +5,10 @@ import com.github.wxiaoqi.security.common.util.SystemProperty;
...
@@ -5,6 +5,10 @@ import com.github.wxiaoqi.security.common.util.SystemProperty;
public
class
ResultCode
{
public
class
ResultCode
{
////////////////////////////参数相关///////////////////////////
public
static
int
PARAM_ILLEGAL_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"PARAM_ILLEGAL_CODE"
));
public
static
int
PARAM_EXPIRE_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"PARAM_EXPIRE_CODE"
));
// 操作成功
// 操作成功
public
static
int
SUCCESS_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"SUCCESS_CODE"
));
public
static
int
SUCCESS_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"SUCCESS_CODE"
));
// 操作失败
// 操作失败
...
@@ -128,11 +132,11 @@ public class ResultCode {
...
@@ -128,11 +132,11 @@ public class ResultCode {
// 账户已禁用
// 账户已禁用
public
static
int
ACCOUNTINFO_ISDEL
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ACCOUNTINFO_ISDEL"
));
public
static
int
ACCOUNTINFO_ISDEL
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"ACCOUNTINFO_ISDEL"
));
// 监控设备不存在
//
// 监控设备不存在
public
static
int
DEVICE_NOTEXIST_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"DEVICE_NOTEXIST_CODE"
));
//
public static int DEVICE_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("DEVICE_NOTEXIST_CODE"));
// 设备access_token获取失败
//
// 设备access_token获取失败
public
static
int
DEVICE_TOKEN_NOTEXIST_CODE
=
Integer
//
public static int DEVICE_TOKEN_NOTEXIST_CODE = Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"DEVICE_TOKEN_NOTEXIST_CODE"
));
//
.valueOf(SystemProperty.getResultConfig("DEVICE_TOKEN_NOTEXIST_CODE"));
// 操作频繁提示
// 操作频繁提示
public
static
int
API_MAX_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"API_MAX_CODE"
));
public
static
int
API_MAX_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"API_MAX_CODE"
));
...
...
ace-common/src/main/resources/properties/resultcod.properties
View file @
81a14283
...
@@ -32,6 +32,14 @@ RSTOKEN_NULL_CODE=1007
...
@@ -32,6 +32,14 @@ RSTOKEN_NULL_CODE=1007
DB_OPERATION_FAIL_CODE
=
1008
DB_OPERATION_FAIL_CODE
=
1008
1008
=
数据库操作失败
1008
=
数据库操作失败
#参数非法
PARAM_ILLEGAL_CODE
=
1011
1011
=
参数非法,请修改
#参数时效已过时
PARAM_EXPIRE_CODE
=
1010
1010
=
参数时效已过时,不能使用
#请求微信接口失败
#请求微信接口失败
WXAPI_CODE
=
2001
WXAPI_CODE
=
2001
#微信用不不存在
#微信用不不存在
...
@@ -146,10 +154,10 @@ NICKNAME_NULL_CODE=9006
...
@@ -146,10 +154,10 @@ NICKNAME_NULL_CODE=9006
ACCOUNTINFO_ISDEL
=
9007
ACCOUNTINFO_ISDEL
=
9007
9007
=
账户已禁用
9007
=
账户已禁用
DEVICE_NOTEXIST_CODE
=
1005
#
DEVICE_NOTEXIST_CODE=1005
1005
=
监控设备不存在
#
1005=监控设备不存在
DEVICE_TOKEN_NOTEXIST_CODE
=
1006
#
DEVICE_TOKEN_NOTEXIST_CODE=1006
1005
=
设备access_token获取失败
#
1005=设备access_token获取失败
REPEAT_SUB_CODE
=
1008
REPEAT_SUB_CODE
=
1008
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserManage.java
0 → 100644
View file @
81a14283
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
@Data
public
class
AppUserManage
{
private
AppUserLogin
appUserLogin
;
private
AppUserDetail
appUserDetail
;
private
BaseUserMember
baseUserMember
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserCollectBiz.java
View file @
81a14283
...
@@ -55,6 +55,8 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl
...
@@ -55,6 +55,8 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl
TourGood
tourGood
=
tourFeign
.
one
(
typeId
);
TourGood
tourGood
=
tourFeign
.
one
(
typeId
);
if
(
tourGood
!=
null
){
if
(
tourGood
!=
null
){
BeanUtils
.
copyProperties
(
collect
,
tourGood
);
BeanUtils
.
copyProperties
(
collect
,
tourGood
);
collect
.
setId
(
null
);
collect
.
setStatus
(
0
);
insertSelective
(
collect
);
insertSelective
(
collect
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserManageBiz.java
0 → 100644
View file @
81a14283
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.mapper.*
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
tk.mybatis.mapper.entity.Example
;
/**
* app用户管理业务逻辑层
*
* @author Administrator
*/
@Service
public
class
AppUserManageBiz
extends
BaseBiz
<
AppUserDetailMapper
,
AppUserDetail
>
{
@Autowired
private
AppUserLoginMapper
appUserLoginMapper
;
/**
* 根据条件查询
*
* @param appUserVo
* @return
*/
public
AppUserVo
findAllByQuery
(
AppUserVo
appUserVo
)
{
return
mapper
.
selectAppUserManage
(
appUserVo
);
}
@Transactional
public
void
deleteAppUser
(
Integer
id
)
{
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setIsdel
(
1
);
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"id"
,
id
);
appUserLogin
.
setUpdatetime
(
System
.
currentTimeMillis
());
appUserLoginMapper
.
updateByExampleSelective
(
appUserLogin
,
example
);
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
appUserDetail
.
setIsdel
(
1
);
appUserDetail
.
setUpdatetime
(
System
.
currentTimeMillis
());
Example
detailExample
=
new
Example
(
AppUserLogin
.
class
);
Example
.
Criteria
detailCriteria
=
detailExample
.
createCriteria
();
criteria
.
andEqualTo
(
"id"
,
id
);
mapper
.
updateByExampleSelective
(
appUserDetail
,
detailCriteria
);
}
public
AppUserVo
findOneById
(
Integer
id
)
{
return
mapper
.
getUserInfo
(
id
);
}
@Transactional
public
void
save
(
AppUserVo
appUserVo
)
{
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
AppUserDetail
appUserDetail
=
new
AppUserDetail
();
try
{
BeanUtilsBean
.
getInstance
().
copyProperties
(
appUserLogin
,
appUserVo
);
BeanUtilsBean
.
getInstance
().
copyProperties
(
appUserDetail
,
appUserVo
);
if
(
appUserVo
.
getUserid
()
==
null
||
appUserVo
.
getUserid
()
==
0
)
{
//设置登录用户信息
appUserLogin
.
setIsdel
(
0
);
appUserLogin
.
setCreatetime
(
System
.
currentTimeMillis
());
appUserLogin
.
setCertificationStatus
(
0
);
appUserLogin
.
setStatus
(
0
);
//设置用户详情
appUserDetail
.
setIsdel
(
0
);
if
(
appUserDetail
.
getIsMember
()
==
null
)
{
appUserDetail
.
setIsMember
(
0
);
}
appUserLoginMapper
.
insertSelective
(
appUserLogin
);
mapper
.
insertSelective
(
appUserDetail
);
}
else
{
appUserLogin
.
setUpdatetime
(
System
.
currentTimeMillis
());
appUserDetail
.
setUpdatetime
(
System
.
currentTimeMillis
());
appUserLoginMapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
mapper
.
updateByPrimaryKeySelective
(
appUserDetail
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
View file @
81a14283
...
@@ -95,6 +95,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
...
@@ -95,6 +95,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
Integer
totalNumber
=
userMemberVo
.
getTotalNumber
()==
null
?
0
:
userMemberVo
.
getTotalNumber
();
Integer
totalNumber
=
userMemberVo
.
getTotalNumber
()==
null
?
0
:
userMemberVo
.
getTotalNumber
();
BaseUserMember
baseUserMember
=
new
BaseUserMember
();
BaseUserMember
baseUserMember
=
new
BaseUserMember
();
baseUserMember
.
setId
(
userMemberVo
.
getId
());
baseUserMember
.
setId
(
userMemberVo
.
getId
());
baseUserMember
.
setUserId
(
userId
);
if
(
type
==
1
){
if
(
type
==
1
){
/*if((freeDays-lockDays)>0&&(freeDays-lockDays)>=days){
/*if((freeDays-lockDays)>0&&(freeDays-lockDays)>=days){
baseUserMember.setLockDays(lockDays+days);
baseUserMember.setLockDays(lockDays+days);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserDetailMapper.java
View file @
81a14283
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
...
@@ -10,5 +11,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
...
@@ -10,5 +11,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
//查询用户信息
//查询用户信息
public
AppUserVo
getUserInfo
(
@Param
(
"userId"
)
Integer
userId
);
public
AppUserVo
getUserInfo
(
@Param
(
"userId"
)
Integer
userId
);
AppUserVo
selectAppUserManage
(
AppUserVo
appUserVo
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserLoginMapper.java
View file @
81a14283
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
AppUserLoginMapper
extends
Mapper
<
AppUserLogin
>
{
public
interface
AppUserLoginMapper
extends
Mapper
<
AppUserLogin
>
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserMapper.java
View file @
81a14283
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUser
;
import
com.github.wxiaoqi.security.admin.entity.AppUser
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.entity.Group
;
import
com.github.wxiaoqi.security.admin.entity.Group
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
...
@@ -17,4 +18,6 @@ public interface AppUserMapper extends Mapper<AppUser> {
...
@@ -17,4 +18,6 @@ public interface AppUserMapper extends Mapper<AppUser> {
int
insertAppUserGroup
(
@Param
(
"appUserId"
)
Integer
appUserId
,
@Param
(
"groups"
)
Set
<
Integer
>
groups
);
int
insertAppUserGroup
(
@Param
(
"appUserId"
)
Integer
appUserId
,
@Param
(
"groups"
)
Set
<
Integer
>
groups
);
int
deleteAppUserGroup
(
Integer
appUserId
);
int
deleteAppUserGroup
(
Integer
appUserId
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUsersManageController.java
0 → 100644
View file @
81a14283
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppUserManageBiz
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
org.springframework.web.bind.annotation.*
;
/**
* app用户管理类
* @author Administrator
*/
@RestController
@RequestMapping
(
"appUsersManage"
)
public
class
AppUsersManageController
extends
BaseController
<
AppUserManageBiz
,
AppUserManage
>
{
/**
* 查询所有
* @return
*/
@GetMapping
(
"/findAll"
)
public
ObjectRestResponse
<
AppUserVo
>
findAllByQuery
(
@RequestBody
AppUserVo
appUserVo
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAllByQuery
(
appUserVo
));
}
/**
* 删除
* @param id
* @return
*/
@DeleteMapping
(
"/deleteById/{id}"
)
public
ObjectRestResponse
deleteById
(
@PathVariable
Integer
id
){
baseBiz
.
deleteAppUser
(
id
);
return
ObjectRestResponse
.
succ
();
}
/**
* 查询一条
* @param id
* @return
*/
@GetMapping
(
"/findOneById/{id}"
)
public
ObjectRestResponse
<
AppUserVo
>
findOneById
(
@PathVariable
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneById
(
id
));
}
@PostMapping
(
"/save"
)
public
ObjectRestResponse
save
(
@RequestBody
AppUserVo
appUserVo
){
baseBiz
.
save
(
appUserVo
);
return
ObjectRestResponse
.
succ
();
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/MemberLevelController.java
View file @
81a14283
...
@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.rest;
...
@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.rest;
import
com.github.wxiaoqi.security.admin.biz.UserMemberLevelBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserMemberLevelBiz
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
io.swagger.models.auth.In
;
import
io.swagger.models.auth.In
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -27,6 +28,11 @@ public class MemberLevelController {
...
@@ -27,6 +28,11 @@ public class MemberLevelController {
return
memberBiz
.
getLevesls
();
return
memberBiz
.
getLevesls
();
}
}
@RequestMapping
(
value
=
"/app/unauth/level/list"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
BaseUserMemberLevel
>>
list
()
throws
Exception
{
return
ObjectRestResponse
.
succ
(
memberBiz
.
getLevesls
());
}
@RequestMapping
(
value
=
"/app/unauth/level/{type}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/app/unauth/level/{type}"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
public
@ResponseBody
BaseUserMemberLevel
level
(
@PathVariable
Integer
type
)
throws
Exception
{
BaseUserMemberLevel
level
(
@PathVariable
Integer
type
)
throws
Exception
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
81a14283
...
@@ -153,7 +153,7 @@ public class AppUserRest {
...
@@ -153,7 +153,7 @@ public class AppUserRest {
@RequestMapping
(
value
=
"/user/reset"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/user/reset"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
public
@ResponseBody
JSONObject
login
(
JSONObject
reset
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
81a14283
...
@@ -241,8 +241,8 @@ public class AppPermissionService {
...
@@ -241,8 +241,8 @@ public class AppPermissionService {
userLogin
.
setUsername
(
username
);
userLogin
.
setUsername
(
username
);
appUserLoginBiz
.
updateSelectiveById
(
userLogin
);
appUserLoginBiz
.
updateSelectiveById
(
userLogin
);
}
}
data
.
put
(
"im
_t
oken"
,
access_token
);
data
.
put
(
"im
T
oken"
,
access_token
);
data
.
put
(
"im
_
UserId"
,
imUserId
);
data
.
put
(
"imUserId"
,
imUserId
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
...
@@ -273,6 +273,7 @@ public class AppPermissionService {
...
@@ -273,6 +273,7 @@ public class AppPermissionService {
if
(
StringUtils
.
isNotBlank
(
userVo
.
getHeadimgurl
()))
{
if
(
StringUtils
.
isNotBlank
(
userVo
.
getHeadimgurl
()))
{
data
.
put
(
"headerurl"
,
userVo
.
getHeadimgurl
());
data
.
put
(
"headerurl"
,
userVo
.
getHeadimgurl
());
}
}
data
.
put
(
"certificationStatus"
,
userVo
.
getCertificationStatus
());
}
}
// 缓存操作
// 缓存操作
String
token
=
""
;
String
token
=
""
;
...
@@ -282,7 +283,7 @@ public class AppPermissionService {
...
@@ -282,7 +283,7 @@ public class AppPermissionService {
// 返回结果
// 返回结果
// data.put("token", token);
// data.put("token", token);
data
.
put
(
"username"
,
username
);
data
.
put
(
"username"
,
username
);
data
.
put
(
"user
i
d"
,
userid
);
data
.
put
(
"user
I
d"
,
userid
);
}
}
return
data
;
return
data
;
...
@@ -366,8 +367,8 @@ public class AppPermissionService {
...
@@ -366,8 +367,8 @@ public class AppPermissionService {
String
imPassword
=
userLogin
.
getImPassword
();
String
imPassword
=
userLogin
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
data
.
put
(
"im
_t
oken"
,
access_token
);
data
.
put
(
"im
T
oken"
,
access_token
);
data
.
put
(
"im
_
UserId"
,
imUserId
);
data
.
put
(
"imUserId"
,
imUserId
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
...
@@ -453,8 +454,8 @@ public class AppPermissionService {
...
@@ -453,8 +454,8 @@ public class AppPermissionService {
String
imPassword
=
userLogin
.
getImPassword
();
String
imPassword
=
userLogin
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
userLogin
.
getUsername
(),
imPassword
,
imUserId
);
String
access_token
=
loginIm
(
userLogin
.
getUsername
(),
imPassword
,
imUserId
);
data
.
put
(
"im
_t
oken"
,
access_token
);
data
.
put
(
"im
T
oken"
,
access_token
);
data
.
put
(
"im
_
UserId"
,
imUserId
);
data
.
put
(
"imUserId"
,
imUserId
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
...
@@ -495,8 +496,8 @@ public class AppPermissionService {
...
@@ -495,8 +496,8 @@ public class AppPermissionService {
String
imPassword
=
user
.
getImPassword
();
String
imPassword
=
user
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
data
.
put
(
"im
_t
oken"
,
access_token
);
data
.
put
(
"im
T
oken"
,
access_token
);
data
.
put
(
"im
_
UserId"
,
imUserId
);
data
.
put
(
"imUserId"
,
imUserId
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
...
@@ -531,6 +532,14 @@ public class AppPermissionService {
...
@@ -531,6 +532,14 @@ public class AppPermissionService {
Integer
userid
=
user
.
getId
();
Integer
userid
=
user
.
getId
();
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+
(
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
JSONObject
data
=
autoLogin
(
userid
,
user
.
getUsername
(),
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
);
// 到im注册,获取返回结果
Integer
imUserId
=
user
.
getImUserid
();
String
imPassword
=
user
.
getImPassword
();
if
(
StringUtils
.
isNotBlank
(
imPassword
)&&
imUserId
!=
null
&&
imUserId
>
0
){
String
access_token
=
loginIm
(
username
,
imPassword
,
imUserId
);
data
.
put
(
"imToken"
,
access_token
);
data
.
put
(
"imUserId"
,
imUserId
);
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
}
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserDetailMapper.xml
View file @
81a14283
...
@@ -28,6 +28,92 @@
...
@@ -28,6 +28,92 @@
<select
id=
"getUserInfo"
resultMap=
"AppUserVoMap"
>
<select
id=
"getUserInfo"
resultMap=
"AppUserVoMap"
>
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
left join app_user_detail d
left join app_user_detail d
on d.userid = l.id where d.userid = #{userId} limit 1
on d.userid = l.id
where d.userid = #{userId} limit 1
</select>
</select>
<select
id=
"selectAppUserManage"
parameterType=
"Integer"
resultMap=
"AppUserVoMap"
>
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
left join app_user_detail d
on d.userid = l.id where 1=1
<if
test=
"id != null"
>
and d.id =#{id}
</if>
<if
test=
"userid != null"
>
and d.userid = #{userId}
</if>
<if
test=
"username != null"
>
and l.username=#{username}
</if>
<if
test=
"imUserd != null"
>
and l.im_userid=#{imUserid}
</if>
<if
test=
"wxOpenid != null"
>
and l.wx_openid=#{wxOpenid}
</if>
<if
test=
"unionid != null"
>
and l.unionid=#{unionid}
</if>
<if
test=
"openid != null"
>
and l.openid=#{openid}
</if>
<if
test=
"status != null"
>
and l.status=#{status}
</if>
<if
test=
"idNumber != null"
>
and l.id_number=#{idNumber}
</if>
<if
test=
"certificationStatus != null"
>
and l.certification_status=#{certificationStatus}
</if>
<if
test=
"isMember != null"
>
and d.is member=#{isMember}
</if>
<if
test=
"nickname != null"
>
and d.nickname=#{nickname}
</if>
<if
test=
"realname != null"
>
and d.realname=#{realname}
</if>
<if
test=
"email != null"
>
and d.email=#{email}
</if>
<if
test=
"sex != null"
>
and d.sex=#{sex}
</if>
<if
test=
"birthday != null"
>
and d.birthday=#{birthday}
</if>
<if
test=
"personSign != null"
>
and d.person_sign=#{personSign}
</if>
<if
test=
"remark != null"
>
and d.remark=#{remark}
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
ace-modules/ace-admin/src/main/resources/mapper/AppUserMapper.xml
View file @
81a14283
...
@@ -21,4 +21,6 @@
...
@@ -21,4 +21,6 @@
right join app_group_member agm on bg.id = agm.group_id
right join app_group_member agm on bg.id = agm.group_id
where user_id = #{id}
where user_id = #{id}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
ace-modules/ace-interface/src/main/java/com/github/wxiaoqi/security/api/vo/config/HeaderConfig.java
View file @
81a14283
...
@@ -17,8 +17,6 @@ import java.util.Enumeration;
...
@@ -17,8 +17,6 @@ import java.util.Enumeration;
* @description 设置请求头部信息,防止微服务之间调用请求头部信息丢失
* @description 设置请求头部信息,防止微服务之间调用请求头部信息丢失
* @data 2019/6/25 16:22
* @data 2019/6/25 16:22
*/
*/
@Configuration
@Component
public
class
HeaderConfig
implements
RequestInterceptor
{
public
class
HeaderConfig
implements
RequestInterceptor
{
@Override
@Override
...
...
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/vo/BannerVo.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
app
.
entity
.
vo
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/6/28 9:34
*/
@Data
public
class
BannerVo
{
/**
* 封面地址
*/
private
String
cover
;
/**
* 跳转链接地址
*/
private
String
url
;
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/BannerBiz.java
View file @
81a14283
...
@@ -4,10 +4,12 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
...
@@ -4,10 +4,12 @@ import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.Banner
;
import
com.xxfc.platform.app.entity.Banner
;
import
com.xxfc.platform.app.entity.vo.BannerVo
;
import
com.xxfc.platform.app.mapper.BannerMapper
;
import
com.xxfc.platform.app.mapper.BannerMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -30,12 +32,16 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
...
@@ -30,12 +32,16 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
this.deleteById(id);
this.deleteById(id);
}*/
}*/
public
List
<
Banner
>
findBannerList
(
Integer
type
)
{
public
List
<
BannerVo
>
findBannerList
(
Integer
type
)
{
Banner
banner
=
new
Banner
();
List
<
BannerVo
>
bannerVos
=
new
ArrayList
<>();
banner
.
setIsDel
(
0
);
List
<
Banner
>
banners
=
mapper
.
findBannerListByType
(
type
);
banner
.
setType
(
type
);
banners
.
forEach
(
banner
->
{
//mapper.findByType(type);
BannerVo
bannerVo
=
new
BannerVo
();
return
mapper
.
findBannerListByType
(
type
);
bannerVo
.
setCover
(
banner
.
getCover
());
banner
.
setUrl
(
banner
.
getUrl
());
bannerVos
.
add
(
bannerVo
);
});
return
bannerVos
;
}
}
/*
/*
...
...
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/BannerController.java
View file @
81a14283
...
@@ -2,7 +2,7 @@ package com.xxfc.platform.app.rest;
...
@@ -2,7 +2,7 @@ package com.xxfc.platform.app.rest;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.app.biz.BannerBiz
;
import
com.xxfc.platform.app.biz.BannerBiz
;
import
com.xxfc.platform.app.entity.
Banner
;
import
com.xxfc.platform.app.entity.
vo.BannerVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -33,7 +33,7 @@ public class BannerController {
...
@@ -33,7 +33,7 @@ public class BannerController {
if
(
type
==
null
)
{
if
(
type
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
List
<
Banner
>
bannerList
=
bannerBiz
.
findBannerList
(
type
);
List
<
Banner
Vo
>
bannerList
=
bannerBiz
.
findBannerList
(
type
);
return
ObjectRestResponse
.
succ
(
bannerList
);
return
ObjectRestResponse
.
succ
(
bannerList
);
}
}
}
}
xx-campsite/xx-campsite-api/src/main/java/com/xxfc/platform/campsite/dto/CampsiteShopPageDTO.java
View file @
81a14283
...
@@ -5,8 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,8 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Objects
;
/**
/**
...
@@ -92,5 +92,20 @@ public class CampsiteShopPageDTO implements Serializable {
...
@@ -92,5 +92,20 @@ public class CampsiteShopPageDTO implements Serializable {
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
private
Long
crtTime
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
CampsiteShopPageDTO
that
=
(
CampsiteShopPageDTO
)
o
;
return
Objects
.
equals
(
id
,
that
.
id
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
id
);
}
}
}
xx-campsite/xx-campsite-server/pom.xml
View file @
81a14283
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<groupId>
com.xxfc.common
</groupId>
<groupId>
com.xxfc.common
</groupId>
<artifactId>
xx-common-platform-web
</artifactId>
<artifactId>
xx-common-platform-web
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
<relativePath/>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.xxfc.platform
</groupId>
<groupId>
com.xxfc.platform
</groupId>
...
@@ -18,6 +19,17 @@
...
@@ -18,6 +19,17 @@
<artifactId>
xx-campsite-api
</artifactId>
<artifactId>
xx-campsite-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.wxiaoqi
</groupId>
<artifactId>
ace-common
</artifactId>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<!-- <dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.2.0.Final</version>
</dependency>-->
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
View file @
81a14283
...
@@ -61,12 +61,14 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper,CampsiteShop> {
...
@@ -61,12 +61,14 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper,CampsiteShop> {
campsiteShopPageDataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
campsiteShopPageDataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
campsiteShopPageDataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
campsiteShopPageDataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
if
(
CollectionUtils
.
isEmpty
(
campsiteShopPageDTOS
)){
if
(
CollectionUtils
.
isEmpty
(
campsiteShopPageDTOS
)){
campsiteShopPageDataVO
.
setData
(
new
ArrayList
<
CampsiteShopPageVo
>());
return
campsiteShopPageDataVO
;
return
campsiteShopPageDataVO
;
}
}
if
(
log
.
isDebugEnabled
()){
if
(
log
.
isDebugEnabled
()){
log
.
debug
(
"根据type=【{}】查询到的店铺数据:【{}】"
,
type
,
campsiteShopPageDTOS
);
log
.
debug
(
"根据type=【{}】查询到的店铺数据:【{}】"
,
type
,
campsiteShopPageDTOS
);
}
}
List
<
CampsiteShopPageVo
>
campsiteShopPageVoList
=
new
ArrayList
<>();
List
<
CampsiteShopPageVo
>
campsiteShopPageVoList
=
new
ArrayList
<>();
campsiteShopPageDTOS
=
campsiteShopPageDTOS
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
CampsiteShopPageDTO
campsiteShopPageDTO
:
campsiteShopPageDTOS
)
{
for
(
CampsiteShopPageDTO
campsiteShopPageDTO
:
campsiteShopPageDTOS
)
{
CampsiteShopPageVo
campsiteShopPageVo
=
new
CampsiteShopPageVo
();
CampsiteShopPageVo
campsiteShopPageVo
=
new
CampsiteShopPageVo
();
BeanUtils
.
copyProperties
(
campsiteShopPageDTO
,
campsiteShopPageVo
);
BeanUtils
.
copyProperties
(
campsiteShopPageDTO
,
campsiteShopPageVo
);
...
...
xx-campsite/xx-campsite-server/src/main/resources/mapper/CampsiteShopMapper.xml
View file @
81a14283
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
FROM `campsite_shop_tag` cst
FROM `campsite_shop_tag` cst
left JOIN `campsite_shop` cs on cst.shop_id=cs.id
left JOIN `campsite_shop` cs on cst.shop_id=cs.id
left JOIN `campsite_tag` ct on cst.tag_id=ct.id
left JOIN `campsite_tag` ct on cst.tag_id=ct.id
where cs.sale_state=1
where cs.sale_state=1
and cs.is_del=0
<if
test=
"typeId!=null"
>
<if
test=
"typeId!=null"
>
and cst.tag_id=#{typeId}
and cst.tag_id=#{typeId}
</if>
</if>
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<select
id=
"findAllByHome"
resultType=
"com.github.wxiaoqi.security.common.vo.GoodDataVO"
>
<select
id=
"findAllByHome"
resultType=
"com.github.wxiaoqi.security.common.vo.GoodDataVO"
>
select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude
select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude
FROM `campsite_shop` cs
FROM `campsite_shop` cs
where cs.sale_state=1
where cs.sale_state=1
and cs.is_del=0
order by cs.hot desc
order by cs.hot desc
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
</select>
</select>
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
81a14283
...
@@ -81,6 +81,7 @@ public class UserBiz {
...
@@ -81,6 +81,7 @@ public class UserBiz {
return
baseResponse
;
return
baseResponse
;
}
}
/**
/**
* 登录
* 登录
* @param map
* @param map
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/AddRentVehicleDTO.java
View file @
81a14283
...
@@ -14,12 +14,10 @@ public class AddRentVehicleDTO{
...
@@ -14,12 +14,10 @@ public class AddRentVehicleDTO{
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
//开始时间
//开始时间
@Column
(
name
=
"start_time"
)
@ApiModelProperty
(
value
=
"开始时间"
)
@ApiModelProperty
(
value
=
"开始时间"
)
private
Long
startTime
;
private
Long
startTime
;
//结束时间
//结束时间
@Column
(
name
=
"end_time"
)
@ApiModelProperty
(
value
=
"结束时间"
)
@ApiModelProperty
(
value
=
"结束时间"
)
private
Long
endTime
;
private
Long
endTime
;
...
@@ -36,12 +34,10 @@ public class AddRentVehicleDTO{
...
@@ -36,12 +34,10 @@ public class AddRentVehicleDTO{
private
String
bookEndDate
;
private
String
bookEndDate
;
//天数
//天数
@Column
(
name
=
"day_num"
)
@ApiModelProperty
(
value
=
"天数"
)
@ApiModelProperty
(
value
=
"天数"
)
private
Integer
dayNum
;
private
Integer
dayNum
;
//取车地点
//取车地点
@Column
(
name
=
"start_addr"
)
@ApiModelProperty
(
value
=
"取车地点"
)
@ApiModelProperty
(
value
=
"取车地点"
)
private
String
startAddr
;
private
String
startAddr
;
...
@@ -51,7 +47,6 @@ public class AddRentVehicleDTO{
...
@@ -51,7 +47,6 @@ public class AddRentVehicleDTO{
private
String
endAddr
;
private
String
endAddr
;
//取车城市编号
//取车城市编号
@Column
(
name
=
"start_city"
)
@ApiModelProperty
(
value
=
"取车城市编号"
)
@ApiModelProperty
(
value
=
"取车城市编号"
)
private
Integer
startCity
;
private
Integer
startCity
;
...
@@ -61,7 +56,6 @@ public class AddRentVehicleDTO{
...
@@ -61,7 +56,6 @@ public class AddRentVehicleDTO{
private
Integer
endCity
;
private
Integer
endCity
;
//取车城市名称
//取车城市名称
@Column
(
name
=
"start_city_name"
)
@ApiModelProperty
(
value
=
"取车城市名称"
)
@ApiModelProperty
(
value
=
"取车城市名称"
)
private
String
startCityName
;
private
String
startCityName
;
...
@@ -71,30 +65,42 @@ public class AddRentVehicleDTO{
...
@@ -71,30 +65,42 @@ public class AddRentVehicleDTO{
private
String
endCityName
;
private
String
endCityName
;
//司机类型 1--公司司机;2--自己司机
//司机类型 1--公司司机;2--自己司机
@Column
(
name
=
"driver_type"
)
@ApiModelProperty
(
value
=
"司机类型 1--公司司机;2--自己司机"
)
@ApiModelProperty
(
value
=
"司机类型 1--公司司机;2--自己司机"
)
private
Integer
driverType
;
private
Integer
driverType
;
//自己司机ids
//自己司机ids
@Column
(
name
=
"my_driver_ids"
)
@ApiModelProperty
(
value
=
"自己司机ids"
)
@ApiModelProperty
(
value
=
"自己司机ids"
)
private
String
myDriverIds
;
private
String
myDriverIds
;
//出发公司Id
//出发公司Id
@Column
(
name
=
"start_company_id"
)
@ApiModelProperty
(
value
=
"出发公司Id"
)
@ApiModelProperty
(
value
=
"出发公司Id"
)
private
Integer
startCompanyId
;
private
Integer
startCompanyId
;
//结束公司Id
//结束公司Id
@Column
(
name
=
"end_company_id"
)
@ApiModelProperty
(
value
=
"结束公司Id"
)
@ApiModelProperty
(
value
=
"结束公司Id"
)
private
Integer
endCompanyId
;
private
Integer
endCompanyId
;
//车型id
//车型id
@Column
(
name
=
"model_id"
)
@ApiModelProperty
(
value
=
"车型id"
)
@ApiModelProperty
(
value
=
"车型id"
)
private
Integer
modelId
;
private
Integer
modelId
;
//车型id
@ApiModelProperty
(
value
=
"是否购买免赔"
)
private
Integer
damageSafe
;
/**
* 是否使用出租免费天数
*/
@ApiModelProperty
(
value
=
"是否使用出租免费天数"
)
private
Integer
rentFreeDay
;
/**
* 优惠券ids
*/
@ApiModelProperty
(
value
=
"优惠券ids"
)
private
String
couponIds
;
public
void
setStartTime
(
Long
startTime
)
{
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
this
.
startTime
=
startTime
;
this
.
bookStartDate
=
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
this
.
bookStartDate
=
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/AddTourDTO.java
View file @
81a14283
...
@@ -68,4 +68,10 @@ public class AddTourDTO {
...
@@ -68,4 +68,10 @@ public class AddTourDTO {
@Column
(
name
=
"has_insure"
)
@Column
(
name
=
"has_insure"
)
@ApiModelProperty
(
value
=
"是否保险标记 1--要保险;0--不需要"
)
@ApiModelProperty
(
value
=
"是否保险标记 1--要保险;0--不需要"
)
Integer
hasInsure
;
Integer
hasInsure
;
/**
* 优惠券ids
*/
@ApiModelProperty
(
value
=
"优惠券ids"
)
private
String
couponIds
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
81a14283
...
@@ -167,12 +167,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -167,12 +167,13 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
*/
*/
public
void
cancel
(
BaseOrder
baseOrder
)
{
public
void
cancel
(
BaseOrder
baseOrder
)
{
if
(
cancelAble
.
get
(
baseOrder
.
getType
()).
contains
(
baseOrder
.
getStatus
()))
{
if
(
cancelAble
.
get
(
baseOrder
.
getType
()).
contains
(
baseOrder
.
getStatus
()))
{
int
updateResult
=
this
.
updateSelectiveByIdRe
(
new
BaseOrder
(){{
BaseOrder
updateOrder
=
new
BaseOrder
(){{
setId
(
baseOrder
.
getId
());
setId
(
baseOrder
.
getId
());
setStatus
(
OrderStatusEnum
.
ORDER_CANCEL
.
getCode
());
setStatus
(
OrderStatusEnum
.
ORDER_CANCEL
.
getCode
());
setCancelReason
(
baseOrder
.
getCancelReason
());
setCancelReason
(
baseOrder
.
getCancelReason
());
setVersion
(
baseOrder
.
getVersion
());
setVersion
(
baseOrder
.
getVersion
());
}});
}};
int
updateResult
=
this
.
updateSelectiveByIdRe
(
updateOrder
);
//如果取消失败,则抛异常
//如果取消失败,则抛异常
if
(
updateResult
<=
0
)
{
if
(
updateResult
<=
0
)
{
...
@@ -181,7 +182,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -181,7 +182,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//触发退款流程
//触发退款流程
//判断是否已支付
//判断是否已支付
if
(
baseOrder
.
getHasPay
().
equals
(
SYS_TRUE
))
{
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()
))
{
//判断订单类型
//判断订单类型
if
(
OrderTypeEnum
.
RentVehicle
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
if
(
OrderTypeEnum
.
RentVehicle
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/config/RabbitUserConfig.java
View file @
81a14283
package
com
.
xxfc
.
platform
.
order
.
config
;
package
com
.
xxfc
.
platform
.
order
.
config
;
import
org.springframework.amqp.core.Binding
;
import
org.springframework.amqp.core.*
;
import
org.springframework.amqp.core.BindingBuilder
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.core.CustomExchange
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.core.Queue
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
;
import
org.springframework.amqp.support.converter.Jackson2JsonMessageConverter
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -52,5 +53,14 @@ public class RabbitUserConfig {
...
@@ -52,5 +53,14 @@ public class RabbitUserConfig {
public
Binding
cfgDelayBinding
(
Queue
cfgDelayQueue
,
CustomExchange
cfgUserDelayExchange
){
public
Binding
cfgDelayBinding
(
Queue
cfgDelayQueue
,
CustomExchange
cfgUserDelayExchange
){
return
BindingBuilder
.
bind
(
cfgDelayQueue
).
to
(
cfgUserDelayExchange
).
with
(
ORDER_CANCEL_KEY
).
noargs
();
return
BindingBuilder
.
bind
(
cfgDelayQueue
).
to
(
cfgUserDelayExchange
).
with
(
ORDER_CANCEL_KEY
).
noargs
();
}
}
// @Bean
// public RabbitListenerContainerFactory<?> rabbitListenerContainerFactory(ConnectionFactory connectionFactory){
// SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
// factory.setConnectionFactory(connectionFactory);
//// factory.setMessageConverter(new Jackson2JsonMessageConverter());
// factory.setAcknowledgeMode(AcknowledgeMode.MANUAL);
// return factory;
// }
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mqhandler/RabbitConsumer.java
View file @
81a14283
...
@@ -56,7 +56,7 @@ public class RabbitConsumer {
...
@@ -56,7 +56,7 @@ public class RabbitConsumer {
* 其中的参数如果为true是把消息退回到queue但是有可能被其它的consumer(集群)接收到,
* 其中的参数如果为true是把消息退回到queue但是有可能被其它的consumer(集群)接收到,
* 设置为false是只补发给当前的consumer
* 设置为false是只补发给当前的consumer
*/
*/
channel
.
basicRecover
(
fals
e
);
channel
.
basicRecover
(
tru
e
);
}
}
}
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
81a14283
...
@@ -70,6 +70,9 @@ public class BaseOrderController extends CommonBaseController {
...
@@ -70,6 +70,9 @@ public class BaseOrderController extends CommonBaseController {
@Autowired
@Autowired
OrderMemberDetailBiz
orderMemberDetailBiz
;
OrderMemberDetailBiz
orderMemberDetailBiz
;
@Value
(
"${gateway.insideHost}"
)
String
insideHost
;
@Value
(
"${gateway.host}"
)
@Value
(
"${gateway.host}"
)
String
host
;
String
host
;
...
@@ -256,7 +259,7 @@ public class BaseOrderController extends CommonBaseController {
...
@@ -256,7 +259,7 @@ public class BaseOrderController extends CommonBaseController {
orderPayVo
.
setBody
(
baseOrder
.
getName
());
orderPayVo
.
setBody
(
baseOrder
.
getName
());
orderPayVo
.
setBuyerIp
(
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
)));
orderPayVo
.
setBuyerIp
(
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
)));
orderPayVo
.
setChannel
(
PayChannelEnum
.
ORDER_CRT
.
getCode
());
orderPayVo
.
setChannel
(
PayChannelEnum
.
ORDER_CRT
.
getCode
());
orderPayVo
.
setNotifyUrl
(
h
ost
+
order
+
notifyUrl
+
"?orderNo="
+
baseOrder
.
getNo
());
orderPayVo
.
setNotifyUrl
(
insideH
ost
+
order
+
notifyUrl
+
"?orderNo="
+
baseOrder
.
getNo
());
orderPayVo
.
setSubject
(
baseOrder
.
getName
());
orderPayVo
.
setSubject
(
baseOrder
.
getName
());
orderPayVo
.
setUserId
(
baseOrder
.
getUserId
());
orderPayVo
.
setUserId
(
baseOrder
.
getUserId
());
ObjectRestResponse
response
=
BeanUtil
.
toBean
(
thirdFeign
.
wx
(
orderPayVo
),
ObjectRestResponse
.
class
);
ObjectRestResponse
response
=
BeanUtil
.
toBean
(
thirdFeign
.
wx
(
orderPayVo
),
ObjectRestResponse
.
class
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderTourVerificationController.java
View file @
81a14283
...
@@ -38,7 +38,7 @@ public class OrderTourVerificationController extends CommonBaseController {
...
@@ -38,7 +38,7 @@ public class OrderTourVerificationController extends CommonBaseController {
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
public
UserDTO
getUserInfo
(){
return
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();}
public
UserDTO
getUserInfo
(){
return
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();}
@RequestMapping
(
value
=
"/verification/orderlist"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/verification/orderlist"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"旅游核销订单列表"
)
@ApiOperation
(
value
=
"旅游核销订单列表"
)
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/AbstractOrderHandle.java
View file @
81a14283
...
@@ -87,31 +87,12 @@ public abstract class AbstractOrderHandle<Biz extends BaseBiz, Detail extends Or
...
@@ -87,31 +87,12 @@ public abstract class AbstractOrderHandle<Biz extends BaseBiz, Detail extends Or
detail
.
setOrderId
(
detail
.
getOrder
().
getId
());
detail
.
setOrderId
(
detail
.
getOrder
().
getId
());
detailBiz
.
insertSelective
(
detail
);
detailBiz
.
insertSelective
(
detail
);
detail
.
getOrder
().
setDetailId
(
detail
.
getId
());
detail
.
getOrder
().
setDetailId
(
detail
.
getId
());
baseOrderBiz
.
updateSelectiveById
(
detail
.
getOrder
());
int
updateResult
=
baseOrderBiz
.
updateSelectiveByIdRe
(
detail
.
getOrder
());
if
(
updateResult
>
0
)
{
detail
.
getOrder
().
setVersion
(
detail
.
getOrder
().
getVersion
()
+
1
);
}
}
}
// /**
// * 创建订单及其多子项
// * @param details
// */
// public void createOrder(List<Detail> details) {
// BaseOrder order = createOrder();
// for(Detail detail : details) {
// preHandleDetail(order, detail);
// }
// handleDetail(details);
// }
//
// /**
// * 处理订单多子项
// * @param details
// */
// public void handleDetail(List<Detail> details){
// for(Detail detail : details) {
// detailBiz.insertSelective(detail);
// }
// }
/**
/**
* 计算价格
* 计算价格
* @param detail
* @param detail
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
81a14283
...
@@ -92,7 +92,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -92,7 +92,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
super
.
handleDetail
(
bo
);
super
.
handleDetail
(
bo
);
//发送定时取消订单(30分钟)
//发送定时取消订单(30分钟)
rabbitProduct
.
sendDelayMessage
(
bo
.
getOrder
(),
1000L
*
60
*
30
);
//rabbitProduct.sendDelayMessage(bo.getOrder(), 1000L * 60 * 30);
rabbitProduct
.
sendDelayMessage
(
bo
.
getOrder
(),
1000L
*
60
*
5
);
}
}
@Override
@Override
...
@@ -116,7 +117,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -116,7 +117,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
AppUserDTO
dto
=
detail
.
getAppUserDTO
();
AppUserDTO
dto
=
detail
.
getAppUserDTO
();
//如果用户存在,并且为会员,并且车辆有优惠价
//如果用户存在,并且为会员,并且车辆有优惠价
if
(
null
!=
dto
&&
null
!=
detail
.
getRentFreeDay
()
&&
detail
.
getRentFreeDay
()
>
0
&&
dto
.
getRentFreeDays
()
>
0
)
{
if
(
null
!=
dto
&&
null
!=
detail
.
getRentFreeDay
()
&&
detail
.
getRentFreeDay
()
>
0
)
{
if
(
dto
.
getRentFreeDays
()
<=
0
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_EXPIRE_CODE
);
}
if
(
detail
.
getDayNum
()
>
dto
.
getRentFreeDays
())
{
if
(
detail
.
getDayNum
()
>
dto
.
getRentFreeDays
())
{
freeDayNum
=
dto
.
getRentFreeDays
();
freeDayNum
=
dto
.
getRentFreeDays
();
}
else
{
}
else
{
...
@@ -127,6 +131,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -127,6 +131,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
vehicleDayNum
=
detail
.
getDayNum
();
vehicleDayNum
=
detail
.
getDayNum
();
}
}
detail
.
setFreeDays
(
freeDayNum
);
//计算价格
//计算价格
//计算车辆费用
//计算车辆费用
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
...
@@ -136,7 +142,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -136,7 +142,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
String
[]
prices
=
StrUtil
.
isBlank
(
vehicleModel
.
getRentDiscountPrice
())
String
[]
prices
=
StrUtil
.
isBlank
(
vehicleModel
.
getRentDiscountPrice
())
?
new
String
[]{
vehicleModel
.
getPrice
().
toString
(),
vehicleModel
.
getPrice
().
toString
(),
vehicleModel
.
getPrice
().
toString
()}
?
new
String
[]{
vehicleModel
.
getPrice
().
toString
(),
vehicleModel
.
getPrice
().
toString
(),
vehicleModel
.
getPrice
().
toString
()}
:
vehicleModel
.
getRentDiscountPrice
().
split
(
","
);
:
vehicleModel
.
getRentDiscountPrice
().
split
(
","
);
switch
(
MemberEnum
.
getByCode
(
detail
.
getAppUserDTO
().
get
IsMember
()))
{
switch
(
MemberEnum
.
getByCode
(
detail
.
getAppUserDTO
().
get
MemberLevel
()))
{
case
NORMAL:
case
NORMAL:
modelAmount
=
handleDiscount
(
vehicleModel
,
prices
,
NORMAL
);
modelAmount
=
handleDiscount
(
vehicleModel
,
prices
,
NORMAL
);
break
;
break
;
...
@@ -199,7 +205,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -199,7 +205,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
private
BigDecimal
handleDiscount
(
VehicleModel
vehicleModel
,
String
[]
prices
,
MemberEnum
memberEnum
)
{
private
BigDecimal
handleDiscount
(
VehicleModel
vehicleModel
,
String
[]
prices
,
MemberEnum
memberEnum
)
{
BigDecimal
modelAmount
;
//会员比例
BigDecimal
modelAmount
;
//会员比例
if
(
DISCOUNT_STATUS_MEMBER
.
equals
(
vehicleModel
.
getRentDiscountStatus
()))
{
if
(
DISCOUNT_STATUS_MEMBER
.
equals
(
vehicleModel
.
getRentDiscountStatus
()))
{
modelAmount
=
new
BigDecimal
(
String
.
valueOf
((
memberEnum
.
getPercent
()/
100
))).
multiply
(
vehicleModel
.
getPrice
()
);
modelAmount
=
new
BigDecimal
(
String
.
valueOf
((
memberEnum
.
getPercent
()/
100
d
))).
multiply
(
vehicleModel
.
getPrice
()).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
else
{
}
else
{
//会员固定价列表
//会员固定价列表
modelAmount
=
new
BigDecimal
(
prices
[(
memberEnum
.
getCode
()
-
1
)]);
modelAmount
=
new
BigDecimal
(
prices
[(
memberEnum
.
getCode
()
-
1
)]);
...
@@ -220,7 +226,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -220,7 +226,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
childrenStr
.
append
(
",${tem_0104}"
);
childrenStr
.
append
(
",${tem_0104}"
);
}
}
if
(
childrenStr
.
length
()
>
0
){
if
(
childrenStr
.
length
()
>
0
){
childrenStr
.
deleteCharAt
(
1
);
childrenStr
.
deleteCharAt
(
0
);
}
}
return
childrenStr
.
toString
();
return
childrenStr
.
toString
();
}
}
...
@@ -242,6 +248,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -242,6 +248,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
private
void
acquireVehicle
(
RentVehicleBO
detail
)
{
private
void
acquireVehicle
(
RentVehicleBO
detail
)
{
//根据车型、时间、距离,门店,预定车辆
//根据车型、时间、距离,门店,预定车辆
RentVehicleBookDTO
rentVehicleBookDTO
=
BeanUtil
.
toBean
(
detail
.
getBookVehicleVO
(),
RentVehicleBookDTO
.
class
);
RentVehicleBookDTO
rentVehicleBookDTO
=
BeanUtil
.
toBean
(
detail
.
getBookVehicleVO
(),
RentVehicleBookDTO
.
class
);
rentVehicleBookDTO
.
setModelId
(
detail
.
getModelId
());
rentVehicleBookDTO
.
setUserName
(
BaseContextHandler
.
getName
());
rentVehicleBookDTO
.
setUserName
(
BaseContextHandler
.
getName
());
ObjectRestResponse
<
VehicleBookRecord
>
orr
=
vehicleFeign
.
rentApplyVehicle
(
rentVehicleBookDTO
);
ObjectRestResponse
<
VehicleBookRecord
>
orr
=
vehicleFeign
.
rentApplyVehicle
(
rentVehicleBookDTO
);
detail
.
setVehicleId
(
orr
.
getData
().
getVehicleId
());
detail
.
setVehicleId
(
orr
.
getData
().
getVehicleId
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderTourService.java
View file @
81a14283
...
@@ -209,11 +209,10 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
...
@@ -209,11 +209,10 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
childrenStr
.
append
(
",${tem_0203}"
);
childrenStr
.
append
(
",${tem_0203}"
);
}
}
String
str
=
childrenStr
.
toString
();
if
(
childrenStr
.
length
()
>
0
){
if
(
str
.
length
()
>
0
)
{
childrenStr
.
deleteCharAt
(
0
);
str
=
str
.
substring
(
1
,
str
.
length
());
}
}
return
str
;
return
childrenStr
.
toString
()
;
}
}
/**
/**
...
...
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/dto/GoodSiteDTO.java
View file @
81a14283
...
@@ -31,7 +31,7 @@ public class GoodSiteDTO {
...
@@ -31,7 +31,7 @@ public class GoodSiteDTO {
//分公司id
//分公司id
@ApiModelProperty
(
value
=
"分公司id"
)
@ApiModelProperty
(
value
=
"分公司id"
)
private
String
companyId
;
private
Integer
companyId
;
/**
/**
* 地址-省/直辖市(编码)
* 地址-省/直辖市(编码)
...
...
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/entity/TourGoodSite.java
View file @
81a14283
...
@@ -50,7 +50,7 @@ public class TourGoodSite implements Serializable {
...
@@ -50,7 +50,7 @@ public class TourGoodSite implements Serializable {
*/
*/
@Column
(
name
=
"company_id"
)
@Column
(
name
=
"company_id"
)
@ApiModelProperty
(
value
=
"分公司id"
)
@ApiModelProperty
(
value
=
"分公司id"
)
private
String
companyId
;
private
Integer
companyId
;
/**
/**
* 地址-省/直辖市(编码)
* 地址-省/直辖市(编码)
...
@@ -64,7 +64,7 @@ public class TourGoodSite implements Serializable {
...
@@ -64,7 +64,7 @@ public class TourGoodSite implements Serializable {
*/
*/
@Column
(
name
=
"province_name"
)
@Column
(
name
=
"province_name"
)
@ApiModelProperty
(
"地址-省/直辖市(名称)"
)
@ApiModelProperty
(
"地址-省/直辖市(名称)"
)
private
Integer
provinceName
;
private
String
provinceName
;
/**
/**
* 地址-市(编码)
* 地址-市(编码)
...
@@ -78,7 +78,7 @@ public class TourGoodSite implements Serializable {
...
@@ -78,7 +78,7 @@ public class TourGoodSite implements Serializable {
*/
*/
@Column
(
name
=
"city_name"
)
@Column
(
name
=
"city_name"
)
@ApiModelProperty
(
"地址-市(名称)"
)
@ApiModelProperty
(
"地址-市(名称)"
)
private
Integer
cityName
;
private
String
cityName
;
/**
/**
* 出发时间
* 出发时间
...
...
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
View file @
81a14283
...
@@ -92,6 +92,6 @@ public interface TourFeign {
...
@@ -92,6 +92,6 @@ public interface TourFeign {
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"4"
)
Integer
limit
);
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"4"
)
Integer
limit
);
//获取商品信息
//获取商品信息
@RequestMapping
(
value
=
"/app/unauth/one"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
good/
app/unauth/one"
,
method
=
RequestMethod
.
GET
)
public
TourGood
one
(
@RequestParam
(
value
=
"goodId"
,
defaultValue
=
"0"
)
Integer
goodId
);
public
TourGood
one
(
@RequestParam
(
value
=
"goodId"
,
defaultValue
=
"0"
)
Integer
goodId
);
}
}
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourGoodDetailBiz.java
View file @
81a14283
...
@@ -78,6 +78,8 @@ public class TourGoodDetailBiz extends BaseBiz<TourGoodMapper, TourGood> {
...
@@ -78,6 +78,8 @@ public class TourGoodDetailBiz extends BaseBiz<TourGoodMapper, TourGood> {
//获取出行时间
//获取出行时间
List
<
TourDepartTimeVo
>
timelist
=
priceMapper
.
getAllByGoodId
(
id
);
List
<
TourDepartTimeVo
>
timelist
=
priceMapper
.
getAllByGoodId
(
id
);
detailVo
.
setTourDepartTimeVo
(
timelist
);
detailVo
.
setTourDepartTimeVo
(
timelist
);
Integer
stock
=
priceMapper
.
getTotalStock
(
id
);
detailVo
.
setStock
(
stock
);
//获取出发地点
//获取出发地点
List
<
TourDepartVo
>
departList
=
siteMapper
.
getlistByGoodId
(
id
);
List
<
TourDepartVo
>
departList
=
siteMapper
.
getlistByGoodId
(
id
);
detailVo
.
setTourDepartVo
(
departList
);
detailVo
.
setTourDepartVo
(
departList
);
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourTagBannerBiz.java
View file @
81a14283
...
@@ -127,13 +127,13 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
...
@@ -127,13 +127,13 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
* @param tourTagBannerDTOS
* @param tourTagBannerDTOS
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateTourBannerByBatch
(
List
<
TourTagBannerDTO
>
tourTagBannerDTOS
,
UserDTO
userDTO
)
{
public
void
updateTourBannerByBatch
(
List
<
TourTagBannerDTO
>
tourTagBannerDTOS
,
Integer
tagId
,
UserDTO
userDTO
)
{
List
<
Long
>
tourTagBannerIds
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
nonNull
(
tourTagBannerDTO
.
getId
())).
map
(
TourTagBannerDTO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
tourTagBannerIds
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
nonNull
(
tourTagBannerDTO
.
getId
())).
map
(
TourTagBannerDTO:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerIds
)){
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerIds
)){
mapper
.
updateTourBannerStatusByTagannerIdsAndTagId
(
tourTagBannerIds
,
t
ourTagBannerDTOS
.
get
(
0
).
getTagId
()
,
1
);
mapper
.
updateTourBannerStatusByTagannerIdsAndTagId
(
tourTagBannerIds
,
t
agId
,
1
);
}
else
{
}
else
{
if
(
CollectionUtils
.
is
Not
Empty
(
tourTagBannerDTOS
)){
if
(
CollectionUtils
.
isEmpty
(
tourTagBannerDTOS
)){
mapper
.
updateTourTagBannerStatusByTagId
(
t
ourTagBannerDTOS
.
get
(
0
).
getTagId
()
,
1
,
Instant
.
now
().
toEpochMilli
());
mapper
.
updateTourTagBannerStatusByTagId
(
t
agId
,
1
,
Instant
.
now
().
toEpochMilli
());
}
}
}
}
List
<
TourTagBannerDTO
>
tagBannerDTOS
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getId
())).
collect
(
Collectors
.
toList
());
List
<
TourTagBannerDTO
>
tagBannerDTOS
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getId
())).
collect
(
Collectors
.
toList
());
...
@@ -169,4 +169,5 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
...
@@ -169,4 +169,5 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
}
}
return
tourTagBannerDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
TourTagBannerDTO:
:
getTagId
));
return
tourTagBannerDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
TourTagBannerDTO:
:
getTagId
));
}
}
}
}
\ No newline at end of file
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourTagBiz.java
View file @
81a14283
...
@@ -210,7 +210,7 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
...
@@ -210,7 +210,7 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerDTOS
)){
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerDTOS
)){
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getTagId
())).
peek
(
tourTagBannerDTO
->
tourTagBannerDTO
.
setTagId
(
tourTagDTO
.
getId
())).
count
();
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getTagId
())).
peek
(
tourTagBannerDTO
->
tourTagBannerDTO
.
setTagId
(
tourTagDTO
.
getId
())).
count
();
}
}
tourTagBannerBiz
.
updateTourBannerByBatch
(
tourTagBannerDTOS
,
userDTO
);
tourTagBannerBiz
.
updateTourBannerByBatch
(
tourTagBannerDTOS
,
tourTagAndBannerDTO
.
getTourTagDTO
().
getId
(),
userDTO
);
return
effrows
;
return
effrows
;
}
}
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/mapper/TourGoodSpePriceMapper.java
View file @
81a14283
...
@@ -18,6 +18,9 @@ public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> {
...
@@ -18,6 +18,9 @@ public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> {
List
<
TourDepartTimeVo
>
getAllByGoodId
(
@Param
(
"goodId"
)
Integer
goodId
);
List
<
TourDepartTimeVo
>
getAllByGoodId
(
@Param
(
"goodId"
)
Integer
goodId
);
//获取总库存
Integer
getTotalStock
(
@Param
(
"goodId"
)
Integer
goodId
);
//减库存
//减库存
int
updStockById
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"number"
)
Integer
number
,
@Param
(
"type"
)
Integer
type
);
int
updStockById
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"number"
)
Integer
number
,
@Param
(
"type"
)
Integer
type
);
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourTagBannerController.java
View file @
81a14283
package
com
.
xxfc
.
platform
.
tour
.
rest
;
package
com
.
xxfc
.
platform
.
tour
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ListRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.tour.biz.TourTagBannerBiz
;
import
com.xxfc.platform.tour.biz.TourTagBannerBiz
;
import
com.xxfc.platform.tour.dto.TourTagBannerDTO
;
import
com.xxfc.platform.tour.entity.TourTagBanner
;
import
com.xxfc.platform.tour.entity.TourTagBanner
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -16,7 +16,6 @@ public class TourTagBannerController extends BaseController<TourTagBannerBiz,Tou
...
@@ -16,7 +16,6 @@ public class TourTagBannerController extends BaseController<TourTagBannerBiz,Tou
@Autowired
@Autowired
private
TourTagBannerBiz
tagBannerBiz
;
private
TourTagBannerBiz
tagBannerBiz
;
@GetMapping
(
"/app/unauth/findById/{tid}"
)
@GetMapping
(
"/app/unauth/findById/{tid}"
)
...
@@ -26,7 +25,10 @@ public class TourTagBannerController extends BaseController<TourTagBannerBiz,Tou
...
@@ -26,7 +25,10 @@ public class TourTagBannerController extends BaseController<TourTagBannerBiz,Tou
return
ObjectRestResponse
.
succ
(
tourTagBanners
);
return
ObjectRestResponse
.
succ
(
tourTagBanners
);
}
}
@GetMapping
(
"/app/unauth/findByType/{type}"
)
public
ObjectRestResponse
findByType
(
@PathVariable
Integer
type
)
{
List
<
TourTagBannerDTO
>
tourTagBannerDTOS
=
tagBannerBiz
.
findTourTagBannersByTagId
(
type
);
return
ObjectRestResponse
.
succ
(
tourTagBannerDTOS
);
}
}
}
\ No newline at end of file
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourUserController.java
View file @
81a14283
...
@@ -34,7 +34,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
...
@@ -34,7 +34,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
@GetMapping
(
"/app/unauth/getTourUser/{isChild}"
)
@GetMapping
(
"/app/unauth/getTourUser/{isChild}"
)
public
ObjectRestResponse
findListByTourUserByIsChild
(
@PathVariable
int
isChild
){
public
ObjectRestResponse
findListByTourUserByIsChild
(
@PathVariable
int
isChild
){
AppUserDTO
userInfo
=
getUserInfo
();
AppUserDTO
userInfo
=
getUserInfo
();
Integer
id
=
userInfo
.
get
I
d
();
Integer
id
=
userInfo
.
get
Useri
d
();
List
<
TourUser
>
tourUsers
=
baseBiz
.
findListByTourUserByIsChild
(
id
,
isChild
);
List
<
TourUser
>
tourUsers
=
baseBiz
.
findListByTourUserByIsChild
(
id
,
isChild
);
return
ObjectRestResponse
.
succ
(
tourUsers
);
return
ObjectRestResponse
.
succ
(
tourUsers
);
...
@@ -115,7 +115,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
...
@@ -115,7 +115,7 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
if
(
userInfo
==
null
||
userInfo
.
getUserid
()==
null
||
userInfo
.
getUserid
()==
0
)
{
if
(
userInfo
==
null
||
userInfo
.
getUserid
()==
null
||
userInfo
.
getUserid
()==
0
)
{
ObjectRestResponse
.
createDefaultFail
();
ObjectRestResponse
.
createDefaultFail
();
}
}
Integer
id
=
userInfo
.
get
I
d
();
Integer
id
=
userInfo
.
get
Useri
d
();
List
<
TourUser
>
tourUsers
=
baseBiz
.
getTourUser
(
id
);
List
<
TourUser
>
tourUsers
=
baseBiz
.
getTourUser
(
id
);
return
ObjectRestResponse
.
succ
(
tourUsers
);
return
ObjectRestResponse
.
succ
(
tourUsers
);
}
}
...
...
xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodMapper.xml
View file @
81a14283
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
from tour_good g
from tour_good g
LEFT JOIN tour_good_tag tag ON g.id=tag.good_id
LEFT JOIN tour_good_tag tag ON g.id=tag.good_id
LEFT JOIN tour_tag t ON tag.tag_id=t.id
LEFT JOIN tour_tag t ON tag.tag_id=t.id
where g.recommend=1
where g.recommend=1
and g.status=1 and g.is_del=0
GROUP BY g.id
GROUP BY g.id
ORDER BY g.rank DESC ,g.id DESC
ORDER BY g.rank DESC ,g.id DESC
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
...
...
xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodSpePriceMapper.xml
View file @
81a14283
...
@@ -41,6 +41,11 @@
...
@@ -41,6 +41,11 @@
FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 ORDER BY start_time
FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 ORDER BY start_time
</select>
</select>
<!-- 获取出行时间 -->
<select
id=
"getTotalStock"
resultType=
"Integer"
>
SELECT IFNULL(SUM(stock),0) as stock FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 and IFNULL(DATEDIFF(start_time,NOW()),0)>0
</select>
<!-- 减库存-->
<!-- 减库存-->
<update
id=
"updStockById"
>
<update
id=
"updStockById"
>
update tour_good_spe_price set
update tour_good_spe_price set
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/ITrafficViolationsFeign.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
api
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.model.JuheResult
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
//@FeignClient(name = "xx-universal")
@RequestMapping
(
"/3p/tv"
)
public
interface
ITrafficViolationsFeign
{
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/ITrafficViolationsService.java
deleted
100644 → 0
View file @
7c6df77d
package
com
.
xxfc
.
platform
.
universal
.
api
;
import
com.xxfc.platform.universal.model.JuheResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
@FeignClient
(
"xx-third-party"
)
@RequestMapping
(
"3p/tv"
)
public
interface
ITrafficViolationsService
{
/**
* 获取支持的城市
* @param province
* @return
*/
@RequestMapping
(
value
=
"city"
,
method
=
RequestMethod
.
GET
)
JuheResult
getCityInfo
(
String
province
);
/**
* 查违章
* @param city 城市代码
* @param hphm 车牌号码
* @param hpzl 车辆类型 01:大车,02:小车
* @param engineno 发动机号
* @param classno 车架号
* @return
*/
@RequestMapping
(
value
=
"trafficViolations"
,
method
=
RequestMethod
.
GET
)
JuheResult
queryTrafficViolations
(
String
city
,
String
hphm
,
String
hpzl
,
String
engineno
,
String
classno
);
/**
* 获取剩余查询次数
* @return
*/
@RequestMapping
(
value
=
"balance"
,
method
=
RequestMethod
.
GET
)
JuheResult
getBalance
();
/**
* 根据车牌查归属地
* @param hphm 车牌号码
* @return
*/
@RequestMapping
(
value
=
"carPre"
,
method
=
RequestMethod
.
GET
)
JuheResult
carPre
(
String
hphm
);
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/LicensePlateType.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
tk.mybatis.mapper.annotation.KeySql
;
import
tk.mybatis.mapper.code.IdentityDialect
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Objects
;
@Data
public
class
LicensePlateType
implements
Serializable
{
/**
* id
*/
@Id
@KeySql
(
dialect
=
IdentityDialect
.
MYSQL
)
private
Integer
id
;
/**
* 车型代码
*/
private
String
code
;
/**
* 车型类型
*/
private
String
type
;
/**
* 创建时间
*/
@Column
(
name
=
"create_date"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT-8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createDate
;
/**
* 修改时间
*/
@Column
(
name
=
"update_date"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT-8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateDate
;
public
LicensePlateType
(
String
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
public
LicensePlateType
()
{
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
LicensePlateType
that
=
(
LicensePlateType
)
o
;
return
code
.
equals
(
that
.
code
)
&&
type
.
equals
(
that
.
type
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
code
,
type
);
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/SearchableCity.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
tk.mybatis.mapper.annotation.KeySql
;
import
tk.mybatis.mapper.code.IdentityDialect
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
java.util.Date
;
@Data
public
class
SearchableCity
{
@Id
@KeySql
(
dialect
=
IdentityDialect
.
MYSQL
)
private
Integer
id
;
private
String
code
;
@Column
(
name
=
"city_name"
)
private
String
cityName
;
@Column
(
name
=
"create_date"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT-8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createDate
;
@Column
(
name
=
"update_date"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT-8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateDate
;
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/feign/ThirdFeign.java
View file @
81a14283
...
@@ -5,11 +5,9 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...
@@ -5,11 +5,9 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.xxfc.platform.universal.entity.OrderRefund
;
import
com.xxfc.platform.universal.entity.OrderRefund
;
import
com.xxfc.platform.universal.vo.OrderPayVo
;
import
com.xxfc.platform.universal.vo.OrderPayVo
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -30,4 +28,25 @@ public interface ThirdFeign {
...
@@ -30,4 +28,25 @@ public interface ThirdFeign {
@RequestMapping
(
value
=
"/refund/app/wx"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/refund/app/wx"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
String
>
refund
(
@RequestBody
OrderRefundVo
orderRefundVo
);
public
ObjectRestResponse
<
String
>
refund
(
@RequestBody
OrderRefundVo
orderRefundVo
);
/**
* 获取支持的城市
* @return
*/
@GetMapping
(
"/city"
)
ObjectRestResponse
getCityInfo
();
/**
* 违章车辆查询
* @return
*/
@PostMapping
(
"/trafficViolations"
)
ObjectRestResponse
queryTrafficViolations
(
@RequestBody
TrafficViolations
trafficViolations
)
;
/**
* 车辆类型查询
* @return
*/
@GetMapping
(
"/LicensePlateType"
)
ObjectRestResponse
getLicensePlateType
();
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/vo/TrafficViolations.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
vo
;
import
lombok.Data
;
@Data
public
class
TrafficViolations
{
/**
* 车牌类型
*/
private
String
type
;
/**
* 车牌号码
*/
private
String
plateno
;
/**
* 发动机号
*/
private
String
engineno
;
/**
* 车架号
*/
private
String
frameno
;
}
xx-universal/xx-universal-server/pom.xml
View file @
81a14283
...
@@ -72,6 +72,10 @@
...
@@ -72,6 +72,10 @@
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
antlr
</groupId>
<artifactId>
antlr
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/UniversalApplication.java
View file @
81a14283
...
@@ -19,7 +19,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -19,7 +19,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableAceCache
@EnableAceCache
@EnableTransactionManagement
@EnableTransactionManagement
@tk
.
mybatis
.
spring
.
annotation
.
MapperScan
(
basePackages
=
"com.xxfc.platform.universal.mapper"
)
@tk
.
mybatis
.
spring
.
annotation
.
MapperScan
(
basePackages
=
"com.xxfc.platform.universal.mapper"
)
@EnableFeignClients
(
value
=
{
"com.
github.wxiaoqi.security.auth.client.feign"
,
"com.xxfc.platform"
,
"com.github.wxiaoqi.security.admin.feign
"
},
defaultConfiguration
=
HeaderConfig
.
class
)
@EnableFeignClients
(
value
=
{
"com.
xxfc.platform"
,
"com.github.wxiaoqi.security
"
},
defaultConfiguration
=
HeaderConfig
.
class
)
public
class
UniversalApplication
{
public
class
UniversalApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/LicensePlateTypeBiz.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.universal.entity.LicensePlateType
;
import
com.xxfc.platform.universal.mapper.LicensePlateTypeMapper
;
import
org.springframework.stereotype.Service
;
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.sql.SQLDataException
;
import
java.sql.SQLException
;
import
java.util.List
;
@Service
public
class
LicensePlateTypeBiz
extends
BaseBiz
<
LicensePlateTypeMapper
,
LicensePlateType
>
{
/**
* 获取车牌类型和和编码
* @param licensePlateTypes
*/
@Transactional
public
void
insertLicensePlateType
(
List
<
LicensePlateType
>
licensePlateTypes
)
{
mapper
.
insertLicensePlateType
(
licensePlateTypes
);
}
/**
* 修改数据库数据
* @param licensePlateTypes
* @throws SQLException
*/
@Transactional
public
void
updateLicensePlateType
(
List
<
LicensePlateType
>
licensePlateTypes
)
throws
SQLException
{
// List<LicensePlateType> saveLicensePlateTypes = mapper.selectAll();
// HashSet<LicensePlateType> judgeSet = new HashSet<>();
// judgeSet.addAll(saveLicensePlateTypes);
// for (LicensePlateType licensePlateType : licensePlateTypes) {
//
// if (judgeSet.add(licensePlateType)) {
//
// mapper.updateByExample()
// }
// }
for
(
LicensePlateType
licensePlateType
:
licensePlateTypes
)
{
Example
exa
=
Example
.
builder
(
LicensePlateType
.
class
)
.
where
(
WeekendSqls
.<
LicensePlateType
>
custom
()
.
andEqualTo
(
LicensePlateType:
:
getCode
,
licensePlateType
.
getCode
())
).
build
();
int
flag
=
mapper
.
updateByExample
(
licensePlateType
,
exa
);
if
(
flag
==
0
)
{
insertSelective
(
licensePlateType
);
}
if
(
flag
>
1
)
{
throw
new
SQLException
(
"修改错误,同时修改多条数据"
);
}
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
81a14283
...
@@ -50,7 +50,14 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
...
@@ -50,7 +50,14 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
Integer
amount
=
orderPayVo
.
getAmount
();
Integer
amount
=
orderPayVo
.
getAmount
();
log
.
error
(
"---下单---order_no====="
+
order_no
+
"--支付订单号--trade_no===="
+
trade_no
+
"--金额---amount===="
+
amount
);
log
.
error
(
"---下单---order_no====="
+
order_no
+
"--支付订单号--trade_no===="
+
trade_no
+
"--金额---amount===="
+
amount
);
//报名费回调路径
//报名费回调路径
String
jsParam
=
WXPay
.
apppay
(
1
+
""
,
orderPayVo
.
getBody
(),
"https://"
+
SystemConfig
.
weixinHost
+
"/api/universal/pay/app/unauth/notify"
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
//临时处理
amount
=
amount
/
100000
;
if
(
amount
<=
0
)
{
amount
=
1
;
}
String
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
"https://"
+
SystemConfig
.
weixinHost
+
"/api/universal/pay/app/unauth/notify"
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
if
(!
StringUtils
.
isBlank
(
jsParam
))
if
(!
StringUtils
.
isBlank
(
jsParam
))
{
{
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/SearchableCityBiz.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.universal.entity.SearchableCity
;
import
com.xxfc.platform.universal.mapper.SearchableCityMapper
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
@Service
public
class
SearchableCityBiz
extends
BaseBiz
<
SearchableCityMapper
,
SearchableCity
>
{
public
void
insertSearchableCities
(
ArrayList
<
SearchableCity
>
searchableCities
)
{
mapper
.
insertSearchableCities
(
searchableCities
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/TrafficViolationsController.java
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
controller
;
package
com
.
xxfc
.
platform
.
universal
.
controller
;
import
com.
xxfc.platform.universal.api.ITrafficViolationsService
;
import
com.
alibaba.fastjson.JSONObject
;
import
com.
xxfc.platform.universal.model.JuheResult
;
import
com.
github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RestController
@RequestMapping
(
"3p/tv"
)
@RequestMapping
(
"3p/tv"
)
public
class
TrafficViolationsController
{
public
class
TrafficViolationsController
{
//implements ITrafficViolationsService {
@Autowired
// @Autowired
TrafficViolationsService
tvService
;
// TrafficViolationsService tvService;
//
/**
// @Override
* 获取支持的城市
// @GetMapping("city")
* @return
// public JuheResult getCityInfo(String province) {
*/
// return tvService.getCity(province);
@GetMapping
(
"/city"
)
// }
public
ObjectRestResponse
getCityInfo
()
{
//
try
{
// @Override
return
ObjectRestResponse
.
succ
(
JSONObject
.
parse
(
tvService
.
getCity
()));
// @GetMapping("trafficViolations")
}
catch
(
Exception
e
)
{
// public JuheResult queryTrafficViolations(String city, String hphm, String hpzl, String engineno, String classno) {
e
.
printStackTrace
();
// return tvService.queryViolations(city, hphm, hpzl, engineno, classno);
return
ObjectRestResponse
.
createDefaultFail
();
// }
}
//
}
// @Override
// @GetMapping("balance")
/**
// public JuheResult getBalance() {
* 违章车辆查询
// return tvService.queryBalance();
* @return
// }
*/
//
@PostMapping
(
"/trafficViolations"
)
// @Override
public
ObjectRestResponse
queryTrafficViolations
(
@RequestBody
TrafficViolations
trafficViolations
)
{
// @GetMapping("carPre")
try
{
// public JuheResult carPre(String hphm) {
return
ObjectRestResponse
.
succ
(
JSONObject
.
parse
(
tvService
.
queryViolations
(
trafficViolations
)));
// return tvService.queryCityByHphm(hphm);
}
catch
(
Exception
e
)
{
// }
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
/**
* 车辆类型查询
* @return
*/
@GetMapping
(
"/LicensePlateType"
)
public
ObjectRestResponse
getLicensePlateType
()
{
try
{
return
ObjectRestResponse
.
succ
(
tvService
.
getLicensePlateType
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/mapper/LicensePlateTypeMapper.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
mapper
;
import
com.xxfc.platform.universal.entity.LicensePlateType
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
LicensePlateTypeMapper
extends
Mapper
<
LicensePlateType
>
{
void
insertLicensePlateType
(
@Param
(
"licensePlateTypes"
)
List
<
LicensePlateType
>
licensePlateTypes
);
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/mapper/SearchableCityMapper.java
0 → 100644
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
mapper
;
import
com.xxfc.platform.universal.entity.SearchableCity
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.ArrayList
;
public
interface
SearchableCityMapper
extends
Mapper
<
SearchableCity
>
{
void
insertSearchableCities
(
@Param
(
value
=
"searchableCities"
)
ArrayList
<
SearchableCity
>
searchableCities
);
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/TrafficViolationsService.java
View file @
81a14283
package
com
.
xxfc
.
platform
.
universal
.
service
;
package
com
.
xxfc
.
platform
.
universal
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xxfc.platform.universal.model.*
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.universal.biz.LicensePlateTypeBiz
;
import
com.xxfc.platform.universal.entity.LicensePlateType
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
import
java.sql.SQLException
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
/**
* 违章查询
* 违章查询
* 注意:调用"北京库斯曼科技有限公司"的接口,返回参是Unicode编码
*/
*/
//
@Service
@Service
public
class
TrafficViolationsService
{
public
class
TrafficViolationsService
{
@Value
(
"${juhe.key}"
)
@Autowired
private
String
KEY
;
private
LicensePlateTypeBiz
licensePlateTypeBiz
;
//支持的城市
private
static
final
String
URL_GET_CITY
=
"http://v.juhe.cn/wz/citys?"
+
"province={province}&dtype={dtype}&format={format}&callback={callback}&key={key}"
;
//查违章
private
static
final
String
URL_QUERY_WZ
=
"http://v.juhe.cn/wz/query?"
+
"dtype={dtype}&city={city}&hphm={hphm}&hpzl={hpzl}&engineno={engineno}&classno={classno}&key={key}"
;
//剩余次数
private
static
final
String
URL_BALANCE
=
"http://v.juhe.cn/wz/status?"
+
"dtype={dtype}&key={key}"
;
//根据车牌查城市
private
static
final
String
URL_CAR_PRE
=
"http://v.juhe.cn/wz/carPre?"
+
"hphm={hphm}&key={key}"
;
@Autowired
@Autowired
RestTemplate
restTemplate
;
private
TaskExecutor
taskExecutor
;
@Value
(
"${ALIYUN.CODE}"
)
private
String
CODE
;
@Value
(
"${RETURN.TYPE}"
)
private
String
TYPE
;
/**
* 下列参数,根据使用不同的公司的接口进行修改
*/
private
static
final
String
CITY_HOST
=
"https://weizhang.market.alicloudapi.com"
;
private
static
final
String
CITY_PATH
=
"/wz/province"
;
private
static
final
String
CITY_METHOD
=
"GET"
;
private
static
final
String
VIOLATIONS_HOST
=
"https://weizhang.market.alicloudapi.com"
;
private
static
final
String
VIOLATIONS_PATH
=
"/wz/query"
;
private
static
final
String
VIOLATIONS_METHOD
=
"GET"
;
private
static
final
String
GET_LICENSE_PLATE_TYPE_HOST
=
"https://weizhang.market.alicloudapi.com"
;
private
static
final
String
GET_LICENSE_PLATE_TYPE_PATH
=
"/wz/type"
;
private
static
final
String
GET_LICENSE_PLATE_TYPE_METHOD
=
"GET"
;
private
static
final
String
TYPE_NAME
=
"type"
;
private
static
final
String
PLATENO_NAME
=
"plateno"
;
private
static
final
String
ENGINENO_NAME
=
"engineno"
;
private
static
final
String
FRAMENO_NAME
=
"frameno"
;
private
static
final
String
AUTHORIZATION
=
"Authorization"
;
/**
/**
* 获取支持城市
* 支持查询的城市
* province string N 默认全部,省份简写,如:ZJ、JS
* @return
* dtype string N 返回数据格式:json或xml或jsonp,默认json
* @throws Exception
* format int N 格式选择1或2,默认1
* callback String N 返回格式选择jsonp时,必须传递
* {"resultcode":"101","reason":"error key","result":null,"error_code":10001}
*/
*/
public
JuheResult
<
Map
<
String
,
JuheTrafficViolationsProvinceInfo
>>
getCity
(
String
province
)
{
public
String
getCity
()
throws
Exception
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
headers
=
new
HashMap
<
paramsMap
.
put
(
"key"
,
KEY
);
String
,
String
>();
paramsMap
.
put
(
"province"
,
province
==
null
?
""
:
province
);
headers
.
put
(
AUTHORIZATION
,
"APPCODE "
+
CODE
);
paramsMap
.
put
(
"dtype"
,
"json"
);
Map
<
String
,
String
>
querys
=
new
HashMap
<
String
,
String
>();
paramsMap
.
put
(
"format"
,
""
);
querys
.
put
(
TYPE_NAME
,
TYPE
);
paramsMap
.
put
(
"callback"
,
""
);
HttpResponse
httpResponse
=
CertifHttpUtils
.
doGet
(
CITY_HOST
,
CITY_PATH
,
CITY_METHOD
,
headers
,
querys
);
return
query
(
URL_GET_CITY
,
paramsMap
);
HttpEntity
entity
=
httpResponse
.
getEntity
();
// String result = EntityUtils.toString(entity);
// ArrayList<SearchableCity> searchableCities = JSONObject.parseObject(result, ArrayList.class);
// searchableCities.forEach(searchableCity ->searchableCity.setCreateDate(new Date()) );
// searchableCityBiz.insertSearchableCities(searchableCities);
return
unicodeToString
(
EntityUtils
.
toString
(
entity
));
}
/**s
* 违章车辆查询
* @param trafficViolations
* @return
*/
public
String
queryViolations
(
TrafficViolations
trafficViolations
)
throws
Exception
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
AUTHORIZATION
,
"APPCODE "
+
CODE
);
Map
<
String
,
String
>
querys
=
new
HashMap
<
String
,
String
>();
querys
.
put
(
TYPE_NAME
,
trafficViolations
.
getType
());
querys
.
put
(
PLATENO_NAME
,
trafficViolations
.
getPlateno
());
querys
.
put
(
ENGINENO_NAME
,
trafficViolations
.
getEngineno
());
querys
.
put
(
FRAMENO_NAME
,
trafficViolations
.
getFrameno
());
HttpResponse
httpResponse
=
CertifHttpUtils
.
doGet
(
VIOLATIONS_HOST
,
VIOLATIONS_PATH
,
VIOLATIONS_METHOD
,
headers
,
querys
);
HttpEntity
entity
=
httpResponse
.
getEntity
();
return
unicodeToString
(
EntityUtils
.
toString
(
entity
));
}
}
/**
/**
* 查违章
* 放入bean中
* dtype string 否 返回数据格式:默认:json
* @throws Exception
* city String 是 城市代码 *
* @return
* hphm String 是 号牌号码 完整7位 ,需要utf8 urlencode*
* hpzl String 是 号牌类型,默认02:小型车,01:大型车
* engineno String 否 发动机号 (具体是否需要根据城市接口中的参数填写)
* classno String 否 车架号 (具体是否需要根据城市接口中的参数填写)
*/
*/
public
JuheResult
<
JuheTrafficViolationsInfo
>
queryViolations
(
String
city
,
String
hphm
,
String
hpzl
,
public
ArrayList
<
LicensePlateType
>
saveLicensePlateType
()
throws
Exception
{
String
engineno
,
String
classno
)
{
String
result
=
searchaLicensePlateType
();
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
result
))
{
paramsMap
.
put
(
"key"
,
KEY
);
throw
new
BaseException
(
"错误! 查询不到车辆类型"
);
paramsMap
.
put
(
"dtype"
,
"json"
);
}
paramsMap
.
put
(
"city"
,
city
);
Map
<
String
,
Object
>
resultMap
=
JSONObject
.
parseObject
(
result
,
Map
.
class
);
paramsMap
.
put
(
"hphm"
,
hphm
);
Integer
status
=
(
Integer
)
resultMap
.
get
(
"status"
);
paramsMap
.
put
(
"hpzl"
,
hpzl
);
Map
<
String
,
String
>
licensePlateTypeMap
=
(
Map
<
String
,
String
>)
resultMap
.
get
(
"result"
);
paramsMap
.
put
(
"engineno"
,
engineno
);
if
(
status
!=
200
||
licensePlateTypeMap
==
null
)
{
paramsMap
.
put
(
"classno"
,
classno
);
throw
new
BaseException
(
"错误! 查询不到车辆类型"
);
return
query
(
URL_QUERY_WZ
,
paramsMap
);
}
ArrayList
<
LicensePlateType
>
licensePlateTypes
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
String
>
licensePlateTypeEntry
:
licensePlateTypeMap
.
entrySet
())
{
licensePlateTypes
.
add
(
new
LicensePlateType
(
licensePlateTypeEntry
.
getKey
(),
licensePlateTypeEntry
.
getValue
()));
}
return
licensePlateTypes
;
}
}
/**
/**
* 查询剩余次数
* Unicode转汉字字符串(根据接口返回编码的类型使用)
* @param str
* @return
*/
*/
public
JuheResult
<
JuheTrafficViolationsBalanceInfo
>
queryBalance
()
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
private
String
unicodeToString
(
String
str
)
{
paramsMap
.
put
(
"key"
,
KEY
);
paramsMap
.
put
(
"dtype"
,
"json"
);
Pattern
pattern
=
Pattern
.
compile
(
"(\\\\u(\\p{XDigit}{4}))"
);
return
query
(
URL_BALANCE
,
paramsMap
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
char
ch
;
while
(
matcher
.
find
())
{
String
group
=
matcher
.
group
(
2
);
ch
=
(
char
)
Integer
.
parseInt
(
group
,
16
);
String
group1
=
matcher
.
group
(
1
);
str
=
str
.
replace
(
group1
,
ch
+
""
);
}
return
str
;
}
}
/**
/**
* 根据车牌前缀查城市参数
* 调用接口获取车辆车牌和代码
* @return
* @throws Exception
*/
*/
public
JuheResult
<
JuheCarPreInfo
>
queryCityByHphm
(
String
hphm
)
{
public
String
searchaLicensePlateType
()
throws
Exception
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
paramsMap
.
put
(
"key"
,
KEY
);
headers
.
put
(
AUTHORIZATION
,
"APPCODE "
+
CODE
);
paramsMap
.
put
(
"hphm"
,
hphm
);
HashMap
<
String
,
String
>
querys
=
new
HashMap
<>();
return
query
(
URL_CAR_PRE
,
paramsMap
);
HttpResponse
httpResponse
=
CertifHttpUtils
.
doGet
(
GET_LICENSE_PLATE_TYPE_HOST
,
GET_LICENSE_PLATE_TYPE_PATH
,
GET_LICENSE_PLATE_TYPE_METHOD
,
headers
,
querys
);
HttpEntity
entity
=
httpResponse
.
getEntity
();
return
unicodeToString
(
EntityUtils
.
toString
(
entity
));
}
}
private
JuheResult
query
(
String
url
,
Map
<
String
,
String
>
paramsMap
)
{
/**
try
{
* 查询对应的车牌和车牌代码
String
responseStr
=
restTemplate
.
getForObject
(
url
,
String
.
class
,
paramsMap
);
* @return
return
JSON
.
parseObject
(
responseStr
,
JuheResult
.
class
);
* @throws Exception
}
catch
(
RestClientException
ex
)
{
*/
JuheResult
result
=
new
JuheResult
();
public
List
<
LicensePlateType
>
getLicensePlateType
()
throws
Exception
{
result
.
setReason
(
"请求错误"
);
List
<
LicensePlateType
>
licensePlateTypes
=
licensePlateTypeBiz
.
selectListAll
();
result
.
setResultcode
(
"500"
);
if
(
CollectionUtils
.
isEmpty
(
licensePlateTypes
))
{
return
result
;
licensePlateTypes
=
saveLicensePlateType
();
List
<
LicensePlateType
>
finalLicensePlateTypes
=
licensePlateTypes
;
taskExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
insertLicensePlateType
(
finalLicensePlateTypes
);
}
});
}
}
return
licensePlateTypes
;
}
}
/**
* 定时修改车牌类型
* @throws SQLException
*/
@Scheduled
(
cron
=
"0 0 0 0/7 * ?"
)
private
void
updateLicensePlateType
()
throws
SQLException
{
List
<
LicensePlateType
>
licensePlateTypes
=
licensePlateTypeBiz
.
selectListAll
();
licensePlateTypeBiz
.
updateLicensePlateType
(
licensePlateTypes
);
}
private
void
insertLicensePlateType
(
List
<
LicensePlateType
>
finalLicensePlateTypes
){
licensePlateTypeBiz
.
insertLicensePlateType
(
finalLicensePlateTypes
);
}
}
}
xx-universal/xx-universal-server/src/main/resources/application.properties
View file @
81a14283
#\u8BA4\u8BC1\u63A5\u53E3\u9700\u8981\u643A\u5E26\u7684\u53C2\u6570
#\u8BA4\u8BC1\u63A5\u53E3\u9700\u8981\u643A\u5E26\u7684\u53C2\u6570
#A-\u8BA4\u8BC1
#A\u8BA4\u8BC1
certif.cHost
=
https://idcert.market.alicloudapi.com
certif.cHost
=
https://idcert.market.alicloudapi.com
certif.cPath
=
/idcard
certif.cPath
=
/idcard
certif.cMethod
=
GET
certif.cMethod
=
GET
certif.cAppcode
=
acea1c8811f748b3a65815f11db357c4
certif.cAppcode
=
acea1c8811f748b3a65815f11db357c4
#1.\u8BF7\u6C42
#1.\u8BF7\u6C42
#\u8EAB\u4EFD\u8BC1\u53F7\u5B57\u6BB5\u540D\u79F0
#\u8EAB\u4EFD\u8BC1\u53F7\u5B57\u6BB5\u540D\u79F0
certif.idCardName
=
idCard
certif.idCardName
=
idCard
#\u59D3\u540D\u5B57\u6BB5\u540D\u79F0
#\u59D3\u540D\u5B57\u6BB5\u540D\u79F0
certif.cName
=
name
certif.cName
=
name
#2.\u54CD\u5E94
#2.\u54CD\u5E94
#\u9519\u8BEF\u7801\u5B57\u6BB5\u540D
#\u9519\u8BEF\u7801\u5B57\u6BB5\u540D
certif.certifRet
=
status
certif.certifRet
=
status
#\u8BA4\u8BC1\u6210\u529F\u7801
#\u8BA4\u8BC1\u6210\u529F\u7801
certif.certifResultCode
=
01
certif.certifResultCode
=
01
#B-\u56FE\u7247\u89E3\u6790
#B\u56FE\u7247\u89E3\u6790
certif.iHost
=
https://ocridcard.market.alicloudapi.com
certif.iHost
=
https://ocridcard.market.alicloudapi.com
certif.iPath
=
/idimages
certif.iPath
=
/idimages
certif.iMethod
=
POST
certif.iMethod
=
POST
certif.iAppcode
=
acea1c8811f748b3a65815f11db357c4
certif.iAppcode
=
acea1c8811f748b3a65815f11db357c4
#1.\u8BF7\u6C42
#1.\u8BF7\u6C42
#\u56FE\u7247url\u5B57\u6BB5\u540D
#\u56FE\u7247url\u5B57\u6BB5\u540D
certif.picName
=
image
certif.picName
=
image
...
@@ -34,7 +28,6 @@ certif.typeName=idCardSide
...
@@ -34,7 +28,6 @@ certif.typeName=idCardSide
certif.frontParameter
=
front
certif.frontParameter
=
front
#\u56FE\u7247\u80CC\u9762\u6807\u8BC6\u53C2\u6570
#\u56FE\u7247\u80CC\u9762\u6807\u8BC6\u53C2\u6570
certif.backParameter
=
back
certif.backParameter
=
back
#2.\u54CD\u5E94
#2.\u54CD\u5E94
#\u56FE\u7247\u89E3\u6790\u54CD\u5E94\u643A\u5E26\u9519\u8BEF\u7801\u5B57\u6BB5\u540D
#\u56FE\u7247\u89E3\u6790\u54CD\u5E94\u643A\u5E26\u9519\u8BEF\u7801\u5B57\u6BB5\u540D
certif.imageRet
=
code
certif.imageRet
=
code
...
@@ -48,3 +41,9 @@ certif.numberName=code
...
@@ -48,3 +41,9 @@ certif.numberName=code
certif.iName
=
name
certif.iName
=
name
#\u8EAB\u4EFD\u8BC1\u5230\u671F\u65F6\u95F4\u5B57\u6BB5\u540D
#\u8EAB\u4EFD\u8BC1\u5230\u671F\u65F6\u95F4\u5B57\u6BB5\u540D
certif.expirationDateName
=
expiryDate
certif.expirationDateName
=
expiryDate
#C-\u8FDD\u7AE0\u8F66\u8F86\u67E5\u8BE2
#\u63A5\u53E3appcode
ALIYUN.CODE
=
acea1c8811f748b3a65815f11db357c4
#\u8FD4\u56DE\u53C2\u6570\u7C7B\u578B(HTML/JSON/JSONP/XML)
RETURN.TYPE
=
JSON
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
81a14283
...
@@ -135,9 +135,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
...
@@ -135,9 +135,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
return
new
ResponseEntity
<
byte
[]>(
FileUtils
.
readFileToByteArray
(
file
),
headers
,
HttpStatus
.
CREATED
);
return
new
ResponseEntity
<
byte
[]>(
FileUtils
.
readFileToByteArray
(
file
),
headers
,
HttpStatus
.
CREATED
);
}
}
@Cache
(
key
=
"vehical"
)
//
@Cache(key = "vehical")
public
Vehicle
get
(
String
id
){
public
Vehicle
get
(
String
id
){
return
mapper
.
selectByPrimaryKey
(
id
);
Vehicle
vehicle
=
mapper
.
selectByPrimaryKey
(
id
);
return
vehicle
;
}
}
/**
/**
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/AccompanyingItemController.java
View file @
81a14283
...
@@ -13,33 +13,39 @@ import com.xxfc.platform.vehicle.pojo.AddOrUpdateAccompanyingItem;
...
@@ -13,33 +13,39 @@ import com.xxfc.platform.vehicle.pojo.AddOrUpdateAccompanyingItem;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.pojo.QueryAccompanyItemVo
;
import
com.xxfc.platform.vehicle.pojo.QueryAccompanyItemVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.List
;
/**
* @author Administrator
*/
@RestController
@RestController
@RequestMapping
(
"/accompanyingItem"
)
@RequestMapping
(
"/accompanyingItem"
)
@IgnoreClientToken
@IgnoreClientToken
@Slf4j
@Slf4j
public
class
AccompanyingItemController
extends
BaseController
<
AccompanyingItemBiz
>
{
public
class
AccompanyingItemController
extends
BaseController
<
AccompanyingItemBiz
>
{
@Autowired
AccompanyingItemBiz
accompanyingItemBiz
;
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
/**
private
RestResponse
<
AccompanyingItem
>
get
(
@PathVariable
Integer
id
)
throws
Exception
{
*
* @param id
* @return
* @throws Exception
*/
@GetMapping
(
value
=
"/{id}"
)
public
RestResponse
<
AccompanyingItem
>
get
(
@PathVariable
Integer
id
)
throws
Exception
{
return
RestResponse
.
codeAndData
(
RestResponse
.
SUC_CODE
,
baseBiz
.
get
(
id
));
return
RestResponse
.
codeAndData
(
RestResponse
.
SUC_CODE
,
baseBiz
.
get
(
id
));
}
}
@RequestMapping
(
value
=
"/all"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/all"
,
method
=
RequestMethod
.
GET
)
p
rivate
RestResponse
<
List
<
AccompanyingItem
>>
getAll
(){
p
ublic
RestResponse
<
List
<
AccompanyingItem
>>
getAll
(){
return
RestResponse
.
codeAndData
(
RestResponse
.
SUC_CODE
,
accompanyingItem
Biz
.
getAll
());
return
RestResponse
.
codeAndData
(
RestResponse
.
SUC_CODE
,
base
Biz
.
getAll
());
}
}
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
p
rivate
RestResponse
<
PageDataVO
<
AccompanyingItem
>>
getByPage
(
@RequestParam
String
queryAccompanyItemVoJson
)
throws
Exception
{
p
ublic
RestResponse
<
PageDataVO
<
AccompanyingItem
>>
getByPage
(
@RequestParam
String
queryAccompanyItemVoJson
)
throws
Exception
{
QueryAccompanyItemVo
queryAccompanyItemVo
=
null
;
QueryAccompanyItemVo
queryAccompanyItemVo
=
null
;
try
{
try
{
queryAccompanyItemVo
=
JSON
.
parseObject
(
queryAccompanyItemVoJson
,
QueryAccompanyItemVo
.
class
);
queryAccompanyItemVo
=
JSON
.
parseObject
(
queryAccompanyItemVoJson
,
QueryAccompanyItemVo
.
class
);
...
@@ -52,17 +58,17 @@ public class AccompanyingItemController extends BaseController<AccompanyingItemB
...
@@ -52,17 +58,17 @@ public class AccompanyingItemController extends BaseController<AccompanyingItemB
}
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
p
rivate
RestResponse
<
Integer
>
add
(
@RequestBody
AddOrUpdateAccompanyingItem
addOrUpdateAccompanyingItem
)
throws
Exception
{
p
ublic
RestResponse
<
Integer
>
add
(
@RequestBody
AddOrUpdateAccompanyingItem
addOrUpdateAccompanyingItem
)
throws
Exception
{
return
baseBiz
.
add
(
addOrUpdateAccompanyingItem
);
return
baseBiz
.
add
(
addOrUpdateAccompanyingItem
);
}
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
PUT
)
p
rivate
RestResponse
<
Integer
>
update
(
@RequestBody
AddOrUpdateAccompanyingItem
addOrUpdateAccompanyingItem
)
throws
Exception
{
p
ublic
RestResponse
<
Integer
>
update
(
@RequestBody
AddOrUpdateAccompanyingItem
addOrUpdateAccompanyingItem
)
throws
Exception
{
return
baseBiz
.
update
(
addOrUpdateAccompanyingItem
);
return
baseBiz
.
update
(
addOrUpdateAccompanyingItem
);
}
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
p
rivate
RestResponse
<
Integer
>
del
(
@PathVariable
Integer
id
)
throws
Exception
{
p
ublic
RestResponse
<
Integer
>
del
(
@PathVariable
Integer
id
)
throws
Exception
{
return
baseBiz
.
del
(
id
);
return
baseBiz
.
del
(
id
);
}
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/AreaController.java
View file @
81a14283
...
@@ -12,12 +12,18 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -12,12 +12,18 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.List
;
import
java.util.List
;
/**
* 片区
*/
@RestController
@RestController
@RequestMapping
(
"/area"
)
@RequestMapping
(
"/area"
)
@Slf4j
@Slf4j
@IgnoreClientToken
@IgnoreClientToken
public
class
AreaController
extends
BaseController
<
AreaBiz
,
Area
>
{
public
class
AreaController
extends
BaseController
<
AreaBiz
,
Area
>
{
/**
* 获取所有片区
* @return
*/
@GetMapping
(
"/findAll"
)
@GetMapping
(
"/findAll"
)
public
RestResponse
<
List
<
Area
>>
findAll
(){
public
RestResponse
<
List
<
Area
>>
findAll
(){
return
RestResponse
.
suc
(
baseBiz
.
selectListAll
());
return
RestResponse
.
suc
(
baseBiz
.
selectListAll
());
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
81a14283
...
@@ -24,15 +24,14 @@
...
@@ -24,15 +24,14 @@
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
</if>
</if>
from branch_company
from branch_company
<trim
prefix=
"where"
suffixOverrides=
"and"
>
<where>
<if
test=
"addrCity != null"
>
<if
test=
"addrCity != null"
>
addr_city = #{addrCity}
and addr_city = #{addrCity}
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
longitude is not null and latitude is not null
and longitude is not null and latitude is not null
</if>
</if>
</trim>
</where>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
order by distance asc
order by distance asc
</if>
</if>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/LicensePlateType.xml
0 → 100644
View file @
81a14283
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.universal.mapper.LicensePlateTypeMapper"
>
<insert
id=
"insertLicensePlateType"
parameterType=
"List"
>
insert into license_plate_type (code,type,create_date,update_date) values
<foreach
collection=
"licensePlateTypes"
item=
"lpt"
index=
"index"
separator=
","
>
(#{lpt.code},#{lpt.createDate},#{lpt.updateDate})
</foreach>
</insert>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
81a14283
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
left join
left join
vehicle_book_info vbi on v.`id` = vbi.vehicle
vehicle_book_info vbi on v.`id` = vbi.vehicle
</if>
</if>
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
58 left join branch_company bc on v.`subordinate_branch` = bc.id
LEFT JOIN branch_company bc ON v.park_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
LEFT JOIN branch_company bc1 ON v.expect_destination_branch_company_id = bc1.id
where
where
v.is_del=0
v.is_del=0
...
@@ -333,7 +333,8 @@
...
@@ -333,7 +333,8 @@
</if>
</if>
<include
refid=
"searchUsableSql"
/>
<include
refid=
"searchUsableSql"
/>
and vm.id is not null
and bc.id is not null
GROUP BY model_id, company_id
GROUP BY model_id, company_id
<if
test=
"lon != null and lat != null"
>
, distance
</if>
<if
test=
"lon != null and lat != null"
>
, distance
</if>
...
...
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/RegionTest.java
View file @
81a14283
...
@@ -13,6 +13,8 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -13,6 +13,8 @@ import com.alibaba.fastjson.JSONObject;
import
com.github.stuxuhai.jpinyin.PinyinHelper
;
import
com.github.stuxuhai.jpinyin.PinyinHelper
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.google.common.collect.Sets
;
import
com.mysql.cj.conf.RuntimeProperty
;
import
com.xxfc.platform.vehicle.VehicleApplication
;
import
com.xxfc.platform.vehicle.VehicleApplication
;
import
com.xxfc.platform.vehicle.biz.SysRegionBiz
;
import
com.xxfc.platform.vehicle.biz.SysRegionBiz
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
...
@@ -29,9 +31,8 @@ import org.springframework.boot.test.context.SpringBootTest;
...
@@ -29,9 +31,8 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.ArrayList
;
import
java.io.PrintStream
;
import
java.util.HashMap
;
import
java.util.*
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
={
VehicleApplication
.
class
})
@SpringBootTest
(
classes
={
VehicleApplication
.
class
})
...
@@ -59,6 +60,8 @@ public class RegionTest {
...
@@ -59,6 +60,8 @@ public class RegionTest {
public
class
NewData
{
public
class
NewData
{
Long
id
;
Long
id
;
String
name
;
String
name
;
String
lat
;
String
lon
;
}
}
@Data
@Data
...
@@ -131,34 +134,61 @@ public class RegionTest {
...
@@ -131,34 +134,61 @@ public class RegionTest {
System
.
out
.
println
(
"test"
);
System
.
out
.
println
(
"test"
);
}
}
@Test
// @Test
public
void
test1
()
{
// public void test1() {
int
i
=
DateTime
.
now
().
getMinuteOfDay
()
/
5
;
// int i = DateTime.now().getMinuteOfDay() / 5;
System
.
out
.
println
(
"DateTime.now().getMinuteOfDay() / 5++++++++++++"
+
i
);
// System.out.println("DateTime.now().getMinuteOfDay() / 5++++++++++++"+i);
String
redisLockKey
=
RedisKey
.
SYS_REGION_REFRESH_LOCK
+
i
;
//同一日每5分钟只刷新一次
// String redisLockKey = RedisKey.SYS_REGION_REFRESH_LOCK +i;//同一日每5分钟只刷新一次
System
.
out
.
println
(
"redisLockKey++++++++++++++++"
+
redisLockKey
);
// System.out.println("redisLockKey++++++++++++++++"+redisLockKey);
String
s
=
String
.
valueOf
(
DateTime
.
now
().
getMillis
());
// String s = String.valueOf(DateTime.now().getMillis());
System
.
out
.
println
(
"s++++++++++++++++++"
+
s
);
// System.out.println("s++++++++++++++++++"+s);
Boolean
suc
=
customRedisTemplate
.
opsForValue
().
setIfAbsent
(
redisLockKey
,
s
);
// Boolean suc = customRedisTemplate.opsForValue().setIfAbsent(redisLockKey, s);
Boolean
test1
=
customRedisTemplate
.
opsForValue
().
setIfAbsent
(
"1"
,
"2"
);
// Boolean test1 = customRedisTemplate.opsForValue().setIfAbsent("1", "2");
Boolean
test2
=
customRedisTemplate
.
opsForValue
().
setIfAbsent
(
"1"
,
"3"
);
// Boolean test2 = customRedisTemplate.opsForValue().setIfAbsent("1", "3");
System
.
out
.
println
(
"test1///////////////////////////////"
+
test1
);
// System.out.println("test1///////////////////////////////"+test1);
System
.
out
.
println
(
"test2///////////////////////////////"
+
test2
);
// System.out.println("test2///////////////////////////////"+test2);
System
.
out
.
println
(
"suc++++++++++++++++++++"
+
suc
);
// System.out.println("suc++++++++++++++++++++"+suc);
}
// }
//
// @Test
// public void testRedis() {
// SysRegion sysRegion = getSysRegion(1);
// System.out.println("sysRegion+++++++++"+sysRegion);
// System.out.println("TEST_REDIS_KEY+++++++++++" + TEST_REDIS_KEY);
// }
//
// @Cache(key = TEST_REDIS_KEY)
// private SysRegion getSysRegion(int id){
// SysRegion sysRegion = sysRegionBiz.selectById(2);
// return sysRegion;
// }
@Test
public
void
testRedis
()
{
SysRegion
sysRegion
=
getSysRegion
(
1
);
System
.
out
.
println
(
"sysRegion+++++++++"
+
sysRegion
);
System
.
out
.
println
(
"TEST_REDIS_KEY+++++++++++"
+
TEST_REDIS_KEY
);
}
@Cache
(
key
=
TEST_REDIS_KEY
)
@Test
private
SysRegion
getSysRegion
(
int
id
){
public
void
testStream
(){
SysRegion
sysRegion
=
sysRegionBiz
.
selectById
(
2
);
List
<
Integer
>
integers
=
Arrays
.
asList
(
1
,
3
,
5
,
7
,
9
,
9
);
return
sysRegion
;
HashSet
<
Integer
>
objects
=
new
HashSet
<>();
}
objects
.
addAll
(
integers
);
System
.
out
.
println
(
objects
);
System
.
out
.
println
(
"获取最小值"
);
Optional
<
Integer
>
min
=
objects
.
parallelStream
().
min
(
Integer:
:
compareTo
);
if
(
min
.
isPresent
())
{
System
.
out
.
println
(
min
.
get
());
}
System
.
out
.
println
(
"获取最大"
);
Optional
<
Integer
>
max
=
integers
.
parallelStream
().
max
(
Integer:
:
compareTo
);
if
(
max
.
isPresent
())
{
System
.
out
.
println
(
max
.
get
());
}
System
.
out
.
println
(
"排序"
);
integers
.
stream
().
sorted
().
forEach
(
elem
->
System
.
out
.
println
(
elem
));
System
.
out
.
println
(
"筛选"
);
integers
.
parallelStream
().
filter
(
e
->
e
>
1
).
filter
(
e
->
e
<
9
).
forEach
(
e
->
System
.
out
.
println
(
e
));
System
.
out
.
println
(
"list的总和为"
);
integers
.
stream
().
reduce
((
a
,
b
)
->
a
+
b
).
ifPresent
(
System
.
out
::
println
);
}
}
}
xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/TimeTest.java
View file @
81a14283
...
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,4 +32,38 @@ public class TimeTest {
...
@@ -31,4 +32,38 @@ public class TimeTest {
DateTime
startDay
=
DateTime
.
parse
(
"2019-06-04"
,
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
startDay
=
DateTime
.
parse
(
"2019-06-04"
,
DEFAULT_DATE_TIME_FORMATTER
);
System
.
out
.
println
(
"test"
);
System
.
out
.
println
(
"test"
);
}
}
@Test
public
void
testStream
()
throws
Exception
{
ArrayList
<
Student
>
students
=
new
ArrayList
<>();
students
.
add
(
new
Student
(
"张1"
,
"11"
));
students
.
add
(
new
Student
(
"张2"
,
"12"
));
students
.
add
(
new
Student
(
"张3"
,
"13"
));
students
.
add
(
new
Student
(
"张4"
,
"14"
));
students
.
add
(
new
Student
(
"张5"
,
"15"
));
int
i
=
0
;
students
.
forEach
(
student
->
student
.
setCode
(
1
));
students
.
forEach
(
System
.
out
::
println
);
}
}
@Data
class
Student
implements
Serializable
{
private
String
name
;
private
String
age
;
private
int
code
;
public
Student
(
String
name
,
String
age
,
int
code
)
{
this
.
name
=
name
;
this
.
age
=
age
;
this
.
code
=
code
;
}
public
Student
(
String
name
,
String
age
)
{
this
.
name
=
name
;
this
.
age
=
age
;
}
}
}
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