Merge pull request #3410 from dataease/pr@dev@fix_spelling_error_in_backend
fix: 部分后台拼写错误
This commit is contained in:
commit
d4c8492313
@ -37,13 +37,13 @@ public class DeLogAnnotationHandler {
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
private static List<Integer> befores = new ArrayList<>();
|
||||
private static List<Integer> before = new ArrayList<>();
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
befores.add(SysLogConstants.OPERATE_TYPE.DELETE.getValue());
|
||||
befores.add(SysLogConstants.OPERATE_TYPE.UNSHARE.getValue());
|
||||
befores.add(SysLogConstants.OPERATE_TYPE.UNAUTHORIZE.getValue());
|
||||
before.add(SysLogConstants.OPERATE_TYPE.DELETE.getValue());
|
||||
before.add(SysLogConstants.OPERATE_TYPE.UNSHARE.getValue());
|
||||
before.add(SysLogConstants.OPERATE_TYPE.UNAUTHORIZE.getValue());
|
||||
}
|
||||
|
||||
private SysLogDTO exec(JoinPoint point, DeLog deLog) throws Exception{
|
||||
@ -110,7 +110,7 @@ public class DeLogAnnotationHandler {
|
||||
SysLogDTO logDTO = null;
|
||||
Object result = null;
|
||||
DeLog log = getLog(point);
|
||||
if(befores.contains(log.operatetype().getValue())) {
|
||||
if(before.contains(log.operatetype().getValue())) {
|
||||
// 前置处理 比如删除操作 需要在数据删除之前查询
|
||||
logDTO = exec(point, log);
|
||||
result = point.proceed(point.getArgs());
|
||||
|
||||
@ -127,7 +127,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
|
||||
@CacheEvict(value = AuthConstants.USER_PANEL_NAME, key = "'user' + #userId")
|
||||
})
|
||||
public void clearUserResource(Long userId) {
|
||||
LogUtil.info("all permission resource of user {} is cleanning...", userId);
|
||||
LogUtil.info("all permission resource of user {} is cleaning...", userId);
|
||||
}
|
||||
|
||||
@Caching(evict = {
|
||||
@ -136,7 +136,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
|
||||
@CacheEvict(value = AuthConstants.DEPT_PANEL_NAME, key = "'dept' + #deptId")
|
||||
})
|
||||
public void clearDeptResource(Long deptId) {
|
||||
LogUtil.info("all permission resource of dept {} is cleanning...", deptId);
|
||||
LogUtil.info("all permission resource of dept {} is cleaning...", deptId);
|
||||
}
|
||||
|
||||
@Caching(evict = {
|
||||
@ -145,7 +145,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
|
||||
@CacheEvict(value = AuthConstants.ROLE_PANEL_NAME, key = "'role' + #roleId")
|
||||
})
|
||||
public void clearRoleResource(Long roleId) {
|
||||
LogUtil.info("all permission resource of role {} is cleanning...", roleId);
|
||||
LogUtil.info("all permission resource of role {} is cleaning...", roleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -4,10 +4,10 @@ public enum ResourceAuthLevel {
|
||||
|
||||
COMMON_LEVEL_USE(1),
|
||||
|
||||
PANNEL_LEVEL_VIEW(1),
|
||||
PANNEL_LEVEL_EXPORT(3),
|
||||
PANNEL_LEVEL_MANAGE(5),
|
||||
PANNEL_LEVEL_GRANT(15),
|
||||
PANEL_LEVEL_VIEW(1),
|
||||
PANEL_LEVEL_EXPORT(3),
|
||||
PANEL_LEVEL_MANAGE(5),
|
||||
PANEL_LEVEL_GRANT(15),
|
||||
|
||||
DATASET_LEVEL_USE(1),
|
||||
DATASET_LEVEL_MANAGE(3),
|
||||
|
||||
@ -11,6 +11,6 @@ public class ExcelSheetModel {
|
||||
|
||||
private List<String> heads;
|
||||
|
||||
private List<List<String>> datas;
|
||||
private List<List<String>> data;
|
||||
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ public class AuthUtils {
|
||||
result.addAll(roleSet);
|
||||
result.addAll(deptSet);
|
||||
Arrays.stream(defaultPanelPermissions).forEach(item -> {
|
||||
result.add(new AuthItem(item, ResourceAuthLevel.PANNEL_LEVEL_MANAGE.getLevel()));
|
||||
result.add(new AuthItem(item, ResourceAuthLevel.PANEL_LEVEL_MANAGE.getLevel()));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public class CronUtils {
|
||||
if (!CronExpression.isValidExpression(cron)) {
|
||||
throw new RuntimeException("cron :" + cron + "表达式解析错误");
|
||||
}
|
||||
return TriggerBuilder.newTrigger().withIdentity("Caclulate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build();
|
||||
return TriggerBuilder.newTrigger().withIdentity("Calculate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -28,7 +28,7 @@ public class ExcelUtils {
|
||||
|
||||
sheets.forEach(sheet -> {
|
||||
|
||||
List<List<String>> details = sheet.getDatas();
|
||||
List<List<String>> details = sheet.getData();
|
||||
details.add(0, sheet.getHeads());
|
||||
String sheetName = sheet.getSheetName();
|
||||
HSSFSheet curSheet = wb.createSheet(sheetName);
|
||||
|
||||
@ -23,7 +23,7 @@ import java.util.stream.Collectors;
|
||||
**/
|
||||
public class ExcelXlsReader implements HSSFListener {
|
||||
|
||||
private int minColums = -1;
|
||||
private int minColumns = -1;
|
||||
|
||||
public Integer getObtainedNum() {
|
||||
return obtainedNum;
|
||||
@ -211,8 +211,8 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
thisRow = frec.getRow();
|
||||
thisColumn = frec.getColumn();
|
||||
thisStr = String.valueOf(frec.getValue());
|
||||
String feildType = checkType(thisStr, thisColumn);
|
||||
if(feildType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){
|
||||
String fieldType = checkType(thisStr, thisColumn);
|
||||
if(fieldType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){
|
||||
thisStr = thisStr.substring(0, thisStr.length() -2);
|
||||
}
|
||||
cellList.add(thisColumn, thisStr);
|
||||
@ -300,7 +300,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
|
||||
//行结束时的操作
|
||||
if (record instanceof LastCellOfRowDummyRecord) {
|
||||
if (minColums > 0) {
|
||||
if (minColumns > 0) {
|
||||
//列值重新置空
|
||||
if (lastColumnNumber == -1) {
|
||||
lastColumnNumber = 0;
|
||||
@ -308,9 +308,9 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
}
|
||||
lastColumnNumber = -1;
|
||||
|
||||
if(!totalSheets.stream().map(ExcelSheetData::getExcelLable).collect(Collectors.toList()).contains(sheetName)){
|
||||
if(!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)){
|
||||
ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
excelSheetData.setExcelLable(sheetName);
|
||||
excelSheetData.setExcelLabel(sheetName);
|
||||
excelSheetData.setData(new ArrayList<>());
|
||||
excelSheetData.setFields(new ArrayList<>());
|
||||
totalSheets.add(excelSheetData);
|
||||
@ -330,10 +330,10 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
|
||||
|
||||
if (flag && curRow != 0) { //该行不为空行且该行不是第一行,发送(第一行为列名,不需要)
|
||||
if(!totalSheets.stream().map(ExcelSheetData::getExcelLable).collect(Collectors.toList()).contains(sheetName)){
|
||||
if(!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)){
|
||||
ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
excelSheetData.setData(new ArrayList<>(data));
|
||||
excelSheetData.setExcelLable(sheetName);
|
||||
excelSheetData.setExcelLabel(sheetName);
|
||||
excelSheetData.setFields(new ArrayList<>(fields));
|
||||
List<String> tmp = new ArrayList<>(cellList);
|
||||
excelSheetData.getData().add(tmp);
|
||||
@ -341,11 +341,11 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
totalSheets.add(excelSheetData);
|
||||
}else {
|
||||
List<String> tmp = new ArrayList<>(cellList);
|
||||
if(obtainedNum != null && totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum){
|
||||
totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
if(obtainedNum != null && totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum){
|
||||
totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
}
|
||||
if(obtainedNum == null){
|
||||
totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
}
|
||||
totalRows++;
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
|
||||
ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
excelSheetData.setData(new ArrayList<>(data));
|
||||
excelSheetData.setExcelLable(sheets.getSheetName());
|
||||
excelSheetData.setExcelLabel(sheets.getSheetName());
|
||||
excelSheetData.setFields(new ArrayList<>(fields));
|
||||
totalSheets.add(excelSheetData);
|
||||
|
||||
|
||||
@ -36,21 +36,21 @@ public class ChartViewController {
|
||||
@Resource
|
||||
private ChartViewCacheService chartViewCacheService;
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save/{panelId}")
|
||||
public ChartViewDTO save(@PathVariable String panelId, @RequestBody ChartViewRequest request) {
|
||||
return chartViewService.save(request);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("新建视图")
|
||||
@PostMapping("/newOne/{panelId}")
|
||||
public ChartViewWithBLOBs save(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
|
||||
return chartViewService.newOne(chartViewWithBLOBs);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("保存编辑的视图信息")
|
||||
@PostMapping("/viewEditSave/{panelId}")
|
||||
public void viewEditSave(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
|
||||
@ -71,7 +71,7 @@ public class ChartViewController {
|
||||
return chartViewService.listAndGroup(chartViewRequest);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@ApiOperation("详细信息")
|
||||
@PostMapping("/get/{id}/{panelId}")
|
||||
public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId, @RequestBody ChartViewRequest viewRequest) {
|
||||
@ -87,7 +87,7 @@ public class ChartViewController {
|
||||
}
|
||||
|
||||
@DePermissionProxy(value = "proxy", paramIndex = 2)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@ApiOperation("数据")
|
||||
@PostMapping("/getData/{id}/{panelId}")
|
||||
public ChartViewDTO getData(@PathVariable String id, @PathVariable String panelId,
|
||||
@ -95,21 +95,21 @@ public class ChartViewController {
|
||||
return chartViewService.getData(id, requestList);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@ApiOperation("视图详情")
|
||||
@PostMapping("chartDetail/{id}/{panelId}")
|
||||
public ChartDetail chartDetail(@PathVariable String id, @PathVariable String panelId) {
|
||||
return chartViewService.getChartDetail(id);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@ApiOperation("复制")
|
||||
@PostMapping("chartCopy/{id}/{panelId}")
|
||||
public String chartCopy(@PathVariable String id, @PathVariable String panelId) {
|
||||
return chartViewService.chartCopy(id, panelId);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@ApiOperation("批量复制")
|
||||
@PostMapping("chartBatchCopy/{panelId}")
|
||||
public Map<String, String> chartBatchCopy(@RequestBody ChartCopyBatchRequest request, @PathVariable String panelId) {
|
||||
@ -129,7 +129,7 @@ public class ChartViewController {
|
||||
return chartViewService.search(chartViewRequest);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@ApiOperation("计算结果")
|
||||
@PostMapping("/calcData/{panelId}")
|
||||
public ChartViewDTO calcData(@PathVariable String panelId, @RequestBody ChartCalRequest request) throws Exception {
|
||||
@ -144,14 +144,14 @@ public class ChartViewController {
|
||||
return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@ApiOperation("初始化仪表板视图缓存")
|
||||
@PostMapping("/initViewCache/{panelId}")
|
||||
public void initViewCache(@PathVariable String panelId) {
|
||||
chartViewService.initViewCache(panelId);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@ApiOperation("重置视图")
|
||||
@PostMapping("/resetViewCache/{id}/{panelId}")
|
||||
public void resetViewCache(@PathVariable String id, @PathVariable String panelId) {
|
||||
|
||||
@ -35,7 +35,7 @@ public class ChartViewFieldController {
|
||||
@Resource
|
||||
private DataSetTableService dataSetTableService;
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save/{panelId}")
|
||||
public ChartViewField save(@PathVariable String panelId, @RequestBody ChartViewField chartViewField) {
|
||||
@ -53,21 +53,21 @@ public class ChartViewFieldController {
|
||||
return chartViewFieldService.save(chartViewField);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@ApiOperation("删除")
|
||||
@PostMapping("/delete/{id}/{panelId}")
|
||||
public void delete(@PathVariable String id, @PathVariable String panelId) {
|
||||
chartViewFieldService.delete(id);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
|
||||
@ApiOperation("删除视图的字段")
|
||||
@PostMapping("/deleteByChartId/{chartId}/{panelId}")
|
||||
public void deleteByChartId(@PathVariable String chartId, @PathVariable String panelId) {
|
||||
chartViewFieldService.deleteByChartId(chartId);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
|
||||
@ApiOperation("分组查询表下属字段")
|
||||
@PostMapping("listByDQ/{chartId}/{panelId}")
|
||||
public ChartViewField4Type listByDQ(@PathVariable String chartId, @PathVariable String panelId) {
|
||||
|
||||
@ -62,7 +62,7 @@ public class DataSetTableFieldController {
|
||||
DatasetTableField datasetTableField = DatasetTableField.builder().build();
|
||||
datasetTableField.setTableId(tableId);
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
fields = permissionService.filterColumnPermissons(fields, new ArrayList<>(), tableId, null);
|
||||
fields = permissionService.filterColumnPermissions(fields, new ArrayList<>(), tableId, null);
|
||||
return fields;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class DataSetTableFieldController {
|
||||
datasetTableField.setTableId(tableId);
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
List<String> desensitizationList = new ArrayList<>();
|
||||
fields = permissionService.filterColumnPermissons(fields, desensitizationList, tableId, null);
|
||||
fields = permissionService.filterColumnPermissions(fields, desensitizationList, tableId, null);
|
||||
fields = fields.stream().filter(item -> !desensitizationList.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
return fields;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ public class PanelGroupController {
|
||||
@PostMapping("/save")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id"),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
@I18n
|
||||
public PanelGroupDTO save(@RequestBody PanelGroupRequest request) throws Exception{
|
||||
@ -77,7 +77,7 @@ public class PanelGroupController {
|
||||
@PostMapping("/update")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id"),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
@I18n
|
||||
public String update(@RequestBody PanelGroupRequest request) {
|
||||
@ -85,14 +85,14 @@ public class PanelGroupController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@PostMapping("/deleteCircle/{id}")
|
||||
public void deleteCircle(@PathVariable String id) {
|
||||
panelGroupService.deleteCircle(id);
|
||||
}
|
||||
|
||||
@ApiOperation("详细信息")
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@GetMapping("/findOne/{id}")
|
||||
public PanelGroupDTO findOne(@PathVariable String id) throws Exception {
|
||||
return panelGroupService.findOne(id);
|
||||
@ -101,7 +101,7 @@ public class PanelGroupController {
|
||||
@ApiIgnore
|
||||
@ApiOperation("详细信息(分享人代理)")
|
||||
@DePermissionProxy(paramIndex = 1)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@PostMapping("/proxy/findOne/{id}")
|
||||
public PanelGroupDTO proxyFindOne(@PathVariable String id, @RequestBody PermissionProxy proxy)
|
||||
throws Exception {
|
||||
@ -146,7 +146,7 @@ public class PanelGroupController {
|
||||
@ApiOperation("更新仪表板状态")
|
||||
@PostMapping("/updatePanelStatus/{panelId}")
|
||||
@I18n
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
public void updatePanelStatus(@PathVariable String panelId, @RequestBody PanelGroupBaseInfoRequest request) {
|
||||
panelGroupService.updatePanelStatus(panelId, request);
|
||||
}
|
||||
@ -154,7 +154,7 @@ public class PanelGroupController {
|
||||
@PostMapping("/autoCache")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id"),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
public void autoCache(@RequestBody PanelGroupRequest request){
|
||||
panelGroupService.autoCache(request);
|
||||
|
||||
@ -18,7 +18,7 @@ public class ApiDefinition {
|
||||
private ApiDefinitionRequest request;
|
||||
private String dataPath;
|
||||
private String status;
|
||||
private List<Map<String,String>> datas = new ArrayList<>();
|
||||
private List<Map<String,String>> data = new ArrayList<>();
|
||||
private List<JSONObject> jsonFields = new ArrayList<>();
|
||||
private int previewNum = 10;
|
||||
private int maxPreviewNum = 10;
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EsReponse {
|
||||
public class EsResponse {
|
||||
private List<Column> columns = new ArrayList<>();
|
||||
private List<String[]> rows = new ArrayList<>();
|
||||
private String cursor;
|
||||
@ -78,8 +78,8 @@ public class SysMenuController {
|
||||
|
||||
@PostMapping("/childMenus/{pid}")
|
||||
public Set<Long> childMenus(@PathVariable Long pid){
|
||||
List<MenuNodeResponse> childs = menuService.childs(pid);
|
||||
Set<Long> sets = childs.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet());
|
||||
List<MenuNodeResponse> children = menuService.children(pid);
|
||||
Set<Long> sets = children.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet());
|
||||
sets.add(pid);
|
||||
return sets;
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class BaseGridRequest implements Serializable {
|
||||
GridExample gridExample = new GridExample();
|
||||
if (CollectionUtils.isNotEmpty(conditions)) {
|
||||
GridExample.Criteria criteria = gridExample.createCriteria();
|
||||
conditions.forEach(criteria::addCondtion);
|
||||
conditions.forEach(criteria::addCondition);
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(orders)){
|
||||
|
||||
@ -10,7 +10,7 @@ public class ExcelFileData {
|
||||
@ApiModelProperty("excelID")
|
||||
private String id;
|
||||
@ApiModelProperty("excel标签")
|
||||
private String excelLable;
|
||||
private String excelLabel;
|
||||
@ApiModelProperty("sheets")
|
||||
private List<ExcelSheetData> sheets;
|
||||
@ApiModelProperty("路径")
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.Map;
|
||||
@Data
|
||||
public class ExcelSheetData {
|
||||
@ApiModelProperty("标签")
|
||||
private String excelLable;
|
||||
private String excelLabel;
|
||||
@ApiModelProperty("数据集合")
|
||||
private List<List<String>> data;
|
||||
@ApiModelProperty("字段集合")
|
||||
|
||||
@ -6,7 +6,7 @@ import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class RedshiftConfigration extends JdbcConfiguration {
|
||||
public class RedshiftConfiguration extends JdbcConfiguration {
|
||||
|
||||
private String driver = "com.amazon.redshift.jdbc42.Driver";
|
||||
|
||||
@ -132,7 +132,7 @@ public class GridExample {
|
||||
|
||||
|
||||
|
||||
public Criteria addCondtion(ConditionEntity conditionEntity){
|
||||
public Criteria addCondition(ConditionEntity conditionEntity){
|
||||
String field = conditionEntity.getField();
|
||||
Object value = conditionEntity.getValue();
|
||||
String operator = conditionEntity.getOperator();
|
||||
|
||||
@ -17,7 +17,7 @@ public interface MapApi {
|
||||
|
||||
|
||||
@GetMapping("/globalEntitys/{pcode}")
|
||||
List<AreaEntity> globalEntitys(@PathVariable String pcode);
|
||||
List<AreaEntity> globalEntities(@PathVariable String pcode);
|
||||
|
||||
@PostMapping(value = "/saveMapNode", consumes = {"multipart/form-data"})
|
||||
void saveMapNode(MapNodeRequest request, MultipartFile file) throws Exception;
|
||||
|
||||
@ -6,7 +6,7 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MapNodeReadReponse implements Serializable {
|
||||
public class MapNodeReadResponse implements Serializable {
|
||||
|
||||
@ApiModelProperty("区域代码")
|
||||
private String code;
|
||||
@ -15,7 +15,7 @@ public class MapNodeReadReponse implements Serializable {
|
||||
@ApiModelProperty("区域级别")
|
||||
private Integer level;
|
||||
@ApiModelProperty("上级区域")
|
||||
private MapNodeReadReponse parent;
|
||||
private MapNodeReadResponse parent;
|
||||
@ApiModelProperty("geoGson")
|
||||
private String json;
|
||||
}
|
||||
@ -26,16 +26,16 @@ public class MapServer implements MapApi {
|
||||
if (StringUtils.equals(pcode, "0")) {
|
||||
return areaEntities;
|
||||
}
|
||||
return mapService.entitysByPid(areaEntities, pcode);
|
||||
return mapService.entitiesByPid(areaEntities, pcode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaEntity> globalEntitys(String pcode) {
|
||||
public List<AreaEntity> globalEntities(String pcode) {
|
||||
List<AreaEntity> areaEntities = mapService.globalEntities();
|
||||
if (StringUtils.equals(pcode, "0")) {
|
||||
return areaEntities;
|
||||
}
|
||||
return mapService.entitysByPid(areaEntities, pcode);
|
||||
return mapService.entitiesByPid(areaEntities, pcode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ public class MapService {
|
||||
return areaEntities;
|
||||
}
|
||||
|
||||
public List<AreaEntity> entitysByPid(List<AreaEntity> entities, String pid) {
|
||||
public List<AreaEntity> entitiesByPid(List<AreaEntity> entities, String pid) {
|
||||
for (int i = 0; i < entities.size(); i++) {
|
||||
AreaEntity areaEntity = entities.get(i);
|
||||
if (StringUtils.equals(pid, areaEntity.getCode())) {
|
||||
@ -51,7 +51,7 @@ public class MapService {
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(areaEntity.getChildren())) {
|
||||
List<AreaEntity> areaEntities = entitysByPid(areaEntity.getChildren(), pid);
|
||||
List<AreaEntity> areaEntities = entitiesByPid(areaEntity.getChildren(), pid);
|
||||
if (null != areaEntities) {
|
||||
return areaEntities;
|
||||
}
|
||||
@ -65,7 +65,7 @@ public class MapService {
|
||||
Long pValue = Long.parseLong(pCode);
|
||||
MapService mapService = CommonBeanFactory.getBean(MapService.class);
|
||||
List<AreaEntity> areaEntities = mapService.globalEntities();
|
||||
List<AreaEntity> brothers = entitysByPid(areaEntities, pCode);
|
||||
List<AreaEntity> brothers = entitiesByPid(areaEntities, pCode);
|
||||
|
||||
brothers.sort(Comparator.comparing(item -> Long.parseLong(item.getCode())));
|
||||
AreaEntity lastBrother = brothers.get(brothers.size() - 1);
|
||||
|
||||
@ -57,8 +57,8 @@ public class SSOServer {
|
||||
DEException.throwException("缺少oidc插件");
|
||||
}
|
||||
oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
|
||||
Boolean suuportOIDC = oidcXpackService.isSupportOIDC();
|
||||
if (!suuportOIDC) {
|
||||
Boolean supportOIDC = oidcXpackService.isSupportOIDC();
|
||||
if (!supportOIDC) {
|
||||
DEException.throwException("未开启oidc");
|
||||
}
|
||||
Map<String, String> config = config(oidcXpackService);
|
||||
|
||||
@ -270,8 +270,8 @@ public class XEmailTaskServer {
|
||||
String[] headArr = new String[] {Translator.get("I18N_XPACKTASK_NAME"), Translator.get("I18N_XPACKTASK_EXEC_TIME"), Translator.get("I18N_XPACKTASK_STATUS")};
|
||||
List<String> head = Arrays.asList(headArr);
|
||||
excelSheetModel.setHeads(head);
|
||||
List<List<String>> datas = instanceDTOS.stream().map(this::formatExcelData).collect(Collectors.toList());
|
||||
excelSheetModel.setDatas(datas);
|
||||
List<List<String>> data = instanceDTOS.stream().map(this::formatExcelData).collect(Collectors.toList());
|
||||
excelSheetModel.setData(data);
|
||||
return excelSheetModel;
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ public class ApiProvider extends Provider {
|
||||
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
|
||||
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
|
||||
|
||||
fieldList = getTableFileds(apiDefinition);
|
||||
fieldList = getTableFields(apiDefinition);
|
||||
result.put("fieldList", fieldList);
|
||||
dataList = fetchResult(response, apiDefinition);
|
||||
result.put("dataList", dataList);
|
||||
@ -80,7 +80,7 @@ public class ApiProvider extends Provider {
|
||||
}
|
||||
|
||||
|
||||
private List<TableField> getTableFileds(ApiDefinition apiDefinition) throws Exception {
|
||||
private List<TableField> getTableFields(ApiDefinition apiDefinition) throws Exception {
|
||||
List<TableField> tableFields = new ArrayList<>();
|
||||
for (DatasetTableFieldDTO field : apiDefinition.getFields()) {
|
||||
TableField tableField = new TableField();
|
||||
@ -93,13 +93,13 @@ public class ApiProvider extends Provider {
|
||||
return tableFields;
|
||||
}
|
||||
|
||||
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception {
|
||||
public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
|
||||
List<ApiDefinition> lists = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), new TypeToken<List<ApiDefinition>>() {
|
||||
}.getType());
|
||||
List<TableField> tableFields = new ArrayList<>();
|
||||
for (ApiDefinition apiDefinition : lists) {
|
||||
if (datasourceRequest.getTable().equalsIgnoreCase(apiDefinition.getName())) {
|
||||
tableFields = getTableFileds(apiDefinition);
|
||||
tableFields = getTableFields(apiDefinition);
|
||||
}
|
||||
}
|
||||
return tableFields;
|
||||
@ -361,14 +361,14 @@ public class ApiProvider extends Provider {
|
||||
private List<String[]> fetchResult(String result, ApiDefinition apiDefinition) {
|
||||
List<String[]> dataList = new LinkedList<>();
|
||||
if (StringUtils.isNotEmpty(apiDefinition.getDataPath()) && CollectionUtils.isEmpty(apiDefinition.getJsonFields())) {
|
||||
List<LinkedHashMap> datas = new ArrayList<>();
|
||||
List<LinkedHashMap> currentData = new ArrayList<>();
|
||||
Object object = JsonPath.read(result, apiDefinition.getDataPath());
|
||||
if (object instanceof List) {
|
||||
datas = (List<LinkedHashMap>) object;
|
||||
currentData = (List<LinkedHashMap>) object;
|
||||
} else {
|
||||
datas.add((LinkedHashMap) object);
|
||||
currentData.add((LinkedHashMap) object);
|
||||
}
|
||||
for (LinkedHashMap data : datas) {
|
||||
for (LinkedHashMap data : currentData) {
|
||||
String[] row = new String[apiDefinition.getFields().size()];
|
||||
int i = 0;
|
||||
for (DatasetTableFieldDTO field : apiDefinition.getFields()) {
|
||||
@ -379,22 +379,22 @@ public class ApiProvider extends Provider {
|
||||
}
|
||||
} else {
|
||||
List<String> jsonPaths = apiDefinition.getFields().stream().map(DatasetTableFieldDTO::getJsonPath).collect(Collectors.toList());
|
||||
Long maxLenth = 0l;
|
||||
Long maxLength = 0l;
|
||||
List<List<String>> columnDataList = new ArrayList<>();
|
||||
for (int i = 0; i < jsonPaths.size(); i++) {
|
||||
List<String> datas = new ArrayList<>();
|
||||
List<String> data = new ArrayList<>();
|
||||
Object object = JsonPath.read(result, jsonPaths.get(i));
|
||||
if (object instanceof List && jsonPaths.get(i).contains("[*]")) {
|
||||
datas = (List<String>) object;
|
||||
data = (List<String>) object;
|
||||
} else {
|
||||
if (object != null) {
|
||||
datas.add(object.toString());
|
||||
data.add(object.toString());
|
||||
}
|
||||
}
|
||||
maxLenth = maxLenth > datas.size() ? maxLenth : datas.size();
|
||||
columnDataList.add(datas);
|
||||
maxLength = maxLength > data.size() ? maxLength : data.size();
|
||||
columnDataList.add(data);
|
||||
}
|
||||
for (int i = 0; i < maxLenth; i++) {
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
String[] row = new String[apiDefinition.getFields().size()];
|
||||
dataList.add(row);
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.dataease.commons.utils.HttpClientConfig;
|
||||
import io.dataease.commons.utils.HttpClientUtil;
|
||||
import io.dataease.controller.request.datasource.es.EsReponse;
|
||||
import io.dataease.controller.request.datasource.es.EsResponse;
|
||||
import io.dataease.controller.request.datasource.es.Request;
|
||||
import io.dataease.controller.request.datasource.es.RequestWithCursor;
|
||||
import io.dataease.dto.datasource.EsConfiguration;
|
||||
@ -60,22 +60,22 @@ public class EsProvider extends Provider {
|
||||
request.setFetch_size(dsr.getFetchSize());
|
||||
String url = esConfiguration.getUrl().endsWith("/") ? esConfiguration.getUrl() + esConfiguration.getUri() + "?format=json" : esConfiguration.getUrl() + "/" + esConfiguration.getUri() + "?format=json";
|
||||
String response = HttpClientUtil.post(url, new Gson().toJson(request), httpClientConfig);
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
|
||||
list.addAll(fetchResult(esReponse));
|
||||
list.addAll(fetchResult(esResponse));
|
||||
if (dsr.isPageable()) {
|
||||
Integer realSize = dsr.getPage() * dsr.getPageSize() < list.size() ? dsr.getPage() * dsr.getPageSize() : list.size();
|
||||
list = list.subList((dsr.getPage() - 1) * dsr.getPageSize(), realSize);
|
||||
}
|
||||
if (!dsr.isPreviewData()) {
|
||||
while (StringUtils.isNotEmpty(esReponse.getCursor())) {
|
||||
RequestWithCursor requstWithCursor = new RequestWithCursor();
|
||||
requstWithCursor.setQuery(dsr.getQuery());
|
||||
requstWithCursor.setFetch_size(dsr.getFetchSize());
|
||||
requstWithCursor.setCursor(esReponse.getCursor());
|
||||
response = HttpClientUtil.post(url, new Gson().toJson(requstWithCursor), httpClientConfig);
|
||||
esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
list.addAll(fetchResult(esReponse));
|
||||
while (StringUtils.isNotEmpty(esResponse.getCursor())) {
|
||||
RequestWithCursor requestWithCursor = new RequestWithCursor();
|
||||
requestWithCursor.setQuery(dsr.getQuery());
|
||||
requestWithCursor.setFetch_size(dsr.getFetchSize());
|
||||
requestWithCursor.setCursor(esResponse.getCursor());
|
||||
response = HttpClientUtil.post(url, new Gson().toJson(requestWithCursor), httpClientConfig);
|
||||
esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
list.addAll(fetchResult(esResponse));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@ -112,16 +112,16 @@ public class EsProvider extends Provider {
|
||||
|
||||
|
||||
private List<String[]> fetchResult(String response) throws Exception {
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
return fetchResult(esReponse);
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
return fetchResult(esResponse);
|
||||
}
|
||||
|
||||
private List<String[]> fetchResult(EsReponse esReponse) throws Exception {
|
||||
private List<String[]> fetchResult(EsResponse esResponse) throws Exception {
|
||||
List<String[]> list = new LinkedList<>();
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
list.addAll(esReponse.getRows());
|
||||
list.addAll(esResponse.getRows());
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -139,12 +139,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableField> fetchResultField(String response) throws Exception {
|
||||
List<TableField> fieldList = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (String[] row : esReponse.getRows()) {
|
||||
for (String[] row : esResponse.getRows()) {
|
||||
TableField field = new TableField();
|
||||
field.setFieldName(row[0]);
|
||||
field.setRemarks(row[0]);
|
||||
@ -157,12 +157,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableField> fetchResultField4Sql(String response) throws Exception {
|
||||
List<TableField> fieldList = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (EsReponse.Column column : esReponse.getColumns()) {
|
||||
for (EsResponse.Column column : esResponse.getColumns()) {
|
||||
TableField field = new TableField();
|
||||
field.setFieldName(column.getName());
|
||||
field.setRemarks(column.getName());
|
||||
@ -175,12 +175,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableField> fetchResultField4Table(String response) throws Exception {
|
||||
List<TableField> fieldList = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (String[] row : esReponse.getRows()) {
|
||||
for (String[] row : esResponse.getRows()) {
|
||||
if(!row[1].equalsIgnoreCase("STRUCT")){
|
||||
TableField field = new TableField();
|
||||
field.setFieldName(row[0]);
|
||||
@ -221,12 +221,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableDesc> fetchTables(String response) throws Exception {
|
||||
List<TableDesc> tables = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (String[] row : esReponse.getRows()) {
|
||||
for (String[] row : esResponse.getRows()) {
|
||||
if (row.length == 3 && row[1].contains("TABLE") && row[2].equalsIgnoreCase("INDEX")) {
|
||||
TableDesc tableDesc = new TableDesc();
|
||||
tableDesc.setName(row[0]);
|
||||
|
||||
@ -263,8 +263,8 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
while (rs.next()) {
|
||||
String[] row = new String[columnCount];
|
||||
for (int j = 0; j < columnCount; j++) {
|
||||
int columType = metaData.getColumnType(j + 1);
|
||||
switch (columType) {
|
||||
int columnType = metaData.getColumnType(j + 1);
|
||||
switch (columnType) {
|
||||
case Types.DATE:
|
||||
if (rs.getDate(j + 1) != null) {
|
||||
row[j] = rs.getDate(j + 1).toString();
|
||||
@ -426,12 +426,12 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
jdbcurl = mongodbConfiguration.getJdbc(datasourceRequest.getDatasource().getId());
|
||||
break;
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
username = redshiftConfigration.getUsername();
|
||||
password = redshiftConfigration.getPassword();
|
||||
defaultDriver = redshiftConfigration.getDriver();
|
||||
customDriver = redshiftConfigration.getCustomDriver();
|
||||
jdbcurl = redshiftConfigration.getJdbc();
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
username = redshiftConfiguration.getUsername();
|
||||
password = redshiftConfiguration.getPassword();
|
||||
defaultDriver = redshiftConfiguration.getDriver();
|
||||
customDriver = redshiftConfiguration.getCustomDriver();
|
||||
jdbcurl = redshiftConfiguration.getJdbc();
|
||||
break;
|
||||
case hive:
|
||||
HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class);
|
||||
@ -570,11 +570,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
jdbcConfiguration = mongodbConfiguration;
|
||||
break;
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
dataSource.setPassword(redshiftConfigration.getPassword());
|
||||
dataSource.setDriverClassName(redshiftConfigration.getDriver());
|
||||
dataSource.setUrl(redshiftConfigration.getJdbc());
|
||||
jdbcConfiguration = redshiftConfigration;
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
dataSource.setPassword(redshiftConfiguration.getPassword());
|
||||
dataSource.setDriverClassName(redshiftConfiguration.getDriver());
|
||||
dataSource.setUrl(redshiftConfiguration.getJdbc());
|
||||
jdbcConfiguration = redshiftConfiguration;
|
||||
break;
|
||||
case hive:
|
||||
HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class);
|
||||
@ -655,11 +655,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
CHConfiguration chConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), CHConfiguration.class);
|
||||
return "SELECT name FROM system.tables where database='DATABASE';".replace("DATABASE", chConfiguration.getDataBase());
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfigration.getSchema())) {
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfiguration.getSchema())) {
|
||||
throw new Exception(Translator.get("i18n_schema_is_empty"));
|
||||
}
|
||||
return "SELECT tablename FROM pg_tables WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfigration.getSchema());
|
||||
return "SELECT tablename FROM pg_tables WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfiguration.getSchema());
|
||||
case db2:
|
||||
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
|
||||
if (StringUtils.isEmpty(db2Configuration.getSchema())) {
|
||||
@ -705,11 +705,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
}
|
||||
return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", pgConfiguration.getSchema());
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfigration.getSchema())) {
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfiguration.getSchema())) {
|
||||
throw new Exception(Translator.get("i18n_schema_is_empty"));
|
||||
}
|
||||
return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfigration.getSchema());
|
||||
return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfiguration.getSchema());
|
||||
|
||||
case db2:
|
||||
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
|
||||
|
||||
@ -351,7 +351,7 @@ public class ChartViewService {
|
||||
|
||||
//列权限
|
||||
List<String> desensitizationList = new ArrayList<>();
|
||||
List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissons(fields, desensitizationList, table.getId(), requestList.getUser());
|
||||
List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissions(fields, desensitizationList, table.getId(), requestList.getUser());
|
||||
//将没有权限的列删掉
|
||||
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList());
|
||||
dataeaseNames.add("*");
|
||||
@ -598,7 +598,7 @@ public class ChartViewService {
|
||||
|
||||
List<String> desensitizationList = new ArrayList<>();
|
||||
//列权限
|
||||
List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissons(fields, desensitizationList, table.getId(), requestList.getUser());
|
||||
List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissions(fields, desensitizationList, table.getId(), requestList.getUser());
|
||||
//将没有权限的列删掉
|
||||
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList());
|
||||
dataeaseNames.add("*");
|
||||
@ -1168,11 +1168,11 @@ public class ChartViewService {
|
||||
return "SELECT " + stringBuilder + " FROM (" + sql + ") tmp";
|
||||
}
|
||||
|
||||
public ChartViewDTO uniteViewResult(String sql, Map<String, Object> chartData, Map<String, Object> tabelData, ChartViewDTO view, Boolean isDrill, List<ChartExtFilterRequest> drillFilters, List<ChartSeniorAssistDTO> dynamicAssistFields, List<String[]> assistData) {
|
||||
public ChartViewDTO uniteViewResult(String sql, Map<String, Object> chartData, Map<String, Object> tableData, ChartViewDTO view, Boolean isDrill, List<ChartExtFilterRequest> drillFilters, List<ChartSeniorAssistDTO> dynamicAssistFields, List<String[]> assistData) {
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.putAll(chartData);
|
||||
map.putAll(tabelData);
|
||||
map.putAll(tableData);
|
||||
|
||||
List<DatasetTableField> sourceFields = dataSetTableFieldsService.getFieldsByTableId(view.getTableId());
|
||||
map.put("sourceFields", sourceFields);
|
||||
|
||||
@ -114,7 +114,7 @@ public class ViewExportExcel {
|
||||
return filterInvalidDecimal(val.toString());
|
||||
}).collect(Collectors.toList())).collect(Collectors.toList());
|
||||
result.setHeads(heads);
|
||||
result.setDatas(details);
|
||||
result.setData(details);
|
||||
|
||||
result.setSheetName(title);
|
||||
return result;
|
||||
|
||||
@ -134,11 +134,11 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
}
|
||||
}
|
||||
String keyword = ConstantsUtil.constantsValue(pluginViewSet.getDsType(), "KEYWORD_TABLE");
|
||||
String tabelName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
|
||||
String tabelAlias = String.format(TABLE_ALIAS_PREFIX, 0);
|
||||
PluginViewSQL tableObj = PluginViewSQL.builder().tableName(tabelName).tableAlias(tabelAlias).build();
|
||||
String realTableName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
|
||||
String tableAlias = String.format(TABLE_ALIAS_PREFIX, 0);
|
||||
PluginViewSQL tableObj = PluginViewSQL.builder().tableName(realTableName).tableAlias(tableAlias).build();
|
||||
QueryProvider queryProvider = ProviderFactory.getQueryProvider(pluginViewSet.getDsType());
|
||||
SQLObj sqlObj = SQLObj.builder().tableName(tabelName).tableAlias(tabelAlias).build();
|
||||
SQLObj sqlObj = SQLObj.builder().tableName(realTableName).tableAlias(tableAlias).build();
|
||||
PluginViewSetImpl child = (PluginViewSetImpl)pluginViewSet;
|
||||
queryProvider.setSchema(sqlObj, child.getDs());
|
||||
tableObj.setTableName(sqlObj.getTableName());
|
||||
|
||||
@ -519,7 +519,7 @@ public class DataSetTableService {
|
||||
datasetTableField.setTableId(dataSetTableRequest.getId());
|
||||
datasetTableField.setChecked(Boolean.TRUE);
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
fields = permissionService.filterColumnPermissons(fields, new ArrayList<>(), dataSetTableRequest.getId(), null);
|
||||
fields = permissionService.filterColumnPermissions(fields, new ArrayList<>(), dataSetTableRequest.getId(), null);
|
||||
List<DatasetTableField> dimension = new ArrayList<>();
|
||||
List<DatasetTableField> quota = new ArrayList<>();
|
||||
|
||||
@ -556,7 +556,7 @@ public class DataSetTableService {
|
||||
public Map<String, Object> getPreviewData(DataSetTableRequest dataSetTableRequest, Integer page, Integer pageSize,
|
||||
List<DatasetTableField> extFields) throws Exception {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String sycnStatus = "";
|
||||
String syncStatus = "";
|
||||
DatasetTableField datasetTableField = DatasetTableField.builder().tableId(dataSetTableRequest.getId())
|
||||
.checked(Boolean.TRUE).build();
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
@ -574,7 +574,7 @@ public class DataSetTableService {
|
||||
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionsTreeService.getRowPermissionsTree(fields, datasetTable, null);
|
||||
// 列权限
|
||||
List<String> desensitizationList = new ArrayList<>();
|
||||
fields = permissionService.filterColumnPermissons(fields, desensitizationList, datasetTable.getId(), null);
|
||||
fields = permissionService.filterColumnPermissions(fields, desensitizationList, datasetTable.getId(), null);
|
||||
if (CollectionUtils.isEmpty(fields)) {
|
||||
map.put("fields", fields);
|
||||
map.put("data", new ArrayList<>());
|
||||
@ -783,7 +783,7 @@ public class DataSetTableService {
|
||||
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel");
|
||||
if (CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)) {
|
||||
dataSetTaskLogDTOS.get(0).getStatus().equalsIgnoreCase(JobStatus.Underway.name());
|
||||
sycnStatus = dataSetTaskLogDTOS.get(0).getStatus();
|
||||
syncStatus = dataSetTaskLogDTOS.get(0).getStatus();
|
||||
}
|
||||
|
||||
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
|
||||
@ -951,7 +951,7 @@ public class DataSetTableService {
|
||||
map.put("fields", fields);
|
||||
map.put("data", jsonArray);
|
||||
map.put("page", dataSetPreviewPage);
|
||||
map.put("sycnStatus", sycnStatus);
|
||||
map.put("syncStatus", syncStatus);
|
||||
|
||||
return map;
|
||||
}
|
||||
@ -1109,7 +1109,7 @@ public class DataSetTableService {
|
||||
binaryExpression = (BinaryExpression) expr;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (binaryExpression != null && !(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVarible(binaryExpression.toString())) {
|
||||
if (binaryExpression != null && !(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVariable(binaryExpression.toString())) {
|
||||
stringBuilder.append(SubstitutedSql);
|
||||
} else {
|
||||
expr.accept(getExpressionDeParser(stringBuilder));
|
||||
@ -2112,7 +2112,7 @@ public class DataSetTableService {
|
||||
return o1.getColumnIndex().compareTo(o2.getColumnIndex());
|
||||
});
|
||||
|
||||
List<String> originNameFileds = datasetTableFields.stream().map(DatasetTableField::getOriginName)
|
||||
List<String> originNameFields = datasetTableFields.stream().map(DatasetTableField::getOriginName)
|
||||
.collect(Collectors.toList());
|
||||
Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId());
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
@ -2125,18 +2125,18 @@ public class DataSetTableService {
|
||||
.replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(qp.wrapSql(sql));
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
List<String> sqlFields = new ArrayList<>();
|
||||
try {
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName)
|
||||
.forEach(field -> {
|
||||
sqlFileds.add(field);
|
||||
sqlFields.add(field);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
|
||||
}
|
||||
|
||||
if (!originNameFileds.equals(sqlFileds)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_add_not_matching") + sqlFileds.toString());
|
||||
if (!originNameFields.equals(sqlFields)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_add_not_matching") + sqlFields.toString());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete())
|
||||
@ -2145,16 +2145,16 @@ public class DataSetTableService {
|
||||
.replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(qp.wrapSql(sql));
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
List<String> sqlFields = new ArrayList<>();
|
||||
try {
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName)
|
||||
.forEach(field -> sqlFileds.add(field));
|
||||
.forEach(field -> sqlFields.add(field));
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
|
||||
}
|
||||
|
||||
if (!originNameFileds.equals(sqlFileds)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_delete_not_matching") + sqlFileds.toString());
|
||||
if (!originNameFields.equals(sqlFields)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_delete_not_matching") + sqlFields.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2218,7 +2218,7 @@ public class DataSetTableService {
|
||||
String filename = file.getOriginalFilename();
|
||||
// parse file
|
||||
List<ExcelSheetData> excelSheetDataList = parseExcel(filename, file.getInputStream(), true);
|
||||
List<ExcelSheetData> retrunSheetDataList = new ArrayList<>();
|
||||
List<ExcelSheetData> returnSheetDataList = new ArrayList<>();
|
||||
|
||||
if (StringUtils.isNotEmpty(tableId)) {
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.getFieldsByTableId(tableId);
|
||||
@ -2240,10 +2240,10 @@ public class DataSetTableService {
|
||||
List<TableField> tableFields = excelSheetData.getFields();
|
||||
List<String> newFields = tableFields.stream().map(TableField::getRemarks).collect(Collectors.toList());
|
||||
if (oldFields.equals(newFields)) {
|
||||
retrunSheetDataList.add(excelSheetData);
|
||||
returnSheetDataList.add(excelSheetData);
|
||||
}
|
||||
}
|
||||
if (retrunSheetDataList.size() == 0) {
|
||||
if (returnSheetDataList.size() == 0) {
|
||||
DataEaseException.throwException(Translator.get("i18n_excel_column_change"));
|
||||
}
|
||||
} else {
|
||||
@ -2278,41 +2278,41 @@ public class DataSetTableService {
|
||||
}
|
||||
excelSheetData.setEffectExtField(effectExtField);
|
||||
|
||||
retrunSheetDataList.add(excelSheetData);
|
||||
returnSheetDataList.add(excelSheetData);
|
||||
}
|
||||
if (retrunSheetDataList.size() == 0) {
|
||||
if (returnSheetDataList.size() == 0) {
|
||||
DataEaseException.throwException(Translator.get("i18n_excel_column_change"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
retrunSheetDataList = excelSheetDataList;
|
||||
returnSheetDataList = excelSheetDataList;
|
||||
}
|
||||
retrunSheetDataList = retrunSheetDataList.stream()
|
||||
returnSheetDataList = returnSheetDataList.stream()
|
||||
.filter(excelSheetData -> CollectionUtils.isNotEmpty(excelSheetData.getFields()))
|
||||
.collect(Collectors.toList());
|
||||
// save file
|
||||
String excelId = UUID.randomUUID().toString();
|
||||
String filePath = saveFile(file, excelId);
|
||||
ExcelFileData excelFileData = new ExcelFileData();
|
||||
excelFileData.setExcelLable(filename);
|
||||
excelFileData.setExcelLabel(filename);
|
||||
excelFileData.setId(excelId);
|
||||
excelFileData.setPath(filePath);
|
||||
|
||||
filename = filename.substring(0, filename.lastIndexOf('.'));
|
||||
if (retrunSheetDataList.size() == 1) {
|
||||
retrunSheetDataList.get(0).setDatasetName(filename);
|
||||
retrunSheetDataList.get(0).setSheetExcelId(excelId);
|
||||
retrunSheetDataList.get(0).setId(UUID.randomUUID().toString());
|
||||
retrunSheetDataList.get(0).setPath(filePath);
|
||||
if (returnSheetDataList.size() == 1) {
|
||||
returnSheetDataList.get(0).setDatasetName(filename);
|
||||
returnSheetDataList.get(0).setSheetExcelId(excelId);
|
||||
returnSheetDataList.get(0).setId(UUID.randomUUID().toString());
|
||||
returnSheetDataList.get(0).setPath(filePath);
|
||||
} else {
|
||||
for (ExcelSheetData excelSheetData : retrunSheetDataList) {
|
||||
excelSheetData.setDatasetName(filename + "-" + excelSheetData.getExcelLable());
|
||||
for (ExcelSheetData excelSheetData : returnSheetDataList) {
|
||||
excelSheetData.setDatasetName(filename + "-" + excelSheetData.getExcelLabel());
|
||||
excelSheetData.setSheetExcelId(excelId);
|
||||
excelSheetData.setId(UUID.randomUUID().toString());
|
||||
excelSheetData.setPath(filePath);
|
||||
}
|
||||
}
|
||||
excelFileData.setSheets(retrunSheetDataList);
|
||||
excelFileData.setSheets(returnSheetDataList);
|
||||
return excelFileData;
|
||||
}
|
||||
|
||||
@ -2359,7 +2359,7 @@ public class DataSetTableService {
|
||||
String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new);
|
||||
excelSheetData.setFields(fields);
|
||||
excelSheetData.setData(data);
|
||||
excelSheetData.setExcelLable(filename);
|
||||
excelSheetData.setExcelLabel(filename);
|
||||
excelSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ",")));
|
||||
excelSheetDataList.add(excelSheetData);
|
||||
}
|
||||
@ -2644,7 +2644,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(Between between) {
|
||||
if (hasVarible(between.getBetweenExpressionStart().toString()) || hasVarible(between.getBetweenExpressionEnd().toString())) {
|
||||
if (hasVariable(between.getBetweenExpressionStart().toString()) || hasVariable(between.getBetweenExpressionEnd().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
} else {
|
||||
getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd());
|
||||
@ -2653,7 +2653,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(MinorThan minorThan) {
|
||||
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) {
|
||||
if (hasVariable(minorThan.getLeftExpression().toString()) || hasVariable(minorThan.getRightExpression().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2664,7 +2664,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(MinorThanEquals minorThan) {
|
||||
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) {
|
||||
if (hasVariable(minorThan.getLeftExpression().toString()) || hasVariable(minorThan.getRightExpression().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2675,7 +2675,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(GreaterThanEquals minorThan) {
|
||||
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) {
|
||||
if (hasVariable(minorThan.getLeftExpression().toString()) || hasVariable(minorThan.getRightExpression().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2686,7 +2686,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(GreaterThan greaterThan) {
|
||||
if (hasVarible(greaterThan.getLeftExpression().toString()) || hasVarible(greaterThan.getRightExpression().toString())) {
|
||||
if (hasVariable(greaterThan.getLeftExpression().toString()) || hasVariable(greaterThan.getRightExpression().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2708,7 +2708,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(LikeExpression likeExpression) {
|
||||
if (hasVarible(likeExpression.toString())) {
|
||||
if (hasVariable(likeExpression.toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2723,7 +2723,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(InExpression inExpression) {
|
||||
if (inExpression.getRightItemsList() != null && hasVarible(inExpression.getRightItemsList().toString())) {
|
||||
if (inExpression.getRightItemsList() != null && hasVariable(inExpression.getRightItemsList().toString())) {
|
||||
stringBuilder.append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2752,7 +2752,7 @@ public class DataSetTableService {
|
||||
public void visit(SubSelect subSelect) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Expression in = ((PlainSelect) subSelect.getSelectBody()).getWhere();
|
||||
if (in instanceof BinaryExpression && hasVarible(in.toString())) {
|
||||
if (in instanceof BinaryExpression && hasVariable(in.toString())) {
|
||||
stringBuilder.append(SubstitutedParams);
|
||||
} else {
|
||||
in.accept(getExpressionDeParser(stringBuilder));
|
||||
@ -2777,7 +2777,7 @@ public class DataSetTableService {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (expr.getLeftExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getLeftExpression().toString())) {
|
||||
if (expr.getLeftExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getLeftExpression().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
} else {
|
||||
expr.getLeftExpression().accept(this);
|
||||
@ -2791,7 +2791,7 @@ public class DataSetTableService {
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getRightExpression().toString())) {
|
||||
if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getRightExpression().toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
} else {
|
||||
expr.getRightExpression().accept(this);
|
||||
@ -2801,7 +2801,7 @@ public class DataSetTableService {
|
||||
return expressionDeParser;
|
||||
}
|
||||
|
||||
static private boolean hasVarible(String sql) {
|
||||
static private boolean hasVariable(String sql) {
|
||||
return sql.contains(SubstitutedParams);
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ public class ExtractDataService {
|
||||
private static final String lastUpdateTime = "${__last_update_time__}";
|
||||
private static final String currentUpdateTime = "${__current_update_time__}";
|
||||
private static final String separator = "|DE|";
|
||||
private static final String extention = "txt";
|
||||
private static final String extension = "txt";
|
||||
private static final String root_path = "/opt/dataease/data/kettle/";
|
||||
|
||||
@Value("${kettle.files.keep:false}")
|
||||
@ -471,11 +471,11 @@ public class ExtractDataService {
|
||||
}
|
||||
switch (extractType) {
|
||||
case "all_scope":
|
||||
dataFile = root_path + TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())) + "." + extention;
|
||||
dataFile = root_path + TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())) + "." + extension;
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), dataFile);
|
||||
break;
|
||||
default:
|
||||
dataFile = root_path + TableUtils.addName(TableUtils.tableName(datasetTable.getId())) + "." + extention;
|
||||
dataFile = root_path + TableUtils.addName(TableUtils.tableName(datasetTable.getId())) + "." + extension;
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), dataFile);
|
||||
break;
|
||||
}
|
||||
@ -722,7 +722,7 @@ public class ExtractDataService {
|
||||
}
|
||||
|
||||
for (ExcelSheetData sheet : totalSheets) {
|
||||
if (sheet.getExcelLable().equalsIgnoreCase(excelSheetData.getExcelLable())) {
|
||||
if (sheet.getExcelLabel().equalsIgnoreCase(excelSheetData.getExcelLabel())) {
|
||||
for (List<String> dataItem : sheet.getData()) {
|
||||
if (dataItem.size() > 0) {
|
||||
data.add(dataItem.toArray(new String[dataItem.size()]));
|
||||
@ -820,16 +820,16 @@ public class ExtractDataService {
|
||||
case "all_scope":
|
||||
outFile = TableUtils.tmpName(TableUtils.tableName(datasetTable.getId()));
|
||||
jobName = "job_" + TableUtils.tableName(datasetTable.getId());
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), root_path + outFile + "." + extention);
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extension, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), root_path + outFile + "." + extension);
|
||||
break;
|
||||
case "incremental_add":
|
||||
outFile = TableUtils.addName(datasetTable.getId());
|
||||
jobName = "job_add_" + TableUtils.tableName(datasetTable.getId());
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention);
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extension, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extension);
|
||||
break;
|
||||
case "incremental_delete":
|
||||
outFile = TableUtils.deleteName(TableUtils.tableName(datasetTable.getId()));
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "DELETE", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention);
|
||||
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "DELETE", root_path + outFile + "." + extension, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extension);
|
||||
jobName = "job_delete_" + TableUtils.tableName(datasetTable.getId());
|
||||
break;
|
||||
default:
|
||||
@ -1098,7 +1098,7 @@ public class ExtractDataService {
|
||||
filesRequired.add("Y");
|
||||
|
||||
ExcelInputMeta excelInputMeta = new ExcelInputMeta();
|
||||
sheetNames.add(excelSheetData.getExcelLable());
|
||||
sheetNames.add(excelSheetData.getExcelLabel());
|
||||
if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
|
||||
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI);
|
||||
excelInputMeta.setSheetName(sheetNames.toArray(new String[sheetNames.size()]));
|
||||
@ -1141,7 +1141,7 @@ public class ExtractDataService {
|
||||
textFileOutputMeta.setHeaderEnabled(false);
|
||||
textFileOutputMeta.setFilename(root_path + dorisOutputTable);
|
||||
textFileOutputMeta.setSeparator(separator);
|
||||
textFileOutputMeta.setExtension(extention);
|
||||
textFileOutputMeta.setExtension(extension);
|
||||
|
||||
if (datasource.getType().equalsIgnoreCase(DatasourceTypes.oracle.name())) {
|
||||
TextFileField[] outputFields = new TextFileField[datasetTableFields.size() + 1];
|
||||
@ -1295,7 +1295,7 @@ public class ExtractDataService {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
deleteFile(root_path + fileName + "." + extention);
|
||||
deleteFile(root_path + fileName + "." + extension);
|
||||
deleteFile(root_path + jobName + ".kjb");
|
||||
deleteFile(root_path + transName + ".ktr");
|
||||
}
|
||||
@ -1388,8 +1388,8 @@ public class ExtractDataService {
|
||||
" r = createOutputRow(r, data.outputRowMeta.size());\n" +
|
||||
" String str = \"\";\n" +
|
||||
"\n" +
|
||||
" List<String> fileds = Arrays.asList(\"Column_Fields\".split(\",\"));\n" +
|
||||
" for (String filed : fileds) {\n" +
|
||||
" List<String> fields = Arrays.asList(\"Column_Fields\".split(\",\"));\n" +
|
||||
" for (String filed : fields) {\n" +
|
||||
" String tmp = get(Fields.In, filed).getString(r);\n" +
|
||||
"handleCharset \n" +
|
||||
"handleWraps \n" +
|
||||
|
||||
@ -73,7 +73,7 @@ public class PermissionService {
|
||||
return customFilter;
|
||||
}
|
||||
|
||||
public List<DatasetTableField> filterColumnPermissons(List<DatasetTableField> fields, List<String> desensitizationList, String datasetTableId, Long user){
|
||||
public List<DatasetTableField> filterColumnPermissions(List<DatasetTableField> fields, List<String> desensitizationList, String datasetTableId, Long user){
|
||||
List<DatasetTableField> result = new ArrayList<>();
|
||||
List<ColumnPermissionItem> allColumnPermissionItems = new ArrayList<>();
|
||||
for (DataSetColumnPermissionsDTO dataSetColumnPermissionsDTO : columnPermissions(datasetTableId, user)) {
|
||||
|
||||
@ -104,7 +104,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
if (userPermissions) {
|
||||
//列权限
|
||||
List<String> desensitizationList = new ArrayList<>();
|
||||
fields = permissionService.filterColumnPermissons(fields, desensitizationList, datasetTable.getId(), userId);
|
||||
fields = permissionService.filterColumnPermissions(fields, desensitizationList, datasetTable.getId(), userId);
|
||||
Map<String, DatasetTableField> fieldMap = fields.stream().collect(Collectors.toMap(DatasetTableField::getId, node -> node));
|
||||
permissionFields = fieldIds.stream().map(fieldMap::get).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(permissionFields) || permissionFields.get(0) == null) {
|
||||
|
||||
@ -120,18 +120,18 @@ public class PanelAppTemplateService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDatasource(List<Datasource> oldDatasourceList, List<Datasource> newDatasourceList) throws Exception {
|
||||
Map<String, String> datasourceRelaMap = new HashMap<>();
|
||||
Map<String, String> datasourceRealMap = new HashMap<>();
|
||||
for (int i = 0; i < newDatasourceList.size(); i++) {
|
||||
Datasource datasource = newDatasourceList.get(0);
|
||||
datasource.setId(null);
|
||||
Datasource newDatasource = datasourceService.addDatasource(datasource);
|
||||
datasourceRelaMap.put(oldDatasourceList.get(i).getId(), newDatasource.getId());
|
||||
datasourceRealMap.put(oldDatasourceList.get(i).getId(), newDatasource.getId());
|
||||
}
|
||||
return datasourceRelaMap;
|
||||
return datasourceRealMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyPanelView(List<PanelView> panelViewsInfo, Map<String, String> chartViewsRelaMap, String panelId) {
|
||||
public void applyPanelView(List<PanelView> panelViewsInfo, Map<String, String> chartViewsRealMap, String panelId) {
|
||||
Long time = System.currentTimeMillis();
|
||||
String userName = AuthUtils.getUser().getUsername();
|
||||
panelViewsInfo.forEach(panelView -> {
|
||||
@ -139,13 +139,13 @@ public class PanelAppTemplateService {
|
||||
panelView.setPanelId(panelId);
|
||||
panelView.setCreateTime(time);
|
||||
panelView.setCreateBy(userName);
|
||||
panelView.setChartViewId(chartViewsRelaMap.get(panelView.getChartViewId()));
|
||||
panelView.setChartViewId(chartViewsRealMap.get(panelView.getChartViewId()));
|
||||
panelViewService.save(panelView);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRelaMap, String newPanelId, String panelName, String pid) {
|
||||
public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRealMap, String newPanelId, String panelName, String pid) {
|
||||
panelInfo.setId(newPanelId);
|
||||
panelInfo.setPid(pid);
|
||||
panelInfo.setName(panelName);
|
||||
@ -153,48 +153,48 @@ public class PanelAppTemplateService {
|
||||
panelInfo.setPanelType("self");
|
||||
panelInfo.setCreateBy(AuthUtils.getUser().getUsername());
|
||||
panelInfo.setCreateTime(System.currentTimeMillis());
|
||||
panelGroupService.newPanelFromApp(panelInfo, chartViewsRelaMap);
|
||||
panelGroupService.newPanelFromApp(panelInfo, chartViewsRealMap);
|
||||
return newPanelId;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasourceRelaMap, String sceneId) throws Exception {
|
||||
Map<String, String> datasetsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasourceRealMap, String sceneId) throws Exception {
|
||||
Map<String, String> datasetsRealMap = new HashMap<>();
|
||||
for (DatasetTable datasetTable : datasetTablesInfo) {
|
||||
String oldId = datasetTable.getId();
|
||||
datasetTable.setId(null);
|
||||
datasetTable.setSceneId(sceneId);
|
||||
datasetTable.setDataSourceId(datasourceRelaMap.get(datasetTable.getDataSourceId()));
|
||||
datasetTable.setDataSourceId(datasourceRealMap.get(datasetTable.getDataSourceId()));
|
||||
DataSetTableRequest datasetRequest = new DataSetTableRequest();
|
||||
BeanUtils.copyBean(datasetRequest, datasetTable);
|
||||
datasetRequest.setOptFrom("appApply");
|
||||
datasetRequest.setSyncType("sync_now");
|
||||
DatasetTable newDataset = dataSetTableService.save(datasetRequest);
|
||||
datasetsRelaMap.put(oldId, newDataset.getId());
|
||||
datasetsRealMap.put(oldId, newDataset.getId());
|
||||
}
|
||||
return datasetsRelaMap;
|
||||
return datasetsRealMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRelaMap) {
|
||||
Map<String, String> datasetFieldsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRealMap) {
|
||||
Map<String, String> datasetFieldsRealMap = new HashMap<>();
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
String oldId = datasetTableField.getId();
|
||||
datasetTableField.setTableId(datasetsRelaMap.get(datasetTableField.getTableId()));
|
||||
datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
|
||||
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
|
||||
datasetFieldsRelaMap.put(oldId, newTableField.getId());
|
||||
datasetFieldsRealMap.put(oldId, newTableField.getId());
|
||||
}
|
||||
return datasetFieldsRelaMap;
|
||||
return datasetFieldsRealMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void resetCustomAndUnionDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasetRelaMap, Map<String, String> datasetFieldsRelaMap) throws Exception {
|
||||
public void resetCustomAndUnionDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasetRealMap, Map<String, String> datasetFieldsRealMap) throws Exception {
|
||||
for (DatasetTable datasetTable : datasetTablesInfo) {
|
||||
if ((DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTable.getType()) || DatasetType.UNION.name().equalsIgnoreCase(datasetTable.getType()))) {
|
||||
datasetRelaMap.forEach((k, v) -> {
|
||||
datasetRealMap.forEach((k, v) -> {
|
||||
datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v));
|
||||
});
|
||||
datasetFieldsRelaMap.forEach((k, v) -> {
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v));
|
||||
});
|
||||
if (1 == datasetTable.getMode()) {
|
||||
@ -209,13 +209,13 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap, String sceneId) throws Exception {
|
||||
Map<String, String> chartViewsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap, String sceneId) throws Exception {
|
||||
Map<String, String> chartViewsRealMap = new HashMap<>();
|
||||
for (ChartViewWithBLOBs chartView : chartViewsInfo) {
|
||||
String oldViewId = chartView.getId();
|
||||
// 替换datasetId
|
||||
chartView.setTableId(datasetsRelaMap.get(chartView.getTableId()));
|
||||
datasetsRelaMap.forEach((k, v) -> {
|
||||
chartView.setTableId(datasetsRealMap.get(chartView.getTableId()));
|
||||
datasetsRealMap.forEach((k, v) -> {
|
||||
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
|
||||
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
|
||||
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
|
||||
@ -228,7 +228,7 @@ public class PanelAppTemplateService {
|
||||
chartView.setDrillFields(chartView.getDrillFields().replaceAll(k, v));
|
||||
});
|
||||
//替换datasetFieldId
|
||||
datasetFieldsRelaMap.forEach((k, v) -> {
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
|
||||
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
|
||||
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
|
||||
@ -243,31 +243,31 @@ public class PanelAppTemplateService {
|
||||
chartView.setId(null);
|
||||
chartView.setSceneId(sceneId);
|
||||
ChartViewWithBLOBs newOne = chartViewService.newOne(chartView);
|
||||
chartViewsRelaMap.put(oldViewId, newOne.getId());
|
||||
chartViewsRealMap.put(oldViewId, newOne.getId());
|
||||
}
|
||||
return chartViewsRelaMap;
|
||||
return chartViewsRealMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRelaMap, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap) {
|
||||
Map<String, String> chartViewFieldsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRealMap, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap) {
|
||||
Map<String, String> chartViewFieldsRealMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(chartViewFieldsInfo)) {
|
||||
for (ChartViewField chartViewField : chartViewFieldsInfo) {
|
||||
String oldChartFieldId = chartViewField.getId();
|
||||
chartViewField.setId(null);
|
||||
//替换datasetId
|
||||
chartViewField.setTableId(datasetsRelaMap.get(chartViewField.getTableId()));
|
||||
chartViewField.setTableId(datasetsRealMap.get(chartViewField.getTableId()));
|
||||
//替换chartViewId
|
||||
chartViewField.setChartId(chartViewsRelaMap.get(chartViewField.getId()));
|
||||
chartViewField.setChartId(chartViewsRealMap.get(chartViewField.getId()));
|
||||
//替换datasetFieldId
|
||||
datasetFieldsRelaMap.forEach((k, v) -> {
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
chartViewField.setOriginName(chartViewField.getOriginName().replaceAll(k, v));
|
||||
});
|
||||
ChartViewField newChartViewField = chartViewFieldService.save(chartViewField);
|
||||
chartViewFieldsRelaMap.put(oldChartFieldId, newChartViewField.getId());
|
||||
chartViewFieldsRealMap.put(oldChartFieldId, newChartViewField.getId());
|
||||
}
|
||||
}
|
||||
return chartViewFieldsRelaMap;
|
||||
return chartViewFieldsRealMap;
|
||||
}
|
||||
|
||||
public void nameCheck(PanelAppTemplateApplyRequest request) {
|
||||
|
||||
@ -401,12 +401,12 @@ public class PanelGroupService {
|
||||
return newPanelId;
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String newPanelFromApp(PanelGroupRequest request,Map<String,String> chartViewsRelaMap){
|
||||
public String newPanelFromApp(PanelGroupRequest request,Map<String,String> chartViewsRealMap){
|
||||
String newPanelId = request.getId();
|
||||
String templateData = request.getPanelData();
|
||||
String staticResource = request.getStaticResource();
|
||||
Boolean mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
for(Map.Entry<String,String> entry:chartViewsRelaMap.entrySet()){
|
||||
Boolean mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
for(Map.Entry<String,String> entry:chartViewsRealMap.entrySet()){
|
||||
templateData = templateData.replaceAll(entry.getKey(),entry.getValue());
|
||||
}
|
||||
request.setMobileLayout(mobileLayout);
|
||||
@ -439,13 +439,13 @@ public class PanelGroupService {
|
||||
templateStyle = panelTemplate.getTemplateStyle();
|
||||
templateData = panelTemplate.getTemplateData();
|
||||
dynamicData = panelTemplate.getDynamicData();
|
||||
mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
} else if (PanelConstants.NEW_PANEL_FROM.NEW_OUTER_TEMPLATE.equals(newFrom)) {
|
||||
templateStyle = request.getPanelStyle();
|
||||
templateData = request.getPanelData();
|
||||
dynamicData = request.getDynamicData();
|
||||
staticResource = request.getStaticResource();
|
||||
mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
} else if (PanelConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)) {
|
||||
PanelTemplateFileDTO templateFileInfo = getTemplateFromMarket(request.getTemplateUrl());
|
||||
if (templateFileInfo == null) {
|
||||
@ -455,7 +455,7 @@ public class PanelGroupService {
|
||||
templateData = templateFileInfo.getPanelData();
|
||||
dynamicData = templateFileInfo.getDynamicData();
|
||||
staticResource = templateFileInfo.getStaticResource();
|
||||
mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
}
|
||||
Map<String, String> dynamicDataMap = gson.fromJson(dynamicData, Map.class);
|
||||
if (dynamicDataMap == null) {
|
||||
@ -803,7 +803,7 @@ public class PanelGroupService {
|
||||
if (CollectionUtils.isEmpty(datasourceDTOS)) {
|
||||
return new PanelExport2App("this panel don't have datasource");
|
||||
} else if (datasourceDTOS.size() > 1) {
|
||||
return new PanelExport2App("this panel should hava only one dataset");
|
||||
return new PanelExport2App("this panel should have only one dataset");
|
||||
}
|
||||
return new PanelExport2App(chartViewsInfo, chartViewFieldsInfo, datasetTablesInfo, datasetTableFieldsInfo, dataSetTasksInfo, datasourceDTOS,panelViews);
|
||||
}
|
||||
@ -841,23 +841,23 @@ public class PanelGroupService {
|
||||
//获取仪表板视图信息
|
||||
List<PanelView> panelViewsInfo = gson.fromJson(appInfo.getPanelViewsInfo(), new TypeToken<List<PanelView>>(){}.getType());
|
||||
|
||||
Map<String,String> datasourceRelaMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo,request.getDatasourceList());
|
||||
Map<String,String> datasourceRealMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo,request.getDatasourceList());
|
||||
|
||||
Map<String,String> datasetsRelaMap = panelAppTemplateService.applyDataset(datasetTablesInfo,datasourceRelaMap,asideDatasetGroupId);
|
||||
Map<String,String> datasetsRealMap = panelAppTemplateService.applyDataset(datasetTablesInfo,datasourceRealMap,asideDatasetGroupId);
|
||||
|
||||
Map<String,String> datasetFieldsRelaMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo,datasetsRelaMap);
|
||||
Map<String,String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo,datasetsRealMap);
|
||||
|
||||
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo,datasetsRelaMap,datasetFieldsRelaMap);
|
||||
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo,datasetsRealMap,datasetFieldsRealMap);
|
||||
|
||||
Map<String,String> chartViewsRelaMap = panelAppTemplateService.applyViews(chartViewsInfo,datasetsRelaMap,datasetFieldsRelaMap,newPanelId);
|
||||
Map<String,String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo,datasetsRealMap,datasetFieldsRealMap,newPanelId);
|
||||
|
||||
panelAppTemplateService.applyViewsField(chartViewFieldsInfo,chartViewsRelaMap,datasetsRelaMap,datasetFieldsRelaMap);
|
||||
panelAppTemplateService.applyViewsField(chartViewFieldsInfo,chartViewsRealMap,datasetsRealMap,datasetFieldsRealMap);
|
||||
|
||||
panelAppTemplateService.applyPanel(panelInfo,chartViewsRelaMap,newPanelId, request.getPanelName(), request.getPanelId());
|
||||
panelAppTemplateService.applyPanel(panelInfo,chartViewsRealMap,newPanelId, request.getPanelName(), request.getPanelId());
|
||||
|
||||
panelAppTemplateService.applyPanelView(panelViewsInfo,chartViewsRelaMap,newPanelId);
|
||||
panelAppTemplateService.applyPanelView(panelViewsInfo,chartViewsRealMap,newPanelId);
|
||||
|
||||
String newDatasourceId =datasourceRelaMap.entrySet().stream().findFirst().get().getValue();
|
||||
String newDatasourceId =datasourceRealMap.entrySet().stream().findFirst().get().getValue();
|
||||
|
||||
String newDatasourceName = request.getDatasourceList().get(0).getName();
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ public class PanelViewService {
|
||||
return viewIds;
|
||||
}
|
||||
|
||||
public Boolean havaMobileLayout(String panelData){
|
||||
public Boolean haveMobileLayout(String panelData){
|
||||
Boolean mobileLayout = false;
|
||||
if (StringUtils.isNotEmpty(panelData)) {
|
||||
JsonArray dataArray = JsonParser.parseString(panelData).getAsJsonArray();
|
||||
|
||||
@ -351,16 +351,16 @@ public class ShareService {
|
||||
param.put("deptId", deptId);
|
||||
param.put("roleIds", CollectionUtils.isNotEmpty(roleIds)? roleIds: null);
|
||||
|
||||
List<PanelSharePo> datas = extPanelShareMapper.query(param);
|
||||
List<PanelShareDto> dtoLists = datas.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po))
|
||||
List<PanelSharePo> data = extPanelShareMapper.query(param);
|
||||
List<PanelShareDto> dtoLists = data.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po))
|
||||
.collect(Collectors.toList());
|
||||
return convertTree(dtoLists);
|
||||
}
|
||||
|
||||
// List构建Tree
|
||||
private List<PanelShareDto> convertTree(List<PanelShareDto> datas) {
|
||||
private List<PanelShareDto> convertTree(List<PanelShareDto> data) {
|
||||
String username = AuthUtils.getUser().getUsername();
|
||||
Map<String, List<PanelShareDto>> map = datas.stream()
|
||||
Map<String, List<PanelShareDto>> map = data.stream()
|
||||
.filter(panelShareDto -> StringUtils.isNotEmpty(panelShareDto.getCreator())
|
||||
&& !StringUtils.equals(username, panelShareDto.getCreator()))
|
||||
.collect(Collectors.groupingBy(PanelShareDto::getCreator));
|
||||
|
||||
@ -48,18 +48,18 @@ public class AppLogManager {
|
||||
|
||||
public String detailInfo(SysLogWithBLOBs vo) {
|
||||
String sourceName = vo.getSourceName();
|
||||
String postion = null;
|
||||
String position = null;
|
||||
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
|
||||
operateTypeName = Translator.get(operateTypeName);
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
|
||||
sourceTypeName = Translator.get(sourceTypeName);
|
||||
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
|
||||
|
||||
if ((postion = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(postion, type);
|
||||
if ((position = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(position, type);
|
||||
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
|
||||
String postionResult = String.format(positionFormat, template);
|
||||
return postionResult + result;
|
||||
String positionResult = String.format(positionFormat, template);
|
||||
return positionResult + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -113,9 +113,9 @@ public class MenuService {
|
||||
return sysMenuMapper.updateByPrimaryKeySelective(sysMenu);
|
||||
}
|
||||
|
||||
public List<MenuNodeResponse> childs(Long pid) {
|
||||
Set<SysMenu> childs = getChilds(nodesByPid(pid), new HashSet());
|
||||
List<SysMenu> menus = new ArrayList<>(childs);
|
||||
public List<MenuNodeResponse> children(Long pid) {
|
||||
Set<SysMenu> children = getChildren(nodesByPid(pid), new HashSet());
|
||||
List<SysMenu> menus = new ArrayList<>(children);
|
||||
return convert(menus);
|
||||
}
|
||||
|
||||
@ -138,12 +138,12 @@ public class MenuService {
|
||||
return roots.stream().map(node -> node.getMenuId().equals(targetRootNode.getId()) ? targetRootNode : format(node)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private Set<SysMenu> getChilds(List<SysMenu> lists, Set<SysMenu> sets) {
|
||||
private Set<SysMenu> getChildren(List<SysMenu> lists, Set<SysMenu> sets) {
|
||||
lists.forEach(menu -> {
|
||||
sets.add(menu);
|
||||
List<SysMenu> kidMenus = nodesByPid(menu.getMenuId());
|
||||
if (CollectionUtils.isNotEmpty(kidMenus)) {
|
||||
getChilds(kidMenus, sets);
|
||||
getChildren(kidMenus, sets);
|
||||
}
|
||||
});
|
||||
return sets;
|
||||
|
||||
@ -48,18 +48,18 @@ public class LogManager {
|
||||
|
||||
public String detailInfo(SysLogWithBLOBs vo) {
|
||||
String sourceName = vo.getSourceName();
|
||||
String postion = null;
|
||||
String position = null;
|
||||
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
|
||||
operateTypeName = Translator.get(operateTypeName);
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
|
||||
sourceTypeName = Translator.get(sourceTypeName);
|
||||
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
|
||||
|
||||
if ((postion = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(postion, type);
|
||||
if ((position = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(position, type);
|
||||
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
|
||||
String postionResult = String.format(positionFormat, template);
|
||||
return postionResult + result;
|
||||
String positionResult = String.format(positionFormat, template);
|
||||
return positionResult + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user