ソースを参照

Merge branch 'fms_2.5' into debug

ziwen 2 年 前
コミット
9a1578a613
2 ファイル変更13 行追加9 行削除
  1. 12 8
      controller/contract/pre_register.go
  2. 1 1
      models/fms/contract_pre_payment.go

+ 12 - 8
controller/contract/pre_register.go

@@ -392,13 +392,17 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
 		resp.Fail("最多只能选择两个销售", c)
 		return
 	}
+	var sellers []*crm.Admin
 	var pars []interface{}
-	cond := ` admin_id in (?) `
-	pars = append(pars, sellerIds)
-	sellers, e := admin.List(cond, pars)
-	if e != nil {
-		resp.FailMsg("获取销售信息失败", "获取销售信息失败, Err: "+e.Error(), c)
-		return
+	cond := ``
+	if len(sellerIds) > 0 {
+		cond = ` admin_id in (?) `
+		pars = append(pars, sellerIds)
+		sellers, e = admin.List(cond, pars)
+		if e != nil {
+			resp.FailMsg("获取销售信息失败", "获取销售信息失败, Err: "+e.Error(), c)
+			return
+		}
 	}
 
 	//修改合同
@@ -548,7 +552,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
 			pp.ArriveAmount = a
 		}
 		ppList = append(ppList, pp)
-
+		//todo 更新
 	}
 	invoiceUpdateCols := []string{
 		"CurrencyUnit", "Amount", "InvoiceDate", "AdminId", "AdminName", "Remark",
@@ -779,7 +783,7 @@ func (rg *PreRegisterController) Detail(c *gin.Context) {
 	serviceTemplateIdSlice := make([]string, 0)
 	for _, service := range services {
 		if service.Title == "FICC小套餐" {
-			serviceTemplateIdSlice = strings.Split(service.ChartPermissionIds,",")
+			serviceTemplateIdSlice = strings.Split(service.ChartPermissionIds, ",")
 		}
 	}
 

+ 1 - 1
models/fms/contract_pre_payment.go

@@ -157,7 +157,7 @@ type PreRegisterEditReq struct {
 	EndDate            string `json:"end_date" binding:"required" description:"约定结束日期"`
 	RegisterType       int    `json:"register_type" description:"预登记类型 3-开票预登记 4-到款预登记"`
 	ProductIds         string `gorm:"column:product_ids" json:"product_ids" description:"产品ID:1-FICC; 2-权益, 如果两者都有,则用英文逗号拼接"`
-	SellerIds          string `json:"seller_ids" binding:"required" description:"CRM系统-销售ID"`
+	SellerIds          string `json:"seller_ids" description:"CRM系统-销售ID"`
 	List               []*PreRegisterEditReqItem
 	Services           []ContractServiceAddReq `json:"services" description:"服务套餐内容"`
 }