root 1 年間 前
コミット
408e908023
100 ファイル変更7349 行追加580 行削除
  1. 1 1
      .env
  2. 11 1
      app/BaseController.php
  3. 33 0
      app/common.php
  4. 139 0
      app/controller/Base.php
  5. 155 0
      app/controller/Briefing.php
  6. 138 0
      app/controller/Check.php
  7. 282 0
      app/controller/Enterprises.php
  8. 34 0
      app/controller/EsConnect.php
  9. 141 0
      app/controller/Grid.php
  10. 165 0
      app/controller/Gridperson.php
  11. 54 26
      app/controller/Index.php
  12. 143 0
      app/controller/Input.php
  13. 154 0
      app/controller/InputUse.php
  14. 154 0
      app/controller/Pesticide.php
  15. 64 0
      app/controller/ProPch.php
  16. 160 0
      app/controller/Product.php
  17. 228 0
      app/controller/ProductBatch.php
  18. 84 0
      app/controller/ProductClass.php
  19. 24 0
      app/controller/Qkjb.php
  20. 107 0
      app/controller/Statstics.php
  21. 63 0
      app/controller/Sym.php
  22. 115 0
      app/controller/UploadFile.php
  23. 60 0
      app/controller/ZdXzq.php
  24. 1 1
      app/middleware.php
  25. 3 2
      app/model/Base.php
  26. 10 0
      app/model/Check.php
  27. 10 0
      app/model/CheckDetail.php
  28. 10 0
      app/model/Enterprises.php
  29. 1 1
      app/model/Grid.php
  30. 12 0
      app/model/Input.php
  31. 11 0
      app/model/InputUse.php
  32. 10 0
      app/model/PesticideList.php
  33. 10 0
      app/model/ProPch.php
  34. 12 0
      app/model/Product.php
  35. 12 0
      app/model/ProductBatch.php
  36. 10 0
      app/model/ProductClass.php
  37. 1 1
      app/model/Qkjb.php
  38. 10 0
      app/model/Statstics.php
  39. 10 0
      app/model/User.php
  40. 10 0
      app/model/ZdXzq.php
  41. 10 0
      app/service/Base.php
  42. 44 0
      app/service/BaseService.php
  43. 13 0
      app/service/CheckDetailService.php
  44. 21 0
      app/service/CheckService.php
  45. 8 0
      app/service/Enterprises.php
  46. 70 0
      app/service/EnterprisesService.php
  47. 54 0
      app/service/GridService.php
  48. 56 0
      app/service/InputService.php
  49. 54 0
      app/service/InputuseService.php
  50. 0 22
      app/service/NszyService.php
  51. 54 0
      app/service/PesticideListService.php
  52. 23 0
      app/service/ProPchService.php
  53. 91 0
      app/service/ProductBatchService.php
  54. 48 0
      app/service/ProductClassService.php
  55. 41 0
      app/service/ProductService.php
  56. 54 0
      app/service/QkjbService.php
  57. 0 23
      app/service/QyBasicService.php
  58. 0 22
      app/service/RyService.php
  59. 24 0
      app/service/StatsticsService.php
  60. 77 0
      app/service/UserService.php
  61. 0 13
      app/service/ZdCpmcService.php
  62. 33 0
      app/service/ZdXzqService.php
  63. 32 0
      app/validate/Base.php
  64. 31 0
      app/validate/EditProduct.php
  65. 22 0
      app/validate/EditUserInfo.php
  66. 28 0
      app/validate/Enterprises.php
  67. 20 0
      app/validate/EnterprisesLogin.php
  68. 22 0
      app/validate/GridAdd.php
  69. 17 0
      app/validate/Id.php
  70. 20 0
      app/validate/InputAdd.php
  71. 29 0
      app/validate/Inputuse.php
  72. 19 0
      app/validate/Page.php
  73. 20 0
      app/validate/PesticideList.php
  74. 24 0
      app/validate/ProPchAdd.php
  75. 31 0
      app/validate/Product.php
  76. 23 0
      app/validate/ProductBatch.php
  77. 20 0
      app/validate/Qkjb.php
  78. 17 0
      app/validate/Qydm.php
  79. 17 0
      app/validate/RePassword.php
  80. 19 0
      app/validate/Statistic.php
  81. 4 4
      app/validate/UserLogin.php
  82. 25 0
      app/validate/getListByqydm.php
  83. 3 1
      composer.json
  84. 1738 274
      composer.lock
  85. 17 6
      config/apidoc.php
  86. 13 0
      config/cache.php
  87. 7 1
      config/database.php
  88. 9 0
      config/filesystem.php
  89. 42 0
      default.conf
  90. 17 0
      docs/baseDB.md
  91. 48 0
      docs/enterprises.md
  92. BIN
      docs/img.png
  93. BIN
      docs/img_1.png
  94. 22 0
      docs/inputDB.md
  95. 18 0
      docs/inputUse.md
  96. 24 0
      docs/productDB.md
  97. 9 1
      vendor/composer/autoload_files.php
  98. 21 1
      vendor/composer/autoload_psr4.php
  99. 132 2
      vendor/composer/autoload_static.php
  100. 1362 177
      vendor/composer/installed.json

+ 1 - 1
.env

@@ -1 +1 @@
-APP_DEBUG = true

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = 121.41.26.116
DATABASE = ah
USERNAME = root
PASSWORD = aielabzyh@661130
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true
PREFIX = t_

[LANG]
default_lang = zh-cn
[JWT]
SECRET=7acc0207b7624f2d2a34249aec6e5089
TTL = 86400
+APP_DEBUG = true
ALIYUN_OSS_ACCESS_ID=LTAI4G1xGunUnwkgq48jFWi9
ALIYUN_OSS_ACCESS_KEY=17PK5dY7WnLJR1ejgsopTUBUOzS05S
ALIYUN_OSS_BUCKET=ahwgh
ALIYUN_OSS_ENDPOINT=oss-cn-hangzhou.aliyuncs.com
ALIYUN_OSS_IS_CNAME=false
ALIYUN_OSS_CDN_DOMAIN=
ALIYUN_OSS_IS_SSL=false
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE=mysql
HOSTNAME=116.62.102.18
DATABASE=ahjg
USERNAME=root
PASSWORD = aielabzyh@661130
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true
PREFIX = t_

[LANG]
default_lang = zh-cn
[JWT]
SECRET=7acc0207b7624f2d2a34249aec6e5089
TTL = 86400

+ 11 - 1
app/BaseController.php

@@ -3,6 +3,7 @@ declare (strict_types = 1);
 
 namespace app;
 
+use app\controller\ResponseJson;
 use think\App;
 use think\exception\ValidateException;
 use think\Validate;
@@ -53,7 +54,7 @@ abstract class BaseController
     // 初始化
     protected function initialize()
     {}
-
+    use ResponseJson;
     /**
      * 验证数据
      * @access protected
@@ -91,4 +92,13 @@ abstract class BaseController
         return $v->failException(true)->check($data);
     }
 
+    protected function  uuid()
+    {
+        //        $uuid = substr ( $chars, 0, 8 ) . '-'
+//            . substr ( $chars, 8, 4 ) . '-'
+//            . substr ( $chars, 12, 4 ) . '-'
+//            . substr ( $chars, 16, 4 ) . '-'
+//            . substr ( $chars, 20, 12 );
+        return md5(uniqid((string)mt_rand(), true));
+    }
 }

+ 33 - 0
app/common.php

@@ -1,7 +1,40 @@
 <?php
 use thans\jwt\facade\JWTAuth;
 // 应用公共文件
+function getXzqdm(){
+    $payload = JWTAuth::auth();
+    return $payload['xzqdm']->getValue();
+}
+function getUserId(){
+    $payload = JWTAuth::auth();
+    return $payload['id']->getValue();
+}
+
 function getQydm(){
     $payload = JWTAuth::auth();
     return $payload['qydm']->getValue();
+}
+
+/**
+ * @return false|string
+ * 获取行政区代码,并去除结尾的0
+ */
+function getXzqdmSub(){
+    $payload = JWTAuth::auth();
+    $xzqdm = $payload['xzqdm']->getValue();
+    $province = substr($xzqdm,3);
+    $city = substr($xzqdm,4);
+
+    $country = substr($xzqdm,6);
+    if($province === "000000"){
+        $code = substr($xzqdm,0,2);
+    }else if ($city === "00000"){
+        $code = substr($xzqdm,0,4);
+    }else if ($country === "000"){
+        $code = substr($xzqdm,0,6);
+    }else{
+       $code = $xzqdm ;
+    }
+
+    return $code;
 }

+ 139 - 0
app/controller/Base.php

@@ -0,0 +1,139 @@
+<?php
+
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\BaseService;
+use app\service\EnterprisesService;
+use app\validate\getListByqydm;
+use app\validate\Id;
+use app\validate\Page;
+use app\validate\Qydm;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+/**
+ * @Apidoc\Title("基地信息")
+ * @Apidoc\Group("基地")
+ * @Apidoc\Sort (7)
+ */
+class Base extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+
+    /**
+     * @Apidoc\Title("通过企业代码查基地信息")
+     * @Apidoc\Tag("基地")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("getBaseListByQydm",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getBaseListByQydm():Json
+    {
+        $page=$this->request->get();
+        try{
+            validate(getListByqydm::class)->check($page);
+        }catch(ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(BaseService::getBaseInfoByQydm($page,$page["qydm"])) ;
+
+    }
+    /**
+     * @Apidoc\Title("通过ID查基地信息")
+     * @Apidoc\Tag("基地")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("getBaseInfoById",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getBaseInfoById():Json
+    {
+        $id=$this->request->get();
+        try{
+            validate(Id::class)->check($id);
+        }catch(ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(BaseService::getBaseInfoById($id["id"])) ;
+
+    }
+
+    /**
+     * @Apidoc\Title("删除基地信息")
+     * @Apidoc\Tag("基地")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("delBaseInfoById",method="POST")
+     * @Middleware({"jwt"})
+     */
+
+    public function delBaseInfoById():Json
+    {
+        $id = $this->request->post();
+        try {
+            validate(Id::class)->check($id);
+        } catch (ValidateException $e) {
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(BaseService::delBase($id["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+
+    /**
+     * @Apidoc\Title("通过ID更新基地信息")
+     * @Apidoc\Tag("基地")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("updateBaseById",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function updateBaseById():Json
+    {
+        $info= $this->request->post();
+        try {
+            validate(Id::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+            return $this->JsonSucess(BaseService::editBaseInfo($info,$info["id"]));
+
+    }
+
+    /**
+     * @Apidoc\Title("添加基地信息")
+     * @Apidoc\Tag("基地")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("addBaseInfo",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addBaseInfo():Json
+    {
+        $info= $this->request->post();
+        try {
+            validate(\app\validate\Base::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(BaseService::addBase($info));
+
+    }
+
+
+
+}

+ 155 - 0
app/controller/Briefing.php

@@ -0,0 +1,155 @@
+<?php
+
+
+namespace app\controller;
+
+
+use app\BaseController;
+
+
+use app\service\GridService;
+use app\service\QkjbService;
+use app\validate\getListByqydm;
+use app\validate\Id;
+use app\validate\Qkjb;
+use app\validate\Page;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+
+
+/**
+ * @Apidoc\Title("农药残留突出问题攻坚治理")
+ * @Apidoc\Group("情况简报")
+ * @Apidoc\Sort(11)
+ */
+
+class Briefing extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+
+
+    /**
+     * @Apidoc\Title("农药残留突出问题攻坚治理信息列表")
+     * @Apidoc\Tag("情况简报")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getQkjbList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getQkjbList():Json{
+
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            $page["page"]=1;
+            $page["size"] = 10;
+        }
+
+        try {
+            return $this->JsonSucess(QkjbService::getQkjbList($page, getXzqdmSub()));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("添加情况简报")
+     * @Apidoc\Tag("添加情况简报")
+     * @Apidoc\Method ("POST")
+     * @Route("/addQkjb",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addQkjb(): Json
+    {
+        $data =  $this->request->post();
+        try {
+            validate(Qkjb::class)->check($data);
+            $data['creation_time']   = date('Y-m-d h:i:s', time());
+            $result = QkjbService::addQkjb($data);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("修改情况简报")
+     * @Apidoc\Tag("修改情况简报")
+     * @Apidoc\Method ("POST")
+     * @Route("/editgrid",method="POST")
+     * @Middleware({"jwt"})
+     */
+    //修改
+    public function updateQkjbById(): Json
+    {
+        $data= $this->request->get();
+        try {
+            validate(Id::class)->check($data);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(QkjbService::editQkjbInfo($data, $data["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("删除情况简报")
+     * @Apidoc\Tag("删除情况简报")
+     * @Apidoc\Method ("Post")
+     * @Route("/deleteqkjb",method="Post")
+     * @Middleware({"jwt"})
+     */
+    //删除
+    public function deleteQkjbById(): Json{
+        $id=$this->request->post();
+        try {
+            validate(Id::class)->check($id);
+            $result = QkjbService::deleteQkjb($id);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+
+
+
+
+
+
+}

+ 138 - 0
app/controller/Check.php

@@ -0,0 +1,138 @@
+<?php
+
+namespace app\controller;
+use app\BaseController;
+use app\model\CheckDict;
+use app\service\CheckClassService;
+use app\service\CheckDetailService;
+use app\service\CheckService;
+use app\service\ZdXzqService;
+use app\service\EnterprisesService;
+use app\validate\Id;
+use app\validate\Page;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use think\exception\ValidateException;
+use think\response\Json;
+
+/**
+ * @Apidoc\Title("现场检查列表")
+ * @Apidoc\Group("巡检")
+ * @Apidoc\Sort (9)
+ */
+class Check extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    /**
+     * @Apidoc\Title("获取现场检查列表")
+     * @Apidoc\Tag("巡检")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getCheckList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getCheckList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(CheckService::getCheckList($page,getXzqdmSub()));
+    }
+    /**
+     * @Apidoc\Title("获取待检检查列表")
+     * @Apidoc\Tag("巡检")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getWaitCheckList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getWaitCheckList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        
+        $res = EnterprisesService::getEnterPrisesList($page, getXzqdmSub());
+        foreach ($res["row"] as $key => $value){
+           
+            $res["row"][$key]["townsc"]=ZdXzqService::getXzqDetail($value["towns"]);
+            $res["row"][$key]["countryc"] = ZdXzqService::getXzqDetail(str_pad(substr($value["towns"],0,6),9,'0'));
+            $res["row"][$key]["cityc"] = ZdXzqService::getXzqDetail(str_pad(substr($value["towns"],0,4),9,'0'));
+        }
+        return $this->JsonSucess($res);
+    }
+
+    /**
+     * @Apidoc\Title("获取现场检查项目16项总表列表")
+     * @Apidoc\Tag("巡检")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("getCheckDict",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getCheckDict():Json
+    {
+        return $this->JsonSucess(CheckClassService::getCheckDict());
+    }
+    /**
+     * @Apidoc\Title("获取现场检查项目详情列表根据check_class_id")
+     * @Apidoc\Tag("巡检")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("郑雪瑞")
+     * @Route("getCheckDetailDict",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getCheckDetailDict():Json
+    {
+        $id = $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+
+        }
+        return $this->JsonSucess(CheckClassService::getCheckDetailByCheckId($id["id"]));
+    }
+
+
+    /**
+     * @Apidoc\Title("添加检查信息")
+     * @Apidoc\Tag("巡检")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("addCheckInfo",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addCheckInfo(): Json
+    {
+        $data=$this->request->post();
+        $data["is_pass"]=0;
+        $data["nopass"]=0;
+        for ($i=0;$i<count($data["detail"]);$i++){
+
+            if ($data["detail"][$i]["check_res"]=="1" || $data["detail"][$i]["check_res"]=="2"){
+                $data["is_pass"]++;
+            }else{
+                $data["nopass"]++;
+            }
+        }
+        $id=CheckService::addCheck($data);
+        for ($j=0;$j<count($data["detail"]);$j++){
+            $data["detail"][$i]["check_id"]=$id;
+            CheckDetailService::addCheckDetail($data["detail"][$i]);
+        }
+        return $this->JsonSucess();
+
+
+    }
+
+
+}

+ 282 - 0
app/controller/Enterprises.php

@@ -0,0 +1,282 @@
+<?php
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\EnterprisesService;
+use app\service\UserService;
+use app\validate\Id;
+use app\validate\Page;
+use app\validate\Qydm;
+use app\validate\EnterprisesLogin;
+use app\validate\UserLogin;
+use thans\jwt\facade\JWTAuth;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+/**
+ * @Apidoc\Title("企业信息")
+ * @Apidoc\Group("企业")
+ * @Apidoc\Sort (3)
+ */
+class Enterprises extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+    /**
+     * @Apidoc\Title("企业列表")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getEnterPrisesList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getEnterPrisesList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            $page["page"]=1;
+            $page["size"] = 15;
+        }
+
+        try {
+         return $this->JsonSucess(EnterprisesService::getEnterPrisesList($page, getXzqdmSub()));
+        } catch (DataNotFoundException $dbE) {
+            return $this->JsonError($dbE);
+        } catch (ModelNotFoundException $dbE) {
+            return $this->JsonError($dbE);
+        } catch (DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+
+    }
+    /**
+     * @Apidoc\Title("企业信息by ID")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getEnterPrisesInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getEnterPrisesInfo(): Json
+    {
+        $id= $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+
+        try {
+            return $this->JsonSucess(EnterprisesService::getEnterprisesInfoById($id["id"]));
+        } catch (DataNotFoundException $dbE) {
+            return $this->JsonError($dbE);
+        } catch (ModelNotFoundException $dbE) {
+            return $this->JsonError($dbE);
+        } catch (DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+
+    }
+    /**
+     * @Apidoc\Title("企业信息by Qydm")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getEnterPrisesByQydm",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getEnterPrisesByQydm(): Json
+    {
+        $qydm= $this->request->get();
+        try {
+            validate(Qydm::class)->check($qydm);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+
+        try {
+            return $this->JsonSucess(EnterprisesService::getEnterprisesInfoByQydm(getQydm()));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE->getMessage());
+        }
+
+    }
+    /**
+     * @Apidoc\Title("监管企业信息by Qydm")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getEnterPrisesByQydmGOV",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getEnterPrisesByQydmGOV(): Json
+    {
+        $qydm= $this->request->get();
+        try {
+            validate(Qydm::class)->check($qydm);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+
+        try {
+            return $this->JsonSucess(EnterprisesService::getEnterprisesInfoByQydm($qydm["qydm"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE->getMessage());
+        }
+
+    }
+    /**
+     * @Apidoc\Title("删除企业信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("delEnterPrisesById",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function delEnterPrisesById(): Json
+    {
+        $id= $this->request->POST();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(EnterprisesService::delEnterprises($id["id"]));
+        } catch (DataNotFoundException $dbE) {
+             return $this->JsonError($dbE->getMessage());
+        } catch (ModelNotFoundException $dbE) {
+           return $this->JsonError($dbE->getMessage());
+        } catch (DbException $dbE) {
+            return $this->JsonError($dbE->getMessage());
+        }
+
+    }
+    /**
+     * @Apidoc\Title("更新企业信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("updateEnterPrisesById",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function updateEnterPrisesById(): Json
+    {
+        $info= $this->request->post();
+        try {
+            validate(Qydm::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(EnterprisesService::editEnterprisesInfo($info,$info["id"]));
+        } catch (DataNotFoundException $dbE) {
+           
+            return $this->JsonError($dbE->getMessage());
+        } catch (ModelNotFoundException $dbE) {
+           
+           return $this->JsonError($dbE->getMessage());
+        } catch (DbException $dbE) {
+             
+            return $this->JsonError($dbE->getMessage());
+        }
+
+    }
+    /**
+     * @Apidoc\Title("添加企业信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("addEnterPrises",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addEnterPrises(): Json
+    {
+        $info= $this->request->post();
+      try {
+            validate(\app\validate\Enterprises::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        if ($info["entity_type"]=="个人"){
+            $info["qydm"]=$info["towns"].".".$info["fzr_id_number"];
+        }else{
+            $info["qydm"]=$info["towns"].".".$info["xydm"];
+        }
+
+        return $this->JsonSucess(EnterprisesService::addEnterprises($info));
+
+    }
+
+
+    /**
+     * @Apidoc\Title("企业用户登录接口")
+     * @Apidoc\Tag("企业用户登录")
+     * @Apidoc\Author("yang")
+     * @Apidoc\Method ("POST")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Route("enterpriseslogin",method="POST")
+     * @Middleware({})
+     */
+    public function enterpriseslogin():Json{
+        $loginInfo =  $this->request->post();
+        // dump($loginInfo);die;
+        try {
+            validate(EnterprisesLogin::class)->check($loginInfo);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        $userInfo=EnterprisesService::selectLoginInfo($loginInfo);
+        if ($userInfo){
+            $token = JWTAuth::builder(['qydm' => $userInfo["qydm"]]);//参数为用户认证的信息,请自行添加
+            return $this->JsonSucess(["token"=>$token,"userInfo"=>$userInfo],1);
+        }else{
+            return $this->JsonError(1002);
+        }
+
+
+    }
+
+
+    /**
+     * @Apidoc\Title("注册企业信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("yang")
+     * @Route("registerEnterPrises",method="POST")
+     * @Middleware({})
+     */
+    public function registerEnterPrises(): Json
+    {
+        $info= $this->request->post();
+        try {
+            validate(\app\validate\Enterprises::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        if ($info["entity_type"]=="个人"){
+            $info["qydm"]=$info["towns"].".".$info["fzr_id_number"];
+        }else{
+            $info["qydm"]=$info["towns"].".".$info["xydm"];
+        }
+
+        $info['creation_time']   = date('Y-m-d h:i:s', time());
+        return $this->JsonSucess(EnterprisesService::addEnterprises($info));
+
+    }
+
+
+}

+ 34 - 0
app/controller/EsConnect.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace app\controller;
+
+use think\facade\Db;
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+/**
+ * @Apidoc\Title("ElaticSearch")
+ * @Apidoc\Group("ElaticSearch")
+ * @Apidoc\Sort (10)
+ */
+class EsConnect extends \app\BaseController
+{
+    /**
+     * @Apidoc\Title("saveEs")
+     * @Apidoc\Tag("saveEs")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("saveEs",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function saveEs(){
+
+
+      $res=Db::connect("elasticsearch")->name('enterprises')->select();
+        return $this->JsonSucess($res);
+    }
+
+
+
+}

+ 141 - 0
app/controller/Grid.php

@@ -0,0 +1,141 @@
+<?php
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\GridService;
+use app\validate\GridAdd;
+use app\validate\Id;
+use app\validate\Page;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+
+/**
+ * @Apidoc\Title("网格点信息")
+ * @Apidoc\Group("grid")
+ * @Apidoc\Sort(6)
+ */
+class Grid extends BaseController
+{
+    use ResponseJson;
+
+    //新增方法
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("添加网格点")
+     * @Apidoc\Tag("添加网格点")
+     * @Apidoc\Method ("POST")
+     * @Route("/addgrid",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addGrid(): Json
+    {
+        $gridInfo =  $this->request->post();
+        try {
+            validate(GridAdd::class)->check($gridInfo);
+            $gridInfo['creation_time']   = date('Y-m-d h:i:s', time());
+            $result = GridService::addGrid($gridInfo);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("删除网格点")
+     * @Apidoc\Tag("删除网格点")
+     * @Apidoc\Method ("Post")
+     * @Route("/delgrid",method="Post")
+     * @Middleware({"jwt"})
+     */
+    //删除
+    public function del(): Json{
+        $id=$this->request->post();
+        try {
+            validate(Id::class)->check($id);
+            $result = GridService::delGrid($id);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("修改网格点信息")
+     * @Apidoc\Tag("修改网格点信息")
+     * @Apidoc\Method ("Get")
+     * @Route("/editgrid",method="Get")
+     * @Middleware({"jwt"})
+     */
+
+    //修改
+    public function updateGridById(): Json
+    {
+        $info= $this->request->get();
+        try {
+            validate(Id::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(GridService::editGridInfo($info,$info["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("查询网格点信息")
+     * @Apidoc\Tag("查询网格点信息")
+     * @Apidoc\Method ("Get")
+     * @Route("/infogrid",method="Get")
+     * @Middleware({"jwt"})
+     */
+    //查询
+    public function getGridList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            $page["page"]=1;
+            $page["size"] = 15;
+        }
+
+        try {
+            return $this->JsonSucess(GridService::getGridList($page, getXzqdmSub()));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+
+    }
+}

+ 165 - 0
app/controller/Gridperson.php

@@ -0,0 +1,165 @@
+<?php
+
+
+namespace app\controller;
+
+
+use app\BaseController;
+use app\service\EnterprisesService;
+use app\service\UserService;
+use app\validate\Page;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+
+/**
+ * @Apidoc\Title("网格监管人员信息")
+ * @Apidoc\Group("gridperson")
+ * @Apidoc\Sort(2)
+ */
+class Gridperson extends BaseController
+{
+
+    use ResponseJson;
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("获取网格人员信息")
+     * @Apidoc\Tag("网格人员查询")
+     * @Apidoc\Method ("POST")
+     * @Route("/getgridpersoninfolist",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function getGridPersonInfoList(): Json{
+        $page = $this->request->post();
+
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            $page["page"]=1;
+            $page["size"] = 10;
+        }
+
+        try {
+            return $this->JsonSucess(UserService::getUserInfoList($page, getXzqdmSub()));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+
+    }
+
+    
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("网格人员信息添加")
+     * @Apidoc\Tag("网格人员")
+     * @Apidoc\Method ("POST")
+     * @Route("/addgridperson",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addGridPerson(): Json{
+        $data = $this->request->post();
+        try {
+            //validate(gridPersonInfo::class)->check($data);
+            $data['creation_time']   = date('Y-m-d h:i:s', time());
+            return $this->JsonSucess(UserService::saveUserInfo($data));
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+
+    }
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("通过id获取网格人员信息")
+     * @Apidoc\Tag("网格人员")
+     * @Apidoc\Method ("GET")
+     * @Route("/getgridpersonbyid",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getGridPersoninfoById(): Json{
+        $data = $this->request->get();
+        try {
+            //validate(gridPersonInfo::class)->check($data);
+
+            return $this->JsonSucess(UserService::getgridpersonInfoById($data['id']));
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+
+    }
+
+
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("网格人员信息修改")
+     * @Apidoc\Tag("网格人员")
+     * @Apidoc\Method ("POST")
+     * @Route("/editgridperson",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function editGridPersoninfoById(): Json{
+        $data = $this->request->post();
+        try {
+            //validate(gridPersonInfo::class)->check($data);
+            $data['last_update_time']   = date('Y-m-d h:i:s', time());
+            return $this->JsonSucess(UserService::editUserInfoById($data['id'],$data));
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("通过id删除网格人员信息")
+     * @Apidoc\Tag("网格人员")
+     * @Apidoc\Method ("GET")
+     * @Route("/deletegridperson",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function deleteGridPersoninfoById(): Json{
+        $data = $this->request->get();
+        try {
+            //validate(gridPersonInfo::class)->check($data);
+            $data['last_update_time']   = date('Y-m-d h:i:s', time());
+            return $this->JsonSucess(UserService::deleteUserInfoById($data['id']));
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+
+    }
+
+
+
+
+}

+ 54 - 26
app/controller/Index.php

@@ -2,13 +2,11 @@
 namespace app\controller;
 
 use app\BaseController;
-use app\model\Ry;
-use app\model\ZdCpmc;
-use app\service\NszyService;
-use app\service\QyBasicService;
-use app\service\RyService;
-use app\service\ZdCpmcService;
+use app\service\UserService;
+use app\validate\EditUserInfo;
+use app\validate\RePassword;
 use app\validate\UserLogin;
+use think\annotation\route\Validate;
 use think\db\exception\DataNotFoundException;
 use think\db\exception\DbException;
 use think\db\exception\ModelNotFoundException;
@@ -18,16 +16,23 @@ use think\annotation\Route;
 use think\annotation\route\Middleware;
 use hg\apidoc\annotation as Apidoc;
 use thans\jwt\facade\JWTAuth;
+
+/**
+ * @Apidoc\Title("用户")
+ * @Apidoc\Group("index")
+ * @Apidoc\Sort(1)
+ */
 class Index extends BaseController
 {
     protected $middleware = [
-        'jwt' 	=> ['except' 	=> ['login'] ],
+        'jwt' 	=> ['except' 	=> ['login','apidoc'] ],
     ];
     use ResponseJson;
 
     /**
      * @Apidoc\Title("基础的接口演示")
      * @Apidoc\Tag("基础,示例")
+     * @Apidoc\Author("ihavoc")
      * @Apidoc\Method ("GET")
      * @Route("/")
      * @Middleware({})
@@ -45,23 +50,24 @@ class Index extends BaseController
     /**
      * @Apidoc\Title("登录接口")
      * @Apidoc\Tag("用户登录")
-     * @Apidoc\Method ("GET")
+     * @Apidoc\Author("ihavoc")
+     * @Apidoc\Method ("POST")
      * @throws ModelNotFoundException
      * @throws DataNotFoundException
      * @throws DbException
-     * @Route("login")
+     * @Route("login",method="POST")
      * @Middleware({})
      */
     public function login():Json{
-       $loginInfo =  $this->request->get();
+       $loginInfo =  $this->request->post();
         try {
             validate(UserLogin::class)->check($loginInfo);
         }catch (ValidateException $e){
             return $this->JsonError($e->getError(),0);
         }
-       $userInfo=RyService::selectLoginInfo($loginInfo);
+       $userInfo=UserService::selectLoginInfo($loginInfo);
        if ($userInfo){
-           $token = JWTAuth::builder(['qydm' => $userInfo["qydm"]]);//参数为用户认证的信息,请自行添加
+           $token = JWTAuth::builder(['xzqdm' => $userInfo["xzqdm"],'id'=>$userInfo["id"]]);//参数为用户认证的信息,请自行添加
            return $this->JsonSucess(["token"=>$token,"userInfo"=>$userInfo],1001);
        }else{
            return $this->JsonError(1002);
@@ -74,34 +80,56 @@ class Index extends BaseController
      * @throws ModelNotFoundException
      * @throws DataNotFoundException
      * @throws DbException
-     * @Route("/getQyBasicList")
+     * @Apidoc\Title("根据token获取用户信息")
+     * @Apidoc\Tag("用户信息")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author("ihavoc")
+     * @Route("/getUserInfo",method="POST")
      * @Middleware({"jwt"})
      */
-    public function getQyBasicList(): Json
+    public function getUserInfo(): Json
     {
-        getQydm();
 
-        return $this->JsonSucess(QyBasicService::selectQyBasic());
+        return $this->JsonSucess(UserService::getUserInfoById(getUserId()));
     }
-
     /**
      * @throws ModelNotFoundException
      * @throws DataNotFoundException
      * @throws DbException
-     * @Route("getNszyByQydm")
+     * @Apidoc\Title("修改密码")
+     * @Apidoc\Tag("用户信息")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author("ihavoc")
+     * @Route("/editPassword",method="POST")
      * @Middleware({"jwt"})
      */
-    public function getNszyByQydm():Json{
-        return $this->JsonSucess(NszyService::selectNszyByQydm(getQydm()));
-    }
-    /**
+    public function editPassword():Json{
+        $rePassword = $this->request->post();
+        try {
+            validate(RePassword::class)->check($rePassword);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(UserService::editPasswordById(getUserId(),$rePassword["password"]));
+    }/**
      * @throws ModelNotFoundException
      * @throws DataNotFoundException
      * @throws DbException
-     * @Route("getJiangdou")
-     *
+     * @Apidoc\Title("修改用户信息")
+     * @Apidoc\Tag("用户信息")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author("ihavoc")
+     * @Route("/editUserInfo",method="POST")
+     * @Middleware({"jwt"})
      */
-    public function getJiangdou(){
-        return json(ZdCpmcService::getQydmBycpmc());
+    public function editUserInfoById():Json{
+        $userInfo = $this->request->post();
+        try {
+            validate(EditUserInfo::class)->check($userInfo);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(UserService::editUserInfoById(getUserId(),$userInfo));
     }
+
 }

+ 143 - 0
app/controller/Input.php

@@ -0,0 +1,143 @@
+<?php
+
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\InputService;
+use app\validate\getListByqydm;
+use app\validate\Id;
+use app\validate\InputAdd;
+use app\validate\Page;
+use app\validate\Qydm;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+/**
+ * @Apidoc\Title("投入品")
+ * @Apidoc\Group("企业")
+ * @Apidoc\Sort (3)
+ */
+
+class Input extends BaseController
+{
+
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+    /**
+     * @Apidoc\Title("投入品列表")
+     * @Apidoc\Tag("投入品")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getInputList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getInputList():Json{
+
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(InputService::getInputList($page,getQydm()));
+
+
+    }
+    /**
+     * @Apidoc\Title("投入品信息by ID")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getInputInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+
+    public function getInputInfoById(): json
+    {
+        $id = $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(InputService::getInputById($id["id"]));
+    }
+    
+    /**
+     * @Apidoc\Title("删除投入品信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("wangzhen")
+     * @Route("delInputById",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function delInputById():json{
+        $id= $this->request->POST();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+
+        try {
+            return $this->JsonSucess(InputService::delInputById($id["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+    /**
+     * @Apidoc\Title("更新投入品信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("yang")
+     * @Route("updateInputById",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function updataInputById():json{
+        $info= $this->request->POST();
+        try {
+            validate(Id::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+
+        try {
+            return $this->JsonSucess(InputService::eidtInputInfo($info,$info["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+    /**
+     * @Apidoc\Title("添加投入品信息")
+     * @Apidoc\Tag("企业")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("yang")
+     * @Route("addInput",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addInput():json{
+
+        $data =  $this->request->post();
+        try {
+            validate(InputAdd::class)->check($data);
+            $data['creation_time']   = date('Y-m-d h:i:s', time());
+            $result = InputService::addInput($data);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(1,"success","");
+
+    }
+}

+ 154 - 0
app/controller/InputUse.php

@@ -0,0 +1,154 @@
+<?php
+
+
+namespace app\controller;
+
+use app\BaseController;
+
+
+use app\service\InputuseService;
+use app\validate\Id;
+use app\validate\Page;
+use think\console\Input;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+
+/**
+ * @Apidoc\Title("投入品使用")
+ * @Apidoc\Group("inputuse")
+ * @Apidoc\Sort(8)
+ */
+class InputUse extends BaseController
+{
+    use ResponseJson;
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @Apidoc\Title("添加投入品使用")
+     * @Apidoc\Tag("投入品使用")
+     * @Apidoc\Method ("POST")
+     * @Route("/addInputuse",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addInputuse(): Json
+    {
+        $inputInfo =  $this->request->post();
+        $inputInfo['creation_time']   = date('Y-m-d h:i:s', time());
+        try {
+            validate(\app\validate\Inputuse::class)->check($inputInfo);
+
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return  $this->JsonSucess(InputuseService::addInputUse($inputInfo));
+    }
+
+
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("删除投入品使用")
+     * @Apidoc\Tag("投入品使用")
+     * @Apidoc\Method ("POST")
+     * @Route("/delInputuse",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function delInputuse(): Json
+    {
+        $id = $this->request->post();
+        try {
+            validate(Id::class)->check($id);
+        } catch (ValidateException $e) {
+            return $this->JsonError($e->getError(), 0);
+        }
+        return $this->JsonSucess(InputuseService::delInputUse($id["id"]));
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("修改投入品使用")
+     * @Apidoc\Tag("修改投入品使用")
+     * @Apidoc\Method ("POST")
+     * @Route("/editInputuse",method="POST")
+     * @Middleware({"jwt"})
+     */
+
+    public function editInputuse(): Json
+    {
+        $info= $this->request->post();
+        $info['last_update_time']   = date('Y-m-d h:i:s', time());
+        try {
+            validate(Id::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+
+            return $this->JsonSucess(InputuseService::editInputUse($info,$info["id"]));
+
+    }
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("获取投入品使用记录")
+     * @Apidoc\Tag("投入品")
+     * @Apidoc\Method ("POST")
+     * @Route("/getInputUseList",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function getInputUseList(): Json
+    {
+
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(InputuseService::getInputUseList($page,getQydm()));
+
+
+    }
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("获取投入品使用详情")
+     * @Apidoc\Tag("投入品")
+     * @Apidoc\Method ("GET")
+     * @Route("/getInputUseById",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getInputUseById(): Json
+    {
+        $id = $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+       return $this->JsonSucess(InputuseService::getInputUseById($id["id"]));
+
+    }
+}

+ 154 - 0
app/controller/Pesticide.php

@@ -0,0 +1,154 @@
+<?php
+
+
+namespace app\controller;
+
+
+use app\BaseController;
+
+
+use app\service\PesticideListService;
+use app\validate\getListByqydm;
+use app\validate\Id;
+use app\validate\PesticideList;
+use app\validate\Page;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+
+
+/**
+ * @Apidoc\Title("豇豆农药经常检出农药清单和禁限用农药名录发放张贴情况")
+ * @Apidoc\Group("豇豆农药经常检出农药清单和禁限用农药名录发放张贴情况")
+ * @Apidoc\Sort(12)
+ */
+
+class Pesticide extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+
+
+    /**
+     * @Apidoc\Title("经常检出农药清单和禁限用农药名录发放张贴情况列表")
+     * @Apidoc\Tag("经常检出农药清单和禁限用农药名录发放张贴情况列表")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getPesticideList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getPesticide():Json{
+
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            $page["page"]=1;
+            $page["size"] = 10;
+        }
+
+        try {
+            return $this->JsonSucess(PesticideListService::getPesticideList($page, getXzqdmSub()));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("添加农药清单和禁限用农药")
+     * @Apidoc\Tag("添加")
+     * @Apidoc\Method ("POST")
+     * @Route("/addPesticide",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addPesticide(): Json
+    {
+        $data =  $this->request->post();
+        try {
+            validate(Pesticide::class)->check($data);
+            $data['creation_time']   = date('Y-m-d h:i:s', time());
+            $result = PesticideListService::addPesticideList($data);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("修改农药清单和禁限用农药")
+     * @Apidoc\Tag("修改")
+     * @Apidoc\Method ("POST")
+     * @Route("/editpesticide",method="POST")
+     * @Middleware({"jwt"})
+     */
+    //修改
+    public function editPesticideById(): Json
+    {
+        $data= $this->request->get();
+        try {
+            validate(Id::class)->check($data);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(PesticideListService::editPesticideInfo($data, $data["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+
+
+    /**
+     * @Apidoc\Author("yang")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("删除农药清单和禁限用农药")
+     * @Apidoc\Tag("删除")
+     * @Apidoc\Method ("Post")
+     * @Route("/deletepesticide",method="Post")
+     * @Middleware({"jwt"})
+     */
+    //删除
+    public function deletePesticideById(): Json{
+        $id=$this->request->post();
+        try {
+            validate(Id::class)->check($id);
+            $result = PesticideListService::deletePesticide($id);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+
+
+
+
+
+
+}

+ 64 - 0
app/controller/ProPch.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\GridService;
+use app\service\ProPchService;
+use app\validate\GridAdd;
+use app\validate\Id;
+use app\validate\ProPchAdd;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use think\exception\ValidateException;
+use think\response\Json;
+
+
+/**
+ * @Apidoc\Title("批次号信息")
+ * @Apidoc\Group("pch")
+ * @Apidoc\Sort(16)
+ */
+class ProPch extends BaseController
+{
+
+    use ResponseJson;
+
+    //新增方法
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("生成批次号信息")
+     * @Apidoc\Tag("生成批次号信息")
+     * @Apidoc\Method ("POST")
+     * @Route("/addpch",method="POST")
+     * @Middleware({"jwt"})
+     */
+
+    public function addGrid(): Json
+    {
+        $info =  $this->request->post();
+        try {
+            validate(ProPchAdd::class)->check($info);
+            $info['creation_time']   = date('Y-m-d h:i:s', time());
+            $info['last_update_time']   = date('Y-m-d h:i:s', time());
+            $result = ProPchService::addProPch($info,$this->uuid());
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+
+}

+ 160 - 0
app/controller/Product.php

@@ -0,0 +1,160 @@
+<?php
+
+
+namespace app\controller;
+use app\BaseController;
+use app\validate\EditProduct;
+use app\validate\Id;
+use app\validate\Page;
+use app\service\ProductService;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+
+/**
+ * @Apidoc\Title("产品信息")
+ * @Apidoc\Group("产品")
+ * @Apidoc\Sort (6)
+ */
+class Product extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+    /**
+     * @Apidoc\Title("产品列表")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("刘庆")
+     * @Route("getProductList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductService::getProductList($page,getQydm()));
+    }
+
+    /**
+     * @Apidoc\Title("产品列表")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("刘庆")
+     * @Route("getProductListGOV",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductListGOV(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductService::getProductList($page,$page["qydm"]));
+    }
+
+    /**
+     * @Apidoc\Title("产品信息ByID")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("刘庆")
+     * @Route("getProductInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductInfo(): Json
+    {
+        $id = $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductService::getProductInfoById($id["id"]));
+    }
+
+    /**
+     * @Apidoc\Title("添加产品信息")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("刘庆")
+     * @Route("addProduct",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addProduct(): Json
+    {
+        $info = $this->request->post();
+        try {
+            validate(\app\validate\Product::class)->check($info);
+        } catch (ValidateException $e) {
+            $this->JsonError($e->getError());
+        }
+
+            return $this->JsonSucess(ProductService::addProduct($info));
+
+    }
+    /**
+     * @Apidoc\Title("更新产品信息")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("刘庆")
+     * @Route("editProduct",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function editProduct(): Json
+    {
+        $info = $this->request->post();
+        try {
+            validate(EditProduct::class)->check($info);
+        } catch (ValidateException $e) {
+            $this->JsonError($e->getError());
+        }
+       return $this->JsonSucess(ProductService::editProduct($info,$info["id"]));
+
+    }
+    /**
+     * @Apidoc\Title("删除产品信息")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("刘庆")
+     * @Route("delProduct",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function delProduct(): Json
+    {
+        $id = $this->request->post();
+        try {
+            validate(Id::class)->check($id);
+        } catch (ValidateException $e) {
+            $this->JsonError($e->getError());
+        }
+       return $this->JsonSucess(ProductService::delProduct($id["id"]));
+
+    }
+    /**
+     * @Apidoc\Title("获取产品列表包含批次号")
+     * @Apidoc\Tag("产品")
+     * @Apidoc\Method ("get")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getProductListIsPch",method="get")
+     * @Middleware({"jwt"})
+     */
+    public function getProductListIsPch(): Json
+    {
+        return $this->JsonSucess(ProductService::getProductListIsPch(getQydm()));
+    }
+
+
+}

+ 228 - 0
app/controller/ProductBatch.php

@@ -0,0 +1,228 @@
+<?php
+
+
+namespace app\controller;
+use app\BaseController;
+use app\validate\EditProduct;
+use app\validate\Id;
+use app\validate\Page;
+use app\service\ProductBatchService;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+
+/**
+ * @Apidoc\Title("建档出证")
+ * @Apidoc\Group("产品建档出征")
+ * @Apidoc\Sort (17)
+ */
+class ProductBatch extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+
+    /**
+     * @Apidoc\Title("建档出证列表信息")
+     * @Apidoc\Tag("列表信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getProductBatchList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductBatchList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductBatchService::getProductBatchList($page,getQydm()));
+
+    }
+
+    /**
+     * @Apidoc\Title("获取所有批次信息")
+     * @Apidoc\Tag("列表信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getProductBatchAllInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductBatchAllInfo(): Json
+    {
+        $page = $this->request->get();
+        try {
+            return $this->JsonSucess(ProductBatchService::getProductBatchAll(getQydm()));
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+
+    }
+
+
+
+
+    /**
+     * @Apidoc\Title("建档出证列表信息")
+     * @Apidoc\Tag("列表信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("selectProductBatchList",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function selectProductBatchList(): Json
+    {
+        $page = $this->request->get();
+        try {
+            validate(Page::class)->check($page);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductBatchService::getProductList($page,getQydm()));
+    }
+
+
+    /**
+     * @Apidoc\Title("建档出证企业基础信息获取")
+     * @Apidoc\Tag("基础信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getEnterprisesBaseInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getEnterprisesBaseInfo(): Json
+    {
+        $result = ProductBatchService::findEnterprisesBaseInfo(getQydm());
+        return $this->JsonSucess($result);
+    }
+
+    /**
+     * @Apidoc\Title("建档出证产品信息获取")
+     * @Apidoc\Tag("基础信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getProductBaseInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductBaseInfo(): Json
+    {
+        $result = ProductBatchService::selectProductBaseInfo(getQydm());
+        return $this->JsonSucess($result);
+    }
+
+    /**
+     * @Apidoc\Title("建档出证产品产地信息获取")
+     * @Apidoc\Tag("基础信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getChandiBaseInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getchandiBaseInfo(): Json
+    {
+        $result = ProductBatchService::selectChandiBaseInfo(getQydm());
+        return $this->JsonSucess($result);
+    }
+
+
+    /**
+     * @Apidoc\Title("添加产品批次信息")
+     * @Apidoc\Tag("产品批次")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("yang")
+     * @Route("addProductBatch",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function addProductBatch(): Json
+    {
+        $info = $this->request->post();
+        try {
+            validate(\app\validate\ProductBatch::class)->check($info);
+        } catch (ValidateException $e) {
+            $this->JsonError($e->getError());
+        }
+        $info['batch_id'] = date('mdhis', time());
+        $info['creation_time']   = date('Y-m-d h:i:s', time());
+        return $this->JsonSucess(ProductBatchService::addProductBatch($info));
+
+    }
+
+
+
+    /**
+     * @Apidoc\Title("产品批次信息ByID")
+     * @Apidoc\Tag("产品批次信息")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getProductBatchInfo",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductBatchInfo(): Json
+    {
+        $id = $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductBatchService::getProductBatchInfoById($id["id"]));
+    }
+
+
+
+    /**
+     * @Apidoc\Title("更新产品批次信息")
+     * @Apidoc\Tag("产品批次信息")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("yang")
+     * @Route("editProductBatch",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function editProductBatch(): Json
+    {
+        $info = $this->request->post();
+        try {
+            validate(\app\validate\ProductBatch::class)->check($info);
+        } catch (ValidateException $e) {
+            $this->JsonError($e->getError());
+        }
+       return $this->JsonSucess(ProductBatchService::editProductBatch($info,$info["id"]));
+
+    }
+    /**
+     * @Apidoc\Author("ihavoc")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("根据产品id获取批次号信息")
+     * @Apidoc\Tag("批次号")
+     * @Apidoc\Method ("POST")
+     * @Route("/getPchByProductId",method="POST")
+     * @Middleware({"jwt"})
+     */
+    public function getPchByProductId(){
+        $id = $this->request->get();
+        try {
+            validate(Id::class)->check($id);
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError());
+        }
+        return $this->JsonSucess(ProductBatchService::getPchByProId($id["id"]));
+    }
+
+
+
+
+
+
+
+}

+ 84 - 0
app/controller/ProductClass.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\ProductClassService;
+use app\service\ZdXzqService;
+use Psr\SimpleCache\InvalidArgumentException;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use think\facade\Cache;
+use think\response\Json;
+
+/**
+ * @Apidoc\Title("产品字典")
+ * @Apidoc\Group("产品")
+ * @Apidoc\Sort (7)
+ */
+class ProductClass extends BaseController
+{
+    /**
+     * @Apidoc\Title("通过分类id 无限级分类")
+     * @Apidoc\Tag("产品字典")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getProductClassById",method="GET")
+     * @Middleware({"jwt"})
+     * @throws InvalidArgumentException
+     */
+    public function getProductClassById(): Json
+    {
+       $id = $this->request->get();
+       $product_dict =  Cache::store('redis')->get('product_class_'.$id["id"]);
+       if ($product_dict){
+           return  $this->JsonSucess($product_dict);
+       }
+        try {
+            $productDict = ProductClassService::getProductClassById($id["id"]);
+        } catch (DataNotFoundException|DbException $e) {
+            return $this->JsonError($e->getData());
+        }
+       $dict =$this->getArray("0".$id["id"],$productDict->toArray());
+       Cache::store('redis')->set('product_class_'.$id["id"],$dict);
+         return $this->JsonSucess($dict);
+
+    }
+    function getArray($parentCode,$data): array
+    {
+       
+        $arr = array();
+        foreach($data as $k => $v){
+            
+            if($v["parent_id"]==$parentCode){
+               unset($data[$k]);
+                $c=$this->getArray($v["product_code"],$data);
+                if($c){
+                    $v["children"]=$c;
+                }
+                $arr[]=$v;
+                
+            }
+             
+        }
+      
+       return $arr;
+    }
+
+    /**
+     * @Apidoc\Title("通过分类id查找产品分类")
+     * @Apidoc\Tag("产品字典")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("yang")
+     * @Route("getProductClass",method="GET")
+     * @Middleware({"jwt"})
+     */
+    public function getProductClass(){
+        return $this->JsonSucess(ProductClassService::getProductClass());
+    }
+
+}

+ 24 - 0
app/controller/Qkjb.php

@@ -0,0 +1,24 @@
+<?php
+
+
+namespace app\controller;
+
+
+use app\BaseController;
+
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+
+
+/**
+ * @Apidoc\Title("")
+ * @Apidoc\Group("gridperson")
+ * @Apidoc\Sort(2)
+ */
+
+class Qkjb extends BaseController
+{
+
+}

+ 107 - 0
app/controller/Statstics.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace app\controller;
+
+use app\BaseController;
+use app\service\StatsticsService;
+
+use app\validate\Id;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\ValidateException;
+use think\response\Json;
+
+/**
+ * @Apidoc\Title("基地统计")
+ * @Apidoc\Group("基地统计信息")
+ * @Apidoc\Sort (15)
+ */
+class Statstics extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+
+    /**
+     * @Apidoc\Title("添加基地统计")
+     * @Apidoc\Tag("添加基地统计")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ruicu")
+     * @Route("addstatic",method="POST")
+     */
+    public function addStatic(): Json
+    {
+        $info =  $this->request->post();
+        try {
+            validate(Statistic::class)->check($info);
+            $info['creation_time']   = date('Y-m-d h:i:s', time());
+            $result = StatsticsService::addStatistic($info);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("删除基地统计信息")
+     * @Apidoc\Tag("基地统计信息")
+     * @Apidoc\Method ("Post")
+     * @Route("/delstatic",method="Post")
+     * @Middleware({"jwt"})
+     */
+    //删除
+    public function del(): Json{
+        $id=$this->request->post();
+        try {
+            validate(Id::class)->check($id);
+            $result = StatsticsService::delStatistic($id);
+            if (!$result){
+                return $this->JsonError(1002);
+            }
+        }catch (ValidateException $e){
+            return $this->JsonError($e->getError(),0);
+        }
+        return  $this->JsonResponse(200,"success","");
+    }
+
+    /**
+     * @Apidoc\Author("ruicu")
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @Apidoc\Title("修改基地统计信息")
+     * @Apidoc\Tag("修改基地统计信息")
+     * @Apidoc\Method ("Get")
+     * @Route("/editstatic",method="Get")
+     * @Middleware({"jwt"})
+     */
+
+    //修改
+    public function updateStaticById(): Json
+    {
+        $info= $this->request->get();
+        try {
+            validate(Id::class)->check($info);
+        }catch (ValidateException $e){
+            $this->JsonError($e->getError());
+        }
+        try {
+            return $this->JsonSucess(StatsticsService::editStatisticInfo($info,$info["id"]));
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $dbE) {
+            return $this->JsonError($dbE);
+        }
+    }
+}

+ 63 - 0
app/controller/Sym.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace app\controller;
+use app\model\ProductBatch;
+use app\BaseController;
+use app\service\ZdXzqService;
+use think\facade\Db;
+use think\response\Json;
+use think\exception\ValidateException;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+/**
+ * @Apidoc\Title("溯源码")
+ * @Apidoc\Group("溯源码")
+ * @Apidoc\Sort (18)
+ */
+class Sym extends BaseController
+{
+
+    /**
+     * @Apidoc\Title("溯源码生成")
+     * @Apidoc\Tag("溯源码")
+     * @Apidoc\Method ("post")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("code",method="post")
+     * @Middleware({"jwt"})
+     */
+    public function code(): Json
+    {
+        $data=$this->request->post();
+        $data['qydm']=getQydm();
+
+        $chandi= ProductBatch::where([['batch_id','=',$data['batch_id']],['qydm','=',$data['qydm']]])->findOrEmpty();
+        $xzq["xzqdm"] = explode(".",$data["qydm"])[0];
+        $city["towns"]=ZdXzqService::getXzqDetail($data["qydm"]);
+        $city["country"] = ZdXzqService::getXzqDetail(str_pad(substr($xzq["xzqdm"],0,6),9,'0'));
+        $city["city"] = ZdXzqService::getXzqDetail(str_pad(substr($xzq["xzqdm"],0,4),9,'0'));
+//        var_dump($city);
+        $data['base_id']=$chandi['base_id'];
+
+        $data['date']=date('Y-m-d H:i:s');
+
+        for ($i=0;$i<$data['num'];$i++){
+            $data['sym']=strtoupper(substr(md5($this->msectime()),8,16).$i);
+            $res = Db::name('sym')->strict(false)->save($data);
+            $re[$i] = Db::name('product')->where([['t_product.qydm','=',$data['qydm']],['t_product.id','=',$chandi['product_id']]])->field('e.enterprises_name,e.fzr_phone,t_product.product_name')->join('t_enterprises e','t_product.qydm=e.qydm')->findOrEmpty();
+            $re[$i]["city"]="安徽省".$city["city"]["xzqmc"].$city["country"]["xzqmc"];
+            $re[$i]['sym']=$data['sym'];
+            $re[$i]['create_date']=date('Y-m-d');
+        }
+        return $this->JsonSucess($re);
+
+
+    }
+    function msectime()
+    {
+        list($msec, $sec) = explode(' ', microtime());
+        $msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
+        return $msectime;
+    }
+
+}

+ 115 - 0
app/controller/UploadFile.php

@@ -0,0 +1,115 @@
+<?php
+
+namespace app\controller;
+
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use app\BaseController;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use thans\filesystem\Filesystem;
+use think\response\Json;
+
+/**
+ * @Apidoc\Title("文件上传")
+ * @Apidoc\Group("文件")
+ * @Apidoc\Sort (8)
+ */
+class UploadFile extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+    /**
+     * @Apidoc\Title("企业营业执照上传")
+     * @Apidoc\Tag("文件")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("enterpriseCardUpload",method="POST")
+     * @Middleware({})
+     */
+    public function enterpriseCardUpload(): Json
+    {
+
+        $file = request()->file('image');
+        $savename = (new Filesystem(app()))->disk("aliyun")->putFile( 'enterprise', $file, 'uniqid');
+        return $this->JsonSucess(["filename"=>$savename,"url"=>"https://ahwgh.oss-cn-hangzhou.aliyuncs.com/".$savename]);
+
+    }
+    /**
+     * @Apidoc\Title("法人、个人身份证上传")
+     * @Apidoc\Tag("文件")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("personCardUpload",method="POST")
+     * @Middleware({})
+     */
+    public function personCardUpload(): Json
+    {
+
+        $file = request()->file('image');
+        $savename = (new Filesystem(app()))->disk("aliyun")->putFile( 'person', $file, 'uniqid');
+        return $this->JsonSucess(["filename"=>$savename,"url"=>"https://ahwgh.oss-cn-hangzhou.aliyuncs.com/".$savename]);
+    }
+    /**
+     * @Apidoc\Title("产品图片上传")
+     * @Apidoc\Tag("文件")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("productUpload",method="POST")
+     * @Middleware({})
+     */
+    public function productUpload(): Json
+    {
+
+        $file = request()->file('image');
+        $savename = (new Filesystem(app()))->disk("aliyun")->putFile( 'product', $file, 'uniqid');
+        return $this->JsonSucess(["filename"=>$savename,"url"=>"https://ahwgh.oss-cn-hangzhou.aliyuncs.com/".$savename]);
+    }
+    /**
+     * @Apidoc\Title("产品认证上传")
+     * @Apidoc\Tag("文件")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("productCreUpload",method="POST")
+     * @Middleware({})
+     */
+    public function productCreUpload(): Json
+    {
+        $file = request()->file('image');
+        $savename = (new Filesystem(app()))->disk("aliyun")->putFile( 'productCre', $file, 'uniqid');
+        return $this->JsonSucess(["filename"=>$savename,"url"=>"https://ahwgh.oss-cn-hangzhou.aliyuncs.com/".$savename]);
+    }
+    /**
+     * @Apidoc\Title("巡检照片上传")
+     * @Apidoc\Tag("文件")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("patrolInspectionUpload",method="POST")
+     * @Middleware({})
+     */
+    public function patrolInspectionUpload(): Json
+    {
+        $file = request()->file('image');
+        $savename = (new Filesystem(app()))->disk("aliyun")->putFile( 'patrolInspection', $file, 'uniqid');
+        return $this->JsonSucess(["filename"=>$savename,"url"=>"https://ahwgh.oss-cn-hangzhou.aliyuncs.com/".$savename]);
+    }
+    /**
+     * @Apidoc\Title("投入品照片上传")
+     * @Apidoc\Tag("文件")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("inputUpload",method="POST")
+     * @Middleware({})
+     */
+    public function inputUpload(): Json
+    {
+        $file = request()->file('image');
+        $savename = (new Filesystem(app()))->disk("aliyun")->putFile( 'input', $file, 'uniqid');
+        return $this->JsonSucess(["filename"=>$savename,"url"=>"https://ahwgh.oss-cn-hangzhou.aliyuncs.com/".$savename]);
+    }
+
+}

+ 60 - 0
app/controller/ZdXzq.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace app\controller;
+use app\service\ZdXzqService;
+use think\annotation\Route;
+use think\annotation\route\Middleware;
+use hg\apidoc\annotation as Apidoc;
+use app\BaseController;
+use think\facade\Cache;
+
+/**
+ * @Apidoc\Title("行政区")
+ * @Apidoc\Group("行政区")
+ * @Apidoc\Sort (3)
+ */
+class ZdXzq extends BaseController
+{
+    protected $middleware = [
+        'jwt',
+    ];
+    use ResponseJson;
+
+    /**
+     * @Apidoc\Title("行政区代码,无限极分类")
+     * @Apidoc\Tag("行政区")
+     * @Apidoc\Method ("POST")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getXzqdm",method="POST")
+
+     */
+    public function getXzqdm(){
+        $citydict = Cache::store("redis")->get("citydict");
+        if ($citydict){
+            return $this->JsonSucess($citydict);
+        }else{
+            $citydict =ZdXzqService::getXzq();
+            Cache::store("redis")->set("citydict",$citydict);
+            return $this->JsonSucess($citydict);
+        }
+
+    }
+    
+    /**
+     * @Apidoc\Title("根据街道行政区代码获取所属区域")
+     * @Apidoc\Tag("行政区")
+     * @Apidoc\Method ("GET")
+     * @Apidoc\Author ("ihavoc")
+     * @Route("getXzqDetail",method="GET")
+
+     */
+    public function getXzqDetail(){
+        $xzq = $this->request->get();
+        $data["towns"]=ZdXzqService::getXzqDetail($xzq["xzqdm"]);
+        $data["country"] = ZdXzqService::getXzqDetail(str_pad(substr($xzq["xzqdm"],0,6),9,'0'));
+        $data["city"] = ZdXzqService::getXzqDetail(str_pad(substr($xzq["xzqdm"],0,4),9,'0'));
+        return $this->JsonSucess($data);
+    }
+
+
+}

+ 1 - 1
app/middleware.php

@@ -1,11 +1,11 @@
 <?php
 // 全局中间件定义文件
 return [
+    think\middleware\AllowCrossDomain::class
     // 全局请求缓存
     // \think\middleware\CheckRequestCache::class,
     // 多语言加载
     // \think\middleware\LoadLangPack::class,
     // Session初始化
     // \think\middleware\SessionInit::class
-
 ];

+ 3 - 2
app/model/ZdCpmc.php → app/model/Base.php

@@ -1,11 +1,12 @@
 <?php
 
+
 namespace app\model;
 
+
 use think\Model;
 
-class ZdCpmc extends Model
+class Base extends  Model
 {
 
-
 }

+ 10 - 0
app/model/Check.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class Check extends Model
+{
+
+}

+ 10 - 0
app/model/CheckDetail.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class CheckDetail extends Model
+{
+
+}

+ 10 - 0
app/model/Enterprises.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class Enterprises extends Model
+{
+
+}

+ 1 - 1
app/model/Nszy.php → app/model/Grid.php

@@ -4,7 +4,7 @@ namespace app\model;
 
 use think\Model;
 
-class Nszy extends Model
+class Grid extends Model
 {
 
 }

+ 12 - 0
app/model/Input.php

@@ -0,0 +1,12 @@
+<?php
+
+
+namespace app\model;
+
+
+use think\Model;
+
+class Input extends Model
+{
+
+}

+ 11 - 0
app/model/InputUse.php

@@ -0,0 +1,11 @@
+<?php
+
+
+namespace app\model;
+
+use think\Model;
+
+class InputUse extends Model
+{
+
+}

+ 10 - 0
app/model/PesticideList.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class PesticideList extends Model
+{
+
+}

+ 10 - 0
app/model/ProPch.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class ProPch extends Model
+{
+
+}

+ 12 - 0
app/model/Product.php

@@ -0,0 +1,12 @@
+<?php
+
+
+namespace app\model;
+
+
+use think\Model;
+
+class Product extends Model
+{
+
+}

+ 12 - 0
app/model/ProductBatch.php

@@ -0,0 +1,12 @@
+<?php
+
+
+namespace app\model;
+
+
+use think\Model;
+
+class ProductBatch extends Model
+{
+
+}

+ 10 - 0
app/model/ProductClass.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class ProductClass extends Model
+{
+
+}

+ 1 - 1
app/model/Ry.php → app/model/Qkjb.php

@@ -4,7 +4,7 @@ namespace app\model;
 
 use think\Model;
 
-class Ry extends Model
+class Qkjb extends Model
 {
 
 }

+ 10 - 0
app/model/Statstics.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class Statstics extends Model
+{
+
+}

+ 10 - 0
app/model/User.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class User extends Model
+{
+
+}

+ 10 - 0
app/model/ZdXzq.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\model;
+
+use think\Model;
+
+class ZdXzq extends Model
+{
+
+}

+ 10 - 0
app/service/Base.php

@@ -0,0 +1,10 @@
+<?php
+
+
+namespace app\service;
+
+
+class Base
+{
+
+}

+ 44 - 0
app/service/BaseService.php

@@ -0,0 +1,44 @@
+<?php
+
+
+namespace app\service;
+
+use app\model\Base;
+use think\console\command\Lists;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+
+class BaseService
+{
+
+    public static function getBaseInfoByQydm($page,$qydm){
+        $map[] =["qydm","=",$qydm];
+        $res["row"]=Base::where($map)->page($page["page"],$page["size"])->field("t_base.*,x.xzqmc as cityname,e.xzqmc as countyname,f.xzqmc as townsname")->leftJoin("t_zd_xzq x","t_base.city=x.xzqdm")->leftJoin("t_zd_xzq e","t_base.county=e.xzqdm")->leftJoin("t_zd_xzq f","t_base.towns=f.xzqdm")->select();
+        $res["count"]=Base::where($map)->count();
+        return $res;
+    }
+
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getBaseInfoById($id){
+        return (new Base)->field("t_base.*,x.xzqmc as cityname,e.xzqmc as countyname,f.xzqmc as townsname")->where("t_base.id",$id)->leftJoin("t_zd_xzq x","t_base.city=x.xzqdm")->leftJoin("t_zd_xzq e","t_base.county=e.xzqdm")->leftJoin("t_zd_xzq f","t_base.towns=f.xzqdm")->find();
+    }
+
+    public static function editBaseInfo($info,$id): Base
+    {
+        return Base::update($info,["id"=>$id]);
+    }
+    public static function addBase($info): bool
+    {
+        return (new Base)->save($info);
+    }
+    public static function delBase($id): bool
+    {
+        return Base::destroy($id);
+    }
+}

+ 13 - 0
app/service/CheckDetailService.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace app\service;
+
+use app\model\CheckDetail;
+
+class CheckDetailService
+{
+    public static function addCheckDetail($data){
+       return CheckDetail::create($data);
+    }
+
+}

+ 21 - 0
app/service/CheckService.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace app\service;
+
+
+
+
+use app\model\Check;
+use think\facade\Db;
+
+class CheckService
+{
+    public static function getCheckList($page,$xzqdm){
+       return Db::name("check")->field("t_check.*,count(t_check.qydm) as check_count,e.enterprises_name")->where("t_check.qydm","like",$xzqdm."%")->leftJoin("t_enterprises e","e.qydm=t_check.qydm")->page($page["page"],$page["size"])->select();
+    }
+    public static function addCheck($data){
+        $res=Check::create($data);
+        return $res->id;
+    }
+
+}

+ 8 - 0
app/service/Enterprises.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace app\service;
+
+class Enterprises
+{
+
+}

+ 70 - 0
app/service/EnterprisesService.php

@@ -0,0 +1,70 @@
+<?php
+
+namespace app\service;
+
+use app\model\Enterprises;
+use think\console\command\Lists;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\facade\Db;
+use think\Model;
+
+class EnterprisesService
+{
+    public static function selectLoginInfo($loginInfo){
+        $map[] = ["username","=",$loginInfo["username"]];
+        $map[] = ["password","=",$loginInfo["password"]];
+        return (new Enterprises())->where($map)->field("qydm, fzr_name")->find();
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getEnterPrisesList($page, $xzqdm){
+        switch (strlen($xzqdm) ){
+            case 4:
+                $map[]=["city","=",$xzqdm];
+                break;
+            case 6:
+                $map[] = ["country","=",$xzqdm];
+                break;
+            case 9:
+                $map[] = ["towns","=",$xzqdm];
+                break;
+            default:
+                $map[]=["city","<>",""];
+        }
+        $res["row"] = (new Enterprises)->where($map)->page($page["page"],$page["size"])->select();
+        $res["count"] = (new Enterprises)->where($map)->count();
+
+       return $res;
+    }
+
+    public static function getEnterprisesInfoByQydm($qydm){
+        return Db::name("enterprises")->field("t_enterprises.*,x.xzqmc as cityname,e.xzqmc as countyname,f.xzqmc as townsname")->where("qydm",$qydm)->leftJoin("t_zd_xzq x","t_enterprises.city=x.xzqdm")->leftJoin("t_zd_xzq e","t_enterprises.county=e.xzqdm")->leftJoin("t_zd_xzq f","t_enterprises.towns=f.xzqdm")->find();
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getEnterprisesInfoById($id){
+        return (new Enterprises)->find($id);
+    }
+    public static function editEnterprisesInfo($info,$id): Enterprises
+    {
+        return Enterprises::update($info,["id"=>$id]);
+    }
+    public static function addEnterprises($info): bool
+    {
+       return (new Enterprises)->save($info);
+    }
+    public static function delEnterprises($id): bool
+    {
+        return Enterprises::destroy($id);
+    }
+}

+ 54 - 0
app/service/GridService.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace app\service;
+
+use app\model\Grid;
+use app\model\User;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+
+class GridService
+{
+    public static function addGrid($info): bool
+    {
+        $grid =new Grid();
+        return $grid->save($info);
+    }
+
+    public static function delGrid($info): bool
+    {
+
+        return Grid::destroy($info['id']);
+
+    }
+
+    public static function editGridInfo($info,$id): Grid
+    {
+        return Grid::update($info,["id"=>$id]);
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getGridList($page, $xzqdm)
+    {
+        switch (strlen($xzqdm) ){
+            case 4:
+                $map[]=["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 6:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 9:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            default:
+                $map[]=[];
+        }
+        return (new Grid())->where($map)->page($page["page"],$page["size"])->select();
+    }
+
+}

+ 56 - 0
app/service/InputService.php

@@ -0,0 +1,56 @@
+<?php
+
+
+namespace app\service;
+
+
+use app\model\Enterprises;
+use app\model\Input;
+use app\validate\Qydm;
+use think\facade\Db;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\Model;
+
+class InputService
+{
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getInputList($page,$qydm){
+//        return (new Input)->where("qydm",$qydm)->page($page["page"],$page["size"])->select();
+
+        $res["row"] =(new Input)->where("qydm",$qydm)->page($page["page"],$page["size"])->select();
+        $res["count"]= (new Input)->where($qydm=="qydm")->count();
+        return $res;
+
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getInputById($id){
+
+        return Db::name("input")->field("t_input.*,t_enterprises.enterprises_name")->where("t_input.id","=",$id)->leftJoin("t_enterprises","t_input.qydm=t_enterprises.qydm")->select();
+
+    }
+    public static function eidtInputInfo($info,$id): Input{
+        return Input::update($info,["id"=>$id]);
+    }
+
+    public static function addInput($info):bool{
+        $input =new Input();
+        return $input->save($info);
+
+    }
+
+    public static function delInputById($id):bool{
+        return Input::destroy($id);
+    }
+
+}

+ 54 - 0
app/service/InputuseService.php

@@ -0,0 +1,54 @@
+<?php
+
+
+namespace app\service;
+
+
+use app\model\InputUse;
+use think\facade\Db;
+
+
+class InputuseService
+{
+    public static function getInputUseList($page,$qydm){
+
+
+        $res["row"] =(new InputUse)
+            ->where("t_input_use.qydm",$qydm)
+            ->field('t_input_use.*,t_enterprises.enterprises_name, t_product_batch.batch_id,t_product.product_name')
+            ->page($page["page"],$page["size"])
+            ->leftJoin("t_enterprises","t_enterprises.qydm=t_input_use.qydm")
+            ->leftJoin("t_product_batch","t_product_batch.batch_id=t_input_use.sydx")
+            ->leftJoin("t_product","t_product_batch.product_id=t_product.id")
+            ->select();
+
+        $res["count"]= (new InputUse)->where($qydm=="qydm")->count();
+        return $res;
+
+    }
+    public static function getInputUseById($id){
+        return  Db::name("input_use")
+            ->where("t_input_use.qydm",getQydm())
+            ->where("t_input_use.id",$id)
+            ->field('t_input_use.*,t_enterprises.enterprises_name, t_product_batch.batch_id,t_product.product_name')
+            ->leftJoin("t_enterprises","t_enterprises.qydm=t_input_use.qydm")
+            ->leftJoin("t_product_batch","t_product_batch.batch_id=t_input_use.sydx")
+            ->leftJoin("t_product","t_product_batch.product_id=t_product.id")
+            ->select();
+
+    }
+
+    public static function addInputUse($info){
+        return (new InputUse)->save($info);
+
+    }
+    public static function editInputUse($info,$id){
+        return InputUse::update($info,["id"=>$id]);
+    }
+    public static function delInputUse($id){
+        return InputUse::destroy($id);
+    }
+
+
+
+}

+ 0 - 22
app/service/NszyService.php

@@ -1,22 +0,0 @@
-<?php
-
-namespace app\service;
-
-use app\model\Nszy;
-use think\db\exception\DataNotFoundException;
-use think\db\exception\DbException;
-use think\db\exception\ModelNotFoundException;
-
-class NszyService
-{
-    /**
-     * @throws ModelNotFoundException
-     * @throws DataNotFoundException
-     * @throws DbException
-     */
-    static function selectNszyByQydm($qydm, $page=1, $limit=10):array{
-        $res["row"]=(new \app\model\Nszy)->where("qydm",$qydm)->page($page,$limit)->select();
-        $res["total"]= (new \app\model\Nszy)->where("qydm",$qydm)->count();
-        return $res;
-    }
-}

+ 54 - 0
app/service/PesticideListService.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace app\service;
+
+use app\model\PesticideList;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\Model;
+
+class PesticideListService
+{
+    public static function addPesticide($info): bool
+    {
+        $pesticidelist =new PesticideList();
+        return $pesticidelist->save($info);
+    }
+
+    public static function deletePesticideList($info): bool
+    {
+
+        return PesticideList::destroy($info['id']);
+
+    }
+
+    public static function editPesticideListInfo($info,$id): PesticideList
+    {
+        return PesticideList::update($info,["id"=>$id]);
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getQPesticideList($page, $xzqdm)
+    {
+        switch (strlen($xzqdm) ){
+            case 4:
+                $map[]=["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 6:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 9:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            default:
+                $map[]=[];
+        }
+        return (new PesticideList())->where($map)->page($page["page"],$page["size"])->select();
+    }
+
+}

+ 23 - 0
app/service/ProPchService.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace app\service;
+
+use app\model\Grid;
+use app\model\ProPch;
+
+class ProPchService
+{
+    public static function addProPch($info,$uuid): bool
+    {
+        $info['pch'] = substr($info['rq'],2,2)
+            .substr($info['rq'],5,2)
+            .substr($info['rq'],8,2).
+        '-'.$uuid;
+        return (new ProPch())->save($info);
+    }
+    public static function getPchByProId($id){
+     return   ProPch::where("pro_id",$id)->select();
+    }
+
+
+}

+ 91 - 0
app/service/ProductBatchService.php

@@ -0,0 +1,91 @@
+<?php
+
+
+namespace app\service;
+
+use app\model\Product;
+use app\model\ProductBatch;
+use app\model\Enterprises;
+use app\model\Base;
+use think\Model;
+
+
+class ProductBatchService
+{
+
+    public static function getProductBatchList($page, $qydm): array
+    {
+        $map[]=["t_product_batch.qydm","=",$qydm];
+        $res["row"] = (new ProductBatch)
+                    ->where($map)
+                    ->field("t_product_batch.*,t_product.product_name, t_product.product_class_id, t_enterprises.enterprises_name,
+                            t_enterprises.fzr_phone, t_enterprises.enterprises_address")
+                    ->page($page["page"],$page["size"])
+                    ->leftJoin("t_product","t_product_batch.product_id=t_product.id")
+                    ->leftJoin("t_enterprises","t_enterprises.qydm=t_product_batch.qydm")
+                    ->select();
+        $res["count"] = (new ProductBatch)->where($map)->count();
+        return $res;
+    }
+
+    public static function getProductBatchAll($qydm)
+    {
+        $map[]=["t_product_batch.qydm","=",$qydm];
+        $res = (new ProductBatch)
+            ->where($map)
+            ->field("t_product_batch.batch_id,t_product.product_name")
+            ->leftJoin("t_product","t_product_batch.product_id=t_product.id")
+            ->select();
+
+        return $res;
+    }
+
+    public static function getProductBatchInfoById($id)
+    {
+        return ProductBatch::find($id);
+    }
+
+
+    public static function addProductBatch($info):bool
+    {
+        return (new ProductBatch)->save($info);
+    }
+    public static function editProductBatch($info,$id): ProductBatch
+    {
+        return ProductBatch::update($info,["id"=>$id]);
+    }
+    public static function delProductBatch($id): bool
+    {
+        return ProductBatch::destroy($id);
+    }
+
+    public static function findEnterprisesBaseInfo($qydm)
+    {
+        $map[] = ["qydm","=",$qydm];
+        return Enterprises::field('qydm, enterprises_name, fzr_phone')
+            ->where($map)
+            ->find();
+    }
+
+
+    public static function selectProductBaseInfo($qydm)
+    {
+        $map[] = ["qydm","=",$qydm];
+        return Product::field('id, product_name, product_class_id')
+            ->where($map)
+            ->select();
+    }
+
+
+    public static function selectChandiBaseInfo($qydm)
+    {
+        $map[] = ["qydm","=",$qydm];
+        return Base::field('id, city, county, towns, village')
+            ->where($map)
+            ->select();
+    }
+    public static function getPchByProId($id){
+        return   ProductBatch::where("product_id",$id)->select();
+    }
+
+}

+ 48 - 0
app/service/ProductClassService.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace app\service;
+
+use app\model\ProductClass;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\Model;
+
+class ProductClassService{
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getProductClassById($id){
+        $del_flag = "N";
+      return  (new \app\model\ProductClass)
+          //->field('')
+          ->where("type_id",$id)
+          ->where("del_flag",'=', "N")
+          ->select();
+    }
+
+    public static function getProductClass(){
+
+        $type_data =  (new ProductClass)->field("type_id")->group("type_id")->select();
+        for ($i=0;$i<count($type_data);$i++){
+
+            $type_data[$i]["data"]=(new ProductClass)
+                ->field('id, parent_name, parent_id, name')
+                ->where('type_id', $type_data[$i]['type_id'])
+                ->select();
+            for ($j=0;$j<count($type_data[$i]["data"]);$j++){
+                //$type_data[$i]["data"][$j]["data"] = [];
+                $type_data[$i]["data"][$j]["data"]=(new ProductClass)
+                    ->field('parent_name, parent_id, name')
+                    ->where('parent_id', $type_data[$i]['data'][$j]['parent_id'])
+
+                    ->select();
+            }
+        }
+
+        return $type_data;
+    }
+
+}

+ 41 - 0
app/service/ProductService.php

@@ -0,0 +1,41 @@
+<?php
+
+
+namespace app\service;
+
+use app\model\Product;
+use think\Model;
+
+
+class ProductService
+{
+
+    public static function getProductList($page, $qydm): array
+    {
+        $map[]=["qydm","=",$qydm];
+        $res["row"] = (new Product)->where($map)->page($page["page"],$page["size"])->select();
+        $res["count"] = (new Product)->where($map)->count();
+        return $res;
+    }
+    public static function getProductInfoById($id)
+    {
+        return Product::find($id);
+    }
+
+
+    public static function addProduct($info):bool
+    {
+        return (new Product)->save($info);
+    }
+    public static function editProduct($info,$id): Product
+    {
+        return Product::update($info,["id"=>$id]);
+    }
+    public static function delProduct($id): bool
+    {
+        return Product::destroy($id);
+    }
+    public static function getProductListIsPch($qydm){
+      return  Product::where("t_product.qydm",$qydm)->field("t_product.*")->join("t_product_batch p","t_product.id=p.product_id")->select();
+    }
+}

+ 54 - 0
app/service/QkjbService.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace app\service;
+
+use app\model\Qkjb;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\Model;
+
+class QkjbService
+{
+    public static function addQkjb($info): bool
+    {
+        $qkjb =new Qkjb();
+        return $qkjb->save($info);
+    }
+
+    public static function deleteQkjb($info): bool
+    {
+
+        return Qkjb::destroy($info['id']);
+
+    }
+
+    public static function editQkjbInfo($info,$id): Qkjb
+    {
+        return Qkjb::update($info,["id"=>$id]);
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getQkjbList($page, $xzqdm)
+    {
+        switch (strlen($xzqdm) ){
+            case 4:
+                $map[]=["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 6:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 9:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            default:
+                $map[]=[];
+        }
+        return (new Qkjb())->where($map)->page($page["page"],$page["size"])->select();
+    }
+
+}

+ 0 - 23
app/service/QyBasicService.php

@@ -1,23 +0,0 @@
-<?php
-
-namespace app\service;
-
-use app\model\QyBasic;
-use think\db\exception\DataNotFoundException;
-use think\db\exception\DbException;
-use think\db\exception\ModelNotFoundException;
-
-class QyBasicService
-{
-    /**
-     * @throws ModelNotFoundException
-     * @throws DataNotFoundException
-     * @throws DbException
-     */
-    static function selectQyBasic($page=1, $limit=10): array
-    {
-        $res["row"] = (new \app\model\QyBasic)->page($page,$limit)->select();
-        $res["total"] = (new \app\model\QyBasic)->count();
-        return $res;
-    }
-}

+ 0 - 22
app/service/RyService.php

@@ -1,22 +0,0 @@
-<?php
-
-namespace app\service;
-
-use app\model\Ry;
-use think\db\exception\DataNotFoundException;
-use think\db\exception\DbException;
-use think\db\exception\ModelNotFoundException;
-
-class RyService
-{
-    /**
-     * @throws ModelNotFoundException
-     * @throws DataNotFoundException
-     * @throws DbException
-     */
-    static function selectLoginInfo($loginInfo):array{
-        $map[]=["rybh","=",$loginInfo["rybh"]];
-        $map[]=["kl","=",$loginInfo["kl"]];
-        return (new \app\model\Ry)->where($map)->find()->toArray();
-    }
-}

+ 24 - 0
app/service/StatsticsService.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace app\service;
+
+use app\model\Grid;
+use app\model\Statstics;
+
+class StatsticsService {
+    public static function delStatistic($info): bool
+    {
+        return Statstics::destroy($info['id']);
+    }
+
+    public static function editStatisticInfo($info,$id): Grid
+    {
+        return Statstics::update($info,["id"=>$id]);
+    }
+
+    public static function addStatistic($info): bool
+    {
+        return (new Statstics())->save($info);
+    }
+
+}

+ 77 - 0
app/service/UserService.php

@@ -0,0 +1,77 @@
+<?php
+
+namespace app\service;
+
+use app\model\User;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
+use think\Model;
+
+class UserService
+{
+    public static function selectLoginInfo($loginInfo){
+        $map[] = ["username","=",$loginInfo["username"]];
+        $map[] = ["password","=",$loginInfo["password"]];
+        return (new User)->where($map)->field("id,username,xzqdm,level,name")->find();
+    }
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DataNotFoundException
+     * @throws DbException
+     */
+    public static function getUserInfoById($id){
+        return (new \app\model\User)->field("username,xzqdm,level,name")->find($id);
+    }
+
+    public static function getGridPersonInfoById($id){
+        return User::field("name,xzqdm,level,work_organization, phone, work_position, person_group, person_duty, person_image,id")->find($id);
+    }
+
+    public static function editPasswordById($id,$password): User
+    {
+        return User::update(["password"=>$password],["id"=>$id]);
+    }
+    public static function editUserInfoById($id,$userInfo): User
+    {
+        return User::update($userInfo,["id"=>$id]);
+    }
+
+    public static function saveUserInfo($userInfo): User{
+        return User::create($userInfo);
+    }
+
+
+    public static function deleteUserInfoById($id): bool{return User::destroy($id);}
+
+
+    /**
+     * @throws ModelNotFoundException
+     * @throws DbException
+     * @throws DataNotFoundException
+     */
+    public static function getUserInfoList($page, $xzqdm){
+
+        switch (strlen($xzqdm) ){
+            case 4:
+                $map[]=["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 6:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            case 9:
+                $map[] = ["xzqdm","like",'%'.$xzqdm.'%'];
+                break;
+            default:
+                $map[]=["xzqdm","<>",'null'];
+
+        }
+        $map[]=["work_position","=","网格员"];
+
+        return (new User)->where($map)->page($page["page"],$page["size"])->select();
+    }
+
+
+
+}

+ 0 - 13
app/service/ZdCpmcService.php

@@ -1,13 +0,0 @@
-<?php
-
-namespace app\service;
-
-use app\model\ZdCpmc;
-
-class ZdCpmcService
-{
-    static function getQydmBycpmc(){
-        return (new \app\model\ZdCpmc)->field('t_zd_cpmc.qydm,cpmc,count(t_zd_cpmc.bh) as row,q.qymc,q.fzr,q.addr')->where("cpmc","like","%"."豇"."%")->group("t_zd_cpmc.qydm")->join("t_qy_basic q",'q.qydm=t_zd_cpmc.qydm')->select();
-    }
-
-}

+ 33 - 0
app/service/ZdXzqService.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace app\service;
+
+use app\model\ZdXzq;
+
+class ZdXzqService
+{
+    public static function getXzq(){
+       $condition[] = ["xzqdm","like","%"."00000"];
+       $condition[]=["xzqdm","<>","340000000"]; //去除安徽省选项
+       $city =  (new ZdXzq)->field("xzqdm as id, xzqmc as name")->where($condition)->select();
+       for ($i=0;$i<count($city);$i++){
+
+           $map[$i][]=["xzqdm","NOTLIKE","%"."00000"];
+           $map[$i][]=["xzqdm","like",[substr($city[$i]["id"],0,4)."%"."000"],"AND"];
+
+           $city[$i]["children"]=(new ZdXzq)->field("xzqdm as id, xzqmc as name")->where($map[$i])->select();
+           for ($j=0;$j<count($city[$i]["children"]);$j++){
+               $maptown[$j][$i][]=["xzqdm","NOTLIKE","%"."000"];
+               $maptown[$j][$i][]=["xzqdm","LIKE",substr($city[$i]["children"][$j]["id"],0,6)."%","AND"];
+               $city[$i]["children"][$j]["children"]=(new ZdXzq)->field("xzqdm as id, xzqmc as name")->where($maptown[$j][$i])->select();
+           }
+       }
+
+       return $city;
+    }
+    public static function getXzqDetail($xzqdm){
+       return ZdXzq::where("xzqdm",$xzqdm)->find();
+        
+    }
+
+}

+ 32 - 0
app/validate/Base.php

@@ -0,0 +1,32 @@
+<?php
+
+
+namespace app\validate;
+use think\Validate;
+
+class Base extends Validate
+{
+    protected $rule =   [
+
+        'qydm'   => 'require',
+        'base_name' => 'require',
+        'county'   => 'require',
+        'towns'   => 'require',
+        'village'   => 'require',
+        'country'   => 'require',
+        'lnt'   => 'require',
+        'lat'   => 'require',
+
+    ];
+
+    protected $message  =   [
+        'qydm'     => '企业代码不能为空',
+        'base_name'     => '基地名称不能为空',
+        'county'     => '基地所在县不能为空',
+        'towns'     => '基地所在乡镇不能为空',
+        'village'     => '基地所在村不能为空',
+        'lnt'     => '基地经度不能为空',
+        'lat'     => '基地纬度不能为空',
+    ];
+
+}

+ 31 - 0
app/validate/EditProduct.php

@@ -0,0 +1,31 @@
+<?php
+
+
+namespace app\validate;
+
+
+class EditProduct extends \think\Validate
+{
+    protected $rule =   [
+        "id"=>"require",
+        'product_name'  => 'require',
+        'product_class_id'   => 'require',
+        'qydm'   => 'require',
+        'scale'   => 'require',
+        'scale_class'   => 'require',
+        'production'   => 'require',
+        'production_class'   => 'require',
+        'ship'   => 'require',
+    ];
+    protected $message  =   [
+        "id.require"=>"ID不能为空",
+        'product_name.require'     => '产品名称不能为空',
+        'product_class_id.require'     => '产品分类不能为空',
+        'qydm.require'     => '企业代码不能为空',
+        'scale.require'     => '规模数值不能为空',
+        'scale_class.require'     => '规模单位不能为空',
+        'production.require'     => '产量不能为空',
+        'production_class.require'     => '产量单位不能为空',
+        'ship.require'     => '上市月份不能为空',
+    ];
+}

+ 22 - 0
app/validate/EditUserInfo.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace app\validate;
+
+use think\Validate;
+
+class EditUserInfo extends Validate
+{
+    protected $rule =   [
+        'username'   => 'require',
+        'name'   => 'require',
+        'level'   => 'require',
+        'phone'   => 'require',
+
+    ];
+
+    protected $message  =   [
+        'username.require'     => '不能为空',
+
+    ];
+
+}

+ 28 - 0
app/validate/Enterprises.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace app\validate;
+
+class Enterprises extends \think\Validate
+{
+    protected $rule =   [
+
+        'fzr_name'   => 'require',
+        'fzr_id_number' => 'require',
+        'entity_type'   => 'require',
+        'enterprises_type'   => 'require',
+        'city'   => 'require',
+        'country'   => 'require',
+        'towns'   => 'require',
+    ];
+
+    protected $message  =   [
+        'fzr_name.require'     => '负责人姓名不能为空',
+        'fzr_id_number.require'     => '负责人身份证不能为空',
+        'entity_type.require'     => '主体类型不能为空',
+        'enterprises_type.require'     => '生产类型不能为空',
+        'city.require'     => '所属市不能为空',
+        'country.require'     => '所属区县不能为空',
+        'towns.require'     => '所属乡、镇、街道不能为空',
+    ];
+
+}

+ 20 - 0
app/validate/EnterprisesLogin.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace app\validate;
+
+class EnterprisesLogin extends \think\Validate
+{
+    protected $rule =   [
+
+        'username'   => 'require',
+        'password' => 'require',
+
+    ];
+
+    protected $message  =   [
+        'username.require'     => '登录账号不能为空',
+        'password.require'     => '密码不能为空',
+
+    ];
+
+}

+ 22 - 0
app/validate/GridAdd.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace app\validate;
+
+use think\Validate;
+
+class GridAdd extends Validate
+{
+    protected $rule =   [
+        'xzqdm'  => 'require',
+        'grid_name'   => 'require',
+        'grid_level'   => 'require'
+
+    ];
+
+    protected $message  =   [
+        'xzqdm.require' => '行政区代码不为空',
+        'grid_name.require'     => '网格点名称不为空',
+        'grid_level.require'     => '网格点级别不能为空'
+    ];
+
+}

+ 17 - 0
app/validate/Id.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace app\validate;
+
+class Id extends \think\Validate
+{
+    protected $rule =   [
+        'id'   => 'require',
+
+    ];
+
+    protected $message  =   [
+        'id.require'     => '不能为空',
+
+
+    ];
+}

+ 20 - 0
app/validate/InputAdd.php

@@ -0,0 +1,20 @@
+<?php
+
+
+namespace app\validate;
+
+
+
+
+class InputAdd extends \think\Validate
+{
+    protected $rule =   [
+        'qydm'   => 'require',
+
+    ];
+    protected $message  =   [
+        'qydm.require'     => '不能为空',
+
+
+    ];
+}

+ 29 - 0
app/validate/Inputuse.php

@@ -0,0 +1,29 @@
+<?php
+
+
+namespace app\validate;
+
+
+use think\Validate;
+
+class Inputuse extends Validate
+{
+    protected $rule =   [
+        'qydm'  => 'require',
+        'djzh'   => 'require',
+        'sydx'   => 'require',
+        'fzbch'   => 'require',
+        'syl'   => 'require',
+        'syrq'   => 'require',
+
+    ];
+
+    protected $message  =   [
+        'qydm.require' => '企业代码不为空',
+        'djzh.require'     => '登记证号不为空',
+        'sydx.require'     => '施用对象不能为空',
+        'fzbch.require'     => '防治病虫害不能为空',
+        'syl.require'     => '施用量不能为空',
+        'syrq.require'     => '施用日期不能为空',
+    ];
+}

+ 19 - 0
app/validate/Page.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace app\validate;
+
+use think\Validate;
+
+class Page extends Validate
+{
+    protected $rule =   [
+        'page'   => 'require',
+        'size'   => 'require',
+    ];
+
+    protected $message  =   [
+        'page.require'     => 'page不能为空',
+        'size.require'     => 'size不能为空',
+
+    ];
+}

+ 20 - 0
app/validate/PesticideList.php

@@ -0,0 +1,20 @@
+<?php
+
+
+namespace app\validate;
+
+
+
+
+class PesticideList extends \think\Validate
+{
+    protected $rule =   [
+        'qydm'   => 'require',
+
+    ];
+    protected $message  =   [
+        'qydm.require'     => '不能为空',
+
+
+    ];
+}

+ 24 - 0
app/validate/ProPchAdd.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace app\validate;
+
+use think\Validate;
+
+class ProPchAdd extends Validate
+{
+    protected $rule =   [
+        'qydm'  => 'require',
+        'rq'   => 'require',
+        'base_id'   => 'require',
+        'pro_id'   => 'require'
+
+    ];
+
+    protected $message  =   [
+        'qydm.require' => '企业代码不为空',
+        'rq.require'     => '日期不为空',
+        'base_id.require'     => '基地id不能为空',
+        'pro_id.require'     => '产品id不能为空'
+    ];
+
+}

+ 31 - 0
app/validate/Product.php

@@ -0,0 +1,31 @@
+<?php
+
+
+namespace app\validate;
+
+
+use think\Validate;
+
+class Product extends Validate
+{
+    protected $rule =   [
+        'product_name'  => 'require',
+        'product_class_id'   => 'require',
+        'qydm'   => 'require',
+        'scale'   => 'require',
+        'scale_class'   => 'require',
+        'production'   => 'require',
+        'production_class'   => 'require',
+        'ship'   => 'require',
+    ];
+    protected $message  =   [
+        'product_name.require'     => '产品名称不能为空',
+        'product_class_id.require'     => '产品分类不能为空',
+        'qydm.require'     => '企业代码不能为空',
+        'scale.require'     => '规模数值不能为空',
+        'scale_class.require'     => '规模单位不能为空',
+        'production.require'     => '产量不能为空',
+        'production_class.require'     => '产量单位不能为空',
+        'ship.require'     => '上市月份不能为空',
+    ];
+}

+ 23 - 0
app/validate/ProductBatch.php

@@ -0,0 +1,23 @@
+<?php
+
+
+namespace app\validate;
+
+
+use think\Validate;
+
+class ProductBatch extends Validate
+{
+    protected $rule =   [
+        'qydm'   => 'require',
+        'product_id'   => 'require',
+        'base_id'   => 'require',
+
+    ];
+    protected $message  =   [
+        'qydm.require'     => '企业代码不能为空',
+        'product_id.require'     => '产品不能为空',
+        'base_id.require'     => '产地不能为空',
+
+    ];
+}

+ 20 - 0
app/validate/Qkjb.php

@@ -0,0 +1,20 @@
+<?php
+
+
+namespace app\validate;
+
+
+
+
+class Qkjb extends \think\Validate
+{
+    protected $rule =   [
+        'xzqdm'   => 'require',
+
+    ];
+    protected $message  =   [
+        'xzqdm.require'     => '不能为空',
+
+
+    ];
+}

+ 17 - 0
app/validate/Qydm.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace app\validate;
+
+class Qydm extends \think\Validate
+{
+    protected $rule =   [
+        'qydm'   => 'require',
+
+    ];
+
+    protected $message  =   [
+        'qydm.require'     => '不能为空',
+
+
+    ];
+}

+ 17 - 0
app/validate/RePassword.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace app\validate;
+
+use think\Validate;
+
+class RePassword extends Validate
+{
+    protected $rule =   [
+        'password'   => 'require',
+    ];
+
+    protected $message  =   [
+        'password.require'     => '登录密码不能为空',
+
+    ];
+}

+ 19 - 0
app/validate/Statistic.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace app\validate;
+
+use think\Validate;
+
+class Statistic extends Validate
+{
+    protected $rule =   [
+        'base_id'  => 'require',
+        'pro_id'   => 'require'
+    ];
+
+    protected $message  =   [
+        'base_id.require' => '基地id不为空',
+        'pro_id.require'     => '产品id不为空'
+    ];
+
+}

+ 4 - 4
app/validate/UserLogin.php

@@ -7,14 +7,14 @@ use think\Validate;
 class UserLogin extends Validate
 {
     protected $rule =   [
-        'rybh'  => 'require',
-        'kl'   => 'number',
+        'username'  => 'require',
+        'password'   => 'require',
 
     ];
 
     protected $message  =   [
-        'rybh.require' => '登录名称不能为空',
-        'kl.require'     => '登录密码不能为空',
+        'username.require' => '登录名称不能为空',
+        'password.require'     => '登录密码不能为空',
 
     ];
 }

+ 25 - 0
app/validate/getListByqydm.php

@@ -0,0 +1,25 @@
+<?php
+
+
+namespace app\validate;
+
+
+use think\Validate;
+
+class getListByqydm extends Validate
+{
+    protected $rule =   [
+        'page'   => 'require',
+        'size'   => 'require',
+        'qydm'   => 'require',
+
+    ];
+
+    protected $message  =   [
+        'page.require'     => 'page不能为空',
+        'size.require'     => 'size不能为空',
+        'qydm.require'     => 'qydm不能为空',
+
+    ];
+
+}

+ 3 - 1
composer.json

@@ -26,7 +26,9 @@
         "topthink/think-filesystem": "^1.0",
         "topthink/think-annotation": "1.0",
         "thans/tp-jwt-auth": "^1.3",
-        "hg/apidoc": "^5.0"
+        "hg/apidoc": "^5.0",
+        "thans/thinkphp-filesystem-cloud": "^1.0",
+        "zhushide/think-orm-elasticsearch": "^0.2.5"
     },
     "require-dev": {
         "symfony/var-dumper": "^4.2",

ファイルの差分が大きいため隠しています
+ 1738 - 274
composer.lock


+ 17 - 6
config/apidoc.php

@@ -3,7 +3,7 @@ return [
     // (选配)文档标题,显示在左上角与首页
     'title'              => 'Apidoc',
     // (选配)文档描述,显示在首页
-    'desc'               => '',
+    'desc'               => '此文档为安徽监管网格化后台',
     // (必须)设置文档的应用/版本
     'apps'           => [
         [
@@ -13,8 +13,10 @@ return [
             'path'=>'app\controller',
             // (必须)唯一的key
             'key'=>'dakkdakdkasdkmmmm',
-        ]
+        ],
+
     ],
+
     // (必须)指定通用注释定义的文件地址
     'definitions'        => "app\common\controller\Definitions",
     // (必须)自动生成url规则,当接口不添加@Apidoc\Url ("xxx")注解时,使用以下规则自动生成
@@ -34,9 +36,9 @@ return [
     // (必须)权限认证配置
     'auth'               => [
         // 是否启用密码验证
-        'enable'     => false,
+        'enable'     => true,
         // 全局访问密码
-        'password'   => "123456",
+        'password'   => "661130",
         // 密码加密盐
         'secret_key' => "apidoc#hg_code",
         // 授权访问后的有效期
@@ -74,7 +76,7 @@ return [
         ]
     ],
     //(选配)默认作者
-    'default_author'=>'',
+    'default_author'=>'ihavoc',
     //(选配)默认请求类型
     'default_method'=>'GET',
     //(选配)允许跨域访问
@@ -88,7 +90,16 @@ return [
     // (选配)数据库配置
     'database'=>[],
     // (选配)Markdown文档
-    'docs'              => [],
+    'docs'              => [
+        ['title'=>"控制器书写教程","path"=>"docs/controller"],
+        ['title'=>"企业表说明","path"=>"docs/enterprises"],
+        ['title'=>"产品表说明","path"=>"docs/productDB"],
+        ['title'=>"基地表说明","path"=>"docs/baseDB"],
+        ['title'=>"投入品表说明","path"=>"docs/inputDB"],
+        ['title'=>"投入品使用记录表说明","path"=>"docs/inputUse"],
+        ['title'=>"豇豆农药残留突出问题攻坚治理重点情况简报","path"=>"docs/qkjb"],
+
+    ],
     // (选配)代码生成器配置 注意:是一个二维数组
     'generator' =>[]
 ];

+ 13 - 0
config/cache.php

@@ -24,6 +24,19 @@ return [
             // 序列化机制 例如 ['serialize', 'unserialize']
             'serialize'  => [],
         ],
+        'redis'   =>  [
+            'type'     => 'redis',
+            'host'     => '127.0.0.1',
+            'port'     => '26379',
+            'password' => '661130',
+            'select'   => '0',
+            // 全局缓存有效期(0为永久有效)
+            'expire'   => 0,
+            // 缓存前缀
+            'prefix'   => '',
+            'timeout'  => 0,
+
+        ],
         // 更多的缓存连接
     ],
 ];

+ 7 - 1
config/database.php

@@ -57,7 +57,13 @@ return [
             // 开启字段缓存
             'fields_cache'    => false,
         ],
-
+        'elasticsearch' => [
+            'type'=>'elasticsearch',
+            'hosts' =>  ['elastic:zyh661130@es.ahlssp.net:80'],
+            'retries' => env('elasticsearch.retries', 0), //重连次数
+            'SSLVerification' => env('elasticsearch.SSLVerification', false),
+            // 'logger' => app('log'),
+        ],
         // 更多的数据库配置信息
     ],
 ];

+ 9 - 0
config/filesystem.php

@@ -19,6 +19,15 @@ return [
             // 可见性
             'visibility' => 'public',
         ],
+
+        'aliyun' => [
+            'type'         => 'aliyun',
+            'accessId'     => 'LTAI4G1xGunUnwkgq48jFWi9',
+            'accessSecret' => '17PK5dY7WnLJR1ejgsopTUBUOzS05S',
+            'bucket'       => 'ahwgh',
+            'endpoint'     => 'oss-cn-hangzhou.aliyuncs.com',
+            'url'          => 'http://oss-cn-hangzhou.aliyuncs.com',
+        ],
         // 更多的磁盘配置信息
     ],
 ];

+ 42 - 0
default.conf

@@ -0,0 +1,42 @@
+server {
+    listen 80;
+    server_name _;
+    root /var/www/html/public;
+
+    add_header X-Frame-Options "SAMEORIGIN";
+    add_header X-XSS-Protection "1; mode=block";
+    add_header X-Content-Type-Options "nosniff";
+
+    index index.php;
+
+    charset utf-8;
+
+    location / {
+        index index.php;
+        if (!-e $request_filename) {
+                    rewrite  ^(.*)$  /index.php?s=/$1  last;
+                    break;
+                }
+    }
+    location ~ \.php(/|$) {
+                include fastcgi_params;
+                 #ubuntu 缺少这个配置
+                fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
+                try_files $fastcgi_script_name =404;
+                add_header logid  $request_id;
+                fastcgi_param logid  $request_id;
+                fastcgi_pass unix:/var/run/php-fpm.sock;
+                fastcgi_index index.php;
+            }
+
+    location = /favicon.ico { access_log off; log_not_found off; }
+    location = /robots.txt  { access_log off; log_not_found off; }
+
+    error_page 404 /index.php;
+
+
+
+    location ~ /\.(?!well-known).* {
+        deny all;
+    }
+}

+ 17 - 0
docs/baseDB.md

@@ -0,0 +1,17 @@
+# 企业基地表
+t_base
+| Field|  Type|  Extra | P |
+| :-----| ----: | :----: | :----: |
+ | id | int(10) |
+ | qydm | varchar(24) | COMMENT ''企业代码'' |
+ | base_name | varchar(255) | COMMENT ''基地名称'' | Allow Null |
+ | county | varchar(24) | COMMENT ''基地所在县'' | Allow Null |
+ | towns | varchar(32) | COMMENT ''所在乡镇'' | Allow Null |
+ | village | varchar(32) | COMMENT ''所在村'' | Allow Null |
+ | lnt | varchar(50) | COMMENT ''基地经度'' | Allow Null
+ | lat | varchar(50) | COMMENT ''基地纬度'' | Allow Null |
+ | areas | double(8,2) | COMMENT ''基地面积'' | Allow Null |
+ | openhouse | int(4) | COMMENT ''露地数量'' | Allow Null |
+ | greenhouse | int(4) | COMMENT ''大棚数量'' | Allow Null |
+ | creation_time | datetime | | Allow Null |
+ | last_update_time | datetime | | Allow Null |

+ 48 - 0
docs/enterprises.md

@@ -0,0 +1,48 @@
+# 企业表说明
+```php
+'fzr_name.require'     => '负责人姓名不能为空',
+'fzr_id_number.require'     => '负责人身份证不能为空',
+'entity_type.require'     => '主体类型不能为空',
+'enterprises_type.require'     => '生产类型不能为空',
+'city.require'     => '所属市不能为空',
+'country.require'     => '所属区县不能为空',
+'towns.require'     => '所属乡、镇、街道不能为空',
+```
+## 注册主体类型
+企业、个体工商户、家庭农场、合作社、个人 
+------------------------------------
+合作社分为 有独立组织机构代码证(营业执照),无组织机构代码证(营业执照)
+## enterprises_type 生产类型
+多选,提交拼接字符串,用“,”分割
+## 后端企业代码生成规则
+最后一级行政区代码+“.”+身份证号/营业执照号
+---------------------------------------
+t_enterprises
+| Field|  Type|  Extra | P |
+| :-----| ----: | :----: | :----: |
+id | int(11) Auto Increment
+qydm | varchar(20) | COMMENT ''企业代码'' |
+enterprises_name |  varchar(255) | COMMENT ''企业名称'' | Allow Null
+fzr_name |  varchar(10) | COMMENT ''负责人姓名(法人姓名)''
+fzr_phone | varchar(18) | COMMENT ''负责人联系方式(法人联系方式)'' | Allow Null
+fzr_id_number | varchar(24) | COMMENT ''负责人身份证号'' |
+fer_image | varchar(255) | COMMENT ''负责人身份证正反面图片(支持多图)'' | Allow Null
+enterprises_address | varchar(255) | COMMENT ''企业地址'' | Allow Null
+enterprises_lnt | varchar(255) | COMMENT ''企业经度'' | Allow Null
+enterprises_lat | varchar(50) | COMMENT ''企业纬度'' | Allow Null
+enterprises_type | varchar(255) | COMMENT ''企业类型(种植、畜牧、水产、其他等)'' | Allow Null
+entity_type | varchar(255) | COMMENT ''企业主体类型(生产企业、合作社、家庭农场、大户、散户)'' |
+credit_rating | varchar(10) | COMMENT ''企业信用等级'' | Allow Null
+register_capital | varchar(10) | COMMENT ''企业注册资金(万元)'' | Allow Null
+annual_sales | varchar(10) | COMMENT ''企业年销售量'' | Allow Null
+enterprise_scale | varchar(255) | COMMENT ''企业规模'' | Allow Null
+xydm | varchar(50)  |COMMENT ''企业营业执照上的信用代码'' | Allow Null
+business_image | varchar(255) | COMMENT ''企业营业执照图片'' | Allow Null
+company_introduction | text | COMMENT ''企业介绍'' | Allow Null
+city | varchar(10) | COMMENT ''所属市'' |
+county | varchar(10) | COMMENT ''所属县区'' |
+towns | varchar(20) | COMMENT ''所属乡镇'' |
+status | int(2) | COMMENT ''经营主体的状态(0,1,2)'' | Allow Null
+delete_status | int(2) | COMMENT ''记录软删除状态0正常1删除'' | Allow Null
+creation_time | datetime | COMMENT ''创建时间'' | Allow Null
+last_update_time | datetime | COMMENT ''最后修改时间'' | Allow Null

BIN
docs/img.png


BIN
docs/img_1.png


+ 22 - 0
docs/inputDB.md

@@ -0,0 +1,22 @@
+# 投入品表
+t_input
+| Field|  Type|  Extra | P |
+| :-----| ----: | :----: | :----: |
+id | int(11) Auto Increment
+qydm | varchar(255) | COMMENT ''购买企业的企业代码'' | |
+input_number | varchar(255) | COMMENT ''投入品记录号(系统生成,用于投入品使用是关联)'' | Allow Null
+buy_type | varchar(20) | COMMENT ''购买品类'' | Allow Null
+product_name | varchar(20) | COMMENT ''商品名称'' | Allow Null
+yxcf | varchar(255) | COMMENT ''有效成分'' | Allow Null
+djzh | varchar(255) | COMMENT ''登记证号'' | Allow Null
+djzw | varchar(255) | COMMENT ''登记作物、动物'' | Allow Null
+jg | varchar(10) | COMMENT ''间隔(修药期)'' | Allow Null
+cjmc | varchar(255) | COMMENT ''投入品厂家名称'' | Allow Null
+bzgg | varchar(255) | COMMENT ''投入品包装规格'' | Allow Null
+gmsl | varchar(10) | COMMENT ''投入品购买数量'' | Allow Null
+jldw | varchar(10) | COMMENT ''投入品计量单位'' | Allow Null
+gmrq | datetime | COMMENT ''投入品购买时间'' | Allow Null
+xszmc | varchar(20) | COMMENT ''投入品销售者名称'' | Allow Null
+image | varchar(255) | COMMENT ''投入品图片'' | Allow Null
+creation_time | datetime | COMMENT ''创建时间'' | Allow Null
+last_update_time | datetime | COMMENT ''最后修改时间'' | Allow Null

+ 18 - 0
docs/inputUse.md

@@ -0,0 +1,18 @@
+# 投入品记录表
+--------------------------
+投入品记录号 input_number 关联投入品id
+----------------------------
+sydx 使用对象关联产品表id
+-----------------------
+t_input_use
+| Field|  Type|  Extra | P |
+| :-----| ----: | :----: | :----: |
+| id | int(11)| |  Auto Increment | |
+| qydm | varchar(255) | COMMENT ''企业代码'' | Allow Null
+| input_number | varchar(255) | COMMENT ''投入品记录号'' | Allow Null
+| sydx | varchar(255) | COMMENT ''施用对象'' | Allow Null
+| fzbch | varchar(255) | COMMENT ''防治病虫害'' | Allow Null
+| syl | varchar(10) | COMMENT ''施用量'' | Allow Null
+| syrq | datetime | COMMENT ''施用日期'' | Allow Null
+| creation_time | datetime | COMMENT ''创建时间'' | Allow Null
+| last_update_time | datetime | COMMENT ''最后修改时间'' | Allow Null

+ 24 - 0
docs/productDB.md

@@ -0,0 +1,24 @@
+# product表结构
+t_product
+| Field | Type | Extra | P|
+| :-----| ----: | :----: | :----: |
+| id | int(11) | COMMENT ''主键id'' | Auto Increment
+| product_name | varchar(255) | COMMENT ''产品名称'' |
+| product_class_id | varchar(255) | COMMENT ''产品分类id,关联product_class'' |
+| area | varchar(255) | COMMENT ''种植面积'' | Allow Null
+| qydm | varchar(255) | COMMENT ''企业代码''  |Allow Null
+| pattern | varchar(255) | COMMENT ''种植方式 露天/大棚'' | Allow Null
+| authentication | varchar(255) | COMMENT ''认证类型绿色/有机/地理标志'' | Allow Null
+| auth_img | varchar(255) | COMMENT ''认证证书'' | Allow Null
+| auth_date_start | date | COMMENT ''认证起始日期'' | Allow Null
+| auth_date_end | date | COMMENT ''认证结束日期'' | Allow Null
+| auth_number | varchar(255) | COMMENT ''产品证书编号'' | Allow Null
+| auth_org | varchar(255) | COMMENT ''颁发证书机构'' | Allow Null
+| scale | varchar(255) | COMMENT ''规模数值'' | Allow Null
+| scale_class | varchar(255) | COMMENT ''规模单位'' | Allow Null
+| production | varchar(255) | COMMENT ''产量'' | Allow Null
+| production_class | varchar(255) | COMMENT ''产量单位'' | Allow Null
+| ship | varchar(255) | COMMENT ''上市月份逗号分隔'' | Allow Null
+| create_time | datetime | COMMENT ''创建数据时间'' | Allow Null
+| update_time | datetime ON UPDATE CURRENT_TIMESTAMP | COMMENT ''更新时间'' | Allow Null
+| delete_time | datetime | COMMENT ''软删除'' | Allow Null

+ 9 - 1
vendor/composer/autoload_files.php

@@ -6,11 +6,19 @@ $vendorDir = dirname(__DIR__);
 $baseDir = dirname($vendorDir);
 
 return array(
+    '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
+    'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
+    '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
+    '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
     '9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
     '35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php',
+    'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
+    'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
+    'cd5441689b14144e5573bf989ee47b34' => $vendorDir . '/qcloud/cos-sdk-v5/src/Common.php',
+    '841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
+    '8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
     '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
     '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
-    'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
     '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
     'cc25fa796cd7d2989f16cf9daf45371d' => $vendorDir . '/thans/tp-jwt-auth/src/helper.php',
 );

+ 21 - 1
vendor/composer/autoload_psr4.php

@@ -7,25 +7,45 @@ $baseDir = dirname($vendorDir);
 
 return array(
     'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'),
+    'think\\db\\' => array($vendorDir . '/zhushide/think-orm-elasticsearch/src'),
     'think\\annotation\\' => array($vendorDir . '/topthink/think-annotation/src'),
     'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-filesystem/src', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src'),
     'thans\\jwt\\' => array($vendorDir . '/thans/tp-jwt-auth/src'),
+    'thans\\filesystem\\' => array($vendorDir . '/thans/thinkphp-filesystem-cloud/src'),
     'hg\\apidoc\\' => array($vendorDir . '/hg/apidoc/src'),
     'app\\' => array($baseDir . '/app'),
+    'Xxtime\\Flysystem\\Aliyun\\' => array($vendorDir . '/xxtime/flysystem-aliyun-oss/src'),
     'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
     'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
     'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
     'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
+    'React\\Promise\\' => array($vendorDir . '/react/promise/src'),
+    'Qiniu\\' => array($vendorDir . '/qiniu/php-sdk/src/Qiniu'),
+    'Qcloud\\Cos\\' => array($vendorDir . '/qcloud/cos-sdk-v5/src'),
     'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
     'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
-    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
+    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
+    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
     'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
     'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
     'PhpDocReader\\' => array($vendorDir . '/php-di/phpdoc-reader/src/PhpDocReader'),
+    'Overtrue\\Flysystem\\Cos\\' => array($vendorDir . '/overtrue/flysystem-cos/src'),
+    'OSS\\' => array($vendorDir . '/aliyuncs/oss-sdk-php/src/OSS'),
+    'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),
+    'Liz\\Flysystem\\QiNiu\\' => array($vendorDir . '/liz/flysystem-qiniu/src'),
     'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'),
     'League\\Flysystem\\Cached\\' => array($vendorDir . '/league/flysystem-cached-adapter/src'),
     'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
     'Lcobucci\\JWT\\' => array($vendorDir . '/qeq66/jwt/src'),
+    'GuzzleHttp\\UriTemplate\\' => array($vendorDir . '/guzzlehttp/uri-template/src'),
+    'GuzzleHttp\\Stream\\' => array($vendorDir . '/ezimuel/guzzlestreams/src'),
+    'GuzzleHttp\\Ring\\' => array($vendorDir . '/ezimuel/ringphp/src'),
+    'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
+    'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
+    'GuzzleHttp\\Command\\Guzzle\\' => array($vendorDir . '/guzzlehttp/guzzle-services/src'),
+    'GuzzleHttp\\Command\\' => array($vendorDir . '/guzzlehttp/command/src'),
+    'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
+    'Elasticsearch\\' => array($vendorDir . '/elasticsearch/elasticsearch/src/Elasticsearch'),
     'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'),
     'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/src'),
     'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'),

+ 132 - 2
vendor/composer/autoload_static.php

@@ -7,11 +7,19 @@ namespace Composer\Autoload;
 class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
 {
     public static $files = array (
+        '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
+        'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
+        '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
+        '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
         '9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
         '35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php',
+        'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
+        'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
+        'cd5441689b14144e5573bf989ee47b34' => __DIR__ . '/..' . '/qcloud/cos-sdk-v5/src/Common.php',
+        '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
+        '8592c7b0947d8a0965a9e8c3d16f9c24' => __DIR__ . '/..' . '/elasticsearch/elasticsearch/src/autoload.php',
         '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
         '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
-        'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
         '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
         'cc25fa796cd7d2989f16cf9daf45371d' => __DIR__ . '/..' . '/thans/tp-jwt-auth/src/helper.php',
     );
@@ -20,9 +28,11 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         't' => 
         array (
             'think\\trace\\' => 12,
+            'think\\db\\' => 9,
             'think\\annotation\\' => 17,
             'think\\' => 6,
             'thans\\jwt\\' => 10,
+            'thans\\filesystem\\' => 17,
         ),
         'h' => 
         array (
@@ -32,6 +42,10 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             'app\\' => 4,
         ),
+        'X' => 
+        array (
+            'Xxtime\\Flysystem\\Aliyun\\' => 24,
+        ),
         'S' => 
         array (
             'Symfony\\Polyfill\\Php80\\' => 23,
@@ -39,22 +53,57 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
             'Symfony\\Polyfill\\Mbstring\\' => 26,
             'Symfony\\Component\\VarDumper\\' => 28,
         ),
+        'R' => 
+        array (
+            'React\\Promise\\' => 14,
+        ),
+        'Q' => 
+        array (
+            'Qiniu\\' => 6,
+            'Qcloud\\Cos\\' => 11,
+        ),
         'P' => 
         array (
             'Psr\\SimpleCache\\' => 16,
             'Psr\\Log\\' => 8,
             'Psr\\Http\\Message\\' => 17,
+            'Psr\\Http\\Client\\' => 16,
             'Psr\\Container\\' => 14,
             'Psr\\Cache\\' => 10,
             'PhpDocReader\\' => 13,
         ),
+        'O' => 
+        array (
+            'Overtrue\\Flysystem\\Cos\\' => 23,
+            'OSS\\' => 4,
+        ),
+        'M' => 
+        array (
+            'MyCLabs\\Enum\\' => 13,
+        ),
         'L' => 
         array (
+            'Liz\\Flysystem\\QiNiu\\' => 20,
             'League\\MimeTypeDetection\\' => 25,
             'League\\Flysystem\\Cached\\' => 24,
             'League\\Flysystem\\' => 17,
             'Lcobucci\\JWT\\' => 13,
         ),
+        'G' => 
+        array (
+            'GuzzleHttp\\UriTemplate\\' => 23,
+            'GuzzleHttp\\Stream\\' => 18,
+            'GuzzleHttp\\Ring\\' => 16,
+            'GuzzleHttp\\Psr7\\' => 16,
+            'GuzzleHttp\\Promise\\' => 19,
+            'GuzzleHttp\\Command\\Guzzle\\' => 26,
+            'GuzzleHttp\\Command\\' => 19,
+            'GuzzleHttp\\' => 11,
+        ),
+        'E' => 
+        array (
+            'Elasticsearch\\' => 14,
+        ),
         'D' => 
         array (
             'Doctrine\\Deprecations\\' => 22,
@@ -68,6 +117,10 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             0 => __DIR__ . '/..' . '/topthink/think-trace/src',
         ),
+        'think\\db\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/zhushide/think-orm-elasticsearch/src',
+        ),
         'think\\annotation\\' => 
         array (
             0 => __DIR__ . '/..' . '/topthink/think-annotation/src',
@@ -83,6 +136,10 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             0 => __DIR__ . '/..' . '/thans/tp-jwt-auth/src',
         ),
+        'thans\\filesystem\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/thans/thinkphp-filesystem-cloud/src',
+        ),
         'hg\\apidoc\\' => 
         array (
             0 => __DIR__ . '/..' . '/hg/apidoc/src',
@@ -91,6 +148,10 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             0 => __DIR__ . '/../..' . '/app',
         ),
+        'Xxtime\\Flysystem\\Aliyun\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/xxtime/flysystem-aliyun-oss/src',
+        ),
         'Symfony\\Polyfill\\Php80\\' => 
         array (
             0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
@@ -107,6 +168,18 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             0 => __DIR__ . '/..' . '/symfony/var-dumper',
         ),
+        'React\\Promise\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/react/promise/src',
+        ),
+        'Qiniu\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu',
+        ),
+        'Qcloud\\Cos\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/qcloud/cos-sdk-v5/src',
+        ),
         'Psr\\SimpleCache\\' => 
         array (
             0 => __DIR__ . '/..' . '/psr/simple-cache/src',
@@ -117,7 +190,12 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         ),
         'Psr\\Http\\Message\\' => 
         array (
-            0 => __DIR__ . '/..' . '/psr/http-message/src',
+            0 => __DIR__ . '/..' . '/psr/http-factory/src',
+            1 => __DIR__ . '/..' . '/psr/http-message/src',
+        ),
+        'Psr\\Http\\Client\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/psr/http-client/src',
         ),
         'Psr\\Container\\' => 
         array (
@@ -131,6 +209,22 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             0 => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader',
         ),
+        'Overtrue\\Flysystem\\Cos\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/overtrue/flysystem-cos/src',
+        ),
+        'OSS\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS',
+        ),
+        'MyCLabs\\Enum\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/myclabs/php-enum/src',
+        ),
+        'Liz\\Flysystem\\QiNiu\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/liz/flysystem-qiniu/src',
+        ),
         'League\\MimeTypeDetection\\' => 
         array (
             0 => __DIR__ . '/..' . '/league/mime-type-detection/src',
@@ -147,6 +241,42 @@ class ComposerStaticInitc5816a8f99b96cf0f2cbda034ad106d7
         array (
             0 => __DIR__ . '/..' . '/qeq66/jwt/src',
         ),
+        'GuzzleHttp\\UriTemplate\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/guzzlehttp/uri-template/src',
+        ),
+        'GuzzleHttp\\Stream\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/ezimuel/guzzlestreams/src',
+        ),
+        'GuzzleHttp\\Ring\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/ezimuel/ringphp/src',
+        ),
+        'GuzzleHttp\\Psr7\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
+        ),
+        'GuzzleHttp\\Promise\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
+        ),
+        'GuzzleHttp\\Command\\Guzzle\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/guzzlehttp/guzzle-services/src',
+        ),
+        'GuzzleHttp\\Command\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/guzzlehttp/command/src',
+        ),
+        'GuzzleHttp\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
+        ),
+        'Elasticsearch\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/elasticsearch/elasticsearch/src/Elasticsearch',
+        ),
         'Doctrine\\Deprecations\\' => 
         array (
             0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations',

ファイルの差分が大きいため隠しています
+ 1362 - 177
vendor/composer/installed.json


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません