| | |
| | | return |
| | | } |
| | | |
| | | //CreatorId, b := c.Get("claims") |
| | | //if !b { |
| | | // ctx.Fail(ecode.JWTParseErr) |
| | | // return |
| | | //} |
| | | // |
| | | //client.CreatorId = CreatorId.(int) |
| | | count, err := model.NewClientSearch(nil).SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | errCode = clientService.AddClient(client, params.SalesLeadsId) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(client.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewClientSearch(nil).SetId(client.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | |
| | | import ( |
| | | "aps_crm/conf" |
| | | "aps_crm/constvar" |
| | | "aps_crm/model" |
| | | "aps_crm/model/request" |
| | | "aps_crm/model/response" |
| | | "aps_crm/pkg/contextx" |
| | |
| | | Count: list.Total, |
| | | }) |
| | | } |
| | | |
| | | // GetAutoCode |
| | | // |
| | | // @Tags 编码 |
| | | // @Summary 获取自动编码 |
| | | // @Produce application/json |
| | | // @Param object body code.CodeStandard true "参数" |
| | | // @Success 200 {object} response.ListResponse |
| | | // |
| | | // @Router /api/code/getAutoCode [post] |
| | | func (ca *CodeApi) GetAutoCode(c *gin.Context) { |
| | | var params code.CodeStandard |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | var ( |
| | | id = 0 |
| | | err error |
| | | ) |
| | | switch constvar.CodeStandardType(params.Type) { |
| | | case constvar.CodeStandardTypeSaleKey: |
| | | id, err = model.NewSaleChanceSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeSaleLead: |
| | | id, err = model.NewSalesLeadsSearch(nil).MaxAutoIncr() |
| | | case constvar.CodeStandardTypeCustom: |
| | | id, err = model.NewClientSearch(nil).MaxAutoIncr() |
| | | case constvar.CodeStandardTypeFollowRecord: |
| | | id, err = model.NewFollowRecordSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeQuotation: |
| | | id, err = model.NewQuotationSearch(nil).MaxAutoIncr() |
| | | case constvar.CodeStandardTypeSaleTotalOrder: |
| | | id, err = model.NewMasterOrderSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeSaleSuborder: |
| | | id, err = model.NewSubOrderSearch(nil).MaxAutoIncr() |
| | | case constvar.CodeStandardTypeSaleDetail: |
| | | id, err = model.NewSalesDetailsSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeSaleReturnGoods: |
| | | id, err = model.NewSalesReturnSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeSaleRefund: |
| | | id, err = model.NewSalesRefundSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeContract: |
| | | id, err = model.NewContractSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeServerContract: |
| | | id, err = model.NewServiceContractSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeCustomServer: |
| | | id, err = model.NewServiceOrderSearch().MaxAutoIncr() |
| | | case constvar.CodeStandardTypeServerFollow: |
| | | id, err = model.NewServiceFollowupSearch().MaxAutoIncr() |
| | | default: |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码规则不存在") |
| | | return |
| | | } |
| | | if err != nil { |
| | | logx.Errorf("GetAutoCode err: %v", err.Error()) |
| | | ctx.FailWithMsg(ecode.UnknownErr, "获取最大值失败") |
| | | return |
| | | } |
| | | autoCode := model.GetAutoCode(id, ¶ms) |
| | | ctx.OkWithDetailed(autoCode) |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewContractSearch().SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if contract.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(contract.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewContractSearch().SetId(contract.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewFollowRecordSearch().SetNumber(followRecord.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if followRecord.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | if params.FollowRecord.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(followRecord.Id, ¶ms.FollowRecord.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewFollowRecordSearch().SetId(followRecord.Id).UpdateMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewMasterOrderSearch().SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if masterOrder.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(masterOrder.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewMasterOrderSearch().SetId(masterOrder.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewQuotationSearch(nil).SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if quotation.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(quotation.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewQuotationSearch(nil).SetId(quotation.Id).Updates(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | if params.CodeRule.Method != 1 { |
| | | count, err := model.NewSaleChanceSearch().SetNumber(saleChance.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "销售机会编码已存在") |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewSaleChanceSearch().SetNumber(saleChance.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "销售机会编码已存在") |
| | | return |
| | | } |
| | | |
| | | if saleChance.MemberId == 0 { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(saleChance.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewSaleChanceSearch().SetId(saleChance.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewSalesDetailsSearch().SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if salesDetails.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(salesDetails.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewSalesDetailsSearch().SetId(salesDetails.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.OkWithDetailed(salesDetails) |
| | |
| | | salesDetailsModel.LogisticNumber = salesDetails.LogisticNumber |
| | | salesDetailsModel.LogisticCost = salesDetails.LogisticCost |
| | | salesDetailsModel.CodeStandID = salesDetails.CodeStandID |
| | | salesDetailsModel.DeliverType = salesDetails.DeliverType |
| | | |
| | | return ecode.OK, salesDetailsModel |
| | | } |
| | |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | count, err := model.NewSalesLeadsSearch(nil).SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | errCode = salesLeadsService.AddSalesLeads(&salesLeads) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(salesLeads.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewSalesLeadsSearch(nil).SetId(salesLeads.Id).UpdateMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewSalesRefundSearch().SetNumber(salesRefund.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if salesRefund.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.SalesRefund.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(salesRefund.Id, ¶ms.SalesRefund.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewSalesRefundSearch().SetId(salesRefund.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewSalesReturnSearch().SetNumber(salesReturn.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if salesReturn.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | |
| | | if params.SalesReturn.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(salesReturn.Id, ¶ms.SalesReturn.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewSalesReturnSearch().SetId(salesReturn.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewServiceContractSearch().SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if params.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(serviceContract.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewServiceContractSearch().SetId(serviceContract.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | | } |
| | | |
| | | //// Delete |
| | | //// |
| | | //// @Tags ServiceContract |
| | | //// @Summary 删除服务合同 |
| | | //// @Produce application/json |
| | | //// @Param object body request.DeleteServiceContract true "查询参数" |
| | | //// @Success 200 {object} contextx.Response{} |
| | | //// @Router /api/serviceContract/delete [delete] |
| | | //func (s *ServiceContractApi) Delete(c *gin.Context) { |
| | | // var params request.DeleteServiceContract |
| | | // ctx, ok := contextx.NewContext(c, ¶ms) |
| | | // if !ok { |
| | | // return |
| | | // } |
| | | // |
| | | // errCode := serviceContractService.DeleteServiceContract(params.Ids) |
| | | // if errCode != ecode.OK { |
| | | // ctx.Fail(errCode) |
| | | // return |
| | | // } |
| | | // |
| | | // ctx.Ok() |
| | | //} |
| | | |
| | | // BatchDelete |
| | | // @Tags ServiceContract |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewServiceFollowupSearch().SetNumber(serviceFollowup.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | errCode = serviceFollowupService.AddServiceFollowup(&serviceFollowup) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(serviceFollowup.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewServiceFollowupSearch().SetId(serviceFollowup.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewServiceOrderSearch().SetNumber(serviceOrder.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | errCode := service.NewServiceOrderService().AddServiceOrder(serviceOrder) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | | } |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(serviceOrder.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "service_number": autoCode, |
| | | } |
| | | _ = model.NewServiceOrderSearch().SetId(serviceOrder.Id).UpdateByMap(m) |
| | | } |
| | | |
| | | ctx.Ok() |
| | |
| | | return |
| | | } |
| | | |
| | | count, err := model.NewSubOrderSearch(nil).SetNumber(params.Number).Count() |
| | | if err != nil { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码验证失败") |
| | | return |
| | | } |
| | | if count > 0 { |
| | | ctx.FailWithMsg(ecode.UnknownErr, "编码已存在") |
| | | return |
| | | } |
| | | |
| | | if subOrder.MemberId == 0 { |
| | | userInfo := utils.GetUserInfo(c) |
| | | if userInfo.UserType == constvar.UserTypeSub { |
| | |
| | | return |
| | | } |
| | | |
| | | if params.CodeRule.Method == 1 { |
| | | autoCode := model.GetAutoCode(subOrder.Id, ¶ms.CodeRule) |
| | | m := map[string]interface{}{ |
| | | "number": autoCode, |
| | | } |
| | | _ = model.NewSubOrderSearch(nil).SetId(subOrder.Id).UpdateByMap(m) |
| | | } |
| | | ctx.Ok() |
| | | } |
| | | |
| | |
| | | type CodeStandardType string |
| | | |
| | | const ( |
| | | CodeStandardTypeSaleLead CodeStandardType = "销售线索编码" |
| | | CodeStandardTypeCustom CodeStandardType = "客户编码" |
| | | CodeStandardTypeContact CodeStandardType = "联系人编码" |
| | | CodeStandardTypeFollowRecord CodeStandardType = "跟进记录编码" |
| | | CodeStandardTypeSaleKey CodeStandardType = "销售机会编码" |
| | | CodeStandardTypeQuotation CodeStandardType = "报价编码" |
| | | CodeStandardTypeSaleTotalOrder CodeStandardType = "销售总单编码" |
| | | CodeStandardTypeSaleSuborder CodeStandardType = "销售子单编码" |
| | | CodeStandardTypeSaleRefund CodeStandardType = "销售退款编码" |
| | | CodeStandardTypeContract CodeStandardType = "合同编码" |
| | | CodeStandardTypeServerContract CodeStandardType = "服务合同编码" |
| | | CodeStandardTypeServerFollow CodeStandardType = "服务回访编码" |
| | | CodeStandardTypeSaleLead CodeStandardType = "销售线索编码" |
| | | CodeStandardTypeCustom CodeStandardType = "客户编码" |
| | | CodeStandardTypeFollowRecord CodeStandardType = "跟进记录编码" |
| | | CodeStandardTypeSaleKey CodeStandardType = "销售机会编码" |
| | | CodeStandardTypeQuotation CodeStandardType = "报价编码" |
| | | CodeStandardTypeSaleTotalOrder CodeStandardType = "销售总单编码" |
| | | CodeStandardTypeSaleSuborder CodeStandardType = "销售子单编码" |
| | | CodeStandardTypeSaleRefund CodeStandardType = "销售退款编码" |
| | | CodeStandardTypeContract CodeStandardType = "合同编码" |
| | | CodeStandardTypeServerContract CodeStandardType = "服务合同编码" |
| | | CodeStandardTypeServerFollow CodeStandardType = "服务回访编码" |
| | | CodeStandardTypeCustomServer CodeStandardType = "客户服务编码" |
| | | CodeStandardTypeSaleInvoice CodeStandardType = "销售发票编码" |
| | | CodeStandardTypeSaleDetail CodeStandardType = "销售明细编码" |
| | | CodeStandardTypeSaleReturnGoods CodeStandardType = "销售退货编码" |
| | | ) |
| | | |
| | | func (t CodeStandardType) Valid() bool { |
| | | if t != CodeStandardTypeSaleLead && |
| | | t != CodeStandardTypeCustom && |
| | | t != CodeStandardTypeContact && |
| | | t != CodeStandardTypeFollowRecord && |
| | | t != CodeStandardTypeSaleKey && |
| | | t != CodeStandardTypeQuotation && |
| | |
| | | t != CodeStandardTypeSaleRefund && |
| | | t != CodeStandardTypeContract && |
| | | t != CodeStandardTypeServerContract && |
| | | t != CodeStandardTypeCustomServer && |
| | | t != CodeStandardTypeSaleInvoice && |
| | | t != CodeStandardTypeSaleDetail && |
| | | t != CodeStandardTypeSaleReturnGoods && |
| | | t != CodeStandardTypeServerFollow { |
| | | return false |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api/code/getAutoCode": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "编码" |
| | | ], |
| | | "summary": "获取自动编码", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | | "schema": { |
| | | "$ref": "#/definitions/response.ListResponse" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api/code/getCodeList": { |
| | | "get": { |
| | | "produces": [ |
| | |
| | | "solutions": { |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "状态", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/model.Status" |
| | | } |
| | | ] |
| | | }, |
| | | "status_id": { |
| | | "$ref": "#/definitions/model.Status" |
| | | "type": "integer" |
| | | }, |
| | | "threats": { |
| | | "type": "string" |
| | |
| | | }, |
| | | "creatorName": { |
| | | "type": "string" |
| | | }, |
| | | "deliverType": { |
| | | "type": "integer" |
| | | }, |
| | | "deliveryDate": { |
| | | "type": "string" |
| | |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | | }, |
| | | "conditions": { |
| | | "type": "string" |
| | | }, |
| | | "deliverType": { |
| | | "description": "交付类型:1.一次发货,2.多次发货", |
| | | "type": "integer" |
| | | }, |
| | | "deliveryDate": { |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "city_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "properties": { |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | }, |
| | | "client_status_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | | }, |
| | | "conditions": { |
| | | "type": "string" |
| | | }, |
| | | "deliverType": { |
| | | "description": "交付类型:1.一次发货,2.多次发货", |
| | | "type": "integer" |
| | | }, |
| | | "deliveryDate": { |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_type_id": { |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "city_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "properties": { |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api/code/getAutoCode": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "编码" |
| | | ], |
| | | "summary": "获取自动编码", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | | "schema": { |
| | | "$ref": "#/definitions/response.ListResponse" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api/code/getCodeList": { |
| | | "get": { |
| | | "produces": [ |
| | |
| | | "solutions": { |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "状态", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/model.Status" |
| | | } |
| | | ] |
| | | }, |
| | | "status_id": { |
| | | "$ref": "#/definitions/model.Status" |
| | | "type": "integer" |
| | | }, |
| | | "threats": { |
| | | "type": "string" |
| | |
| | | }, |
| | | "creatorName": { |
| | | "type": "string" |
| | | }, |
| | | "deliverType": { |
| | | "type": "integer" |
| | | }, |
| | | "deliveryDate": { |
| | | "type": "string" |
| | |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | | }, |
| | | "conditions": { |
| | | "type": "string" |
| | | }, |
| | | "deliverType": { |
| | | "description": "交付类型:1.一次发货,2.多次发货", |
| | | "type": "integer" |
| | | }, |
| | | "deliveryDate": { |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "city_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "properties": { |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | }, |
| | | "client_status_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | | }, |
| | | "conditions": { |
| | | "type": "string" |
| | | }, |
| | | "deliverType": { |
| | | "description": "交付类型:1.一次发货,2.多次发货", |
| | | "type": "integer" |
| | | }, |
| | | "deliveryDate": { |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_type_id": { |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "properties": { |
| | | "city_id": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "description": "客户类型ID", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | | "type": "string" |
| | |
| | | "clientId": { |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | "properties": { |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | | "codeRule": { |
| | | "$ref": "#/definitions/code.CodeStandard" |
| | | }, |
| | | "codeStandID": { |
| | | "description": "编码id", |
| | |
| | | type: integer |
| | | solutions: |
| | | type: string |
| | | status: |
| | | allOf: |
| | | - $ref: '#/definitions/model.Status' |
| | | description: 状态 |
| | | status_id: |
| | | $ref: '#/definitions/model.Status' |
| | | type: integer |
| | | threats: |
| | | type: string |
| | | whether_established: |
| | |
| | | type: integer |
| | | creatorName: |
| | | type: string |
| | | deliverType: |
| | | type: integer |
| | | deliveryDate: |
| | | type: string |
| | | id: |
| | |
| | | client_type_id: |
| | | description: 客户类型ID |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | type: integer |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | type: string |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | | conditions: |
| | | type: string |
| | | deliverType: |
| | | description: 交付类型:1.一次发货,2.多次发货 |
| | | type: integer |
| | | deliveryDate: |
| | | type: string |
| | | logisticCompany: |
| | |
| | | properties: |
| | | city_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | client_type_id: |
| | | description: 客户类型ID |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | clientId: |
| | | description: 客户id |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | type: integer |
| | | client_status_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | type: string |
| | | contact_id: |
| | |
| | | type: string |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | | conditions: |
| | | type: string |
| | | deliverType: |
| | | description: 交付类型:1.一次发货,2.多次发货 |
| | | type: integer |
| | | deliveryDate: |
| | | type: string |
| | | logisticCompany: |
| | |
| | | type: integer |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | client_type_id: |
| | | description: 客户类型ID |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | type: integer |
| | | client_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | city_id: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | client_type_id: |
| | | description: 客户类型ID |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | clientId: |
| | | description: 客户id |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | properties: |
| | | clientId: |
| | | type: integer |
| | | codeRule: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | codeStandID: |
| | | description: 编码id |
| | | type: string |
| | |
| | | summary: 更新客户类型 |
| | | tags: |
| | | - ClientType |
| | | /api/code/getAutoCode: |
| | | post: |
| | | parameters: |
| | | - description: 参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/code.CodeStandard' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: OK |
| | | schema: |
| | | $ref: '#/definitions/response.ListResponse' |
| | | summary: 获取自动编码 |
| | | tags: |
| | | - 编码 |
| | | /api/code/getCodeList: |
| | | get: |
| | | parameters: |
| | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | "time" |
| | | ) |
| | |
| | | return db.Updates(data).Error |
| | | } |
| | | |
| | | func (slf *ClientSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *ClientSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *ClientSearch) SetPage(page, size int) *ClientSearch { |
| | | slf.PageNum, slf.PageSize = page, size |
| | | return slf |
| | |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if len(slf.SearchMap) > 0 { |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *ContractSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *ContractSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *ContractSearch) SetId(id int) *ContractSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | slf.Orm = slf.Orm.Where("id in (?)", ids) |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ContractSearch) SetNumber(number string) *ContractSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ContractSearch) UpdateByMap(data map[string]interface{}) error { |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | } |
| | | if slf.ClientId != 0 { |
| | | db = db.Where("client_id = ?", slf.ClientId) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if len(slf.SearchMap) > 0 { |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *FollowRecordSearch) Count() (int64, error) { |
| | | var count int64 |
| | | err := slf.build().Count(&count).Error |
| | | return count, err |
| | | } |
| | | |
| | | func (slf *FollowRecordSearch) Page(page, pageSize int) ([]*FollowRecord, int64, error) { |
| | | var records = make([]*FollowRecord, 0) |
| | | var count int64 |
| | |
| | | func (slf *FollowRecordSearch) Delete() error { |
| | | var db = slf.build() |
| | | return db.Delete(&slf.FollowRecord).Error |
| | | } |
| | | |
| | | func (slf *FollowRecordSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *FollowRecordSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *FollowRecordSearch) SetId(id int) *FollowRecordSearch { |
| | |
| | | slf.Orm = tx |
| | | return slf |
| | | } |
| | | |
| | | func (slf *FollowRecordSearch) SetNumber(number string) *FollowRecordSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | var db = slf.Orm.Model(&MasterOrder{}) |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if len(slf.SearchMap) > 0 { |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *MasterOrderSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *MasterOrderSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *MasterOrderSearch) SetId(id int) *MasterOrderSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *MasterOrderSearch) SetNumber(number string) *MasterOrderSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *MasterOrderSearch) UpdateByMap(data map[string]interface{}) error { |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | var db = slf.Orm.Model(&Quotation{}) |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if len(slf.SearchMap) > 0 { |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *QuotationSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *QuotationSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *QuotationSearch) SetId(id int) *QuotationSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | slf.SearchMap = searchMap |
| | | return slf |
| | | } |
| | | |
| | | func (slf *QuotationSearch) SetNumber(number string) *QuotationSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | func (slf *QuotationSearch) SetIds(ids []int) *QuotationSearch { |
| | | slf.Orm = slf.Orm.Where("id in (?)", ids) |
| | | return slf |
| | |
| | | package request |
| | | |
| | | import "aps_crm/proto/code" |
| | | |
| | | type AddClient struct { |
| | | Client |
| | | } |
| | | |
| | | type Client struct { |
| | | Name string `json:"name"` // 公司名称 |
| | | Number string `json:"number"` // 公司编号 |
| | | ClientStatusId int `json:"client_status_id"` // 客户状态ID |
| | | ClientTypeId int `json:"client_type_id"` // 客户类型ID |
| | | ClientOriginId int `json:"client_origin_id"` // 客户来源ID |
| | | ClientLevelId int `json:"client_level_id"` // 客户等级ID |
| | | MemberId int `json:"member_id"` // 销售负责人ID |
| | | ServiceMemberId int `json:"service_member_id"` // 服务负责人ID |
| | | DetailAddress string `json:"detail_address"` // 详细地址 |
| | | Remark string `json:"remark"` // 备注 |
| | | NextVisitTime string `json:"next_visit_time"` // 下次回访时间 |
| | | LatestServiceTime string `json:"latest_service_time"` // 最晚服务时间 |
| | | Contact Contact `json:"contact"` |
| | | SalesLeadsId int `json:"sales_leads_id"` // 销售线索ID |
| | | ContactId int `json:"contact_id"` // 联系人ID |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | Name string `json:"name"` // 公司名称 |
| | | Number string `json:"number"` // 公司编号 |
| | | ClientStatusId int `json:"client_status_id"` // 客户状态ID |
| | | ClientTypeId int `json:"client_type_id"` // 客户类型ID |
| | | ClientOriginId int `json:"client_origin_id"` // 客户来源ID |
| | | ClientLevelId int `json:"client_level_id"` // 客户等级ID |
| | | MemberId int `json:"member_id"` // 销售负责人ID |
| | | ServiceMemberId int `json:"service_member_id"` // 服务负责人ID |
| | | DetailAddress string `json:"detail_address"` // 详细地址 |
| | | Remark string `json:"remark"` // 备注 |
| | | NextVisitTime string `json:"next_visit_time"` // 下次回访时间 |
| | | LatestServiceTime string `json:"latest_service_time"` // 最晚服务时间 |
| | | Contact Contact `json:"contact"` |
| | | SalesLeadsId int `json:"sales_leads_id"` // 销售线索ID |
| | | ContactId int `json:"contact_id"` // 联系人ID |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | Address |
| | | Business |
| | | } |
| | |
| | | package request |
| | | |
| | | import "aps_crm/proto/code" |
| | | |
| | | type AddContract struct { |
| | | Contract |
| | | } |
| | | |
| | | type Contract struct { |
| | | ContractName string `json:"contractName"` //合同名称 |
| | | ClientId int `json:"client_id"` |
| | | MemberId int `json:"member_id"` |
| | | Number string `json:"number"` |
| | | QuotationId int `json:"quotation_id"` |
| | | StatusId int `json:"status_id"` |
| | | File string `json:"file"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ContractName string `json:"contractName"` //合同名称 |
| | | ClientId int `json:"client_id"` |
| | | MemberId int `json:"member_id"` |
| | | Number string `json:"number"` |
| | | QuotationId int `json:"quotation_id"` |
| | | StatusId int `json:"status_id"` |
| | | File string `json:"file"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | } |
| | | |
| | | type UpdateContract struct { |
| | |
| | | package request |
| | | |
| | | import "aps_crm/proto/code" |
| | | |
| | | type AddFollowRecord struct { |
| | | FollowRecord FollowRecord `json:"follow_record" binding:"required"` |
| | | } |
| | | |
| | | type FollowRecord struct { |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int(11);comment:客户id"` |
| | | ClientStatusId int `json:"client_status_id" gorm:"column:client_status_id;type:int(11);comment:客户状态id"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:跟进人id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:跟进编号"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int(11);comment:联系人id"` |
| | | Topic string `json:"topic" gorm:"column:topic;type:varchar(255);comment:跟进主题"` |
| | | Record string `json:"record" gorm:"column:record;type:MEDIUMTEXT;comment:跟进记录"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int(11);comment:销售机会id"` |
| | | SalesLeadsId int `json:"sales_leads_id" gorm:"column:sales_leads_id;type:int(11);comment:销售线索id"` |
| | | ContactInformationId int `json:"contact_information_id" gorm:"column:contact_information_id;type:int(11);comment:联系方式id"` |
| | | FollowTime string `json:"follow_time" gorm:"column:follow_time;type:datetime;comment:跟进时间"` |
| | | NextFollowTime string `json:"next_follow_time" gorm:"column:next_follow_time;type:datetime;comment:下次跟进时间"` |
| | | Purpose string `json:"purpose" gorm:"column:purpose;type:varchar(255);comment:跟进目的"` |
| | | Content string `json:"content" gorm:"column:content;type:varchar(255);comment:跟进内容"` |
| | | CodeStandID string `json:"codeStandID" gorm:"column:code_stand_id;type:varchar(255);comment:编码id"` |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int(11);comment:客户id"` |
| | | ClientStatusId int `json:"client_status_id" gorm:"column:client_status_id;type:int(11);comment:客户状态id"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:跟进人id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:跟进编号"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int(11);comment:联系人id"` |
| | | Topic string `json:"topic" gorm:"column:topic;type:varchar(255);comment:跟进主题"` |
| | | Record string `json:"record" gorm:"column:record;type:MEDIUMTEXT;comment:跟进记录"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int(11);comment:销售机会id"` |
| | | SalesLeadsId int `json:"sales_leads_id" gorm:"column:sales_leads_id;type:int(11);comment:销售线索id"` |
| | | ContactInformationId int `json:"contact_information_id" gorm:"column:contact_information_id;type:int(11);comment:联系方式id"` |
| | | FollowTime string `json:"follow_time" gorm:"column:follow_time;type:datetime;comment:跟进时间"` |
| | | NextFollowTime string `json:"next_follow_time" gorm:"column:next_follow_time;type:datetime;comment:下次跟进时间"` |
| | | Purpose string `json:"purpose" gorm:"column:purpose;type:varchar(255);comment:跟进目的"` |
| | | Content string `json:"content" gorm:"column:content;type:varchar(255);comment:跟进内容"` |
| | | CodeStandID string `json:"codeStandID" gorm:"column:code_stand_id;type:varchar(255);comment:编码id"` |
| | | } |
| | | |
| | | type UpdateFollowRecord struct { |
| | |
| | | package request |
| | | |
| | | import "aps_crm/proto/code" |
| | | |
| | | type AddMasterOrder struct { |
| | | MasterOrder |
| | | } |
| | | |
| | | type MasterOrder struct { |
| | | Number string `json:"number"` |
| | | ClientId int `json:"client_id"` |
| | | MemberId int `json:"member_id"` |
| | | StartTime string `json:"start_time"` |
| | | EndTime string `json:"end_time"` |
| | | Money float64 `json:"money"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | Number string `json:"number"` |
| | | ClientId int `json:"client_id"` |
| | | MemberId int `json:"member_id"` |
| | | StartTime string `json:"start_time"` |
| | | EndTime string `json:"end_time"` |
| | | Money float64 `json:"money"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | } |
| | | |
| | | type UpdateMasterOrder struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddQuotation struct { |
| | |
| | | } |
| | | |
| | | type Quotation struct { |
| | | QuotationName string `json:"quotationName"` //报价单名称 |
| | | ClientId int `json:"client_id"` |
| | | Number string `json:"number"` |
| | | QuotationStatusId int `json:"quotation_status_id"` |
| | | ValidityDate string `json:"validity_date"` |
| | | ContactId int `json:"contact_id"` |
| | | MemberId int `json:"member_id"` |
| | | SaleChanceId int `json:"sale_chance_id"` |
| | | Conditions string `json:"conditions"` |
| | | File string `json:"file"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | Products []model.Product `json:"products"` |
| | | QuotationName string `json:"quotationName"` //报价单名称 |
| | | ClientId int `json:"client_id"` |
| | | Number string `json:"number"` |
| | | QuotationStatusId int `json:"quotation_status_id"` |
| | | ValidityDate string `json:"validity_date"` |
| | | ContactId int `json:"contact_id"` |
| | | MemberId int `json:"member_id"` |
| | | SaleChanceId int `json:"sale_chance_id"` |
| | | Conditions string `json:"conditions"` |
| | | File string `json:"file"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | Products []model.Product `json:"products"` |
| | | } |
| | | |
| | | type UpdateQuotation struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddSaleChance struct { |
| | |
| | | } |
| | | |
| | | type SaleChance struct { |
| | | Name string `json:"name"` |
| | | ClientId int `json:"client_id"` |
| | | Number string `json:"number"` |
| | | ContactId int `json:"contact_id"` |
| | | SalesSourcesId int `json:"sales_sources_id"` |
| | | SaleTypeId int `json:"sale_type_id"` |
| | | SaleStageId int `json:"sale_stage_id"` |
| | | MemberId int `json:"member_id"` |
| | | RegularCustomersId int `json:"regular_customers_id"` |
| | | Competitors string `json:"competitors"` |
| | | Possibilities int `json:"possibilities"` |
| | | Budget float64 `json:"budget"` |
| | | ProjectedAmount float64 `json:"projected_amount"` |
| | | Currency int `json:"currency"` |
| | | ExpectedTime string `json:"expected_time"` |
| | | StatusId int `json:"status_id"` |
| | | PainPoints string `json:"pain_points"` |
| | | WhetherEstablished string `json:"whether_established"` |
| | | CapitalBudget string `json:"capital_budget"` |
| | | KeyMaker string `json:"key_maker"` |
| | | KeyFactors string `json:"key_factors"` |
| | | Process string `json:"process"` |
| | | Solutions string `json:"solutions"` |
| | | Advantages string `json:"advantages"` |
| | | Disadvantages string `json:"disadvantages"` |
| | | Opportunities string `json:"opportunities"` |
| | | Threats string `json:"threats"` |
| | | Remark string `json:"remark"` |
| | | DetailAddress string `json:"detail_address"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | Products []*model.Product `json:"products" gorm:"many2many:SaleChance_Product;"` |
| | | Name string `json:"name"` |
| | | ClientId int `json:"client_id"` |
| | | Number string `json:"number"` |
| | | ContactId int `json:"contact_id"` |
| | | SalesSourcesId int `json:"sales_sources_id"` |
| | | SaleTypeId int `json:"sale_type_id"` |
| | | SaleStageId int `json:"sale_stage_id"` |
| | | MemberId int `json:"member_id"` |
| | | RegularCustomersId int `json:"regular_customers_id"` |
| | | Competitors string `json:"competitors"` |
| | | Possibilities int `json:"possibilities"` |
| | | Budget float64 `json:"budget"` |
| | | ProjectedAmount float64 `json:"projected_amount"` |
| | | Currency int `json:"currency"` |
| | | ExpectedTime string `json:"expected_time"` |
| | | StatusId int `json:"status_id"` |
| | | PainPoints string `json:"pain_points"` |
| | | WhetherEstablished string `json:"whether_established"` |
| | | CapitalBudget string `json:"capital_budget"` |
| | | KeyMaker string `json:"key_maker"` |
| | | KeyFactors string `json:"key_factors"` |
| | | Process string `json:"process"` |
| | | Solutions string `json:"solutions"` |
| | | Advantages string `json:"advantages"` |
| | | Disadvantages string `json:"disadvantages"` |
| | | Opportunities string `json:"opportunities"` |
| | | Threats string `json:"threats"` |
| | | Remark string `json:"remark"` |
| | | DetailAddress string `json:"detail_address"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | Products []*model.Product `json:"products" gorm:"many2many:SaleChance_Product;"` |
| | | Address |
| | | } |
| | | |
| | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddSalesDetails struct { |
| | |
| | | } |
| | | |
| | | type SalesDetails struct { |
| | | ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:销售子单号"` |
| | | SaleChanceId int `json:"saleChanceId" gorm:"column:sale_chance_id;type:int;comment:销售机会id"` |
| | | SaleType int `json:"saleType" gorm:"column:sale_type;type:int;comment:销售类型"` |
| | | SignTime string `json:"signTime" gorm:"column:sign_time;type:datetime;comment:签单时间"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | DeliveryDate string `json:"deliveryDate" gorm:"column:delivery_date;type:datetime;comment:交货日期"` |
| | | WechatOrderStatusId int `json:"wechatOrderStatusId" gorm:"column:wechat_order_status_id;type:int;comment:微信订单状态id"` |
| | | Address string `json:"address" gorm:"column:address;type:varchar(255);comment:地址"` |
| | | Phone string `json:"phone" gorm:"column:phone;type:varchar(255);comment:电话"` |
| | | Addressee string `json:"addressee" gorm:"column:addressee;type:varchar(255);comment:收件人"` |
| | | Conditions string `json:"conditions" gorm:"column:conditions;type:text;comment:条件"` |
| | | Remark string `json:"remark" gorm:"column:remark;type:text;comment:备注"` |
| | | Products []*model.Product `json:"products" gorm:"many2many:sales_details_product;"` |
| | | LogisticCompany string `json:"logisticCompany" gorm:"column:logistic_company;type:varchar(255);comment:物流公司"` |
| | | LogisticNumber string `json:"logisticNumber" gorm:"column:logistic_number;type:varchar(255);comment:物流单号"` |
| | | LogisticCost float64 `json:"logisticCost" gorm:"column:logistic_cost;type:decimal(10,2);comment:物流费用"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:销售子单号"` |
| | | SaleChanceId int `json:"saleChanceId" gorm:"column:sale_chance_id;type:int;comment:销售机会id"` |
| | | SaleType int `json:"saleType" gorm:"column:sale_type;type:int;comment:销售类型"` |
| | | SignTime string `json:"signTime" gorm:"column:sign_time;type:datetime;comment:签单时间"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | DeliveryDate string `json:"deliveryDate" gorm:"column:delivery_date;type:datetime;comment:交货日期"` |
| | | WechatOrderStatusId int `json:"wechatOrderStatusId" gorm:"column:wechat_order_status_id;type:int;comment:微信订单状态id"` |
| | | Address string `json:"address" gorm:"column:address;type:varchar(255);comment:地址"` |
| | | Phone string `json:"phone" gorm:"column:phone;type:varchar(255);comment:电话"` |
| | | Addressee string `json:"addressee" gorm:"column:addressee;type:varchar(255);comment:收件人"` |
| | | Conditions string `json:"conditions" gorm:"column:conditions;type:text;comment:条件"` |
| | | Remark string `json:"remark" gorm:"column:remark;type:text;comment:备注"` |
| | | Products []*model.Product `json:"products" gorm:"many2many:sales_details_product;"` |
| | | LogisticCompany string `json:"logisticCompany" gorm:"column:logistic_company;type:varchar(255);comment:物流公司"` |
| | | LogisticNumber string `json:"logisticNumber" gorm:"column:logistic_number;type:varchar(255);comment:物流单号"` |
| | | LogisticCost float64 `json:"logisticCost" gorm:"column:logistic_cost;type:decimal(10,2);comment:物流费用"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | DeliverType int `json:"deliverType"` //交付类型:1.一次发货,2.多次发货 |
| | | } |
| | | |
| | | type UpdateSalesDetails struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddSalesLeads struct { |
| | |
| | | } |
| | | |
| | | type SalesLeads struct { |
| | | Name string `json:"name"` // 公司名称 |
| | | Number string `json:"number"` // 销售线索编号 |
| | | ContactName string `json:"contact_name"` // 联系人姓名 |
| | | ContactPhone string `json:"contact_phone"` // 联系人电话 |
| | | ContactPosition string `json:"contact_position"` // 联系人职位 |
| | | SalesSourcesId int `json:"sales_sources_id"` // 商机来源ID |
| | | MemberId int `json:"member_id"` // 销售负责人ID |
| | | Desc string `json:"desc"` // 备注 |
| | | DetailAddress string `json:"detail_address"` // 详细地址 |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | Name string `json:"name"` // 公司名称 |
| | | Number string `json:"number"` // 销售线索编号 |
| | | ContactName string `json:"contact_name"` // 联系人姓名 |
| | | ContactPhone string `json:"contact_phone"` // 联系人电话 |
| | | ContactPosition string `json:"contact_position"` // 联系人职位 |
| | | SalesSourcesId int `json:"sales_sources_id"` // 商机来源ID |
| | | MemberId int `json:"member_id"` // 销售负责人ID |
| | | Desc string `json:"desc"` // 备注 |
| | | DetailAddress string `json:"detail_address"` // 详细地址 |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | Address |
| | | } |
| | | |
| | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddSalesRefundRequest struct { |
| | |
| | | Reason string `json:"reason"` |
| | | Products []*model.Product `json:"products"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | } |
| | | |
| | | type UpdateSalesRefundRequest struct { |
| | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddSalesReturnRequest struct { |
| | |
| | | Reason string `json:"reason" gorm:"column:reason;type:varchar(255);comment:退货原因"` //退货原因 |
| | | Products []*model.Product `json:"products" gorm:"many2many:salesReturn_product;"` //退货产品 |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | } |
| | | |
| | | type UpdateSalesReturnRequest struct { |
| | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddServiceContract struct { |
| | |
| | | } |
| | | |
| | | type ServiceContract struct { |
| | | ClientId int `json:"clientId"` |
| | | Number string `json:"number"` |
| | | MemberId int `json:"memberId" binding:"required"` |
| | | ContactId int `json:"contactId"` |
| | | SaleChanceId int `json:"saleChanceId"` |
| | | SalesDetailsId int `json:"salesDetailsId"` |
| | | QuotationId int `json:"quotationId"` |
| | | TypeId int `json:"typeId"` |
| | | SignTime string `json:"signTime" binding:"datetime=2006-01-02"` |
| | | StartTime string `json:"startTime"` |
| | | EndTime string `json:"endTime"` |
| | | StatusId int `json:"statusId"` |
| | | ServiceTimes int `json:"serviceTimes"` |
| | | Terms string `json:"terms"` |
| | | Remark string `json:"remark"` |
| | | Products []*model.Product `json:"products"` |
| | | ServiceContractTypeId int `json:"serviceContractTypeId"` |
| | | ServiceContractStatusId int `json:"serviceContractStatusId"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ClientId int `json:"clientId"` |
| | | Number string `json:"number"` |
| | | MemberId int `json:"memberId" binding:"required"` |
| | | ContactId int `json:"contactId"` |
| | | SaleChanceId int `json:"saleChanceId"` |
| | | SalesDetailsId int `json:"salesDetailsId"` |
| | | QuotationId int `json:"quotationId"` |
| | | TypeId int `json:"typeId"` |
| | | SignTime string `json:"signTime" binding:"datetime=2006-01-02"` |
| | | StartTime string `json:"startTime"` |
| | | EndTime string `json:"endTime"` |
| | | StatusId int `json:"statusId"` |
| | | ServiceTimes int `json:"serviceTimes"` |
| | | Terms string `json:"terms"` |
| | | Remark string `json:"remark"` |
| | | Products []*model.Product `json:"products"` |
| | | ServiceContractTypeId int `json:"serviceContractTypeId"` |
| | | ServiceContractStatusId int `json:"serviceContractStatusId"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | } |
| | | |
| | | type UpdateServiceContract struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddServiceFollowup struct { |
| | |
| | | } |
| | | |
| | | type ServiceFollowup struct { |
| | | ClientId int `json:"clientId"` |
| | | Number string `json:"number"` |
| | | ContactId int `json:"contactId"` |
| | | ServiceOrderId int `json:"serviceOrderId"` |
| | | MemberId int `json:"memberId"` |
| | | PlanId int `json:"planId"` |
| | | Satisfaction int `json:"satisfaction"` |
| | | TimelyRate int `json:"timelyRate"` |
| | | SolveRate int `json:"solveRate"` |
| | | IsVisit int `json:"isVisit"` |
| | | OldMemberId int `json:"oldMemberId"` |
| | | Remark string `json:"remark"` |
| | | File string `json:"file"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ClientId int `json:"clientId"` |
| | | Number string `json:"number"` |
| | | ContactId int `json:"contactId"` |
| | | ServiceOrderId int `json:"serviceOrderId"` |
| | | MemberId int `json:"memberId"` |
| | | PlanId int `json:"planId"` |
| | | Satisfaction int `json:"satisfaction"` |
| | | TimelyRate int `json:"timelyRate"` |
| | | SolveRate int `json:"solveRate"` |
| | | IsVisit int `json:"isVisit"` |
| | | OldMemberId int `json:"oldMemberId"` |
| | | Remark string `json:"remark"` |
| | | File string `json:"file"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | } |
| | | |
| | | type UpdateServiceFollowup struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddServiceOrder struct { |
| | | ServiceNumber string `gorm:"service_number" json:"serviceNumber"` // 服务单编号 |
| | | ClientId int `gorm:"client_id" json:"clientId"` // 客户id |
| | | ServiceContractId int `gorm:"service_contract_id" json:"serviceContractId"` // 合同id |
| | | SalesDetailsId int `gorm:"sales_details_id" json:"salesDetailsId"` // 销售订单id |
| | | Subject string `gorm:"subject" json:"subject"` // 主题 |
| | | ProductTypeName string `json:"productTypeName"` // 产品分类名称 |
| | | ProductName string `json:"productName"` // 产品名称 |
| | | ServiceTypeId int `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式id |
| | | ServiceManId int `gorm:"service_man_id" json:"serviceManId"` // 服务人员 |
| | | ContactId int `gorm:"linkman_id" json:"contactId"` // 联系人id |
| | | Address string `gorm:"address" json:"address"` // 上门地址 |
| | | PriorityLevelId int `gorm:"priority_level_id" json:"priorityLevelId"` // 优先级别id |
| | | AppointmentTime string `gorm:"appointment_time" json:"appointmentTime"` // 预约上门时间 |
| | | SaleChanceId int `gorm:"sale_leads" json:"saleChanceId"` // 销售机会id |
| | | FaultTypeId int `gorm:"severity_id" json:"faultTypeId"` // 故障类别id |
| | | SeverityId int `gorm:"severity_id" json:"severity"` // 严重程度id |
| | | ServiceOrderStatusId int `gorm:"column:service_order_status_id;type:int;not null;default:0;comment:服务单状态id" json:"serviceOrderStatusId"` // 处理状态 |
| | | ExpectTime string `gorm:"expect_time" json:"expectTime"` // 希望处理时间 |
| | | RealTime string `gorm:"real_time" json:"realTime"` // 实际处理时间 |
| | | CarFare float64 `gorm:"car_fare" json:"carFare"` // 交通费 |
| | | ChargeAmount float64 `gorm:"charge_amount" json:"chargeAmount"` // 收费金额 |
| | | TimeSpentId int `gorm:"time_spent_id" json:"timeSpentId"` // 花费时间 |
| | | FaqId int `gorm:"problem_id" json:"faqId"` // 常见问题id |
| | | ProblemDesc string `gorm:"problem_desc" json:"problemDesc"` // 问题描述 |
| | | Solution string `gorm:"solution" json:"solution"` // 解决方法 |
| | | SolutionRemark string `gorm:"solution_remark" json:"solutionRemark"` // 内部备注 |
| | | Remark string `gorm:"remark" json:"remark"` // 备注 |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ServiceNumber string `gorm:"service_number" json:"serviceNumber"` // 服务单编号 |
| | | ClientId int `gorm:"client_id" json:"clientId"` // 客户id |
| | | ServiceContractId int `gorm:"service_contract_id" json:"serviceContractId"` // 合同id |
| | | SalesDetailsId int `gorm:"sales_details_id" json:"salesDetailsId"` // 销售订单id |
| | | Subject string `gorm:"subject" json:"subject"` // 主题 |
| | | ProductTypeName string `json:"productTypeName"` // 产品分类名称 |
| | | ProductName string `json:"productName"` // 产品名称 |
| | | ServiceTypeId int `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式id |
| | | ServiceManId int `gorm:"service_man_id" json:"serviceManId"` // 服务人员 |
| | | ContactId int `gorm:"linkman_id" json:"contactId"` // 联系人id |
| | | Address string `gorm:"address" json:"address"` // 上门地址 |
| | | PriorityLevelId int `gorm:"priority_level_id" json:"priorityLevelId"` // 优先级别id |
| | | AppointmentTime string `gorm:"appointment_time" json:"appointmentTime"` // 预约上门时间 |
| | | SaleChanceId int `gorm:"sale_leads" json:"saleChanceId"` // 销售机会id |
| | | FaultTypeId int `gorm:"severity_id" json:"faultTypeId"` // 故障类别id |
| | | SeverityId int `gorm:"severity_id" json:"severity"` // 严重程度id |
| | | ServiceOrderStatusId int `gorm:"column:service_order_status_id;type:int;not null;default:0;comment:服务单状态id" json:"serviceOrderStatusId"` // 处理状态 |
| | | ExpectTime string `gorm:"expect_time" json:"expectTime"` // 希望处理时间 |
| | | RealTime string `gorm:"real_time" json:"realTime"` // 实际处理时间 |
| | | CarFare float64 `gorm:"car_fare" json:"carFare"` // 交通费 |
| | | ChargeAmount float64 `gorm:"charge_amount" json:"chargeAmount"` // 收费金额 |
| | | TimeSpentId int `gorm:"time_spent_id" json:"timeSpentId"` // 花费时间 |
| | | FaqId int `gorm:"problem_id" json:"faqId"` // 常见问题id |
| | | ProblemDesc string `gorm:"problem_desc" json:"problemDesc"` // 问题描述 |
| | | Solution string `gorm:"solution" json:"solution"` // 解决方法 |
| | | SolutionRemark string `gorm:"solution_remark" json:"solutionRemark"` // 内部备注 |
| | | Remark string `gorm:"remark" json:"remark"` // 备注 |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | } |
| | | |
| | | type UpdateServiceOrder struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/model" |
| | | "aps_crm/proto/code" |
| | | ) |
| | | |
| | | type AddSubOrder struct { |
| | |
| | | } |
| | | |
| | | type SubOrder struct { |
| | | ClientId int `json:"clientId"` |
| | | MasterOrderId int `json:"masterOrderId"` |
| | | Number string `json:"number"` |
| | | MemberId int `json:"memberId"` |
| | | Product []model.Product `json:"product"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | CodeRule code.CodeStandard `json:"codeRule"` |
| | | ClientId int `json:"clientId"` |
| | | MasterOrderId int `json:"masterOrderId"` |
| | | Number string `json:"number"` |
| | | MemberId int `json:"memberId"` |
| | | Product []model.Product `json:"product"` |
| | | CodeStandID string `json:"codeStandID"` //编码id |
| | | } |
| | | |
| | | type UpdateSubOrder struct { |
| | |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | | } |
| | | |
| | | func (slf *SaleChanceSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | |
| | | AmountUnInvoiced decimal.Decimal `gorm:"column:amount_not_invoiced;type:decimal(12,2);comment:未开票金额" json:"amountUnInvoiced"` // 未开票金额 |
| | | AmountTotal decimal.Decimal `gorm:"column:amount_total;type:decimal(12,2);comment:价税合计" json:"amountTotal"` // 价税合计 |
| | | CodeStandID string `json:"codeStandID" gorm:"column:code_stand_id;type:varchar(255);comment:编码id"` |
| | | DeliverType int `json:"deliverType" gorm:"column:deliver_type;type:int;comment:交付类型(1.一次发货,2.多次发货)"` |
| | | CrmModel |
| | | } |
| | | |
| | |
| | | return db.Updates(record).Error |
| | | } |
| | | |
| | | func (slf *SalesDetailsSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *SalesDetailsSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *SalesDetailsSearch) SetId(id int) *SalesDetailsSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | import ( |
| | | "aps_crm/constvar" |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | } |
| | | if slf.Name != "" { |
| | | db = db.Where("name = ?", slf.Name) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if len(slf.SearchMap) > 0 { |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *SalesLeadsSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *SalesLeadsSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *SalesLeadsSearch) SetId(id int) *SalesLeadsSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SalesLeadsSearch) SetNumber(number string) *SalesLeadsSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SalesLeadsSearch) SetSearchMap(data map[string]interface{}) *SalesLeadsSearch { |
| | | slf.SearchMap = data |
| | | return slf |
| | |
| | | if len(slf.MemberIds) > 0 { |
| | | db = db.Where("sales_refund.member_id in ?", slf.MemberIds) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | return db |
| | | } |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *SalesRefundSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *SalesRefundSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *SalesRefundSearch) SetId(id int) *SalesRefundSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SalesRefundSearch) SetNumber(number string) *SalesRefundSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SalesRefundSearch) UpdateByMap(data map[string]interface{}) error { |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | |
| | | if len(slf.MemberIds) > 0 { |
| | | db = db.Where("sales_return.member_id in ?", slf.MemberIds) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | return db |
| | | } |
| | |
| | | return records, err |
| | | } |
| | | |
| | | func (slf *SalesReturnSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *SalesReturnSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *SalesReturnSearch) SetId(id int) *SalesReturnSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SalesReturnSearch) SetNumber(number string) *SalesReturnSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SalesReturnSearch) UpdateByMap(data map[string]interface{}) error { |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | |
| | | if slf.ContactId != 0 { |
| | | db = db.Where("contact_id = ?", slf.ContactId) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | return db |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Order("id desc").Order("id desc").Find(&records).Error |
| | | err := db.Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetNumber(number string) *ServiceContractSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceContractSearch) SetId(id int) *ServiceContractSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | if len(slf.MemberIds) > 0 { |
| | | db = db.Where("service_followup.member_id in ?", slf.MemberIds) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | return db |
| | | } |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *ServiceFollowupSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *ServiceFollowupSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *ServiceFollowupSearch) SetNumber(number string) *ServiceFollowupSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceFollowupSearch) SetId(id int) *ServiceFollowupSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | if len(slf.ServiceManIds) > 0 { |
| | | db = db.Where("service_man_id in ?", slf.ServiceManIds) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | return db |
| | | } |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetNumber(number string) *ServiceOrderSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) First() (*ServiceOrder, error) { |
| | | var db = slf.build() |
| | | var record = new(ServiceOrder) |
| | |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | |
| | | |
| | | import ( |
| | | "aps_crm/pkg/mysqlx" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | ) |
| | | |
| | |
| | | |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.Number != "" { |
| | | db = db.Where("number = ?", slf.Number) |
| | | } |
| | | |
| | | if len(slf.SearchMap) > 0 { |
| | |
| | | return records, total, err |
| | | } |
| | | |
| | | func (slf *SubOrderSearch) Count() (int64, error) { |
| | | var db = slf.build() |
| | | var total int64 |
| | | err := db.Count(&total).Error |
| | | return total, err |
| | | } |
| | | |
| | | func (slf *SubOrderSearch) MaxAutoIncr() (int, error) { |
| | | type Result struct { |
| | | Max int |
| | | } |
| | | |
| | | var ( |
| | | result Result |
| | | db = slf.build() |
| | | ) |
| | | |
| | | err := db.Select("MAX(id) as max").Scan(&result).Error |
| | | if err != nil { |
| | | return result.Max, fmt.Errorf("max err: %v", err) |
| | | } |
| | | return result.Max, nil |
| | | } |
| | | |
| | | func (slf *SubOrderSearch) SetId(id int) *SubOrderSearch { |
| | | slf.Id = id |
| | | return slf |
| | |
| | | slf.Orm = slf.Orm.Where("id in (?)", ids) |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SubOrderSearch) SetNumber(number string) *SubOrderSearch { |
| | | slf.Number = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *SubOrderSearch) UpdateByMap(data map[string]interface{}) error { |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | |
| | | } else { // 固定值 |
| | | prefixValue = codeStandard.AutoRule.PrefixValue |
| | | } |
| | | strMaxAutoIncr := strconv.Itoa(id) |
| | | strMaxAutoIncr := strconv.Itoa(id + 1) |
| | | count := int(codeStandard.AutoRule.AutoLength) - len(strMaxAutoIncr) |
| | | for i := 0; i < count; i++ { |
| | | strMaxAutoIncr = "0" + strMaxAutoIncr |
| | |
| | | codeGroup := PrivateGroup.Group("code") |
| | | codeApi := v1.CodeApi{} |
| | | { |
| | | codeGroup.GET("getCodeList", codeApi.GetCodeList) //获取编码列表 |
| | | codeGroup.GET("getCodeList", codeApi.GetCodeList) //获取编码列表 |
| | | codeGroup.POST("getAutoCode", codeApi.GetAutoCode) //获取编码列表 |
| | | } |
| | | return Router |
| | | } |