Browse Source

此版本将tenantId修改成字符串兼职java版本的000000,需要重新导入doc/iot.sql

sixian 2 năm trước cách đây
mục cha
commit
16bf333776
100 tập tin đã thay đổi với 262 bổ sung259 xóa
  1. 2 2
      app/data/controller/calcTask.go
  2. 1 1
      app/data/dao/environmentDao.go
  3. 3 3
      app/device/controller/infoBoardController.go
  4. 1 1
      app/device/dao/LightStrategyDao.go
  5. 1 1
      app/device/dao/alarmDao.go
  6. 1 1
      app/device/dao/alarmTerminalDao.go
  7. 1 1
      app/device/dao/bridgeDao.go
  8. 1 1
      app/device/dao/bridgeSensorDao.go
  9. 1 1
      app/device/dao/cameraDao.go
  10. 1 1
      app/device/dao/captureUnitDao.go
  11. 1 1
      app/device/dao/checkPointDao.go
  12. 1 1
      app/device/dao/garbageDao.go
  13. 1 1
      app/device/dao/garbageWayGroupDao.go
  14. 1 1
      app/device/dao/gatewayDao.go
  15. 1 1
      app/device/dao/gatewayRelationDao.go
  16. 1 1
      app/device/dao/infoBoardDao.go
  17. 1 1
      app/device/dao/intelligentLightingDao.go
  18. 1 1
      app/device/dao/ipBroadcastDao.go
  19. 1 1
      app/device/dao/lampPoleDao.go
  20. 1 1
      app/device/dao/lampPoleGroupDao.go
  21. 1 1
      app/device/dao/lightControlDao.go
  22. 1 1
      app/device/dao/manholeCoverDao.go
  23. 1 1
      app/device/dao/onDemandGroupDao.go
  24. 1 1
      app/device/dao/onDemandSensorDao.go
  25. 2 2
      app/device/dao/optoSensoDao.go
  26. 1 1
      app/device/dao/switchBoxDao.go
  27. 2 2
      app/device/dao/tenantCodeDao.go
  28. 1 1
      app/device/dao/transformerDao.go
  29. 1 1
      app/device/dao/venderDao.go
  30. 5 5
      app/device/dao/workbenchDao.go
  31. 1 1
      app/device/dao/zigbeeDao.go
  32. 2 2
      app/device/service/LightStrategyService.go
  33. 4 4
      app/device/service/alarmService.go
  34. 2 2
      app/device/service/alarmTerminalService.go
  35. 3 3
      app/device/service/bridgeSensorService.go
  36. 3 3
      app/device/service/bridgeService.go
  37. 3 3
      app/device/service/cameraService.go
  38. 6 6
      app/device/service/captureUintService.go
  39. 4 4
      app/device/service/garbageService.go
  40. 3 3
      app/device/service/garbageWayGroupService.go
  41. 4 4
      app/device/service/gatewayService.go
  42. 4 4
      app/device/service/infoBoardService.go
  43. 7 7
      app/device/service/intelligentLightingService.go
  44. 5 5
      app/device/service/ipBroadcastService.go
  45. 8 8
      app/device/service/lampPoleGroupService.go
  46. 3 3
      app/device/service/lampPoleService.go
  47. 3 3
      app/device/service/lightControlService.go
  48. 3 3
      app/device/service/manholeCoverService.go
  49. 4 4
      app/device/service/onDemandGroupService.go
  50. 2 2
      app/device/service/onDemandSensorService.go
  51. 4 4
      app/device/service/optoSensoService.go
  52. 4 4
      app/device/service/switchBoxService.go
  53. 4 4
      app/device/service/transformerService.go
  54. 5 5
      app/device/service/utilService.go
  55. 8 9
      app/device/service/workbenchService.go
  56. 3 3
      app/device/service/zigbeeService.go
  57. 2 2
      app/middleware/token.go
  58. 9 0
      app/multimedia/controller/programController.go
  59. 1 1
      app/multimedia/dao/libraryDao.go
  60. 1 1
      app/multimedia/dao/programDao.go
  61. 7 7
      app/multimedia/dao/programRelationDao.go
  62. 1 1
      app/multimedia/dao/publishLibrariesDao.go
  63. 5 5
      app/multimedia/service/libraryService.go
  64. 7 7
      app/multimedia/service/programService.go
  65. 3 3
      app/multimedia/service/publishLibrariesService.go
  66. 1 1
      app/operation/dao/operationDao.go
  67. 1 1
      app/operation/dao/viewsAllCodeDeviceDao.go
  68. 4 4
      app/operation/service/alarmService.go
  69. 3 3
      app/operation/service/captureAreaService.go
  70. 1 1
      app/operation/service/captureCarRecordService.go
  71. 1 1
      app/operation/service/capturePeriodsService.go
  72. 2 2
      app/operation/service/captureReportService.go
  73. 4 4
      app/operation/service/captureService.go
  74. 3 3
      app/operation/service/captureSpeedService.go
  75. 3 3
      app/operation/service/captureVehicleTypeExService.go
  76. 4 4
      app/operation/service/deviceCoutService.go
  77. 1 1
      app/operation/service/environmentService.go
  78. 1 1
      app/operation/service/garbageService.go
  79. 4 5
      app/operation/service/lightingRateService.go
  80. 1 1
      app/security/service/securityService.go
  81. 2 2
      app/system/controller/tenant.go
  82. 2 5
      app/system/controller/token.go
  83. 1 1
      app/system/dao/operationHisDao.go
  84. 2 2
      app/system/dao/tenant.go
  85. 1 1
      app/system/dao/user.go
  86. 1 1
      app/system/model/tenant.go
  87. 3 3
      app/system/model/token.go
  88. 4 4
      app/system/service/dictService.go
  89. 2 2
      app/system/service/operationHisService.go
  90. 1 1
      app/system/service/roleService.go
  91. 4 4
      app/system/service/tenantService.go
  92. 4 4
      app/system/service/userService.go
  93. 1 1
      app/warn/dao/businessTacticsDao.go
  94. 1 1
      app/warn/dao/viewAllCodeDao.go
  95. 3 3
      app/warn/service/businessTacticsService.go
  96. 1 1
      app/warn/service/noticeRecordService.go
  97. 10 10
      app/warn/service/noticeSetService.go
  98. 7 8
      app/warn/service/platformAlarmService.go
  99. 1 1
      build.bat
  100. 0 0
      config/config.yaml

+ 2 - 2
app/data/controller/calcTask.go

@@ -44,7 +44,7 @@ func CalcTask() {
 		tenant := system.Tenant{}
 		tenants, _, _ := tenant.GetTenants(0, 1000)
 		for _, t := range tenants {
-			warnService.PlatformAlarmService.Refresh(int(t.TenantId))
+			warnService.PlatformAlarmService.Refresh(t.TenantId)
 		}
 		//发送告警
 		warnService.TaskWarnService.HandlingAlarms()
@@ -61,7 +61,7 @@ func CalcTask() {
 	})
 	//【led信息屏】播放节目同步
 	c.AddFunc("*/10 * * * * ?", func() {
-		//controller.InfoBoard.CronSyncLedPaying(0)
+		controller.InfoBoard.CronSyncLedPaying(0)
 	})
 	c.Start()
 }

+ 1 - 1
app/data/dao/environmentDao.go

@@ -20,7 +20,7 @@ type EnvironmentData struct {
 	Air           float32   `gorm:"type:float(10, 2)" json:"air"`          //空气质量指数
 	AirName       string    `gorm:"varchar(100)" json:"airName"`           //空气质量指数
 	IsDay         int       `gorm:"type:int" json:"isDay"`                 //是否用于天数据 7点的采集数据用于天数据,0否 1是
-	TenantId      int       `gorm:"type:int" json:"tenantId"`
+	TenantId      string    `gorm:"type:varchar(12)" json:"tenantId"`
 	PostTime      time.Time `gorm:"type:datetime" json:"postTime"`      //采集时间
 	CreateTime    time.Time `gorm:"type:datetime" json:"createTime"`    //新增时间
 	CreateDate    string    `gorm:"type:varchar(50)" json:"createDate"` //显示时间

+ 3 - 3
app/device/controller/infoBoardController.go

@@ -149,7 +149,7 @@ func (c *infoBoardCtl) EdgeCmd(ctx *gin.Context) {
 	if req.Directive == 4 {
 		c.CronSyncLedPaying(req.Id)
 	}
-	service.InfoBoardService.EdgeCmd(strconv.Itoa(claims.TenantId), req.InfoSn, req.Directive, req.Id)
+	service.InfoBoardService.EdgeCmd(claims.TenantId, req.InfoSn, req.Directive, req.Id)
 	ctx.JSON(http.StatusOK, common.SuccessResponse(common.Succeeded, nil))
 }
 
@@ -166,7 +166,7 @@ func (s *infoBoardCtl) CronSyncBrightnessAndMusicvolume() {
 		_, retState := cache.GetDeviceState(led.Sn)
 		//fmt.Printf("retState = %v \n", retState)
 		if retState == "1" {
-			service.InfoBoardService.EdgeCmd(strconv.Itoa(led.TenantId), led.Sn, 101, led.ID)
+			service.InfoBoardService.EdgeCmd(led.TenantId, led.Sn, 101, led.ID)
 		}
 	}
 }
@@ -191,7 +191,7 @@ func (s *infoBoardCtl) CronSyncLedPaying(id int) {
 			fmt.Printf("led信息屏设备Sn = %v 当前正在播放[%v]", led.Sn, playing)
 			playJson := service2.PublishLibrariesService.LedPaying(led.ID, playing)
 			if playJson != "" {
-				service.InfoBoardService.EdgePushLedProgram(strconv.Itoa(led.TenantId), led.Sn, playJson)
+				service.InfoBoardService.EdgePushLedProgram(led.TenantId, led.Sn, playJson)
 				fmt.Printf("需要更新\n")
 			} else {
 				fmt.Printf("无需更新\n")

+ 1 - 1
app/device/dao/LightStrategyDao.go

@@ -14,7 +14,7 @@ type LightStrategy struct {
 	EndTime            string    `gorm:"type:varchar(60)" json:"endTime"`              //策略期限结束时间
 	IsAllYear          int       `gorm:"type:int;default 1" json:"isAllYear"`          //全年设置2=是,1=否
 	IsAutomaticRenewal int       `gorm:"type:int;default 1" json:"isAutomaticRenewal"` //自动续期设置 2=是,1=否
-	TenantId           int       `gorm:"type:int" json:"tenantId"`                     //租户ID
+	TenantId           string    `gorm:"type:varchar(12)" json:"tenantId"`             //租户ID
 	CreateTime         time.Time `gorm:"type:datetime" json:"createTime"`              //新增时间
 	CreateUser         int64     `gorm:"type:bigint" json:"createUser"`                //新增记录操作用户ID
 	UpdateTime         time.Time `gorm:"type:datetime" json:"updateTime"`              //修改时间

+ 1 - 1
app/device/dao/alarmDao.go

@@ -21,7 +21,7 @@ type Alarm struct {
 	Numeration  int        `gorm:"type:int" json:"numeration"`        //编号
 	IPAddress   string     `gorm:"type:varchar(50)" json:"ipAddress"` //IP地址
 	InstallTime *time.Time `gorm:"type:date" json:"installTime"`      //安装时间
-	TenantId    int        `gorm:"type:int" json:"tenantId"`          //租户id
+	TenantId    string     `gorm:"type:varchar(12)" json:"tenantId"`  //租户id
 	CreateTime  time.Time  `gorm:"type:datetime" json:"createTime"`   //新增时间
 	CreateUser  int64      `gorm:"type:bigint" json:"createUser"`     //新增记录操作用户ID
 	UpdateTime  time.Time  `gorm:"type:datetime" json:"updateTime"`   //修改时间

+ 1 - 1
app/device/dao/alarmTerminalDao.go

@@ -23,7 +23,7 @@ type AlarmTerminal struct {
 	ServeId          int       `gorm:"type:int" json:"serveId"`                   //所属服务ID
 	IPAddress        string    `gorm:"type:varchar(50)" json:"ipAddress"`         //IP地址
 	InstallTime      time.Time `gorm:"type:date" json:"installTime"`              //安装时间
-	TenantId         int       `gorm:"type:int" json:"tenantId"`                  //租户id
+	TenantId         string    `gorm:"type:varchar(12)" json:"tenantId"`          //租户id
 	CreateTime       time.Time `gorm:"type:datetime" json:"createTime"`           //新增时间
 	CreateUser       int64     `gorm:"type:bigint" json:"createUser"`             //新增记录操作用户ID
 	UpdateTime       time.Time `gorm:"type:datetime" json:"updateTime"`           //修改时间

+ 1 - 1
app/device/dao/bridgeDao.go

@@ -29,7 +29,7 @@ type Bridge struct {
 	DesignSpeed       int       `gorm:"type:int" json:"designSpeed"`                //设计时速
 	BriefIntroduction string    `gorm:"type:varchar(255)" json:"briefIntroduction"` //简介
 	Photo             string    `gorm:"type:varchar(255)" json:"photo"`             //照片
-	TenantId          int       `gorm:"type:int" json:"tenantId"`                   //租户id
+	TenantId          string    `gorm:"type:varchar(12)" json:"tenantId"`           //租户id
 	CreateTime        time.Time `gorm:"type:datetime" json:"createTime"`            //新增时间
 	CreateUser        int64     `gorm:"type:bigint" json:"createUser"`              //新增记录操作用户ID
 	UpdateTime        time.Time `gorm:"type:datetime" json:"updateTime"`            //修改时间

+ 1 - 1
app/device/dao/bridgeSensorDao.go

@@ -19,7 +19,7 @@ type BridgeSensor struct {
 	InstallPosition  string     `gorm:"type:varchar(100)" json:"installPosition"` //安装位置
 	InstallTime      *time.Time `gorm:"type:date" json:"installTime"`             //安装时间
 	IPAddress        string     `gorm:"type:varchar(64)" json:"ipAddress"`        //IP地址-备用
-	TenantID         int        `gorm:"type:int" json:"tenantID"`                 //租户id
+	TenantID         string     `gorm:"type:varchar(12)" json:"tenantID"`         //租户id
 	CreateTime       time.Time  `gorm:"type:datetime" json:"createTime"`          //新增时间
 	CreateUser       int64      `gorm:"type:bigint" json:"createUser"`            //新增记录操作用户ID
 	UpdateTime       time.Time  `gorm:"type:datetime" json:"updateTime"`          //修改时间

+ 1 - 1
app/device/dao/cameraDao.go

@@ -25,7 +25,7 @@ type CameraDevice struct {
 	MonitorAddress   string      `gorm:"type:varchar(255)" json:"monitorAddress"`        //监控地址 ip:端口
 	IPAddress        string      `gorm:"type:varchar(40)" json:"ipAddress"`              //IP地址
 	InstallTime      common.Time `gorm:"type:date" json:"installTime"`                   //安装时间
-	TenantId         int         `gorm:"type:int" json:"tenantId"`                       //租户ID
+	TenantId         string      `gorm:"type:varchar(12)" json:"tenantId"`               //租户ID
 	CreateTime       time.Time   `gorm:"type:datetime" json:"createTime"`                //新增时间
 	CreateUser       int64       `gorm:"type:bigint" json:"createUser"`                  //新增记录操作用户ID
 	UpdateTime       time.Time   `gorm:"type:datetime" json:"updateTime"`                //修改时间

+ 1 - 1
app/device/dao/captureUnitDao.go

@@ -29,7 +29,7 @@ type CaptureUnit struct {
 	GatewayId              int       `gorm:"type:int" json:"gatewayId"`                            //网关ID
 	GatewayName            string    `gorm:"type:varchar(80)" json:"gatewayName"`                  //网关名称
 	GatewaySn              string    `gorm:"type:varchar(30)" json:"gatewaySn"`                    //网关编码
-	TenantId               int       `gorm:"type:int" json:"tenantId"`                             //租户ID
+	TenantId               string    `gorm:"type:varchar(12)" json:"tenantId"`                     //租户ID
 	CreateTime             time.Time `gorm:"type:datetime" json:"createTime"`                      //新增时间
 	CreateUser             int64     `gorm:"type:bigint" json:"createUser"`                        //新增记录操作用户ID
 	UpdateTime             time.Time `gorm:"type:datetime" json:"updateTime"`                      //修改时间

+ 1 - 1
app/device/dao/checkPointDao.go

@@ -10,7 +10,7 @@ type CheckPoint struct {
 	PointName     string    `gorm:"type:varchar(64)" json:"pointName"`      //卡口名称
 	PointSN       string    `gorm:"type:varchar(60)" json:"pointSn"`        //卡口编码
 	PointLocation string    `gorm:"type:varchar(150)" json:"pointLocation"` //卡口位置
-	TenantId      int       `gorm:"type:int" json:"tenantId"`               //租户ID
+	TenantId      string    `gorm:"type:varchar(12)" json:"tenantId"`       //租户ID
 	CreateTime    time.Time `gorm:"type:datetime" json:"createTime"`        //新增时间
 	CreateUser    int64     `gorm:"type:bigint" json:"createUser"`          //新增记录操作用户ID
 	UpdateTime    time.Time `gorm:"type:datetime" json:"updateTime"`        //修改时间

+ 1 - 1
app/device/dao/garbageDao.go

@@ -31,7 +31,7 @@ type Garbage struct {
 	InstallLocation string    `gorm:"type:varchar(100)" json:"installLocation"` //安装位置
 	PhotoUrl        string    `gorm:"type:varchar(255)" json:"photoUrl"`        //供电箱照片地址
 	Remark          string    `gorm:"type:varchar(1000)" json:"remark"`         //备注
-	TenantId        int       `gorm:"type:int" json:"tenantId"`                 //租户id
+	TenantId        string    `gorm:"type:varchar(12)" json:"tenantId"`         //租户id
 	CreateTime      time.Time `gorm:"type:datetime" json:"createTime"`          //新增时间
 	CreateUser      int64     `gorm:"type:bigint" json:"createUser"`            //新增记录操作用户ID
 	UpdateTime      time.Time `gorm:"type:datetime" json:"updateTime"`          //修改时间

+ 1 - 1
app/device/dao/garbageWayGroupDao.go

@@ -9,7 +9,7 @@ import (
 type GarbageWayGroup struct {
 	ID         int       `gorm:"primary_key" json:"id"`               //编号
 	GroupName  string    `gorm:"type:varchar(64)" json:"groupName"`   //分组名称
-	TenantId   int       `gorm:"type:int" json:"tenantId"`            //租户id
+	TenantId   string    `gorm:"type:varchar(12)" json:"tenantId"`    //租户id
 	CreateTime time.Time `gorm:"type:datetime" json:"createTime"`     //新增时间
 	CreateUser int64     `gorm:"type:bigint" json:"createUser"`       //新增记录操作用户ID
 	UpdateTime time.Time `gorm:"type:datetime" json:"updateTime"`     //修改时间

+ 1 - 1
app/device/dao/gatewayDao.go

@@ -26,7 +26,7 @@ type Gateway struct {
 	DoNum              int         `gorm:"type:int;default 0" json:"doNum"`                 //DO口数量
 	Num485             int         `gorm:"type:int;default 0" json:"num485"`                //485口数量
 	NetworkNum         int         `gorm:"type:int;default 0" json:"networkNum"`            //网口数量
-	TenantId           int         `gorm:"type:int" json:"tenantId"`                        //租户ID
+	TenantId           string      `gorm:"type:varchar(12)" json:"tenantId"`                //租户ID
 	CreateTime         time.Time   `gorm:"type:datetime" json:"createTime"`                 //新增时间
 	CreateUser         int64       `gorm:"type:bigint" json:"createUser"`                   //新增记录操作用户ID
 	UpdateTime         time.Time   `gorm:"type:datetime" json:"updateTime"`                 //修改时间

+ 1 - 1
app/device/dao/gatewayRelationDao.go

@@ -18,7 +18,7 @@ type GatewayRelation struct {
 	IpBroadcastCount   int       `gorm:"type:int;default 0"` //IP音柱数量
 	CurveSensorCount   int       `gorm:"type:int;default 0" comment:"信息屏"`
 	Total              int       `gorm:"type:int;default 0"`                  //总数
-	TenantId           int       `gorm:"type:int" json:"tenantId"`            //租户ID
+	TenantId           string    `gorm:"type:varchar(12)" json:"tenantId"`    //租户ID
 	CreateTime         time.Time `gorm:"type:datetime" json:"createTime"`     //新增时间
 	UpdateTime         time.Time `gorm:"type:datetime" json:"updateTime"`     //修改时间
 	IsDeleted          int       `gorm:"type:int;default 0" json:"isDeleted"` //是否删除 0=未删除,1=删

+ 1 - 1
app/device/dao/infoBoardDao.go

@@ -30,7 +30,7 @@ type InfoBoard struct {
 	BootEndTime      string      `gorm:"type:varchar(64)" json:"bootEndTime"`              //开机结束时间
 	NeverCloseDown   int         `gorm:"type:int" json:"neverCloseDown"`                   //永不关机:1-选择,2-取消
 	InstallTime      common.Time `gorm:"type:date" json:"installTime"`                     //安装时间
-	TenantId         int         `gorm:"type:int" json:"tenantId"`                         //租户ID
+	TenantId         string      `gorm:"type:varchar(12)" json:"tenantId"`                 //租户ID
 	CreateTime       time.Time   `gorm:"type:datetime" json:"createTime"`                  //新增时间
 	CreateUser       int64       `gorm:"type:bigint" json:"createUser"`                    //新增记录操作用户ID
 	UpdateTime       time.Time   `gorm:"type:datetime" json:"updateTime"`                  //修改时间

+ 1 - 1
app/device/dao/intelligentLightingDao.go

@@ -57,7 +57,7 @@ type IntelligentLight struct {
 	LightID      int       `gorm:"type:int" json:"lightID"`             //照明策略id
 	RelationType int       `gorm:"type:int" json:"relationType"`        //关联类型1=灯控,2=灯杆分组
 	Rid          int       `gorm:"type:int" json:"rid"`                 //关联外键ID 根据type类型关联至其表
-	TenantId     int       `gorm:"type:int" json:"tenantId"`            //租户ID
+	TenantId     string    `gorm:"type:varchar(12)" json:"tenantId"`    //租户ID
 	CreateTime   time.Time `gorm:"type:datetime" json:"createTime"`     //新增时间
 	CreateUser   int64     `gorm:"type:bigint" json:"createUser"`       //新增记录操作用户ID
 	UpdateTime   time.Time `gorm:"type:datetime" json:"updateTime"`     //修改时间

+ 1 - 1
app/device/dao/ipBroadcastDao.go

@@ -23,7 +23,7 @@ type IpBroadcast struct {
 	ServerPort       int         `gorm:"type:int" json:"serverPort"`                       //服务端口
 	SoundVolume      int         `gorm:"type:int" json:"soundVolume"`                      //音量0-100换算
 	InstallTime      common.Time `gorm:"type:date" json:"installTime"`                     //安装时间
-	TenantId         int         `gorm:"type:int" json:"tenantId"`                         //租户ID
+	TenantId         string      `gorm:"type:varchar(12)" json:"tenantId"`                 //租户ID
 	CreateTime       time.Time   `gorm:"type:datetime" json:"createTime"`                  //新增时间
 	CreateUser       int64       `gorm:"type:bigint" json:"createUser"`                    //新增记录操作用户ID
 	UpdateTime       time.Time   `gorm:"type:datetime" json:"updateTime"`                  //修改时间

+ 1 - 1
app/device/dao/lampPoleDao.go

@@ -27,7 +27,7 @@ type LampPole struct {
 	IsCross         int         `gorm:"type:int" json:"isCross"`                  //是否为路口-0-是1-不是
 	InstallTime     common.Time `gorm:"type:date" json:"installTime"`             //安装时间
 	LampPolePhoto   string      `gorm:"type:varchar(255)" json:"lampPolePhoto"`   //灯杆照片
-	TenantId        int         `gorm:"type:int" json:"tenantId"`                 //租户ID
+	TenantId        string      `gorm:"type:varchar(12)" json:"tenantId"`         //租户ID
 	CreateTime      time.Time   `gorm:"type:datetime" json:"createTime"`          //新增时间
 	CreateUser      int64       `gorm:"type:bigint" json:"createUser"`            //新增记录操作用户ID
 	UpdateTime      time.Time   `gorm:"type:datetime" json:"updateTime"`          //修改时间

+ 1 - 1
app/device/dao/lampPoleGroupDao.go

@@ -10,7 +10,7 @@ import (
 type LampPoleGroup struct {
 	ID            int         `gorm:"primary_key" json:"id"`                             //编号
 	PoleGroupName string      `gorm:"type:varchar(64)" json:"poleGroupName"`             //分组名称
-	TenantId      int         `gorm:"type:int" json:"tenantId"`                          //租户ID
+	TenantId      string      `gorm:"type:varchar(12)" json:"tenantId"`                  //租户ID
 	CreateTime    common.Time `gorm:"type:datetime;not null'" json:"createTime"`         //新增时间
 	CreateUser    int64       `gorm:"type:bigint" json:"createUser"`                     //新增记录操作用户ID
 	UpdateTime    common.Time `gorm:"type:datetime" json:"updateTime"`                   //修改时间

+ 1 - 1
app/device/dao/lightControlDao.go

@@ -25,7 +25,7 @@ type LightControl struct {
 	BrandId          int         `gorm:"type:int" json:"brandId"`                   //设备品牌
 	ModelId          int         `gorm:"type:int" json:"modelId"`                   //设备型号
 	InstallTime      common.Time `gorm:"type:date" json:"installTime"`              //安装时间
-	TenantId         int         `gorm:"type:int" json:"tenantId"`                  //租户ID
+	TenantId         string      `gorm:"type:varchar(12)" json:"tenantId"`          //租户ID
 	CreateTime       time.Time   `gorm:"type:datetime" json:"createTime"`           //新增时间
 	CreateUser       int64       `gorm:"type:bigint" json:"createUser"`             //新增记录操作用户ID
 	UpdateTime       time.Time   `gorm:"type:datetime" json:"updateTime"`           //修改时间

+ 1 - 1
app/device/dao/manholeCoverDao.go

@@ -27,7 +27,7 @@ type ManholeCover struct {
 	Longitude           float64    `gorm:"type:double(17, 14)  " json:"longitude"`   //经度
 	PhotoUrl            string     `gorm:"type:varchar(255) " json:"photoUrl"`       //照片地址
 	Remark              string     `gorm:"type:varchar(1000)  " json:"remark"`       //备注
-	TenantId            int        `gorm:"type:int" json:"tenantId"`                 //租户ID
+	TenantId            string     `gorm:"type:varchar(12)" json:"tenantId"`         //租户ID
 	CreateTime          time.Time  `gorm:"type:datetime" json:"createTime"`          //新增时间
 	CreateUser          int64      `gorm:"type:bigint" json:"createUser"`            //新增记录操作用户ID
 	UpdateTime          time.Time  `gorm:"type:datetime" json:"updateTime"`          //修改时间

+ 1 - 1
app/device/dao/onDemandGroupDao.go

@@ -14,7 +14,7 @@ type OnDemandGroup struct {
 	LightingNum       int       `gorm:"type:int" json:"lightingNum"`           //亮灯数量
 	BeforeLightingNum int       `gorm:"type:int" json:"beforeLightingNum"`     //提前亮灯数
 	OutTimes          int       `gorm:"type:int" json:"outTimes"`              //延迟时间
-	TenantId          int       `gorm:"type:int" json:"tenantId"`              //租户ID
+	TenantId          string    `gorm:"type:varchar(12)" json:"tenantId"`      //租户ID
 	CreateTime        time.Time `gorm:"type:datetime" json:"createTime"`       //新增时间
 	CreateUser        int64     `gorm:"type:bigint" json:"createUser"`         //新增记录操作用户ID
 	UpdateTime        time.Time `gorm:"type:datetime" json:"updateTime"`       //修改时间

+ 1 - 1
app/device/dao/onDemandSensorDao.go

@@ -15,7 +15,7 @@ type OnDemandSensor struct {
 	LampPoleID  int       `gorm:"type:int" json:"lampPoleId"`           //所属灯杆
 	SensorPhoto string    `gorm:"type:varchar(255)" json:"sensorPhoto"` //传感器照片
 	InstallTime time.Time `gorm:"type:date" json:"installTime"`         //安装时间
-	TenantId    int       `gorm:"type:int" json:"tenantId"`             //租户ID
+	TenantId    string    `gorm:"type:varchar(12)" json:"tenantId"`     //租户ID
 	CreateTime  time.Time `gorm:"type:datetime" json:"createTime"`      //新增时间
 	CreateUser  int64     `gorm:"type:bigint" json:"createUser"`        //新增记录操作用户ID
 	UpdateTime  time.Time `gorm:"type:datetime" json:"updateTime"`      //修改时间

+ 2 - 2
app/device/dao/optoSensoDao.go

@@ -23,7 +23,7 @@ type OptoSensor struct {
 	InstallTime      common.Time `gorm:"type:date" json:"installTime"`              //安装时间
 	IPAddress        string      `gorm:"type:varchar(64)" json:"ipAddress"`         //IP地址-备用
 	IsDefault        int         `gorm:"type:int;default 0" json:"isDefault"`       //是否设为首页默认展示 0=不展示,1=设置展示
-	TenantId         int         `gorm:"type:int" json:"tenantId"`                  //租户ID
+	TenantId         string      `gorm:"type:varchar(12)" json:"tenantId"`          //租户ID
 	CreateTime       time.Time   `gorm:"type:datetime" json:"createTime"`           //新增时间
 	CreateUser       int64       `gorm:"type:bigint" json:"createUser"`             //新增记录操作用户ID
 	UpdateTime       time.Time   `gorm:"type:datetime" json:"updateTime"`           //修改时间
@@ -123,7 +123,7 @@ func (c OptoSensor) GetAll() []*OptoSensor {
 func (c OptoSensor) getList(optoSensor OptoSensor) []OptoSensorVO {
 	var optoSensorVO []OptoSensorVO
 	tenantId := optoSensor.TenantId
-	if tenantId == 0 {
+	if tenantId == "" {
 		tenantId = c.TenantId
 	}
 	optoSensor.TenantId = tenantId

+ 1 - 1
app/device/dao/switchBoxDao.go

@@ -24,7 +24,7 @@ type SwitchBox struct {
 	PoleLat        float64     `gorm:"type:double(17, 14)  " json:"poleLat"`              //纬度
 	MonitorAddress string      `gorm:"type:varchar(255)   " json:"monitorAddress"`        //监控地址
 	InstallTime    common.Time `gorm:"type:date" json:"installTime"`                      //安装时间
-	TenantId       int         `gorm:"type:int" json:"tenantId"`                          //租户id
+	TenantId       string      `gorm:"type:varchar(12)" json:"tenantId"`                  //租户id
 	CreateTime     time.Time   `gorm:"type:datetime" json:"createTime"`                   //新增时间
 	CreateUser     int64       `gorm:"type:bigint" json:"createUser"`                     //新增记录操作用户ID
 	UpdateTime     time.Time   `gorm:"type:datetime" json:"updateTime"`                   //修改时间

+ 2 - 2
app/device/dao/tenantCodeDao.go

@@ -2,7 +2,7 @@ package dao
 
 type TenantCode struct {
 	ID       int     `gorm:"primary_key" json:"id" COMMENT "编号"`
-	TenantID int     `gorm:"varchar(12)"  json:"tenantId" COMMENT "租户ID"`
+	TenantId string  `gorm:"varchar(12)"  json:"tenantId" COMMENT "租户ID"`
 	CityCode string  `gorm:"varchar(6)" json:"cityCode"  COMMENT "城市行政编码"`
 	CityName string  `gorm:"varchar(255)" json:"cityName"  COMMENT "城市名称"`
 	CityLng  float64 `gorm:"double(18,14)" json:"cityLng"  COMMENT "经度"`
@@ -16,6 +16,6 @@ func (TenantCode) TableName() string {
 //根据租户得到位置记录
 func (c *TenantCode) GetTenantCode() (TenantCode, error) {
 	var tenantCode TenantCode
-	err := Db.Debug().Model(&c).Where(" tenant_id = ?", c.TenantID).Find(&tenantCode).Error
+	err := Db.Debug().Model(&c).Where(" tenant_id = ?", c.TenantId).Find(&tenantCode).Error
 	return tenantCode, err
 }

+ 1 - 1
app/device/dao/transformerDao.go

@@ -19,7 +19,7 @@ type Transformer struct {
 	PoleLat         float64    `gorm:"type:double(17, 14)  " json:"poleLat"`              //纬度
 	TransPhotoUrl   string     `gorm:"type:varchar(255)" json:"transPhotoUrl"`            //变压器照片地址
 	InstallTime     *time.Time `gorm:"type:date" json:"installTime"`                      //安装时间
-	TenantId        int        `gorm:"type:int" json:"tenantId"`                          //租户id
+	TenantId        string     `gorm:"type:varchar(12)" json:"tenantId"`                  //租户id
 	CreateTime      time.Time  `gorm:"type:datetime" json:"createTime"`                   //新增时间
 	CreateUser      int64      `gorm:"type:bigint" json:"createUser"`                     //新增记录操作用户ID
 	UpdateTime      time.Time  `gorm:"type:datetime" json:"updateTime"`                   //修改时间

+ 1 - 1
app/device/dao/venderDao.go

@@ -11,7 +11,7 @@ type DeviceVendor struct {
 	VendorValue string    `gorm:"type:varchar(200)" json:"vendorValue"` //值
 	ParentId    int       `gorm:"type:int" json:"parentId"`             //父id,厂家为-1
 	DeviceType  int       `gorm:"type:int" json:"deviceType"`           //设备类型
-	TenantId    int       `gorm:"type:int" json:"tenantId"`             //租户id
+	TenantId    string    `gorm:"type:varchar(12)" json:"tenantId"`     //租户id
 	CreateTime  time.Time `gorm:"type:datetime" json:"createTime"`      //新增时间
 	CreateUser  int64     `gorm:"type:bigint" json:"createUser"`        //新增记录操作用户ID
 	UpdateTime  time.Time `gorm:"type:datetime" json:"updateTime"`      //修改时间

+ 5 - 5
app/device/dao/workbenchDao.go

@@ -9,7 +9,7 @@ type CountDevice struct {
 	DeviceType string `json:"deviceType"`
 }
 
-func GetDeviceCount(tenantId int) ([]CountDevice, error) {
+func GetDeviceCount(tenantId string) ([]CountDevice, error) {
 	var result []CountDevice
 	var count CountDevice
 	Db.Debug().Model(&LampPole{}).Select(" count(*) count_num, 'lamppole' device_type ").
@@ -54,7 +54,7 @@ type CountAlarm struct {
 	Backlog        int `json:"backlog"`
 }
 
-func GetAlarmCount(tenantId int) (*CountAlarm, error) {
+func GetAlarmCount(tenantId string) (*CountAlarm, error) {
 	var alarm CountAlarm
 	return &alarm, nil
 }
@@ -65,7 +65,7 @@ type CountJobTodo struct {
 	LastYearJob  int `json:"lastYearJob"`
 }
 
-func GetCountJobTodo(tenantId int) (*CountJobTodo, error) {
+func GetCountJobTodo(tenantId string) (*CountJobTodo, error) {
 	var todos CountJobTodo
 	return &todos, nil
 }
@@ -75,7 +75,7 @@ type Notification struct {
 	Title    string `json:"title"`
 }
 
-func GetNotification(tenantId int) (*Notification, error) {
+func GetNotification(tenantId string) (*Notification, error) {
 	var notification Notification
 	return &notification, nil
 }
@@ -110,7 +110,7 @@ type OptoSensorVO struct {
 
 }
 
-func GetAqi(tenantId int) (*OptoSensorVO, error) {
+func GetAqi(tenantId string) (*OptoSensorVO, error) {
 	var sensorVO OptoSensorVO
 	var optoSensor OptoSensor
 	optoSensor.TenantId = tenantId

+ 1 - 1
app/device/dao/zigbeeDao.go

@@ -26,7 +26,7 @@ type Zigbee struct {
 	ChannelNum       int         `gorm:"type:int" json:"chanelNum"`                 //通道号
 	NetworkNum       int         `gorm:"type:int" json:"networkNum"`                //网络号
 	InstallTime      common.Time `gorm:"type:date" json:"installTime"`              //安装时间
-	TenantId         int         `gorm:"type:int" json:"tenantId"`                  //租户id
+	TenantId         string      `gorm:"type:varchar(12)" json:"tenantId"`          //租户id
 	CreateTime       time.Time   `gorm:"type:datetime" json:"createTime"`           //新增时间
 	CreateUser       int64       `gorm:"type:bigint" json:"createUser"`             //新增记录操作用户ID
 	UpdateTime       time.Time   `gorm:"type:datetime" json:"updateTime"`           //修改时间

+ 2 - 2
app/device/service/LightStrategyService.go

@@ -39,7 +39,7 @@ func (s *lightStrategyService) Get(id int) (*model.LightStrategyDetail, *common.
 	return lightStrategy, nil
 }
 
-func (s *lightStrategyService) CreateOrUpdate(userId int64, tenantId int, req *model.LightStrategyDetail) *common.Errors {
+func (s *lightStrategyService) CreateOrUpdate(userId int64, tenantId string, req *model.LightStrategyDetail) *common.Errors {
 	// 创建查询实例
 	strategy := req
 	logger.Logger.Errorf("CreateOrUpdate strategy = %+v \n", strategy)
@@ -235,7 +235,7 @@ func (s *lightStrategyService) List(searchValue string, current, size int) ([]mo
 	return details, total, nil
 }
 
-func (s *lightStrategyService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *lightStrategyService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	strategy := &dao.LightStrategy{
 		ID:         id,

+ 4 - 4
app/device/service/alarmService.go

@@ -29,7 +29,7 @@ func (s *alarmService) Get(id int) (*dao.Alarm, *common.Errors) {
 	return device, nil
 }
 
-func (s *alarmService) CreateOrUpdate(userId int64, tenantId int, req dao.Alarm) *common.Errors {
+func (s *alarmService) CreateOrUpdate(userId int64, tenantId string, req dao.Alarm) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -82,7 +82,7 @@ func (s *alarmService) List(poleGroupName string, current, size int) ([]dao.Alar
 	return devices, total, nil
 }
 
-func (s *alarmService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *alarmService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.Alarm{
 		ID:         id,
@@ -99,7 +99,7 @@ func (s *alarmService) Remove(userId int64, tenantId int, id int) *common.Errors
 	return nil
 }
 
-func (s *alarmService) GetList(tenantId int) ([]*dao.Alarm, *common.Errors) {
+func (s *alarmService) GetList(tenantId string, ) ([]*dao.Alarm, *common.Errors) {
 	var devices []*dao.Alarm
 	err := cache.Redis.Get(getAlarmListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -117,6 +117,6 @@ func (s *alarmService) GetList(tenantId int) ([]*dao.Alarm, *common.Errors) {
 	return devices, nil
 }
 
-func getAlarmListRedisKey(tenantId int) string {
+func getAlarmListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.AlarmList, tenantId)
 }

+ 2 - 2
app/device/service/alarmTerminalService.go

@@ -33,7 +33,7 @@ func (s *alarmTerminalService) Get(id int) (*model.AlarmTerminalDetail, *common.
 	}, nil
 }
 
-func (s *alarmTerminalService) CreateOrUpdate(userId int64, tenantId int, req dao.AlarmTerminal) *common.Errors {
+func (s *alarmTerminalService) CreateOrUpdate(userId int64, tenantId string, req dao.AlarmTerminal) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -93,7 +93,7 @@ func (s *alarmTerminalService) List(poleGroupName string, current, size int) ([]
 	return details, total, nil
 }
 
-func (s *alarmTerminalService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *alarmTerminalService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.AlarmTerminal{
 		ID:         id,

+ 3 - 3
app/device/service/bridgeSensorService.go

@@ -26,7 +26,7 @@ func (s *bridgeSensorService) Get(id int) (*dao.BridgeSensor, *common.Errors) {
 	return device, nil
 }
 
-func (s *bridgeSensorService) CreateOrUpdate(userId int64, tenantId int, req dao.BridgeSensor) *common.Errors {
+func (s *bridgeSensorService) CreateOrUpdate(userId int64, tenantId string, req dao.BridgeSensor) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantID = tenantId
@@ -77,7 +77,7 @@ func (s *bridgeSensorService) List(searchValue string, current, size int) ([]dao
 	return devices, total, nil
 }
 
-func (s *bridgeSensorService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *bridgeSensorService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.BridgeSensor{
 		ID:         id,
@@ -94,7 +94,7 @@ func (s *bridgeSensorService) Remove(userId int64, tenantId int, id int) *common
 	return nil
 }
 
-func (s *bridgeSensorService) GetList(tenantId int) ([]*dao.BridgeSensor, *common.Errors) {
+func (s *bridgeSensorService) GetList(tenantId string, ) ([]*dao.BridgeSensor, *common.Errors) {
 	var devices []*dao.BridgeSensor
 	err := cache.Redis.Get(getTransformerListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {

+ 3 - 3
app/device/service/bridgeService.go

@@ -24,7 +24,7 @@ func (s *bridgeService) Get(id int) (*dao.Bridge, *common.Errors) {
 	return device, nil
 }
 
-func (s *bridgeService) CreateOrUpdate(userId int64, tenantId int, req dao.Bridge) *common.Errors {
+func (s *bridgeService) CreateOrUpdate(userId int64, tenantId string, req dao.Bridge) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -76,7 +76,7 @@ func (s *bridgeService) List(searchValue string, current, size int) ([]dao.Bridg
 	return devices, total, nil
 }
 
-func (s *bridgeService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *bridgeService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.Bridge{
 		ID:         id,
@@ -93,7 +93,7 @@ func (s *bridgeService) Remove(userId int64, tenantId int, id int) *common.Error
 	return nil
 }
 
-func (s *bridgeService) GetList(tenantId int) ([]*dao.Bridge, *common.Errors) {
+func (s *bridgeService) GetList(tenantId string, ) ([]*dao.Bridge, *common.Errors) {
 	// todo use redis cache
 	device := &dao.Bridge{
 		TenantId:  tenantId,

+ 3 - 3
app/device/service/cameraService.go

@@ -16,7 +16,7 @@ var CameraService = new(cameraService)
 
 type cameraService struct{}
 
-func (s *cameraService) CreateOrUpdate(userId int64, tenantId int, req *model.CameraDetail) *common.Errors {
+func (s *cameraService) CreateOrUpdate(userId int64, tenantId string, req *model.CameraDetail) *common.Errors {
 	device := req.CameraDevice
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -122,7 +122,7 @@ func (s *cameraService) List(searchValue, cameraType string, current, size int)
 	return details, total, nil
 }
 
-func (s *cameraService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *cameraService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.CameraDevice{
 		ID:         id,
@@ -140,7 +140,7 @@ func (s *cameraService) Remove(userId int64, tenantId int, id int) *common.Error
 	return nil
 }
 
-func (s *cameraService) GetList(tenantId int) ([]dao.CameraDevice, *common.Errors) {
+func (s *cameraService) GetList(tenantId string, ) ([]dao.CameraDevice, *common.Errors) {
 	device := &dao.CameraDevice{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 6 - 6
app/device/service/captureUintService.go

@@ -15,7 +15,7 @@ var CaptureUintService = new(captureUintService)
 
 type captureUintService struct{}
 
-func (s *captureUintService) CaptureSubmit(userId int64, tenantId int, req *model.CaptureDetail) *common.Errors {
+func (s *captureUintService) CaptureSubmit(userId int64, tenantId string, req *model.CaptureDetail) *common.Errors {
 	device := req.CaptureUnit
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -98,7 +98,7 @@ func (s *captureUintService) CaptureList(searchValue string, current, size int)
 	return details, total, nil
 }
 
-func (s *captureUintService) CaptureGetList(tenantId int) ([]*dao.CaptureUnit, *common.Errors) {
+func (s *captureUintService) CaptureGetList(tenantId string, ) ([]*dao.CaptureUnit, *common.Errors) {
 	device := &dao.CaptureUnit{
 		TenantId:  tenantId,
 		IsDeleted: 0,
@@ -126,7 +126,7 @@ func (s *captureUintService) GetPoint(id int) (*dao.CheckPoint, *common.Errors)
 	return device, nil
 }
 
-func (s *captureUintService) PointSubmit(userId int64, tenantId int, req *dao.CheckPoint) *common.Errors {
+func (s *captureUintService) PointSubmit(userId int64, tenantId string, req *dao.CheckPoint) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -175,7 +175,7 @@ func (s *captureUintService) PointList(searchValue string, current, size int) ([
 	return devices, total, nil
 }
 
-func (s *captureUintService) PointGetList(tenantId int) ([]*dao.CheckPoint, *common.Errors) {
+func (s *captureUintService) PointGetList(tenantId string, ) ([]*dao.CheckPoint, *common.Errors) {
 	device := &dao.CheckPoint{
 		TenantId:  tenantId,
 		IsDeleted: 0,
@@ -190,7 +190,7 @@ func (s *captureUintService) PointGetList(tenantId int) ([]*dao.CheckPoint, *com
 	return devices, nil
 }
 
-func (s *captureUintService) RemoveCapture(userId int64, tenantId int, id int) *common.Errors {
+func (s *captureUintService) RemoveCapture(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.CaptureUnit{
 		ID:         id,
@@ -207,7 +207,7 @@ func (s *captureUintService) RemoveCapture(userId int64, tenantId int, id int) *
 	return nil
 }
 
-func (s *captureUintService) RemovePoint(userId int64, tenantId int, id int) *common.Errors {
+func (s *captureUintService) RemovePoint(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.CheckPoint{
 		ID:         id,

+ 4 - 4
app/device/service/garbageService.go

@@ -28,7 +28,7 @@ func (s *garbageService) Get(id int) (*dao.Garbage, *common.Errors) {
 
 }
 
-func (s *garbageService) CreateOrUpdate(userId int64, tenantId int, req dao.Garbage) *common.Errors {
+func (s *garbageService) CreateOrUpdate(userId int64, tenantId string, req dao.Garbage) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.UpdateUser = userId
@@ -78,7 +78,7 @@ func (s *garbageService) List(searchValue string, current, size int) ([]dao.Garb
 	return devices, total, nil
 }
 
-func (s *garbageService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *garbageService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.Garbage{
 		ID:         id,
@@ -95,7 +95,7 @@ func (s *garbageService) Remove(userId int64, tenantId int, id int) *common.Erro
 	return nil
 }
 
-func (s *garbageService) GetList(tenantId int) ([]*dao.Garbage, *common.Errors) {
+func (s *garbageService) GetList(tenantId string, ) ([]*dao.Garbage, *common.Errors) {
 	var devices []*dao.Garbage
 	err := cache.Redis.Get(getGarbageListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -113,7 +113,7 @@ func (s *garbageService) GetList(tenantId int) ([]*dao.Garbage, *common.Errors)
 	return devices, nil
 }
 
-func getGarbageListRedisKey(tenantId int) string {
+func getGarbageListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.GarbageList, tenantId)
 }
 

+ 3 - 3
app/device/service/garbageWayGroupService.go

@@ -28,7 +28,7 @@ func (s *garbageWayGroupService) Get(id int) (*dao.GarbageWayGroup, *common.Erro
 
 }
 
-func (s *garbageWayGroupService) CreateOrUpdate(userId int64, tenantId int, req dao.GarbageWayGroup) *common.Errors {
+func (s *garbageWayGroupService) CreateOrUpdate(userId int64, tenantId string, req dao.GarbageWayGroup) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -78,7 +78,7 @@ func (s *garbageWayGroupService) List(searchValue string, current, size int) ([]
 	return devices, total, nil
 }
 
-func (s *garbageWayGroupService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *garbageWayGroupService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.GarbageWayGroup{
 		ID:         id,
@@ -95,7 +95,7 @@ func (s *garbageWayGroupService) Remove(userId int64, tenantId int, id int) *com
 	return nil
 }
 
-func (s *garbageWayGroupService) GetList(tenantId int) ([]*dao.GarbageWayGroup, *common.Errors) {
+func (s *garbageWayGroupService) GetList(tenantId string, ) ([]*dao.GarbageWayGroup, *common.Errors) {
 	var devices []*dao.GarbageWayGroup
 	err := cache.Redis.Get(getGarbageWayGroupListRedisKey("000000")).Scan(&devices)
 	if err == nil {

+ 4 - 4
app/device/service/gatewayService.go

@@ -42,7 +42,7 @@ func (s *gatewayService) Get(id int) (*model.GatewayDetail, *common.Errors) {
 	return detail, nil
 }
 
-func (s *gatewayService) CreateOrUpdate(userId int64, tenantId int, req *model.GatewayDetail) *common.Errors {
+func (s *gatewayService) CreateOrUpdate(userId int64, tenantId string, req *model.GatewayDetail) *common.Errors {
 	device := req.Gateway
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -126,7 +126,7 @@ func (s *gatewayService) List(searchValue string, current, size int) ([]model.Ga
 	return details, total, nil
 }
 
-func (s *gatewayService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *gatewayService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.Gateway{
 		ID:         id,
@@ -148,7 +148,7 @@ func (s *gatewayService) Remove(userId int64, tenantId int, id int) *common.Erro
 	return nil
 }
 
-func (s *gatewayService) GetList(tenantId int) ([]*dao.Gateway, *common.Errors) {
+func (s *gatewayService) GetList(tenantId string, ) ([]*dao.Gateway, *common.Errors) {
 	var devices []*dao.Gateway
 	err := cache.Redis.Get(getGatewayListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -171,7 +171,7 @@ func (s *gatewayService) GetList(tenantId int) ([]*dao.Gateway, *common.Errors)
 	return devices, nil
 }
 
-func getGatewayListRedisKey(tenantId int) string {
+func getGatewayListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.GatewayList, tenantId)
 }
 

+ 4 - 4
app/device/service/infoBoardService.go

@@ -32,7 +32,7 @@ func (s *infoBoardService) Get(id int) (*model.InfoBoardDetail, *common.Errors)
 	return &detail, nil
 }
 
-func (s *infoBoardService) CreateOrUpdate(userId int64, tenantId int, req dao.InfoBoard) *common.Errors {
+func (s *infoBoardService) CreateOrUpdate(userId int64, tenantId string, req dao.InfoBoard) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -147,7 +147,7 @@ func (s *infoBoardService) rewriteBoardDetail(d dao.InfoBoard) model.InfoBoardDe
 	return detail
 }
 
-func (s *infoBoardService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *infoBoardService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.InfoBoard{
 		ID:         id,
@@ -178,7 +178,7 @@ func (s *infoBoardService) GetByLampPole(lampPoleId int) []dao.InfoBoard {
 	return device.GetDevicesByLampPole()
 }
 
-func (s *infoBoardService) GetByResolution(tenantId, resolution int) []dao.InfoBoard {
+func (s *infoBoardService) GetByResolution(tenantId string, resolution int) []dao.InfoBoard {
 	device := &dao.InfoBoard{
 		Resolution: resolution,
 		TenantId:   tenantId,
@@ -186,7 +186,7 @@ func (s *infoBoardService) GetByResolution(tenantId, resolution int) []dao.InfoB
 	return device.GetDevicesByResolution()
 }
 
-func (s *infoBoardService) GetByIds(tenantId int, ids string) []dao.InfoBoard {
+func (s *infoBoardService) GetByIds(tenantId string, ids string) []dao.InfoBoard {
 	device := &dao.InfoBoard{
 		TenantId: tenantId,
 	}

+ 7 - 7
app/device/service/intelligentLightingService.go

@@ -16,7 +16,7 @@ var IntelligentLightingService = new(intelligentLightingService)
 
 type intelligentLightingService struct{}
 
-func (s *intelligentLightingService) GetDetailByLight(tenantId, id int, reqType int) (model.RspIntelligentLightDetail,
+func (s *intelligentLightingService) GetDetailByLight(tenantId string, id int, reqType int) (model.RspIntelligentLightDetail,
 	*common.Errors) {
 	detail := model.RspIntelligentLightDetail{}
 	if reqType == 2 {
@@ -48,7 +48,7 @@ func (s *intelligentLightingService) GetDetailByLight(tenantId, id int, reqType
 	return detail, nil
 }
 
-func (s *intelligentLightingService) GetLightRelation(tenantId, rId, relationType int) model.IntelligentLightSimple {
+func (s *intelligentLightingService) GetLightRelation(tenantId string, rId, relationType int) model.IntelligentLightSimple {
 	detail := model.IntelligentLightSimple{}
 
 	// 获取照明策略关联
@@ -109,7 +109,7 @@ func (s *intelligentLightingService) BatchGet(ids []int) []dao.IntelligentLight
 	return intelligentLights
 }
 
-func (s *intelligentLightingService) List(tenantId int, searchValue string, current, size,
+func (s *intelligentLightingService) List(tenantId string, searchValue string, current, size,
 	groupId int) ([]dao.LightrelationVo, int64, error) {
 	var result []dao.LightrelationVo
 	//获取策略关联信息
@@ -158,7 +158,7 @@ func (s *intelligentLightingService) List(tenantId int, searchValue string, curr
 }
 
 // Relation 保存策略
-func (s *intelligentLightingService) Relation(userId int64, tenantId int, publicId int, lightId int, relationType int) error {
+func (s *intelligentLightingService) Relation(userId int64, tenantId string, publicId int, lightId int, relationType int) error {
 	intelligent := &dao.IntelligentLight{
 		LightID:      lightId,
 		Rid:          publicId,
@@ -183,7 +183,7 @@ func (s *intelligentLightingService) Relation(userId int64, tenantId int, public
 }
 
 // Recovery 恢复到分组
-func (s *intelligentLightingService) Recovery(userId int64, tenantId int, groupId int, id int) error {
+func (s *intelligentLightingService) Recovery(userId int64, tenantId string, groupId int, id int) error {
 	//1.IntelligentLight查出 `relation_type` = '2' AND `rid` = '67'  查出组中的 light_id
 	//2.IntelligentLight保存 上面 的light_id 到 id中
 	intelligent := &dao.IntelligentLight{
@@ -208,7 +208,7 @@ func (s *intelligentLightingService) Recovery(userId int64, tenantId int, groupI
 }
 
 // ChangeHandSwitch 开灯控制
-func (s *intelligentLightingService) ChangeHandSwitch(userId int64, tenantId int, handSwitch int, handType int, publicId int, handTime int, luminance int, explain string, name string) error {
+func (s *intelligentLightingService) ChangeHandSwitch(userId int64, tenantId string, handSwitch int, handType int, publicId int, handTime int, luminance int, explain string, name string) error {
 	light, err := s.GetDetailByLight(tenantId, publicId, handType)
 	if err != nil {
 		panic(err)
@@ -222,7 +222,7 @@ func (s *intelligentLightingService) ChangeHandSwitch(userId int64, tenantId int
 	// 这里要调用云端 操作灯控
 	var forLightControlReq edge_service.ForLightControlReq
 	forLightControlReq.Codes = sn
-	forLightControlReq.Tenant = strconv.Itoa(tenantId)
+	forLightControlReq.Tenant = tenantId
 	forLightControlReq.Recovery = handTime
 	forLightControlReq.Brightness = luminance
 	str := "灯控"

+ 5 - 5
app/device/service/ipBroadcastService.go

@@ -32,7 +32,7 @@ func (s *ipBroadcastService) Get(id int) (*model.IpBroadcastDetail, *common.Erro
 	}, nil
 }
 
-func (s *ipBroadcastService) CreateOrUpdate(userId int64, tenantId int, req dao.IpBroadcast) *common.Errors {
+func (s *ipBroadcastService) CreateOrUpdate(userId int64, tenantId string, req dao.IpBroadcast) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -93,7 +93,7 @@ func (s *ipBroadcastService) List(searchValue string, current, size int) ([]mode
 	return details, total, nil
 }
 
-func (s *ipBroadcastService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *ipBroadcastService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.IpBroadcast{
 		ID:         id,
@@ -110,7 +110,7 @@ func (s *ipBroadcastService) Remove(userId int64, tenantId int, id int) *common.
 	return nil
 }
 
-func (s *ipBroadcastService) GetList(tenantId int) ([]dao.IpBroadcast, *common.Errors) {
+func (s *ipBroadcastService) GetList(tenantId string, ) ([]dao.IpBroadcast, *common.Errors) {
 	device := &dao.IpBroadcast{
 		TenantId:  tenantId,
 		IsDeleted: 0,
@@ -139,7 +139,7 @@ func (s *ipBroadcastService) GetByLampPole(id int) []dao.IpBroadcast {
 	return device.GetDevicesByLampPole()
 }
 
-func (s *ipBroadcastService) GetAll(tenantId int) []dao.IpBroadcast {
+func (s *ipBroadcastService) GetAll(tenantId string, ) []dao.IpBroadcast {
 	device := &dao.IpBroadcast{
 		TenantId:  tenantId,
 		IsDeleted: 0,
@@ -147,7 +147,7 @@ func (s *ipBroadcastService) GetAll(tenantId int) []dao.IpBroadcast {
 	return device.GetAll()
 }
 
-func (s *ipBroadcastService) GetByIds(tenantId int, ids string) []dao.IpBroadcast {
+func (s *ipBroadcastService) GetByIds(tenantId string, ids string) []dao.IpBroadcast {
 	device := &dao.IpBroadcast{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 8 - 8
app/device/service/lampPoleGroupService.go

@@ -28,7 +28,7 @@ func (s *lampPoleGroupService) Get(id int) (*dao.LampPoleGroup, *common.Errors)
 	return device, nil
 }
 
-func (s *lampPoleGroupService) CreateOrUpdate(userId int64, tenantId int, req *dao.LampPoleGroup) *common.Errors {
+func (s *lampPoleGroupService) CreateOrUpdate(userId int64, tenantId string, req *dao.LampPoleGroup) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -87,7 +87,7 @@ func (s *lampPoleGroupService) List(poleGroupName string, current, size int) ([]
 	return devices, total, nil
 }
 
-func (s *lampPoleGroupService) Remove(userId int64, tenantId int, id int, name string) *common.Errors {
+func (s *lampPoleGroupService) Remove(userId int64, tenantId string, id int, name string) *common.Errors {
 	device := &dao.LampPoleGroup{
 		ID:         id,
 		IsDeleted:  1,
@@ -108,7 +108,7 @@ func (s *lampPoleGroupService) Remove(userId int64, tenantId int, id int, name s
 	return nil
 }
 
-func (s *lampPoleGroupService) GetList(tenantId int) ([]*dao.LampPoleGroup, *common.Errors) {
+func (s *lampPoleGroupService) GetList(tenantId string, ) ([]*dao.LampPoleGroup, *common.Errors) {
 	var devices []*dao.LampPoleGroup
 	err := cache.Redis.Get(getLampPoleGroupListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -128,11 +128,11 @@ func (s *lampPoleGroupService) GetList(tenantId int) ([]*dao.LampPoleGroup, *com
 	return devices, nil
 }
 
-func getLampPoleGroupListRedisKey(tenantId int) string {
+func getLampPoleGroupListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.LampPoleGroupList, tenantId)
 }
 
-func (s *lampPoleGroupService) GetFiltration(tenantId int) ([]*dao.LampPoleGroup, *common.Errors) {
+func (s *lampPoleGroupService) GetFiltration(tenantId string, ) ([]*dao.LampPoleGroup, *common.Errors) {
 	var devices []*dao.LampPoleGroup
 	err := cache.Redis.Get(getGroupFiltrationListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -157,11 +157,11 @@ func (s *lampPoleGroupService) GetFiltration(tenantId int) ([]*dao.LampPoleGroup
 	return devices, nil
 }
 
-func getGroupFiltrationListRedisKey(tenantId int) string {
+func getGroupFiltrationListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.GroupFiltrationList, tenantId)
 }
 
-func (s *lampPoleGroupService) GetTree(tenantId int) ([]*dao.LampPoleGroup, *common.Errors) {
+func (s *lampPoleGroupService) GetTree(tenantId string, ) ([]*dao.LampPoleGroup, *common.Errors) {
 	// todo use redis cache
 	device := &dao.LampPoleGroup{
 		TenantId:  tenantId,
@@ -178,7 +178,7 @@ func (s *lampPoleGroupService) GetTree(tenantId int) ([]*dao.LampPoleGroup, *com
 	return devices, nil
 }
 
-func (s *lampPoleGroupService) GetByIds(tenantId int, ids []int) []*dao.LampPoleGroup {
+func (s *lampPoleGroupService) GetByIds(tenantId string, ids []int) []*dao.LampPoleGroup {
 	device := &dao.LampPoleGroup{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 3 - 3
app/device/service/lampPoleService.go

@@ -50,7 +50,7 @@ func (s *lampPoleService) GetRelevanceDetail(id int) (*model.LampPoleDetail, *co
 	}, nil
 }
 
-func (s *lampPoleService) CreateOrUpdate(userId int64, tenantId int, req *dao.LampPole) *common.Errors {
+func (s *lampPoleService) CreateOrUpdate(userId int64, tenantId string, req *dao.LampPole) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.CoordType = 1
@@ -103,7 +103,7 @@ func (s *lampPoleService) List(searchValue, groupId, boxId string, current, size
 	return devices, total, nil
 }
 
-func (s *lampPoleService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *lampPoleService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.LampPole{
 		ID:         id,
@@ -120,7 +120,7 @@ func (s *lampPoleService) Remove(userId int64, tenantId int, id int) *common.Err
 	return nil
 }
 
-func (s *lampPoleService) GetList(tenantId int) ([]*dao.LampPole, *common.Errors) {
+func (s *lampPoleService) GetList(tenantId string, ) ([]*dao.LampPole, *common.Errors) {
 	device := &dao.LampPole{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 3 - 3
app/device/service/lightControlService.go

@@ -36,7 +36,7 @@ func (s *lightControlService) Get(id int) (*model.LightControlDetail, *common.Er
 	return &detail, nil
 }
 
-func (s *lightControlService) CreateOrUpdate(userId int64, tenantId int, req *dao.LightControl) *common.Errors {
+func (s *lightControlService) CreateOrUpdate(userId int64, tenantId string, req *dao.LightControl) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -152,7 +152,7 @@ func (s *lightControlService) List(searchValue, controlType, zigbeeId string, cu
 	return details, total, nil
 }
 
-func (s *lightControlService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *lightControlService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.LightControl{
 		ID:         id,
@@ -169,7 +169,7 @@ func (s *lightControlService) Remove(userId int64, tenantId int, id int) *common
 	return nil
 }
 
-func (s *lightControlService) GetList(tenantId int) ([]dao.LightControl, *common.Errors) {
+func (s *lightControlService) GetList(tenantId string) ([]dao.LightControl, *common.Errors) {
 	device := &dao.LightControl{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 3 - 3
app/device/service/manholeCoverService.go

@@ -25,7 +25,7 @@ func (s *manholeCoverService) Get(id int) (*dao.ManholeCover, *common.Errors) {
 
 }
 
-func (s *manholeCoverService) CreateOrUpdate(userId int64, tenantId int, req dao.ManholeCover) *common.Errors {
+func (s *manholeCoverService) CreateOrUpdate(userId int64, tenantId string, req dao.ManholeCover) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -76,7 +76,7 @@ func (s *manholeCoverService) List(searchValue string, current, size int) ([]dao
 	return devices, total, nil
 }
 
-func (s *manholeCoverService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *manholeCoverService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.ManholeCover{
 		ID:         id,
@@ -93,7 +93,7 @@ func (s *manholeCoverService) Remove(userId int64, tenantId int, id int) *common
 	return nil
 }
 
-func (s *manholeCoverService) GetList(tenantId int) ([]*dao.ManholeCover, *common.Errors) {
+func (s *manholeCoverService) GetList(tenantId string) ([]*dao.ManholeCover, *common.Errors) {
 	device := &dao.ManholeCover{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 4 - 4
app/device/service/onDemandGroupService.go

@@ -30,7 +30,7 @@ func (s *onDemandGroupService) Get(id int) (*dao.OnDemandGroup, *common.Errors)
 	return device, nil
 }
 
-func (s *onDemandGroupService) CreateOrUpdate(userId int64, tenantId int, req *dao.OnDemandGroup) *common.Errors {
+func (s *onDemandGroupService) CreateOrUpdate(userId int64, tenantId string, req *dao.OnDemandGroup) *common.Errors {
 	device := req
 	device.TenantId = tenantId
 	device.UpdateUser = userId
@@ -80,7 +80,7 @@ func (s *onDemandGroupService) List(searchValue string, current, size int) ([]da
 	return devices, nil
 }
 
-func (s *onDemandGroupService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *onDemandGroupService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.OnDemandGroup{
 		ID:         id,
@@ -97,7 +97,7 @@ func (s *onDemandGroupService) Remove(userId int64, tenantId int, id int) *commo
 	return nil
 }
 
-func (s *onDemandGroupService) GetList(tenantId int) ([]*dao.OnDemandGroup, *common.Errors) {
+func (s *onDemandGroupService) GetList(tenantId string, ) ([]*dao.OnDemandGroup, *common.Errors) {
 	var devices []*dao.OnDemandGroup
 	err := cache.Redis.Get(getOnDemandGroupListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -117,7 +117,7 @@ func (s *onDemandGroupService) GetList(tenantId int) ([]*dao.OnDemandGroup, *com
 	return devices, nil
 }
 
-func getOnDemandGroupListRedisKey(tenantId int) string {
+func getOnDemandGroupListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.OnDemandGroupList, tenantId)
 }
 

+ 2 - 2
app/device/service/onDemandSensorService.go

@@ -25,7 +25,7 @@ func (s *onDemandSensorService) Get(id int) (*dao.OnDemandSensor, *common.Errors
 
 }
 
-func (s *onDemandSensorService) CreateOrUpdate(userId int64, tenantId int, req dao.OnDemandSensor) *common.Errors {
+func (s *onDemandSensorService) CreateOrUpdate(userId int64, tenantId string, req dao.OnDemandSensor) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -76,7 +76,7 @@ func (s *onDemandSensorService) List(searchValue string, current, size int) ([]d
 	return devices, total, nil
 }
 
-func (s *onDemandSensorService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *onDemandSensorService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.OnDemandSensor{
 		ID:         id,

+ 4 - 4
app/device/service/optoSensoService.go

@@ -32,7 +32,7 @@ func (s *optoSensorService) Get(id int) (*model.OptoSensorDetail, *common.Errors
 	}, nil
 }
 
-func (s *optoSensorService) CreateOrUpdate(userId int64, tenantId int, req dao.OptoSensor) *common.Errors {
+func (s *optoSensorService) CreateOrUpdate(userId int64, tenantId string, req dao.OptoSensor) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -93,7 +93,7 @@ func (s *optoSensorService) List(searchValue string, current, size int) ([]model
 	return details, total, nil
 }
 
-func (s *optoSensorService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *optoSensorService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.OptoSensor{
 		ID:         id,
@@ -110,7 +110,7 @@ func (s *optoSensorService) Remove(userId int64, tenantId int, id int) *common.E
 	return nil
 }
 
-func (s *optoSensorService) GetList(tenantId int) ([]*dao.OptoSensor, *common.Errors) {
+func (s *optoSensorService) GetList(tenantId string) ([]*dao.OptoSensor, *common.Errors) {
 	device := &dao.OptoSensor{
 		TenantId:  tenantId,
 		IsDeleted: 0,
@@ -139,7 +139,7 @@ func (s *optoSensorService) GetByLampPole(id int) []dao.OptoSensor {
 	return device.GetDevicesByLampPole()
 }
 
-func (s *optoSensorService) GetByTenant(id int) []dao.OptoSensor {
+func (s *optoSensorService) GetByTenant(id string) []dao.OptoSensor {
 	// 创建查询实例
 	device := &dao.OptoSensor{
 		TenantId: id,

+ 4 - 4
app/device/service/switchBoxService.go

@@ -28,7 +28,7 @@ func (s *switchBoxService) Get(id int) (*dao.SwitchBox, *common.Errors) {
 
 }
 
-func (s *switchBoxService) CreateOrUpdate(userId int64, tenantId int, req dao.SwitchBox) *common.Errors {
+func (s *switchBoxService) CreateOrUpdate(userId int64, tenantId string, req dao.SwitchBox) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -87,7 +87,7 @@ func (s *switchBoxService) List(searchValue string, current, size int) ([]dao.Sw
 	return devices, total, nil
 }
 
-func (s *switchBoxService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *switchBoxService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.SwitchBox{
 		ID:         id,
@@ -105,7 +105,7 @@ func (s *switchBoxService) Remove(userId int64, tenantId int, id int) *common.Er
 	return nil
 }
 
-func (s *switchBoxService) GetList(tenantId int) ([]*dao.SwitchBox, *common.Errors) {
+func (s *switchBoxService) GetList(tenantId string, ) ([]*dao.SwitchBox, *common.Errors) {
 	var devices []*dao.SwitchBox
 	err := cache.Redis.Get(getSwitchBoxListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -124,6 +124,6 @@ func (s *switchBoxService) GetList(tenantId int) ([]*dao.SwitchBox, *common.Erro
 	return devices, nil
 }
 
-func getSwitchBoxListRedisKey(tenantId int) string {
+func getSwitchBoxListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.SwitchBoxList, tenantId)
 }

+ 4 - 4
app/device/service/transformerService.go

@@ -28,7 +28,7 @@ func (s *transformerService) Get(id int) (*dao.Transformer, *common.Errors) {
 
 }
 
-func (s *transformerService) CreateOrUpdate(userId int64, tenantId int, req dao.Transformer) *common.Errors {
+func (s *transformerService) CreateOrUpdate(userId int64, tenantId string, req dao.Transformer) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -84,7 +84,7 @@ func (s *transformerService) List(searchValue string, current, size int) ([]dao.
 	return devices, total, nil
 }
 
-func (s *transformerService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *transformerService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.Transformer{
 		ID:         id,
@@ -101,7 +101,7 @@ func (s *transformerService) Remove(userId int64, tenantId int, id int) *common.
 	return nil
 }
 
-func (s *transformerService) GetList(tenantId int) ([]*dao.Transformer, *common.Errors) {
+func (s *transformerService) GetList(tenantId string, ) ([]*dao.Transformer, *common.Errors) {
 	var devices []*dao.Transformer
 	err := cache.Redis.Get(getTransformerListRedisKey(tenantId)).Scan(&devices)
 	if err == nil {
@@ -121,6 +121,6 @@ func (s *transformerService) GetList(tenantId int) ([]*dao.Transformer, *common.
 	return devices, nil
 }
 
-func getTransformerListRedisKey(tenantId int) string {
+func getTransformerListRedisKey(tenantId string, ) string {
 	return fmt.Sprintf(model.TransformerList, tenantId)
 }

+ 5 - 5
app/device/service/utilService.go

@@ -8,7 +8,7 @@ var UtilService = new(utilService)
 
 type utilService struct{}
 
-func (s *utilService) GetDeviceVendor(tenantId, deviceType int) ([]dao.DeviceVendor, error) {
+func (s *utilService) GetDeviceVendor(tenantId string, deviceType int) ([]dao.DeviceVendor, error) {
 	// 创建查询实例
 	device := &dao.DeviceVendor{
 		TenantId:   tenantId,
@@ -21,7 +21,7 @@ func (s *utilService) GetDeviceVendor(tenantId, deviceType int) ([]dao.DeviceVen
 	return vendors, nil
 }
 
-func (s *utilService) GetDeviceBrand(tenantId, deviceType int) ([]dao.DeviceVendor, error) {
+func (s *utilService) GetDeviceBrand(tenantId string, deviceType int) ([]dao.DeviceVendor, error) {
 	// 创建查询实例
 	device := &dao.DeviceVendor{
 		TenantId:   tenantId,
@@ -34,7 +34,7 @@ func (s *utilService) GetDeviceBrand(tenantId, deviceType int) ([]dao.DeviceVend
 	return vendors, nil
 }
 
-func (s *utilService) GetDeviceModel(tenantId, deviceType, parentId int) ([]dao.DeviceVendor, error) {
+func (s *utilService) GetDeviceModel(tenantId string, deviceType, parentId int) ([]dao.DeviceVendor, error) {
 	// 创建查询实例
 	device := &dao.DeviceVendor{
 		TenantId:   tenantId,
@@ -48,10 +48,10 @@ func (s *utilService) GetDeviceModel(tenantId, deviceType, parentId int) ([]dao.
 	return vendors, nil
 }
 
-func (s *utilService) GetTenantCode(tenantId int) (*dao.TenantCode, error) {
+func (s *utilService) GetTenantCode(tenantId string) (*dao.TenantCode, error) {
 	// 创建查询实例
 	device := &dao.TenantCode{
-		TenantID: tenantId,
+		TenantId: tenantId,
 	}
 	tenantCode, err := device.GetTenantCode()
 	if err != nil {

+ 8 - 9
app/device/service/workbenchService.go

@@ -9,7 +9,6 @@ import (
 	"iot_manager_service/app/operation/edge_service"
 	operationModel "iot_manager_service/app/operation/model"
 	"iot_manager_service/util/common"
-	"strconv"
 	"time"
 )
 
@@ -18,7 +17,7 @@ var WorkbenchService = new(workbenchService)
 
 type workbenchService struct{}
 
-func (s *workbenchService) CountDevice(tenantId int) ([]dao.CountDevice, *common.Errors) {
+func (s *workbenchService) CountDevice(tenantId string) ([]dao.CountDevice, *common.Errors) {
 	counts, err := dao.GetDeviceCount(tenantId)
 	if err != nil {
 		return nil, common.FailResponse(err.Error(), nil)
@@ -26,7 +25,7 @@ func (s *workbenchService) CountDevice(tenantId int) ([]dao.CountDevice, *common
 	return counts, nil
 }
 
-func (s *workbenchService) CountAlarm(tenantId int) (*dao.CountAlarm, *common.Errors) {
+func (s *workbenchService) CountAlarm(tenantId string) (*dao.CountAlarm, *common.Errors) {
 	count, err := dao.GetAlarmCount(tenantId)
 	if err != nil {
 		return nil, common.FailResponse(err.Error(), nil)
@@ -34,7 +33,7 @@ func (s *workbenchService) CountAlarm(tenantId int) (*dao.CountAlarm, *common.Er
 	return count, nil
 }
 
-func (s *workbenchService) CountJobTodo(tenantId int) (*dao.CountAlarm, *common.Errors) {
+func (s *workbenchService) CountJobTodo(tenantId string) (*dao.CountAlarm, *common.Errors) {
 	count, err := dao.GetAlarmCount(tenantId)
 	if err != nil {
 		return nil, common.FailResponse(err.Error(), nil)
@@ -42,7 +41,7 @@ func (s *workbenchService) CountJobTodo(tenantId int) (*dao.CountAlarm, *common.
 	return count, nil
 }
 
-func (s *workbenchService) Notification(tenantId int) (*dao.Notification, *common.Errors) {
+func (s *workbenchService) Notification(tenantId string) (*dao.Notification, *common.Errors) {
 	notification, err := dao.GetNotification(tenantId)
 	if err != nil {
 		return nil, common.FailResponse(err.Error(), nil)
@@ -50,7 +49,7 @@ func (s *workbenchService) Notification(tenantId int) (*dao.Notification, *commo
 	return notification, nil
 }
 
-func (s *workbenchService) LightRate(tenantId int, req model.ReqLightRates) (*model.RspLightRate, *common.Errors) {
+func (s *workbenchService) LightRate(tenantId string, req model.ReqLightRates) (*model.RspLightRate, *common.Errors) {
 
 	var list []operationModel.ResponseLightingRate
 	var err error
@@ -93,7 +92,7 @@ func (s *workbenchService) LightRate(tenantId int, req model.ReqLightRates) (*mo
 }
 
 //工作台-采集点
-func (s *workbenchService) Aqi(tenantId int) (interface{}, interface{}) {
+func (s *workbenchService) Aqi(tenantId string) (interface{}, interface{}) {
 	aqi, err := dao.GetAqi(tenantId)
 	if err != nil {
 		return nil, common.FailResponse(err.Error(), nil)
@@ -129,7 +128,7 @@ func (s *workbenchService) GetNewsDate(vo *dao.OptoSensorVO) *dao.OptoSensorVO {
 }
 
 // getLightRateData 能耗和光照
-func (s *workbenchService) getLightRateData(method string, tenantId int, req operationModel.RequestLightingRateFilter) ([]operationModel.ResponseLightingRate, error) {
+func (s *workbenchService) getLightRateData(method string, tenantId string, req operationModel.RequestLightingRateFilter) ([]operationModel.ResponseLightingRate, error) {
 	lightControl := operationDao.Operation{
 		TenantId: tenantId,
 	}
@@ -157,7 +156,7 @@ func (s *workbenchService) getLightRateData(method string, tenantId int, req ope
 	//亮灯率
 	forLightRate := edge_service.ForLightRate{}
 	lightRates, err := forLightRate.GetLightRate(edge_service.ForLightRateReq{
-		Tenant: strconv.Itoa(tenantId),
+		Tenant: tenantId,
 		Start:  req.StartTime,
 		End:    req.EndTime,
 		Flag:   flag2,

+ 3 - 3
app/device/service/zigbeeService.go

@@ -34,7 +34,7 @@ func (s *zigbeeService) Get(id int) (*model.ZigbeeDetail, *common.Errors) {
 
 }
 
-func (s *zigbeeService) CreateOrUpdate(userId int64, tenantId int, req dao.Zigbee) *common.Errors {
+func (s *zigbeeService) CreateOrUpdate(userId int64, tenantId string, req dao.Zigbee) *common.Errors {
 	// 创建查询实例
 	device := req
 	device.TenantId = tenantId
@@ -94,7 +94,7 @@ func (s *zigbeeService) List(searchValue string, current, size int) ([]model.Zig
 	return details, total, nil
 }
 
-func (s *zigbeeService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *zigbeeService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.Zigbee{
 		ID:         id,
@@ -111,7 +111,7 @@ func (s *zigbeeService) Remove(userId int64, tenantId int, id int) *common.Error
 	return nil
 }
 
-func (s *zigbeeService) GetList(tenantId int) ([]dao.Zigbee, *common.Errors) {
+func (s *zigbeeService) GetList(tenantId string) ([]dao.Zigbee, *common.Errors) {
 	device := &dao.Zigbee{
 		TenantId:  tenantId,
 		IsDeleted: 0,

+ 2 - 2
app/middleware/token.go

@@ -16,14 +16,14 @@ var EmptyKeyFunc = func(t *jwt.Token) (interface{}, error) { return []byte(confi
 
 type Claims struct {
 	jwt.StandardClaims
-	TenantId int    `json:"tenant_id"`
+	TenantId string `json:"tenant_id"`
 	UserId   int64  `json:"user_id"`
 	RoleId   int64  `json:"role_id"`
 	UserName string `json:"user_name"`
 	Random   string `json:"random"`
 }
 
-func GetAccessToken(userId, roleId int64, tenantId int, userName string, random string) (string, error) {
+func GetAccessToken(userId, roleId int64, tenantId string, userName string, random string) (string, error) {
 	jwtToken := Claims{StandardClaims: jwt.StandardClaims{
 		Audience:  Audience,
 		Issuer:    Issuer,

+ 9 - 0
app/multimedia/controller/programController.go

@@ -2,6 +2,7 @@ package controller
 
 import (
 	"github.com/gin-gonic/gin"
+	dev_controller "iot_manager_service/app/device/controller"
 	"iot_manager_service/app/middleware"
 	"iot_manager_service/app/multimedia/model"
 	"iot_manager_service/app/multimedia/service"
@@ -9,6 +10,7 @@ import (
 	"math"
 	"net/http"
 	"strconv"
+	"strings"
 )
 
 var Program = new(programCtl)
@@ -178,5 +180,12 @@ func (c *programCtl) Audit(ctx *gin.Context) {
 		return
 	}
 
+	split := strings.Split(req.InfoId, ",")
+	for _, s := range split {
+		id, err := strconv.Atoi(s)
+		if err != nil {
+			dev_controller.InfoBoard.CronSyncLedPaying(id)
+		}
+	}
 	ctx.JSON(http.StatusOK, common.SuccessResponse(common.Success, nil))
 }

+ 1 - 1
app/multimedia/dao/libraryDao.go

@@ -16,7 +16,7 @@ type Library struct {
 	FileId          string    `gorm:"type:varchar(255)" json:"fileId"`            //文件ID,系统类型为广播系统时使用
 	TalkSpeed       int       `gorm:"type:int;default 0" json:"talkSpeed"`        //语速(用于文字广播):0-正常,1-快一些,2-很快
 	SysType         int       `gorm:"type:int" json:"sysType"`                    //系统类型:0-信息发布系统,1-广播系统
-	TenantId        int       `gorm:"type:int" json:"tenantId"`                   //租户ID
+	TenantId        string    `gorm:"type:varchar(12)" json:"tenantId"`           //租户ID
 	CreateTime      time.Time `gorm:"type:datetime" json:"createTime"`            //新增时间
 	CreateUser      int64     `gorm:"type:bigint" json:"createUser"`              //新增记录操作用户ID
 	UpdateTime      time.Time `gorm:"type:datetime" json:"updateTime"`            //修改时间

+ 1 - 1
app/multimedia/dao/programDao.go

@@ -13,7 +13,7 @@ type Program struct {
 	ImgDuration int       `gorm:"type:int;default 0" json:"imgDuration"` //图片播放时长(毫秒)
 	Remarks     string    `gorm:"type:varchar(4000)" json:"remarks"`     //备注
 	SysType     int       `gorm:"type:int" json:"sysTrecordype"`         //系统类型:0-信息发布系统,1-广播系统
-	TenantId    int       `gorm:"type:int" json:"tenantId"`              //租户ID
+	TenantId    string    `gorm:"type:varchar(12)" json:"tenantId"`      //租户ID
 	CreateTime  time.Time `gorm:"type:datetime" json:"createTime"`       //新增时间
 	CreateUser  int64     `gorm:"type:bigint" json:"createUser"`         //新增记录操作用户ID
 	UpdateTime  time.Time `gorm:"type:datetime" json:"updateTime"`       //修改时间

+ 7 - 7
app/multimedia/dao/programRelationDao.go

@@ -1,13 +1,13 @@
 package dao
 
 type ProgramRelation struct {
-	ID        int `gorm:"primary_key" json:"id"`               //编号
-	ProgramId int `gorm:"type:int" json:"programId"`           //节目单ID
-	LibraryId int `gorm:"type:int" json:"libraryId"`           //素材ID
-	Duration  int `gorm:"type:int" json:"duration"`            //时长
-	OrderNo   int `gorm:"type:int" json:"orderNo"`             //排序位置
-	TenantId  int `gorm:"type:int" json:"tenantId"`            //租户ID
-	IsDeleted int `gorm:"type:int;default 0" json:"isDeleted"` //是否删除 0=未删除,1=删除
+	ID        int    `gorm:"primary_key" json:"id"`               //编号
+	ProgramId int    `gorm:"type:int" json:"programId"`           //节目单ID
+	LibraryId int    `gorm:"type:int" json:"libraryId"`           //素材ID
+	Duration  int    `gorm:"type:int" json:"duration"`            //时长
+	OrderNo   int    `gorm:"type:int" json:"orderNo"`             //排序位置
+	TenantId  string `gorm:"type:varchar(12)" json:"tenantId"`    //租户ID
+	IsDeleted int    `gorm:"type:int;default 0" json:"isDeleted"` //是否删除 0=未删除,1=删除
 }
 
 func (ProgramRelation) TableName() string {

+ 1 - 1
app/multimedia/dao/publishLibrariesDao.go

@@ -24,7 +24,7 @@ type PublishLibraries struct {
 	UpdateUser       string      `gorm:"column:update_user;type:varchar(60);comment:修改用户" json:"updateUser"`                            // 修改用户
 	IsDeleted        int         `gorm:"column:is_deleted;type:int(11);default:0;comment:是否删除 0=未删除,1=删除" json:"isDeleted"`             // 是否删除 0=未删除,1=删除
 	Status           int         `gorm:"column:status;type:int(11);comment:状态 0审核1播放2暂停3取消4过期5审核不通过" json:"status"`                     // 状态 0审核1播放2暂停3取消4过期5审核不通过
-	TenantId         int         `gorm:"column:tenant_id;type:int(11);comment:租户ID" json:"tenantTd"`                                    // 租户ID
+	TenantId         string      `gorm:"column:tenant_id;type:varchar(12);comment:租户ID" json:"tenantTd"`                                // 租户ID
 	Remarks          string      `gorm:"column:remarks;type:varchar(4000);comment:系统类型:0-多媒体系统,1-广播系统" json:"remarks"`                  // 备注
 	SysType          int         `gorm:"column:sys_type;type:int(11);default:0;comment:编号" json:"sysStype"`                             // 系统类型:0-多媒体系统,1-广播系统
 	KsTime           string      `gorm:"column:ks_time;type:varchar(50);comment:播放开始时间" json:"ksTime"`                                  // 播放开始时间

+ 5 - 5
app/multimedia/service/libraryService.go

@@ -29,7 +29,7 @@ func (s *libraryService) Get(id int) (*dao.Library, *common.Errors) {
 	return library, nil
 }
 
-func (s *libraryService) List(tenantId int, searchValue string, current, size, sysType, libType int) ([]model.LibraryDetail, int64,
+func (s *libraryService) List(tenantId string, searchValue string, current, size, sysType, libType int) ([]model.LibraryDetail, int64,
 	*common.Errors) {
 	library := &dao.Library{
 		TenantId: tenantId,
@@ -59,7 +59,7 @@ func (s *libraryService) List(tenantId int, searchValue string, current, size, s
 	return rsp, total, nil
 }
 
-func (s *libraryService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *libraryService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	library := &dao.Library{
 		ID:         id,
 		IsDeleted:  1,
@@ -75,7 +75,7 @@ func (s *libraryService) Remove(userId int64, tenantId int, id int) *common.Erro
 	return nil
 }
 
-func (s *libraryService) GetList(tenantId int, libName string, libType, sysType int) ([]dao.Library, *common.Errors) {
+func (s *libraryService) GetList(tenantId string, libName string, libType, sysType int) ([]dao.Library, *common.Errors) {
 	library := &dao.Library{
 		TenantId: tenantId,
 		LibName:  libName,
@@ -90,7 +90,7 @@ func (s *libraryService) GetList(tenantId int, libName string, libType, sysType
 	return libraries, nil
 }
 
-func (s *libraryService) UploadFile(tenantId int, fileHeader *multipart.FileHeader) (*model.RspUploadFile,
+func (s *libraryService) UploadFile(tenantId string, fileHeader *multipart.FileHeader) (*model.RspUploadFile,
 	*common.Errors) {
 	fileContent, err := fileHeader.Open()
 	if err != nil {
@@ -153,7 +153,7 @@ func (s *libraryService) UploadFile(tenantId int, fileHeader *multipart.FileHead
 	}, nil
 }
 
-func (s *libraryService) Submit(tenantId int, userId int64, req dao.Library) *common.Errors {
+func (s *libraryService) Submit(tenantId string, userId int64, req dao.Library) *common.Errors {
 	library := &req
 	library.TenantId = tenantId
 	library.UpdateUser = userId

+ 7 - 7
app/multimedia/service/programService.go

@@ -25,7 +25,7 @@ func (s *programService) Get(id int) (*dao.Program, *common.Errors) {
 	return Program, nil
 }
 
-func (s *programService) List(tenantId int, searchValue string, current, size, sysType int) ([]model.ProgramDetail, int64,
+func (s *programService) List(tenantId string, searchValue string, current, size, sysType int) ([]model.ProgramDetail, int64,
 	*common.Errors) {
 	program := &dao.Program{
 		TenantId: tenantId,
@@ -53,7 +53,7 @@ func (s *programService) List(tenantId int, searchValue string, current, size, s
 	return rsp, total, nil
 }
 
-func (s *programService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *programService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	relation := &dao.ProgramRelation{
 		ProgramId: id,
 		TenantId:  tenantId,
@@ -79,7 +79,7 @@ func (s *programService) Remove(userId int64, tenantId int, id int) *common.Erro
 	return nil
 }
 
-func (s *programService) GetList(tenantId int, name string) ([]dao.Program, *common.Errors) {
+func (s *programService) GetList(tenantId string, name string) ([]dao.Program, *common.Errors) {
 	Program := &dao.Program{
 		TenantId: tenantId,
 		Name:     name,
@@ -92,7 +92,7 @@ func (s *programService) GetList(tenantId int, name string) ([]dao.Program, *com
 	return libraries, nil
 }
 
-func (s *programService) Submit(tenantId int, userId int64, req model.ReqProgramSubmit) *common.Errors {
+func (s *programService) Submit(tenantId string, userId int64, req model.ReqProgramSubmit) *common.Errors {
 	program := &dao.Program{
 		Name:        req.Name,
 		Resolution:  req.Resolution,
@@ -137,7 +137,7 @@ func (s *programService) Submit(tenantId int, userId int64, req model.ReqProgram
 	return common.SuccessResponse(common.Succeeded, nil)
 }
 
-func (s *programService) GetLibraryList(tenantId, programId int) ([]dao.Library, *common.Errors) {
+func (s *programService) GetLibraryList(tenantId string, programId int) ([]dao.Library, *common.Errors) {
 	relation := &dao.ProgramRelation{
 		ProgramId: programId,
 		TenantId:  tenantId,
@@ -170,7 +170,7 @@ func (s *programService) GetLibraryList(tenantId, programId int) ([]dao.Library,
 	return libraries, nil
 }
 
-func (s *programService) RelationDeviceList(tenantId, sysType, resolution int) ([]model.ProgramDeviceDetail,
+func (s *programService) RelationDeviceList(tenantId string, sysType, resolution int) ([]model.ProgramDeviceDetail,
 	*common.Errors) {
 	var lampGroupIds []int
 	infoBoardMap := make(map[int][]model.ProgramDevice)
@@ -219,7 +219,7 @@ func (s *programService) RelationDeviceList(tenantId, sysType, resolution int) (
 	return details, nil
 }
 
-func (s *programService) RelationDeviceListByIds(tenantId, sysType int, deviceIds string) ([]model.ProgramDeviceList,
+func (s *programService) RelationDeviceListByIds(tenantId string, sysType int, deviceIds string) ([]model.ProgramDeviceList,
 	*common.Errors) {
 	deviceList := []model.ProgramDeviceList{}
 	if sysType == model.SysTypeInfoBar {

+ 3 - 3
app/multimedia/service/publishLibrariesService.go

@@ -21,7 +21,7 @@ type publishLibrariesService struct{}
 TODO: 此接口都未对接边缘端
 */
 
-func (s *publishLibrariesService) List(tenantId int, searchValue string, current, size int, sysType int) ([]dao.PublishLibraries, int64,
+func (s *publishLibrariesService) List(tenantId string, searchValue string, current, size int, sysType int) ([]dao.PublishLibraries, int64,
 	*common.Errors) {
 	program := &dao.PublishLibraries{
 		TenantId: tenantId,
@@ -112,7 +112,7 @@ func (s *publishLibrariesService) putPublishLibraries(programId int, publishLibr
 }
 
 // UpdateStatus 状态变更
-func (s *publishLibrariesService) UpdateStatus(tenantId int, id int, status int, name string) (bool, error) {
+func (s *publishLibrariesService) UpdateStatus(tenantId string, id int, status int, name string) (bool, error) {
 	update := &dao.PublishLibraries{
 		TenantId: tenantId,
 		ID:       int64(id),
@@ -126,7 +126,7 @@ func (s *publishLibrariesService) UpdateStatus(tenantId int, id int, status int,
 	return true, nil
 }
 
-func (s *publishLibrariesService) Remove(userId int64, tenantId int, id int) *common.Errors {
+func (s *publishLibrariesService) Remove(userId int64, tenantId string, id int) *common.Errors {
 	// 创建查询实例
 	device := &dao.PublishLibraries{
 		ID:         int64(id),

+ 1 - 1
app/operation/dao/operationDao.go

@@ -1,7 +1,7 @@
 package dao
 
 type Operation struct {
-	TenantId  int    `gorm:"type:int" json:"tenantId"`            //租户ID
+	TenantId  string `gorm:"type:varchar(12)" json:"tenantId"`    //租户ID
 	Sn        string `gorm:"type:varchar(60)" json:"sn"`          //设备序列号
 	IsDeleted int    `gorm:"type:int;default 0" json:"isDeleted"` //是否删除 0=未删除,1=删除
 }

+ 1 - 1
app/operation/dao/viewsAllCodeDeviceDao.go

@@ -3,7 +3,7 @@ package dao
 import "iot_manager_service/app/operation/model"
 
 type ViewsAllCodeDevice struct {
-	TenantId       int    `json:"tenantId"`
+	TenantId       string `json:"tenantId"`
 	DeviceType     int    `json:"deviceType"`     //类型 1-14
 	DeviceTypeName string `json:"deviceTypeName"` //类型中文名
 	MonthTime      string `json:"monthTime,omitempty"`

+ 4 - 4
app/operation/service/alarmService.go

@@ -11,16 +11,16 @@ var AlarmService = new(alarmService)
 
 type alarmService struct{}
 
-func (s alarmService) GetDayList(tenantId int, req model.RequestAlarmFilter) ([]model.ResponseAlarm, error) {
+func (s alarmService) GetDayList(tenantId string, req model.RequestAlarmFilter) ([]model.ResponseAlarm, error) {
 	return s.getData("day", tenantId, req)
 }
 
-func (s alarmService) GetMonthList(tenantId int, req model.RequestAlarmFilter) ([]model.ResponseAlarm, error) {
+func (s alarmService) GetMonthList(tenantId string, req model.RequestAlarmFilter) ([]model.ResponseAlarm, error) {
 	return s.getData("month", tenantId, req)
 }
 
-func (s alarmService) getData(method string, tenantId int, req model.RequestAlarmFilter) ([]model.ResponseAlarm, error) {
-	alarmDao := dao.Alarm{TenantId: strconv.Itoa(tenantId)}
+func (s alarmService) getData(method string, tenantId string, req model.RequestAlarmFilter) ([]model.ResponseAlarm, error) {
+	alarmDao := dao.Alarm{TenantId: tenantId}
 	alarms, err := alarmDao.Gets(req) //取报警数据
 
 	var countDates []string

+ 3 - 3
app/operation/service/captureAreaService.go

@@ -13,7 +13,7 @@ var CaptureAreaService = new(captureAreaService)
 type captureAreaService struct{}
 
 // GetAreaList 得到下方前10的详细数据 list
-func (s captureAreaService) GetAreaList(tenantId int, req model.RequestCaptureFilter) (interface{}, error) {
+func (s captureAreaService) GetAreaList(tenantId string, req model.RequestCaptureFilter) (interface{}, error) {
 	//得到边缘数据
 	flag, forData, err := s.getData(tenantId, req)
 
@@ -91,7 +91,7 @@ func (s captureAreaService) GetAreaList(tenantId int, req model.RequestCaptureFi
 }
 
 // GetAreaTypeList 前10的地区 和 数量 line 图表
-func (s captureAreaService) GetAreaTypeList(tenantId int, req model.RequestCaptureFilter) (interface{}, error) {
+func (s captureAreaService) GetAreaTypeList(tenantId string, req model.RequestCaptureFilter) (interface{}, error) {
 	//得到全部数据
 	_, forData, err := s.getData(tenantId, req)
 
@@ -106,7 +106,7 @@ func (s captureAreaService) GetAreaTypeList(tenantId int, req model.RequestCaptu
 }
 
 //得到边缘接口 时间范围数据
-func (s captureAreaService) getData(tenantId int, req model.RequestCaptureFilter) (int, []edge_service.ForCaptureItsData, error) {
+func (s captureAreaService) getData(tenantId string, req model.RequestCaptureFilter) (int, []edge_service.ForCaptureItsData, error) {
 	//区分按月或按日
 	flag := 0
 	if req.QueryType == "month" {

+ 1 - 1
app/operation/service/captureCarRecordService.go

@@ -18,7 +18,7 @@ var (
 	BigTruckVType    int = 17 //大型货车
 )
 
-func (s captureCarRecordService) GetCarRecordCount(tenantId int, req model.RequestCarRecordCountFilter) (*model.ResponseCarRecordAll, error) {
+func (s captureCarRecordService) GetCarRecordCount(tenantId string, req model.RequestCarRecordCountFilter) (*model.ResponseCarRecordAll, error) {
 	unit := dao.CaptureUnit{
 		TenantId: tenantId,
 		ID:       req.CaptureId,

+ 1 - 1
app/operation/service/capturePeriodsService.go

@@ -12,7 +12,7 @@ var CapturePeriodsService = new(capturePeriodsService)
 
 type capturePeriodsService struct{}
 
-func (s capturePeriodsService) GetPeriodsList(tenantId int, req model.RequestCaptureFilter) (interface{}, error) {
+func (s capturePeriodsService) GetPeriodsList(tenantId string, req model.RequestCaptureFilter) (interface{}, error) {
 	unit := dao.CaptureUnit{
 		TenantId: tenantId,
 		ID:       req.CaptureId,

+ 2 - 2
app/operation/service/captureReportService.go

@@ -13,7 +13,7 @@ var CaptureReportService = new(captureReportService)
 
 type captureReportService struct{}
 
-func (s captureReportService) GetList(tenantId int, req model.RequestCaptureReportFilter) ([]model.ResponseCaptureReport, error) {
+func (s captureReportService) GetList(tenantId string, req model.RequestCaptureReportFilter) ([]model.ResponseCaptureReport, error) {
 	var list []model.ResponseCaptureReport
 	//按日期  或 时段把每个类型的汇总 展示 出来
 	flag, record, err := s.getData(tenantId, req)
@@ -72,7 +72,7 @@ func (s captureReportService) GetList(tenantId int, req model.RequestCaptureRepo
 }
 
 //得到边缘接口 时间范围数据
-func (s captureReportService) getData(tenantId int, req model.RequestCaptureReportFilter) (int, []edge_service.ForCaptureItsData, error) {
+func (s captureReportService) getData(tenantId string, req model.RequestCaptureReportFilter) (int, []edge_service.ForCaptureItsData, error) {
 	//区分按月或按日
 	flag := 1 //月
 	if req.QueryType == 1 {

+ 4 - 4
app/operation/service/captureService.go

@@ -13,17 +13,17 @@ var CaptureService = new(captureService)
 type captureService struct{}
 
 // GetDayVehicleTotal 车流统计 日
-func (s captureService) GetDayVehicleTotal(tenantId int, req model.RequestCaptureFilter) ([]model.ResponseCaptureVehicleTotal, error) {
+func (s captureService) GetDayVehicleTotal(tenantId string, req model.RequestCaptureFilter) ([]model.ResponseCaptureVehicleTotal, error) {
 	return s.getVehicleTotalData(0, tenantId, req)
 }
 
 // GetMonthVehicleTotal 车流统计 月
-func (s captureService) GetMonthVehicleTotal(tenantId int, req model.RequestCaptureFilter) ([]model.ResponseCaptureVehicleTotal, error) {
+func (s captureService) GetMonthVehicleTotal(tenantId string, req model.RequestCaptureFilter) ([]model.ResponseCaptureVehicleTotal, error) {
 	return s.getVehicleTotalData(1, tenantId, req)
 }
 
 // 车流统计公用方法
-func (s captureService) getVehicleTotalData(flag int, tenantId int, req model.RequestCaptureFilter) ([]model.ResponseCaptureVehicleTotal, error) {
+func (s captureService) getVehicleTotalData(flag int, tenantId string, req model.RequestCaptureFilter) ([]model.ResponseCaptureVehicleTotal, error) {
 	unit := dao.CaptureUnit{
 		TenantId: tenantId,
 		ID:       req.CaptureId,
@@ -70,7 +70,7 @@ func (s captureService) getVehicleTotalData(flag int, tenantId int, req model.Re
 }
 
 // GetSuggestSpeed 从数据库查抓拍单元风向
-func (s captureService) GetSuggestSpeed(tenantId int, captureId int) (*dao.CaptureUnit, error) {
+func (s captureService) GetSuggestSpeed(tenantId string, captureId int) (*dao.CaptureUnit, error) {
 	unit := dao.CaptureUnit{
 		TenantId: tenantId,
 		ID:       captureId,

+ 3 - 3
app/operation/service/captureSpeedService.go

@@ -15,7 +15,7 @@ var CaptureSpeedService = new(captureSpeedService)
 type captureSpeedService struct{}
 
 // GetList 车速统计
-func (s captureSpeedService) GetList(tenantId int, req model.RequestCaptureFilter) (map[string]interface{}, error) {
+func (s captureSpeedService) GetList(tenantId string, req model.RequestCaptureFilter) (map[string]interface{}, error) {
 	//sectionSpeed 区间车速数据
 	data := make(map[string]interface{})
 	speed, err := s.getSectionSpeed(tenantId, req)
@@ -27,7 +27,7 @@ func (s captureSpeedService) GetList(tenantId int, req model.RequestCaptureFilte
 }
 
 // 区间车速数据
-func (s captureSpeedService) getSectionSpeed(tenantId int, req model.RequestCaptureFilter) ([]edge_service.ForCaptureItsData, error) {
+func (s captureSpeedService) getSectionSpeed(tenantId string, req model.RequestCaptureFilter) ([]edge_service.ForCaptureItsData, error) {
 	//区分按月或按日
 	flag := 0
 	if req.QueryType == "month" {
@@ -55,7 +55,7 @@ func (s captureSpeedService) getSectionSpeed(tenantId int, req model.RequestCapt
 }
 
 // 超速数据
-func (s captureSpeedService) getOverSpeed(tenantId int, req model.RequestCaptureFilter) ([]edge_service.ForCaptureItsData, error) {
+func (s captureSpeedService) getOverSpeed(tenantId string, req model.RequestCaptureFilter) ([]edge_service.ForCaptureItsData, error) {
 	//区分按月或按日
 	flag := 0
 	if req.QueryType == "month" {

+ 3 - 3
app/operation/service/captureVehicleTypeExService.go

@@ -15,7 +15,7 @@ var CaptureVehicleTypeExService = new(captureVehicleTypeExService)
 type captureVehicleTypeExService struct{}
 
 // GetVehicleList 得到下方前10的详细数据 list
-func (s captureVehicleTypeExService) GetVehicleList(tenantId int, req model.RequestCaptureFilter) (interface{}, error) {
+func (s captureVehicleTypeExService) GetVehicleList(tenantId string, req model.RequestCaptureFilter) (interface{}, error) {
 	//得到边缘数据
 	flag, forData, err := s.getData(tenantId, req)
 
@@ -91,7 +91,7 @@ func (s captureVehicleTypeExService) GetVehicleList(tenantId int, req model.Requ
 }
 
 // GetVehicleTypeList 前10的地区 和 数量 line 图表
-func (s captureVehicleTypeExService) GetVehicleTypeList(tenantId int, req model.RequestCaptureFilter) (interface{}, error) {
+func (s captureVehicleTypeExService) GetVehicleTypeList(tenantId string, req model.RequestCaptureFilter) (interface{}, error) {
 	//得到全部数据
 	_, forData, err := s.getData(tenantId, req)
 
@@ -106,7 +106,7 @@ func (s captureVehicleTypeExService) GetVehicleTypeList(tenantId int, req model.
 }
 
 //得到边缘接口 时间范围数据
-func (s captureVehicleTypeExService) getData(tenantId int, req model.RequestCaptureFilter) (int, []edge_service.ForCaptureItsData, error) {
+func (s captureVehicleTypeExService) getData(tenantId string, req model.RequestCaptureFilter) (int, []edge_service.ForCaptureItsData, error) {
 	//区分按月或按日
 	flag := 0
 	if req.QueryType == "month" {

+ 4 - 4
app/operation/service/deviceCoutService.go

@@ -10,7 +10,7 @@ var DeviceCountService = new(deviceCountService)
 
 type deviceCountService struct{}
 
-func (s deviceCountService) CountDevice(tenantId int, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
+func (s deviceCountService) CountDevice(tenantId string, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
 	list := dao.ViewsAllCodeDevice{
 		TenantId: tenantId,
 	}
@@ -27,21 +27,21 @@ func (s deviceCountService) CountDevice(tenantId int, req model.RequestDeviceCou
 	return counts, nil
 }
 
-func (s deviceCountService) GetYearList(tenantId int, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
+func (s deviceCountService) GetYearList(tenantId string, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
 	list := dao.ViewsAllCodeDevice{
 		TenantId: tenantId,
 	}
 	return list.GetYearDeviceCount(req)
 }
 
-func (s deviceCountService) GetMonthList(tenantId int, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
+func (s deviceCountService) GetMonthList(tenantId string, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
 	list := dao.ViewsAllCodeDevice{
 		TenantId: tenantId,
 	}
 	return list.GetMonthDeviceCount(req)
 }
 
-func (s deviceCountService) GetDayList(tenantId int, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
+func (s deviceCountService) GetDayList(tenantId string, req model.RequestDeviceCountFilter) ([]dao.ViewsAllCodeDevice, error) {
 	list := dao.ViewsAllCodeDevice{
 		TenantId: tenantId,
 	}

+ 1 - 1
app/operation/service/environmentService.go

@@ -15,7 +15,7 @@ var EnvironmentService = new(environmentService)
 
 type environmentService struct{}
 
-func (s *environmentService) EnvironmentList(tenantId int) ([]model.EnvironmentDetail, *common.Errors) {
+func (s *environmentService) EnvironmentList(tenantId string, ) ([]model.EnvironmentDetail, *common.Errors) {
 	var result []model.EnvironmentDetail
 	devices := deviceService.OptoSensorService.GetByTenant(tenantId)
 	for _, d := range devices {

+ 1 - 1
app/operation/service/garbageService.go

@@ -11,7 +11,7 @@ var GarbageService = new(garbageService)
 
 type garbageService struct{}
 
-func (s *garbageService) GarbageList(tenantId int) ([]model.GarbageDetail, *common.Errors) {
+func (s *garbageService) GarbageList(tenantId string, ) ([]model.GarbageDetail, *common.Errors) {
 	var result []model.GarbageDetail
 	devices, err := device.GarbageService.GetList(tenantId)
 	if err != nil {

+ 4 - 5
app/operation/service/lightingRateService.go

@@ -5,23 +5,22 @@ import (
 	"iot_manager_service/app/operation/edge_service"
 	"iot_manager_service/app/operation/model"
 	"iot_manager_service/util/common"
-	"strconv"
 )
 
 var LightingRateService = new(lightingRateService)
 
 type lightingRateService struct{}
 
-func (s lightingRateService) GetDayList(tenantId int, req model.RequestLightingRateFilter) ([]model.ResponseLightingRate, error) {
+func (s lightingRateService) GetDayList(tenantId string, req model.RequestLightingRateFilter) ([]model.ResponseLightingRate, error) {
 	return s.getData("day", tenantId, req)
 }
 
-func (s lightingRateService) GetMonthList(tenantId int, req model.RequestLightingRateFilter) ([]model.ResponseLightingRate, error) {
+func (s lightingRateService) GetMonthList(tenantId string, req model.RequestLightingRateFilter) ([]model.ResponseLightingRate, error) {
 	return s.getData("month", tenantId, req)
 }
 
 // 公用请求边缘端数据,月和日
-func (s lightingRateService) getData(method string, tenantId int, req model.RequestLightingRateFilter) ([]model.ResponseLightingRate, error) {
+func (s lightingRateService) getData(method string, tenantId string, req model.RequestLightingRateFilter) ([]model.ResponseLightingRate, error) {
 	lightControl := dao.Operation{
 		TenantId: tenantId,
 	}
@@ -49,7 +48,7 @@ func (s lightingRateService) getData(method string, tenantId int, req model.Requ
 	//亮灯率
 	forLightRate := edge_service.ForLightRate{}
 	lightRates, err := forLightRate.GetLightRate(edge_service.ForLightRateReq{
-		Tenant: strconv.Itoa(tenantId),
+		Tenant: tenantId,
 		Start:  req.StartTime,
 		End:    req.EndTime,
 		Flag:   flag2,

+ 1 - 1
app/security/service/securityService.go

@@ -11,7 +11,7 @@ var SecurityService = new(securityService)
 
 type securityService struct{}
 
-func (s *securityService) GetCameraLiveList(tenantId int) ([]model.CameraLiveDetail, *common.Errors) {
+func (s *securityService) GetCameraLiveList(tenantId string) ([]model.CameraLiveDetail, *common.Errors) {
 	groups, err := service.LampPoleGroupService.GetList(tenantId)
 	if err != nil {
 		return nil, nil

+ 2 - 2
app/system/controller/tenant.go

@@ -50,9 +50,9 @@ func (c *tenant) List(ctx *gin.Context) {
 		size = 10
 	}
 
-	tenantId := -1
+	tenantId := ""
 	if tId != "" {
-		tenantId, _ = strconv.Atoi(tId)
+		tenantId = (tId)
 	}
 
 	tenants, counts, err := service.TenantService.List(tenantId, tenantName, linkman, current, size)

+ 2 - 5
app/system/controller/token.go

@@ -11,7 +11,6 @@ import (
 	"iot_manager_service/app/system/service"
 	"iot_manager_service/util/cache"
 	"iot_manager_service/util/common"
-	"strconv"
 	"time"
 
 	"iot_manager_service/app/system/model"
@@ -43,11 +42,9 @@ func (c *auth) Token(ctx *gin.Context) {
 	// 校验连续登录失败次数
 	checkLock()
 
-	tId, _ := strconv.Atoi(tenantId)
-
 	userType := ctx.GetHeader(model.UserTypeHeaderKey)
 	token := model.Token{
-		TenantId:     tId,
+		TenantId:     tenantId,
 		UserName:     userName,
 		Password:     password,
 		GrantType:    grantType,
@@ -249,7 +246,7 @@ func judgeTenant(tenant *dao.Tenant) bool {
 	return true
 }
 
-func getAccessTokenKey(tenantId int, uId int64, random string) string {
+func getAccessTokenKey(tenantId string, uId int64, random string) string {
 	return fmt.Sprintf("access_token_%d_%d_%s", tenantId, uId, random)
 }
 

+ 1 - 1
app/system/dao/operationHisDao.go

@@ -14,7 +14,7 @@ type OperationHistory struct {
 	Result        int       `gorm:"type:int" json:"result"`           //0 成功 1失败
 	HandleUserId  int64     `gorm:"type:bigint" json:"handleUserId"`  //操作用户ID
 	HandleTime    time.Time `gorm:"type:timestamp" json:"handleTime"` //操作时间
-	TenantId      int       `gorm:"type:int" json:"tenantId"`         //租户ID
+	TenantId      string    `gorm:"type:varchar(12)" json:"tenantId"` //租户ID
 }
 
 func (OperationHistory) TableName() string {

+ 2 - 2
app/system/dao/tenant.go

@@ -8,7 +8,7 @@ import (
 // 租户
 type Tenant struct {
 	ID               int64     `gorm:"primary_key" json:"id"`                    //编号
-	TenantId         int       `gorm:"type:int" json:"tenantId"`                 //租户ID
+	TenantId         string    `gorm:"type:varchar(12)" json:"tenantId"`         //租户ID
 	TenantName       string    `gorm:"type:varchar(50)" json:"tenantName"`       //租户名称
 	Domain           string    `gorm:"type:varchar(255)" json:"domain"`          //域名地址
 	BackgroundUrl    string    `gorm:"type:varchar(1000)" json:"backgroundUrl"`  //系统背景
@@ -68,7 +68,7 @@ func (c *Tenant) GetTenants(offset, limit int) ([]Tenant, int64, error) {
 	var counts int64
 	db := Db.Debug().Model(&c)
 	db.Count(&counts)
-	if c.TenantId > 0 {
+	if c.TenantId == "" {
 		db = db.Where("tenant_id = ?", c.TenantId)
 	}
 	if c.TenantName != "" {

+ 1 - 1
app/system/dao/user.go

@@ -8,7 +8,7 @@ import (
 // User 用户
 type User struct {
 	ID                      int64     `gorm:"primary_key;type:bigint" json:"id"`                                  //编号
-	TenantId                int       `gorm:"type:int" json:"tenantId"`                                           //租户ID
+	TenantId                string    `gorm:"type:varchar(12)" json:"tenantId"`                                   //租户ID
 	Code                    string    `gorm:"type:varchar(12)" json:"code"`                                       //用户编号
 	Account                 string    `gorm:"type:varchar(45)" json:"account"`                                    //账号
 	Password                string    `gorm:"type:varchar(45)" json:"password"`                                   //密码

+ 1 - 1
app/system/model/tenant.go

@@ -3,7 +3,7 @@ package model
 import "iot_manager_service/app/system/dao"
 
 const (
-	AdminTenantId = 999999 //默认租户
+	AdminTenantId = "999999" //默认租户
 )
 
 type RsqTenantList struct {

+ 3 - 3
app/system/model/token.go

@@ -3,7 +3,7 @@ package model
 import "iot_manager_service/app/system/dao"
 
 type Token struct {
-	TenantId     int
+	TenantId     string
 	UserName     string
 	Password     string
 	GrantType    string
@@ -19,7 +19,7 @@ type UserInfo struct {
 }
 
 type RspToken struct {
-	TenantId     int    `json:"tenant_id"`
+	TenantId     string `json:"tenant_id"`
 	UserId       int64  `json:"user_id"`
 	RoleId       int64  `json:"role_id"`
 	OauthId      string `json:"oauth_id"`
@@ -41,7 +41,7 @@ type RspCaptcha struct {
 }
 
 type RspLogin struct {
-	ID            int    `json:"id"`
+	ID            string `json:"id"`
 	Name          string `json:"name"`
 	BackgroundUrl string `json:"backgroundUrl"`
 	SysLogoUrl    string `json:"sysLogoUrl"`

+ 4 - 4
app/system/service/dictService.go

@@ -47,18 +47,18 @@ func (s *dictService) GetByCode(code string) ([]dao.Dict, error) {
 	return dict.GetByCode()
 }
 
-func (s *dictService) GetControlType(tenantId int, id int) string {
+func (s *dictService) GetControlType(tenantId string, id int) string {
 	return s.GetCacheDict(fmt.Sprintf(ControlTypeKey, tenantId, id), ControlType, id)
 }
 
-func (s *dictService) GetModuleName(tenantId int, id int) string {
+func (s *dictService) GetModuleName(tenantId string, id int) string {
 	return s.GetCacheDict(fmt.Sprintf(ModuleTypeKey, tenantId, id), ModuleType, id)
 }
 
-func (s *dictService) GetSexName(tenantId int, id int) string {
+func (s *dictService) GetSexName(tenantId string, id int) string {
 	return s.GetCacheDict(fmt.Sprintf(SexNameKey, tenantId, id), Sex, id)
 }
 
-func (s *dictService) GetResolutionName(tenantId int, id int) string {
+func (s *dictService) GetResolutionName(tenantId string, id int) string {
 	return s.GetCacheDict(fmt.Sprintf(ResolutionTypeKey, tenantId, id), ResolutionType, id)
 }

+ 2 - 2
app/system/service/operationHisService.go

@@ -14,7 +14,7 @@ var OperationHisService = new(operationHisService)
 
 type operationHisService struct{}
 
-func (s *operationHisService) Save(userId int64, tenantId int, handleType, handleModuleType, deviceType int,
+func (s *operationHisService) Save(userId int64, tenantId string, handleType, handleModuleType, deviceType int,
 	handleObject string, handleResult int) {
 	operation := dao.OperationHistory{
 		OperationType: handleType,
@@ -32,7 +32,7 @@ func (s *operationHisService) Save(userId int64, tenantId int, handleType, handl
 	}
 }
 
-func (s *operationHisService) List(tenantId int, handleContent, operationType, moduleType string, current,
+func (s *operationHisService) List(tenantId string, handleContent, operationType, moduleType string, current,
 	size int) ([]model.OperationHisDetail, int64, *common.Errors) {
 	his := dao.OperationHistory{
 		Object: handleContent,

+ 1 - 1
app/system/service/roleService.go

@@ -120,7 +120,7 @@ func (s *roleService) Grant(req *model.ReqRoleGrant) error {
 
 const RoleNameKey = "%d:sys:role_name:%d"
 
-func (s *roleService) GetRoleName(tenantId int, roleId int64) string {
+func (s *roleService) GetRoleName(tenantId string, roleId int64) string {
 	var name string
 	key := fmt.Sprintf(RoleNameKey, tenantId, roleId)
 	name, err := cache.Redis.Get(key).Result()

+ 4 - 4
app/system/service/tenantService.go

@@ -25,7 +25,7 @@ func (s *tenantService) GetTenantByPasskey(passKey string) (*dao.Tenant, error)
 	return tenant, nil
 }
 
-func (s *tenantService) GetOne(tenantId int) (*dao.Tenant, error) {
+func (s *tenantService) GetOne(tenantId string) (*dao.Tenant, error) {
 	tenant := &dao.Tenant{
 		TenantId: tenantId,
 	}
@@ -58,11 +58,11 @@ func (s *tenantService) GetByDomain(domain string) (*dao.Tenant, error) {
 	return tenant, nil
 }
 
-func (s *tenantService) List(tenantId int, tenantName, linkman string, current, size int) ([]dao.Tenant, int64, error) {
+func (s *tenantService) List(tenantId string, tenantName, linkman string, current, size int) ([]dao.Tenant, int64, error) {
 	tenant := &dao.Tenant{}
 	offset := (current - 1) * size
 	limit := size
-	if tenantId > 0 {
+	if tenantId == "" {
 		tenant.TenantId = tenantId
 	}
 	if tenantName != "" {
@@ -124,7 +124,7 @@ func (s *tenantService) Remove(userId, id int64) *common.Errors {
 
 const TenantNameKey = "%d:sys:tenant_name:%d"
 
-func (s *tenantService) GetTenantName(tenantId int, id int) string {
+func (s *tenantService) GetTenantName(tenantId string, id string) string {
 	var name string
 	key := fmt.Sprintf(TenantNameKey, tenantId, id)
 	name, err := cache.Redis.Get(key).Result()

+ 4 - 4
app/system/service/userService.go

@@ -38,7 +38,7 @@ func (s *userService) Get(id int64) (*model.UserDetail, error) {
 	return detail, nil
 }
 
-func (s *userService) GetOneByTenantId(tenantId int) *dao.User {
+func (s *userService) GetOneByTenantId(tenantId string) *dao.User {
 	user := &dao.User{
 		TenantId: tenantId,
 	}
@@ -49,7 +49,7 @@ func (s *userService) GetOneByTenantId(tenantId int) *dao.User {
 	return user
 }
 
-func (s *userService) GetOne(tenantId int, account, password string) *dao.User {
+func (s *userService) GetOne(tenantId string, account, password string) *dao.User {
 	// 密码前端先MD5 后端再sha1加密
 	t := sha1.New()
 	_, _ = io.WriteString(t, password)
@@ -166,7 +166,7 @@ func (s *userService) Grant(userIds []string, roleIds string) error {
 
 const UserKey = "%d:sys:user:%d"
 
-func (s *userService) GetUserName(tenantId int, id int64) string {
+func (s *userService) GetUserName(tenantId string, id int64) string {
 	var name string
 	key := fmt.Sprintf(UserKey, tenantId, id)
 	name, err := cache.Redis.Get(key).Result()
@@ -187,7 +187,7 @@ func (s *userService) IsExist(user dao.User) bool {
 }
 
 // UpAvatar  上传头像
-func (s *userService) UpAvatar(tenantId int, userId int64, fileHeader *multipart.FileHeader) *model.Link {
+func (s *userService) UpAvatar(tenantId string, userId int64, fileHeader *multipart.FileHeader) *model.Link {
 	//检查是否已有头像,成功上传后将其删除
 	dao := &dao.User{TenantId: tenantId, ID: userId}
 	dao.GetAvatar()

+ 1 - 1
app/warn/dao/businessTacticsDao.go

@@ -15,7 +15,7 @@ type BusinessTactics struct {
 	MinValue     float64 `comment:"下限值" json:"minValue,omitempty"`
 	Duration     int     `comment:"持续时间" json:"duration,omitempty"`
 	IsEnable     int     `comment:"1-启用,2-禁用;默认启用" json:"isEnable,omitempty"`
-	TenantId     int     `comment:"租户ID" json:"tenantId,omitempty"`
+	TenantId     string  `gorm:"type:varchar(12)" comment:"租户ID" json:"tenantId,omitempty"`
 	ID           uint    `gorm:"primarykey" json:"id"`
 	CreatedAt    time.Time
 	UpdatedAt    time.Time

+ 1 - 1
app/warn/dao/viewAllCodeDao.go

@@ -17,7 +17,7 @@ type ViewsAllCode struct {
 	InstallTime    string
 	CreateTime     common.Time
 	IsDeleted      int
-	TenantId       int
+	TenantId       string
 }
 
 func (ViewsAllCode) TableName() string {

+ 3 - 3
app/warn/service/businessTacticsService.go

@@ -13,7 +13,7 @@ var BusinessTacticsService = new(businessTacticsService)
 
 type businessTacticsService struct{}
 
-func (s businessTacticsService) GetList(tenantId int, filter model.RequestBusinessTacticFilter) ([]dao.BusinessTactics, int64, error) {
+func (s businessTacticsService) GetList(tenantId string, filter model.RequestBusinessTacticFilter) ([]dao.BusinessTactics, int64, error) {
 	tactics := dao.BusinessTactics{TenantId: tenantId}
 	businessTactics, i, err := tactics.Gets(filter)
 	for i2, tactic := range businessTactics {
@@ -25,7 +25,7 @@ func (s businessTacticsService) GetList(tenantId int, filter model.RequestBusine
 	return businessTactics, i, err
 }
 
-func (s businessTacticsService) SaveOrUpdate(tenantId int, d model.RequestBusinessSubmit) error {
+func (s businessTacticsService) SaveOrUpdate(tenantId string, d model.RequestBusinessSubmit) error {
 	MaxValue, _ := strconv.ParseFloat(d.MaxValue, 64)
 	MinValue, _ := strconv.ParseFloat(d.MinValue, 64)
 	Duration, _ := strconv.Atoi(d.Duration)
@@ -51,7 +51,7 @@ func (s businessTacticsService) SaveOrUpdate(tenantId int, d model.RequestBusine
 	return err
 }
 
-func (s businessTacticsService) Remove(tenantId int, id int) error {
+func (s businessTacticsService) Remove(tenantId string, id int) error {
 	tactics := dao.BusinessTactics{TenantId: tenantId}
 	return tactics.Delete(id)
 }

+ 1 - 1
app/warn/service/noticeRecordService.go

@@ -9,7 +9,7 @@ var NoticeRecordService = new(noticeRecordService)
 
 type noticeRecordService struct{}
 
-func (s noticeRecordService) List(tenantId int, filter model.RequestNoticeRecordFilter) ([]model.ResposeNoticeRecordData, int64, error) {
+func (s noticeRecordService) List(tenantId string, filter model.RequestNoticeRecordFilter) ([]model.ResposeNoticeRecordData, int64, error) {
 	var list []model.ResposeNoticeRecordData
 	dao := dao.NoticeRecord{}
 	records, total, err := dao.GetList(filter)

+ 10 - 10
app/warn/service/noticeSetService.go

@@ -14,7 +14,7 @@ var NoticeSetService = new(noticeSetService)
 
 type noticeSetService struct{}
 
-func (s noticeSetService) GetList(tenantId int, searchValue string) ([]model.NoticeSetRecords, error) {
+func (s noticeSetService) GetList(tenantId string, searchValue string) ([]model.NoticeSetRecords, error) {
 	code := dao.ViewsAllCode{TenantId: tenantId}
 	deviceTypeGroups, _ := code.GetGroupByDeviceType(searchValue)
 	var deviceTypeGroupsNew []model.NoticeSetRecords
@@ -24,7 +24,7 @@ func (s noticeSetService) GetList(tenantId int, searchValue string) ([]model.Not
 		code.DeviceType = group.DeviceType
 		devices, _ := code.GetDatasByDeviceType(searchValue)
 		for _, device := range devices {
-			key := strconv.Itoa(tenantId) + strconv.Itoa(3) + strconv.Itoa(device.DeviceType) + strconv.Itoa(device.DeviceId)
+			key := tenantId + strconv.Itoa(3) + strconv.Itoa(device.DeviceType) + strconv.Itoa(device.DeviceId)
 			set := noteiceSets[key]
 			deviceNew = append(deviceNew, model.NoticeSetRecords{
 				Rtype:                   3,
@@ -40,7 +40,7 @@ func (s noticeSetService) GetList(tenantId int, searchValue string) ([]model.Not
 				BusinessUserIds:         set.BusinessUserIds,
 			})
 		}
-		key := strconv.Itoa(tenantId) + strconv.Itoa(2) + strconv.Itoa(group.DeviceType) + strconv.Itoa(999999)
+		key := (tenantId) + strconv.Itoa(2) + strconv.Itoa(group.DeviceType) + strconv.Itoa(999999)
 		set := noteiceSets[key]
 		deviceTypeGroupsNew = append(deviceTypeGroupsNew, model.NoticeSetRecords{
 			Rtype:                   2,
@@ -57,7 +57,7 @@ func (s noticeSetService) GetList(tenantId int, searchValue string) ([]model.Not
 			BusinessUserIds:         set.BusinessUserIds,
 		})
 	}
-	key := strconv.Itoa(tenantId) + strconv.Itoa(1) + strconv.Itoa(0) + strconv.Itoa(999999)
+	key := tenantId + strconv.Itoa(1) + strconv.Itoa(0) + strconv.Itoa(999999)
 	set := noteiceSets[key]
 	data := []model.NoticeSetRecords{
 		{
@@ -78,7 +78,7 @@ func (s noticeSetService) GetList(tenantId int, searchValue string) ([]model.Not
 	return data, nil
 }
 
-func (s noticeSetService) Update(post model.NoticeUpdateData, tenantId int) error {
+func (s noticeSetService) Update(post model.NoticeUpdateData, tenantId string) error {
 	rtype := post.Rtype
 	if rtype == 0 {
 		rtype = 1
@@ -88,7 +88,7 @@ func (s noticeSetService) Update(post model.NoticeUpdateData, tenantId int) erro
 		deviceId = post.DeviceID
 	}
 	set := dao.NoticeSet{
-		TenantId:                strconv.Itoa(tenantId),
+		TenantId:                tenantId,
 		DeviceType:              post.DeviceType,
 		DeviceId:                deviceId,
 		DeviceSn:                post.ID,
@@ -105,8 +105,8 @@ func (s noticeSetService) Update(post model.NoticeUpdateData, tenantId int) erro
 	return set.UpdateOrSave()
 }
 
-func (s noticeSetService) getNoteiceSets(tenantId int) map[string]dao.NoticeSet {
-	noticeSet := dao.NoticeSet{TenantId: strconv.Itoa(tenantId)}
+func (s noticeSetService) getNoteiceSets(tenantId string) map[string]dao.NoticeSet {
+	noticeSet := dao.NoticeSet{TenantId: tenantId}
 	list, _ := noticeSet.GetList()
 	news := make(map[string]dao.NoticeSet)
 	for _, set := range list {
@@ -169,8 +169,8 @@ func (s noticeSetService) getUserName(ids string) string {
 	return strings.Join(nameList, ",")
 }
 
-func (s noticeSetService) Remove(id string, tenantId int) error {
-	noticeSet := dao.NoticeSet{DeviceSn: id, TenantId: strconv.Itoa(tenantId)}
+func (s noticeSetService) Remove(id string, tenantId string) error {
+	noticeSet := dao.NoticeSet{DeviceSn: id, TenantId: tenantId}
 	return noticeSet.Delete()
 }
 

+ 7 - 8
app/warn/service/platformAlarmService.go

@@ -5,7 +5,6 @@ import (
 	edgeService "iot_manager_service/app/warn/edge_service"
 	"iot_manager_service/app/warn/model"
 	"iot_manager_service/util/common"
-	"strconv"
 	"time"
 )
 
@@ -14,10 +13,10 @@ var PlatformAlarmService = new(platformAlarmService)
 type platformAlarmService struct{}
 
 // GetList 报警列表
-func (s platformAlarmService) GetList(tenantId int, filter model.RequestPlatFormAlartFilter) ([]model.PlatFormAlartData, int64, error) {
+func (s platformAlarmService) GetList(tenantId string, filter model.RequestPlatFormAlartFilter) ([]model.PlatFormAlartData, int64, error) {
 	var list []model.PlatFormAlartData
 	dao := dao.PlatformAlarm{
-		TenantId: strconv.Itoa(tenantId),
+		TenantId: tenantId,
 	}
 	levelArr := make(map[int]string)
 	levelArr[1] = "紧急"
@@ -46,7 +45,7 @@ func (s platformAlarmService) GetList(tenantId int, filter model.RequestPlatForm
 }
 
 // Refresh 同步边缘接口报警数据
-func (s platformAlarmService) Refresh(tenantId int) error {
+func (s platformAlarmService) Refresh(tenantId string) error {
 	viewDao := dao.ViewsAllCode{TenantId: tenantId}
 	alls, err := viewDao.GetAlls()
 	if err != nil {
@@ -75,7 +74,7 @@ func (s platformAlarmService) Refresh(tenantId int) error {
 		}
 		alarms = append(alarms, dao.PlatformAlarm{
 			ID:                data.ID,
-			TenantId:          strconv.Itoa(tenantId),
+			TenantId:          tenantId,
 			ArmDeviceType:     viewInfo.DeviceType,
 			ArmDeviceTypeName: viewInfo.DeviceTypeName,
 			ArmDeviceId:       viewInfo.DeviceId,
@@ -104,7 +103,7 @@ func (s platformAlarmService) Refresh(tenantId int) error {
 }
 
 // HandleAlarm 告警处理
-func (s platformAlarmService) HandleAlarm(tenant_id int, id int, armHandle int, remark string) error {
+func (s platformAlarmService) HandleAlarm(tenant_id string, id int, armHandle int, remark string) error {
 	dao := dao.PlatformAlarm{
 		ID:             id,
 		ArmHandle:      armHandle,
@@ -115,8 +114,8 @@ func (s platformAlarmService) HandleAlarm(tenant_id int, id int, armHandle int,
 }
 
 // GetWarnCount 根据设备类型 取
-func (s platformAlarmService) GetWarnCount(tenantId int, deviceType int) (int64, error) {
-	alarm := dao.PlatformAlarm{TenantId: strconv.Itoa(tenantId), ArmDeviceType: deviceType}
+func (s platformAlarmService) GetWarnCount(tenantId string, deviceType int) (int64, error) {
+	alarm := dao.PlatformAlarm{TenantId: tenantId, ArmDeviceType: deviceType}
 	return alarm.GetWarnCount()
 }
 

+ 1 - 1
build.bat

@@ -1,3 +1,3 @@
 set GOARCH=amd64
 set GOOS=linux
-go build -o build/iot_service ./
+go build -o build/iot_svr ./

+ 0 - 0
config/config.yaml


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác