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
40689640
Commit
40689640
authored
Sep 27, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品,公司相关
parent
22eec2e9
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
280 additions
and
14 deletions
+280
-14
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+15
-5
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+4
-0
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+2
-0
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+6
-0
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+10
-0
JwtAuthenticationChwRequest.java
.../security/auth/util/user/JwtAuthenticationChwRequest.java
+46
-0
RequestTypeConstants.java
...xiaoqi/security/common/constant/RequestTypeConstants.java
+2
-0
UserRest.java
.../java/com/github/wxiaoqi/security/admin/rpc/UserRest.java
+1
-1
PermissionService.java
...wxiaoqi/security/admin/rpc/service/PermissionService.java
+17
-0
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+5
-0
CompanySearchOldDTO.java
...a/com/xxfc/platform/vehicle/pojo/CompanySearchOldDTO.java
+15
-0
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+6
-4
BranchCompanyMapper.java
...com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
+1
-0
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+8
-4
PublicController.java
...java/com/xxfc/platform/vehicle/rest/PublicController.java
+83
-0
BgVehicleBrandController.java
...platform/vehicle/rest/admin/BgVehicleBrandController.java
+13
-0
BgVehicleCategoryController.java
...tform/vehicle/rest/admin/BgVehicleCategoryController.java
+18
-0
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+28
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
40689640
package
com
.
github
.
wxiaoqi
.
security
.
auth
.
controller
;
package
com
.
github
.
wxiaoqi
.
security
.
auth
.
controller
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.service.AuthService
;
import
com.github.wxiaoqi.security.auth.service.AuthService
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationChwRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
@@ -17,6 +19,9 @@ import org.springframework.web.bind.annotation.*;
...
@@ -17,6 +19,9 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
RequestTypeConstants
.
BUSINESS
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
RequestTypeConstants
.
OPERATE
;
@Api
(
tags
=
"用户登录"
)
@Api
(
tags
=
"用户登录"
)
@RestController
@RestController
@RequestMapping
(
"jwt"
)
@RequestMapping
(
"jwt"
)
...
@@ -54,7 +59,7 @@ public class AuthController {
...
@@ -54,7 +59,7 @@ public class AuthController {
@RequestMapping
(
value
=
"/chw/token"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/chw/token"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
String
>
chwCreateAuthenticationToken
(
public
ObjectRestResponse
<
String
>
chwCreateAuthenticationToken
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
,
@RequestBody
JwtAuthentication
Chw
Request
authenticationRequest
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
log
.
info
(
authenticationRequest
.
getUsername
()+
" require logging..."
);
log
.
info
(
authenticationRequest
.
getUsername
()+
" require logging..."
);
// keliii 分请求类型处理token
// keliii 分请求类型处理token
...
@@ -63,10 +68,15 @@ public class AuthController {
...
@@ -63,10 +68,15 @@ public class AuthController {
requestType
=
RequestTypeConstants
.
BASE
;
requestType
=
RequestTypeConstants
.
BASE
;
}
}
final
String
token
;
final
String
token
;
if
(
RequestTypeConstants
.
APP
.
equals
(
requestType
))
{
if
(
StrUtil
.
isNotBlank
(
requestType
))
{
token
=
appAuthService
.
login
(
authenticationRequest
);
if
(
OPERATE
.
equals
(
requestType
))
{
}
else
{
authenticationRequest
.
setBizType
(
1
);
token
=
authService
.
login
(
authenticationRequest
);
}
else
if
(
BUSINESS
.
equals
(
requestType
))
{
authenticationRequest
.
setBizType
(
2
);
}
token
=
authService
.
loginChw
(
authenticationRequest
);
}
else
{
token
=
""
;
}
}
return
new
ObjectRestResponse
<
String
>().
data
(
token
);
return
new
ObjectRestResponse
<
String
>().
data
(
token
);
}
}
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
40689640
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.github.wxiaoqi.security.api.vo.user.AppUserInfo
;
import
com.github.wxiaoqi.security.api.vo.user.AppUserInfo
;
import
com.github.wxiaoqi.security.api.vo.user.UserInfo
;
import
com.github.wxiaoqi.security.api.vo.user.UserInfo
;
import
com.github.wxiaoqi.security.auth.configuration.FeignConfiguration
;
import
com.github.wxiaoqi.security.auth.configuration.FeignConfiguration
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationChwRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -22,6 +23,9 @@ public interface IUserService {
...
@@ -22,6 +23,9 @@ public interface IUserService {
@RequestMapping
(
value
=
"/api/user/validate"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/user/validate"
,
method
=
RequestMethod
.
POST
)
public
UserInfo
validate
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
public
UserInfo
validate
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
@RequestMapping
(
value
=
"/api/user/chw/validate"
,
method
=
RequestMethod
.
POST
)
public
UserInfo
validateChw
(
@RequestBody
JwtAuthenticationChwRequest
authenticationRequest
);
@RequestMapping
(
value
=
"/api/user/validate/small"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/user/validate/small"
,
method
=
RequestMethod
.
POST
)
public
UserInfo
validateSmall
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
public
UserInfo
validateSmall
(
@RequestBody
JwtAuthenticationRequest
authenticationRequest
);
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
40689640
...
@@ -2,11 +2,13 @@ package com.github.wxiaoqi.security.auth.service;
...
@@ -2,11 +2,13 @@ package com.github.wxiaoqi.security.auth.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationChwRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
public
interface
AuthService
{
public
interface
AuthService
{
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
String
login
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
String
loginChw
(
JwtAuthenticationChwRequest
authenticationRequest
)
throws
Exception
;
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
;
String
refresh
(
String
oldToken
)
throws
Exception
;
String
refresh
(
String
oldToken
)
throws
Exception
;
void
validate
(
String
token
)
throws
Exception
;
void
validate
(
String
token
)
throws
Exception
;
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
40689640
...
@@ -7,6 +7,7 @@ import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
...
@@ -7,6 +7,7 @@ import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
import
com.github.wxiaoqi.security.auth.common.util.jwt.JWTInfo
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.JWTInfo
;
import
com.github.wxiaoqi.security.auth.feign.IUserService
;
import
com.github.wxiaoqi.security.auth.feign.IUserService
;
import
com.github.wxiaoqi.security.auth.service.AuthService
;
import
com.github.wxiaoqi.security.auth.service.AuthService
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationChwRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtTokenUtil
;
import
com.github.wxiaoqi.security.auth.util.user.JwtTokenUtil
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
...
@@ -42,6 +43,11 @@ public class AppAuthServiceImpl implements AuthService {
...
@@ -42,6 +43,11 @@ public class AppAuthServiceImpl implements AuthService {
throw
new
UserInvalidException
(
"用户不存在或账户密码错误!"
);
throw
new
UserInvalidException
(
"用户不存在或账户密码错误!"
);
}
}
@Override
public
String
loginChw
(
JwtAuthenticationChwRequest
authenticationRequest
)
throws
Exception
{
return
null
;
}
@Override
@Override
public
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
{
public
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
{
UserInfo
info
=
userService
.
validateSmall
(
authenticationRequest
);
UserInfo
info
=
userService
.
validateSmall
(
authenticationRequest
);
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
40689640
...
@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
...
@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
import
com.github.wxiaoqi.security.auth.common.util.jwt.JWTInfo
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.JWTInfo
;
import
com.github.wxiaoqi.security.auth.feign.IUserService
;
import
com.github.wxiaoqi.security.auth.feign.IUserService
;
import
com.github.wxiaoqi.security.auth.service.AuthService
;
import
com.github.wxiaoqi.security.auth.service.AuthService
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationChwRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest
;
import
com.github.wxiaoqi.security.auth.util.user.JwtTokenUtil
;
import
com.github.wxiaoqi.security.auth.util.user.JwtTokenUtil
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
import
com.github.wxiaoqi.security.common.constant.RequestTypeConstants
;
...
@@ -41,6 +42,15 @@ public class AuthServiceImpl implements AuthService {
...
@@ -41,6 +42,15 @@ public class AuthServiceImpl implements AuthService {
throw
new
UserInvalidException
(
"用户不存在或账户密码错误!"
);
throw
new
UserInvalidException
(
"用户不存在或账户密码错误!"
);
}
}
@Override
public
String
loginChw
(
JwtAuthenticationChwRequest
authenticationRequest
)
throws
Exception
{
UserInfo
info
=
userService
.
validateChw
(
authenticationRequest
);
if
(!
StringUtils
.
isEmpty
(
info
.
getId
()))
{
return
jwtTokenUtil
.
generateToken
(
new
JWTInfo
(
info
.
getUsername
(),
info
.
getId
()
+
""
,
info
.
getName
()));
}
throw
new
UserInvalidException
(
"用户不存在或账户密码错误!"
);
}
@Override
@Override
public
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
{
public
ObjectRestResponse
loginSmall
(
JwtAuthenticationRequest
authenticationRequest
)
throws
Exception
{
UserInfo
info
=
userService
.
validateSmall
(
authenticationRequest
);
UserInfo
info
=
userService
.
validateSmall
(
authenticationRequest
);
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/util/user/JwtAuthenticationChwRequest.java
0 → 100644
View file @
40689640
package
com
.
github
.
wxiaoqi
.
security
.
auth
.
util
.
user
;
import
java.io.Serializable
;
public
class
JwtAuthenticationChwRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8445943548965154778L
;
private
String
username
;
private
String
password
;
private
Integer
bizType
;
public
JwtAuthenticationChwRequest
(
String
username
,
String
password
,
Integer
bizType
)
{
this
.
username
=
username
;
this
.
password
=
password
;
this
.
bizType
=
bizType
;
}
public
JwtAuthenticationChwRequest
()
{
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
Integer
getBizType
()
{
return
bizType
;
}
public
void
setBizType
(
Integer
bizType
)
{
this
.
bizType
=
bizType
;
}
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/RequestTypeConstants.java
View file @
40689640
...
@@ -10,5 +10,7 @@ public class RequestTypeConstants {
...
@@ -10,5 +10,7 @@ public class RequestTypeConstants {
public
static
final
String
BASE
=
"BASE"
;
public
static
final
String
BASE
=
"BASE"
;
public
static
final
String
APP
=
"APP"
;
public
static
final
String
APP
=
"APP"
;
public
static
final
String
WX
=
"WX"
;
public
static
final
String
WX
=
"WX"
;
public
static
final
String
OPERATE
=
"OPERATE"
;
public
static
final
String
BUSINESS
=
"BUSINESS"
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/UserRest.java
View file @
40689640
...
@@ -43,7 +43,7 @@ public class UserRest {
...
@@ -43,7 +43,7 @@ public class UserRest {
@RequestMapping
(
value
=
"/user/chw/validate"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/user/chw/validate"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
UserInfo
chwValidate
(
@RequestBody
Map
<
String
,
String
>
body
){
public
@ResponseBody
UserInfo
chwValidate
(
@RequestBody
Map
<
String
,
String
>
body
){
return
permissionService
.
validate
(
body
.
get
(
"username"
),
body
.
get
(
"password"
));
return
permissionService
.
validate
Chw
(
body
.
get
(
"username"
),
body
.
get
(
"password"
),
Integer
.
valueOf
(
body
.
get
(
"bizType"
)
));
}
}
@RequestMapping
(
value
=
"/user/validate/small"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/user/validate/small"
,
method
=
RequestMethod
.
POST
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/PermissionService.java
View file @
40689640
...
@@ -66,6 +66,23 @@ public class PermissionService {
...
@@ -66,6 +66,23 @@ public class PermissionService {
}
}
return
info
;
return
info
;
}
}
public
UserInfo
validateChw
(
String
username
,
String
password
,
Integer
bizType
){
UserInfo
info
=
new
UserInfo
();
//User user = userBiz.getUserByUsername(username);
User
user
=
userBiz
.
selectOne
(
new
User
(){{
setUsername
(
username
);
setBizType
(
bizType
);
}});
if
(
user
!=
null
){
if
(
encoder
.
matches
(
password
,
user
.
getPassword
()))
{
BeanUtils
.
copyProperties
(
user
,
info
);
info
.
setId
(
user
.
getId
().
toString
());
}
}
return
info
;
}
//小程序登录
//小程序登录
public
UserInfo
validateSmall
(
String
username
,
String
password
){
public
UserInfo
validateSmall
(
String
username
,
String
password
){
UserInfo
info
=
new
UserInfo
();
UserInfo
info
=
new
UserInfo
();
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
40689640
...
@@ -92,4 +92,9 @@ public class DictionaryKey {
...
@@ -92,4 +92,9 @@ public class DictionaryKey {
* 取消时间缓冲(分钟)
* 取消时间缓冲(分钟)
*/
*/
public
static
final
String
CANCEL_TIME_BUFFER
=
"CANCEL_TIME_BUFFER"
;
public
static
final
String
CANCEL_TIME_BUFFER
=
"CANCEL_TIME_BUFFER"
;
/**
* 商品类别
*/
public
static
final
String
VEHICLE_GOODS_TYPE
=
"VEHICLE_GOODS_TYPE"
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/CompanySearchOldDTO.java
0 → 100644
View file @
40689640
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
lombok.Data
;
@Data
public
class
CompanySearchOldDTO
{
Integer
page
;
Integer
limit
;
Integer
addrCity
;
String
lon
;
String
lat
;
Integer
state
;
Integer
isShow
=
1
;
Integer
isDel
=
0
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
40689640
...
@@ -24,10 +24,7 @@ import com.xxfc.platform.vehicle.entity.BranchCompany;
...
@@ -24,10 +24,7 @@ import com.xxfc.platform.vehicle.entity.BranchCompany;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyMapper
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyMapper
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVo
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchVO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyListDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyListDTO
;
...
@@ -231,6 +228,11 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
...
@@ -231,6 +228,11 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return
PageDataVO
.
pageInfo
(
branchCompanyPageInfo
);
return
PageDataVO
.
pageInfo
(
branchCompanyPageInfo
);
}
}
public
PageDataVO
<
BranchCompany
>
searchOld
(
CompanySearchOldDTO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPage
(),
vo
.
getLimit
());
PageInfo
<
BranchCompany
>
branchCompanyPageInfo
=
new
PageInfo
<>(
mapper
.
searchOld
(
vo
.
getLon
(),
vo
.
getLat
(),
vo
.
getAddrCity
(),
vo
.
getState
(),
vo
.
getIsShow
(),
vo
.
getIsDel
()));
return
PageDataVO
.
pageInfo
(
branchCompanyPageInfo
);
}
public
List
<
CompanySearchVO
>
getList
(
CompanySearchDTO
vo
){
public
List
<
CompanySearchVO
>
getList
(
CompanySearchDTO
vo
){
return
mapper
.
search
(
vo
);
return
mapper
.
search
(
vo
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
View file @
40689640
...
@@ -15,6 +15,7 @@ import java.util.List;
...
@@ -15,6 +15,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
public
interface
BranchCompanyMapper
extends
Mapper
<
BranchCompany
>,
SelectByIdListMapper
<
BranchCompany
,
Integer
>
{
public
interface
BranchCompanyMapper
extends
Mapper
<
BranchCompany
>,
SelectByIdListMapper
<
BranchCompany
,
Integer
>
{
List
<
BranchCompany
>
searchOld
(
@Param
(
"lon"
)
String
lon
,
@Param
(
"lat"
)
String
lat
,
@Param
(
"addrCity"
)
Integer
addrCity
,
Integer
state
,
Integer
isShow
,
Integer
isDel
);
List
<
CompanySearchVO
>
search
(
CompanySearchDTO
companySearchDTO
);
List
<
CompanySearchVO
>
search
(
CompanySearchDTO
companySearchDTO
);
List
<
BranchCompany
>
selectByZoneId
(
Map
<
String
,
Object
>
param
);
List
<
BranchCompany
>
selectByZoneId
(
Map
<
String
,
Object
>
param
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
40689640
...
@@ -16,10 +16,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
...
@@ -16,10 +16,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.Area
;
import
com.xxfc.platform.vehicle.entity.Area
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVo
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchVO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyAreaDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.BranchCompanyFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo
;
...
@@ -248,4 +245,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
...
@@ -248,4 +245,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return
ObjectRestResponse
.
succ
(
baseBiz
.
getList
(
vo
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
getList
(
vo
));
}
}
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
@IgnoreClientToken
public
RestResponse
<
PageDataVO
<
BranchCompany
>>
search
(
@Validated
CompanySearchOldDTO
vo
)
{
return
RestResponse
.
data
(
baseBiz
.
searchOld
(
vo
));
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/PublicController.java
0 → 100644
View file @
40689640
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.biz.*
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.CustomIllegalParamException
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
com.xxfc.platform.vehicle.rest.admin.BgVehicleCategoryController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
VEHICLE
;
@RestController
@RequestMapping
(
"/public"
)
@Slf4j
@IgnoreClientToken
@Api
(
value
=
"公共controller"
,
tags
={
"公共controller"
})
public
class
PublicController
{
@Autowired
ThirdFeign
thirdFeign
;
@Data
public
static
class
GoodsType
{
private
Integer
id
;
private
String
name
;
}
@ApiOperation
(
"查询所有类别"
)
@IgnoreUserToken
@RequestMapping
(
value
=
"/app/unauth/goodsType/all"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ObjectRestResponse
<
List
<
GoodsType
>>
goodsTypeAll
()
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
String
jsonStr
=
dictionaryMap
.
get
(
VEHICLE
+
"_"
+
DictionaryKey
.
VEHICLE_GOODS_TYPE
).
getDetail
();
return
ObjectRestResponse
.
succ
(
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
jsonStr
),
GoodsType
.
class
));
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/BgVehicleBrandController.java
0 → 100755
View file @
40689640
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.vehicle.biz.VehicleBrandBiz
;
import
com.xxfc.platform.vehicle.entity.VehicleBrand
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"backstage/vehicleBrand"
)
public
class
BgVehicleBrandController
extends
BaseController
<
VehicleBrandBiz
,
VehicleBrand
>
{
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/BgVehicleCategoryController.java
View file @
40689640
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONUtil
;
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.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.biz.VehicleCategoryBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleCategoryBiz
;
import
com.xxfc.platform.vehicle.entity.VehicleCategory
;
import
com.xxfc.platform.vehicle.entity.VehicleCategory
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
VEHICLE
;
@RestController
@RestController
@RequestMapping
(
"admin/vehicleCategory"
)
@RequestMapping
(
"admin/vehicleCategory"
)
public
class
BgVehicleCategoryController
extends
BaseController
<
VehicleCategoryBiz
,
VehicleCategory
>
{
public
class
BgVehicleCategoryController
extends
BaseController
<
VehicleCategoryBiz
,
VehicleCategory
>
{
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
40689640
...
@@ -24,6 +24,34 @@
...
@@ -24,6 +24,34 @@
<result
column=
"state"
property=
"state"
/>
<result
column=
"state"
property=
"state"
/>
</resultMap>
</resultMap>
<select
id=
"searchOld"
resultType=
"com.xxfc.platform.vehicle.pojo.CompanySearchVO"
>
select *
<if
test=
"lon != null and lat != null"
>
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
</if>
from branch_company
<where>
<if
test=
"addrCity != null"
>
and (addr_city = #{addrCity} or addr_province = #{addrCity} or addr_town = #{addrCity})
</if>
<if
test=
"lon != null and lat != null"
>
and longitude is not null and latitude is not null
</if>
<if
test=
"state != null"
>
and state = #{state}
</if>
<if
test=
"isShow != null"
>
and is_show = #{isShow}
</if>
<if
test=
"isDel != null"
>
and is_del = #{isDel}
</if>
</where>
<if
test=
"lon != null and lat != null"
>
order by distance asc
</if>
</select>
<select
id=
"search"
parameterType=
"com.xxfc.platform.vehicle.pojo.CompanySearchDTO"
resultType=
"com.xxfc.platform.vehicle.pojo.CompanySearchVO"
>
<select
id=
"search"
parameterType=
"com.xxfc.platform.vehicle.pojo.CompanySearchDTO"
resultType=
"com.xxfc.platform.vehicle.pojo.CompanySearchVO"
>
select c.*,i.name as companyName
select c.*,i.name as companyName
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
...
...
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