Api.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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. /* 注释变更驳回如果恢复,这段要去掉 */
  375. $record->newAgencyType = $data['agencyType'];
  376. $record->newName = htmlspecialchars($data['name']);
  377. $record->newIdCard = htmlspecialchars($data['idCard']);
  378. if ($data["agencyType"] == 1) {
  379. $record->newIndustryFieldNew = $data['industryFieldNew'];
  380. $record->newIndustryFieldOld = $data['industryFieldOld'];
  381. } else {
  382. $record->newIndustryFieldNew = null;
  383. $record->newIndustryFieldOld = null;
  384. }
  385. $record->newStreet = $data['street'];
  386. $record->newAddress = $data['address'];
  387. $record->newLegal = $data['legal'];
  388. $record->newEphone = $data['ephone'];
  389. $record->newAgentName = $data['agentName'];
  390. $record->newAgentEmail = $data['agentEmail'];
  391. $record->newAgentPhone = $data['agentPhone'];
  392. $record->newEnterpriseTag = $data['enterpriseTag'];
  393. $record->newOrganizationTag = $data['organizationTag'];
  394. $record->newInstitutionTag = $data['institutionTag'];
  395. $record->newEnterpriseType = $data['enterpriseType'];
  396. $record->newBankCard = $data['bankCard'];
  397. $record->newBank = $data['bank'];
  398. $record->newBankNetwork = $data['bankNetwork'];
  399. /* 注释变更驳回如果恢复,这段要去掉 */
  400. /* 注释变更驳回$fields = array_filter(explode(",", $record->modify_fields));
  401. for ($i = 0; $i < count($fields); $i++) {
  402. $key = lcfirst(substr($fields[$i], 3));
  403. $record[$fields[$i]] = $data[$key]; //仅可修改选择的字段
  404. } */
  405. }
  406. if (!$record["newImgurl"]) {
  407. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  408. $where = [];
  409. $where[] = ["mainId", "=", $record_id];
  410. $where[] = ["api", "=", "businessLicense"];
  411. $where[] = ["active", "=", 1];
  412. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  413. if ($_uploadFile) {
  414. $record["newImgurl"] = $_uploadFile["url"];
  415. } else {
  416. $record["newImgurl"] = $ep["imgurl"];
  417. }
  418. }
  419. }
  420. if (!$record["newBankImg"]) {
  421. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  422. $where = [];
  423. $where[] = ["mainId", "=", $record_id];
  424. $where[] = ["api", "=", "businessBank"];
  425. $where[] = ["active", "=", 1];
  426. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  427. if ($_uploadFile) {
  428. $record["newBankImg"] = $_uploadFile["url"];
  429. } else {
  430. $record["newBankImg"] = $ep["bankImg"];
  431. }
  432. }
  433. }
  434. if (!$record["newDomainImg"]) {
  435. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  436. $where = [];
  437. $where[] = ["mainId", "=", $record_id];
  438. $where[] = ["api", "=", "businessDomain"];
  439. $where[] = ["active", "=", 1];
  440. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  441. if ($_uploadFile) {
  442. $record["newDomainImg"] = $_uploadFile["url"];
  443. } else {
  444. $record["newDomainImg"] = $ep["domainImg"];
  445. }
  446. }
  447. }
  448. if (!$record["newBeian"]) {
  449. if (strtotime($record["createTime"]) < strtotime($this->compatible_time)) {
  450. $where = [];
  451. $where[] = ["mainId", "=", $record_id];
  452. $where[] = ["api", "=", "businessBeian"];
  453. $where[] = ["active", "=", 1];
  454. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  455. if ($_uploadFile) {
  456. $record["newBeian"] = $_uploadFile["url"];
  457. } else {
  458. $record["newBeian"] = $ep["beian"];
  459. }
  460. }
  461. }
  462. $files = $this->request->file();
  463. if ($files) {
  464. $uploadapi = new UploadApi();
  465. //注释变更驳回$modify_files = array_filter(explode(",", $record->modify_files));
  466. $modify_files = ["newImgurl", "newBankImg", "newDomainImg", "newTypeImg", "newBeian"];
  467. if (strtotime($record->createTime) < strtotime($this->compatible_time)) {
  468. //旧typeid需要转换成新的禁用文件格式
  469. $oldtypes = ["1161965644164075522" => "newImgurl", "1518753449987148467" => "newImgurl", "1518328155588131269" => "newBankImg", "1518926324960220206" => "newBankImg",
  470. "1518941016720463523" => "newDomainImg", "1519109971871948101" => "newBeian", "1519185486755815382" => "newBeian"];
  471. foreach ($modify_files as $key => $_typeId) {
  472. if ($oldtypes[$_typeId]) {
  473. $modify_files[$key] = $oldtypes[$_typeId];
  474. }
  475. }
  476. }
  477. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newImgurl", $modify_files)) ? true : false;
  478. if (array_key_exists('imgurl', $files) && $uploadAllowed) {
  479. $upload_result = $uploadapi->uploadOne($this->request->file('imgurl'), 'system');
  480. if ($upload_result->code == 500) {
  481. return \StrUtil::back($upload_result, "EpChangeEdit.callBack");
  482. }
  483. $record["newImgurl"] = $upload_result->filepath;
  484. }
  485. //检验附件 开户许可证
  486. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newBankImg", $modify_files)) ? true : false;
  487. if (array_key_exists('bankImg', $files) && $uploadAllowed) {
  488. $upload_result1 = $uploadapi->uploadOne($this->request->file('bankImg'), 'system');
  489. if ($upload_result1->code == 500) {
  490. return \StrUtil::back($upload_result1, "EpChangeEdit.callBack");
  491. }
  492. $record["newBankImg"] = $upload_result1->filepath;
  493. }
  494. //检验附件 行业领域佐证材料
  495. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newDomainImg", $modify_files)) ? true : false;
  496. if (array_key_exists('domainImg', $files) && $uploadAllowed) {
  497. $upload_result2 = $uploadapi->uploadOne($this->request->file('domainImg'), 'system');
  498. if ($upload_result2->code == 500) {
  499. return \StrUtil::back($upload_result2, "EpChangeEdit.callBack");
  500. }
  501. $record["newDomainImg"] = $upload_result2->filepath;
  502. }
  503. //检验附件 规上、高新技术、专精特新企业需要上传佐证材料
  504. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newTypeImg", $modify_files)) ? true : false;
  505. if (array_key_exists('typeImg', $files) && $uploadAllowed) {
  506. $upload_result4 = $uploadapi->uploadOne($this->request->file('typeImg'), 'system');
  507. if ($upload_result4->code == 500) {
  508. return \StrUtil::back($upload_result4, "EpChangeEdit.callBack");
  509. }
  510. $record["newTypeImg"] = $upload_result4->filepath;
  511. }
  512. //检验附件 人才联络员备案表
  513. $uploadAllowed = $record->checkState == 1 || ($record->checkState != 1 && in_array("newBeian", $modify_files)) ? true : false;
  514. if (array_key_exists('beian', $files) && $uploadAllowed) {
  515. $upload_result3 = $uploadapi->uploadOne($this->request->file('beian'), 'system');
  516. if ($upload_result3->code == 500) {
  517. return \StrUtil::back($upload_result3, "EpChangeEdit.callBack");
  518. }
  519. $record["newBeian"] = $upload_result3->filepath;
  520. }
  521. }
  522. if (!$record["newImgurl"]) {
  523. throw new ValidateException("请上传营业执照");
  524. }
  525. if ($ep->special == 0) {
  526. if (!$record["newBankImg"]) {
  527. throw new ValidateException("请上传开户许可证/基本存款账户信息");
  528. }
  529. if ($ep->type == 1 && $data["agencyType"] == 1 && !$record["newDomainImg"]) {
  530. throw new ValidateException("请上传行业领域佐证材料");
  531. }
  532. if ($data["agencyType"] != 1) {
  533. $record["newDomainImg"] = null;
  534. }
  535. if (in_array($record->newEnterpriseType, ["guishang", "gaoxinjishu", "zhuanjingtexin"]) && !$record["newTypeImg"]) {
  536. throw new ValidateException("规上、高新技术、专精特新企业需要上传佐证材料");
  537. }
  538. if (!in_array($record->newEnterpriseType, ["guishang", "gaoxinjishu", "zhuanjingtexin"])) {
  539. $record["newTypeImg"] = null;
  540. }
  541. }
  542. if (!$record["newBeian"]) {
  543. throw new ValidateException("请上传人才联络员信息备案表");
  544. }
  545. $record->updateTime = date("Y-m-d H:i:s");
  546. $record->updateUser = session("user")["uid"];
  547. $record->save();
  548. $log = [
  549. 'id' => getStringId(),
  550. 'category' => 'enterprise_change',
  551. 'mainId' => '',
  552. 'type' => 10,
  553. 'active' => 1,
  554. 'state' => 1,
  555. 'step' => 100,
  556. 'stateChange' => '保存未提交',
  557. 'description' => '机构信息变更记录修改成功',
  558. 'createTime' => date("Y-m-d H:i:s", time()),
  559. 'createUser' => '用户'
  560. ];
  561. $success_msg = "修改成功";
  562. //$res = ['msg' => '修改成功', 'code' => 200, 'obj' => $record];
  563. }
  564. TalentChecklog::create($log);
  565. $response_object->id = $record_id;
  566. $response_object->code = 200;
  567. $response_object->msg = $success_msg;
  568. return \StrUtil::back($response_object, "EpChangeEdit.callBack");
  569. //return json($res);
  570. } catch (ValidateException $e) {
  571. $response_object->code = 500;
  572. $response_object->msg = is_array($e->getError()) ? implode("<br>", $e->getError()) : $e->getError();
  573. return \StrUtil::back($response_object, "EpChangeEdit.callBack");
  574. //return json(["msg" => array_pop($error), 'code' => 500]);
  575. }
  576. }
  577. public function toUpdate() {
  578. $id = trim($this->request['id']);
  579. $ecr = EnterpriseRecord::findOrEmpty($id);
  580. $ep = Enterprise::where('id', $ecr->mainId)->find();
  581. $ecr["special"] = $ep["special"];
  582. $time = $this->compatible_time;
  583. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  584. $_files = explode(",", $ecr["modify_files"]);
  585. $_new_files = [];
  586. foreach ($_files as $_file) {
  587. $where = [];
  588. $where[] = ["id", "=", $_file];
  589. $_filetype = CurrentcyFileType::where($where)->find();
  590. switch ($_filetype["api"]) {
  591. case "businessLicense":
  592. $_new_files[] = "newImgurl";
  593. break;
  594. case "businessBank";
  595. $_new_files[] = "newBankImg";
  596. break;
  597. case "businessDomain";
  598. $_new_files[] = "newDomainImg";
  599. break;
  600. case "businessBeian";
  601. $_new_files[] = "newBeian";
  602. break;
  603. default:
  604. $_new_files[] = $_file;
  605. break;
  606. }
  607. }
  608. $ecr["modify_files"] = implode(",", $_new_files);
  609. }
  610. //营业执照
  611. if (!$ecr["newImgurl"]) {
  612. //兼容旧filetype
  613. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  614. $where = [];
  615. $where[] = ["mainId", "=", $id];
  616. $where[] = ["api", "=", "businessLicense"];
  617. $where[] = ["active", "=", 1];
  618. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  619. if ($_uploadFile) {
  620. $ecr["newImgurl"] = $_uploadFile["url"];
  621. } else {
  622. $ecr["newImgurl"] = $ep["imgurl"];
  623. }
  624. }
  625. }
  626. if ($ecr["newImgurl"]) {
  627. $pathinfo = pathinfo($ecr["newImgurl"]);
  628. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  629. $ecr["imgurl_is_img"] = 1;
  630. }
  631. }
  632. //备案表
  633. if (!$ecr["newBeian"]) {
  634. //兼容旧filetype
  635. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  636. $where = [];
  637. $where[] = ["mainId", "=", $id];
  638. $where[] = ["api", "=", "businessBeian"];
  639. $where[] = ["active", "=", 1];
  640. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  641. if ($_uploadFile) {
  642. $ecr["newBeian"] = $_uploadFile["url"];
  643. } else {
  644. $ecr["newBeian"] = $ep["beian"];
  645. }
  646. }
  647. }
  648. if ($ecr["newBeian"]) {
  649. $pathinfo = pathinfo($ecr["newBeian"]);
  650. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  651. $ecr["beian_is_img"] = 1;
  652. }
  653. }
  654. //行业领域
  655. if (!$ecr["newDomainImg"]) {
  656. //兼容旧filetype
  657. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  658. $where = [];
  659. $where[] = ["mainId", "=", $id];
  660. $where[] = ["api", "=", "businessDomain"];
  661. $where[] = ["active", "=", 1];
  662. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  663. if ($_uploadFile) {
  664. $ecr["newDomainImg"] = $_uploadFile["url"];
  665. } else {
  666. $ecr["newDomainImg"] = $ep["domainImg"];
  667. }
  668. }
  669. }
  670. if ($ecr["newDomainImg"]) {
  671. $pathinfo = pathinfo($ecr["newDomainImg"]);
  672. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  673. $ecr["domainImg_is_img"] = 1;
  674. }
  675. }
  676. //规上、高新技术、专精特新企业需要上传佐证材料
  677. if ($ecr["newTypeImg"]) {
  678. $pathinfo = pathinfo($ecr["newTypeImg"]);
  679. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  680. $ecr["typeImg_is_img"] = 1;
  681. }
  682. }
  683. //开户许可证
  684. if (!$ecr["newBankImg"]) {
  685. //兼容旧filetype
  686. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  687. $where = [];
  688. $where[] = ["mainId", "=", $id];
  689. $where[] = ["api", "=", "businessBank"];
  690. $where[] = ["active", "=", 1];
  691. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  692. if ($_uploadFile) {
  693. $ecr["newBankImg"] = $_uploadFile["url"];
  694. } else {
  695. $ecr["newBankImg"] = $ep["bankImg"];
  696. }
  697. }
  698. }
  699. if ($ecr["newBankImg"]) {
  700. $pathinfo = pathinfo($ecr["newBankImg"]);
  701. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  702. $ecr["bankImg_is_img"] = 1;
  703. }
  704. }
  705. switch ($ep->special) {
  706. case 0:
  707. return view("", ['ecr' => $ecr]);
  708. break;
  709. case 1:
  710. return view("", ['ecr' => $ecr]);
  711. break;
  712. case 3:
  713. return view("", ['ecr' => $ecr]);
  714. break;
  715. default:
  716. break;
  717. }
  718. }
  719. public function submitToCheck() {
  720. $id = trim($this->request->post('id'));
  721. if (!$id) {
  722. return json(['msg' => '记录为空', 'code' => 500]);
  723. }
  724. $obj = EnterpriseRecord::find($id);
  725. if (!$obj) {
  726. return json(['msg' => '提交审核失败,请先填写基础信息', 'code' => 500]);
  727. }
  728. if ($obj['checkState'] != 1 && $obj['checkState'] != 3) {
  729. return json(['msg' => '不能重复提交审核', 'code' => 500]);
  730. }
  731. $ep = EnterpriseApi::getOne($obj->mainId);
  732. //20220918增加根据不同的企业类型显示不同的信息变更界面|20221014废弃使用filetype
  733. /* switch ($ep->special) {
  734. case 0:
  735. $org_type = 'enterpriseChange';
  736. break;
  737. case 1:
  738. $org_type = 'governmentChange';
  739. break;
  740. default:
  741. break;
  742. }
  743. $list = CurrentcyFileType::where('type', $org_type)->where('active', 1)->select();
  744. if (!$list || count($list) <= 0) {
  745. return json(['msg' => '缺少附件', 'code' => 500]);
  746. }
  747. $error_msg = "";
  748. foreach ($list as $k => $v) {
  749. if ($v['must'] == 1) {
  750. $count = TalentCommonFile::where('mainId', $id)->where('typeId', $v['id'])->count();
  751. if ($count == 0) {
  752. if (strlen($error_msg) == 0) {
  753. $error_msg = "以下为必传附件:";
  754. }
  755. $error_msg .= $v['name'] . ";";
  756. }
  757. }
  758. }
  759. if (strlen($error_msg) > 0) {
  760. return json(['msg' => $error_msg, 'code' => 500]);
  761. } */
  762. if ($obj['checkState'] == 3) {
  763. $obj['checkState'] = 5;
  764. $state = 5;
  765. } else {
  766. $obj['checkState'] = 2;
  767. $state = 2;
  768. }
  769. $obj->save();
  770. $log = [
  771. 'id' => getStringId(),
  772. 'category' => 'enterprise_change',
  773. 'mainId' => $id,
  774. 'type' => 10,
  775. 'active' => 1,
  776. 'state' => $state,
  777. 'step' => 100,
  778. 'stateChange' => "<span class='label'>待提交</span>-><span class='label label-success'>待审核</span>",
  779. 'description' => '提交审核',
  780. 'createTime' => date("Y-m-d H:i:s", time()),
  781. 'createUser' => '用户'
  782. ];
  783. TalentChecklog::create($log);
  784. return json(['msg' => '提交审核成功', 'code' => 200, 'obj' => 1]);
  785. }
  786. public function toDetail() {
  787. $id = trim($this->request['id']);
  788. if (!$id) {
  789. return json(['msg' => '记录为空', 'code' => 500]);
  790. }
  791. $ecr = EnterpriseRecord::find($id);
  792. $ep = EnterpriseApi::getOne($ecr['mainId']);
  793. $streetList = DictApi::selectByParentCode('street');
  794. $ecr["special"] = $ep["special"];
  795. $ecr['oldStreetName'] = $streetList[$ecr['oldStreet']];
  796. $ecr['newStreetName'] = $streetList[$ecr['newStreet']];
  797. //20220918增加根据不同的企业类型显示不同的信息变更界面
  798. $time = $this->compatible_time;
  799. //营业执照
  800. if (!$ecr["oldImgurl"]) {
  801. $ecr["oldImgurl"] = $ep["imgurl"];
  802. }
  803. if ($ecr["oldImgurl"]) {
  804. $pathinfo = pathinfo($ecr["oldImgurl"]);
  805. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  806. $ecr["oldImgurl_is_img"] = 1;
  807. }
  808. }
  809. if (!$ecr["newImgurl"]) {
  810. //兼容旧filetype
  811. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  812. $where = [];
  813. $where[] = ["mainId", "=", $id];
  814. $where[] = ["api", "=", "businessLicense"];
  815. $where[] = ["active", "=", 1];
  816. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  817. if ($_uploadFile) {
  818. $ecr["newImgurl"] = $_uploadFile["url"];
  819. } else {
  820. $ecr["newImgurl"] = $ep["imgurl"];
  821. }
  822. }
  823. }
  824. if ($ecr["newImgurl"]) {
  825. $pathinfo = pathinfo($ecr["newImgurl"]);
  826. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  827. $ecr["newImgurl_is_img"] = 1;
  828. }
  829. }
  830. //备案表
  831. if (!$ecr["oldBeian"]) {
  832. $ecr["oldBeian"] = $ep["beian"];
  833. }
  834. if ($ecr["oldBeian"]) {
  835. $pathinfo = pathinfo($ecr["oldBeian"]);
  836. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  837. $ecr["oldBeian_is_img"] = 1;
  838. }
  839. }
  840. if (!$ecr["newBeian"]) {
  841. //兼容旧filetype
  842. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  843. $where = [];
  844. $where[] = ["mainId", "=", $id];
  845. $where[] = ["api", "=", "businessBeian"];
  846. $where[] = ["active", "=", 1];
  847. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  848. if ($_uploadFile) {
  849. $ecr["newBeian"] = $_uploadFile["url"];
  850. } else {
  851. $ecr["newBeian"] = $ep["beian"];
  852. }
  853. }
  854. }
  855. if ($ecr["newBeian"]) {
  856. $pathinfo = pathinfo($ecr["newBeian"]);
  857. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  858. $ecr["newBeian_is_img"] = 1;
  859. }
  860. }
  861. //行业领域
  862. if (!$ecr["oldDomainImg"]) {
  863. $ecr["oldDomainImg"] = $ep["domainImg"];
  864. }
  865. if ($ecr["oldDomainImg"]) {
  866. $pathinfo = pathinfo($ecr["oldDomainImg"]);
  867. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  868. $ecr["oldDomainImg_is_img"] = 1;
  869. }
  870. }
  871. if (!$ecr["newDomainImg"]) {
  872. //兼容旧filetype
  873. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  874. $where = [];
  875. $where[] = ["mainId", "=", $id];
  876. $where[] = ["api", "=", "businessDomain"];
  877. $where[] = ["active", "=", 1];
  878. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  879. if ($_uploadFile) {
  880. $ecr["newDomainImg"] = $_uploadFile["url"];
  881. } else {
  882. $ecr["newDomainImg"] = $ep["domainImg"];
  883. }
  884. }
  885. }
  886. if ($ecr["newDomainImg"]) {
  887. $pathinfo = pathinfo($ecr["newDomainImg"]);
  888. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  889. $ecr["newDomainImg_is_img"] = 1;
  890. }
  891. }
  892. //规上、高新技术、专精特新企业需要上传佐证材料
  893. if ($ecr["oldTypeImg"]) {
  894. $pathinfo = pathinfo($ecr["oldTypeImg"]);
  895. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  896. $ecr["oldTypeImg_is_img"] = 1;
  897. }
  898. }
  899. if ($ecr["newTypeImg"]) {
  900. $pathinfo = pathinfo($ecr["newTypeImg"]);
  901. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  902. $ecr["newTypeImg_is_img"] = 1;
  903. }
  904. }
  905. //开户许可证
  906. if (!$ecr["oldBankImg"]) {
  907. $ecr["oldBankImg"] = $ep["bankImg"];
  908. }
  909. if ($ecr["oldBankImg"]) {
  910. $pathinfo = pathinfo($ecr["oldBankImg"]);
  911. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  912. $ecr["oldBankImg_is_img"] = 1;
  913. }
  914. }
  915. if (!$ecr["newBankImg"]) {
  916. //兼容旧filetype
  917. if (strtotime($ecr["createTime"]) < strtotime($time)) {
  918. $where = [];
  919. $where[] = ["mainId", "=", $id];
  920. $where[] = ["api", "=", "businessBank"];
  921. $where[] = ["active", "=", 1];
  922. $_uploadFile = TalentCommonFile::alias("tcf")->leftJoin("new_currency_filetype ft", "ft.id=tcf.typeId")->where($where)->order("tcf.createTime desc")->find();
  923. if ($_uploadFile) {
  924. $ecr["newBankImg"] = $_uploadFile["url"];
  925. } else {
  926. $ecr["newBankImg"] = $ep["bankImg"];
  927. }
  928. }
  929. }
  930. if ($ecr["newBankImg"]) {
  931. $pathinfo = pathinfo($ecr["newBankImg"]);
  932. if (in_array($pathinfo["extension"], ["jpeg", "jpg", "png", "gif"])) {
  933. $ecr["newBankImg_is_img"] = 1;
  934. }
  935. }
  936. switch ($ep->special) {
  937. case 0:
  938. $agencyTypeList = DictApi::selectByParentCode('agency_type');
  939. $tagList = DictApi::selectByParentCode('enterprise_tag');
  940. $typeList = DictApi::selectByParentCode('enterprise_type');
  941. $industryFieldNew = DictApi::selectByParentCode('industry_field');
  942. $industry = DictApi::findDictByCode($ecr['oldIndustryFieldOld']);
  943. $ecr['oldIndustryFieldOldName'] = $industry['name'];
  944. $industry = DictApi::findDictByCode($ecr['newIndustryFieldOld']);
  945. $ecr['newIndustryFieldOldName'] = $industry['name'];
  946. $ecr['oldEnterpriseTagName'] = $tagList[$ecr['oldEnterpriseTag']];
  947. $ecr['newEnterpriseTagName'] = $tagList[$ecr['newEnterpriseTag']];
  948. $ecr['oldEnterpriseTypeName'] = $typeList[$ecr['oldEnterpriseType']];
  949. $ecr['newEnterpriseTypeName'] = $typeList[$ecr['newEnterpriseType']];
  950. $ecr['oldIndustryFieldNewName'] = $industryFieldNew[$ecr['oldIndustryFieldNew']];
  951. $ecr['newIndustryFieldNewName'] = $industryFieldNew[$ecr['newIndustryFieldNew']];
  952. $ecr['oldAgencyTypeName'] = $agencyTypeList[$ecr['oldAgencyType']];
  953. $ecr['newAgencyTypeName'] = $agencyTypeList[$ecr['newAgencyType']];
  954. return view("", ['ecr' => $ecr]);
  955. break;
  956. case 1:
  957. $tagList = DictApi::selectByParentCode('institution_tag');
  958. $ecr['oldInstitutionTagName'] = $tagList[$ecr['oldInstitutionTag']];
  959. $ecr['newInstitutionTagName'] = $tagList[$ecr['newInstitutionTag']];
  960. return view("", ['ecr' => $ecr]);
  961. break;
  962. case 3:
  963. $tagList = DictApi::selectByParentCode('organization_tag');
  964. $ecr['oldOrganizationTagName'] = $tagList[$ecr['oldOrganizationTag']];
  965. $ecr['newOrganizationTagName'] = $tagList[$ecr['newOrganizationTag']];
  966. return view("", ['ecr' => $ecr]);
  967. break;
  968. default:
  969. break;
  970. }
  971. }
  972. }