TestController.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <?php
  2. namespace console\controllers;
  3. use common\models\AccidentCases;
  4. use common\models\BaseUser;
  5. use common\models\EventSourceData;
  6. use common\models\Staff;
  7. use common\services\AccidentCasesDimensionService;
  8. use common\services\AccidentCasesScoreService;
  9. use common\services\EmergencyResponseDimensionService;
  10. use common\services\EmergencyResponseService;
  11. use common\services\OperationalAdjustmentsDimensionService;
  12. use common\services\OperationalAdjustmentsService;
  13. use Exception;
  14. use yii\console\Controller;
  15. class TestController extends Controller
  16. {
  17. public function actionPathUrlEncode()
  18. {
  19. /** @var EventSourceData[] $list */
  20. $list = EventSourceData::find()->all();
  21. foreach ($list as $value) {
  22. // $fileName = Upload::trimSpace($value->file_name);
  23. $fileName = $value->file_name;
  24. $fileName = rawurlencode($fileName);
  25. $value->url = "/uploads/case/{$value->accident_id}/{$fileName}";
  26. $value->save();
  27. }
  28. echo "ok";
  29. }
  30. protected function initDimension()
  31. {
  32. $dictionaryIdList = AccidentCasesScoreService::getContentDictionaryIdList();
  33. /** @var AccidentCases[] $AccidentCasesList */
  34. $AccidentCasesList = AccidentCases::find()->all();
  35. foreach ($AccidentCasesList as $AccidentCases) {
  36. //初始化评价维度
  37. AccidentCasesDimensionService::initContent($AccidentCases->id, $dictionaryIdList);
  38. }
  39. $EmergencyResponseList = EmergencyResponseService::getEmergencyResponseQuery()->all();
  40. foreach ($EmergencyResponseList as $EmergencyResponse) {
  41. EmergencyResponseDimensionService::add($EmergencyResponse);
  42. }
  43. $OperationalAdjustmentsList = OperationalAdjustmentsService::getQuery()->all();
  44. foreach ($OperationalAdjustmentsList as $OperationalAdjustments) {
  45. OperationalAdjustmentsDimensionService::add($OperationalAdjustments);
  46. }
  47. }
  48. public function actionAddUser()
  49. {
  50. set_time_limit(0);
  51. $listInfo = [
  52. ["质量安全部", "王培臣", "01020001791", "3"],
  53. ["技术业务部", "钱进", "01000000236", "3"],
  54. ["技术业务部", "李瑜芬", "01000000043", "3"],
  55. ["技术业务部", "曹耘文", "01000000702", "3"],
  56. ["技术业务部", "陈丽萍", "01000000378", "3"],
  57. ["技术业务部", "谢璟捷", "01000000200", "3"],
  58. ["技术业务部", "陆峥嵘", "01004000040", "3"],
  59. ["技术业务部", "方铖", "01000000764", "3"],
  60. ["技术业务部", "靳笑楠", "01000000718", "3"],
  61. ["技术业务部", "史若愚", "01000000280", "3"],
  62. ["技术业务部", "张宇峰", "01040004671", "2"],
  63. ["技术业务部", "刘静", "01000000694", "3"],
  64. ["调度指挥部", "庄毅华", "01000000207", "3"],
  65. ["调度指挥部", "李文俊", "01000000226", "3"],
  66. ["调度指挥部", "张浩", "01000000198", "3"],
  67. ["调度指挥部", "王晨", "01000000447", "3"],
  68. ["调度指挥部", "朱伟", "01000000424", "3"],
  69. ["调度指挥部", "麦金", "01000000376", "3"],
  70. ["调度指挥部", "许有骞", "01000000152", "3"],
  71. ["调度指挥部", "刘晓靓", "01000000296", "3"],
  72. ["调度指挥部", "朱辰天", "01000000298", "3"],
  73. ["调度指挥部", "海洋", "01000000217", "3"],
  74. ["调度指挥部", "陈华", "01000000356", "3"],
  75. ["调度指挥部", "王琦", "01000000324", "3"],
  76. ["调度指挥部", "康伟", "01000000095", "3"],
  77. ["调度指挥部", "孙依琳", "01000000511", "3"],
  78. ["隆德OCC", "嵇雪静", "01000000379", "3"],
  79. ["隆德OCC", "俞新辉", "01000000366", "3"],
  80. ["隆德OCC", "浦雯强", "01000000153", "3"],
  81. ["隆德OCC", "陈俊", "01000000316", "3"],
  82. ["隆德OCC", "邱炯", "01020002820", "3"],
  83. ["隆德OCC", "尹建伟", "01020001877", "3"],
  84. ["隆德OCC", "傅瑜杰", "01040000504", "3"],
  85. ["隆德OCC", "江裕丰", "01000000121", "3"],
  86. ["隆德OCC", "陶文彬", "01000000122", "3"],
  87. ["隆德OCC", "朱慬峰", "01000000275", "2"],
  88. ["隆德OCC", "张海钢", "01000000289", "2"],
  89. ["隆德OCC", "杨斐", "01000000096", "2"],
  90. ["隆德OCC", "康宁", "01000000411", "2"],
  91. ["隆德OCC", "彭贵兰", "01000000452", "2"],
  92. ["隆德OCC", "吴俊", "01000000216", "2"],
  93. ["隆德OCC", "王誉辰", "01000000495", "2"],
  94. ["隆德OCC", "陈志钧", "01000000097", "2"],
  95. ["隆德OCC", "董猛", "01000000104", "2"],
  96. ["隆德OCC", "黄文佳", "01040000915", "2"],
  97. ["隆德OCC", "朱家麟", "01000000677", "2"],
  98. ["隆德OCC", "张伟", "01000000337", "2"],
  99. ["隆德OCC", "沈华", "01000000348", "2"],
  100. ["隆德OCC", "陈国荣", "01000000078", "2"],
  101. ["隆德OCC", "张宇峰", "01040004671", "2"],
  102. ["隆德OCC", "宗瑜敏", "01040000750", "2"],
  103. ["隆德OCC", "蒋威", "01030001151", "2"],
  104. ["隆德OCC", "赵祺晶", "01000000500", "2"],
  105. ["隆德OCC", "赵意", "01040001084", "2"],
  106. ["隆德OCC", "金振鑫", "01030000849", "2"],
  107. ["隆德OCC", "赵斐", "01000000499", "2"],
  108. ["隆德OCC", "孙静雯", "01020002473", "2"],
  109. ["隆德OCC", "金孝宗", "01000000189", "2"],
  110. ["隆德OCC", "俞浩", "01030001579", "2"],
  111. ["隆德OCC", "吴龚杰", "01050001204", "2"],
  112. ["隆德OCC", "陈成", "01050000292", "2"],
  113. ["隆德OCC", "吕琛佳", "01040000725", "2"],
  114. ["隆德OCC", "沈自强", "01030000370", "2"],
  115. ["隆德OCC", "潘皆", "01030001813", "2"],
  116. ["隆德OCC", "袁嘉玺", "01030000767", "2"],
  117. ["隆德OCC", "吕量", "01000000489", "2"],
  118. ["隆德OCC", "李晓冬", "01040000347", "2"],
  119. ["隆德OCC", "喻浏玮", "01040001425", "2"],
  120. ["隆德OCC", "叶臻敏", "01040001074", "2"],
  121. ["隆德OCC", "陈昱栋", "01020001849", "2"],
  122. ["隆德OCC", "许勇", "01010000652", "2"],
  123. ["隆德OCC", "高宇峰", "01040000381", "2"],
  124. ["隆德OCC", "张健盛", "01020003445", "2"],
  125. ["隆德OCC", "瞿俊杰", "01000000079", "2"],
  126. ["隆德OCC", "姒一鸣", "01000000088", "2"],
  127. ["隆德OCC", "汪洋", "01000000088", "2"],
  128. ["隆德OCC", "冯路", "01020002757", "2"],
  129. ["隆德OCC", "陈煜璿", "01000000084", "2"],
  130. ["隆德OCC", "金烈", "01010005363", "2"],
  131. ["隆德OCC", "蔡巍强", "01000000633", "2"],
  132. ["隆德OCC", "杨鸣", "01030000419", "2"],
  133. ["隆德OCC", "徐骥", "01010005731", "2"],
  134. ["隆德OCC", "陈芝炘", "01010004886", "2"],
  135. ["隆德OCC", "顾超", "01000000156", "2"],
  136. ["隆德OCC", "孙荣鸣", "01010005375", "2"],
  137. ["隆德OCC", "张杰", "01000000632", "2"],
  138. ["隆德OCC", "张子翼", "01010005070", "2"],
  139. ["隆德OCC", "郁坤", "01010005730", "2"],
  140. ["隆德OCC", "张磊", "01010009368", "2"],
  141. ["隆德OCC", "倪雯婷", "01020002733", "2"],
  142. ["隆德OCC", "于国强", "01000000708", "2"],
  143. ["隆德OCC", "周琦峰", "01010009585", "2"],
  144. ["隆德OCC", "王毅超", "01010009506", "2"],
  145. ["隆德OCC", "倪庆", "01010004705", "2"],
  146. ["隆德OCC", "陈佳敏", "01010004866", "2"],
  147. ["隆德OCC", "张琛", "01010000417", "2"],
  148. ["隆德OCC", "胡佳炜", "01030001677", "2"],
  149. ["隆德OCC", "肖雄", "01020007031", "2"],
  150. ["隆德OCC", "许琳鹤", "01020001866", "2"],
  151. ["隆德OCC", "王真豪", "01010005651", "2"],
  152. ["隆德OCC", "朱鸿", "01030000774", "2"],
  153. ["隆德OCC", "薛至罡", "01020003661", "2"],
  154. ["隆德OCC", "翟鑫鸿", "01050004443", "2"],
  155. ["隆德OCC", "刘嘉骏", "01000000746", "2"],
  156. ["隆德OCC", "刘罡", "01030004261", "2"],
  157. ["隆德OCC", "丁宸", "01030001244", "2"],
  158. ["隆德OCC", "冯慈君", "01030000756", "2"],
  159. ["隆德OCC", "黄黎敏", "01030000229", "2"],
  160. ["隆德OCC", "沈大卫", "01030001248", "2"],
  161. ["隆德OCC", "蒋昊磊", "01030001619", "2"],
  162. ["隆德OCC", "李腾", "01030000320", "2"],
  163. ["隆德OCC", "李淼淼", "01000000113", "2"],
  164. ["新闸", "朱晔炜", "01000000169", "3"],
  165. ["新闸", "郑浒钢", "01000000143", "3"],
  166. ["新闸", "高叶民", "01000000106", "3"],
  167. ["新闸", "唐珊寅", "01000000345", "3"],
  168. ["新闸", "杨超", "01010005750", "3"],
  169. ["新闸", "康宁", "01000000411", "2"],
  170. ["新闸", "胡稀稀", "01000000136", "2"],
  171. ["新闸", "朱晶晶", "01000000336", "2"],
  172. ["新闸", "陈健", "01020002767", "2"],
  173. ["新闸", "严卓桢", "01000000363", "2"],
  174. ["新闸", "杨意达", "01000000387", "2"],
  175. ["新闸", "孔寅", "01000000427", "2"],
  176. ["新闸", "夏元灏", "01000000090", "2"],
  177. ["新闸", "丁一鸣", "01020002768", "2"],
  178. ["新闸", "朱晨杰", "01030000423", "2"],
  179. ["新闸", "方旻", "01030000384", "2"],
  180. ["新闸", "史斌", "01030001616", "2"],
  181. ["新闸", "陈易君", "01000000302", "2"],
  182. ["新闸", "陈毅君", "01030000383", "2"],
  183. ["新闸", "陈琦", "01030001511", "2"],
  184. ["新闸", "王琤", "01030000371", "2"],
  185. ["新闸", "张誉华", "01030001111", "2"],
  186. ["新闸", "陈仁德", "01030000734", "2"],
  187. ["新闸", "朱捷", "01020005072", "2"],
  188. ["新闸", "张晓筱", "01020004700", "2"],
  189. ["新闸", "王盛琪", "01030003371", "2"],
  190. ["新闸", "成敏", "01030001201", "2"],
  191. ["新闸", "孔垂荣", "01020000659", "2"],
  192. ["新闸", "王佳亮", "01030000464", "2"],
  193. ["新闸", "谢骞凌", "01020001788", "2"],
  194. ["新闸", "许新亮", "01020002073", "2"],
  195. ["新闸", "沈骏", "01050003901", "2"],
  196. ["新闸", "沈凌峰", "01020004128", "2"],
  197. ["新闸", "王昊", "01000000080", "2"],
  198. ["新闸", "张同宏", "01000000333", "2"],
  199. ["新闸", "俞力权", "01010005686", "2"],
  200. ["新闸", "夏旭阳", "01010005409", "2"],
  201. ["新闸", "徐新明", "01000000419", "2"],
  202. ["新闸", "赵杰", "01000000630", "2"],
  203. ["新闸", "欧君琦", "01010005388", "2"],
  204. ["新闸", "金金", "01010005647", "2"],
  205. ["新闸", "安琪", "01010005065", "2"],
  206. ["新闸", "钱超", "01010009369", "2"],
  207. ["新闸", "傅洲杰", "01010009365", "2"],
  208. ["新闸", "沈之昕", "01000000745", "2"],
  209. ["3C东二区", "罗铮", "01000000241", "3"],
  210. ["3C东二区", "陈周邃", "01000000239", "3"],
  211. ["3C东二区", "徐华", "01000000400", "3"],
  212. ["3C东二区", "朱秋蒻", "01000000250", "3"],
  213. ["3C东二区", "郑骏庆", "01000000247", "3"],
  214. ["3C东二区", "蔡伟捷", "01000000087", "3"],
  215. ["3C东二区", "龚伟栋", "01000000347", "2"],
  216. ["3C东二区", "王晓琼", "01000000450", "2"],
  217. ["3C东二区", "黄君", "01000000377", "2"],
  218. ["3C东二区", "崔杰", "01020002549", "2"],
  219. ["3C东二区", "杨燕", "01000000172", "2"],
  220. ["3C东二区", "陈可好", "01030001482", "2"],
  221. ["3C东二区", "赵贾平", "01000000093", "2"],
  222. ["3C东二区", "陈曹君", "01010010429", "2"],
  223. ["3C东二区", "陈捷", "01000000636", "2"],
  224. ["3C东二区", "路冀晨", "01010005340", "2"],
  225. ["3C东二区", "赵琪", "01010000867", "2"],
  226. ["3C东二区", "沈俊磊", "01020005100", "2"],
  227. ["3C东二区", "瞿凯", "01020002385", "2"],
  228. ["3C东二区", "凌云", "01000000380", "2"],
  229. ["3C东二区", "杨韵", "01000000691", "2"],
  230. ["3C东二区", "周辉", "01010005461", "2"],
  231. ["3C东二区", "蒋嵩", "01020001883", "2"],
  232. ["3C东二区", "黄玉萍", "01000000426", "2"],
  233. ["3C东二区", "薛锋", "01000000086", "2"],
  234. ["3C东二区", "李靖", "01030000268", "2"],
  235. ["3C东二区", "周洁", "01000000238", "2"],
  236. ["3C东二区", "周智充", "01050000374", "2"],
  237. ["3C东二区", "徐桢东", "01020003114", "2"],
  238. ["3C东二区", "周俊", "01020005217", "2"],
  239. ["3C东二区", "王伟", "01050003149", "2"],
  240. ["3C东二区", "刘万青", "01020003136", "2"],
  241. ["3C东二区", "黄晓顺", "01030001003", "2"],
  242. ["3C东二区", "黄东", "01000000709", "2"],
  243. ["3C东二区", "徐春东", "01000000370", "2"],
  244. ["3C东二区", "瞿天成", "01000000349", "2"],
  245. ["3C东二区", "秦国毅", "01000000261", "2"],
  246. ["3C东二区", "奚春海", "01000000117", "2"],
  247. ["3C东二区", "朱正元", "01030000381", "2"],
  248. ["3C东二区", "顾家超", "01030000356", "2"],
  249. ["3C东二区", "张国清", "01040001018", "2"],
  250. ["3C东二区", "凌浩峰", "01020002433", "2"],
  251. ["3C东二区", "张莹侃", "01030001869", "2"],
  252. ["3C东二区", "胡秋刚", "01030000410", "2"],
  253. ["3C东二区", "张斌", "01000000107", "2"],
  254. ["3C东二区", "沈慧珺", "01050000667", "2"],
  255. ["3C东二区", "彭佳骏", "01000000647", "2"],
  256. ["3C东二区", "孟朱捷", "01020001945", "2"],
  257. ["3C东二区", "郑嘉豪", "01000000752", "2"],
  258. ["3C东二区", "孙杨", "01040000573", "2"],
  259. ["3C东二区", "吴晨", "01010008418", "2"],
  260. ["3C东二区", "许光曦", "01000000613", "2"],
  261. ["3C东二区", "戚佳俊", "01030001487", "2"],
  262. ["3C东二区", "王成", "01010009590", "2"],
  263. ["3C东二区", "陈里骏", "01020002187", "2"],
  264. ["3C东二区", "奚凌贇", "01030002145", "2"],
  265. ["3C东二区", "王寅", "01010000654", "2"],
  266. ["3C东二区", "杨斌1", "01050000604", "2"],
  267. ["3C东二区", "张俊琦", "01050001140", "2"],
  268. ["3C东二区", "谢圣豪", "01020001769", "2"],
  269. ["3C东二区", "沈玺", "01020001713", "2"],
  270. ["3C东二区", "李君渔", "01000000425", "2"],
  271. ["3C东二区", "朱頔", "01050000697", "2"],
  272. ["3C东二区", "李骅", "01000000231", "2"],
  273. ["3C东二区", "张婧婷", "01010004063", "2"],
  274. ["3C东二区", "张薛健", "01010010631", "2"],
  275. ["3C东二区", "魏益彬", "01000000711", "2"],
  276. ["3C东二区", "孙通", "01000000493", "2"],
  277. ["3C东二区", "李文俊", "01000000226", "2"],
  278. ["3C东二区", "麦金", "01000000376", "2"],
  279. ["3C东西区", "田卫华", "01000000266", "3"],
  280. ["3C东西区", "刘斌", "01000000184", "3"],
  281. ["3C东西区", "李培松", "01000000255", "3"],
  282. ["3C东西区", "谢轶恒", "01000000108", "3"],
  283. ["3C东西区", "沈祥彬", "01020003049", "3"],
  284. ["3C东西区", "宋霆", "01000000390", "3"],
  285. ["3C东西区", "钱超亮", "01000000317", "2"],
  286. ["3C东西区", "顾鹤", "01000000340", "2"],
  287. ["3C东西区", "王亦辰", "01000000081", "2"],
  288. ["3C东西区", "钱佳旻", "01000000155", "2"],
  289. ["3C东西区", "陆礼惠", "01000000437", "2"],
  290. ["3C东西区", "徐辉", "01020002540", "2"],
  291. ["3C东西区", "郑靖云", "01000000358", "2"],
  292. ["3C东西区", "刘成伟", "01000000149", "2"],
  293. ["3C东西区", "朱佳敏", "01000000435", "2"],
  294. ["3C东西区", "陈佳伟", "01020002397", "2"],
  295. ["3C东西区", "徐焱", "01020002773", "2"],
  296. ["3C东西区", "沈德龙", "01030000784", "2"],
  297. ["3C东西区", "吴剑敏", "01030000278", "2"],
  298. ["3C东西区", "施晓涛", "01000000373", "2"],
  299. ["3C东西区", "庄炜", "01000000360", "2"],
  300. ["3C东西区", "包斯峰", "01030000382", "2"],
  301. ["3C东西区", "吴中琪", "01020001774", "2"],
  302. ["3C东西区", "周捷", "01040000600", "2"],
  303. ["3C东西区", "汤德楠", "01040001476", "2"],
  304. ["3C东西区", "戴辰", "01010002811", "2"],
  305. ["3C东西区", "王培俊", "01020002472", "2"],
  306. ["3C东西区", "陈敏", "01010000415", "2"],
  307. ["3C东西区", "强悠飞", "01030001169", "2"],
  308. ["3C东西区", "张侠", "01000000127", "2"],
  309. ["3C东西区", "陆义隆", "01010009332", "2"],
  310. ["3C东西区", "王琳", "01040001788", "2"],
  311. ["3C东西区", "施伟", "01040001386", "2"],
  312. ["3C东西区", "陈晓栋", "01040002959", "2"],
  313. ["3C东西区", "李瑛", "01000000623", "2"],
  314. ["3C东西区", "颜文巍", "01000000208", "2"],
  315. ["3C东西区", "华志超", "01040000810", "2"],
  316. ["3C东西区", "黄沫瑶", "01020004699", "2"],
  317. ["3C东西区", "丁佳骏", "01040002167", "2"],
  318. ["3C东西区", "祁明", "01030001488", "2"],
  319. ["3C东西区", "严黎华", "01000000110", "2"],
  320. ["3C东西区", "赵俊", "01030001401", "2"],
  321. ["3C东西区", "严申", "01050000711", "2"],
  322. ["3C东西区", "邬圣亮", "01050001396", "2"],
  323. ["3C东西区", "李建栋", "01040001360", "2"],
  324. ["3C东西区", "王晨", "01000000276", "2"],
  325. ["3C东西区", "陈佳俊", "01030002369", "2"],
  326. ["3C东西区", "陈冠", "01030001026", "2"],
  327. ["3C东西区", "蒋琳", "01040002754", "2"],
  328. ["3C东西区", "朱佩钦", "01050004436", "2"],
  329. ["3C东西区", "张国华", "01030000325", "2"],
  330. ["3C东西区", "钱玉敏", "01050004007", "2"],
  331. ["3C东西区", "袁馨琪", "01040005289", "2"],
  332. ["3C东西区", "戴勇辉", "01040000543", "2"],
  333. ["3C东西区", "乐梦芸", "01000000485", "2"],
  334. ["3C东西区", "朱瑞卿", "01000000135", "2"],
  335. ["3C东西区", "邵逾", "01000000094", "2"],
  336. ["3C东西区", "李晶君", "01000000211", "2"],
  337. ["3C东西区", "喻成樑", "01000000287", "2"],
  338. ["3C东西区", "朱蔚华", "01000000335", "2"],
  339. ["3C东西区", "张贞杰", "01000000439", "2"],
  340. ["3C东西区", "孙晓", "01000000414", "2"],
  341. ["3C东西区", "秦福耀", "01010005600", "2"],
  342. ["3C东西区", "鄂自强", "01010005387", "2"],
  343. ["3C东西区", "许文斌", "01000000278", "2"],
  344. ["3C东西区", "阮前卫", "01000000240", "2"],
  345. ["3C东西区", "吕伟敏", "01000000385", "2"],
  346. ["3C东西区", "严林明", "01000000154", "2"],
  347. ["3C东西区", "郑斌伟", "01010004840", "2"],
  348. ["3C东西区", "张煜", "01010005093", "2"],
  349. ["3C东西区", "俞辰峰", "01010005645", "2"],
  350. ["3C东西区", "陈汝珊", "01000000161", "2"],
  351. ["3C东西区", "徐健", "01010005734", "2"],
  352. ["3C东西区", "杨吴斐", "01000000689", "2"],
  353. ["3C东西区", "童凯文", "01010009514", "2"],
  354. ["3C东西区", "金燕", "01000000616", "2"],
  355. ["3C东西区", "刘捷", "01010005196", "2"],
  356. ["3C东西区", "张伟宁", "01000000608", "2"],
  357. ["3C东西区", "周康键", "01010005292", "2"],
  358. ["3C东西区", "钟厉", "01000000712", "2"],
  359. ["3C东西区", "盛晓伟", "01010004924", "2"],
  360. ["3C东西区", "吴海峰", "01000000292", "2"],
  361. ["3C东西区", "刘斐", "01000000237", "2"],
  362. ["3C东西区", "孙烨", "01000000111", "2"],
  363. ["3C东西区", "陈鹏程", "01000000362", "2"],
  364. ["3C东西区", "周文浩", "01050000655", "2"],
  365. ["3C东西区", "胡佳妮", "01000000412", "2"],
  366. ["3C东西区", "嵇盛", "01000000339", "2"],
  367. ["3C东西区", "顾凯", "01000000361", "2"],
  368. ["3C东西区", "季苏峰", "01000000203", "2"],
  369. ["3C东西区", "魏哲文", "01000000222", "2"],
  370. ["3C东西区", "纪春", "01000000284", "2"],
  371. ["3C东西区", "邹源", "01000000100", "2"],
  372. ["3C东西区", "施页", "01000000103", "2"],
  373. ["3C东西区", "李歆音", "01040000920", "2"],
  374. ["3C东西区", "郦天", "01000000243", "2"],
  375. ["3C东西区", "金浩", "01000000303", "2"],
  376. ["3C东西区", "王象昇", "01000000191", "2"],
  377. ["3C东西区", "陶旭莹", "01000000359", "2"],
  378. ["3C东西区", "余征飞", "01000000397", "2"],
  379. ["3C东西区", "袁晨1", "01000000498", "2"],
  380. ["3C东西区", "许茂杰", "01040000300", "2"],
  381. ["3C东西区", "胡培卿", "01000000194", "2"],
  382. ["3C东西区", "钱春辉", "01000000325", "2"],
  383. ["3C东西区", "朱敏", "01000000351", "2"],
  384. ["3C东西区", "章睿", "01000000429", "2"],
  385. ["3C东西区", "姚巍", "01000000209", "2"],
  386. ["3C东西区", "戴云飞", "01000000368", "2"],
  387. ["3C东西区", "陈激", "01010004517", "2"],
  388. ["3C东西区", "罗震佳", "01000000631", "2"],
  389. ["3C东西区", "俞晓鸣", "01010005663", "2"],
  390. ["3C东西区", "励纯", "01050001166", "2"],
  391. ["3C东西区", "安韧", "01050001543", "2"],
  392. ["3C东西区", "周云辉", "01000000635", "2"],
  393. ["3C东西区", "唐晨", "01040001387", "2"],
  394. ["3C东西区", "阮亦翔", "01030000825", "2"],
  395. ["3C东西区", "凌梦虎", "01020000586", "2"],
  396. ["3C东西区", "陈思琪", "01020001768", "2"],
  397. ["3C东西区", "程超勇", "01050002419", "2"],
  398. ["3C东西区", "濮徐杰", "01010002299", "2"],
  399. ["3C东西区", "卢佳盛", "01010009374", "2"],
  400. ["3C东西区", "吴超", "01000000228", "2"],
  401. ["3C东西区", "龚程良", "01010002009", "2"],
  402. ["3C东西区", "施酝亮", "01010010582", "2"],
  403. ["3C东西区", "傅琪琪", "01010005346", "2"],
  404. ["3C东西区", "朱杰", "01030000869", "2"],
  405. ["3C东西区", "赵雷", "01020000064", "2"],
  406. ["3C东西区", "杨子聪", "01040004675", "2"],
  407. ["3C东西区", "周凯宇", "01050003495", "2"],
  408. ["3C东西区", "顾旻超", "01030004093", "2"],
  409. ["3C东西区", "邵伟明", "01040000566", "2"],
  410. ["3C东西区", "黄申超", "01050000808", "2"],
  411. ["3C东西区", "劳力勇", "01000000133", "2"],
  412. ["3C东西区", "柳俊杰", "01000000269", "2"],
  413. ["3C东西区", "董海峰", "01000000344", "2"],
  414. ["3C东西区", "许诺", "01000000428", "2"],
  415. ["COCC", "殷瑞琦", "01000000304", "3"],
  416. ["COCC", "朱大为", "01000000386", "3"],
  417. ["COCC", "孟炜捷", "01000000212", "3"],
  418. ["COCC", "钱培培", "01000000329", "3"],
  419. ["COCC", "张志虹", "01000000123", "3"],
  420. ["COCC", "江裕丰", "01000000121", "3"],
  421. ["COCC", "张鸣跃", "01000000391", "2"],
  422. ["COCC", "邵俊杰", "01030000763", "2"],
  423. ["COCC", "罗渊淳", "01000000488", "2"],
  424. ["COCC", "李法斌", "01010002298", "2"],
  425. ["COCC", "姜卫刚", "01010002075", "2"],
  426. ["COCC", "薛至罡", "01020003661", "2"],
  427. ["COCC", "童瑞军", "01000000293", "2"],
  428. ["COCC", "余嫣", "01000000310", "2"],
  429. ["COCC", "史君", "01000000288", "2"],
  430. ["COCC", "聂唯佳", "01000000307", "2"],
  431. ["COCC", "支竞雄", "01000000263", "2"],
  432. ["COCC", "徐惠骏", "01020005102", "2"],
  433. ["COCC", "朱杰", "01030001227", "2"],
  434. ["COCC", "赵峰", "01020002354", "2"],
  435. ["COCC", "沈骏", "01050003901", "2"],
  436. ["COCC", "孙磊", "01000000273", "2"],
  437. ["COCC", "刘春风", "01000000438", "2"],
  438. ["COCC", "季梦夏", "01020000064", "2"],
  439. ["COCC", "赵雷", "01000000483", "2"],
  440. ["3C东一区", "朱辰天", "01000000298", "3"],
  441. ["3C东一区", "何辉", "01000000101", "3"],
  442. ["3C东一区", "徐灵骏", "01000000341", "2"],
  443. ["3C东一区", "陆逸", "01020002547", "2"],
  444. ];
  445. foreach ($listInfo as $userInfo) {
  446. $user = BaseUser::findOne(["username" => $userInfo[2]]);
  447. if (!$user) {
  448. $info = new BaseUser();
  449. $info->password = md5("admin123456");
  450. $info->username = $userInfo[2];
  451. $info->name = $userInfo[1];
  452. $info->roles = $userInfo[3];
  453. //创建时间,更新时间
  454. $info->create_time = date("Y-m-d H:i:s");
  455. $info->update_time = date("Y-m-d H:i:s");
  456. if (!$info->save()) {
  457. throw new Exception($info->getErrorSummary(true)[0]);
  458. }
  459. //保存员工信息
  460. $staffInfo = new Staff();
  461. //数据录入
  462. $staffInfo->name = $userInfo[1];
  463. $staffInfo->phone = 111;
  464. $staffInfo->seniority = 0;
  465. $staffInfo->department = $userInfo[0];
  466. $staffInfo->employment = "";
  467. $staffInfo->uid = $info->id;
  468. $staffInfo->save();
  469. }
  470. echo $userInfo[2] . " success";
  471. echo "\n";
  472. }
  473. }
  474. public function actionTest()
  475. {
  476. // $AccidentCasesList = AccidentCases::find()->all();
  477. // foreach ($AccidentCasesList as $AccidentCase) {
  478. // /** @var $AccidentCase AccidentCases */
  479. //// if ($AccidentCase->substation_type != 0) {
  480. //// $AccidentCase->substation_type = json_encode([(int)$AccidentCase->substation_type]);
  481. //// } else {
  482. //// $AccidentCase->substation_type = '[]';
  483. //// }
  484. // if ($AccidentCase->duty_category != 0) {
  485. // $AccidentCase->duty_category = json_encode([(int)$AccidentCase->duty_category]);
  486. // } else {
  487. // $AccidentCase->duty_category = '[]';
  488. // }
  489. // if ($AccidentCase->duty_reason != 0) {
  490. // $AccidentCase->duty_reason = json_encode([(int)$AccidentCase->duty_reason]);
  491. // } else {
  492. // $AccidentCase->duty_reason = '[]';
  493. // }
  494. // $AccidentCase->save();
  495. // }
  496. // $a = date("z",time());
  497. // $b = date("z",strtotime("2024-12-31"));
  498. // var_dump($a);
  499. // var_dump($b);
  500. $accidentIdList = [
  501. 2, 3, 4, 1, 7, 5, 8, 12, 13, 25, 18, 26, 27, 23, 31, 32
  502. ];
  503. // $accidentIdList = [
  504. // 18
  505. // ];
  506. foreach ($accidentIdList as $accidentId) {
  507. $this->dealWithEventSourceDataFile($accidentId);
  508. }
  509. $this->dealWithEventSourceData();
  510. exit;
  511. }
  512. public static function dealWithEventSourceData()
  513. {
  514. $dataList = EventSourceData::find()->where(["delete_time" => 0])->all();
  515. foreach ($dataList as $data) {
  516. /** @var EventSourceData $data */
  517. $type = explode(".", $data->file_name);
  518. if (strtolower($type[count($type) - 1]) == "avi" || strtolower($type[count($type) - 1]) == "wmv" || strtolower($type[count($type) - 1]) == "mkv") {
  519. $newFileName = "";
  520. foreach ($type as $typeValue) {
  521. if ($typeValue != $type[count($type) - 1]) {
  522. $newFileName .= $typeValue . ".";
  523. }
  524. }
  525. $newFileName .= "mp4";
  526. $urlNew = "";
  527. $urlExplode = explode(".", $data->url);
  528. foreach ($urlExplode as $urlExplodeValue) {
  529. if ($urlExplodeValue != $urlExplode[count($type) - 1]) {
  530. $urlNew .= $urlExplodeValue . ".";
  531. }
  532. }
  533. $urlNew .= "mp4";
  534. $data->file_name = $newFileName;
  535. $data->url = $urlNew;
  536. $data->save();
  537. var_dump($newFileName);
  538. } else if (strtolower($type[count($type) - 1]) == "wav") {
  539. $newFileName = "";
  540. foreach ($type as $typeValue) {
  541. if ($typeValue != $type[count($type) - 1]) {
  542. $newFileName .= $typeValue . ".";
  543. }
  544. }
  545. $newFileName .= "mp3";
  546. $urlNew = "";
  547. $urlExplode = explode(".", $data->url);
  548. foreach ($urlExplode as $urlExplodeValue) {
  549. if ($urlExplodeValue != $urlExplode[count($type) - 1]) {
  550. $urlNew .= $urlExplodeValue . ".";
  551. }
  552. }
  553. $urlNew .= "mp3";
  554. $data->file_name = $newFileName;
  555. $data->url = $urlNew;
  556. $data->save();
  557. var_dump($newFileName);
  558. }
  559. }
  560. }
  561. public static function dealWithEventSourceDataFile($accident_id)
  562. {
  563. //******先存储图片,返回完整路径******/
  564. $dir = "../../frontend/web/uploads/case/" . $accident_id; //设定存储上传文件的文件夹
  565. $scanned_directory = array_diff(scandir($dir), array('..', '.'));
  566. foreach ($scanned_directory as $fileName) {
  567. $oldPath = $dir . "/" . $fileName; // 路径+旧文件名
  568. //生成文件名
  569. $path = "/uploads/case/" . $accident_id . "/" . rawurlencode($fileName);
  570. //文件转码
  571. $env = require __DIR__ . '/../../common/config/env/currentEnv.php';
  572. if (in_array($env, ["product"])) {
  573. /**
  574. * ffmpeg -i 111.wmv -c:v libx264 2.mp4
  575. * ffmpeg -i input.file -codec:a libmp3lame output.mp3
  576. */
  577. $type = explode(".", $fileName);
  578. if (strtolower($type[count($type) - 1]) == "avi" || strtolower($type[count($type) - 1]) == "wmv" || strtolower($type[count($type) - 1]) == "mkv") {
  579. $newFileName = "";
  580. foreach ($type as $typeValue) {
  581. if ($typeValue != $type[count($type) - 1]) {
  582. $newFileName .= $typeValue . ".";
  583. }
  584. }
  585. $newFileName .= "mp4";
  586. $oriPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $fileName;
  587. $newPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $newFileName;
  588. if (!file_exists($newPath)) {
  589. $result = shell_exec("/usr/local/ffmpeg/bin/ffmpeg -i '$oriPath' -c:v libx264 '$newPath' 2>&1");
  590. }
  591. $pathNew = "/uploads/case/" . $accident_id . "/" . rawurlencode($newFileName);
  592. if (file_exists($newPath)) {
  593. var_dump("存在");
  594. } else {
  595. var_dump("不存在");
  596. }
  597. } else if (strtolower($type[count($type) - 1]) == "wav") {
  598. $newFileName = "";
  599. foreach ($type as $typeValue) {
  600. if ($typeValue != $type[count($type) - 1]) {
  601. $newFileName .= $typeValue . ".";
  602. }
  603. }
  604. $newFileName .= "mp3";
  605. var_dump($newFileName);
  606. $oriPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $fileName;
  607. $newPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $newFileName;
  608. if (!file_exists($newPath)) {
  609. $result = shell_exec("/usr/local/ffmpeg/bin/ffmpeg -i '$oriPath' -codec:a libmp3lame '$newPath' 2>&1");
  610. }
  611. $pathNew = "/uploads/case/" . $accident_id . "/" . rawurlencode($newFileName);
  612. if (file_exists($newPath)) {
  613. var_dump("存在");
  614. } else {
  615. var_dump("不存在");
  616. }
  617. }
  618. }
  619. //返回数据
  620. var_dump(111);
  621. }
  622. }
  623. }