Api.php 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
  1. <?php
  2. namespace app\enterprise\controller;
  3. use app\admin\model\Enterprise;
  4. use app\common\api\DictApi;
  5. use app\common\api\EnterpriseApi;
  6. use app\common\model\CurrentcyFileType;
  7. use app\common\model\TalentChecklog;
  8. use app\common\model\TalentCommonFile;
  9. use app\enterprise\model\EnterpriseRecord;
  10. use app\enterprise\common\EnterpriseController;
  11. use app\Request;
  12. use think\exception\ValidateException;
  13. use app\common\api\UploadApi;
  14. class Api extends EnterpriseController {
  15. private $compatible_time = "2022-10-15 23:59:59";
  16. public function findEnterpriseChangeByPage() {
  17. $order = trim($this->request->param("order")) ?: "desc";
  18. $offset = trim($this->request->param("offset")) ?: 0;
  19. $limit = trim($this->request->param("limit")) ?: 10;
  20. $list = EnterpriseRecord::where('mainId', session("user")["uid"])->limit($offset, $limit)->order('createTime ' . $order)->select()->toArray();
  21. $count = count($list);
  22. if ($count > 0) {
  23. $streetList = DictApi::selectByParentCode('street');
  24. $typeList = DictApi::selectByParentCode('enterprise_type');
  25. $industryFieldNew = DictApi::selectByParentCode('industry_field');
  26. foreach ($list as $k => &$v) {
  27. $v['newIndustryFieldNewName'] = $industryFieldNew[$v['newIndustryFieldNew']];
  28. $v['newEnterpriseType'] = $typeList[$v['newEnterpriseType']];
  29. $v['newStreetName'] = $streetList[$v['newStreet']];
  30. }
  31. }
  32. return json(["total" => $count, "rows" => $list]);
  33. }
  34. public function findUnfinishedChangeRecord() {
  35. return EnterpriseRecord::where('mainId', session("user")["uid"])->where('checkState', '<>', 4)->select()->toArray();
  36. }
  37. public function toAdd() {
  38. $ep = Enterprise::where('id', session("user")["uid"])->find();
  39. $ecr = [
  40. "special" => $ep["special"],
  41. 'enterprise_id' => $ep['id'],
  42. 'newName' => $ep['name'],
  43. 'newIdCard' => $ep['idCard'],
  44. 'newStreet' => $ep['street'],
  45. 'newAddress' => $ep['address'],
  46. 'newLegal' => $ep['legal'],
  47. 'newEphone' => $ep['ephone'],
  48. 'newAgentName' => $ep['agentName'],
  49. 'newAgentEmail' => $ep['agentEmail'],
  50. 'newAgentPhone' => $ep['agentPhone'],
  51. 'type' => $ep['type'],
  52. 'newAgencyType' => $ep['agencyType'],
  53. 'newEnterpriseTag' => $ep['enterpriseTag'],
  54. 'newOrganizationTag' => $ep['organizationTag'],
  55. 'newInstitutionTag' => $ep['institutionTag'],
  56. 'newEnterpriseType' => $ep['enterpriseType'],
  57. 'newIndustryFieldNew' => $ep['industryFieldNew'],
  58. 'newIndustryFieldOld' => $ep['industryFieldOld'],
  59. 'newBankCard' => $ep['bankCard'],
  60. 'newBank' => $ep['bank'],
  61. 'newBankNetwork' => $ep['bankNetwork']
  62. ];
  63. if ($ep["imgurl"]) {
  64. $ecr["imgurl"] = $ep["imgurl"];
  65. $extension = pathinfo($ep["imgurl"])["extension"];
  66. if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
  67. $ecr["imgurl_is_img"] = 1;
  68. }
  69. }
  70. if ($ep["bankImg"]) {
  71. $ecr["bankImg"] = $ep["bankImg"];
  72. $extension = pathinfo($ep["bankImg"])["extension"];
  73. if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
  74. $ecr["bankImg_is_img"] = 1;
  75. }
  76. }
  77. if ($ep["domainImg"]) {
  78. $ecr["domainImg"] = $ep["domainImg"];
  79. $extension = pathinfo($ep["domainImg"])["extension"];
  80. if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
  81. $ecr["domainImg_is_img"] = 1;
  82. }
  83. }
  84. if ($ep["typeImg"]) {
  85. $ecr["typeImg"] = $ep["typeImg"];
  86. $extension = pathinfo($ep["typeImg"])["extension"];
  87. if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
  88. $ecr["typeImg_is_img"] = 1;
  89. }
  90. }
  91. if ($ep["beian"]) {
  92. $ecr["beian"] = $ep["beian"];
  93. $extension = pathinfo($ep["beian"])["extension"];
  94. if (in_array($extension, ["jpeg", "jpg", "png", "gif"])) {
  95. $ecr["beian_is_img"] = 1;
  96. }
  97. }
  98. switch ($ep['checkState']) {
  99. case 1:
  100. $ecr['checkStateName'] = '保存未提交审核';
  101. break;
  102. case 2:
  103. $ecr['checkStateName'] = '待审核';
  104. break;
  105. case 3:
  106. $ecr['checkStateName'] = '审核驳回';
  107. break;
  108. case 4:
  109. $ecr['checkStateName'] = '审核通过';
  110. break;
  111. case 5:
  112. $ecr['checkStateName'] = '重新提交';
  113. break;
  114. default:
  115. $ecr['checkStateName'] = '';
  116. }
  117. //20220918增加根据不同的企业类型显示不同的信息变更界面
  118. switch ($ep->special) {
  119. case 0:
  120. return view("", ['ecr' => $ecr]);
  121. break;
  122. case 1:
  123. return view("", ['ecr' => $ecr]);
  124. break;
  125. case 3:
  126. return view("", ['ecr' => $ecr]);
  127. break;
  128. default:
  129. break;
  130. }
  131. }
  132. public function upsert() {
  133. $data = [
  134. 'id' => \StrUtil::getRequestDecodeParam($this->request, 'enterprise_id'),
  135. 'name' => \StrUtil::getRequestDecodeParam($this->request, 'newName'), //单位名称
  136. 'idCard' => \StrUtil::getRequestDecodeParam($this->request, 'newIdCard'), //统一社会信用代码
  137. 'agentName' => \StrUtil::getRequestDecodeParam($this->request, 'newAgentName'), //人才联络员
  138. 'agentPhone' => \StrUtil::getRequestDecodeParam($this->request, 'newAgentPhone'), //人才联络员电话
  139. 'legal' => \StrUtil::getRequestDecodeParam($this->request, 'newLegal'), //法人
  140. 'street' => \StrUtil::getRequestDecodeParam($this->request, 'newStreet'), //镇街
  141. 'address' => \StrUtil::getRequestDecodeParam($this->request, 'newAddress'), //地址
  142. 'type' => intval($this->request['type']),
  143. 'agencyType' => intval($this->request['newAgencyType']),
  144. 'enterpriseTag' => \StrUtil::getRequestDecodeParam($this->request, 'newEnterpriseTag'), //单位标签
  145. 'organizationTag' => \StrUtil::getRequestDecodeParam($this->request, 'newOrganizationTag'), //机构标签
  146. 'institutionTag' => \StrUtil::getRequestDecodeParam($this->request, 'newInstitutionTag'), //事业单位标签
  147. 'enterpriseType' => \StrUtil::getRequestDecodeParam($this->request, 'newEnterpriseType'), //单位类型
  148. 'agentEmail' => \StrUtil::getRequestDecodeParam($this->request, 'newAgentEmail'), //邮箱
  149. 'ephone' => \StrUtil::getRequestDecodeParam($this->request, 'newEphone'), //单位电话
  150. 'industryFieldNew' => \StrUtil::getRequestDecodeParam($this->request, 'newIndustryFieldNew'), //产业领域
  151. 'industryFieldOld' => \StrUtil::getRequestDecodeParam($this->request, 'newIndustryFieldOld'), //行业领域
  152. 'bankCard' => \StrUtil::getRequestDecodeParam($this->request, 'newBankCard'), //银行
  153. 'bank' => \StrUtil::getRequestDecodeParam($this->request, 'newBank'), //开户行
  154. 'bankNetwork' => \StrUtil::getRequestDecodeParam($this->request, 'newBankNetwork')//网点
  155. ];
  156. $response_object = new \stdClass();
  157. try {
  158. if (stripos($data['name'], "(")) {
  159. $data['name'] = str_replace('(', '(', $data['name']);
  160. }
  161. if (stripos($data['name'], ")")) {
  162. $data['name'] = str_replace(')', ')', $data['name']);
  163. }
  164. $ep = Enterprise::where('id', session("user")["uid"])->find();
  165. switch ($ep->special) {
  166. case 0:
  167. if ($ep->type == 2) {
  168. validate(\app\common\validate\Enterprise::class)->batch(true)->scene('jc_change')->check($data);
  169. } else {
  170. if ($data["agencyType"] == 1) {
  171. validate(\app\common\validate\Enterprise::class)->batch(true)->scene('change')->check($data);
  172. } else {
  173. validate(\app\common\validate\Enterprise::class)->batch(true)->scene('change2')->check($data);
  174. }
  175. }
  176. break;
  177. case 1:
  178. validate(\app\common\validate\Enterprise::class)->batch(true)->scene('sy_change')->check($data);
  179. break;
  180. default:
  181. break;
  182. }
  183. $record_id = \StrUtil::getRequestDecodeParam($this->request, 'id');
  184. if (!$record_id) {
  185. $record_id = getStringId();
  186. $record_data = [
  187. 'id' => $record_id,
  188. 'mainId' => $data['id'],
  189. 'type' => $data['type'],
  190. 'oldAgencyType' => $ep['agencyType'],
  191. 'oldName' => $ep['name'],
  192. 'oldIdCard' => $ep['idCard'],
  193. 'oldIndustryFieldNew' => $ep['industryFieldNew'],
  194. 'oldIndustryFieldOld' => $ep['industryFieldOld'],
  195. 'oldStreet' => $ep['street'],
  196. 'oldAddress' => $ep['address'],
  197. 'oldLegal' => $ep['legal'],
  198. 'oldEphone' => $ep['ephone'],
  199. 'oldAgentName' => $ep['agentName'],
  200. 'oldAgentEmail' => $ep['agentEmail'],
  201. 'oldAgentPhone' => $ep['agentPhone'],
  202. 'oldEnterpriseTag' => $ep['enterpriseTag'],
  203. 'oldOrganizationTag' => $ep['organizationTag'],
  204. 'oldInstitutionTag' => $ep['institutionTag'],
  205. 'oldEnterpriseType' => $ep['enterpriseType'],
  206. 'oldBankCard' => $ep['bankCard'],
  207. 'oldBank' => $ep['bank'],
  208. 'oldBankNetwork' => $ep['bankNetwork'],
  209. "oldImgurl" => $ep["imgurl"],
  210. "oldBankImg" => $ep["bankImg"],
  211. "oldDomainImg" => $ep["domainImg"],
  212. "oldTypeImg" => $ep["typeImg"],
  213. "oldBeian" => $ep["beian"],
  214. 'newAgencyType' => $data['agencyType'],
  215. 'newName' => htmlspecialchars($data['name']),
  216. 'newIdCard' => htmlspecialchars($data['idCard']),
  217. 'newIndustryFieldNew' => $data['industryFieldNew'],
  218. 'newIndustryFieldOld' => $data['industryFieldOld'],
  219. 'newStreet' => $data['street'],
  220. 'newAddress' => $data['address'],
  221. 'newLegal' => $data['legal'],
  222. 'newEphone' => $data['ephone'],
  223. 'newAgentName' => $data['agentName'],
  224. 'newAgentEmail' => $data['agentEmail'],
  225. 'newAgentPhone' => $data['agentPhone'],
  226. 'newEnterpriseTag' => $data['enterpriseTag'],
  227. 'newOrganizationTag' => $data['organizationTag'],
  228. 'newInstitutionTag' => $data['institutionTag'],
  229. 'newEnterpriseType' => $data['enterpriseType'],
  230. 'newBankCard' => $data['bankCard'],
  231. 'newBank' => $data['bank'],
  232. 'newBankNetwork' => $data['bankNetwork'],
  233. 'checkState' => 1,
  234. 'createTime' => date("Y-m-d H:i:s", time()),
  235. 'createUser' => session("user")["uid"]
  236. ];
  237. $record_data["newImgurl"] = $ep["imgurl"];
  238. $record_data["newBankImg"] = $ep["bankImg"];
  239. $record_data["newDomainImg"] = $ep["domainImg"];
  240. $record_data["newTypeImg"] = $ep["typeImg"];
  241. $record_data["newBeian"] = $ep["beian"];
  242. if ($data["agencyType"] != 1) {
  243. $record_data["newIndustryFieldNew"] = null;
  244. $record_data["newIndustryFieldOld"] = null;
  245. $record_data["newDomainImg"] = null;
  246. }
  247. $files = $this->request->file();
  248. if ($files) {
  249. $uploadapi = new UploadApi();
  250. if (array_key_exists('imgurl', $files)) {
  251. $upload_result = $uploadapi->uploadOne($this->request->file('imgurl'), 'system');
  252. if ($upload_result->code == 500) {
  253. return \StrUtil::back($upload_result, "EpChangeEdit.callBack");
  254. }
  255. $record_data["newImgurl"] = $upload_result->filepath;
  256. }
  257. //检验附件 开户许可证
  258. if (array_key_exists('bankImg', $files)) {
  259. $upload_result1 = $uploadapi->uploadOne($this->request->file('bankImg'), 'system');
  260. if ($upload_result1->code == 500) {
  261. return \StrUtil::back($upload_result1, "EpChangeEdit.callBack");
  262. }
  263. $record_data["newBankImg"] = $upload_result1->filepath;
  264. }
  265. //检验附件 行业领域佐证材料
  266. if (array_key_exists('domainImg', $files) && $data['agencyType'] == 1) {
  267. $upload_result2 = $uploadapi->uploadOne($this->request->file('domainImg'), 'system');
  268. if ($upload_result2->code == 500) {
  269. return \StrUtil::back($upload_result2, "EpChangeEdit.callBack");
  270. }
  271. $record_data["newDomainImg"] = $upload_result2->filepath;
  272. }
  273. //检验附件 三种类型企业上传材料
  274. if (array_key_exists('typeImg', $files)) {
  275. $upload_result4 = $uploadapi->uploadOne($this->request->file('typeImg'), 'system');
  276. if ($upload_result4->code == 500) {
  277. return \StrUtil::back($upload_result4, "EpChangeEdit.callBack");
  278. }
  279. $record_data["newTypeImg"] = $upload_result4->filepath;
  280. }
  281. //检验附件 人才联络员备案表
  282. if (array_key_exists('beian', $files)) {
  283. $upload_result3 = $uploadapi->uploadOne($this->request->file('beian'), 'system');
  284. if ($upload_result3->code == 500) {
  285. return \StrUtil::back($upload_result3, "EpChangeEdit.callBack");
  286. }
  287. $record_data["newBeian"] = $upload_result3->filepath;
  288. }
  289. }
  290. if (!$record_data["newImgurl"]) {
  291. throw new ValidateException("请上传营业执照");
  292. }
  293. if ($ep->special == 0) {
  294. if (!$record_data["newBankImg"]) {
  295. throw new ValidateException("请上传开户许可证/基本存款账户信息");
  296. }
  297. if ($ep->type == 1 && $data['agencyType'] == 1 && !$record_data["newDomainImg"]) {
  298. throw new ValidateException("请上传行业领域佐证材料");
  299. }
  300. if (in_array($record_data["newEnterpriseType"], ["guishang", "gaoxinjishu", "zhuanjingtexin"]) && !$record_data["newTypeImg"]) {
  301. throw new ValidateException("规上、高新技术、专精特新企业需要上传佐证材料");
  302. }
  303. if (!in_array($record_data["newEnterpriseType"], ["guishang", "gaoxinjishu", "zhuanjingtexin"])) {
  304. $record_data["newTypeImg"] = null;
  305. }
  306. }
  307. if (!$record_data["newBeian"]) {
  308. throw new ValidateException("请上传人才联络员信息备案表");
  309. }
  310. EnterpriseRecord::create($record_data);
  311. $log = [
  312. 'id' => getStringId(),
  313. 'mainId' => $record_data['id'],
  314. 'category' => 'enterprise_change',
  315. 'type' => 10,
  316. 'active' => 1,
  317. 'state' => 1,
  318. 'step' => 100,
  319. 'stateChange' => '保存未提交',
  320. 'description' => '机构信息变更记录添加成功',
  321. 'createTime' => date("Y-m-d H:i:s", time()),
  322. 'createUser' => '用户'
  323. ];
  324. $success_msg = "添加成功";
  325. //$res = ['msg' => '添加成功', 'code' => 200, 'obj' => $record_data];
  326. } else {
  327. $record = EnterpriseRecord::find($record_id);
  328. $ep = Enterprise::where('id', session("user")["uid"])->find();
  329. $record->oldAgencyType = $ep['agencyType'];
  330. $record->oldName = $ep['name'];
  331. $record->oldIdCard = $ep['idCard'];
  332. $record->oldIndustryFieldNew = $ep['industryFieldNew'];
  333. $record->oldIndustryFieldOld = $ep['industryFieldOld'];
  334. $record->oldStreet = $ep['street'];
  335. $record->oldAddress = $ep['address'];
  336. $record->oldLegal = $ep['legal'];
  337. $record->oldEphone = $ep['ephone'];
  338. $record->oldAgentName = $ep['agentName'];
  339. $record->oldAgentEmail = $ep['agentEmail'];
  340. $record->oldAgentPhone = $ep['agentPhone'];
  341. $record->oldEnterpriseTag = $ep['enterpriseTag'];
  342. $record->oldOrganizationTag = $ep['organizationTag'];
  343. $record->oldInstitutionTag = $ep['institutionTag'];
  344. $record->oldEnterpriseType = $ep['enterpriseType'];
  345. $record->oldBankCard = $ep['bankCard'];
  346. $record->oldBank = $ep['bank'];
  347. $record->oldBankNetwork = $ep['bankNetwork'];
  348. if ($record->checkState == 1) {
  349. $record->newAgencyType = $data['agencyType'];
  350. $record->newName = htmlspecialchars($data['name']);
  351. $record->newIdCard = htmlspecialchars($data['idCard']);
  352. if ($data["agencyType"] == 1) {
  353. $record->newIndustryFieldNew = $data['industryFieldNew'];
  354. $record->newIndustryFieldOld = $data['industryFieldOld'];
  355. } else {
  356. $record->newIndustryFieldNew = null;
  357. $record->newIndustryFieldOld = null;
  358. }
  359. $record->newStreet = $data['street'];
  360. $record->newAddress = $data['address'];
  361. $record->newLegal = $data['legal'];
  362. $record->newEphone = $data['ephone'];
  363. $record->newAgentName = $data['agentName'];
  364. $record->newAgentEmail = $data['agentEmail'];
  365. $record->newAgentPhone = $data['agentPhone'];
  366. $record->newEnterpriseTag = $data['enterpriseTag'];
  367. $record->newOrganizationTag = $data['organizationTag'];
  368. $record->newInstitutionTag = $data['institutionTag'];
  369. $record->newEnterpriseType = $data['enterpriseType'];
  370. $record->newBankCard = $data['bankCard'];
  371. $record->newBank = $data['bank'];
  372. $record->newBankNetwork = $data['bankNetwork'];
  373. } else {
  374. $fields = array_filter(explode(",", $record->modify_fields));
  375. for ($i = 0; $i < count($fields); $i++) {
  376. $key = lcfirst(substr($fields[$i], 3));
  377. $record[$fields[$i]] = $data[$key]; //仅可修改选择的字段
  378. }
  379. }
  380. if (!$record["newImgurl"]) {
  381. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  382. $where = [];
  383. $where[] = ["mainId", "=", $record_id];
  384. $where[] = ["api", "=", "businessLicense"];
  385. $where[] = ["active", "=", 1];
  386. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  387. if ($_uploadFile) {
  388. $record["newImgurl"] = $_uploadFile["url"];
  389. } else {
  390. $record["newImgurl"] = $ep["imgurl"];
  391. }
  392. }
  393. }
  394. if (!$record["newBankImg"]) {
  395. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  396. $where = [];
  397. $where[] = ["mainId", "=", $record_id];
  398. $where[] = ["api", "=", "businessBank"];
  399. $where[] = ["active", "=", 1];
  400. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  401. if ($_uploadFile) {
  402. $record["newBankImg"] = $_uploadFile["url"];
  403. } else {
  404. $record["newBankImg"] = $ep["bankImg"];
  405. }
  406. }
  407. }
  408. if (!$record["newDomainImg"]) {
  409. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  410. $where = [];
  411. $where[] = ["mainId", "=", $record_id];
  412. $where[] = ["api", "=", "businessDomain"];
  413. $where[] = ["active", "=", 1];
  414. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  415. if ($_uploadFile) {
  416. $record["newDomainImg"] = $_uploadFile["url"];
  417. } else {
  418. $record["newDomainImg"] = $ep["domainImg"];
  419. }
  420. }
  421. }
  422. if (!$record["newBeian"]) {
  423. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  424. $where = [];
  425. $where[] = ["mainId", "=", $record_id];
  426. $where[] = ["api", "=", "businessBeian"];
  427. $where[] = ["active", "=", 1];
  428. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  429. if ($_uploadFile) {
  430. $record["newBeian"] = $_uploadFile["url"];
  431. } else {
  432. $record["newBeian"] = $ep["beian"];
  433. }
  434. }
  435. }
  436. $files = $this->request->file();
  437. if ($files) {
  438. $uploadapi = new UploadApi();
  439. $modify_files = array_filter(explode(",", $record->modify_files)); //["newImgurl", "newBankImg", "newDomainImg", "newTypeImg", "newBeian"];
  440. if (strtotime($record->createTime) < strtotime($this->compatible_time)) {
  441. //旧typeid需要转换成新的禁用文件格式
  442. $oldtypes = ["1161965644164075522" => "newImgurl", "1518753449987148467" => "newImgurl", "1518328155588131269" => "newBankImg", "1518926324960220206" => "newBankImg",
  443. "1518941016720463523" => "newDomainImg", "1519109971871948101" => "newBeian", "1519185486755815382" => "newBeian"];
  444. foreach ($modify_files as $key => $_typeId) {
  445. if ($oldtypes[$_typeId]) {
  446. $modify_files[$key] = $oldtypes[$_typeId];
  447. }
  448. }
  449. }
  450. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newImgurl", $modify_files)) ? true : false;
  451. if (array_key_exists('imgurl', $files) && $uploadAllowed) {
  452. $upload_result = $uploadapi->uploadOne($this->request->file('imgurl'), 'system');
  453. if ($upload_result->code == 500) {
  454. return \StrUtil::back($upload_result, "EpChangeEdit.callBack");
  455. }
  456. $record["newImgurl"] = $upload_result->filepath;
  457. }
  458. //检验附件 开户许可证
  459. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newBankImg", $modify_files)) ? true : false;
  460. if (array_key_exists('bankImg', $files) && $uploadAllowed) {
  461. $upload_result1 = $uploadapi->uploadOne($this->request->file('bankImg'), 'system');
  462. if ($upload_result1->code == 500) {
  463. return \StrUtil::back($upload_result1, "EpChangeEdit.callBack");
  464. }
  465. $record["newBankImg"] = $upload_result1->filepath;
  466. }
  467. //检验附件 行业领域佐证材料
  468. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newDomainImg", $modify_files)) ? true : false;
  469. if (array_key_exists('domainImg', $files) && $uploadAllowed) {
  470. $upload_result2 = $uploadapi->uploadOne($this->request->file('domainImg'), 'system');
  471. if ($upload_result2->code == 500) {
  472. return \StrUtil::back($upload_result2, "EpChangeEdit.callBack");
  473. }
  474. $record["newDomainImg"] = $upload_result2->filepath;
  475. }
  476. //检验附件 规上、高新技术、专精特新企业需要上传佐证材料
  477. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newTypeImg", $modify_files)) ? true : false;
  478. if (array_key_exists('typeImg', $files) && $uploadAllowed) {
  479. $upload_result4 = $uploadapi->uploadOne($this->request->file('typeImg'), 'system');
  480. if ($upload_result4->code == 500) {
  481. return \StrUtil::back($upload_result4, "EpChangeEdit.callBack");
  482. }
  483. $record["newTypeImg"] = $upload_result4->filepath;
  484. }
  485. //检验附件 人才联络员备案表
  486. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newBeian", $modify_files)) ? true : false;
  487. if (array_key_exists('beian', $files) && $uploadAllowed) {
  488. $upload_result3 = $uploadapi->uploadOne($this->request->file('beian'), 'system');
  489. if ($upload_result3->code == 500) {
  490. return \StrUtil::back($upload_result3, "EpChangeEdit.callBack");
  491. }
  492. $record["newBeian"] = $upload_result3->filepath;
  493. }
  494. }
  495. if (!$record["newImgurl"]) {
  496. throw new ValidateException("请上传营业执照");
  497. }
  498. if ($ep->special == 0) {
  499. if (!$record["newBankImg"]) {
  500. throw new ValidateException("请上传开户许可证/基本存款账户信息");
  501. }
  502. if ($ep->type == 1 && $data["agencyType"] == 1 && !$record["newDomainImg"]) {
  503. throw new ValidateException("请上传行业领域佐证材料");
  504. }
  505. if ($data["agencyType"] != 1) {
  506. $record["newDomainImg"] = null;
  507. }
  508. if (in_array($record->newEnterpriseType, ["guishang", "gaoxinjishu", "zhuanjingtexin"]) && !$record["newTypeImg"]) {
  509. throw new ValidateException("规上、高新技术、专精特新企业需要上传佐证材料");
  510. }
  511. if (!in_array($record->newEnterpriseType, ["guishang", "gaoxinjishu", "zhuanjingtexin"])) {
  512. $record["newTypeImg"] = null;
  513. }
  514. }
  515. if (!$record["newBeian"]) {
  516. throw new ValidateException("请上传人才联络员信息备案表");
  517. }
  518. $record->updateTime = date("Y-m-d H:i:s");
  519. $record->updateUser = session("user")["uid"];
  520. $record->save();
  521. $log = [
  522. 'id' => getStringId(),
  523. 'category' => 'enterprise_change',
  524. 'mainId' => '',
  525. 'type' => 10,
  526. 'active' => 1,
  527. 'state' => 1,
  528. 'step' => 100,
  529. 'stateChange' => '保存未提交',
  530. 'description' => '机构信息变更记录修改成功',
  531. 'createTime' => date("Y-m-d H:i:s", time()),
  532. 'createUser' => '用户'
  533. ];
  534. $success_msg = "修改成功";
  535. //$res = ['msg' => '修改成功', 'code' => 200, 'obj' => $record];
  536. }
  537. TalentChecklog::create($log);
  538. $response_object->id = $record_id;
  539. $response_object->code = 200;
  540. $response_object->msg = $success_msg;
  541. return \StrUtil::back($response_object, "EpChangeEdit.callBack");
  542. //return json($res);
  543. } catch (ValidateException $e) {
  544. $response_object->code = 500;
  545. $response_object->msg = is_array($e->getError()) ? implode("<br>", $e->getError()) : $e->getError();
  546. return \StrUtil::back($response_object, "EpChangeEdit.callBack");
  547. //return json(["msg" => array_pop($error), 'code' => 500]);
  548. }
  549. }
  550. public function toUpdate() {
  551. $id = trim($this->request['id']);
  552. $ecr = EnterpriseRecord::findOrEmpty($id);
  553. $ep = Enterprise::where('id', $ecr->mainId)->find();
  554. $ecr["special"] = $ep["special"];
  555. $time = $this->compatible_time;
  556. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  557. $_files = explode(",", $ecr["modify_files"]);
  558. $_new_files = [];
  559. foreach ($_files as $_file) {
  560. $where = [];
  561. $where[] = ["id", "=", $_file];
  562. $_filetype = CurrentcyFileType::where($where)->find();
  563. switch ($_filetype["api"]) {
  564. case "businessLicense":
  565. $_new_files[] = "newImgurl";
  566. break;
  567. case "businessBank";
  568. $_new_files[] = "newBankImg";
  569. break;
  570. case "businessDomain";
  571. $_new_files[] = "newDomainImg";
  572. break;
  573. case "businessBeian";
  574. $_new_files[] = "newBeian";
  575. break;
  576. default:
  577. $_new_files[] = $_file;
  578. break;
  579. }
  580. }
  581. $ecr["modify_files"] = implode(",", $_new_files);
  582. }
  583. //营业执照
  584. if (!$ecr["newImgurl"]) {
  585. //兼容旧filetype
  586. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  587. $where = [];
  588. $where[] = ["mainId", "=", $id];
  589. $where[] = ["api", "=", "businessLicense"];
  590. $where[] = ["active", "=", 1];
  591. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  592. if ($_uploadFile) {
  593. $ecr["newImgurl"] = $_uploadFile["url"];
  594. } else {
  595. $ecr["newImgurl"] = $ep["imgurl"];
  596. }
  597. }
  598. }
  599. if ($ecr["newImgurl"]) {
  600. $pathinfo = pathinfo($ecr["newImgurl"]);
  601. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  602. $ecr["imgurl_is_img"] = 1;
  603. }
  604. }
  605. //备案表
  606. if (!$ecr["newBeian"]) {
  607. //兼容旧filetype
  608. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  609. $where = [];
  610. $where[] = ["mainId", "=", $id];
  611. $where[] = ["api", "=", "businessBeian"];
  612. $where[] = ["active", "=", 1];
  613. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  614. if ($_uploadFile) {
  615. $ecr["newBeian"] = $_uploadFile["url"];
  616. } else {
  617. $ecr["newBeian"] = $ep["beian"];
  618. }
  619. }
  620. }
  621. if ($ecr["newBeian"]) {
  622. $pathinfo = pathinfo($ecr["newBeian"]);
  623. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  624. $ecr["beian_is_img"] = 1;
  625. }
  626. }
  627. //行业领域
  628. if (!$ecr["newDomainImg"]) {
  629. //兼容旧filetype
  630. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  631. $where = [];
  632. $where[] = ["mainId", "=", $id];
  633. $where[] = ["api", "=", "businessDomain"];
  634. $where[] = ["active", "=", 1];
  635. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  636. if ($_uploadFile) {
  637. $ecr["newDomainImg"] = $_uploadFile["url"];
  638. } else {
  639. $ecr["newDomainImg"] = $ep["domainImg"];
  640. }
  641. }
  642. }
  643. if ($ecr["newDomainImg"]) {
  644. $pathinfo = pathinfo($ecr["newDomainImg"]);
  645. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  646. $ecr["domainImg_is_img"] = 1;
  647. }
  648. }
  649. //规上、高新技术、专精特新企业需要上传佐证材料
  650. if ($ecr["newTypeImg"]) {
  651. $pathinfo = pathinfo($ecr["newTypeImg"]);
  652. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  653. $ecr["typeImg_is_img"] = 1;
  654. }
  655. }
  656. //开户许可证
  657. if (!$ecr["newBankImg"]) {
  658. //兼容旧filetype
  659. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  660. $where = [];
  661. $where[] = ["mainId", "=", $id];
  662. $where[] = ["api", "=", "businessBank"];
  663. $where[] = ["active", "=", 1];
  664. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  665. if ($_uploadFile) {
  666. $ecr["newBankImg"] = $_uploadFile["url"];
  667. } else {
  668. $ecr["newBankImg"] = $ep["bankImg"];
  669. }
  670. }
  671. }
  672. if ($ecr["newBankImg"]) {
  673. $pathinfo = pathinfo($ecr["newBankImg"]);
  674. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  675. $ecr["bankImg_is_img"] = 1;
  676. }
  677. }
  678. switch ($ep->special) {
  679. case 0:
  680. return view("", ['ecr' => $ecr]);
  681. break;
  682. case 1:
  683. return view("", ['ecr' => $ecr]);
  684. break;
  685. case 3:
  686. return view("", ['ecr' => $ecr]);
  687. break;
  688. default:
  689. break;
  690. }
  691. }
  692. public function submitToCheck() {
  693. $id = trim($this->request->post('id'));
  694. if (!$id) {
  695. return json(['msg' => '记录为空', 'code' => 500]);
  696. }
  697. $obj = EnterpriseRecord::find($id);
  698. if (!$obj) {
  699. return json(['msg' => '提交审核失败,请先填写基础信息', 'code' => 500]);
  700. }
  701. if ($obj['checkState'] != 1 && $obj['checkState'] != 3) {
  702. return json(['msg' => '不能重复提交审核', 'code' => 500]);
  703. }
  704. $ep = EnterpriseApi::getOne($obj->mainId);
  705. //20220918增加根据不同的企业类型显示不同的信息变更界面|20221014废弃使用filetype
  706. /* switch ($ep->special) {
  707. case 0:
  708. $org_type = 'enterpriseChange';
  709. break;
  710. case 1:
  711. $org_type = 'governmentChange';
  712. break;
  713. default:
  714. break;
  715. }
  716. $list = CurrentcyFileType::where('type', $org_type)->where('active', 1)->select();
  717. if (!$list || count($list) <= 0) {
  718. return json(['msg' => '缺少附件', 'code' => 500]);
  719. }
  720. $error_msg = "";
  721. foreach ($list as $k => $v) {
  722. if ($v['must'] == 1) {
  723. $count = TalentCommonFile::where('mainId', $id)->where('typeId', $v['id'])->count();
  724. if ($count == 0) {
  725. if (strlen($error_msg) == 0) {
  726. $error_msg = "以下为必传附件:";
  727. }
  728. $error_msg .= $v['name'] . ";";
  729. }
  730. }
  731. }
  732. if (strlen($error_msg) > 0) {
  733. return json(['msg' => $error_msg, 'code' => 500]);
  734. } */
  735. if ($obj['checkState'] == 3) {
  736. $obj['checkState'] = 5;
  737. $state = 5;
  738. } else {
  739. $obj['checkState'] = 2;
  740. $state = 2;
  741. }
  742. $obj->save();
  743. $log = [
  744. 'id' => getStringId(),
  745. 'category' => 'enterprise_change',
  746. 'mainId' => $id,
  747. 'type' => 10,
  748. 'active' => 1,
  749. 'state' => $state,
  750. 'step' => 100,
  751. 'stateChange' => "<span class='label'>待提交</span>-><span class='label label-success'>待审核</span>",
  752. 'description' => '提交审核',
  753. 'createTime' => date("Y-m-d H:i:s", time()),
  754. 'createUser' => '用户'
  755. ];
  756. TalentChecklog::create($log);
  757. return json(['msg' => '提交审核成功', 'code' => 200, 'obj' => 1]);
  758. }
  759. public function toDetail() {
  760. $id = trim($this->request['id']);
  761. if (!$id) {
  762. return json(['msg' => '记录为空', 'code' => 500]);
  763. }
  764. $ecr = EnterpriseRecord::find($id);
  765. $ep = EnterpriseApi::getOne($ecr['mainId']);
  766. $streetList = DictApi::selectByParentCode('street');
  767. $ecr["special"] = $ep["special"];
  768. $ecr['oldStreetName'] = $streetList[$ecr['oldStreet']];
  769. $ecr['newStreetName'] = $streetList[$ecr['newStreet']];
  770. //20220918增加根据不同的企业类型显示不同的信息变更界面
  771. $time = $this->compatible_time;
  772. //营业执照
  773. if (!$ecr["oldImgurl"]) {
  774. $ecr["oldImgurl"] = $ep["imgurl"];
  775. }
  776. if ($ecr["oldImgurl"]) {
  777. $pathinfo = pathinfo($ecr["oldImgurl"]);
  778. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  779. $ecr["oldImgurl_is_img"] = 1;
  780. }
  781. }
  782. if (!$ecr["newImgurl"]) {
  783. //兼容旧filetype
  784. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  785. $where = [];
  786. $where[] = ["mainId", "=", $id];
  787. $where[] = ["api", "=", "businessLicense"];
  788. $where[] = ["active", "=", 1];
  789. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  790. if ($_uploadFile) {
  791. $ecr["newImgurl"] = $_uploadFile["url"];
  792. } else {
  793. $ecr["newImgurl"] = $ep["imgurl"];
  794. }
  795. }
  796. }
  797. if ($ecr["newImgurl"]) {
  798. $pathinfo = pathinfo($ecr["newImgurl"]);
  799. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  800. $ecr["newImgurl_is_img"] = 1;
  801. }
  802. }
  803. //备案表
  804. if (!$ecr["oldBeian"]) {
  805. $ecr["oldBeian"] = $ep["beian"];
  806. }
  807. if ($ecr["oldBeian"]) {
  808. $pathinfo = pathinfo($ecr["oldBeian"]);
  809. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  810. $ecr["oldBeian_is_img"] = 1;
  811. }
  812. }
  813. if (!$ecr["newBeian"]) {
  814. //兼容旧filetype
  815. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  816. $where = [];
  817. $where[] = ["mainId", "=", $id];
  818. $where[] = ["api", "=", "businessBeian"];
  819. $where[] = ["active", "=", 1];
  820. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  821. if ($_uploadFile) {
  822. $ecr["newBeian"] = $_uploadFile["url"];
  823. } else {
  824. $ecr["newBeian"] = $ep["beian"];
  825. }
  826. }
  827. }
  828. if ($ecr["newBeian"]) {
  829. $pathinfo = pathinfo($ecr["newBeian"]);
  830. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  831. $ecr["newBeian_is_img"] = 1;
  832. }
  833. }
  834. //行业领域
  835. if (!$ecr["oldDomainImg"]) {
  836. $ecr["oldDomainImg"] = $ep["domainImg"];
  837. }
  838. if ($ecr["oldDomainImg"]) {
  839. $pathinfo = pathinfo($ecr["oldDomainImg"]);
  840. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  841. $ecr["oldDomainImg_is_img"] = 1;
  842. }
  843. }
  844. if (!$ecr["newDomainImg"]) {
  845. //兼容旧filetype
  846. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  847. $where = [];
  848. $where[] = ["mainId", "=", $id];
  849. $where[] = ["api", "=", "businessDomain"];
  850. $where[] = ["active", "=", 1];
  851. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  852. if ($_uploadFile) {
  853. $ecr["newDomainImg"] = $_uploadFile["url"];
  854. } else {
  855. $ecr["newDomainImg"] = $ep["domainImg"];
  856. }
  857. }
  858. }
  859. if ($ecr["newDomainImg"]) {
  860. $pathinfo = pathinfo($ecr["newDomainImg"]);
  861. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  862. $ecr["newDomainImg_is_img"] = 1;
  863. }
  864. }
  865. //规上、高新技术、专精特新企业需要上传佐证材料
  866. if ($ecr["oldTypeImg"]) {
  867. $pathinfo = pathinfo($ecr["oldTypeImg"]);
  868. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  869. $ecr["oldTypeImg_is_img"] = 1;
  870. }
  871. }
  872. if ($ecr["newTypeImg"]) {
  873. $pathinfo = pathinfo($ecr["newTypeImg"]);
  874. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  875. $ecr["newTypeImg_is_img"] = 1;
  876. }
  877. }
  878. //开户许可证
  879. if (!$ecr["oldBankImg"]) {
  880. $ecr["oldBankImg"] = $ep["bankImg"];
  881. }
  882. if ($ecr["oldBankImg"]) {
  883. $pathinfo = pathinfo($ecr["oldBankImg"]);
  884. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  885. $ecr["oldBankImg_is_img"] = 1;
  886. }
  887. }
  888. if (!$ecr["newBankImg"]) {
  889. //兼容旧filetype
  890. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  891. $where = [];
  892. $where[] = ["mainId", "=", $id];
  893. $where[] = ["api", "=", "businessBank"];
  894. $where[] = ["active", "=", 1];
  895. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  896. if ($_uploadFile) {
  897. $ecr["newBankImg"] = $_uploadFile["url"];
  898. } else {
  899. $ecr["newBankImg"] = $ep["bankImg"];
  900. }
  901. }
  902. }
  903. if ($ecr["newBankImg"]) {
  904. $pathinfo = pathinfo($ecr["newBankImg"]);
  905. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  906. $ecr["newBankImg_is_img"] = 1;
  907. }
  908. }
  909. switch ($ep->special) {
  910. case 0:
  911. $agencyTypeList = DictApi::selectByParentCode('agency_type');
  912. $tagList = DictApi::selectByParentCode('enterprise_tag');
  913. $typeList = DictApi::selectByParentCode('enterprise_type');
  914. $industryFieldNew = DictApi::selectByParentCode('industry_field');
  915. $industry = DictApi::findDictByCode($ecr['oldIndustryFieldOld']);
  916. $ecr['oldIndustryFieldOldName'] = $industry['name'];
  917. $industry = DictApi::findDictByCode($ecr['newIndustryFieldOld']);
  918. $ecr['newIndustryFieldOldName'] = $industry['name'];
  919. $ecr['oldEnterpriseTagName'] = $tagList[$ecr['oldEnterpriseTag']];
  920. $ecr['newEnterpriseTagName'] = $tagList[$ecr['newEnterpriseTag']];
  921. $ecr['oldEnterpriseTypeName'] = $typeList[$ecr['oldEnterpriseType']];
  922. $ecr['newEnterpriseTypeName'] = $typeList[$ecr['newEnterpriseType']];
  923. $ecr['oldIndustryFieldNewName'] = $industryFieldNew[$ecr['oldIndustryFieldNew']];
  924. $ecr['newIndustryFieldNewName'] = $industryFieldNew[$ecr['newIndustryFieldNew']];
  925. $ecr['oldAgencyTypeName'] = $agencyTypeList[$ecr['oldAgencyType']];
  926. $ecr['newAgencyTypeName'] = $agencyTypeList[$ecr['newAgencyType']];
  927. return view("", ['ecr' => $ecr]);
  928. break;
  929. case 1:
  930. $tagList = DictApi::selectByParentCode('institution_tag');
  931. $ecr['oldInstitutionTagName'] = $tagList[$ecr['oldInstitutionTag']];
  932. $ecr['newInstitutionTagName'] = $tagList[$ecr['newInstitutionTag']];
  933. return view("", ['ecr' => $ecr]);
  934. break;
  935. case 3:
  936. $tagList = DictApi::selectByParentCode('organization_tag');
  937. $ecr['oldOrganizationTagName'] = $tagList[$ecr['oldOrganizationTag']];
  938. $ecr['newOrganizationTagName'] = $tagList[$ecr['newOrganizationTag']];
  939. return view("", ['ecr' => $ecr]);
  940. break;
  941. default:
  942. break;
  943. }
  944. }
  945. }