Преглед изворни кода

Merge branch 'develop' of http://code.dashoo.cn/chengjian/opms_backend into develop

liuyaqi пре 2 година
родитељ
комит
939974dc8f
53 измењених фајлова са 197 додато и 109 уклоњено
  1. 15 0
      opms_admin/app/handler/base_region_auth.go
  2. 31 1
      opms_admin/app/service/base_region_auth.go
  3. 1 1
      opms_parent/app/dao/base/internal/base_distributor.go
  4. 1 1
      opms_parent/app/dao/base/internal/base_distributor_contact.go
  5. 1 1
      opms_parent/app/dao/base/internal/base_district.go
  6. 1 1
      opms_parent/app/dao/base/internal/base_product.go
  7. 1 1
      opms_parent/app/dao/base/internal/base_sales_region.go
  8. 1 1
      opms_parent/app/dao/base/internal/base_sales_region_detail.go
  9. 1 1
      opms_parent/app/dao/contract/internal/ctr_contract.go
  10. 1 1
      opms_parent/app/dao/contract/internal/ctr_contract_append.go
  11. 1 1
      opms_parent/app/dao/contract/internal/ctr_contract_dynamics.go
  12. 1 1
      opms_parent/app/dao/contract/internal/ctr_contract_product.go
  13. 1 1
      opms_parent/app/dao/cust/internal/cust_customer.go
  14. 1 1
      opms_parent/app/dao/cust/internal/cust_customer_belong.go
  15. 1 1
      opms_parent/app/dao/cust/internal/cust_customer_bid_record.go
  16. 1 1
      opms_parent/app/dao/cust/internal/cust_customer_contact.go
  17. 1 1
      opms_parent/app/dao/cust/internal/cust_customer_dynamics.go
  18. 1 1
      opms_parent/app/dao/cust/internal/cust_customer_invoice_header.go
  19. 1 1
      opms_parent/app/dao/dingtalk_log/internal/dingtalk_log.go
  20. 1 1
      opms_parent/app/dao/plat/internal/plat_followup.go
  21. 1 1
      opms_parent/app/dao/plat/internal/plat_followup_comment.go
  22. 1 1
      opms_parent/app/dao/plat/internal/plat_followup_file.go
  23. 1 1
      opms_parent/app/dao/plat/internal/plat_punch_records.go
  24. 1 1
      opms_parent/app/dao/plat/internal/plat_questionnaire.go
  25. 1 1
      opms_parent/app/dao/plat/internal/plat_schedule.go
  26. 1 1
      opms_parent/app/dao/plat/internal/plat_schedule_attendee.go
  27. 1 1
      opms_parent/app/dao/plat/internal/plat_schedule_remind.go
  28. 1 1
      opms_parent/app/dao/plat/internal/plat_task.go
  29. 1 1
      opms_parent/app/dao/plat/internal/plat_task_comment.go
  30. 1 1
      opms_parent/app/dao/plat/internal/plat_task_handle.go
  31. 1 1
      opms_parent/app/dao/plat/internal/plat_task_log.go
  32. 1 1
      opms_parent/app/dao/plat/internal/plat_task_progress.go
  33. 1 1
      opms_parent/app/dao/plat/internal/plat_user_config.go
  34. 1 1
      opms_parent/app/dao/proj/internal/proj_business.go
  35. 1 1
      opms_parent/app/dao/proj/internal/proj_business_contact.go
  36. 1 1
      opms_parent/app/dao/proj/internal/proj_business_file.go
  37. 1 1
      opms_parent/app/dao/proj/internal/proj_business_product.go
  38. 1 1
      opms_parent/app/dao/proj/internal/proj_business_team.go
  39. 1 1
      opms_parent/app/dao/sys_report/internal/sys_report.go
  40. 1 1
      opms_parent/app/dao/sys_report/internal/sys_role_report.go
  41. 1 1
      opms_parent/app/dao/workflow/internal/plat_workflow.go
  42. 6 6
      opms_parent/app/handler/cust/cust_customer_bid_record.go
  43. 25 1
      opms_parent/app/handler/proj/business.go
  44. 6 6
      opms_parent/app/handler/sysreport/sys_role_report.go
  45. 20 22
      opms_parent/app/model/cust/cust_customer.go
  46. 1 0
      opms_parent/app/model/plat/plat_task.go
  47. 8 8
      opms_parent/app/model/proj/proj_business.go
  48. 6 6
      opms_parent/app/service/contract/ctr_contract.go
  49. 8 8
      opms_parent/app/service/cust/cust_customer.go
  50. 17 2
      opms_parent/app/service/plat/plat_followup.go
  51. 3 0
      opms_parent/app/service/plat/plat_task.go
  52. 3 1
      opms_parent/app/service/proj/business.go
  53. 9 9
      opms_parent/app/service/sys_report/sys_role_report.go

+ 15 - 0
opms_admin/app/handler/base_region_auth.go

@@ -62,3 +62,18 @@ func (h *BaseRegionAuthHandler) GetRegionUsers(ctx context.Context, req *model.S
 	rsp.Data = g.Map{"list": list, "total": total}
 	return nil
 }
+
+// GetUserSalesProvince 获取用户销售省份
+func (h *BaseRegionAuthHandler) GetUserSalesProvince(ctx context.Context, nullParams interface{}, rsp *comm_def.CommonMsg) error {
+	regionService, err := service.NewRegionService(ctx)
+	if err != nil {
+		g.Log().Error(err)
+		return errors.New("系统异常,请重新尝试")
+	}
+	list, err := regionService.GetCurrentUserProvinceAuth()
+	if err != nil {
+		return err
+	}
+	rsp.Data = g.Map{"list": list}
+	return nil
+}

+ 31 - 1
opms_admin/app/service/base_region_auth.go

@@ -187,7 +187,7 @@ func (s *regionService) GetRegionUsers(req *model.SysUserSearchReq) (total int,
 	return
 }
 
-// 获取当前用户产品授权
+// 获取当前用户 地区授权
 func (s *regionService) getCurrentUserRegionAuth(userId ...int) ([]string, error) {
 	defaultUser := s.GetCxtUserId()
 	if len(userId) > 0 {
@@ -199,3 +199,33 @@ func (s *regionService) getCurrentUserRegionAuth(userId ...int) ([]string, error
 	}
 	return gconv.Strings(result), nil
 }
+
+// 获取当前用户地区省份授权
+func (s *regionService) GetCurrentUserProvinceAuth(userId ...int) (g.Map, error) {
+	defaultUser := s.GetCxtUserId()
+	if len(userId) > 0 {
+		defaultUser = userId[0]
+	}
+	authList, err := s.Dao.Where(s.Dao.C.UserId, defaultUser).Fields(s.Dao.C.ProvinceId, s.Dao.C.ProvinceName).Distinct().All()
+	if err != nil {
+		return nil, err
+	}
+	if len(authList) == 0 {
+		return nil, err
+	}
+	provinceList := make(g.ListStrStr, 0)
+	for _, v := range authList {
+		provinceList = append(provinceList, g.MapStrStr{
+			"id":         "auth" + gconv.String(v.ProvinceId),
+			"regionCode": gconv.String(v.ProvinceId),
+			"regionDesc": v.ProvinceName,
+		})
+	}
+	result := g.Map{
+		"id":         "auth99999999",
+		"regionCode": "99999999",
+		"regionDesc": "负责区域",
+		"children":   provinceList,
+	}
+	return result, nil
+}

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

@@ -720,7 +720,7 @@ func (d *BaseDistributorDao) Unscoped() *BaseDistributorDao {
 // DataScope enables the DataScope feature.
 func (d *BaseDistributorDao) DataScope(ctx context.Context, userCol ...string) *BaseDistributorDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -696,7 +696,7 @@ func (d *BaseDistributorContactDao) Unscoped() *BaseDistributorContactDao {
 // DataScope enables the DataScope feature.
 func (d *BaseDistributorContactDao) DataScope(ctx context.Context, userCol ...string) *BaseDistributorContactDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -696,7 +696,7 @@ func (d *BaseDistrictDao) Unscoped() *BaseDistrictDao {
 // DataScope enables the DataScope feature.
 func (d *BaseDistrictDao) DataScope(ctx context.Context, userCol ...string) *BaseDistrictDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -699,7 +699,7 @@ func (d *BaseProductDao) Unscoped() *BaseProductDao {
 // DataScope enables the DataScope feature.
 func (d *BaseProductDao) DataScope(ctx context.Context, userCol ...string) *BaseProductDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -690,7 +690,7 @@ func (d *BaseSalesRegionDao) Unscoped() *BaseSalesRegionDao {
 // DataScope enables the DataScope feature.
 func (d *BaseSalesRegionDao) DataScope(ctx context.Context, userCol ...string) *BaseSalesRegionDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -693,7 +693,7 @@ func (d *BaseSalesRegionDetailDao) Unscoped() *BaseSalesRegionDetailDao {
 // DataScope enables the DataScope feature.
 func (d *BaseSalesRegionDetailDao) DataScope(ctx context.Context, userCol ...string) *BaseSalesRegionDetailDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -762,7 +762,7 @@ func (d *CtrContractDao) Unscoped() *CtrContractDao {
 // DataScope enables the DataScope feature.
 func (d *CtrContractDao) DataScope(ctx context.Context, userCol ...string) *CtrContractDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -690,7 +690,7 @@ func (d *CtrContractAppendDao) Unscoped() *CtrContractAppendDao {
 // DataScope enables the DataScope feature.
 func (d *CtrContractAppendDao) DataScope(ctx context.Context, userCol ...string) *CtrContractAppendDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -696,7 +696,7 @@ func (d *CtrContractDynamicsDao) Unscoped() *CtrContractDynamicsDao {
 // DataScope enables the DataScope feature.
 func (d *CtrContractDynamicsDao) DataScope(ctx context.Context, userCol ...string) *CtrContractDynamicsDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -708,7 +708,7 @@ func (d *CtrContractProductDao) Unscoped() *CtrContractProductDao {
 // DataScope enables the DataScope feature.
 func (d *CtrContractProductDao) DataScope(ctx context.Context, userCol ...string) *CtrContractProductDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -744,7 +744,7 @@ func (d *CustCustomerDao) Unscoped() *CustCustomerDao {
 // DataScope enables the DataScope feature.
 func (d *CustCustomerDao) DataScope(ctx context.Context, userCol ...string) *CustCustomerDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -702,7 +702,7 @@ func (d *CustCustomerBelongDao) Unscoped() *CustCustomerBelongDao {
 // DataScope enables the DataScope feature.
 func (d *CustCustomerBelongDao) DataScope(ctx context.Context, userCol ...string) *CustCustomerBelongDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -702,7 +702,7 @@ func (d *CustCustomerBidRecordDao) Unscoped() *CustCustomerBidRecordDao {
 // DataScope enables the DataScope feature.
 func (d *CustCustomerBidRecordDao) DataScope(ctx context.Context, userCol ...string) *CustCustomerBidRecordDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -708,7 +708,7 @@ func (d *CustCustomerContactDao) Unscoped() *CustCustomerContactDao {
 // DataScope enables the DataScope feature.
 func (d *CustCustomerContactDao) DataScope(ctx context.Context, userCol ...string) *CustCustomerContactDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -696,7 +696,7 @@ func (d *CustCustomerDynamicsDao) Unscoped() *CustCustomerDynamicsDao {
 // DataScope enables the DataScope feature.
 func (d *CustCustomerDynamicsDao) DataScope(ctx context.Context, userCol ...string) *CustCustomerDynamicsDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -699,7 +699,7 @@ func (d *CustCustomerInvoiceHeaderDao) Unscoped() *CustCustomerInvoiceHeaderDao
 // DataScope enables the DataScope feature.
 func (d *CustCustomerInvoiceHeaderDao) DataScope(ctx context.Context, userCol ...string) *CustCustomerInvoiceHeaderDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -684,7 +684,7 @@ func (d *DingtalkLogDao) Unscoped() *DingtalkLogDao {
 // DataScope enables the DataScope feature.
 func (d *DingtalkLogDao) DataScope(ctx context.Context, userCol ...string) *DingtalkLogDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -714,7 +714,7 @@ func (d *PlatFollowupDao) Unscoped() *PlatFollowupDao {
 // DataScope enables the DataScope feature.
 func (d *PlatFollowupDao) DataScope(ctx context.Context, userCol ...string) *PlatFollowupDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -687,7 +687,7 @@ func (d *PlatFollowupCommentDao) Unscoped() *PlatFollowupCommentDao {
 // DataScope enables the DataScope feature.
 func (d *PlatFollowupCommentDao) DataScope(ctx context.Context, userCol ...string) *PlatFollowupCommentDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -690,7 +690,7 @@ func (d *PlatFollowupFileDao) Unscoped() *PlatFollowupFileDao {
 // DataScope enables the DataScope feature.
 func (d *PlatFollowupFileDao) DataScope(ctx context.Context, userCol ...string) *PlatFollowupFileDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -705,7 +705,7 @@ func (d *PlatPunchRecordsDao) Unscoped() *PlatPunchRecordsDao {
 // DataScope enables the DataScope feature.
 func (d *PlatPunchRecordsDao) DataScope(ctx context.Context, userCol ...string) *PlatPunchRecordsDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -702,7 +702,7 @@ func (d *PlatQuestionnaireDao) Unscoped() *PlatQuestionnaireDao {
 // DataScope enables the DataScope feature.
 func (d *PlatQuestionnaireDao) DataScope(ctx context.Context, userCol ...string) *PlatQuestionnaireDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -711,7 +711,7 @@ func (d *PlatScheduleDao) Unscoped() *PlatScheduleDao {
 // DataScope enables the DataScope feature.
 func (d *PlatScheduleDao) DataScope(ctx context.Context, userCol ...string) *PlatScheduleDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -693,7 +693,7 @@ func (d *PlatScheduleAttendeeDao) Unscoped() *PlatScheduleAttendeeDao {
 // DataScope enables the DataScope feature.
 func (d *PlatScheduleAttendeeDao) DataScope(ctx context.Context, userCol ...string) *PlatScheduleAttendeeDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -696,7 +696,7 @@ func (d *PlatScheduleRemindDao) Unscoped() *PlatScheduleRemindDao {
 // DataScope enables the DataScope feature.
 func (d *PlatScheduleRemindDao) DataScope(ctx context.Context, userCol ...string) *PlatScheduleRemindDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -756,7 +756,7 @@ func (d *PlatTaskDao) Unscoped() *PlatTaskDao {
 // DataScope enables the DataScope feature.
 func (d *PlatTaskDao) DataScope(ctx context.Context, userCol ...string) *PlatTaskDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -687,7 +687,7 @@ func (d *PlatTaskCommentDao) Unscoped() *PlatTaskCommentDao {
 // DataScope enables the DataScope feature.
 func (d *PlatTaskCommentDao) DataScope(ctx context.Context, userCol ...string) *PlatTaskCommentDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -705,7 +705,7 @@ func (d *PlatTaskHandleDao) Unscoped() *PlatTaskHandleDao {
 // DataScope enables the DataScope feature.
 func (d *PlatTaskHandleDao) DataScope(ctx context.Context, userCol ...string) *PlatTaskHandleDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -693,7 +693,7 @@ func (d *PlatTaskLogDao) Unscoped() *PlatTaskLogDao {
 // DataScope enables the DataScope feature.
 func (d *PlatTaskLogDao) DataScope(ctx context.Context, userCol ...string) *PlatTaskLogDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -690,7 +690,7 @@ func (d *PlatTaskProgressDao) Unscoped() *PlatTaskProgressDao {
 // DataScope enables the DataScope feature.
 func (d *PlatTaskProgressDao) DataScope(ctx context.Context, userCol ...string) *PlatTaskProgressDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -687,7 +687,7 @@ func (d *PlatUserConfigDao) Unscoped() *PlatUserConfigDao {
 // DataScope enables the DataScope feature.
 func (d *PlatUserConfigDao) DataScope(ctx context.Context, userCol ...string) *PlatUserConfigDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

+ 1 - 1
opms_parent/app/dao/proj/internal/proj_business.go

@@ -867,7 +867,7 @@ func (d *ProjBusinessDao) Unscoped() *ProjBusinessDao {
 // DataScope enables the DataScope feature.
 func (d *ProjBusinessDao) DataScope(ctx context.Context, userCol ...string) *ProjBusinessDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -684,7 +684,7 @@ func (d *ProjBusinessContactDao) Unscoped() *ProjBusinessContactDao {
 // DataScope enables the DataScope feature.
 func (d *ProjBusinessContactDao) DataScope(ctx context.Context, userCol ...string) *ProjBusinessContactDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -693,7 +693,7 @@ func (d *ProjBusinessFileDao) Unscoped() *ProjBusinessFileDao {
 // DataScope enables the DataScope feature.
 func (d *ProjBusinessFileDao) DataScope(ctx context.Context, userCol ...string) *ProjBusinessFileDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -708,7 +708,7 @@ func (d *ProjBusinessProductDao) Unscoped() *ProjBusinessProductDao {
 // DataScope enables the DataScope feature.
 func (d *ProjBusinessProductDao) DataScope(ctx context.Context, userCol ...string) *ProjBusinessProductDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -693,7 +693,7 @@ func (d *ProjBusinessTeamDao) Unscoped() *ProjBusinessTeamDao {
 // DataScope enables the DataScope feature.
 func (d *ProjBusinessTeamDao) DataScope(ctx context.Context, userCol ...string) *ProjBusinessTeamDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -693,7 +693,7 @@ func (d *SysReportDao) Unscoped() *SysReportDao {
 // DataScope enables the DataScope feature.
 func (d *SysReportDao) DataScope(ctx context.Context, userCol ...string) *SysReportDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -684,7 +684,7 @@ func (d *SysRoleReportDao) Unscoped() *SysRoleReportDao {
 // DataScope enables the DataScope feature.
 func (d *SysRoleReportDao) DataScope(ctx context.Context, userCol ...string) *SysRoleReportDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

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

@@ -699,7 +699,7 @@ func (d *PlatWorkflowDao) Unscoped() *PlatWorkflowDao {
 // DataScope enables the DataScope feature.
 func (d *PlatWorkflowDao) DataScope(ctx context.Context, userCol ...string) *PlatWorkflowDao {
 	cs := ctx.Value("contextService")
-	dataScope := gconv.Map(cs)["dataScope"].(g.Map)
+	dataScope := gconv.Map(gconv.String(gconv.Map(cs)["dataScope"]))
 	if dataScope != nil {
 		tableAs := d.TableAs
 		if d.TableAs != "" {

+ 6 - 6
opms_parent/app/handler/cust/cust_customer_bid_record.go

@@ -4,15 +4,15 @@ import (
 	"context"
 	model "dashoo.cn/micro/app/model/cust"
 	service "dashoo.cn/micro/app/service/cust"
+	"github.com/gogf/gf/frame/g"
 
 	"dashoo.cn/common_definition/comm_def"
-	"github.com/gogf/gf/frame/g"
 )
 
 type CustCustomerBidRecordHandler struct{}
 
 func (c *CustCustomerBidRecordHandler) Get(ctx context.Context, req *model.IdRequiredReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("CustCustomerBidRecordHandler.Get request %#v ", *req)
+	g.Log().Infof("CustCustomerBidRecordHandler.Get request %#v ", req)
 	s, err := service.NewCustCustomerBidRecordService(ctx)
 	if err != nil {
 		return err
@@ -26,7 +26,7 @@ func (c *CustCustomerBidRecordHandler) Get(ctx context.Context, req *model.IdReq
 }
 
 func (c *CustCustomerBidRecordHandler) List(ctx context.Context, req *model.CustCustomerBidRecordListReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("CustCustomerBidRecordHandler.List request %#v ", *req)
+	g.Log().Infof("CustCustomerBidRecordHandler.List request %#v ", &req)
 	s, err := service.NewCustCustomerBidRecordService(ctx)
 	if err != nil {
 		return err
@@ -46,7 +46,7 @@ func (c *CustCustomerBidRecordHandler) List(ctx context.Context, req *model.Cust
 }
 
 func (c *CustCustomerBidRecordHandler) Add(ctx context.Context, req *model.CustCustomerBidRecordAddReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("CustCustomerBidRecordHandler.Add request %#v ", *req)
+	g.Log().Infof("CustCustomerBidRecordHandler.Add request %#v ", &req)
 	s, err := service.NewCustCustomerBidRecordService(ctx)
 	if err != nil {
 		return err
@@ -60,7 +60,7 @@ func (c *CustCustomerBidRecordHandler) Add(ctx context.Context, req *model.CustC
 }
 
 func (c *CustCustomerBidRecordHandler) Update(ctx context.Context, req *model.CustCustomerBidRecordUpdateReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("CustCustomerBidRecordHandler.Update request %#v ", *req)
+	g.Log().Infof("CustCustomerBidRecordHandler.Update request %#v ", &req)
 	s, err := service.NewCustCustomerBidRecordService(ctx)
 	if err != nil {
 		return err
@@ -73,7 +73,7 @@ func (c *CustCustomerBidRecordHandler) Update(ctx context.Context, req *model.Cu
 }
 
 func (c *CustCustomerBidRecordHandler) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("CustCustomerBidRecordHandler.Delete request %#v ", *req)
+	g.Log().Infof("CustCustomerBidRecordHandler.Delete request %#v ", &req)
 	s, err := service.NewCustCustomerBidRecordService(ctx)
 	if err != nil {
 		return err

+ 25 - 1
opms_parent/app/handler/proj/business.go

@@ -158,11 +158,35 @@ func (p *BusinessHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq,
 
 // BusinessUpgrade 项目升级
 // Swagger:Business 项目 项目升级
-func (p *BusinessHandler) BusinessUpgrade(ctx context.Context, args *multipart.MultipartFile, rsp *comm_def.CommonMsg) error {
+func (p *BusinessHandler) BusinessUpgrade(ctx context.Context, req *projModel.BusinessUpgradeReq, rsp *comm_def.CommonMsg) error {
+	// 参数校验
+	if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
+		return err
+	}
+	if req.NboType != projSrv.StatusC && req.NboBudget <= 0 {
+		return myerrors.TipsError("项目预算不能小于0")
+	}
+	businessService, err := projSrv.NewBusinessService(ctx)
+	if err != nil {
+		return err
+	}
+	err = businessService.BusinessUpgrade(req, nil)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// BusinessUpgradeA 项目升级A类
+// Swagger:Business 项目 项目升级
+func (p *BusinessHandler) BusinessUpgradeA(ctx context.Context, args *multipart.MultipartFile, rsp *comm_def.CommonMsg) error {
 	req := new(projModel.BusinessUpgradeReq)
 	if err := gconv.Struct(args.Meta, req); err != nil {
 		return err
 	}
+	if req.NboType != projSrv.StatusC && req.NboBudget <= 0 {
+		return myerrors.TipsError("项目预算不能小于0")
+	}
 	if req.NboType == projSrv.StatusA && req.IsAdoptDashoo == "10" {
 		if args.FileName == "" {
 			return fmt.Errorf("文件名称不能为空")

+ 6 - 6
opms_parent/app/handler/sysreport/sys_role_report.go

@@ -13,7 +13,7 @@ type SysRoleReportHandler struct{}
 
 // Swagger:RoleReport 获取列表数据
 func (c *SysRoleReportHandler) GetList(ctx context.Context, req *sys_report.SysRoleReportListReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("SysReportHandler.List request %#v ", *req)
+	g.Log().Infof("SysReportHandler.List request %#v ", &req)
 	s, err := service.NewSysRoleReportService(ctx)
 	if err != nil {
 		return err
@@ -28,7 +28,7 @@ func (c *SysRoleReportHandler) GetList(ctx context.Context, req *sys_report.SysR
 
 // Swagger:RoleReport 添加数据
 func (c *SysRoleReportHandler) Add(ctx context.Context, req *sys_report.SysRoleReportListAdd, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("SysReportHandler.Add request %#v ", req)
+	g.Log().Infof("SysReportHandler.Add request %#v ", &req)
 	s, err := service.NewSysRoleReportService(ctx)
 	if err != nil {
 		return err
@@ -42,7 +42,7 @@ func (c *SysRoleReportHandler) Add(ctx context.Context, req *sys_report.SysRoleR
 
 // Swagger:RoleReport 更新数据
 func (c *SysRoleReportHandler) Update(ctx context.Context, req *sys_report.SysRoleReport, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("SysReportHandler.Update request %#v ", *req)
+	g.Log().Infof("SysReportHandler.Update request %#v ", &req)
 	s, err := service.NewSysRoleReportService(ctx)
 	if err != nil {
 		return err
@@ -54,7 +54,7 @@ func (c *SysRoleReportHandler) Update(ctx context.Context, req *sys_report.SysRo
 
 // Swagger:RoleReport 删除数据
 func (c *SysRoleReportHandler) Delete(ctx context.Context, req *sys_report.IdsReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("SysReportHandler.Delete request %#v ", *req)
+	g.Log().Infof("SysReportHandler.Delete request %#v ", &req)
 	s, err := service.NewSysRoleReportService(ctx)
 	if err != nil {
 		return err
@@ -68,7 +68,7 @@ func (c *SysRoleReportHandler) Delete(ctx context.Context, req *sys_report.IdsRe
 
 // Swagger:RoleReport 数据详情
 func (c *SysRoleReportHandler) Get(ctx context.Context, req *model.IdRequiredReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("SysReportHandler.Get request %#v ", *req)
+	g.Log().Infof("SysReportHandler.Get request %#v ", &req)
 	s, err := service.NewSysRoleReportService(ctx)
 	if err != nil {
 		return err
@@ -83,7 +83,7 @@ func (c *SysRoleReportHandler) Get(ctx context.Context, req *model.IdRequiredReq
 
 // Swagger:RoleReport 获取列表数据
 func (c *SysRoleReportHandler) RoleList(ctx context.Context, req *sys_report.SysRoleReportListReq, rsp *comm_def.CommonMsg) error {
-	g.Log().Infof("SysReportHandler.RoleList request %#v ", *req)
+	g.Log().Infof("SysReportHandler.RoleList request %#v ", &req)
 	s, err := service.NewSysRoleReportService(ctx)
 	if err != nil {
 		return err

+ 20 - 22
opms_parent/app/model/cust/cust_customer.go

@@ -5,10 +5,8 @@
 package cust
 
 import (
-	"dashoo.cn/opms_libary/request"
-	"github.com/gogf/gf/os/gtime"
-
 	"dashoo.cn/micro/app/model/cust/internal"
+	"dashoo.cn/opms_libary/request"
 )
 
 // CustCustomer is the golang structure for table cust_customer.
@@ -46,25 +44,25 @@ type CustExport struct {
 
 // CustomerAddSeq 单表添加客户信息表
 type CustomerAddSeq struct {
-	CustName       string      `p:"custName"        json:"custName"      v:"required#客户名称不能为空"`     // 客户名称
-	AbbrName       string      `p:"abbrName"        json:"abbrName"   `                             // 助计名
-	CustLocation   string      `p:"custLocation"    json:"custLocation"    `                        // 所在地区
-	CustAddress    string      `p:"custAddress"     json:"custAddress"   `                          // 详细地址
-	CustProvinceId int         `json:"custProvinceId"`                                              // 所在省ID
-	CustProvince   string      `json:"custProvince"`                                                // 所在省
-	CustCityId     int         `json:"custCityId"`                                                  // 所在市ID
-	CustCity       string      `json:"custCity"`                                                    // 所在市
-	CustRegionId   int         `json:"custRegionId"`                                                // 所在区县ID
-	CustRegion     string      `json:"custRegion"`                                                  // 所在区县
-	FollowUpDate   *gtime.Time `p:"followUpDate"    json:"followUpDate"   `                         //跟进时间
-	CustIndustry   string      `p:"custIndustry"    json:"custIndustry"  v:"required#客户行业不能为空"`     //客户行业
-	CustLevel      string      `p:"custLevel"       json:"custLevel"`                               //客户级别
-	CustSource     string      `p:"custSource"      json:"custSource"        v:"required#客户来源不能为空"` //客户来源
-	CustDistCode   int         `p:"custDistCode"    json:"custDistCode"  v:"required#省份不能为空" `      // 省份Id
-	Remark         string      `p:"remark"          json:"remark"`                                  //备注
-	SalesName      string      `p:"salesName"       json:"salesName"   `                            // 销售名称
-	SalesId        int         `p:"salesId"         json:"salesId"   `                              // 销售id
-	InvoiceHeader  string      `json:"invoiceHeader"`                                               // 开票抬头
+	CustName       string `p:"custName"        json:"custName"      v:"required#客户名称不能为空"` // 客户名称
+	AbbrName       string `p:"abbrName"        json:"abbrName"   `                         // 助计名
+	CustLocation   string `p:"custLocation"    json:"custLocation"    `                    // 所在地区
+	CustAddress    string `p:"custAddress"     json:"custAddress"   `                      // 详细地址
+	CustProvinceId int    `json:"custProvinceId"`                                          // 所在省ID
+	CustProvince   string `json:"custProvince"`                                            // 所在省
+	CustCityId     int    `json:"custCityId"`                                              // 所在市ID
+	CustCity       string `json:"custCity"`                                                // 所在市
+	CustRegionId   int    `json:"custRegionId"`                                            // 所在区县ID
+	CustRegion     string `json:"custRegion"`                                              // 所在区县
+	//FollowUpDate   *gtime.Time `p:"followUpDate"    json:"followUpDate"   `                         //跟进时间
+	CustIndustry  string `p:"custIndustry"    json:"custIndustry"  v:"required#客户行业不能为空"`     //客户行业
+	CustLevel     string `p:"custLevel"       json:"custLevel"`                               //客户级别
+	CustSource    string `p:"custSource"      json:"custSource"        v:"required#客户来源不能为空"` //客户来源
+	CustDistCode  int    `p:"custDistCode"    json:"custDistCode"  v:"required#省份不能为空" `      // 省份Id
+	Remark        string `p:"remark"          json:"remark"`                                  //备注
+	SalesName     string `p:"salesName"       json:"salesName"   `                            // 销售名称
+	SalesId       int    `p:"salesId"         json:"salesId"   `                              // 销售id
+	InvoiceHeader string `json:"invoiceHeader"`                                               // 开票抬头
 }
 
 // 客户联系人信息

+ 1 - 0
opms_parent/app/model/plat/plat_task.go

@@ -22,6 +22,7 @@ type PlatTaskEx struct {
 
 // 查询
 type SearchPlatTaskReq struct {
+	TaskId      string `json:"taskId"`      // 任务Id
 	TaskTitle   string `json:"taskTitle"`   // 任务标题
 	TaskType    string `son:"taskType"`     // 任务类型 数据字典
 	Source      string `json:"source"`      // 事项来源 数据字典

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

@@ -98,14 +98,14 @@ type BusinessProduct struct {
 
 // BusinessUpgradeReq 项目升级请求
 type BusinessUpgradeReq struct {
-	Id                      int         `json:"id"                      v:"required|min:1#|id不能为空"`                                // 主键
-	NboType                 string      `json:"nboType"                 v:"required|in:10,20,30#项目级别不能为空|项目级别错误"`                  // 项目级别
-	NboBudget               float64     `json:"nboBudget"               v:"required-unless:nboType,30|min:0.01#项目预算不能为空|项目预算应大于0"` // 项目预算
-	DistributorId           int         `json:"distributorId"           `                                                          // 经销商/代理商ID
-	DistributorName         string      `json:"distributorName"         `                                                          // 经销商/代理商名称
-	TechnicalSupportName    string      `json:"technicalSupportName"    v:"required-unless:nboType,30#技术支持人员不能为空"`                 // 技术支持人员
-	TechnicalSupportContent string      `json:"technicalSupportContent" v:"required-unless:nboType,30#技术支持内容不能为空"`                 // 技术支持内容
-	TechnicalSupportTime    *gtime.Time `json:"technicalSupportTime"    v:"required-unless:nboType,30#技术支持时间不能为空"`                 // 技术支持时间
+	Id                      int         `json:"id"                      v:"required|min:1#|id不能为空"`                // 主键
+	NboType                 string      `json:"nboType"                 v:"required|in:10,20,30#项目级别不能为空|项目级别错误"`  // 项目级别
+	NboBudget               float64     `json:"nboBudget"               v:"required-unless:nboType,30#项目预算不能为空"`   // 项目预算
+	DistributorId           int         `json:"distributorId"           `                                          // 经销商/代理商ID
+	DistributorName         string      `json:"distributorName"         `                                          // 经销商/代理商名称
+	TechnicalSupportName    string      `json:"technicalSupportName"    v:"required-unless:nboType,30#技术支持人员不能为空"` // 技术支持人员
+	TechnicalSupportContent string      `json:"technicalSupportContent" v:"required-unless:nboType,30#技术支持内容不能为空"` // 技术支持内容
+	TechnicalSupportTime    *gtime.Time `json:"technicalSupportTime"    v:"required-unless:nboType,30#技术支持时间不能为空"` // 技术支持时间
 	//CustomerSatisfaction      string      `json:"customerSatisfaction"`      // 客户满意度 (10很满意、20满意、30较满意、40一般、50不满意)
 	ParentReceiver            string      `json:"parentReceiver"`                                                  // 总部对接人
 	NboBudgetTime             *gtime.Time `json:"nboBudgetTime"`                                                   // 项目预算期限

+ 6 - 6
opms_parent/app/service/contract/ctr_contract.go

@@ -792,12 +792,12 @@ func (s CtrContractService) Update(ctx context.Context, req *model.CtrContractUp
 	if req.ContractEndTime != nil {
 		toupdate["contract_end_time"] = req.ContractEndTime
 	}
-	if req.InchargeId != 0 {
-		toupdate["incharge_id"] = req.InchargeId
-	}
-	if req.InchargeName != "" {
-		toupdate["incharge_name"] = req.InchargeName
-	}
+	//if req.InchargeId != 0 {
+	//	toupdate["incharge_id"] = req.InchargeId
+	//}
+	//if req.InchargeName != "" {
+	//	toupdate["incharge_name"] = req.InchargeName
+	//}
 	if req.SignatoryId != 0 {
 		toupdate["signatory_id"] = req.SignatoryId
 	}

+ 8 - 8
opms_parent/app/service/cust/cust_customer.go

@@ -8,6 +8,7 @@ import (
 	"math"
 	"strconv"
 	"strings"
+	"time"
 
 	"dashoo.cn/common_definition/comm_def"
 	"dashoo.cn/opms_libary/micro_srv"
@@ -981,18 +982,17 @@ func (s *CustomerService) CustAbstract(Id int64) (followInfo *model.Follow, err
 		return
 	}
 	now := gtime.Now()
-	var hours float64
-	if followTime.FollowUpDate == nil {
-		poor := now.Sub(gtime.New(followTime.CreatedTime))
-		hours = float64(poor.Hours() / 24)
+	var difference time.Duration
+	if followTime.FollowUpDate.IsZero() {
+		difference = now.Sub(gtime.New(followTime.CreatedTime))
 	} else {
-		poor := now.Sub(gtime.New(followTime.FollowUpDate))
-		hours = float64(poor.Hours() / 24)
+		difference = now.Sub(gtime.New(followTime.FollowUpDate))
 	}
-	if hours < 0 {
+	days := difference.Hours() / 24
+	if days < 0 {
 		followInfo.NotFollowDay = 0
 	} else {
-		followInfo.NotFollowDay = int(math.Floor(hours))
+		followInfo.NotFollowDay = int(math.Floor(days))
 	}
 	return
 }

+ 17 - 2
opms_parent/app/service/plat/plat_followup.go

@@ -2,7 +2,9 @@ package plat
 
 import (
 	"context"
+	projdao "dashoo.cn/micro/app/dao/proj"
 	"database/sql"
+	"github.com/gogf/gf/container/garray"
 	"strconv"
 	"strings"
 
@@ -33,7 +35,7 @@ func NewFollowupService(ctx context.Context) (svc *followupService, err error) {
 
 // 跟进记录信息列表
 func (s *followupService) GetList(req *model.SearchPlatFollowupReq) (total int, followupList []*model.PlatFollowup, err error) {
-	followupModel := s.Dao.M
+	followupModel := s.Dao.DataScope(s.Ctx)
 
 	if req.CustId != "" {
 		followupModel = followupModel.Where("cust_id", req.CustId)
@@ -113,13 +115,26 @@ func (s *followupService) Create(req *model.AddPlatFollowupReq) (err error) {
 	}
 	_, err = s.Dao.DB.Update("cust_customer", toUpdate, "id = ?", req.CustId)
 
+	if platFollowup.TargetType == "20" {
+		// 更新客户 最后跟进时间 字段
+		toUpdate := map[string]interface{}{
+			projdao.ProjBusiness.C.FinalFollowTime: req.FollowDate,
+			projdao.ProjBusiness.C.FinalFollowId:   s.GetCxtUserId(),
+			projdao.ProjBusiness.C.FinalFollowName: s.GetCxtUserName(),
+		}
+		_, err = s.Dao.DB.Update(projdao.ProjBusiness.Table, toUpdate, "id = ?", req.TargetId)
+	}
+
 	return
 }
 
 // 跟进记录信息列表:按照日期显示,并附带评论
 func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total int, followupList []*model.FollowupInfoResp, err error) {
 	followupModel := s.Dao.M
-
+	// 用户仅有销售工程师角色展示自己的数据,其他人可以看到所有数据
+	if garray.NewStrArrayFrom(s.CxtUser.Roles, true).Contains("SalesEngineer") {
+		followupModel = followupModel.WhereIn("created_by", s.DataScope["userIds"])
+	}
 	if req.CustId != "" {
 		followupModel = followupModel.Where("cust_id", req.CustId)
 	}

+ 3 - 0
opms_parent/app/service/plat/plat_task.go

@@ -45,6 +45,9 @@ func NewTaskService(ctx context.Context) (svc *taskService, err error) {
 // GetList 任务信息列表
 func (s *taskService) GetList(req *model.SearchPlatTaskReq) (total int, TaskList []*model.PlatTaskEx, err error) {
 	TaskModel := s.Dao.LeftJoin("plat_task_handle", "plat_task_handle.task_id=plat_task.id")
+	if req.TaskId != "" {
+		TaskModel = TaskModel.Where("plat_task.id", req.TaskId)
+	}
 	if req.TaskTitle != "" {
 		TaskModel = TaskModel.Where("plat_task.task_title LIKE ?", "%"+req.TaskTitle+"%")
 	}

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

@@ -130,6 +130,7 @@ func (p *businessService) GetBusinessDynamics(req *model.BusinessReq) (total int
 				"opnContent": gconv.Map(v.OpnContent),
 			})
 			result[opnDate] = temp
+			opnDateFlag = opnDate
 		}
 	}
 	return
@@ -296,7 +297,8 @@ func (p *businessService) UpdateById(req *model.UpdateProjBusinessReq) error {
 
 	err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
 		// 更新项目
-		_, err = p.Dao.TX(tx).FieldsEx(service.UpdateFieldEx...).WherePri(projDao.ProjBusiness.C.Id, req.Id).Update(businessData)
+		updateFieldEx := append(service.UpdateFieldEx, p.Dao.C.SaleId, p.Dao.C.SaleName)
+		_, err = p.Dao.TX(tx).FieldsEx(updateFieldEx...).WherePri(projDao.ProjBusiness.C.Id, req.Id).Update(businessData)
 		if err != nil {
 			return err
 		}

+ 9 - 9
opms_parent/app/service/sys_report/sys_role_report.go

@@ -39,11 +39,11 @@ func NewSysRoleReportService(ctx context.Context) (*SysRoleReportService, error)
 		userInfo: userInfo,
 	}, nil
 }
-func (s SysRoleReportService) List(ctx context.Context, req *sys_report.SysRoleReportListReq) (int, []model.SysRoleReportListReq, error) {
+func (s SysRoleReportService) List(ctx context.Context, req *sys_report.SysRoleReportListReq) (int, []model.SysReport, error) {
 
-	dao := s.Dao.Unscoped().As("a").
+	dao := s.Dao.Unscoped().As("a").Where("a.deleted_time is null").
 		LeftJoin("sys_role b", "a.role_id = b.id AND b.deleted_time is  null ").
-		LeftJoin("sys_report c", "c.id=a.report_id  AND c.deleted_time is  null ").Where("a.report_id=? and a.deleted_time is null", req.ReportId)
+		LeftJoin("sys_report c", "c.id=a.report_id  AND c.deleted_time is  null ").WhereIn("b.role_key", s.userInfo.Roles).Group("c.id")
 	total, err := dao.Count()
 	if err != nil {
 		return 0, nil, err
@@ -51,13 +51,13 @@ func (s SysRoleReportService) List(ctx context.Context, req *sys_report.SysRoleR
 	if req.PageNum != 0 {
 		dao = dao.Page(req.GetPage())
 	}
-	orderby := "a.created_time desc"
-	if req.OrderBy != "" {
-		orderby = req.OrderBy
-	}
-	dao = dao.Fields("a.*,b.role_name,c.report_name").Order(orderby)
+	//orderby := "a.created_time desc"
+	//if req.OrderBy != "" {
+	//	orderby = req.OrderBy
+	//}
+	dao = dao.Fields("c.*")
 
-	ents := []model.SysRoleReportListReq{}
+	ents := []model.SysReport{}
 	err = dao.Scan(&ents)
 	if err != nil && err != sql.ErrNoRows {
 		return 0, nil, err