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
531e5f94
Commit
531e5f94
authored
May 29, 2022
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】修改代码
parent
f22f8a3c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
145 additions
and
8 deletions
+145
-8
pom.xml
pom.xml
+1
-1
BranchController.java
...io/office/modules/manage/controller/BranchController.java
+8
-5
BranchDao.java
src/main/java/io/office/modules/manage/dao/BranchDao.java
+8
-0
CodeagentVo.java
...java/io/office/modules/manage/entity/dto/CodeagentVo.java
+72
-0
BranchService.java
.../java/io/office/modules/manage/service/BranchService.java
+5
-0
BranchServiceImpl.java
...office/modules/manage/service/impl/BranchServiceImpl.java
+14
-0
application-dev.yml
src/main/resources/application-dev.yml
+13
-0
BranchDao.xml
src/main/resources/mapper/manage/BranchDao.xml
+19
-2
CodeagentDao.xml
src/main/resources/mapper/manage/CodeagentDao.xml
+5
-0
No files found.
pom.xml
View file @
531e5f94
...
...
@@ -38,7 +38,7 @@
<swagger.version>
2.7.0
</swagger.version>
<joda.time.version>
2.9.9
</joda.time.version>
<gson.version>
2.8.5
</gson.version>
<fastjson.version>
1.2.
72
</fastjson.version>
<fastjson.version>
1.2.
83
</fastjson.version>
<hutool.version>
4.1.1
</hutool.version>
<lombok.version>
1.18.4
</lombok.version>
...
...
src/main/java/io/office/modules/manage/controller/BranchController.java
View file @
531e5f94
...
...
@@ -3,7 +3,9 @@ package io.office.modules.manage.controller;
import
java.util.Arrays
;
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.vo.request.ShortCodeVo
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -39,10 +41,11 @@ public class BranchController {
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:branch:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
branchService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
public
R
list
(
@RequestBody
Map
<
String
,
Object
>
params
){
Page
<
DocEntity
>
page
=
this
.
branchService
.
getListPage
(
params
,
new
Page
(
Integer
.
parseInt
(
params
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
params
.
get
(
"limit"
).
toString
())));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
@@ -54,7 +57,7 @@ public class BranchController {
public
R
info
(
@PathVariable
(
"branchCode"
)
String
branchCode
){
BranchEntity
branch
=
branchService
.
getById
(
branchCode
);
return
R
.
ok
().
put
(
"
branch
"
,
branch
);
return
R
.
ok
().
put
(
"
data
"
,
branch
);
}
/**
...
...
src/main/java/io/office/modules/manage/dao/BranchDao.java
View file @
531e5f94
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.BranchEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.manage.vo.response.BranchEntityVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${comments}
*
...
...
@@ -19,5 +24,8 @@ public interface BranchDao extends BaseMapper<BranchEntity> {
BranchEntityVo
getBranchDetail
(
@Param
(
"branchCode"
)
String
branchCode
);
List
<
BranchEntityVo
>
getListPage
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/entity/dto/CodeagentVo.java
0 → 100644
View file @
531e5f94
package
io
.
office
.
modules
.
manage
.
entity
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
*
* @description:
*
* @author wudi
* @date 14:05 2022/5/23
*/
@Data
public
class
CodeagentVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
id
;
/**
* $column.comments
*/
private
String
title
;
/**
* $column.comments
*/
private
String
content
;
/**
* $column.comments
*/
private
String
address
;
/**
* $column.comments
*/
private
String
phone
;
/**
* $column.comments
*/
private
String
postcode
;
/**
* $column.comments
*/
private
String
contactman
;
/**
* $column.comments
*/
private
String
fax
;
/**
* $column.comments
*/
private
String
description
;
/**
* $column.comments
*/
private
String
mail
;
/**
* $column.comments
*/
private
String
website
;
/**
* $column.comments
*/
private
String
addressDescription
;
}
src/main/java/io/office/modules/manage/service/BranchService.java
View file @
531e5f94
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.BranchEntity
;
...
...
@@ -21,5 +22,9 @@ public interface BranchService extends IService<BranchEntity> {
BranchEntityVo
getBranchDetail
(
String
branchCode
);
Page
getListPage
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/BranchServiceImpl.java
View file @
531e5f94
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.DocEntity
;
import
io.office.modules.manage.vo.response.BranchEntityVo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -32,4 +38,11 @@ public class BranchServiceImpl extends ServiceImpl<BranchDao, BranchEntity> impl
return
baseMapper
.
getBranchDetail
(
branchCode
);
}
@Override
public
Page
getListPage
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
List
<
BranchEntityVo
>
list
=
baseMapper
.
getListPage
(
params
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
}
\ No newline at end of file
src/main/resources/application-dev.yml
View file @
531e5f94
...
...
@@ -48,6 +48,19 @@ spring:
config
:
multi-statement-allow
:
true
dynamic
:
datasource
:
slave1
:
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://118.190.181.128:51433;DatabaseName=gs108
username
:
sa
password
:
1234.abcd
slave2
:
driver-class-name
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
url
:
jdbc:sqlserver://118.190.181.128:51433;DatabaseName=gs108
username
:
sa
password
:
1234.abcd
##多数据源的配置
#dynamic:
# datasource:
...
...
src/main/resources/mapper/manage/BranchDao.xml
View file @
531e5f94
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"io.office.modules.manage.dao.BranchDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.BranchEntity"
id=
"branchMap"
>
<result
property=
"branchCode"
column=
"branch_code"
/>
<result
property=
"branchName"
column=
"branch_name"
/>
...
...
@@ -18,7 +18,8 @@
</resultMap>
<select
id=
"getBranchDetail"
parameterType=
"string"
resultType=
"io.office.modules.manage.vo.response.BranchEntityVo"
>
<select
id=
"getBranchDetail"
parameterType=
"string"
resultType=
"io.office.modules.manage.vo.response.BranchEntityVo"
>
SELECT
a.*, b.description,
b.mail,
...
...
@@ -33,7 +34,22 @@
branch_code = #{branchCode}
</select>
<select
id=
"getListPage"
resultType=
"io.office.modules.manage.vo.response.BranchEntityVo"
>
SELECT
a.*, b.description,
b.mail,
b.website
FROM
center_outer.dbo.branch a
LEFT JOIN codeagent b ON a.branch_code = b.id
WHERE
branch_code
<>
'0000'
<if
test=
"params.branchName!=null and params.branchName!=''"
>
and a.branch_name like concat('%',#{params.branchName},'%')
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper/manage/CodeagentDao.xml
View file @
531e5f94
...
...
@@ -20,4 +20,8 @@
</resultMap>
</mapper>
\ No newline at end of file
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