|
|
@@ -2,6 +2,7 @@ package com.usoftchina.bi.server.service.user;
|
|
|
|
|
|
import com.usoftchina.bi.core.base.BaseContextHolder;
|
|
|
import com.usoftchina.bi.server.dao.user.UserPowerMapper;
|
|
|
+import com.usoftchina.bi.server.model.vo.configVo.BatchUserPowerInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.configVo.UserPowerInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.dataVo.DashboardPowerDTO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -44,4 +45,27 @@ public class UserPowerService {
|
|
|
userPowerMapper.delete(userPowerInfo);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量更新权限
|
|
|
+ * @param batchUserPowerInfo
|
|
|
+ */
|
|
|
+ public void batchAdd(BatchUserPowerInfo batchUserPowerInfo) {
|
|
|
+ String[] ids = batchUserPowerInfo.getDashboardIds().split(",");
|
|
|
+ if (batchUserPowerInfo.getType() == 0) {
|
|
|
+ userPowerMapper.deleteByUserGroupId(batchUserPowerInfo.getDashboardIds(),batchUserPowerInfo.getBizId());
|
|
|
+ userPowerMapper.insertByUserGroupId(ids, batchUserPowerInfo.getBizId());
|
|
|
+ }else {
|
|
|
+ userPowerMapper.deleteByUserId(batchUserPowerInfo.getDashboardIds(), batchUserPowerInfo.getBizId());
|
|
|
+ userPowerMapper.insertByUserId(ids, batchUserPowerInfo.getBizId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void batchDelete(BatchUserPowerInfo batchUserPowerInfo){
|
|
|
+ if (batchUserPowerInfo.getType() == 0) {
|
|
|
+ userPowerMapper.deleteByUserGroupId(batchUserPowerInfo.getDashboardIds(),batchUserPowerInfo.getBizId());
|
|
|
+ }else {
|
|
|
+ userPowerMapper.deleteByUserId(batchUserPowerInfo.getDashboardIds(), batchUserPowerInfo.getBizId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|