Prechádzať zdrojové kódy

feature:战略项目组权限及其页面调整

ZZH-wl 1 rok pred
rodič
commit
e59da4695d
76 zmenil súbory, kde vykonal 737 pridanie a 1395 odobranie
  1. 1 8
      opms_admin/app/dao/internal/sys_message.go
  2. 6 6
      opms_admin/app/model/base_product_auth.go
  3. 12 12
      opms_admin/app/service/base_product_auth.go
  4. 1 12
      opms_parent/app/dao/base/internal/base_distributor.go
  5. 1 12
      opms_parent/app/dao/base/internal/base_distributor_contact.go
  6. 1 12
      opms_parent/app/dao/base/internal/base_distributor_dynamics.go
  7. 1 12
      opms_parent/app/dao/base/internal/base_distributor_record.go
  8. 1 12
      opms_parent/app/dao/base/internal/base_distributor_target.go
  9. 1 8
      opms_parent/app/dao/base/internal/base_district.go
  10. 1 8
      opms_parent/app/dao/base/internal/base_product.go
  11. 1 8
      opms_parent/app/dao/base/internal/base_sales_region.go
  12. 1 8
      opms_parent/app/dao/base/internal/base_sales_region_detail.go
  13. 1 12
      opms_parent/app/dao/contract/internal/ctr_contract.go
  14. 1 8
      opms_parent/app/dao/contract/internal/ctr_contract_append.go
  15. 1 8
      opms_parent/app/dao/contract/internal/ctr_contract_collection.go
  16. 1 12
      opms_parent/app/dao/contract/internal/ctr_contract_collection_plan.go
  17. 1 8
      opms_parent/app/dao/contract/internal/ctr_contract_dynamics.go
  18. 1 8
      opms_parent/app/dao/contract/internal/ctr_contract_goal.go
  19. 1 8
      opms_parent/app/dao/contract/internal/ctr_contract_invoice.go
  20. 1 12
      opms_parent/app/dao/contract/internal/ctr_contract_product.go
  21. 128 0
      opms_parent/app/dao/contract/internal/ctr_contract_sale_target.go
  22. 128 0
      opms_parent/app/dao/contract/internal/ctr_contract_share.go
  23. 1 8
      opms_parent/app/dao/cust/internal/cust_customer.go
  24. 1 8
      opms_parent/app/dao/cust/internal/cust_customer_belong.go
  25. 1 8
      opms_parent/app/dao/cust/internal/cust_customer_bid_record.go
  26. 1 8
      opms_parent/app/dao/cust/internal/cust_customer_contact.go
  27. 1 8
      opms_parent/app/dao/cust/internal/cust_customer_dynamics.go
  28. 1 8
      opms_parent/app/dao/cust/internal/cust_customer_invoice_header.go
  29. 1 12
      opms_parent/app/dao/cust/internal/product_consult_record.go
  30. 1 8
      opms_parent/app/dao/dingtalk_log/internal/dingtalk_log.go
  31. 1 12
      opms_parent/app/dao/partner/internal/partner_company.go
  32. 1 12
      opms_parent/app/dao/partner/internal/partner_company_contact.go
  33. 1 12
      opms_parent/app/dao/plat/internal/plat_followup.go
  34. 1 8
      opms_parent/app/dao/plat/internal/plat_followup_comment.go
  35. 1 8
      opms_parent/app/dao/plat/internal/plat_followup_file.go
  36. 1 8
      opms_parent/app/dao/plat/internal/plat_punch_records.go
  37. 1 8
      opms_parent/app/dao/plat/internal/plat_questionnaire.go
  38. 1 8
      opms_parent/app/dao/plat/internal/plat_schedule.go
  39. 1 8
      opms_parent/app/dao/plat/internal/plat_schedule_attendee.go
  40. 1 8
      opms_parent/app/dao/plat/internal/plat_schedule_remind.go
  41. 1 8
      opms_parent/app/dao/plat/internal/plat_tablecols_config.go
  42. 1 8
      opms_parent/app/dao/plat/internal/plat_task.go
  43. 1 8
      opms_parent/app/dao/plat/internal/plat_task_comment.go
  44. 1 8
      opms_parent/app/dao/plat/internal/plat_task_handle.go
  45. 1 8
      opms_parent/app/dao/plat/internal/plat_task_log.go
  46. 1 8
      opms_parent/app/dao/plat/internal/plat_task_progress.go
  47. 1 8
      opms_parent/app/dao/plat/internal/plat_user_config.go
  48. 7 12
      opms_parent/app/dao/proj/internal/proj_business.go
  49. 1 8
      opms_parent/app/dao/proj/internal/proj_business_contact.go
  50. 1 8
      opms_parent/app/dao/proj/internal/proj_business_dynamics.go
  51. 1 8
      opms_parent/app/dao/proj/internal/proj_business_file.go
  52. 1 8
      opms_parent/app/dao/proj/internal/proj_business_product.go
  53. 1 8
      opms_parent/app/dao/proj/internal/proj_business_team.go
  54. 1 8
      opms_parent/app/dao/sys_report/internal/sys_report.go
  55. 1 8
      opms_parent/app/dao/sys_report/internal/sys_role_report.go
  56. 128 0
      opms_parent/app/dao/work/internal/deliver_order.go
  57. 1 12
      opms_parent/app/dao/work/internal/deliver_order_imp_plan.go
  58. 1 12
      opms_parent/app/dao/work/internal/deliver_order_imp_progress.go
  59. 128 0
      opms_parent/app/dao/work/internal/deliver_order_imp_progress_log.go
  60. 1 12
      opms_parent/app/dao/work/internal/deliver_order_product.go
  61. 1 12
      opms_parent/app/dao/work/internal/deliver_progress_product.go
  62. 1 12
      opms_parent/app/dao/work/internal/work_order.go
  63. 0 799
      opms_parent/app/dao/work/internal/work_order_1.go
  64. 1 8
      opms_parent/app/dao/work/internal/work_order_dynamics.go
  65. 1 8
      opms_parent/app/dao/work/internal/work_order_feedback.go
  66. 1 8
      opms_parent/app/dao/work/internal/work_order_feedback_file.go
  67. 1 12
      opms_parent/app/dao/work/internal/work_order_feedback_trial.go
  68. 1 8
      opms_parent/app/dao/work/internal/work_order_type.go
  69. 1 8
      opms_parent/app/dao/workflow/internal/plat_workflow.go
  70. 32 0
      opms_parent/app/handler/proj/business.go
  71. 2 0
      opms_parent/app/model/proj/internal/proj_business.go
  72. 1 1
      opms_parent/app/model/proj/proj_business.go
  73. 99 1
      opms_parent/app/service/proj/business.go
  74. 1 0
      opms_parent/app/service/proj/const.go
  75. BIN
      opms_parent/app/static/项目跟进1680592053758030700.xlsx
  76. 4 4
      opms_parent/config/config.toml

+ 1 - 8
opms_admin/app/dao/internal/sys_message.go

@@ -744,14 +744,7 @@ func (d *SysMessageDao) DataScope(ctx context.Context, args ...interface{}) *Sys
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok || specialFlag {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 6 - 6
opms_admin/app/model/base_product_auth.go

@@ -39,12 +39,12 @@ type BaseProductAuthSearchReq struct {
 
 // SaveBaseProductAuthReq 产品线更新
 type SaveBaseProductAuthReq struct {
-	UserId    int            `orm:"user_id"    json:"userId"      v:"required|min:1#用户ID不能为空|用户ID不能为空"` // 用户ID
-	UserName  string         `orm:"user_name"  json:"userName"    v:"required#用户姓名不能为空"`                // 用户姓名
-	UserPost  string         `orm:"user_post"  json:"userPost"`                                         // 岗位
-	UserPhone string         `orm:"user_phone" json:"userPhone"`                                        // 电话
-	IsBig     string         `orm:"is_big"     json:"isBig"       v:"required#大项目授权不能为空"`               // 大项目授权10是20否
-	Lines     []*ProductLine `json:"lines"`
+	UserId    int    `orm:"user_id"    json:"userId"      v:"required|min:1#用户ID不能为空|用户ID不能为空"` // 用户ID
+	UserName  string `orm:"user_name"  json:"userName"    v:"required#用户姓名不能为空"`                // 用户姓名
+	UserPost  string `orm:"user_post"  json:"userPost"`                                         // 岗位
+	UserPhone string `orm:"user_phone" json:"userPhone"`                                        // 电话
+	//IsBig     string         `orm:"is_big"     json:"isBig"       v:"required#大项目授权不能为空"`               // 大项目授权10是20否
+	Lines []*ProductLine `json:"lines"`
 }
 
 // ProductLine 产品线

+ 12 - 12
opms_admin/app/service/base_product_auth.go

@@ -80,24 +80,24 @@ func (s *lineService) Save(req *model.SaveBaseProductAuthReq) (err error) {
 			ProductCode: line.ProductCode,
 			ProductName: line.ProductName,
 			Remark:      line.Remark,
-			IsBig:       req.IsBig,
+			//IsBig:       req.IsBig,
 		}
 		SetCreatedInfo(data, s.GetCxtUserId(), s.GetCxtUserName())
 		SetUpdatedInfo(data, s.GetCxtUserId(), s.GetCxtUserName())
 
 		newLines = append(newLines, data)
 	}
-	if len(newLines) == 0 && req.IsBig == "10" {
-		data := &model.BaseProductAuth{
-			UserId:    req.UserId,
-			UserName:  req.UserName,
-			UserPhone: req.UserPhone,
-			UserPost:  req.UserPost,
-			IsBig:     req.IsBig,
-		}
-		SetCreatedInfo(data, s.GetCxtUserId(), s.GetCxtUserName())
-		newLines = append(newLines, data)
-	}
+	//if len(newLines) == 0 && req.IsBig == "10" {
+	//	data := &model.BaseProductAuth{
+	//		UserId:    req.UserId,
+	//		UserName:  req.UserName,
+	//		UserPhone: req.UserPhone,
+	//		UserPost:  req.UserPost,
+	//		IsBig:     req.IsBig,
+	//	}
+	//	SetCreatedInfo(data, s.GetCxtUserId(), s.GetCxtUserName())
+	//	newLines = append(newLines, data)
+	//}
 	if len(newLines) > 0 {
 		_, err = s.Dao.Save(newLines)
 	}

+ 1 - 12
opms_parent/app/dao/base/internal/base_distributor.go

@@ -864,22 +864,11 @@ func (d *BaseDistributorDao) checkColumnsName(dataScope map[string]interface{},
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/base/internal/base_distributor_contact.go

@@ -804,22 +804,11 @@ func (d *BaseDistributorContactDao) checkColumnsName(dataScope map[string]interf
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/base/internal/base_distributor_dynamics.go

@@ -798,22 +798,11 @@ func (d *BaseDistributorDynamicsDao) checkColumnsName(dataScope map[string]inter
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/base/internal/base_distributor_record.go

@@ -813,22 +813,11 @@ func (d *BaseDistributorRecordDao) checkColumnsName(dataScope map[string]interfa
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/base/internal/base_distributor_target.go

@@ -801,22 +801,11 @@ func (d *BaseDistributorTargetDao) checkColumnsName(dataScope map[string]interfa
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 8
opms_parent/app/dao/base/internal/base_district.go

@@ -726,14 +726,7 @@ func (d *BaseDistrictDao) DataScope(ctx context.Context, userCol ...string) *Bas
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/base/internal/base_product.go

@@ -732,14 +732,7 @@ func (d *BaseProductDao) DataScope(ctx context.Context, userCol ...string) *Base
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/base/internal/base_sales_region.go

@@ -720,14 +720,7 @@ func (d *BaseSalesRegionDao) DataScope(ctx context.Context, userCol ...string) *
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/base/internal/base_sales_region_detail.go

@@ -723,14 +723,7 @@ func (d *BaseSalesRegionDetailDao) DataScope(ctx context.Context, userCol ...str
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 12
opms_parent/app/dao/contract/internal/ctr_contract.go

@@ -901,22 +901,11 @@ func (d *CtrContractDao) checkColumnsName(dataScope map[string]interface{}, args
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 8
opms_parent/app/dao/contract/internal/ctr_contract_append.go

@@ -720,14 +720,7 @@ func (d *CtrContractAppendDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/contract/internal/ctr_contract_collection.go

@@ -747,14 +747,7 @@ func (d *CtrContractCollectionDao) DataScope(ctx context.Context, args ...interf
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok || specialFlag {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 12
opms_parent/app/dao/contract/internal/ctr_contract_collection_plan.go

@@ -814,22 +814,11 @@ func (d *CtrContractCollectionPlanDao) checkColumnsName(dataScope map[string]int
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 8
opms_parent/app/dao/contract/internal/ctr_contract_dynamics.go

@@ -726,14 +726,7 @@ func (d *CtrContractDynamicsDao) DataScope(ctx context.Context, userCol ...strin
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/contract/internal/ctr_contract_goal.go

@@ -717,14 +717,7 @@ func (d *CtrContractGoalDao) DataScope(ctx context.Context, userCol ...string) *
 				orValues = append(orValues, userIds)
 			}
 		}
-		bigColumns := "is_big"
-		if ok, _ := d.M.HasField("is_big"); ok {
-			if val, ok := dataScope[bigColumns]; ok && val != "" {
-				orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-				orValues = append(orValues, val)
-			}
-			delete(dataScope, bigColumns)
-		}
+
 		var andColumns []string
 		var andValues []interface{}
 		for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/contract/internal/ctr_contract_invoice.go

@@ -768,14 +768,7 @@ func (d *CtrContractInvoiceDao) DataScope(ctx context.Context, args ...interface
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok || specialFlag {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 12
opms_parent/app/dao/contract/internal/ctr_contract_product.go

@@ -841,22 +841,11 @@ func (d *CtrContractProductDao) checkColumnsName(dataScope map[string]interface{
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 128 - 0
opms_parent/app/dao/contract/internal/ctr_contract_sale_target.go

@@ -7,9 +7,13 @@ package internal
 import (
 	"context"
 	"database/sql"
+	"fmt"
+	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/frame/gmvc"
+	"github.com/gogf/gf/util/gconv"
+	"strings"
 	"time"
 
 	model "dashoo.cn/micro/app/model/contract"
@@ -788,3 +792,127 @@ func (d *CtrContractSaleTargetDao) LockShared() *CtrContractSaleTargetDao {
 func (d *CtrContractSaleTargetDao) Unscoped() *CtrContractSaleTargetDao {
 	return &CtrContractSaleTargetDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
 }
+
+// DataScope enables the DataScope feature.
+func (d *CtrContractSaleTargetDao) DataScope(ctx context.Context, args ...interface{}) *CtrContractSaleTargetDao {
+	cs := ctx.Value("contextService")
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
+	if dataScope != nil {
+		// 销售工程师判断
+		var salesEngineerFlag bool
+		if roles, ok := dataScope["roles"]; ok {
+			arr := garray.NewArrayFrom(roles.([]interface{}), true)
+			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
+				salesEngineerFlag = true
+			}
+		}
+		userIds, ok := dataScope["userIds"]
+		specialFlag, userCols, orColsMap := d.checkColumnsName(dataScope, args...)
+
+		var orColumns []string
+		var orValues []interface{}
+		if ok && userIds != "-1" {
+			for _, column := range userCols {
+				if ok, _ := d.M.HasField(column); ok || specialFlag {
+					orColumns = append(orColumns, column+" IN (?) ")
+					orValues = append(orValues, userIds)
+				}
+			}
+		}
+		for col, params := range orColsMap {
+			if ok, _ := d.M.HasField(col); ok || specialFlag {
+				orColumns = append(orColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+				orValues = append(orValues, params)
+			}
+		}
+
+		// 销售工程师权限加成
+		if !salesEngineerFlag {
+			var andColumns []string
+			var andValues []interface{}
+			for col, params := range dataScope {
+				if ok, _ := d.M.HasField(col); ok || specialFlag {
+					andColumns = append(andColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+					andValues = append(andValues, params)
+				}
+			}
+			if len(andColumns) > 0 {
+				andWhereSql := strings.Join(andColumns, " AND ")
+				orColumns = append(orColumns, "("+andWhereSql+")")
+				orValues = append(orValues, andValues...)
+			}
+		}
+
+		whereSql := strings.Join(orColumns, " OR ")
+		return &CtrContractSaleTargetDao{M: d.M.Where(whereSql, orValues...).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+	}
+	return d
+}
+
+// args 1、字段
+// args 2、字段、表名
+// args 3、字段对应关系
+func (d *CtrContractSaleTargetDao) checkColumnsName(dataScope map[string]interface{}, args ...interface{}) (bool, []string, map[string]interface{}) {
+	var userCols []string
+	tableAs, specialFlag := "", false
+	orColsMap, colsContrast := map[string]interface{}{}, map[string]interface{}{}
+
+	if d.TableAs != "" && len(args) <= 1 {
+		tableAs = d.TableAs + "."
+	}
+	if len(args) > 1 {
+		specialFlag = true
+		if val, ok := args[1].(string); ok {
+			tableAs = val + "."
+		}
+	}
+	if len(args) > 0 {
+		userCols = []string{tableAs + "created_by"}
+		if column, ok := args[0].(string); ok {
+			userCols = []string{tableAs + column}
+		}
+		if cols, ok := args[0].([]string); ok {
+			for _, v := range cols {
+				userCols = append(userCols, tableAs+v)
+			}
+		}
+		if val, ok := args[0].(map[string]interface{}); ok {
+			specialFlag = true
+			colsContrast = val
+			if orcols, ok := val["orcols"]; ok {
+				if col, ok := orcols.(string); ok && gconv.String(val[col]) != "" {
+					orColsMap[col] = val[col]
+					delete(colsContrast, col)
+				}
+				if cols, ok := orcols.([]string); ok {
+					for _, col := range cols {
+						if gconv.String(val[col]) == "" {
+							continue
+						}
+						orColsMap[col] = val[col]
+						delete(colsContrast, col)
+					}
+				}
+			}
+			delete(colsContrast, "orcols")
+		}
+	}
+
+	delete(dataScope, "userIds")
+	delete(dataScope, "roles")
+	delete(dataScope, "posts")
+
+	if len(colsContrast) > 0 {
+		for k, v := range dataScope {
+			if data, ok := colsContrast[k]; ok {
+				dataScope[data.(string)] = v
+			}
+			delete(dataScope, k)
+			delete(colsContrast, k)
+		}
+		for k, v := range colsContrast {
+			dataScope[k] = v
+		}
+	}
+	return specialFlag, userCols, orColsMap
+}

+ 128 - 0
opms_parent/app/dao/contract/internal/ctr_contract_share.go

@@ -7,9 +7,13 @@ package internal
 import (
 	"context"
 	"database/sql"
+	"fmt"
+	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/frame/gmvc"
+	"github.com/gogf/gf/util/gconv"
+	"strings"
 	"time"
 
 	model "dashoo.cn/micro/app/model/contract"
@@ -695,3 +699,127 @@ func (d *CtrContractShareDao) LockShared() *CtrContractShareDao {
 func (d *CtrContractShareDao) Unscoped() *CtrContractShareDao {
 	return &CtrContractShareDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
 }
+
+// DataScope enables the DataScope feature.
+func (d *CtrContractShareDao) DataScope(ctx context.Context, args ...interface{}) *CtrContractShareDao {
+	cs := ctx.Value("contextService")
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
+	if dataScope != nil {
+		// 销售工程师判断
+		var salesEngineerFlag bool
+		if roles, ok := dataScope["roles"]; ok {
+			arr := garray.NewArrayFrom(roles.([]interface{}), true)
+			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
+				salesEngineerFlag = true
+			}
+		}
+		userIds, ok := dataScope["userIds"]
+		specialFlag, userCols, orColsMap := d.checkColumnsName(dataScope, args...)
+
+		var orColumns []string
+		var orValues []interface{}
+		if ok && userIds != "-1" {
+			for _, column := range userCols {
+				if ok, _ := d.M.HasField(column); ok || specialFlag {
+					orColumns = append(orColumns, column+" IN (?) ")
+					orValues = append(orValues, userIds)
+				}
+			}
+		}
+		for col, params := range orColsMap {
+			if ok, _ := d.M.HasField(col); ok || specialFlag {
+				orColumns = append(orColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+				orValues = append(orValues, params)
+			}
+		}
+
+		// 销售工程师权限加成
+		if !salesEngineerFlag {
+			var andColumns []string
+			var andValues []interface{}
+			for col, params := range dataScope {
+				if ok, _ := d.M.HasField(col); ok || specialFlag {
+					andColumns = append(andColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+					andValues = append(andValues, params)
+				}
+			}
+			if len(andColumns) > 0 {
+				andWhereSql := strings.Join(andColumns, " AND ")
+				orColumns = append(orColumns, "("+andWhereSql+")")
+				orValues = append(orValues, andValues...)
+			}
+		}
+
+		whereSql := strings.Join(orColumns, " OR ")
+		return &CtrContractShareDao{M: d.M.Where(whereSql, orValues...).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+	}
+	return d
+}
+
+// args 1、字段
+// args 2、字段、表名
+// args 3、字段对应关系
+func (d *CtrContractShareDao) checkColumnsName(dataScope map[string]interface{}, args ...interface{}) (bool, []string, map[string]interface{}) {
+	var userCols []string
+	tableAs, specialFlag := "", false
+	orColsMap, colsContrast := map[string]interface{}{}, map[string]interface{}{}
+
+	if d.TableAs != "" && len(args) <= 1 {
+		tableAs = d.TableAs + "."
+	}
+	if len(args) > 1 {
+		specialFlag = true
+		if val, ok := args[1].(string); ok {
+			tableAs = val + "."
+		}
+	}
+	if len(args) > 0 {
+		userCols = []string{tableAs + "created_by"}
+		if column, ok := args[0].(string); ok {
+			userCols = []string{tableAs + column}
+		}
+		if cols, ok := args[0].([]string); ok {
+			for _, v := range cols {
+				userCols = append(userCols, tableAs+v)
+			}
+		}
+		if val, ok := args[0].(map[string]interface{}); ok {
+			specialFlag = true
+			colsContrast = val
+			if orcols, ok := val["orcols"]; ok {
+				if col, ok := orcols.(string); ok && gconv.String(val[col]) != "" {
+					orColsMap[col] = val[col]
+					delete(colsContrast, col)
+				}
+				if cols, ok := orcols.([]string); ok {
+					for _, col := range cols {
+						if gconv.String(val[col]) == "" {
+							continue
+						}
+						orColsMap[col] = val[col]
+						delete(colsContrast, col)
+					}
+				}
+			}
+			delete(colsContrast, "orcols")
+		}
+	}
+
+	delete(dataScope, "userIds")
+	delete(dataScope, "roles")
+	delete(dataScope, "posts")
+
+	if len(colsContrast) > 0 {
+		for k, v := range dataScope {
+			if data, ok := colsContrast[k]; ok {
+				dataScope[data.(string)] = v
+			}
+			delete(dataScope, k)
+			delete(colsContrast, k)
+		}
+		for k, v := range colsContrast {
+			dataScope[k] = v
+		}
+	}
+	return specialFlag, userCols, orColsMap
+}

+ 1 - 8
opms_parent/app/dao/cust/internal/cust_customer.go

@@ -774,14 +774,7 @@ func (d *CustCustomerDao) DataScope(ctx context.Context, userCol ...string) *Cus
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/cust/internal/cust_customer_belong.go

@@ -732,14 +732,7 @@ func (d *CustCustomerBelongDao) DataScope(ctx context.Context, userCol ...string
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/cust/internal/cust_customer_bid_record.go

@@ -753,14 +753,7 @@ func (d *CustCustomerBidRecordDao) DataScope(ctx context.Context, userCol ...str
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/cust/internal/cust_customer_contact.go

@@ -738,14 +738,7 @@ func (d *CustCustomerContactDao) DataScope(ctx context.Context, userCol ...strin
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/cust/internal/cust_customer_dynamics.go

@@ -726,14 +726,7 @@ func (d *CustCustomerDynamicsDao) DataScope(ctx context.Context, userCol ...stri
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/cust/internal/cust_customer_invoice_header.go

@@ -729,14 +729,7 @@ func (d *CustCustomerInvoiceHeaderDao) DataScope(ctx context.Context, userCol ..
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 12
opms_parent/app/dao/cust/internal/product_consult_record.go

@@ -850,22 +850,11 @@ func (d *ProductConsultRecordDao) checkColumnsName(dataScope map[string]interfac
 			}
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 8
opms_parent/app/dao/dingtalk_log/internal/dingtalk_log.go

@@ -714,14 +714,7 @@ func (d *DingtalkLogDao) DataScope(ctx context.Context, userCol ...string) *Ding
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 12
opms_parent/app/dao/partner/internal/partner_company.go

@@ -783,22 +783,11 @@ func (d *PartnerCompanyDao) checkColumnsName(dataScope map[string]interface{}, a
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/partner/internal/partner_company_contact.go

@@ -795,22 +795,11 @@ func (d *PartnerCompanyContactDao) checkColumnsName(dataScope map[string]interfa
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/plat/internal/plat_followup.go

@@ -837,22 +837,11 @@ func (d *PlatFollowupDao) checkColumnsName(dataScope map[string]interface{}, arg
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_followup_comment.go

@@ -717,14 +717,7 @@ func (d *PlatFollowupCommentDao) DataScope(ctx context.Context, userCol ...strin
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_followup_file.go

@@ -720,14 +720,7 @@ func (d *PlatFollowupFileDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_punch_records.go

@@ -735,14 +735,7 @@ func (d *PlatPunchRecordsDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_questionnaire.go

@@ -732,14 +732,7 @@ func (d *PlatQuestionnaireDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_schedule.go

@@ -741,14 +741,7 @@ func (d *PlatScheduleDao) DataScope(ctx context.Context, userCol ...string) *Pla
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_schedule_attendee.go

@@ -723,14 +723,7 @@ func (d *PlatScheduleAttendeeDao) DataScope(ctx context.Context, userCol ...stri
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_schedule_remind.go

@@ -726,14 +726,7 @@ func (d *PlatScheduleRemindDao) DataScope(ctx context.Context, userCol ...string
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_tablecols_config.go

@@ -726,14 +726,7 @@ func (d *PlatTablecolsConfigDao) DataScope(ctx context.Context, args ...interfac
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok || specialFlag {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_task.go

@@ -792,14 +792,7 @@ func (d *PlatTaskDao) DataScope(ctx context.Context, userCol ...string) *PlatTas
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_task_comment.go

@@ -717,14 +717,7 @@ func (d *PlatTaskCommentDao) DataScope(ctx context.Context, userCol ...string) *
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_task_handle.go

@@ -735,14 +735,7 @@ func (d *PlatTaskHandleDao) DataScope(ctx context.Context, userCol ...string) *P
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_task_log.go

@@ -723,14 +723,7 @@ func (d *PlatTaskLogDao) DataScope(ctx context.Context, userCol ...string) *Plat
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_task_progress.go

@@ -720,14 +720,7 @@ func (d *PlatTaskProgressDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/plat/internal/plat_user_config.go

@@ -717,14 +717,7 @@ func (d *PlatUserConfigDao) DataScope(ctx context.Context, userCol ...string) *P
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 7 - 12
opms_parent/app/dao/proj/internal/proj_business.go

@@ -61,6 +61,8 @@ type projBusinessColumns struct {
 	SalesModel                string // 销售模式(10直销20经销30代理)
 	SaleId                    string // 归属销售
 	SaleName                  string // 销售姓名
+	StrategicSaleId           string // 战略项目组销售
+	StrategicSaleName         string // 战略项目组销售姓名
 	DistributorId             string // 经销商/代理商ID
 	DistributorName           string // 经销商/代理商名称
 	BidId                     string // 客户招标ID
@@ -148,6 +150,8 @@ var (
 			SalesModel:                "sales_model",
 			SaleId:                    "sale_id",
 			SaleName:                  "sale_name",
+			StrategicSaleId:           "strategic_sale_id",
+			StrategicSaleName:         "strategic_sale_name",
 			DistributorId:             "distributor_id",
 			DistributorName:           "distributor_name",
 			BidId:                     "bid_id",
@@ -237,6 +241,8 @@ func NewProjBusinessDao(tenant string) ProjBusinessDao {
 			SalesModel:                "sales_model",
 			SaleId:                    "sale_id",
 			SaleName:                  "sale_name",
+			StrategicSaleId:           "strategic_sale_id",
+			StrategicSaleName:         "strategic_sale_name",
 			DistributorId:             "distributor_id",
 			DistributorName:           "distributor_name",
 			BidId:                     "bid_id",
@@ -912,21 +918,10 @@ func (d *ProjBusinessDao) DataScope(ctx context.Context, userCol ...string) *Pro
 			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
 				salesEngineerFlag = true
 			}
-			// 战略项目组可以看所有的储备项目
-			if arr.Contains("StrategicProjectTeam") {
-				orColumns = append(orColumns, tableAs+"nbo_type = '50' ")
-			}
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/proj/internal/proj_business_contact.go

@@ -717,14 +717,7 @@ func (d *ProjBusinessContactDao) DataScope(ctx context.Context, userCol ...strin
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/proj/internal/proj_business_dynamics.go

@@ -735,14 +735,7 @@ func (d *ProjBusinessDynamicsDao) DataScope(ctx context.Context, args ...interfa
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok || specialFlag {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/proj/internal/proj_business_file.go

@@ -723,14 +723,7 @@ func (d *ProjBusinessFileDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/proj/internal/proj_business_product.go

@@ -738,14 +738,7 @@ func (d *ProjBusinessProductDao) DataScope(ctx context.Context, userCol ...strin
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/proj/internal/proj_business_team.go

@@ -723,14 +723,7 @@ func (d *ProjBusinessTeamDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/sys_report/internal/sys_report.go

@@ -723,14 +723,7 @@ func (d *SysReportDao) DataScope(ctx context.Context, userCol ...string) *SysRep
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/sys_report/internal/sys_role_report.go

@@ -714,14 +714,7 @@ func (d *SysRoleReportDao) DataScope(ctx context.Context, userCol ...string) *Sy
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 128 - 0
opms_parent/app/dao/work/internal/deliver_order.go

@@ -7,9 +7,13 @@ package internal
 import (
 	"context"
 	"database/sql"
+	"fmt"
+	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/frame/gmvc"
+	"github.com/gogf/gf/util/gconv"
+	"strings"
 	"time"
 
 	model "dashoo.cn/micro/app/model/work"
@@ -740,3 +744,127 @@ func (d *DeliverOrderDao) LockShared() *DeliverOrderDao {
 func (d *DeliverOrderDao) Unscoped() *DeliverOrderDao {
 	return &DeliverOrderDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
 }
+
+// DataScope enables the DataScope feature.
+func (d *DeliverOrderDao) DataScope(ctx context.Context, args ...interface{}) *DeliverOrderDao {
+	cs := ctx.Value("contextService")
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
+	if dataScope != nil {
+		// 销售工程师判断
+		var salesEngineerFlag bool
+		if roles, ok := dataScope["roles"]; ok {
+			arr := garray.NewArrayFrom(roles.([]interface{}), true)
+			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
+				salesEngineerFlag = true
+			}
+		}
+		userIds, ok := dataScope["userIds"]
+		specialFlag, userCols, orColsMap := d.checkColumnsName(dataScope, args...)
+
+		var orColumns []string
+		var orValues []interface{}
+		if ok && userIds != "-1" {
+			for _, column := range userCols {
+				if ok, _ := d.M.HasField(column); ok || specialFlag {
+					orColumns = append(orColumns, column+" IN (?) ")
+					orValues = append(orValues, userIds)
+				}
+			}
+		}
+		for col, params := range orColsMap {
+			if ok, _ := d.M.HasField(col); ok || specialFlag {
+				orColumns = append(orColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+				orValues = append(orValues, params)
+			}
+		}
+
+		// 销售工程师权限加成
+		if !salesEngineerFlag {
+			var andColumns []string
+			var andValues []interface{}
+			for col, params := range dataScope {
+				if ok, _ := d.M.HasField(col); ok || specialFlag {
+					andColumns = append(andColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+					andValues = append(andValues, params)
+				}
+			}
+			if len(andColumns) > 0 {
+				andWhereSql := strings.Join(andColumns, " AND ")
+				orColumns = append(orColumns, "("+andWhereSql+")")
+				orValues = append(orValues, andValues...)
+			}
+		}
+
+		whereSql := strings.Join(orColumns, " OR ")
+		return &DeliverOrderDao{M: d.M.Where(whereSql, orValues...).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+	}
+	return d
+}
+
+// args 1、字段
+// args 2、字段、表名
+// args 3、字段对应关系
+func (d *DeliverOrderDao) checkColumnsName(dataScope map[string]interface{}, args ...interface{}) (bool, []string, map[string]interface{}) {
+	var userCols []string
+	tableAs, specialFlag := "", false
+	orColsMap, colsContrast := map[string]interface{}{}, map[string]interface{}{}
+
+	if d.TableAs != "" && len(args) <= 1 {
+		tableAs = d.TableAs + "."
+	}
+	if len(args) > 1 {
+		specialFlag = true
+		if val, ok := args[1].(string); ok {
+			tableAs = val + "."
+		}
+	}
+	if len(args) > 0 {
+		userCols = []string{tableAs + "created_by"}
+		if column, ok := args[0].(string); ok {
+			userCols = []string{tableAs + column}
+		}
+		if cols, ok := args[0].([]string); ok {
+			for _, v := range cols {
+				userCols = append(userCols, tableAs+v)
+			}
+		}
+		if val, ok := args[0].(map[string]interface{}); ok {
+			specialFlag = true
+			colsContrast = val
+			if orcols, ok := val["orcols"]; ok {
+				if col, ok := orcols.(string); ok && gconv.String(val[col]) != "" {
+					orColsMap[col] = val[col]
+					delete(colsContrast, col)
+				}
+				if cols, ok := orcols.([]string); ok {
+					for _, col := range cols {
+						if gconv.String(val[col]) == "" {
+							continue
+						}
+						orColsMap[col] = val[col]
+						delete(colsContrast, col)
+					}
+				}
+			}
+			delete(colsContrast, "orcols")
+		}
+	}
+
+	delete(dataScope, "userIds")
+	delete(dataScope, "roles")
+	delete(dataScope, "posts")
+
+	if len(colsContrast) > 0 {
+		for k, v := range dataScope {
+			if data, ok := colsContrast[k]; ok {
+				dataScope[data.(string)] = v
+			}
+			delete(dataScope, k)
+			delete(colsContrast, k)
+		}
+		for k, v := range colsContrast {
+			dataScope[k] = v
+		}
+	}
+	return specialFlag, userCols, orColsMap
+}

+ 1 - 12
opms_parent/app/dao/work/internal/deliver_order_imp_plan.go

@@ -801,22 +801,11 @@ func (d *DeliverOrderImpPlanDao) checkColumnsName(dataScope map[string]interface
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/work/internal/deliver_order_imp_progress.go

@@ -927,22 +927,11 @@ func (d *DeliverOrderImpProgressDao) checkColumnsName(dataScope map[string]inter
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 128 - 0
opms_parent/app/dao/work/internal/deliver_order_imp_progress_log.go

@@ -7,9 +7,13 @@ package internal
 import (
 	"context"
 	"database/sql"
+	"fmt"
+	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/frame/gmvc"
+	"github.com/gogf/gf/util/gconv"
+	"strings"
 	"time"
 
 	model "dashoo.cn/micro/app/model/work"
@@ -698,3 +702,127 @@ func (d *DeliverOrderImpProgressLogDao) LockShared() *DeliverOrderImpProgressLog
 func (d *DeliverOrderImpProgressLogDao) Unscoped() *DeliverOrderImpProgressLogDao {
 	return &DeliverOrderImpProgressLogDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
 }
+
+// DataScope enables the DataScope feature.
+func (d *DeliverOrderImpProgressLogDao) DataScope(ctx context.Context, args ...interface{}) *DeliverOrderImpProgressLogDao {
+	cs := ctx.Value("contextService")
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
+	if dataScope != nil {
+		// 销售工程师判断
+		var salesEngineerFlag bool
+		if roles, ok := dataScope["roles"]; ok {
+			arr := garray.NewArrayFrom(roles.([]interface{}), true)
+			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
+				salesEngineerFlag = true
+			}
+		}
+		userIds, ok := dataScope["userIds"]
+		specialFlag, userCols, orColsMap := d.checkColumnsName(dataScope, args...)
+
+		var orColumns []string
+		var orValues []interface{}
+		if ok && userIds != "-1" {
+			for _, column := range userCols {
+				if ok, _ := d.M.HasField(column); ok || specialFlag {
+					orColumns = append(orColumns, column+" IN (?) ")
+					orValues = append(orValues, userIds)
+				}
+			}
+		}
+		for col, params := range orColsMap {
+			if ok, _ := d.M.HasField(col); ok || specialFlag {
+				orColumns = append(orColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+				orValues = append(orValues, params)
+			}
+		}
+
+		// 销售工程师权限加成
+		if !salesEngineerFlag {
+			var andColumns []string
+			var andValues []interface{}
+			for col, params := range dataScope {
+				if ok, _ := d.M.HasField(col); ok || specialFlag {
+					andColumns = append(andColumns, fmt.Sprintf(" ( %s IN (?) )", col))
+					andValues = append(andValues, params)
+				}
+			}
+			if len(andColumns) > 0 {
+				andWhereSql := strings.Join(andColumns, " AND ")
+				orColumns = append(orColumns, "("+andWhereSql+")")
+				orValues = append(orValues, andValues...)
+			}
+		}
+
+		whereSql := strings.Join(orColumns, " OR ")
+		return &DeliverOrderImpProgressLogDao{M: d.M.Where(whereSql, orValues...).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
+	}
+	return d
+}
+
+// args 1、字段
+// args 2、字段、表名
+// args 3、字段对应关系
+func (d *DeliverOrderImpProgressLogDao) checkColumnsName(dataScope map[string]interface{}, args ...interface{}) (bool, []string, map[string]interface{}) {
+	var userCols []string
+	tableAs, specialFlag := "", false
+	orColsMap, colsContrast := map[string]interface{}{}, map[string]interface{}{}
+
+	if d.TableAs != "" && len(args) <= 1 {
+		tableAs = d.TableAs + "."
+	}
+	if len(args) > 1 {
+		specialFlag = true
+		if val, ok := args[1].(string); ok {
+			tableAs = val + "."
+		}
+	}
+	if len(args) > 0 {
+		userCols = []string{tableAs + "created_by"}
+		if column, ok := args[0].(string); ok {
+			userCols = []string{tableAs + column}
+		}
+		if cols, ok := args[0].([]string); ok {
+			for _, v := range cols {
+				userCols = append(userCols, tableAs+v)
+			}
+		}
+		if val, ok := args[0].(map[string]interface{}); ok {
+			specialFlag = true
+			colsContrast = val
+			if orcols, ok := val["orcols"]; ok {
+				if col, ok := orcols.(string); ok && gconv.String(val[col]) != "" {
+					orColsMap[col] = val[col]
+					delete(colsContrast, col)
+				}
+				if cols, ok := orcols.([]string); ok {
+					for _, col := range cols {
+						if gconv.String(val[col]) == "" {
+							continue
+						}
+						orColsMap[col] = val[col]
+						delete(colsContrast, col)
+					}
+				}
+			}
+			delete(colsContrast, "orcols")
+		}
+	}
+
+	delete(dataScope, "userIds")
+	delete(dataScope, "roles")
+	delete(dataScope, "posts")
+
+	if len(colsContrast) > 0 {
+		for k, v := range dataScope {
+			if data, ok := colsContrast[k]; ok {
+				dataScope[data.(string)] = v
+			}
+			delete(dataScope, k)
+			delete(colsContrast, k)
+		}
+		for k, v := range colsContrast {
+			dataScope[k] = v
+		}
+	}
+	return specialFlag, userCols, orColsMap
+}

+ 1 - 12
opms_parent/app/dao/work/internal/deliver_order_product.go

@@ -819,22 +819,11 @@ func (d *DeliverOrderProductDao) checkColumnsName(dataScope map[string]interface
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/work/internal/deliver_progress_product.go

@@ -825,22 +825,11 @@ func (d *DeliverProgressProductDao) checkColumnsName(dataScope map[string]interf
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 12
opms_parent/app/dao/work/internal/work_order.go

@@ -918,22 +918,11 @@ func (d *WorkOrderDao) checkColumnsName(dataScope map[string]interface{}, args .
 			}
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if specialFlag && len(args) == 1 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 0 - 799
opms_parent/app/dao/work/internal/work_order_1.go

@@ -1,799 +0,0 @@
-// // ==========================================================================
-// // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
-// // ==========================================================================
-package internal
-
-//
-//import (
-//	"context"
-//	"database/sql"
-//	"github.com/gogf/gf/container/garray"
-//	"github.com/gogf/gf/database/gdb"
-//	"github.com/gogf/gf/frame/g"
-//	"github.com/gogf/gf/frame/gmvc"
-//	"github.com/gogf/gf/util/gconv"
-//	"strings"
-//	"time"
-//
-//	model "dashoo.cn/micro/app/model/work"
-//)
-//
-//// WorkOrderDao is the manager for logic model data accessing and custom defined data operations functions management.
-//type WorkOrderDao struct {
-//	gmvc.M                   // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
-//	C       workOrderColumns // C is the short type for Columns, which contains all the column names of Table for convenient usage.
-//	DB      gdb.DB           // DB is the raw underlying database management object.
-//	Table   string           // Table is the underlying table name of the DAO.
-//	TableAs string           // TableAs is the underlying table alias name of the DAO.
-//}
-//
-//// WorkOrderColumns defines and stores column names for table work_order.
-//type workOrderColumns struct {
-//	Id             string // 主键
-//	Name           string // 工单名称
-//	NboId          string // 关联项目
-//	NboCode        string // 项目编码
-//	NboName        string // 项目名称
-//	CustId         string // 关联客户
-//	CustName       string // 客户名称
-//	OrderTypeId    string // 工单类型
-//	OrderTypeName  string // 工单类型名称
-//	OrderStatus    string // 工单状态(10发起20审批中30审批通过40审批拒绝50关闭)
-//	FormData       string // 表单数据
-//	AssignUserId   string // 分派人员ID
-//	AssignUserName string // 分派人员姓名
-//	Feedback       string // 反馈信息
-//	File           string // 相关文件
-//	Remark         string // 备注
-//	CreatedBy      string // 创建者
-//	CreatedName    string // 创建人
-//	CreatedTime    string // 创建时间
-//	UpdatedBy      string // 更新者
-//	UpdatedName    string // 更新人
-//	UpdatedTime    string // 更新时间
-//	DeletedTime    string // 删除时间
-//}
-//
-//var (
-//	// WorkOrder is globally public accessible object for table work_order operations.
-//	WorkOrder = WorkOrderDao{
-//		M:     g.DB("default").Model("work_order").Safe(),
-//		DB:    g.DB("default"),
-//		Table: "work_order",
-//		C: workOrderColumns{
-//			Id:             "id",
-//			Name:           "name",
-//			NboId:          "nbo_id",
-//			NboCode:        "nbo_code",
-//			NboName:        "nbo_name",
-//			CustId:         "cust_id",
-//			CustName:       "cust_name",
-//			OrderTypeId:    "order_type_id",
-//			OrderTypeName:  "order_type_name",
-//			OrderStatus:    "order_status",
-//			FormData:       "form_data",
-//			AssignUserId:   "assign_user_id",
-//			AssignUserName: "assign_user_name",
-//			Feedback:       "feedback",
-//			File:           "file",
-//			Remark:         "remark",
-//			CreatedBy:      "created_by",
-//			CreatedName:    "created_name",
-//			CreatedTime:    "created_time",
-//			UpdatedBy:      "updated_by",
-//			UpdatedName:    "updated_name",
-//			UpdatedTime:    "updated_time",
-//			DeletedTime:    "deleted_time",
-//		},
-//	}
-//)
-//
-//func NewWorkOrderDao(tenant string) WorkOrderDao {
-//	var dao WorkOrderDao
-//	dao = WorkOrderDao{
-//		M:     g.DB(tenant).Model("work_order").Safe(),
-//		DB:    g.DB(tenant),
-//		Table: "work_order",
-//		C: workOrderColumns{
-//			Id:             "id",
-//			Name:           "name",
-//			NboId:          "nbo_id",
-//			NboCode:        "nbo_code",
-//			NboName:        "nbo_name",
-//			CustId:         "cust_id",
-//			CustName:       "cust_name",
-//			OrderTypeId:    "order_type_id",
-//			OrderTypeName:  "order_type_name",
-//			OrderStatus:    "order_status",
-//			FormData:       "form_data",
-//			AssignUserId:   "assign_user_id",
-//			AssignUserName: "assign_user_name",
-//			Feedback:       "feedback",
-//			File:           "file",
-//			Remark:         "remark",
-//			CreatedBy:      "created_by",
-//			CreatedName:    "created_name",
-//			CreatedTime:    "created_time",
-//			UpdatedBy:      "updated_by",
-//			UpdatedName:    "updated_name",
-//			UpdatedTime:    "updated_time",
-//			DeletedTime:    "deleted_time",
-//		},
-//	}
-//	return dao
-//}
-//
-//// Ctx is a chaining function, which creates and returns a new DB that is a shallow copy
-//// of current DB object and with given context in it.
-//// Note that this returned DB object can be used only once, so do not assign it to
-//// a global or package variable for long using.
-//func (d *WorkOrderDao) Ctx(ctx context.Context) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// GetCtx returns the context for current Model.
-//// It returns "context.Background() i"s there's no context previously set.
-//func (d *WorkOrderDao) GetCtx() context.Context {
-//	return d.M.GetCtx()
-//}
-//
-//// As sets an alias name for current table.
-//func (d *WorkOrderDao) As(as string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.As(as), Table: d.Table, TableAs: as}
-//}
-//
-//// TX sets the transaction for current operation.
-//func (d *WorkOrderDao) TX(tx *gdb.TX) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.TX(tx), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Master marks the following operation on master node.
-//func (d *WorkOrderDao) Master() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Master(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Slave marks the following operation on slave node.
-//// Note that it makes sense only if there's any slave node configured.
-//func (d *WorkOrderDao) Slave() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Slave(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Args sets custom arguments for model operation.
-//func (d *WorkOrderDao) Args(args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Args(args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Handler calls each of "handlers" on current Model and returns a new Model.
-//// ModelHandler is a function that handles given Model and returns a new Model that is custom modified.
-//func (d *WorkOrderDao) Handler(handlers ...gdb.ModelHandler) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Handler(handlers...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// LeftJoin does "LEFT JOIN ... ON ..." statement on the model.
-//// The parameter <table> can be joined table and its joined condition,
-//// and also with its alias name, like:
-//// Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid")
-//// Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
-//func (d *WorkOrderDao) LeftJoin(table ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.LeftJoin(table...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// RightJoin does "RIGHT JOIN ... ON ..." statement on the model.
-//// The parameter <table> can be joined table and its joined condition,
-//// and also with its alias name, like:
-//// Table("user").RightJoin("user_detail", "user_detail.uid=user.uid")
-//// Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
-//func (d *WorkOrderDao) RightJoin(table ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.RightJoin(table...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// InnerJoin does "INNER JOIN ... ON ..." statement on the model.
-//// The parameter <table> can be joined table and its joined condition,
-//// and also with its alias name, like:
-//// Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid")
-//// Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
-//func (d *WorkOrderDao) InnerJoin(table ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.InnerJoin(table...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Fields sets the operation fields of the model, multiple fields joined using char ','.
-//// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
-//func (d *WorkOrderDao) Fields(fieldNamesOrMapStruct ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Fields(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','.
-//// The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
-//func (d *WorkOrderDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.FieldsEx(fieldNamesOrMapStruct...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// FieldCount formats and appends commonly used field "COUNT(column)" to the select fields of model.
-//func (d *WorkOrderDao) FieldCount(column string, as ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.FieldCount(column, as...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// FieldSum formats and appends commonly used field "SUM(column)" to the select fields of model.
-//func (d *WorkOrderDao) FieldSum(column string, as ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.FieldSum(column, as...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// FieldMin formats and appends commonly used field "MIN(column)" to the select fields of model.
-//func (d *WorkOrderDao) FieldMin(column string, as ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.FieldMin(column, as...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// FieldMax formats and appends commonly used field "MAX(column)" to the select fields of model.
-//func (d *WorkOrderDao) FieldMax(column string, as ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.FieldMax(column, as...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// FieldAvg formats and appends commonly used field "AVG(column)" to the select fields of model.
-//func (d *WorkOrderDao) FieldAvg(column string, as ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.FieldAvg(column, as...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Option adds extra operation option for the model.
-//// Deprecated, use separate operations instead.
-//func (d *WorkOrderDao) Option(option int) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Option(option), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
-//// the data and where attributes for empty values.
-//func (d *WorkOrderDao) OmitEmpty() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OmitEmpty(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OmitEmptyWhere sets optionOmitEmptyWhere option for the model, which automatically filers
-//// the Where/Having parameters for "empty" values.
-//func (d *WorkOrderDao) OmitEmptyWhere() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OmitEmptyWhere(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OmitEmptyData sets optionOmitEmptyData option for the model, which automatically filers
-//// the Data parameters for "empty" values.
-//func (d *WorkOrderDao) OmitEmptyData() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OmitEmptyData(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OmitNil sets optionOmitNil option for the model, which automatically filers
-//// the data and where parameters for "nil" values.
-//func (d *WorkOrderDao) OmitNil() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OmitNil(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OmitNilWhere sets optionOmitNilWhere option for the model, which automatically filers
-//// the Where/Having parameters for "nil" values.
-//func (d *WorkOrderDao) OmitNilWhere() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OmitNilWhere(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OmitNilData sets optionOmitNilData option for the model, which automatically filers
-//// the Data parameters for "nil" values.
-//func (d *WorkOrderDao) OmitNilData() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OmitNilData(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Filter marks filtering the fields which does not exist in the fields of the operated table.
-//// Note that this function supports only single table operations.
-//// Deprecated, filter feature is automatically enabled from GoFrame v1.16.0, it is so no longer used.
-//func (d *WorkOrderDao) Filter() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Filter(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Where sets the condition statement for the model. The parameter <where> can be type of
-//// string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times,
-//// multiple conditions will be joined into where statement using "AND".
-//// Eg:
-//// Where("uid=10000")
-//// Where("uid", 10000)
-//// Where("money>? AND name like ?", 99999, "vip_%")
-//// Where("uid", 1).Where("name", "john")
-//// Where("status IN (?)", g.Slice{1,2,3})
-//// Where("age IN(?,?)", 18, 50)
-//// Where(User{ Id : 1, UserName : "john"})
-//func (d *WorkOrderDao) Where(where interface{}, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Where(where, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WherePri does the same logic as M.Where except that if the parameter <where>
-//// is a single condition like int/string/float/slice, it treats the condition as the primary
-//// key value. That is, if primary key is "id" and given <where> parameter as "123", the
-//// WherePri function treats the condition as "id=123", but M.Where treats the condition
-//// as string "123".
-//func (d *WorkOrderDao) WherePri(where interface{}, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WherePri(where, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Having sets the having statement for the model.
-//// The parameters of this function usage are as the same as function Where.
-//// See Where.
-//func (d *WorkOrderDao) Having(having interface{}, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Having(having, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Wheref builds condition string using fmt.Sprintf and arguments.
-//// Note that if the number of "args" is more than the place holder in "format",
-//// the extra "args" will be used as the where condition arguments of the Model.
-//func (d *WorkOrderDao) Wheref(format string, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Wheref(format, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereLT builds "column < value" statement.
-//func (d *WorkOrderDao) WhereLT(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereLT(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereLTE builds "column <= value" statement.
-//func (d *WorkOrderDao) WhereLTE(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereLTE(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereGT builds "column > value" statement.
-//func (d *WorkOrderDao) WhereGT(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereGT(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereGTE builds "column >= value" statement.
-//func (d *WorkOrderDao) WhereGTE(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereGTE(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereBetween builds "column BETWEEN min AND max" statement.
-//func (d *WorkOrderDao) WhereBetween(column string, min, max interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereLike builds "column LIKE like" statement.
-//func (d *WorkOrderDao) WhereLike(column string, like interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereLike(column, like), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereIn builds "column IN (in)" statement.
-//func (d *WorkOrderDao) WhereIn(column string, in interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereIn(column, in), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereNull builds "columns[0] IS NULL AND columns[1] IS NULL ..." statement.
-//func (d *WorkOrderDao) WhereNull(columns ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereNull(columns...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereNotBetween builds "column NOT BETWEEN min AND max" statement.
-//func (d *WorkOrderDao) WhereNotBetween(column string, min, max interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereNotLike builds "column NOT LIKE like" statement.
-//func (d *WorkOrderDao) WhereNotLike(column string, like interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereNot builds "column != value" statement.
-//func (d *WorkOrderDao) WhereNot(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereNot(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereNotIn builds "column NOT IN (in)" statement.
-//func (d *WorkOrderDao) WhereNotIn(column string, in interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereNotNull builds "columns[0] IS NOT NULL AND columns[1] IS NOT NULL ..." statement.
-//func (d *WorkOrderDao) WhereNotNull(columns ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOr adds "OR" condition to the where statement.
-//func (d *WorkOrderDao) WhereOr(where interface{}, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOr(where, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrf builds "OR" condition string using fmt.Sprintf and arguments.
-//func (d *WorkOrderDao) WhereOrf(format string, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrf(format, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrLT builds "column < value" statement in "OR" conditions..
-//func (d *WorkOrderDao) WhereOrLT(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrLT(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrLTE builds "column <= value" statement in "OR" conditions..
-//func (d *WorkOrderDao) WhereOrLTE(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrLTE(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrGT builds "column > value" statement in "OR" conditions..
-//func (d *WorkOrderDao) WhereOrGT(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrGT(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrGTE builds "column >= value" statement in "OR" conditions..
-//func (d *WorkOrderDao) WhereOrGTE(column string, value interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrGTE(column, value), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrBetween builds "column BETWEEN min AND max" statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrBetween(column string, min, max interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrLike builds "column LIKE like" statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrLike(column string, like interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrLike(column, like), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrIn builds "column IN (in)" statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrIn(column string, in interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrIn(column, in), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrNull builds "columns[0] IS NULL OR columns[1] IS NULL ..." statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrNull(columns ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrNull(columns...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrNotBetween builds "column NOT BETWEEN min AND max" statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrNotBetween(column string, min, max interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrNotBetween(column, min, max), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrNotLike builds "column NOT LIKE like" statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrNotLike(column string, like interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrNotLike(column, like), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrNotIn builds "column NOT IN (in)" statement.
-//func (d *WorkOrderDao) WhereOrNotIn(column string, in interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrNotIn(column, in), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// WhereOrNotNull builds "columns[0] IS NOT NULL OR columns[1] IS NOT NULL ..." statement in "OR" conditions.
-//func (d *WorkOrderDao) WhereOrNotNull(columns ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.WhereOrNotNull(columns...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Group sets the "GROUP BY" statement for the model.
-//func (d *WorkOrderDao) Group(groupBy ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Group(groupBy...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// And adds "AND" condition to the where statement.
-//// Deprecated, use Where instead.
-//func (d *WorkOrderDao) And(where interface{}, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.And(where, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Or adds "OR" condition to the where statement.
-//// Deprecated, use WhereOr instead.
-//func (d *WorkOrderDao) Or(where interface{}, args ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Or(where, args...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// GroupBy sets the "GROUP BY" statement for the model.
-//func (d *WorkOrderDao) GroupBy(groupBy string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Group(groupBy), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Order sets the "ORDER BY" statement for the model.
-//func (d *WorkOrderDao) Order(orderBy ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Order(orderBy...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OrderAsc sets the "ORDER BY xxx ASC" statement for the model.
-//func (d *WorkOrderDao) OrderAsc(column string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OrderAsc(column), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OrderDesc sets the "ORDER BY xxx DESC" statement for the model.
-//func (d *WorkOrderDao) OrderDesc(column string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OrderDesc(column), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
-//func (d *WorkOrderDao) OrderRandom() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.OrderRandom(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// OrderBy is alias of Model.Order.
-//// See Model.Order.
-//// Deprecated, use Order instead.
-//func (d *WorkOrderDao) OrderBy(orderBy string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Order(orderBy), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Limit sets the "LIMIT" statement for the model.
-//// The parameter <limit> can be either one or two number, if passed two number is passed,
-//// it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]"
-//// statement.
-//func (d *WorkOrderDao) Limit(limit ...int) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Limit(limit...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Offset sets the "OFFSET" statement for the model.
-//// It only makes sense for some databases like SQLServer, PostgreSQL, etc.
-//func (d *WorkOrderDao) Offset(offset int) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Offset(offset), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Distinct forces the query to only return distinct results.
-//func (d *WorkOrderDao) Distinct() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Distinct(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Page sets the paging number for the model.
-//// The parameter <page> is started from 1 for paging.
-//// Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
-//func (d *WorkOrderDao) Page(page, limit int) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Page(page, limit), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Batch sets the batch operation number for the model.
-//func (d *WorkOrderDao) Batch(batch int) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Batch(batch), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Cache sets the cache feature for the model. It caches the result of the sql, which means
-//// if there's another same sql request, it just reads and returns the result from cache, it
-//// but not committed and executed into the database.
-////
-//// If the parameter <duration> < 0, which means it clear the cache with given <name>.
-//// If the parameter <duration> = 0, which means it never expires.
-//// If the parameter <duration> > 0, which means it expires after <duration>.
-////
-//// The optional parameter <name> is used to bind a name to the cache, which means you can later
-//// control the cache like changing the <duration> or clearing the cache with specified <name>.
-////
-//// Note that, the cache feature is disabled if the model is operating on a transaction.
-//func (d *WorkOrderDao) Cache(duration time.Duration, name ...string) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Cache(duration, name...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Data sets the operation data for the model.
-//// The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc.
-//// Eg:
-//// Data("uid=10000")
-//// Data("uid", 10000)
-//// Data(g.Map{"uid": 10000, "name":"john"})
-//// Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
-//func (d *WorkOrderDao) Data(data ...interface{}) *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Data(data...), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// All does "SELECT FROM ..." statement for the model.
-//// It retrieves the records from table and returns the result as []*model.WorkOrder.
-//// It returns nil if there's no record retrieved with the given conditions from table.
-////
-//// The optional parameter <where> is the same as the parameter of M.Where function,
-//// see M.Where.
-//func (d *WorkOrderDao) All(where ...interface{}) ([]*model.WorkOrder, error) {
-//	all, err := d.M.All(where...)
-//	if err != nil {
-//		return nil, err
-//	}
-//	var entities []*model.WorkOrder
-//	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
-//		return nil, err
-//	}
-//	return entities, nil
-//}
-//
-//// One retrieves one record from table and returns the result as *model.WorkOrder.
-//// It returns nil if there's no record retrieved with the given conditions from table.
-////
-//// The optional parameter <where> is the same as the parameter of M.Where function,
-//// see M.Where.
-//func (d *WorkOrderDao) One(where ...interface{}) (*model.WorkOrder, error) {
-//	one, err := d.M.One(where...)
-//	if err != nil {
-//		return nil, err
-//	}
-//	var entity *model.WorkOrder
-//	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
-//		return nil, err
-//	}
-//	return entity, nil
-//}
-//
-//// FindOne retrieves and returns a single Record by M.WherePri and M.One.
-//// Also see M.WherePri and M.One.
-//func (d *WorkOrderDao) FindOne(where ...interface{}) (*model.WorkOrder, error) {
-//	one, err := d.M.FindOne(where...)
-//	if err != nil {
-//		return nil, err
-//	}
-//	var entity *model.WorkOrder
-//	if err = one.Struct(&entity); err != nil && err != sql.ErrNoRows {
-//		return nil, err
-//	}
-//	return entity, nil
-//}
-//
-//// FindAll retrieves and returns Result by by M.WherePri and M.All.
-//// Also see M.WherePri and M.All.
-//func (d *WorkOrderDao) FindAll(where ...interface{}) ([]*model.WorkOrder, error) {
-//	all, err := d.M.FindAll(where...)
-//	if err != nil {
-//		return nil, err
-//	}
-//	var entities []*model.WorkOrder
-//	if err = all.Structs(&entities); err != nil && err != sql.ErrNoRows {
-//		return nil, err
-//	}
-//	return entities, nil
-//}
-//
-//// Struct retrieves one record from table and converts it into given struct.
-//// The parameter <pointer> should be type of *struct/**struct. If type **struct is given,
-//// it can create the struct internally during converting.
-////
-//// The optional parameter <where> is the same as the parameter of Model.Where function,
-//// see Model.Where.
-////
-//// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
-//// from table and <pointer> is not nil.
-////
-//// Eg:
-//// user := new(User)
-//// err  := dao.User.Where("id", 1).Struct(user)
-////
-//// user := (*User)(nil)
-//// err  := dao.User.Where("id", 1).Struct(&user)
-//func (d *WorkOrderDao) Struct(pointer interface{}, where ...interface{}) error {
-//	return d.M.Struct(pointer, where...)
-//}
-//
-//// Structs retrieves records from table and converts them into given struct slice.
-//// The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct
-//// slice internally during converting.
-////
-//// The optional parameter <where> is the same as the parameter of Model.Where function,
-//// see Model.Where.
-////
-//// Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions
-//// from table and <pointer> is not empty.
-////
-//// Eg:
-//// users := ([]User)(nil)
-//// err   := dao.User.Structs(&users)
-////
-//// users := ([]*User)(nil)
-//// err   := dao.User.Structs(&users)
-//func (d *WorkOrderDao) Structs(pointer interface{}, where ...interface{}) error {
-//	return d.M.Structs(pointer, where...)
-//}
-//
-//// Scan automatically calls Struct or Structs function according to the type of parameter <pointer>.
-//// It calls function Struct if <pointer> is type of *struct/**struct.
-//// It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
-////
-//// The optional parameter <where> is the same as the parameter of Model.Where function,
-//// see Model.Where.
-////
-//// Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
-////
-//// Eg:
-//// user  := new(User)
-//// err   := dao.User.Where("id", 1).Scan(user)
-////
-//// user  := (*User)(nil)
-//// err   := dao.User.Where("id", 1).Scan(&user)
-////
-//// users := ([]User)(nil)
-//// err   := dao.User.Scan(&users)
-////
-//// users := ([]*User)(nil)
-//// err   := dao.User.Scan(&users)
-//func (d *WorkOrderDao) Scan(pointer interface{}, where ...interface{}) error {
-//	return d.M.Scan(pointer, where...)
-//}
-//
-//// Chunk iterates the table with given size and callback function.
-//func (d *WorkOrderDao) Chunk(limit int, callback func(entities []*model.WorkOrder, err error) bool) {
-//	d.M.Chunk(limit, func(result gdb.Result, err error) bool {
-//		var entities []*model.WorkOrder
-//		err = result.Structs(&entities)
-//		if err == sql.ErrNoRows {
-//			return false
-//		}
-//		return callback(entities, err)
-//	})
-//}
-//
-//// LockUpdate sets the lock for update for current operation.
-//func (d *WorkOrderDao) LockUpdate() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.LockUpdate(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// LockShared sets the lock in share mode for current operation.
-//func (d *WorkOrderDao) LockShared() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.LockShared(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// Unscoped enables/disables the soft deleting feature.
-//func (d *WorkOrderDao) Unscoped() *WorkOrderDao {
-//	return &WorkOrderDao{M: d.M.Unscoped(), Table: d.Table, TableAs: d.TableAs}
-//}
-//
-//// DataScope enables the DataScope feature.
-//func (d *WorkOrderDao) DataScope(ctx context.Context, args ...interface{}) *WorkOrderDao {
-//	cs := ctx.Value("contextService")
-//	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
-//	if dataScope != nil {
-//		var specialFlag bool
-//		var tableAs string
-//		if d.TableAs != "" && len(args) <= 1 {
-//			tableAs = d.TableAs + "."
-//		}
-//		if len(args) > 1 {
-//			specialFlag = true
-//			if val, ok := args[1].(string); ok {
-//				tableAs = val + "."
-//			}
-//		}
-//		userIds, ok := dataScope["userIds"]
-//		delete(dataScope, "userIds")
-//		var orColumns []string
-//		var orValues []interface{}
-//		if ok && userIds != "-1" {
-//			columns := []string{"created_by"}
-//			if len(args) > 0 {
-//				column, ok := args[0].(string)
-//				if ok {
-//					columns[0] = column
-//				}
-//				cols, ok := args[0].([]string)
-//				if ok {
-//					columns = cols
-//				}
-//			}
-//			for _, column := range columns {
-//				if ok, _ := d.M.HasField(column); ok || specialFlag {
-//					orColumns = append(orColumns, tableAs+column+" IN (?) ")
-//					orValues = append(orValues, userIds)
-//				}
-//			}
-//
-//		}
-//		// 销售工程师判断
-//		var salesEngineerFlag bool
-//		if roles, ok := dataScope["roles"]; ok {
-//			delete(dataScope, "roles")
-//			delete(dataScope, "posts")
-//			arr := garray.NewArrayFrom(roles.([]interface{}), true)
-//			if arr.Len() == 1 && arr.Contains("SalesEngineer") {
-//				salesEngineerFlag = true
-//			}
-//		}
-//		// 非销售工程师权限加成
-//		if !salesEngineerFlag {
-//			bigColumns := "is_big"
-//			if ok, _ := d.M.HasField("is_big"); ok || specialFlag {
-//				if val, ok := dataScope[bigColumns]; ok && val != "" {
-//					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-//					orValues = append(orValues, val)
-//				}
-//				delete(dataScope, bigColumns)
-//			}
-//			var andColumns []string
-//			var andValues []interface{}
-//			for k, v := range dataScope {
-//				if ok, _ := d.M.HasField(k); ok || specialFlag {
-//					andColumns = append(andColumns, tableAs+k+" IN (?) ")
-//					andValues = append(andValues, v)
-//				}
-//			}
-//			if len(andColumns) > 0 {
-//				andWhereSql := strings.Join(andColumns, " AND ")
-//				orColumns = append(orColumns, "("+andWhereSql+")")
-//				orValues = append(orValues, andValues...)
-//			}
-//		}
-//
-//		whereSql := strings.Join(orColumns, " OR ")
-//		return &WorkOrderDao{M: d.M.Where(whereSql, orValues...).Ctx(ctx), Table: d.Table, TableAs: d.TableAs}
-//	}
-//	return d
-//}

+ 1 - 8
opms_parent/app/dao/work/internal/work_order_dynamics.go

@@ -726,14 +726,7 @@ func (d *WorkOrderDynamicsDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/work/internal/work_order_feedback.go

@@ -723,14 +723,7 @@ func (d *WorkOrderFeedbackDao) DataScope(ctx context.Context, userCol ...string)
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/work/internal/work_order_feedback_file.go

@@ -717,14 +717,7 @@ func (d *WorkOrderFeedbackFileDao) DataScope(ctx context.Context, userCol ...str
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 12
opms_parent/app/dao/work/internal/work_order_feedback_trial.go

@@ -804,22 +804,11 @@ func (d *WorkOrderFeedbackTrialDao) checkColumnsName(dataScope map[string]interf
 			delete(colsContrast, "orcols")
 		}
 	}
-	bigColumns := "is_big"
-	if isBig, ok := dataScope[bigColumns]; ok {
-		if bigCol, ok := colsContrast[bigColumns]; ok {
-			orColsMap[bigCol.(string)] = isBig
-			delete(colsContrast, bigCol.(string))
-		} else {
-			if ok, _ := d.M.HasField(bigColumns); ok && specialFlag {
-				orColsMap[tableAs+bigColumns] = isBig
-			}
-		}
-	}
 
 	delete(dataScope, "userIds")
 	delete(dataScope, "roles")
 	delete(dataScope, "posts")
-	delete(dataScope, bigColumns)
+
 	if len(colsContrast) > 0 {
 		for k, v := range dataScope {
 			if data, ok := colsContrast[k]; ok {

+ 1 - 8
opms_parent/app/dao/work/internal/work_order_type.go

@@ -720,14 +720,7 @@ func (d *WorkOrderTypeDao) DataScope(ctx context.Context, userCol ...string) *Wo
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 1 - 8
opms_parent/app/dao/workflow/internal/plat_workflow.go

@@ -729,14 +729,7 @@ func (d *PlatWorkflowDao) DataScope(ctx context.Context, userCol ...string) *Pla
 		}
 		// 非销售工程师权限加成
 		if !salesEngineerFlag {
-			bigColumns := "is_big"
-			if ok, _ := d.M.HasField("is_big"); ok {
-				if val, ok := dataScope[bigColumns]; ok && val != "" {
-					orColumns = append(orColumns, tableAs+bigColumns+" = ? ")
-					orValues = append(orValues, val)
-				}
-				delete(dataScope, bigColumns)
-			}
+
 			var andColumns []string
 			var andValues []interface{}
 			for k, v := range dataScope {

+ 32 - 0
opms_parent/app/handler/proj/business.go

@@ -29,6 +29,20 @@ func (p *BusinessHandler) GetList(ctx context.Context, req *projModel.ProjBusine
 	return nil
 }
 
+// Swagger:Business 项目 战略项目组查询项目
+func (p *BusinessHandler) GetListByStrategic(ctx context.Context, req *projModel.ProjBusinessSearchReq, rsp *comm_def.CommonMsg) error {
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return err
+	}
+	total, list, err := businessService.GetListByStrategic(req)
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list, "total": total}
+	return nil
+}
+
 // Swagger:Business 项目 项目详情
 func (p *BusinessHandler) GetEntityById(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
 	// 参数校验
@@ -270,6 +284,24 @@ func (p *BusinessHandler) SysAdminBusinessTransfer(ctx context.Context, req *pro
 	return nil
 }
 
+// StrategicBusinessTransfer 转移战略项目归属
+// Swagger:Business 项目 项目转移
+func (p *BusinessHandler) StrategicBusinessTransfer(ctx context.Context, req *projModel.BusinessTransferReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.StrategicBusinessTransfer(req)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
 // ConvertToReserve 转为储备项目
 // Swagger:Business 项目 转为储备项目
 func (p *BusinessHandler) ConvertToReserve(ctx context.Context, req *projModel.BusinessToReserveReq, rsp *comm_def.CommonMsg) error {

+ 2 - 0
opms_parent/app/model/proj/internal/proj_business.go

@@ -42,6 +42,8 @@ type ProjBusiness struct {
 	SalesModel                string      `orm:"sales_model"                 json:"salesModel"`                // 销售模式(10直销20经销30代理)
 	SaleId                    int         `orm:"sale_id"                     json:"saleId"`                    // 归属销售
 	SaleName                  string      `orm:"sale_name"                   json:"saleName"`                  // 销售姓名
+	StrategicSaleId           int         `orm:"strategic_sale_id"           json:"strategicSaleId"`           // 战略项目组销售
+	StrategicSaleName         string      `orm:"strategic_sale_name"         json:"strategicSaleName"`         // 战略项目组销售姓名
 	DistributorId             int         `orm:"distributor_id"              json:"distributorId"`             // 经销商/代理商ID
 	DistributorName           string      `orm:"distributor_name"            json:"distributorName"`           // 经销商/代理商名称
 	BidId                     int         `orm:"bid_id"                      json:"bidId"`                     // 客户招标ID

+ 1 - 1
opms_parent/app/model/proj/proj_business.go

@@ -53,7 +53,7 @@ type AddProjBusinessReq struct {
 	DistributorId   int    `json:"distributorId"      v:"required-unless:salesModel,10#经销商/代理商不能为空"`   // 经销商/代理商ID
 	DistributorName string `json:"distributorName"    v:"required-unless:salesModel,10#经销商/代理商名称不能为空"` // 经销商/代理商名称
 	NboType         string `json:"nboType"            v:"required|in:30,50#项目级别不能为空|项目级别错误"`           // 项目级别
-	IsBig           string `json:"isBig"              v:"required#是否大项目不能为空"`                          // 是否大项目
+	IsBig           string `json:"isBig"              v:"required#是否战略项目不能为空"`                         // 是否大项目
 	Remark          string `json:"remark"             `                                                // 备注
 }
 

+ 99 - 1
opms_parent/app/service/proj/business.go

@@ -102,6 +102,64 @@ func (p *businessService) GetList(req *model.ProjBusinessSearchReq) (total int,
 	return
 }
 
+func (p *businessService) GetListByStrategic(req *model.ProjBusinessSearchReq) (total int, businessList []*model.ProjBusinessRes, err error) {
+	db := p.Dao.As("proj").Where("proj."+p.Dao.C.IsBig, "10")
+	// 除管理员、总经理、销售总监、战略项目组组长可以看到全部项目外,其余人员只能看自己负责的项目
+	if service.StringsContains(p.CxtUser.Roles, "SysAdmin") ||
+		service.StringsContains(p.CxtUser.Roles, "GeneralManager") ||
+		service.StringsContains(p.CxtUser.Roles, "SalesDirector") ||
+		service.StringsContains(p.CxtUser.Roles, "StrategicProjectTeamLeader") {
+	} else {
+		db = db.Where(fmt.Sprintf("proj.%v=? OR proj.%v=? OR proj.%v=?", p.Dao.C.SaleId, p.Dao.C.StrategicSaleId, p.Dao.C.NboType), p.CxtUser.Id, p.CxtUser.Id, StatusReserve)
+	}
+	if req.NboName != "" {
+		db = db.WhereLike("proj."+p.Dao.C.NboName, "%"+req.NboName+"%")
+	}
+	if req.CustId != 0 { // 客户-项目记录 查看已删除的项目记录
+		db = db.Where("proj."+p.Dao.C.CustId, req.CustId).Unscoped()
+	}
+	if req.CustName != "" {
+		db = db.WhereLike("proj."+p.Dao.C.CustName, "%"+req.CustName+"%")
+	}
+	if req.SaleName != "" {
+		db = db.WhereLike("proj."+p.Dao.C.SaleName, "%"+req.SaleName+"%")
+	}
+	if req.NboType != "" {
+		db = db.Where("proj."+p.Dao.C.NboType, req.NboType)
+	}
+	if req.ProductLine != "" {
+		db = db.Where("proj."+p.Dao.C.ProductLine, req.ProductLine)
+	}
+	if req.NboSource != "" {
+		db = db.Where("proj."+p.Dao.C.NboSource, req.NboSource)
+	}
+	if req.DistributorName != "" {
+		db = db.WhereLike("proj."+p.Dao.C.DistributorName, "%"+req.DistributorName+"%")
+	}
+	if req.BeginTime != "" {
+		db = db.WhereGTE("proj."+p.Dao.C.FilingTime, req.BeginTime)
+	}
+	if req.EndTime != "" {
+		db = db.WhereLTE("proj."+p.Dao.C.FilingTime, req.EndTime)
+	}
+	if req.ProvinceId != 0 {
+		db = db.Where("proj."+p.Dao.C.CustProvinceId, req.ProvinceId)
+	}
+	total, err = db.Count()
+	if err != nil {
+		err = myerrors.DbError("获取总行数失败。")
+		return
+	}
+	if req.NboType == StatusDeal {
+		db = db.Unscoped().WhereNull(`proj.deleted_time`).
+			LeftJoin(contractDao.CtrContract.Table, "contract", "`proj`.id=`contract`.nbo_id AND `contract`.`deleted_time` IS NULL ").
+			Fields("`proj`.cust_city_id as cust_city_id,`contract`.contract_amount, `contract`.created_time as proj_closing_time")
+	}
+	db = db.Fields("`proj`.*")
+	err = db.Page(req.GetPage()).OrderDesc("id").Scan(&businessList)
+	return
+}
+
 func (p *businessService) GetEntityById(id int64) (business *model.ProjBusinessRes, err error) {
 	err = p.Dao.Where(projDao.ProjBusiness.C.Id, id).Scan(&business)
 	if err != nil {
@@ -323,7 +381,7 @@ func (p *businessService) Create(req *model.AddProjBusinessReq) (err error) {
 				},
 				{
 					Id:    utils.String("DDSelectField_5R11VVM6GI00"),
-					Name:  utils.String("是否为项目"),
+					Name:  utils.String("是否为战略项目"),
 					Value: utils.String(yesOrNoType[business.IsBig]),
 				},
 				{
@@ -718,6 +776,46 @@ func (p *businessService) BusinessTransferNotify(flow *workflowModel.PlatWorkflo
 	return err
 }
 
+// StrategicBusinessTransfer 转移战略项目归属
+func (p *businessService) StrategicBusinessTransfer(req *model.BusinessTransferReq) error {
+	business, err := p.GetEntityById(int64(req.Id))
+	if err != nil {
+		return err
+	}
+	businessMap := g.Map{
+		p.Dao.C.StrategicSaleId:   req.UserId,
+		p.Dao.C.StrategicSaleName: req.UserName,
+	}
+	service.SetUpdatedInfo(businessMap, p.GetCxtUserId(), p.GetCxtUserName())
+
+	opnContent := gconv.Map(gconv.String(businessMap))
+	opnContent["origStrategicSaleId"] = business.SaleId
+	opnContent["origStrategicSaleName"] = business.SaleName
+	opnContent["strategicSaleId"] = req.UserId
+	opnContent["strategicSaleName"] = req.UserName
+	opnContent["remark"] = req.Remark
+	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		// 更新项目
+		_, err = p.Dao.TX(tx).WherePri(projDao.ProjBusiness.C.Id, req.Id).Data(businessMap).Update()
+		if err != nil {
+			return err
+		}
+		// 添加项目动态
+		dynamics := model.ProjBusinessDynamics{
+			BusId:   req.Id,
+			OpnType: OpnTransferStrategic,
+			Remark:  req.Remark,
+		}
+		_, err = p.CreateProjBusinessDynamics(tx, dynamics, opnContent)
+		if err != nil {
+			g.Log().Error(err)
+			return err
+		}
+		return nil
+	})
+	return err
+}
+
 // BusinessGradation 项目调级
 func (p *businessService) BusinessGradation(busId int, nboType, busType string) (*model.ProjBusiness, error) {
 	business, err := p.Dao.WherePri(busId).WhereNot(p.Dao.C.ApproStatus, ApprovalWaiting).One()

+ 1 - 0
opms_parent/app/service/proj/const.go

@@ -14,6 +14,7 @@ const (
 	OpnDowngradeApproval = "51" // 降级审批动态
 	OpnTransfer          = "60" // 转移动态
 	OpnTransferApproval  = "61" // 转移审批动态
+	OpnTransferStrategic = "62" // 战略项目转移动态
 	OpnAssociation       = "70" // 关联联系人动态
 	OpnDisassociation    = "71" // 解除关联联系人动态
 	OpnPrimacyContact    = "72" // 设置首要联系人动态

BIN
opms_parent/app/static/项目跟进1680592053758030700.xlsx


+ 4 - 4
opms_parent/config/config.toml

@@ -1,10 +1,10 @@
 # 应用系统设置
 [setting]
     logpath = "/tmp/log/admin"
-    bind-addr = "192.168.0.106:9981"
+    bind-addr = "192.168.0.84:9981"
     bind-mutipart-addr = "127.0.0.1:9999"
     need-advertise-addr = false
-    srv-name = "dashoo.opms.parent-0.0.1-sxy"
+    srv-name = "dashoo.opms.parent-0.0.1-zzh"
     env = "dev"
     swagger = true
 
@@ -24,7 +24,7 @@
         deletedAt = "deleted_time"
         link = "mysql:root:Dashoo#190801@ali@tcp(192.168.0.252:3306)/dashoo_crm"
 
-[[database.cp5vbwxy]]
+    [[database.cp5vbwxy]]
         Debug = true
         createdAt = "created_time"
         updatedAt = "updated_time"
@@ -32,7 +32,7 @@
         link = "mysql:root:Bgt56yhn@@@tcp(192.168.0.218:3306)/opms?loc=Local&parseTime=true"
 
 [micro_srv]
-    auth = "dashoo.opms.admin-0.0.1-sxy,192.168.0.106:8888"
+    auth = "dashoo.opms.admin-0.0.1"
     tenant = "default"