|
...
|
...
|
@@ -136,11 +136,11 @@ class Ticket5UploadDataController extends BaseController |
|
|
|
public function save()
|
|
|
|
{
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id' => 'required',
|
|
|
|
'post_id' => 'required',
|
|
|
|
'type' => 'required',
|
|
|
|
'text' => 'required'
|
|
|
|
], [
|
|
|
|
'project_id.required' => 'project_id不能为空',
|
|
|
|
'post_od.required' => 'project_id不能为空',
|
|
|
|
'type.required' => '上传类型不能为空',
|
|
|
|
'text' => '数据详情不为空'
|
|
|
|
]);
|
|
...
|
...
|
@@ -152,5 +152,41 @@ class Ticket5UploadDataController extends BaseController |
|
|
|
}
|
|
|
|
//验证当前数据是否已提交
|
|
|
|
$this->param['text'] = json_encode($this->param['text'], true);
|
|
|
|
$this->pushTicketByBots($this->param['post_id'],$this->param['type']);
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
//执行编辑
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
if($info['status'] == 0){
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
}else{
|
|
|
|
$this->response('当前状态不允许编辑', Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$this->response('success');
|
|
|
|
}else{
|
|
|
|
$info = $this->model->read(['project_id' => $this->param['project_id'], 'type' => $this->param['type'], 'text' => $this->param['text'], 'status' => 0]);
|
|
|
|
if ($info === false) {
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
} else {
|
|
|
|
$id = $info['id'];
|
|
|
|
}
|
|
|
|
$data = ['id' => $id];
|
|
|
|
$this->response('success', Code::SUCCESS, $data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :钉钉通知
|
|
|
|
* @name :pushTicketByBots
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/11/10 11:10
|
|
|
|
*/
|
|
|
|
public function pushTicketByBots($post_id,$type = 1)
|
|
|
|
{
|
|
|
|
$project = TicketProject::where('post_id', $post_id)->where('project_cate',$type)->where('is_del', 0)->first();
|
|
|
|
if (!$project){
|
|
|
|
return response()->json(['message' => '未找到对应的工单项目'], 404);
|
|
|
|
}
|
|
|
|
return $project->pushWechatGroupMsg("您好,用户已上传数据,请审核!");
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|