Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
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
黄营
datax-cloud
Commits
d3ed5ad9
Commit
d3ed5ad9
authored
Sep 29, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
7656bfa2
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
672 additions
and
21 deletions
+672
-21
CheckRuleDto.java
...a/cn/datax/service/data/quality/api/dto/CheckRuleDto.java
+4
-0
CheckRuleEntity.java
...atax/service/data/quality/api/entity/CheckRuleEntity.java
+10
-0
ScheduleJobEntity.java
...ax/service/data/quality/api/entity/ScheduleJobEntity.java
+61
-0
ScheduleJobQuery.java
...atax/service/data/quality/api/query/ScheduleJobQuery.java
+20
-0
CheckRuleVo.java
...ava/cn/datax/service/data/quality/api/vo/CheckRuleVo.java
+2
-0
ScheduleJobVo.java
...a/cn/datax/service/data/quality/api/vo/ScheduleJobVo.java
+27
-0
SchedulingConfig.java
...n/datax/service/data/quality/config/SchedulingConfig.java
+20
-0
StartedUpRunner.java
...cn/datax/service/data/quality/config/StartedUpRunner.java
+26
-0
ScheduleJobController.java
...ervice/data/quality/controller/ScheduleJobController.java
+76
-0
ScheduleJobDao.java
...ava/cn/datax/service/data/quality/dao/ScheduleJobDao.java
+18
-0
ScheduleJobMapper.java
...tax/service/data/quality/mapstruct/ScheduleJobMapper.java
+33
-0
ScheduleJobService.java
...atax/service/data/quality/service/ScheduleJobService.java
+17
-0
ScheduleJobServiceImpl.java
...ice/data/quality/service/impl/ScheduleJobServiceImpl.java
+36
-0
CronTaskRegistrar.java
...cn/datax/service/data/quality/task/CronTaskRegistrar.java
+58
-0
MyTask.java
.../main/java/cn/datax/service/data/quality/task/MyTask.java
+15
-0
ScheduledTask.java
...ava/cn/datax/service/data/quality/task/ScheduledTask.java
+18
-0
SchedulingRunnable.java
...n/datax/service/data/quality/task/SchedulingRunnable.java
+82
-0
CheckRuleMapper.xml
...ity-service/src/main/resources/mapper/CheckRuleMapper.xml
+6
-2
ScheduleJobMapper.xml
...y-service/src/main/resources/mapper/ScheduleJobMapper.xml
+23
-0
ContrastDto.java
...a/cn/datax/service/data/standard/api/dto/ContrastDto.java
+6
-0
ContrastEntity.java
...atax/service/data/standard/api/entity/ContrastEntity.java
+15
-0
ContrastTreeVo.java
...cn/datax/service/data/standard/api/vo/ContrastTreeVo.java
+1
-4
ContrastVo.java
...ava/cn/datax/service/data/standard/api/vo/ContrastVo.java
+3
-0
ContrastServiceImpl.java
...rvice/data/standard/service/impl/ContrastServiceImpl.java
+41
-2
ContrastMapper.xml
...dard-service/src/main/resources/mapper/ContrastMapper.xml
+4
-1
DataModelAdd.vue
datax-ui/src/views/masterdata/datamodel/DataModelAdd.vue
+2
-2
DataModelDetail.vue
datax-ui/src/views/masterdata/datamodel/DataModelDetail.vue
+2
-2
DataModelEdit.vue
datax-ui/src/views/masterdata/datamodel/DataModelEdit.vue
+2
-2
CheckRuleAdd.vue
datax-ui/src/views/quality/checkrule/CheckRuleAdd.vue
+4
-0
CheckRuleEdit.vue
datax-ui/src/views/quality/checkrule/CheckRuleEdit.vue
+4
-0
CheckRuleList.vue
datax-ui/src/views/quality/checkrule/CheckRuleList.vue
+8
-2
DataContrastList.vue
...x-ui/src/views/standard/datacontrast/DataContrastList.vue
+3
-2
FormContrast.vue
...c/views/standard/datacontrast/components/FormContrast.vue
+25
-2
No files found.
datax-modules/data-quality-service-parent/data-quality-service-api/src/main/java/cn/datax/service/data/quality/api/dto/CheckRuleDto.java
View file @
d3ed5ad9
...
...
@@ -40,10 +40,14 @@ public class CheckRuleDto implements Serializable {
private
String
ruleTableId
;
@ApiModelProperty
(
value
=
"数据表"
)
private
String
ruleTable
;
@ApiModelProperty
(
value
=
"数据表名称"
)
private
String
ruleTableComment
;
@ApiModelProperty
(
value
=
"核查字段主键"
)
private
String
ruleColumnId
;
@ApiModelProperty
(
value
=
"核查字段"
)
private
String
ruleColumn
;
@ApiModelProperty
(
value
=
"核查字段名称"
)
private
String
ruleColumnComment
;
@ApiModelProperty
(
value
=
"核查脚本"
)
private
String
ruleSql
;
@ApiModelProperty
(
value
=
"状态"
)
...
...
datax-modules/data-quality-service-parent/data-quality-service-api/src/main/java/cn/datax/service/data/quality/api/entity/CheckRuleEntity.java
View file @
d3ed5ad9
...
...
@@ -65,6 +65,11 @@ public class CheckRuleEntity extends DataScopeBaseEntity {
private
String
ruleTable
;
/**
* 数据表名称
*/
private
String
ruleTableComment
;
/**
* 核查字段主键
*/
private
String
ruleColumnId
;
...
...
@@ -75,6 +80,11 @@ public class CheckRuleEntity extends DataScopeBaseEntity {
private
String
ruleColumn
;
/**
* 核查字段名称
*/
private
String
ruleColumnComment
;
/**
* 核查脚本
*/
private
String
ruleSql
;
...
...
datax-modules/data-quality-service-parent/data-quality-service-api/src/main/java/cn/datax/service/data/quality/api/entity/ScheduleJobEntity.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* <p>
* 数据质量监控任务信息表
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"quality_schedule_job"
)
public
class
ScheduleJobEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
String
id
;
/**
* 任务名称
*/
private
String
jobName
;
/**
* bean名称
*/
private
String
beanName
;
/**
* 方法名称
*/
private
String
methodName
;
/**
* 方法参数
*/
private
String
methodParams
;
/**
* cron表达式
*/
private
String
cronExpression
;
/**
* 状态(1运行 0暂停)
*/
private
String
status
;
}
datax-modules/data-quality-service-parent/data-quality-service-api/src/main/java/cn/datax/service/data/quality/api/query/ScheduleJobQuery.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
api
.
query
;
import
cn.datax.common.base.BaseQueryParams
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 数据质量监控任务信息表 查询实体
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ScheduleJobQuery
extends
BaseQueryParams
{
private
static
final
long
serialVersionUID
=
1L
;
}
datax-modules/data-quality-service-parent/data-quality-service-api/src/main/java/cn/datax/service/data/quality/api/vo/CheckRuleVo.java
View file @
d3ed5ad9
...
...
@@ -32,7 +32,9 @@ public class CheckRuleVo implements Serializable {
private
String
ruleSource
;
private
String
ruleTableId
;
private
String
ruleTable
;
private
String
ruleTableComment
;
private
String
ruleColumnId
;
private
String
ruleColumn
;
private
String
ruleColumnComment
;
private
String
ruleSql
;
}
datax-modules/data-quality-service-parent/data-quality-service-api/src/main/java/cn/datax/service/data/quality/api/vo/ScheduleJobVo.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 数据质量监控任务信息表 实体VO
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Data
public
class
ScheduleJobVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
private
String
status
;
private
String
jobName
;
private
String
beanName
;
private
String
methodName
;
private
String
methodParams
;
private
String
cronExpression
;
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/config/SchedulingConfig.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.TaskScheduler
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
@Configuration
public
class
SchedulingConfig
{
@Bean
public
TaskScheduler
taskScheduler
()
{
ThreadPoolTaskScheduler
taskScheduler
=
new
ThreadPoolTaskScheduler
();
// 定时任务执行线程池核心线程数
taskScheduler
.
setPoolSize
(
5
);
taskScheduler
.
setRemoveOnCancelPolicy
(
true
);
taskScheduler
.
setThreadNamePrefix
(
"TaskSchedulerThreadPool-"
);
return
taskScheduler
;
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/config/StartedUpRunner.java
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
config
;
import
cn.datax.common.core.DataConstant
;
import
cn.datax.service.data.quality.api.entity.ScheduleJobEntity
;
import
cn.datax.service.data.quality.service.ScheduleJobService
;
import
cn.datax.service.data.quality.task.CronTaskRegistrar
;
import
cn.datax.service.data.quality.task.SchedulingRunnable
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.context.ConfigurableApplicationContext
;
...
...
@@ -9,7 +18,9 @@ import org.springframework.stereotype.Component;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
@Slf4j
@Component
@RequiredArgsConstructor
public
class
StartedUpRunner
implements
ApplicationRunner
{
...
...
@@ -17,6 +28,12 @@ public class StartedUpRunner implements ApplicationRunner {
private
final
ConfigurableApplicationContext
context
;
private
final
Environment
environment
;
@Autowired
private
CronTaskRegistrar
cronTaskRegistrar
;
@Autowired
private
ScheduleJobService
scheduleJobService
;
@Override
public
void
run
(
ApplicationArguments
args
)
{
if
(
context
.
isActive
())
{
...
...
@@ -26,6 +43,15 @@ public class StartedUpRunner implements ApplicationRunner {
"端口号:"
+
environment
.
getProperty
(
"server.port"
)
+
"\n"
+
"-----------------------------------------"
;
System
.
out
.
println
(
banner
);
List
<
ScheduleJobEntity
>
list
=
scheduleJobService
.
list
(
Wrappers
.<
ScheduleJobEntity
>
lambdaQuery
().
eq
(
ScheduleJobEntity:
:
getStatus
,
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
()));
if
(
CollUtil
.
isNotEmpty
(
list
))
{
list
.
stream
().
forEach
(
job
->
{
SchedulingRunnable
task
=
new
SchedulingRunnable
(
job
.
getBeanName
(),
job
.
getMethodName
(),
job
.
getMethodParams
());
cronTaskRegistrar
.
addCronTask
(
task
,
job
.
getCronExpression
());
});
}
log
.
info
(
"定时任务已加载完毕..."
);
}
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/controller/ScheduleJobController.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
controller
;
import
cn.datax.common.core.JsonPage
;
import
cn.datax.common.core.R
;
import
cn.datax.service.data.quality.api.entity.ScheduleJobEntity
;
import
cn.datax.service.data.quality.api.vo.ScheduleJobVo
;
import
cn.datax.service.data.quality.api.query.ScheduleJobQuery
;
import
cn.datax.service.data.quality.mapstruct.ScheduleJobMapper
;
import
cn.datax.service.data.quality.service.ScheduleJobService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
cn.datax.common.base.BaseController
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* 数据质量监控任务信息表 前端控制器
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Api
(
tags
=
{
"数据质量监控任务信息表"
})
@RestController
@RequestMapping
(
"/quality/scheduleJob"
)
public
class
ScheduleJobController
extends
BaseController
{
@Autowired
private
ScheduleJobService
scheduleJobService
;
@Autowired
private
ScheduleJobMapper
scheduleJobMapper
;
/**
* 通过ID查询信息
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"获取详细信息"
,
notes
=
"根据url的id来获取详细信息"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"path"
)
@GetMapping
(
"/{id}"
)
public
R
getScheduleJobById
(
@PathVariable
String
id
)
{
ScheduleJobEntity
scheduleJobEntity
=
scheduleJobService
.
getScheduleJobById
(
id
);
return
R
.
ok
().
setData
(
scheduleJobMapper
.
toVO
(
scheduleJobEntity
));
}
/**
* 分页查询信息
*
* @param scheduleJobQuery
* @return
*/
@ApiOperation
(
value
=
"分页查询"
,
notes
=
""
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"scheduleJobQuery"
,
value
=
"查询实体scheduleJobQuery"
,
required
=
true
,
dataTypeClass
=
ScheduleJobQuery
.
class
)
})
@GetMapping
(
"/page"
)
public
R
getScheduleJobPage
(
ScheduleJobQuery
scheduleJobQuery
)
{
QueryWrapper
<
ScheduleJobEntity
>
queryWrapper
=
new
QueryWrapper
<>();
IPage
<
ScheduleJobEntity
>
page
=
scheduleJobService
.
page
(
new
Page
<>(
scheduleJobQuery
.
getPageNum
(),
scheduleJobQuery
.
getPageSize
()),
queryWrapper
);
List
<
ScheduleJobVo
>
collect
=
page
.
getRecords
().
stream
().
map
(
scheduleJobMapper:
:
toVO
).
collect
(
Collectors
.
toList
());
JsonPage
<
ScheduleJobVo
>
jsonPage
=
new
JsonPage
<>(
page
.
getCurrent
(),
page
.
getSize
(),
page
.
getTotal
(),
collect
);
return
R
.
ok
().
setData
(
jsonPage
);
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/dao/ScheduleJobDao.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
dao
;
import
cn.datax.common.base.BaseDao
;
import
cn.datax.service.data.quality.api.entity.ScheduleJobEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* <p>
* 数据质量监控任务信息表 Mapper 接口
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Mapper
public
interface
ScheduleJobDao
extends
BaseDao
<
ScheduleJobEntity
>
{
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/mapstruct/ScheduleJobMapper.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
mapstruct
;
import
cn.datax.service.data.quality.api.entity.ScheduleJobEntity
;
import
cn.datax.service.data.quality.api.vo.ScheduleJobVo
;
import
org.mapstruct.Mapper
;
import
java.util.List
;
/**
* <p>
* 数据质量监控任务信息表 Mapper 实体映射
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Mapper
(
componentModel
=
"spring"
)
public
interface
ScheduleJobMapper
{
/**
* 将源对象转换为VO对象
* @param e
* @return D
*/
ScheduleJobVo
toVO
(
ScheduleJobEntity
e
);
/**
* 将源对象集合转换为VO对象集合
* @param es
* @return List<D>
*/
List
<
ScheduleJobVo
>
toVO
(
List
<
ScheduleJobEntity
>
es
);
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/service/ScheduleJobService.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
service
;
import
cn.datax.service.data.quality.api.entity.ScheduleJobEntity
;
import
cn.datax.common.base.BaseService
;
/**
* <p>
* 数据质量监控任务信息表 服务类
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
public
interface
ScheduleJobService
extends
BaseService
<
ScheduleJobEntity
>
{
ScheduleJobEntity
getScheduleJobById
(
String
id
);
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/service/impl/ScheduleJobServiceImpl.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
service
.
impl
;
import
cn.datax.service.data.quality.api.entity.ScheduleJobEntity
;
import
cn.datax.service.data.quality.service.ScheduleJobService
;
import
cn.datax.service.data.quality.mapstruct.ScheduleJobMapper
;
import
cn.datax.service.data.quality.dao.ScheduleJobDao
;
import
cn.datax.common.base.BaseServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* <p>
* 数据质量监控任务信息表 服务实现类
* </p>
*
* @author yuwei
* @since 2020-09-29
*/
@Service
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
ScheduleJobServiceImpl
extends
BaseServiceImpl
<
ScheduleJobDao
,
ScheduleJobEntity
>
implements
ScheduleJobService
{
@Autowired
private
ScheduleJobDao
scheduleJobDao
;
@Autowired
private
ScheduleJobMapper
scheduleJobMapper
;
@Override
public
ScheduleJobEntity
getScheduleJobById
(
String
id
)
{
ScheduleJobEntity
scheduleJobEntity
=
super
.
getById
(
id
);
return
scheduleJobEntity
;
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/task/CronTaskRegistrar.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
task
;
import
org.springframework.beans.factory.DisposableBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.TaskScheduler
;
import
org.springframework.scheduling.config.CronTask
;
import
org.springframework.stereotype.Component
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Component
public
class
CronTaskRegistrar
implements
DisposableBean
{
private
final
Map
<
Runnable
,
ScheduledTask
>
scheduledTasks
=
new
ConcurrentHashMap
<>(
8
);
@Autowired
private
TaskScheduler
taskScheduler
;
public
TaskScheduler
getScheduler
()
{
return
this
.
taskScheduler
;
}
public
void
addCronTask
(
Runnable
task
,
String
cronExpression
)
{
addCronTask
(
new
CronTask
(
task
,
cronExpression
));
}
public
void
addCronTask
(
CronTask
cronTask
)
{
if
(
cronTask
!=
null
)
{
Runnable
task
=
cronTask
.
getRunnable
();
if
(
this
.
scheduledTasks
.
containsKey
(
task
))
{
removeCronTask
(
task
);
}
this
.
scheduledTasks
.
put
(
task
,
scheduleCronTask
(
cronTask
));
}
}
public
void
removeCronTask
(
Runnable
task
)
{
ScheduledTask
scheduledTask
=
this
.
scheduledTasks
.
remove
(
task
);
if
(
scheduledTask
!=
null
)
{
scheduledTask
.
cancel
();
}
}
public
ScheduledTask
scheduleCronTask
(
CronTask
cronTask
)
{
ScheduledTask
scheduledTask
=
new
ScheduledTask
();
scheduledTask
.
future
=
this
.
taskScheduler
.
schedule
(
cronTask
.
getRunnable
(),
cronTask
.
getTrigger
());
return
scheduledTask
;
}
@Override
public
void
destroy
()
{
for
(
ScheduledTask
task
:
this
.
scheduledTasks
.
values
())
{
task
.
cancel
();
}
this
.
scheduledTasks
.
clear
();
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/task/MyTask.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
task
;
import
org.springframework.stereotype.Component
;
@Component
(
"myTask"
)
public
class
MyTask
{
public
void
taskWithParams
(
String
params
)
{
System
.
out
.
println
(
"执行有参示例任务:"
+
params
);
}
public
void
taskNoParams
()
{
System
.
out
.
println
(
"执行无参示例任务"
);
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/task/ScheduledTask.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
task
;
import
java.util.concurrent.ScheduledFuture
;
public
final
class
ScheduledTask
{
volatile
ScheduledFuture
<?>
future
;
/**
* 取消定时任务
*/
public
void
cancel
()
{
ScheduledFuture
<?>
future
=
this
.
future
;
if
(
future
!=
null
)
{
future
.
cancel
(
true
);
}
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/java/cn/datax/service/data/quality/task/SchedulingRunnable.java
0 → 100644
View file @
d3ed5ad9
package
cn
.
datax
.
service
.
data
.
quality
.
task
;
import
cn.datax.common.utils.SpringContextHolder
;
import
cn.hutool.core.util.StrUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ReflectionUtils
;
import
java.lang.reflect.Method
;
import
java.util.Objects
;
@Slf4j
public
class
SchedulingRunnable
implements
Runnable
{
private
String
beanName
;
private
String
methodName
;
private
String
params
;
public
SchedulingRunnable
(
String
beanName
,
String
methodName
)
{
this
(
beanName
,
methodName
,
null
);
}
public
SchedulingRunnable
(
String
beanName
,
String
methodName
,
String
params
)
{
this
.
beanName
=
beanName
;
this
.
methodName
=
methodName
;
this
.
params
=
params
;
}
@Override
public
void
run
()
{
log
.
info
(
"定时任务开始执行 - bean:{},方法:{},参数:{}"
,
beanName
,
methodName
,
params
);
long
startTime
=
System
.
currentTimeMillis
();
try
{
Object
target
=
SpringContextHolder
.
getBean
(
beanName
);
Method
method
=
null
;
if
(
StrUtil
.
isNotEmpty
(
params
))
{
method
=
target
.
getClass
().
getDeclaredMethod
(
methodName
,
String
.
class
);
}
else
{
method
=
target
.
getClass
().
getDeclaredMethod
(
methodName
);
}
ReflectionUtils
.
makeAccessible
(
method
);
if
(
StrUtil
.
isNotEmpty
(
params
))
{
method
.
invoke
(
target
,
params
);
}
else
{
method
.
invoke
(
target
);
}
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"定时任务执行异常 - bean:%s,方法:%s,参数:%s "
,
beanName
,
methodName
,
params
),
ex
);
}
long
times
=
System
.
currentTimeMillis
()
-
startTime
;
log
.
info
(
"定时任务执行结束 - bean:{},方法:{},参数:{},耗时:{} 毫秒"
,
beanName
,
methodName
,
params
,
times
);
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
SchedulingRunnable
that
=
(
SchedulingRunnable
)
o
;
if
(
params
==
null
)
{
return
beanName
.
equals
(
that
.
beanName
)
&&
methodName
.
equals
(
that
.
methodName
)
&&
that
.
params
==
null
;
}
return
beanName
.
equals
(
that
.
beanName
)
&&
methodName
.
equals
(
that
.
methodName
)
&&
params
.
equals
(
that
.
params
);
}
@Override
public
int
hashCode
()
{
if
(
params
==
null
)
{
return
Objects
.
hash
(
beanName
,
methodName
);
}
return
Objects
.
hash
(
beanName
,
methodName
,
params
);
}
}
datax-modules/data-quality-service-parent/data-quality-service/src/main/resources/mapper/CheckRuleMapper.xml
View file @
d3ed5ad9
...
...
@@ -20,8 +20,10 @@
<result
column=
"rule_source"
property=
"ruleSource"
/>
<result
column=
"rule_table_id"
property=
"ruleTableId"
/>
<result
column=
"rule_table"
property=
"ruleTable"
/>
<result
column=
"rule_table_comment"
property=
"ruleTableComment"
/>
<result
column=
"rule_column_id"
property=
"ruleColumnId"
/>
<result
column=
"rule_column"
property=
"ruleColumn"
/>
<result
column=
"rule_column_comment"
property=
"ruleColumnComment"
/>
<result
column=
"rule_sql"
property=
"ruleSql"
/>
<result
column=
"last_check_batch"
property=
"lastCheckBatch"
/>
</resultMap>
...
...
@@ -36,7 +38,8 @@
update_by,
update_time,
remark,
rule_name, rule_type_id, rule_level, rule_source_id, rule_source, rule_table_id, rule_table, rule_column_id, rule_column, rule_sql, last_check_batch
rule_name, rule_type_id, rule_level, rule_source_id, rule_source, rule_table_id, rule_table, rule_table_comment
rule_column_id, rule_column, rule_column_comment, rule_sql, last_check_batch
</sql>
<sql
id=
"Rule_Column_List"
>
...
...
@@ -48,7 +51,8 @@
${alias}.update_by,
${alias}.update_time,
${alias}.remark,
${alias}.rule_name, ${alias}.rule_type_id, ${alias}.rule_level, ${alias}.rule_source_id, ${alias}.rule_source, ${alias}.rule_table_id, ${alias}.rule_table, ${alias}.rule_column_id, ${alias}.rule_column, ${alias}.rule_sql, ${alias}.last_check_batch
${alias}.rule_name, ${alias}.rule_type_id, ${alias}.rule_level, ${alias}.rule_source_id, ${alias}.rule_source,
${alias}.rule_table_id, ${alias}.rule_table, ${alias}.rule_table_comment, ${alias}.rule_column_id, ${alias}.rule_column, ${alias}.rule_column_comment, ${alias}.rule_sql, ${alias}.last_check_batch
</sql>
<select
id=
"selectPage"
resultMap=
"BaseResultMap"
>
...
...
datax-modules/data-quality-service-parent/data-quality-service/src/main/resources/mapper/ScheduleJobMapper.xml
0 → 100644
View file @
d3ed5ad9
<?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=
"cn.datax.service.data.quality.dao.ScheduleJobDao"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.datax.service.data.quality.api.entity.ScheduleJobEntity"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"job_name"
property=
"jobName"
/>
<result
column=
"bean_name"
property=
"beanName"
/>
<result
column=
"method_name"
property=
"methodName"
/>
<result
column=
"method_params"
property=
"methodParams"
/>
<result
column=
"cron_expression"
property=
"cronExpression"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id,
status,
job_name, bean_name, method_name, method_params, cron_expression
</sql>
</mapper>
datax-modules/data-standard-service-parent/data-standard-service-api/src/main/java/cn/datax/service/data/standard/api/dto/ContrastDto.java
View file @
d3ed5ad9
...
...
@@ -33,14 +33,20 @@ public class ContrastDto implements Serializable {
private
String
tableId
;
@ApiModelProperty
(
value
=
"数据表"
)
private
String
tableName
;
@ApiModelProperty
(
value
=
"数据表名称"
)
private
String
tableComment
;
@ApiModelProperty
(
value
=
"对照字段主键"
)
private
String
columnId
;
@ApiModelProperty
(
value
=
"对照字段"
)
private
String
columnName
;
@ApiModelProperty
(
value
=
"对照字段名称"
)
private
String
columnComment
;
@ApiModelProperty
(
value
=
"标准类别主键"
)
private
String
gbTypeId
;
@ApiModelProperty
(
value
=
"标准类别编码"
)
private
String
gbTypeCode
;
@ApiModelProperty
(
value
=
"标准类别名称"
)
private
String
gbTypeName
;
@ApiModelProperty
(
value
=
"绑定标准字段"
)
private
String
bindGbColumn
;
}
datax-modules/data-standard-service-parent/data-standard-service-api/src/main/java/cn/datax/service/data/standard/api/entity/ContrastEntity.java
View file @
d3ed5ad9
...
...
@@ -43,6 +43,11 @@ public class ContrastEntity extends DataScopeBaseEntity {
private
String
tableName
;
/**
* 数据表名称
*/
private
String
tableComment
;
/**
* 对照字段主键
*/
private
String
columnId
;
...
...
@@ -53,6 +58,11 @@ public class ContrastEntity extends DataScopeBaseEntity {
private
String
columnName
;
/**
* 对照字段名称
*/
private
String
columnComment
;
/**
* 标准类别主键
*/
private
String
gbTypeId
;
...
...
@@ -66,4 +76,9 @@ public class ContrastEntity extends DataScopeBaseEntity {
* 标准类别名称
*/
private
String
gbTypeName
;
/**
* 绑定标准字段
*/
private
String
bindGbColumn
;
}
datax-modules/data-standard-service-parent/data-standard-service-api/src/main/java/cn/datax/service/data/standard/api/vo/ContrastTreeVo.java
View file @
d3ed5ad9
...
...
@@ -11,11 +11,8 @@ public class ContrastTreeVo implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
/**
* 数据层级 database、table、column
*/
private
String
type
;
private
String
label
;
private
String
name
;
/**
* 数据
*/
...
...
datax-modules/data-standard-service-parent/data-standard-service-api/src/main/java/cn/datax/service/data/standard/api/vo/ContrastVo.java
View file @
d3ed5ad9
...
...
@@ -28,9 +28,12 @@ public class ContrastVo implements Serializable {
private
String
sourceName
;
private
String
tableId
;
private
String
tableName
;
private
String
tableComment
;
private
String
columnId
;
private
String
columnName
;
private
String
columnComment
;
private
String
gbTypeId
;
private
String
gbTypeCode
;
private
String
gbTypeName
;
private
String
bindGbColumn
;
}
datax-modules/data-standard-service-parent/data-standard-service/src/main/java/cn/datax/service/data/standard/service/impl/ContrastServiceImpl.java
View file @
d3ed5ad9
...
...
@@ -13,6 +13,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -71,8 +73,45 @@ public class ContrastServiceImpl extends BaseServiceImpl<ContrastDao, ContrastEn
@Override
public
List
<
ContrastTreeVo
>
getContrastTree
()
{
List
<
ContrastTreeVo
>
list
=
new
ArrayList
<>();
List
<
ContrastEntity
>
contrastEntityList
=
contrastDao
.
selectList
(
Wrappers
.
emptyWrapper
());
Map
<
String
,
List
<
ContrastEntity
>>
sourceListMap
=
contrastEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ContrastEntity:
:
getSourceId
));
return
null
;
Map
<
String
,
List
<
ContrastEntity
>>
sourceMap
=
contrastEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ContrastEntity:
:
getSourceId
));
Iterator
<
Map
.
Entry
<
String
,
List
<
ContrastEntity
>>>
sourceIterator
=
sourceMap
.
entrySet
().
iterator
();
while
(
sourceIterator
.
hasNext
())
{
Map
.
Entry
<
String
,
List
<
ContrastEntity
>>
sourceEntry
=
sourceIterator
.
next
();
String
sourceId
=
sourceEntry
.
getKey
();
List
<
ContrastEntity
>
sourceList
=
sourceEntry
.
getValue
();
String
sourceName
=
sourceList
.
get
(
0
).
getSourceName
();
ContrastTreeVo
sourceTree
=
new
ContrastTreeVo
();
sourceTree
.
setId
(
sourceId
);
sourceTree
.
setLabel
(
sourceName
);
Map
<
String
,
List
<
ContrastEntity
>>
tableMap
=
sourceList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ContrastEntity:
:
getTableId
));
Iterator
<
Map
.
Entry
<
String
,
List
<
ContrastEntity
>>>
tableIterator
=
tableMap
.
entrySet
().
iterator
();
List
<
ContrastTreeVo
>
tableTreeList
=
new
ArrayList
<>();
while
(
tableIterator
.
hasNext
())
{
Map
.
Entry
<
String
,
List
<
ContrastEntity
>>
tableEntry
=
tableIterator
.
next
();
String
tableId
=
tableEntry
.
getKey
();
List
<
ContrastEntity
>
tableList
=
tableEntry
.
getValue
();
String
tableName
=
tableList
.
get
(
0
).
getTableName
();
String
tableComment
=
tableList
.
get
(
0
).
getTableComment
();
ContrastTreeVo
tableTree
=
new
ContrastTreeVo
();
tableTree
.
setId
(
tableId
);
tableTree
.
setLabel
(
tableName
);
tableTree
.
setName
(
tableComment
);
List
<
ContrastTreeVo
>
columnTreeList
=
tableList
.
stream
().
map
(
s
->
{
ContrastTreeVo
columnTree
=
new
ContrastTreeVo
();
columnTree
.
setId
(
s
.
getId
());
columnTree
.
setLabel
(
s
.
getColumnName
());
columnTree
.
setName
(
s
.
getColumnComment
());
columnTree
.
setData
(
s
);
return
columnTree
;
}).
collect
(
Collectors
.
toList
());
tableTree
.
setChildren
(
columnTreeList
);
tableTreeList
.
add
(
tableTree
);
}
sourceTree
.
setChildren
(
tableTreeList
);
list
.
add
(
sourceTree
);
}
return
list
;
}
}
datax-modules/data-standard-service-parent/data-standard-service/src/main/resources/mapper/ContrastMapper.xml
View file @
d3ed5ad9
...
...
@@ -16,11 +16,14 @@
<result
column=
"source_name"
property=
"sourceName"
/>
<result
column=
"table_id"
property=
"tableId"
/>
<result
column=
"table_name"
property=
"tableName"
/>
<result
column=
"table_comment"
property=
"tableComment"
/>
<result
column=
"column_id"
property=
"columnId"
/>
<result
column=
"column_name"
property=
"columnName"
/>
<result
column=
"column_comment"
property=
"columnComment"
/>
<result
column=
"gb_type_id"
property=
"gbTypeId"
/>
<result
column=
"gb_type_code"
property=
"gbTypeCode"
/>
<result
column=
"gb_type_name"
property=
"gbTypeName"
/>
<result
column=
"bind_gb_column"
property=
"bindGbColumn"
/>
</resultMap>
<!-- 通用查询结果列 -->
...
...
@@ -33,7 +36,7 @@
update_by,
update_time,
remark,
source_id, source_name, table_id, table_name,
column_id, column_name, gb_type_id, gb_type_code, gb_type_name
source_id, source_name, table_id, table_name,
table_comment, column_id, column_name, column_comment, gb_type_id, gb_type_code, gb_type_name, bind_gb_column
</sql>
</mapper>
datax-ui/src/views/masterdata/datamodel/DataModelAdd.vue
View file @
d3ed5ad9
...
...
@@ -204,7 +204,7 @@
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.bindDictColumn'"
>
<el-select
:disabled=
"scope.row.isSystem === '1' || scope.row.isBindDict === '0'"
v-model=
"scope.row.bindDictColumn"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in
dict
ColumnOptions"
v-for=
"item in
gb
ColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
...
...
@@ -308,7 +308,7 @@ export default {
// 数据标准类别数据字典
dictTypeOptions
:
[],
// 标准字典字段数据字典
dict
ColumnOptions
:
[
gb
ColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
],
...
...
datax-ui/src/views/masterdata/datamodel/DataModelDetail.vue
View file @
d3ed5ad9
...
...
@@ -198,7 +198,7 @@
<el-form-item>
<el-select
v-model=
"scope.row.bindDictColumn"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in
dict
ColumnOptions"
v-for=
"item in
gb
ColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
...
...
@@ -263,7 +263,7 @@ export default {
queryTypeOptions
:
[],
htmlTypeOptions
:
[],
dictTypeOptions
:
[],
dict
ColumnOptions
:
[
gb
ColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
]
...
...
datax-ui/src/views/masterdata/datamodel/DataModelEdit.vue
View file @
d3ed5ad9
...
...
@@ -204,7 +204,7 @@
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.bindDictColumn'"
>
<el-select
:disabled=
"scope.row.isSystem === '1' || scope.row.isBindDict === '0'"
v-model=
"scope.row.bindDictColumn"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in
dict
ColumnOptions"
v-for=
"item in
gb
ColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
...
...
@@ -296,7 +296,7 @@ export default {
queryTypeOptions
:
[],
htmlTypeOptions
:
[],
dictTypeOptions
:
[],
dict
ColumnOptions
:
[
gb
ColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
]
...
...
datax-ui/src/views/quality/checkrule/CheckRuleAdd.vue
View file @
d3ed5ad9
...
...
@@ -193,8 +193,10 @@ export default {
return
item
.
id
===
val
})
this
.
form
.
ruleTable
=
table
.
tableName
this
.
form
.
ruleTableComment
=
table
.
tableComment
this
.
form
.
ruleColumnId
=
''
this
.
form
.
ruleColumn
=
''
this
.
form
.
ruleColumnComment
=
''
}
})
},
...
...
@@ -203,6 +205,8 @@ export default {
return
item
.
id
===
val
})
this
.
form
.
ruleColumn
=
column
.
columnName
this
.
form
.
ruleColumnComment
=
column
.
columnComment
this
.
$forceUpdate
()
},
/** 提交按钮 */
submitForm
:
function
()
{
...
...
datax-ui/src/views/quality/checkrule/CheckRuleEdit.vue
View file @
d3ed5ad9
...
...
@@ -202,8 +202,10 @@ export default {
return
item
.
id
===
val
})
this
.
form
.
ruleTable
=
table
.
tableName
this
.
form
.
ruleTableComment
=
table
.
tableComment
this
.
form
.
ruleColumnId
=
''
this
.
form
.
ruleColumn
=
''
this
.
form
.
ruleColumnComment
=
''
}
})
},
...
...
@@ -212,6 +214,8 @@ export default {
return
item
.
id
===
val
})
this
.
form
.
ruleColumn
=
column
.
columnName
this
.
form
.
ruleColumnComment
=
column
.
columnComment
this
.
$forceUpdate
()
},
/** 提交按钮 */
submitForm
:
function
()
{
...
...
datax-ui/src/views/quality/checkrule/CheckRuleList.vue
View file @
d3ed5ad9
...
...
@@ -184,8 +184,8 @@ export default {
{
prop
:
'ruleName'
,
label
:
'规则名称'
,
show
:
true
},
{
prop
:
'ruleType'
,
label
:
'规则类型'
,
show
:
true
},
{
prop
:
'ruleSource'
,
label
:
'数据源'
,
show
:
true
},
{
prop
:
'ruleTable'
,
label
:
'数据表'
,
show
:
true
},
{
prop
:
'ruleColumn'
,
label
:
'核查字段'
,
show
:
true
},
{
prop
:
'ruleTable'
,
label
:
'数据表'
,
show
:
true
,
formatter
:
this
.
ruleTableFormatter
},
{
prop
:
'ruleColumn'
,
label
:
'核查字段'
,
show
:
true
,
formatter
:
this
.
ruleColumnFormatter
},
{
prop
:
'ruleLevel'
,
label
:
'规则级别'
,
show
:
true
,
formatter
:
this
.
ruleLevelFormatter
},
{
prop
:
'status'
,
...
...
@@ -371,6 +371,12 @@ export default {
return
<
el
-
tag
type
=
'warning'
>
{
dictLabel
}
<
/el-tag
>
}
},
ruleTableFormatter
(
row
,
column
,
cellValue
,
index
)
{
return
row
.
ruleTableComment
?
row
.
ruleTable
+
'('
+
row
.
ruleTableComment
+
')'
:
row
.
ruleTable
},
ruleColumnFormatter
(
row
,
column
,
cellValue
,
index
)
{
return
row
.
ruleColumnComment
?
row
.
ruleColumn
+
'('
+
row
.
ruleColumnComment
+
')'
:
row
.
ruleColumn
},
ruleLevelFormatter
(
row
,
column
,
cellValue
,
index
)
{
const
dictLabel
=
this
.
selectDictLabel
(
this
.
ruleLevelOptions
,
cellValue
)
if
(
cellValue
===
'1'
)
{
...
...
datax-ui/src/views/standard/datacontrast/DataContrastList.vue
View file @
d3ed5ad9
...
...
@@ -16,7 +16,7 @@
>
<template
slot-scope=
"
{ node, data }">
<span
class=
"custom-tree-node"
@
mouseenter=
"mouseenter(data)"
@
mouseleave=
"mouseleave(data)"
>
<span><i
v-if=
"node.level === 1"
class=
"iconfont icon-zuzhi tree-folder"
/>
{{
node
.
label
}}
</span>
<span><i
v-if=
"node.level === 1"
class=
"iconfont icon-zuzhi tree-folder"
/>
{{
data
.
name
?
node
.
label
+
'('
+
data
.
name
+
')'
:
node
.
label
}}
</span>
<span
class=
"tree-bts"
>
<i
v-show=
"node.level === 1 && data.show"
class=
"el-icon-circle-plus-outline bt-add"
@
click=
"() => handleAddContrast()"
/>
<i
v-show=
"node.level === 4 && data.show"
class=
"el-icon-edit-outline bt-edit"
@
click=
"() => handleEditContrast(data)"
/>
...
...
@@ -271,6 +271,7 @@ export default {
},
/** 节点单击事件 */
handleNodeClick
(
data
,
node
)
{
this
.
queryParams
.
contrastId
=
''
if
(
node
.
level
===
4
)
{
this
.
queryParams
.
contrastId
=
data
.
id
this
.
getList
()
...
...
@@ -289,7 +290,7 @@ export default {
},
handleEditContrast
(
data
)
{
this
.
dialogFormContrastVisible
=
true
this
.
currentContrast
=
Object
.
assign
({},
data
)
this
.
currentContrast
=
Object
.
assign
({},
data
.
data
)
},
handleDelContrast
(
data
)
{
this
.
$confirm
(
'选中数据将被永久删除, 是否继续?'
,
'提示'
,
{
...
...
datax-ui/src/views/standard/datacontrast/components/FormContrast.vue
View file @
d3ed5ad9
...
...
@@ -44,6 +44,16 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"绑定标准字段"
prop=
"bindGbColumn"
>
<el-select
v-model=
"form.bindGbColumn"
placeholder=
"请选择标准字典字段"
>
<el-option
v-for=
"item in gbColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确定
</el-button>
...
...
@@ -86,7 +96,8 @@ export default {
columnName
:
undefined
,
gbTypeId
:
undefined
,
gbTypeCode
:
undefined
,
gbTypeName
:
undefined
gbTypeName
:
undefined
,
bindGbColumn
:
undefined
},
rules
:
{
sourceId
:
[
...
...
@@ -100,12 +111,20 @@ export default {
],
gbTypeId
:
[
{
required
:
true
,
message
:
'标准类别不能为空'
,
trigger
:
'change'
}
],
bindGbColumn
:
[
{
required
:
true
,
message
:
'绑定标准字段不能为空'
,
trigger
:
'change'
}
]
},
sourceOptions
:
[],
tableOptions
:
[],
columnOptions
:
[],
gbTypeOptions
:
[]
gbTypeOptions
:
[],
// 标准字典字段数据字典
gbColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
]
}
},
computed
:
{
...
...
@@ -163,8 +182,10 @@ export default {
return
item
.
id
===
val
})
this
.
form
.
tableName
=
table
.
tableName
this
.
form
.
tableComment
=
table
.
tableComment
this
.
form
.
columnId
=
''
this
.
form
.
columnName
=
''
this
.
form
.
columnComment
=
''
}
})
},
...
...
@@ -173,6 +194,8 @@ export default {
return
item
.
id
===
val
})
this
.
form
.
columnName
=
column
.
columnName
this
.
form
.
columnComment
=
column
.
columnComment
this
.
$forceUpdate
()
},
gbTypeSelectChanged
(
val
)
{
const
gbType
=
this
.
gbTypeOptions
.
find
(
function
(
item
)
{
...
...
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