| New file |
| | |
| | | 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, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | errCode := service.NewBankAccountService().AddBankAccount(¶ms.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, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.BankAccount.Id = params.Id |
| | | |
| | | errCode := service.NewBankAccountService().UpdateBankAccount(¶ms.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, ¶ms) |
| | | 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, |
| | | }) |
| | | } |
| New file |
| | |
| | | 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, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | errCode := service.NewPaymentTypeService().AddPaymentType(¶ms.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, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.PaymentType.Id = params.Id |
| | | |
| | | errCode := service.NewPaymentTypeService().UpdatePaymentType(¶ms.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, ¶ms) |
| | | 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, |
| | | }) |
| | | } |
| New file |
| | |
| | | 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, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | errCode := service.NewReceiptService().AddReceipt(¶ms.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, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.Receipt.Id = params.Id |
| | | |
| | | errCode := service.NewReceiptService().UpdateReceipt(¶ms.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, ¶ms) |
| | | 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, |
| | | }) |
| | | } |
| New file |
| | |
| | | package constvar |
| | | type BankAccountQueryClass string |
| | | |
| | | const ( |
| | | BankAccountQueryClassExpireLessThen60Days BankAccountQueryClass = "" |
| | | ) |
| | | |
| | | type BankAccountKeywordType string |
| | | |
| | | const ( |
| | | BankAccountKeywordCustomerName BankAccountKeywordType = "" |
| | | ) |
| New file |
| | |
| | | package constvar |
| | | type PaymentTypeQueryClass string |
| | | |
| | | const ( |
| | | PaymentTypeQueryClassExpireLessThen60Days PaymentTypeQueryClass = "" |
| | | ) |
| | | |
| | | type PaymentTypeKeywordType string |
| | | |
| | | const ( |
| | | PaymentTypeKeywordCustomerName PaymentTypeKeywordType = "" |
| | | ) |
| New file |
| | |
| | | package constvar |
| | | type ReceiptQueryClass string |
| | | |
| | | const ( |
| | | ReceiptQueryClassExpireLessThen60Days ReceiptQueryClass = "" |
| | | ) |
| | | |
| | | type ReceiptKeywordType string |
| | | |
| | | const ( |
| | | ReceiptKeywordCustomerName ReceiptKeywordType = "" |
| | | ) |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | "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" |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | }, |
| | | "definitions": { |
| | | "constvar.BankAccountKeywordType": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "" |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "BankAccountKeywordCustomerName" |
| | | ] |
| | | }, |
| | | "constvar.BankAccountQueryClass": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "" |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "BankAccountQueryClassExpireLessThen60Days" |
| | | ] |
| | | }, |
| | | "constvar.FaqKeywordType": { |
| | | "type": "string", |
| | | "enum": [ |
| | |
| | | ], |
| | | "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": { |
| | |
| | | "items": { |
| | | "$ref": "#/definitions/model.Menu" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "model.BankAccount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "model.PaymentType": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "model.Plan": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | }, |
| | | "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" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "description": "比例", |
| | | "type": "number" |
| | | }, |
| | | "principal": { |
| | | "principalId": { |
| | | "description": "收款负责人ID", |
| | | "type": "integer" |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddBankAccount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddCity": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddPaymentType": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddPlan": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "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" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateBankAccount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateCities": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePaymentType": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePlan": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "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" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "description": "比例", |
| | | "type": "number" |
| | | }, |
| | | "principal": { |
| | | "principalId": { |
| | | "description": "收款负责人ID", |
| | | "type": "integer" |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | "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" |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | }, |
| | | "definitions": { |
| | | "constvar.BankAccountKeywordType": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "" |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "BankAccountKeywordCustomerName" |
| | | ] |
| | | }, |
| | | "constvar.BankAccountQueryClass": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "" |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "BankAccountQueryClassExpireLessThen60Days" |
| | | ] |
| | | }, |
| | | "constvar.FaqKeywordType": { |
| | | "type": "string", |
| | | "enum": [ |
| | |
| | | ], |
| | | "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": { |
| | |
| | | "items": { |
| | | "$ref": "#/definitions/model.Menu" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "model.BankAccount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "model.PaymentType": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "model.Plan": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | }, |
| | | "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" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "description": "比例", |
| | | "type": "number" |
| | | }, |
| | | "principal": { |
| | | "principalId": { |
| | | "description": "收款负责人ID", |
| | | "type": "integer" |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddBankAccount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddCity": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddPaymentType": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddPlan": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "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" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateBankAccount": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateCities": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePaymentType": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePlan": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "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" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "description": "比例", |
| | | "type": "number" |
| | | }, |
| | | "principal": { |
| | | "principalId": { |
| | | "description": "收款负责人ID", |
| | | "type": "integer" |
| | | }, |
| | |
| | | definitions: |
| | | constvar.BankAccountKeywordType: |
| | | enum: |
| | | - "" |
| | | type: string |
| | | x-enum-varnames: |
| | | - BankAccountKeywordCustomerName |
| | | constvar.BankAccountQueryClass: |
| | | enum: |
| | | - "" |
| | | type: string |
| | | x-enum-varnames: |
| | | - BankAccountQueryClassExpireLessThen60Days |
| | | constvar.FaqKeywordType: |
| | | enum: |
| | | - "" |
| | |
| | | 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 |
| | |
| | | items: |
| | | $ref: '#/definitions/model.Menu' |
| | | type: array |
| | | type: object |
| | | model.BankAccount: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | type: object |
| | | model.City: |
| | | properties: |
| | |
| | | name: |
| | | type: string |
| | | type: object |
| | | model.PaymentType: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | type: object |
| | | model.Plan: |
| | | properties: |
| | | clientId: |
| | |
| | | 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: |
| | |
| | | percent: |
| | | description: 比例 |
| | | type: number |
| | | principal: |
| | | principalId: |
| | | description: 收款负责人ID |
| | | type: integer |
| | | remark: |
| | |
| | | $ref: '#/definitions/request.CasbinInfo' |
| | | type: array |
| | | type: object |
| | | request.AddBankAccount: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | type: object |
| | | request.AddCity: |
| | | properties: |
| | | name: |
| | |
| | | required: |
| | | - name |
| | | type: object |
| | | request.AddPaymentType: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | type: object |
| | | request.AddPlan: |
| | | properties: |
| | | plan: |
| | |
| | | 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: |
| | |
| | | required: |
| | | - account_id |
| | | type: object |
| | | request.UpdateBankAccount: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | type: object |
| | | request.UpdateCities: |
| | | properties: |
| | | cities: |
| | |
| | | required: |
| | | - order_type |
| | | type: object |
| | | request.UpdatePaymentType: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | type: object |
| | | request.UpdatePlan: |
| | | properties: |
| | | id: |
| | |
| | | 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: |
| | |
| | | percent: |
| | | description: 比例 |
| | | type: number |
| | | principal: |
| | | principalId: |
| | | description: 收款负责人ID |
| | | type: integer |
| | | remark: |
| | |
| | | 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: |
| | |
| | | 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: |
| | |
| | | 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: |
| New file |
| | |
| | | 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) |
| | | } |
| New file |
| | |
| | | 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) |
| | | } |
| New file |
| | |
| | | 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) |
| | | } |
| New file |
| | |
| | | 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"` |
| | | } |
| New file |
| | |
| | | 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"` |
| | | } |
| New file |
| | |
| | | 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"` |
| | | } |
| New file |
| | |
| | | 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) // 获取银行账户列表 |
| | | } |
| | | } |
| | |
| | | InitTimeSpentRouter(PrivateGroup) |
| | | InitFaultTypeRouter(PrivateGroup) |
| | | InitServiceCollectionPlanRouter(PrivateGroup) |
| | | InitReceiptRouter(PrivateGroup) |
| | | InitBankAccountRouter(PrivateGroup) |
| | | InitPaymentTypeRouter(PrivateGroup) |
| | | } |
| | | return Router |
| | | } |
| New file |
| | |
| | | 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) // 获取支付方式列表 |
| | | } |
| | | } |
| New file |
| | |
| | | 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) // 获取收款单列表 |
| | | } |
| | | } |
| New file |
| | |
| | | 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 |
| | | } |
| New file |
| | |
| | | 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 |
| | | } |
| New file |
| | |
| | | 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 |
| | | } |