浏览代码

feat: 111

lanjianrong 4 年之前
父节点
当前提交
e6153cdec9
共有 4 个文件被更改,包括 885 次插入0 次删除
  1. 17 0
      conf/project.go
  2. 328 0
      web/docs/docs.go
  3. 328 0
      web/docs/swagger.json
  4. 212 0
      web/docs/swagger.yaml

+ 17 - 0
conf/project.go

@@ -26,3 +26,20 @@ const NodeRpcHost = "localhost:50051"
 
 // 是否需要启动全局计划任务服务
 var RunningCrontabService = false
+
+// 审批常量
+type auditStatus struct {
+	uncheck int
+	checking int
+	checked int
+	checkNo int
+}
+
+func NewAuditConsts() AuditStatus {
+	return &auditStatus {
+		uncheck: 0, // 待审批
+		checking: 1, // 审批中
+		checked: 2, // 审批完成
+		checkNo: 3,// 退回
+	}
+}

+ 328 - 0
web/docs/docs.go

@@ -147,6 +147,78 @@ var doc = `{
                 }
             }
         },
+        "/api/contract/income/create": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "新增合同",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "合同管理"
+                ],
+                "summary": "新增合同",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "项目节ID",
+                        "name": "treeId",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "标段ID",
+                        "name": "bidsectionId",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "合同编号",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "合同名称",
+                        "name": "name",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "合同类型(1)",
+                        "name": "contractsType",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "合同金额",
+                        "name": "price",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,-1参数类错误,msg:错误信息}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.TreeSectionContract"
+                        }
+                    }
+                }
+            }
+        },
         "/api/contract/income/section/all": {
             "get": {
                 "security": [
@@ -1387,6 +1459,214 @@ var doc = `{
                 }
             }
         },
+        "/api/safe": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "获得列表数据",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "标段ID",
+                        "name": "bidsectionId",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,data:viewmodels.Safe,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            },
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "创建新的安全巡检记录",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "description": "标段ID",
+                        "name": "bidsectionId",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "编号",
+                        "name": "code",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "日期",
+                        "name": "createTime",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "检查部位",
+                        "name": "inspection",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "部位",
+                        "name": "position",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            },
+            "delete": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "删除安全巡检记录",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "description": "安全巡检ID",
+                        "name": "id",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            }
+        },
+        "/api/safe/detail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "获得安全巡检详情页面数据",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "巡检ID",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,data:viewmodels.Safe,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            }
+        },
         "/api/tree": {
             "get": {
                 "security": [
@@ -1676,6 +1956,16 @@ var doc = `{
                 },
                 "projectId": {
                     "type": "string"
+                },
+                "safeRectification": {
+                    "type": "integer"
+                },
+                "safeRectificationIn": {
+                    "type": "integer"
+                },
+                "safeTotal": {
+                    "description": "安全巡检字段-后期做接口后移动-TODO",
+                    "type": "integer"
                 }
             }
         },
@@ -1740,6 +2030,44 @@ var doc = `{
                 }
             }
         },
+        "viewmodels.Safe": {
+            "type": "object",
+            "properties": {
+                "bidsectionId": {
+                    "type": "string"
+                },
+                "code": {
+                    "type": "string"
+                },
+                "createTime": {
+                    "type": "string"
+                },
+                "demand": {
+                    "type": "string"
+                },
+                "endTime": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "string"
+                },
+                "inspection": {
+                    "type": "string"
+                },
+                "inspectionDetail": {
+                    "type": "string"
+                },
+                "position": {
+                    "type": "string"
+                },
+                "status": {
+                    "type": "integer"
+                },
+                "uid": {
+                    "type": "string"
+                }
+            }
+        },
         "viewmodels.Tree": {
             "type": "object",
             "properties": {

+ 328 - 0
web/docs/swagger.json

@@ -130,6 +130,78 @@
                 }
             }
         },
+        "/api/contract/income/create": {
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "新增合同",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "合同管理"
+                ],
+                "summary": "新增合同",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "项目节ID",
+                        "name": "treeId",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "标段ID",
+                        "name": "bidsectionId",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "合同编号",
+                        "name": "code",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "合同名称",
+                        "name": "name",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "合同类型(1)",
+                        "name": "contractsType",
+                        "in": "path",
+                        "required": true
+                    },
+                    {
+                        "type": "string",
+                        "description": "合同金额",
+                        "name": "price",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,-1参数类错误,msg:错误信息}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.TreeSectionContract"
+                        }
+                    }
+                }
+            }
+        },
         "/api/contract/income/section/all": {
             "get": {
                 "security": [
@@ -1370,6 +1442,214 @@
                 }
             }
         },
+        "/api/safe": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "获得列表数据",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "标段ID",
+                        "name": "bidsectionId",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,data:viewmodels.Safe,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            },
+            "post": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "创建新的安全巡检记录",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "description": "标段ID",
+                        "name": "bidsectionId",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "编号",
+                        "name": "code",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "日期",
+                        "name": "createTime",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "检查部位",
+                        "name": "inspection",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    },
+                    {
+                        "description": "部位",
+                        "name": "position",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            },
+            "delete": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "删除安全巡检记录",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "description": "安全巡检ID",
+                        "name": "id",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            }
+        },
+        "/api/safe/detail": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "description": "获得安全巡检详情页面数据",
+                "consumes": [
+                    "application/json"
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "安全巡检"
+                ],
+                "summary": "安全巡检列表",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "巡检ID",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "{code:0成功,data:viewmodels.Safe,msg:}",
+                        "schema": {
+                            "$ref": "#/definitions/viewmodels.Safe"
+                        }
+                    },
+                    "400": {
+                        "description": "{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}",
+                        "schema": {
+                            "type": "string"
+                        }
+                    }
+                }
+            }
+        },
         "/api/tree": {
             "get": {
                 "security": [
@@ -1659,6 +1939,16 @@
                 },
                 "projectId": {
                     "type": "string"
+                },
+                "safeRectification": {
+                    "type": "integer"
+                },
+                "safeRectificationIn": {
+                    "type": "integer"
+                },
+                "safeTotal": {
+                    "description": "安全巡检字段-后期做接口后移动-TODO",
+                    "type": "integer"
                 }
             }
         },
@@ -1723,6 +2013,44 @@
                 }
             }
         },
+        "viewmodels.Safe": {
+            "type": "object",
+            "properties": {
+                "bidsectionId": {
+                    "type": "string"
+                },
+                "code": {
+                    "type": "string"
+                },
+                "createTime": {
+                    "type": "string"
+                },
+                "demand": {
+                    "type": "string"
+                },
+                "endTime": {
+                    "type": "string"
+                },
+                "id": {
+                    "type": "string"
+                },
+                "inspection": {
+                    "type": "string"
+                },
+                "inspectionDetail": {
+                    "type": "string"
+                },
+                "position": {
+                    "type": "string"
+                },
+                "status": {
+                    "type": "integer"
+                },
+                "uid": {
+                    "type": "string"
+                }
+            }
+        },
         "viewmodels.Tree": {
             "type": "object",
             "properties": {

+ 212 - 0
web/docs/swagger.yaml

@@ -42,6 +42,13 @@ definitions:
         type: string
       projectId:
         type: string
+      safeRectification:
+        type: integer
+      safeRectificationIn:
+        type: integer
+      safeTotal:
+        description: 安全巡检字段-后期做接口后移动-TODO
+        type: integer
     type: object
   viewmodels.Project:
     properties:
@@ -83,6 +90,31 @@ definitions:
       telephone:
         type: string
     type: object
+  viewmodels.Safe:
+    properties:
+      bidsectionId:
+        type: string
+      code:
+        type: string
+      createTime:
+        type: string
+      demand:
+        type: string
+      endTime:
+        type: string
+      id:
+        type: string
+      inspection:
+        type: string
+      inspectionDetail:
+        type: string
+      position:
+        type: string
+      status:
+        type: integer
+      uid:
+        type: string
+    type: object
   viewmodels.Tree:
     properties:
       ancounts:
@@ -259,6 +291,54 @@ paths:
       summary: 单个合同详情和项目节详情
       tags:
       - 合同管理
+  /api/contract/income/create:
+    post:
+      consumes:
+      - application/json
+      description: 新增合同
+      parameters:
+      - description: 项目节ID
+        in: path
+        name: treeId
+        required: true
+        type: string
+      - description: 标段ID
+        in: path
+        name: bidsectionId
+        required: true
+        type: string
+      - description: 合同编号
+        in: path
+        name: code
+        required: true
+        type: string
+      - description: 合同名称
+        in: path
+        name: name
+        required: true
+        type: string
+      - description: 合同类型(1)
+        in: path
+        name: contractsType
+        required: true
+        type: integer
+      - description: 合同金额
+        in: path
+        name: price
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: '{code:0成功,-1参数类错误,msg:错误信息}'
+          schema:
+            $ref: '#/definitions/viewmodels.TreeSectionContract'
+      security:
+      - ApiKeyAuth: []
+      summary: 新增合同
+      tags:
+      - 合同管理
   /api/contract/income/section/all:
     get:
       consumes:
@@ -1046,6 +1126,138 @@ paths:
       summary: 保存项目信息
       tags:
       - 项目设置-管理员
+  /api/safe:
+    delete:
+      consumes:
+      - application/json
+      description: 删除安全巡检记录
+      parameters:
+      - description: 安全巡检ID
+        in: body
+        name: id
+        required: true
+        schema:
+          type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: '{code:0成功,msg:}'
+          schema:
+            $ref: '#/definitions/viewmodels.Safe'
+        "400":
+          description: '{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}'
+          schema:
+            type: string
+      security:
+      - ApiKeyAuth: []
+      summary: 安全巡检列表
+      tags:
+      - 安全巡检
+    get:
+      consumes:
+      - application/json
+      description: 获得列表数据
+      parameters:
+      - description: 标段ID
+        in: path
+        name: bidsectionId
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: '{code:0成功,data:viewmodels.Safe,msg:}'
+          schema:
+            $ref: '#/definitions/viewmodels.Safe'
+        "400":
+          description: '{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}'
+          schema:
+            type: string
+      security:
+      - ApiKeyAuth: []
+      summary: 安全巡检列表
+      tags:
+      - 安全巡检
+    post:
+      consumes:
+      - application/json
+      description: 创建新的安全巡检记录
+      parameters:
+      - description: 标段ID
+        in: body
+        name: bidsectionId
+        required: true
+        schema:
+          type: string
+      - description: 编号
+        in: body
+        name: code
+        required: true
+        schema:
+          type: string
+      - description: 日期
+        in: body
+        name: createTime
+        required: true
+        schema:
+          type: string
+      - description: 检查部位
+        in: body
+        name: inspection
+        required: true
+        schema:
+          type: string
+      - description: 部位
+        in: body
+        name: position
+        required: true
+        schema:
+          type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: '{code:0成功,msg:}'
+          schema:
+            $ref: '#/definitions/viewmodels.Safe'
+        "400":
+          description: '{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}'
+          schema:
+            type: string
+      security:
+      - ApiKeyAuth: []
+      summary: 安全巡检列表
+      tags:
+      - 安全巡检
+  /api/safe/detail:
+    get:
+      consumes:
+      - application/json
+      description: 获得安全巡检详情页面数据
+      parameters:
+      - description: 巡检ID
+        in: path
+        name: id
+        required: true
+        type: string
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: '{code:0成功,data:viewmodels.Safe,msg:}'
+          schema:
+            $ref: '#/definitions/viewmodels.Safe'
+        "400":
+          description: '{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}'
+          schema:
+            type: string
+      security:
+      - ApiKeyAuth: []
+      summary: 安全巡检列表
+      tags:
+      - 安全巡检
   /api/tree:
     delete:
       consumes: