10 コミット 8f87424779 ... 9d34c0f2d0

作者 SHA1 メッセージ 日付
  hzd 9d34c0f2d0 修改 4 ヶ月 前
  hzd aeca21dd6c Merge branch 'master' of http://121.36.46.135:3000/shangshang/jili2 4 ヶ月 前
  hzd 44c1c0806d xg 4 ヶ月 前
  hzd 6f0820d9b3 优化 4 ヶ月 前
  ss df307a2351 1 5 ヶ月 前
  ss 6f85991dad 1 5 ヶ月 前
  ss f3cc29ddee 11 5 ヶ月 前
  ss b3b95ca725 11 5 ヶ月 前
  ss 0cd1469bc7 1 5 ヶ月 前
  ss 33d2a96cf2 初始化 5 ヶ月 前

+ 1 - 0
application/admin/controller/Orders.php

@@ -1324,6 +1324,7 @@ class Orders extends Auth {
                 ->where($map)
                 ->order(['o.order_mode' => 'asc', 'oc.xq_time' => 'desc'])
                 ->select();
+            halt($lists);
             $newret = [];
             $newret1 = [];
             $newret2 = [];

+ 3 - 2
application/admin/view/common/login.html

@@ -87,7 +87,7 @@
         </div>
 
         <div class="zi">
-            <img src="/static/admin/img/zi.png" alt="">
+<!--            <img src="/static/admin/img/zi.png" alt="">-->
         </div>
     </div>
 
@@ -119,8 +119,9 @@
         </form>
     </div>
 </div>-->
-<div class="copyright-text">
+<div class="copyright-text" style="color: #ffffff;">
 <!--    Copyright © 2023 明德智慧医院后勤一站式服务平台 版权所有-->
+    备案号: <a href="https://beian.miit.gov.cn"><span style="color: #ffffff;">湘ICP备2021008204号-1</span></a>
 </div>
 <script src="/static/hplus/js/jquery.min.js?v=2.1.4"></script>
 <script src="/static/hplus/js/bootstrap.min.js?v=3.3.7"></script>

+ 26 - 3
application/common/model/Orders.php

@@ -138,6 +138,10 @@ class Orders extends Base {
                 if (!isset($data['to_user_id']) || empty($data['to_user_id'])) {
                     $this->error = '请选择执行人';
                     return false;
+//                    $sData['order_mode'] = 1;
+//                    $data['to_user_id'] = "";
+                }else{
+//                    $sData['order_mode'] = 4;
                 }
                 if ($data['work_type_mode'] == 1) {
                     if (!isset($data['type_id']) || empty($data['type_id'])) {
@@ -222,7 +226,26 @@ class Orders extends Base {
                 $conveyCate = Db::name('convey_cate')
                     ->where('id', $data['type'])
                     ->find();
-                if($conveyCate['cate']==4){
+                if($conveyCate){ // 需求时间和应完成时间,都由前端传
+                    if(!$data['xq_time'] || !$data['ywc_time']){
+                        $data['xq_time'] = date('Y-m-d H:i:s');
+                        $time = Db::name('time')
+                            ->where('id',$conveyCate['time_id'])
+                            ->find();
+                        $data['ywc_time'] = date('Y-m-d H:i',strtotime($data['xq_time']) + 60*$time['bz_time']);
+                    }else{
+                        if ($data['xq_time'] >= $data['ywc_time']) {
+                            $this->error = '应完成时间应大于需求时间';
+                            return false;
+                        }
+                        if (strtotime($data['xq_time']) < time() - 10 * 60) {
+                            $this->error = '需求时间已过时';
+                            return false;
+                        }
+                    }
+                }
+
+                /*if($conveyCate['cate']==4){
                     if (!$data['xq_time'] || !$data['ywc_time']) {
                         $this->error = '应完成时间应和需求时间不能为空';
                         return false;
@@ -241,7 +264,7 @@ class Orders extends Base {
                         ->where('id',$conveyCate['time_id'])
                         ->find();
                     $data['ywc_time'] = date('Y-m-d H:i',strtotime($data['xq_time']) + 60*$time['bz_time']);
-                }
+                }*/
 
 
                 $ysData = array(
@@ -311,7 +334,7 @@ class Orders extends Base {
                         $data['to_user_id'] = $data['user_id'];
                     }
                     $send_user_num = $this->sendUserNum($data['work_type_mode'],$data['org_id']);
-                    $users = explode(',', $data['to_user_id']);
+                    $users = empty($data['to_user_id'])?[]:explode(',', $data['to_user_id']);
                     if($send_user_num==1 && count($users) >1){
                         exception('执行人只能选择单人');
                     }

+ 136 - 0
application/index/controller/Index.php

@@ -22,6 +22,7 @@ class Index extends Controller
         set_time_limit(0);
         ini_set("memory_limit","512M");
 
+        exit();
         $file = "./1.xls";
         $orgId = 100;
         $cate1 = 22; //灭火器
@@ -59,6 +60,141 @@ class Index extends Controller
         halt($data);
     }
 
+    public function device2(){
+        set_time_limit(0);
+        ini_set("memory_limit","2048M");
+
+        $file = "./2.xls";
+        $orgId = 100;
+        $cate1 = 24; //月度
+        $cate2 = 25; //季度
+        $cate3 = 26; //年度
+        $cate4 = 27; //半年度
+
+        $form1 = "20,21,22,23";
+        $form2 = "24,25,26,27";
+
+        $userId = 3139;
+
+        $data = ExcelUtil::read($file,['num','title','sn','spec','content','area','forms','cate']);
+//        halt($data);
+
+        $forms = [];
+
+        $i = 0;
+        foreach ($data as $k=>$v){
+            $forms = array_merge($forms,explode(";",$v['forms']));
+            if($i >= 228){
+                $device = [
+                    'org_id' => $orgId,
+                    'title' => $v['title'],
+                    'cate_id' => 0,
+                    'enable' => 1,
+                    'del' => 0,
+                    'create_time' => getTime(),
+                    'sn' => $v['sn'],
+                    'spec' => $v['spec'],
+                    'area' => $v['area'],
+                    'content' => $v['content']
+                ];
+                $cateId = 0;
+                if($v['cate'] == "1年/次"){
+                    $cateId = $cate3;
+                    //$data[$k]['device_form'] = $form1;
+                }if($v['cate'] == "1季度/次"){
+                    $cateId = $cate2;
+                    //$data[$k]['device_form'] = $form1;
+                }if($v['cate'] == "1月/次"){
+                    $cateId = $cate1;
+                    //$data[$k]['device_form'] = $form1;
+                }else{
+                    $cateId = $cate4;
+//                    $data[$k]['device_form'] = $form2;
+                }
+                $device['cate_id'] = $cateId;
+                $farr = $this->formatForms(explode(";",$v['forms']));
+                $formIds = [];
+                foreach ($farr as $kk=>$vv){
+                    // 检查是否已存在
+                    $forminfo = Db::name("device_form")->where('org_id',$orgId)->where('cate_id',$cateId)->where('title',$vv)->find();
+                    if($forminfo){
+                        $formIds[] = $forminfo['id'];
+                    }else{
+                        $fid = Db::name("device_form")->insertGetId([
+                            'org_id' => $orgId,
+                            'cate_id' => $cateId,
+                            'title' => $vv,
+                            'sort' => 50,
+                            'del' => 0,
+                            'enable' => 1,
+                            'create_time' => getTime()
+                        ]);
+                        $formIds[] = $fid;
+                    }
+                }
+                $device['device_form'] = implode(",",$formIds);
+
+                $deivceId = Db::name('device')->insertGetId($device);
+                if($deivceId){
+                    Db::name('device_user')->insert([
+                        "device_id" => $deivceId,
+                        "user_id" => $userId,
+                    ]);
+                }
+            }
+
+            $i++;
+        }
+
+
+//        $forms = array_unique($forms);
+//        $nforms = [];
+//        foreach ($forms as $k=>$v){
+//            if(!empty(trim($v))){
+//                $nforms[] = $this->format($v);
+//            }
+//        }
+//
+//        $farr = [];
+//        foreach ($nforms as $k=>$v){
+//            $farr[] = [
+//                "org_id" => $orgId,
+//                "title" => $v,
+//                "sort" => 50,
+//                "del" => 0,
+//                "enable" => 1,
+//                "create_time" => getTime(),
+//            ];
+//        }
+//
+//        $ids = [20,21,22,23,24,25,26,27];
+
+//        dump($nforms);
+        halt($data);
+    }
+
+    public function formatForms($lists){
+        $forms = array_unique($lists);
+        $nforms = [];
+        foreach ($forms as $k=>$v){
+            if(!empty(trim($v))){
+                $nforms[] = $this->format($v);
+            }
+        }
+        return $nforms;
+    }
+
+    public function format($val){
+        $ff = [
+            '1.','2.','3.','4.','5.','6.','7.','8.','9.',
+            '5、','6、','7,'
+        ];
+        foreach ($ff as $k=>$v){
+            $val = str_ireplace($v,"",$val);
+        }
+        return trim($val);
+    }
+
     public function tt(){
         $orgId = 28;
         $mode = 3;

BIN
public/logo-old.png


BIN
public/logo.png


+ 1 - 1
public/static/admin/css/login.css

@@ -129,7 +129,7 @@ body {
     font-weight: 400;
     color: #023894;
     position: fixed;
-    /*left: 40%;*/
+    left: 40%;
     top: 90%;
     right: 10%;
 }