Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lmp_server
Project
Project
Details
Activity
Releases
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
lmp
lmp_server
Commits
cc809ff6
Commit
cc809ff6
authored
Apr 03, 2024
by
pengxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据集清洗新增重新清洗接口。
parent
0634e753
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
6 deletions
+51
-6
DatasetCleanController.java
.../yice/webadmin/app/controller/DatasetCleanController.java
+18
-2
DatasetCleanService.java
...va/com/yice/webadmin/app/service/DatasetCleanService.java
+6
-0
DatasetCleanServiceImpl.java
...ce/webadmin/app/service/impl/DatasetCleanServiceImpl.java
+14
-1
SysOperationLogType.java
...m/yice/common/log/model/constant/SysOperationLogType.java
+13
-3
No files found.
application-webadmin/src/main/java/com/yice/webadmin/app/controller/DatasetCleanController.java
View file @
cc809ff6
...
...
@@ -62,7 +62,7 @@ public class DatasetCleanController {
* @return 应答结果对象,包含新增对象主键Id。
*/
@ApiOperationSupport
(
ignoreParameters
=
{
"datasetCleanDto.cleanId"
})
@OperationLog
(
type
=
SysOperationLogType
.
ADD_ALL
)
@OperationLog
(
type
=
SysOperationLogType
.
START_CLEAN
)
@PostMapping
(
"/startClean"
)
public
ResponseResult
<
DatasetClean
>
startClean
(
@MyRequestBody
DatasetCleanDto
datasetCleanDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
datasetCleanDto
,
false
);
...
...
@@ -80,7 +80,7 @@ public class DatasetCleanController {
* @param cleanId 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE
)
@OperationLog
(
type
=
SysOperationLogType
.
STOP_CLEAN
)
@PostMapping
(
"/stopClean"
)
public
ResponseResult
<
Void
>
stopClean
(
@RequestParam
Long
cleanId
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
cleanId
))
{
...
...
@@ -90,6 +90,22 @@ public class DatasetCleanController {
return
ResponseResult
.
success
();
}
/**
* 重启数据集清洗数据。
*
* @param cleanId 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@OperationLog
(
type
=
SysOperationLogType
.
RESTART_CLEAN
)
@PostMapping
(
"/restartClean"
)
public
ResponseResult
<
Void
>
restartClean
(
@RequestParam
Long
cleanId
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
cleanId
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
datasetCleanService
.
restartCleanTask
(
cleanId
);
return
ResponseResult
.
success
();
}
/**
* 更新数据集清洗数据。
*
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/service/DatasetCleanService.java
View file @
cc809ff6
...
...
@@ -21,6 +21,12 @@ public interface DatasetCleanService extends IBaseService<DatasetClean, Long> {
*/
DatasetClean
saveNew
(
DatasetClean
datasetClean
);
/**
* 重新清洗任务
* @param cleanId 清洗任务id
*/
void
restartCleanTask
(
Long
cleanId
);
/**
* 停止清洗任务
* @param cleanId 清洗任务id
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/service/impl/DatasetCleanServiceImpl.java
View file @
cc809ff6
...
...
@@ -122,6 +122,7 @@ public class DatasetCleanServiceImpl extends BaseService<DatasetClean, Long> imp
return
datasetClean
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Async
(
"taskExecutor"
)
public
Future
<
Void
>
executeCleanTaskAsync
(
List
<
DatasetData
>
dataList
,
Long
cleanId
,
Long
datasetId
)
{
asyncDealWithDatasetSaveBatch
(
dataList
,
cleanId
);
...
...
@@ -130,6 +131,7 @@ public class DatasetCleanServiceImpl extends BaseService<DatasetClean, Long> imp
DatasetClean
filter
=
new
DatasetClean
();
filter
.
setCleanStatus
(
DatasetConstant
.
CLEAN_FINISHED
);
filter
.
setFinishTime
(
new
Date
());
filter
.
setCleanId
(
cleanId
);
this
.
updateById
(
filter
);
return
new
AsyncResult
<>(
null
);
}
...
...
@@ -177,6 +179,18 @@ public class DatasetCleanServiceImpl extends BaseService<DatasetClean, Long> imp
}
}
/**
* 重新清洗任务
* @param cleanId 清洗任务id
*/
@Override
public
void
restartCleanTask
(
Long
cleanId
)
{
DatasetClean
clean
=
this
.
datasetCleanMapper
.
selectById
(
cleanId
);
if
(
null
!=
clean
){
doDatasetCleanHandler
(
clean
.
getDatasetId
(),
cleanId
);
}
}
/**
* ==============================
* ===总数据清洗过程===
...
...
@@ -325,7 +339,6 @@ public class DatasetCleanServiceImpl extends BaseService<DatasetClean, Long> imp
// 将修改后的JSON转换回字符串
modifiedJson
=
mapper
.
writerWithDefaultPrettyPrinter
().
writeValueAsString
(
objectNode
);
System
.
out
.
println
(
modifiedJson
);
}
return
modifiedJson
;
...
...
common/common-log/src/main/java/com/yice/common/log/model/constant/SysOperationLogType.java
View file @
cc809ff6
...
...
@@ -28,9 +28,17 @@ public final class SysOperationLogType {
*/
public
static
final
int
ADD
=
10
;
/**
*
新增多个
。
*
数据开始清洗
。
*/
public
static
final
int
ADD_ALL
=
11
;
public
static
final
int
START_CLEAN
=
11
;
/**
* 数据停止清洗。
*/
public
static
final
int
STOP_CLEAN
=
12
;
/**
* 数据重新清洗。
*/
public
static
final
int
RESTART_CLEAN
=
13
;
/**
* 修改。
*/
...
...
@@ -138,7 +146,9 @@ public final class SysOperationLogType {
DICT_MAP
.
put
(
LOGIN
,
"登录"
);
DICT_MAP
.
put
(
LOGOUT
,
"登出"
);
DICT_MAP
.
put
(
ADD
,
"新增"
);
DICT_MAP
.
put
(
ADD_ALL
,
"新增多个"
);
DICT_MAP
.
put
(
START_CLEAN
,
"开始清洗"
);
DICT_MAP
.
put
(
STOP_CLEAN
,
"停止清洗"
);
DICT_MAP
.
put
(
RESTART_CLEAN
,
"重新清洗"
);
DICT_MAP
.
put
(
UPDATE
,
"修改"
);
DICT_MAP
.
put
(
DELETE
,
"删除"
);
DICT_MAP
.
put
(
ADD_M2M
,
"新增多对多关联"
);
...
...
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