From 4b2c52b17abef8521f9211b4865e1cad0288b12a Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期六, 21 十月 2023 17:47:50 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/crm --- api/v1/quotation.go | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/api/v1/quotation.go b/api/v1/quotation.go index a26d4e9..7beeb3b 100644 --- a/api/v1/quotation.go +++ b/api/v1/quotation.go @@ -1,11 +1,13 @@ package v1 import ( + "aps_crm/constvar" "aps_crm/model" "aps_crm/model/request" "aps_crm/model/response" "aps_crm/pkg/contextx" "aps_crm/pkg/ecode" + "aps_crm/utils" "github.com/gin-gonic/gin" ) @@ -30,6 +32,13 @@ if errCode != ecode.OK { ctx.Fail(errCode) return + } + + if quotation.MemberId == 0 { + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + quotation.MemberId = userInfo.CrmUserId + } } errCode = quotationService.AddQuotation("ation) @@ -149,6 +158,7 @@ quotationModel.File = quotation.File quotationModel.Products = quotation.Products quotationModel.CodeStandID = quotation.CodeStandID + quotationModel.QuotationName = quotation.QuotationName return ecode.OK, quotationModel @@ -169,6 +179,14 @@ return } + userInfo := utils.GetUserInfo(c) + if userInfo.UserType == constvar.UserTypeSub { + if params.SearchMap == nil { + params.SearchMap = make(map[string]interface{}, 0) + } + params.SearchMap["member_id"] = userInfo.CrmUserId + } + quotations, total, errCode := quotationService.GetQuotationList(params.Page, params.PageSize, params.SearchMap) if errCode != ecode.OK { ctx.Fail(errCode) -- Gitblit v1.8.0