Răsfoiți Sursa

Merge branch 'fms_2.5' into debug

# Conflicts:
#	controller/crm/contract.go
#	models/crm/contract.go
ziwen 2 ani în urmă
părinte
comite
8cc888e870
2 a modificat fișierele cu 34 adăugiri și 16 ștergeri
  1. 31 16
      controller/crm/contract.go
  2. 3 0
      models/crm/contract.go

+ 31 - 16
controller/crm/contract.go

@@ -110,24 +110,39 @@ func (rg *ContractController) SearchList(c *gin.Context) {
 			contractTypeKey = fms.ContractTypeAgentPay
 		}
 
-		respList = append(respList, &crm.ContractSearchListResp{
-			ContractId:         list[i].ContractId,
-			ContractCode:       list[i].ContractCode,
-			ProductId:          list[i].ProductId,
-			CompanyName:        list[i].CompanyName,
-			RelateContractCode: payContractCodeMap[list[i].ContractId],
-			ActualCompanyName:  payCompanyMap[list[i].ContractId],
-			SellerId:           list[i].SellerId,
-			SellerName:         list[i].SellerName,
-			ContractTypeKey:    contractTypeKey,
-			ContractType:       contractType,
-			Price:              list[i].Price,
-			StartDate:          utils.TimeTransferString(utils.FormatDate, list[i].StartDate),
-			EndDate:            utils.TimeTransferString(utils.FormatDate, list[i].EndDate),
+		respItem := &crm.ContractSearchListResp{
+			ContractId:              list[i].ContractId,
+			ContractCode:            list[i].ContractCode,
+			ProductId:               list[i].ProductId,
+			CompanyName:             list[i].CompanyName,
+			RelateContractCode:      payContractCodeMap[list[i].ContractId],
+			ActualCompanyName:       payCompanyMap[list[i].ContractId],
+			SellerId:                list[i].SellerId,
+			SellerName:              list[i].SellerName,
+			ContractTypeKey:         contractTypeKey,
+			ContractType:            contractType,
+			ContractBusinessTypeInt: 0,
+			Price:                   list[i].Price,
+			StartDate:               utils.TimeTransferString(utils.FormatDate, list[i].StartDate),
+			EndDate:                 utils.TimeTransferString(utils.FormatDate, list[i].EndDate),
 			ActualPayCompanies: businessPayMap[list[i].ContractId],
-		})
-	}
+		}
+		if list[i].ContractBusinessType == crm.ContractTypePayment {
+			respItem.ContractBusinessTypeInt = 2
+		}else {
+			respItem.ContractBusinessTypeInt = 1
+		}
+		if list[i].ContractType == "新签合同"{
+			respItem.ContractTypeInt = 1
+		} else if list[i].ContractType == "续约合同"{
+			respItem.ContractTypeInt = 2
+		} else if list[i].ContractType == "补充协议"{
+			respItem.ContractTypeInt = 3
+		}
+		respList = append(respList, respItem)
 
+	}
+	
 	page.SetTotal(total)
 	baseData := new(base.BaseData)
 	baseData.SetPage(page)

+ 3 - 0
models/crm/contract.go

@@ -90,6 +90,9 @@ type ContractSearchListResp struct {
 	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'代付合同;"`
+	
 }
 
 // PayCompanyRelation 代付合同