|
@@ -499,6 +499,7 @@ func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool,
|
|
|
// 操作记录
|
|
|
dataPermissionMoveRecordList := make([]*data_manage_permission.DataPermissionMoveRecord, 0)
|
|
|
uniqueCode := uuid.NewUUID().Hex32()
|
|
|
+ title := `资产转移`
|
|
|
content := `资产转入`
|
|
|
|
|
|
switch source {
|
|
@@ -701,7 +702,7 @@ func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool,
|
|
|
DataPermissionMessageId: 0,
|
|
|
SendUserId: int32(opUserId),
|
|
|
ReceiveUserId: int32(adminInfo.AdminId),
|
|
|
- Content: content,
|
|
|
+ Content: title,
|
|
|
Remark: content,
|
|
|
OpType: 1,
|
|
|
Source: int32(source),
|
|
@@ -732,7 +733,7 @@ func MoveEdbChart(source, subSource, oldUserId, newUserId int, isSelectAll bool,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// MoveAllEdbChart
|
|
|
+// MoveAllEdbChartOld
|
|
|
// @Description: 通过原创建人转移指标/图表创建人
|
|
|
// @author: Roc
|
|
|
// @datetime 2024-03-26 15:11:12
|
|
@@ -751,6 +752,7 @@ func MoveAllEdbChartOld(sourceList, oldUserIdList []int, userId, opUserId int) (
|
|
|
// 操作记录
|
|
|
dataPermissionMoveRecordList := make([]*data_manage_permission.DataPermissionMoveRecord, 0)
|
|
|
uniqueCode := uuid.NewUUID().Hex32()
|
|
|
+ title := `资产转移`
|
|
|
content := `资产转入`
|
|
|
sourceStrList := make([]string, 0)
|
|
|
|
|
@@ -954,7 +956,7 @@ func MoveAllEdbChartOld(sourceList, oldUserIdList []int, userId, opUserId int) (
|
|
|
DataPermissionMessageId: 0,
|
|
|
SendUserId: int32(opUserId),
|
|
|
ReceiveUserId: int32(adminInfo.AdminId),
|
|
|
- Content: content,
|
|
|
+ Content: title,
|
|
|
Remark: content,
|
|
|
OpType: 2,
|
|
|
OpUniqueCode: uniqueCode,
|
|
@@ -1002,6 +1004,7 @@ func MoveAllEdbChart(sourceList, oldUserIdList []int, userId, opUserId int) (err
|
|
|
// 操作记录
|
|
|
dataPermissionMoveRecordList := make([]*data_manage_permission.DataPermissionMoveRecord, 0)
|
|
|
uniqueCode := uuid.NewUUID().Hex32()
|
|
|
+ title := `资产转移`
|
|
|
content := `资产转入`
|
|
|
sourceStrList := make([]string, 0)
|
|
|
|
|
@@ -1203,7 +1206,7 @@ func MoveAllEdbChart(sourceList, oldUserIdList []int, userId, opUserId int) (err
|
|
|
DataPermissionMessageId: 0,
|
|
|
SendUserId: int32(opUserId),
|
|
|
ReceiveUserId: int32(adminInfo.AdminId),
|
|
|
- Content: content,
|
|
|
+ Content: title,
|
|
|
Remark: content,
|
|
|
OpType: 2,
|
|
|
OpUniqueCode: uniqueCode,
|
|
@@ -1233,8 +1236,9 @@ func MoveAllEdbChart(sourceList, oldUserIdList []int, userId, opUserId int) (err
|
|
|
}
|
|
|
|
|
|
// GetMoveEdbChartCount 获取待转移的指标/图表列表
|
|
|
-// @param source 来源 :1:手工数据指标 2:钢联化工数据库 3:ETA指标库 4:ETA预测指标 5:图库 6:ETA表格
|
|
|
-func GetMoveEdbChartCount(userId int) (sourceMap map[int]int, err error) {
|
|
|
+// @param userId 用户
|
|
|
+// @param countType 来源 :1:设置资产权限;2:设置数据权限
|
|
|
+func GetMoveEdbChartCount(userId, countType int) (sourceMap map[int]int, err error) {
|
|
|
sourceMap = make(map[int]int)
|
|
|
{
|
|
|
// 手工数据指标
|
|
@@ -1271,23 +1275,6 @@ func GetMoveEdbChartCount(userId int) (sourceMap map[int]int, err error) {
|
|
|
sourceMap[2] = total
|
|
|
}
|
|
|
|
|
|
- {
|
|
|
- // 钢联化工数据库
|
|
|
- var condition string
|
|
|
- var pars []interface{}
|
|
|
- if userId > 0 {
|
|
|
- condition += ` AND sys_user_id = ? `
|
|
|
- pars = append(pars, userId)
|
|
|
- }
|
|
|
-
|
|
|
- total, tmpErr := data_manage.GetMysteelChemicalIndexCount(condition, pars)
|
|
|
- if tmpErr != nil {
|
|
|
- err = tmpErr
|
|
|
- return
|
|
|
- }
|
|
|
- sourceMap[2] = total
|
|
|
- }
|
|
|
-
|
|
|
{
|
|
|
// ETA指标库
|
|
|
var condition string
|
|
@@ -1352,11 +1339,20 @@ func GetMoveEdbChartCount(userId int) (sourceMap map[int]int, err error) {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
|
|
|
+ condition += ` AND is_delete = 0 `
|
|
|
+
|
|
|
if userId > 0 {
|
|
|
condition += ` AND sys_user_id = ? `
|
|
|
pars = append(pars, userId)
|
|
|
}
|
|
|
|
|
|
+ switch countType {
|
|
|
+ case 2:
|
|
|
+ condition += ` AND source in (2,3) `
|
|
|
+ default:
|
|
|
+ condition += ` AND source in (2,3,4) `
|
|
|
+ }
|
|
|
+
|
|
|
total, tmpErr := excel.GetExcelInfoCountByCondition(condition, pars)
|
|
|
if tmpErr != nil {
|
|
|
err = tmpErr
|