Pārlūkot izejas kodu

更新一些信息

sandm 2 gadi atpakaļ
vecāks
revīzija
e3cae221dc

+ 50 - 0
app/admin/controller/DirectlyIdentify.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\common\AdminController;
+use think\facade\Db;
+
+class DirectlyIdentify extends AdminController{
+
+    public function index(){
+        return view("", []);
+    }
+
+    public function list(){
+
+    }
+
+    public function enterprise_import(){
+        if (!$this->request->file())
+            return json(["msg" => "没有选择文件"]);
+        $excel = $this->request->file("file");
+
+        if (!isExcelFile($excel->getMime()))
+            return json(["msg" => "不是正确的Excel文件"]);
+        $mapping = [
+            0 => "type",
+            1 => "talentLevel",
+            2 => "name",
+            3 => "activeYear",
+            4 => "description"
+        ];
+
+        $path = $excel->getRealPath();
+
+        $zhiren_data = [
+            'task_name' => date("Y-m-d",time()) , "-导入机构数据",
+            'task_file' => $path,
+            'task_status' => -1,
+            'createTime' => date("Y-m-d H:i:s",time()),
+            'updateTime' => date("Y-m-d H:i:s",time())
+        ];
+
+        $id = Db::table("new_talent_zhiren")->insert($zhiren_data);
+
+        queue("app\job\Import", ["id" => $id]);
+
+        $data = ["code" => 200, "msg" => "导入成功"];
+        echo sprintf('<script>parent.DirectlyIdentify.callBack(%s);</script>', json_encode($data));
+    }
+}

+ 82 - 0
app/admin/view/directly_identify/index.html

@@ -0,0 +1,82 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>直认数据管理</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+
+                        </div>
+                        <div class="hidden-xs" id="DictTableToolbar" role="group">
+                            {if condition="chkCommission('/admin/directly_identify/enterprise_template','/directly_identify/enterprise_template')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DirectlyIdentify.download_enterprise_template()">
+                                <i class="fa fa-plus"></i>&nbsp;机构导入模板下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/import_enterprise','/directly_identify/import_enterprise')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="DirectlyIdentify.enterprise_import()">
+                                <i class="fa fa-plus"></i>&nbsp;导入机构数据
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/talent_template','/directly_identify/talent_template')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="Dict.delete()" id="">
+                                <i class="fa fa-plus"></i>&nbsp;人才导入模板下载
+                            </button>
+                            {/if}
+                            {if condition="chkCommission('/admin/directly_identify/import_talent','/directly_identify/import_talent')"}
+                            <button type="button" class="btn btn-sm btn-primary " onclick="Dict.delete()" id="">
+                                <i class="fa fa-plus"></i>&nbsp;导入人才数据
+                            </button>
+                            {/if}
+                        </div>
+                        <table id="directlyIdentifyTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                            <thead>
+                            <tr>
+                                <th data-field="selectItem" data-checkbox="true"></th>
+                            </tr>
+                            </thead>
+                        </table>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<!--核查征信导入模态框-->
+<div class="modal fade " id="enterpriseImportModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" id="importModalLabel">机构数据导入</h4>
+            </div>
+            <div class="modal-body">
+                <form id="enterprise-import-form" action="/admin/directly_identify/enterprise_import" method="post" enctype="multipart/form-data" target="hiddenIframe">
+                    <input type="file" id="file" name="file" onchange="$('#fileName').val($('#file').val());" class="hidden">
+                    <div class="form-group row">
+                        <div class="col-sm-1"></div>
+                        <div class="col-sm-11">
+                            <div class="input-group">
+                                <input type="text" class="form-control" id="fileName" name="fileName" placeholder="请选择需要上传的附件" readonly="readonly" >
+                                <span class="input-group-btn">
+                                    <button class="btn btn-secondary" type="button" onclick="$('#file').click()"><i class="fa fa-search"></i>选择文件</button>
+                                </span>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="DirectlyIdentify.importSubmit()">提交</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="/static/modular/directlyIdentify/index.js"></script>
+{/block}

+ 1 - 1
app/admin/view/enterprise/goto_enterprise_detail_page.html

@@ -185,7 +185,7 @@
                                 <td class="value1 word-wrap" style="border-right: 1px solid #c0a16b">
                                     {$ep.industryFieldOldName}
                                 </td>
-                                <td style="border: 1px solid #c0a16b">
+                                <td style="border: 1px solid #c0a16b;width: 300px">
                                     <label>
                                         行业领域佐证材料
                                     </label>

+ 1 - 0
app/admin/view/talent/talentInfo_base_check.html

@@ -228,6 +228,7 @@
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>工资发放月份</label>
                                                         <input type="text" class="form-control" id="salary_pay_month" value="{$info.salary_pay_month}"/>
+                                                        <span style="color: red">累计缴交月份6个月以上</span>
                                                     </div>
                                                 </td>
                                             </tr>

+ 1 - 1
app/common/api/ChuanglanSmsApi.php

@@ -28,7 +28,7 @@ class ChuanglanSmsApi {
             'phone' => $mobile,
             'report' => $needstatus,
         );
-        $deny_list = ["jjrcw.test", "jjrcw.test:8080"]; //拒绝短信名单
+        $deny_list = ["jjrcw.test", "jjrcw.test:8080","report.com"]; //拒绝短信名单
         if (in_array($_SERVER["HTTP_HOST"], $deny_list))
             return false; //测试不发送信息
         $result = $this->curlPost(self::API_SEND_URL, $postArr);

+ 3 - 0
app/index/controller/Auth.php

@@ -213,4 +213,7 @@ class Auth extends BaseController {
         }
     }
 
