commit
7bca7b9bac
@ -67,7 +67,12 @@ public class DataSetTableTaskController {
|
||||
@PostMapping("list/{goPage}/{pageSize}")
|
||||
public Pager<List<DataSetTaskDTO>> list(@RequestBody DatasetTableTask datasetTableTask, @PathVariable int goPage, @PathVariable int pageSize) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
return PageUtils.setPageInfo(page, dataSetTableTaskService.list(datasetTableTask));
|
||||
Pager<List<DataSetTaskDTO>> listPager = PageUtils.setPageInfo(page, dataSetTableTaskService.list(datasetTableTask));
|
||||
List<DataSetTaskDTO> listObject = listPager.getListObject();
|
||||
for (DataSetTaskDTO dto : listObject) {
|
||||
dataSetTableTaskLogService.lastExecStatus(dto);
|
||||
}
|
||||
return listPager;
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询")
|
||||
|
||||
@ -3,15 +3,15 @@
|
||||
<mapper namespace="io.dataease.ext.HomeMapper">
|
||||
|
||||
<select id="queryStore" resultType="io.dataease.mobile.dto.HomeItemDTO">
|
||||
select
|
||||
s.panel_group_id as id,
|
||||
g.name as title,
|
||||
s.create_time as `time`
|
||||
select
|
||||
s.panel_group_id as id,
|
||||
g.name as title,
|
||||
s.create_time as `time`
|
||||
from( SELECT GET_V_AUTH_MODEL_ID_P_USE_MOBILE ( #{userId}, 'panel' ) cids ) t, panel_store s
|
||||
inner join panel_group g
|
||||
on s.panel_group_id = g.id
|
||||
on s.panel_group_id = g.id
|
||||
where s.user_id = #{userId}
|
||||
and FIND_IN_SET( g.id, cids )
|
||||
and FIND_IN_SET( g.id, cids )
|
||||
<if test="lastTime != null">
|
||||
and #{lastTime} > s.create_time
|
||||
</if>
|
||||
@ -20,25 +20,32 @@
|
||||
|
||||
<select id="queryShare" resultType="io.dataease.mobile.dto.HomeItemShareDTO">
|
||||
select
|
||||
distinct(s.panel_group_id) as id,
|
||||
g.name as title,
|
||||
s.create_time as `time`,
|
||||
u.nick_name,
|
||||
u.user_id
|
||||
distinct(s.panel_group_id) as id,
|
||||
g.name as title,
|
||||
s.create_time as `time`,
|
||||
u.nick_name,
|
||||
u.user_id
|
||||
from panel_share s
|
||||
inner join panel_group g
|
||||
on s.panel_group_id = g.id
|
||||
on s.panel_group_id = g.id
|
||||
left join sys_user u on u.username = IFNULL(s.granter,g.create_by)
|
||||
where
|
||||
g.mobile_layout = 1 and (
|
||||
( s.target_id = #{userId} and s.type = 0 ) or
|
||||
( s.target_id = #{deptId} and s.type = 2 ) or
|
||||
( s.target_id in
|
||||
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
|
||||
#{roleId}
|
||||
</foreach>
|
||||
and s.type = 1 )
|
||||
)
|
||||
g.mobile_layout = 1 and (
|
||||
( s.target_id = #{userId} and s.type = 0 )
|
||||
<if test="deptId != null">
|
||||
or ( s.target_id = #{deptId} and s.type = 2 )
|
||||
</if>
|
||||
|
||||
<if test="roleIds != null">
|
||||
or
|
||||
( s.target_id in
|
||||
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
|
||||
#{roleId}
|
||||
</foreach>
|
||||
and s.type = 1 )
|
||||
</if>
|
||||
|
||||
)
|
||||
<if test="lastTime != null">
|
||||
and #{lastTime} > s.create_time
|
||||
</if>
|
||||
@ -46,6 +53,4 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -11,7 +11,9 @@ import io.dataease.mobile.dto.HomeItemDTO;
|
||||
import io.dataease.mobile.dto.HomeItemShareDTO;
|
||||
import io.dataease.ext.HomeMapper;
|
||||
import io.dataease.mobile.dto.HomeRequest;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -47,7 +49,10 @@ public class HomeService {
|
||||
List<Long> roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());
|
||||
|
||||
param.put("deptId", deptId);
|
||||
param.put("roleIds", roleIds);
|
||||
if (CollectionUtils.isNotEmpty(roleIds)) {
|
||||
param.put("roleIds", roleIds);
|
||||
}
|
||||
|
||||
if (null != request.getLastTime()) {
|
||||
param.put("lastTime", request.getLastTime());
|
||||
}
|
||||
|
||||
@ -89,8 +89,8 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
}
|
||||
DatabaseMetaData databaseMetaData = connection.getMetaData();
|
||||
String tableNamePattern = datasourceRequest.getTable();
|
||||
if(datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.mysql.name())){
|
||||
if(databaseMetaData.getDriverMajorVersion() < 8){
|
||||
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.mysql.name())) {
|
||||
if (databaseMetaData.getDriverMajorVersion() < 8) {
|
||||
tableNamePattern = String.format(MySQLConstants.KEYWORD_TABLE, tableNamePattern);
|
||||
}
|
||||
}
|
||||
@ -98,29 +98,36 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
while (resultSet.next()) {
|
||||
String tableName = resultSet.getString("TABLE_NAME");
|
||||
String database;
|
||||
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.pg.name()) ||datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.ck.name()) || datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.impala.name())) {
|
||||
String schema = resultSet.getString("TABLE_SCHEM");
|
||||
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.pg.name()) || datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.ck.name())
|
||||
|| datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.impala.name())) {
|
||||
database = resultSet.getString("TABLE_SCHEM");
|
||||
} else {
|
||||
database = resultSet.getString("TABLE_CAT");
|
||||
}
|
||||
if(datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.pg.name())){
|
||||
if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDsSchema(datasourceRequest))) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
}else {
|
||||
if (database != null) {
|
||||
if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDatabase(datasourceRequest))) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
} else {
|
||||
if (tableName.equals(datasourceRequest.getTable())) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.pg.name())) {
|
||||
if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDsSchema(datasourceRequest))) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
} else if (datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.sqlServer.name())) {
|
||||
if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDatabase(datasourceRequest)) && schema.equalsIgnoreCase(getDsSchema(datasourceRequest))) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
} else {
|
||||
if (database != null) {
|
||||
if (tableName.equals(datasourceRequest.getTable()) && database.equalsIgnoreCase(getDatabase(datasourceRequest))) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
} else {
|
||||
if (tableName.equals(datasourceRequest.getTable())) {
|
||||
TableField tableField = getTableFiled(resultSet, datasourceRequest);
|
||||
list.add(tableField);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
resultSet.close();
|
||||
@ -165,9 +172,9 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
} else {
|
||||
String size = resultSet.getString("COLUMN_SIZE");
|
||||
if (size == null) {
|
||||
if(dbType.equals("JSON") && datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.mysql.name())){
|
||||
if (dbType.equals("JSON") && datasourceRequest.getDatasource().getType().equalsIgnoreCase(DatasourceTypes.mysql.name())) {
|
||||
tableField.setFieldSize(65535);
|
||||
}else {
|
||||
} else {
|
||||
tableField.setFieldSize(1);
|
||||
}
|
||||
|
||||
@ -176,7 +183,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(tableField.getFieldType()) && tableField.getFieldType().equalsIgnoreCase("DECIMAL")){
|
||||
if (StringUtils.isNotEmpty(tableField.getFieldType()) && tableField.getFieldType().equalsIgnoreCase("DECIMAL")) {
|
||||
tableField.setAccuracy(Integer.valueOf(resultSet.getString("DECIMAL_DIGITS")));
|
||||
}
|
||||
return tableField;
|
||||
@ -746,16 +753,16 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConfiguration(Datasource datasource)throws Exception{
|
||||
if (StringUtils.isEmpty(datasource.getConfiguration())){
|
||||
public void checkConfiguration(Datasource datasource) throws Exception {
|
||||
if (StringUtils.isEmpty(datasource.getConfiguration())) {
|
||||
throw new Exception("Datasource configuration is empty");
|
||||
}
|
||||
try {
|
||||
JdbcConfiguration jdbcConfiguration = new Gson().fromJson(datasource.getConfiguration(), JdbcConfiguration.class);
|
||||
if(jdbcConfiguration.getQueryTimeout() < 0){
|
||||
throw new Exception("Querytimeout cannot be less than zero." );
|
||||
if (jdbcConfiguration.getQueryTimeout() < 0) {
|
||||
throw new Exception("Querytimeout cannot be less than zero.");
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Invalid configuration: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ public class DataSetTableService {
|
||||
datasetTableTask.setTableId(datasetTable.getId());
|
||||
datasetTableTask.setRate(ScheduleType.SIMPLE.toString());
|
||||
datasetTableTask.setType("all_scope");
|
||||
datasetTableTask.setName(datasetTable.getName() + " 更新设置");
|
||||
datasetTableTask.setName(datasetTable.getName() + " 更新设置-" + System.currentTimeMillis());
|
||||
datasetTableTask.setEnd("0");
|
||||
datasetTableTask.setStatus(TaskStatus.Underway.name());
|
||||
datasetTableTask.setStartTime(System.currentTimeMillis());
|
||||
|
||||
@ -81,11 +81,13 @@ public class PanelAppTemplateService {
|
||||
if (StringUtils.isEmpty(requestTemplate.getNodeType())) {
|
||||
requestTemplate.setNodeType("template");
|
||||
}
|
||||
//Store static resource into the server
|
||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||
panelAppTemplateMapper.insertSelective(requestTemplate);
|
||||
if(StringUtils.isNotEmpty(request.getSnapshot())){
|
||||
//Store static resource into the server
|
||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||
panelAppTemplateMapper.insertSelective(requestTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -96,9 +98,11 @@ public class PanelAppTemplateService {
|
||||
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
|
||||
BeanUtils.copyBean(requestTemplate, request);
|
||||
//Store static resource into the server
|
||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||
if(StringUtils.isNotEmpty(request.getSnapshot())){
|
||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||
}
|
||||
panelAppTemplateMapper.updateByPrimaryKeySelective(requestTemplate);
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`,
|
||||
DROP FUNCTION IF EXISTS `GET_V_AUTH_MODEL_WITH_CHILDREN`;
|
||||
delimiter ;;
|
||||
CREATE FUNCTION `GET_V_AUTH_MODEL_WITH_CHILDREN`(parentId longtext,modelType varchar(255))
|
||||
RETURNS longtext CHARSET utf8mb4
|
||||
RETURNS longtext CHARSET utf8mb4 COLLATE utf8mb4_general_ci
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
|
||||
@ -176,7 +176,7 @@ delimiter ;
|
||||
DROP FUNCTION IF EXISTS `GET_V_AUTH_MODEL_WITH_PARENT`;
|
||||
delimiter ;;
|
||||
CREATE FUNCTION `GET_V_AUTH_MODEL_WITH_PARENT`(childrenId longtext,modelType varchar(255))
|
||||
RETURNS longtext CHARSET utf8mb4
|
||||
RETURNS longtext CHARSET utf8mb4 COLLATE utf8mb4_general_ci
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@
|
||||
:append-to-body="true"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<UserViewMobileDialog
|
||||
<user-view-mobile-dialog
|
||||
v-if="mobileChartDetailsVisible"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:chart="showChartInfo"
|
||||
@ -211,10 +211,11 @@ import DeRichTextView from '@/components/canvas/custom-component/DeRichTextView'
|
||||
import Vue from 'vue'
|
||||
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
|
||||
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
|
||||
import UserViewMobileDialog from '@/components/canvas/custom-component/UserViewMobileDialog'
|
||||
|
||||
export default {
|
||||
name: 'UserView',
|
||||
components: { UserViewDialog, DeRichTextView, LabelNormalText, PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 },
|
||||
components: { UserViewMobileDialog, UserViewDialog, DeRichTextView, LabelNormalText, PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 },
|
||||
props: {
|
||||
canvasId: {
|
||||
type: String,
|
||||
@ -807,7 +808,6 @@ export default {
|
||||
this.showChartInfo = this.chart
|
||||
this.showChartTableInfo = tableChart
|
||||
this.showChartInfoType = params.openType
|
||||
this.chartDetailsVisible = true
|
||||
if (this.terminal === 'pc') {
|
||||
this.chartDetailsVisible = true
|
||||
} else {
|
||||
|
||||
@ -211,16 +211,16 @@
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<el-input
|
||||
v-if="scope.row.deType === 1"
|
||||
v-model="scope.row.dateFormat"
|
||||
:placeholder="$t('dataset.date_format')"
|
||||
size="small"
|
||||
class="input-type"
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
@blur="saveEdit(scope.row)"
|
||||
@keyup.enter.native="saveEdit(scope.row)"
|
||||
/>
|
||||
<!-- <el-input-->
|
||||
<!-- v-if="scope.row.deType === 1"-->
|
||||
<!-- v-model="scope.row.dateFormat"-->
|
||||
<!-- :placeholder="$t('dataset.date_format')"-->
|
||||
<!-- size="small"-->
|
||||
<!-- class="input-type"-->
|
||||
<!-- :disabled="!hasDataPermission('manage', param.privileges)"-->
|
||||
<!-- @blur="saveEdit(scope.row)"-->
|
||||
<!-- @keyup.enter.native="saveEdit(scope.row)"-->
|
||||
<!-- />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -548,16 +548,16 @@
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<el-input
|
||||
v-if="scope.row.deType === 1"
|
||||
v-model="scope.row.dateFormat"
|
||||
:placeholder="$t('dataset.date_format')"
|
||||
size="small"
|
||||
class="input-type"
|
||||
:disabled="!hasDataPermission('manage', param.privileges)"
|
||||
@blur="saveEdit(scope.row)"
|
||||
@keyup.enter.native="saveEdit(scope.row)"
|
||||
/>
|
||||
<!-- <el-input-->
|
||||
<!-- v-if="scope.row.deType === 1"-->
|
||||
<!-- v-model="scope.row.dateFormat"-->
|
||||
<!-- :placeholder="$t('dataset.date_format')"-->
|
||||
<!-- size="small"-->
|
||||
<!-- class="input-type"-->
|
||||
<!-- :disabled="!hasDataPermission('manage', param.privileges)"-->
|
||||
<!-- @blur="saveEdit(scope.row)"-->
|
||||
<!-- @keyup.enter.native="saveEdit(scope.row)"-->
|
||||
<!-- />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
||||
@ -68,8 +68,15 @@
|
||||
v-if="scope.row.lastExecStatus"
|
||||
:class="[`de-${scope.row.lastExecStatus}-pre`, 'de-status']"
|
||||
>{{
|
||||
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
||||
}}
|
||||
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
||||
}}
|
||||
<svg-icon
|
||||
v-if="scope.row.lastExecStatus === 'Error'"
|
||||
style="cursor: pointer;"
|
||||
icon-class="icon-maybe"
|
||||
class="field-icon-location"
|
||||
@click="showErrorMassage(scope.row.msg)"
|
||||
/>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user