From 530fed8ec225453572d57b15c200ab062c335457 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 01 十一月 2023 19:20:21 +0800 Subject: [PATCH] 公海member_id使用0 --- service/dataServer.go | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 163 insertions(+), 0 deletions(-) diff --git a/service/dataServer.go b/service/dataServer.go index 6d43c33..63f1d40 100644 --- a/service/dataServer.go +++ b/service/dataServer.go @@ -1 +1,164 @@ package service + +import ( + "aps_crm/constvar" + "aps_crm/model/response" + "aps_crm/pkg/ecode" + "aps_crm/utils" + "github.com/gin-gonic/gin" +) + +type DataServer struct{} + +func (DataServer) GetAllData(c *gin.Context) (errCode int, data response.DataResponse) { + // get country list + countryList, _ := ServiceGroup.GetCountryList() + data.Country = countryList + + // get province list + provinceList, _ := ServiceGroup.GetProvinces(0) + data.Province = provinceList + + // get city list + cityList, _ := ServiceGroup.ListCities(0) + data.City = cityList + + // get region list + regionList, _ := ServiceGroup.ListRegions(0) + data.Region = regionList + + // get client level list + clientLevelList, _ := ServiceGroup.GetClientLevelList() + data.ClientLevel = clientLevelList + + // get client status list + clientStatusList, _ := ServiceGroup.GetClientStatusList() + data.ClientStatus = clientStatusList + + // get client type list + clientTypeList, _ := ServiceGroup.GetClientTypeList() + data.ClientType = clientTypeList + + // get client Origin list + clientOriginList, _ := ServiceGroup.GetClientOriginList() + data.ClientOrigin = clientOriginList + + // get Industry list + industryList, _ := ServiceGroup.GetIndustryList() + data.Industry = industryList + + // get EnterpriseNature list + enterpriseNatureList, _ := ServiceGroup.GetEnterpriseNatureList() + data.EnterpriseNature = enterpriseNatureList + + // get RegisterCapital list + registerCapitalList, _ := ServiceGroup.GetRegisteredCapitalList() + data.RegisteredCapital = registerCapitalList + + // get EnterpriseScale list + enterpriseScaleList, _ := ServiceGroup.GetEnterpriseScaleList() + data.EnterpriseScale = enterpriseScaleList + + // get SalesStage list + salesStageList, _ := ServiceGroup.GetSaleStageList() + data.SaleStage = salesStageList + + // get SalesType list + salesTypeList, _ := ServiceGroup.GetSaleTypeList() + data.SaleType = salesTypeList + + // get SalesSource list + salesSourceList, _ := ServiceGroup.GetSalesSourcesList() + data.SalesSource = salesSourceList + + // get RegularCustomer list + regularCustomerList, _ := ServiceGroup.GetRegularCustomersList() + data.RegularCustomers = regularCustomerList + + // get Member list + + var memberIds []int + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + memberIds = userInfo.SubUserIds + } + + memberList, _ := ServiceGroup.GetUserList(memberIds) + data.Member = memberList + + // get Department list + departmentList, _ := ServiceGroup.GetDepartmentList() + data.Department = departmentList + + // get Satisfaction list + satisfactionList, _ := ServiceGroup.GetSatisfactionList() + data.Satisfaction = satisfactionList + + // get TimelyRate list + timelyRateList, _ := ServiceGroup.GetTimelyRateList() + data.TimelyRate = timelyRateList + + // get SolveRate list + solveRateList, _ := ServiceGroup.GetSolveRateList() + data.SolveRate = solveRateList + + // get IsVisit list + isVisitList, _ := ServiceGroup.GetIsVisitList() + data.IsVisit = isVisitList + + // get ReportSource list + reportSourceList, _ := ServiceGroup.GetReportSourceList() + data.ReportSource = reportSourceList + + // get OrderType list + orderTypeList, _ := ServiceGroup.GetOrderTypeList() + data.OrderType = orderTypeList + + // get ServiceContractStatus list + serviceContractStatusList, _, _ := ServiceGroup.GetServiceContractStatusList() + data.ServiceContractStatus = serviceContractStatusList + + // get ServiceContractType list + serviceContractTypeList, _ := ServiceGroup.GetServiceContractTypeList() + data.ServiceContractType = serviceContractTypeList + + // get RefundMethod list + refundMethodList, _ := ServiceGroup.GetRefundMethodList() + data.RefundMethod = refundMethodList + + // get IsInvoice list + isInvoiceList, _ := ServiceGroup.GetIsInvoiceList() + data.IsInvoice = isInvoiceList + + // get AccountId list + accountIdList, _ := ServiceGroup.GetAccountIdList() + data.AccountId = accountIdList + + // get SalesReturnStatus list + salesReturnStatusList, _ := ServiceGroup.GetSalesReturnStatusList() + data.SalesReturnStatus = salesReturnStatusList + + // get Repository list + repositoryList, _ := ServiceGroup.GetRepositoryList() + data.Repository = repositoryList + + // get QuotationStatus list + quotationStatusList, _ := ServiceGroup.GetQuotationStatusList() + data.QuotationStatus = quotationStatusList + + // get Possibility list + possibilityList, _ := ServiceGroup.GetPossibilityList() + data.Possibility = possibilityList + + // get Status list + statusList, _ := ServiceGroup.GetStatusList() + data.Status = statusList + + // get Currency list + currencyList, _ := ServiceGroup.GetCurrencyList() + data.Currency = currencyList + + errCode = ecode.OK + + return +} -- Gitblit v1.8.0