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
7f9a4c95
Commit
7f9a4c95
authored
Apr 17, 2024
by
wenyi.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加指标完整页面
parent
a86ffc53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
44 deletions
+24
-44
app/api/controller/ExcelFile.php
+16
-4
app/api/controller/Norm.php
+5
-38
app/api/route/api.php
+2
-1
config/config.php
+1
-1
No files found.
app/api/controller/ExcelFile.php
View file @
7f9a4c95
...
@@ -101,8 +101,18 @@ class ExcelFile extends BaseController
...
@@ -101,8 +101,18 @@ class ExcelFile extends BaseController
$arr
[
'remark'
]
=
$value
[
$current
];
$arr
[
'remark'
]
=
$value
[
$current
];
$current
++
;
$current
++
;
// 文件路径
// 文件路径
$arr
[
'fileListPdf'
]
=
$value
[
$current
];
if
(
$value
[
$current
]){
$str
=
[];
$ex
=
explode
(
","
,
$value
[
$current
]);
foreach
(
$ex
as
$va
){
array_push
(
$str
,
config
(
"config.resource_address"
)
.
'/public/storage/import_pdf/'
.
$va
);
}
$arr
[
'fileListPdf'
]
=
implode
(
','
,
$str
);
}
else
{
$arr
[
'fileListPdf'
]
=
$value
[
$current
];
}
$current
++
;
$current
++
;
// 文件名称
// 文件名称
$arr
[
'file_name'
]
=
$value
[
$current
];
$arr
[
'file_name'
]
=
$value
[
$current
];
...
@@ -356,6 +366,8 @@ class ExcelFile extends BaseController
...
@@ -356,6 +366,8 @@ class ExcelFile extends BaseController
'refer_type'
=>
$value
[
'refer_type'
],
'refer_type'
=>
$value
[
'refer_type'
],
'remark'
=>
$value
[
'remark'
],
'remark'
=>
$value
[
'remark'
],
'imgPath'
=>
$value
[
'imgPath'
],
'imgPath'
=>
$value
[
'imgPath'
],
'fileListPdf'
=>
$value
[
'fileListPdf'
],
'file_name'
=>
$value
[
'file_name'
],
];
];
$norm_collects_id
=
Db
::
name
(
'norm_collects'
)
->
insertGetId
(
$arr
);
$norm_collects_id
=
Db
::
name
(
'norm_collects'
)
->
insertGetId
(
$arr
);
if
(
empty
(
$norm_collects_id
)){
if
(
empty
(
$norm_collects_id
)){
...
@@ -567,7 +579,7 @@ class ExcelFile extends BaseController
...
@@ -567,7 +579,7 @@ class ExcelFile extends BaseController
}
}
// 保存 ExcelFile 文件
// 保存 ExcelFile 文件
$writer
=
new
Xlsx
(
$spreadsheet
);
$writer
=
new
Xlsx
(
$spreadsheet
);
$name
=
'xlsx/'
.
$task
[
'name'
]
.
'_'
.
date
(
'YmdHis'
)
.
'.xlsx'
;
$name
=
'
storage/
xlsx/'
.
$task
[
'name'
]
.
'_'
.
date
(
'YmdHis'
)
.
'.xlsx'
;
$writer
->
save
(
$name
);
$writer
->
save
(
$name
);
// header('Content-Type: application/vnd.ms-excel');
// header('Content-Type: application/vnd.ms-excel');
...
@@ -721,7 +733,7 @@ class ExcelFile extends BaseController
...
@@ -721,7 +733,7 @@ class ExcelFile extends BaseController
}
}
// 保存 ExcelFile 文件
// 保存 ExcelFile 文件
$writer
=
new
Xlsx
(
$spreadsheet
);
$writer
=
new
Xlsx
(
$spreadsheet
);
$name
=
'xlsx/'
.
$norm
[
'name'
]
.
'_'
.
date
(
'YmdHis'
)
.
'.xlsx'
;
$name
=
'
storage/
xlsx/'
.
$norm
[
'name'
]
.
'_'
.
date
(
'YmdHis'
)
.
'.xlsx'
;
$writer
->
save
(
$name
);
$writer
->
save
(
$name
);
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.success"
),
config
(
"config.resource_address"
)
.
'public/'
.
$name
);
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.success"
),
config
(
"config.resource_address"
)
.
'public/'
.
$name
);
}
else
{
}
else
{
...
@@ -869,7 +881,7 @@ class ExcelFile extends BaseController
...
@@ -869,7 +881,7 @@ class ExcelFile extends BaseController
}
}
// 保存 ExcelFile 文件
// 保存 ExcelFile 文件
$writer
=
new
Xlsx
(
$spreadsheet
);
$writer
=
new
Xlsx
(
$spreadsheet
);
$name
=
'xlsx/多选子任务导出_'
.
date
(
'YmdHis'
)
.
'.xlsx'
;
$name
=
'
storage/
xlsx/多选子任务导出_'
.
date
(
'YmdHis'
)
.
'.xlsx'
;
$writer
->
save
(
$name
);
$writer
->
save
(
$name
);
// header('Content-Type: application/vnd.ms-excel');
// header('Content-Type: application/vnd.ms-excel');
...
...
app/api/controller/Norm.php
View file @
7f9a4c95
...
@@ -215,7 +215,7 @@ class Norm
...
@@ -215,7 +215,7 @@ class Norm
}
}
/**
/**
* 返回指标详情
* 返回指标详情
V1版本
* @return \josn
* @return \josn
*/
*/
public
function
detail
()
public
function
detail
()
...
@@ -241,7 +241,6 @@ class Norm
...
@@ -241,7 +241,6 @@ class Norm
$data
[
'receivesList'
]
=
$NormReceivesBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
$data
[
'receivesList'
]
=
$NormReceivesBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
}
else
{
}
else
{
$list
=
$NormReceivesBus
->
getConditionalQueryAllPaging
([
'norm_id'
=>
$id
],
$page
,
$limit
);
$list
=
$NormReceivesBus
->
getConditionalQueryAllPaging
([
'norm_id'
=>
$id
],
$page
,
$limit
);
// var_dump($list);
$data
[
'receivesList'
]
=
$list
[
'data'
];
$data
[
'receivesList'
]
=
$list
[
'data'
];
$data
[
'total'
]
=
$list
[
'total'
];
$data
[
'total'
]
=
$list
[
'total'
];
}
}
...
@@ -287,7 +286,7 @@ class Norm
...
@@ -287,7 +286,7 @@ class Norm
* 返回指标完整详情信息
* 返回指标完整详情信息
* @return \josn
* @return \josn
*/
*/
public
function
whole
()
public
function
whole
Detail
()
{
{
$id
=
input
(
"param.id"
);
$id
=
input
(
"param.id"
);
$page
=
input
(
"param.page"
)
?
input
(
"param.page"
)
:-
1
;
$page
=
input
(
"param.page"
)
?
input
(
"param.page"
)
:-
1
;
...
@@ -310,7 +309,6 @@ class Norm
...
@@ -310,7 +309,6 @@ class Norm
$data
[
'receivesList'
]
=
$NormReceivesBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
$data
[
'receivesList'
]
=
$NormReceivesBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
}
else
{
}
else
{
$list
=
$NormReceivesBus
->
getConditionalQueryAllPaging
([
'norm_id'
=>
$id
],
$page
,
$limit
);
$list
=
$NormReceivesBus
->
getConditionalQueryAllPaging
([
'norm_id'
=>
$id
],
$page
,
$limit
);
// var_dump($list);
$data
[
'receivesList'
]
=
$list
[
'data'
];
$data
[
'receivesList'
]
=
$list
[
'data'
];
$data
[
'total'
]
=
$list
[
'total'
];
$data
[
'total'
]
=
$list
[
'total'
];
}
}
...
@@ -353,14 +351,14 @@ class Norm
...
@@ -353,14 +351,14 @@ class Norm
}
}
/**
/**
* 返回指标
详情
* 返回指标
部分信息
* @return \josn
* @return \josn
*/
*/
public
function
detail1
()
public
function
partDetail
()
{
{
$id
=
input
(
"param.id"
);
$id
=
input
(
"param.id"
);
if
(
empty
(
$id
)){
if
(
empty
(
$id
)){
return
returnResult
(
config
(
"config.code.error"
),
'
填写信息
错误,请检查!'
);
return
returnResult
(
config
(
"config.code.error"
),
'
ID
错误,请检查!'
);
}
}
$normBus
=
new
CommonBus
(
'NormBus'
);
// 通过公共业务初始化指标类
$normBus
=
new
CommonBus
(
'NormBus'
);
// 通过公共业务初始化指标类
$data
=
[];
$data
=
[];
...
@@ -371,43 +369,12 @@ class Norm
...
@@ -371,43 +369,12 @@ class Norm
$normExtendBus
=
new
CommonBus
(
'NormExtendBus'
);
$normExtendBus
=
new
CommonBus
(
'NormExtendBus'
);
$res
=
$normExtendBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
$res
=
$normExtendBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
$data
[
'custom'
]
=
$res
;
$data
[
'custom'
]
=
$res
;
// 领取信息
$NormReceivesBus
=
new
CommonBus
(
'NormReceivesBus'
);
// 通过公共业务初始化指标类
$data
[
'receivesList'
]
=
$NormReceivesBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
]);
if
(
!
empty
(
$data
[
'receivesList'
])){
foreach
(
$data
[
'receivesList'
]
as
$index
=>
$vlues
){
$TaskPackageBus
=
new
CommonBus
(
'TaskPackageBus'
);
// 通过公共业务初始化指标类
$data
[
'receivesList'
][
$index
][
'task_info'
]
=
$TaskPackageBus
->
getConditionalQuery
([
'id'
=>
$vlues
[
'task_id'
]]);
$NormListBus
=
new
CommonBus
(
'NormListBus'
);
// 通过公共业务初始化指标类
$data
[
'receivesList'
][
$index
][
'norm_list_info'
]
=
$NormListBus
->
getConditionalQuery
([
'id'
=>
$vlues
[
'norm_list_id'
]]);
$NormListExtendBus
=
new
CommonBus
(
'NormListExtendBus'
);
// 通过公共业务初始化指标类
$data
[
'receivesList'
][
$index
][
'norm_list_extend'
]
=
$NormListExtendBus
->
getConditionalQueryAll
([
'norm_list_id'
=>
$vlues
[
'norm_list_id'
]]);
$NormCollectsBus
=
new
CommonBus
(
'NormCollectsBus'
);
// 通过公共业务初始化指标类
$collectsInfo
=
$NormCollectsBus
->
getConditionalQuery
([
'norm_receive_id'
=>
$vlues
[
'id'
]]);
if
(
$collectsInfo
){
$NormCollectsExtendBus
=
new
CommonBus
(
'NormCollectsExtendBus'
);
// 通过公共业务初始化指标类
$normCollectsExtend
=
$NormCollectsExtendBus
->
getConditionalQueryAll
([
'norm_collects_id'
=>
$collectsInfo
[
'id'
]]);
$data
[
'receivesList'
][
$index
][
'refer_type'
]
=
$collectsInfo
[
'refer_type'
];
$data
[
'receivesList'
][
$index
][
'remark'
]
=
$collectsInfo
[
'remark'
];
$data
[
'receivesList'
][
$index
][
'imgPath'
]
=
$collectsInfo
[
'imgPath'
];
$data
[
'receivesList'
][
$index
][
'normCollectsExtend'
]
=
$normCollectsExtend
;
}
else
{
$normExtendBus
=
new
CommonBus
(
'NormExtendBus'
);
$res
=
$normExtendBus
->
getConditionalQueryAll
([
'norm_id'
=>
$id
,
'user_filled'
=>
1
]);
$data
[
'receivesList'
][
$index
][
'refer_type'
]
=
''
;
$data
[
'receivesList'
][
$index
][
'remark'
]
=
''
;
$data
[
'receivesList'
][
$index
][
'imgPath'
]
=
''
;
$data
[
'receivesList'
][
$index
][
'normCollectsExtend'
]
=
$res
;
}
}
}
if
(
$data
){
if
(
$data
){
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.success"
),
$data
);
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.success"
),
$data
);
}
else
{
}
else
{
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.null_data"
),[]);
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.null_data"
),[]);
}
}
}
}
/**
/**
* 修改指标信息
* 修改指标信息
* @return \josn|void\
* @return \josn|void\
...
...
app/api/route/api.php
View file @
7f9a4c95
...
@@ -61,7 +61,8 @@ Route::rule("taskPackage/delete","TaskPackage/delete"); // 删除任务列表
...
@@ -61,7 +61,8 @@ Route::rule("taskPackage/delete","TaskPackage/delete"); // 删除任务列表
Route
::
rule
(
"norm/add"
,
"Norm/add"
);
// 新增指标
Route
::
rule
(
"norm/add"
,
"Norm/add"
);
// 新增指标
Route
::
rule
(
"norm/list"
,
"Norm/list"
);
// 指标列表
Route
::
rule
(
"norm/list"
,
"Norm/list"
);
// 指标列表
Route
::
rule
(
"norm/detail"
,
"Norm/detail"
);
// 指标详情
Route
::
rule
(
"norm/detail"
,
"Norm/detail"
);
// 指标详情
Route
::
rule
(
"norm/whole"
,
"Norm/whole"
);
// 指标完整详情信息
Route
::
rule
(
"norm/whole"
,
"Norm/wholeDetail"
);
// 指标完整详情信息
Route
::
rule
(
"norm/partDetail"
,
"Norm/partDetail"
);
// 部分详情信息
Route
::
rule
(
"norm/edit"
,
"Norm/edit"
);
// 指标详情
Route
::
rule
(
"norm/edit"
,
"Norm/edit"
);
// 指标详情
Route
::
rule
(
"norm/finalData"
,
"Norm/finalData"
);
// 返回最后的ID
Route
::
rule
(
"norm/finalData"
,
"Norm/finalData"
);
// 返回最后的ID
Route
::
rule
(
"norm/delete"
,
"Norm/delete"
);
// 删除详情
Route
::
rule
(
"norm/delete"
,
"Norm/delete"
);
// 删除详情
...
...
config/config.php
View file @
7f9a4c95
...
@@ -12,7 +12,7 @@ return [
...
@@ -12,7 +12,7 @@ return [
"success"
=>
"ok"
,
"success"
=>
"ok"
,
"error"
=>
"系统內部错误!"
,
"error"
=>
"系统內部错误!"
,
"server_failure"
=>
"服务器故障!"
,
"server_failure"
=>
"服务器故障!"
,
"interface_error"
=>
"请
求方式或接口错误,请检查
!"
,
"interface_error"
=>
"请
检查请求方式、接口名称、资源名称是否正确
!"
,
"format_error"
=>
"数据格式错误!"
,
"format_error"
=>
"数据格式错误!"
,
"request_error"
=>
"请求错误!"
,
"request_error"
=>
"请求错误!"
,
"server_error"
=>
"服务器错误!"
,
"server_error"
=>
"服务器错误!"
,
...
...
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