Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
framework-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 49cc9bba
authored
Jul 01, 2024
by
xiehao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增元素
1 parent
0e7102e3
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
989 additions
and
8 deletions
arch-base/src/main/java/org/arch/modules/archoverall/a.java
arch-base/src/main/java/org/arch/modules/archoverall/dto/BatchUpdateDTO.java
arch-base/src/main/java/org/arch/modules/archsys/b.java
arch-overall/pom.xml
clouds/mybatis/src/main/java/org/arch/common/entity/BaseEntity.java → arch-overall/src/main/java/org/arch/common/entity/BaseEntity.java
clouds/mybatis/src/main/java/org/arch/common/entity/BasePageEntity.java → arch-overall/src/main/java/org/arch/common/entity/BasePageEntity.java
arch-overall/src/main/java/org/arch/modules/design/controller/ArchiElementController.java
arch-overall/src/main/java/org/arch/modules/design/dto/ArchiElementDTO.java
arch-overall/src/main/java/org/arch/modules/design/pojo/ArchiElement.java
arch-overall/src/main/java/org/arch/modules/design/service/ArchiElementService.java
arch-overall/src/main/java/org/arch/modules/design/service/impl/ArchiElementImpl.java
arch-overall/src/main/java/org/arch/modules/design/service/mapper/ArchiElementMapper.java
arch-overall/src/main/resources/bootstrap-dev.yml
arch-overall/src/main/resources/bootstrap-local.yml
arch-overall/src/main/resources/bootstrap-sit.yml
arch-overall/src/main/resources/bootstrap.yml
arch-overall/src/main/resources/logback-spring.xml
arch-overall/src/main/resources/mapper/modules/asset/ArchiElementMapper.xml
arch-overall/src/main/resources/tika-config.xml
arch-base/src/main/java/org/arch/modules/archoverall/a.java
deleted
100644 → 0
View file @
0e7102e
package
org
.
arch
.
modules
.
archoverall
;
public
class
a
{
}
arch-base/src/main/java/org/arch/modules/archoverall/dto/BatchUpdateDTO.java
0 → 100644
View file @
49cc9bb
package
org
.
arch
.
modules
.
archoverall
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* 批量更新 DTO
*
* @author xh13k
* @date 2024/06/04
*/
@Data
public
class
BatchUpdateDTO
{
private
List
<
Long
>
elementId
;
}
arch-base/src/main/java/org/arch/modules/archsys/b.java
deleted
100644 → 0
View file @
0e7102e
package
org
.
arch
.
modules
.
archsys
;
public
class
b
{
}
arch-overall/pom.xml
View file @
49cc9bb
...
@@ -17,4 +17,26 @@
...
@@ -17,4 +17,26 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
</properties>
<dependencies>
<dependency>
<groupId>
org.arch
</groupId>
<artifactId>
arch-base
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.yulichang
</groupId>
<artifactId>
mybatis-plus-join-core
</artifactId>
<version>
1.4.11
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
</project>
\ No newline at end of file
clouds/mybatis
/src/main/java/org/arch/common/entity/BaseEntity.java
→
arch-overall
/src/main/java/org/arch/common/entity/BaseEntity.java
View file @
49cc9bb
File moved
clouds/mybatis
/src/main/java/org/arch/common/entity/BasePageEntity.java
→
arch-overall
/src/main/java/org/arch/common/entity/BasePageEntity.java
View file @
49cc9bb
File moved
arch-overall/src/main/java/org/arch/modules/design/controller/ArchiElementController.java
0 → 100644
View file @
49cc9bb
package
org
.
arch
.
modules
.
design
.
controller
;
import
com.eadc.modules.design.entity.ArchiElement
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.arch.Result
;
import
org.arch.modules.archoverall.dto.BatchUpdateDTO
;
import
org.arch.modules.design.dto.ArchiElementDTO
;
import
org.arch.modules.design.service.ArchiElementService
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Api
(
tags
=
{
"元素管理"
})
@RestController
@RequestMapping
(
"ele"
)
@RequiredArgsConstructor
public
class
ArchiElementController
{
private
final
ArchiElementService
archiElementService
;
@PostMapping
(
value
=
"/"
)
// @ApiOperation(DescContent.QUERY_PAGINATED_LIST_ELEMENTS)
// @AutoLog(value = LogEventTypeEnum.SEARCH, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.LOW)
public
Result
gtArchiElement
(
@RequestBody
ArchiElementDTO
dto
)
{
return
Result
.
success
(
archiElementService
.
gtArchiElement
(
dto
));
}
@PostMapping
(
"/ad-ele"
)
@ApiOperation
(
"新增元素"
)
// @AutoLog(value = LogEventTypeEnum.INSERT, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.MIDDLE, description = "新增元素")
public
Result
adEle
(
@RequestBody
ArchiElement
archiElements
)
{
return
Result
.
success
(
archiElementService
.
insert
(
archiElements
));
}
@PostMapping
(
"/upd-ele"
)
@ApiOperation
(
"修改元素"
)
// @AutoLog(value = LogEventTypeEnum.UPDATE, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.MIDDLE, description = "修改元素")
public
Result
updEle
(
@RequestBody
ArchiElement
archiElement
)
{
return
Result
.
success
(
archiElementService
.
update
(
archiElement
));
}
@PostMapping
(
"/del-ele"
)
@ApiOperation
(
"根据Id删除元素"
)
// @AutoLog(value = LogEventTypeEnum.DELETE, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.HIGH, description = "删除元素")
public
Result
delEle
(
@RequestBody
ArchiElement
archiElement
)
{
return
Result
.
success
(
archiElementService
.
delete
(
archiElement
));
}
@PostMapping
(
value
=
"/updEleBatch"
)
@ApiOperation
(
value
=
"批量发布版本"
)
// @AutoLog(value = LogEventTypeEnum.OTHER, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.LOW, description = "批量发布版本")
public
Result
updEleBatch
(
@RequestBody
BatchUpdateDTO
requestMap
)
{
return
Result
.
success
(
archiElementService
.
updEleBatch
(
requestMap
));
}
@PostMapping
(
value
=
"/archi-ele-list"
)
@ApiOperation
(
value
=
"查询元素列表"
)
// @AutoLog(value = LogEventTypeEnum.SEARCH, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.LOW, description = "查询元素列表")
public
Result
gtEleList
(
@RequestBody
ArchiElement
params
)
{
return
Result
.
success
(
archiElementService
.
gtEle
(
params
));
}
@PostMapping
(
value
=
"/ele-list"
)
@ApiOperation
(
value
=
"获取元素列表"
)
// @AutoLog(value = LogEventTypeEnum.SEARCH, LogTypeValue = LogTypeEnum.BUSI_LOG, LogLevValue = LogLevEnum.LOW, description = "获取元素列表")
public
Result
getEleList
(
@RequestBody
ArchiElementDTO
dto
)
{
return
Result
.
success
(
archiElementService
.
gtEleList
(
dto
));
}
}
arch-overall/src/main/java/org/arch/modules/design/dto/ArchiElementDTO.java
0 → 100644
View file @
49cc9bb
package
org
.
arch
.
modules
.
design
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.arch.common.entity.BasePageEntity
;
import
java.util.List
;
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@ApiModel
(
value
=
"元素模块查询的传输对象"
,
description
=
"元素模块查询的传输对象"
)
public
class
ArchiElementDTO
extends
BasePageEntity
{
@ApiModelProperty
(
value
=
"总条数"
)
private
Integer
total
;
@ApiModelProperty
(
value
=
"主键"
)
@TableId
(
"element_id"
)
private
String
elementId
;
@ApiModelProperty
(
value
=
"元素名称"
)
private
String
elementName
;
@ApiModelProperty
(
value
=
"架构归属"
)
private
Long
archiBelongId
;
@ApiModelProperty
(
value
=
"企业架构层级"
)
private
Integer
eaLevel
;
@ApiModelProperty
(
value
=
"状态 0:已停用 1:已发布 2:暂存"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"是否删除 1:已删除 0:未删除"
)
private
Integer
delFlag
;
@ApiModelProperty
(
value
=
"元素类型(1:标准图元;2:常规图元)"
)
private
Integer
eleType
;
@ApiModelProperty
(
value
=
"元素id集合"
)
private
List
<
Long
>
eleIdList
;
@ApiModelProperty
(
value
=
"架构归属id集合"
)
private
List
<
String
>
belongIdList
;
@ApiModelProperty
(
value
=
"适用范围(1:总体架构 2:系统架构 3:总体及系统架构)"
)
private
Integer
scope
;
@ApiModelProperty
(
value
=
"适用范围集合"
)
@TableField
(
exist
=
false
)
private
List
<
Long
>
scopeList
;
}
arch-overall/src/main/java/org/arch/modules/design/pojo/ArchiElement.java
0 → 100644
View file @
49cc9bb
package
com
.
eadc
.
modules
.
design
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.arch.common.entity.BaseEntity
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@TableName
(
"archi_element"
)
@ApiModel
(
value
=
"ArchiElement"
,
description
=
"架构元素"
)
public
class
ArchiElement
extends
BaseEntity
{
@ApiModelProperty
(
value
=
"主键"
)
@TableId
(
"element_id"
)
private
Long
elementId
;
@ApiModelProperty
(
value
=
"编码"
)
private
String
elementCode
;
@ApiModelProperty
(
value
=
"元素名称"
)
private
String
elementName
;
@ApiModelProperty
(
value
=
"架构层次"
)
private
Long
archiLevelId
;
@ApiModelProperty
(
value
=
"架构归属"
)
private
Long
archiBelongId
;
@ApiModelProperty
(
value
=
"企业架构层级"
)
private
Integer
eaLevel
;
@ApiModelProperty
(
value
=
"元素类型(1:标准图元;2:常规图元)"
)
private
Integer
eleType
;
@ApiModelProperty
(
value
=
"描述"
)
private
String
content
;
@ApiModelProperty
(
value
=
"图标"
)
@TableField
(
exist
=
false
)
private
String
icon
;
@ApiModelProperty
(
value
=
"图形名称"
)
@TableField
(
exist
=
false
)
private
String
iconName
;
@ApiModelProperty
(
value
=
"颜色值"
)
private
String
color
;
@ApiModelProperty
(
value
=
"版本"
)
private
String
version
;
@ApiModelProperty
(
value
=
"状态 0:已停用 1:已发布 2:暂存"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"架构层次编码"
)
private
Integer
archiLevelCode
;
@ApiModelProperty
(
value
=
"架构归属编码"
)
private
Integer
archiBelongCode
;
@ApiModelProperty
(
value
=
"图像宽"
)
private
BigDecimal
shapeWidth
;
@ApiModelProperty
(
value
=
"图像高"
)
private
BigDecimal
shapeHeight
;
@ApiModelProperty
(
value
=
"引用关系"
)
private
String
referenceRelationship
;
@ApiModelProperty
(
value
=
"示例"
)
private
String
example
;
@ApiModelProperty
(
value
=
"定义"
)
private
String
definition
;
@ApiModelProperty
(
value
=
"适用范围(1:总体架构 2:系统架构 3:总体及系统架构)"
)
private
Integer
scope
;
@ApiModelProperty
(
value
=
"适用范围集合"
)
@TableField
(
exist
=
false
)
private
List
<
Long
>
scopeList
;
@ApiModelProperty
(
value
=
"元素id集合"
)
@TableField
(
exist
=
false
)
private
List
<
Long
>
eleIdList
;
@ApiModelProperty
(
value
=
"图形库ID"
)
private
Long
graphId
;
}
arch-overall/src/main/java/org/arch/modules/design/service/ArchiElementService.java
0 → 100644
View file @
49cc9bb
package
org
.
arch
.
modules
.
design
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.eadc.modules.design.entity.ArchiElement
;
import
org.arch.modules.archoverall.dto.BatchUpdateDTO
;
import
org.arch.modules.design.dto.ArchiElementDTO
;
import
java.util.List
;
public
interface
ArchiElementService
extends
IService
<
ArchiElement
>
{
/**
* 元素列表
*
* @param dto DTO
* @param page 页
* @return {@link IPage }<{@link ArchiElement }>
*/
IPage
<
ArchiElement
>
gtArchiElement
(
ArchiElementDTO
dto
);
/**
* 新增元素
*
* @param params 参数
* @return {@link Boolean }
*/
Boolean
insert
(
ArchiElement
params
);
/**
* 更新
*
* @param archiElement Archi 元素
* @return {@link Boolean }
*/
Boolean
update
(
ArchiElement
archiElement
);
/**
* 删除
*
* @param archiElement Archi 元素
* @return {@link Boolean }
*/
Boolean
delete
(
ArchiElement
archiElement
);
/**
* 批量发布
*
* @param requestMap 参数
* @return {@link Boolean }
*/
Boolean
updEleBatch
(
BatchUpdateDTO
requestMap
);
/**
* 元素列表
*
* @param dto DTO
* @return {@link List }<{@link ArchiElement }>
*/
List
<
ArchiElement
>
gtEleList
(
ArchiElementDTO
dto
);
/**
* 查询元素列表
*
* @param params 参数
* @return {@link List }<{@link ArchiElement }>
*/
List
<
ArchiElement
>
gtEle
(
ArchiElement
params
);
}
arch-overall/src/main/java/org/arch/modules/design/service/impl/ArchiElementImpl.java
0 → 100644
View file @
49cc9bb
package
org
.
arch
.
modules
.
design
.
service
.
impl
;
import
cn.hutool.core.lang.UUID
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Assert
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.eadc.modules.design.entity.ArchiElement
;
import
com.eadc.modules.design.service.mapper.ArchiElementMapper
;
import
com.github.xiaoymin.knife4j.core.util.StrUtil
;
import
org.arch.modules.archoverall.dto.BatchUpdateDTO
;
import
org.arch.modules.design.dto.ArchiElementDTO
;
import
org.arch.modules.design.service.ArchiElementService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
@Service
public
class
ArchiElementImpl
extends
ServiceImpl
<
ArchiElementMapper
,
ArchiElement
>
implements
ArchiElementService
{
@Resource
private
ArchiElementMapper
archiElementMapper
;
@Override
public
IPage
<
ArchiElement
>
gtArchiElement
(
ArchiElementDTO
dto
)
{
return
archiElementMapper
.
gtArchiElement
(
dto
,
PageDTO
.
of
(
dto
.
getCurrent
(),
dto
.
getPageSize
()));
}
@Override
public
Boolean
insert
(
ArchiElement
archiElements
)
{
archiElements
.
setElementCode
(
UUID
.
fastUUID
().
toString
());
if
(
archiElements
.
getState
()
==
1
)
{
List
<
ArchiElement
>
list
=
archiElementMapper
.
initVersion
();
for
(
ArchiElement
element
:
list
)
{
if
(
element
.
getVersion
()
!=
null
)
{
archiElements
.
setVersion
(
element
.
getVersion
());
break
;
}
}
LambdaQueryWrapper
<
ArchiElement
>
wrapper
=
Wrappers
.
lambdaQuery
(
ArchiElement
.
class
).
select
().
eq
(
StrUtil
.
isNotBlank
(
archiElements
.
getElementName
()),
ArchiElement:
:
getElementName
,
archiElements
.
getElementName
()).
eq
(
Objects
.
nonNull
(
archiElements
.
getArchiBelongId
()),
ArchiElement:
:
getArchiBelongId
,
archiElements
.
getArchiBelongId
()).
ne
(
Objects
.
nonNull
(
archiElements
.
getElementId
()),
ArchiElement:
:
getElementId
,
archiElements
.
getElementId
());
List
<
ArchiElement
>
eleList
=
archiElementMapper
.
selectList
(
wrapper
);
if
(!
CollectionUtils
.
isEmpty
(
eleList
))
{
eleList
.
forEach
(
e
->
{
e
.
setState
(
0
);
archiElementMapper
.
updateById
(
e
);
});
}
List
<
ArchiElement
>
maxVer
=
archiElementMapper
.
maxVer
(
archiElements
);
if
(!
CollectionUtils
.
isEmpty
(
maxVer
))
{
String
lastMaxVer
=
maxVer
.
get
(
0
).
getVersion
();
String
ver
=
VersionUtil
.
getNextVersion
(
lastMaxVer
);
archiElements
.
setVersion
(
ver
);
}
}
archiElements
.
setDelFlag
(
0
);
return
save
(
archiElements
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
delete
(
ArchiElement
archiElement
)
{
ArchiElement
model
=
getById
(
archiElement
.
getElementId
());
Assert
.
notNull
(
model
,
"未找到元素"
);
Integer
state
=
model
.
getState
();
Assert
.
isFalse
(
1
==
state
,
"当前状态下不可删除!"
);
return
removeById
(
archiElement
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
updEleBatch
(
BatchUpdateDTO
requestMap
)
{
List
<
Long
>
elementId
=
requestMap
.
getElementId
();
Assert
.
isFalse
(
CollectionUtils
.
isEmpty
(
elementId
),
"元素ID不能为空"
);
elementId
.
forEach
(
it
->
{
ArchiElement
archiElement
=
archiElementMapper
.
selectById
(
it
);
Assert
.
notNull
(
archiElement
,
"未找到元素"
);
Integer
state
=
archiElement
.
getState
();
Assert
.
isFalse
(
1
==
state
,
"当前状态下不可发布!"
);
String
version
=
archiElementMapper
.
getVersion
(
it
);
archiElement
.
setState
(
1
);
archiElement
.
setVersion
(
VersionUtil
.
getNextVersion
(
version
));
archiElement
.
updateById
();
});
return
Boolean
.
TRUE
;
}
@Override
public
List
<
ArchiElement
>
gtEleList
(
ArchiElementDTO
dto
)
{
return
archiElementMapper
.
gtEleList
(
dto
);
}
@Override
public
List
<
ArchiEleProperty
>
findMetaModelProperties
(
int
type
,
List
<
Long
>
eleIdList
)
{
LambdaQueryWrapper
<
ArchiEleProperty
>
wrapper
=
new
LambdaQueryWrapper
<
ArchiEleProperty
>().
eq
(
ArchiEleProperty:
:
getType
,
type
).
in
(
ArchiEleProperty:
:
getTypeId
,
eleIdList
).
eq
(
ArchiEleProperty:
:
getDelFlag
,
0
);
return
archiElePropertyMapper
.
selectList
(
wrapper
);
}
@Override
public
List
<
ArchiElement
>
gtEle
(
ArchiElement
params
)
{
LambdaQueryWrapper
<
ArchiElement
>
wrapper
=
new
LambdaQueryWrapper
<
ArchiElement
>().
like
(
StrUtil
.
isNotBlank
(
params
.
getElementName
()),
ArchiElement:
:
getElementName
,
params
.
getElementName
()).
eq
(
Objects
.
nonNull
(
params
.
getArchiBelongId
()),
ArchiElement:
:
getArchiBelongId
,
params
.
getArchiBelongId
()).
eq
(
Objects
.
nonNull
(
params
.
getEaLevel
()),
ArchiElement:
:
getEaLevel
,
params
.
getEaLevel
()).
eq
(
Objects
.
nonNull
(
params
.
getEleType
()),
ArchiElement:
:
getEleType
,
params
.
getEleType
()).
eq
(
Objects
.
nonNull
(
params
.
getState
()),
ArchiElement:
:
getState
,
params
.
getState
()).
eq
(
ArchiElement:
:
getDelFlag
,
0
).
orderByDesc
(
ArchiElement:
:
getCreateTime
);
return
archiElementMapper
.
selectList
(
wrapper
);
}
@Override
public
Boolean
update
(
ArchiElement
archiElement
)
{
Integer
state
=
archiElement
.
getState
();
if
(
archiElement
.
getElementId
()
==
null
)
{
throw
new
IllegalArgumentException
(
"修改元素主键不能为空!"
);
}
// 发布生成新版本,须传元素名称
List
<
ArchiElement
>
lists
=
archiElementMapper
.
gtArcEleByName
(
archiElement
);
if
(
state
==
1
&&
!
lists
.
isEmpty
()
&&
lists
.
get
(
0
).
getVersion
()
==
null
)
{
List
<
ArchiElement
>
list
=
archiElementMapper
.
initVersion
();
for
(
ArchiElement
element
:
list
)
{
if
(
element
.
getVersion
()
!=
null
)
{
archiElement
.
setVersion
(
element
.
getVersion
());
break
;
}
}
}
else
if
(
state
==
1
&&
!
lists
.
isEmpty
()
&&
lists
.
get
(
0
).
getVersion
()
!=
null
)
{
LambdaQueryWrapper
<
ArchiElement
>
wrapper
=
Wrappers
.
lambdaQuery
(
ArchiElement
.
class
).
select
().
eq
(
StrUtil
.
isNotBlank
(
archiElement
.
getElementName
()),
ArchiElement:
:
getElementName
,
archiElement
.
getElementName
()).
eq
(
Objects
.
nonNull
(
archiElement
.
getArchiBelongId
()),
ArchiElement:
:
getArchiBelongId
,
archiElement
.
getArchiBelongId
()).
ne
(
Objects
.
nonNull
(
archiElement
.
getElementId
()),
ArchiElement:
:
getElementId
,
archiElement
.
getElementId
());
List
<
ArchiElement
>
eleList
=
archiElementMapper
.
selectList
(
wrapper
);
if
(!
CollectionUtils
.
isEmpty
(
eleList
))
{
eleList
.
forEach
(
e
->
{
e
.
setState
(
0
);
archiElementMapper
.
updateById
(
e
);
});
}
List
<
ArchiElement
>
maxVer
=
archiElementMapper
.
maxVer
(
archiElement
);
if
(!
CollectionUtils
.
isEmpty
(
maxVer
))
{
String
lastMaxVer
=
maxVer
.
get
(
0
).
getVersion
();
String
ver
=
VersionUtil
.
getNextVersion
(
lastMaxVer
);
archiElement
.
setVersion
(
ver
);
}
}
archiElement
.
setLastUpdateTime
(
new
Date
());
archiElementMapper
.
updateById
(
archiElement
);
return
true
;
}
}
arch-overall/src/main/java/org/arch/modules/design/service/mapper/ArchiElementMapper.java
0 → 100644
View file @
49cc9bb
package
org
.
arch
.
modules
.
design
.
service
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.eadc.modules.design.entity.ArchiElement
;
import
com.github.yulichang.base.MPJBaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.arch.modules.design.dto.ArchiElementDTO
;
import
java.util.List
;
public
interface
ArchiElementMapper
extends
MPJBaseMapper
<
ArchiElement
>
{
/**
* 初始化版本
*
* @return {@link List }<{@link ArchiElement }>
*/
List
<
ArchiElement
>
initVersion
();
/**
* 获取版本
*
* @return {@link List }<{@link ArchiElement }>
*/
String
getVersion
(
@Param
(
"elementId"
)
Long
elementId
);
/**
* 元素列表
*
* @param dto DTO
* @param page 页
* @return {@link IPage }<{@link ArchiElement }>
*/
IPage
<
ArchiElement
>
gtArchiElement
(
@Param
(
"dto"
)
ArchiElementDTO
dto
,
Page
<
Object
>
page
);
/**
* 根据元素名称查询元素
*
* @param archiElements Archi 元素
* @return {@link List }<{@link ArchiElement }>
*/
List
<
ArchiElement
>
gtArcEleByName
(
@Param
(
"do"
)
ArchiElement
archiElements
);
/**
* 获取元素列表
*
* @param dto DTO
* @return {@link List }<{@link ArchiElement }>
*/
List
<
ArchiElement
>
gtEleList
(
@Param
(
"dto"
)
ArchiElementDTO
dto
);
List
<
ArchiElement
>
maxVer
(
ArchiElement
archiElement
);
/**
* 根据视图配置查询架构元素
*
* @return {@link List }<{@link ArchiElement }>
*/
List
<
ArchiElement
>
queryEleByAssertView
(
Long
viewId
);
}
arch-overall/src/main/resources/bootstrap-dev.yml
0 → 100644
View file @
49cc9bb
server
:
port
:
17003
nacos
:
server-addr
:
192.168.0.210:18848
username
:
nacos
password
:
nacos
namespace
:
${NAMESPACE:public}
file-extension
:
yaml
spring
:
cloud
:
nacos
:
config
:
group
:
DEFAULT_GROUP
server-addr
:
${nacos.server-addr}
username
:
${nacos.username}
password
:
${nacos.password}
namespace
:
${nacos.namespace}
# 公共配置
shared-configs
:
-
data-id
:
common-storage.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-config.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-log.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-datasource.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-mybatis.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-isc.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-redis.${nacos.file-extension}
refresh
:
true
discovery
:
ip
:
localhost
server-addr
:
${nacos.server-addr}
username
:
${nacos.username}
password
:
${nacos.password}
namespace
:
${nacos.namespace}
config
:
activate
:
on-profile
:
dev
arch-overall/src/main/resources/bootstrap-local.yml
0 → 100644
View file @
49cc9bb
server
:
port
:
17003
nacos
:
server-addr
:
localhost:8848
username
:
nacos
password
:
nacos
namespace
:
${NAMESPACE:public}
file-extension
:
yaml
spring
:
cloud
:
nacos
:
config
:
group
:
DEFAULT_GROUP
server-addr
:
${nacos.server-addr}
username
:
${nacos.username}
password
:
${nacos.password}
namespace
:
${nacos.namespace}
# 公共配置
shared-configs
:
-
data-id
:
common-storage.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-config.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-log.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-datasource.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-mybatis.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-isc.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-redis.${nacos.file-extension}
refresh
:
true
discovery
:
ip
:
localhost
server-addr
:
${nacos.server-addr}
username
:
${nacos.username}
password
:
${nacos.password}
namespace
:
${nacos.namespace}
arch-overall/src/main/resources/bootstrap-sit.yml
0 → 100644
View file @
49cc9bb
server
:
port
:
17003
nacos
:
server-addr
:
192.168.0.120:18848
username
:
nacos
password
:
nacos
namespace
:
${NAMESPACE:sit}
file-extension
:
yaml
spring
:
cloud
:
nacos
:
config
:
group
:
DEFAULT_GROUP
server-addr
:
${nacos.server-addr}
username
:
${nacos.username}
password
:
${nacos.password}
namespace
:
${nacos.namespace}
# 公共配置
shared-configs
:
-
data-id
:
common-storage.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-config.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-log.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-datasource.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-mybatis.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-isc.${nacos.file-extension}
refresh
:
true
-
data-id
:
common-redis.${nacos.file-extension}
refresh
:
true
discovery
:
server-addr
:
${nacos.server-addr}
username
:
${nacos.username}
password
:
${nacos.password}
namespace
:
${nacos.namespace}
config
:
activate
:
on-profile
:
sit
arch-overall/src/main/resources/bootstrap.yml
0 → 100644
View file @
49cc9bb
spring
:
application
:
name
:
eadc-architecture
main
:
# 解决升级 Spring Boot 2.6后,因循环引用导致启动时报错是否允许循环引用
allow-circular-references
:
true
servlet
:
multipart
:
max-file-size
:
50MB
max-request-size
:
100MB
profiles
:
active
:
dev
arch-overall/src/main/resources/logback-spring.xml
0 → 100644
View file @
49cc9bb
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
>
<!--定义日志文件的存储地址 -->
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<property
name=
"LOG_NAME"
value=
"eadc-architecture"
/>
<!--从配置中心加载数据-->
<springProperty
scope=
"context"
name=
"applicationName"
source=
"spring.application.name"
/>
<springProperty
scope=
"context"
name=
"logstashDestination"
source=
"logstash.destination"
/>
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<withJansi>
true
</withJansi>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n
</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件INFO -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${LOG_HOME}/${LOG_NAME}_info.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名 -->
<FileNamePattern>
${LOG_HOME}/${LOG_NAME}_info.%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<maxHistory>
30
</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!-- 按照每天生成日志文件ERROR -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
${LOG_HOME}/${LOG_NAME}_error.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${LOG_HOME}/${LOG_NAME}_error.%d{yyyy-MM-dd}.log
</FileNamePattern>
<MaxHistory>
30
</MaxHistory>
</rollingPolicy>
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50}:%L - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<!-- 只打印错误日志 -->
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!--nacos 心跳 INFO 屏蔽-->
<logger
name=
"com.alibaba.nacos"
level=
"OFF"
>
<appender-ref
ref=
"ERROR_FILE"
/>
</logger>
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"TRACE"
/>
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
/>
<logger
name=
"com.xxl.job.core"
level=
"DEBUG"
/>
<logger
name=
"org.apache.http.impl.conn"
level=
"INFO"
/>
<logger
name=
"springfox.documentation"
level=
"INFO"
/>
<logger
name=
"org.springframework"
level=
"INFO"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"INFO"
/>
<!-- 本地环境 -->
<springProfile
name=
"local"
>
<root
level=
"DEBUG"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
</springProfile>
<!-- 其它环境 -->
<springProfile
name=
"dev,test,stage,prod,sit,uat,default"
>
<root
level=
"DEBUG"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"INFO_FILE"
/>
<appender-ref
ref=
"ERROR_FILE"
/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
arch-overall/src/main/resources/mapper/modules/asset/ArchiElementMapper.xml
0 → 100644
View file @
49cc9bb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.eadc.modules.design.service.mapper.ArchiElementMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.eadc.modules.design.entity.ArchiElement"
>
<result
column=
"element_id"
property=
"elementId"
/>
<result
column=
"element_code"
property=
"elementCode"
/>
<result
column=
"element_name"
property=
"elementName"
/>
<result
column=
"archi_level_id"
property=
"archiLevelId"
/>
<result
column=
"archi_belong_id"
property=
"archiBelongId"
/>
<result
column=
"ea_level"
property=
"eaLevel"
/>
<result
column=
"ele_type"
property=
"eleType"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"icon"
property=
"icon"
/>
<result
column=
"icon_name"
property=
"iconName"
/>
<result
column=
"color"
property=
"color"
/>
<result
column=
"version"
property=
"version"
/>
<result
column=
"state"
property=
"state"
/>
<result
column=
"create_man"
property=
"createMan"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"last_update_time"
property=
"lastUpdateTime"
/>
<result
column=
"last_update_man"
property=
"lastUpdateMan"
/>
<result
column=
"del_flag"
property=
"delFlag"
/>
<result
column=
"archi_level_code"
property=
"archiLevelCode"
/>
<result
column=
"archi_belong_code"
property=
"archiBelongCode"
/>
</resultMap>
<select
id=
"initVersion"
resultType=
"com.eadc.modules.design.entity.ArchiElement"
>
SELECT CONCAT(DATE_FORMAT(NOW(), '%Y%m%d'), '-V', YEAR(NOW()) - 2023 - 1, '.', DATE_FORMAT(NOW(), '%m'), '.0') AS version;
</select>
<!--元素列表-->
<select
id=
"gtArchiElement"
resultType=
"com.eadc.modules.design.entity.ArchiElement"
>
select se.*,
gm.graph_name as iconName,
gm.icon
from archi_element se
left join graph_meta_info gm on se.graph_id = gm.graph_id
<where>
<if
test=
"dto.elementName != null and dto.elementName != ''"
>
and se.element_name like concat('%', #{dto.elementName}, '%')
</if>
<if
test=
"dto.archiBelongId != null"
>
and se.archi_belong_id = #{dto.archiBelongId}
</if>
<if
test=
"dto.state != null"
>
and se.state = #{dto.state}
</if>
<if
test=
"dto.scope != null"
>
and se.scope = #{dto.scope}
</if>
and se.del_flag = '0'
</where>
order by se.create_time desc
</select>
<!--根据元素名称查询元素-->
<select
id=
"gtArcEleByName"
resultType=
"com.eadc.modules.design.entity.ArchiElement"
>
select se.element_id,
se.element_name,
se.archi_belong_id,
se.color,
se.version
from archi_element se
<where>
and se.del_flag = '0'
<if
test=
"do.elementName != null and do.elementName != ''"
>
and se.element_name = #{do.elementName}
</if>
<if
test=
"do.elementId != null and do.elementId != ''"
>
and se.element_id = #{do.elementId}
</if>
</where>
order by se.create_time desc
</select>
<select
id=
"gtEleList"
resultType=
"com.eadc.modules.design.entity.ArchiElement"
>
select se.*,
gm.graph_name as iconName,
gm.icon
from archi_element se
left join graph_meta_info gm ON se.graph_id = gm.graph_id
<where>
and se.del_flag = '0'
<if
test=
"dto.elementName != null and dto.elementName != ''"
>
and se.element_name = #{dto.elementName}
</if>
<if
test=
"dto.elementId != null"
>
and se.element_id = #{dto.elementId}
</if>
<if
test=
"dto.archiBelongId != null"
>
and se.archi_belong_id = #{dto.archiBelongId}
</if>
<if
test=
"dto.eleType != null"
>
and se.ele_type = #{dto.eleType}
</if>
<if
test=
"dto.state != null"
>
and se.state = #{dto.state}
</if>
<if
test=
"dto.eleIdList != null and dto.eleIdList.size() > 0"
>
and se.element_id in
<foreach
item=
"eleId"
collection=
"dto.eleIdList"
open=
"("
separator=
","
close=
")"
>
#{eleId}
</foreach>
</if>
<if
test=
"dto.belongIdList != null and dto.belongIdList.size() > 0"
>
and se.archi_belong_id in
<foreach
item=
"belongId"
collection=
"dto.belongIdList"
open=
"("
separator=
","
close=
")"
>
#{belongId}
</foreach>
</if>
<if
test=
"dto.scopeList != null and dto.scopeList.size() > 0"
>
and se.scope in
<foreach
item=
"scope"
collection=
"dto.scopeList"
open=
"("
separator=
","
close=
")"
>
#{scope}
</foreach>
</if>
</where>
order by se.create_time desc
</select>
<select
id=
"maxVer"
resultType=
"com.eadc.modules.design.entity.ArchiElement"
>
SELECT a.version
FROM archi_element a
<where>
<if
test=
"elementName != null and elementName != ''"
>
and a.element_name = #{elementName}
</if>
<if
test=
"archiBelongId != null"
>
and a.archi_belong_id = #{archiBelongId}
</if>
and a.del_flag = 0
</where>
ORDER BY CAST(SUBSTRING_INDEX(version, '.', -1) AS DECIMAL) DESC
LIMIT 1
</select>
<!-- 根据视图配置查询架构元素-->
<select
id=
"queryEleByAssertView"
resultMap=
"BaseResultMap"
>
select ae.element_id,
ae.element_code,
ae.element_name,
ae.archi_level_id,
ae.archi_belong_id,
ae.ea_level,
ae.content,
ae.color,
ae.version,
ae.`state`,
ae.ele_type,
ae.create_man,
ae.create_time,
ae.last_update_time,
ae.last_update_man,
ae.del_flag,
ae.archi_level_code,
ae.archi_belong_code,
ae.shape_width,
ae.shape_height,
ae.reference_relationship,
ae.example,
ae.`definition`,
ae.`scope`,
ae.graph_id
from archi_element ae
where find_in_set(ae.element_id,
(select ave.archi_ele_id from archi_view_ele ave where archi_view_id = #{viewId}))
and ae.state = 1
</select>
<!--获取最新版本-->
<select
id=
"getVersion"
resultType=
"java.lang.String"
>
set @i := (
<include
refid=
"com.eadc.modules.design.service.mapper.VersionInitMapper.versionInit"
/>
);
select ifnull(version, @i) from archi_element where element_id = #{elementId} for update
</select>
</mapper>
\ No newline at end of file
arch-overall/src/main/resources/tika-config.xml
0 → 100644
View file @
49cc9bb
<!--<?xml version="1.0" encoding="UTF-8"?>-->
<!--<properties>-->
<!-- <encodingDetectors>-->
<!-- <encodingDetector class="org.apache.tika.parser.html.HtmlEncodingDetector">-->
<!-- <params>-->
<!-- <param name="markLimit" type="int">64000</param>-->
<!-- </params>-->
<!-- </encodingDetector>-->
<!-- <encodingDetector class="org.apache.tika.parser.txt.UniversalEncodingDetector">-->
<!-- <params>-->
<!-- <param name="markLimit" type="int">64001</param>-->
<!-- </params>-->
<!-- </encodingDetector>-->
<!-- <encodingDetector class="org.apache.tika.parser.txt.Icu4jEncodingDetector">-->
<!-- <params>-->
<!-- <param name="markLimit" type="int">64002</param>-->
<!-- </params>-->
<!-- </encodingDetector>-->
<!-- </encodingDetectors>-->
<!--</properties>-->
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment