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
eac39d4d
Commit
eac39d4d
authored
Apr 11, 2024
by
cwy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first commit
parent
c73fae01
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
0 deletions
+85
-0
app/api/controller/NormCollects.php
+6
-0
app/api/controller/TaskPackage.php
+39
-0
app/api/controller/Upload.php
+35
-0
app/api/route/api.php
+1
-0
runtime/session/sess_45d32640cd3f37f76c795955e2819b0a
+2
-0
runtime/session/sess_ce1f0b0a0b3d4fefec7aab2bcb41a93d
+2
-0
No files found.
app/api/controller/NormCollects.php
View file @
eac39d4d
...
@@ -29,6 +29,7 @@ class NormCollects extends AuthBase
...
@@ -29,6 +29,7 @@ class NormCollects extends AuthBase
$data
[
'refer_type'
]
=
trim
(
$queryArr
[
'addItem'
][
'refer_type'
]);
$data
[
'refer_type'
]
=
trim
(
$queryArr
[
'addItem'
][
'refer_type'
]);
$data
[
'remark'
]
=
trim
(
$queryArr
[
'addItem'
][
'remark'
]);
$data
[
'remark'
]
=
trim
(
$queryArr
[
'addItem'
][
'remark'
]);
$data
[
'imgPath'
]
=
$queryArr
[
'editorImgList'
];
$data
[
'imgPath'
]
=
$queryArr
[
'editorImgList'
];
$data
[
'fileListPdf'
]
=
$queryArr
[
'fileListPdf'
];
$data
[
'editorContent'
]
=
$queryArr
[
'editorContent'
];
$data
[
'editorContent'
]
=
$queryArr
[
'editorContent'
];
$data
[
'user_id'
]
=
$this
->
userId
;
$data
[
'user_id'
]
=
$this
->
userId
;
if
(
empty
(
$data
[
'norm_list_id'
])
||
empty
(
$data
[
'task_id'
])
||
empty
(
$data
[
'norm_id'
])
||
empty
(
$data
[
'norm_receive_id'
])
||
empty
(
$data
[
'user_id'
])){
if
(
empty
(
$data
[
'norm_list_id'
])
||
empty
(
$data
[
'task_id'
])
||
empty
(
$data
[
'norm_id'
])
||
empty
(
$data
[
'norm_receive_id'
])
||
empty
(
$data
[
'user_id'
])){
...
@@ -54,6 +55,11 @@ class NormCollects extends AuthBase
...
@@ -54,6 +55,11 @@ class NormCollects extends AuthBase
}
else
{
}
else
{
$data
[
'imgPath'
]
=
''
;
$data
[
'imgPath'
]
=
''
;
}
}
if
(
$data
[
'fileListPdf'
]){
$data
[
'fileListPdf'
]
=
implode
(
','
,
$data
[
'fileListPdf'
]);
}
else
{
$data
[
'fileListPdf'
]
=
''
;
}
$NormCollectsBus
=
new
\app\api\business\CommonBus
(
'NormCollectsBus'
);
// 通过公共业务初始化指标类
$NormCollectsBus
=
new
\app\api\business\CommonBus
(
'NormCollectsBus'
);
// 通过公共业务初始化指标类
$res
=
$NormCollectsBus
->
getConditionalQuery
(
$arr
);
$res
=
$NormCollectsBus
->
getConditionalQuery
(
$arr
);
if
(
$res
){
if
(
$res
){
...
...
app/api/controller/TaskPackage.php
View file @
eac39d4d
...
@@ -12,6 +12,7 @@ namespace app\api\controller;
...
@@ -12,6 +12,7 @@ namespace app\api\controller;
use
app\api\business\CommonBus
as
CommonBus
;
use
app\api\business\CommonBus
as
CommonBus
;
use
think\facade\Db
;
class
TaskPackage
extends
AuthBase
class
TaskPackage
extends
AuthBase
{
{
...
@@ -89,4 +90,41 @@ class TaskPackage extends AuthBase
...
@@ -89,4 +90,41 @@ class TaskPackage extends AuthBase
exception
(
$e
,
'TaskPackage.add'
);
exception
(
$e
,
'TaskPackage.add'
);
}
}
}
}
/**
* 发布任务
* @return \josn|void
*/
public
function
delete
()
{
try
{
// 数据接收
$taskId
=
input
(
"param.task_id"
,
''
,
"trim"
);
// 业务处理
Db
::
startTrans
();
$control
=
1
;
$bus
=
new
\app\api\business\CommonBus
(
'TaskPackageBus'
);
$info
=
$bus
->
deleteData
(
$taskId
);
$NormBus
=
new
\app\api\business\CommonBus
(
'NormBus'
);
$result
=
$NormBus
->
conditionDeletion
([
'task_id'
=>
$taskId
]);
$NormCollectsBus
=
new
\app\api\business\CommonBus
(
'NormCollectsBus'
);
$result
=
$NormCollectsBus
->
conditionDeletion
([
'task_id'
=>
$taskId
]);
$NormCollectsExtendBus
=
new
\app\api\business\CommonBus
(
'NormCollectsExtendBus'
);
$result
=
$NormCollectsExtendBus
->
conditionDeletion
([
'task_id'
=>
$taskId
]);
$NormListBus
=
new
\app\api\business\CommonBus
(
'NormListBus'
);
$result
=
$NormListBus
->
conditionDeletion
([
'task_id'
=>
$taskId
]);
$NormReceivesBus
=
new
\app\api\business\CommonBus
(
'NormReceivesBus'
);
$result
=
$NormReceivesBus
->
conditionDeletion
([
'task_id'
=>
$taskId
]);
// 全部添加完成提交
if
(
$control
==
1
){
Db
::
commit
();
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.success"
),
$info
);
}
else
{
Db
::
rollback
();
return
returnResult
(
config
(
"config.code.success"
),
config
(
"config.describe.null_data"
),[]);
}
}
catch
(
\Exception
$e
){
exception
(
$e
,
'TaskPackage.add'
);
}
}
}
}
\ No newline at end of file
app/api/controller/Upload.php
View file @
eac39d4d
...
@@ -52,4 +52,38 @@ class Upload
...
@@ -52,4 +52,38 @@ class Upload
}
}
}
}
/**
* 上传PDF文件
* @return \josn|\think\response\Json
*/
public
function
uploadPdf
(){
try
{
$file
=
request
()
->
file
(
'file'
);
// 上传到本地服务器
$savename
=
\think\facade\Filesystem
::
putFile
(
'pdf'
,
$file
);
if
(
$savename
){
// 文件上传成功,返回图片信息
$image_url
=
'/public/storage/'
.
$savename
;
$image_name
=
$savename
;
// 图片名称
$url
=
config
(
"config.resource_address"
)
.
$image_url
;
return
json
([
'errno'
=>
0
,
'data'
=>
[
'url'
=>
$url
,
'alt'
=>
$image_name
,
]
]);
}
else
{
// 文件上传失败
return
json
([
'errno'
=>
1
,
'data'
=>
[],
'msg'
=>
$file
->
getError
()
]);
}
}
catch
(
\Exception
$e
){
logWrite
(
'picture'
,
$e
->
getMessage
(),
__FILE__
);
return
returnResult
(
config
(
"config.code.error"
),
$e
->
getMessage
());
}
}
}
}
\ No newline at end of file
app/api/route/api.php
View file @
eac39d4d
...
@@ -84,6 +84,7 @@ Route::rule("normCollects/notCollectible","normCollects/notCollectible"); // 数
...
@@ -84,6 +84,7 @@ Route::rule("normCollects/notCollectible","normCollects/notCollectible"); // 数
/***************************上传 */
/***************************上传 */
Route
::
rule
(
"upload/picture"
,
"upload/picture"
);
Route
::
rule
(
"upload/picture"
,
"upload/picture"
);
Route
::
rule
(
"uploadPdf"
,
"upload/uploadPdf"
);
/***************************指标结算 */
/***************************指标结算 */
Route
::
rule
(
"normOrders/add"
,
"NormOrders/add"
);
//结算指标
Route
::
rule
(
"normOrders/add"
,
"NormOrders/add"
);
//结算指标
...
...
runtime/session/sess_45d32640cd3f37f76c795955e2819b0a
0 → 100644
View file @
eac39d4d
a:1:{s:5:"users";a:10:{s:2:"id";i:1;s:4:"name";s:12:"开发人员";s:5:"phone";s:11:"18417180202";s:7:"account";s:5:"admin";s:8:"password";s:32:"e10adc3949ba59abbe56e057f20f883e";s:6:"status";i:1;s:4:"type";i:1;s:11:"create_time";s:1:"1";s:5:"email";s:18:"wesley_prc@163.com";s:13:"department_id";i:3;}}
\ No newline at end of file
runtime/session/sess_ce1f0b0a0b3d4fefec7aab2bcb41a93d
0 → 100644
View file @
eac39d4d
a:1:{s:5:"users";a:10:{s:2:"id";i:4;s:4:"name";s:13:"测试人员2";s:5:"phone";s:4:"2131";s:7:"account";s:7:"test002";s:8:"password";s:32:"e10adc3949ba59abbe56e057f20f883e";s:6:"status";i:1;s:4:"type";i:1;s:11:"create_time";s:10:"1708836112";s:5:"email";s:3:"123";s:13:"department_id";i:2;}}
\ 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