Api.php 47 KB

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