Procházet zdrojové kódy

更新上传成绩逻辑

zmw před 12 hodinami
rodič
revize
7b08fdbe5c

+ 26 - 2
app/Admin/Controllers/Recruit/RecruitController.php

@@ -2911,9 +2911,33 @@ class RecruitController extends Controller
             }else{
                 return response()->json(['status' => 0, 'msg' => '成绩上传失败'], 200);
             }
-        }else{
-            return response()->json(['status' => 0, 'msg' => '笔试成绩不存在'], 200);
         }
+        if(array_key_exists('face_data',$data)){
+            $ticket_url = base_path() . "/storage/app/public/recruit/ticket/" . uniqid() . '.xlsx';
+            if(move_uploaded_file($_FILES['face_data']['tmp_name'],$ticket_url)){
+                $spreadsheet = IOFactory::load($ticket_url);
+                $sheet = $spreadsheet->getActiveSheet();
+                $rowCount = $sheet->getHighestRow();
+                $record = [];
+                for($row = 2;$row<=$rowCount;$row++){
+                    $record[$sheet->getCell("A{$row}")->getValue()] = [
+                        'id' => $sheet->getCell("A{$row}")->getValue(),
+                        'realname' => $sheet->getCell("B{$row}")->getValue(),
+                        'card' => $sheet->getCell("C{$row}")->getValue(),
+                        'ex_number' => $sheet->getCell("E{$row}")->getValue(),
+                        'record' => $sheet->getCell("F{$row}")->getValue(),
+                        'next' => $sheet->getCell("G{$row}")->getValue()
+                    ];
+                }
+                Recruit::where('id',$data['recruit_id'])->update(['face_status' => 1]);
+                $record = new TicketJob($data['recruit_id'],'face_result',$record);
+                dispatch($record);
+                return response()->json(['status' => 1, 'msg' => '成绩上传成功'], 200);
+            }else{
+                return response()->json(['status' => 0, 'msg' => '成绩上传失败'], 200);
+            }
+        }
+        return response()->json(['status' => 0, 'msg' => '上传成绩失败'], 200);
     }
 
     public function create_record_template(Request $request){

+ 33 - 0
app/Jobs/TicketJob.php

@@ -508,6 +508,39 @@ class TicketJob implements ShouldQueue
                         break;
                 }
                 break;
+            case 'face_result':
+                $list = $this->data;
+                foreach ($list as $k => $v){
+                    if(!array_key_exists('id',$v) || intval($v['id']) <= 0){
+                        continue;
+                    }
+                    $appoint_info = RecruitAppointInfo::where('recruit_appoint_info.id',$v['id'])->where('recruit_appoint_info.recruit_id',$this->recruit_id)->join('recruit_ticket', 'recruit_appoint_info.id', '=', 'recruit_ticket.appoint_id')->select('recruit_appoint_info.*','recruit_ticket.ex_number')->first();
+                    if(!$appoint_info){
+                        continue;
+                    }
+                    if($appoint_info->realname != $v['realname'] || $appoint_info->card != $v['card'] || $appoint_info->ex_number != $v['ex_number']){
+                        //数据污染,路过处理
+                        continue;
+                    }
+                    if($v['next'] == '是'){
+                        $update['face_audit'] = 1;
+                        $status = -1;
+                    }else{
+                        $update['face_audit'] = 0;
+                        $status = 3;
+                    }
+                    if(!is_numeric($v['record']) && empty($v['record'])){
+                        $update['face_audit'] = 2;
+                        $status = 3;
+                    }
+                    if(in_array(6,explode(',',$recruit->step))){
+                        $update['reexamine_audit'] = $status;
+                    }else{
+                        $update['face_audit'] = $status;
+                    }
+                    RecruitAppointInfo::where('id',$v['id'])->update($update);
+                }
+                break;
         }
     }
 

+ 23 - 20
resources/views/admin/recruit/check_out_appoint.blade.php

@@ -46,6 +46,8 @@
         right: 30px;
         border: 1px solid #ccc;
         background: #fff;
+        overflow: hidden;
+        max-height: 600px;
     }
     .post{
         position: fixed;
@@ -1001,9 +1003,10 @@
             direction:'horizontal',
             loop:true,
             autoplay:false,
-            //前进后退按钮
-            nextButton:'.swiper-button-next',
-            prevButton:'.swiper-button-prev',
+            navigation: {
+                nextEl: ".swiper-button-next",
+                prevEl: ".swiper-button-prev",
+            },
             zoom : {
                 toggle: true,
             },
@@ -1034,23 +1037,23 @@
         });
 
         let photos = {!! $photos_json !!};
-        // $('.attachment').click(function () {
-        //     let key = $(this).data('key');
-        //     let name = $(this).data('name');
-        //     let photo = photos[name];
-        //     console.log(photo)
-        //     photo.start = key;
-        //     layer.photos({
-        //         photos: photo,
-        //         shade: 0,
-        //         closeBtn:2,
-        //         scrollbar:true,
-        //         tab: function () {
-        //             num = 0;
-        //             $(".layui-layer-photos").append("<div class='icon' style='position:relative;width:100%;text-align:center;top:-133px;cursor:pointer;'><img src='/themes/default/assets/statistics/js/layer/skin/default/turn_left.png' style='width:30px;height:30px;'><//div>");
-        //         }
-        //     });
-        // });
+        $('.attchment').click(function () {
+            let key = $(this).data('key');
+            let name = $(this).data('name');
+            let photo = photos[name];
+            console.log(photo)
+            photo.start = key;
+            layer.photos({
+                photos: photo,
+                shade:  [0.1, '#000'],
+                closeBtn:1,
+                scrollbar:true,
+                tab: function () {
+                    num = 0;
+                    $(".layui-layer-photos").append("<div class='icon' style='position:relative;width:100%;text-align:center;top:-133px;cursor:pointer;'><img src='/themes/default/assets/statistics/js/layer/skin/default/turn_left.png' style='width:30px;height:30px;'><//div>");
+                }
+            });
+        });
 
 
         $(".swiper-container").append("<div class='icon1' style='position:relative;width:100%;text-align:center;top:-133px;cursor:pointer;z-index: 9'><img src='/themes/default/assets/statistics/js/layer/skin/default/turn_left.png' style='width:30px;height:30px;'><//div>");