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
21905e88
Commit
21905e88
authored
Sep 29, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-chw' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev-chw
parents
39dcc55e
46fd063a
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
713 additions
and
60 deletions
+713
-60
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
DefaultKeyGenerator.java
...n/java/com/ace/cache/parser/impl/DefaultKeyGenerator.java
+3
-0
RequestTypeConstants.java
...xiaoqi/security/common/constant/RequestTypeConstants.java
+2
-0
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+19
-1
User.java
...n/java/com/github/wxiaoqi/security/admin/entity/User.java
+3
-1
UserRestInterface.java
.../wxiaoqi/security/admin/feign/rest/UserRestInterface.java
+4
-0
CompanyInfoBiz.java
...com/github/wxiaoqi/security/admin/biz/CompanyInfoBiz.java
+2
-0
UserBiz.java
...n/java/com/github/wxiaoqi/security/admin/biz/UserBiz.java
+34
-0
CurrentController.java
...github/wxiaoqi/security/admin/rest/CurrentController.java
+1
-0
ElementController.java
...github/wxiaoqi/security/admin/rest/ElementController.java
+2
-2
MenuController.java
...om/github/wxiaoqi/security/admin/rest/MenuController.java
+4
-2
PublicController.java
.../github/wxiaoqi/security/admin/rest/PublicController.java
+2
-0
ChwUserController.java
...ub/wxiaoqi/security/admin/rest/chw/ChwUserController.java
+87
-7
UserRest.java
.../java/com/github/wxiaoqi/security/admin/rpc/UserRest.java
+1
-1
PermissionService.java
...wxiaoqi/security/admin/rpc/service/PermissionService.java
+21
-0
UserMapper.xml
...odules/ace-admin/src/main/resources/mapper/UserMapper.xml
+1
-0
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+5
-0
VehicleBrand.java
...n/java/com/xxfc/platform/vehicle/entity/VehicleBrand.java
+3
-10
VehicleCata.java
...in/java/com/xxfc/platform/vehicle/entity/VehicleCata.java
+9
-4
VehicleCategory.java
...ava/com/xxfc/platform/vehicle/entity/VehicleCategory.java
+5
-5
VehiclePlatCata.java
...ava/com/xxfc/platform/vehicle/entity/VehiclePlatCata.java
+10
-1
CompanySearchOldDTO.java
...a/com/xxfc/platform/vehicle/pojo/CompanySearchOldDTO.java
+15
-0
VehicleApplication.java
...in/java/com/xxfc/platform/vehicle/VehicleApplication.java
+2
-0
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+6
-4
VehiclePlatCataBiz.java
...ava/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
+16
-7
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
VehicleCataController.java
...com/xxfc/platform/vehicle/rest/VehicleCataController.java
+1
-1
BgVehicleBrandController.java
...platform/vehicle/rest/admin/BgVehicleBrandController.java
+13
-0
BgVehicleCataController.java
.../platform/vehicle/rest/admin/BgVehicleCataController.java
+211
-0
BgVehicleCategoryController.java
...tform/vehicle/rest/admin/BgVehicleCategoryController.java
+26
-3
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+28
-0
VehicleBrandMapper.xml
...e-server/src/main/resources/mapper/VehicleBrandMapper.xml
+1
-2
VehicleCataMapper.xml
...le-server/src/main/resources/mapper/VehicleCataMapper.xml
+1
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
21905e88
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 @
21905e88
...
@@ -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 @
21905e88
...
@@ -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 @
21905e88
...
@@ -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 @
21905e88
...
@@ -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 @
21905e88
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/ace/cache/parser/impl/DefaultKeyGenerator.java
View file @
21905e88
...
@@ -53,6 +53,9 @@ public class DefaultKeyGenerator extends IKeyGenerator {
...
@@ -53,6 +53,9 @@ public class DefaultKeyGenerator extends IKeyGenerator {
if
(
express
.
length
>
1
)
{
if
(
express
.
length
>
1
)
{
String
field
=
express
[
1
];
String
field
=
express
[
1
];
value
=
ReflectionUtils
.
getFieldValue
(
value
,
field
);
value
=
ReflectionUtils
.
getFieldValue
(
value
,
field
);
if
(
value
==
null
||
value
.
equals
(
"null"
))
{
value
=
""
;
}
}
}
if
(
isFirst
)
{
if
(
isFirst
)
{
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/RequestTypeConstants.java
View file @
21905e88
...
@@ -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-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
21905e88
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -56,6 +57,14 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
...
@@ -56,6 +57,14 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return
new
ObjectRestResponse
<
Entity
>();
return
new
ObjectRestResponse
<
Entity
>();
}
}
@ApiOperation
(
"修改"
)
@RequestMapping
(
value
=
"/"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ObjectRestResponse
<
Entity
>
update2
(
@RequestBody
Entity
entity
)
throws
Exception
{
baseBiz
.
updateSelectiveById
(
entity
);
return
new
ObjectRestResponse
<
Entity
>();
}
@ApiOperation
(
"删除"
)
@ApiOperation
(
"删除"
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
@ResponseBody
...
@@ -101,7 +110,16 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
...
@@ -101,7 +110,16 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@RequestMapping
(
value
=
"/del"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/del"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
del
(
Entity
entity
){
public
ObjectRestResponse
del
(
Entity
entity
){
ReflectionUtils
.
setFieldValue
(
entity
,
"isDel"
,
1
);
Field
field
=
ReflectionUtils
.
getAccessibleField
(
entity
,
"isDel"
);
Field
field2
=
ReflectionUtils
.
getAccessibleField
(
entity
,
"delete"
);
if
(
null
!=
field
)
{
ReflectionUtils
.
setFieldValue
(
entity
,
"isDel"
,
1
);
}
if
(
null
!=
field2
)
{
ReflectionUtils
.
setFieldValue
(
entity
,
"delete"
,
1
);
}
baseBiz
.
updateSelectiveById
(
entity
);
baseBiz
.
updateSelectiveById
(
entity
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/User.java
View file @
21905e88
...
@@ -102,6 +102,9 @@ public class User {
...
@@ -102,6 +102,9 @@ public class User {
@Column
(
name
=
"biz_type"
)
@Column
(
name
=
"biz_type"
)
private
Integer
bizType
;
private
Integer
bizType
;
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
private
String
attr1
;
private
String
attr1
;
private
String
attr2
;
private
String
attr2
;
...
@@ -121,5 +124,4 @@ public class User {
...
@@ -121,5 +124,4 @@ public class User {
@Transient
@Transient
private
List
<
Integer
>
companyIds
;
private
List
<
Integer
>
companyIds
;
}
}
\ No newline at end of file
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/rest/UserRestInterface.java
View file @
21905e88
...
@@ -51,6 +51,10 @@ public interface UserRestInterface {
...
@@ -51,6 +51,10 @@ public interface UserRestInterface {
}
}
}
}
default
UserDTO
getAdminUserInfoV2
()
{
return
getAdminUserInfoV2
(
Boolean
.
TRUE
);
}
default
void
checkAdminUser
(){
default
void
checkAdminUser
(){
if
(
null
==
getAdminUserInfo
())
{
if
(
null
==
getAdminUserInfo
())
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/CompanyInfoBiz.java
View file @
21905e88
...
@@ -164,10 +164,12 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
...
@@ -164,10 +164,12 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
String
password
=
username
.
substring
(
5
);
String
password
=
username
.
substring
(
5
);
user
=
new
User
();
user
=
new
User
();
user
.
setUsername
(
username
);
user
.
setUsername
(
username
);
user
.
setMobilePhone
(
username
);
user
.
setName
(
companyInfo
.
getName
());
user
.
setName
(
companyInfo
.
getName
());
user
.
setPassword
(
password
);
user
.
setPassword
(
password
);
user
.
setStatus
(
1
);
user
.
setStatus
(
1
);
user
.
setCorporationId
(
branchId
);
user
.
setCorporationId
(
branchId
);
user
.
setCompanyId
(
companyInfo
.
getId
().
intValue
());
user
.
setDataAll
(
2
);
user
.
setDataAll
(
2
);
user
.
setDataCorporation
(
branchId
+
""
);
user
.
setDataCorporation
(
branchId
+
""
);
user
.
setAppUserId
(
appUserId
);
user
.
setAppUserId
(
appUserId
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBiz.java
View file @
21905e88
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
...
@@ -33,6 +35,8 @@ import java.util.*;
...
@@ -33,6 +35,8 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -85,9 +89,20 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
...
@@ -85,9 +89,20 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
public
User
getUserByUsername
(
String
username
){
public
User
getUserByUsername
(
String
username
){
User
user
=
new
User
();
User
user
=
new
User
();
user
.
setUsername
(
username
);
user
.
setUsername
(
username
);
user
.
setIsDel
(
SYS_FALSE
);
return
mapper
.
selectOne
(
user
);
return
mapper
.
selectOne
(
user
);
}
}
// /**
// * 根据用户名获取用户信息
// * @param userId
// * @return
// */
// @Cache(key="user{1}")
// public User getUserByUserId(Integer userId){
// return mapper.selectByPrimaryKey(userId);
// }
public
TableResultResponse
<
BaseUserVo
>
selectPage
(
Query
query
,
User
currentUser
)
{
public
TableResultResponse
<
BaseUserVo
>
selectPage
(
Query
query
,
User
currentUser
)
{
List
<
BaseUserVo
>
userVos
=
new
ArrayList
<>();
List
<
BaseUserVo
>
userVos
=
new
ArrayList
<>();
List
<
User
>
list
=
new
ArrayList
<>();
List
<
User
>
list
=
new
ArrayList
<>();
...
@@ -180,6 +195,25 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
...
@@ -180,6 +195,25 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
return
mapper
.
select
(
user
);
return
mapper
.
select
(
user
);
}
}
public
List
<
User
>
getCountByUsernameBiz
(
String
username
,
Integer
bizType
,
String
mobilePhone
){
// User user = new User();
// user.setUsername(username);
// user.setBizType(bizType);
// user.setStatus(SYS_TRUE);
// user.setIsDel(SYS_FALSE);
// return mapper.select(user);
return
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
User:
:
getUsername
,
username
);
w
.
andEqualTo
(
User:
:
getBizType
,
bizType
);
w
.
andEqualTo
(
User:
:
getIsDel
,
SYS_FALSE
);
w
.
andEqualTo
(
User:
:
getStatus
,
SYS_TRUE
);
if
(
StrUtil
.
isNotBlank
(
mobilePhone
))
{
w
.
andEqualTo
(
User:
:
getMobilePhone
,
mobilePhone
);
}
return
w
;
});
}
public
User
getUserByUid
(
Integer
userId
){
public
User
getUserByUid
(
Integer
userId
){
return
mapper
.
selectByPrimaryKey
(
userId
);
return
mapper
.
selectByPrimaryKey
(
userId
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/CurrentController.java
View file @
21905e88
...
@@ -46,6 +46,7 @@ public class CurrentController {
...
@@ -46,6 +46,7 @@ public class CurrentController {
public
@ResponseBody
public
@ResponseBody
BaseResponse
getGroups
()
throws
Exception
{
BaseResponse
getGroups
()
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
throw
new
Exception
();
throw
new
Exception
();
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/ElementController.java
View file @
21905e88
...
@@ -46,7 +46,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
...
@@ -46,7 +46,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
Element
>
getAuthorityElement
(
String
menuId
)
{
public
ObjectRestResponse
<
Element
>
getAuthorityElement
(
String
menuId
)
{
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
,
menuId
);
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
,
menuId
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
}
}
...
@@ -54,7 +54,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
...
@@ -54,7 +54,7 @@ public class ElementController extends BaseController<ElementBiz, Element> {
@RequestMapping
(
value
=
"/user/menu"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/menu"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
Element
>
getAuthorityElement
()
{
public
ObjectRestResponse
<
Element
>
getAuthorityElement
()
{
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
);
List
<
Element
>
elements
=
baseBiz
.
getAuthorityElementByUserId
(
userId
+
""
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
return
new
ObjectRestResponse
<
List
<
Element
>>().
data
(
elements
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/MenuController.java
View file @
21905e88
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.admin.biz.MenuBiz;
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.admin.biz.MenuBiz;
import
com.github.wxiaoqi.security.admin.biz.UserBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserBiz
;
import
com.github.wxiaoqi.security.admin.entity.Element
;
import
com.github.wxiaoqi.security.admin.entity.Element
;
import
com.github.wxiaoqi.security.admin.entity.Menu
;
import
com.github.wxiaoqi.security.admin.entity.Menu
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.vo.AuthorityMenuTree
;
import
com.github.wxiaoqi.security.admin.vo.AuthorityMenuTree
;
import
com.github.wxiaoqi.security.admin.vo.MenuTree
;
import
com.github.wxiaoqi.security.admin.vo.MenuTree
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
...
@@ -102,7 +103,8 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
...
@@ -102,7 +103,8 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
@RequestMapping
(
value
=
"/user/authorityTree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/authorityTree"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
List
<
MenuTree
>
listUserAuthorityMenu
(
Integer
parentId
){
public
List
<
MenuTree
>
listUserAuthorityMenu
(
Integer
parentId
){
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
try
{
try
{
if
(
parentId
==
null
)
{
if
(
parentId
==
null
)
{
parentId
=
this
.
getSystem
().
get
(
0
).
getId
();
parentId
=
this
.
getSystem
().
get
(
0
).
getId
();
...
@@ -116,7 +118,7 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
...
@@ -116,7 +118,7 @@ public class MenuController extends BaseController<MenuBiz, Menu> {
@RequestMapping
(
value
=
"/user/system"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/system"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
List
<
Menu
>
listUserAuthoritySystem
()
{
public
List
<
Menu
>
listUserAuthoritySystem
()
{
int
userId
=
userBiz
.
getUserByUsername
(
getCurrentUserName
()).
getId
();
int
userId
=
getCurrentUserIdInt
();
return
baseBiz
.
getUserAuthoritySystemByUserId
(
userId
);
return
baseBiz
.
getUserAuthoritySystemByUserId
(
userId
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/PublicController.java
View file @
21905e88
...
@@ -66,6 +66,7 @@ public class PublicController {
...
@@ -66,6 +66,7 @@ public class PublicController {
public
@ResponseBody
public
@ResponseBody
ObjectRestResponse
userinfoByToken
(
String
token
)
throws
Exception
{
ObjectRestResponse
userinfoByToken
(
String
token
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
}
}
...
@@ -80,6 +81,7 @@ public class PublicController {
...
@@ -80,6 +81,7 @@ public class PublicController {
public
@ResponseBody
public
@ResponseBody
ObjectRestResponse
userinfoByTokenV2
(
String
token
,
boolean
flag
)
throws
Exception
{
ObjectRestResponse
userinfoByTokenV2
(
String
token
,
boolean
flag
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/chw/ChwUserController.java
View file @
21905e88
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
chw
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
chw
;
import
cn.hutool.core.collection.CollUtil
;
import
com.github.wxiaoqi.security.admin.biz.GroupBiz
;
import
com.github.wxiaoqi.security.admin.biz.GroupBiz
;
import
com.github.wxiaoqi.security.admin.biz.MenuBiz
;
import
com.github.wxiaoqi.security.admin.biz.MenuBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserBiz
;
...
@@ -16,9 +17,13 @@ import com.github.wxiaoqi.security.admin.vo.MenuTree;
...
@@ -16,9 +17,13 @@ import com.github.wxiaoqi.security.admin.vo.MenuTree;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.rest.CommonBaseController
;
import
com.github.wxiaoqi.security.common.util.ReflectionUtils
;
import
com.github.wxiaoqi.security.common.vo.DataInterBean
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -26,12 +31,15 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -26,12 +31,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_BUSINESS
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_OPERATE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
.
User
.
BIZ_TYPE_OPERATE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
util
.
process
.
ResultCode
.
PARAM_ILLEGAL_CODE
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -102,7 +110,7 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -102,7 +110,7 @@ public class ChwUserController extends CommonBaseController implements UserRestI
vo
.
setBizType
(
BIZ_TYPE_OPERATE
);
vo
.
setBizType
(
BIZ_TYPE_OPERATE
);
vo
.
setStatus
(
SYS_TRUE
);
vo
.
setStatus
(
SYS_TRUE
);
if
(
StringUtils
.
isNotBlank
(
username
))
{
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsername
(
username
);
List
<
User
>
list
=
userBiz
.
getCountByUsername
Biz
(
username
,
BIZ_TYPE_OPERATE
,
null
);
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
}
...
@@ -113,34 +121,92 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -113,34 +121,92 @@ public class ChwUserController extends CommonBaseController implements UserRestI
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
@RequestMapping
(
value
=
"/business/addUser"
,
method
=
RequestMethod
.
POST
)
@IgnoreClientToken
public
ObjectRestResponse
<
User
>
businessAdd
(
@RequestBody
UserController
.
UserVO
vo
)
{
DataInterBean
dataInterBean
=
getDataInter
();
String
username
=
vo
.
getUsername
();
vo
.
setBizType
(
BIZ_TYPE_BUSINESS
);
vo
.
setStatus
(
SYS_TRUE
);
vo
.
setCorporationId
(
getAdminUserInfoV2
().
getCorporationId
());
if
(
CollUtil
.
isNotEmpty
(
dataInterBean
.
getDataCompanyIds
()))
{
vo
.
setCompanyId
(
dataInterBean
.
getDataCompanyIds
().
get
(
0
));
}
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsernameBiz
(
username
,
BIZ_TYPE_BUSINESS
,
vo
.
getMobilePhone
());
if
(
list
.
size
()
>
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
}
else
{
throw
new
BaseException
(
"手机号已被使用"
,
PARAM_ILLEGAL_CODE
);
}
userBiz
.
insertSelective
(
vo
);
//添加权限关系
groupBiz
.
modifyUserGroups
(
vo
.
getId
(),
vo
.
getMembers
());
return
ObjectRestResponse
.
succ
();
}
@RequestMapping
(
value
=
"/operate/{id}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/operate/{id}"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
User
>
update
(
@RequestBody
UserController
.
UserVO
vo
)
{
public
ObjectRestResponse
<
User
>
update
(
@RequestBody
UserController
.
UserVO
vo
)
{
if
(!
edit
(
vo
,
BIZ_TYPE_OPERATE
)){
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
return
new
ObjectRestResponse
<
User
>();
}
@RequestMapping
(
value
=
"/business/{id}"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ObjectRestResponse
<
User
>
businessUpdate
(
@RequestBody
UserController
.
UserVO
vo
)
{
if
(!
edit
(
vo
,
BIZ_TYPE_BUSINESS
)){
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
());
}
return
new
ObjectRestResponse
<
User
>();
}
private
boolean
edit
(
UserController
.
UserVO
vo
,
Integer
bizType
)
{
handleDataLimit
(
vo
);
handleDataLimit
(
vo
);
String
username
=
vo
.
getUsername
();
String
username
=
vo
.
getUsername
();
if
(
StringUtils
.
isNotBlank
(
username
))
{
if
(
StringUtils
.
isNotBlank
(
username
))
{
List
<
User
>
list
=
userBiz
.
getCountByUsername
(
username
);
List
<
User
>
list
=
userBiz
.
getCountByUsername
(
username
);
if
(
list
.
size
()
>
1
)
{
if
(
list
.
size
()
>
1
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
())
;
return
false
;
}
}
if
(
list
.
size
()
==
1
)
{
if
(
list
.
size
()
==
1
)
{
User
user
=
list
.
get
(
0
);
User
user
=
list
.
get
(
0
);
if
(!
user
.
getId
().
equals
(
vo
.
getId
()))
{
if
(!
user
.
getId
().
equals
(
vo
.
getId
())
&&
bizType
!=
user
.
getBizType
()
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
USER_IS_EXIST
.
getCode
(),
ResCode
.
USER_IS_EXIST
.
getDesc
())
;
return
false
;
}
}
}
}
}
}
userBiz
.
updateSelectiveById
(
vo
);
userBiz
.
updateSelectiveById
(
vo
);
//添加权限关系
//添加权限关系
groupBiz
.
modifyUserGroups
(
vo
.
getId
(),
vo
.
getMembers
());
groupBiz
.
modifyUserGroups
(
vo
.
getId
(),
vo
.
getMembers
());
return
new
ObjectRestResponse
<
User
>()
;
return
true
;
}
}
@RequestMapping
(
value
=
"/operate/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/operate/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
<
User
>
remove
(
@PathVariable
int
id
)
{
public
ObjectRestResponse
<
User
>
remove
(
@PathVariable
int
id
)
{
userBiz
.
deleteById
(
id
);
del
(
id
,
BIZ_TYPE_OPERATE
);
return
new
ObjectRestResponse
<
User
>();
return
new
ObjectRestResponse
();
}
@RequestMapping
(
value
=
"/business/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseBody
public
ObjectRestResponse
businessRemove
(
@PathVariable
int
id
)
{
del
(
id
,
BIZ_TYPE_BUSINESS
);
return
new
ObjectRestResponse
();
}
private
void
del
(
int
id
,
Integer
bizType
)
{
User
user
=
userBiz
.
selectById
(
id
);
if
(
null
!=
user
&&
user
.
getBizType
()
==
bizType
)
{
del
(
new
User
(){{
setId
(
id
);
}});
}
}
}
private
void
handleDataLimit
(
@RequestBody
UserController
.
UserVO
dto
)
{
private
void
handleDataLimit
(
@RequestBody
UserController
.
UserVO
dto
)
{
...
@@ -160,4 +226,18 @@ public class ChwUserController extends CommonBaseController implements UserRestI
...
@@ -160,4 +226,18 @@ public class ChwUserController extends CommonBaseController implements UserRestI
}
}
}
}
}
}
private
void
del
(
User
entity
)
{
Field
field
=
ReflectionUtils
.
getAccessibleField
(
entity
,
"isDel"
);
Field
field2
=
ReflectionUtils
.
getAccessibleField
(
entity
,
"delete"
);
if
(
null
!=
field
)
{
ReflectionUtils
.
setFieldValue
(
entity
,
"isDel"
,
1
);
}
if
(
null
!=
field2
)
{
ReflectionUtils
.
setFieldValue
(
entity
,
"delete"
,
1
);
}
userBiz
.
updateSelectiveById
(
entity
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/UserRest.java
View file @
21905e88
...
@@ -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 @
21905e88
...
@@ -66,6 +66,24 @@ public class PermissionService {
...
@@ -66,6 +66,24 @@ 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
);
setIsDel
(
0
);
}});
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
();
...
@@ -153,9 +171,11 @@ public class PermissionService {
...
@@ -153,9 +171,11 @@ public class PermissionService {
public
FrontUser
getUserInfo
(
String
token
)
throws
Exception
{
public
FrontUser
getUserInfo
(
String
token
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
null
;
return
null
;
}
}
// Integer userId = Integer.valueOf(userIdStr);
UserInfo
user
=
this
.
getUserByUsername
(
username
);
UserInfo
user
=
this
.
getUserByUsername
(
username
);
FrontUser
frontUser
=
new
FrontUser
();
FrontUser
frontUser
=
new
FrontUser
();
BeanUtils
.
copyProperties
(
user
,
frontUser
);
BeanUtils
.
copyProperties
(
user
,
frontUser
);
...
@@ -173,6 +193,7 @@ public class PermissionService {
...
@@ -173,6 +193,7 @@ public class PermissionService {
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
public
List
<
MenuTree
>
getMenusByUsername
(
String
token
,
String
state
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
//String userIdStr = userAuthUtil.getInfoFromToken(token).getId();
if
(
username
==
null
)
{
if
(
username
==
null
)
{
return
null
;
return
null
;
}
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/UserMapper.xml
View file @
21905e88
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
LEFT JOIN company_info i ON c.company_id=i.id
LEFT JOIN company_info i ON c.company_id=i.id
LEFT JOIN company_info ci ON u.corporation_id=ci.id
LEFT JOIN company_info ci ON u.corporation_id=ci.id
<where>
<where>
u.is_del = 0
<if
test=
"bizType != null"
>
<if
test=
"bizType != null"
>
and u.biz_type = #{bizType}
and u.biz_type = #{bizType}
</if>
</if>
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
21905e88
...
@@ -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/entity/VehicleBrand.java
View file @
21905e88
...
@@ -48,13 +48,6 @@ public class VehicleBrand implements Serializable {
...
@@ -48,13 +48,6 @@ public class VehicleBrand implements Serializable {
@ApiModelProperty
(
value
=
"品牌英文名称"
)
@ApiModelProperty
(
value
=
"品牌英文名称"
)
private
String
enName
;
private
String
enName
;
/**
* 品牌首字母
*/
@Column
(
name
=
"index"
)
@ApiModelProperty
(
value
=
"品牌首字母"
)
private
String
index
;
/**
/**
* 品牌logo
* 品牌logo
*/
*/
...
@@ -107,9 +100,9 @@ public class VehicleBrand implements Serializable {
...
@@ -107,9 +100,9 @@ public class VehicleBrand implements Serializable {
/**
/**
* 品牌删除状态 1:正常 2:删除
* 品牌删除状态 1:正常 2:删除
*/
*/
@Column
(
name
=
"
delete
"
)
@Column
(
name
=
"
is_del
"
)
@ApiModelProperty
(
value
=
"品牌删除状态
1:正常 2
:删除"
)
@ApiModelProperty
(
value
=
"品牌删除状态
0:正常 1
:删除"
)
private
Integer
delete
;
private
Integer
isDel
;
/**
/**
* 品牌审核备注
* 品牌审核备注
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleCata.java
View file @
21905e88
...
@@ -24,11 +24,16 @@ public class VehicleCata implements Serializable {
...
@@ -24,11 +24,16 @@ public class VehicleCata implements Serializable {
@GeneratedValue
(
generator
=
"JDBC"
)
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
private
Integer
id
;
//车型id
//车型id
@Column
(
name
=
"vehicle_model_id"
)
@Column
(
name
=
"vehicle_model_id"
)
@ApiModelProperty
(
value
=
"车型id"
)
@ApiModelProperty
(
value
=
"车型id"
)
private
Integer
vehicleModelId
;
private
Integer
vehicleModelId
;
//车辆id
@Column
(
name
=
"vehicle_id"
)
@ApiModelProperty
(
value
=
"车辆id"
)
private
Integer
vehicleId
;
//分类id
//分类id
@Column
(
name
=
"cata_id"
)
@Column
(
name
=
"cata_id"
)
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleCategory.java
View file @
21905e88
...
@@ -32,14 +32,14 @@ public class VehicleCategory implements Serializable {
...
@@ -32,14 +32,14 @@ public class VehicleCategory implements Serializable {
*/
*/
@Column
(
name
=
"brand_id"
)
@Column
(
name
=
"brand_id"
)
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
private
Long
brandId
;
private
Integer
brandId
;
/**
/**
*
*
*/
*/
@Column
(
name
=
"brand_name"
)
@Column
(
name
=
"brand_name"
)
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
private
Lo
ng
brandName
;
private
Stri
ng
brandName
;
/**
/**
*
*
...
@@ -65,9 +65,9 @@ public class VehicleCategory implements Serializable {
...
@@ -65,9 +65,9 @@ public class VehicleCategory implements Serializable {
/**
/**
* 品牌删除状态 1:正常 2:删除
* 品牌删除状态 1:正常 2:删除
*/
*/
@Column
(
name
=
"
delete
"
)
@Column
(
name
=
"
is_del
"
)
@ApiModelProperty
(
value
=
"品牌删除状态
1:正常 2
:删除"
)
@ApiModelProperty
(
value
=
"品牌删除状态
0:正常 1
:删除"
)
private
Integer
delete
;
private
Integer
isDel
;
/**
/**
* 创建时间
* 创建时间
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehiclePlatCata.java
View file @
21905e88
...
@@ -71,7 +71,7 @@ public class VehiclePlatCata implements Serializable {
...
@@ -71,7 +71,7 @@ public class VehiclePlatCata implements Serializable {
private
Long
updTime
;
private
Long
updTime
;
//是否多选
//是否多选
@Column
(
name
=
"is
M
ore"
)
@Column
(
name
=
"is
_m
ore"
)
@ApiModelProperty
(
value
=
"多选 0:单选 1:多选"
)
@ApiModelProperty
(
value
=
"多选 0:单选 1:多选"
)
private
Integer
isMore
;
private
Integer
isMore
;
...
@@ -81,4 +81,13 @@ public class VehiclePlatCata implements Serializable {
...
@@ -81,4 +81,13 @@ public class VehiclePlatCata implements Serializable {
@ApiModelProperty
(
value
=
"是否作为客户端查询条件:0-否,1-是"
)
@ApiModelProperty
(
value
=
"是否作为客户端查询条件:0-否,1-是"
)
private
Integer
startUsing
;
private
Integer
startUsing
;
//商家录入是否多选 0--否;1--是
@Column
(
name
=
"is_input_more"
)
@ApiModelProperty
(
value
=
"商家录入是否多选 0--否;1--是"
)
private
Integer
isInputMore
;
//类型 1--房车;2--机车;3--游艇
@Column
(
name
=
"goods_type"
)
@ApiModelProperty
(
value
=
"类型 1--房车;2--机车;3--游艇"
)
private
Integer
goodsType
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/CompanySearchOldDTO.java
0 → 100644
View file @
21905e88
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/VehicleApplication.java
View file @
21905e88
...
@@ -8,6 +8,7 @@ import org.springframework.boot.SpringApplication;
...
@@ -8,6 +8,7 @@ import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@SpringBootApplication
(
scanBasePackages
=
{
@SpringBootApplication
(
scanBasePackages
=
{
...
@@ -23,6 +24,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -23,6 +24,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableFeignClients
(
value
=
{
"com.github.wxiaoqi.security"
,
"com.xxfc.platform.*.feign"
},
defaultConfiguration
=
HeaderConfig
.
class
)
@EnableFeignClients
(
value
=
{
"com.github.wxiaoqi.security"
,
"com.xxfc.platform.*.feign"
},
defaultConfiguration
=
HeaderConfig
.
class
)
@EnableAceCache
@EnableAceCache
@AddBasicConfiguration
@AddBasicConfiguration
@EnableAspectJAutoProxy
(
proxyTargetClass
=
true
,
exposeProxy
=
true
)
@tk
.
mybatis
.
spring
.
annotation
.
MapperScan
(
basePackages
=
"com.xxfc.platform.vehicle.mapper"
)
@tk
.
mybatis
.
spring
.
annotation
.
MapperScan
(
basePackages
=
"com.xxfc.platform.vehicle.mapper"
)
public
class
VehicleApplication
{
public
class
VehicleApplication
{
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
21905e88
...
@@ -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/biz/VehiclePlatCataBiz.java
View file @
21905e88
...
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.assertj.core.util.Arrays
;
import
org.assertj.core.util.Arrays
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -178,7 +179,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -178,7 +179,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
* @param parentId
* @param parentId
* @return
* @return
*/
*/
public
ObjectRestResponse
fingCatasByParentId
(
Integer
parentId
)
{
public
ObjectRestResponse
<
List
<
VehiclePlatCata
>>
fingCatasByParentId
(
Integer
parentId
)
{
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
()
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
()
...
@@ -199,11 +200,11 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -199,11 +200,11 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
* @param limit
* @param limit
* @return
* @return
*/
*/
public
ObjectRestResponse
getCascades
(
Integer
page
,
Integer
limit
,
Integer
sort
)
{
public
ObjectRestResponse
getCascades
(
Integer
page
,
Integer
limit
,
Integer
sort
,
Integer
goodsType
)
{
try
{
try
{
//标签列表页面
//标签列表页面
if
(
sort
==
null
||
sort
==
0
)
{
if
(
sort
==
null
||
sort
==
0
)
{
return
getPage
(
page
,
limit
);
return
getPage
(
page
,
limit
,
goodsType
);
}
}
//增加车型页面
//增加车型页面
...
@@ -235,12 +236,16 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -235,12 +236,16 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
}
}
@Cache
(
key
=
RedisKey
.
BRANCH_COMPANY_CATA_PAGE
)
@Cache
(
key
=
RedisKey
.
BRANCH_COMPANY_CATA_PAGE
)
private
ObjectRestResponse
getPage
(
Integer
page
,
Integer
limit
)
{
private
ObjectRestResponse
getPage
(
Integer
page
,
Integer
limit
,
Integer
goodsType
)
{
//获取一级标签
//获取一级标签
WeekendSqls
<
VehiclePlatCata
>
weekendSqls
=
WeekendSqls
.<
VehiclePlatCata
>
custom
();
if
(
null
!=
goodsType
){
weekendSqls
.
andEqualTo
(
VehiclePlatCata:
:
getGoodsType
,
goodsType
);
}
weekendSqls
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
0
)
.
andEqualTo
(
VehiclePlatCata:
:
getState
,
0
);
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
()
.
where
(
weekendSqls
)
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
0
)
.
andEqualTo
(
VehiclePlatCata:
:
getState
,
0
))
.
orderByAsc
(
"rank"
)
.
orderByAsc
(
"rank"
)
.
build
();
.
build
();
...
@@ -511,4 +516,8 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -511,4 +516,8 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
});
});
return
cataVos
;
return
cataVos
;
}
}
private
VehiclePlatCataBiz
getMyBiz
()
{
return
AopContext
.
currentProxy
()
!=
null
?
(
VehiclePlatCataBiz
)
AopContext
.
currentProxy
()
:
this
;
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
View file @
21905e88
...
@@ -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 @
21905e88
...
@@ -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 @
21905e88
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/VehicleCataController.java
View file @
21905e88
...
@@ -98,7 +98,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -98,7 +98,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
,
@PathVariable
Integer
limit
,
@PathVariable
Integer
limit
,
@PathVariable
Integer
sort
){
,
@PathVariable
Integer
sort
){
return
baseBiz
.
getCascades
(
page
,
limit
,
sort
);
return
baseBiz
.
getCascades
(
page
,
limit
,
sort
,
null
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/BgVehicleBrandController.java
0 → 100755
View file @
21905e88
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/BgVehicleCataController.java
0 → 100644
View file @
21905e88
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.vehicle.biz.VehicleCataBiz
;
import
com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.VehicleBaseController
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.pojo.Cascade
;
import
com.xxfc.platform.vehicle.pojo.CataVo
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePlatCataVo
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/backstage/cata"
)
@Slf4j
@IgnoreClientToken
public
class
BgVehicleCataController
extends
VehicleBaseController
<
VehiclePlatCataBiz
>
{
@Autowired
VehicleCataBiz
vehicleCataBiz
;
@RequestMapping
(
value
=
"/update"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
update
(
@RequestBody
CataVo
cataVo
)
throws
Exception
{
return
baseBiz
.
update
(
cataVo
);
}
@RequestMapping
(
value
=
"/app/all"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
test
()
throws
Exception
{
AppUserDTO
userDTO
=
getUserInfo
();
return
RestResponse
.
data
(
userDTO
);
}
@RequestMapping
(
value
=
"/app/unauth/all"
,
method
=
RequestMethod
.
POST
)
@IgnoreUserToken
public
RestResponse
all
()
throws
Exception
{
return
RestResponse
.
data
(
baseBiz
.
findTypeTree
());
}
@RequestMapping
(
value
=
"/bind"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
bind
(
@RequestParam
(
value
=
"ids"
,
defaultValue
=
""
)
String
ids
,
@RequestParam
(
value
=
"modelId"
,
defaultValue
=
"0"
)
Integer
modelId
)
throws
Exception
{
return
vehicleCataBiz
.
updateCataByModel
(
ids
,
modelId
);
}
/**
* 根据父类id获取子标签
* @param parentId
* @return
*/
@GetMapping
(
value
=
"/add/fingCatasByParentId/{parentId}"
)
public
ObjectRestResponse
<
List
<
VehiclePlatCata
>>
fingCatasByParentId
(
@PathVariable
(
"parentId"
)
Integer
parentId
){
return
baseBiz
.
fingCatasByParentId
(
parentId
);
}
/**
* 查询一个一级标签及其子标签
* @param id
* @return
*/
@GetMapping
(
value
=
"/findCascade"
)
public
ObjectRestResponse
findCascade
(
Integer
id
){
return
baseBiz
.
findCascade
(
id
);
}
/**
* 分页或不分页,获取一级标签及其子标签
* #@param dto.page 当前页
* #@param dto.limit 每页条数
* #@param dto.sort 分类 0-标签管理页面,1-增加车辆页面
* @return
*/
@GetMapping
(
value
=
"/operation/getCascades"
)
public
ObjectRestResponse
getCascades
(
PageDTO
dto
){
return
baseBiz
.
getCascades
(
dto
.
getPage
(),
dto
.
getLimit
(),
dto
.
getSort
(),
dto
.
getGoodsType
());
}
/**
* 分页或不分页,获取一级标签及其子标签
* #@param dto.page 当前页
* #@param dto.limit 每页条数
* #@param dto.sort 分类 0-标签管理页面,1-增加车辆页面
* @return
*/
@GetMapping
(
value
=
"/business/getCascades"
)
public
ObjectRestResponse
getBusinessCascades
(
PageDTO
dto
){
dto
.
setSort
(
1
);
return
baseBiz
.
getCascades
(
dto
.
getPage
(),
dto
.
getLimit
(),
dto
.
getSort
(),
dto
.
getGoodsType
());
}
@Data
public
static
class
PageDTO
extends
PageParam
{
Integer
sort
;
Integer
goodsType
;
}
/**
* 级联添加
* @param cascade
* @return
*/
@PostMapping
(
value
=
"/add/addCascade/"
)
@Transactional
public
ObjectRestResponse
addCascade
(
@RequestBody
Cascade
<
VehiclePlatCata
>
cascade
){
return
baseBiz
.
addCascade
(
cascade
);
}
/**
* 修改和增加一二级标签
* @param cas
* @return
*/
@PostMapping
(
"/operation/updateAndAdd"
)
public
ObjectRestResponse
save
(
@RequestBody
Cascade
<
VehiclePlatCata
>
cas
){
return
baseBiz
.
updateAndAdd
(
cas
);
}
/**
* 修改标签排序
* @param id
* @param rank
* @return
*/
@PutMapping
(
"/add/updateParentRank/{id}/{rank}"
)
public
ObjectRestResponse
updateParentRank
(
@PathVariable
(
"id"
)
Integer
id
,
@PathVariable
(
"rank"
)
Integer
rank
){
return
baseBiz
.
updateParentRank
(
id
,
rank
);
}
/**
* 查询当前车型拥有的标签
* @param ids
* @return
*/
@GetMapping
(
"/add/getCatasByIds/{ids}"
)
public
ObjectRestResponse
<
List
<
VehiclePlatCata
>>
getCatasByIds
(
@PathVariable
String
ids
){
return
baseBiz
.
getCatasByIds
(
ids
);
}
/**
* 删除一级标签及其子标签
* #@param vehiclePlatCata.id 标签id
* @return
*/
@DeleteMapping
(
"/operation/deleteCascadeById"
)
public
ObjectRestResponse
deleteCascadeById
(
@RequestBody
VehiclePlatCata
vehiclePlatCata
){
return
baseBiz
.
deleteCascadeById
(
vehiclePlatCata
.
getId
());
}
/**
* 修改客户端查询条件
* @param id
* @param startUsing
* @return
*/
@PutMapping
(
"/add/setStartUsingById/{id}/{startUsing}"
)
public
ObjectRestResponse
setStartUsingById
(
@PathVariable
(
"id"
)
Integer
id
,
@PathVariable
(
"startUsing"
)
Integer
startUsing
){
return
baseBiz
.
setStartUsingById
(
id
,
startUsing
);
}
/**
* 修改单选还是多选
* @param id
* @param isMore
* @return
*/
@PutMapping
(
"/add/setIsMore/{id}/{isMore}"
)
public
ObjectRestResponse
setIsMore
(
@PathVariable
(
"id"
)
Integer
id
,
@PathVariable
(
"isMore"
)
Integer
isMore
){
return
baseBiz
.
setIsore
(
id
,
isMore
);
}
/**
* 根据类型id查询分类
* @param type
* @return
*/
@GetMapping
(
"/app/unauth/types"
)
public
ObjectRestResponse
<
List
<
VehiclePlatCataVo
>>
findVehiclePlatCate
(
@RequestParam
(
value
=
"type"
,
required
=
false
,
defaultValue
=
"7"
)
Integer
type
){
List
<
VehiclePlatCataVo
>
category
=
baseBiz
.
findVehicleCategoryByParentId
(
type
);
return
ObjectRestResponse
.
succ
(
category
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/BgVehicleCategoryController.java
View file @
21905e88
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
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.RestController
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
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
(
"
backstage
/vehicleCategory"
)
public
class
BgVehicleCategoryController
extends
BaseController
<
VehicleCategoryBiz
,
VehicleCategory
>
{
public
class
BgVehicleCategoryController
extends
BaseController
<
VehicleCategoryBiz
,
VehicleCategory
>
{
@ApiOperation
(
"添加"
)
@RequestMapping
(
value
=
"addCategory"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ObjectRestResponse
<
VehicleCategory
>
addCategory
(
@RequestBody
VehicleCategory
entity
)
{
baseBiz
.
insertSelective
(
entity
);
return
new
ObjectRestResponse
<
VehicleCategory
>();
}
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
21905e88
...
@@ -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"
>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBrandMapper.xml
View file @
21905e88
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
<result
property=
"code"
column=
"code"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"cnName"
column=
"cn_name"
/>
<result
property=
"cnName"
column=
"cn_name"
/>
<result
property=
"enName"
column=
"en_name"
/>
<result
property=
"enName"
column=
"en_name"
/>
<result
property=
"index"
column=
"index"
/>
<result
property=
"logo"
column=
"logo"
/>
<result
property=
"logo"
column=
"logo"
/>
<result
property=
"banner"
column=
"banner"
/>
<result
property=
"banner"
column=
"banner"
/>
<result
property=
"story"
column=
"story"
/>
<result
property=
"story"
column=
"story"
/>
...
@@ -17,7 +16,7 @@
...
@@ -17,7 +16,7 @@
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"recommend"
column=
"recommend"
/>
<result
property=
"recommend"
column=
"recommend"
/>
<result
property=
"audit"
column=
"audit"
/>
<result
property=
"audit"
column=
"audit"
/>
<result
property=
"
delete"
column=
"delete
"
/>
<result
property=
"
isDel"
column=
"is_del
"
/>
<result
property=
"auditRemark"
column=
"audit_remark"
/>
<result
property=
"auditRemark"
column=
"audit_remark"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"updTime"
column=
"upd_time"
/>
<result
property=
"updTime"
column=
"upd_time"
/>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleCataMapper.xml
View file @
21905e88
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<resultMap
type=
"com.xxfc.platform.vehicle.entity.VehicleCata"
id=
"vehicleCataMap"
>
<resultMap
type=
"com.xxfc.platform.vehicle.entity.VehicleCata"
id=
"vehicleCataMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"vehicleModelId"
column=
"vehicle_model_id"
/>
<result
property=
"vehicleModelId"
column=
"vehicle_model_id"
/>
<result
property=
"vehicleId"
column=
"vehicle_id"
/>
<result
property=
"cataId"
column=
"cata_id"
/>
<result
property=
"cataId"
column=
"cata_id"
/>
<result
property=
"isdel"
column=
"isdel"
/>
<result
property=
"isdel"
column=
"isdel"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
...
...
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