|
@@ -33,11 +33,11 @@ class Enterprise extends AdminController {
|
|
|
public function gotoEnterpriseDetailPage() {
|
|
|
$id = trim($this->request['id']);
|
|
|
$ep = EnterpriseApi::getOne($id);
|
|
|
- $check_info = ApiData::where('action','=','register_check')->where('uid','=',$ep['idCard'])->where('status','=',1)->find();
|
|
|
- $force = intval($this->request['force'],0);
|
|
|
- if($force || !$check_info || !$check_info['status']){
|
|
|
+ $check_info = ApiData::where('action', '=', 'register_check')->where('uid', '=', $ep['idCard'])->where('status', '=', 1)->find();
|
|
|
+ $force = intval($this->request['force'], 0);
|
|
|
+ if ($force || !$check_info || !$check_info['status']) {
|
|
|
$rsapi = new RsApi();
|
|
|
- switch ($ep['special']){
|
|
|
+ switch ($ep['special']) {
|
|
|
case 0:
|
|
|
$ep['rs'] = $rsapi->I040102($ep['idCard']);
|
|
|
break;
|
|
@@ -49,7 +49,7 @@ class Enterprise extends AdminController {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- ApiData::where('action','=','register_check')->where('uid','=',$ep['idCard'])->where('status','=',1)->update(['status' => 0,'updateTime' => time()]);
|
|
|
+ ApiData::where('action', '=', 'register_check')->where('uid', '=', $ep['idCard'])->where('status', '=', 1)->update(['status' => 0, 'updateTime' => time()]);
|
|
|
$api_model_data = [
|
|
|
'uid' => $ep['idCard'],
|
|
|
'action' => 'register_check',
|
|
@@ -58,7 +58,7 @@ class Enterprise extends AdminController {
|
|
|
];
|
|
|
|
|
|
ApiData::create($api_model_data);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$ep['rs'] = unserialize($check_info['content']);
|
|
|
}
|
|
|
|
|
@@ -402,6 +402,145 @@ class Enterprise extends AdminController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function gotoRejectPage() {
|
|
|
+ $id = trim($this->request['id']);
|
|
|
+ $ep = EnterpriseApi::getOne($id);
|
|
|
+ if (!$ep) {
|
|
|
+ return "无此企业";
|
|
|
+ }
|
|
|
+ if ($ep["checkState"] != 3) {
|
|
|
+ return "该操作只能对已通过企业进行驳回";
|
|
|
+ }
|
|
|
+ $lastLog = \app\common\api\TalentLogApi::getLastLog($id, 10);
|
|
|
+ if ($lastLog["active"] != 1 || $lastLog["state"] != $ep["checkState"]) {
|
|
|
+ return "日志状态与当前状态不一致,已中止操作";
|
|
|
+ }
|
|
|
+ $ep["passedUser"] = $lastLog["createUser"];
|
|
|
+ $ep["passedTime"] = $lastLog["createTime"];
|
|
|
+ //---------设置产业领域 --------------------------------------------------
|
|
|
+ if (\StrUtil::isNotEmpAndNull($ep['industryFieldNew'])) {
|
|
|
+ $industryFieldNew = DictApi::findByParentCodeAndCode('industry_field', $ep['industryFieldNew']);
|
|
|
+ if ($industryFieldNew != null) {
|
|
|
+ $ep['industryFieldNewName'] = $industryFieldNew['name'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ($ep->special == 0) {
|
|
|
+ $fields = ["name" => "企业名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "企业地址", "street" => "所属街道", "ephone" => "企业电话", "bankCard" => "企业银行账号", "bank" => "企业开户银行", "bankNetwork" => "企业开户银行网点",
|
|
|
+ "agencyType" => "机构类型", "industryFieldNew" => "产业领域", "industryFieldOld" => "行业领域", "enterpriseTag" => "企业标签", "enterpriseType" => "企业类型",
|
|
|
+ "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
|
|
|
+ $files = ["imgurl" => "企业营业执照", "bankImg" => "开户许可证/基本存款账户信息", "domainImg" => "行业领域佐证材料", "beian" => "人才联络员信息备案表", "typeImg" => "规上、高新技术、专精特新企业上传材料"];
|
|
|
+ } else {
|
|
|
+ $fields = ["name" => "单位名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "单位地址", "street" => "所属街道", "ephone" => "单位电话", "bankCard" => "单位银行账号", "bank" => "单位开户银行", "bankNetwork" => "单位开户银行网点",
|
|
|
+ "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
|
|
|
+ if ($ep->special == 1) {
|
|
|
+ $fields["institutionTag"] = "单位标签";
|
|
|
+ }
|
|
|
+ if ($ep->special == 3) {
|
|
|
+ $fields["organizationTag"] = "机构标签";
|
|
|
+ }
|
|
|
+ $files = ["imgurl" => "法人证或批文", "bankImg" => "开户许可证/基本存款账户信息", "beian" => "人才联络员备案表"];
|
|
|
+ }
|
|
|
+
|
|
|
+ $modify_fields = [];
|
|
|
+ $modify_files = [];
|
|
|
+ $_modify_fields = explode(",", $ep["modify_fields"]);
|
|
|
+ foreach ($fields as $key => $value) {
|
|
|
+ $modify_fields[$key] = ["field" => $key, "name" => $value];
|
|
|
+ }
|
|
|
+ $_modify_files = explode(",", $ep["modify_files"]);
|
|
|
+ foreach ($files as $key => $value) {
|
|
|
+ $modify_files[$key] = ["field" => $key, "name" => $value];
|
|
|
+ }
|
|
|
+
|
|
|
+ return view("", ['ep' => $ep, 'fields' => $modify_fields, "files" => $modify_files]);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function doReject() {
|
|
|
+ $id = trim($this->request['id']);
|
|
|
+ if (!$id) {
|
|
|
+ return json(["msg" => 'ID不能为空!']);
|
|
|
+ }
|
|
|
+ $ep = EnterpriseApi::getOne($id);
|
|
|
+ if (!$ep) {
|
|
|
+ return json(["msg" => '无此企业!']);
|
|
|
+ }
|
|
|
+ if ($ep["checkState"] != 3) {
|
|
|
+ return json(["msg" => '该操作只能对已通过企业进行驳回!']);
|
|
|
+ }
|
|
|
+ $checkMsg = $this->request['checkMsg'];
|
|
|
+ $fields = $this->request['fields'];
|
|
|
+ $files = $this->request['files'];
|
|
|
+ if (\StrUtil::isEmpOrNull($checkMsg)) {
|
|
|
+ return json(["msg" => '请填写审核意见!']);
|
|
|
+ }
|
|
|
+ if (strlen($checkMsg) > 1000) {
|
|
|
+ return json(["msg" => '审核意见最多1000个字符!']);
|
|
|
+ }
|
|
|
+ if (!$fields && !$files) {
|
|
|
+ return json(["msg" => '请选择驳回修改的字段或者附件!']);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ $lastLog = \app\common\api\TalentLogApi::getLastLog($id, 10);
|
|
|
+ if ($lastLog["active"] != 1 || $lastLog["state"] != $ep["checkState"]) {
|
|
|
+ return json(["msg" => '日志状态与当前状态不一致,已中止操作']);
|
|
|
+ }
|
|
|
+ $companyName = session('user')["companyName"] ?: session('user')["rolename"];
|
|
|
+ $checkData = [
|
|
|
+ 'id' => $id,
|
|
|
+ 'checkState' => 2,
|
|
|
+ 'checkMsg' => $checkMsg,
|
|
|
+ 'modify_fields' => $fields ? implode(",", $fields) : null,
|
|
|
+ 'modify_files' => $files ? implode(",", $files) : null,
|
|
|
+ 'checkUser' => session('user')['name'],
|
|
|
+ 'updateUser' => session('user')['uid'],
|
|
|
+ 'updateTime' => date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ $res = EnterpriseApi::updateById($checkData);
|
|
|
+
|
|
|
+ $tplContent = "【晋江市人才服务平台】您好!您提交的晋江市现代产业体系人才机构注册信息因信息填写错误或上传不完整已被退回,请及时登录“晋江市人才综合服务申报平台”根据审核意见修改并重新提交。退订回复TD。";
|
|
|
+ $smsapi = new ChuanglanSmsApi();
|
|
|
+ $result = $smsapi->sendSMS($ep['agentPhone'], $tplContent);
|
|
|
+
|
|
|
+ //短信入库数据
|
|
|
+ $record_data = [
|
|
|
+ 'id' => getStringId(),
|
|
|
+ 'bizId' => $result['msgId'],
|
|
|
+ 'userId' => $id,
|
|
|
+ 'type' => 2,
|
|
|
+ 'smsType' => 2,
|
|
|
+ 'name' => $ep['name'],
|
|
|
+ 'phone' => $ep['agentPhone'],
|
|
|
+ 'params' => '机构注册通过再驳回',
|
|
|
+ 'state' => $result['code'] == 0 ? 2 : 3,
|
|
|
+ 'sendingDate' => date("Y-m-d H:i:s", time()),
|
|
|
+ 'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
+ 'templateCode' => $tplContent,
|
|
|
+ "msg" => $result['errorMsg']
|
|
|
+ ];
|
|
|
+
|
|
|
+ MessageRecord::create($record_data);
|
|
|
+ TalentChecklog::create([
|
|
|
+ 'id' => getStringId(),
|
|
|
+ 'mainId' => $id,
|
|
|
+ 'type' => 10,
|
|
|
+ 'typeField' => null,
|
|
|
+ 'active' => 1,
|
|
|
+ 'state' => 2,
|
|
|
+ 'step' => 101,
|
|
|
+ 'stateChange' => TalentState::stateEnum(2),
|
|
|
+ 'description' => $checkMsg,
|
|
|
+ 'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
+ 'createUser' => session('user')['name'] . "({$companyName})"
|
|
|
+ ]);
|
|
|
+
|
|
|
+ return json(["msg" => '操作成功!', "code" => 200]);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return json(["msg" => $e->getMessage()]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function delEnterprise() {
|
|
|
if (!$id = trim($this->request['id'])) {
|
|
|
return json(["msg" => 'ID不能为空!', "code" => 500]);
|