Merge branch 'dev' into pr@dev_st_fix
This commit is contained in:
commit
579890279c
@ -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) {
|
||||
|
||||
@ -15,6 +15,7 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
|
||||
@ -24,7 +25,7 @@ public class ExcelUtils {
|
||||
|
||||
public static File exportExcel(List<ExcelSheetModel> sheets, String fileName, String folderId) throws Exception {
|
||||
AtomicReference<String> realFileName = new AtomicReference<>(fileName);
|
||||
Workbook wb = new XSSFWorkbook();
|
||||
Workbook wb = new SXSSFWorkbook();
|
||||
|
||||
sheets.forEach(sheet -> {
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import org.apache.poi.hssf.eventusermodel.*;
|
||||
import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord;
|
||||
import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyRecord;
|
||||
import org.apache.poi.hssf.record.*;
|
||||
import org.apache.poi.hssf.record.Record;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDataFormatter;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -781,7 +781,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
case StarRocks:
|
||||
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
||||
mysqlConfiguration.getJdbc();
|
||||
if(!mysqlConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$")){
|
||||
if(!mysqlConfiguration.getDataBase().matches("^[0-9a-zA-Z_-]{1,}$")){
|
||||
throw new Exception("Invalid database name");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -8,7 +8,9 @@ import io.dataease.plugins.common.base.domain.Datasource;
|
||||
import io.dataease.plugins.common.base.mapper.DatasetTableFieldMapper;
|
||||
import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.DorisConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.MySQLConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.SQLConstants;
|
||||
import io.dataease.plugins.common.constants.engine.MysqlConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartCustomFilterItemDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
@ -1074,11 +1076,20 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
if (field.getDeType() == 1) {
|
||||
String format = transDateFormat(request.getDateStyle(), request.getDatePattern());
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||
whereName = String.format(DorisConstants.STR_TO_DATE, originName, format);
|
||||
String date = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
if(request.getOperator().equals("between")){
|
||||
whereName = date;
|
||||
}else {
|
||||
whereName = String.format(MySQLConstants.DATE_FORMAT, date, format);
|
||||
}
|
||||
}
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, format);
|
||||
if(request.getOperator().equals("between")){
|
||||
whereName = originName;
|
||||
}else {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, format);
|
||||
}
|
||||
}
|
||||
} else if (field.getDeType() == 0) {
|
||||
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
|
||||
|
||||
@ -7,6 +7,8 @@ import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
|
||||
import io.dataease.plugins.common.base.domain.Datasource;
|
||||
import io.dataease.plugins.common.base.mapper.DatasetTableFieldMapper;
|
||||
import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.DorisConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.MySQLConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.SQLConstants;
|
||||
import io.dataease.plugins.common.constants.engine.MysqlConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartCustomFilterItemDTO;
|
||||
@ -1061,10 +1063,20 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
if (field.getDeType() == 1) {
|
||||
String format = transDateFormat(request.getDateStyle(), request.getDatePattern());
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||
whereName = String.format(MysqlConstants.DATE_FORMAT, originName, format);
|
||||
String date = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
if(request.getOperator().equals("between")){
|
||||
whereName = date;
|
||||
}else {
|
||||
whereName = String.format(MySQLConstants.DATE_FORMAT, date, format);
|
||||
}
|
||||
}
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
whereName = originName;
|
||||
if(request.getOperator().equals("between")){
|
||||
whereName = originName;
|
||||
}else {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, format);
|
||||
}
|
||||
}
|
||||
} else if (field.getDeType() == 0 && field.getDeExtractType() == 0) {
|
||||
whereName = String.format(MysqlConstants.CAST, originName, MysqlConstants.CHAR);
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -67,6 +67,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -2964,7 +2965,7 @@ public class DataSetTableService {
|
||||
details.add(row);
|
||||
}
|
||||
// 操作Excel
|
||||
Workbook wb = new XSSFWorkbook();
|
||||
Workbook wb = new SXSSFWorkbook();
|
||||
// Sheet
|
||||
Sheet detailsSheet = wb.createSheet("数据");
|
||||
//给单元格设置样式
|
||||
|
||||
@ -225,8 +225,11 @@ public class EngineService {
|
||||
;
|
||||
mysqlConfiguration.setHost(matcher.group(1));
|
||||
mysqlConfiguration.setPort(Integer.valueOf(matcher.group(2)));
|
||||
mysqlConfiguration.setDataBase(matcher.group(3).split("\\?")[0]);
|
||||
mysqlConfiguration.setExtraParams(matcher.group(3).split("\\?")[1]);
|
||||
String[] databasePrams = matcher.group(3).split("\\?");
|
||||
mysqlConfiguration.setDataBase(databasePrams[0]);
|
||||
if(databasePrams.length == 2){
|
||||
mysqlConfiguration.setExtraParams(databasePrams[1]);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(mysqlConfiguration.getExtraParams()) && !mysqlConfiguration.getExtraParams().contains("connectionCollation")){
|
||||
mysqlConfiguration.setExtraParams(mysqlConfiguration.getExtraParams() + "&connectionCollation=utf8mb4_general_ci");
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.pentaho.di.core.util.UUIDUtil;
|
||||
import org.slf4j.Logger;
|
||||
@ -660,7 +661,7 @@ public class PanelGroupService {
|
||||
Integer[] excelTypes = request.getExcelTypes();
|
||||
details.add(0, request.getHeader());
|
||||
|
||||
Workbook wb = new XSSFWorkbook();
|
||||
Workbook wb = new SXSSFWorkbook();
|
||||
//明细sheet
|
||||
Sheet detailsSheet = wb.createSheet("数据");
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -27,9 +27,8 @@ import io.dataease.service.system.SystemParameterService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -384,13 +383,13 @@ public class LogService {
|
||||
details.add(0, headArr);
|
||||
|
||||
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
Workbook wb = new SXSSFWorkbook();
|
||||
//明细sheet
|
||||
XSSFSheet detailsSheet = wb.createSheet("数据");
|
||||
Sheet detailsSheet = wb.createSheet("数据");
|
||||
|
||||
//给单元格设置样式
|
||||
XSSFCellStyle cellStyle = wb.createCellStyle();
|
||||
XSSFFont font = wb.createFont();
|
||||
CellStyle cellStyle = wb.createCellStyle();
|
||||
Font font = wb.createFont();
|
||||
//设置字体大小
|
||||
font.setFontHeightInPoints((short) 12);
|
||||
//设置字体加粗
|
||||
@ -404,11 +403,11 @@ public class LogService {
|
||||
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
for (int i = 0; i < details.size(); i++) {
|
||||
XSSFRow row = detailsSheet.createRow(i);
|
||||
Row row = detailsSheet.createRow(i);
|
||||
String[] rowData = details.get(i);
|
||||
if (rowData != null) {
|
||||
for (int j = 0; j < rowData.length; j++) {
|
||||
XSSFCell cell = row.createCell(j);
|
||||
Cell cell = row.createCell(j);
|
||||
cell.setCellValue(rowData[j]);
|
||||
if (i == 0) {// 头部
|
||||
cell.setCellStyle(cellStyle);
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -396,6 +396,9 @@ export default {
|
||||
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
|
||||
}
|
||||
}
|
||||
if (chart_option.tooltip) {
|
||||
chart_option.tooltip.appendToBody = true
|
||||
}
|
||||
this.myEcharts(chart_option)
|
||||
this.$nextTick(() => (this.linkageActive()))
|
||||
},
|
||||
|
||||
@ -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