Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-platform
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
赵啸非
enterprise-platform
Commits
23dc25b3
Commit
23dc25b3
authored
1 year ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加其它官网设计
parent
d3b3009d
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
3802 additions
and
3 deletions
+3802
-3
common-lib/src/main/java/com/mortals/xhx/module/area/model/AreaEntity.java
...in/java/com/mortals/xhx/module/area/model/AreaEntity.java
+319
-0
common-lib/src/main/java/com/mortals/xhx/module/area/model/AreaQuery.java
...ain/java/com/mortals/xhx/module/area/model/AreaQuery.java
+1021
-0
common-lib/src/main/java/com/mortals/xhx/module/area/model/AreaTreeSelect.java
...ava/com/mortals/xhx/module/area/model/AreaTreeSelect.java
+67
-0
common-lib/src/main/java/com/mortals/xhx/module/area/model/vo/AreaVo.java
...ain/java/com/mortals/xhx/module/area/model/vo/AreaVo.java
+20
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/area/service/impl/AreaServiceImpl.java
...mortals/xhx/module/area/service/impl/AreaServiceImpl.java
+2
-3
enterprise-manager/src/main/java/com/mortals/xhx/module/base/dao/BaseAreaDao.java
...ain/java/com/mortals/xhx/module/base/dao/BaseAreaDao.java
+17
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/dao/ibatis/BaseAreaDaoImpl.java
...m/mortals/xhx/module/base/dao/ibatis/BaseAreaDaoImpl.java
+20
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaEntity.java
...ava/com/mortals/xhx/module/base/model/BaseAreaEntity.java
+318
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaQuery.java
...java/com/mortals/xhx/module/base/model/BaseAreaQuery.java
+1021
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/model/vo/BaseAreaVo.java
...java/com/mortals/xhx/module/base/model/vo/BaseAreaVo.java
+20
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/service/BaseAreaService.java
.../com/mortals/xhx/module/base/service/BaseAreaService.java
+23
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/service/impl/BaseAreaServiceImpl.java
...als/xhx/module/base/service/impl/BaseAreaServiceImpl.java
+96
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/base/web/BaseAreaController.java
...a/com/mortals/xhx/module/base/web/BaseAreaController.java
+47
-0
enterprise-manager/src/main/resources/sqlmap/module/base/BaseAreaMapper.xml
.../src/main/resources/sqlmap/module/base/BaseAreaMapper.xml
+811
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/module/area/model/AreaEntity.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.area.model
;
import
com.mortals.xhx.module.area.model.vo.AreaVo
;
/**
* 区域实体对象
*
* @author zxfei
* @date 2022-01-12
*/
public
class
AreaEntity
extends
AreaVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 祖级列表,逗号分隔
*/
private
String
ancestors
;
/**
* 区域名称
*/
private
String
name
;
/**
* 一体化的ID号
*/
private
String
iid
;
/**
* 一体化的父id
*/
private
String
pid
;
/**
* 是否有下级区域(True.是,False.否)
*/
private
String
haveSonArea
;
/**
* 是否有下级部门(True.是,False.否)
*/
private
String
haveSonDept
;
/**
* 是否获取部门(true.是,false.否)
*/
private
String
haveGetDept
;
/**
* 是否获取事项列表(true.是,false.否)
*/
private
String
haveGetMatterList
;
/**
* 区域编码
*/
private
String
areaCode
;
/**
* 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
*/
private
Integer
areaLevel
;
/**
* 名称简称
*/
private
String
shortName
;
/**
* 访问地址
*/
private
String
domain
;
/**
* 区域状态 (0.停用,1.正常)
*/
private
Integer
status
;
public
AreaEntity
(){}
/**
* 获取 祖级列表,逗号分隔
* @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
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
AreaEntity
)
{
AreaEntity
tmp
=
(
AreaEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
}
}
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
.
areaLevel
=
1
;
this
.
shortName
=
null
;
this
.
domain
=
null
;
this
.
status
=
1
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
common-lib/src/main/java/com/mortals/xhx/module/area/model/AreaQuery.java
0 → 100644
View file @
23dc25b3
This diff is collapsed.
Click to expand it.
common-lib/src/main/java/com/mortals/xhx/module/area/model/AreaTreeSelect.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.area.model
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 区域前端映射树结构实体类
*
* @author zxfei
* @date 2022-01-12
*/
@Data
public
class
AreaTreeSelect
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 节点ID
*/
private
String
id
;
/**
* 节点名称
*/
private
String
label
;
/**
* 区域编码
*/
private
String
areaCode
;
/**
* 是否叶子节点
*/
private
Boolean
isLeaf
;
/**
* 节点类型
*/
private
String
type
;
/**
* 图标
*/
private
String
icon
;
/**
* 子节点
*/
private
List
<
AreaTreeSelect
>
children
;
public
AreaTreeSelect
(
AreaEntity
entity
)
{
this
.
id
=
entity
.
getIid
();
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
.
type
=
"area"
;
this
.
icon
=
"el-icon-folder"
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
common-lib/src/main/java/com/mortals/xhx/module/area/model/vo/AreaVo.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.area.model.vo
;
import
com.mortals.framework.model.BaseEntity
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author: zxfei
* @date: 2022/6/6 14:58
* @description:
**/
@Data
public
class
AreaVo
extends
BaseEntityLong
{
private
List
<
AreaEntity
>
children
=
new
ArrayList
<>();
}
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/area/service/impl/AreaServiceImpl.java
View file @
23dc25b3
...
...
@@ -4,6 +4,7 @@ import com.mortals.framework.common.Rest;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.xhx.base.system.site.service.SiteService
;
import
com.mortals.xhx.common.code.SatusEnum
;
import
com.mortals.xhx.module.area.dao.AreaDao
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
...
...
@@ -11,7 +12,6 @@ import com.mortals.xhx.module.area.model.AreaQuery;
import
com.mortals.xhx.module.area.model.AreaTreeSelect
;
import
com.mortals.xhx.module.area.service.AreaService
;
import
com.mortals.xhx.module.base.service.BaseAreaService
;
import
com.mortals.xhx.module.site.service.SiteService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -32,8 +32,7 @@ import java.util.stream.Collectors;
@Service
(
"areaService"
)
public
class
AreaServiceImpl
extends
AbstractCRUDCacheServiceImpl
<
AreaDao
,
AreaEntity
,
Long
>
implements
AreaService
{
@Autowired
private
SiteService
siteService
;
@Autowired
private
BaseAreaService
baseAreaService
;
...
...
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/dao/BaseAreaDao.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.base.dao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
/**
* 区域Dao
* 区域 DAO接口
*
* @author zxfei
* @date 2022-11-22
*/
public
interface
BaseAreaDao
extends
ICRUDDao
<
BaseAreaEntity
,
Long
>{
}
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/dao/ibatis/BaseAreaDaoImpl.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.base.dao.ibatis
;
import
com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis
;
import
com.mortals.xhx.module.base.dao.BaseAreaDao
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
import
org.springframework.stereotype.Repository
;
/**
* 区域DaoImpl DAO接口
*
* @author zxfei
* @date 2022-11-22
*/
@Repository
(
"baseAreaDao"
)
public
class
BaseAreaDaoImpl
extends
BaseCRUDDaoMybatis
<
BaseAreaEntity
,
Long
>
implements
BaseAreaDao
{
}
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaEntity.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.base.model
;
import
com.mortals.xhx.module.base.model.vo.BaseAreaVo
;
/**
* 区域实体对象
*
* @author zxfei
* @date 2022-11-22
*/
public
class
BaseAreaEntity
extends
BaseAreaVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 祖级列表,逗号分隔
*/
private
String
ancestors
;
/**
* 区域名称
*/
private
String
name
;
/**
* 一体化的ID号
*/
private
String
iid
;
/**
* 一体化的父id
*/
private
String
pid
;
/**
* 是否有下级区域(True.是,False.否)
*/
private
String
haveSonArea
;
/**
* 是否有下级部门(True.是,False.否)
*/
private
String
haveSonDept
;
/**
* 是否获取部门(true.是,false.否)
*/
private
String
haveGetDept
;
/**
* 是否获取事项列表(true.是,false.否)
*/
private
String
haveGetMatterList
;
/**
* 区域编码
*/
private
String
areaCode
;
/**
* 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
*/
private
Integer
areaLevel
;
/**
* 名称简称
*/
private
String
shortName
;
/**
* 访问地址
*/
private
String
domain
;
/**
* 区域状态 (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
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
BaseAreaEntity
)
{
BaseAreaEntity
tmp
=
(
BaseAreaEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
}
}
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
.
areaLevel
=
1
;
this
.
shortName
=
null
;
this
.
domain
=
null
;
this
.
status
=
1
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/model/BaseAreaQuery.java
0 → 100644
View file @
23dc25b3
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/model/vo/BaseAreaVo.java
0 → 100644
View file @
23dc25b3
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
;
/**
* 区域视图对象
*
* @author zxfei
* @date 2022-11-22
*/
@Data
public
class
BaseAreaVo
extends
BaseEntityLong
{
private
List
<
BaseAreaEntity
>
children
=
new
ArrayList
<>();
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/service/BaseAreaService.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.base.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.base.model.BaseAreaEntity
;
/**
* BaseAreaService
*
* 区域 service接口
*
* @author zxfei
* @date 2022-11-22
*/
public
interface
BaseAreaService
extends
ICRUDService
<
BaseAreaEntity
,
Long
>{
/**
* 根据顶点名称生成子节点
* @param baseAreaEntity
* @param context
*/
Rest
<
String
>
genSubAreaByRootName
(
BaseAreaEntity
baseAreaEntity
,
Context
context
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/service/impl/BaseAreaServiceImpl.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.base.service.impl
;
import
cn.hutool.core.collection.ListUtil
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
com.mortals.xhx.module.area.service.AreaService
;
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.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* BaseAreaService
* 区域 service实现
*
* @author zxfei
* @date 2022-11-22
*/
@Service
(
"baseAreaService"
)
public
class
BaseAreaServiceImpl
extends
AbstractCRUDServiceImpl
<
BaseAreaDao
,
BaseAreaEntity
,
Long
>
implements
BaseAreaService
{
@Autowired
private
AreaService
areaService
;
@Override
public
Rest
<
String
>
genSubAreaByRootName
(
BaseAreaEntity
baseAreaEntity
,
Context
context
)
{
String
areaCode
=
baseAreaEntity
.
getAreaCode
();
String
matchCode
=
areaCode
.
replaceAll
(
"(0)+$"
,
""
);
BaseAreaQuery
baseAreaQuery
=
new
BaseAreaQuery
();
baseAreaQuery
.
setAreaCode
(
matchCode
+
"%"
);
List
<
BaseAreaEntity
>
baseAreaEntityList
=
this
.
find
(
baseAreaQuery
);
//清除子区域数据
Rest
<
String
>
rest
=
areaService
.
removeAll
();
List
<
AreaEntity
>
collect
=
baseAreaEntityList
.
stream
().
map
(
item
->
{
AreaEntity
areaEntity
=
new
AreaEntity
();
areaEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
item
,
areaEntity
,
BeanUtil
.
getNullPropertyNames
(
item
));
if
(
item
.
getAreaCode
().
equalsIgnoreCase
(
areaCode
)){
areaEntity
.
setPid
(
"0"
);
}
return
areaEntity
;
}).
collect
(
Collectors
.
toList
());
log
.
info
(
"更新数据条数:"
+
collect
.
size
());
List
<
List
<
AreaEntity
>>
partition
=
ListUtil
.
partition
(
collect
,
100
);
for
(
List
<
AreaEntity
>
areaEntities
:
partition
)
{
areaService
.
save
(
areaEntities
,
context
);
}
areaService
.
loadCache
();
return
Rest
.
ok
(
"初始化区域数据成功!"
);
}
/**
* 递归列表
*/
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
List
<
BaseAreaEntity
>
getChildList
(
List
<
BaseAreaEntity
>
list
,
BaseAreaEntity
t
)
{
return
list
.
stream
().
map
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getPid
())
&&
item
.
getPid
()
==
t
.
getIid
())
{
return
item
;
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
}
/**
* 判断是否有子节点
*/
private
boolean
hasChild
(
List
<
BaseAreaEntity
>
list
,
BaseAreaEntity
t
)
{
return
getChildList
(
list
,
t
).
size
()
>
0
?
true
:
false
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/base/web/BaseAreaController.java
0 → 100644
View file @
23dc25b3
package
com.mortals.xhx.module.base.web
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICacheService
;
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
java.util.Map
;
/**
* 区域
*
* @author zxfei
* @date 2022-11-22
*/
@RestController
@RequestMapping
(
"base/area"
)
public
class
BaseAreaController
extends
BaseCRUDJsonBodyMappingController
<
BaseAreaService
,
BaseAreaEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
@Autowired
private
ICacheService
cacheService
;
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"
));
super
.
init
(
model
,
context
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/resources/sqlmap/module/base/BaseAreaMapper.xml
0 → 100644
View file @
23dc25b3
This diff is collapsed.
Click to expand it.
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