Explorar el Código

feature(*): 1、招标信息新增产品线、状态字段,部分字段的名称调整
2、在招投处可以创建项目及创建经销商
3、合同中增加产品线的查询方式,项目中增加所在省的查询方式

lk hace 2 años
padre
commit
fa5cdf60e6

+ 6 - 0
opms_parent/app/dao/cust/internal/cust_customer_bid_record.go

@@ -34,7 +34,9 @@ type custCustomerBidRecordColumns struct {
 	CuctName      string // 客户名称
 	ProductName   string // 招标产品名称
 	PublishedTime string // 发布招标日期
+	Status        string // 状态:(10跟进中,20待审批,30已闭环、40已超期)
 	Budget        string // 项目预算
+	ProductLine   string // 产品线
 	Title         string // 招标信息标题
 	InfoType      string // 信息分类
 	Bidder        string // 中标单位
@@ -60,7 +62,9 @@ var (
 			CuctName:      "cuct_name",
 			ProductName:   "product_name",
 			PublishedTime: "published_time",
+			Status:        "status",
 			Budget:        "budget",
+			ProductLine:   "product_line",
 			Title:         "title",
 			InfoType:      "info_type",
 			Bidder:        "bidder",
@@ -88,7 +92,9 @@ func NewCustCustomerBidRecordDao(tenant string) CustCustomerBidRecordDao {
 			CuctName:      "cuct_name",
 			ProductName:   "product_name",
 			PublishedTime: "published_time",
+			Status:        "status",
 			Budget:        "budget",
+			ProductLine:   "product_line",
 			Title:         "title",
 			InfoType:      "info_type",
 			Bidder:        "bidder",

+ 7 - 7
opms_parent/app/model/contract/ctr_contract.go

@@ -36,13 +36,13 @@ type CtrContractListReq struct {
 	ContractType string `json:"contractType"` // 合同类型
 	// ContractStartTime *gtime.Time `json:"contractStartTime"` // 合同开始时间
 	// ContractEndTime   *gtime.Time `json:"contractEndTime"`   // 合同结束时间
-	InchargeId      int    `json:"inchargeId"`      // 负责人ID
-	InchargeName    string `json:"inchargeName"`    // 负责人
-	SignatoryId     int    `json:"signatoryId"`     // 公司签约人ID
-	SignatoryName   string `json:"signatoryName"`   // 公司签约人
-	DistributorId   int    `json:"distributorId"`   // 经销商ID
-	DistributorName string `json:"distributorName"` // 经销商
-
+	InchargeId           int    `json:"inchargeId"`        // 负责人ID
+	InchargeName         string `json:"inchargeName"`      // 负责人
+	SignatoryId          int    `json:"signatoryId"`       // 公司签约人ID
+	SignatoryName        string `json:"signatoryName"`     // 公司签约人
+	DistributorId        int    `json:"distributorId"`     // 经销商ID
+	DistributorName      string `json:"distributorName"`   // 经销商
+	ProductLine          string `json:"productLine"`       // 产品线
 	ContractEndTimeStart string `p:"contractEndTimeStart"` //开始时间
 	ContractEndTimeEnd   string `p:"contractEndTimeEnd"`   //结束时间
 	CustProvinceId       int    `json:"custProvinceId"`    // 所在省ID

+ 3 - 0
opms_parent/app/model/cust/cust_customer_bid_record.go

@@ -33,6 +33,7 @@ type CustCustomerBidRecordAddReq struct {
 	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"`                               // 中标单位
@@ -47,8 +48,10 @@ type CustCustomerBidRecordUpdateReq struct {
 	ProductName   string      `json:"productName"`   // 招标产品名称
 	PublishedTime *gtime.Time `json:"publishedTime"` // 发布招标日期
 	Budget        float64     `json:"budget"`        // 项目预算
+	ProductLine   string      `json:"productLine"`   // 产品线
 	Title         string      `json:"title"`         // 招标信息标题
 	InfoType      string      `json:"infoType"`      // 信息分类
 	Bidder        string      `json:"bidder"`        // 中标单位
+	BiddingTime   *gtime.Time `json:"BiddingTime"`   // 招标日期
 	Remark        *string     `json:"remark"`
 }

+ 3 - 1
opms_parent/app/model/cust/internal/cust_customer_bid_record.go

@@ -15,11 +15,13 @@ type CustCustomerBidRecord struct {
 	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"` // 招标日期
+	BiddingTime   *gtime.Time `orm:"bidding_time"   json:"biddingTime"`   // 招标日期
 	Remark        string      `orm:"remark"         json:"remark"`        // 备注
 	CreatedBy     int         `orm:"created_by"     json:"createdBy"`     // 创建者
 	CreatedName   string      `orm:"created_name"   json:"createdName"`   // 创建人

+ 1 - 0
opms_parent/app/model/proj/proj_business.go

@@ -24,6 +24,7 @@ type ProjBusinessSearchReq struct {
 	NboSource       string `json:"nboSource"`       // 项目来源
 	DistributorName string `json:"distributorName"` // 经销商/代理商名称
 	//FilingTime      *gtime.Time `json:"filingTime"`      // 项目备案时间
+	ProvinceId int `json:"provinceId"`
 	request.PageReq
 }
 

+ 3 - 0
opms_parent/app/service/contract/ctr_contract.go

@@ -244,6 +244,9 @@ func (s CtrContractService) List(ctx context.Context, req *model.CtrContractList
 	if req.CustCityId != 0 {
 		dao = dao.Where("a.cust_city_id = ?", req.CustCityId)
 	}
+	if req.ProductLine != "" {
+		dao = dao.Where("a.product_line = ?", req.ProductLine)
+	}
 
 	total, err := dao.Count()
 	if err != nil {

+ 21 - 0
opms_parent/app/service/cust/cust_customer_bid_record.go

@@ -2,6 +2,7 @@ package cust
 
 import (
 	"context"
+	"dashoo.cn/micro/app/service"
 	"database/sql"
 	"fmt"
 	"github.com/gogf/gf/frame/g"
@@ -58,6 +59,18 @@ func (s CustCustomerBidRecordService) List(ctx context.Context, req *model.CustC
 	ctx = context.WithValue(ctx, "contextService", s)
 	dao := s.CustomerDao.As("customer").DataScope(ctx, "sales_id").
 		LeftJoin(s.Dao.Table, "bid", "bid.cust_id=customer.id").WhereNot("bid.id", 0)
+	//	系统管理员、总经理、销售总监、销售助理看全部的
+	if service.StringsContains(s.userInfo.Roles, "GeneralManager") || service.StringsContains(s.userInfo.Roles, "SalesDirector") || service.StringsContains(s.userInfo.Roles, "SaleAssociate") || service.StringsContains(s.userInfo.Roles, "SysAdmin") {
+
+	} else {
+		// 默认按照产品线
+		productCode, err := service.ColumnString(s.Dao.DB.Table("base_product_auth").Wheref("user_id = ?", s.userInfo.Id), "product_code")
+		if err != nil {
+			return 0, nil, err
+		}
+		g.Log().Infof("CustCustomerBidRecordService List product_code %v", productCode)
+		dao = dao.Where("bid.product_line in (?)", productCode)
+	}
 	if req.SearchText != "" {
 		likestr := fmt.Sprintf("%%%s%%", req.SearchText)
 		dao = dao.Where("(bid.cuct_name LIKE ? || bid.product_name LIKE ? || bid.title LIKE ? || bid.bidder LIKE ?)", likestr, likestr, likestr, likestr)
@@ -134,7 +147,9 @@ func (s CustCustomerBidRecordService) Add(ctx context.Context, req *model.CustCu
 		CuctName:      cust.CustName,
 		ProductName:   req.ProductName,
 		PublishedTime: req.PublishedTime,
+		Status:        "10", // 状态:(10跟进中,20待审批,30已闭环、40已超期)
 		Budget:        req.Budget,
+		ProductLine:   req.ProductLine,
 		Title:         req.Title,
 		InfoType:      req.InfoType,
 		Bidder:        req.Bidder,
@@ -194,6 +209,9 @@ func (s CustCustomerBidRecordService) Update(ctx context.Context, req *model.Cus
 	if req.Budget != 0 {
 		toupdate["budget"] = req.Budget
 	}
+	if req.ProductLine != "" {
+		toupdate["product_line"] = req.ProductLine
+	}
 	if req.Title != "" {
 		toupdate["title"] = req.Title
 	}
@@ -203,6 +221,9 @@ func (s CustCustomerBidRecordService) Update(ctx context.Context, req *model.Cus
 	if req.Bidder != "" {
 		toupdate["bidder"] = req.Bidder
 	}
+	if req.BiddingTime != nil {
+		toupdate["bidding_time"] = req.BiddingTime
+	}
 	if req.Remark != nil {
 		toupdate["remark"] = *req.Remark
 	}

+ 3 - 0
opms_parent/app/service/proj/business.go

@@ -73,6 +73,9 @@ func (p *businessService) GetList(req *model.ProjBusinessSearchReq) (total int,
 	if req.EndTime != "" {
 		db = db.WhereLTE("proj."+p.Dao.C.FilingTime, req.EndTime)
 	}
+	if req.ProvinceId != 0 {
+		db = db.Where("proj."+p.Dao.C.CustProvinceId, req.ProvinceId)
+	}
 	total, err = db.Count()
 	if err != nil {
 		err = myerrors.DbError("获取总行数失败。")