Commit eac39d4d by cwy

first commit

parent c73fae01
......@@ -29,6 +29,7 @@ class NormCollects extends AuthBase
$data['refer_type'] = trim($queryArr['addItem']['refer_type']);
$data['remark'] = trim($queryArr['addItem']['remark']);
$data['imgPath'] = $queryArr['editorImgList'];
$data['fileListPdf'] = $queryArr['fileListPdf'];
$data['editorContent'] = $queryArr['editorContent'];
$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'])){
......@@ -54,6 +55,11 @@ class NormCollects extends AuthBase
}else{
$data['imgPath'] = '';
}
if($data['fileListPdf']){
$data['fileListPdf'] = implode(',',$data['fileListPdf']);
}else{
$data['fileListPdf'] = '';
}
$NormCollectsBus = new \app\api\business\CommonBus('NormCollectsBus'); // 通过公共业务初始化指标类
$res = $NormCollectsBus->getConditionalQuery($arr);
if($res){
......
......@@ -12,6 +12,7 @@ namespace app\api\controller;
use app\api\business\CommonBus as CommonBus;
use think\facade\Db;
class TaskPackage extends AuthBase
{
......@@ -89,4 +90,41 @@ class TaskPackage extends AuthBase
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
......@@ -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
......@@ -84,6 +84,7 @@ Route::rule("normCollects/notCollectible","normCollects/notCollectible"); // 数
/***************************上传 */
Route::rule("upload/picture","upload/picture");
Route::rule("uploadPdf","upload/uploadPdf");
/***************************指标结算 */
Route::rule("normOrders/add","NormOrders/add"); //结算指标
......
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment