|
@@ -180,7 +180,7 @@ func GetApprovalCount(condition string, pars []interface{}) (count int, err erro
|
|
|
}
|
|
|
|
|
|
|
|
|
-func TryOutToFormal(companyId, productId, sellerId, companyApprovalId, companyContractId int, startDate, endDate, sellerName, productName string, packageType int) (newCompanyReportPermissionList []*company_report_permission.CompanyReportPermission, err error) {
|
|
|
+func TryOutToFormal(companyId, productId, sellerId, companyApprovalId, companyContractId int, startDate, endDate, sellerName, productName string, packageType, raiPackageType int) (newCompanyReportPermissionList []*company_report_permission.CompanyReportPermission, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
tx, err := o.Begin()
|
|
|
if err != nil {
|
|
@@ -195,15 +195,15 @@ func TryOutToFormal(companyId, productId, sellerId, companyApprovalId, companyCo
|
|
|
}()
|
|
|
|
|
|
|
|
|
- sql := `UPDATE company_product SET status='正式',try_out_time=NULL,last_description_time=NULL,freeze_time=NULL,renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',start_date=?,end_date=?,package_type=?,modify_time=NOW(),formal_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
+ sql := `UPDATE company_product SET status='正式',try_out_time=NULL,last_description_time=NULL,freeze_time=NULL,renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',start_date=?,end_date=?,package_type=?,rai_package_type=?,modify_time=NOW(),formal_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
if packageType == 0 {
|
|
|
- sql = `UPDATE company_product SET status='正式',try_out_time=NULL,last_description_time=NULL,freeze_time=NULL,renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',start_date=?,end_date=?,modify_time=NOW(),formal_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
- _, err = tx.Raw(sql, startDate, endDate, companyId, productId).Exec()
|
|
|
+ sql = `UPDATE company_product SET status='正式',try_out_time=NULL,last_description_time=NULL,freeze_time=NULL,renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',start_date=?,end_date=?,rai_package_type=?,modify_time=NOW(),formal_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
+ _, err = tx.Raw(sql, startDate, endDate, raiPackageType, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
- _, err = tx.Raw(sql, startDate, endDate, packageType, companyId, productId).Exec()
|
|
|
+ _, err = tx.Raw(sql, startDate, endDate, packageType, raiPackageType, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -264,6 +264,7 @@ func TryOutToFormal(companyId, productId, sellerId, companyApprovalId, companyCo
|
|
|
Status: "正式",
|
|
|
ModifyTime: time.Now(),
|
|
|
IsUpgrade: pv.IsUpgrade,
|
|
|
+ ExpensiveYx: pv.ExpensiveYx,
|
|
|
}
|
|
|
newId, tmpErr := tx.Insert(tmpCompanyReportPermission)
|
|
|
if tmpErr != nil {
|
|
@@ -651,7 +652,7 @@ func ApplyReceive(companyId, productId, sysUserId, companyApprovalId, applyUserI
|
|
|
}
|
|
|
|
|
|
|
|
|
-func ApplyServiceUpdate(companyId, productId, sellerId, companyApprovalId, companyContractId int, startDate, endDate, sellerName, productName string, packageType int) (newCompanyReportPermissionList []*company_report_permission.CompanyReportPermission, err error) {
|
|
|
+func ApplyServiceUpdate(companyId, productId, sellerId, companyApprovalId, companyContractId int, startDate, endDate, sellerName, productName string, packageType, raiPackageType int) (newCompanyReportPermissionList []*company_report_permission.CompanyReportPermission, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
tx, err := o.Begin()
|
|
|
if err != nil {
|
|
@@ -734,14 +735,14 @@ func ApplyServiceUpdate(companyId, productId, sellerId, companyApprovalId, compa
|
|
|
|
|
|
if packageType == 0 {
|
|
|
|
|
|
- sql = `UPDATE company_product SET status='正式',is_formal=1,is_suspend=0,approve_status='已审批',start_date=?,end_date=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
- _, err = tx.Raw(sql, updateStartDateTime, updateEndDateTime, companyId, productId).Exec()
|
|
|
+ sql = `UPDATE company_product SET status='正式',is_formal=1,is_suspend=0,approve_status='已审批',start_date=?,end_date=?,rai_package_type=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
+ _, err = tx.Raw(sql, updateStartDateTime, updateEndDateTime, raiPackageType, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
- sql = `UPDATE company_product SET status='正式',is_formal=1,is_suspend=0,approve_status='已审批',start_date=?,end_date=?,package_type=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
- _, err = tx.Raw(sql, updateStartDateTime, updateEndDateTime, packageType, companyId, productId).Exec()
|
|
|
+ sql = `UPDATE company_product SET status='正式',is_formal=1,is_suspend=0,approve_status='已审批',start_date=?,end_date=?,package_type=?,rai_package_type=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
|
|
|
+ _, err = tx.Raw(sql, updateStartDateTime, updateEndDateTime, packageType, raiPackageType, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -793,7 +794,9 @@ func ApplyServiceUpdate(companyId, productId, sellerId, companyApprovalId, compa
|
|
|
nowPermission.ModifyTime = time.Now()
|
|
|
nowPermission.CompanyContractId = pv.CompanyContractId
|
|
|
nowPermission.Status = "正式"
|
|
|
- _, err = tx.Update(nowPermission, "EndDate", "LastUpdatedTime", "ModifyTime", "CompanyContractId", "Status")
|
|
|
+ nowPermission.IsUpgrade = pv.IsUpgrade
|
|
|
+ nowPermission.ExpensiveYx = pv.ExpensiveYx
|
|
|
+ _, err = tx.Update(nowPermission, "EndDate", "LastUpdatedTime", "ModifyTime", "CompanyContractId", "Status", "IsUpgrade", "ExpensiveYx")
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -819,9 +822,10 @@ func ApplyServiceUpdate(companyId, productId, sellerId, companyApprovalId, compa
|
|
|
ProductId: productId,
|
|
|
ProductName: productName,
|
|
|
|
|
|
- Status: "正式",
|
|
|
- ModifyTime: time.Now(),
|
|
|
-
|
|
|
+ Status: "正式",
|
|
|
+ ModifyTime: time.Now(),
|
|
|
+ IsUpgrade: pv.IsUpgrade,
|
|
|
+ ExpensiveYx: pv.ExpensiveYx,
|
|
|
}
|
|
|
newId, tmpErr := tx.Insert(nowPermission)
|
|
|
if tmpErr != nil {
|