+    public function test(){
+        queue("app\job\Import", ["type" => 1, "info" => '11111']);
+    }
 }

+ 127 - 0
app/job/Import.php

@@ -0,0 +1,127 @@
+<?php
+
+namespace app\job;
+
+use think\queue\Job;
+use think\facade\Log;
+use think\facade\Db;
+use app\common\api\ChuanglanSmsApi;
+
+class Import{
+
+    public function fire(Job $job, $data) {
+        if ($this->deal($data)) {
+            Log::info(json_encode($data));
+            $job->delete();
+            return true;
+        }
+        Log::error(json_encode($data));
+        if ($job->attempts() >= 3) {
+            $job->delete();
+            return false;
+        }
+        $job->release(10); //10秒后重试
+    }
+
+    /**
+     * 处理业务逻辑
+     * @param type $data
+     * @return bool
+     */
+    public function deal($data): bool {
+        $res = Db::table("new_talent_zhiren")->where('id',$data['id'])->findOrEmpty();
+        if($res){
+            if($res['task_status'] != -1){
+                return false;
+            }
+            $datas = getExcelDatas($res['task_file']);
+            $datas = array_slice($datas, 1); //去标题
+            $inserts = [];
+            $street = Db::table("sys_dict")->where("pid",1655)->column("code","name");
+            while ($row = array_shift($datas)) {
+                $msg = [];
+                $item = [];
+                $cols = count($row);
+                $item['data'] = 1;
+                for ($i = 0; $i < $cols; $i++) {
+                    switch ($i){
+                        case 0:
+                            if(!in_array($row[$i],['企业用户','民办非企业','事业单位'])){
+                                if($row[$i] == '事业单位'){
+                                    $item['special'] = 1;
+                                }else{
+                                    $item['special'] = 0;
+                                }
+                            }else{
+                               array_push($msg,"导入的机构类型不正确");
+                            }
+                            break;
+                        case 1:
+                            if(empty($row[$i])){
+                                array_push($msg,"机构名称不能为空");
+                            }else{
+                                $info = Db::table("un_enterprise")->where('name',$row[$i])->findOrEmpty();
+                                if($info){
+                                    array_push($msg,"机构名称已存在,请检查");
+                                }else{
+
+                                    $isMatched = preg_match('/^[\x{4e00}-\x{9fa5}\(\)()\da-zA-Z&]{2,50}$/u', $row[$i], $matches);
+                                    if($isMatched){
+                                        $item['name'] = $row[$i];
+                                    }else{
+                                        array_push($msg,"机构名称只能是中文或数字");
+                                    }
+                                }
+                            }
+                            break;
+                        case 2:
+                            $info = Db::table("un_enterprise")->where('idCard',$row[$i])->findOrEmpty();
+                            if($info){
+                                array_push($msg,"机构代码已存在,请检查");
+                            }else{
+                                $item['idCard'] = $row[$i];
+                            }
+                            break;
+                        case 3:
+                            $item['agentName'] = $row[$i];
+                            break;
+                        case 4:
+                            $item['agentPhone'] = $row[$i];
+                            break;
+                        case 5:
+                            $item['street'] = array_key_exists($row[$i],$street) ? $street[$row[$i]] : '00000';
+                            break;
+                        case 6:
+                            $item['address'] = $row[$i];
+                            break;
+                        case 7:
+                            $item['ephone'] = $row[$i];
+                            break;
+                        case 8:
+                            $item['bankCard'] = $row[$i];
+                            break;
+                        case 9:
+                            $item['bank'] = $row[$i];
+                            break;
+                        case 10:
+                            $item['bankNetwork'] = $row[$i];
+                            break;
+                    }
+                }
+                if(count($msg) >= 1){
+
+                }
+
+                $companyIds = [];
+                $new = [];
+
+                $new["companyIds"] = $companyIds ? implode(",", $companyIds) : null;
+                $new["createTime"] = date("Y-m-d H:i:s");
+                $inserts[] = $new;
+            }
+
+        }else{
+            return false;
+        }
+    }
+}

BIN
public/static/downloadFile/directly_identify_enterprise_template.xlsx


+ 75 - 0
public/static/modular/directlyIdentify/index.js

@@ -0,0 +1,75 @@
+/**
+ * 表格初始化
+ */
+var DirectlyIdentify = {
+    id: "directlyIdentifyTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+DirectlyIdentify.initColumn = function () {
+    return [
+        {field: 'selectItem', radio: true},
+        {title: '人才层次', field: 'talentLevel', visible: true, align: 'center', valign: 'middle'},
+        {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return "晋江市现代产业体系人才";
+                }
+                if (value == 2) {
+                    return "集成电路优秀人才";
+                }
+            }
+        },
+        {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '有效期', field: 'activeYear', visible: true, align: 'center', valign: 'middle'},
+        {title: '是否启用', field: 'active', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">启用</button>";
+                }
+                if (value == 2) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">停用</button>";
+                }
+            }
+        },
+        {title: '审核单位', field: 'companyNames', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'},
+    ];
+};
+
+//模板下载
+DirectlyIdentify.download_enterprise_template = function () {
+    window.location.href = Feng.ctxPath + "/static/downloadFile/directly_identify_enterprise_template.xlsx";
+}
+
+DirectlyIdentify.enterprise_import = function () {
+    $("#enterprise-import-form")[0].reset();
+    $("#enterpriseImportModal").modal("show");
+}
+
+DirectlyIdentify.enterpriseImportSubmit = function () {
+    $("#enterprise-import-form")[0].submit();
+}
+
+
+$(function () {
+
+    var defaultColunms = DirectlyIdentify.initColumn();
+    var table = new BSTable(DirectlyIdentify.id, "/admin/directly_identify/list", defaultColunms);
+    table.setPaginationType("server");
+    DirectlyIdentify.table = table.init();
+    //下拉框数据动态加载
+    Feng.addAjaxSelect({
+        "id": "talentLevel",
+        "displayCode": "code",
+        "displayName": "name",
+        "type": "GET",
+        "url": "/admin/dict/findChildDictByCode?code=talent_arrange"
+    });
+
+});