浏览代码

feature(招投标): 客户招标信息新增渠道推进工作、客户推进工作、客户后续销售机会字段

likai 1 年之前
父节点
当前提交
2b10a8f61f

+ 72 - 63
opms_parent/app/dao/cust/internal/cust_customer_bid_record.go

@@ -29,27 +29,30 @@ type CustCustomerBidRecordDao struct {
 
 // CustCustomerBidRecordColumns defines and stores column names for table cust_customer_bid_record.
 type custCustomerBidRecordColumns struct {
-	Id            string // 主键
-	CustId        string // 关联客户
-	CuctName      string // 客户名称
-	ProductName   string // 招标产品名称
-	PublishedTime string // 发布招标日期
-	Status        string // 状态:(10跟进中,20待审批,30已闭环、40已超期)
-	Budget        string // 项目预算
-	ProductLine   string // 产品线
-	Title         string // 招标信息标题
-	InfoType      string // 信息分类
-	Bidder        string // 中标单位
-	BiddingTime   string // 招标时间
-	CloseLoopMsg  string // 闭环信息描述
-	Remark        string // 备注
-	CreatedBy     string // 创建者
-	CreatedName   string // 创建人
-	CreatedTime   string // 创建时间
-	UpdatedBy     string // 更新者
-	UpdatedName   string // 更新人
-	UpdatedTime   string // 更新时间
-	DeletedTime   string // 删除时间
+	Id                            string // 主键
+	CustId                        string // 关联客户
+	CuctName                      string // 客户名称
+	ProductName                   string // 招标产品名称
+	PublishedTime                 string // 发布招标日期
+	Status                        string // 状态:(10跟进中,20待审批,30已闭环、40已超期)
+	Budget                        string // 项目预算
+	ProductLine                   string // 产品线
+	Title                         string // 招标信息标题
+	InfoType                      string // 信息分类
+	Bidder                        string // 中标单位
+	BiddingTime                   string // 招标时间
+	CloseLoopMsg                  string // 闭环信息描述
+	ChannelPromotionWork          string // 渠道推进工作
+	CustomerPromotionWork         string // 客户推进工作
+	CustomerSubsequentOpportunity string // 客户后续销售机会
+	Remark                        string // 备注
+	CreatedBy                     string // 创建者
+	CreatedName                   string // 创建人
+	CreatedTime                   string // 创建时间
+	UpdatedBy                     string // 更新者
+	UpdatedName                   string // 更新人
+	UpdatedTime                   string // 更新时间
+	DeletedTime                   string // 删除时间
 }
 
 var (
@@ -59,27 +62,30 @@ var (
 		DB:    g.DB("default"),
 		Table: "cust_customer_bid_record",
 		C: custCustomerBidRecordColumns{
-			Id:            "id",
-			CustId:        "cust_id",
-			CuctName:      "cuct_name",
-			ProductName:   "product_name",
-			PublishedTime: "published_time",
-			Status:        "status",
-			Budget:        "budget",
-			ProductLine:   "product_line",
-			Title:         "title",
-			InfoType:      "info_type",
-			Bidder:        "bidder",
-			BiddingTime:   "bidding_time",
-			CloseLoopMsg:  "close_loop_msg",
-			Remark:        "remark",
-			CreatedBy:     "created_by",
-			CreatedName:   "created_name",
-			CreatedTime:   "created_time",
-			UpdatedBy:     "updated_by",
-			UpdatedName:   "updated_name",
-			UpdatedTime:   "updated_time",
-			DeletedTime:   "deleted_time",
+			Id:                            "id",
+			CustId:                        "cust_id",
+			CuctName:                      "cuct_name",
+			ProductName:                   "product_name",
+			PublishedTime:                 "published_time",
+			Status:                        "status",
+			Budget:                        "budget",
+			ProductLine:                   "product_line",
+			Title:                         "title",
+			InfoType:                      "info_type",
+			Bidder:                        "bidder",
+			BiddingTime:                   "bidding_time",
+			CloseLoopMsg:                  "close_loop_msg",
+			ChannelPromotionWork:          "channel_promotion_work",
+			CustomerPromotionWork:         "customer_promotion_work",
+			CustomerSubsequentOpportunity: "customer_subsequent_opportunity",
+			Remark:                        "remark",
+			CreatedBy:                     "created_by",
+			CreatedName:                   "created_name",
+			CreatedTime:                   "created_time",
+			UpdatedBy:                     "updated_by",
+			UpdatedName:                   "updated_name",
+			UpdatedTime:                   "updated_time",
+			DeletedTime:                   "deleted_time",
 		},
 	}
 )
@@ -91,27 +97,30 @@ func NewCustCustomerBidRecordDao(tenant string) CustCustomerBidRecordDao {
 		DB:    g.DB(tenant),
 		Table: "cust_customer_bid_record",
 		C: custCustomerBidRecordColumns{
-			Id:            "id",
-			CustId:        "cust_id",
-			CuctName:      "cuct_name",
-			ProductName:   "product_name",
-			PublishedTime: "published_time",
-			Status:        "status",
-			Budget:        "budget",
-			ProductLine:   "product_line",
-			Title:         "title",
-			InfoType:      "info_type",
-			Bidder:        "bidder",
-			BiddingTime:   "bidding_time",
-			CloseLoopMsg:  "close_loop_msg",
-			Remark:        "remark",
-			CreatedBy:     "created_by",
-			CreatedName:   "created_name",
-			CreatedTime:   "created_time",
-			UpdatedBy:     "updated_by",
-			UpdatedName:   "updated_name",
-			UpdatedTime:   "updated_time",
-			DeletedTime:   "deleted_time",
+			Id:                            "id",
+			CustId:                        "cust_id",
+			CuctName:                      "cuct_name",
+			ProductName:                   "product_name",
+			PublishedTime:                 "published_time",
+			Status:                        "status",
+			Budget:                        "budget",
+			ProductLine:                   "product_line",
+			Title:                         "title",
+			InfoType:                      "info_type",
+			Bidder:                        "bidder",
+			BiddingTime:                   "bidding_time",
+			CloseLoopMsg:                  "close_loop_msg",
+			ChannelPromotionWork:          "channel_promotion_work",
+			CustomerPromotionWork:         "customer_promotion_work",
+			CustomerSubsequentOpportunity: "customer_subsequent_opportunity",
+			Remark:                        "remark",
+			CreatedBy:                     "created_by",
+			CreatedName:                   "created_name",
+			CreatedTime:                   "created_time",
+			UpdatedBy:                     "updated_by",
+			UpdatedName:                   "updated_name",
+			UpdatedTime:                   "updated_time",
+			DeletedTime:                   "deleted_time",
 		},
 	}
 	return dao

+ 16 - 13
opms_parent/app/model/cust/cust_customer_bid_record.go

@@ -29,16 +29,16 @@ type CustCustomerBidRecordListReq struct {
 }
 
 type CustCustomerBidRecordAddReq struct {
-	CustId        int         `json:"custId" v:"required#请输入关联客户"`          // 关联客户
+	CustId        int         `json:"custId" v:"required#请输入关联客户"`            // 关联客户
 	ProductName   string      `json:"productName" v:"required#请输入招标产品名称"`   // 招标产品名称
 	PublishedTime *gtime.Time `json:"publishedTime" v:"required#请输入发布招标日期"` // 发布招标日期
-	Budget        float64     `json:"budget"  v:"required#请输入项目预算"`         // 项目预算
-	ProductLine   string      `json:"productLine" v:"required#请输入产品线"`      // 产品线
-	Title         string      `json:"title"`                                // 招标信息标题
-	InfoType      string      `json:"infoType" v:"required#请输入信息分类"`        // 信息分类
-	Bidder        string      `json:"bidder"`                               // 中标单位
-	BiddingTime   *gtime.Time `json:"BiddingTime" v:"required#请输入日期"`       // 招标日期
-	Remark        string      `json:"remark"`                               // 备注
+	Budget        float64     `json:"budget"  v:"required#请输入项目预算"`           // 项目预算
+	ProductLine   string      `json:"productLine" v:"required#请输入产品线"`         // 产品线
+	Title         string      `json:"title"`                                         // 招标信息标题
+	InfoType      string      `json:"infoType" v:"required#请输入信息分类"`          // 信息分类
+	Bidder        string      `json:"bidder"`                                        // 中标单位
+	BiddingTime   *gtime.Time `json:"BiddingTime" v:"required#请输入日期"`           // 招标日期
+	Remark        string      `json:"remark"`                                        // 备注
 }
 
 type CustCustomerBidRecordUpdateReq struct {
@@ -57,9 +57,12 @@ type CustCustomerBidRecordUpdateReq struct {
 }
 
 type CloseLoopReq struct {
-	Id              int    `json:"id" v:"required#请输入Id"`
-	CloseMethod     string `json:"closeMethod"`
-	BusinessName    string `json:"businessName"`
-	DistributorName string `json:"distributorName"`
-	CloseReason     string `json:"closeReason"`
+	Id                            int    `json:"id" v:"required#请输入Id"`
+	CloseMethod                   string `json:"closeMethod"`
+	BusinessName                  string `json:"businessName"`
+	DistributorName               string `json:"distributorName"`
+	CloseReason                   string `json:"closeReason"`
+	ChannelPromotionWork          string `json:"channelPromotionWork"`          // 渠道推进工作
+	CustomerPromotionWork         string `json:"customerPromotionWork"`         // 客户推进工作
+	CustomerSubsequentOpportunity string `json:"customerSubsequentOpportunity"` // 客户后续销售机会
 }

+ 24 - 21
opms_parent/app/model/cust/internal/cust_customer_bid_record.go

@@ -10,25 +10,28 @@ import (
 
 // CustCustomerBidRecord is the golang structure for table cust_customer_bid_record.
 type CustCustomerBidRecord struct {
-	Id            int         `orm:"id,primary"     json:"id"`            // 主键
-	CustId        int         `orm:"cust_id"        json:"custId"`        // 关联客户
-	CuctName      string      `orm:"cuct_name"      json:"cuctName"`      // 客户名称
-	ProductName   string      `orm:"product_name"   json:"productName"`   // 招标产品名称
-	PublishedTime *gtime.Time `orm:"published_time" json:"publishedTime"` // 发布招标日期
-	Status        string      `orm:"status"         json:"status"`        // 状态:(10跟进中,20待审批,30已闭环、40已超期)
-	Budget        float64     `orm:"budget"         json:"budget"`        // 项目预算
-	ProductLine   string      `orm:"product_line"   json:"productLine"`   // 产品线
-	Title         string      `orm:"title"          json:"title"`         // 招标信息标题
-	InfoType      string      `orm:"info_type"      json:"infoType"`      // 信息分类
-	Bidder        string      `orm:"bidder"         json:"bidder"`        // 中标单位
-	BiddingTime   *gtime.Time `orm:"bidding_time"   json:"biddingTime"`   // 招标日期
-	CloseLoopMsg  string      `orm:"close_loop_msg" json:"closeLoopMsg"`  // 闭环信息描述
-	Remark        string      `orm:"remark"         json:"remark"`        // 备注
-	CreatedBy     int         `orm:"created_by"     json:"createdBy"`     // 创建者
-	CreatedName   string      `orm:"created_name"   json:"createdName"`   // 创建人
-	CreatedTime   *gtime.Time `orm:"created_time"   json:"createdTime"`   // 创建时间
-	UpdatedBy     int         `orm:"updated_by"     json:"updatedBy"`     // 更新者
-	UpdatedName   string      `orm:"updated_name"   json:"updatedName"`   // 更新人
-	UpdatedTime   *gtime.Time `orm:"updated_time"   json:"updatedTime"`   // 更新时间
-	DeletedTime   *gtime.Time `orm:"deleted_time"   json:"deletedTime"`   // 删除时间
+	Id                            int         `orm:"id,primary"                      json:"id"`                            // 主键
+	CustId                        int         `orm:"cust_id"                         json:"custId"`                        // 关联客户
+	CuctName                      string      `orm:"cuct_name"                       json:"cuctName"`                      // 客户名称
+	ProductName                   string      `orm:"product_name"                    json:"productName"`                   // 招标产品名称
+	PublishedTime                 *gtime.Time `orm:"published_time"                  json:"publishedTime"`                 // 发布招标日期
+	Status                        string      `orm:"status"                          json:"status"`                        // 状态:(10跟进中,20待审批,30已闭环、40已超期)
+	Budget                        float64     `orm:"budget"                          json:"budget"`                        // 项目预算
+	ProductLine                   string      `orm:"product_line"                    json:"productLine"`                   // 产品线
+	Title                         string      `orm:"title"                           json:"title"`                         // 招标信息标题
+	InfoType                      string      `orm:"info_type"                       json:"infoType"`                      // 信息分类
+	Bidder                        string      `orm:"bidder"                          json:"bidder"`                        // 中标单位
+	BiddingTime                   *gtime.Time `orm:"bidding_time"                    json:"biddingTime"`                   // 招标日期
+	CloseLoopMsg                  string      `orm:"close_loop_msg"                  json:"closeLoopMsg"`                  // 闭环信息描述
+	ChannelPromotionWork          string      `orm:"channel_promotion_work"          json:"channelPromotionWork"`          // 渠道推进工作
+	CustomerPromotionWork         string      `orm:"customer_promotion_work"         json:"customerPromotionWork"`         // 客户推进工作
+	CustomerSubsequentOpportunity string      `orm:"customer_subsequent_opportunity" json:"customerSubsequentOpportunity"` // 客户后续销售机会
+	Remark                        string      `orm:"remark"                          json:"remark"`                        // 备注
+	CreatedBy                     int         `orm:"created_by"                      json:"createdBy"`                     // 创建者
+	CreatedName                   string      `orm:"created_name"                    json:"createdName"`                   // 创建人
+	CreatedTime                   *gtime.Time `orm:"created_time"                    json:"createdTime"`                   // 创建时间
+	UpdatedBy                     int         `orm:"updated_by"                      json:"updatedBy"`                     // 更新者
+	UpdatedName                   string      `orm:"updated_name"                    json:"updatedName"`                   // 更新人
+	UpdatedTime                   *gtime.Time `orm:"updated_time"                    json:"updatedTime"`                   // 更新时间
+	DeletedTime                   *gtime.Time `orm:"deleted_time"                    json:"deletedTime"`                   // 删除时间
 }

+ 26 - 1
opms_parent/app/service/cust/cust_customer_bid_record.go

@@ -297,8 +297,18 @@ func (s CustCustomerBidRecordService) CloseLoop(ctx context.Context, req *model.
 	}
 
 	err = s.Dao.Transaction(context.TODO(), func(ctx1 context.Context, tx *gdb.TX) error {
+		data := g.Map{
+			"status":                          "20",
+			"close_loop_msg":                  req.CloseReason,
+			"channel_promotion_work":          req.ChannelPromotionWork,
+			"customer_promotion_work":         req.CustomerPromotionWork,
+			"customer_subsequent_opportunity": req.CustomerSubsequentOpportunity,
+			"updated_by":                      s.userInfo.Id,
+			"updated_name":                    s.userInfo.NickName,
+			"updated_time":                    gtime.Now(),
+		}
 		// 改为待审批状态
-		_, err := s.Dao.Update(fmt.Sprintf("status='20',close_loop_msg='%v'", req.CloseReason), fmt.Sprintf("id='%v'", req.Id))
+		_, err := s.Dao.Update(data, fmt.Sprintf("id='%v'", req.Id))
 		if err != nil {
 			return err
 		}
@@ -360,6 +370,21 @@ func (s CustCustomerBidRecordService) CloseLoop(ctx context.Context, req *model.
 					Name:  utils.String("名称"),
 					Value: utils.String(name),
 				},
+				{
+					Id:    utils.String("TextField_KARTQZ45DI80"),
+					Name:  utils.String("渠道推进工作"),
+					Value: utils.String(req.ChannelPromotionWork),
+				},
+				{
+					Id:    utils.String("TextField_EJ2GWZ8CD000"),
+					Name:  utils.String("客户推进工作"),
+					Value: utils.String(req.CustomerPromotionWork),
+				},
+				{
+					Id:    utils.String("TextField_LSRPAR2S1TS0"),
+					Name:  utils.String("客户后续销售机会"),
+					Value: utils.String(req.CustomerSubsequentOpportunity),
+				},
 				{
 					Id:    utils.String("TextareaField_FXZRRAQB7CW0"),
 					Name:  utils.String("申请原因"),