Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emport-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘泽志
emport-api
Commits
3f89b1b1
Commit
3f89b1b1
authored
Feb 09, 2023
by
刘泽志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规则
parent
38599d76
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
302 additions
and
0 deletions
+302
-0
DataImportController.java
...f/his/web/controller/dataImport/DataImportController.java
+56
-0
AddRuleParam.java
...om/tbyf/his/web/dataImport/domain/param/AddRuleParam.java
+37
-0
QueryRuleParam.java
.../tbyf/his/web/dataImport/domain/param/QueryRuleParam.java
+25
-0
UpdateRuleParam.java
...tbyf/his/web/dataImport/domain/param/UpdateRuleParam.java
+42
-0
BindRule.java
...ain/java/com/tbyf/his/web/dataImport/entity/BindRule.java
+33
-0
DataRule.java
...ain/java/com/tbyf/his/web/dataImport/entity/DataRule.java
+50
-0
DataRuleMapper.java
...va/com/tbyf/his/web/dataImport/mapper/DataRuleMapper.java
+12
-0
DataRuleService.java
.../com/tbyf/his/web/dataImport/service/DataRuleService.java
+12
-0
DataRuleServiceImpl.java
.../his/web/dataImport/service/impl/DataRuleServiceImpl.java
+20
-0
dataImport.sql
scripts/dataImport.sql
+15
-0
No files found.
admin-api/src/main/java/com/tbyf/his/web/controller/dataImport/DataImportController.java
View file @
3f89b1b1
...
@@ -20,9 +20,11 @@ import com.tbyf.his.web.dataImport.domain.param.*;
...
@@ -20,9 +20,11 @@ import com.tbyf.his.web.dataImport.domain.param.*;
import
com.tbyf.his.web.dataImport.entity.DataDict
;
import
com.tbyf.his.web.dataImport.entity.DataDict
;
import
com.tbyf.his.web.dataImport.entity.DataField
;
import
com.tbyf.his.web.dataImport.entity.DataField
;
import
com.tbyf.his.web.dataImport.entity.DataImportTemplate
;
import
com.tbyf.his.web.dataImport.entity.DataImportTemplate
;
import
com.tbyf.his.web.dataImport.entity.DataRule
;
import
com.tbyf.his.web.dataImport.service.DataDictService
;
import
com.tbyf.his.web.dataImport.service.DataDictService
;
import
com.tbyf.his.web.dataImport.service.DataFieldService
;
import
com.tbyf.his.web.dataImport.service.DataFieldService
;
import
com.tbyf.his.web.dataImport.service.DataImportTemplateService
;
import
com.tbyf.his.web.dataImport.service.DataImportTemplateService
;
import
com.tbyf.his.web.dataImport.service.DataRuleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -63,6 +65,9 @@ public class DataImportController {
...
@@ -63,6 +65,9 @@ public class DataImportController {
@Autowired
@Autowired
private
DataFieldService
dataFieldService
;
private
DataFieldService
dataFieldService
;
@Autowired
private
DataRuleService
dataRuleService
;
@IgnoreWebSecurity
@IgnoreWebSecurity
@GetMapping
(
"/template"
)
@GetMapping
(
"/template"
)
@ApiOperation
(
"模板查询"
)
@ApiOperation
(
"模板查询"
)
...
@@ -253,4 +258,55 @@ public class DataImportController {
...
@@ -253,4 +258,55 @@ public class DataImportController {
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
}
}
@IgnoreWebSecurity
@GetMapping
(
"/rule"
)
@ApiOperation
(
"规则查询"
)
public
TableDataInfo
queryRule
(
@Validated
QueryRuleParam
param
)
{
final
Page
<
DataRule
>
page
=
Page
.
of
(
param
.
getPageNum
(),
param
.
getPageSize
());
final
LambdaQueryWrapper
<
DataRule
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
DataRule
.
class
);
queryWrapper
.
like
(
StringUtils
.
isNotBlank
(
param
.
getName
()),
DataRule:
:
getName
,
param
.
getName
())
.
eq
(
StringUtils
.
isNotBlank
(
param
.
getType
()),
DataRule:
:
getType
,
param
.
getType
())
.
in
(
DataRule:
:
getType
,
"基础规则"
,
"组合规则"
);
final
Page
<
DataRule
>
templatePage
=
dataRuleService
.
page
(
page
,
queryWrapper
);
return
param
.
convert
(
templatePage
);
}
@IgnoreWebSecurity
@GetMapping
(
"/rule/dict"
)
@ApiOperation
(
"规则字典"
)
public
AjaxResult
queryRuleDict
()
{
final
LambdaQueryWrapper
<
DataRule
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
DataRule
.
class
);
queryWrapper
.
in
(
DataRule:
:
getType
,
"基础规则"
,
"组合规则"
)
.
select
(
DataRule:
:
getId
,
DataRule:
:
getName
);
return
AjaxResult
.
success
(
dataRuleService
.
list
(
queryWrapper
));
}
@IgnoreWebSecurity
@PostMapping
(
"/rule"
)
@ApiOperation
(
"规则新增"
)
public
AjaxResult
addRule
(
@RequestBody
@Validated
AddRuleParam
param
)
{
DataRule
rule
=
new
DataRule
();
BeanUtils
.
copyProperties
(
param
,
rule
);
dataRuleService
.
save
(
rule
);
return
AjaxResult
.
success
();
}
@IgnoreWebSecurity
@PutMapping
(
"/rule"
)
@ApiOperation
(
"修改规则"
)
public
AjaxResult
updateRule
(
@RequestBody
@Validated
UpdateRuleParam
param
)
{
DataRule
rule
=
new
DataRule
();
BeanUtils
.
copyProperties
(
param
,
rule
);
dataRuleService
.
updateById
(
rule
);
return
AjaxResult
.
success
();
}
@IgnoreWebSecurity
@DeleteMapping
(
"/rule"
)
@ApiOperation
(
"删除规则"
)
public
AjaxResult
deleteRule
(
@RequestParam
String
ruleId
)
{
dataRuleService
.
removeById
(
ruleId
);
return
AjaxResult
.
success
();
}
}
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/domain/param/AddRuleParam.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
domain
.
param
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* @author lzz
* @date 2023/1/10 15:36
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"新增规则"
,
description
=
"新增规则"
)
public
class
AddRuleParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"规则名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"规则类型 1-基础规则 2-组合规则 3-字段复合规则"
)
private
String
type
;
@ApiModelProperty
(
value
=
"规则验证模式"
)
private
String
mode
;
@ApiModelProperty
(
value
=
"规则验证内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remarks
;
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/domain/param/QueryRuleParam.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
domain
.
param
;
import
com.tbyf.his.web.dataImport.domain.ParamMp
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* @author lzz
* @date 2023/1/10 17:01
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"规则查询参数"
,
description
=
"规则查询参数"
)
public
class
QueryRuleParam
extends
ParamMp
{
@ApiModelProperty
(
value
=
"规则名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"规则类型"
)
private
String
type
;
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/domain/param/UpdateRuleParam.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
domain
.
param
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
/**
* @author lzz
* @date 2023/1/10 15:36
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"修改字段"
,
description
=
"修改字段"
)
public
class
UpdateRuleParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"规则id"
)
@NotBlank
(
message
=
"规则id不能为空"
)
private
String
id
;
@ApiModelProperty
(
value
=
"规则名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"规则类型 1-基础规则 2-组合规则 3-字段复合规则"
)
private
String
type
;
@ApiModelProperty
(
value
=
"规则验证模式"
)
private
String
mode
;
@ApiModelProperty
(
value
=
"规则验证内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remarks
;
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/entity/BindRule.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* @author lzz
* @date 2023/1/10 15:36
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"bind_rule"
,
autoResultMap
=
true
)
@ApiModel
(
value
=
"数据规则绑定表"
,
description
=
"数据规则绑定表"
)
public
class
BindRule
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"数据ID"
)
@TableField
(
"data_id"
)
private
String
dataId
;
@ApiModelProperty
(
value
=
"规则ID"
)
@TableField
(
"rule_id"
)
private
String
ruleId
;
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/entity/DataRule.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
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.experimental.Accessors
;
import
java.io.Serializable
;
/**
* @author lzz
* @date 2023/1/10 15:36
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"data_rule"
,
autoResultMap
=
true
)
@ApiModel
(
value
=
"数据规则表"
,
description
=
"数据规则表"
)
public
class
DataRule
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
@ApiModelProperty
(
value
=
"规则名称"
)
@TableField
(
"name"
)
private
String
name
;
@ApiModelProperty
(
value
=
"规则类型 1-基础规则 2-组合规则 3-字段复合规则"
)
@TableField
(
"type"
)
private
String
type
;
@ApiModelProperty
(
value
=
"规则验证模式"
)
@TableField
(
"mode"
)
private
String
mode
;
@ApiModelProperty
(
value
=
"规则验证内容"
)
@TableField
(
"content"
)
private
String
content
;
@ApiModelProperty
(
value
=
"备注"
)
@TableField
(
"remarks"
)
private
String
remarks
;
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/mapper/DataRuleMapper.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.tbyf.his.web.dataImport.entity.DataRule
;
/**
* @author lzz
* @date 2023/2/7 11:22
*/
public
interface
DataRuleMapper
extends
BaseMapper
<
DataRule
>
{
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/service/DataRuleService.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.tbyf.his.web.dataImport.entity.DataRule
;
/**
* @author lzz
* @date 2023/2/7 11:23
*/
public
interface
DataRuleService
extends
IService
<
DataRule
>
{
}
admin-api/src/main/java/com/tbyf/his/web/dataImport/service/impl/DataRuleServiceImpl.java
0 → 100644
View file @
3f89b1b1
package
com
.
tbyf
.
his
.
web
.
dataImport
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.tbyf.his.common.annotation.DataSource
;
import
com.tbyf.his.common.enums.DataSourceType
;
import
com.tbyf.his.web.dataImport.entity.DataRule
;
import
com.tbyf.his.web.dataImport.mapper.DataRuleMapper
;
import
com.tbyf.his.web.dataImport.service.DataRuleService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
/**
* @author lzz
* @date 2023/2/7 11:24
*/
@Slf4j
@Service
@DataSource
(
DataSourceType
.
MASTER
)
public
class
DataRuleServiceImpl
extends
ServiceImpl
<
DataRuleMapper
,
DataRule
>
implements
DataRuleService
{
}
scripts/dataImport.sql
View file @
3f89b1b1
...
@@ -38,4 +38,18 @@ create table data_field
...
@@ -38,4 +38,18 @@ create table data_field
field
varchar
(
32
)
null
comment
'数据库字段名'
field
varchar
(
32
)
null
comment
'数据库字段名'
)
comment
'数据字段表'
;
)
comment
'数据字段表'
;
create
table
data_rule
(
id
varchar
(
32
)
not
null
primary
key
,
name
varchar
(
64
)
null
comment
'规则名称'
,
type
varchar
(
64
)
null
comment
'规则类型 1-基础规则 2-组合规则 3-字段复合规则'
,
mode
varchar
(
64
)
null
comment
'规则验证模式'
,
content
varchar
(
256
)
null
comment
'规则验证内容'
,
remarks
text
null
comment
'备注'
)
comment
'数据规则表'
;
create
table
bind_rule
(
data_id
varchar
(
32
)
null
comment
'数据ID'
,
rule_id
varchar
(
32
)
null
comment
'规则ID'
)
comment
'规则绑定表'
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment