zhangqian
2023-08-05 1d8f07d32634854a07379479a760ba387a53314c
收款单管理及账户,支付方式
4个文件已修改
18个文件已添加
3123 ■■■■■ 已修改文件
api/v1/bankAccount.go 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/paymentType.go 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/receipt.go 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constvar/bankAccount.go 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constvar/paymentType.go 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
constvar/receipt.go 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 757 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 757 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 490 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/bankAccount.go 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/paymentType.go 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/receipt.go 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/bankAccount.go 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/paymentType.go 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/receipt.go 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/bankAccount.go 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/index.go 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/paymentType.go 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/receipt.go 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/bankAccount.go 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/paymentType.go 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/receipt.go 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/bankAccount.go
New file
@@ -0,0 +1,112 @@
package v1
import (
    "aps_crm/model/request"
    "aps_crm/model/response"
    "aps_crm/pkg/contextx"
    "aps_crm/pkg/ecode"
    "aps_crm/service"
    "github.com/gin-gonic/gin"
    "strconv"
)
type BankAccountApi struct{}
// Add
// @Tags        银行账户管理
// @Summary    添加银行账户
// @Produce    application/json
// @Param        object    body        request.AddBankAccount    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
// @Router        /api/bankAccount/add [post]
func (s *BankAccountApi) Add(c *gin.Context) {
    var params request.AddBankAccount
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode := service.NewBankAccountService().AddBankAccount(&params.BankAccount)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Delete
// @Tags        银行账户管理
// @Summary    删除银行账户
// @Produce    application/json
// @Param        id    path        int    true    "查询参数"
// @Success    200    {object}    contextx.Response{}
// @Router        /api/bankAccount/delete/{id} [delete]
func (s *BankAccountApi) Delete(c *gin.Context) {
    ctx, ok := contextx.NewContext(c, nil)
    if !ok {
        return
    }
    id, _ := strconv.Atoi(c.Param("id"))
    errCode := service.NewBankAccountService().DeleteBankAccount(id)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Update
// @Tags        银行账户管理
// @Summary    更新银行账户
// @Produce    application/json
// @Param        object    body        request.UpdateBankAccount    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
// @Router        /api/bankAccount/update [put]
func (s *BankAccountApi) Update(c *gin.Context) {
    var params request.UpdateBankAccount
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.BankAccount.Id = params.Id
    errCode := service.NewBankAccountService().UpdateBankAccount(&params.BankAccount)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// List
// @Tags        银行账户管理
// @Summary    获取银行账户列表
// @Produce    application/json
// @Param        object    query        request.GetBankAccountList    true    "参数"
// @Success    200    {object}    response.ListResponse{data=[]model.BankAccount}
// @Router        /api/bankAccount/list [get]
func (s *BankAccountApi) List(c *gin.Context) {
    var params request.GetBankAccountList
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    bankAccount, total, errCode := service.NewBankAccountService().GetBankAccountList()
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.OkWithDetailed(response.ListResponse{
        Data: bankAccount,
        Count: total,
    })
}
api/v1/paymentType.go
New file
@@ -0,0 +1,112 @@
package v1
import (
    "aps_crm/model/request"
    "aps_crm/model/response"
    "aps_crm/pkg/contextx"
    "aps_crm/pkg/ecode"
    "aps_crm/service"
    "github.com/gin-gonic/gin"
    "strconv"
)
type PaymentTypeApi struct{}
// Add
// @Tags        支付方式管理
// @Summary    添加支付方式
// @Produce    application/json
// @Param        object    body        request.AddPaymentType    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
// @Router        /api/paymentType/add [post]
func (s *PaymentTypeApi) Add(c *gin.Context) {
    var params request.AddPaymentType
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode := service.NewPaymentTypeService().AddPaymentType(&params.PaymentType)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Delete
// @Tags        支付方式管理
// @Summary    删除支付方式
// @Produce    application/json
// @Param        id    path        int    true    "查询参数"
// @Success    200    {object}    contextx.Response{}
// @Router        /api/paymentType/delete/{id} [delete]
func (s *PaymentTypeApi) Delete(c *gin.Context) {
    ctx, ok := contextx.NewContext(c, nil)
    if !ok {
        return
    }
    id, _ := strconv.Atoi(c.Param("id"))
    errCode := service.NewPaymentTypeService().DeletePaymentType(id)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Update
// @Tags        支付方式管理
// @Summary    更新支付方式
// @Produce    application/json
// @Param        object    body        request.UpdatePaymentType    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
// @Router        /api/paymentType/update [put]
func (s *PaymentTypeApi) Update(c *gin.Context) {
    var params request.UpdatePaymentType
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.PaymentType.Id = params.Id
    errCode := service.NewPaymentTypeService().UpdatePaymentType(&params.PaymentType)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// List
// @Tags        支付方式管理
// @Summary    获取支付方式列表
// @Produce    application/json
// @Param        object    query        request.GetPaymentTypeList    true    "参数"
// @Success    200    {object}    response.ListResponse{data=[]model.PaymentType}
// @Router        /api/paymentType/list [get]
func (s *PaymentTypeApi) List(c *gin.Context) {
    var params request.GetPaymentTypeList
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    paymentType, total, errCode := service.NewPaymentTypeService().GetPaymentTypeList()
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.OkWithDetailed(response.ListResponse{
        Data: paymentType,
        Count: total,
    })
}
api/v1/receipt.go
New file
@@ -0,0 +1,112 @@
package v1
import (
    "aps_crm/model/request"
    "aps_crm/model/response"
    "aps_crm/pkg/contextx"
    "aps_crm/pkg/ecode"
    "aps_crm/service"
    "github.com/gin-gonic/gin"
    "strconv"
)
type ReceiptApi struct{}
// Add
// @Tags        收款单管理
// @Summary    添加收款单
// @Produce    application/json
// @Param        object    body        request.AddReceipt    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
// @Router        /api/receipt/add [post]
func (s *ReceiptApi) Add(c *gin.Context) {
    var params request.AddReceipt
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    errCode := service.NewReceiptService().AddReceipt(&params.Receipt)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Delete
// @Tags        收款单管理
// @Summary    删除收款单
// @Produce    application/json
// @Param        id    path        int    true    "查询参数"
// @Success    200    {object}    contextx.Response{}
// @Router        /api/receipt/delete/{id} [delete]
func (s *ReceiptApi) Delete(c *gin.Context) {
    ctx, ok := contextx.NewContext(c, nil)
    if !ok {
        return
    }
    id, _ := strconv.Atoi(c.Param("id"))
    errCode := service.NewReceiptService().DeleteReceipt(id)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// Update
// @Tags        收款单管理
// @Summary    更新收款单
// @Produce    application/json
// @Param        object    body        request.UpdateReceipt    true    "查询参数"
// @Success    200        {object}    contextx.Response{}
// @Router        /api/receipt/update [put]
func (s *ReceiptApi) Update(c *gin.Context) {
    var params request.UpdateReceipt
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    if params.Id == 0 {
        ctx.Fail(ecode.ParamsErr)
    }
    params.Receipt.Id = params.Id
    errCode := service.NewReceiptService().UpdateReceipt(&params.Receipt)
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.Ok()
}
// List
// @Tags        收款单管理
// @Summary    获取收款单列表
// @Produce    application/json
// @Param        object    query        request.GetReceiptList    true    "参数"
// @Success    200    {object}    response.ListResponse{data=[]model.Receipt}
// @Router        /api/receipt/list [get]
func (s *ReceiptApi) List(c *gin.Context) {
    var params request.GetReceiptList
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    receipt, total, errCode := service.NewReceiptService().GetReceiptList()
    if errCode != ecode.OK {
        ctx.Fail(errCode)
        return
    }
    ctx.OkWithDetailed(response.ListResponse{
        Data: receipt,
        Count: total,
    })
}
constvar/bankAccount.go
New file
@@ -0,0 +1,12 @@
package constvar
type BankAccountQueryClass string
const (
    BankAccountQueryClassExpireLessThen60Days BankAccountQueryClass = ""
)
type BankAccountKeywordType string
const (
    BankAccountKeywordCustomerName   BankAccountKeywordType = ""
)
constvar/paymentType.go
New file
@@ -0,0 +1,12 @@
package constvar
type PaymentTypeQueryClass string
const (
    PaymentTypeQueryClassExpireLessThen60Days PaymentTypeQueryClass = ""
)
type PaymentTypeKeywordType string
const (
    PaymentTypeKeywordCustomerName   PaymentTypeKeywordType = ""
)
constvar/receipt.go
New file
@@ -0,0 +1,12 @@
package constvar
type ReceiptQueryClass string
const (
    ReceiptQueryClassExpireLessThen60Days ReceiptQueryClass = ""
)
type ReceiptKeywordType string
const (
    ReceiptKeywordCustomerName   ReceiptKeywordType = ""
)
docs/docs.go
@@ -241,6 +241,169 @@
                }
            }
        },
        "/api/bankAccount/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "添加银行账户",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddBankAccount"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/bankAccount/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "删除银行账户",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/bankAccount/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "获取银行账户列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "BankAccountKeywordCustomerName"
                        ],
                        "name": "keywordType",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "BankAccountQueryClassExpireLessThen60Days"
                        ],
                        "name": "queryClass",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.ListResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.BankAccount"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/bankAccount/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "更新银行账户",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateBankAccount"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/base/captcha": {
            "post": {
                "produces": [
@@ -3271,6 +3434,169 @@
                }
            }
        },
        "/api/paymentType/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "添加支付方式",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddPaymentType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/paymentType/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "删除支付方式",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/paymentType/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "获取支付方式列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "PaymentTypeKeywordCustomerName"
                        ],
                        "name": "keywordType",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "PaymentTypeQueryClassExpireLessThen60Days"
                        ],
                        "name": "queryClass",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.ListResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.PaymentType"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/paymentType/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "更新支付方式",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdatePaymentType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/plan/add": {
            "post": {
                "produces": [
@@ -4036,6 +4362,169 @@
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateQuotationStatuss"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/receipt/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "添加收款单",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddReceipt"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/receipt/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "删除收款单",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/receipt/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "获取收款单列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "ReceiptKeywordCustomerName"
                        ],
                        "name": "keywordType",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "ReceiptQueryClassExpireLessThen60Days"
                        ],
                        "name": "queryClass",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.ListResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.Receipt"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/receipt/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "更新收款单",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateReceipt"
                        }
                    }
                ],
@@ -8071,6 +8560,24 @@
        }
    },
    "definitions": {
        "constvar.BankAccountKeywordType": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "BankAccountKeywordCustomerName"
            ]
        },
        "constvar.BankAccountQueryClass": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "BankAccountQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.FaqKeywordType": {
            "type": "string",
            "enum": [
@@ -8087,6 +8594,42 @@
            ],
            "x-enum-varnames": [
                "FaqQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.PaymentTypeKeywordType": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "PaymentTypeKeywordCustomerName"
            ]
        },
        "constvar.PaymentTypeQueryClass": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "PaymentTypeQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.ReceiptKeywordType": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "ReceiptKeywordCustomerName"
            ]
        },
        "constvar.ReceiptQueryClass": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "ReceiptQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.SalesStatus": {
@@ -8281,6 +8824,17 @@
                    "items": {
                        "$ref": "#/definitions/model.Menu"
                    }
                }
            }
        },
        "model.BankAccount": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
@@ -8941,6 +9495,17 @@
                }
            }
        },
        "model.PaymentType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.Plan": {
            "type": "object",
            "properties": {
@@ -9099,6 +9664,54 @@
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.Receipt": {
            "type": "object",
            "properties": {
                "bankAccountId": {
                    "description": "账户id",
                    "type": "integer"
                },
                "clientId": {
                    "description": "客户id",
                    "type": "integer"
                },
                "fileId": {
                    "description": "附件id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "moneyType": {
                    "description": "币种",
                    "type": "string"
                },
                "paymentTypeId": {
                    "description": "收款方式ID",
                    "type": "integer"
                },
                "principalId": {
                    "description": "负责人id",
                    "type": "integer"
                },
                "receiptDate": {
                    "description": "收款日期",
                    "type": "string"
                },
                "remark": {
                    "description": "备注",
                    "type": "string"
                },
                "sourceId": {
                    "description": "源单id",
                    "type": "integer"
                },
                "sourceType": {
                    "description": "来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)",
                    "type": "integer"
                }
            }
        },
@@ -9584,7 +10197,7 @@
                    "description": "比例",
                    "type": "number"
                },
                "principal": {
                "principalId": {
                    "description": "收款负责人ID",
                    "type": "integer"
                },
@@ -10082,6 +10695,17 @@
                }
            }
        },
        "request.AddBankAccount": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.AddCity": {
            "type": "object",
            "properties": {
@@ -10517,6 +11141,17 @@
                }
            }
        },
        "request.AddPaymentType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.AddPlan": {
            "type": "object",
            "properties": {
@@ -10596,6 +11231,54 @@
            "properties": {
                "name": {
                    "type": "string"
                }
            }
        },
        "request.AddReceipt": {
            "type": "object",
            "properties": {
                "bankAccountId": {
                    "description": "账户id",
                    "type": "integer"
                },
                "clientId": {
                    "description": "客户id",
                    "type": "integer"
                },
                "fileId": {
                    "description": "附件id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "moneyType": {
                    "description": "币种",
                    "type": "string"
                },
                "paymentTypeId": {
                    "description": "收款方式ID",
                    "type": "integer"
                },
                "principalId": {
                    "description": "负责人id",
                    "type": "integer"
                },
                "receiptDate": {
                    "description": "收款日期",
                    "type": "string"
                },
                "remark": {
                    "description": "备注",
                    "type": "string"
                },
                "sourceId": {
                    "description": "源单id",
                    "type": "integer"
                },
                "sourceType": {
                    "description": "来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)",
                    "type": "integer"
                }
            }
        },
@@ -12208,6 +12891,17 @@
                }
            }
        },
        "request.UpdateBankAccount": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.UpdateCities": {
            "type": "object",
            "properties": {
@@ -12899,6 +13593,17 @@
                }
            }
        },
        "request.UpdatePaymentType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.UpdatePlan": {
            "type": "object",
            "properties": {
@@ -13036,6 +13741,54 @@
                    "items": {
                        "$ref": "#/definitions/request.UpdateQuotationStatus"
                    }
                }
            }
        },
        "request.UpdateReceipt": {
            "type": "object",
            "properties": {
                "bankAccountId": {
                    "description": "账户id",
                    "type": "integer"
                },
                "clientId": {
                    "description": "客户id",
                    "type": "integer"
                },
                "fileId": {
                    "description": "附件id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "moneyType": {
                    "description": "币种",
                    "type": "string"
                },
                "paymentTypeId": {
                    "description": "收款方式ID",
                    "type": "integer"
                },
                "principalId": {
                    "description": "负责人id",
                    "type": "integer"
                },
                "receiptDate": {
                    "description": "收款日期",
                    "type": "string"
                },
                "remark": {
                    "description": "备注",
                    "type": "string"
                },
                "sourceId": {
                    "description": "源单id",
                    "type": "integer"
                },
                "sourceType": {
                    "description": "来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)",
                    "type": "integer"
                }
            }
        },
@@ -13573,7 +14326,7 @@
                    "description": "比例",
                    "type": "number"
                },
                "principal": {
                "principalId": {
                    "description": "收款负责人ID",
                    "type": "integer"
                },
docs/swagger.json
@@ -229,6 +229,169 @@
                }
            }
        },
        "/api/bankAccount/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "添加银行账户",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddBankAccount"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/bankAccount/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "删除银行账户",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/bankAccount/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "获取银行账户列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "BankAccountKeywordCustomerName"
                        ],
                        "name": "keywordType",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "BankAccountQueryClassExpireLessThen60Days"
                        ],
                        "name": "queryClass",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.ListResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.BankAccount"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/bankAccount/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "银行账户管理"
                ],
                "summary": "更新银行账户",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateBankAccount"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/base/captcha": {
            "post": {
                "produces": [
@@ -3259,6 +3422,169 @@
                }
            }
        },
        "/api/paymentType/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "添加支付方式",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddPaymentType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/paymentType/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "删除支付方式",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/paymentType/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "获取支付方式列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "PaymentTypeKeywordCustomerName"
                        ],
                        "name": "keywordType",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "PaymentTypeQueryClassExpireLessThen60Days"
                        ],
                        "name": "queryClass",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.ListResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.PaymentType"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/paymentType/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "支付方式管理"
                ],
                "summary": "更新支付方式",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdatePaymentType"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/plan/add": {
            "post": {
                "produces": [
@@ -4024,6 +4350,169 @@
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateQuotationStatuss"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/receipt/add": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "添加收款单",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.AddReceipt"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/receipt/delete/{id}": {
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "删除收款单",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "查询参数",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/receipt/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "获取收款单列表",
                "parameters": [
                    {
                        "type": "string",
                        "name": "keyword",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "ReceiptKeywordCustomerName"
                        ],
                        "name": "keywordType",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            ""
                        ],
                        "type": "string",
                        "x-enum-varnames": [
                            "ReceiptQueryClassExpireLessThen60Days"
                        ],
                        "name": "queryClass",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/response.ListResponse"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.Receipt"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/receipt/update": {
            "put": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "收款单管理"
                ],
                "summary": "更新收款单",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateReceipt"
                        }
                    }
                ],
@@ -8059,6 +8548,24 @@
        }
    },
    "definitions": {
        "constvar.BankAccountKeywordType": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "BankAccountKeywordCustomerName"
            ]
        },
        "constvar.BankAccountQueryClass": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "BankAccountQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.FaqKeywordType": {
            "type": "string",
            "enum": [
@@ -8075,6 +8582,42 @@
            ],
            "x-enum-varnames": [
                "FaqQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.PaymentTypeKeywordType": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "PaymentTypeKeywordCustomerName"
            ]
        },
        "constvar.PaymentTypeQueryClass": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "PaymentTypeQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.ReceiptKeywordType": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "ReceiptKeywordCustomerName"
            ]
        },
        "constvar.ReceiptQueryClass": {
            "type": "string",
            "enum": [
                ""
            ],
            "x-enum-varnames": [
                "ReceiptQueryClassExpireLessThen60Days"
            ]
        },
        "constvar.SalesStatus": {
@@ -8269,6 +8812,17 @@
                    "items": {
                        "$ref": "#/definitions/model.Menu"
                    }
                }
            }
        },
        "model.BankAccount": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
@@ -8929,6 +9483,17 @@
                }
            }
        },
        "model.PaymentType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.Plan": {
            "type": "object",
            "properties": {
@@ -9087,6 +9652,54 @@
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.Receipt": {
            "type": "object",
            "properties": {
                "bankAccountId": {
                    "description": "账户id",
                    "type": "integer"
                },
                "clientId": {
                    "description": "客户id",
                    "type": "integer"
                },
                "fileId": {
                    "description": "附件id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "moneyType": {
                    "description": "币种",
                    "type": "string"
                },
                "paymentTypeId": {
                    "description": "收款方式ID",
                    "type": "integer"
                },
                "principalId": {
                    "description": "负责人id",
                    "type": "integer"
                },
                "receiptDate": {
                    "description": "收款日期",
                    "type": "string"
                },
                "remark": {
                    "description": "备注",
                    "type": "string"
                },
                "sourceId": {
                    "description": "源单id",
                    "type": "integer"
                },
                "sourceType": {
                    "description": "来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)",
                    "type": "integer"
                }
            }
        },
@@ -9572,7 +10185,7 @@
                    "description": "比例",
                    "type": "number"
                },
                "principal": {
                "principalId": {
                    "description": "收款负责人ID",
                    "type": "integer"
                },
@@ -10070,6 +10683,17 @@
                }
            }
        },
        "request.AddBankAccount": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.AddCity": {
            "type": "object",
            "properties": {
@@ -10505,6 +11129,17 @@
                }
            }
        },
        "request.AddPaymentType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.AddPlan": {
            "type": "object",
            "properties": {
@@ -10584,6 +11219,54 @@
            "properties": {
                "name": {
                    "type": "string"
                }
            }
        },
        "request.AddReceipt": {
            "type": "object",
            "properties": {
                "bankAccountId": {
                    "description": "账户id",
                    "type": "integer"
                },
                "clientId": {
                    "description": "客户id",
                    "type": "integer"
                },
                "fileId": {
                    "description": "附件id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "moneyType": {
                    "description": "币种",
                    "type": "string"
                },
                "paymentTypeId": {
                    "description": "收款方式ID",
                    "type": "integer"
                },
                "principalId": {
                    "description": "负责人id",
                    "type": "integer"
                },
                "receiptDate": {
                    "description": "收款日期",
                    "type": "string"
                },
                "remark": {
                    "description": "备注",
                    "type": "string"
                },
                "sourceId": {
                    "description": "源单id",
                    "type": "integer"
                },
                "sourceType": {
                    "description": "来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)",
                    "type": "integer"
                }
            }
        },
@@ -12196,6 +12879,17 @@
                }
            }
        },
        "request.UpdateBankAccount": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.UpdateCities": {
            "type": "object",
            "properties": {
@@ -12887,6 +13581,17 @@
                }
            }
        },
        "request.UpdatePaymentType": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "request.UpdatePlan": {
            "type": "object",
            "properties": {
@@ -13024,6 +13729,54 @@
                    "items": {
                        "$ref": "#/definitions/request.UpdateQuotationStatus"
                    }
                }
            }
        },
        "request.UpdateReceipt": {
            "type": "object",
            "properties": {
                "bankAccountId": {
                    "description": "账户id",
                    "type": "integer"
                },
                "clientId": {
                    "description": "客户id",
                    "type": "integer"
                },
                "fileId": {
                    "description": "附件id",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "moneyType": {
                    "description": "币种",
                    "type": "string"
                },
                "paymentTypeId": {
                    "description": "收款方式ID",
                    "type": "integer"
                },
                "principalId": {
                    "description": "负责人id",
                    "type": "integer"
                },
                "receiptDate": {
                    "description": "收款日期",
                    "type": "string"
                },
                "remark": {
                    "description": "备注",
                    "type": "string"
                },
                "sourceId": {
                    "description": "源单id",
                    "type": "integer"
                },
                "sourceType": {
                    "description": "来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)",
                    "type": "integer"
                }
            }
        },
@@ -13561,7 +14314,7 @@
                    "description": "比例",
                    "type": "number"
                },
                "principal": {
                "principalId": {
                    "description": "收款负责人ID",
                    "type": "integer"
                },
docs/swagger.yaml
@@ -1,4 +1,16 @@
definitions:
  constvar.BankAccountKeywordType:
    enum:
    - ""
    type: string
    x-enum-varnames:
    - BankAccountKeywordCustomerName
  constvar.BankAccountQueryClass:
    enum:
    - ""
    type: string
    x-enum-varnames:
    - BankAccountQueryClassExpireLessThen60Days
  constvar.FaqKeywordType:
    enum:
    - ""
@@ -11,6 +23,30 @@
    type: string
    x-enum-varnames:
    - FaqQueryClassExpireLessThen60Days
  constvar.PaymentTypeKeywordType:
    enum:
    - ""
    type: string
    x-enum-varnames:
    - PaymentTypeKeywordCustomerName
  constvar.PaymentTypeQueryClass:
    enum:
    - ""
    type: string
    x-enum-varnames:
    - PaymentTypeQueryClassExpireLessThen60Days
  constvar.ReceiptKeywordType:
    enum:
    - ""
    type: string
    x-enum-varnames:
    - ReceiptKeywordCustomerName
  constvar.ReceiptQueryClass:
    enum:
    - ""
    type: string
    x-enum-varnames:
    - ReceiptQueryClassExpireLessThen60Days
  constvar.SalesStatus:
    enum:
    - 1
@@ -167,6 +203,13 @@
        items:
          $ref: '#/definitions/model.Menu'
        type: array
    type: object
  model.BankAccount:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  model.City:
    properties:
@@ -598,6 +641,13 @@
      name:
        type: string
    type: object
  model.PaymentType:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  model.Plan:
    properties:
      clientId:
@@ -702,6 +752,41 @@
        type: integer
      name:
        type: string
    type: object
  model.Receipt:
    properties:
      bankAccountId:
        description: 账户id
        type: integer
      clientId:
        description: 客户id
        type: integer
      fileId:
        description: 附件id
        type: integer
      id:
        type: integer
      moneyType:
        description: 币种
        type: string
      paymentTypeId:
        description: 收款方式ID
        type: integer
      principalId:
        description: 负责人id
        type: integer
      receiptDate:
        description: 收款日期
        type: string
      remark:
        description: 备注
        type: string
      sourceId:
        description: 源单id
        type: integer
      sourceType:
        description: 来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)
        type: integer
    type: object
  model.RefundMethod:
    properties:
@@ -1021,7 +1106,7 @@
      percent:
        description: 比例
        type: number
      principal:
      principalId:
        description: 收款负责人ID
        type: integer
      remark:
@@ -1358,6 +1443,13 @@
          $ref: '#/definitions/request.CasbinInfo'
        type: array
    type: object
  request.AddBankAccount:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  request.AddCity:
    properties:
      name:
@@ -1653,6 +1745,13 @@
    required:
    - name
    type: object
  request.AddPaymentType:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  request.AddPlan:
    properties:
      plan:
@@ -1705,6 +1804,41 @@
        type: string
    required:
    - name
    type: object
  request.AddReceipt:
    properties:
      bankAccountId:
        description: 账户id
        type: integer
      clientId:
        description: 客户id
        type: integer
      fileId:
        description: 附件id
        type: integer
      id:
        type: integer
      moneyType:
        description: 币种
        type: string
      paymentTypeId:
        description: 收款方式ID
        type: integer
      principalId:
        description: 负责人id
        type: integer
      receiptDate:
        description: 收款日期
        type: string
      remark:
        description: 备注
        type: string
      sourceId:
        description: 源单id
        type: integer
      sourceType:
        description: 来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)
        type: integer
    type: object
  request.AddRefundMethod:
    properties:
@@ -2801,6 +2935,13 @@
    required:
    - account_id
    type: object
  request.UpdateBankAccount:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  request.UpdateCities:
    properties:
      cities:
@@ -3267,6 +3408,13 @@
    required:
    - order_type
    type: object
  request.UpdatePaymentType:
    properties:
      id:
        type: integer
      name:
        type: string
    type: object
  request.UpdatePlan:
    properties:
      id:
@@ -3358,6 +3506,41 @@
        type: array
    required:
    - quotation_status
    type: object
  request.UpdateReceipt:
    properties:
      bankAccountId:
        description: 账户id
        type: integer
      clientId:
        description: 客户id
        type: integer
      fileId:
        description: 附件id
        type: integer
      id:
        type: integer
      moneyType:
        description: 币种
        type: string
      paymentTypeId:
        description: 收款方式ID
        type: integer
      principalId:
        description: 负责人id
        type: integer
      receiptDate:
        description: 收款日期
        type: string
      remark:
        description: 备注
        type: string
      sourceId:
        description: 源单id
        type: integer
      sourceType:
        description: 来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)
        type: integer
    type: object
  request.UpdateRefundMethod:
    properties:
@@ -3715,7 +3898,7 @@
      percent:
        description: 比例
        type: number
      principal:
      principalId:
        description: 收款负责人ID
        type: integer
      remark:
@@ -4838,6 +5021,107 @@
      summary: 设置角色菜单
      tags:
      - Authority
  /api/bankAccount/add:
    post:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.AddBankAccount'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 添加银行账户
      tags:
      - 银行账户管理
  /api/bankAccount/delete/{id}:
    delete:
      parameters:
      - description: 查询参数
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 删除银行账户
      tags:
      - 银行账户管理
  /api/bankAccount/list:
    get:
      parameters:
      - in: query
        name: keyword
        type: string
      - enum:
        - ""
        in: query
        name: keywordType
        type: string
        x-enum-varnames:
        - BankAccountKeywordCustomerName
      - description: 页码
        in: query
        name: page
        type: integer
      - description: 每页大小
        in: query
        name: pageSize
        type: integer
      - enum:
        - ""
        in: query
        name: queryClass
        type: string
        x-enum-varnames:
        - BankAccountQueryClassExpireLessThen60Days
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            allOf:
            - $ref: '#/definitions/response.ListResponse'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/model.BankAccount'
                  type: array
              type: object
      summary: 获取银行账户列表
      tags:
      - 银行账户管理
  /api/bankAccount/update:
    put:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateBankAccount'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 更新银行账户
      tags:
      - 银行账户管理
  /api/base/captcha:
    post:
      produces:
@@ -6691,6 +6975,107 @@
      summary: 更新工单类型
      tags:
      - OrderType
  /api/paymentType/add:
    post:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.AddPaymentType'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 添加支付方式
      tags:
      - 支付方式管理
  /api/paymentType/delete/{id}:
    delete:
      parameters:
      - description: 查询参数
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 删除支付方式
      tags:
      - 支付方式管理
  /api/paymentType/list:
    get:
      parameters:
      - in: query
        name: keyword
        type: string
      - enum:
        - ""
        in: query
        name: keywordType
        type: string
        x-enum-varnames:
        - PaymentTypeKeywordCustomerName
      - description: 页码
        in: query
        name: page
        type: integer
      - description: 每页大小
        in: query
        name: pageSize
        type: integer
      - enum:
        - ""
        in: query
        name: queryClass
        type: string
        x-enum-varnames:
        - PaymentTypeQueryClassExpireLessThen60Days
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            allOf:
            - $ref: '#/definitions/response.ListResponse'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/model.PaymentType'
                  type: array
              type: object
      summary: 获取支付方式列表
      tags:
      - 支付方式管理
  /api/paymentType/update:
    put:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdatePaymentType'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 更新支付方式
      tags:
      - 支付方式管理
  /api/plan/add:
    post:
      parameters:
@@ -7170,6 +7555,107 @@
      summary: 更新报价单状态
      tags:
      - QuotationStatus
  /api/receipt/add:
    post:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.AddReceipt'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 添加收款单
      tags:
      - 收款单管理
  /api/receipt/delete/{id}:
    delete:
      parameters:
      - description: 查询参数
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 删除收款单
      tags:
      - 收款单管理
  /api/receipt/list:
    get:
      parameters:
      - in: query
        name: keyword
        type: string
      - enum:
        - ""
        in: query
        name: keywordType
        type: string
        x-enum-varnames:
        - ReceiptKeywordCustomerName
      - description: 页码
        in: query
        name: page
        type: integer
      - description: 每页大小
        in: query
        name: pageSize
        type: integer
      - enum:
        - ""
        in: query
        name: queryClass
        type: string
        x-enum-varnames:
        - ReceiptQueryClassExpireLessThen60Days
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            allOf:
            - $ref: '#/definitions/response.ListResponse'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/model.Receipt'
                  type: array
              type: object
      summary: 获取收款单列表
      tags:
      - 收款单管理
  /api/receipt/update:
    put:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateReceipt'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 更新收款单
      tags:
      - 收款单管理
  /api/refundMethod/add:
    post:
      parameters:
