ziwen 2 년 전
부모
커밋
0c8d0ee91d
2개의 변경된 파일32개의 추가작업 그리고 15개의 파일을 삭제
  1. 30 15
      controller/crm/contract.go
  2. 2 0
      models/crm/contract.go

+ 30 - 15
controller/crm/contract.go

@@ -92,21 +92,36 @@ 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),
+		}
+		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)

+ 2 - 0
models/crm/contract.go

@@ -88,6 +88,8 @@ type ContractSearchListResp struct {
 	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合同类型: 新签合同; 续约合同; 补充协议;"`
+	ContractTypeInt    int  `json:"contract_type_int" description:"CRM合同类型: 1新签合同; 2续约合同; 3补充协议;"`
+	ContractBusinessTypeInt    int  `json:"contract_business_type_int" description:"合同业务类型,1'业务合同', 2'代付合同;"`
 	Price           float64 `json:"price" description:"合同金额"`
 	StartDate       string  `json:"start_date" description:"合同开始日期"`
 	EndDate         string  `json:"end_date" description:"合同结束日期"`