Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nnjcy-data-model
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁家彪
nnjcy-data-model
Commits
1736e103
Commit
1736e103
authored
Sep 07, 2023
by
梁家彪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善数据汇聚日志
parent
33ece2e3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
49 deletions
+91
-49
dataoperation-server/src/main/java/com/zq/dataoperation/controller/DataCollectLogController.java
+11
-4
dataoperation-server/src/main/java/com/zq/dataoperation/dao/DataCollectFileLogDao.java
+8
-0
dataoperation-server/src/main/java/com/zq/dataoperation/entity/DataCollectFileLog.java
+56
-0
dataoperation-server/src/main/java/com/zq/dataoperation/entity/DataCollectSettingFile.java
+1
-1
dataoperation-server/src/main/java/com/zq/dataoperation/service/DataCollectLogService.java
+13
-16
dataoperation-server/src/main/java/com/zq/dataoperation/service/DataCollectService.java
+2
-28
No files found.
dataoperation-server/src/main/java/com/zq/dataoperation/controller/DataCollectLogController.java
View file @
1736e103
...
...
@@ -27,9 +27,9 @@ public class DataCollectLogController {
// }
@ApiOperation
(
"分页获取数据汇聚日志"
)
@PostMapping
(
value
=
"/
page
"
)
public
ResultVo
get
DataCollectDetails
(
@RequestBody
DataCollectLogReq
req
)
{
return
ResultVo
.
success
(
dataCollectLogService
.
page
(
req
));
@PostMapping
(
value
=
"/
list
"
)
public
ResultVo
get
List
(
@RequestBody
DataCollectLogReq
req
)
{
return
ResultVo
.
success
(
dataCollectLogService
.
getList
(
req
));
}
@ApiOperation
(
"删除数据汇聚日志"
)
...
...
@@ -42,9 +42,15 @@ public class DataCollectLogController {
@ApiOperation
(
"批量删除数据汇聚设置"
)
@DeleteMapping
(
value
=
"/batchDelete"
)
public
ResultVo
batchDelete
(
@RequestBody
List
<
Long
>
ids
)
{
public
ResultVo
batchDelete
(
@RequestBody
List
<
Integer
>
ids
)
{
boolean
b
=
dataCollectLogService
.
removeByIds
(
ids
);
AssertUtils
.
isTrue
(
b
,
"操作失败"
);
return
ResultVo
.
success
(
"操作成功"
);
}
@ApiOperation
(
"获取文件汇聚日志"
)
@GetMapping
(
value
=
"/file/{id}"
)
public
ResultVo
file
(
@PathVariable
Integer
id
)
{
return
ResultVo
.
success
(
dataCollectLogService
.
file
(
id
));
}
}
\ No newline at end of file
dataoperation-server/src/main/java/com/zq/dataoperation/dao/DataCollectFileLogDao.java
0 → 100644
View file @
1736e103
package
com
.
zq
.
dataoperation
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zq.dataoperation.entity.DataCollectFileLog
;
public
interface
DataCollectFileLogDao
extends
BaseMapper
<
DataCollectFileLog
>
{
}
\ No newline at end of file
dataoperation-server/src/main/java/com/zq/dataoperation/entity/DataCollectFileLog.java
0 → 100644
View file @
1736e103
package
com
.
zq
.
dataoperation
.
entity
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
DataCollectFileLog
{
/**
* id
*/
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 文件汇聚id
*/
private
Integer
dataCollectSettingFileId
;
/**
* 文件存储目录
*/
private
String
fileFolder
;
/**
* 文件名称
*/
private
String
fileName
;
/**
* OCR(0未做 1完成)
*/
private
String
ocrFlag
;
/**
* createTime
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
/**
* updateTime
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
updateTime
;;
}
\ No newline at end of file
dataoperation-server/src/main/java/com/zq/dataoperation/entity/DataCollectSettingFile.java
View file @
1736e103
...
...
@@ -19,7 +19,7 @@ public class DataCollectSettingFile {
* id
*/
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
private
Integer
id
;
/**
* 数据汇聚id
...
...
dataoperation-server/src/main/java/com/zq/dataoperation/service/DataCollectLogService.java
View file @
1736e103
...
...
@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.zq.common.utils.PagingUtils
;
import
com.zq.common.vo.PageVo
;
import
com.zq.dataoperation.dao.DataCollectFileLogDao
;
import
com.zq.dataoperation.dao.DataCollectTaskLogDao
;
import
com.zq.dataoperation.entity.DataCollectSetting
;
import
com.zq.dataoperation.entity.DataCollectFileLog
;
import
com.zq.dataoperation.entity.DataCollectTaskLog
;
import
com.zq.dataoperation.vo.DataCollectLogReq
;
import
com.zq.dataoperation.vo.DataCollectTaskLogResp
;
...
...
@@ -26,30 +28,20 @@ public class DataCollectLogService extends ServiceImpl<DataCollectTaskLogDao, Da
@Resource
private
DataCollectService
dataCollectService
;
public
PageVo
getPageDataCollectLog
(
DataCollectLogReq
req
)
{
@Resource
private
DataCollectFileLogDao
dataCollectFileLogDao
;
public
PageVo
getList
(
DataCollectLogReq
req
)
{
LambdaQueryWrapper
<
DataCollectTaskLog
>
wrapper
=
new
LambdaQueryWrapper
<>();
PageVo
pageVo
=
PagingUtils
.
paging
(
req
,
dataCollectTaskLogDao
,
DataCollectTaskLog
.
class
,
wrapper
);
List
<
DataCollectTaskLogResp
>
taskLogRespList
=
new
ArrayList
<>(
pageVo
.
getRows
().
size
());
for
(
Object
row
:
pageVo
.
getRows
())
{
DataCollectTaskLog
dataCollectTaskLog
=
(
DataCollectTaskLog
)
row
;
DataCollectTaskLogResp
resp
=
new
DataCollectTaskLogResp
();
DataCollectSetting
dataCollectSetting
=
dataCollectService
.
getById
(
dataCollectTaskLog
.
getDataCollectSettingId
());
resp
.
setTaskName
(
dataCollectSetting
.
getTaskName
());
BeanUtil
.
copyProperties
(
dataCollectTaskLog
,
resp
);
taskLogRespList
.
add
(
resp
);
}
pageVo
.
setRows
(
taskLogRespList
);
return
pageVo
;
if
(
null
==
dataCollectSetting
){
continue
;
}
public
PageVo
page
(
DataCollectLogReq
req
)
{
LambdaQueryWrapper
<
DataCollectTaskLog
>
wrapper
=
new
LambdaQueryWrapper
<>();
PageVo
pageVo
=
PagingUtils
.
paging
(
req
,
dataCollectTaskLogDao
,
DataCollectTaskLog
.
class
,
wrapper
);
List
<
DataCollectTaskLogResp
>
taskLogRespList
=
new
ArrayList
<>(
pageVo
.
getRows
().
size
());
for
(
Object
row
:
pageVo
.
getRows
())
{
DataCollectTaskLog
dataCollectTaskLog
=
(
DataCollectTaskLog
)
row
;
DataCollectTaskLogResp
resp
=
new
DataCollectTaskLogResp
();
DataCollectSetting
dataCollectSetting
=
dataCollectService
.
getById
(
dataCollectTaskLog
.
getDataCollectSettingId
());
resp
.
setTaskName
(
dataCollectSetting
.
getTaskName
());
BeanUtil
.
copyProperties
(
dataCollectTaskLog
,
resp
);
taskLogRespList
.
add
(
resp
);
...
...
@@ -57,4 +49,8 @@ public class DataCollectLogService extends ServiceImpl<DataCollectTaskLogDao, Da
pageVo
.
setRows
(
taskLogRespList
);
return
pageVo
;
}
public
List
<
DataCollectFileLog
>
file
(
Integer
id
){
return
dataCollectFileLogDao
.
selectList
(
new
LambdaQueryWrapper
<
DataCollectFileLog
>().
eq
(
DataCollectFileLog:
:
getDataCollectSettingFileId
,
id
));
}
}
\ No newline at end of file
dataoperation-server/src/main/java/com/zq/dataoperation/service/DataCollectService.java
View file @
1736e103
...
...
@@ -29,8 +29,8 @@ import java.util.HashMap;
import
java.util.List
;
@Slf4j
@RequiredArgsConstructor
@Service
@RequiredArgsConstructor
public
class
DataCollectService
extends
ServiceImpl
<
DataCollectDao
,
DataCollectSetting
>
{
@Resource
...
...
@@ -110,7 +110,6 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
AssertUtils
.
isTrue
(
updateById
(
dataCollectSettingAddReq
),
"修改失败"
);
}
@Transactional
public
void
delete
(
Integer
id
){
DataCollectSetting
dataCollectSetting
=
getById
(
id
);
UpdateWrapper
wrapper
=
new
UpdateWrapper
();
...
...
@@ -119,6 +118,7 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
AssertUtils
.
isTrue
(
removeById
(
id
),
"删除失败"
);
}
@Transactional
public
void
batchDelete
(
List
<
Integer
>
ids
){
for
(
Integer
id
:
ids
)
{
delete
(
id
);
...
...
@@ -139,29 +139,4 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
throw
new
BusinessException
(
"不支持的类型"
);
}
}
public
Object
getObj
(
int
dataType
){
switch
(
dataType
)
{
case
1
:
return
new
DataCollectSettingDb
();
case
2
:
return
new
DataCollectSettingFile
();
case
3
:
return
new
DataCollectSettingApi
();
case
4
:
return
new
DataCollectSettingSite
();
default
:
throw
new
BusinessException
(
"不支持的类型"
);
}
}
public
<
T
>
List
<
T
>
objToList
(
Object
obj
,
Class
<
T
>
clazz
){
List
<
T
>
list
=
new
ArrayList
<>();
if
(
obj
instanceof
List
<?>){
for
(
Object
o
:
(
List
<?>)
obj
)
{
list
.
add
(
clazz
.
cast
(
o
));
}
}
return
list
;
}
}
\ 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