Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
5770ee9a42
@ -107,7 +107,7 @@ public class AuthServer implements AuthApi {
|
||||
public String test() {
|
||||
SysUserEntity userById = authUserService.getUserById(4L);
|
||||
String nickName = userById.getNickName();
|
||||
System.out.println(nickName);
|
||||
// System.out.println(nickName);
|
||||
/* Map<String, DePluginXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType(DePluginXpackService.class);
|
||||
for (Map.Entry entry : beansOfType.entrySet()) {
|
||||
Object key = entry.getKey();
|
||||
|
||||
@ -97,10 +97,10 @@ public class JWTUtils {
|
||||
isExpire = now - lastOperateTime > Login_Interval;
|
||||
}
|
||||
if (isExpire) {
|
||||
System.out.println("-----------------------");
|
||||
System.out.println("-----上次操作时间是["+lastOperateTime+"]-----");
|
||||
System.out.println("-----当前操作时间是["+now+"]-----");
|
||||
System.out.println("-----------------------");
|
||||
// System.out.println("-----------------------");
|
||||
// System.out.println("-----上次操作时间是["+lastOperateTime+"]-----");
|
||||
// System.out.println("-----当前操作时间是["+now+"]-----");
|
||||
// System.out.println("-----------------------");
|
||||
}
|
||||
return isExpire;
|
||||
}
|
||||
|
||||
@ -96,19 +96,19 @@ public class DateUtils {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("start:");
|
||||
// System.out.println("start:");
|
||||
Date paramTime = getTime(getTimeString(new Long("1607672440731")));
|
||||
|
||||
Map<String, Date> weekDate = getWeedFirstTimeAndLastTime(paramTime);
|
||||
|
||||
for (Map.Entry<String, Date> entry :
|
||||
weekDate.entrySet()) {
|
||||
System.out.println(entry.getKey() + ":" + getTimeString(entry.getValue())+":"+entry.getValue().getTime());
|
||||
// System.out.println(entry.getKey() + ":" + getTimeString(entry.getValue())+":"+entry.getValue().getTime());
|
||||
}
|
||||
|
||||
long countTimeLong = new Long("1607672440731");
|
||||
|
||||
System.out.println(getTimeString(--countTimeLong));
|
||||
// System.out.println(getTimeString(--countTimeLong));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ public class DeFileUtils {
|
||||
// 检测是否存在目录
|
||||
if (!dest.getParentFile().exists()) {
|
||||
if (!dest.getParentFile().mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
// System.out.println("was not successful.");
|
||||
}
|
||||
}
|
||||
// 文件写入
|
||||
|
||||
@ -30,15 +30,12 @@ public class ZipUtils {
|
||||
while (ze != null) {
|
||||
String fileName = ze.getName();
|
||||
File newFile = new File(outputFolder + File.separator + fileName);
|
||||
System.out.println("file unzip : " + newFile.getAbsoluteFile());
|
||||
//大部分网络上的源码,这里没有判断子目录
|
||||
if (ze.isDirectory()) {
|
||||
if (!newFile.mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
} else {
|
||||
if (!new File(newFile.getParent()).mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
FileOutputStream fos = new FileOutputStream(newFile);
|
||||
int len;
|
||||
@ -51,7 +48,6 @@ public class ZipUtils {
|
||||
}
|
||||
zis.closeEntry();
|
||||
zis.close();
|
||||
System.out.println("Done");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -68,14 +64,12 @@ public class ZipUtils {
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
if (!file.mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
} else {
|
||||
File parent = file.getParentFile();
|
||||
|
||||
if (!parent.exists()) {
|
||||
if (!parent.mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +101,6 @@ public class ZipUtils {
|
||||
File desDir = new File(folderPath);
|
||||
if (!desDir.exists()) {
|
||||
if (!desDir.mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
}
|
||||
ZipFile zf = new ZipFile(zipFile);
|
||||
@ -120,7 +113,6 @@ public class ZipUtils {
|
||||
File fileParentDir = desFile.getParentFile();
|
||||
if (!fileParentDir.exists()) {
|
||||
if (!fileParentDir.mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ public class ModuleClassLoader extends URLClassLoader {
|
||||
|
||||
SpringContextUtil.getBeanFactory().registerBeanDefinition(beanName,beanDefinition);
|
||||
registeredBean.add(beanName);
|
||||
System.out.println("注册bean:"+beanName);
|
||||
// System.out.println("注册bean:"+beanName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,9 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -255,6 +257,8 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
return " IS NULL ";
|
||||
case "not_null":
|
||||
return " IS NOT NULL ";
|
||||
case "between":
|
||||
return " BETWEEN ";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@ -285,6 +289,11 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
filter.append("('").append(StringUtils.join(value, "','")).append("')");
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "like")) {
|
||||
filter.append("'%").append(value.get(0)).append("%'");
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
|
||||
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
|
||||
filter.append("'").append(startTime).append("' AND '").append(endTime).append("'");
|
||||
} else {
|
||||
filter.append("'").append(value.get(0)).append("'");
|
||||
}
|
||||
|
||||
@ -9,7 +9,9 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -262,6 +264,8 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
return " IS NULL ";
|
||||
case "not_null":
|
||||
return " IS NOT NULL ";
|
||||
case "between":
|
||||
return " BETWEEN ";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@ -292,6 +296,11 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
filter.append("('").append(StringUtils.join(value, "','")).append("')");
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "like")) {
|
||||
filter.append("'%").append(value.get(0)).append("%'");
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
|
||||
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
|
||||
filter.append("'").append(startTime).append("' AND '").append(endTime).append("'");
|
||||
} else {
|
||||
filter.append("'").append(value.get(0)).append("'");
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package io.dataease.service.dataset.impl.direct;
|
||||
import io.dataease.base.domain.DatasetTable;
|
||||
import io.dataease.base.domain.DatasetTableField;
|
||||
import io.dataease.base.domain.Datasource;
|
||||
import io.dataease.commons.utils.CommonBeanFactory;
|
||||
import io.dataease.datasource.provider.DatasourceProvider;
|
||||
import io.dataease.datasource.provider.ProviderFactory;
|
||||
import io.dataease.datasource.request.DatasourceRequest;
|
||||
@ -53,15 +54,26 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
if (ObjectUtils.isEmpty(datasetTable) || StringUtils.isEmpty(datasetTable.getName())) return null;
|
||||
String tableName = datasetTable.getName();
|
||||
|
||||
String dataSourceId = datasetTable.getDataSourceId();
|
||||
if (StringUtils.isEmpty(dataSourceId)) return null;
|
||||
Datasource ds = datasourceService.get(dataSourceId);
|
||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(ds);
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
String querySQL = qp.createQuerySQL(tableName, Collections.singletonList(field));
|
||||
datasourceRequest.setQuery(querySQL);
|
||||
DatasourceProvider datasourceProvider;
|
||||
if (datasetTable.getMode() == 0) {
|
||||
String dataSourceId = datasetTable.getDataSourceId();
|
||||
if (StringUtils.isEmpty(dataSourceId)) return null;
|
||||
Datasource ds = datasourceService.get(dataSourceId);
|
||||
datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
datasourceRequest.setDatasource(ds);
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
String querySQL = qp.createQuerySQL(tableName, Collections.singletonList(field));
|
||||
datasourceRequest.setQuery(querySQL);
|
||||
} else {
|
||||
Datasource ds = (Datasource) CommonBeanFactory.getBean("DorisDatasource");
|
||||
datasourceProvider = ProviderFactory.getProvider(ds.getType());
|
||||
datasourceRequest.setDatasource(ds);
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
String querySQL = qp.createQuerySQL(tableName, Collections.singletonList(field));
|
||||
datasourceRequest.setQuery(querySQL);
|
||||
}
|
||||
|
||||
try {
|
||||
List<String[]> rows = datasourceProvider.getData(datasourceRequest);
|
||||
List<Object> results = rows.stream().map(row -> row[0]).distinct().collect(Collectors.toList());
|
||||
|
||||
@ -265,6 +265,6 @@ public class SystemParameterService {
|
||||
public static void main(String[] args) {
|
||||
String info="[{\"paramKey\":\"base.url\",\"paramValue\":null,\"type\":\"text\",\"sort\":1,\"file\":null,\"fileName\":null},{\"paramKey\":\"base.title\",\"paramValue\":\"DataEase Title\",\"type\":\"text\",\"sort\":3,\"file\":null,\"fileName\":null},{\"paramKey\":\"base.logo\",\"paramValue\":\"DataEase\",\"type\":\"text\",\"sort\":4,\"file\":null,\"fileName\":\"favicon.icon.png\"}]";
|
||||
List<SystemParameterDTO> temp = JSON.parseArray(info,SystemParameterDTO.class);
|
||||
System.out.println("===>");
|
||||
// System.out.println("===>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,9 +56,9 @@ rsa.public_key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD2
|
||||
spring.cache.type=ehcache
|
||||
spring.cache.ehcache.config=classpath:/ehcache/ehcache.xml
|
||||
#打印URL路径
|
||||
logging.level.org.springframework.web=trace
|
||||
logging.level.org.springframework.boot.web=trace
|
||||
spring.mvc.log-request-details=true
|
||||
#logging.level.org.springframework.web=trace
|
||||
#logging.level.org.springframework.boot.web=trace
|
||||
#spring.mvc.log-request-details=true
|
||||
pagehelper.PageRowBounds=true
|
||||
#excel等用户上传文件路径
|
||||
upload.file.path=/opt/dataease/data/kettle/
|
||||
|
||||
@ -42,9 +42,9 @@ INSERT INTO `sys_menu` VALUES (36, 1, 0, 1, '菜单表单', 'system-menu-form',
|
||||
INSERT INTO `sys_menu` VALUES (37, 1, 0, 1, '组织表单', 'system-dept-form', 'system/dept/form', 12, '', 'dept-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (38, 1, 0, 1, '角色表单', 'system-role-form', 'system/role/form', 13, '', 'role-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (39, 0, 0, 1, '数据源表单', 'datasource-form', 'system/datasource/form', 5, NULL, '/ds-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (40, 1, 0, 1, '模板管理', 'system-template', 'panel/template/index', 13, 'dashboard', 'panel/template/index', NULL, b'0', b'0', 'sysparam:read', NULL, NULL, NULL, 1620444227389);
|
||||
INSERT INTO `sys_menu` VALUES (41, 1, 0, 1, '权限管理', 'system-auth', 'system/authority/index', 14, 'password', 'system/authority/index', b'0', b'0', b'0', 'sysparam:read', NULL, NULL, NULL, 1620447312657);
|
||||
INSERT INTO `sys_menu` VALUES (42, 1, 0, 1, '插件管理', 'system-plugin', 'system/plugin/index', 15, 'sys-tools', '/plugin', b'0', b'0', b'0', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (40, 1, 0, 1, '模板管理', 'system-template', 'panel/template/index', 13, 'dashboard', 'panel/template/index', NULL, b'0', b'0', 'template:read', NULL, NULL, NULL, 1620444227389);
|
||||
INSERT INTO `sys_menu` VALUES (41, 1, 0, 1, '权限管理', 'system-auth', 'system/authority/index', 14, 'password', 'system/authority/index', b'0', b'0', b'0', 'auth:read', NULL, NULL, NULL, 1620447312657);
|
||||
INSERT INTO `sys_menu` VALUES (42, 1, 0, 1, '插件管理', 'system-plugin', 'system/plugin/index', 15, 'sys-tools', '/plugin', b'0', b'0', b'0', 'plugin:read', NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (50, 0, 0, 1, '个人信息', 'person-info', 'system/user/privateForm', 999, NULL, '/person-info', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (51, 0, 0, 1, '重置密码', 'person-pwd-reset', 'system/user/personPwd', 999, NULL, '/person-pwd', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_menu` VALUES (52, 0, 0, 1, '关于', 'about', 'system/about/index', 16, 'system', '/about', b'0', b'0', b'1', NULL, NULL, NULL, NULL, 1620897406691);
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dateFormat } from '@/utils'
|
||||
import { timeSection } from '@/utils'
|
||||
export default {
|
||||
|
||||
props: {
|
||||
@ -29,7 +29,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
options: null,
|
||||
operator: 'eq',
|
||||
operator: 'between',
|
||||
values: null
|
||||
}
|
||||
},
|
||||
@ -50,37 +50,26 @@ export default {
|
||||
this.inDraw && this.$store.dispatch('conditions/add', param)
|
||||
},
|
||||
dateChange(value) {
|
||||
// const nvalue = dateFormat(value, this.getFormat())
|
||||
// console.log(nvalue)
|
||||
this.setCondition()
|
||||
},
|
||||
formatValues(values) {
|
||||
if (!values || values.length === 0) {
|
||||
return []
|
||||
}
|
||||
return values.map(value => dateFormat(value, this.getFormat()))
|
||||
},
|
||||
getFormat() {
|
||||
let format = 'yyyy'
|
||||
switch (this.options.attrs.type) {
|
||||
case 'year':
|
||||
format = 'yyyy'
|
||||
break
|
||||
case 'month':
|
||||
format = 'yyyy-MM'
|
||||
break
|
||||
case 'date':
|
||||
format = 'yyyy-MM-dd'
|
||||
break
|
||||
case 'daterange':
|
||||
format = 'yyyy-MM-dd'
|
||||
this.operator = 'in'
|
||||
break
|
||||
default:
|
||||
format = 'yyyy'
|
||||
break
|
||||
if (this.options.attrs.type === 'daterange') {
|
||||
if (values.length !== 2) {
|
||||
return null
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
return timeSection(value, this.options.attrs.type)
|
||||
}
|
||||
return format
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,47 @@
|
||||
|
||||
/**
|
||||
* Created by PanJiaChen on 16/11/18.
|
||||
*/
|
||||
export function timeSection(date, type) {
|
||||
if (!date) {
|
||||
return null
|
||||
}
|
||||
const timeRanger = new Array(2)
|
||||
|
||||
date.setHours(0)
|
||||
date.setMinutes(0)
|
||||
date.setSeconds(0)
|
||||
date.setMilliseconds(0)
|
||||
const end = new Date(date)
|
||||
if (type === 'year') {
|
||||
date.setDate(1)
|
||||
date.setMonth(0)
|
||||
end.setFullYear(date.getFullYear() + 1)
|
||||
timeRanger[1] = end.getTime() - 1
|
||||
}
|
||||
if (type === 'month') {
|
||||
date.setDate(1)
|
||||
const currentMonth = date.getMonth()
|
||||
if (currentMonth === 11) {
|
||||
end.setFullYear(date.getFullYear() + 1)
|
||||
end.setMonth(0)
|
||||
} else {
|
||||
end.setMonth(date.getMonth() + 1)
|
||||
}
|
||||
timeRanger[1] = end.getTime() - 1
|
||||
}
|
||||
|
||||
if (type === 'date') {
|
||||
end.setHours(23)
|
||||
end.setMinutes(59)
|
||||
end.setSeconds(59)
|
||||
end.setMilliseconds(999)
|
||||
timeRanger[1] = end.getTime()
|
||||
}
|
||||
timeRanger[0] = date.getTime()
|
||||
|
||||
return timeRanger
|
||||
}
|
||||
export function dateFormat(date, fmt) {
|
||||
let ret
|
||||
const opt = {
|
||||
|
||||
@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
save() {
|
||||
if (!this.templateInfo.pid) {
|
||||
this.$warning(this.$t(panel.pls_select_belong_to_category))
|
||||
this.$warning(this.$t('panel.pls_select_belong_to_category'))
|
||||
return false
|
||||
}
|
||||
if (!this.templateInfo.name) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user