From b4201a0054369a8cd89e940947fd6f1a89f357c2 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期三, 02 八月 2023 13:38:24 +0800 Subject: [PATCH] Merge branch 'master' into fly --- model/plan.go | 41 service/followRecord.go | 19 api/v1/salesRefund.go | 51 service/assign.go | 36 model/request/salesReturn.go | 5 service/plan.go | 18 router/client.go | 6 model/salesReturn.go | 41 model/salesLeads.go | 48 service/saleChance.go | 64 api/v1/masterOrder.go | 50 service/serviceFollowup.go | 18 router/saleChance.go | 4 router/subOrder.go | 4 router/contact.go | 4 service/salesRefund.go | 18 api/v1/orderManage.go | 50 api/v1/serviceFollowup.go | 50 model/request/quotation.go | 5 api/v1/plan.go | 50 service/salesDetails.go | 18 model/contract.go | 42 model/request/subOrder.go | 5 pkg/ecode/code.go | 17 api/v1/contract.go | 50 model/masterOrder.go | 42 model/request/plan.go | 5 service/index.go | 25 router/serviceFeeManage.go | 4 api/v1/salesDetails.go | 50 service/salesReturn.go | 18 router/salesLeads.go | 4 api/v1/index.go | 144 model/request/salesLeads.go | 5 service/client.go | 60 api/v1/subOrder.go | 50 model/saleChance.go | 60 service/masterOrder.go | 18 model/quotation.go | 40 router/salesReturn.go | 4 docs/swagger.json | 722 ++++++++ model/serviceContract.go | 44 api/v1/saleChance.go | 50 api/v1/assign.go | 49 model/request/serviceContract.go | 5 model/salesRefund.go | 42 router/masterOrder.go | 4 service/subOrder.go | 18 router/orderManage.go | 4 service/serviceContract.go | 30 model/request/masterOrder.go | 5 model/request/salesDetails.go | 5 docs/swagger.yaml | 499 ++++++ api/v1/salesReturn.go | 50 router/serviceContract.go | 4 model/request/assign.go | 7 model/request/contract.go | 5 service/orderManage.go | 18 model/serviceFeeManage.go | 42 api/v1/salesLeads.go | 51 service/contract.go | 18 model/user.go | 5 model/subOrder.go | 40 service/contact.go | 18 service/salesLeads.go | 37 model/request/saleChance.go | 5 router/salesDetails.go | 4 docs/docs.go | 722 ++++++++ model/followRecord.go | 43 model/orderManage.go | 41 router/salesRefund.go | 4 model/request/salesRefund.go | 5 router/plan.go | 4 router/quotation.go | 4 model/request/contact.go | 5 api/v1/client.go | 60 api/v1/serviceFeeManage.go | 50 model/request/serviceFeeManage.go | 5 api/v1/contact.go | 51 model/contact.go | 38 router/assign.go | 16 api/v1/quotation.go | 50 service/serviceFeeManage.go | 18 model/serviceFollowup.go | 42 router/serviceFollowup.go | 4 model/request/orderManage.go | 5 model/request/serviceFollowup.go | 5 model/client.go | 41 model/request/followRecord.go | 5 router/followRecord.go | 4 model/request/client.go | 9 router/contract.go | 4 model/response/response.go | 54 /dev/null | 65 model/salesDetails.go | 42 service/quotation.go | 18 api/v1/serviceContract.go | 51 router/index.go | 48 api/v1/followRecord.go | 51 99 files changed, 3,604 insertions(+), 984 deletions(-) diff --git a/api/v1/assign.go b/api/v1/assign.go new file mode 100644 index 0000000..4889095 --- /dev/null +++ b/api/v1/assign.go @@ -0,0 +1,49 @@ +package v1 + +import ( + "aps_crm/model/request" + "aps_crm/pkg/contextx" + "aps_crm/pkg/ecode" + "github.com/gin-gonic/gin" +) + +type AssignApi struct{} + +// Assign +// +// @Tags Assign +// @Summary 瀹℃牳 +// @Produce application/json +// @Param object body request.Assign true "鏌ヨ鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/assign/assign [post] +func (au *AssignApi) Assign(c *gin.Context) { + var params request.Assign + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + if params.MemberId == 0 { + ctx.Fail(ecode.AssignWrongMemberId) + return + } + + if params.Id == 0 { + ctx.Fail(ecode.AssignWrongId) + return + } + + if params.Type == "" { + ctx.Fail(ecode.AssignWrongModelType) + return + } + + errCode := assignService.Assign(params.MemberId, params.Id, params.Type) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} diff --git a/api/v1/client.go b/api/v1/client.go index 96aa141..3be607b 100644 --- a/api/v1/client.go +++ b/api/v1/client.go @@ -7,7 +7,6 @@ "aps_crm/pkg/contextx" "aps_crm/pkg/ecode" "github.com/gin-gonic/gin" - "strconv" ) type ClientApi struct{} @@ -42,28 +41,6 @@ } ctx.Ok() -} - -// List -// -// @Tags Client -// @Summary 鑾峰彇瀹㈡埛鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.ClientResponse} -// @Router /api/client/list [get] -func (cli *ClientApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - errCode, clients := clientService.GetClientList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.ClientResponse{List: clients}) } func checkClientParams(params request.Client) (int, *model.Client) { @@ -142,17 +119,17 @@ // @Tags Client // @Summary 鍒犻櫎瀹㈡埛 // @Produce application/json -// @Param id path int true "瀹㈡埛ID" +// @Param object body request.DeleteClient true "鏌ヨ鍙傛暟" // @Success 200 {object} contextx.Response{} -// @Router /api/client/delete/{id} [delete] +// @Router /api/client/delete [delete] func (cli *ClientApi) Delete(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) + var params request.DeleteClient + ctx, ok := contextx.NewContext(c, ¶ms) if !ok { return } - id, _ := strconv.Atoi(c.Param("id")) - errCode := clientService.DeleteClient(id) + errCode := clientService.DeleteClient(params.Ids) if errCode != ecode.OK { ctx.Fail(errCode) return @@ -198,3 +175,30 @@ ctx.Ok() } + +// List +// +// @Tags Client +// @Summary 瀹㈡埛鍒楄〃 +// @Produce application/json +// @Param object body request.GetClientList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.ClientResponse} +// @Router /api/client/list [post] +func (cli *ClientApi) List(c *gin.Context) { + var params request.GetClientList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + clients, total, errCode := clientService.GetClientList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ClientResponse{ + List: clients, + Count: int(total), + }) +} diff --git a/api/v1/contact.go b/api/v1/contact.go index 001ecc9..2fd3dd4 100644 --- a/api/v1/contact.go +++ b/api/v1/contact.go @@ -66,30 +66,6 @@ ctx.Ok() } -// List -// -// @Tags Contact -// @Summary 鑱旂郴浜哄垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.ContactResponse} -// @Router /api/contact/list [get] -func (con *ContactApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - contacts, errCode := contactService.GetContactList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.ContactResponse{ - List: contacts, - }) -} - // Update // // @Tags Contact @@ -168,3 +144,30 @@ contact.IsFirst = params.IsFirst return ecode.OK, contact } + +// List +// +// @Tags Contact +// @Summary 鑱旂郴浜哄垪琛� +// @Produce application/json +// @Param object body request.GetContactList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.ContactResponse} +// @Router /api/contact/list [post] +func (con *ContactApi) List(c *gin.Context) { + var params request.GetContactList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + contacts, total, errCode := contactService.GetContactList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ContactResponse{ + List: contacts, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/contract.go b/api/v1/contract.go index 0f69384..ebd4cf2 100644 --- a/api/v1/contract.go +++ b/api/v1/contract.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags Contract -// @Summary 鑾峰彇鍚堝悓鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.ContractResponse} -// @Router /api/contract/list [get] -func (s *ContractApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - contractList, errCode := contractService.GetContractList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.ContractResponse{ - List: contractList, - }) -} func checkContractParams(contract request.Contract) (errCode int, contractModel model.Contract) { //if contract.Number == "" { @@ -142,3 +119,30 @@ return ecode.OK, contractModel } + +// List +// +// @Tags Contract +// @Summary 閿�鍞悎鍚屽垪琛� +// @Produce application/json +// @Param object body request.GetContractList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.ContractResponse} +// @Router /api/contract/list [post] +func (con *ContractApi) List(c *gin.Context) { + var params request.GetContractList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + contracts, total, errCode := contractService.GetContractList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ContractResponse{ + List: contracts, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/followRecord.go b/api/v1/followRecord.go index 852cb90..e6c2f4c 100644 --- a/api/v1/followRecord.go +++ b/api/v1/followRecord.go @@ -43,30 +43,6 @@ ctx.Ok() } -// List -// -// @Tags FollowRecord -// @Summary 鑾峰彇璺熻繘璁板綍鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.FollowRecordResponse} -// @Router /api/followRecord/list [get] -func (fr *FollowRecordApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - errCode, followRecordList := followRecordService.GetFollowRecordList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.FollowRecordResponse{ - List: followRecordList, - }) -} - // Delete // // @Tags FollowRecord @@ -219,3 +195,30 @@ return time.Time{}, err } + +// List +// +// @Tags FollowRecord +// @Summary 鍥炶璁板綍鍒楄〃 +// @Produce application/json +// @Param object body request.GetFollowRecordList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.FollowRecordResponse} +// @Router /api/followRecord/list [post] +func (fr *FollowRecordApi) List(c *gin.Context) { + var params request.GetFollowRecordList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + followRecords, total, errCode := followRecordService.GetFollowRecordList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.FollowRecordResponse{ + List: followRecords, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/index.go b/api/v1/index.go index d7f869b..00c8f70 100644 --- a/api/v1/index.go +++ b/api/v1/index.go @@ -5,17 +5,17 @@ ) type Group struct { - CurrencyApi - QuotationStatusApi - RepositoryApi - SalesReturnStatusApi - AccountIdApi - IsInvoiceApi - RefundMethodApi - ServiceContractTypeApi - ServiceContractStatusApi - OrderTypeApi - ReportSourceApi + CurrencyApi + QuotationStatusApi + RepositoryApi + SalesReturnStatusApi + AccountIdApi + IsInvoiceApi + RefundMethodApi + ServiceContractTypeApi + ServiceContractStatusApi + OrderTypeApi + ReportSourceApi IsVisitApi SolveRateApi TimelyRateApi @@ -64,68 +64,70 @@ DepartmentApi VettingApi SatisfactionApi + AssignApi } var ApiGroup = new(Group) var ( - userService = service.ServiceGroup.UserService - jwtService = service.ServiceGroup.JwtService - countryService = service.ServiceGroup.CountryService - provinceService = service.ServiceGroup.ProvinceService - cityService = service.ServiceGroup.CityService - regionService = service.ServiceGroup.RegionService - contactService = service.ServiceGroup.ContactService - clientService = service.ServiceGroup.ClientService - clientStatusService = service.ServiceGroup.ClientStatusService - clientTypeService = service.ServiceGroup.ClientTypeService - clientOriginService = service.ServiceGroup.ClientOriginService - clientLevelService = service.ServiceGroup.ClientLevelService - industryService = service.ServiceGroup.IndustryService - enterpriseNatureService = service.ServiceGroup.EnterpriseNatureService - registeredCapitalService = service.ServiceGroup.RegisteredCapitalService - enterpriseScaleService = service.ServiceGroup.EnterpriseScaleService - salesLeadsService = service.ServiceGroup.SalesLeadsService - salesSourcesService = service.ServiceGroup.SalesSourcesService - followRecordService = service.ServiceGroup.FollowRecordService - saleChanceService = service.ServiceGroup.SaleChanceService - saleStageService = service.ServiceGroup.SaleStageService - saleTypeService = service.ServiceGroup.SaleTypeService - regularCustomersService = service.ServiceGroup.RegularCustomersService - possibilityService = service.ServiceGroup.PossibilityService - statusService = service.ServiceGroup.StatusService - quotationService = service.ServiceGroup.QuotationService - masterOrderService = service.ServiceGroup.MasterOrderService - subOrderService = service.ServiceGroup.SubOrderService - salesDetailsService = service.ServiceGroup.SalesDetailsService - salesReturnService = service.ServiceGroup.SalesReturnService - salesRefundService = service.ServiceGroup.SalesRefundService - contractService = service.ServiceGroup.ContractService - planService = service.ServiceGroup.PlanService - serviceContractService = service.ServiceGroup.SContractService - orderManageService = service.ServiceGroup.OrderManageService - serviceFollowupService = service.ServiceGroup.FollowupService - customerServiceSheetService = service.ServiceGroup.CustomerServiceSheetService - serviceFeeManageService = service.ServiceGroup.FeeManageService - casbinService = service.ServiceGroup.CasbinService - authorityService = service.ServiceGroup.AuthorityService - menuService = service.ServiceGroup.MenuService - allDataServer = service.ServiceGroup.DataServer - departmentService = service.ServiceGroup.DepartmentService - vettingService = service.ServiceGroup.VettingService - satisfactionService = service.ServiceGroup.SatisfactionService - timelyRateService = service.ServiceGroup.TimelyRateService - solveRateService = service.ServiceGroup.SolveRateService - isVisitService = service.ServiceGroup.IsVisitService - reportSourceService = service.ServiceGroup.ReportSourceService - orderTypeService = service.ServiceGroup.OrderTypeService - serviceContractStatusService = service.ServiceGroup.ServiceContractStatusService - serviceContractTypeService = service.ServiceGroup.ServiceContractTypeService - refundMethodService = service.ServiceGroup.RefundMethodService - isInvoiceService = service.ServiceGroup.IsInvoiceService - accountIdService = service.ServiceGroup.AccountIdService - salesReturnStatusService = service.ServiceGroup.SalesReturnStatusService - repositoryService = service.ServiceGroup.RepositoryService - quotationStatusService = service.ServiceGroup.QuotationStatusService - currencyService = service.ServiceGroup.CurrencyService -) \ No newline at end of file + userService = service.ServiceGroup.UserService + jwtService = service.ServiceGroup.JwtService + countryService = service.ServiceGroup.CountryService + provinceService = service.ServiceGroup.ProvinceService + cityService = service.ServiceGroup.CityService + regionService = service.ServiceGroup.RegionService + contactService = service.ServiceGroup.ContactService + clientService = service.ServiceGroup.ClientService + clientStatusService = service.ServiceGroup.ClientStatusService + clientTypeService = service.ServiceGroup.ClientTypeService + clientOriginService = service.ServiceGroup.ClientOriginService + clientLevelService = service.ServiceGroup.ClientLevelService + industryService = service.ServiceGroup.IndustryService + enterpriseNatureService = service.ServiceGroup.EnterpriseNatureService + registeredCapitalService = service.ServiceGroup.RegisteredCapitalService + enterpriseScaleService = service.ServiceGroup.EnterpriseScaleService + salesLeadsService = service.ServiceGroup.SalesLeadsService + salesSourcesService = service.ServiceGroup.SalesSourcesService + followRecordService = service.ServiceGroup.FollowRecordService + saleChanceService = service.ServiceGroup.SaleChanceService + saleStageService = service.ServiceGroup.SaleStageService + saleTypeService = service.ServiceGroup.SaleTypeService + regularCustomersService = service.ServiceGroup.RegularCustomersService + possibilityService = service.ServiceGroup.PossibilityService + statusService = service.ServiceGroup.StatusService + quotationService = service.ServiceGroup.QuotationService + masterOrderService = service.ServiceGroup.MasterOrderService + subOrderService = service.ServiceGroup.SubOrderService + salesDetailsService = service.ServiceGroup.SalesDetailsService + salesReturnService = service.ServiceGroup.SalesReturnService + salesRefundService = service.ServiceGroup.SalesRefundService + contractService = service.ServiceGroup.ContractService + planService = service.ServiceGroup.PlanService + serviceContractService = service.ServiceGroup.SContractService + orderManageService = service.ServiceGroup.OrderManageService + serviceFollowupService = service.ServiceGroup.FollowupService + customerServiceSheetService = service.ServiceGroup.CustomerServiceSheetService + serviceFeeManageService = service.ServiceGroup.FeeManageService + casbinService = service.ServiceGroup.CasbinService + authorityService = service.ServiceGroup.AuthorityService + menuService = service.ServiceGroup.MenuService + allDataServer = service.ServiceGroup.DataServer + departmentService = service.ServiceGroup.DepartmentService + vettingService = service.ServiceGroup.VettingService + satisfactionService = service.ServiceGroup.SatisfactionService + timelyRateService = service.ServiceGroup.TimelyRateService + solveRateService = service.ServiceGroup.SolveRateService + isVisitService = service.ServiceGroup.IsVisitService + reportSourceService = service.ServiceGroup.ReportSourceService + orderTypeService = service.ServiceGroup.OrderTypeService + serviceContractStatusService = service.ServiceGroup.ServiceContractStatusService + serviceContractTypeService = service.ServiceGroup.ServiceContractTypeService + refundMethodService = service.ServiceGroup.RefundMethodService + isInvoiceService = service.ServiceGroup.IsInvoiceService + accountIdService = service.ServiceGroup.AccountIdService + salesReturnStatusService = service.ServiceGroup.SalesReturnStatusService + repositoryService = service.ServiceGroup.RepositoryService + quotationStatusService = service.ServiceGroup.QuotationStatusService + currencyService = service.ServiceGroup.CurrencyService + assignService = service.ServiceGroup.AssignService +) diff --git a/api/v1/masterOrder.go b/api/v1/masterOrder.go index 3c479b3..1e77b66 100644 --- a/api/v1/masterOrder.go +++ b/api/v1/masterOrder.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags MasterOrder -// @Summary 涓昏鍗曞垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.MasterOrderResponse} -// @Router /api/masterOrder/list [get] -func (s *MasterOrderApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := masterOrderService.GetMasterOrderList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.MasterOrderResponse{ - List: list, - }) -} // checkMasterOrderParams // 妫�鏌ヤ富璁㈠崟鍙傛暟 @@ -152,3 +129,30 @@ return ecode.OK, masterOrderModel } + +// List +// +// @Tags MasterOrder +// @Summary 閿�鍞�诲崟鍒楄〃 +// @Produce application/json +// @Param object body request.GetMasterOrderList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.MasterOrderResponse} +// @Router /api/masterOrder/list [post] +func (con *MasterOrderApi) List(c *gin.Context) { + var params request.GetMasterOrderList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + masterOrders, total, errCode := masterOrderService.GetMasterOrderList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.MasterOrderResponse{ + List: masterOrders, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/orderManage.go b/api/v1/orderManage.go index a295dfc..0a5d9c4 100644 --- a/api/v1/orderManage.go +++ b/api/v1/orderManage.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags OrderManage -// @Summary 宸ュ崟鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{} -// @Router /api/orderManage/list [get] -func (o *OrderManageApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := orderManageService.GetOrderManageList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.OrderManageResponse{ - List: list, - }) -} // checkOrderManageParams func checkOrderManageParams(orderManage request.OrderManage) (int, model.OrderManage) { @@ -153,3 +130,30 @@ File: orderManage.File, } } + +// List +// +// @Tags OrderManage +// @Summary 宸ュ崟绠$悊鍒楄〃 +// @Produce application/json +// @Param object body request.GetOrderManageList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.OrderManageResponse} +// @Router /api/orderManage/list [post] +func (con *OrderManageApi) List(c *gin.Context) { + var params request.GetOrderManageList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + orderManages, total, errCode := orderManageService.GetOrderManageList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.OrderManageResponse{ + List: orderManages, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/plan.go b/api/v1/plan.go index 28fff5a..f09f7d9 100644 --- a/api/v1/plan.go +++ b/api/v1/plan.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags Plan -// @Summary 鑾峰彇璁″垝鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.PlanResponse} -// @Router /api/plan/list [get] -func (s *PlanApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := planService.GetPlanList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.PlanResponse{ - List: list, - }) -} func checkPlanParams(plan request.Plan) (errCode int, p model.Plan) { //if plan.Number == "" { @@ -155,3 +132,30 @@ return ecode.OK, p } + +// List +// +// @Tags Plan +// @Summary 鐢熸垚璁″垝鍒楄〃 +// @Produce application/json +// @Param object body request.GetPlanList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.PlanResponse} +// @Router /api/plan/list [post] +func (con *PlanApi) List(c *gin.Context) { + var params request.GetPlanList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + plans, total, errCode := planService.GetPlanList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.PlanResponse{ + List: plans, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/qutation.go b/api/v1/quotation.go similarity index 88% rename from api/v1/qutation.go rename to api/v1/quotation.go index c76567f..3a8dd0e 100644 --- a/api/v1/qutation.go +++ b/api/v1/quotation.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags Quotation -// @Summary 鎶ヤ环鍗曞垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.QuotationResponse} -// @Router /api/quotation/list [get] -func (s *QuotationApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := quotationService.GetQuotationList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.QuotationResponse{ - List: list, - }) -} // checkQuotationParams func checkQuotationParams(quotation request.Quotation) (int, model.Quotation) { @@ -166,3 +143,30 @@ return ecode.OK, quotationModel } + +// List +// +// @Tags Quotation +// @Summary 鎶ヤ环鍗曞垪琛� +// @Produce application/json +// @Param object body request.GetQuotationList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.QuotationResponse} +// @Router /api/quotation/list [post] +func (con *QuotationApi) List(c *gin.Context) { + var params request.GetQuotationList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + quotations, total, errCode := quotationService.GetQuotationList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.QuotationResponse{ + List: quotations, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/saleChance.go b/api/v1/saleChance.go index 35d91b1..b938563 100644 --- a/api/v1/saleChance.go +++ b/api/v1/saleChance.go @@ -104,29 +104,6 @@ ctx.Ok() } -// List -// -// @Tags SaleChance -// @Summary 鑾峰彇閿�鍞満浼氬垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.SaleChanceResponse} -// @Router /api/saleChance/list [get] -func (s *SaleChanceApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - errCode, list := saleChanceService.GetSaleChanceList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.SaleChanceResponse{ - List: list, - }) -} // checkSaleChanceParams // 妫�鏌ラ攢鍞満浼氬弬鏁� @@ -207,3 +184,30 @@ return ecode.OK, sc } + +// List +// +// @Tags SaleChance +// @Summary 閿�鍞満浼氬垪琛� +// @Produce application/json +// @Param object body request.GetSaleChanceList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.SaleChanceResponse} +// @Router /api/saleChance/list [post] +func (con *SaleChanceApi) List(c *gin.Context) { + var params request.GetSaleChanceList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + saleChances, total, errCode := saleChanceService.GetSaleChanceList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.SaleChanceResponse{ + List: saleChances, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/salesDetails.go b/api/v1/salesDetails.go index d7f8bec..113673f 100644 --- a/api/v1/salesDetails.go +++ b/api/v1/salesDetails.go @@ -97,29 +97,6 @@ ctx.Ok() } -// List -// -// @Tags SalesDetails -// @Summary 鑾峰彇閿�鍞槑缁嗗垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.SalesDetailsResponse} -// @Router /api/salesDetails/list [get] -func (s *SalesDetailsApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := salesDetailsService.GetSalesDetailsList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.SalesDetailsResponse{ - List: list, - }) -} func checkSalesDetailsParams(salesDetails request.SalesDetails) (errCode int, salesDetailsModel model.SalesDetails) { //if salesDetails.ClientId == 0 { @@ -168,3 +145,30 @@ return ecode.OK, salesDetailsModel } + +// List +// +// @Tags SalesDetails +// @Summary 閿�鍞槑缁嗗崟鍒楄〃 +// @Produce application/json +// @Param object body request.GetSalesDetailsList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.SalesDetailsResponse} +// @Router /api/salesDetails/list [post] +func (con *SalesDetailsApi) List(c *gin.Context) { + var params request.GetSalesDetailsList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + salesDetailss, total, errCode := salesDetailsService.GetSalesDetailsList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.SalesDetailsResponse{ + List: salesDetailss, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/salesLeads.go b/api/v1/salesLeads.go index 137b398..0a48ac5 100644 --- a/api/v1/salesLeads.go +++ b/api/v1/salesLeads.go @@ -99,30 +99,6 @@ ctx.Ok() } -// List -// -// @Tags SalesLeads -// @Summary 鑾峰彇閿�鍞嚎绱㈠垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.SalesLeadsResponse} -// @Router /api/salesLeads/list [get] -func (s *SalesLeadsApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - errCode, salesLeadsList := salesLeadsService.GetSalesLeadsList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.SalesLeadsResponse{ - List: salesLeadsList, - }) -} - func checkSalesLeadsParams(params request.SalesLeads) (errCode int, salesLeads model.SalesLeads) { //if params.Name == "" { // return ecode.InvalidParams, salesLeads @@ -160,3 +136,30 @@ return ecode.OK, salesLeads } + +// List +// +// @Tags SalesLeads +// @Summary 閿�鍞嚎绱㈠垪琛� +// @Produce application/json +// @Param object body request.GetSalesLeadsList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.SalesLeadsResponse} +// @Router /api/salesLeads/list [post] +func (con *SalesLeadsApi) List(c *gin.Context) { + var params request.GetSalesLeadsList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + salesLeadss, total, errCode := salesLeadsService.GetSalesLeadsList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.SalesLeadsResponse{ + List: salesLeadss, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/salesRefund.go b/api/v1/salesRefund.go index 77d24f7..8da5dd5 100644 --- a/api/v1/salesRefund.go +++ b/api/v1/salesRefund.go @@ -98,30 +98,6 @@ ctx.Ok() } -// List -// -// @Tags SalesRefund -// @Summary 閿�鍞��娆惧垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.SalesRefundResponse} -// @Router /api/salesRefund/list [get] -func (s *SalesRefundApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := salesRefundService.GetSalesRefundList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.SalesRefundResponse{ - List: list, - }) - -} func checkSalesRefundParams(salesRefund request.SalesRefund) (errCode int, salesRefundRes model.SalesRefund) { //if salesRefund.ClientId == 0 { @@ -156,3 +132,30 @@ return ecode.OK, salesRefundRes } + +// List +// +// @Tags SalesRefund +// @Summary 閿�鍞��娆惧崟鍒楄〃 +// @Produce application/json +// @Param object body request.GetSalesRefundList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.SalesRefundResponse} +// @Router /api/salesRefund/list [post] +func (con *SalesRefundApi) List(c *gin.Context) { + var params request.GetSalesRefundList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + salesRefunds, total, errCode := salesRefundService.GetSalesRefundList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.SalesRefundResponse{ + List: salesRefunds, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/salesReturn.go b/api/v1/salesReturn.go index de7e59b..20b1949 100644 --- a/api/v1/salesReturn.go +++ b/api/v1/salesReturn.go @@ -99,29 +99,6 @@ } -// List -// -// @Tags SalesReturn -// @Summary 鑾峰彇閿�鍞��璐у垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.SalesReturnResponse} -// @Router /api/salesReturn/list [get] -func (s *SalesReturnApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - salesReturns, errCode := salesReturnService.GetSalesReturnList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.SalesReturnResponse{ - List: salesReturns, - }) -} func checkSalesReturnParams(salesReturn request.SalesReturn) (errCode int, s model.SalesReturn) { //if salesReturn.Number == "" { @@ -152,3 +129,30 @@ return ecode.OK, s } + +// List +// +// @Tags SalesReturn +// @Summary 閿�鍞��璐у崟鍒楄〃 +// @Produce application/json +// @Param object body request.GetSalesReturnList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.SalesReturnResponse} +// @Router /api/salesReturn/list [post] +func (con *SalesReturnApi) List(c *gin.Context) { + var params request.GetSalesReturnList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + salesReturns, total, errCode := salesReturnService.GetSalesReturnList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.SalesReturnResponse{ + List: salesReturns, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/serviceContracts.go b/api/v1/serviceContract.go similarity index 87% rename from api/v1/serviceContracts.go rename to api/v1/serviceContract.go index b04b77d..8cb3e92 100644 --- a/api/v1/serviceContracts.go +++ b/api/v1/serviceContract.go @@ -98,30 +98,6 @@ ctx.Ok() } -// List -// -// @Tags ServiceContract -// @Summary 鏈嶅姟鍚堝悓鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.ServiceContractsResponse} -// @Router /api/serviceContract/list [get] -func (s *ServiceContractApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - serviceContracts, errCode := serviceContractService.GetServiceContractList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.ServiceContractsResponse{ - List: serviceContracts, - }) -} - // check params func checkServiceContractParams(serviceContract request.ServiceContract) (errCode int, result model.ServiceContract) { //if serviceContract.SignTime == "" { @@ -172,3 +148,30 @@ return ecode.OK, result } + +// List +// +// @Tags ServiceContract +// @Summary 鐢熸垚璁″垝鍒楄〃 +// @Produce application/json +// @Param object body request.GetServiceContractList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.ServiceContractsResponse} +// @Router /api/serviceContract/list [post] +func (con *ServiceContractApi) List(c *gin.Context) { + var params request.GetServiceContractList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + serviceContracts, total, errCode := serviceContractService.GetServiceContractList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ServiceContractsResponse{ + List: serviceContracts, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/serviceFeeManage.go b/api/v1/serviceFeeManage.go index 834ad2c..c7b71d5 100644 --- a/api/v1/serviceFeeManage.go +++ b/api/v1/serviceFeeManage.go @@ -113,29 +113,6 @@ ctx.Ok() } -// List -// -// @Tags ServiceFeeManage -// @Summary 鏈嶅姟璐圭鐞嗗垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.ServiceFeeManageResponse} -// @Router /api/serviceFeeManage/list [get] -func (s *ServiceFeeManageApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := serviceFeeManageService.GetServiceFeeManageList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.ServiceFeeManageResponse{ - List: list, - }) -} // checkServiceFeeManageParams func checkServiceFeeManageParams(serviceFeeManage request.ServiceFeeManage) (errCode int, result model.ServiceFeeManage) { @@ -161,3 +138,30 @@ return ecode.OK, result } + +// List +// +// @Tags ServiceFeeManage +// @Summary 鏈嶅姟璐圭鐞嗗垪琛� +// @Produce application/json +// @Param object body request.GetServiceFeeManageList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.ServiceFeeManageResponse} +// @Router /api/serviceFeeManage/list [post] +func (con *ServiceFeeManageApi) List(c *gin.Context) { + var params request.GetServiceFeeManageList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + serviceFeeManages, total, errCode := serviceFeeManageService.GetServiceFeeManageList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ServiceFeeManageResponse{ + List: serviceFeeManages, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/serviceFollowup.go b/api/v1/serviceFollowup.go index 9e97657..dd6009b 100644 --- a/api/v1/serviceFollowup.go +++ b/api/v1/serviceFollowup.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags ServiceFollowup -// @Summary 鏈嶅姟璺熻繘鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.ServiceFollowupResponse} -// @Router /api/serviceFollowup/list [get] -func (s *ServiceFollowupApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := serviceFollowupService.GetServiceFollowupList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.ServiceFollowupResponse{ - List: list, - }) -} // checkServiceFollowupParams func checkServiceFollowupParams(serviceFollowup request.ServiceFollowup) (errCode int, serviceFollowupModel model.ServiceFollowup) { @@ -150,3 +127,30 @@ return ecode.OK, serviceFollowupModel } + +// List +// +// @Tags ServiceFollowup +// @Summary 鍥炶鍗曠鐞嗗垪琛� +// @Produce application/json +// @Param object body request.GetServiceFollowupList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.ServiceFollowupResponse} +// @Router /api/serviceFollowup/list [post] +func (con *ServiceFollowupApi) List(c *gin.Context) { + var params request.GetServiceFollowupList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + serviceFollowups, total, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ServiceFollowupResponse{ + List: serviceFollowups, + Count: int(total), + }) +} \ No newline at end of file diff --git a/api/v1/subOrder.go b/api/v1/subOrder.go index a13f934..d749e21 100644 --- a/api/v1/subOrder.go +++ b/api/v1/subOrder.go @@ -98,29 +98,6 @@ ctx.Ok() } -// List -// -// @Tags SubOrder -// @Summary 鑾峰彇瀛愯鍗曞垪琛� -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.SubOrderResponse} -// @Router /api/subOrder/list [get] -func (s *SubOrderApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - subOrders, errCode := subOrderService.GetSubOrderList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.SubOrderResponse{ - List: subOrders, - }) -} // checkSubOrderParams // 妫�鏌ュ瓙璁㈠崟鍙傛暟 @@ -141,3 +118,30 @@ return ecode.OK, newSubOrder } + +// List +// +// @Tags SubOrder +// @Summary 閿�鍞瓙鍗曞垪琛� +// @Produce application/json +// @Param object body request.GetSubOrderList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.SubOrderResponse} +// @Router /api/subOrder/list [post] +func (con *SubOrderApi) List(c *gin.Context) { + var params request.GetSubOrderList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + subOrders, total, errCode := subOrderService.GetSubOrderList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.SubOrderResponse{ + List: subOrders, + Count: int(total), + }) +} \ No newline at end of file diff --git a/docs/docs.go b/docs/docs.go index 7984631..ba26073 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -135,6 +135,36 @@ } } }, + "/api/assign/assign": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Assign" + ], + "summary": "瀹℃牳", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Assign" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, "/api/authority/add": { "post": { "security": [ @@ -471,7 +501,7 @@ } } }, - "/api/client/delete/{id}": { + "/api/client/delete": { "delete": { "produces": [ "application/json" @@ -482,11 +512,13 @@ "summary": "鍒犻櫎瀹㈡埛", "parameters": [ { - "type": "integer", - "description": "瀹㈡埛ID", - "name": "id", - "in": "path", - "required": true + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.DeleteClient" + } } ], "responses": { @@ -500,14 +532,25 @@ } }, "/api/client/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "Client" ], - "summary": "鑾峰彇瀹㈡埛鍒楄〃", + "summary": "瀹㈡埛鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetClientList" + } + } + ], "responses": { "200": { "description": "OK", @@ -1095,7 +1138,7 @@ } }, "/api/contact/list": { - "get": { + "post": { "produces": [ "application/json" ], @@ -1103,6 +1146,17 @@ "Contact" ], "summary": "鑱旂郴浜哄垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetContactList" + } + } + ], "responses": { "200": { "description": "OK", @@ -1214,14 +1268,25 @@ } }, "/api/contract/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "Contract" ], - "summary": "鑾峰彇鍚堝悓鍒楄〃", + "summary": "閿�鍞悎鍚屽垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetContractList" + } + } + ], "responses": { "200": { "description": "OK", @@ -2068,14 +2133,25 @@ } }, "/api/followRecord/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "FollowRecord" ], - "summary": "鑾峰彇璺熻繘璁板綍鍒楄〃", + "summary": "鍥炶璁板綍鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetFollowRecordList" + } + } + ], "responses": { "200": { "description": "OK", @@ -2575,14 +2651,25 @@ } }, "/api/masterOrder/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "MasterOrder" ], - "summary": "涓昏鍗曞垪琛�", + "summary": "閿�鍞�诲崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetMasterOrderList" + } + } + ], "responses": { "200": { "description": "OK", @@ -2739,19 +2826,42 @@ } }, "/api/orderManage/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "OrderManage" ], - "summary": "宸ュ崟鍒楄〃", + "summary": "宸ュ崟绠$悊鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetOrderManageList" + } + } + ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/contextx.Response" + "allOf": [ + { + "$ref": "#/definitions/contextx.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.OrderManageResponse" + } + } + } + ] } } } @@ -2965,14 +3075,25 @@ } }, "/api/plan/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "Plan" ], - "summary": "鑾峰彇璁″垝鍒楄〃", + "summary": "鐢熸垚璁″垝鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetPlanList" + } + } + ], "responses": { "200": { "description": "OK", @@ -3361,7 +3482,7 @@ } }, "/api/quotation/list": { - "get": { + "post": { "produces": [ "application/json" ], @@ -3369,6 +3490,17 @@ "Quotation" ], "summary": "鎶ヤ环鍗曞垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetQuotationList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4340,14 +4472,25 @@ } }, "/api/saleChance/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SaleChance" ], - "summary": "鑾峰彇閿�鍞満浼氬垪琛�", + "summary": "閿�鍞満浼氬垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSaleChanceList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4697,14 +4840,25 @@ } }, "/api/salesDetails/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesDetails" ], - "summary": "鑾峰彇閿�鍞槑缁嗗垪琛�", + "summary": "閿�鍞槑缁嗗崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesDetailsList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4816,14 +4970,25 @@ } }, "/api/salesLeads/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesLeads" ], - "summary": "鑾峰彇閿�鍞嚎绱㈠垪琛�", + "summary": "閿�鍞嚎绱㈠垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesLeadsList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4935,14 +5100,25 @@ } }, "/api/salesRefund/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesRefund" ], - "summary": "閿�鍞��娆惧垪琛�", + "summary": "閿�鍞��娆惧崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesRefundList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5054,14 +5230,25 @@ } }, "/api/salesReturn/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesReturn" ], - "summary": "鑾峰彇閿�鍞��璐у垪琛�", + "summary": "閿�鍞��璐у崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesReturnList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5530,14 +5717,25 @@ } }, "/api/serviceContract/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "ServiceContract" ], - "summary": "鏈嶅姟鍚堝悓鍒楄〃", + "summary": "鐢熸垚璁″垝鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetServiceContractList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5887,7 +6085,7 @@ } }, "/api/serviceFeeManage/list": { - "get": { + "post": { "produces": [ "application/json" ], @@ -5895,6 +6093,17 @@ "ServiceFeeManage" ], "summary": "鏈嶅姟璐圭鐞嗗垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetServiceFeeManageList" + } + } + ], "responses": { "200": { "description": "OK", @@ -6006,14 +6215,25 @@ } }, "/api/serviceFollowup/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "ServiceFollowup" ], - "summary": "鏈嶅姟璺熻繘鍒楄〃", + "summary": "鍥炶鍗曠鐞嗗垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetServiceFollowupList" + } + } + ], "responses": { "200": { "description": "OK", @@ -6351,14 +6571,25 @@ } }, "/api/subOrder/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SubOrder" ], - "summary": "鑾峰彇瀛愯鍗曞垪琛�", + "summary": "閿�鍞瓙鍗曞垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSubOrderList" + } + } + ], "responses": { "200": { "description": "OK", @@ -7521,6 +7752,44 @@ } } }, + "model.OrderManage": { + "type": "object", + "properties": { + "client": { + "$ref": "#/definitions/model.Client" + }, + "clientId": { + "type": "integer" + }, + "contactId": { + "type": "integer" + }, + "file": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "number": { + "type": "string" + }, + "orderType": { + "type": "integer" + }, + "problemDescription": { + "type": "string" + }, + "reportSourceId": { + "type": "integer" + }, + "sourceSheet": { + "type": "integer" + } + } + }, "model.OrderType": { "type": "object", "properties": { @@ -7921,6 +8190,15 @@ }, "id": { "type": "integer" + }, + "logisticCompany": { + "type": "string" + }, + "logisticCost": { + "type": "number" + }, + "logisticNumber": { + "type": "string" }, "memberId": { "type": "integer" @@ -9508,6 +9786,20 @@ } } }, + "request.Assign": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "member_id": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, "request.CasbinInfo": { "type": "object", "properties": { @@ -9629,6 +9921,17 @@ } } }, + "request.DeleteClient": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, "request.DeleteCountry": { "type": "object", "properties": { @@ -9691,6 +9994,278 @@ }, "topic": { "type": "string" + } + } + }, + "request.GetClientList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetContactList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetContractList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetFollowRecordList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetMasterOrderList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetOrderManageList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetPlanList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetQuotationList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSaleChanceList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesDetailsList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesLeadsList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesRefundList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesReturnList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetServiceContractList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetServiceFeeManageList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetServiceFollowupList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSubOrderList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" } } }, @@ -9826,6 +10401,15 @@ "type": "string" }, "deliveryDate": { + "type": "string" + }, + "logisticCompany": { + "type": "string" + }, + "logisticCost": { + "type": "number" + }, + "logisticNumber": { "type": "string" }, "memberId": { @@ -11762,6 +12346,9 @@ "response.ClientResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -11795,6 +12382,9 @@ "response.ContactResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -11806,6 +12396,9 @@ "response.ContractResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12122,6 +12715,9 @@ "response.FollowRecordResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12180,6 +12776,9 @@ "response.MasterOrderResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12195,6 +12794,20 @@ "type": "array", "items": { "$ref": "#/definitions/model.Menu" + } + } + } + }, + "response.OrderManageResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderManage" } } } @@ -12228,6 +12841,9 @@ "response.PlanResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12261,6 +12877,9 @@ "response.QuotationResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12338,6 +12957,9 @@ "response.SaleChanceResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12371,6 +12993,9 @@ "response.SalesDetailsResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12382,6 +13007,9 @@ "response.SalesLeadsResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12393,6 +13021,9 @@ "response.SalesRefundResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12404,6 +13035,9 @@ "response.SalesReturnResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12470,6 +13104,9 @@ "response.ServiceContractsResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12481,6 +13118,9 @@ "response.ServiceFeeManageResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12492,6 +13132,9 @@ "response.ServiceFollowupResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12514,6 +13157,9 @@ "response.SubOrderResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { diff --git a/docs/swagger.json b/docs/swagger.json index 0216806..2da771e 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -123,6 +123,36 @@ } } }, + "/api/assign/assign": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Assign" + ], + "summary": "瀹℃牳", + "parameters": [ + { + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Assign" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/contextx.Response" + } + } + } + } + }, "/api/authority/add": { "post": { "security": [ @@ -459,7 +489,7 @@ } } }, - "/api/client/delete/{id}": { + "/api/client/delete": { "delete": { "produces": [ "application/json" @@ -470,11 +500,13 @@ "summary": "鍒犻櫎瀹㈡埛", "parameters": [ { - "type": "integer", - "description": "瀹㈡埛ID", - "name": "id", - "in": "path", - "required": true + "description": "鏌ヨ鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.DeleteClient" + } } ], "responses": { @@ -488,14 +520,25 @@ } }, "/api/client/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "Client" ], - "summary": "鑾峰彇瀹㈡埛鍒楄〃", + "summary": "瀹㈡埛鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetClientList" + } + } + ], "responses": { "200": { "description": "OK", @@ -1083,7 +1126,7 @@ } }, "/api/contact/list": { - "get": { + "post": { "produces": [ "application/json" ], @@ -1091,6 +1134,17 @@ "Contact" ], "summary": "鑱旂郴浜哄垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetContactList" + } + } + ], "responses": { "200": { "description": "OK", @@ -1202,14 +1256,25 @@ } }, "/api/contract/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "Contract" ], - "summary": "鑾峰彇鍚堝悓鍒楄〃", + "summary": "閿�鍞悎鍚屽垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetContractList" + } + } + ], "responses": { "200": { "description": "OK", @@ -2056,14 +2121,25 @@ } }, "/api/followRecord/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "FollowRecord" ], - "summary": "鑾峰彇璺熻繘璁板綍鍒楄〃", + "summary": "鍥炶璁板綍鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetFollowRecordList" + } + } + ], "responses": { "200": { "description": "OK", @@ -2563,14 +2639,25 @@ } }, "/api/masterOrder/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "MasterOrder" ], - "summary": "涓昏鍗曞垪琛�", + "summary": "閿�鍞�诲崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetMasterOrderList" + } + } + ], "responses": { "200": { "description": "OK", @@ -2727,19 +2814,42 @@ } }, "/api/orderManage/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "OrderManage" ], - "summary": "宸ュ崟鍒楄〃", + "summary": "宸ュ崟绠$悊鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetOrderManageList" + } + } + ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/contextx.Response" + "allOf": [ + { + "$ref": "#/definitions/contextx.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.OrderManageResponse" + } + } + } + ] } } } @@ -2953,14 +3063,25 @@ } }, "/api/plan/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "Plan" ], - "summary": "鑾峰彇璁″垝鍒楄〃", + "summary": "鐢熸垚璁″垝鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetPlanList" + } + } + ], "responses": { "200": { "description": "OK", @@ -3349,7 +3470,7 @@ } }, "/api/quotation/list": { - "get": { + "post": { "produces": [ "application/json" ], @@ -3357,6 +3478,17 @@ "Quotation" ], "summary": "鎶ヤ环鍗曞垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetQuotationList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4328,14 +4460,25 @@ } }, "/api/saleChance/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SaleChance" ], - "summary": "鑾峰彇閿�鍞満浼氬垪琛�", + "summary": "閿�鍞満浼氬垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSaleChanceList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4685,14 +4828,25 @@ } }, "/api/salesDetails/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesDetails" ], - "summary": "鑾峰彇閿�鍞槑缁嗗垪琛�", + "summary": "閿�鍞槑缁嗗崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesDetailsList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4804,14 +4958,25 @@ } }, "/api/salesLeads/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesLeads" ], - "summary": "鑾峰彇閿�鍞嚎绱㈠垪琛�", + "summary": "閿�鍞嚎绱㈠垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesLeadsList" + } + } + ], "responses": { "200": { "description": "OK", @@ -4923,14 +5088,25 @@ } }, "/api/salesRefund/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesRefund" ], - "summary": "閿�鍞��娆惧垪琛�", + "summary": "閿�鍞��娆惧崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesRefundList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5042,14 +5218,25 @@ } }, "/api/salesReturn/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SalesReturn" ], - "summary": "鑾峰彇閿�鍞��璐у垪琛�", + "summary": "閿�鍞��璐у崟鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSalesReturnList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5518,14 +5705,25 @@ } }, "/api/serviceContract/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "ServiceContract" ], - "summary": "鏈嶅姟鍚堝悓鍒楄〃", + "summary": "鐢熸垚璁″垝鍒楄〃", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetServiceContractList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5875,7 +6073,7 @@ } }, "/api/serviceFeeManage/list": { - "get": { + "post": { "produces": [ "application/json" ], @@ -5883,6 +6081,17 @@ "ServiceFeeManage" ], "summary": "鏈嶅姟璐圭鐞嗗垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetServiceFeeManageList" + } + } + ], "responses": { "200": { "description": "OK", @@ -5994,14 +6203,25 @@ } }, "/api/serviceFollowup/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "ServiceFollowup" ], - "summary": "鏈嶅姟璺熻繘鍒楄〃", + "summary": "鍥炶鍗曠鐞嗗垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetServiceFollowupList" + } + } + ], "responses": { "200": { "description": "OK", @@ -6339,14 +6559,25 @@ } }, "/api/subOrder/list": { - "get": { + "post": { "produces": [ "application/json" ], "tags": [ "SubOrder" ], - "summary": "鑾峰彇瀛愯鍗曞垪琛�", + "summary": "閿�鍞瓙鍗曞垪琛�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetSubOrderList" + } + } + ], "responses": { "200": { "description": "OK", @@ -7509,6 +7740,44 @@ } } }, + "model.OrderManage": { + "type": "object", + "properties": { + "client": { + "$ref": "#/definitions/model.Client" + }, + "clientId": { + "type": "integer" + }, + "contactId": { + "type": "integer" + }, + "file": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "number": { + "type": "string" + }, + "orderType": { + "type": "integer" + }, + "problemDescription": { + "type": "string" + }, + "reportSourceId": { + "type": "integer" + }, + "sourceSheet": { + "type": "integer" + } + } + }, "model.OrderType": { "type": "object", "properties": { @@ -7909,6 +8178,15 @@ }, "id": { "type": "integer" + }, + "logisticCompany": { + "type": "string" + }, + "logisticCost": { + "type": "number" + }, + "logisticNumber": { + "type": "string" }, "memberId": { "type": "integer" @@ -9496,6 +9774,20 @@ } } }, + "request.Assign": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "member_id": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, "request.CasbinInfo": { "type": "object", "properties": { @@ -9617,6 +9909,17 @@ } } }, + "request.DeleteClient": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, "request.DeleteCountry": { "type": "object", "properties": { @@ -9679,6 +9982,278 @@ }, "topic": { "type": "string" + } + } + }, + "request.GetClientList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetContactList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetContractList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetFollowRecordList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetMasterOrderList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetOrderManageList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetPlanList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetQuotationList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSaleChanceList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesDetailsList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesLeadsList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesRefundList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSalesReturnList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetServiceContractList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetServiceFeeManageList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetServiceFollowupList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" + } + } + }, + "request.GetSubOrderList": { + "type": "object", + "properties": { + "keyword": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" } } }, @@ -9814,6 +10389,15 @@ "type": "string" }, "deliveryDate": { + "type": "string" + }, + "logisticCompany": { + "type": "string" + }, + "logisticCost": { + "type": "number" + }, + "logisticNumber": { "type": "string" }, "memberId": { @@ -11750,6 +12334,9 @@ "response.ClientResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -11783,6 +12370,9 @@ "response.ContactResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -11794,6 +12384,9 @@ "response.ContractResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12110,6 +12703,9 @@ "response.FollowRecordResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12168,6 +12764,9 @@ "response.MasterOrderResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12183,6 +12782,20 @@ "type": "array", "items": { "$ref": "#/definitions/model.Menu" + } + } + } + }, + "response.OrderManageResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderManage" } } } @@ -12216,6 +12829,9 @@ "response.PlanResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12249,6 +12865,9 @@ "response.QuotationResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12326,6 +12945,9 @@ "response.SaleChanceResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12359,6 +12981,9 @@ "response.SalesDetailsResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12370,6 +12995,9 @@ "response.SalesLeadsResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12381,6 +13009,9 @@ "response.SalesRefundResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12392,6 +13023,9 @@ "response.SalesReturnResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12458,6 +13092,9 @@ "response.ServiceContractsResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12469,6 +13106,9 @@ "response.ServiceFeeManageResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12480,6 +13120,9 @@ "response.ServiceFollowupResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { @@ -12502,6 +13145,9 @@ "response.SubOrderResponse": { "type": "object", "properties": { + "count": { + "type": "integer" + }, "list": { "type": "array", "items": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index cc6e9dd..26faa50 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -450,6 +450,31 @@ title: type: string type: object + model.OrderManage: + properties: + client: + $ref: '#/definitions/model.Client' + clientId: + type: integer + contactId: + type: integer + file: + type: string + id: + type: integer + name: + type: string + number: + type: string + orderType: + type: integer + problemDescription: + type: string + reportSourceId: + type: integer + sourceSheet: + type: integer + type: object model.OrderType: properties: id: @@ -712,6 +737,12 @@ type: string id: type: integer + logisticCompany: + type: string + logisticCost: + type: number + logisticNumber: + type: string memberId: type: integer number: @@ -1770,6 +1801,15 @@ - vettingId - vettingType type: object + request.Assign: + properties: + id: + type: integer + member_id: + type: integer + type: + type: string + type: object request.CasbinInfo: properties: method: @@ -1858,6 +1898,13 @@ description: 寰俊鍙� type: string type: object + request.DeleteClient: + properties: + ids: + items: + type: integer + type: array + type: object request.DeleteCountry: properties: id: @@ -1900,6 +1947,193 @@ type: integer topic: type: string + type: object + request.GetClientList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetContactList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetContractList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetFollowRecordList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetMasterOrderList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetOrderManageList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetPlanList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetQuotationList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetSaleChanceList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetSalesDetailsList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetSalesLeadsList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetSalesRefundList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetSalesReturnList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetServiceContractList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetServiceFeeManageList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetServiceFollowupList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer + type: object + request.GetSubOrderList: + properties: + keyword: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer type: object request.GetUserList: properties: @@ -1991,6 +2225,12 @@ conditions: type: string deliveryDate: + type: string + logisticCompany: + type: string + logisticCost: + type: number + logisticNumber: type: string memberId: type: integer @@ -3285,6 +3525,8 @@ type: object response.ClientResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.Client' @@ -3306,6 +3548,8 @@ type: object response.ContactResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.ContactDetail' @@ -3313,6 +3557,8 @@ type: object response.ContractResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.Contract' @@ -3533,6 +3779,8 @@ type: object response.FollowRecordResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.FollowRecord' @@ -3570,6 +3818,8 @@ type: object response.MasterOrderResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.MasterOrder' @@ -3580,6 +3830,15 @@ list: items: $ref: '#/definitions/model.Menu' + type: array + type: object + response.OrderManageResponse: + properties: + count: + type: integer + list: + items: + $ref: '#/definitions/model.OrderManage' type: array type: object response.OrderTypeResponse: @@ -3601,6 +3860,8 @@ type: object response.PlanResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.Plan' @@ -3622,6 +3883,8 @@ type: object response.QuotationResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.Quotation' @@ -3671,6 +3934,8 @@ type: object response.SaleChanceResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.SaleChance' @@ -3692,6 +3957,8 @@ type: object response.SalesDetailsResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.SalesDetails' @@ -3699,6 +3966,8 @@ type: object response.SalesLeadsResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.SalesLeads' @@ -3706,6 +3975,8 @@ type: object response.SalesRefundResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.SalesRefund' @@ -3713,6 +3984,8 @@ type: object response.SalesReturnResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.SalesReturn' @@ -3755,6 +4028,8 @@ type: object response.ServiceContractsResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.ServiceContract' @@ -3762,6 +4037,8 @@ type: object response.ServiceFeeManageResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.ServiceFeeManage' @@ -3769,6 +4046,8 @@ type: object response.ServiceFollowupResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.ServiceFollowup' @@ -3783,6 +4062,8 @@ type: object response.SubOrderResponse: properties: + count: + type: integer list: items: $ref: '#/definitions/model.SubOrder' @@ -3876,6 +4157,25 @@ summary: 鏇存柊璐︽埛 tags: - AccountId + /api/assign/assign: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.Assign' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/contextx.Response' + summary: 瀹℃牳 + tags: + - Assign /api/authority/add: post: consumes: @@ -4079,14 +4379,15 @@ summary: 娣诲姞瀹㈡埛 tags: - Client - /api/client/delete/{id}: + /api/client/delete: delete: parameters: - - description: 瀹㈡埛ID - in: path - name: id + - description: 鏌ヨ鍙傛暟 + in: body + name: object required: true - type: integer + schema: + $ref: '#/definitions/request.DeleteClient' produces: - application/json responses: @@ -4098,7 +4399,14 @@ tags: - Client /api/client/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetClientList' produces: - application/json responses: @@ -4111,7 +4419,7 @@ data: $ref: '#/definitions/response.ClientResponse' type: object - summary: 鑾峰彇瀹㈡埛鍒楄〃 + summary: 瀹㈡埛鍒楄〃 tags: - Client /api/client/update: @@ -4463,7 +4771,14 @@ tags: - Contact /api/contact/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetContactList' produces: - application/json responses: @@ -4536,7 +4851,14 @@ tags: - Contract /api/contract/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetContractList' produces: - application/json responses: @@ -4549,7 +4871,7 @@ data: $ref: '#/definitions/response.ContractResponse' type: object - summary: 鑾峰彇鍚堝悓鍒楄〃 + summary: 閿�鍞悎鍚屽垪琛� tags: - Contract /api/contract/update: @@ -5060,7 +5382,14 @@ tags: - FollowRecord /api/followRecord/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetFollowRecordList' produces: - application/json responses: @@ -5073,7 +5402,7 @@ data: $ref: '#/definitions/response.FollowRecordResponse' type: object - summary: 鑾峰彇璺熻繘璁板綍鍒楄〃 + summary: 鍥炶璁板綍鍒楄〃 tags: - FollowRecord /api/followRecord/update: @@ -5369,7 +5698,14 @@ tags: - MasterOrder /api/masterOrder/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetMasterOrderList' produces: - application/json responses: @@ -5382,7 +5718,7 @@ data: $ref: '#/definitions/response.MasterOrderResponse' type: object - summary: 涓昏鍗曞垪琛� + summary: 閿�鍞�诲崟鍒楄〃 tags: - MasterOrder /api/masterOrder/update: @@ -5467,15 +5803,27 @@ tags: - OrderManage /api/orderManage/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetOrderManageList' produces: - application/json responses: "200": description: OK schema: - $ref: '#/definitions/contextx.Response' - summary: 宸ュ崟鍒楄〃 + allOf: + - $ref: '#/definitions/contextx.Response' + - properties: + data: + $ref: '#/definitions/response.OrderManageResponse' + type: object + summary: 宸ュ崟绠$悊鍒楄〃 tags: - OrderManage /api/orderManage/update: @@ -5608,7 +5956,14 @@ tags: - Plan /api/plan/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetPlanList' produces: - application/json responses: @@ -5621,7 +5976,7 @@ data: $ref: '#/definitions/response.PlanResponse' type: object - summary: 鑾峰彇璁″垝鍒楄〃 + summary: 鐢熸垚璁″垝鍒楄〃 tags: - Plan /api/plan/update: @@ -5852,7 +6207,14 @@ tags: - Quotation /api/quotation/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetQuotationList' produces: - application/json responses: @@ -6456,7 +6818,14 @@ tags: - SaleChance /api/saleChance/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetSaleChanceList' produces: - application/json responses: @@ -6469,7 +6838,7 @@ data: $ref: '#/definitions/response.SaleChanceResponse' type: object - summary: 鑾峰彇閿�鍞満浼氬垪琛� + summary: 閿�鍞満浼氬垪琛� tags: - SaleChance /api/saleChance/update: @@ -6675,7 +7044,14 @@ tags: - SalesDetails /api/salesDetails/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetSalesDetailsList' produces: - application/json responses: @@ -6688,7 +7064,7 @@ data: $ref: '#/definitions/response.SalesDetailsResponse' type: object - summary: 鑾峰彇閿�鍞槑缁嗗垪琛� + summary: 閿�鍞槑缁嗗崟鍒楄〃 tags: - SalesDetails /api/salesDetails/update: @@ -6748,7 +7124,14 @@ tags: - SalesLeads /api/salesLeads/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetSalesLeadsList' produces: - application/json responses: @@ -6761,7 +7144,7 @@ data: $ref: '#/definitions/response.SalesLeadsResponse' type: object - summary: 鑾峰彇閿�鍞嚎绱㈠垪琛� + summary: 閿�鍞嚎绱㈠垪琛� tags: - SalesLeads /api/salesLeads/update: @@ -6821,7 +7204,14 @@ tags: - SalesRefund /api/salesRefund/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetSalesRefundList' produces: - application/json responses: @@ -6834,7 +7224,7 @@ data: $ref: '#/definitions/response.SalesRefundResponse' type: object - summary: 閿�鍞��娆惧垪琛� + summary: 閿�鍞��娆惧崟鍒楄〃 tags: - SalesRefund /api/salesRefund/update: @@ -6894,7 +7284,14 @@ tags: - SalesReturn /api/salesReturn/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetSalesReturnList' produces: - application/json responses: @@ -6907,7 +7304,7 @@ data: $ref: '#/definitions/response.SalesReturnResponse' type: object - summary: 鑾峰彇閿�鍞��璐у垪琛� + summary: 閿�鍞��璐у崟鍒楄〃 tags: - SalesReturn /api/salesReturn/update: @@ -7186,7 +7583,14 @@ tags: - ServiceContract /api/serviceContract/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetServiceContractList' produces: - application/json responses: @@ -7199,7 +7603,7 @@ data: $ref: '#/definitions/response.ServiceContractsResponse' type: object - summary: 鏈嶅姟鍚堝悓鍒楄〃 + summary: 鐢熸垚璁″垝鍒楄〃 tags: - ServiceContract /api/serviceContract/update: @@ -7405,7 +7809,14 @@ tags: - ServiceFeeManage /api/serviceFeeManage/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetServiceFeeManageList' produces: - application/json responses: @@ -7478,7 +7889,14 @@ tags: - ServiceFollowup /api/serviceFollowup/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetServiceFollowupList' produces: - application/json responses: @@ -7491,7 +7909,7 @@ data: $ref: '#/definitions/response.ServiceFollowupResponse' type: object - summary: 鏈嶅姟璺熻繘鍒楄〃 + summary: 鍥炶鍗曠鐞嗗垪琛� tags: - ServiceFollowup /api/serviceFollowup/update: @@ -7692,7 +8110,14 @@ tags: - SubOrder /api/subOrder/list: - get: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetSubOrderList' produces: - application/json responses: @@ -7705,7 +8130,7 @@ data: $ref: '#/definitions/response.SubOrderResponse' type: object - summary: 鑾峰彇瀛愯鍗曞垪琛� + summary: 閿�鍞瓙鍗曞垪琛� tags: - SubOrder /api/subOrder/update: diff --git a/model/client.go b/model/client.go index c764ea9..d58a5c8 100644 --- a/model/client.go +++ b/model/client.go @@ -34,7 +34,12 @@ ClientSearch struct { Client - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -54,6 +59,9 @@ func (slf *ClientSearch) build() *gorm.DB { var db = slf.Orm.Model(&Client{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db.Where("id = ?", slf.Id) } @@ -101,14 +109,41 @@ return record, err } -func (slf *ClientSearch) Find() ([]*Client, error) { +func (slf *ClientSearch) Find() ([]*Client, int64, error) { var db = slf.build() var records = make([]*Client, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("ClientStatus").Preload("ClientType").Preload("ClientOrigin").Preload("ClientLevel").Preload("FollowRecord").Preload("EnterpriseNature").Preload("RegisteredCapital").Preload("Industry").Preload("EnterpriseScale").Preload("Contacts").Preload("Country").Preload("Province").Preload("City").Preload("Region").Find(&records).Error - return records, err + return records, total, err } func (slf *ClientSearch) UpdateByMap(data map[string]interface{}) error { var db = slf.build() return db.Updates(data).Error } + +func (slf *ClientSearch) SetKeyword(keyword string) *ClientSearch { + slf.Keyword = keyword + return slf +} + +func (slf *ClientSearch) SetPage(page, size int) *ClientSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *ClientSearch) SetOrder(order string) *ClientSearch { + slf.OrderBy = order + return slf +} +func (slf *ClientSearch) SetIds(ids []int) *ClientSearch { + slf.Orm = slf.Orm.Where("id in (?)", ids) + return slf +} diff --git a/model/contacts.go b/model/contact.go similarity index 81% rename from model/contacts.go rename to model/contact.go index 98d7805..3fc6048 100644 --- a/model/contacts.go +++ b/model/contact.go @@ -26,7 +26,12 @@ ContactSearch struct { Contact - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ContactDetail struct { @@ -51,6 +56,9 @@ func (slf *ContactSearch) build() *gorm.DB { var db = slf.Orm.Model(&Contact{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -104,11 +112,20 @@ return record, err } -func (slf *ContactSearch) FindAll() ([]*ContactDetail, error) { +func (slf *ContactSearch) FindAll() ([]*ContactDetail, int64, error) { var db = slf.build() var records = make([]*ContactDetail, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("FollowRecord").Preload("Client").Preload("Country").Preload("Province").Preload("City").Preload("Region").Find(&records).Error - return records, err + return records, total, err } func (slf *ContactSearch) SetId(id int) *ContactSearch { @@ -137,3 +154,18 @@ var db = slf.build() return db.Updates(data).Error } + +func (slf *ContactSearch) SetKeyword(keyword string) *ContactSearch { + slf.Keyword = keyword + return slf +} + +func (slf *ContactSearch) SetPage(page, size int) *ContactSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *ContactSearch) SetOrder(order string) *ContactSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/contract.go b/model/contract.go index 31b639b..024cf8b 100644 --- a/model/contract.go +++ b/model/contract.go @@ -20,7 +20,13 @@ ContractSearch struct { Contract - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -36,6 +42,9 @@ func (slf *ContractSearch) build() *gorm.DB { var db = slf.Orm.Model(&Contract{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -65,14 +74,41 @@ return record, err } -func (slf *ContractSearch) FindAll() ([]*Contract, error) { +func (slf *ContractSearch) FindAll() ([]*Contract, int64, error) { var db = slf.build() var records = make([]*Contract, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("Quotation").Find(&records).Error - return records, err + return records, total, err } func (slf *ContractSearch) SetId(id int) *ContractSearch { slf.Id = id return slf } + +func (slf *ContractSearch) SetKeyword(keyword string) *ContractSearch { + slf.Keyword = keyword + return slf +} + +func (slf *ContractSearch) SetPage(page, size int) *ContractSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *ContractSearch) SetOrder(order string) *ContractSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/followRecord.go b/model/followRecord.go index 29123cd..5a2ab82 100644 --- a/model/followRecord.go +++ b/model/followRecord.go @@ -30,7 +30,12 @@ FollowRecordSearch struct { FollowRecord - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -46,6 +51,12 @@ func (slf *FollowRecordSearch) build() *gorm.DB { var db = slf.Orm.Model(&FollowRecord{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } + if slf.Keyword != "" { + db = db.Where("topic LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -101,10 +112,19 @@ return record, err } -func (slf *FollowRecordSearch) Find() ([]*FollowRecord, error) { +func (slf *FollowRecordSearch) FindAll() ([]*FollowRecord, int64, error) { + var db = slf.build() var records = make([]*FollowRecord, 0) - err := slf.build().Preload("Client").Preload("Contact").Find(&records).Error - return records, err + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("Client").Preload("Contact").Find(&records).Error + return records, total, err } func (slf *FollowRecordSearch) Count() (int64, error) { @@ -148,3 +168,18 @@ slf.ClientId = clientId return slf } + +func (slf *FollowRecordSearch) SetKeyword(keyword string) *FollowRecordSearch { + slf.Keyword = keyword + return slf +} + +func (slf *FollowRecordSearch) SetPage(page, size int) *FollowRecordSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *FollowRecordSearch) SetOrder(order string) *FollowRecordSearch { + slf.OrderBy = order + return slf +} diff --git a/model/masterOrder.go b/model/masterOrder.go index 6d52417..71f053e 100644 --- a/model/masterOrder.go +++ b/model/masterOrder.go @@ -23,7 +23,13 @@ // MasterOrderSearch 閿�鍞�诲崟鎼滅储鏉′欢 MasterOrderSearch struct { MasterOrder - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -39,6 +45,9 @@ func (slf *MasterOrderSearch) build() *gorm.DB { var db = slf.Orm.Model(&MasterOrder{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -68,14 +77,41 @@ return record, err } -func (slf *MasterOrderSearch) FindAll() ([]*MasterOrder, error) { +func (slf *MasterOrderSearch) FindAll() ([]*MasterOrder, int64, error) { var db = slf.build() var records = make([]*MasterOrder, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("Client").Find(&records).Error - return records, err + return records, total, err } func (slf *MasterOrderSearch) SetId(id int) *MasterOrderSearch { slf.Id = id return slf } + +func (slf *MasterOrderSearch) SetKeyword(keyword string) *MasterOrderSearch { + slf.Keyword = keyword + return slf +} + +func (slf *MasterOrderSearch) SetPage(page, size int) *MasterOrderSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *MasterOrderSearch) SetOrder(order string) *MasterOrderSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/orderManage.go b/model/orderManage.go index 3bb6f81..2712759 100644 --- a/model/orderManage.go +++ b/model/orderManage.go @@ -23,7 +23,12 @@ OrderManageSearch struct { OrderManage - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -39,6 +44,9 @@ func (slf *OrderManageSearch) build() *gorm.DB { var db = slf.Orm.Model(&OrderManage{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -68,14 +76,37 @@ return record, err } -func (slf *OrderManageSearch) FindAll() ([]*OrderManage, error) { +func (slf *OrderManageSearch) FindAll() ([]*OrderManage, int64, error) { var db = slf.build() - var record = make([]*OrderManage, 0) - err := db.Preload("Client").Find(&record).Error - return record, err + var records = make([]*OrderManage, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("Client").Find(&records).Error + return records, total, err } func (slf *OrderManageSearch) SetId(id int) *OrderManageSearch { slf.Id = id return slf } + +func (slf *OrderManageSearch) SetKeyword(keyword string) *OrderManageSearch { + slf.Keyword = keyword + return slf +} + +func (slf *OrderManageSearch) SetPage(page, size int) *OrderManageSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *OrderManageSearch) SetOrder(order string) *OrderManageSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/plan.go b/model/plan.go index d6d0ae5..a8ccdda 100644 --- a/model/plan.go +++ b/model/plan.go @@ -25,7 +25,12 @@ PlanSearch struct { Plan - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -41,6 +46,9 @@ func (slf *PlanSearch) build() *gorm.DB { var db = slf.Orm.Model(&Plan{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -70,14 +78,37 @@ return record, err } -func (slf *PlanSearch) FindAll() ([]*Plan, error) { +func (slf *PlanSearch) FindAll() ([]*Plan, int64, error) { var db = slf.build() - var record = make([]*Plan, 0) - err := db.Find(&record).Error - return record, err + var records = make([]*Plan, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Find(&records).Error + return records, total, err } func (slf *PlanSearch) SetId(id int) *PlanSearch { slf.Id = id return slf } + +func (slf *PlanSearch) SetKeyword(keyword string) *PlanSearch { + slf.Keyword = keyword + return slf +} + +func (slf *PlanSearch) SetPage(page, size int) *PlanSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *PlanSearch) SetOrder(order string) *PlanSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/quotation.go b/model/quotation.go index 878f211..2999797 100644 --- a/model/quotation.go +++ b/model/quotation.go @@ -28,7 +28,13 @@ // QuotationSearch 鎶ヤ环鍗曟悳绱㈡潯浠� QuotationSearch struct { Quotation - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -44,6 +50,9 @@ func (slf *QuotationSearch) build() *gorm.DB { var db = slf.Orm.Model(&Quotation{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -73,11 +82,19 @@ return &record, err } -func (slf *QuotationSearch) FindAll() ([]*Quotation, error) { +func (slf *QuotationSearch) FindAll() ([]*Quotation, int64, error) { var db = slf.build() - var records []*Quotation + var records = make([]*Quotation, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Find(&records).Error - return records, err + return records, total, err } func (slf *QuotationSearch) SetId(id int) *QuotationSearch { @@ -89,3 +106,18 @@ var db = slf.build() return db.Updates(data).Error } + +func (slf *QuotationSearch) SetKeyword(keyword string) *QuotationSearch { + slf.Keyword = keyword + return slf +} + +func (slf *QuotationSearch) SetPage(page, size int) *QuotationSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *QuotationSearch) SetOrder(order string) *QuotationSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/request/assign.go b/model/request/assign.go new file mode 100644 index 0000000..d0b8413 --- /dev/null +++ b/model/request/assign.go @@ -0,0 +1,7 @@ +package request + +type Assign struct { + MemberId int `json:"member_id"` + Type string `json:"type"` + Id int `json:"id"` +} diff --git a/model/request/client.go b/model/request/client.go index 7e547f5..527f503 100644 --- a/model/request/client.go +++ b/model/request/client.go @@ -26,3 +26,12 @@ Id int `json:"id"` Client } + +type GetClientList struct { + PageInfo + Keyword string `json:"keyword"` +} + +type DeleteClient struct { + Ids []int `json:"ids"` +} diff --git a/model/request/contact.go b/model/request/contact.go index 5b16b31..1c39699 100644 --- a/model/request/contact.go +++ b/model/request/contact.go @@ -26,3 +26,8 @@ Id int `json:"id"` Contact } + +type GetContactList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/contract.go b/model/request/contract.go index ce085ce..f86a93b 100644 --- a/model/request/contract.go +++ b/model/request/contract.go @@ -17,3 +17,8 @@ Id int `json:"id"` Contract } + +type GetContractList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/followRecord.go b/model/request/followRecord.go index 2ddffad..fb0d790 100644 --- a/model/request/followRecord.go +++ b/model/request/followRecord.go @@ -25,3 +25,8 @@ Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` FollowRecord FollowRecord `json:"follow_record" binding:"required"` } + +type GetFollowRecordList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/masterOrder.go b/model/request/masterOrder.go index 349aee0..8ad935e 100644 --- a/model/request/masterOrder.go +++ b/model/request/masterOrder.go @@ -17,3 +17,8 @@ Id int `json:"id"` MasterOrder } + +type GetMasterOrderList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/orderManage.go b/model/request/orderManage.go index 2a468a2..614db86 100644 --- a/model/request/orderManage.go +++ b/model/request/orderManage.go @@ -20,3 +20,8 @@ Id int `json:"id"` OrderManage } + +type GetOrderManageList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/plan.go b/model/request/plan.go index f262cec..706f8c2 100644 --- a/model/request/plan.go +++ b/model/request/plan.go @@ -20,3 +20,8 @@ Id int `json:"id"` Plan Plan `json:"plan"` } + +type GetPlanList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/quotation.go b/model/request/quotation.go index 91654de..8ee6098 100644 --- a/model/request/quotation.go +++ b/model/request/quotation.go @@ -20,3 +20,8 @@ Id int `json:"id"` Quotation } + +type GetQuotationList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/saleChance.go b/model/request/saleChance.go index bc19c29..7d5c4f1 100644 --- a/model/request/saleChance.go +++ b/model/request/saleChance.go @@ -41,3 +41,8 @@ Id int `json:"id" binding:"required"` SaleChance } + +type GetSaleChanceList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/saleDetails.go b/model/request/salesDetails.go similarity index 96% rename from model/request/saleDetails.go rename to model/request/salesDetails.go index c70d201..f5b1975 100644 --- a/model/request/saleDetails.go +++ b/model/request/salesDetails.go @@ -32,3 +32,8 @@ Id int `json:"id"` SalesDetails SalesDetails `json:"salesDetails"` } + +type GetSalesDetailsList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/salesLeads.go b/model/request/salesLeads.go index 88cae6b..578feb7 100644 --- a/model/request/salesLeads.go +++ b/model/request/salesLeads.go @@ -20,3 +20,8 @@ Id int `json:"id"` SalesLeads } + +type GetSalesLeadsList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/salesRefund.go b/model/request/salesRefund.go index 3fb49bc..04b792b 100644 --- a/model/request/salesRefund.go +++ b/model/request/salesRefund.go @@ -22,3 +22,8 @@ Id int `json:"id"` SalesRefund SalesRefund `json:"salesRefund"` } + +type GetSalesRefundList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/salesReturn.go b/model/request/salesReturn.go index 65ad7d4..a31794c 100644 --- a/model/request/salesReturn.go +++ b/model/request/salesReturn.go @@ -21,3 +21,8 @@ Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` SalesReturn SalesReturn } + +type GetSalesReturnList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/serviceContracts.go b/model/request/serviceContract.go similarity index 91% rename from model/request/serviceContracts.go rename to model/request/serviceContract.go index 2334df5..40b6049 100644 --- a/model/request/serviceContracts.go +++ b/model/request/serviceContract.go @@ -31,3 +31,8 @@ Id int `json:"id"` ServiceContract } + +type GetServiceContractList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/serviceFeeManage.go b/model/request/serviceFeeManage.go index b525ae9..d5713b5 100644 --- a/model/request/serviceFeeManage.go +++ b/model/request/serviceFeeManage.go @@ -17,3 +17,8 @@ Client ServiceFeeManage } + +type GetServiceFeeManageList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/serviceFollowup.go b/model/request/serviceFollowup.go index 9ae6706..a13fa6c 100644 --- a/model/request/serviceFollowup.go +++ b/model/request/serviceFollowup.go @@ -24,3 +24,8 @@ Id int `json:"id"` ServiceFollowup } + +type GetServiceFollowupList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/request/subOrder.go b/model/request/subOrder.go index 14d854b..a9e894c 100644 --- a/model/request/subOrder.go +++ b/model/request/subOrder.go @@ -18,3 +18,8 @@ Id int `json:"id"` SubOrder } + +type GetSubOrderList struct { + PageInfo + Keyword string `json:"keyword"` +} diff --git a/model/response/response.go b/model/response/response.go index 04ea37d..46774ab 100644 --- a/model/response/response.go +++ b/model/response/response.go @@ -47,11 +47,13 @@ } ContactResponse struct { - List []*model.ContactDetail `json:"list"` + List []*model.ContactDetail `json:"list"` + Count int `json:"count"` } ClientResponse struct { - List []*model.Client `json:"list"` + List []*model.Client `json:"list"` + Count int `json:"count"` } ClientStatusResponse struct { @@ -87,7 +89,8 @@ } SalesLeadsResponse struct { - List []*model.SalesLeads `json:"list"` + List []*model.SalesLeads `json:"list"` + Count int `json:"count"` } SalesSourceResponse struct { @@ -95,11 +98,13 @@ } FollowRecordResponse struct { - List []*model.FollowRecord `json:"list"` + List []*model.FollowRecord `json:"list"` + Count int `json:"count"` } SaleChanceResponse struct { - List []*model.SaleChance `json:"list"` + List []*model.SaleChance `json:"list"` + Count int `json:"count"` } SaleStageResponse struct { @@ -123,47 +128,58 @@ } QuotationResponse struct { - List []*model.Quotation `json:"list"` + List []*model.Quotation `json:"list"` + Count int `json:"count"` } MasterOrderResponse struct { - List []*model.MasterOrder `json:"list"` + List []*model.MasterOrder `json:"list"` + Count int `json:"count"` } SubOrderResponse struct { - List []*model.SubOrder `json:"list"` + List []*model.SubOrder `json:"list"` + Count int `json:"count"` } SalesDetailsResponse struct { - List []*model.SalesDetails `json:"list"` + List []*model.SalesDetails `json:"list"` + Count int `json:"count"` } SalesReturnResponse struct { - List []*model.SalesReturn `json:"list"` + List []*model.SalesReturn `json:"list"` + Count int `json:"count"` } SalesRefundResponse struct { - List []*model.SalesRefund `json:"list"` + List []*model.SalesRefund `json:"list"` + Count int `json:"count"` } ContractResponse struct { - List []*model.Contract `json:"list"` + List []*model.Contract `json:"list"` + Count int `json:"count"` } PlanResponse struct { - List []*model.Plan `json:"list"` + List []*model.Plan `json:"list"` + Count int `json:"count"` } ServiceContractsResponse struct { - List []*model.ServiceContract `json:"list"` + List []*model.ServiceContract `json:"list"` + Count int `json:"count"` } OrderManageResponse struct { - List []*model.OrderManage `json:"list"` + List []*model.OrderManage `json:"list"` + Count int `json:"count"` } ServiceFollowupResponse struct { - List []*model.ServiceFollowup `json:"list"` + List []*model.ServiceFollowup `json:"list"` + Count int `json:"count"` } CustomerServiceSheetResponse struct { @@ -171,7 +187,8 @@ } ServiceFeeManageResponse struct { - List []*model.ServiceFeeManage `json:"list"` + List []*model.ServiceFeeManage `json:"list"` + Count int `json:"count"` } MenuTreeResponse struct { @@ -182,7 +199,6 @@ // 甯佺 Currency []*model.Currency `json:"currency"` - // 鎶ヤ环鍗曠姸鎬� QuotationStatus []*model.QuotationStatus `json:"quotationStatus"` @@ -328,4 +344,4 @@ CurrencyResponse struct { List []*model.Currency `json:"list"` } -) \ No newline at end of file +) diff --git a/model/saleChance.go b/model/saleChance.go index fdfb54b..320cafb 100644 --- a/model/saleChance.go +++ b/model/saleChance.go @@ -45,9 +45,14 @@ gorm.Model `json:"-"` } - SaleChangeSearch struct { + SaleChanceSearch struct { SaleChance - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -55,12 +60,15 @@ return "sale_chance" } -func NewSaleChangeSearch() *SaleChangeSearch { - return &SaleChangeSearch{Orm: mysqlx.GetDB()} +func NewSaleChanceSearch() *SaleChanceSearch { + return &SaleChanceSearch{Orm: mysqlx.GetDB()} } -func (slf *SaleChangeSearch) build() *gorm.DB { +func (slf *SaleChanceSearch) build() *gorm.DB { var db = slf.Orm.Model(&SaleChance{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id > 0 { db = db.Where("id = ?", slf.Id) } @@ -71,42 +79,66 @@ return db } -func (slf *SaleChangeSearch) Create(record *SaleChance) (err error) { +func (slf *SaleChanceSearch) Create(record *SaleChance) (err error) { var db = slf.build() err = db.Create(record).Error return } -func (slf *SaleChangeSearch) Update(record *SaleChance) (err error) { +func (slf *SaleChanceSearch) Update(record *SaleChance) (err error) { var db = slf.build() err = db.Updates(record).Error return } -func (slf *SaleChangeSearch) Delete() (err error) { +func (slf *SaleChanceSearch) Delete() (err error) { var db = slf.build() err = db.Delete(&SaleChance{}).Error return } -func (slf *SaleChangeSearch) Find() (record SaleChance, err error) { +func (slf *SaleChanceSearch) Find() (record SaleChance, err error) { var db = slf.build() err = db.First(&record).Error return } -func (slf *SaleChangeSearch) FindAll() (record []*SaleChance, err error) { +func (slf *SaleChanceSearch) FindAll() ([]*SaleChance, int64, error) { var db = slf.build() - err = db.Preload("Client").Preload("Contact").Find(&record).Error - return + var records = make([]*SaleChance, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("Client").Preload("Contact").Find(&records).Error + return records, total, err } -func (slf *SaleChangeSearch) SetId(id int) *SaleChangeSearch { +func (slf *SaleChanceSearch) SetId(id int) *SaleChanceSearch { slf.Id = id return slf } -func (slf *SaleChangeSearch) SetName(name string) *SaleChangeSearch { +func (slf *SaleChanceSearch) SetName(name string) *SaleChanceSearch { slf.Name = name return slf } + +func (slf *SaleChanceSearch) SetKeyword(keyword string) *SaleChanceSearch { + slf.Keyword = keyword + return slf +} + +func (slf *SaleChanceSearch) SetPage(page, size int) *SaleChanceSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *SaleChanceSearch) SetOrder(order string) *SaleChanceSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/salesDetails.go b/model/salesDetails.go index 8755d28..dbcaa26 100644 --- a/model/salesDetails.go +++ b/model/salesDetails.go @@ -32,7 +32,13 @@ SalesDetailsSearch struct { SalesDetails - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -48,6 +54,9 @@ func (slf *SalesDetailsSearch) build() *gorm.DB { var db = slf.Orm.Model(&SalesDetails{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -82,9 +91,36 @@ return record, err } -func (slf *SalesDetailsSearch) FindAll() ([]*SalesDetails, error) { +func (slf *SalesDetailsSearch) FindAll() ([]*SalesDetails, int64, error) { var db = slf.build() var records = make([]*SalesDetails, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("Products").Preload("Client").Find(&records).Error - return records, err + return records, total, err } + +func (slf *SalesDetailsSearch) SetKeyword(keyword string) *SalesDetailsSearch { + slf.Keyword = keyword + return slf +} + +func (slf *SalesDetailsSearch) SetPage(page, size int) *SalesDetailsSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *SalesDetailsSearch) SetOrder(order string) *SalesDetailsSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/salesLeads.go b/model/salesLeads.go index 8ff718f..796e15e 100644 --- a/model/salesLeads.go +++ b/model/salesLeads.go @@ -25,7 +25,12 @@ SalesLeadsSearch struct { SalesLeads - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -41,6 +46,12 @@ func (slf *SalesLeadsSearch) build() *gorm.DB { var db = slf.Orm.Model(&SalesLeads{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -102,10 +113,19 @@ return } -func (slf *SalesLeadsSearch) FindAll() (result []*SalesLeads, err error) { +func (slf *SalesLeadsSearch) FindAll() ([]*SalesLeads, int64, error) { var db = slf.build() - err = db.Preload("FollowRecord").Find(&result).Error - return + var records = make([]*SalesLeads, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("FollowRecord").Find(&records).Error + return records, total, err } func (slf *SalesLeadsSearch) SetId(id int) *SalesLeadsSearch { @@ -123,3 +143,23 @@ err = db.First(&result).Error return } + +func (slf *SalesLeadsSearch) SetKeyword(keyword string) *SalesLeadsSearch { + slf.Keyword = keyword + return slf +} + +func (slf *SalesLeadsSearch) SetPage(page, size int) *SalesLeadsSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *SalesLeadsSearch) SetOrder(order string) *SalesLeadsSearch { + slf.OrderBy = order + return slf +} + +func (slf *SalesLeadsSearch) UpdateMap(data map[string]interface{}) error { + var db = slf.build() + return db.Updates(data).Error +} diff --git a/model/salesRefund.go b/model/salesRefund.go index 8cf92ad..e34be5b 100644 --- a/model/salesRefund.go +++ b/model/salesRefund.go @@ -23,7 +23,13 @@ SalesRefundSearch struct { SalesRefund - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -39,6 +45,9 @@ func (slf *SalesRefundSearch) build() *gorm.DB { var db = slf.Orm.Model(&SalesRefund{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -68,14 +77,41 @@ return record, err } -func (slf *SalesRefundSearch) FindAll() ([]*SalesRefund, error) { +func (slf *SalesRefundSearch) FindAll() ([]*SalesRefund, int64, error) { var db = slf.build() var records = make([]*SalesRefund, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("Products").Find(&records).Error - return records, err + return records, total, err } func (slf *SalesRefundSearch) SetId(id int) *SalesRefundSearch { slf.Id = id return slf } + +func (slf *SalesRefundSearch) SetKeyword(keyword string) *SalesRefundSearch { + slf.Keyword = keyword + return slf +} + +func (slf *SalesRefundSearch) SetPage(page, size int) *SalesRefundSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *SalesRefundSearch) SetOrder(order string) *SalesRefundSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/salesReturn.go b/model/salesReturn.go index 074cbe1..94e1232 100644 --- a/model/salesReturn.go +++ b/model/salesReturn.go @@ -21,7 +21,12 @@ SalesReturnSearch struct { SalesReturn - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -37,6 +42,9 @@ func (slf *SalesReturnSearch) build() *gorm.DB { var db = slf.Orm.Model(&SalesReturn{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -66,14 +74,37 @@ return record, err } -func (slf *SalesReturnSearch) FindAll() ([]*SalesReturn, error) { +func (slf *SalesReturnSearch) FindAll() ([]*SalesReturn, int64, error) { var db = slf.build() - var record = make([]*SalesReturn, 0) - err := db.Preload("Products").Find(&record).Error - return record, err + var records = make([]*SalesReturn, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("Products").Find(&records).Error + return records, total, err } func (slf *SalesReturnSearch) SetId(id int) *SalesReturnSearch { slf.Id = id return slf } + +func (slf *SalesReturnSearch) SetKeyword(keyword string) *SalesReturnSearch { + slf.Keyword = keyword + return slf +} + +func (slf *SalesReturnSearch) SetPage(page, size int) *SalesReturnSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *SalesReturnSearch) SetOrder(order string) *SalesReturnSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/serviceContracts.go b/model/serviceContract.go similarity index 76% rename from model/serviceContracts.go rename to model/serviceContract.go index b2930ad..fd9dbb0 100644 --- a/model/serviceContracts.go +++ b/model/serviceContract.go @@ -30,7 +30,12 @@ ServiceContractSearch struct { ServiceContract - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -46,6 +51,12 @@ func (slf *ServiceContractSearch) build() *gorm.DB { var db = slf.Orm.Model(&ServiceContract{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -75,14 +86,41 @@ return record, err } -func (slf *ServiceContractSearch) FindAll() ([]*ServiceContract, error) { +func (slf *ServiceContractSearch) FindAll() ([]*ServiceContract, int64, error) { var db = slf.build() var records = make([]*ServiceContract, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("Products").Find(&records).Error - return records, err + return records, total, err } func (slf *ServiceContractSearch) SetId(id int) *ServiceContractSearch { slf.Id = id return slf } + +func (slf *ServiceContractSearch) SetKeyword(keyword string) *ServiceContractSearch { + slf.Keyword = keyword + return slf +} + +func (slf *ServiceContractSearch) SetPage(page, size int) *ServiceContractSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *ServiceContractSearch) SetOrder(order string) *ServiceContractSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/serviceFeeManage.go b/model/serviceFeeManage.go index 6db6e76..16b6ab4 100644 --- a/model/serviceFeeManage.go +++ b/model/serviceFeeManage.go @@ -20,7 +20,13 @@ ServiceFeeManageSearch struct { ServiceFeeManage - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -40,6 +46,9 @@ func (slf *ServiceFeeManageSearch) build() *gorm.DB { var db = slf.Orm.Model(&ServiceFeeManage{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db.Where("id = ?", slf.Id) } @@ -77,9 +86,36 @@ return record, err } -func (slf *ServiceFeeManageSearch) FindAll() ([]*ServiceFeeManage, error) { +func (slf *ServiceFeeManageSearch) FindAll() ([]*ServiceFeeManage, int64, error) { var db = slf.build() var records = make([]*ServiceFeeManage, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("Client").Find(&records).Error - return records, err + return records, total, err } + +func (slf *ServiceFeeManageSearch) SetKeyword(keyword string) *ServiceFeeManageSearch { + slf.Keyword = keyword + return slf +} + +func (slf *ServiceFeeManageSearch) SetPage(page, size int) *ServiceFeeManageSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *ServiceFeeManageSearch) SetOrder(order string) *ServiceFeeManageSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/serviceFollowup.go b/model/serviceFollowup.go index 6f8f179..c6baa40 100644 --- a/model/serviceFollowup.go +++ b/model/serviceFollowup.go @@ -28,7 +28,13 @@ ServiceFollowupSearch struct { ServiceFollowup - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int + } ) @@ -44,6 +50,9 @@ func (slf *ServiceFollowupSearch) build() *gorm.DB { var db = slf.Orm.Model(&ServiceFollowup{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -73,11 +82,23 @@ return record, err } -func (slf *ServiceFollowupSearch) FindAll() ([]*ServiceFollowup, error) { +func (slf *ServiceFollowupSearch) FindAll() ([]*ServiceFollowup, int64, error) { var db = slf.build() var records = make([]*ServiceFollowup, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + err := db.Preload("CustomerServiceSheet").Find(&records).Error - return records, err + return records, total, err } func (slf *ServiceFollowupSearch) SetId(id int) *ServiceFollowupSearch { @@ -86,3 +107,18 @@ } // 鍙兘鎬� 甯佺 褰撳墠鐘舵�侊紙閿�鍞満浼氾級 + +func (slf *ServiceFollowupSearch) SetKeyword(keyword string) *ServiceFollowupSearch { + slf.Keyword = keyword + return slf +} + +func (slf *ServiceFollowupSearch) SetPage(page, size int) *ServiceFollowupSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *ServiceFollowupSearch) SetOrder(order string) *ServiceFollowupSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/subOrder.go b/model/subOrder.go index 60eb98c..42bb6eb 100644 --- a/model/subOrder.go +++ b/model/subOrder.go @@ -19,7 +19,12 @@ SubOrderSearch struct { SubOrder - Orm *gorm.DB + + Orm *gorm.DB + Keyword string + OrderBy string + PageNum int + PageSize int } ) @@ -35,6 +40,9 @@ func (slf *SubOrderSearch) build() *gorm.DB { var db = slf.Orm.Model(&SubOrder{}) + if slf.Keyword != "" { + db = db.Where("name LIKE ?", "%"+slf.Keyword+"%") + } if slf.Id != 0 { db = db.Where("id = ?", slf.Id) } @@ -63,13 +71,37 @@ return } -func (slf *SubOrderSearch) FindAll() (result []*SubOrder, err error) { +func (slf *SubOrderSearch) FindAll() ([]*SubOrder, int64, error) { var db = slf.build() - err = db.Preload("Products").Preload("Client").Find(&result).Error - return + var records = make([]*SubOrder, 0) + var total int64 + if err := db.Count(&total).Error; err != nil { + return records, total, err + } + if slf.PageNum > 0 && slf.PageSize > 0 { + db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) + } + + err := db.Preload("Products").Preload("Client").Find(&records).Error + return records, total, err } func (slf *SubOrderSearch) SetId(id int) *SubOrderSearch { slf.Id = id return slf } + +func (slf *SubOrderSearch) SetKeyword(keyword string) *SubOrderSearch { + slf.Keyword = keyword + return slf +} + +func (slf *SubOrderSearch) SetPage(page, size int) *SubOrderSearch { + slf.PageNum, slf.PageSize = page, size + return slf +} + +func (slf *SubOrderSearch) SetOrder(order string) *SubOrderSearch { + slf.OrderBy = order + return slf +} \ No newline at end of file diff --git a/model/user.go b/model/user.go index f0d074d..69fc4fa 100644 --- a/model/user.go +++ b/model/user.go @@ -70,6 +70,11 @@ return slf } +func (slf *UserSearch) SetUserId(userId int) *UserSearch { + slf.ID = userId + return slf +} + func (slf *UserSearch) SetUserName(username string) *UserSearch { slf.Username = username return slf diff --git a/pkg/ecode/code.go b/pkg/ecode/code.go index e2462f4..0837cb4 100644 --- a/pkg/ecode/code.go +++ b/pkg/ecode/code.go @@ -137,12 +137,12 @@ FollowRecordUpdateErr = 1800005 // 鏇存柊璺熻繘璁板綍澶辫触 FollowRecordDeleteErr = 1800006 // 鍒犻櫎璺熻繘璁板綍澶辫触 - SaleChangeExist = 1900001 // 閿�鍞満浼氬凡瀛樺湪 - SaleChangeNotExist = 1900002 // 閿�鍞満浼氫笉瀛樺湪 - SaleChangeListErr = 1900003 // 鑾峰彇閿�鍞満浼氬垪琛ㄥけ璐� - SaleChangeSetErr = 1900004 // 璁剧疆閿�鍞満浼氬け璐� - SaleChangeUpdateErr = 1900005 // 鏇存柊閿�鍞満浼氬け璐� - SaleChangeDeleteErr = 1900006 // 鍒犻櫎閿�鍞満浼氬け璐� + SaleChanceExist = 1900001 // 閿�鍞満浼氬凡瀛樺湪 + SaleChanceNotExist = 1900002 // 閿�鍞満浼氫笉瀛樺湪 + SaleChanceListErr = 1900003 // 鑾峰彇閿�鍞満浼氬垪琛ㄥけ璐� + SaleChanceSetErr = 1900004 // 璁剧疆閿�鍞満浼氬け璐� + SaleChanceUpdateErr = 1900005 // 鏇存柊閿�鍞満浼氬け璐� + SaleChanceDeleteErr = 1900006 // 鍒犻櫎閿�鍞満浼氬け璐� SaleStageExist = 2000001 // 閿�鍞樁娈靛凡瀛樺湪 SaleStageNotExist = 2000002 // 閿�鍞樁娈典笉瀛樺湪 @@ -383,4 +383,9 @@ CurrencySetErr = 5600004 // 璁剧疆甯佺澶辫触 CurrencyUpdateErr = 5600005 // 鏇存柊甯佺澶辫触 + AssignErr = 5700001 // 鍒嗛厤澶辫触 + AssignWrongMemberId = 5700002 // 鍒嗛厤澶辫触锛屽垎閰嶄汉涓虹┖ + AssignWrongId = 5700003 // 鍒嗛厤澶辫触锛屽垎閰嶅璞′负绌� + AssignWrongModelType = 5700004 // 鍒嗛厤澶辫触锛屽垎閰嶅璞$被鍨嬩负绌� + ) diff --git a/router/assign.go b/router/assign.go new file mode 100644 index 0000000..ea395ce --- /dev/null +++ b/router/assign.go @@ -0,0 +1,16 @@ +package router + +import ( + v1 "aps_crm/api/v1" + "github.com/gin-gonic/gin" +) + +type AssignRouter struct{} + +func (a *AssignRouter) InitAssignRouter(router *gin.RouterGroup) { + assignRouter := router.Group("assign") + assignApi := v1.ApiGroup.AssignApi + { + assignRouter.POST("assign", assignApi.Assign) // 鍒嗛厤 + } +} diff --git a/router/client.go b/router/client.go index 7111685..3563b8d 100644 --- a/router/client.go +++ b/router/client.go @@ -12,8 +12,8 @@ clientApi := v1.ApiGroup.ClientApi { clientRouter.POST("add", clientApi.Add) // 娣诲姞瀹㈡埛 - clientRouter.DELETE("delete/:id", clientApi.Delete) // 鍒犻櫎瀹㈡埛 + clientRouter.DELETE("delete", clientApi.Delete) // 鍒犻櫎瀹㈡埛 clientRouter.PUT("update", clientApi.Update) // 鏇存柊瀹㈡埛 - clientRouter.GET("list", clientApi.List) // 鑾峰彇瀹㈡埛鍒楄〃 + clientRouter.POST("list", clientApi.List) // 鑾峰彇瀹㈡埛鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/contact.go b/router/contact.go index 89cb965..dcca60c 100644 --- a/router/contact.go +++ b/router/contact.go @@ -14,6 +14,6 @@ contactRouter.POST("add", contactApi.Add) // 娣诲姞鑱旂郴浜� contactRouter.DELETE("delete/:id", contactApi.Delete) // 鍒犻櫎鑱旂郴浜� contactRouter.PUT("update", contactApi.Update) // 鏇存柊鑱旂郴浜� - contactRouter.GET("list", contactApi.List) // 鑾峰彇鑱旂郴浜哄垪琛� + contactRouter.POST("list", contactApi.List) // 鑾峰彇鑱旂郴浜哄垪琛� } -} +} \ No newline at end of file diff --git a/router/contract.go b/router/contract.go index d83f1e1..01cbcb8 100644 --- a/router/contract.go +++ b/router/contract.go @@ -14,6 +14,6 @@ contractRouter.POST("add", contractApi.Add) // 娣诲姞鍚堝悓 contractRouter.DELETE("delete/:id", contractApi.Delete) // 鍒犻櫎鍚堝悓 contractRouter.PUT("update", contractApi.Update) // 鏇存柊鍚堝悓 - contractRouter.GET("list", contractApi.List) // 鑾峰彇鍚堝悓鍒楄〃 + contractRouter.POST("list", contractApi.List) // 鑾峰彇閿�鍞悎鍚屽垪琛� } -} +} \ No newline at end of file diff --git a/router/followRecord.go b/router/followRecord.go index a04d06f..0dbe91c 100644 --- a/router/followRecord.go +++ b/router/followRecord.go @@ -14,6 +14,6 @@ followRecordRouter.POST("add", followRecordApi.Add) // 娣诲姞璺熻繘璁板綍 followRecordRouter.DELETE("delete/:id", followRecordApi.Delete) // 鍒犻櫎璺熻繘璁板綍 followRecordRouter.PUT("update", followRecordApi.Update) // 鏇存柊璺熻繘璁板綍 - followRecordRouter.GET("list", followRecordApi.List) // 鑾峰彇璺熻繘璁板綍鍒楄〃 + followRecordRouter.POST("list", followRecordApi.List) // 鑾峰彇璺熻繘璁板綍鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/index.go b/router/index.go index 43f890a..a05ce9f 100644 --- a/router/index.go +++ b/router/index.go @@ -11,17 +11,17 @@ ) type Group struct { - CurrencyRouter - QuotationStatusRouter - RepositoryRouter - SalesReturnStatusRouter - AccountIdRouter - IsInvoiceRouter - RefundMethodRouter - ServiceContractTypeRouter - ServiceContractStatusRouter - OrderTypeRouter - ReportSourceRouter + CurrencyRouter + QuotationStatusRouter + RepositoryRouter + SalesReturnStatusRouter + AccountIdRouter + IsInvoiceRouter + RefundMethodRouter + ServiceContractTypeRouter + ServiceContractStatusRouter + OrderTypeRouter + ReportSourceRouter IsVisitRouter SolveRateRouter TimelyRateRouter @@ -69,6 +69,7 @@ DataRouter DepartmentRouter SatisfactionRouter + AssignRouter } func InitRouter() *gin.Engine { @@ -146,17 +147,18 @@ routerGroup.InitTimelyRateRouter(PrivateGroup) routerGroup.InitSolveRateRouter(PrivateGroup) routerGroup.InitIsVisitRouter(PrivateGroup) - routerGroup.InitReportSourceRouter(PrivateGroup) - routerGroup.InitOrderTypeRouter(PrivateGroup) - routerGroup.InitServiceContractStatusRouter(PrivateGroup) - routerGroup.InitServiceContractTypeRouter(PrivateGroup) - routerGroup.InitRefundMethodRouter(PrivateGroup) - routerGroup.InitIsInvoiceRouter(PrivateGroup) - routerGroup.InitAccountIdRouter(PrivateGroup) - routerGroup.InitSalesReturnStatusRouter(PrivateGroup) - routerGroup.InitRepositoryRouter(PrivateGroup) - routerGroup.InitQuotationStatusRouter(PrivateGroup) - routerGroup.InitCurrencyRouter(PrivateGroup) + routerGroup.InitReportSourceRouter(PrivateGroup) + routerGroup.InitOrderTypeRouter(PrivateGroup) + routerGroup.InitServiceContractStatusRouter(PrivateGroup) + routerGroup.InitServiceContractTypeRouter(PrivateGroup) + routerGroup.InitRefundMethodRouter(PrivateGroup) + routerGroup.InitIsInvoiceRouter(PrivateGroup) + routerGroup.InitAccountIdRouter(PrivateGroup) + routerGroup.InitSalesReturnStatusRouter(PrivateGroup) + routerGroup.InitRepositoryRouter(PrivateGroup) + routerGroup.InitQuotationStatusRouter(PrivateGroup) + routerGroup.InitCurrencyRouter(PrivateGroup) + routerGroup.InitAssignRouter(PrivateGroup) } return Router -} \ No newline at end of file +} diff --git a/router/masterOrder.go b/router/masterOrder.go index d3d4cf6..23efb34 100644 --- a/router/masterOrder.go +++ b/router/masterOrder.go @@ -14,6 +14,6 @@ masterOrderRouter.POST("add", masterOrderApi.Add) // 娣诲姞涓昏鍗� masterOrderRouter.DELETE("delete/:id", masterOrderApi.Delete) // 鍒犻櫎涓昏鍗� masterOrderRouter.PUT("update", masterOrderApi.Update) // 鏇存柊涓昏鍗� - masterOrderRouter.GET("list", masterOrderApi.List) // 鑾峰彇涓昏鍗曞垪琛� + masterOrderRouter.POST("list", masterOrderApi.List) // 鑾峰彇閿�鍞�诲崟鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/orderManage.go b/router/orderManage.go index 0774329..64ddd77 100644 --- a/router/orderManage.go +++ b/router/orderManage.go @@ -14,6 +14,6 @@ orderManageRouter.POST("add", orderManageApi.Add) // 娣诲姞璁㈠崟 orderManageRouter.DELETE("delete/:id", orderManageApi.Delete) // 鍒犻櫎璁㈠崟 orderManageRouter.PUT("update", orderManageApi.Update) // 鏇存柊璁㈠崟 - orderManageRouter.GET("list", orderManageApi.List) // 鑾峰彇璁㈠崟鍒楄〃 + orderManageRouter.POST("list", orderManageApi.List) // 鑾峰彇宸ュ崟绠$悊鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/plan.go b/router/plan.go index e0b3923..e53fa2f 100644 --- a/router/plan.go +++ b/router/plan.go @@ -14,6 +14,6 @@ planRouter.POST("add", planApi.Add) // 娣诲姞璁″垝 planRouter.DELETE("delete/:id", planApi.Delete) // 鍒犻櫎璁″垝 planRouter.PUT("update", planApi.Update) // 鏇存柊璁″垝 - planRouter.GET("list", planApi.List) // 鑾峰彇璁″垝鍒楄〃 + planRouter.POST("list", planApi.List) // 鑾峰彇鐢熸垚璁″垝鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/qutation.go b/router/quotation.go similarity index 85% rename from router/qutation.go rename to router/quotation.go index d5fc559..c5672e8 100644 --- a/router/qutation.go +++ b/router/quotation.go @@ -14,6 +14,6 @@ quotationRouter.POST("add", quotationApi.Add) // 娣诲姞鎶ヤ环鍗� quotationRouter.DELETE("delete/:id", quotationApi.Delete) // 鍒犻櫎鎶ヤ环鍗� quotationRouter.PUT("update", quotationApi.Update) // 鏇存柊鎶ヤ环鍗� - quotationRouter.GET("list", quotationApi.List) // 鑾峰彇鎶ヤ环鍗曞垪琛� + quotationRouter.POST("list", quotationApi.List) // 鑾峰彇鎶ヤ环鍗曞垪琛� } -} +} \ No newline at end of file diff --git a/router/saleChance.go b/router/saleChance.go index cf82bcc..5844d07 100644 --- a/router/saleChance.go +++ b/router/saleChance.go @@ -14,6 +14,6 @@ saleChanceRouter.POST("add", saleChanceApi.Add) // 娣诲姞閿�鍞満浼� saleChanceRouter.DELETE("delete/:id", saleChanceApi.Delete) // 鍒犻櫎閿�鍞満浼� saleChanceRouter.PUT("update", saleChanceApi.Update) // 鏇存柊閿�鍞満浼� - saleChanceRouter.GET("list", saleChanceApi.List) // 鑾峰彇閿�鍞満浼氬垪琛� + saleChanceRouter.POST("list", saleChanceApi.List) // 鑾峰彇閿�鍞満浼氬垪琛� } -} +} \ No newline at end of file diff --git a/router/salesDetails.go b/router/salesDetails.go index e892a26..01c4248 100644 --- a/router/salesDetails.go +++ b/router/salesDetails.go @@ -14,6 +14,6 @@ salesDetailsRouter.POST("add", salesDetailsApi.Add) // 娣诲姞閿�鍞槑缁� salesDetailsRouter.DELETE("delete/:id", salesDetailsApi.Delete) // 鍒犻櫎閿�鍞槑缁� salesDetailsRouter.PUT("update", salesDetailsApi.Update) // 鏇存柊閿�鍞槑缁� - salesDetailsRouter.GET("list", salesDetailsApi.List) // 鑾峰彇閿�鍞槑缁嗗垪琛� + salesDetailsRouter.POST("list", salesDetailsApi.List) // 鑾峰彇閿�鍞槑缁嗗崟鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/salesLeads.go b/router/salesLeads.go index 810e5fc..9e810ef 100644 --- a/router/salesLeads.go +++ b/router/salesLeads.go @@ -14,6 +14,6 @@ salesLeadsRouter.POST("add", salesLeadsApi.Add) // 娣诲姞閿�鍞嚎绱� salesLeadsRouter.DELETE("delete/:id", salesLeadsApi.Delete) // 鍒犻櫎閿�鍞嚎绱� salesLeadsRouter.PUT("update", salesLeadsApi.Update) // 鏇存柊閿�鍞嚎绱� - salesLeadsRouter.GET("list", salesLeadsApi.List) // 鑾峰彇閿�鍞嚎绱㈠垪琛� + salesLeadsRouter.POST("list", salesLeadsApi.List) // 鑾峰彇閿�鍞嚎绱㈠垪琛� } -} +} \ No newline at end of file diff --git a/router/salesRefund.go b/router/salesRefund.go index 5a30041..c017d70 100644 --- a/router/salesRefund.go +++ b/router/salesRefund.go @@ -14,6 +14,6 @@ salesRefundRouter.POST("add", salesRefundApi.Add) // 娣诲姞閿�鍞��娆� salesRefundRouter.DELETE("delete/:id", salesRefundApi.Delete) // 鍒犻櫎閿�鍞��娆� salesRefundRouter.PUT("update", salesRefundApi.Update) // 鏇存柊閿�鍞��娆� - salesRefundRouter.GET("list", salesRefundApi.List) // 鑾峰彇閿�鍞��娆惧垪琛� + salesRefundRouter.POST("list", salesRefundApi.List) // 鑾峰彇閿�鍞��娆惧崟鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/salesReturn.go b/router/salesReturn.go index 8c73643..8cbb54f 100644 --- a/router/salesReturn.go +++ b/router/salesReturn.go @@ -14,6 +14,6 @@ salesReturnRouter.POST("add", salesReturnApi.Add) // 娣诲姞閿�鍞��璐� salesReturnRouter.DELETE("delete/:id", salesReturnApi.Delete) // 鍒犻櫎閿�鍞��璐� salesReturnRouter.PUT("update", salesReturnApi.Update) // 鏇存柊閿�鍞��璐� - salesReturnRouter.GET("list", salesReturnApi.List) // 鑾峰彇閿�鍞��璐у垪琛� + salesReturnRouter.POST("list", salesReturnApi.List) // 鑾峰彇閿�鍞��璐у崟鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/serviceContracts.go b/router/serviceContract.go similarity index 90% rename from router/serviceContracts.go rename to router/serviceContract.go index 51f4030..0c2d756 100644 --- a/router/serviceContracts.go +++ b/router/serviceContract.go @@ -14,6 +14,6 @@ serviceContractRouter.POST("add", serviceContractApi.Add) // 娣诲姞鏈嶅姟鍚堝悓 serviceContractRouter.DELETE("delete/:id", serviceContractApi.Delete) // 鍒犻櫎鏈嶅姟鍚堝悓 serviceContractRouter.PUT("update", serviceContractApi.Update) // 鏇存柊鏈嶅姟鍚堝悓 - serviceContractRouter.GET("list", serviceContractApi.List) // 鑾峰彇鏈嶅姟鍚堝悓鍒楄〃 + serviceContractRouter.POST("list", serviceContractApi.List) // 鑾峰彇鏈嶅姟鍚堝悓鍒楄〃 } -} +} \ No newline at end of file diff --git a/router/serviceFeeManage.go b/router/serviceFeeManage.go index 92fd410..78de68d 100644 --- a/router/serviceFeeManage.go +++ b/router/serviceFeeManage.go @@ -14,6 +14,6 @@ serviceFeeManageRouter.POST("add", serviceFeeManageApi.Add) // 娣诲姞鏈嶅姟璐圭鐞� serviceFeeManageRouter.DELETE("delete/:id", serviceFeeManageApi.Delete) // 鍒犻櫎鏈嶅姟璐圭鐞� serviceFeeManageRouter.PUT("update", serviceFeeManageApi.Update) // 鏇存柊鏈嶅姟璐圭鐞� - serviceFeeManageRouter.GET("list", serviceFeeManageApi.List) // 鑾峰彇鏈嶅姟璐圭鐞嗗垪琛� + serviceFeeManageRouter.POST("list", serviceFeeManageApi.List) // 鑾峰彇鏈嶅姟璐圭鐞嗗垪琛� } -} +} \ No newline at end of file diff --git a/router/serviceFollowup.go b/router/serviceFollowup.go index 18c728b..0e018ca 100644 --- a/router/serviceFollowup.go +++ b/router/serviceFollowup.go @@ -14,6 +14,6 @@ serviceFollowupRouter.POST("add", serviceFollowupApi.Add) // 娣诲姞鏈嶅姟璺熻繘 serviceFollowupRouter.DELETE("delete/:id", serviceFollowupApi.Delete) // 鍒犻櫎鏈嶅姟璺熻繘 serviceFollowupRouter.PUT("update", serviceFollowupApi.Update) // 鏇存柊鏈嶅姟璺熻繘 - serviceFollowupRouter.GET("list", serviceFollowupApi.List) // 鑾峰彇鏈嶅姟璺熻繘鍒楄〃 + serviceFollowupRouter.POST("list", serviceFollowupApi.List) // 鑾峰彇鍥炶鍗曠鐞嗗垪琛� } -} +} \ No newline at end of file diff --git a/router/subOrder.go b/router/subOrder.go index 1cd0197..ce801ba 100644 --- a/router/subOrder.go +++ b/router/subOrder.go @@ -14,6 +14,6 @@ subOrderRouter.POST("add", subOrderApi.Add) // 娣诲姞瀛愯鍗� subOrderRouter.DELETE("delete/:id", subOrderApi.Delete) // 鍒犻櫎瀛愯鍗� subOrderRouter.PUT("update", subOrderApi.Update) // 鏇存柊瀛愯鍗� - subOrderRouter.GET("list", subOrderApi.List) // 鑾峰彇瀛愯鍗曞垪琛� + subOrderRouter.POST("list", subOrderApi.List) // 鑾峰彇閿�鍞瓙鍗曞垪琛� } -} +} \ No newline at end of file diff --git a/service/assign.go b/service/assign.go new file mode 100644 index 0000000..e05f20a --- /dev/null +++ b/service/assign.go @@ -0,0 +1,36 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/pkg/ecode" +) + +type AssignService struct{} + +type Assign interface { + Assign(id int) error +} + +func (AssignService) Assign(memberId, id int, modelType string) int { + // check member exist + _, err := model.NewUserSearch(nil).SetUserId(memberId).First() + if err != nil { + return ecode.UserNotExist + } + + var errCode int + switch modelType { + case "client": + errCode = ClientService{}.Assign(id, memberId) + case "salesLead": + errCode = SalesLeadsService{}.Assign(id, memberId) + default: + errCode = ecode.AssignWrongModelType + } + + if errCode != ecode.OK { + return errCode + } + + return ecode.OK +} diff --git a/service/client.go b/service/client.go index 260ef66..49c8bb7 100644 --- a/service/client.go +++ b/service/client.go @@ -15,30 +15,6 @@ return ecode.OK } -func (ClientService) DeleteClient(id int) int { - // check client exist - _, err := model.NewClientSearch(nil).SetId(id).First() - if err != nil { - return ecode.ClientNotExist - } - - // delete client - err = model.NewClientSearch(nil).SetId(id).Delete() - if err != nil { - return ecode.ClientDeleteErr - } - return ecode.OK -} - -func (ClientService) GetClientList() (int, []*model.Client) { - // get client list - clients, err := model.NewClientSearch(nil).Find() - if err != nil { - return ecode.ClientListErr, nil - } - - return ecode.OK, clients -} // CheckClientExist check client exist func CheckClientExist(id int) int { @@ -65,3 +41,39 @@ return ecode.OK } + +func (ClientService) GetClientList(page, pageSize int, keyword string) ([]*model.Client, int64, int) { + // get contact list + contacts, total, err := model.NewClientSearch(nil).SetKeyword(keyword).SetPage(page, pageSize).Find() + if err != nil { + return nil, 0, ecode.ClientListErr + } + return contacts, total, ecode.OK +} + +func (ClientService) Assign(id, memberId int) int { + // check client exist + errCode := CheckClientExist(id) + if errCode != ecode.OK { + return errCode + } + + // assign client + err := model.NewClientSearch(nil).SetId(id).UpdateByMap(map[string]interface{}{ + "member_id": memberId, + }) + if err != nil { + return ecode.AssignErr + } + + return ecode.OK +} + +func (ClientService) DeleteClient (ids []int) int { + // delete client + err := model.NewClientSearch(nil).SetIds(ids).Delete() + if err != nil { + return ecode.ClientDeleteErr + } + return ecode.OK +} \ No newline at end of file diff --git a/service/contact.go b/service/contact.go index c62bc8a..8a3e761 100644 --- a/service/contact.go +++ b/service/contact.go @@ -48,15 +48,6 @@ return ecode.OK } -func (ContactService) GetContactList() ([]*model.ContactDetail, int) { - // get contact list - contacts, err := model.NewContactSearch(nil).FindAll() - if err != nil { - return nil, ecode.ContactListErr - } - return contacts, ecode.OK -} - func (ContactService) UpdateContact(contact *model.Contact) int { // check contact exist _, err := model.NewContactSearch(nil).SetId(contact.Id).First() @@ -125,3 +116,12 @@ return ecode.OK } + +func (ContactService) GetContactList(page, pageSize int, keyword string) ([]*model.ContactDetail, int64, int) { + // get contact list + contacts, total, err := model.NewContactSearch(nil).SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.ContactListErr + } + return contacts, total, ecode.OK +} diff --git a/service/contract.go b/service/contract.go index 58cb8e0..42e4c81 100644 --- a/service/contract.go +++ b/service/contract.go @@ -29,15 +29,6 @@ return ecode.OK } -func (ContractService) GetContractList() ([]*model.Contract, int) { - list, err := model.NewContractSearch().FindAll() - if err != nil { - return nil, ecode.ContractListErr - } - - return list, ecode.OK -} - func (ContractService) UpdateContract(contract *model.Contract) int { // check contract exist _, err := model.NewContractSearch().SetId(contract.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (ContractService) GetContractList(page, pageSize int, keyword string) ([]*model.Contract, int64, int) { + // get contact list + contacts, total, err := model.NewContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.ContractListErr + } + return contacts, total, ecode.OK +} diff --git a/service/followRecord.go b/service/followRecord.go index 701488d..0fcc278 100644 --- a/service/followRecord.go +++ b/service/followRecord.go @@ -30,16 +30,6 @@ return ecode.OK } -func (FollowRecordService) GetFollowRecordList() (int, []*model.FollowRecord) { - // get followRecord list - followRecords, err := model.NewFollowRecordSearch().Find() - if err != nil { - return ecode.FollowRecordListErr, nil - } - - return ecode.OK, followRecords -} - // check followRecord exist func checkFollowRecordExist(id int) int { _, err := model.NewFollowRecordSearch().SetId(id).First() @@ -64,3 +54,12 @@ } return ecode.OK } + +func (FollowRecordService) GetFollowRecordList(page, pageSize int, keyword string) ([]*model.FollowRecord, int64, int) { + // get contact list + contacts, total, err := model.NewFollowRecordSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.FollowRecordListErr + } + return contacts, total, ecode.OK +} \ No newline at end of file diff --git a/service/index.go b/service/index.go index e48386e..ae1c0c6 100644 --- a/service/index.go +++ b/service/index.go @@ -49,17 +49,18 @@ TimelyRateService SolveRateService IsVisitService - ReportSourceService - OrderTypeService - ServiceContractStatusService - ServiceContractTypeService - RefundMethodService - IsInvoiceService - AccountIdService - SalesReturnStatusService - RepositoryService - QuotationStatusService - CurrencyService + ReportSourceService + OrderTypeService + ServiceContractStatusService + ServiceContractTypeService + RefundMethodService + IsInvoiceService + AccountIdService + SalesReturnStatusService + RepositoryService + QuotationStatusService + CurrencyService + AssignService } -var ServiceGroup = new(Group) \ No newline at end of file +var ServiceGroup = new(Group) diff --git a/service/masterOrder.go b/service/masterOrder.go index c1255a1..6ce2a5f 100644 --- a/service/masterOrder.go +++ b/service/masterOrder.go @@ -29,15 +29,6 @@ return ecode.OK } -func (MasterOrderService) GetMasterOrderList() ([]*model.MasterOrder, int) { - list, err := model.NewMasterOrderSearch().FindAll() - if err != nil { - return nil, ecode.MasterOrderListErr - } - - return list, ecode.OK -} - func (MasterOrderService) UpdateMasterOrder(masterOrder *model.MasterOrder) int { // check masterOrder exist _, err := model.NewMasterOrderSearch().SetId(masterOrder.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (MasterOrderService) GetMasterOrderList(page, pageSize int, keyword string) ([]*model.MasterOrder, int64, int) { + // get contact list + contacts, total, err := model.NewMasterOrderSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.MasterOrderListErr + } + return contacts, total, ecode.OK +} diff --git a/service/orderManage.go b/service/orderManage.go index 93b8219..c66b8b1 100644 --- a/service/orderManage.go +++ b/service/orderManage.go @@ -29,15 +29,6 @@ return ecode.OK } -func (OrderManageService) GetOrderManageList() ([]*model.OrderManage, int) { - list, err := model.NewOrderManageSearch().FindAll() - if err != nil { - return nil, ecode.OrderManageListErr - } - - return list, ecode.OK -} - func (OrderManageService) UpdateOrderManage(orderManage *model.OrderManage) int { // check orderManage exist _, err := model.NewOrderManageSearch().SetId(orderManage.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (OrderManageService) GetOrderManageList(page, pageSize int, keyword string) ([]*model.OrderManage, int64, int) { + // get contact list + contacts, total, err := model.NewOrderManageSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.OrderManageListErr + } + return contacts, total, ecode.OK +} diff --git a/service/plan.go b/service/plan.go index 9e175fb..b1fc531 100644 --- a/service/plan.go +++ b/service/plan.go @@ -29,15 +29,6 @@ return ecode.OK } -func (PlanService) GetPlanList() ([]*model.Plan, int) { - list, err := model.NewPlanSearch().FindAll() - if err != nil { - return nil, ecode.PlanListErr - } - - return list, ecode.OK -} - func (PlanService) UpdatePlan(plan *model.Plan) int { // check plan exist _, err := model.NewPlanSearch().SetId(plan.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (PlanService) GetPlanList(page, pageSize int, keyword string) ([]*model.Plan, int64, int) { + // get contact list + contacts, total, err := model.NewPlanSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.PlanListErr + } + return contacts, total, ecode.OK +} diff --git a/service/qutation.go b/service/quotation.go similarity index 75% rename from service/qutation.go rename to service/quotation.go index 247f4e8..3ada6cd 100644 --- a/service/qutation.go +++ b/service/quotation.go @@ -29,15 +29,6 @@ return ecode.OK } -func (QuotationService) GetQuotationList() ([]*model.Quotation, int) { - list, err := model.NewQuotationSearch().FindAll() - if err != nil { - return nil, ecode.QuotationListErr - } - - return list, ecode.OK -} - func (QuotationService) UpdateQuotation(quotation *model.Quotation) int { // check quotation exist _, err := model.NewQuotationSearch().SetId(quotation.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (QuotationService) GetQuotationList(page, pageSize int, keyword string) ([]*model.Quotation, int64, int) { + // get contact list + contacts, total, err := model.NewQuotationSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.QuotationListErr + } + return contacts, total, ecode.OK +} diff --git a/service/saleChance.go b/service/saleChance.go new file mode 100644 index 0000000..4c42d23 --- /dev/null +++ b/service/saleChance.go @@ -0,0 +1,64 @@ +package service + +import ( + "aps_crm/model" + "aps_crm/pkg/ecode" +) + +type SaleChanceService struct{} + +func (SaleChanceService) AddSaleChance(saleChange *model.SaleChance) int { + err := model.NewSaleChanceSearch().Create(saleChange) + if err != nil { + return ecode.SaleChanceExist + } + return ecode.OK +} + +func (SaleChanceService) DeleteSaleChance(id int) int { + // check saleChange exist + _, err := model.NewSaleChanceSearch().SetId(id).Find() + if err != nil { + return ecode.SaleChanceNotExist + } + + // delete saleChange + err = model.NewSaleChanceSearch().SetId(id).Delete() + if err != nil { + return ecode.SaleChanceDeleteErr + } + return ecode.OK +} + +func (SaleChanceService) UpdateSaleChance(saleChange *model.SaleChance) int { + // update saleChange + err := model.NewSaleChanceSearch().SetId(saleChange.Id).Update(saleChange) + if err != nil { + return ecode.SaleChanceUpdateErr + } + + return ecode.OK +} + +// CheckSaleChangeExist check saleChange exist +func CheckSaleChangeExist(id int) int { + tmp, err := model.NewSaleChanceSearch().SetId(id).Find() + if err != nil { + return ecode.SaleChanceNotExist + } + + if tmp.Id == 0 { + return ecode.SaleChanceNotExist + } + + return ecode.OK +} + +func (SaleChanceService) GetSaleChanceList(page, pageSize int, keyword string) ([]*model.SaleChance, int64, int) { + // get contact list + contacts, total, err := model.NewSaleChanceSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SaleChanceListErr + } + return contacts, total, ecode.OK +} diff --git a/service/saleChange.go b/service/saleChange.go deleted file mode 100644 index c609f25..0000000 --- a/service/saleChange.go +++ /dev/null @@ -1,65 +0,0 @@ -package service - -import ( - "aps_crm/model" - "aps_crm/pkg/ecode" -) - -type SaleChanceService struct{} - -func (SaleChanceService) AddSaleChance(saleChange *model.SaleChance) int { - err := model.NewSaleChangeSearch().Create(saleChange) - if err != nil { - return ecode.SaleChangeExist - } - return ecode.OK -} - -func (SaleChanceService) DeleteSaleChance(id int) int { - // check saleChange exist - _, err := model.NewSaleChangeSearch().SetId(id).Find() - if err != nil { - return ecode.SaleChangeNotExist - } - - // delete saleChange - err = model.NewSaleChangeSearch().SetId(id).Delete() - if err != nil { - return ecode.SaleChangeDeleteErr - } - return ecode.OK -} - -func (SaleChanceService) GetSaleChanceList() (int, []*model.SaleChance) { - // get saleChange list - saleChanges, err := model.NewSaleChangeSearch().FindAll() - if err != nil { - return ecode.SaleChangeListErr, nil - } - - return ecode.OK, saleChanges -} - -func (SaleChanceService) UpdateSaleChance(saleChange *model.SaleChance) int { - // update saleChange - err := model.NewSaleChangeSearch().SetId(saleChange.Id).Update(saleChange) - if err != nil { - return ecode.SaleChangeUpdateErr - } - - return ecode.OK -} - -// CheckSaleChangeExist check saleChange exist -func CheckSaleChangeExist(id int) int { - tmp, err := model.NewSaleChangeSearch().SetId(id).Find() - if err != nil { - return ecode.SaleChangeNotExist - } - - if tmp.Id == 0 { - return ecode.SaleChangeNotExist - } - - return ecode.OK -} diff --git a/service/salesDetails.go b/service/salesDetails.go index cde3653..8c0b0a2 100644 --- a/service/salesDetails.go +++ b/service/salesDetails.go @@ -29,15 +29,6 @@ return ecode.OK } -func (SalesDetailsService) GetSalesDetailsList() ([]*model.SalesDetails, int) { - list, err := model.NewSalesDetailsSearch().FindAll() - if err != nil { - return nil, ecode.SalesDetailsListErr - } - - return list, ecode.OK -} - func (SalesDetailsService) UpdateSalesDetails(salesDetails *model.SalesDetails) int { // check salesDetails exist _, err := model.NewSalesDetailsSearch().SetId(salesDetails.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (SalesDetailsService) GetSalesDetailsList(page, pageSize int, keyword string) ([]*model.SalesDetails, int64, int) { + // get contact list + contacts, total, err := model.NewSalesDetailsSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SalesDetailsListErr + } + return contacts, total, ecode.OK +} diff --git a/service/salesLeads.go b/service/salesLeads.go index 3c6caa1..f31fd9a 100644 --- a/service/salesLeads.go +++ b/service/salesLeads.go @@ -30,16 +30,6 @@ return ecode.OK } -func (SalesLeadsService) GetSalesLeadsList() (int, []*model.SalesLeads) { - // get salesLeads list - salesLeadss, err := model.NewSalesLeadsSearch().FindAll() - if err != nil { - return ecode.SalesLeadsListErr, nil - } - - return ecode.OK, salesLeadss -} - func (SalesLeadsService) UpdateSalesLeads(salesLeads *model.SalesLeads) int { // update salesLeads err := model.NewSalesLeadsSearch().SetId(salesLeads.Id).Update(salesLeads) @@ -63,3 +53,30 @@ return ecode.OK } + +func (SalesLeadsService) GetSalesLeadsList(page, pageSize int, keyword string) ([]*model.SalesLeads, int64, int) { + // get contact list + contacts, total, err := model.NewSalesLeadsSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SalesLeadsListErr + } + return contacts, total, ecode.OK +} + +func (SalesLeadsService) Assign(id, memberId int) int { + // check salesLeads exist + errCode := CheckSalesLeadsExist(id) + if errCode != ecode.OK { + return errCode + } + + // update salesLeads + err := model.NewSalesLeadsSearch().SetId(id).UpdateMap(map[string]interface{}{ + "member_id": memberId, + }) + if err != nil { + return ecode.SalesLeadsUpdateErr + } + + return ecode.OK +} diff --git a/service/salesRefund.go b/service/salesRefund.go index 5efa2e1..de91872 100644 --- a/service/salesRefund.go +++ b/service/salesRefund.go @@ -29,15 +29,6 @@ return ecode.OK } -func (SalesRefundService) GetSalesRefundList() ([]*model.SalesRefund, int) { - list, err := model.NewSalesRefundSearch().FindAll() - if err != nil { - return nil, ecode.SalesRefundListErr - } - - return list, ecode.OK -} - func (SalesRefundService) UpdateSalesRefund(salesRefund *model.SalesRefund) int { // check salesRefund exist _, err := model.NewSalesRefundSearch().SetId(salesRefund.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (SalesRefundService) GetSalesRefundList(page, pageSize int, keyword string) ([]*model.SalesRefund, int64, int) { + // get contact list + contacts, total, err := model.NewSalesRefundSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SalesRefundListErr + } + return contacts, total, ecode.OK +} diff --git a/service/salesReturn.go b/service/salesReturn.go index f354d2d..655e2f8 100644 --- a/service/salesReturn.go +++ b/service/salesReturn.go @@ -29,15 +29,6 @@ return ecode.OK } -func (SalesReturnService) GetSalesReturnList() ([]*model.SalesReturn, int) { - list, err := model.NewSalesReturnSearch().FindAll() - if err != nil { - return nil, ecode.SalesReturnListErr - } - - return list, ecode.OK -} - func (SalesReturnService) UpdateSalesReturn(salesReturn *model.SalesReturn) int { // check salesReturn exist _, err := model.NewSalesReturnSearch().SetId(salesReturn.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (SalesReturnService) GetSalesReturnList(page, pageSize int, keyword string) ([]*model.SalesReturn, int64, int) { + // get contact list + contacts, total, err := model.NewSalesReturnSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SalesReturnListErr + } + return contacts, total, ecode.OK +} diff --git a/service/serviceContracts.go b/service/serviceContract.go similarity index 63% rename from service/serviceContracts.go rename to service/serviceContract.go index 81a4456..a24b5ad 100644 --- a/service/serviceContracts.go +++ b/service/serviceContract.go @@ -29,15 +29,6 @@ return ecode.OK } -func (SContractService) GetServiceContractList() ([]*model.ServiceContract, int) { - list, err := model.NewServiceContractSearch().FindAll() - if err != nil { - return nil, ecode.SContractListErr - } - - return list, ecode.OK -} - func (SContractService) UpdateServiceContract(serviceContract *model.ServiceContract) int { // check serviceContract exist _, err := model.NewServiceContractSearch().SetId(serviceContract.Id).Find() @@ -53,11 +44,20 @@ return ecode.OK } -func (SContractService) GetServiceContractByContractId(contractId int) ([]*model.ServiceContract, int) { - list, err := model.NewServiceContractSearch().SetId(contractId).FindAll() - if err != nil { - return nil, ecode.SContractListErr - } +//func (SContractService) GetServiceContractByContractId(contractId int) ([]*model.ServiceContract, int) { +// list, err := model.NewServiceContractSearch().SetId(contractId).FindAll() +// if err != nil { +// return nil, ecode.SContractListErr +// } +// +// return list, ecode.OK +//} - return list, ecode.OK +func (SContractService) GetServiceContractList(page, pageSize int, keyword string) ([]*model.ServiceContract, int64, int) { + // get contact list + contacts, total, err := model.NewServiceContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SContractListErr + } + return contacts, total, ecode.OK } diff --git a/service/serviceFeeManage.go b/service/serviceFeeManage.go index 45bd4fa..5afaf9a 100644 --- a/service/serviceFeeManage.go +++ b/service/serviceFeeManage.go @@ -43,15 +43,6 @@ return ecode.OK } -func (FeeManageService) GetServiceFeeManageList() ([]*model.ServiceFeeManage, int) { - list, err := model.NewServiceFeeManageSearch(nil).FindAll() - if err != nil { - return nil, ecode.ServiceFeeManageListErr - } - - return list, ecode.OK -} - func (FeeManageService) UpdateServiceFeeManage(serviceFeeManage *model.ServiceFeeManage) int { // check serviceFeeManage exist _, err := model.NewServiceFeeManageSearch(nil).SetId(serviceFeeManage.Id).Find() @@ -78,3 +69,12 @@ return ecode.OK } + +func (FeeManageService) GetServiceFeeManageList(page, pageSize int, keyword string) ([]*model.ServiceFeeManage, int64, int) { + // get contact list + contacts, total, err := model.NewServiceFeeManageSearch(nil).SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.ServiceFeeManageListErr + } + return contacts, total, ecode.OK +} diff --git a/service/serviceFollowup.go b/service/serviceFollowup.go index 83ea5f5..8faea0b 100644 --- a/service/serviceFollowup.go +++ b/service/serviceFollowup.go @@ -29,15 +29,6 @@ return ecode.OK } -func (FollowupService) GetServiceFollowupList() ([]*model.ServiceFollowup, int) { - list, err := model.NewServiceFollowupSearch().FindAll() - if err != nil { - return nil, ecode.ServiceFollowupListErr - } - - return list, ecode.OK -} - func (FollowupService) UpdateServiceFollowup(serviceFollowup *model.ServiceFollowup) int { // check serviceFollowup exist _, err := model.NewServiceFollowupSearch().SetId(serviceFollowup.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (FollowupService) GetServiceFollowupList(page, pageSize int, keyword string) ([]*model.ServiceFollowup, int64, int) { + // get contact list + contacts, total, err := model.NewServiceFollowupSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.ServiceFollowupListErr + } + return contacts, total, ecode.OK +} diff --git a/service/subOrder.go b/service/subOrder.go index cf6df59..57091e4 100644 --- a/service/subOrder.go +++ b/service/subOrder.go @@ -29,15 +29,6 @@ return ecode.OK } -func (SubOrderService) GetSubOrderList() ([]*model.SubOrder, int) { - list, err := model.NewSubOrderSearch().FindAll() - if err != nil { - return nil, ecode.SubOrderListErr - } - - return list, ecode.OK -} - func (SubOrderService) UpdateSubOrder(subOrder *model.SubOrder) int { // check subOrder exist _, err := model.NewSubOrderSearch().SetId(subOrder.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (SubOrderService) GetSubOrderList(page, pageSize int, keyword string) ([]*model.SubOrder, int64, int) { + // get contact list + contacts, total, err := model.NewSubOrderSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.SubOrderListErr + } + return contacts, total, ecode.OK +} -- Gitblit v1.8.0