|
...
|
...
|
@@ -8,9 +8,12 @@ |
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Models\Geo\GeoConf;
|
|
|
|
use App\Models\Geo\GeoConfirm;
|
|
|
|
use App\Models\Geo\GeoWritings;
|
|
|
|
use App\Models\Manage\ManageHr;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Services\DingService;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Crypt;
|
|
|
|
|
|
...
|
...
|
@@ -89,11 +92,28 @@ class GeoController extends BaseController |
|
|
|
if ($info['status'] == GeoWritings::STATUS_FINISH){
|
|
|
|
return $this->response('当前文章已确认,不可再次确认',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$this->param['confirm_ip'] = $this->request->ip();
|
|
|
|
$this->param['confirm_at'] = date('Y-m-d H:i:s');
|
|
|
|
$this->param['content_length'] = strlen($this->param['content']);
|
|
|
|
$this->param['status'] = GeoWritings::STATUS_FINISH;
|
|
|
|
$geoWritingsModel->edit($this->param,['uniqid' => $token]);
|
|
|
|
$geoConfModel = new GeoConf();
|
|
|
|
$confInfo = $geoConfModel->read(['project_id'=>$info['project_id']]);
|
|
|
|
$hrModel = new ManageHr();
|
|
|
|
$manage_name = $hrModel->getName($confInfo['manager_id'] ??'');
|
|
|
|
$dingService = new DingService();
|
|
|
|
$dingService->handle([
|
|
|
|
'keyword' => '项目数据确认',
|
|
|
|
'msg' =>
|
|
|
|
'cm:文章确认完成' . PHP_EOL .
|
|
|
|
'项目名称:'.$confInfo['company'] ?? '' . PHP_EOL .
|
|
|
|
'负责人:'.$manage_name . PHP_EOL,
|
|
|
|
'isAtAll' => false, // 是否@所有人
|
|
|
|
], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->response('非法请求',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -138,10 +158,31 @@ class GeoController extends BaseController |
|
|
|
'confirm_num.max' => '客户确认数量不能为空',
|
|
|
|
]);
|
|
|
|
$geoConfirmModel = new GeoConfirm();
|
|
|
|
$info = $geoConfirmModel->read(['uniqid'=>$this->param['uniqid']]);
|
|
|
|
if ($info === false){
|
|
|
|
$this->response('当前数据不存在已被删除',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$this->param['status'] = $geoConfirmModel::STATUS_FINISH;
|
|
|
|
$this->param['confirm_ip'] = $this->request->ip();
|
|
|
|
$this->param['confirm_at'] = date('Y-m-d H:i:s');
|
|
|
|
$result = $geoConfirmModel->edit($this->param,['uniqid'=>$this->param['uniqid']]);
|
|
|
|
$result = $geoConfirmModel->edit($this->param,['id'=>$info['$info']]);
|
|
|
|
$geoConfModel = new GeoConf();
|
|
|
|
$confInfo = $geoConfModel->read(['project_id'=>$info['project_id']]);
|
|
|
|
$hrModel = new ManageHr();
|
|
|
|
$manage_name = $hrModel->getName($confInfo['manager_id'] ??'');
|
|
|
|
$dingService = new DingService();
|
|
|
|
$dingService->handle([
|
|
|
|
'keyword' => '项目数据确认',
|
|
|
|
'msg' =>
|
|
|
|
'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL .
|
|
|
|
'项目名称:'.$confInfo['company'] ?? '' . PHP_EOL .
|
|
|
|
'负责人:'.$manage_name . PHP_EOL,
|
|
|
|
'isAtAll' => false, // 是否@所有人
|
|
|
|
], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->response('非法请求',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$result);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|