Ver Fonte

增加查询交易主体、审核设置接口

zou.yingbin há 4 anos atrás
pai
commit
e5f6f465f5
6 ficheiros alterados com 754 adições e 0 exclusões
  1. 35 0
      controllers/ermcp3/qryErmcp3.go
  2. 224 0
      docs/docs.go
  3. 224 0
      docs/swagger.json
  4. 154 0
      docs/swagger.yaml
  5. 115 0
      models/ermcp3.go
  6. 2 0
      routers/router.go

+ 35 - 0
controllers/ermcp3/qryErmcp3.go

@@ -498,3 +498,38 @@ func QueryRootUserAccount(c *gin.Context) {
 	m := models.Ermcp3RootUserAccount{USERID: req.USERID}
 	a.DoGetDataI(&m)
 }
+
+// QueryPaAreaSubject
+// @Summary 查询交易主体
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户id"
+// @Param subjectid query int false "主体ID(SEQ_ERMCP_PA_AREASUBJECT)"
+// @Param subjecttype query int false "主体类型 - 1:交易主体 2:业务部门"
+// @Param subjectstatus query int false "主体状态 - 1:正常 2: 停用"
+// @Success 200 {array} models.Ermcp3PaAreaSubject
+// @Failure 500 {object} app.Response
+// @Router /Ermcp3/QueryPaAreaSubject [get]
+// @Tags 企业风险管理v3(app)
+func QueryPaAreaSubject(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Ermcp3PaAreaSubject{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}
+
+// QueryPaAreaAuditCfg
+// @Summary 查询审核设置
+// @Produce json
+// @Security ApiKeyAuth
+// @Param userid query int true "用户id"
+// @Success 200 {array} models.Ermcp3PaAreaAuditCfg
+// @Failure 500 {object} app.Response
+// @Router /Ermcp3/QueryPaAreaAuditCfg [get]
+// @Tags 企业风险管理v3(app)
+func QueryPaAreaAuditCfg(c *gin.Context) {
+	a := app.GinUtils{Gin: app.Gin{C: c}}
+	m := models.Ermcp3PaAreaAuditCfg{}
+	a.DoBindReq(&m)
+	a.DoGetDataI(&m)
+}

+ 224 - 0
docs/docs.go

@@ -4485,6 +4485,108 @@ var doc = `{
                 }
             }
         },
+        "/Ermcp3/QueryPaAreaAuditCfg": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理v3(app)"
+                ],
+                "summary": "查询审核设置",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Ermcp3PaAreaAuditCfg"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Ermcp3/QueryPaAreaSubject": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理v3(app)"
+                ],
+                "summary": "查询交易主体",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "主体ID(SEQ_ERMCP_PA_AREASUBJECT)",
+                        "name": "subjectid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "主体类型 - 1:交易主体 2:业务部门",
+                        "name": "subjecttype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "主体状态 - 1:正常 2: 停用",
+                        "name": "subjectstatus",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Ermcp3PaAreaSubject"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ermcp3/QueryRootUserAccount": {
             "get": {
                 "security": [
@@ -19293,6 +19395,128 @@ var doc = `{
                 }
             }
         },
+        "models.Ermcp3PaAreaAuditCfg": {
+            "type": "object",
+            "properties": {
+                "areauserid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "buyinauditflag": {
+                    "description": "采购入库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "customerauditflag": {
+                    "description": "客户资料是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "deliveryauditflag": {
+                    "description": "交收是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "invoiceauditflag": {
+                    "description": "发票是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "moneyauditflag": {
+                    "description": "款项是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "operatorid": {
+                    "description": "操作人",
+                    "type": "integer"
+                },
+                "operatorsrc": {
+                    "description": "操作来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "pointpriceauditflag": {
+                    "description": "点价是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "produceinauditflag": {
+                    "description": "生产入库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "produceoutauditflag": {
+                    "description": "生产出库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "selloutauditflag": {
+                    "description": "销售出库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "spotcontractauditflag": {
+                    "description": "现货合同是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.Ermcp3PaAreaSubject": {
+            "type": "object",
+            "properties": {
+                "areauserid": {
+                    "description": "所属机构",
+                    "type": "integer"
+                },
+                "canmodify": {
+                    "description": "是否可修改 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人ID",
+                    "type": "string"
+                },
+                "creatorsrc": {
+                    "description": "创建人来源 - 1:管理端 2:终端 3:交易",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "修改人",
+                    "type": "string"
+                },
+                "modifiersrc": {
+                    "description": "修改人来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "modifytime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "parentsubjectid": {
+                    "description": "上级主体ID",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "subjectid": {
+                    "description": "主体ID(SEQ_ERMCP_PA_AREASUBJECT)",
+                    "type": "integer"
+                },
+                "subjectname": {
+                    "description": "主体名称",
+                    "type": "string"
+                },
+                "subjectstatus": {
+                    "description": "主体状态 - 1:正常 2: 停用",
+                    "type": "integer"
+                },
+                "subjecttype": {
+                    "description": "主体类型 - 1:交易主体 2:业务部门",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Ermcp3RootUserAccount": {
             "type": "object",
             "properties": {

+ 224 - 0
docs/swagger.json

@@ -4469,6 +4469,108 @@
                 }
             }
         },
+        "/Ermcp3/QueryPaAreaAuditCfg": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理v3(app)"
+                ],
+                "summary": "查询审核设置",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Ermcp3PaAreaAuditCfg"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/Ermcp3/QueryPaAreaSubject": {
+            "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "企业风险管理v3(app)"
+                ],
+                "summary": "查询交易主体",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "用户id",
+                        "name": "userid",
+                        "in": "query",
+                        "required": true
+                    },
+                    {
+                        "type": "integer",
+                        "description": "主体ID(SEQ_ERMCP_PA_AREASUBJECT)",
+                        "name": "subjectid",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "主体类型 - 1:交易主体 2:业务部门",
+                        "name": "subjecttype",
+                        "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "主体状态 - 1:正常 2: 停用",
+                        "name": "subjectstatus",
+                        "in": "query"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "OK",
+                        "schema": {
+                            "type": "array",
+                            "items": {
+                                "$ref": "#/definitions/models.Ermcp3PaAreaSubject"
+                            }
+                        }
+                    },
+                    "500": {
+                        "description": "Internal Server Error",
+                        "schema": {
+                            "$ref": "#/definitions/app.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/Ermcp3/QueryRootUserAccount": {
             "get": {
                 "security": [
@@ -19277,6 +19379,128 @@
                 }
             }
         },
+        "models.Ermcp3PaAreaAuditCfg": {
+            "type": "object",
+            "properties": {
+                "areauserid": {
+                    "description": "用户ID",
+                    "type": "integer"
+                },
+                "buyinauditflag": {
+                    "description": "采购入库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "customerauditflag": {
+                    "description": "客户资料是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "deliveryauditflag": {
+                    "description": "交收是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "invoiceauditflag": {
+                    "description": "发票是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "moneyauditflag": {
+                    "description": "款项是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "operatorid": {
+                    "description": "操作人",
+                    "type": "integer"
+                },
+                "operatorsrc": {
+                    "description": "操作来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "pointpriceauditflag": {
+                    "description": "点价是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "produceinauditflag": {
+                    "description": "生产入库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "produceoutauditflag": {
+                    "description": "生产出库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "selloutauditflag": {
+                    "description": "销售出库是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "spotcontractauditflag": {
+                    "description": "现货合同是否需要审核 - 0:不需审核 1:需要审核",
+                    "type": "integer"
+                },
+                "updatetime": {
+                    "description": "更新时间",
+                    "type": "string"
+                }
+            }
+        },
+        "models.Ermcp3PaAreaSubject": {
+            "type": "object",
+            "properties": {
+                "areauserid": {
+                    "description": "所属机构",
+                    "type": "integer"
+                },
+                "canmodify": {
+                    "description": "是否可修改 - 0:否 1:是",
+                    "type": "integer"
+                },
+                "createtime": {
+                    "description": "创建时间",
+                    "type": "string"
+                },
+                "creatorid": {
+                    "description": "创建人ID",
+                    "type": "string"
+                },
+                "creatorsrc": {
+                    "description": "创建人来源 - 1:管理端 2:终端 3:交易",
+                    "type": "integer"
+                },
+                "modifierid": {
+                    "description": "修改人",
+                    "type": "string"
+                },
+                "modifiersrc": {
+                    "description": "修改人来源 - 1:管理端 2:终端",
+                    "type": "integer"
+                },
+                "modifytime": {
+                    "description": "修改时间",
+                    "type": "string"
+                },
+                "parentsubjectid": {
+                    "description": "上级主体ID",
+                    "type": "string"
+                },
+                "remark": {
+                    "description": "备注",
+                    "type": "string"
+                },
+                "subjectid": {
+                    "description": "主体ID(SEQ_ERMCP_PA_AREASUBJECT)",
+                    "type": "integer"
+                },
+                "subjectname": {
+                    "description": "主体名称",
+                    "type": "string"
+                },
+                "subjectstatus": {
+                    "description": "主体状态 - 1:正常 2: 停用",
+                    "type": "integer"
+                },
+                "subjecttype": {
+                    "description": "主体类型 - 1:交易主体 2:业务部门",
+                    "type": "integer"
+                }
+            }
+        },
         "models.Ermcp3RootUserAccount": {
             "type": "object",
             "properties": {

+ 154 - 0
docs/swagger.yaml

@@ -4864,6 +4864,96 @@ definitions:
         description: 套保商品信息
         type: object
     type: object
+  models.Ermcp3PaAreaAuditCfg:
+    properties:
+      areauserid:
+        description: 用户ID
+        type: integer
+      buyinauditflag:
+        description: 采购入库是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      customerauditflag:
+        description: 客户资料是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      deliveryauditflag:
+        description: 交收是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      invoiceauditflag:
+        description: 发票是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      moneyauditflag:
+        description: 款项是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      operatorid:
+        description: 操作人
+        type: integer
+      operatorsrc:
+        description: 操作来源 - 1:管理端 2:终端
+        type: integer
+      pointpriceauditflag:
+        description: 点价是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      produceinauditflag:
+        description: 生产入库是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      produceoutauditflag:
+        description: 生产出库是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      selloutauditflag:
+        description: 销售出库是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      spotcontractauditflag:
+        description: 现货合同是否需要审核 - 0:不需审核 1:需要审核
+        type: integer
+      updatetime:
+        description: 更新时间
+        type: string
+    type: object
+  models.Ermcp3PaAreaSubject:
+    properties:
+      areauserid:
+        description: 所属机构
+        type: integer
+      canmodify:
+        description: 是否可修改 - 0:否 1:是
+        type: integer
+      createtime:
+        description: 创建时间
+        type: string
+      creatorid:
+        description: 创建人ID
+        type: string
+      creatorsrc:
+        description: 创建人来源 - 1:管理端 2:终端 3:交易
+        type: integer
+      modifierid:
+        description: 修改人
+        type: string
+      modifiersrc:
+        description: 修改人来源 - 1:管理端 2:终端
+        type: integer
+      modifytime:
+        description: 修改时间
+        type: string
+      parentsubjectid:
+        description: 上级主体ID
+        type: string
+      remark:
+        description: 备注
+        type: string
+      subjectid:
+        description: 主体ID(SEQ_ERMCP_PA_AREASUBJECT)
+        type: integer
+      subjectname:
+        description: 主体名称
+        type: string
+      subjectstatus:
+        description: '主体状态 - 1:正常 2: 停用'
+        type: integer
+      subjecttype:
+        description: 主体类型 - 1:交易主体 2:业务部门
+        type: integer
+    type: object
   models.Ermcp3RootUserAccount:
     properties:
       accountname:
@@ -20426,6 +20516,70 @@ paths:
       summary: 查询套保品种详情(套保品种/商品详情)
       tags:
       - 企业风险管理v3(app)
+  /Ermcp3/QueryPaAreaAuditCfg:
+    get:
+      parameters:
+      - description: 用户id
+        in: query
+        name: userid
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Ermcp3PaAreaAuditCfg'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询审核设置
+      tags:
+      - 企业风险管理v3(app)
+  /Ermcp3/QueryPaAreaSubject:
+    get:
+      parameters:
+      - description: 用户id
+        in: query
+        name: userid
+        required: true
+        type: integer
+      - description: 主体ID(SEQ_ERMCP_PA_AREASUBJECT)
+        in: query
+        name: subjectid
+        type: integer
+      - description: 主体类型 - 1:交易主体 2:业务部门
+        in: query
+        name: subjecttype
+        type: integer
+      - description: '主体状态 - 1:正常 2: 停用'
+        in: query
+        name: subjectstatus
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: OK
+          schema:
+            items:
+              $ref: '#/definitions/models.Ermcp3PaAreaSubject'
+            type: array
+        "500":
+          description: Internal Server Error
+          schema:
+            $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
+      summary: 查询交易主体
+      tags:
+      - 企业风险管理v3(app)
   /Ermcp3/QueryRootUserAccount:
     get:
       parameters:

+ 115 - 0
models/ermcp3.go

@@ -2212,3 +2212,118 @@ func (r *Ermcp3RootUserAccount) GetDataEx() (interface{}, error) {
 	}
 	return sData, err
 }
+
+// Ermcp3PaAreaSubject 交易主体
+type Ermcp3PaAreaSubject struct {
+	SUBJECTID       int64  `json:"subjectid"  xorm:"SUBJECTID" form:"subjectid"`                   // 主体ID(SEQ_ERMCP_PA_AREASUBJECT)
+	SUBJECTTYPE     int32  `json:"subjecttype"  xorm:"SUBJECTTYPE"`                                // 主体类型 - 1:交易主体 2:业务部门
+	SUBJECTNAME     string `json:"subjectname"  xorm:"SUBJECTNAME"`                                // 主体名称
+	PARENTSUBJECTID string `json:"parentsubjectid"  xorm:"PARENTSUBJECTID" form:"parentsubjectid"` // 上级主体ID
+	AREAUSERID      int64  `json:"areauserid"  xorm:"AREAUSERID" form:"userid"`                    // 所属机构
+	CREATETIME      string `json:"createtime"  xorm:"CREATETIME"`                                  // 创建时间
+	CREATORSRC      int32  `json:"creatorsrc"  xorm:"CREATORSRC"`                                  // 创建人来源 - 1:管理端 2:终端 3:交易
+	CREATORID       string `json:"creatorid"  xorm:"CREATORID" form:"creatorid"`                   // 创建人ID
+	MODIFIERSRC     int32  `json:"modifiersrc"  xorm:"MODIFIERSRC"`                                // 修改人来源 - 1:管理端 2:终端
+	MODIFIERID      string `json:"modifierid"  xorm:"MODIFIERID" form:"modifierid"`                // 修改人
+	MODIFYTIME      string `json:"modifytime"  xorm:"MODIFYTIME"`                                  // 修改时间
+	SUBJECTSTATUS   int32  `json:"subjectstatus"  xorm:"SUBJECTSTATUS"`                            // 主体状态 - 1:正常 2: 停用
+	CANMODIFY       int32  `json:"canmodify"  xorm:"CANMODIFY"`                                    // 是否可修改 - 0:否 1:是
+	REMARK          string `json:"remark"  xorm:"REMARK"`                                          // 备注
+}
+
+func (r *Ermcp3PaAreaSubject) calc() {
+
+}
+
+func (r *Ermcp3PaAreaSubject) buildSql() string {
+	var sqlId utils.SQLVal = `
+SELECT t.SUBJECTID,
+       t.SUBJECTTYPE,
+       t.SUBJECTNAME,
+       t.PARENTSUBJECTID,
+       t.AREAUSERID,
+       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME,
+       t.CREATORSRC,
+       t.CREATORID,
+       t.MODIFIERSRC,
+       t.MODIFIERID,
+       to_char(t.MODIFYTIME, 'yyyy-mm-dd hh24:mi:ss') MODIFYTIME,
+       t.SUBJECTSTATUS,
+       t.CANMODIFY,
+       t.REMARK
+  FROM ERMCP_PA_AREASUBJECT t
+ WHERE 1 = 1
+`
+	areaUserId := mtpcache.GetAreaUserId(r.AREAUSERID, 0)
+	sqlId.And("t.AREAUSERID", areaUserId)
+	sqlId.AndEx("t.SUBJECTID", r.SUBJECTID, r.SUBJECTID > 0)
+	sqlId.AndEx("t.SUBJECTTYPE", r.SUBJECTTYPE, r.SUBJECTTYPE > 0)
+	sqlId.AndEx("t.SUBJECTSTATUS", r.SUBJECTSTATUS, r.SUBJECTSTATUS > 0)
+	return sqlId.String()
+}
+
+// GetDataEx 获取交易主体
+func (r *Ermcp3PaAreaSubject) GetDataEx() (interface{}, error) {
+	sData := make([]Ermcp3PaAreaSubject, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}
+
+// Ermcp3PaAreaAuditCfg 审核设置
+type Ermcp3PaAreaAuditCfg struct {
+	AREAUSERID            int64  `json:"areauserid"  xorm:"AREAUSERID" form:"serid"`          // 用户ID
+	CUSTOMERAUDITFLAG     int32  `json:"customerauditflag"  xorm:"CUSTOMERAUDITFLAG"`         // 客户资料是否需要审核 - 0:不需审核 1:需要审核
+	SPOTCONTRACTAUDITFLAG int32  `json:"spotcontractauditflag"  xorm:"SPOTCONTRACTAUDITFLAG"` // 现货合同是否需要审核 - 0:不需审核 1:需要审核
+	POINTPRICEAUDITFLAG   int32  `json:"pointpriceauditflag"  xorm:"POINTPRICEAUDITFLAG"`     // 点价是否需要审核 - 0:不需审核 1:需要审核
+	DELIVERYAUDITFLAG     int32  `json:"deliveryauditflag"  xorm:"DELIVERYAUDITFLAG"`         // 交收是否需要审核 - 0:不需审核 1:需要审核
+	MONEYAUDITFLAG        int32  `json:"moneyauditflag"  xorm:"MONEYAUDITFLAG"`               // 款项是否需要审核 - 0:不需审核 1:需要审核
+	INVOICEAUDITFLAG      int32  `json:"invoiceauditflag"  xorm:"INVOICEAUDITFLAG"`           // 发票是否需要审核 - 0:不需审核 1:需要审核
+	BUYINAUDITFLAG        int32  `json:"buyinauditflag"  xorm:"BUYINAUDITFLAG"`               // 采购入库是否需要审核 - 0:不需审核 1:需要审核
+	SELLOUTAUDITFLAG      int32  `json:"selloutauditflag"  xorm:"SELLOUTAUDITFLAG"`           // 销售出库是否需要审核 - 0:不需审核 1:需要审核
+	PRODUCEINAUDITFLAG    int32  `json:"produceinauditflag"  xorm:"PRODUCEINAUDITFLAG"`       // 生产入库是否需要审核 - 0:不需审核 1:需要审核
+	PRODUCEOUTAUDITFLAG   int32  `json:"produceoutauditflag"  xorm:"PRODUCEOUTAUDITFLAG"`     // 生产出库是否需要审核 - 0:不需审核 1:需要审核
+	OPERATORSRC           int32  `json:"operatorsrc"  xorm:"OPERATORSRC"`                     // 操作来源 - 1:管理端 2:终端
+	OPERATORID            int64  `json:"operatorid"  xorm:"OPERATORID" form:"operatorid"`     // 操作人
+	UPDATETIME            string `json:"updatetime"  xorm:"UPDATETIME"`                       // 更新时间
+}
+
+func (r *Ermcp3PaAreaAuditCfg) calc() {
+
+}
+
+func (r *Ermcp3PaAreaAuditCfg) buildSql() string {
+	var sqlId utils.SQLVal = `
+SELECT t.AREAUSERID,
+       t.CUSTOMERAUDITFLAG,
+       t.SPOTCONTRACTAUDITFLAG,
+       t.POINTPRICEAUDITFLAG,
+       t.DELIVERYAUDITFLAG,
+       t.MONEYAUDITFLAG,
+       t.INVOICEAUDITFLAG,
+       t.BUYINAUDITFLAG,
+       t.SELLOUTAUDITFLAG,
+       t.PRODUCEINAUDITFLAG,
+       t.PRODUCEOUTAUDITFLAG,
+       t.OPERATORSRC,
+       t.OPERATORID,
+       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME
+  FROM ERMCP_PA_AREAAUDITCONFIG t
+ WHERE 1 = 1
+`
+	areaUserId := mtpcache.GetAreaUserId(r.AREAUSERID, 0)
+	sqlId.And("t.AREAUSERID", areaUserId)
+	return sqlId.String()
+}
+
+// GetDataEx 获取审核设置
+func (r *Ermcp3PaAreaAuditCfg) GetDataEx() (interface{}, error) {
+	sData := make([]Ermcp3PaAreaAuditCfg, 0)
+	err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
+	for i := range sData {
+		sData[i].calc()
+	}
+	return sData, err
+}

+ 2 - 0
routers/router.go

@@ -434,6 +434,8 @@ func InitRouter() *gin.Engine {
 		ermcp3R.GET("/QueryGoodsGroup", ermcp3.QueryGoodsGroup)
 		ermcp3R.GET("/QueryMiddleGoodsDetail", ermcp3.QueryMiddleGoodsDetail)
 		ermcp3R.GET("/QueryRootUserAccount", ermcp3.QueryRootUserAccount)
+		ermcp3R.GET("/QueryPaAreaSubject", ermcp3.QueryPaAreaSubject)
+		ermcp3R.GET("/QueryPaAreaAuditCfg", ermcp3.QueryPaAreaAuditCfg)
 
 		// 报表
 		ermcp3R.GET("/QryReportDaySpotDetail", ermcp3.QryReportDaySpotDetail)