xingzai 9 месяцев назад
Родитель
Сommit
7cc2cb3ae2
1 измененных файлов с 38 добавлено и 0 удалено
  1. 38 0
      services/cygx/contract_allocation.go

+ 38 - 0
services/cygx/contract_allocation.go

@@ -865,6 +865,7 @@ func UpdateCygxallocationCompanyContractByEnterScore(itemsPermissionEnterScore [
 		companyContractIds = append(companyContractIds, v.CompanyContractId)
 	}
 
+	fmt.Println("companyContractIds", companyContractIds)
 	var items []*cygx.CygxAllocationCompanyContract
 	var itemsPermission []*cygx.CygxAllocationCompanyContractPermission
 
@@ -914,3 +915,40 @@ func UpdateCygxallocationCompanyContractByEnterScore(itemsPermissionEnterScore [
 	return
 
 }
+
+//func init15_4_1() {
+//	UpdateCygxallocationCompanyContractByEnterScoreInit()
+//	//"SELECT  *  FROM company_contract WHERE   company_id IN (SELECT  company_id   FROM company_product WHERE  product_id = 2  AND init_status = '永续' ) AND  product_id = 2 ;"
+//}
+
+func UpdateCygxallocationCompanyContractByEnterScoreInit() {
+	var condition string
+	var pars []interface{}
+	listEnterScore, err := cygx.GetCygxEnterScoreList(condition, pars, 0, 999)
+	if err != nil {
+		fmt.Println(err)
+		return
+	}
+	for _, v := range listEnterScore {
+		fmt.Println("v.EnterScoreId", v.EnterScoreId)
+		listPermission, err := cygx.GetCygxEnterScorePermissionListById(v.EnterScoreId)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
+
+		listResearcher, err := cygx.GeCygxEnterScoreResearcherListById(v.EnterScoreId)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
+		sysUser, err := system.GetSysUserById(v.AdminId)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
+		go UpdateCygxallocationCompanyContractByEnterScore(listPermission, listResearcher, v.StartDate, v.EndDate, v.CompanyId, sysUser)
+	}
+	fmt.Println("END")
+	return
+}