Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect-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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyi.chen
data-collect-api
Commits
cdeb8398
Commit
cdeb8398
authored
Apr 18, 2024
by
cwy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多个pdf文件问题
parent
71927fdf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
14 deletions
+85
-14
app/api/controller/ExcelFile.php
+63
-12
app/api/controller/ExcelFilessssssss.php
+8
-1
app/api/controller/NormCollects.php
+13
-1
app/api/route/api.php
+1
-0
No files found.
app/api/controller/ExcelFile.php
View file @
cdeb8398
...
...
@@ -468,11 +468,11 @@ class ExcelFile extends BaseController
$sheet
=
[
'title'
=>
$value
[
'name'
],
'data'
=>
[]];
$normList
=
Db
::
table
(
'norm_list'
)
->
where
(
'norm_id'
,
$value
[
'id'
])
->
select
();
foreach
(
$normList
as
$index
=>
$val
){
$normReceives
=
Db
::
table
(
'norm_receives'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'show'
,
1
)
->
where
(
'status'
,
3
)
->
find
();
$normReceives
=
Db
::
table
(
'norm_receives'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'show'
,
1
)
->
where
(
'status'
,
'in'
,
'3,4'
)
->
find
();
if
(
empty
(
$normReceives
)){
$normCollects
=
[];
}
else
{
$normCollects
=
Db
::
table
(
'norm_collects'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'norm_
collects
_id'
,
$normReceives
[
'id'
])
->
find
();
$normCollects
=
Db
::
table
(
'norm_collects'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'norm_
receive
_id'
,
$normReceives
[
'id'
])
->
find
();
}
$referType
=
''
;
// 信源类型
$imgPath
=
''
;
// 图片
...
...
@@ -481,6 +481,8 @@ class ExcelFile extends BaseController
$not_collectible
=
''
;
$not_collectible_remarks
=
''
;
$reviewStatus
=
''
;
$fileListPdf
=
''
;
$file_name
=
''
;
// 填写内容
if
(
$normCollects
){
if
(
$normCollects
[
'refer_type'
]
==
1
){
...
...
@@ -496,6 +498,12 @@ class ExcelFile extends BaseController
if
(
$normCollects
[
'remark'
]){
$remark
=
$normCollects
[
'remark'
];
}
if
(
$normCollects
[
'fileListPdf'
]){
$fileListPdf
=
str_replace
(
','
,
"
\n
"
,
$normCollects
[
'fileListPdf'
]);
}
if
(
$normCollects
[
'file_name'
]){
$file_name
=
str_replace
(
','
,
"
\n
"
,
$normCollects
[
'file_name'
]);
}
$normCollectsId
=
$normCollects
[
'id'
];
}
// 是否可以采集
...
...
@@ -551,6 +559,8 @@ class ExcelFile extends BaseController
'not_collectible'
=>
$not_collectible
,
'not_collectible_remarks'
=>
$not_collectible_remarks
,
'review_status'
=>
$reviewStatus
,
'fileListPdf'
=>
$fileListPdf
,
'file_name'
=>
$file_name
,
];
$normListExtend
=
Db
::
table
(
'norm_list_extend'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
select
();
// 添加展示端
...
...
@@ -559,10 +569,16 @@ class ExcelFile extends BaseController
array_push
(
$data
[
'admin'
],
$arr
);
}
// 添加用户端
if
(
$normCollects
Id
){
if
(
$normCollects
){
$collectsInfo
=
Db
::
table
(
'norm_collects_extend'
)
->
where
(
'norm_collects_id'
,
$normCollectsId
)
->
select
();
foreach
(
$collectsInfo
as
$collectsValue
){
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
$collectsValue
[
'extend_value'
]];
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
str_replace
(
','
,
"
\n
"
,
$collectsValue
[
'extend_value'
])];
array_push
(
$data
[
'user'
],
$arr
);
}
}
else
{
$normExtendInfo
=
Db
::
table
(
'norm_extend'
)
->
where
(
'norm_id'
,
$value
[
'id'
])
->
where
(
'user_filled'
,
1
)
->
select
();
foreach
(
$normExtendInfo
as
$normExtendInfoValue
){
$arr
=
[
'name'
=>
$normExtendInfoValue
[
'extend_name'
],
'value'
=>
str_replace
(
','
,
"
\n
"
,
$normExtendInfoValue
[
'extend_value'
])];
array_push
(
$data
[
'user'
],
$arr
);
}
}
...
...
@@ -619,11 +635,11 @@ class ExcelFile extends BaseController
$sheet
=
[
'title'
=>
$norm
[
'name'
],
'data'
=>
[]];
$normList
=
Db
::
table
(
'norm_list'
)
->
where
(
'norm_id'
,
$norm
[
'id'
])
->
select
();
foreach
(
$normList
as
$index
=>
$val
){
$normReceives
=
Db
::
table
(
'norm_receives'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'show'
,
1
)
->
where
(
'status'
,
3
)
->
find
();
$normReceives
=
Db
::
table
(
'norm_receives'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'show'
,
1
)
->
where
(
'status'
,
'in'
,
'3,4'
)
->
find
();
if
(
empty
(
$normReceives
)){
$normCollects
=
[];
}
else
{
$normCollects
=
Db
::
table
(
'norm_collects'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'norm_
collects
_id'
,
$normReceives
[
'id'
])
->
find
();
$normCollects
=
Db
::
table
(
'norm_collects'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'norm_
receive
_id'
,
$normReceives
[
'id'
])
->
find
();
}
$referType
=
''
;
// 信源类型
$imgPath
=
''
;
// 图片
...
...
@@ -632,6 +648,8 @@ class ExcelFile extends BaseController
$not_collectible
=
''
;
$not_collectible_remarks
=
''
;
$reviewStatus
=
''
;
$fileListPdf
=
''
;
$file_name
=
''
;
// 填写内容
if
(
$normCollects
){
if
(
$normCollects
[
'refer_type'
]
==
1
){
...
...
@@ -647,6 +665,12 @@ class ExcelFile extends BaseController
if
(
$normCollects
[
'remark'
]){
$remark
=
$normCollects
[
'remark'
];
}
if
(
$normCollects
[
'fileListPdf'
]){
$fileListPdf
=
str_replace
(
','
,
"
\n
"
,
$normCollects
[
'fileListPdf'
]);
}
if
(
$normCollects
[
'file_name'
]){
$file_name
=
str_replace
(
','
,
"
\n
"
,
$normCollects
[
'file_name'
]);
}
$normCollectsId
=
$normCollects
[
'id'
];
}
// 是否可以采集
...
...
@@ -701,6 +725,8 @@ class ExcelFile extends BaseController
'not_collectible'
=>
$not_collectible
,
'not_collectible_remarks'
=>
$not_collectible_remarks
,
'review_status'
=>
$reviewStatus
,
'fileListPdf'
=>
$fileListPdf
,
'file_name'
=>
$file_name
,
];
$normListExtend
=
Db
::
table
(
'norm_list_extend'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
select
();
// 添加展示端
...
...
@@ -712,13 +738,13 @@ class ExcelFile extends BaseController
if
(
$normCollects
){
$collectsInfo
=
Db
::
table
(
'norm_collects_extend'
)
->
where
(
'norm_collects_id'
,
$normCollectsId
)
->
select
();
foreach
(
$collectsInfo
as
$collectsValue
){
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
$collectsValue
[
'extend_value'
]
];
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
str_replace
(
','
,
"
\n
"
,
$collectsValue
[
'extend_value'
])
];
array_push
(
$data
[
'user'
],
$arr
);
}
}
else
{
$normExtendInfo
=
Db
::
table
(
'norm_extend'
)
->
where
(
'norm_id'
,
$norm
[
'id'
])
->
where
(
'user_filled'
,
1
)
->
select
();
foreach
(
$normExtendInfo
as
$normExtendInfoValue
){
$arr
=
[
'name'
=>
$normExtendInfoValue
[
'extend_name'
],
'value'
=>
$normExtendInfoValue
[
'extend_value'
]
];
$arr
=
[
'name'
=>
$normExtendInfoValue
[
'extend_name'
],
'value'
=>
str_replace
(
','
,
"
\n
"
,
$normExtendInfoValue
[
'extend_value'
])
];
array_push
(
$data
[
'user'
],
$arr
);
}
}
...
...
@@ -769,11 +795,11 @@ class ExcelFile extends BaseController
$sheet
=
[
'title'
=>
$value
[
'name'
],
'data'
=>
[]];
$normList
=
Db
::
table
(
'norm_list'
)
->
where
(
'norm_id'
,
$value
[
'id'
])
->
select
();
foreach
(
$normList
as
$index
=>
$val
){
$normReceives
=
Db
::
table
(
'norm_receives'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'show'
,
1
)
->
where
(
'status'
,
3
)
->
find
();
$normReceives
=
Db
::
table
(
'norm_receives'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'show'
,
1
)
->
where
(
'status'
,
'in'
,
'3,4'
)
->
find
();
if
(
empty
(
$normReceives
)){
$normCollects
=
[];
}
else
{
$normCollects
=
Db
::
table
(
'norm_collects'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'norm_
collects
_id'
,
$normReceives
[
'id'
])
->
find
();
$normCollects
=
Db
::
table
(
'norm_collects'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
where
(
'norm_
receive
_id'
,
$normReceives
[
'id'
])
->
find
();
}
$referType
=
''
;
// 信源类型
$imgPath
=
''
;
// 图片
...
...
@@ -782,6 +808,8 @@ class ExcelFile extends BaseController
$not_collectible
=
''
;
$not_collectible_remarks
=
''
;
$reviewStatus
=
''
;
$fileListPdf
=
''
;
$file_name
=
''
;
// 填写内容
if
(
$normCollects
){
if
(
$normCollects
[
'refer_type'
]
==
1
){
...
...
@@ -797,6 +825,12 @@ class ExcelFile extends BaseController
if
(
$normCollects
[
'remark'
]){
$remark
=
$normCollects
[
'remark'
];
}
if
(
$normCollects
[
'fileListPdf'
]){
$fileListPdf
=
str_replace
(
','
,
"
\n
"
,
$normCollects
[
'fileListPdf'
]);
}
if
(
$normCollects
[
'file_name'
]){
$file_name
=
str_replace
(
','
,
"
\n
"
,
$normCollects
[
'file_name'
]);
}
$normCollectsId
=
$normCollects
[
'id'
];
}
// 是否可以采集
...
...
@@ -850,6 +884,8 @@ class ExcelFile extends BaseController
'not_collectible'
=>
$not_collectible
,
'not_collectible_remarks'
=>
$not_collectible_remarks
,
'review_status'
=>
$reviewStatus
,
'fileListPdf'
=>
$fileListPdf
,
'file_name'
=>
$file_name
,
];
$normListExtend
=
Db
::
table
(
'norm_list_extend'
)
->
where
(
'norm_list_id'
,
$val
[
'id'
])
->
select
();
// 添加展示端
...
...
@@ -858,10 +894,17 @@ class ExcelFile extends BaseController
array_push
(
$data
[
'admin'
],
$arr
);
}
// 添加用户端
if
(
$normCollectsId
){
// 添加用户端
if
(
$normCollects
){
$collectsInfo
=
Db
::
table
(
'norm_collects_extend'
)
->
where
(
'norm_collects_id'
,
$normCollectsId
)
->
select
();
foreach
(
$collectsInfo
as
$collectsValue
){
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
$collectsValue
[
'extend_value'
]];
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
str_replace
(
','
,
"
\n
"
,
$collectsValue
[
'extend_value'
])];
array_push
(
$data
[
'user'
],
$arr
);
}
}
else
{
$normExtendInfo
=
Db
::
table
(
'norm_extend'
)
->
where
(
'norm_id'
,
$value
[
'id'
])
->
where
(
'user_filled'
,
1
)
->
select
();
foreach
(
$normExtendInfo
as
$normExtendInfoValue
){
$arr
=
[
'name'
=>
$normExtendInfoValue
[
'extend_name'
],
'value'
=>
str_replace
(
','
,
"
\n
"
,
$normExtendInfoValue
[
'extend_value'
])];
array_push
(
$data
[
'user'
],
$arr
);
}
}
...
...
@@ -932,6 +975,8 @@ class ExcelFile extends BaseController
'优先级'
,
'用户收集备注'
,
'信源类型'
,
'文件地址'
,
'文件名称'
,
];
$arr
=
[];
foreach
(
$data
as
$index
=>
$value
)
{
...
...
@@ -997,6 +1042,12 @@ class ExcelFile extends BaseController
//信源类型
$sheet
->
setCellValue
(
$column
[
$num
+
$position
]
.
$row
,
$value
[
'referType'
]);
$position
++
;
//文件地址
$sheet
->
setCellValue
(
$column
[
$num
+
$position
]
.
$row
,
$value
[
'fileListPdf'
]);
$position
++
;
//文件名称
$sheet
->
setCellValue
(
$column
[
$num
+
$position
]
.
$row
,
$value
[
'file_name'
]);
$position
++
;
// 展示端
foreach
(
$value
[
'admin'
]
as
$ss
){
if
(
$ss
[
'name'
]
==
'年份'
){
...
...
app/api/controller/ExcelFilessssssss.php
View file @
cdeb8398
...
...
@@ -822,12 +822,19 @@ class ExcelFilessssssss extends BaseController
array_push
(
$data
[
'admin'
],
$arr
);
}
// 添加用户端
if
(
$normCollectsId
){
// 添加用户端
if
(
$normCollects
){
$collectsInfo
=
Db
::
table
(
'norm_collects_extend'
)
->
where
(
'norm_collects_id'
,
$normCollectsId
)
->
select
();
foreach
(
$collectsInfo
as
$collectsValue
){
$arr
=
[
'name'
=>
$collectsValue
[
'extend_name'
],
'value'
=>
$collectsValue
[
'extend_value'
]];
array_push
(
$data
[
'user'
],
$arr
);
}
}
else
{
$normExtendInfo
=
Db
::
table
(
'norm_extend'
)
->
where
(
'norm_id'
,
$value
[
'id'
])
->
where
(
'user_filled'
,
1
)
->
select
();
foreach
(
$normExtendInfo
as
$normExtendInfoValue
){
$arr
=
[
'name'
=>
$normExtendInfoValue
[
'extend_name'
],
'value'
=>
$normExtendInfoValue
[
'extend_value'
]
?
$normExtendInfoValue
[
'extend_value'
]
:
'/'
];
array_push
(
$data
[
'user'
],
$arr
);
}
}
// 添加第一条指标信息
array_push
(
$sheet
[
'data'
],
$data
);
...
...
app/api/controller/NormCollects.php
View file @
cdeb8398
...
...
@@ -364,8 +364,19 @@ class NormCollects extends AuthBase
}
}
/**
* 返回文件信息
* @return \josn|void
*/
public
function
getPdfList
()
{
try
{
$id
=
input
(
"param.id"
,
''
,
"trim"
);
$NormCollectsBus
=
new
\app\api\business\CommonBus
(
'NormCollectsBus'
);
// 通过公共业务初始化指标类
$info
=
$NormCollectsBus
->
getConditionalQuery
([
'norm_receive_id'
=>
$id
]);
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.success"
),
$info
);
}
catch
(
\Exception
$e
){
exception
(
$e
,
'NormCollects.getPreserve'
);
}
}
}
\ No newline at end of file
app/api/route/api.php
View file @
cdeb8398
...
...
@@ -85,6 +85,7 @@ Route::rule("normCollects/getPreserve","NormCollects/getPreserve"); // 数据获
Route
::
rule
(
"normCollects/detail"
,
"normCollects/detail"
);
// 查看指标填写详情
Route
::
rule
(
"normCollects/modify"
,
"normCollects/modify"
);
// 修改指标填写详情
Route
::
rule
(
"normCollects/notCollectible"
,
"normCollects/notCollectible"
);
// 数据不可采集
Route
::
rule
(
"normCollects/getPdfList"
,
"normCollects/getPdfList"
);
// pdf文件信息
/***************************上传 */
Route
::
rule
(
"upload/picture"
,
"upload/picture"
);
...
...
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