Pārlūkot izejas kodu

Merge branch 'master' of http://59.57.98.130:3000/jjhc/jucai

linwu 2 gadi atpakaļ
vecāks
revīzija
a88c07a6c8

+ 3 - 0
app/Http/Controllers/Web/Person/MemberInfoController.php

@@ -198,6 +198,9 @@ class MemberInfoController extends WebBaseController
         if($value >= 5){
             $redis->expire('user_email_'.$request->account,900);
             return $this->sendErrorResponse("连续登录失败5次,请15分钟后再尝试!");
+        }else{
+            $value++;
+            $redis->set('user_email_',$value);
         }
         $this->emailService->setAuthTag('personal')
             ->setCallback('App\Services\Person\MemberInfoService', 'sendAuthEmailHook', [$email, auth('web-member')->user()])

+ 220 - 2
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -2057,6 +2057,8 @@ class IndexController extends WebBaseController
         return view('app.recruit.post_select',$view_data);
     }
 
+
+
     /**
      * 放弃择岗
      */
@@ -2133,10 +2135,226 @@ class IndexController extends WebBaseController
 
     public function select_result(Request $request)
     {
-        $view_data = [];
-        return view('app.recruit.select_result',$view_data);
+
+
+        return view('app.recruit.select_result');
     }
 
+    public function get_select_result(Request $request)
+    {
+        $redis = Cache::getRedis();
+        $quota = $redis->get('recruit_quota');
+        if(!$quota){
+            $quota = [
+                [
+                    'name' => '青阳街道',
+                    'value' => 50,
+                ],
+                [
+                    'name' => '梅岭街道',
+                    'value' => 55
+                ],
+                [
+                    'name' => '西园街道',
+                    'value' => 41
+                ],
+                [
+                    'name' => '罗山街道',
+                    'value' => 33
+                ],
+                [
+                    'name' => '灵源街道',
+                    'value' => 39
+                ],
+                [
+                    'name' => '新塘街道',
+                    'value' => 52
+                ],
+                [
+                    'name' => '陈埭镇',
+                    'value' => 77
+                ],
+                [
+                    'name' => '池店镇',
+                    'value' => 82
+                ],
+                [
+                    'name' => '安海镇',
+                    'value' => 64
+                ],
+                [
+                    'name' => '磁灶镇',
+                    'value' => 36
+                ],
+                [
+                    'name' => '内坑镇',
+                    'value' => 30
+                ],
+                [
+                    'name' => '紫帽镇',
+                    'value' => 22
+                ],
+                [
+                    'name' => '东石镇',
+                    'value' =>35
+                ],
+                [
+                    'name' => '永和镇',
+                    'value' => 30
+                ],
+                [
+                    'name' => '英林镇',
+                    'value' => 26
+                ],
+                [
+                    'name' => '金井镇',
+                    'value' => 28
+                ],
+                [
+                    'name' => '龙湖镇',
+                    'value' => 37
+                ],
+                [
+                    'name' => '深沪镇',
+                    'value' => 23
+                ],
+                [
+                    'name' => '西滨镇',
+                    'value' => 12
+                ]
+            ];
+            $redis->set('recruit_quota',json_encode($quota));
+        }else{
+            $quota = json_decode($quota,true);
+        }
+        $limit = $request->input('limit',1);
+        $list = DB::table('recruit_appoint_select as a')->leftJoin('recruit_appoint_info as b','a.appoint_id','=','b.id')->leftJoin('recruit_ticket as c','a.appoint_id','=','c.appoint_id')->whereRaw('a.select_result is null')->select(['b.realname','c.ex_number','a.result','a.select_result','a.id'])->orderBy('record','desc')->limit($limit)->get();
+        $return_data = [
+            'list' => []
+        ];
+        $array_column = array_column($quota,'name');
+        foreach ($list as $k => $v){
+            $person_select_result = json_decode($v->result,true);
+            $flag = 0;//是否择岗成功
+            foreach ($person_select_result as $val){
+                //寻找下标
+                $index = array_search($val,$array_column);
+                if($quota[$index]['value'] > 0){
+                    $quota_data = [
+                        'index' => $index,
+                        'old_value' => $quota[$index]['value']
+                    ];
+                    //有名额允许择岗
+                    DB::table('recruit_appoint_select')->where('id',$v->id)->update(['select_result'=>$val,'status' => 1]);
+                    $v->select_result = $val;
+                    $quota[$index]['value']--;
+                    $quota_data['new_value'] = $quota[$index]['value'];
+                    $redis->set('recruit_quota',json_encode($quota));
+                    $flag = 1;
+                    break;
+                }
+            }
+            if(!$flag){
+                $v->select_result = '未匹配到志愿,本轮择岗不成功!';
+                DB::table('recruit_appoint_select')->where('id',$v->id)->update(['select_result'=>'未匹配到志愿,本轮择岗不成功!','status' => -2]);
+            }
+
+            array_push($return_data['list'],$v);
+        }
+        $return_data['quota'] = $quota_data;
+        return ['status' => 1, 'msg' => '择岗排序成功', 'data' => $return_data];
+    }
+
+    public function select_init(Request $request)
+    {
+        $count = DB::table('recruit_appoint_select')->whereRaw('select_result is null')->count();
+
+        $redis = Cache::getRedis();
+        $quota = $redis->get('recruit_quota');
+        if(!$quota){
+            $quota = [
+                [
+                    'name' => '青阳街道',
+                    'value' => 50,
+                ],
+                [
+                    'name' => '梅岭街道',
+                    'value' => 55
+                ],
+                [
+                    'name' => '西园街道',
+                    'value' => 41
+                ],
+                [
+                    'name' => '罗山街道',
+                    'value' => 33
+                ],
+                [
+                    'name' => '灵源街道',
+                    'value' => 39
+                ],
+                [
+                    'name' => '新塘街道',
+                    'value' => 52
+                ],
+                [
+                    'name' => '陈埭镇',
+                    'value' => 77
+                ],
+                [
+                    'name' => '池店镇',
+                    'value' => 82
+                ],
+                [
+                    'name' => '安海镇',
+                    'value' => 64
+                ],
+                [
+                    'name' => '磁灶镇',
+                    'value' => 36
+                ],
+                [
+                    'name' => '内坑镇',
+                    'value' => 30
+                ],
+                [
+                    'name' => '紫帽镇',
+                    'value' => 22
+                ],
+                [
+                    'name' => '东石镇',
+                    'value' =>35
+                ],
+                [
+                    'name' => '永和镇',
+                    'value' => 30
+                ],
+                [
+                    'name' => '英林镇',
+                    'value' => 26
+                ],
+                [
+                    'name' => '金井镇',
+                    'value' => 28
+                ],
+                [
+                    'name' => '龙湖镇',
+                    'value' => 37
+                ],
+                [
+                    'name' => '深沪镇',
+                    'value' => 23
+                ],
+                [
+                    'name' => '西滨镇',
+                    'value' => 12
+                ]
+            ];
+            $redis->set('recruit_quota',json_encode($quota));
+        }
+        $list = DB::table('recruit_appoint_select as a')->leftJoin('recruit_appoint_info as b','a.appoint_id','=','b.id')->leftJoin('recruit_ticket as c','a.appoint_id','=','c.appoint_id')->whereRaw('a.select_result is not null')->select(['b.realname','c.ex_number','a.result','a.select_result','a.id'])->orderBy('record','desc')->get();
+        return ['status' => 1, 'msg' => '获取初始化信息成功', 'data' => ['count' => $count, 'quota' => $quota, 'list' => $list]];
+    }
 
     public function interviewer_random(Request $request)
     {

+ 12 - 10
app/Http/Controllers/Web/Talent/JjhcController.php

@@ -53,19 +53,21 @@ class JjhcController extends WebBaseController
         $option_list = [
             '青阳街道','梅岭街道','西园街道','罗山街道','灵源街道','新塘街道','陈埭镇','池店镇','安海镇','磁灶镇','内坑镇','紫帽镇','东石镇','永和镇','英林镇','金井镇','龙湖镇','深沪镇','西滨镇'
         ];
-        for ($i = 1;$i<=1000;$i++){
-            $uid = rand(0,999999);
-            $recruit_id = 8;
-            $appoint_id = rand(0,999999);
-            $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
-            if($info){
-                return ['status' => 0, 'msg' => "测试数据重复,请重新点击生成测试数据!"];
-            }
+        $list = DB::table("recruit_appoint_info")->where('recruit_id',18)->where('audit',3)->where('pen_audit',1)->where('post_id',309)->get();
+        foreach ($list as $k => $v){
+            $uid = $v->uid;
+            $recruit_id = 18;
+            $appoint_id = $v->id;
+//            $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
+//            if($info){
+//                return ['status' => 0, 'msg' => "测试数据重复,请重新点击生成测试数据!"];
+//            }
             $data = [
                 'recruit_id' => $recruit_id,
-                'appoint_id' => $recruit_id,
+                'appoint_id' => $appoint_id,
                 'uid' => $uid,
-                'status' => 1
+                'status' => 1,
+                'record' => mt_rand(50.0,100)
             ];
             shuffle($option_list);
             $select = array_slice($option_list,0,rand(1,19));

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
public/themes/default/assets/app/js/vue-count-to.min.js


+ 255 - 0
public/themes/default/views/app/recruit/select_result.blade.php

@@ -0,0 +1,255 @@
+@extends('module.layouts.content')
+
+@push('meta')
+
+@endpush
+
+@push('css')
+    <style >
+        .operation{
+            width: 100%;
+            float: left;
+            text-align: center;
+            margin-top: 30px;
+        }
+        .result {
+            width: 60%;
+            float: left;
+            margin: 20px 0 0;
+            border: 1px solid #ccc;
+        }
+        .tips{
+            float: right;
+            width: 35%;
+            margin: 20px 0 0;
+            border: 1px solid #ccc;
+        }
+        h3{
+            width: 100%;
+            text-align: center;
+            line-height: 40px;
+        }
+        .process{
+            margin-top: 20px;
+            width: 100%;
+            float: left;
+            text-align: center;
+            font-size: 30px;
+            color: #30B08F;
+        }
+        .area-row{
+            line-height: 60px;
+            border-top: 1px solid #ccc;
+            display: flex;
+        }
+        .area-row div{
+            flex: 1;
+            text-align: center;
+            font-size: 30px;
+        }
+        .area-row .area-name{
+            font-size: 20px;
+        }
+        .area-row .area-value{
+            color: #30B08F;
+            transition: all 2s ease-in;
+        }
+    </style>
+@endpush
+
+@push('js')
+    <link href="{{ theme_asset('app/css/common.css') }}" rel="stylesheet">
+    <link href="{{theme_asset('app/css/recruit/recruit.css')}}" rel="stylesheet" type="text/css"/>
+    <link rel="stylesheet" href="{{ theme_asset('app/css/element.css') }}">
+
+@endpush
+
+@section('content')
+    <div id="app">
+        <div class="recruit_container clearfix">
+            <div class="recruit_show_content" style="margin-top: 10px;width: 100%">
+                <div class="title" style="text-align: center"><h2>晋江市公开招聘第十三批村务(社区)专职工作者择岗系统</h2></div>
+                <div class="clearfix">
+                    <div class="operation">
+                        <el-button type="primary" @click="getResult()" :disabled="disabled" v-text="start_button"></el-button>
+                        <el-button type="primary" @click="test()">测试</el-button>
+                    </div>
+                    <div class="process clearfix" ref="process" v-if="init">
+                        择岗进度:<count-to ref='count' class='count' :start-val=startval :end-val=endval :duration=4000></count-to>/<span class="count" v-text="count"></span>
+                    </div>
+
+                    <div class="result">
+                        <h3>择岗结果</h3>
+                        <el-divider></el-divider>
+                        <el-table :data="result" style="width: 100%">
+                            <el-table-column
+                                    prop="realname"
+                                    label="姓名"
+                                    width="100"
+                                    align="center">
+                            </el-table-column>
+                            <el-table-column
+                                    prop="ex_number"
+                                    label="准考证号"
+                                    width="150"
+                                    align="center">
+                            </el-table-column>
+                            <el-table-column
+                                    prop="select_result"
+                                    label="择岗结果"
+                                    width="100"
+                                    align="center">
+                            </el-table-column>
+                            <el-table-column
+                                    prop="result"
+                                    label="择岗意愿"
+                                    align="center">
+                            </el-table-column>
+                        </el-table>
+                    </div>
+                    <div class="tips" ref="tips">
+                        <h3>各镇街剩余名额</h3>
+{{--                        <el-table--}}
+{{--                                :data="quota"--}}
+{{--                                style="width: 100%">--}}
+{{--                            <el-table-column--}}
+{{--                                    prop="name"--}}
+{{--                                    label="地区"--}}
+{{--                                    align="center">--}}
+{{--                            </el-table-column>--}}
+{{--                            <el-table-column--}}
+{{--                                    prop="value"--}}
+{{--                                    label="剩余名额"--}}
+{{--                                    width="180"--}}
+{{--                                    align="center">--}}
+{{--                            </el-table-column>--}}
+{{--                        </el-table>--}}
+                        <div v-for="(item, index) in quota"  class="area-row clearfix">
+                            <div class="area-name">
+                                @{{ item.name }}
+                            </div>
+                            <div class="area-value" :ref="'area_'+index">
+                                <count-to  class='count' :start-val=item.old_value :end-val=item.new_value :duration=4000></count-to>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+
+        </div>
+    </div>
+
+@endsection
+
+@section('script')
+    <script src="{{theme_asset('app/js/vue.min.js')}}"></script>
+    <script src="{{theme_asset('app/js/qs.min.js')}}"></script>
+    <script src="{{theme_asset('app/js/axios.js')}}"></script>
+    <script src="{{theme_asset('app/js/Sortable.min.js')}}"></script>
+    <script src="{{theme_asset('app/js/vuedraggable.umd.min.js')}}"></script>
+    <script src="{{theme_asset('app/js/element.js')}}"></script>
+    <script src="{{theme_asset('app/js/vue-count-to.min.js')}}"></script>
+    <script>
+        const app = new Vue({
+            el: '#app',
+            data: {
+                quota:[],
+                result: [],
+                post_data: {
+                    limit: 1
+                },
+                disabled: false,
+                start_button: "开始分析择岗结果",
+                init:false,
+                startval: 0,
+                endval: 0,
+                count: 0
+            },
+            methods: {
+                getResult: function(){
+                    this.disabled = true;
+                    this.start_button = "择岗排序中";
+                    setInterval(this.getSelectResult,2000);
+                },
+                getInitInfo: function(){
+                    axios.post("{{route('recruit.select_init')}}").then(response => {
+                        let result = response.data;
+                        if(result.data.count > 0){
+                            this.init = true;
+                            this.count = result.data.count;
+                            let quota = eval(result.data.quota);
+                            for(let i = 0;i < quota.length;i++){
+                                let item = new Object();
+                                item.name = quota[i].name;
+                                item.old_value = quota[i].value;
+                                item.new_value = quota[i].value;
+                                this.quota.push(item)
+                            }
+                            this.result = result.data.list;
+                            //this.quota = eval(result.data.quota);
+                        }
+                    });
+                },
+                getSelectResult: function(){
+                    var that = this;
+                    axios.post("{{route('recruit.get_select_result')}}",Qs.stringify(this.post_data)).then(response => {
+                        var result = response.data;
+                        if(result.status){
+                            //加入一条结果记录
+                            this.result.push(result.data.list[0]);
+                            //修改进度结果
+                            this.endval++;
+                            this.$refs.count.start();
+                            this.startval = this.endval;
+                            //名额减
+                            let index = result.data.quota.index;
+                            this.$refs['area_'+index][0].style.background = "#fff611";
+                            var that = this;
+                            setTimeout(function (){
+                                that.$refs['area_'+index][0].style.background = "#fff"
+                            }, 2000);
+                            this.quota[index].old_value = result.data.quota.old_value;
+                            this.quota[index].new_value = result.data.quota.new_value;
+
+
+
+                        }
+                    });
+                },
+                handleScroll: function(){
+                    let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
+                    if(scrollTop > 300){
+                        this.$refs.process.style.position = "fixed";
+                        this.$refs.process.style.top = "0";
+                        this.$refs.process.style.background = "#fff666";
+                        this.$refs.process.style.zIndex = "9";
+
+                        this.$refs.tips.style.position = "fixed";
+                        this.$refs.tips.style.top = "60px";
+                        this.$refs.tips.style.right = "35px";
+                    }else{
+                        this.$refs.process.style.position = "static";
+                        this.$refs.process.style.background = "#fff";
+
+                        this.$refs.tips.style.position = "static";
+                    }
+                    console.log(scrollTop, '滚动距离')
+                },
+                test: function(){
+                    let i = Math.round(Math.random()*19);;
+                    this.$refs['area_'+i][0].style.background = "#fff611"
+                    var that = this;
+                    setTimeout(function (){
+                        that.$refs['area_'+i][0].style.background = "#fff"
+                    }, 2000);
+
+
+                }
+            },
+            created(){
+                this.getInitInfo();
+                window.addEventListener('scroll', this.handleScroll)
+            }
+        })
+    </script>
+@endsection

+ 2 - 0
routes/web.php

@@ -118,6 +118,8 @@ Route::group([
     $router->post('give_up_post','Web\Recruit\IndexController@give_up_post')->name('recruit.give_up_post');
     $router->post('comfirm_post','Web\Recruit\IndexController@comfirm_post')->name('recruit.comfirm_post');
     $router->get('select_result','Web\Recruit\IndexController@select_result')->name('recruit.select_result');
+    $router->post('get_select_result','Web\Recruit\IndexController@get_select_result')->name('recruit.get_select_result');
+    $router->post('select_init','Web\Recruit\IndexController@select_init')->name('recruit.select_init');
 
     $router->any('/{route?}', function () {
         return view('recruit');

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels