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
4ca75060
Commit
4ca75060
authored
Aug 16, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
50f06362
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
5 deletions
+30
-5
AreaBiz.java
.../src/main/java/com/xxfc/platform/vehicle/biz/AreaBiz.java
+1
-0
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+3
-1
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+26
-4
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/AreaBiz.java
View file @
4ca75060
...
...
@@ -59,4 +59,5 @@ public class AreaBiz extends BaseBiz<AreaMapper, Area> implements UserRestInterf
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
4ca75060
...
...
@@ -77,6 +77,8 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
@Autowired
private
VehicleBiz
vehicleBiz
;
/**
* 按主键获取公司
*
...
...
@@ -172,7 +174,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
criteria
.
andIn
(
ID
,
userDTO
.
dataCompany2List
());
}
}
example
.
setOrderByClause
(
"`id`
a
sc"
);
example
.
setOrderByClause
(
"`id`
de
sc"
);
PageHelper
.
startPage
(
page
,
limit
);
PageInfo
<
BranchCompany
>
branchCompanyPageInfo
=
new
PageInfo
<>(
mapper
.
selectByExample
(
example
));
return
PageDataVO
.
pageInfo
(
branchCompanyPageInfo
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
4ca75060
...
...
@@ -6,11 +6,14 @@ 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.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.biz.AreaBiz
;
import
com.xxfc.platform.vehicle.biz.BranchCompanyBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.Area
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVo
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
...
...
@@ -49,6 +52,9 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
@Autowired
private
UserAuthConfig
userAuthConfig
;
@Autowired
private
AreaBiz
areaBiz
;
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
PageDataVO
<
BranchCompany
>>
page
(
@RequestParam
Integer
page
,
@RequestParam
Integer
limit
,
@RequestParam
(
required
=
false
)
Integer
addrProvince
,
@RequestParam
(
required
=
false
)
Integer
addrCity
,
...
...
@@ -89,8 +95,16 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
public
RestResponse
<
Integer
>
add
(
@RequestBody
BranchCompanyVo
branchCompanyVo
)
{
return
RestResponse
.
data
(
baseBiz
.
add
(
branchCompanyVo
));
public
ObjectRestResponse
<
Integer
>
add
(
@RequestBody
BranchCompanyVo
branchCompanyVo
)
{
if
(
branchCompanyVo
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
Area
area
=
areaBiz
.
selectById
(
branchCompanyVo
.
getZoneId
());
Integer
provinc
=
branchCompanyVo
.
getAddrProvince
()==
null
?
0
:
branchCompanyVo
.
getAddrProvince
();
if
(
area
==
null
||
StringUtils
.
isBlank
(
area
.
getProvinceIds
())||!
area
.
getProvinceIds
().
contains
(
provinc
+
""
)){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"片区和省份不一致"
);
}
return
ObjectRestResponse
.
succ
(
baseBiz
.
add
(
branchCompanyVo
));
}
@RequestMapping
(
value
=
"/app/unauth/getByZone"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -113,9 +127,17 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
PUT
)
public
RestResponse
update
(
@RequestBody
BranchCompany
branchCompany
)
{
public
ObjectRestResponse
update
(
@RequestBody
BranchCompany
branchCompany
)
{
if
(
branchCompany
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
Area
area
=
areaBiz
.
selectById
(
branchCompany
.
getZoneId
());
Integer
provinc
=
branchCompany
.
getAddrProvince
()==
null
?
0
:
branchCompany
.
getAddrProvince
();
if
(
area
==
null
||
StringUtils
.
isBlank
(
area
.
getProvinceIds
())||!
area
.
getProvinceIds
().
contains
(
provinc
+
""
)){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"片区和省份不一致"
);
}
baseBiz
.
update
(
branchCompany
);
return
RestResponse
.
sucResponse
();
return
ObjectRestResponse
.
succ
();
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
...
...
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