dataLists(new CompanyLists()); } /** * @notes 添加 * @return \think\response\Json * @author likeadmin * @date 2023/07/15 14:43 */ public function add() { $params = (new CompanyValidate())->post()->goCheck('add'); $params['other_contacts'] = json_encode($params['other_contacts']); $params['qualification'] = json_encode($params['qualification']); $result = CompanyLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(CompanyLogic::getError()); } /** * @notes 编辑 * @return \think\response\Json * @author likeadmin * @date 2023/07/15 14:43 */ public function edit() { $params = (new CompanyValidate())->post()->goCheck('edit'); $params['other_contacts'] = json_encode($params['other_contacts']); $params['qualification'] = json_encode($params['qualification']); $result = CompanyLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(CompanyLogic::getError()); } /** * @notes 删除 * @return \think\response\Json * @author likeadmin * @date 2023/07/15 14:43 */ public function delete() { $params = (new CompanyValidate())->post()->goCheck('delete'); CompanyLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取详情 * @return \think\response\Json * @author likeadmin * @date 2023/07/15 14:43 */ public function detail() { $params = (new CompanyValidate())->goCheck('detail'); $result = CompanyLogic::detail($params); return $this->data($result); } public function Draftingcontracts() { $params = (new CompanyValidate())->goCheck('detail'); $result = CompanyLogic::detail($params); if ($result && $result['contract'] && $result['contract']['contract_type_two_url'] != '') { $data = [ 'name' => $result['company_name'], 'signatories' => [['fullName' => $result['master_name'], 'identityType' => 12, 'identityCard' => $result['organization_code'], 'mobile' => $result['master_phone'], 'email' => $result['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1]], 'url' => $result['contract']['contract_type_two_url'] ]; $res = app(JunziqianController::class)->Signing($data); if ($res->success == true) { Db::name('contract')->where('id', $result['contract']['id'])->update(['contract_no' => $res->data]); return $this->success('起草合同成功', [], 1, 1); } else { return $this->fail($res->msg); } } else { return $this->fail('起草合同失败,联系管理员'); } } public function postsms() { $params = (new CompanyValidate())->goCheck('detail'); $company = Db::name('company')->where('id', $params['id'])->find(); if ($company && $company['contract_id']) { $find = Db::name('contract')->where('id',$company['contract_id'])->find(); if ($find) { $data = array( "applyNo" => $find['contract_no'], //TODO * "fullName" => $company['master_name'], //TODO * "identityCard" => $company['organization_code'], //TODO * "identityType" => 12, //TODO * ); $res = app(JunziqianController::class)->SigningLink($data); if ($res->success == true) { return $this->success('发生成功', [], 1, 1); } else { return $this->fail($res->msg); } } } } }