zhangchuanxing před 6 dny
rodič
revize
24dc572d37

+ 3 - 0
controllers/company.go

@@ -2906,6 +2906,9 @@ func (this *CompanyController) Add() {
 	if req.Status == utils.COMPANY_STATUS_TRY_OUT {
 		item.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
 		item.CompanyType = 2
+		if productId == utils.COMPANY_PRODUCT_RAI_ID {
+			item.EndDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate) // 权益客户试用期改为1个月
+		}
 	}
 
 	item.FirstStartDate = item.StartDate

+ 11 - 2
controllers/company_apply.go

@@ -1406,7 +1406,11 @@ func (this *CompanyApplyController) ApplyThawOld() {
 					delayItem.CompanyApplyId = companyApprovalId
 					delayItem.ChartPermissionId = permissionId
 					delayItem.StartDate = time.Now().Format(utils.FormatDate)
-					delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+					if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+						delayItem.EndDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate)
+					} else {
+						delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+					}
 					delayItem.CreateTime = time.Now()
 					delayItem.ModifyTime = time.Now()
 					err = company.AddCompanyDelayPermission(delayItem)
@@ -1599,7 +1603,12 @@ func (this *CompanyApplyController) ApplyDelayOld() {
 							delayItem.CompanyApplyId = companyApprovalId
 							delayItem.ChartPermissionId = permissionId
 							delayItem.StartDate = time.Now().Format(utils.FormatDate)
-							delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+							if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+								delayItem.EndDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate)
+							} else {
+								delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+							}
+
 							delayItem.CreateTime = time.Now()
 							delayItem.ModifyTime = time.Now()
 							err = company.AddCompanyDelayPermission(delayItem)

+ 11 - 2
controllers/company_apply_v2.go

@@ -1636,7 +1636,11 @@ func (this *CompanyApplyController) ApplyThaw() {
 					delayItem.CompanyApplyId = companyApprovalId
 					delayItem.ChartPermissionId = permissionId
 					delayItem.StartDate = time.Now().Format(utils.FormatDate)
-					delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+					if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+						delayItem.EndDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate)
+					} else {
+						delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+					}
 					delayItem.CreateTime = time.Now()
 					delayItem.ModifyTime = time.Now()
 					err = company.AddCompanyDelayPermission(delayItem)
@@ -2139,7 +2143,12 @@ func (this *CompanyApplyController) ApplyReceive() {
 					delayItem.CompanyApplyId = companyApprovalId
 					delayItem.ChartPermissionId = permissionId
 					delayItem.StartDate = time.Now().Format(utils.FormatDate)
-					delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+					if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+						delayItem.EndDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate)
+					} else {
+						delayItem.EndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+					}
+
 					delayItem.CreateTime = time.Now()
 					delayItem.ModifyTime = time.Now()
 					err = company.AddCompanyDelayPermission(delayItem)

+ 3 - 0
controllers/company_permission.go

@@ -932,6 +932,9 @@ func (this *CompanyPermissionController) PermissionAddTryOut() {
 	companyReportPermissionList := make([]*company.CompanyReportPermission, 0) //添加的品种
 	startDateTime := time.Now()
 	endDateTime := startDateTime.AddDate(0, 2, 0)
+	if product == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+		endDateTime = startDateTime.AddDate(0, 1, 0)
+	}
 	for _, v := range permissionArr {
 		permissionId, _ := strconv.Atoi(v)
 		count, err := company.GetCompanyPermissionCheck(req.CompanyId, permissionId)

+ 5 - 1
models/company/company.go

@@ -965,7 +965,11 @@ func MoveSeller(companyId, productId, sellerId, groupId, departmentId int, selle
 	}()
 
 	startDateTime = time.Now()
-	endDateTime = time.Now().AddDate(0, 2, 0)
+	if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+		endDateTime = time.Now().AddDate(0, 1, 0)
+	} else {
+		endDateTime = time.Now().AddDate(0, 2, 0)
+	}
 
 	startDate := startDateTime.Format(utils.FormatDate)
 	endDate := endDateTime.Format(utils.FormatDate)

+ 9 - 0
models/company/company_approval.go

@@ -403,6 +403,9 @@ func FreezeToTryOut(companyId, productId, sellerId, companyApprovalId, applyUser
 	}()
 	startDate = time.Now().Format(utils.FormatDate)
 	endDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+	if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+		endDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate)
+	}
 
 	//sellerItem, err := system.GetSysAdminById(applyUserId)
 	//if err != nil {
@@ -643,6 +646,9 @@ func TryOutDelay(companyId, productId, sellerId, companyApprovalId int, sellerNa
 		return
 	}
 	newEndDate = endDateTime.AddDate(0, 2, 0).Format(utils.FormatDate)
+	if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+		newEndDate = endDateTime.AddDate(0, 1, 0).Format(utils.FormatDate)
+	}
 	//更新用户产品状态
 	sql := `UPDATE company_product SET approve_status='已审批',is_suspend=0,end_date=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
 	_, err = to.Raw(sql, newEndDate, companyId, productId).Exec()
@@ -767,6 +773,9 @@ func ApplyReceive(companyId, productId, sysUserId, companyApprovalId int, seller
 
 	startDate = time.Now().Format(utils.FormatDate)
 	endDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
+	if productId == utils.COMPANY_PRODUCT_RAI_ID { // 权益客户试用期改为1个月。 需求池 1035
+		endDate = time.Now().AddDate(0, 1, 0).Format(utils.FormatDate)
+	}
 
 	//更新用户产品状态
 	sql := `UPDATE company_product SET status='试用',try_out_time=NULL,last_description_time=NULL,is_suspend=0,approve_status='已审批', start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `