Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
Details
Activity
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
吴迪
gs1-office-web-sit
Commits
ee54424b
Commit
ee54424b
authored
May 30, 2022
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】机构id兼容
parent
26aa5b5d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
14 deletions
+27
-14
BranchController.java
...io/office/modules/manage/controller/BranchController.java
+10
-2
CodeagentController.java
...office/modules/manage/controller/CodeagentController.java
+11
-7
CodeagentEntity.java
...java/io/office/modules/manage/entity/CodeagentEntity.java
+2
-1
BranchDao.xml
src/main/resources/mapper/manage/BranchDao.xml
+4
-4
No files found.
src/main/java/io/office/modules/manage/controller/BranchController.java
View file @
ee54424b
...
...
@@ -6,8 +6,10 @@ import java.util.Map;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.service.CodeagentService
;
import
io.office.modules.manage.vo.request.ShortCodeVo
;
import
io.office.modules.manage.vo.response.BranchEntityVo
;
import
org.apache.commons.lang.ArrayUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -36,6 +38,8 @@ import javax.servlet.http.HttpServletRequest;
public
class
BranchController
{
@Autowired
private
BranchService
branchService
;
@Autowired
private
CodeagentService
codeagentService
;
/**
* 列表
...
...
@@ -88,9 +92,13 @@ public class BranchController {
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:branch:delete")
public
R
delete
(
@RequestBody
String
[]
branchCodes
){
if
(
ArrayUtils
.
isNotEmpty
(
branchCodes
))
{
for
(
String
branchCode
:
branchCodes
)
{
branchCode
=
branchCode
.
trim
();
}
}
branchService
.
removeByIds
(
Arrays
.
asList
(
branchCodes
));
codeagentService
.
removeByIds
(
Arrays
.
asList
(
branchCodes
));
return
R
.
ok
();
}
...
...
src/main/java/io/office/modules/manage/controller/CodeagentController.java
View file @
ee54424b
...
...
@@ -3,6 +3,9 @@ package io.office.modules.manage.controller;
import
java.util.Arrays
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -48,8 +51,9 @@ public class CodeagentController {
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("manage:codeagent:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
CodeagentEntity
codeagent
=
codeagentService
.
getById
(
id
);
public
R
info
(
@PathVariable
(
"id"
)
String
id
){
CodeagentEntity
codeagent
=
codeagentService
.
getById
(
id
.
trim
());
return
R
.
ok
().
put
(
"codeagent"
,
codeagent
);
}
...
...
@@ -73,11 +77,11 @@ public class CodeagentController {
public
R
update
(
@RequestBody
CodeagentEntity
codeagent
){
CodeagentEntity
codeagentServiceById
=
codeagentService
.
getById
(
codeagent
.
getId
());
if
(
codeagentServiceById
!=
null
)
{
codeagentService
.
updateById
(
codeagent
);
}
else
{
codeagentService
.
save
(
codeagent
);
}
QueryWrapper
<
CodeagentEntity
>
updateWrapper
=
new
QueryWrapper
<>();
updateWrapper
.
eq
(
"id"
,
codeagent
.
getId
()
);
codeagent
.
setId
(
codeagent
.
getId
());
codeagentService
.
saveOrUpdate
(
codeagent
,
updateWrapper
);
return
R
.
ok
();
}
...
...
src/main/java/io/office/modules/manage/entity/CodeagentEntity.java
View file @
ee54424b
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
...
@@ -22,7 +23,7 @@ public class CodeagentEntity implements Serializable {
/**
* $column.comments
*/
@TableId
@TableId
(
type
=
IdType
.
INPUT
)
private
Integer
id
;
/**
* $column.comments
...
...
src/main/resources/mapper/manage/BranchDao.xml
View file @
ee54424b
...
...
@@ -28,10 +28,10 @@
c.personname
FROM
center_outer.dbo.branch a
LEFT JOIN codeagent b ON
a.branch_code = b.Id
LEFT JOIN codeagent b ON
ltrim(rtrim(a.branch_code)) = ltrim(rtrim(b.id))
LEFT JOIN center_outer.dbo.person c ON a.branch_contact = c.personid
WHERE
branch_code = #{branchCode}
ltrim(rtrim(branch_code)) = ltrim(rtrim(#{branchCode}))
</select>
<select
id=
"getListPage"
resultType=
"io.office.modules.manage.vo.response.BranchEntityVo"
>
...
...
@@ -41,9 +41,9 @@
b.website
FROM
center_outer.dbo.branch a
LEFT JOIN codeagent b ON
a.branch_code = b.id
LEFT JOIN codeagent b ON
ltrim(rtrim(a.branch_code)) = ltrim(rtrim(b.id))
WHERE
branch_code
<>
'0000'
ltrim(rtrim(a.branch_code))
<>
'0000'
<if
test=
"params.branchName!=null and params.branchName!=''"
>
and a.branch_name like concat('%',#{params.branchName},'%')
</if>
...
...
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