123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633 |
- <?php
- namespace console\controllers;
- use common\models\AccidentCases;
- use common\models\BaseUser;
- use common\models\EventSourceData;
- use common\models\Staff;
- use common\services\AccidentCasesDimensionService;
- use common\services\AccidentCasesScoreService;
- use common\services\EmergencyResponseDimensionService;
- use common\services\EmergencyResponseService;
- use common\services\OperationalAdjustmentsDimensionService;
- use common\services\OperationalAdjustmentsService;
- use Exception;
- use yii\console\Controller;
- class TestController extends Controller
- {
- public function actionPathUrlEncode()
- {
- /** @var EventSourceData[] $list */
- $list = EventSourceData::find()->all();
- foreach ($list as $value) {
- // $fileName = Upload::trimSpace($value->file_name);
- $fileName = $value->file_name;
- $fileName = rawurlencode($fileName);
- $value->url = "/uploads/case/{$value->accident_id}/{$fileName}";
- $value->save();
- }
- echo "ok";
- }
- protected function initDimension()
- {
- $dictionaryIdList = AccidentCasesScoreService::getContentDictionaryIdList();
- /** @var AccidentCases[] $AccidentCasesList */
- $AccidentCasesList = AccidentCases::find()->all();
- foreach ($AccidentCasesList as $AccidentCases) {
- //初始化评价维度
- AccidentCasesDimensionService::initContent($AccidentCases->id, $dictionaryIdList);
- }
- $EmergencyResponseList = EmergencyResponseService::getEmergencyResponseQuery()->all();
- foreach ($EmergencyResponseList as $EmergencyResponse) {
- EmergencyResponseDimensionService::add($EmergencyResponse);
- }
- $OperationalAdjustmentsList = OperationalAdjustmentsService::getQuery()->all();
- foreach ($OperationalAdjustmentsList as $OperationalAdjustments) {
- OperationalAdjustmentsDimensionService::add($OperationalAdjustments);
- }
- }
- public function actionAddUser()
- {
- set_time_limit(0);
- $listInfo = [
- ["质量安全部", "王培臣", "01020001791", "3"],
- ["技术业务部", "钱进", "01000000236", "3"],
- ["技术业务部", "李瑜芬", "01000000043", "3"],
- ["技术业务部", "曹耘文", "01000000702", "3"],
- ["技术业务部", "陈丽萍", "01000000378", "3"],
- ["技术业务部", "谢璟捷", "01000000200", "3"],
- ["技术业务部", "陆峥嵘", "01004000040", "3"],
- ["技术业务部", "方铖", "01000000764", "3"],
- ["技术业务部", "靳笑楠", "01000000718", "3"],
- ["技术业务部", "史若愚", "01000000280", "3"],
- ["技术业务部", "张宇峰", "01040004671", "2"],
- ["技术业务部", "刘静", "01000000694", "3"],
- ["调度指挥部", "庄毅华", "01000000207", "3"],
- ["调度指挥部", "李文俊", "01000000226", "3"],
- ["调度指挥部", "张浩", "01000000198", "3"],
- ["调度指挥部", "王晨", "01000000447", "3"],
- ["调度指挥部", "朱伟", "01000000424", "3"],
- ["调度指挥部", "麦金", "01000000376", "3"],
- ["调度指挥部", "许有骞", "01000000152", "3"],
- ["调度指挥部", "刘晓靓", "01000000296", "3"],
- ["调度指挥部", "朱辰天", "01000000298", "3"],
- ["调度指挥部", "海洋", "01000000217", "3"],
- ["调度指挥部", "陈华", "01000000356", "3"],
- ["调度指挥部", "王琦", "01000000324", "3"],
- ["调度指挥部", "康伟", "01000000095", "3"],
- ["调度指挥部", "孙依琳", "01000000511", "3"],
- ["隆德OCC", "嵇雪静", "01000000379", "3"],
- ["隆德OCC", "俞新辉", "01000000366", "3"],
- ["隆德OCC", "浦雯强", "01000000153", "3"],
- ["隆德OCC", "陈俊", "01000000316", "3"],
- ["隆德OCC", "邱炯", "01020002820", "3"],
- ["隆德OCC", "尹建伟", "01020001877", "3"],
- ["隆德OCC", "傅瑜杰", "01040000504", "3"],
- ["隆德OCC", "江裕丰", "01000000121", "3"],
- ["隆德OCC", "陶文彬", "01000000122", "3"],
- ["隆德OCC", "朱慬峰", "01000000275", "2"],
- ["隆德OCC", "张海钢", "01000000289", "2"],
- ["隆德OCC", "杨斐", "01000000096", "2"],
- ["隆德OCC", "康宁", "01000000411", "2"],
- ["隆德OCC", "彭贵兰", "01000000452", "2"],
- ["隆德OCC", "吴俊", "01000000216", "2"],
- ["隆德OCC", "王誉辰", "01000000495", "2"],
- ["隆德OCC", "陈志钧", "01000000097", "2"],
- ["隆德OCC", "董猛", "01000000104", "2"],
- ["隆德OCC", "黄文佳", "01040000915", "2"],
- ["隆德OCC", "朱家麟", "01000000677", "2"],
- ["隆德OCC", "张伟", "01000000337", "2"],
- ["隆德OCC", "沈华", "01000000348", "2"],
- ["隆德OCC", "陈国荣", "01000000078", "2"],
- ["隆德OCC", "张宇峰", "01040004671", "2"],
- ["隆德OCC", "宗瑜敏", "01040000750", "2"],
- ["隆德OCC", "蒋威", "01030001151", "2"],
- ["隆德OCC", "赵祺晶", "01000000500", "2"],
- ["隆德OCC", "赵意", "01040001084", "2"],
- ["隆德OCC", "金振鑫", "01030000849", "2"],
- ["隆德OCC", "赵斐", "01000000499", "2"],
- ["隆德OCC", "孙静雯", "01020002473", "2"],
- ["隆德OCC", "金孝宗", "01000000189", "2"],
- ["隆德OCC", "俞浩", "01030001579", "2"],
- ["隆德OCC", "吴龚杰", "01050001204", "2"],
- ["隆德OCC", "陈成", "01050000292", "2"],
- ["隆德OCC", "吕琛佳", "01040000725", "2"],
- ["隆德OCC", "沈自强", "01030000370", "2"],
- ["隆德OCC", "潘皆", "01030001813", "2"],
- ["隆德OCC", "袁嘉玺", "01030000767", "2"],
- ["隆德OCC", "吕量", "01000000489", "2"],
- ["隆德OCC", "李晓冬", "01040000347", "2"],
- ["隆德OCC", "喻浏玮", "01040001425", "2"],
- ["隆德OCC", "叶臻敏", "01040001074", "2"],
- ["隆德OCC", "陈昱栋", "01020001849", "2"],
- ["隆德OCC", "许勇", "01010000652", "2"],
- ["隆德OCC", "高宇峰", "01040000381", "2"],
- ["隆德OCC", "张健盛", "01020003445", "2"],
- ["隆德OCC", "瞿俊杰", "01000000079", "2"],
- ["隆德OCC", "姒一鸣", "01000000088", "2"],
- ["隆德OCC", "汪洋", "01000000088", "2"],
- ["隆德OCC", "冯路", "01020002757", "2"],
- ["隆德OCC", "陈煜璿", "01000000084", "2"],
- ["隆德OCC", "金烈", "01010005363", "2"],
- ["隆德OCC", "蔡巍强", "01000000633", "2"],
- ["隆德OCC", "杨鸣", "01030000419", "2"],
- ["隆德OCC", "徐骥", "01010005731", "2"],
- ["隆德OCC", "陈芝炘", "01010004886", "2"],
- ["隆德OCC", "顾超", "01000000156", "2"],
- ["隆德OCC", "孙荣鸣", "01010005375", "2"],
- ["隆德OCC", "张杰", "01000000632", "2"],
- ["隆德OCC", "张子翼", "01010005070", "2"],
- ["隆德OCC", "郁坤", "01010005730", "2"],
- ["隆德OCC", "张磊", "01010009368", "2"],
- ["隆德OCC", "倪雯婷", "01020002733", "2"],
- ["隆德OCC", "于国强", "01000000708", "2"],
- ["隆德OCC", "周琦峰", "01010009585", "2"],
- ["隆德OCC", "王毅超", "01010009506", "2"],
- ["隆德OCC", "倪庆", "01010004705", "2"],
- ["隆德OCC", "陈佳敏", "01010004866", "2"],
- ["隆德OCC", "张琛", "01010000417", "2"],
- ["隆德OCC", "胡佳炜", "01030001677", "2"],
- ["隆德OCC", "肖雄", "01020007031", "2"],
- ["隆德OCC", "许琳鹤", "01020001866", "2"],
- ["隆德OCC", "王真豪", "01010005651", "2"],
- ["隆德OCC", "朱鸿", "01030000774", "2"],
- ["隆德OCC", "薛至罡", "01020003661", "2"],
- ["隆德OCC", "翟鑫鸿", "01050004443", "2"],
- ["隆德OCC", "刘嘉骏", "01000000746", "2"],
- ["隆德OCC", "刘罡", "01030004261", "2"],
- ["隆德OCC", "丁宸", "01030001244", "2"],
- ["隆德OCC", "冯慈君", "01030000756", "2"],
- ["隆德OCC", "黄黎敏", "01030000229", "2"],
- ["隆德OCC", "沈大卫", "01030001248", "2"],
- ["隆德OCC", "蒋昊磊", "01030001619", "2"],
- ["隆德OCC", "李腾", "01030000320", "2"],
- ["隆德OCC", "李淼淼", "01000000113", "2"],
- ["新闸", "朱晔炜", "01000000169", "3"],
- ["新闸", "郑浒钢", "01000000143", "3"],
- ["新闸", "高叶民", "01000000106", "3"],
- ["新闸", "唐珊寅", "01000000345", "3"],
- ["新闸", "杨超", "01010005750", "3"],
- ["新闸", "康宁", "01000000411", "2"],
- ["新闸", "胡稀稀", "01000000136", "2"],
- ["新闸", "朱晶晶", "01000000336", "2"],
- ["新闸", "陈健", "01020002767", "2"],
- ["新闸", "严卓桢", "01000000363", "2"],
- ["新闸", "杨意达", "01000000387", "2"],
- ["新闸", "孔寅", "01000000427", "2"],
- ["新闸", "夏元灏", "01000000090", "2"],
- ["新闸", "丁一鸣", "01020002768", "2"],
- ["新闸", "朱晨杰", "01030000423", "2"],
- ["新闸", "方旻", "01030000384", "2"],
- ["新闸", "史斌", "01030001616", "2"],
- ["新闸", "陈易君", "01000000302", "2"],
- ["新闸", "陈毅君", "01030000383", "2"],
- ["新闸", "陈琦", "01030001511", "2"],
- ["新闸", "王琤", "01030000371", "2"],
- ["新闸", "张誉华", "01030001111", "2"],
- ["新闸", "陈仁德", "01030000734", "2"],
- ["新闸", "朱捷", "01020005072", "2"],
- ["新闸", "张晓筱", "01020004700", "2"],
- ["新闸", "王盛琪", "01030003371", "2"],
- ["新闸", "成敏", "01030001201", "2"],
- ["新闸", "孔垂荣", "01020000659", "2"],
- ["新闸", "王佳亮", "01030000464", "2"],
- ["新闸", "谢骞凌", "01020001788", "2"],
- ["新闸", "许新亮", "01020002073", "2"],
- ["新闸", "沈骏", "01050003901", "2"],
- ["新闸", "沈凌峰", "01020004128", "2"],
- ["新闸", "王昊", "01000000080", "2"],
- ["新闸", "张同宏", "01000000333", "2"],
- ["新闸", "俞力权", "01010005686", "2"],
- ["新闸", "夏旭阳", "01010005409", "2"],
- ["新闸", "徐新明", "01000000419", "2"],
- ["新闸", "赵杰", "01000000630", "2"],
- ["新闸", "欧君琦", "01010005388", "2"],
- ["新闸", "金金", "01010005647", "2"],
- ["新闸", "安琪", "01010005065", "2"],
- ["新闸", "钱超", "01010009369", "2"],
- ["新闸", "傅洲杰", "01010009365", "2"],
- ["新闸", "沈之昕", "01000000745", "2"],
- ["3C东二区", "罗铮", "01000000241", "3"],
- ["3C东二区", "陈周邃", "01000000239", "3"],
- ["3C东二区", "徐华", "01000000400", "3"],
- ["3C东二区", "朱秋蒻", "01000000250", "3"],
- ["3C东二区", "郑骏庆", "01000000247", "3"],
- ["3C东二区", "蔡伟捷", "01000000087", "3"],
- ["3C东二区", "龚伟栋", "01000000347", "2"],
- ["3C东二区", "王晓琼", "01000000450", "2"],
- ["3C东二区", "黄君", "01000000377", "2"],
- ["3C东二区", "崔杰", "01020002549", "2"],
- ["3C东二区", "杨燕", "01000000172", "2"],
- ["3C东二区", "陈可好", "01030001482", "2"],
- ["3C东二区", "赵贾平", "01000000093", "2"],
- ["3C东二区", "陈曹君", "01010010429", "2"],
- ["3C东二区", "陈捷", "01000000636", "2"],
- ["3C东二区", "路冀晨", "01010005340", "2"],
- ["3C东二区", "赵琪", "01010000867", "2"],
- ["3C东二区", "沈俊磊", "01020005100", "2"],
- ["3C东二区", "瞿凯", "01020002385", "2"],
- ["3C东二区", "凌云", "01000000380", "2"],
- ["3C东二区", "杨韵", "01000000691", "2"],
- ["3C东二区", "周辉", "01010005461", "2"],
- ["3C东二区", "蒋嵩", "01020001883", "2"],
- ["3C东二区", "黄玉萍", "01000000426", "2"],
- ["3C东二区", "薛锋", "01000000086", "2"],
- ["3C东二区", "李靖", "01030000268", "2"],
- ["3C东二区", "周洁", "01000000238", "2"],
- ["3C东二区", "周智充", "01050000374", "2"],
- ["3C东二区", "徐桢东", "01020003114", "2"],
- ["3C东二区", "周俊", "01020005217", "2"],
- ["3C东二区", "王伟", "01050003149", "2"],
- ["3C东二区", "刘万青", "01020003136", "2"],
- ["3C东二区", "黄晓顺", "01030001003", "2"],
- ["3C东二区", "黄东", "01000000709", "2"],
- ["3C东二区", "徐春东", "01000000370", "2"],
- ["3C东二区", "瞿天成", "01000000349", "2"],
- ["3C东二区", "秦国毅", "01000000261", "2"],
- ["3C东二区", "奚春海", "01000000117", "2"],
- ["3C东二区", "朱正元", "01030000381", "2"],
- ["3C东二区", "顾家超", "01030000356", "2"],
- ["3C东二区", "张国清", "01040001018", "2"],
- ["3C东二区", "凌浩峰", "01020002433", "2"],
- ["3C东二区", "张莹侃", "01030001869", "2"],
- ["3C东二区", "胡秋刚", "01030000410", "2"],
- ["3C东二区", "张斌", "01000000107", "2"],
- ["3C东二区", "沈慧珺", "01050000667", "2"],
- ["3C东二区", "彭佳骏", "01000000647", "2"],
- ["3C东二区", "孟朱捷", "01020001945", "2"],
- ["3C东二区", "郑嘉豪", "01000000752", "2"],
- ["3C东二区", "孙杨", "01040000573", "2"],
- ["3C东二区", "吴晨", "01010008418", "2"],
- ["3C东二区", "许光曦", "01000000613", "2"],
- ["3C东二区", "戚佳俊", "01030001487", "2"],
- ["3C东二区", "王成", "01010009590", "2"],
- ["3C东二区", "陈里骏", "01020002187", "2"],
- ["3C东二区", "奚凌贇", "01030002145", "2"],
- ["3C东二区", "王寅", "01010000654", "2"],
- ["3C东二区", "杨斌1", "01050000604", "2"],
- ["3C东二区", "张俊琦", "01050001140", "2"],
- ["3C东二区", "谢圣豪", "01020001769", "2"],
- ["3C东二区", "沈玺", "01020001713", "2"],
- ["3C东二区", "李君渔", "01000000425", "2"],
- ["3C东二区", "朱頔", "01050000697", "2"],
- ["3C东二区", "李骅", "01000000231", "2"],
- ["3C东二区", "张婧婷", "01010004063", "2"],
- ["3C东二区", "张薛健", "01010010631", "2"],
- ["3C东二区", "魏益彬", "01000000711", "2"],
- ["3C东二区", "孙通", "01000000493", "2"],
- ["3C东二区", "李文俊", "01000000226", "2"],
- ["3C东二区", "麦金", "01000000376", "2"],
- ["3C东西区", "田卫华", "01000000266", "3"],
- ["3C东西区", "刘斌", "01000000184", "3"],
- ["3C东西区", "李培松", "01000000255", "3"],
- ["3C东西区", "谢轶恒", "01000000108", "3"],
- ["3C东西区", "沈祥彬", "01020003049", "3"],
- ["3C东西区", "宋霆", "01000000390", "3"],
- ["3C东西区", "钱超亮", "01000000317", "2"],
- ["3C东西区", "顾鹤", "01000000340", "2"],
- ["3C东西区", "王亦辰", "01000000081", "2"],
- ["3C东西区", "钱佳旻", "01000000155", "2"],
- ["3C东西区", "陆礼惠", "01000000437", "2"],
- ["3C东西区", "徐辉", "01020002540", "2"],
- ["3C东西区", "郑靖云", "01000000358", "2"],
- ["3C东西区", "刘成伟", "01000000149", "2"],
- ["3C东西区", "朱佳敏", "01000000435", "2"],
- ["3C东西区", "陈佳伟", "01020002397", "2"],
- ["3C东西区", "徐焱", "01020002773", "2"],
- ["3C东西区", "沈德龙", "01030000784", "2"],
- ["3C东西区", "吴剑敏", "01030000278", "2"],
- ["3C东西区", "施晓涛", "01000000373", "2"],
- ["3C东西区", "庄炜", "01000000360", "2"],
- ["3C东西区", "包斯峰", "01030000382", "2"],
- ["3C东西区", "吴中琪", "01020001774", "2"],
- ["3C东西区", "周捷", "01040000600", "2"],
- ["3C东西区", "汤德楠", "01040001476", "2"],
- ["3C东西区", "戴辰", "01010002811", "2"],
- ["3C东西区", "王培俊", "01020002472", "2"],
- ["3C东西区", "陈敏", "01010000415", "2"],
- ["3C东西区", "强悠飞", "01030001169", "2"],
- ["3C东西区", "张侠", "01000000127", "2"],
- ["3C东西区", "陆义隆", "01010009332", "2"],
- ["3C东西区", "王琳", "01040001788", "2"],
- ["3C东西区", "施伟", "01040001386", "2"],
- ["3C东西区", "陈晓栋", "01040002959", "2"],
- ["3C东西区", "李瑛", "01000000623", "2"],
- ["3C东西区", "颜文巍", "01000000208", "2"],
- ["3C东西区", "华志超", "01040000810", "2"],
- ["3C东西区", "黄沫瑶", "01020004699", "2"],
- ["3C东西区", "丁佳骏", "01040002167", "2"],
- ["3C东西区", "祁明", "01030001488", "2"],
- ["3C东西区", "严黎华", "01000000110", "2"],
- ["3C东西区", "赵俊", "01030001401", "2"],
- ["3C东西区", "严申", "01050000711", "2"],
- ["3C东西区", "邬圣亮", "01050001396", "2"],
- ["3C东西区", "李建栋", "01040001360", "2"],
- ["3C东西区", "王晨", "01000000276", "2"],
- ["3C东西区", "陈佳俊", "01030002369", "2"],
- ["3C东西区", "陈冠", "01030001026", "2"],
- ["3C东西区", "蒋琳", "01040002754", "2"],
- ["3C东西区", "朱佩钦", "01050004436", "2"],
- ["3C东西区", "张国华", "01030000325", "2"],
- ["3C东西区", "钱玉敏", "01050004007", "2"],
- ["3C东西区", "袁馨琪", "01040005289", "2"],
- ["3C东西区", "戴勇辉", "01040000543", "2"],
- ["3C东西区", "乐梦芸", "01000000485", "2"],
- ["3C东西区", "朱瑞卿", "01000000135", "2"],
- ["3C东西区", "邵逾", "01000000094", "2"],
- ["3C东西区", "李晶君", "01000000211", "2"],
- ["3C东西区", "喻成樑", "01000000287", "2"],
- ["3C东西区", "朱蔚华", "01000000335", "2"],
- ["3C东西区", "张贞杰", "01000000439", "2"],
- ["3C东西区", "孙晓", "01000000414", "2"],
- ["3C东西区", "秦福耀", "01010005600", "2"],
- ["3C东西区", "鄂自强", "01010005387", "2"],
- ["3C东西区", "许文斌", "01000000278", "2"],
- ["3C东西区", "阮前卫", "01000000240", "2"],
- ["3C东西区", "吕伟敏", "01000000385", "2"],
- ["3C东西区", "严林明", "01000000154", "2"],
- ["3C东西区", "郑斌伟", "01010004840", "2"],
- ["3C东西区", "张煜", "01010005093", "2"],
- ["3C东西区", "俞辰峰", "01010005645", "2"],
- ["3C东西区", "陈汝珊", "01000000161", "2"],
- ["3C东西区", "徐健", "01010005734", "2"],
- ["3C东西区", "杨吴斐", "01000000689", "2"],
- ["3C东西区", "童凯文", "01010009514", "2"],
- ["3C东西区", "金燕", "01000000616", "2"],
- ["3C东西区", "刘捷", "01010005196", "2"],
- ["3C东西区", "张伟宁", "01000000608", "2"],
- ["3C东西区", "周康键", "01010005292", "2"],
- ["3C东西区", "钟厉", "01000000712", "2"],
- ["3C东西区", "盛晓伟", "01010004924", "2"],
- ["3C东西区", "吴海峰", "01000000292", "2"],
- ["3C东西区", "刘斐", "01000000237", "2"],
- ["3C东西区", "孙烨", "01000000111", "2"],
- ["3C东西区", "陈鹏程", "01000000362", "2"],
- ["3C东西区", "周文浩", "01050000655", "2"],
- ["3C东西区", "胡佳妮", "01000000412", "2"],
- ["3C东西区", "嵇盛", "01000000339", "2"],
- ["3C东西区", "顾凯", "01000000361", "2"],
- ["3C东西区", "季苏峰", "01000000203", "2"],
- ["3C东西区", "魏哲文", "01000000222", "2"],
- ["3C东西区", "纪春", "01000000284", "2"],
- ["3C东西区", "邹源", "01000000100", "2"],
- ["3C东西区", "施页", "01000000103", "2"],
- ["3C东西区", "李歆音", "01040000920", "2"],
- ["3C东西区", "郦天", "01000000243", "2"],
- ["3C东西区", "金浩", "01000000303", "2"],
- ["3C东西区", "王象昇", "01000000191", "2"],
- ["3C东西区", "陶旭莹", "01000000359", "2"],
- ["3C东西区", "余征飞", "01000000397", "2"],
- ["3C东西区", "袁晨1", "01000000498", "2"],
- ["3C东西区", "许茂杰", "01040000300", "2"],
- ["3C东西区", "胡培卿", "01000000194", "2"],
- ["3C东西区", "钱春辉", "01000000325", "2"],
- ["3C东西区", "朱敏", "01000000351", "2"],
- ["3C东西区", "章睿", "01000000429", "2"],
- ["3C东西区", "姚巍", "01000000209", "2"],
- ["3C东西区", "戴云飞", "01000000368", "2"],
- ["3C东西区", "陈激", "01010004517", "2"],
- ["3C东西区", "罗震佳", "01000000631", "2"],
- ["3C东西区", "俞晓鸣", "01010005663", "2"],
- ["3C东西区", "励纯", "01050001166", "2"],
- ["3C东西区", "安韧", "01050001543", "2"],
- ["3C东西区", "周云辉", "01000000635", "2"],
- ["3C东西区", "唐晨", "01040001387", "2"],
- ["3C东西区", "阮亦翔", "01030000825", "2"],
- ["3C东西区", "凌梦虎", "01020000586", "2"],
- ["3C东西区", "陈思琪", "01020001768", "2"],
- ["3C东西区", "程超勇", "01050002419", "2"],
- ["3C东西区", "濮徐杰", "01010002299", "2"],
- ["3C东西区", "卢佳盛", "01010009374", "2"],
- ["3C东西区", "吴超", "01000000228", "2"],
- ["3C东西区", "龚程良", "01010002009", "2"],
- ["3C东西区", "施酝亮", "01010010582", "2"],
- ["3C东西区", "傅琪琪", "01010005346", "2"],
- ["3C东西区", "朱杰", "01030000869", "2"],
- ["3C东西区", "赵雷", "01020000064", "2"],
- ["3C东西区", "杨子聪", "01040004675", "2"],
- ["3C东西区", "周凯宇", "01050003495", "2"],
- ["3C东西区", "顾旻超", "01030004093", "2"],
- ["3C东西区", "邵伟明", "01040000566", "2"],
- ["3C东西区", "黄申超", "01050000808", "2"],
- ["3C东西区", "劳力勇", "01000000133", "2"],
- ["3C东西区", "柳俊杰", "01000000269", "2"],
- ["3C东西区", "董海峰", "01000000344", "2"],
- ["3C东西区", "许诺", "01000000428", "2"],
- ["COCC", "殷瑞琦", "01000000304", "3"],
- ["COCC", "朱大为", "01000000386", "3"],
- ["COCC", "孟炜捷", "01000000212", "3"],
- ["COCC", "钱培培", "01000000329", "3"],
- ["COCC", "张志虹", "01000000123", "3"],
- ["COCC", "江裕丰", "01000000121", "3"],
- ["COCC", "张鸣跃", "01000000391", "2"],
- ["COCC", "邵俊杰", "01030000763", "2"],
- ["COCC", "罗渊淳", "01000000488", "2"],
- ["COCC", "李法斌", "01010002298", "2"],
- ["COCC", "姜卫刚", "01010002075", "2"],
- ["COCC", "薛至罡", "01020003661", "2"],
- ["COCC", "童瑞军", "01000000293", "2"],
- ["COCC", "余嫣", "01000000310", "2"],
- ["COCC", "史君", "01000000288", "2"],
- ["COCC", "聂唯佳", "01000000307", "2"],
- ["COCC", "支竞雄", "01000000263", "2"],
- ["COCC", "徐惠骏", "01020005102", "2"],
- ["COCC", "朱杰", "01030001227", "2"],
- ["COCC", "赵峰", "01020002354", "2"],
- ["COCC", "沈骏", "01050003901", "2"],
- ["COCC", "孙磊", "01000000273", "2"],
- ["COCC", "刘春风", "01000000438", "2"],
- ["COCC", "季梦夏", "01020000064", "2"],
- ["COCC", "赵雷", "01000000483", "2"],
- ["3C东一区", "朱辰天", "01000000298", "3"],
- ["3C东一区", "何辉", "01000000101", "3"],
- ["3C东一区", "徐灵骏", "01000000341", "2"],
- ["3C东一区", "陆逸", "01020002547", "2"],
- ];
- foreach ($listInfo as $userInfo) {
- $user = BaseUser::findOne(["username" => $userInfo[2]]);
- if (!$user) {
- $info = new BaseUser();
- $info->password = md5("admin123456");
- $info->username = $userInfo[2];
- $info->name = $userInfo[1];
- $info->roles = $userInfo[3];
- //创建时间,更新时间
- $info->create_time = date("Y-m-d H:i:s");
- $info->update_time = date("Y-m-d H:i:s");
- if (!$info->save()) {
- throw new Exception($info->getErrorSummary(true)[0]);
- }
- //保存员工信息
- $staffInfo = new Staff();
- //数据录入
- $staffInfo->name = $userInfo[1];
- $staffInfo->phone = 111;
- $staffInfo->seniority = 0;
- $staffInfo->department = $userInfo[0];
- $staffInfo->employment = "";
- $staffInfo->uid = $info->id;
- $staffInfo->save();
- }
- echo $userInfo[2] . " success";
- echo "\n";
- }
- }
- public function actionTest()
- {
- // $AccidentCasesList = AccidentCases::find()->all();
- // foreach ($AccidentCasesList as $AccidentCase) {
- // /** @var $AccidentCase AccidentCases */
- //// if ($AccidentCase->substation_type != 0) {
- //// $AccidentCase->substation_type = json_encode([(int)$AccidentCase->substation_type]);
- //// } else {
- //// $AccidentCase->substation_type = '[]';
- //// }
- // if ($AccidentCase->duty_category != 0) {
- // $AccidentCase->duty_category = json_encode([(int)$AccidentCase->duty_category]);
- // } else {
- // $AccidentCase->duty_category = '[]';
- // }
- // if ($AccidentCase->duty_reason != 0) {
- // $AccidentCase->duty_reason = json_encode([(int)$AccidentCase->duty_reason]);
- // } else {
- // $AccidentCase->duty_reason = '[]';
- // }
- // $AccidentCase->save();
- // }
- // $a = date("z",time());
- // $b = date("z",strtotime("2024-12-31"));
- // var_dump($a);
- // var_dump($b);
- $accidentIdList = [
- 2, 3, 4, 1, 7, 5, 8, 12, 13, 25, 18, 26, 27, 23, 31, 32
- ];
- // $accidentIdList = [
- // 18
- // ];
- foreach ($accidentIdList as $accidentId) {
- $this->dealWithEventSourceDataFile($accidentId);
- }
- $this->dealWithEventSourceData();
- exit;
- }
- public static function dealWithEventSourceData()
- {
- $dataList = EventSourceData::find()->where(["delete_time" => 0])->all();
- foreach ($dataList as $data) {
- /** @var EventSourceData $data */
- $type = explode(".", $data->file_name);
- if (strtolower($type[count($type) - 1]) == "avi" || strtolower($type[count($type) - 1]) == "wmv" || strtolower($type[count($type) - 1]) == "mkv") {
- $newFileName = "";
- foreach ($type as $typeValue) {
- if ($typeValue != $type[count($type) - 1]) {
- $newFileName .= $typeValue . ".";
- }
- }
- $newFileName .= "mp4";
- $urlNew = "";
- $urlExplode = explode(".", $data->url);
- foreach ($urlExplode as $urlExplodeValue) {
- if ($urlExplodeValue != $urlExplode[count($type) - 1]) {
- $urlNew .= $urlExplodeValue . ".";
- }
- }
- $urlNew .= "mp4";
- $data->file_name = $newFileName;
- $data->url = $urlNew;
- $data->save();
- var_dump($newFileName);
- } else if (strtolower($type[count($type) - 1]) == "wav") {
- $newFileName = "";
- foreach ($type as $typeValue) {
- if ($typeValue != $type[count($type) - 1]) {
- $newFileName .= $typeValue . ".";
- }
- }
- $newFileName .= "mp3";
- $urlNew = "";
- $urlExplode = explode(".", $data->url);
- foreach ($urlExplode as $urlExplodeValue) {
- if ($urlExplodeValue != $urlExplode[count($type) - 1]) {
- $urlNew .= $urlExplodeValue . ".";
- }
- }
- $urlNew .= "mp3";
- $data->file_name = $newFileName;
- $data->url = $urlNew;
- $data->save();
- var_dump($newFileName);
- }
- }
- }
- public static function dealWithEventSourceDataFile($accident_id)
- {
- //******先存储图片,返回完整路径******/
- $dir = "../../frontend/web/uploads/case/" . $accident_id; //设定存储上传文件的文件夹
- $scanned_directory = array_diff(scandir($dir), array('..', '.'));
- foreach ($scanned_directory as $fileName) {
- $oldPath = $dir . "/" . $fileName; // 路径+旧文件名
- //生成文件名
- $path = "/uploads/case/" . $accident_id . "/" . rawurlencode($fileName);
- //文件转码
- $env = require __DIR__ . '/../../common/config/env/currentEnv.php';
- if (in_array($env, ["product"])) {
- /**
- * ffmpeg -i 111.wmv -c:v libx264 2.mp4
- * ffmpeg -i input.file -codec:a libmp3lame output.mp3
- */
- $type = explode(".", $fileName);
- if (strtolower($type[count($type) - 1]) == "avi" || strtolower($type[count($type) - 1]) == "wmv" || strtolower($type[count($type) - 1]) == "mkv") {
- $newFileName = "";
- foreach ($type as $typeValue) {
- if ($typeValue != $type[count($type) - 1]) {
- $newFileName .= $typeValue . ".";
- }
- }
- $newFileName .= "mp4";
- $oriPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $fileName;
- $newPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $newFileName;
- if (!file_exists($newPath)) {
- $result = shell_exec("/usr/local/ffmpeg/bin/ffmpeg -i '$oriPath' -c:v libx264 '$newPath' 2>&1");
- }
- $pathNew = "/uploads/case/" . $accident_id . "/" . rawurlencode($newFileName);
- if (file_exists($newPath)) {
- var_dump("存在");
- } else {
- var_dump("不存在");
- }
- } else if (strtolower($type[count($type) - 1]) == "wav") {
- $newFileName = "";
- foreach ($type as $typeValue) {
- if ($typeValue != $type[count($type) - 1]) {
- $newFileName .= $typeValue . ".";
- }
- }
- $newFileName .= "mp3";
- var_dump($newFileName);
- $oriPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $fileName;
- $newPath = __DIR__ . "/../../frontend/web/uploads/case/" . $accident_id . "/" . $newFileName;
- if (!file_exists($newPath)) {
- $result = shell_exec("/usr/local/ffmpeg/bin/ffmpeg -i '$oriPath' -codec:a libmp3lame '$newPath' 2>&1");
- }
- $pathNew = "/uploads/case/" . $accident_id . "/" . rawurlencode($newFileName);
- if (file_exists($newPath)) {
- var_dump("存在");
- } else {
- var_dump("不存在");
- }
- }
- }
- //返回数据
- var_dump(111);
- }
- }
- }
|