model/bankAccount.go
New file
@@ -0,0 +1,140 @@
package model
import (
    "aps_crm/constvar"
    "aps_crm/pkg/mysqlx"
    "errors"
    "fmt"
    "gorm.io/gorm"
)
type (
    // BankAccount 银行账户
    BankAccount struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name   string    `json:"name" gorm:"column:name"`
    }
    // BankAccountSearch 银行账户搜索条件
    BankAccountSearch struct {
        BankAccount
        Orm *gorm.DB
        QueryClass  constvar.BankAccountQueryClass
        KeywordType constvar.BankAccountKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
func (BankAccount) TableName() string {
    return "bank_account"
}
func NewBankAccountSearch() *BankAccountSearch {
    return &BankAccountSearch{
        Orm: mysqlx.GetDB(),
    }
}
func (slf *BankAccountSearch) build() *gorm.DB {
    var db = slf.Orm.Model(&BankAccount{})
    if slf.Id != 0 {
        db = db.Where("id = ?", slf.Id)
    }
    return db
}
func (slf *BankAccountSearch) Create(record *BankAccount) error {
    var db = slf.build()
    return db.Create(record).Error
}
func (slf *BankAccountSearch) CreateBatch(records []*BankAccount) error {
    var db = slf.build()
    return db.Create(records).Error
}
func (slf *BankAccountSearch) Delete() error {
    var db = slf.build()
    return db.Delete(&BankAccount{}).Error
}
func (slf *BankAccountSearch) Update(record *BankAccount) error {
    var db = slf.build()
    return db.Updates(record).Error
}
func (slf *BankAccountSearch) FindAll() ([]*BankAccount, error) {
    var db = slf.build()
    var record = make([]*BankAccount, 0)
    err := db.Find(&record).Error
    return record, err
}
func (slf *BankAccountSearch) SetId(id int) *BankAccountSearch {
    slf.Id = id
    return slf
}
func (slf *BankAccountSearch) SetOrm(tx *gorm.DB) *BankAccountSearch {
    slf.Orm = tx
    return slf
}
func (slf *BankAccountSearch) First() (*BankAccount, error) {
    var db = slf.build()
    var record = new(BankAccount)
    err := db.First(record).Error
    return record, err
}
func (slf *BankAccountSearch) Updates(values interface{}) error {
    var db = slf.build()
    return db.Updates(values).Error
}
func (slf *BankAccountSearch) Save(record *BankAccount) error {
    if record.Id == 0 {
        return errors.New("id为空")
    }
    var db = slf.build()
    if err := db.Save(record).Error; err != nil {
        return fmt.Errorf("save err: %v, record: %+v", err, record)
    }
    return nil
}
func (slf *BankAccountSearch) Find() ([]*BankAccount, int64, error) {
    var db = slf.build()
    var records = make([]*BankAccount, 0)
    var total int64
    if err := db.Count(&total).Error; err != nil {
        return records, total, err
    }
    if slf.PageNum > 0 && slf.PageSize > 0 {
        db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
    }
    err := db.Find(&records).Error
    return records, total, err
}
// InitDefaultData 初始化数据
func (slf *BankAccountSearch) InitDefaultData() error {
    var (
        db          = slf.Orm.Table(slf.TableName())
        total int64 = 0
    )
    if err := db.Count(&total).Error; err != nil {
        return err
    }
    if total != 0 {
        return nil
    }
    records := []*BankAccount{}
    return slf.CreateBatch(records)
}
model/paymentType.go
New file
@@ -0,0 +1,140 @@
package model
import (
    "aps_crm/constvar"
    "aps_crm/pkg/mysqlx"
    "errors"
    "fmt"
    "gorm.io/gorm"
)
type (
    // PaymentType 支付方式
    PaymentType struct {
        Id   int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        Name   string    `json:"name" gorm:"column:name"`
    }
    // PaymentTypeSearch 支付方式搜索条件
    PaymentTypeSearch struct {
        PaymentType
        Orm *gorm.DB
        QueryClass  constvar.PaymentTypeQueryClass
        KeywordType constvar.PaymentTypeKeywordType
        Keyword     string
        PageNum  int
        PageSize int
    }
)
func (PaymentType) TableName() string {
    return "payment_type"
}
func NewPaymentTypeSearch() *PaymentTypeSearch {
    return &PaymentTypeSearch{
        Orm: mysqlx.GetDB(),
    }
}
func (slf *PaymentTypeSearch) build() *gorm.DB {
    var db = slf.Orm.Model(&PaymentType{})
    if slf.Id != 0 {
        db = db.Where("id = ?", slf.Id)
    }
    return db
}
func (slf *PaymentTypeSearch) Create(record *PaymentType) error {
    var db = slf.build()
    return db.Create(record).Error
}
func (slf *PaymentTypeSearch) CreateBatch(records []*PaymentType) error {
    var db = slf.build()
    return db.Create(records).Error
}
func (slf *PaymentTypeSearch) Delete() error {
    var db = slf.build()
    return db.Delete(&PaymentType{}).Error
}
func (slf *PaymentTypeSearch) Update(record *PaymentType) error {
    var db = slf.build()
    return db.Updates(record).Error
}
func (slf *PaymentTypeSearch) FindAll() ([]*PaymentType, error) {
    var db = slf.build()
    var record = make([]*PaymentType, 0)
    err := db.Find(&record).Error
    return record, err
}
func (slf *PaymentTypeSearch) SetId(id int) *PaymentTypeSearch {
    slf.Id = id
    return slf
}
func (slf *PaymentTypeSearch) SetOrm(tx *gorm.DB) *PaymentTypeSearch {
    slf.Orm = tx
    return slf
}
func (slf *PaymentTypeSearch) First() (*PaymentType, error) {
    var db = slf.build()
    var record = new(PaymentType)
    err := db.First(record).Error
    return record, err
}
func (slf *PaymentTypeSearch) Updates(values interface{}) error {
    var db = slf.build()
    return db.Updates(values).Error
}
func (slf *PaymentTypeSearch) Save(record *PaymentType) error {
    if record.Id == 0 {
        return errors.New("id为空")
    }
    var db = slf.build()
    if err := db.Save(record).Error; err != nil {
        return fmt.Errorf("save err: %v, record: %+v", err, record)
    }
    return nil
}
func (slf *PaymentTypeSearch) Find() ([]*PaymentType, int64, error) {
    var db = slf.build()
    var records = make([]*PaymentType, 0)
    var total int64
    if err := db.Count(&total).Error; err != nil {
        return records, total, err
    }
    if slf.PageNum > 0 && slf.PageSize > 0 {
        db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
    }
    err := db.Find(&records).Error
    return records, total, err
}
// InitDefaultData 初始化数据
func (slf *PaymentTypeSearch) InitDefaultData() error {
    var (
        db          = slf.Orm.Table(slf.TableName())
        total int64 = 0
    )
    if err := db.Count(&total).Error; err != nil {
        return err
    }
    if total != 0 {
        return nil
    }
    records := []*PaymentType{}
    return slf.CreateBatch(records)
}
model/receipt.go
New file
@@ -0,0 +1,149 @@
package model
import (
    "aps_crm/constvar"
    "aps_crm/pkg/mysqlx"
    "errors"
    "fmt"
    "gorm.io/gorm"
)
type (
    // Receipt 收款单
    Receipt struct {
        Id            int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
        ClientId      int    `gorm:"client_id" json:"clientId"`            // 客户id
        SourceType    int    `gorm:"source_type" json:"sourceType"`        // 来源类型(1销售明细单2服务合同3销售发票4收款计划5出库单)
        SourceId      int    `gorm:"source_id" json:"sourceId"`            // 源单id
        PrincipalId   int    `gorm:"principal_id" json:"principalId"`      // 负责人id
        ReceiptDate   string `gorm:"receipt_date" json:"receiptDate"`      // 收款日期
        MoneyType     string `gorm:"money_type" json:"moneyType"`          // 币种
        PaymentTypeId int    `gorm:"payment_type_id" json:"paymentTypeId"` // 收款方式ID
        BankAccountId int    `gorm:"bank_account_id" json:"bankAccountId"` // 账户id
        Remark        string `gorm:"remark" json:"remark"`                 // 备注
        FileId        int    `gorm:"file_id" json:"fileId"`                // 附件id
    }
    // ReceiptSearch 收款单搜索条件
    ReceiptSearch struct {
        Receipt
        Orm         *gorm.DB
        QueryClass  constvar.ReceiptQueryClass
        KeywordType constvar.ReceiptKeywordType
        Keyword     string
        PageNum     int
        PageSize    int
    }
)
func (Receipt) TableName() string {
    return "receipt"
}
func NewReceiptSearch() *ReceiptSearch {
    return &ReceiptSearch{
        Orm: mysqlx.GetDB(),
    }
}
func (slf *ReceiptSearch) build() *gorm.DB {
    var db = slf.Orm.Model(&Receipt{})
    if slf.Id != 0 {
        db = db.Where("id = ?", slf.Id)
    }
    return db
}
func (slf *ReceiptSearch) Create(record *Receipt) error {
    var db = slf.build()
    return db.Create(record).Error
}
func (slf *ReceiptSearch) CreateBatch(records []*Receipt) error {
    var db = slf.build()
    return db.Create(records).Error
}
func (slf *ReceiptSearch) Delete() error {
    var db = slf.build()
    return db.Delete(&Receipt{}).Error
}
func (slf *ReceiptSearch) Update(record *Receipt) error {
    var db = slf.build()
    return db.Updates(record).Error
}
func (slf *ReceiptSearch) FindAll() ([]*Receipt, error) {
    var db = slf.build()
    var record = make([]*Receipt, 0)
    err := db.Find(&record).Error
    return record, err
}
func (slf *ReceiptSearch) SetId(id int) *ReceiptSearch {
    slf.Id = id
    return slf
}
func (slf *ReceiptSearch) SetOrm(tx *gorm.DB) *ReceiptSearch {
    slf.Orm = tx
    return slf
}
func (slf *ReceiptSearch) First() (*Receipt, error) {
    var db = slf.build()
    var record = new(Receipt)
    err := db.First(record).Error
    return record, err
}
func (slf *ReceiptSearch) Updates(values interface{}) error {
    var db = slf.build()
    return db.Updates(values).Error
}
func (slf *ReceiptSearch) Save(record *Receipt) error {
    if record.Id == 0 {
        return errors.New("id为空")
    }
    var db = slf.build()
    if err := db.Save(record).Error; err != nil {
        return fmt.Errorf("save err: %v, record: %+v", err, record)
    }
    return nil
}
func (slf *ReceiptSearch) Find() ([]*Receipt, int64, error) {
    var db = slf.build()
    var records = make([]*Receipt, 0)
    var total int64
    if err := db.Count(&total).Error; err != nil {
        return records, total, err
    }
    if slf.PageNum > 0 && slf.PageSize > 0 {
        db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize)
    }
    err := db.Find(&records).Error
    return records, total, err
}
// InitDefaultData 初始化数据
func (slf *ReceiptSearch) InitDefaultData() error {
    var (
        db          = slf.Orm.Table(slf.TableName())
        total int64 = 0
    )
    if err := db.Count(&total).Error; err != nil {
        return err
    }
    if total != 0 {
        return nil
    }
    records := []*Receipt{}
    return slf.CreateBatch(records)
}
model/request/bankAccount.go
New file
@@ -0,0 +1,22 @@
package request
import (
    "aps_crm/constvar"
    "aps_crm/model"
)
type AddBankAccount struct {
    model.BankAccount
}
type UpdateBankAccount struct {
    Id int `json:"id"`
    model.BankAccount
}
type GetBankAccountList struct {
    PageInfo
    QueryClass  constvar.BankAccountQueryClass  `json:"queryClass" form:"queryClass"`
    KeywordType constvar.BankAccountKeywordType `json:"keywordType"  form:"keywordType"`
    Keyword     string                       `json:"keyword" form:"keyword"`
}
model/request/paymentType.go
New file
@@ -0,0 +1,22 @@
package request
import (
    "aps_crm/constvar"
    "aps_crm/model"
)
type AddPaymentType struct {
    model.PaymentType
}
type UpdatePaymentType struct {
    Id int `json:"id"`
    model.PaymentType
}
type GetPaymentTypeList struct {
    PageInfo
    QueryClass  constvar.PaymentTypeQueryClass  `json:"queryClass" form:"queryClass"`
    KeywordType constvar.PaymentTypeKeywordType `json:"keywordType"  form:"keywordType"`
    Keyword     string                       `json:"keyword" form:"keyword"`
}
model/request/receipt.go
New file
@@ -0,0 +1,22 @@
package request
import (
    "aps_crm/constvar"
    "aps_crm/model"
)
type AddReceipt struct {
    model.Receipt
}
type UpdateReceipt struct {
    Id int `json:"id"`
    model.Receipt
}
type GetReceiptList struct {
    PageInfo
    QueryClass  constvar.ReceiptQueryClass  `json:"queryClass" form:"queryClass"`
    KeywordType constvar.ReceiptKeywordType `json:"keywordType"  form:"keywordType"`
    Keyword     string                       `json:"keyword" form:"keyword"`
}
router/bankAccount.go
New file
@@ -0,0 +1,17 @@
package router
import (
    v1 "aps_crm/api/v1"
    "github.com/gin-gonic/gin"
)
func InitBankAccountRouter(router *gin.RouterGroup) {
    BankAccountRouter := router.Group("bankAccount")
    BankAccountApi := v1.BankAccountApi{}
    {
        BankAccountRouter.POST("add", BankAccountApi.Add)             // 添加银行账户
        BankAccountRouter.DELETE("delete/:id", BankAccountApi.Delete) // 删除银行账户
        BankAccountRouter.PUT("update", BankAccountApi.Update)        // 更新银行账户
        BankAccountRouter.GET("list", BankAccountApi.List)            // 获取银行账户列表
    }
}
router/index.go
@@ -167,6 +167,9 @@
        InitTimeSpentRouter(PrivateGroup)
        InitFaultTypeRouter(PrivateGroup)
        InitServiceCollectionPlanRouter(PrivateGroup)
        InitReceiptRouter(PrivateGroup)
        InitBankAccountRouter(PrivateGroup)
        InitPaymentTypeRouter(PrivateGroup)
    }
    return Router
}
router/paymentType.go
New file
@@ -0,0 +1,17 @@
package router
import (
    v1 "aps_crm/api/v1"
    "github.com/gin-gonic/gin"
)
func InitPaymentTypeRouter(router *gin.RouterGroup) {
    PaymentTypeRouter := router.Group("paymentType")
    PaymentTypeApi := v1.PaymentTypeApi{}
    {
        PaymentTypeRouter.POST("add", PaymentTypeApi.Add)             // 添加支付方式
        PaymentTypeRouter.DELETE("delete/:id", PaymentTypeApi.Delete) // 删除支付方式
        PaymentTypeRouter.PUT("update", PaymentTypeApi.Update)        // 更新支付方式
        PaymentTypeRouter.GET("list", PaymentTypeApi.List)            // 获取支付方式列表
    }
}
router/receipt.go
New file
@@ -0,0 +1,17 @@
package router
import (
    v1 "aps_crm/api/v1"
    "github.com/gin-gonic/gin"
)
func InitReceiptRouter(router *gin.RouterGroup) {
    ReceiptRouter := router.Group("receipt")
    ReceiptApi := v1.ReceiptApi{}
    {
        ReceiptRouter.POST("add", ReceiptApi.Add)             // 添加收款单
        ReceiptRouter.DELETE("delete/:id", ReceiptApi.Delete) // 删除收款单
        ReceiptRouter.PUT("update", ReceiptApi.Update)        // 更新收款单
        ReceiptRouter.GET("list", ReceiptApi.List)            // 获取收款单列表
    }
}
service/bankAccount.go
New file
@@ -0,0 +1,66 @@
package service
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/pkg/ecode"
)
type BankAccountService struct{}
func NewBankAccountService() BankAccountService {
    return BankAccountService{}
}
func (BankAccountService) AddBankAccount(bankAccount *model.BankAccount) int {
    err := model.NewBankAccountSearch().Create(bankAccount)
    if err != nil {
        return ecode.DBErr
    }
    return ecode.OK
}
func (BankAccountService) DeleteBankAccount(id int) int {
    err := model.NewBankAccountSearch().SetId(id).Delete()
    if err != nil {
        return ecode.DBErr
    }
    return ecode.OK
}
func (BankAccountService) GetBankAccountList() ([]*model.BankAccount, int64, int) {
    list, total, err := model.NewBankAccountSearch().Find()
    if err != nil {
        return nil, 0, ecode.DBErr
    }
    return list, total, ecode.OK
}
func (BankAccountService) UpdateBankAccounts(BankAccounts []*request.UpdateBankAccount) int {
    for _, v := range BankAccounts {
        // check BankAccount exist
        _, err := model.NewBankAccountSearch().SetId(v.Id).First()
        if err != nil {
            return ecode.DBErr
        }
        err = model.NewBankAccountSearch().SetId(v.Id).Updates(map[string]interface{}{
        })
        if err != nil {
            return ecode.DBErr
        }
    }
    return ecode.OK
}
func (BankAccountService) UpdateBankAccount(bankAccount *model.BankAccount) int {
        err := model.NewBankAccountSearch().SetId(bankAccount.Id).Save(bankAccount)
        if err != nil {
            return ecode.DBErr
        }
    return ecode.OK
}
service/paymentType.go
New file
@@ -0,0 +1,66 @@
package service
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/pkg/ecode"
)
type PaymentTypeService struct{}
func NewPaymentTypeService() PaymentTypeService {
    return PaymentTypeService{}
}
func (PaymentTypeService) AddPaymentType(paymentType *model.PaymentType) int {
    err := model.NewPaymentTypeSearch().Create(paymentType)
    if err != nil {
        return ecode.DBErr
    }
    return ecode.OK
}
func (PaymentTypeService) DeletePaymentType(id int) int {
    err := model.NewPaymentTypeSearch().SetId(id).Delete()
    if err != nil {
        return ecode.DBErr
    }
    return ecode.OK
}
func (PaymentTypeService) GetPaymentTypeList() ([]*model.PaymentType, int64, int) {
    list, total, err := model.NewPaymentTypeSearch().Find()
    if err != nil {
        return nil, 0, ecode.DBErr
    }
    return list, total, ecode.OK
}
func (PaymentTypeService) UpdatePaymentTypes(PaymentTypes []*request.UpdatePaymentType) int {
    for _, v := range PaymentTypes {
        // check PaymentType exist
        _, err := model.NewPaymentTypeSearch().SetId(v.Id).First()
        if err != nil {
            return ecode.DBErr
        }
        err = model.NewPaymentTypeSearch().SetId(v.Id).Updates(map[string]interface{}{
        })
        if err != nil {
            return ecode.DBErr
        }
    }
    return ecode.OK
}
func (PaymentTypeService) UpdatePaymentType(paymentType *model.PaymentType) int {
        err := model.NewPaymentTypeSearch().SetId(paymentType.Id).Save(paymentType)
        if err != nil {
            return ecode.DBErr
        }
    return ecode.OK
}
service/receipt.go
New file
@@ -0,0 +1,66 @@
package service
import (
    "aps_crm/model"
    "aps_crm/model/request"
    "aps_crm/pkg/ecode"
)
type ReceiptService struct{}
func NewReceiptService() ReceiptService {
    return ReceiptService{}
}
func (ReceiptService) AddReceipt(receipt *model.Receipt) int {
    err := model.NewReceiptSearch().Create(receipt)
    if err != nil {
        return ecode.DBErr
    }
    return ecode.OK
}
func (ReceiptService) DeleteReceipt(id int) int {
    err := model.NewReceiptSearch().SetId(id).Delete()
    if err != nil {
        return ecode.DBErr
    }
    return ecode.OK
}
func (ReceiptService) GetReceiptList() ([]*model.Receipt, int64, int) {
    list, total, err := model.NewReceiptSearch().Find()
    if err != nil {
        return nil, 0, ecode.DBErr
    }
    return list, total, ecode.OK
}
func (ReceiptService) UpdateReceipts(Receipts []*request.UpdateReceipt) int {
    for _, v := range Receipts {
        // check Receipt exist
        _, err := model.NewReceiptSearch().SetId(v.Id).First()
        if err != nil {
            return ecode.DBErr
        }
        err = model.NewReceiptSearch().SetId(v.Id).Updates(map[string]interface{}{
        })
        if err != nil {
            return ecode.DBErr
        }
    }
    return ecode.OK
}
func (ReceiptService) UpdateReceipt(receipt *model.Receipt) int {
        err := model.NewReceiptSearch().SetId(receipt.Id).Save(receipt)
        if err != nil {
            return ecode.DBErr
        }
    return ecode.OK
}