Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setup-manager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
setup-manager
Commits
23fcd536
Commit
23fcd536
authored
Nov 01, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加区域树
parent
efa10d54
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1327 additions
and
353 deletions
+1327
-353
setup-project-manager/src/main/java/com/mortals/xhx/common/code/AreaLevelEnum.java
.../main/java/com/mortals/xhx/common/code/AreaLevelEnum.java
+34
-41
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveGetDeptEnum.java
...ain/java/com/mortals/xhx/common/code/HaveGetDeptEnum.java
+65
-0
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveGetMatterListEnum.java
...va/com/mortals/xhx/common/code/HaveGetMatterListEnum.java
+65
-0
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveSonAreaEnum.java
...ain/java/com/mortals/xhx/common/code/HaveSonAreaEnum.java
+65
-0
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveSonDeptEnum.java
...ain/java/com/mortals/xhx/common/code/HaveSonDeptEnum.java
+65
-0
setup-project-manager/src/main/java/com/mortals/xhx/common/code/StatusEnum.java
...src/main/java/com/mortals/xhx/common/code/StatusEnum.java
+65
-0
setup-project-manager/src/main/java/com/mortals/xhx/module/base/dao/BaseAreaDao.java
...ain/java/com/mortals/xhx/module/base/dao/BaseAreaDao.java
+9
-2
setup-project-manager/src/main/java/com/mortals/xhx/module/base/dao/ibatis/BaseAreaDaoImpl.java
...m/mortals/xhx/module/base/dao/ibatis/BaseAreaDaoImpl.java
+9
-4
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaEntity.java
...ava/com/mortals/xhx/module/base/model/BaseAreaEntity.java
+21
-234
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaQuery.java
...java/com/mortals/xhx/module/base/model/BaseAreaQuery.java
+327
-2
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaTreeSelect.java
...com/mortals/xhx/module/base/model/BaseAreaTreeSelect.java
+114
-0
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/vo/BaseAreaVo.java
...java/com/mortals/xhx/module/base/model/vo/BaseAreaVo.java
+15
-10
setup-project-manager/src/main/java/com/mortals/xhx/module/base/service/BaseAreaService.java
.../com/mortals/xhx/module/base/service/BaseAreaService.java
+35
-10
setup-project-manager/src/main/java/com/mortals/xhx/module/base/service/impl/BaseAreaServiceImpl.java
...als/xhx/module/base/service/impl/BaseAreaServiceImpl.java
+114
-9
setup-project-manager/src/main/java/com/mortals/xhx/module/base/web/BaseAreaController.java
...a/com/mortals/xhx/module/base/web/BaseAreaController.java
+86
-23
setup-project-manager/src/main/resources/sqlmap/module/base/BaseAreaMapper.xml
.../src/main/resources/sqlmap/module/base/BaseAreaMapper.xml
+172
-18
setup-project-manager/src/test/java/com/mortals/httpclient/base/BaseAreaController.http
.../java/com/mortals/httpclient/base/BaseAreaController.http
+66
-0
No files found.
setup-project-manager/src/main/java/com/mortals/xhx/common/code/AreaLevelEnum.java
View file @
23fcd536
package
com.mortals.xhx.common.code
;
import
com.mortals.framework.ap.SysConstains
;
import
com.mortals.framework.common.IBaseEnum
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 区域级别
*
* @author yiqimin
* @create 2018/09/26
*/
public
enum
AreaLevelEnum
implements
IBaseEnum
{
PROVINCE
(
1
,
"省"
,
SysConstains
.
STYLE_DEFAULT
),
CITY
(
2
,
"市"
,
SysConstains
.
STYLE_DEFAULT
),
AREA
(
3
,
"区/县"
,
SysConstains
.
STYLE_DEFAULT
),
TOWN
(
4
,
"镇"
,
SysConstains
.
STYLE_DEFAULT
);
private
int
value
;
* 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)枚举类
*
* @author zxfei
*/
public
enum
AreaLevelEnum
{
省
(
1
,
"省"
),
地市州
(
2
,
"地市州"
),
区县
(
3
,
"区县"
),
街道
(
4
,
"街道"
),
社区
(
5
,
"社区"
);
private
Integer
value
;
private
String
desc
;
private
String
style
;
AreaLevelEnum
(
int
value
,
String
desc
,
String
style
)
{
AreaLevelEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
this
.
style
=
style
;
}
@Override
public
int
getValue
()
{
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
desc
;
return
this
.
desc
;
}
public
String
getStyle
()
{
return
style
;
}
public
static
AreaLevelEnum
getByValue
(
int
value
)
{
for
(
AreaLevelEnum
e
:
AreaLevelEnum
.
values
())
{
if
(
e
.
getValue
()
==
value
)
{
return
e
;
public
static
AreaLevelEnum
getByValue
(
Integer
value
)
{
for
(
AreaLevelEnum
areaLevelEnum
:
AreaLevelEnum
.
values
())
{
if
(
areaLevelEnum
.
getValue
()
==
value
)
{
return
areaLevelEnum
;
}
}
return
null
;
}
public
static
Map
<
String
,
String
>
getEnumMap
(
int
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<
String
,
String
>();
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
AreaLevelEnum
item
:
AreaLevelEnum
.
values
())
{
try
{
try
{
boolean
hasE
=
false
;
for
(
int
e
:
eItem
)
{
if
(
item
.
getValue
()==
e
)
{
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
){
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveGetDeptEnum.java
0 → 100644
View file @
23fcd536
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 是否获取部门(true.是,false.否)枚举类
*
* @author zxfei
*/
public
enum
HaveGetDeptEnum
{
是
(
"true"
,
"是"
),
否
(
"false"
,
"否"
);
private
String
value
;
private
String
desc
;
HaveGetDeptEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
HaveGetDeptEnum
getByValue
(
String
value
)
{
for
(
HaveGetDeptEnum
haveGetDeptEnum
:
HaveGetDeptEnum
.
values
())
{
if
(
haveGetDeptEnum
.
getValue
()
==
value
)
{
return
haveGetDeptEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
HaveGetDeptEnum
item
:
HaveGetDeptEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveGetMatterListEnum.java
0 → 100644
View file @
23fcd536
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 是否获取事项列表(true.是,false.否)枚举类
*
* @author zxfei
*/
public
enum
HaveGetMatterListEnum
{
是
(
"true"
,
"是"
),
否
(
"false"
,
"否"
);
private
String
value
;
private
String
desc
;
HaveGetMatterListEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
HaveGetMatterListEnum
getByValue
(
String
value
)
{
for
(
HaveGetMatterListEnum
haveGetMatterListEnum
:
HaveGetMatterListEnum
.
values
())
{
if
(
haveGetMatterListEnum
.
getValue
()
==
value
)
{
return
haveGetMatterListEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
HaveGetMatterListEnum
item
:
HaveGetMatterListEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveSonAreaEnum.java
0 → 100644
View file @
23fcd536
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 是否有下级区域(True.是,False.否)枚举类
*
* @author zxfei
*/
public
enum
HaveSonAreaEnum
{
是
(
"True"
,
"是"
),
否
(
"False"
,
"否"
);
private
String
value
;
private
String
desc
;
HaveSonAreaEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
HaveSonAreaEnum
getByValue
(
String
value
)
{
for
(
HaveSonAreaEnum
haveSonAreaEnum
:
HaveSonAreaEnum
.
values
())
{
if
(
haveSonAreaEnum
.
getValue
()
==
value
)
{
return
haveSonAreaEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
HaveSonAreaEnum
item
:
HaveSonAreaEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/common/code/HaveSonDeptEnum.java
0 → 100644
View file @
23fcd536
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 是否有下级部门(True.是,False.否)枚举类
*
* @author zxfei
*/
public
enum
HaveSonDeptEnum
{
是
(
"True"
,
"是"
),
否
(
"False"
,
"否"
);
private
String
value
;
private
String
desc
;
HaveSonDeptEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
HaveSonDeptEnum
getByValue
(
String
value
)
{
for
(
HaveSonDeptEnum
haveSonDeptEnum
:
HaveSonDeptEnum
.
values
())
{
if
(
haveSonDeptEnum
.
getValue
()
==
value
)
{
return
haveSonDeptEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
HaveSonDeptEnum
item
:
HaveSonDeptEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/common/code/StatusEnum.java
0 → 100644
View file @
23fcd536
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 区域状态 (0.停用,1.正常)枚举类
*
* @author zxfei
*/
public
enum
StatusEnum
{
停用
(
0
,
"停用"
),
正常
(
1
,
"正常"
);
private
Integer
value
;
private
String
desc
;
StatusEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
StatusEnum
getByValue
(
Integer
value
)
{
for
(
StatusEnum
statusEnum
:
StatusEnum
.
values
())
{
if
(
statusEnum
.
getValue
()
==
value
)
{
return
statusEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
StatusEnum
item
:
StatusEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/module/base/dao/BaseAreaDao.java
View file @
23fcd536
...
...
@@ -2,16 +2,23 @@ package com.mortals.xhx.module.base.dao;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
java.util.List
;
/**
* 区域Dao
* 区域 DAO接口
*
* @author zxfei
* @date 202
2-11-22
* @date 202
4-11-01
*/
public
interface
BaseAreaDao
extends
ICRUDDao
<
BaseAreaEntity
,
Long
>{
/**
* 查询子节点
*
* @param
* @return
*/
List
<
BaseAreaEntity
>
selectChildrenBaseAreaById
(
String
baseAreaId
);
}
setup-project-manager/src/main/java/com/mortals/xhx/module/base/dao/ibatis/BaseAreaDaoImpl.java
View file @
23fcd536
package
com.mortals.xhx.module.base.dao.ibatis
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
org.springframework.stereotype.Repository
;
import
com.mortals.xhx.module.base.dao.BaseAreaDao
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
java.util.List
;
/**
* 区域DaoImpl DAO接口
*
* @author zxfei
* @date 202
2-11-22
* @date 202
4-11-01
*/
@Repository
(
"baseAreaDao"
)
public
class
BaseAreaDaoImpl
extends
BaseCRUDDaoMybatis
<
BaseAreaEntity
,
Long
>
implements
BaseAreaDao
{
@Override
public
List
<
BaseAreaEntity
>
selectChildrenBaseAreaById
(
String
baseAreaId
)
{
return
getSqlSession
().
selectList
(
getSqlId
(
"selectChildrenBaseAreaById"
),
baseAreaId
);
}
}
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaEntity.java
View file @
23fcd536
package
com.mortals.xhx.module.base.model
;
import
java.util.List
;
import
java.util.ArrayList
;
import
java.math.BigDecimal
;
import
cn.hutool.core.date.DateUtil
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.base.model.vo.BaseAreaVo
;
import
lombok.Data
;
/**
* 区域实体对象
*
* @author zxfei
* @date 202
2-11-22
* @date 202
4-11-01
*/
@Data
public
class
BaseAreaEntity
extends
BaseAreaVo
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -63,196 +71,6 @@ public class BaseAreaEntity extends BaseAreaVo {
* 区域状态 (0.停用,1.正常)
*/
private
Integer
status
;
public
BaseAreaEntity
(){}
/**
* 获取 祖级列表,逗号分隔
* @return String
*/
public
String
getAncestors
(){
return
ancestors
;
}
/**
* 设置 祖级列表,逗号分隔
* @param ancestors
*/
public
void
setAncestors
(
String
ancestors
){
this
.
ancestors
=
ancestors
;
}
/**
* 获取 区域名称
* @return String
*/
public
String
getName
(){
return
name
;
}
/**
* 设置 区域名称
* @param name
*/
public
void
setName
(
String
name
){
this
.
name
=
name
;
}
/**
* 获取 一体化的ID号
* @return String
*/
public
String
getIid
(){
return
iid
;
}
/**
* 设置 一体化的ID号
* @param iid
*/
public
void
setIid
(
String
iid
){
this
.
iid
=
iid
;
}
/**
* 获取 一体化的父id
* @return String
*/
public
String
getPid
(){
return
pid
;
}
/**
* 设置 一体化的父id
* @param pid
*/
public
void
setPid
(
String
pid
){
this
.
pid
=
pid
;
}
/**
* 获取 是否有下级区域(True.是,False.否)
* @return String
*/
public
String
getHaveSonArea
(){
return
haveSonArea
;
}
/**
* 设置 是否有下级区域(True.是,False.否)
* @param haveSonArea
*/
public
void
setHaveSonArea
(
String
haveSonArea
){
this
.
haveSonArea
=
haveSonArea
;
}
/**
* 获取 是否有下级部门(True.是,False.否)
* @return String
*/
public
String
getHaveSonDept
(){
return
haveSonDept
;
}
/**
* 设置 是否有下级部门(True.是,False.否)
* @param haveSonDept
*/
public
void
setHaveSonDept
(
String
haveSonDept
){
this
.
haveSonDept
=
haveSonDept
;
}
/**
* 获取 是否获取部门(true.是,false.否)
* @return String
*/
public
String
getHaveGetDept
(){
return
haveGetDept
;
}
/**
* 设置 是否获取部门(true.是,false.否)
* @param haveGetDept
*/
public
void
setHaveGetDept
(
String
haveGetDept
){
this
.
haveGetDept
=
haveGetDept
;
}
/**
* 获取 是否获取事项列表(true.是,false.否)
* @return String
*/
public
String
getHaveGetMatterList
(){
return
haveGetMatterList
;
}
/**
* 设置 是否获取事项列表(true.是,false.否)
* @param haveGetMatterList
*/
public
void
setHaveGetMatterList
(
String
haveGetMatterList
){
this
.
haveGetMatterList
=
haveGetMatterList
;
}
/**
* 获取 区域编码
* @return String
*/
public
String
getAreaCode
(){
return
areaCode
;
}
/**
* 设置 区域编码
* @param areaCode
*/
public
void
setAreaCode
(
String
areaCode
){
this
.
areaCode
=
areaCode
;
}
/**
* 获取 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
* @return Integer
*/
public
Integer
getAreaLevel
(){
return
areaLevel
;
}
/**
* 设置 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
* @param areaLevel
*/
public
void
setAreaLevel
(
Integer
areaLevel
){
this
.
areaLevel
=
areaLevel
;
}
/**
* 获取 名称简称
* @return String
*/
public
String
getShortName
(){
return
shortName
;
}
/**
* 设置 名称简称
* @param shortName
*/
public
void
setShortName
(
String
shortName
){
this
.
shortName
=
shortName
;
}
/**
* 获取 访问地址
* @return String
*/
public
String
getDomain
(){
return
domain
;
}
/**
* 设置 访问地址
* @param domain
*/
public
void
setDomain
(
String
domain
){
this
.
domain
=
domain
;
}
/**
* 获取 区域状态 (0.停用,1.正常)
* @return Integer
*/
public
Integer
getStatus
(){
return
status
;
}
/**
* 设置 区域状态 (0.停用,1.正常)
* @param status
*/
public
void
setStatus
(
Integer
status
){
this
.
status
=
status
;
}
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
...
...
@@ -269,50 +87,19 @@ public class BaseAreaEntity extends BaseAreaVo {
return
false
;
}
public
String
toString
(){
StringBuilder
sb
=
new
StringBuilder
(
""
);
sb
.
append
(
",ancestors:"
).
append
(
getAncestors
());
sb
.
append
(
",name:"
).
append
(
getName
());
sb
.
append
(
",iid:"
).
append
(
getIid
());
sb
.
append
(
",pid:"
).
append
(
getPid
());
sb
.
append
(
",haveSonArea:"
).
append
(
getHaveSonArea
());
sb
.
append
(
",haveSonDept:"
).
append
(
getHaveSonDept
());
sb
.
append
(
",haveGetDept:"
).
append
(
getHaveGetDept
());
sb
.
append
(
",haveGetMatterList:"
).
append
(
getHaveGetMatterList
());
sb
.
append
(
",areaCode:"
).
append
(
getAreaCode
());
sb
.
append
(
",areaLevel:"
).
append
(
getAreaLevel
());
sb
.
append
(
",shortName:"
).
append
(
getShortName
());
sb
.
append
(
",domain:"
).
append
(
getDomain
());
sb
.
append
(
",status:"
).
append
(
getStatus
());
return
sb
.
toString
();
}
public
void
initAttrValue
(){
this
.
ancestors
=
""
;
this
.
name
=
null
;
this
.
iid
=
null
;
this
.
pid
=
null
;
this
.
haveSonArea
=
null
;
this
.
haveSonDept
=
null
;
this
.
haveGetDept
=
null
;
this
.
haveGetMatterList
=
null
;
this
.
areaCode
=
null
;
this
.
name
=
""
;
this
.
iid
=
""
;
this
.
pid
=
""
;
this
.
haveSonArea
=
""
;
this
.
haveSonDept
=
""
;
this
.
haveGetDept
=
""
;
this
.
haveGetMatterList
=
""
;
this
.
areaCode
=
""
;
this
.
areaLevel
=
1
;
this
.
shortName
=
null
;
this
.
domain
=
null
;
this
.
shortName
=
""
;
this
.
domain
=
""
;
this
.
status
=
1
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaQuery.java
View file @
23fcd536
package
com.mortals.xhx.module.base.model
;
import
java.util.List
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
/**
* 区域查询对象
*
* @author zxfei
* @date 202
2-11-22
* @date 202
4-11-01
*/
public
class
BaseAreaQuery
extends
BaseAreaEntity
{
/** 开始 序号,主键,自增长 */
...
...
@@ -21,33 +21,54 @@ public class BaseAreaQuery extends BaseAreaEntity {
/** 序号,主键,自增长列表 */
private
List
<
Long
>
idList
;
/** 序号,主键,自增长排除列表 */
private
List
<
Long
>
idNotList
;
/** 祖级列表,逗号分隔 */
private
List
<
String
>
ancestorsList
;
/** 祖级列表,逗号分隔排除列表 */
private
List
<
String
>
ancestorsNotList
;
/** 区域名称 */
private
List
<
String
>
nameList
;
/** 区域名称排除列表 */
private
List
<
String
>
nameNotList
;
/** 一体化的ID号 */
private
List
<
String
>
iidList
;
/** 一体化的ID号排除列表 */
private
List
<
String
>
iidNotList
;
/** 一体化的父id */
private
List
<
String
>
pidList
;
/** 一体化的父id排除列表 */
private
List
<
String
>
pidNotList
;
/** 是否有下级区域(True.是,False.否) */
private
List
<
String
>
haveSonAreaList
;
/** 是否有下级区域(True.是,False.否)排除列表 */
private
List
<
String
>
haveSonAreaNotList
;
/** 是否有下级部门(True.是,False.否) */
private
List
<
String
>
haveSonDeptList
;
/** 是否有下级部门(True.是,False.否)排除列表 */
private
List
<
String
>
haveSonDeptNotList
;
/** 是否获取部门(true.是,false.否) */
private
List
<
String
>
haveGetDeptList
;
/** 是否获取部门(true.是,false.否)排除列表 */
private
List
<
String
>
haveGetDeptNotList
;
/** 是否获取事项列表(true.是,false.否) */
private
List
<
String
>
haveGetMatterListList
;
/** 是否获取事项列表(true.是,false.否)排除列表 */
private
List
<
String
>
haveGetMatterListNotList
;
/** 区域编码 */
private
List
<
String
>
areaCodeList
;
/** 区域编码排除列表 */
private
List
<
String
>
areaCodeNotList
;
/** 开始 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区) */
private
Integer
areaLevelStart
;
...
...
@@ -60,12 +81,19 @@ public class BaseAreaQuery extends BaseAreaEntity {
/** 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)列表 */
private
List
<
Integer
>
areaLevelList
;
/** 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)排除列表 */
private
List
<
Integer
>
areaLevelNotList
;
/** 名称简称 */
private
List
<
String
>
shortNameList
;
/** 名称简称排除列表 */
private
List
<
String
>
shortNameNotList
;
/** 访问地址 */
private
List
<
String
>
domainList
;
/** 访问地址排除列表 */
private
List
<
String
>
domainNotList
;
/** 开始 区域状态 (0.停用,1.正常) */
private
Integer
statusStart
;
...
...
@@ -78,6 +106,9 @@ public class BaseAreaQuery extends BaseAreaEntity {
/** 区域状态 (0.停用,1.正常)列表 */
private
List
<
Integer
>
statusList
;
/** 区域状态 (0.停用,1.正常)排除列表 */
private
List
<
Integer
>
statusNotList
;
/** 开始 创建时间 */
private
String
createTimeStart
;
...
...
@@ -96,6 +127,9 @@ public class BaseAreaQuery extends BaseAreaEntity {
/** 创建用户列表 */
private
List
<
Long
>
createUserIdList
;
/** 创建用户排除列表 */
private
List
<
Long
>
createUserIdNotList
;
/** 开始 修改时间 */
private
String
updateTimeStart
;
...
...
@@ -174,6 +208,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
this
.
idList
=
idList
;
}
/**
* 获取 序号,主键,自增长
* @return idNotList
*/
public
List
<
Long
>
getIdNotList
(){
return
this
.
idNotList
;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public
void
setIdNotList
(
List
<
Long
>
idNotList
){
this
.
idNotList
=
idNotList
;
}
/**
* 获取 祖级列表,逗号分隔
* @return ancestorsList
...
...
@@ -189,6 +240,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setAncestorsList
(
List
<
String
>
ancestorsList
){
this
.
ancestorsList
=
ancestorsList
;
}
/**
* 获取 祖级列表,逗号分隔
* @return ancestorsNotList
*/
public
List
<
String
>
getAncestorsNotList
(){
return
this
.
ancestorsNotList
;
}
/**
* 设置 祖级列表,逗号分隔
* @param ancestorsNotList
*/
public
void
setAncestorsNotList
(
List
<
String
>
ancestorsNotList
){
this
.
ancestorsNotList
=
ancestorsNotList
;
}
/**
* 获取 区域名称
* @return nameList
...
...
@@ -204,6 +272,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setNameList
(
List
<
String
>
nameList
){
this
.
nameList
=
nameList
;
}
/**
* 获取 区域名称
* @return nameNotList
*/
public
List
<
String
>
getNameNotList
(){
return
this
.
nameNotList
;
}
/**
* 设置 区域名称
* @param nameNotList
*/
public
void
setNameNotList
(
List
<
String
>
nameNotList
){
this
.
nameNotList
=
nameNotList
;
}
/**
* 获取 一体化的ID号
* @return iidList
...
...
@@ -219,6 +304,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setIidList
(
List
<
String
>
iidList
){
this
.
iidList
=
iidList
;
}
/**
* 获取 一体化的ID号
* @return iidNotList
*/
public
List
<
String
>
getIidNotList
(){
return
this
.
iidNotList
;
}
/**
* 设置 一体化的ID号
* @param iidNotList
*/
public
void
setIidNotList
(
List
<
String
>
iidNotList
){
this
.
iidNotList
=
iidNotList
;
}
/**
* 获取 一体化的父id
* @return pidList
...
...
@@ -234,6 +336,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setPidList
(
List
<
String
>
pidList
){
this
.
pidList
=
pidList
;
}
/**
* 获取 一体化的父id
* @return pidNotList
*/
public
List
<
String
>
getPidNotList
(){
return
this
.
pidNotList
;
}
/**
* 设置 一体化的父id
* @param pidNotList
*/
public
void
setPidNotList
(
List
<
String
>
pidNotList
){
this
.
pidNotList
=
pidNotList
;
}
/**
* 获取 是否有下级区域(True.是,False.否)
* @return haveSonAreaList
...
...
@@ -249,6 +368,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setHaveSonAreaList
(
List
<
String
>
haveSonAreaList
){
this
.
haveSonAreaList
=
haveSonAreaList
;
}
/**
* 获取 是否有下级区域(True.是,False.否)
* @return haveSonAreaNotList
*/
public
List
<
String
>
getHaveSonAreaNotList
(){
return
this
.
haveSonAreaNotList
;
}
/**
* 设置 是否有下级区域(True.是,False.否)
* @param haveSonAreaNotList
*/
public
void
setHaveSonAreaNotList
(
List
<
String
>
haveSonAreaNotList
){
this
.
haveSonAreaNotList
=
haveSonAreaNotList
;
}
/**
* 获取 是否有下级部门(True.是,False.否)
* @return haveSonDeptList
...
...
@@ -264,6 +400,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setHaveSonDeptList
(
List
<
String
>
haveSonDeptList
){
this
.
haveSonDeptList
=
haveSonDeptList
;
}
/**
* 获取 是否有下级部门(True.是,False.否)
* @return haveSonDeptNotList
*/
public
List
<
String
>
getHaveSonDeptNotList
(){
return
this
.
haveSonDeptNotList
;
}
/**
* 设置 是否有下级部门(True.是,False.否)
* @param haveSonDeptNotList
*/
public
void
setHaveSonDeptNotList
(
List
<
String
>
haveSonDeptNotList
){
this
.
haveSonDeptNotList
=
haveSonDeptNotList
;
}
/**
* 获取 是否获取部门(true.是,false.否)
* @return haveGetDeptList
...
...
@@ -279,6 +432,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setHaveGetDeptList
(
List
<
String
>
haveGetDeptList
){
this
.
haveGetDeptList
=
haveGetDeptList
;
}
/**
* 获取 是否获取部门(true.是,false.否)
* @return haveGetDeptNotList
*/
public
List
<
String
>
getHaveGetDeptNotList
(){
return
this
.
haveGetDeptNotList
;
}
/**
* 设置 是否获取部门(true.是,false.否)
* @param haveGetDeptNotList
*/
public
void
setHaveGetDeptNotList
(
List
<
String
>
haveGetDeptNotList
){
this
.
haveGetDeptNotList
=
haveGetDeptNotList
;
}
/**
* 获取 是否获取事项列表(true.是,false.否)
* @return haveGetMatterListList
...
...
@@ -294,6 +464,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setHaveGetMatterListList
(
List
<
String
>
haveGetMatterListList
){
this
.
haveGetMatterListList
=
haveGetMatterListList
;
}
/**
* 获取 是否获取事项列表(true.是,false.否)
* @return haveGetMatterListNotList
*/
public
List
<
String
>
getHaveGetMatterListNotList
(){
return
this
.
haveGetMatterListNotList
;
}
/**
* 设置 是否获取事项列表(true.是,false.否)
* @param haveGetMatterListNotList
*/
public
void
setHaveGetMatterListNotList
(
List
<
String
>
haveGetMatterListNotList
){
this
.
haveGetMatterListNotList
=
haveGetMatterListNotList
;
}
/**
* 获取 区域编码
* @return areaCodeList
...
...
@@ -309,6 +496,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setAreaCodeList
(
List
<
String
>
areaCodeList
){
this
.
areaCodeList
=
areaCodeList
;
}
/**
* 获取 区域编码
* @return areaCodeNotList
*/
public
List
<
String
>
getAreaCodeNotList
(){
return
this
.
areaCodeNotList
;
}
/**
* 设置 区域编码
* @param areaCodeNotList
*/
public
void
setAreaCodeNotList
(
List
<
String
>
areaCodeNotList
){
this
.
areaCodeNotList
=
areaCodeNotList
;
}
/**
* 获取 开始 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
* @return areaLevelStart
...
...
@@ -373,6 +577,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
this
.
areaLevelList
=
areaLevelList
;
}
/**
* 获取 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
* @return areaLevelNotList
*/
public
List
<
Integer
>
getAreaLevelNotList
(){
return
this
.
areaLevelNotList
;
}
/**
* 设置 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
* @param areaLevelNotList
*/
public
void
setAreaLevelNotList
(
List
<
Integer
>
areaLevelNotList
){
this
.
areaLevelNotList
=
areaLevelNotList
;
}
/**
* 获取 名称简称
* @return shortNameList
...
...
@@ -388,6 +609,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setShortNameList
(
List
<
String
>
shortNameList
){
this
.
shortNameList
=
shortNameList
;
}
/**
* 获取 名称简称
* @return shortNameNotList
*/
public
List
<
String
>
getShortNameNotList
(){
return
this
.
shortNameNotList
;
}
/**
* 设置 名称简称
* @param shortNameNotList
*/
public
void
setShortNameNotList
(
List
<
String
>
shortNameNotList
){
this
.
shortNameNotList
=
shortNameNotList
;
}
/**
* 获取 访问地址
* @return domainList
...
...
@@ -403,6 +641,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
public
void
setDomainList
(
List
<
String
>
domainList
){
this
.
domainList
=
domainList
;
}
/**
* 获取 访问地址
* @return domainNotList
*/
public
List
<
String
>
getDomainNotList
(){
return
this
.
domainNotList
;
}
/**
* 设置 访问地址
* @param domainNotList
*/
public
void
setDomainNotList
(
List
<
String
>
domainNotList
){
this
.
domainNotList
=
domainNotList
;
}
/**
* 获取 开始 区域状态 (0.停用,1.正常)
* @return statusStart
...
...
@@ -467,6 +722,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
this
.
statusList
=
statusList
;
}
/**
* 获取 区域状态 (0.停用,1.正常)
* @return statusNotList
*/
public
List
<
Integer
>
getStatusNotList
(){
return
this
.
statusNotList
;
}
/**
* 设置 区域状态 (0.停用,1.正常)
* @param statusNotList
*/
public
void
setStatusNotList
(
List
<
Integer
>
statusNotList
){
this
.
statusNotList
=
statusNotList
;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
...
...
@@ -563,6 +835,23 @@ public class BaseAreaQuery extends BaseAreaEntity {
this
.
createUserIdList
=
createUserIdList
;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public
List
<
Long
>
getCreateUserIdNotList
(){
return
this
.
createUserIdNotList
;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public
void
setCreateUserIdNotList
(
List
<
Long
>
createUserIdNotList
){
this
.
createUserIdNotList
=
createUserIdNotList
;
}
/**
* 获取 开始 修改时间
* @return updateTimeStart
...
...
@@ -640,6 +929,15 @@ public class BaseAreaQuery extends BaseAreaEntity {
return
this
;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public
BaseAreaQuery
idNotList
(
List
<
Long
>
idNotList
){
this
.
idNotList
=
idNotList
;
return
this
;
}
/**
* 设置 祖级列表,逗号分隔
...
...
@@ -856,6 +1154,15 @@ public class BaseAreaQuery extends BaseAreaEntity {
return
this
;
}
/**
* 设置 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
* @param areaLevelNotList
*/
public
BaseAreaQuery
areaLevelNotList
(
List
<
Integer
>
areaLevelNotList
){
this
.
areaLevelNotList
=
areaLevelNotList
;
return
this
;
}
/**
* 设置 名称简称
...
...
@@ -939,6 +1246,15 @@ public class BaseAreaQuery extends BaseAreaEntity {
return
this
;
}
/**
* 设置 区域状态 (0.停用,1.正常)
* @param statusNotList
*/
public
BaseAreaQuery
statusNotList
(
List
<
Integer
>
statusNotList
){
this
.
statusNotList
=
statusNotList
;
return
this
;
}
/**
* 设置 创建用户
...
...
@@ -985,6 +1301,15 @@ public class BaseAreaQuery extends BaseAreaEntity {
return
this
;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public
BaseAreaQuery
createUserIdNotList
(
List
<
Long
>
createUserIdNotList
){
this
.
createUserIdNotList
=
createUserIdNotList
;
return
this
;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
...
...
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaTreeSelect.java
0 → 100644
View file @
23fcd536
package
com.mortals.xhx.module.base.model
;
import
java.lang.reflect.Type
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.mortals.xhx.module.base.model.vo.BaseAreaVo
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.parser.DefaultJSONParser
;
import
com.alibaba.fastjson.parser.JSONToken
;
import
com.alibaba.fastjson.parser.deserializer.ObjectDeserializer
;
import
org.springframework.util.ObjectUtils
;
/**
* 区域前端映射树结构实体类
*
* @author zxfei
* @date 2024-11-01
*/
@Data
public
class
BaseAreaTreeSelect
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 节点ID
*/
private
Long
id
;
/**
* 节点名称
*/
private
String
label
;
/**
* 区域编码
*/
private
String
areaCode
;
/**
* 是否叶子节点
*/
private
Boolean
isLeaf
;
/**
* 节点类型
*/
private
String
type
;
/**
* 图标
*/
private
String
icon
;
/**
* 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
*/
private
Integer
areaLevel
;
/**
* 子节点
*/
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
private
List
<
BaseAreaTreeSelect
>
children
;
public
BaseAreaTreeSelect
()
{};
public
BaseAreaTreeSelect
(
BaseAreaEntity
entity
)
{
this
.
id
=
entity
.
getId
();
this
.
label
=
entity
.
getName
();
if
(
"False"
.
equalsIgnoreCase
(
entity
.
getHaveSonArea
()))
{
this
.
isLeaf
=
true
;
this
.
children
=
new
ArrayList
();
}
else
{
this
.
isLeaf
=
false
;
}
this
.
areaCode
=
entity
.
getAreaCode
();
this
.
areaLevel
=
entity
.
getAreaLevel
();
this
.
type
=
"area"
;
this
.
icon
=
"el-icon-folder"
;
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getChildren
())){
this
.
children
=
entity
.
getChildren
().
stream
().
map
(
BaseAreaTreeSelect:
:
new
).
collect
(
Collectors
.
toList
());
}
}
// 反序列化器
public
class
Deserializer
implements
ObjectDeserializer
{
@Override
public
BaseAreaTreeSelect
deserialze
(
DefaultJSONParser
parser
,
Type
type
,
Object
fieldName
)
{
BaseAreaTreeSelect
node
=
new
BaseAreaTreeSelect
();
JSONObject
jsonObject
=
parser
.
parseObject
();
node
.
setId
(
jsonObject
.
getLong
(
"id"
));
node
.
setLabel
(
jsonObject
.
getString
(
"label"
));
JSONArray
jsonArray
=
jsonObject
.
getJSONArray
(
"children"
);
List
<
BaseAreaTreeSelect
>
children
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
)){
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
BaseAreaTreeSelect
child
=
JSON
.
parseObject
(
jsonArray
.
getJSONObject
(
i
).
toJSONString
(),
BaseAreaTreeSelect
.
class
);
children
.
add
(
child
);
}
}
node
.
setChildren
(
children
);
return
node
;
}
@Override
public
int
getFastMatchToken
()
{
return
JSONToken
.
LBRACE
;
}
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/module/base/model/vo/BaseAreaVo.java
View file @
23fcd536
package
com.mortals.xhx.module.base.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
import
lombok.Data
;
import
com.mortals.framework.annotation.Excel
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 区域视图对象
*
* @author zxfei
* @date 2022-11-22
*/
* 区域视图对象
*
* @author zxfei
* @date 2024-11-01
*/
@Data
public
class
BaseAreaVo
extends
BaseEntityLong
{
private
List
<
BaseAreaEntity
>
children
=
new
ArrayList
<>();
/** 序号,主键,自增长列表 */
private
List
<
Long
>
idList
;
/** 子区域 */
private
List
<
BaseAreaEntity
>
children
=
new
ArrayList
<>();
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/module/base/service/BaseAreaService.java
View file @
23fcd536
package
com.mortals.xhx.module.base.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
com.mortals.xhx.module.base.model.BaseAreaTreeSelect
;
import
java.util.List
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
/**
* BaseAreaService
* <p>
* 区域 service接口
*
* @author zxfei
* @date 2022-11-22
*/
public
interface
BaseAreaService
extends
ICRUDService
<
BaseAreaEntity
,
Long
>
{
* BaseAreaService
*
* 区域 service接口
*
* @author zxfei
* @date 2024-11-01
*/
public
interface
BaseAreaService
extends
ICRUDService
<
BaseAreaEntity
,
Long
>{
/**
* 是否存在区域节点
*
* @param baseAreaId 区域ID
* @return 结果
*/
boolean
hasChildByBaseAreaId
(
String
baseAreaId
);
/**
* 构建前端所需要下拉树结构
*
* @param baseAreaList 区域列表
* @return 下拉树结构列表
*/
List
<
BaseAreaTreeSelect
>
buildBaseAreaTreeSelect
(
List
<
BaseAreaEntity
>
baseAreaList
);
/**
* 根据父id查询子节点
* @param parentId
* @param context
* @return
*/
List
<
BaseAreaTreeSelect
>
getListByParentId
(
String
parentId
,
Context
context
);
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/module/base/service/impl/BaseAreaServiceImpl.java
View file @
23fcd536
package
com.mortals.xhx.module.base.service.impl
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.base.dao.BaseAreaDao
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
com.mortals.xhx.module.base.model.BaseAreaQuery
;
import
com.mortals.xhx.module.base.service.BaseAreaService
;
import
org.springframework.stereotype.Service
;
import
com.mortals.xhx.module.base.model.BaseAreaTreeSelect
;
import
org.springframework.util.ObjectUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* BaseAreaService
* 区域 service实现
*
* @author zxfei
* @date 2022-11-22
*/
* BaseAreaService
* 区域 service实现
*
* @author zxfei
* @date 2024-11-01
*/
@Service
(
"baseAreaService"
)
public
class
BaseAreaServiceImpl
extends
AbstractCRUDServiceImpl
<
BaseAreaDao
,
BaseAreaEntity
,
Long
>
implements
BaseAreaService
{
/**
* 修改子元素关系
*
* @param baseAreaId 被修改的区域ID
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
*/
public
void
updateBaseAreaChildren
(
Long
baseAreaId
,
String
newAncestors
,
String
oldAncestors
,
Context
context
)
{
List
<
BaseAreaEntity
>
children
=
getDao
().
selectChildrenBaseAreaById
(
baseAreaId
.
toString
());
for
(
BaseAreaEntity
child
:
children
)
{
child
.
setAncestors
(
child
.
getAncestors
().
replace
(
oldAncestors
,
newAncestors
));
}
if
(
children
.
size
()
>
0
)
{
this
.
updateAfter
(
children
,
context
);
}
}
@Override
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
//有子节点 禁止删除
if
(!
ObjectUtils
.
isEmpty
(
ids
))
{
BaseAreaEntity
baseAreaEntity
=
this
.
get
(
ids
[
0
]);
if
(
hasChildByBaseAreaId
(
baseAreaEntity
.
getIid
())){
throw
new
AppException
(
"存在下级区域,不允许删除"
);
}
}
super
.
removeBefore
(
ids
,
context
);
}
@Override
public
boolean
hasChildByBaseAreaId
(
String
baseAreaId
)
{
List
<
BaseAreaEntity
>
list
=
this
.
find
(
new
BaseAreaQuery
().
pid
(
baseAreaId
));
return
list
.
size
()
>
0
?
true
:
false
;
}
@Override
public
List
<
BaseAreaTreeSelect
>
buildBaseAreaTreeSelect
(
List
<
BaseAreaEntity
>
list
)
{
List
<
BaseAreaEntity
>
returnList
=
new
ArrayList
<>();
List
<
Long
>
tempList
=
list
.
stream
().
map
(
BaseAreaEntity:
:
getId
).
collect
(
Collectors
.
toList
());
for
(
Iterator
<
BaseAreaEntity
>
iterator
=
list
.
iterator
();
iterator
.
hasNext
();
)
{
BaseAreaEntity
baseAreaEntity
=
iterator
.
next
();
if
(!
tempList
.
contains
(
baseAreaEntity
.
getPid
()))
{
recursionFn
(
list
,
baseAreaEntity
);
returnList
.
add
(
baseAreaEntity
);
}
}
if
(
returnList
.
isEmpty
())
{
returnList
=
list
;
}
return
returnList
.
stream
().
map
(
BaseAreaTreeSelect:
:
new
).
collect
(
Collectors
.
toList
());
}
/**
* 递归列表
*/
private
void
recursionFn
(
List
<
BaseAreaEntity
>
list
,
BaseAreaEntity
t
)
{
// 得到子节点列表
List
<
BaseAreaEntity
>
childList
=
getChildList
(
list
,
t
);
t
.
setChildren
(
childList
);
for
(
BaseAreaEntity
tChild
:
childList
)
{
if
(
hasChild
(
list
,
tChild
))
{
recursionFn
(
list
,
tChild
);
}
}
}
/**
* 判断是否有子节点
*/
private
boolean
hasChild
(
List
<
BaseAreaEntity
>
list
,
BaseAreaEntity
t
)
{
return
getChildList
(
list
,
t
).
size
()
>
0
?
true
:
false
;
}
/**
* 得到子节点列表
*/
private
List
<
BaseAreaEntity
>
getChildList
(
List
<
BaseAreaEntity
>
list
,
BaseAreaEntity
t
)
{
return
list
.
stream
().
map
(
item
->{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getPid
())
&&
item
.
getPid
().
equals
(
t
.
getIid
()))
{
return
item
;
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
BaseAreaTreeSelect
>
getListByParentId
(
String
parentId
,
Context
context
)
{
if
(
ObjectUtils
.
isEmpty
(
parentId
))
{
parentId
=
"0"
;
}
//只做一层
List
<
BaseAreaTreeSelect
>
collect
=
this
.
find
(
new
BaseAreaQuery
().
pid
(
parentId
),
context
).
stream
().
map
(
item
->
new
BaseAreaTreeSelect
(
item
)
).
collect
(
Collectors
.
toList
());
return
collect
;
}
}
\ No newline at end of file
setup-project-manager/src/main/java/com/mortals/xhx/module/base/web/BaseAreaController.java
View file @
23fcd536
package
com.mortals.xhx.module.base.web
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
com.mortals.xhx.module.base.service.BaseAreaService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.mortals.framework.model.Context
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
com.mortals.xhx.module.base.service.BaseAreaService
;
import
com.mortals.xhx.module.base.model.BaseAreaQuery
;
import
com.mortals.xhx.module.base.model.BaseAreaTreeSelect
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
import
com.mortals.xhx.common.code.*
;
/**
* 区域
*
* @author zxfei
* @date 2022-11-22
*/
*
* 区域
*
* @author zxfei
* @date 2024-11-01
*/
@RestController
@RequestMapping
(
"base/area"
)
public
class
BaseAreaController
extends
BaseCRUDJsonBodyMappingController
<
BaseAreaService
,
BaseAreaEntity
,
Long
>
{
public
class
BaseAreaController
extends
BaseCRUDJsonBodyMappingController
<
BaseAreaService
,
BaseAreaEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
@Autowired
private
ICacheService
cacheService
;
public
BaseAreaController
()
{
super
.
setModuleDesc
(
"区域"
);
public
BaseAreaController
(){
super
.
setModuleDesc
(
"区域"
);
}
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"haveSonArea"
,
paramService
.
getParamBySecondOrganize
(
"BaseArea"
,
"haveSonArea"
));
this
.
addDict
(
model
,
"haveSonDept"
,
paramService
.
getParamBySecondOrganize
(
"BaseArea"
,
"haveSonDept"
));
this
.
addDict
(
model
,
"haveGetDept"
,
paramService
.
getParamBySecondOrganize
(
"BaseArea"
,
"haveGetDept"
));
this
.
addDict
(
model
,
"haveGetMatterList"
,
paramService
.
getParamBySecondOrganize
(
"BaseArea"
,
"haveGetMatterList"
));
this
.
addDict
(
model
,
"areaLevel"
,
paramService
.
getParamBySecondOrganize
(
"BaseArea"
,
"areaLevel"
));
this
.
addDict
(
model
,
"status"
,
paramService
.
getParamBySecondOrganize
(
"BaseArea"
,
"status"
));
this
.
addDict
(
model
,
"haveSonArea"
,
HaveSonAreaEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"haveSonDept"
,
HaveSonDeptEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"haveGetDept"
,
HaveGetDeptEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"haveGetMatterList"
,
HaveGetMatterListEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"areaLevel"
,
AreaLevelEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"status"
,
StatusEnum
.
getEnumMap
(
));
super
.
init
(
model
,
context
);
}
/**
* 获取站点下拉树列表
*/
@PostMapping
(
"treeselect"
)
@UnAuth
public
String
treeselect
()
{
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
JSONObject
ret
=
new
JSONObject
();
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
=
VALUE_RESULT_SUCCESS
;
try
{
List
<
BaseAreaEntity
>
list
=
this
.
service
.
find
(
new
BaseAreaQuery
());
List
<
BaseAreaTreeSelect
>
treeSelects
=
this
.
service
.
buildBaseAreaTreeSelect
(
list
);
model
.
put
(
"result"
,
treeSelects
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
code
=
VALUE_RESULT_FAILURE
;
this
.
doException
(
request
,
busiDesc
,
model
,
e
);
}
ret
.
put
(
KEY_RESULT_DATA
,
model
);
ret
.
put
(
KEY_RESULT_CODE
,
code
);
return
ret
.
toJSONString
();
}
/**
* 根据parentId查询子信息
*/
@GetMapping
(
value
=
"getListByParentId"
)
@UnAuth
public
String
getListByParentId
(
String
parentId
)
{
JSONObject
ret
=
new
JSONObject
();
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
()+
"子节点"
;
try
{
List
<
BaseAreaTreeSelect
>
treeList
=
this
.
service
.
getListByParentId
(
parentId
,
getContext
());
model
.
put
(
RESULT_KEY
,
treeList
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_DATA
,
model
);
recordSysLog
(
request
,
busiDesc
+
"【成功】"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"根据parentId查询子信息错误"
,
e
);
this
.
doException
(
request
,
busiDesc
,
model
,
e
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
ret
.
put
(
KEY_RESULT_MSG
,
e
.
getMessage
());
}
return
ret
.
toJSONString
();
}
}
\ No newline at end of file
setup-project-manager/src/main/resources/sqlmap/module/base/BaseAreaMapper.xml
View file @
23fcd536
...
...
@@ -22,10 +22,8 @@
<result
property=
"createTime"
column=
"createTime"
/>
<result
property=
"createUserId"
column=
"createUserId"
/>
<result
property=
"updateTime"
column=
"updateTime"
/>
</resultMap>
<!-- 表所有列 -->
<sql
id=
"_columns"
>
<trim
suffixOverrides=
","
suffix=
""
>
...
...
@@ -364,6 +362,10 @@
</select>
<!-- 获取子节点 -->
<select
id=
"selectChildrenBaseAreaById"
parameterType=
"String"
resultMap=
"BaseAreaEntity-Map"
>
select * from mortals_sys_base_area as a where find_in_set(#{baseAreaId}, ancestors)
</select>
<!-- 获取 -->
<select
id=
"getListCount"
parameterType=
"paramDto"
resultType=
"int"
>
...
...
@@ -413,6 +415,10 @@
<!-- 条件映射-代参数 -->
<sql
id=
"_condition_param_"
>
<bind
name=
"conditionParamRef"
value=
"${_conditionParam_}"
/>
<if
test=
"permissionSql != null and permissionSql != ''"
>
${permissionSql}
</if>
<if
test=
"conditionParamRef.containsKey('id')"
>
<if
test=
"conditionParamRef.id != null"
>
${_conditionType_} a.id=#{${_conditionParam_}.id}
...
...
@@ -426,12 +432,18 @@
${_conditionType_} a.id is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('idList')"
>
<if
test=
"conditionParamRef.containsKey('idList')
and conditionParamRef.idList.size() > 0
"
>
${_conditionType_} a.id in
<foreach
collection=
"conditionParamRef.idList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0"
>
${_conditionType_} a.id not in
<foreach
collection=
"conditionParamRef.idNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null"
>
${_conditionType_} a.id
<![CDATA[ >= ]]>
#{${_conditionParam_}.idStart}
</if>
...
...
@@ -448,12 +460,18 @@
${_conditionType_} a.ancestors is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('ancestorsList')"
>
<if
test=
"conditionParamRef.containsKey('ancestorsList')
and conditionParamRef.ancestorsList.size() > 0
"
>
${_conditionType_} a.ancestors in
<foreach
collection=
"conditionParamRef.ancestorsList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('ancestorsNotList') and conditionParamRef.ancestorsNotList.size() > 0"
>
${_conditionType_} a.ancestors not in
<foreach
collection=
"conditionParamRef.ancestorsNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('name')"
>
<if
test=
"conditionParamRef.name != null and conditionParamRef.name != ''"
>
...
...
@@ -463,12 +481,18 @@
${_conditionType_} a.name is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('nameList')"
>
<if
test=
"conditionParamRef.containsKey('nameList')
and conditionParamRef.nameList.size() > 0
"
>
${_conditionType_} a.name in
<foreach
collection=
"conditionParamRef.nameList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('nameNotList') and conditionParamRef.nameNotList.size() > 0"
>
${_conditionType_} a.name not in
<foreach
collection=
"conditionParamRef.nameNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('iid')"
>
<if
test=
"conditionParamRef.iid != null and conditionParamRef.iid != ''"
>
...
...
@@ -478,12 +502,18 @@
${_conditionType_} a.iid is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('iidList')"
>
<if
test=
"conditionParamRef.containsKey('iidList')
and conditionParamRef.iidList.size() > 0
"
>
${_conditionType_} a.iid in
<foreach
collection=
"conditionParamRef.iidList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('iidNotList') and conditionParamRef.iidNotList.size() > 0"
>
${_conditionType_} a.iid not in
<foreach
collection=
"conditionParamRef.iidNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('pid')"
>
<if
test=
"conditionParamRef.pid != null and conditionParamRef.pid != ''"
>
...
...
@@ -493,12 +523,18 @@
${_conditionType_} a.pid is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('pidList')"
>
<if
test=
"conditionParamRef.containsKey('pidList')
and conditionParamRef.pidList.size() > 0
"
>
${_conditionType_} a.pid in
<foreach
collection=
"conditionParamRef.pidList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('pidNotList') and conditionParamRef.pidNotList.size() > 0"
>
${_conditionType_} a.pid not in
<foreach
collection=
"conditionParamRef.pidNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveSonArea')"
>
<if
test=
"conditionParamRef.haveSonArea != null and conditionParamRef.haveSonArea != ''"
>
...
...
@@ -508,12 +544,18 @@
${_conditionType_} a.haveSonArea is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('haveSonAreaList')"
>
<if
test=
"conditionParamRef.containsKey('haveSonAreaList')
and conditionParamRef.haveSonAreaList.size() > 0
"
>
${_conditionType_} a.haveSonArea in
<foreach
collection=
"conditionParamRef.haveSonAreaList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveSonAreaNotList') and conditionParamRef.haveSonAreaNotList.size() > 0"
>
${_conditionType_} a.haveSonArea not in
<foreach
collection=
"conditionParamRef.haveSonAreaNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveSonDept')"
>
<if
test=
"conditionParamRef.haveSonDept != null and conditionParamRef.haveSonDept != ''"
>
...
...
@@ -523,12 +565,18 @@
${_conditionType_} a.haveSonDept is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('haveSonDeptList')"
>
<if
test=
"conditionParamRef.containsKey('haveSonDeptList')
and conditionParamRef.haveSonDeptList.size() > 0
"
>
${_conditionType_} a.haveSonDept in
<foreach
collection=
"conditionParamRef.haveSonDeptList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveSonDeptNotList') and conditionParamRef.haveSonDeptNotList.size() > 0"
>
${_conditionType_} a.haveSonDept not in
<foreach
collection=
"conditionParamRef.haveSonDeptNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveGetDept')"
>
<if
test=
"conditionParamRef.haveGetDept != null and conditionParamRef.haveGetDept != ''"
>
...
...
@@ -538,12 +586,18 @@
${_conditionType_} a.haveGetDept is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('haveGetDeptList')"
>
<if
test=
"conditionParamRef.containsKey('haveGetDeptList')
and conditionParamRef.haveGetDeptList.size() > 0
"
>
${_conditionType_} a.haveGetDept in
<foreach
collection=
"conditionParamRef.haveGetDeptList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveGetDeptNotList') and conditionParamRef.haveGetDeptNotList.size() > 0"
>
${_conditionType_} a.haveGetDept not in
<foreach
collection=
"conditionParamRef.haveGetDeptNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveGetMatterList')"
>
<if
test=
"conditionParamRef.haveGetMatterList != null and conditionParamRef.haveGetMatterList != ''"
>
...
...
@@ -553,12 +607,18 @@
${_conditionType_} a.haveGetMatterList is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('haveGetMatterListList')"
>
<if
test=
"conditionParamRef.containsKey('haveGetMatterListList')
and conditionParamRef.haveGetMatterListList.size() > 0
"
>
${_conditionType_} a.haveGetMatterList in
<foreach
collection=
"conditionParamRef.haveGetMatterListList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('haveGetMatterListNotList') and conditionParamRef.haveGetMatterListNotList.size() > 0"
>
${_conditionType_} a.haveGetMatterList not in
<foreach
collection=
"conditionParamRef.haveGetMatterListNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('areaCode')"
>
<if
test=
"conditionParamRef.areaCode != null and conditionParamRef.areaCode != ''"
>
...
...
@@ -568,12 +628,18 @@
${_conditionType_} a.areaCode is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('areaCodeList')"
>
<if
test=
"conditionParamRef.containsKey('areaCodeList')
and conditionParamRef.areaCodeList.size() > 0
"
>
${_conditionType_} a.areaCode in
<foreach
collection=
"conditionParamRef.areaCodeList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('areaCodeNotList') and conditionParamRef.areaCodeNotList.size() > 0"
>
${_conditionType_} a.areaCode not in
<foreach
collection=
"conditionParamRef.areaCodeNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('areaLevel')"
>
<if
test=
"conditionParamRef.areaLevel != null "
>
${_conditionType_} a.areaLevel = #{${_conditionParam_}.areaLevel}
...
...
@@ -582,12 +648,18 @@
${_conditionType_} a.areaLevel is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('areaLevelList')"
>
<if
test=
"conditionParamRef.containsKey('areaLevelList')
and conditionParamRef.areaLevelList.size() > 0
"
>
${_conditionType_} a.areaLevel in
<foreach
collection=
"conditionParamRef.areaLevelList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('areaLevelNotList') and conditionParamRef.areaLevelNotList.size() > 0"
>
${_conditionType_} a.areaLevel not in
<foreach
collection=
"conditionParamRef.areaLevelNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('areaLevelStart') and conditionParamRef.areaLevelStart != null"
>
${_conditionType_} a.areaLevel
<![CDATA[ >= ]]>
#{${_conditionParam_}.areaLevelStart}
</if>
...
...
@@ -604,12 +676,18 @@
${_conditionType_} a.shortName is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('shortNameList')"
>
<if
test=
"conditionParamRef.containsKey('shortNameList')
and conditionParamRef.shortNameList.size() > 0
"
>
${_conditionType_} a.shortName in
<foreach
collection=
"conditionParamRef.shortNameList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('shortNameNotList') and conditionParamRef.shortNameNotList.size() > 0"
>
${_conditionType_} a.shortName not in
<foreach
collection=
"conditionParamRef.shortNameNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('domain')"
>
<if
test=
"conditionParamRef.domain != null and conditionParamRef.domain != ''"
>
...
...
@@ -619,12 +697,18 @@
${_conditionType_} a.domain is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('domainList')"
>
<if
test=
"conditionParamRef.containsKey('domainList')
and conditionParamRef.domainList.size() > 0
"
>
${_conditionType_} a.domain in
<foreach
collection=
"conditionParamRef.domainList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('domainNotList') and conditionParamRef.domainNotList.size() > 0"
>
${_conditionType_} a.domain not in
<foreach
collection=
"conditionParamRef.domainNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('status')"
>
<if
test=
"conditionParamRef.status != null "
>
${_conditionType_} a.status = #{${_conditionParam_}.status}
...
...
@@ -633,12 +717,18 @@
${_conditionType_} a.status is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('statusList')"
>
<if
test=
"conditionParamRef.containsKey('statusList')
and conditionParamRef.statusList.size() > 0
"
>
${_conditionType_} a.status in
<foreach
collection=
"conditionParamRef.statusList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('statusNotList') and conditionParamRef.statusNotList.size() > 0"
>
${_conditionType_} a.status not in
<foreach
collection=
"conditionParamRef.statusNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('statusStart') and conditionParamRef.statusStart != null"
>
${_conditionType_} a.status
<![CDATA[ >= ]]>
#{${_conditionParam_}.statusStart}
</if>
...
...
@@ -669,12 +759,18 @@
${_conditionType_} a.createUserId is null
</if>
</if>
<if
test=
"conditionParamRef.containsKey('createUserIdList')"
>
<if
test=
"conditionParamRef.containsKey('createUserIdList')
and conditionParamRef.createUserIdList.size() > 0
"
>
${_conditionType_} a.createUserId in
<foreach
collection=
"conditionParamRef.createUserIdList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0"
>
${_conditionType_} a.createUserId not in
<foreach
collection=
"conditionParamRef.createUserIdNotList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null"
>
${_conditionType_} a.createUserId
<![CDATA[ >= ]]>
#{${_conditionParam_}.createUserIdStart}
</if>
...
...
@@ -701,14 +797,70 @@
<sql
id=
"_orderCols_"
>
<if
test=
"orderColList != null and !orderColList.isEmpty()"
>
order by
<if
test=
"conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0"
>
field(a.id,
<foreach
collection=
"conditionParamRef.idList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<if
test=
"conditionParamRef.containsKey('areaLevelList') and conditionParamRef.areaLevelList.size() > 0"
>
field(a.areaLevel,
<foreach
collection=
"conditionParamRef.areaLevelList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<if
test=
"conditionParamRef.containsKey('statusList') and conditionParamRef.statusList.size() > 0"
>
field(a.status,
<foreach
collection=
"conditionParamRef.statusList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<if
test=
"conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0"
>
field(a.createUserId,
<foreach
collection=
"conditionParamRef.createUserIdList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<trim
suffixOverrides=
","
suffix=
""
>
<foreach
collection=
"orderColList"
open=
""
close=
""
index=
"index"
item=
"item"
separator=
","
>
${item.colName} ${item.sortKind}
a.
${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if
test=
"(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"
>
order by
<if
test=
"conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0"
>
field(a.id,
<foreach
collection=
"conditionParamRef.idList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<if
test=
"conditionParamRef.containsKey('areaLevelList') and conditionParamRef.areaLevelList.size() > 0"
>
field(a.areaLevel,
<foreach
collection=
"conditionParamRef.areaLevelList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<if
test=
"conditionParamRef.containsKey('statusList') and conditionParamRef.statusList.size() > 0"
>
field(a.status,
<foreach
collection=
"conditionParamRef.statusList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<if
test=
"conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0"
>
field(a.createUserId,
<foreach
collection=
"conditionParamRef.createUserIdList"
open=
""
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
,
</if>
<trim
suffixOverrides=
","
suffix=
""
>
<if
test=
"orderCol.containsKey('id')"
>
a.id
...
...
@@ -797,6 +949,8 @@
</if>
</trim>
</if>
</sql>
<sql
id=
"_group_by_"
>
<if
test=
"groupList != null and !groupList.isEmpty()"
>
...
...
setup-project-manager/src/test/java/com/mortals/httpclient/base/BaseAreaController.http
0 → 100644
View file @
23fcd536
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###区域列表
POST {{baseUrl}}/base/area/list
Content-Type: application/json
{
"page":1,
"size":10
}
###区域更新与保存
POST {{baseUrl}}/base/area/save
Authorization: {{authToken}}
Content-Type: application/json
{
"ancestors":"LdZ2li",
"name":"i3SKJc",
"iid":"suSUQY",
"pid":"uRSFOx",
"haveSonArea":"BfkquZ",
"haveSonDept":"pCokey",
"haveGetDept":"2yYsnf",
"haveGetMatterList":"r9jokc",
"areaCode":"gWJcgU",
"areaLevel":1,
"shortName":"fWbdcd",
"domain":"u7GMku",
"status":1,
}
> {%
client.global.set("BaseArea_id", JSON.parse(response.body).data.id);
%}
###区域查看
GET {{baseUrl}}/base/area/info?id=1
###区域编辑
GET {{baseUrl}}/base/area/edit?id=1
Accept: application/json
###区域删除
GET {{baseUrl}}/base/area/delete?id=1
Authorization: {{authToken}}
Accept: application/json
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