Merge branch 'dev' into v1.18
This commit is contained in:
commit
dee938d998
@ -8,7 +8,7 @@ import io.dataease.commons.utils.LogUtil;
|
||||
|
||||
public class PriorityThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
|
||||
public static AtomicInteger globaInteger = new AtomicInteger(1);
|
||||
public static AtomicInteger globalInteger = new AtomicInteger(1);
|
||||
|
||||
private ThreadLocal<Integer> local = new ThreadLocal<Integer>() {
|
||||
@Override
|
||||
@ -42,7 +42,7 @@ public class PriorityThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
|
||||
@Override
|
||||
public void execute(Runnable command) {
|
||||
int andIncrement = globaInteger.getAndIncrement();
|
||||
int andIncrement = globalInteger.getAndIncrement();
|
||||
Integer theadInteger = local.get();
|
||||
try {
|
||||
if (theadInteger == 0) {
|
||||
|
||||
@ -7,6 +7,7 @@ import io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs;
|
||||
import io.dataease.service.panel.PanelAppTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -36,6 +37,7 @@ public class PanelAppTemplateController {
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save")
|
||||
@I18n
|
||||
@RequiresPermissions("appLog:edit")
|
||||
public void save(@RequestBody PanelAppTemplateRequest request) {
|
||||
panelAppTemplateService.save(request);
|
||||
}
|
||||
@ -43,6 +45,7 @@ public class PanelAppTemplateController {
|
||||
@ApiOperation("更新")
|
||||
@PostMapping("/update")
|
||||
@I18n
|
||||
@RequiresPermissions("appLog:edit")
|
||||
public void update(@RequestBody PanelAppTemplateRequest request) {
|
||||
panelAppTemplateService.update(request);
|
||||
}
|
||||
@ -50,6 +53,7 @@ public class PanelAppTemplateController {
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/delete/{appTemplateId}")
|
||||
@I18n
|
||||
@RequiresPermissions("appLog:del")
|
||||
public void delete(@PathVariable String appTemplateId) {
|
||||
panelAppTemplateService.delete(appTemplateId);
|
||||
}
|
||||
@ -64,6 +68,7 @@ public class PanelAppTemplateController {
|
||||
@ApiOperation("移动")
|
||||
@PostMapping("/move")
|
||||
@I18n
|
||||
@RequiresPermissions("appLog:edit")
|
||||
public void move(@RequestBody PanelAppTemplateRequest request) {
|
||||
panelAppTemplateService.move(request);
|
||||
}
|
||||
|
||||
@ -89,15 +89,24 @@ public class PanelGroupController {
|
||||
|
||||
@ApiOperation("更新")
|
||||
@PostMapping("/update")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id"),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@I18n
|
||||
public PanelGroupDTO update(@RequestBody PanelGroupRequest request) {
|
||||
return panelGroupService.update(request);
|
||||
}
|
||||
|
||||
@ApiOperation("移动")
|
||||
@PostMapping("/move")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
@I18n
|
||||
public PanelGroupDTO move(@RequestBody PanelGroupRequest request) {
|
||||
return panelGroupService.update(request);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@PostMapping("/deleteCircle/{id}")
|
||||
|
||||
@ -4,31 +4,28 @@ import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.auth.annotation.DeLog;
|
||||
import io.dataease.auth.annotation.DePermission;
|
||||
import io.dataease.auth.annotation.SqlInjectValidator;
|
||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||
import io.dataease.auth.entity.AccountLockStatus;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.commons.constants.DePermissionType;
|
||||
import io.dataease.commons.constants.ResourceAuthLevel;
|
||||
import io.dataease.commons.constants.SysLogConstants;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.controller.sys.request.KeyGridRequest;
|
||||
import io.dataease.controller.sys.response.AuthBindDTO;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.base.domain.SysRole;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.commons.utils.PageUtils;
|
||||
import io.dataease.commons.utils.Pager;
|
||||
import io.dataease.controller.response.ExistLdapUser;
|
||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||
import io.dataease.controller.sys.request.KeyGridRequest;
|
||||
import io.dataease.controller.sys.request.SysUserCreateRequest;
|
||||
import io.dataease.controller.sys.request.SysUserPwdRequest;
|
||||
import io.dataease.controller.sys.request.SysUserStateRequest;
|
||||
import io.dataease.controller.sys.response.AuthBindDTO;
|
||||
import io.dataease.controller.sys.response.RoleUserItem;
|
||||
import io.dataease.controller.sys.response.SysUserGridResponse;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.base.domain.SysRole;
|
||||
import io.dataease.plugins.common.base.domain.SysUser;
|
||||
import io.dataease.plugins.common.base.domain.SysUserAssist;
|
||||
import io.dataease.service.sys.SysRoleService;
|
||||
@ -37,7 +34,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@ -87,27 +84,22 @@ public class SysUserController {
|
||||
users.forEach(user -> {
|
||||
AccountLockStatus accountLockStatus = authUserService.lockStatus(user.getUsername(), user.getFrom());
|
||||
user.setLocked(accountLockStatus.getLocked());
|
||||
user.setPassword(null);
|
||||
});
|
||||
return PageUtils.setPageInfo(page, users);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
|
||||
@PostMapping("/userGrid/{datasetId}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType = "path", name = "goPage", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(paramType = "path", name = "pageSize", value = "页容量", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "request", value = "查询条件", required = true)
|
||||
})
|
||||
public Pager<List<SysUserGridResponse>> userGrids(@PathVariable String datasetId, @RequestBody KeyGridRequest request) {
|
||||
return userGrid(0, 0, request);
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@PostMapping("/userLists")
|
||||
@SqlInjectValidator({"nick_name", "create_time"})
|
||||
public List<SysUserGridResponse> userLists(@RequestBody BaseGridRequest request) {
|
||||
KeyGridRequest keyGridRequest = BeanUtils.copyBean(new KeyGridRequest(), request);
|
||||
return sysUserService.query(keyGridRequest);
|
||||
List<SysUserGridResponse> users = sysUserService.query(keyGridRequest);
|
||||
if (CollectionUtils.isEmpty(users)) return users;
|
||||
users.forEach(user -> {
|
||||
user.setPassword(null);
|
||||
});
|
||||
return users;
|
||||
}
|
||||
|
||||
@ApiOperation("创建用户")
|
||||
@ -227,7 +219,7 @@ public class SysUserController {
|
||||
@ApiImplicitParam(paramType = "path", name = "pageSize", value = "页容量", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "request", value = "查询条件", required = true)
|
||||
})
|
||||
@SqlInjectValidator({"create_time", "update_time"})
|
||||
@SqlInjectValidator({"create_time", "update_time"})
|
||||
public Pager<List<SysRole>> roleGrid(@PathVariable int goPage, @PathVariable int pageSize,
|
||||
@RequestBody BaseGridRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
|
||||
@ -6,19 +6,19 @@ import io.dataease.auth.entity.TokenInfo;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.auth.util.JWTUtils;
|
||||
import io.dataease.commons.constants.SysLogConstants;
|
||||
import io.dataease.commons.utils.CodingUtil;
|
||||
import io.dataease.commons.utils.DeLogUtils;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.commons.utils.ServletUtils;
|
||||
|
||||
import io.dataease.controller.ResultHolder;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.service.sys.SysUserService;
|
||||
import io.dataease.service.system.SystemParameterService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jasig.cas.client.authentication.AttributePrincipal;
|
||||
import org.jasig.cas.client.util.AssertionHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -33,12 +33,16 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
@ApiIgnore
|
||||
@RequestMapping("/cas")
|
||||
@Controller
|
||||
public class CasServer {
|
||||
|
||||
@Value("#{'${dataease.cas-admin-users:admin}'.split(',')}")
|
||||
private List<String> adminUserList;
|
||||
|
||||
@Autowired
|
||||
private AuthUserService authUserService;
|
||||
|
||||
@ -55,9 +59,14 @@ public class CasServer {
|
||||
|
||||
AttributePrincipal principal = AssertionHolder.getAssertion().getPrincipal();
|
||||
String name = principal.getName();
|
||||
SysUserEntity sysUserEntity = null;
|
||||
try {
|
||||
SysUserEntity sysUserEntity = authUserService.getCasUserByName(name);
|
||||
if(null == sysUserEntity){
|
||||
if (CollectionUtils.isNotEmpty(adminUserList) && adminUserList.contains(name)) {
|
||||
sysUserEntity = authUserService.getUserById(1L);
|
||||
} else {
|
||||
sysUserEntity = authUserService.getCasUserByName(name);
|
||||
}
|
||||
if (null == sysUserEntity) {
|
||||
String s = RandomUtil.randomString(6);
|
||||
String email = s + "@xxx.com";
|
||||
sysUserService.validateCasUser(name);
|
||||
@ -68,11 +77,12 @@ public class CasServer {
|
||||
TokenInfo tokenInfo = TokenInfo.builder().userId(sysUserEntity.getUserId()).username(sysUserEntity.getUsername()).build();
|
||||
String token = JWTUtils.sign(tokenInfo, realPwd);
|
||||
ServletUtils.setToken(token);
|
||||
Cookie cookie_token = new Cookie("Authorization", token);cookie_token.setPath("/");
|
||||
Cookie cookie_token = new Cookie("Authorization", token);
|
||||
cookie_token.setPath("/");
|
||||
response.addCookie(cookie_token);
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.LOGIN, SysLogConstants.SOURCE_TYPE.USER, sysUserEntity.getUserId(), null, null, null);
|
||||
|
||||
}catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
|
||||
String msg = e.getMessage();
|
||||
if (null != e.getCause()) {
|
||||
@ -109,7 +119,7 @@ public class CasServer {
|
||||
ResultHolder success = ResultHolder.success(null);
|
||||
success.setMessage(Translator.get("i18n_default_login_reset"));
|
||||
return success;
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
ResultHolder error = ResultHolder.error(e.getMessage());
|
||||
return error;
|
||||
|
||||
@ -66,8 +66,8 @@ public class XDeptServer {
|
||||
@PostMapping("/search")
|
||||
public List<DeptNodeResponse> search(@RequestBody XpackGridRequest request){
|
||||
DeptXpackService deptService = SpringContextUtil.getBean(DeptXpackService.class);
|
||||
List<XpackSysDept> ndoes = deptService.nodesTreeByCondition(request);
|
||||
List<DeptNodeResponse> nodeResponses = ndoes.stream().map(node -> {
|
||||
List<XpackSysDept> nodes = deptService.nodesTreeByCondition(request);
|
||||
List<DeptNodeResponse> nodeResponses = nodes.stream().map(node -> {
|
||||
DeptNodeResponse deptNodeResponse = BeanUtils.copyBean(new DeptNodeResponse(), node);
|
||||
deptNodeResponse.setHasChildren(node.getSubCount() > 0);
|
||||
deptNodeResponse.setLeaf(node.getSubCount() == 0);
|
||||
|
||||
@ -1121,7 +1121,7 @@ public class EsQueryProvider extends QueryProvider {
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "like")) {
|
||||
String keyword = value.get(0).toUpperCase();
|
||||
whereValue = "'%" + keyword + "%'";
|
||||
whereName = "upper(" + whereName + ")";
|
||||
whereName = "UCASE(" + whereName + ")";
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
|
||||
if (request.getDatasetTableField().getDeType() == 1) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
|
||||
@ -398,8 +398,8 @@ public class ShareService {
|
||||
return;
|
||||
}
|
||||
panelShareOutDTOS.forEach(shareOut -> {
|
||||
SysLogConstants.SOURCE_TYPE buiType = buiType(shareOut.getType());
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.UNSHARE, SysLogConstants.SOURCE_TYPE.PANEL, panelId, panelGroup.getPid(), shareOut.getTargetId(), buiType);
|
||||
SysLogConstants.SOURCE_TYPE busiType = busiType(shareOut.getType());
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.UNSHARE, SysLogConstants.SOURCE_TYPE.PANEL, panelId, panelGroup.getPid(), shareOut.getTargetId(), busiType);
|
||||
});
|
||||
|
||||
Map<Integer, List<PanelShareOutDTO>> listMap = panelShareOutDTOS.stream().collect(Collectors.groupingBy(dto -> dto.getType()));
|
||||
@ -426,7 +426,7 @@ public class ShareService {
|
||||
}
|
||||
}
|
||||
|
||||
private SysLogConstants.SOURCE_TYPE buiType(Integer type) {
|
||||
private SysLogConstants.SOURCE_TYPE busiType(Integer type) {
|
||||
SysLogConstants.SOURCE_TYPE targetType = SysLogConstants.SOURCE_TYPE.USER;
|
||||
if (type == 1) {
|
||||
targetType = SysLogConstants.SOURCE_TYPE.ROLE;
|
||||
@ -443,7 +443,7 @@ public class ShareService {
|
||||
|
||||
extPanelShareMapper.removeShares(removeRequest);
|
||||
|
||||
SysLogConstants.SOURCE_TYPE targetType = buiType(removeRequest.getType());
|
||||
SysLogConstants.SOURCE_TYPE targetType = busiType(removeRequest.getType());
|
||||
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.UNSHARE, SysLogConstants.SOURCE_TYPE.PANEL, panelId, panelGroup.getPid(), removeRequest.getTargetId(), targetType);
|
||||
|
||||
|
||||
@ -200,7 +200,7 @@ export function mappingFieldValues(data) {
|
||||
return request({
|
||||
url: '/dataset/field/mappingFieldValues',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
loading: false,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@ -85,6 +85,15 @@ export function panelUpdate(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function panelMove(data) {
|
||||
return request({
|
||||
url: 'panel/group/move',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function findOne(id) {
|
||||
return request({
|
||||
url: 'panel/group/findOne/' + id,
|
||||
|
||||
@ -365,6 +365,7 @@ export default {
|
||||
.main_view {
|
||||
position: relative;
|
||||
background-size: 100% 100% !important;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.component {
|
||||
|
||||
@ -41,8 +41,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const MIN_NUMBER = -2147483648
|
||||
const MAX_NUMBER = 2147483647
|
||||
const MIN_NUMBER = Number.MIN_SAFE_INTEGER
|
||||
const MAX_NUMBER = Number.MAX_SAFE_INTEGER
|
||||
import bus from '@/utils/bus'
|
||||
export default {
|
||||
|
||||
|
||||
@ -800,4 +800,16 @@ export default {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
::v-deep .el-tabs__nav-wrap.is-scrollable {
|
||||
padding: 0 45px!important;
|
||||
}
|
||||
|
||||
::v-deep .el-tabs__nav-prev {
|
||||
left: 25px!important
|
||||
}
|
||||
|
||||
::v-deep .el-tabs__nav-next {
|
||||
right: 25px!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -2451,7 +2451,7 @@ export default {
|
||||
add_condition: 'Add condition',
|
||||
add_relationship: 'Add relationship',
|
||||
filter_fields: 'Filter fields',
|
||||
selct_filter_fields: 'Please select a filter field',
|
||||
select_filter_fields: 'Please select a filter field',
|
||||
enter_keywords: 'Please enter keywords',
|
||||
screen_method: 'Screening method',
|
||||
select: 'Please select',
|
||||
|
||||
@ -2445,7 +2445,7 @@ export default {
|
||||
add_condition: '添加條件',
|
||||
add_relationship: '添加關系',
|
||||
filter_fields: '篩選字段',
|
||||
selct_filter_fields: '請選擇篩選字段',
|
||||
select_filter_fields: '請選擇篩選字段',
|
||||
enter_keywords: '請輸關鍵字',
|
||||
screen_method: '篩選方式',
|
||||
select: '請選擇',
|
||||
|
||||
@ -2460,7 +2460,7 @@ export default {
|
||||
add_condition: '添加条件',
|
||||
add_relationship: '添加关系',
|
||||
filter_fields: '筛选字段',
|
||||
selct_filter_fields: '请选择筛选字段',
|
||||
select_filter_fields: '请选择筛选字段',
|
||||
enter_keywords: '请输关键字',
|
||||
screen_method: '筛选方式',
|
||||
select: '请选择',
|
||||
|
||||
@ -37,6 +37,7 @@ export function baseFlowMapOption(chartDom, chartId, chart, action) {
|
||||
}
|
||||
}
|
||||
if (xAxis?.length < 2 || xAxisExt?.length < 2) {
|
||||
chartDom.removeAllLayer()
|
||||
return chartDom
|
||||
}
|
||||
chartDom.removeAllLayer()
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<el-input
|
||||
v-model="item.name"
|
||||
class="w100"
|
||||
:placeholder="$t('auth.selct_filter_fields')"
|
||||
:placeholder="$t('auth.select_filter_fields')"
|
||||
size="mini"
|
||||
@input="cancel"
|
||||
/>
|
||||
|
||||
@ -449,7 +449,7 @@ import {
|
||||
defaultTree,
|
||||
delGroup,
|
||||
groupTree,
|
||||
initPanelData,
|
||||
initPanelData, panelMove,
|
||||
panelToTop,
|
||||
panelUpdate,
|
||||
viewPanelLog
|
||||
@ -1116,7 +1116,7 @@ export default {
|
||||
saveMoveGroup() {
|
||||
this.moveInfo.pid = this.tGroup.id
|
||||
this.moveInfo['optType'] = 'move'
|
||||
panelUpdate(this.moveInfo).then((response) => {
|
||||
panelMove(this.moveInfo).then((response) => {
|
||||
updateCacheTree('move', 'panel-main-tree', response.data, this.tData)
|
||||
this.closeMoveGroup()
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user