瀏覽代碼

Merge branch 'crm_16.6' of http://8.136.199.33:3000/hongze/fms_api into debug

zhangchuanxing 3 周之前
父節點
當前提交
5e90b8ce73
共有 2 個文件被更改,包括 36 次插入25 次删除
  1. 19 8
      controller/crm/contract.go
  2. 17 17
      models/crm/contract.go

+ 19 - 8
controller/crm/contract.go

@@ -324,15 +324,26 @@ func (rg *ContractController) SealList(c *gin.Context) {
 
 	respList := make([]*crm.ContractSearchListResp, 0)
 	for i := range list {
+		var contractTypeInt int
+		if list[i].ServiceType == "新签合同" {
+			contractTypeInt = 1
+		} else if list[i].ServiceType == "新签合同" {
+			contractTypeInt = 2
+		} else {
+			contractTypeInt = 3
+		}
 		respItem := &crm.ContractSearchListResp{
-			ContractId:   list[i].SealId,
-			ContractCode: list[i].Code,
-			ProductId:    list[i].ProductId,
-			CompanyName:  list[i].CompanyName,
-			SellerId:     list[i].UserId,
-			SellerName:   list[i].UserName,
-			StartDate:    utils.TimeTransferString(utils.FormatDate, list[i].StartDate),
-			EndDate:      utils.TimeTransferString(utils.FormatDate, list[i].EndDate),
+			ContractId:              list[i].SealId,
+			ContractCode:            list[i].Code,
+			ProductId:               list[i].ProductId,
+			CompanyName:             list[i].CompanyName,
+			SellerId:                list[i].UserId,
+			SellerName:              list[i].UserName,
+			ContractType:            list[i].ServiceType,
+			ContractTypeInt:         contractTypeInt,
+			ContractBusinessTypeInt: 1, // 业务合同
+			StartDate:               utils.TimeTransferString(utils.FormatDate, list[i].StartDate),
+			EndDate:                 utils.TimeTransferString(utils.FormatDate, list[i].EndDate),
 		}
 		respItem.ContractBusinessTypeInt = 1
 		respList = append(respList, respItem)

+ 17 - 17
models/crm/contract.go

@@ -76,23 +76,23 @@ type ContractSearchListReq struct {
 
 // ContractSearchListResp CRM系统合同-搜索列表响应体
 type ContractSearchListResp struct {
-	ContractId         int     `json:"contract_id" description:"合同ID"`
-	ContractCode       string  `json:"contract_code" description:"合同编号"`
-	ProductId          int     `json:"product_id" description:"产品ID"`
-	CompanyName        string  `json:"company_name" description:"客户名称"`
-	RelateContractCode string  `json:"relate_contract_code" description:"代付合同关联的实际使用方合同编号"`
-	ActualCompanyName  string  `json:"actual_company_name" description:"实际使用方"`
-	SellerId           int     `json:"seller_id" description:"销售ID"`
-	SellerName         string  `json:"seller_name" description:"销售名称"`
-	ContractTypeKey    int     `json:"contract_type_key" description:"FMS合同类型: 1-新签; 2-续约; 3-代付; 4-补充协议;"`
-	ContractType       string  `json:"contract_type" description:"CRM合同类型: 新签合同; 续约合同; 补充协议;"`
-	Price              float64 `json:"price" description:"合同金额"`
-	StartDate          string  `json:"start_date" description:"合同开始日期"`
-	EndDate            string  `json:"end_date" description:"合同结束日期"`
-	ActualPayCompanies string  `json:"actual_pay_companies" description:"该合同关联的所有代付方, 英文逗号拼接"`
-	ContractTypeInt    int  `json:"contract_type_int" description:"CRM合同类型: 1新签合同; 2续约合同; 3补充协议;"`
-	ContractBusinessTypeInt    int  `json:"contract_business_type_int" description:"合同业务类型,1'业务合同', 2'代付合同;"`
-	
+	ContractId              int     `json:"contract_id" description:"合同ID"`
+	ContractCode            string  `json:"contract_code" description:"合同编号"`
+	ProductId               int     `json:"product_id" description:"产品ID"`
+	CompanyName             string  `json:"company_name" description:"客户名称"`
+	RelateContractCode      string  `json:"relate_contract_code" description:"代付合同关联的实际使用方合同编号"`
+	ActualCompanyName       string  `json:"actual_company_name" description:"实际使用方"`
+	SellerId                int     `json:"seller_id" description:"销售ID"`
+	SellerName              string  `json:"seller_name" description:"销售名称"`
+	ContractTypeKey         int     `json:"contract_type_key" description:"FMS合同类型: 1-新签; 2-续约; 3-代付; 4-补充协议;"`
+	ContractType            string  `json:"contract_type" description:"CRM合同类型: 新签合同; 续约合同; 补充协议;"`
+	Price                   float64 `json:"price" description:"合同金额"`
+	StartDate               string  `json:"start_date" description:"合同开始日期"`
+	EndDate                 string  `json:"end_date" description:"合同结束日期"`
+	ActualPayCompanies      string  `json:"actual_pay_companies" description:"该合同关联的所有代付方, 英文逗号拼接"`
+	ContractTypeInt         int     `json:"contract_type_int" description:"CRM合同类型: 1新签合同; 2续约合同; 3补充协议;"`
+	ContractBusinessTypeInt int     `json:"contract_business_type_int" description:"合同业务类型,1'业务合同', 2'代付合同;"`
+	HasPayment              int     `json:"has_payment" description:"是否有代付: 0-无; 1-有"`
 }
 
 // PayCompanyRelation 代付合同