提交 a8935a49 authored 作者: xuwei-fit2cloud's avatar xuwei-fit2cloud

refactor: 删除不必要的代码

上级 4513d164
...@@ -11,7 +11,6 @@ public class CurrentRoleDto implements Serializable { ...@@ -11,7 +11,6 @@ public class CurrentRoleDto implements Serializable {
@ApiModelProperty("ID") @ApiModelProperty("ID")
private Long id; private Long id;
// private String code;
@ApiModelProperty("名称") @ApiModelProperty("名称")
private String name; private String name;
} }
...@@ -94,14 +94,7 @@ public class F2CRealm extends AuthorizingRealm { ...@@ -94,14 +94,7 @@ public class F2CRealm extends AuthorizingRealm {
if (username == null) { if (username == null) {
throw new AuthenticationException("token invalid"); throw new AuthenticationException("token invalid");
} }
// 使用缓存
/*SysUserEntity user = authUserService.getUserById(userId);
if (user == null) {
throw new AuthenticationException("User didn't existed!");
}
if (user.getEnabled()==0) {
throw new AuthenticationException("User is valid!");
}*/
SysUserEntity user = userWithId(userId); SysUserEntity user = userWithId(userId);
String pass = null; String pass = null;
try { try {
...@@ -112,13 +105,7 @@ public class F2CRealm extends AuthorizingRealm { ...@@ -112,13 +105,7 @@ public class F2CRealm extends AuthorizingRealm {
if (! JWTUtils.verify(token, tokenInfo, pass)) { if (! JWTUtils.verify(token, tokenInfo, pass)) {
throw new AuthenticationException("Username or password error"); throw new AuthenticationException("Username or password error");
} }
/*// 使用缓存
List<CurrentRoleDto> currentRoleDtos = authUserService.roleInfos(user.getUserId());
// 使用缓存
List<String> permissions = authUserService.permissions(user.getUserId());
CurrentUserDto currentUserDto = BeanUtils.copyBean(new CurrentUserDto(), user);
currentUserDto.setRoles(currentRoleDtos);
currentUserDto.setPermissions(permissions);*/
CurrentUserDto currentUserDto = queryCacheUserDto(user); CurrentUserDto currentUserDto = queryCacheUserDto(user);
return new SimpleAuthenticationInfo(currentUserDto, token, "f2cReam"); return new SimpleAuthenticationInfo(currentUserDto, token, "f2cReam");
} }
......
...@@ -13,8 +13,6 @@ public class TokenInfo implements Serializable { ...@@ -13,8 +13,6 @@ public class TokenInfo implements Serializable {
private Long userId; private Long userId;
/* private String idToken; */
public String format(){ public String format(){
return username + "," +userId; return username + "," +userId;
} }
......
...@@ -39,7 +39,6 @@ public class F2CLinkFilter extends AnonymousFilter { ...@@ -39,7 +39,6 @@ public class F2CLinkFilter extends AnonymousFilter {
panelLink.setPwd("dataease"); panelLink.setPwd("dataease");
pwd = panelLink.getPwd(); pwd = panelLink.getPwd();
}else { }else {
/* pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, panelLink.getPwd()); */
pwd = panelLink.getPwd(); pwd = panelLink.getPwd();
} }
return JWTUtils.verifyLink(link_token, id, pwd); return JWTUtils.verifyLink(link_token, id, pwd);
......
...@@ -53,11 +53,9 @@ public class JWTFilter extends BasicHttpAuthenticationFilter { ...@@ -53,11 +53,9 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
if (ApiKeyHandler.isApiKeyCall(httpServletRequest)) { if (ApiKeyHandler.isApiKeyCall(httpServletRequest)) {
// Long userId = ApiKeyHandler.getUser(httpServletRequest);
ASKToken askToken = ApiKeyHandler.buildToken(httpServletRequest); ASKToken askToken = ApiKeyHandler.buildToken(httpServletRequest);
// UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(userId.toString(), ApiKeyHandler.random);
getSubject(request, response).login(askToken); getSubject(request, response).login(askToken);
return true; return true;
} }
......
...@@ -71,7 +71,6 @@ public class AuthServer implements AuthApi { ...@@ -71,7 +71,6 @@ public class AuthServer implements AuthApi {
LdapAddRequest ldapAddRequest = new LdapAddRequest(); LdapAddRequest ldapAddRequest = new LdapAddRequest();
ldapAddRequest.setUsers(new ArrayList<XpackLdapUserEntity>(){{add(ldapUserEntity);}}); ldapAddRequest.setUsers(new ArrayList<XpackLdapUserEntity>(){{add(ldapUserEntity);}});
ldapAddRequest.setEnabled(1L); ldapAddRequest.setEnabled(1L);
// ldapAddRequest.setDeptId(1L);
ldapAddRequest.setRoleIds(new ArrayList<Long>(){{add(2L);}}); ldapAddRequest.setRoleIds(new ArrayList<Long>(){{add(2L);}});
sysUserService.validateExistUser(ldapUserEntity.getUsername(), ldapUserEntity.getNickname(), ldapUserEntity.getEmail()); sysUserService.validateExistUser(ldapUserEntity.getUsername(), ldapUserEntity.getNickname(), ldapUserEntity.getEmail());
sysUserService.saveLdapUsers(ldapAddRequest); sysUserService.saveLdapUsers(ldapAddRequest);
...@@ -191,13 +190,7 @@ public class AuthServer implements AuthApi { ...@@ -191,13 +190,7 @@ public class AuthServer implements AuthApi {
@Override @Override
public String getPublicKey() { public String getPublicKey() {
return RsaProperties.publicKey; return RsaProperties.publicKey;
} }
/*@Override
public Boolean isLogin() {
return null;
}*/
} }
...@@ -14,7 +14,6 @@ public class DynamicMenuServer implements DynamicMenuApi { ...@@ -14,7 +14,6 @@ public class DynamicMenuServer implements DynamicMenuApi {
@Override @Override
public List<DynamicMenuDto> menus() { public List<DynamicMenuDto> menus() {
//ServletUtils.getToken()
return dynamicMenuService.load(null); return dynamicMenuService.load(null);
} }
} }
...@@ -54,15 +54,11 @@ public class ShiroServiceImpl implements ShiroService { ...@@ -54,15 +54,11 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/dataset/field/fieldValues/**", ANON); filterChainDefinitionMap.put("/dataset/field/fieldValues/**", ANON);
filterChainDefinitionMap.put("/linkJump/queryPanelJumpInfo/**", ANON); filterChainDefinitionMap.put("/linkJump/queryPanelJumpInfo/**", ANON);
//未读消息数量
// filterChainDefinitionMap.put("/api/sys_msg/unReadCount/**", ANON);
filterChainDefinitionMap.put("/**/*.json", ANON); filterChainDefinitionMap.put("/**/*.json", ANON);
filterChainDefinitionMap.put("/system/ui/**", ANON); filterChainDefinitionMap.put("/system/ui/**", ANON);
filterChainDefinitionMap.put("/**/*.js", ANON); filterChainDefinitionMap.put("/**/*.js", ANON);
filterChainDefinitionMap.put("/**/*.css", ANON); filterChainDefinitionMap.put("/**/*.css", ANON);
filterChainDefinitionMap.put("/**/*.map", ANON); filterChainDefinitionMap.put("/**/*.map", ANON);
// filterChainDefinitionMap.put("/axios.map", ANON);
filterChainDefinitionMap.put("/api/auth/login", ANON); filterChainDefinitionMap.put("/api/auth/login", ANON);
filterChainDefinitionMap.put("/api/auth/isPluginLoaded", ANON); filterChainDefinitionMap.put("/api/auth/isPluginLoaded", ANON);
......
...@@ -39,9 +39,6 @@ public class JWTUtils { ...@@ -39,9 +39,6 @@ public class JWTUtils {
Verification verification = JWT.require(algorithm) Verification verification = JWT.require(algorithm)
.withClaim("username", tokenInfo.getUsername()) .withClaim("username", tokenInfo.getUsername())
.withClaim("userId", tokenInfo.getUserId()); .withClaim("userId", tokenInfo.getUserId());
/* if (StringUtils.isNotBlank(tokenInfo.getIdToken())) {
verification.withClaim("idToken", tokenInfo.getIdToken());
} */
JWTVerifier verifier = verification.build(); JWTVerifier verifier = verification.build();
verifier.verify(token); verifier.verify(token);
return true; return true;
...@@ -55,22 +52,14 @@ public class JWTUtils { ...@@ -55,22 +52,14 @@ public class JWTUtils {
DecodedJWT jwt = JWT.decode(token); DecodedJWT jwt = JWT.decode(token);
String username = jwt.getClaim("username").asString(); String username = jwt.getClaim("username").asString();
Long userId = jwt.getClaim("userId").asLong(); Long userId = jwt.getClaim("userId").asLong();
// String idToken = jwt.getClaim("idToken").asString();
if (StringUtils.isEmpty(username) || ObjectUtils.isEmpty(userId) ){ if (StringUtils.isEmpty(username) || ObjectUtils.isEmpty(userId) ){
DataEaseException.throwException("token格式错误!"); DataEaseException.throwException("token格式错误!");
} }
TokenInfoBuilder tokenInfoBuilder = TokenInfo.builder().username(username).userId(userId); TokenInfoBuilder tokenInfoBuilder = TokenInfo.builder().username(username).userId(userId);
/* if (StringUtils.isNotBlank(idToken)) {
tokenInfoBuilder.idToken(idToken);
} */
TokenInfo tokenInfo = tokenInfoBuilder.build(); TokenInfo tokenInfo = tokenInfoBuilder.build();
return tokenInfo; return tokenInfo;
} }
public static boolean needRefresh(String token){ public static boolean needRefresh(String token){
Date exp = JWTUtils.getExp(token); Date exp = JWTUtils.getExp(token);
return new Date().getTime() >= exp.getTime(); return new Date().getTime() >= exp.getTime();
...@@ -120,9 +109,6 @@ public class JWTUtils { ...@@ -120,9 +109,6 @@ public class JWTUtils {
Builder builder = JWT.create() Builder builder = JWT.create()
.withClaim("username", tokenInfo.getUsername()) .withClaim("username", tokenInfo.getUsername())
.withClaim("userId", tokenInfo.getUserId()); .withClaim("userId", tokenInfo.getUserId());
/* if (StringUtils.isNotBlank(tokenInfo.getIdToken())) {
builder.withClaim("idToken", tokenInfo.getIdToken());
} */
return builder.withExpiresAt(date).sign(algorithm); return builder.withExpiresAt(date).sign(algorithm);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -26,7 +26,6 @@ public class RsaUtil { ...@@ -26,7 +26,6 @@ public class RsaUtil {
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec5); PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec5);
Cipher cipher = Cipher.getInstance("RSA"); Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, privateKey); cipher.init(Cipher.DECRYPT_MODE, privateKey);
// byte[] result = cipher.doFinal(Base64.decodeBase64(text));
// 下面该用分段加密 // 下面该用分段加密
byte[] result = null; byte[] result = null;
byte[] b = Base64.decodeBase64(text); byte[] b = Base64.decodeBase64(text);
...@@ -50,7 +49,6 @@ public class RsaUtil { ...@@ -50,7 +49,6 @@ public class RsaUtil {
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2); PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2);
Cipher cipher = Cipher.getInstance("RSA"); Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, publicKey); cipher.init(Cipher.ENCRYPT_MODE, publicKey);
/*byte[] result = cipher.doFinal(text.getBytes());*/
// 下面该用分段加密 // 下面该用分段加密
byte[] result = null; byte[] result = null;
byte[] b = text.getBytes("utf-8"); byte[] b = text.getBytes("utf-8");
......
...@@ -14,5 +14,4 @@ public interface ExtAuthMapper { ...@@ -14,5 +14,4 @@ public interface ExtAuthMapper {
List<Long> queryUserIdWithDeptIds(@Param("deptIds") List<Long> deptIds); List<Long> queryUserIdWithDeptIds(@Param("deptIds") List<Long> deptIds);
List<SysAuth> queryByResource(@Param("resourceId") String resourceId); List<SysAuth> queryByResource(@Param("resourceId") String resourceId);
// Set<Long> queryUserIdWithRD(@Param("roleIds") List<Long> roleIds, @Param("deptIds") List<Long> deptIds);
} }
...@@ -45,11 +45,8 @@ public class DefaultLicenseService { ...@@ -45,11 +45,8 @@ public class DefaultLicenseService {
return f2CLicenseResponse; return f2CLicenseResponse;
}catch (Exception e){ }catch (Exception e){
LogUtil.error(e.getMessage()); LogUtil.error(e.getMessage());
// e.printStackTrace();
// return F2CLicenseResponse.invalid(e.getMessage());
return F2CLicenseResponse.noRecord(); return F2CLicenseResponse.noRecord();
} }
} }
......
...@@ -46,14 +46,8 @@ public class DeFileUtils { ...@@ -46,14 +46,8 @@ public class DeFileUtils {
String path = filePath + fileName; String path = filePath + fileName;
// getCanonicalFile 可解析正确各种路径 // getCanonicalFile 可解析正确各种路径
File dest = new File(path).getCanonicalFile(); File dest = new File(path).getCanonicalFile();
// 检测是否存在目录
if (!dest.getParentFile().exists()) {
if (!dest.getParentFile().mkdirs()) {
// System.out.println("was not successful.");
}
}
// 文件写入 // 文件写入
// file.transferTo(dest);
FileOutputStream fileOutputStream = new FileOutputStream(dest); FileOutputStream fileOutputStream = new FileOutputStream(dest);
fileOutputStream.write(file.getBytes()); fileOutputStream.write(file.getBytes());
fileOutputStream.flush(); fileOutputStream.flush();
......
...@@ -8,8 +8,6 @@ import java.io.PrintWriter; ...@@ -8,8 +8,6 @@ import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
public class LogUtil { public class LogUtil {
//日志工具类
// public static final Log Logger = LogFactory.getLog(LogUtil.class);
private static final String DEBUG = "DEBUG"; private static final String DEBUG = "DEBUG";
private static final String INFO = "INFO"; private static final String INFO = "INFO";
......
...@@ -124,12 +124,6 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe ...@@ -124,12 +124,6 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
case '<': case '<':
sb.append("<");// 转义小于号 sb.append("<");// 转义小于号
break; break;
// case '\'':
// sb.append("'");// 转义单引号
// break;
// case '\"':
// sb.append(""");// 转义双引号
// break;
case '&': case '&':
sb.append("&");// 转义& sb.append("&");// 转义&
break; break;
...@@ -261,7 +255,6 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe ...@@ -261,7 +255,6 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
"<[\r\n| | ]*script[\r\n| | ]*>(.*?)</[\r\n| | ]*script[\r\n| | ]*>", Pattern.CASE_INSENSITIVE); "<[\r\n| | ]*script[\r\n| | ]*>(.*?)</[\r\n| | ]*script[\r\n| | ]*>", Pattern.CASE_INSENSITIVE);
flag = scriptPattern.matcher(value).find(); flag = scriptPattern.matcher(value).find();
if (flag) { if (flag) {
// threadLocal.set("包含XSS攻击脚本,请检查参数!");
return flag; return flag;
} }
// Avoid anything in a // Avoid anything in a
......
...@@ -62,13 +62,6 @@ public class Knife4jConfiguration implements BeanPostProcessor{ ...@@ -62,13 +62,6 @@ public class Knife4jConfiguration implements BeanPostProcessor{
return defaultApi("系统管理", "io.dataease.controller.sys"); return defaultApi("系统管理", "io.dataease.controller.sys");
} }
/*@Bean(value = "pluginsApi")
@Conditional(LicStatusCondition.class)
public Docket pluginsApi() {
return defaultApi("插件管理", "io.dataease.plugins.server");
}*/
private ApiInfo apiInfo(){ private ApiInfo apiInfo(){
return new ApiInfoBuilder() return new ApiInfoBuilder()
.title("DataEase") .title("DataEase")
......
...@@ -49,7 +49,6 @@ public class IndexController { ...@@ -49,7 +49,6 @@ public class IndexController {
case valid: case valid:
return "doc.html"; return "doc.html";
default: default:
// DataEaseException.throwException("Invalid License.");
return "nolic.html"; return "nolic.html";
} }
} }
......
...@@ -68,7 +68,6 @@ public class DatasourceController { ...@@ -68,7 +68,6 @@ public class DatasourceController {
@PostMapping("/list/{goPage}/{pageSize}") @PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<DatasourceDTO>> getDatasourceList(@RequestBody BaseGridRequest request, @PathVariable int goPage, @PathVariable int pageSize) throws Exception { public Pager<List<DatasourceDTO>> getDatasourceList(@RequestBody BaseGridRequest request, @PathVariable int goPage, @PathVariable int pageSize) throws Exception {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true); Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
// return PageUtils.setPageInfo(page, datasourceService.getDatasourceList(request));
return PageUtils.setPageInfo(page, datasourceService.gridQuery(request)); return PageUtils.setPageInfo(page, datasourceService.gridQuery(request));
} }
......
...@@ -67,7 +67,6 @@ public class LinkServer implements LinkApi { ...@@ -67,7 +67,6 @@ public class LinkServer implements LinkApi {
ValidateDto dto = new ValidateDto(); ValidateDto dto = new ValidateDto();
String resourceId = json; String resourceId = json;
/* String resourceId = request.getResourceId(); */
PanelLink one = panelLinkService.findOne(resourceId); PanelLink one = panelLinkService.findOne(resourceId);
dto.setResourceId(resourceId); dto.setResourceId(resourceId);
if (ObjectUtils.isEmpty(one)){ if (ObjectUtils.isEmpty(one)){
......
...@@ -62,7 +62,6 @@ public class MsgController { ...@@ -62,7 +62,6 @@ public class MsgController {
if(null == AuthUtils.getUser() || (userId = AuthUtils.getUser().getUserId()) == null) { if(null == AuthUtils.getUser() || (userId = AuthUtils.getUser().getUserId()) == null) {
throw new RuntimeException("缺少用户ID"); throw new RuntimeException("缺少用户ID");
} }
// Long userId = request.get("userId");
return sysMsgService.queryCount(userId); return sysMsgService.queryCount(userId);
} }
......
...@@ -4,14 +4,10 @@ import io.dataease.base.domain.SysDept; ...@@ -4,14 +4,10 @@ import io.dataease.base.domain.SysDept;
import io.dataease.commons.utils.BeanUtils; import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.ResultHolder; import io.dataease.controller.ResultHolder;
import io.dataease.controller.sys.base.BaseGridRequest; import io.dataease.controller.sys.base.BaseGridRequest;
/*import io.dataease.controller.sys.request.DeptCreateRequest;
import io.dataease.controller.sys.request.DeptDeleteRequest;
import io.dataease.controller.sys.request.DeptStatusRequest;*/
import io.dataease.controller.sys.response.DeptNodeResponse; import io.dataease.controller.sys.response.DeptNodeResponse;
import io.dataease.controller.sys.response.DeptTreeNode; import io.dataease.controller.sys.response.DeptTreeNode;
import io.dataease.service.sys.DeptService; import io.dataease.service.sys.DeptService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/*import io.swagger.annotations.ApiOperation;*/
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -15,34 +15,4 @@ import java.util.List; ...@@ -15,34 +15,4 @@ import java.util.List;
public class SysAuthDTO extends SysAuth { public class SysAuthDTO extends SysAuth {
private List<SysAuthDetail> sysAuthDetails; private List<SysAuthDetail> sysAuthDetails;
// private List<BaseAuthDetail> baseAuthDetails;
//
// private String authDetails;
//
// @Override
// public void setAuthDetails(String authDetails) {
// this.authDetails = authDetails;
// if(StringUtils.isNotEmpty(authDetails)){
// try{
// baseAuthDetails = JSON.parseArray(authDetails,BaseAuthDetail.class);
// }catch (Exception e){
// e.printStackTrace();
// //ignored
// }
// }
// }
//
// public List<BaseAuthDetail> getBaseAuthDetails() {
// return baseAuthDetails;
// }
//
// public void setBaseAuthDetails(List<BaseAuthDetail> baseAuthDetails) {
// this.baseAuthDetails = baseAuthDetails;
// }
//
// @Override
// public String getAuthDetails() {
// return authDetails;
// }
} }
...@@ -75,9 +75,7 @@ public class ScheduleManager { ...@@ -75,9 +75,7 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey); triggerBuilder.withIdentity(triggerKey);
Date nTimeByCron = getNTimeByCron(cron, startTime); Date nTimeByCron = getNTimeByCron(cron, startTime);
// if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron); triggerBuilder.startAt(nTimeByCron);
// }
if (endTime != null) { if (endTime != null) {
if (endTime.before(nTimeByCron)) { if (endTime.before(nTimeByCron)) {
...@@ -160,9 +158,7 @@ public class ScheduleManager { ...@@ -160,9 +158,7 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组 triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组
Date nTimeByCron = getNTimeByCron(cron, startTime); Date nTimeByCron = getNTimeByCron(cron, startTime);
// if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron); triggerBuilder.startAt(nTimeByCron);
// }
if (endTime != null) { if (endTime != null) {
if (endTime.before(nTimeByCron)) { if (endTime.before(nTimeByCron)) {
...@@ -179,14 +175,6 @@ public class ScheduleManager { ...@@ -179,14 +175,6 @@ public class ScheduleManager {
trigger = (CronTrigger) triggerBuilder.build();// 创建Trigger对象 trigger = (CronTrigger) triggerBuilder.build();// 创建Trigger对象
scheduler.rescheduleJob(triggerKey, trigger);// 修改一个任务的触发时间 scheduler.rescheduleJob(triggerKey, trigger);// 修改一个任务的触发时间
/** 方式一 :调用 rescheduleJob 结束 */
/** 方式二:先删除,然后在创建一个新的Job */
// JobDetail jobDetail = sched.getJobDetail(JobKey.jobKey(jobName, jobGroupName));
// Class<? extends Job> jobClass = jobDetail.getJobClass();
// removeJob(jobName, jobGroupName, triggerName, triggerGroupName);
// addJob(jobName, jobGroupName, triggerName, triggerGroupName, jobClass, cron);
/** 方式二 :先删除,然后在创建一个新的Job */
} catch (Exception e) { } catch (Exception e) {
DataEaseException.throwException(e); DataEaseException.throwException(e);
} }
...@@ -227,15 +215,6 @@ public class ScheduleManager { ...@@ -227,15 +215,6 @@ public class ScheduleManager {
trigger = (SimpleTrigger) triggerBuilder.build();// 创建Trigger对象 trigger = (SimpleTrigger) triggerBuilder.build();// 创建Trigger对象
scheduler.rescheduleJob(triggerKey, trigger);// 修改一个任务的触发时间 scheduler.rescheduleJob(triggerKey, trigger);// 修改一个任务的触发时间
/** 方式一 :调用 rescheduleJob 结束 */
/** 方式二:先删除,然后在创建一个新的Job */
// JobDetail jobDetail = sched.getJobDetail(JobKey.jobKey(jobName, jobGroupName));
// Class<? extends Job> jobClass = jobDetail.getJobClass();
// removeJob(jobName, jobGroupName, triggerName, triggerGroupName);
// addJob(jobName, jobGroupName, triggerName, triggerGroupName, jobClass, cron);
/** 方式二 :先删除,然后在创建一个新的Job */
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -21,20 +21,14 @@ public class LicCacheEventListener extends CacheEventListenerFactory implements ...@@ -21,20 +21,14 @@ public class LicCacheEventListener extends CacheEventListenerFactory implements
@Override @Override
public void notifyElementRemoved(Ehcache ehcache, Element element) throws CacheException { public void notifyElementRemoved(Ehcache ehcache, Element element) throws CacheException {
/*System.out.println("notifyElementRemoved");*/
} }
@Override @Override
public void notifyElementPut(Ehcache ehcache, Element element) throws CacheException { public void notifyElementPut(Ehcache ehcache, Element element) throws CacheException {
/*long expirationTime = element.getExpirationTime();
System.out.println(expirationTime);
System.out.println("notifyElementPut");*/
} }
@Override @Override
public void notifyElementUpdated(Ehcache ehcache, Element element) throws CacheException { public void notifyElementUpdated(Ehcache ehcache, Element element) throws CacheException {
/*System.out.println("notifyElementUpdated");*/
} }
/** /**
...@@ -51,12 +45,10 @@ public class LicCacheEventListener extends CacheEventListenerFactory implements ...@@ -51,12 +45,10 @@ public class LicCacheEventListener extends CacheEventListenerFactory implements
@Override @Override
public void notifyElementEvicted(Ehcache ehcache, Element element) { public void notifyElementEvicted(Ehcache ehcache, Element element) {
/*System.out.println("notifyElementEvicted");*/
} }
@Override @Override
public void notifyRemoveAll(Ehcache ehcache) { public void notifyRemoveAll(Ehcache ehcache) {
/*System.out.println("notifyRemoveAll");*/
} }
@Override @Override
......
...@@ -28,7 +28,6 @@ public class MapServer implements MapApi { ...@@ -28,7 +28,6 @@ public class MapServer implements MapApi {
@Override @Override
public String asyncGeometry() { public String asyncGeometry() {
try { try {
// List<AreaEntity> areaEntities = MapUtils.readAreaEntity();
List<AreaEntity> areaEntities = mapService.areaEntities(); List<AreaEntity> areaEntities = mapService.areaEntities();
MapUtils.recursionWriteFull(areaEntities); MapUtils.recursionWriteFull(areaEntities);
}catch (Exception e) { }catch (Exception e) {
......
...@@ -34,7 +34,6 @@ public class MapUtils { ...@@ -34,7 +34,6 @@ public class MapUtils {
public static String formatCode(String code) { public static String formatCode(String code) {
// return code.substring(3);
return code; return code;
} }
...@@ -57,7 +56,6 @@ public class MapUtils { ...@@ -57,7 +56,6 @@ public class MapUtils {
public static List<AreaEntity> readAreaEntity() { public static List<AreaEntity> readAreaEntity() {
List<Map<String, Object>> maps = readCodeList(); List<Map<String, Object>> maps = readCodeList();
// AreaEntity root = new AreaEntity;
Map<String, AreaEntity> provinceMap = new ConcurrentHashMap<>(); Map<String, AreaEntity> provinceMap = new ConcurrentHashMap<>();
Map<String, AreaEntity> cityMap = new ConcurrentHashMap<>(); Map<String, AreaEntity> cityMap = new ConcurrentHashMap<>();
...@@ -66,7 +64,6 @@ public class MapUtils { ...@@ -66,7 +64,6 @@ public class MapUtils {
AreaEntity china = root(); AreaEntity china = root();
maps.stream().forEach(map -> { maps.stream().forEach(map -> {
// maps.stream().forEach(map -> {
String province_code = map.get(Constants.PROVINCE_CODE).toString(); String province_code = map.get(Constants.PROVINCE_CODE).toString();
String city_code = map.get(Constants.CITY_CODE).toString(); String city_code = map.get(Constants.CITY_CODE).toString();
String county_code = map.get(Constants.COUNTY_CODE).toString(); String county_code = map.get(Constants.COUNTY_CODE).toString();
...@@ -110,7 +107,6 @@ public class MapUtils { ...@@ -110,7 +107,6 @@ public class MapUtils {
} }
} }
}); });
// List<AreaEntity> treeNodes = provinceMap.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList());
List<AreaEntity> result = new ArrayList<>(); List<AreaEntity> result = new ArrayList<>();
result.add(china); result.add(china);
return result; return result;
...@@ -127,10 +123,6 @@ public class MapUtils { ...@@ -127,10 +123,6 @@ public class MapUtils {
if (StrUtil.equals("1", mapResponse.getStatus()) && StrUtil.equalsAnyIgnoreCase("ok", mapResponse.getInfo()) && StrUtil.equalsAnyIgnoreCase("10000", mapResponse.getInfocode())) { if (StrUtil.equals("1", mapResponse.getStatus()) && StrUtil.equalsAnyIgnoreCase("ok", mapResponse.getInfo()) && StrUtil.equalsAnyIgnoreCase("10000", mapResponse.getInfocode())) {
List<District> districts = mapResponse.getDistricts(); List<District> districts = mapResponse.getDistricts();
if (CollectionUtil.isNotEmpty(districts)) { if (CollectionUtil.isNotEmpty(districts)) {
/*District district = districts.get(0);
MapResultDto mapResultDto = buildGeometry(district, areaEntity);
writeFeatureFile(mapResultDto, areaEntity.getCode());*/
List<Feature> kidFeatures = districts.stream().map(district -> buildFeature(district, areaEntity)).collect(Collectors.toList()); List<Feature> kidFeatures = districts.stream().map(district -> buildFeature(district, areaEntity)).collect(Collectors.toList());
MapResultDto mapResultDto = buildGeometry(kidFeatures); MapResultDto mapResultDto = buildGeometry(kidFeatures);
writeFeatureFile(mapResultDto, areaEntity.getCode()); writeFeatureFile(mapResultDto, areaEntity.getCode());
......
...@@ -47,7 +47,6 @@ public class PluginRunner implements ApplicationRunner { ...@@ -47,7 +47,6 @@ public class PluginRunner implements ApplicationRunner {
} }
} catch (Exception e) { } catch (Exception e) {
LogUtil.error(e); LogUtil.error(e);
//e.printStackTrace();
} }
}); });
......
...@@ -76,7 +76,6 @@ public class ControllerLoader { ...@@ -76,7 +76,6 @@ public class ControllerLoader {
try { try {
registerController(name); registerController(name);
} catch (Exception e) { } catch (Exception e) {
// e.printStackTrace();
LogUtil.error(e); LogUtil.error(e);
} }
}); });
......
...@@ -104,9 +104,6 @@ public class ModuleClassLoader extends URLClassLoader { ...@@ -104,9 +104,6 @@ public class ModuleClassLoader extends URLClassLoader {
byte[] classBytes = baos.toByteArray(); byte[] classBytes = baos.toByteArray();
classBytesMap.put(className,classBytes); classBytesMap.put(className,classBytes);
} }
/*if (name.endsWith(".xml")) {
loadMapperXml(name);
}*/
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -36,7 +36,6 @@ public class XOidcServer { ...@@ -36,7 +36,6 @@ public class XOidcServer {
Map<String, String> authParam = new HashMap<>(); Map<String, String> authParam = new HashMap<>();
authParam.put("response_type", "code"); authParam.put("response_type", "code");
authParam.put("state", "state"); authParam.put("state", "state");
// authParam.put("redirect_uri", "http://localhost:9528");
oidcSettings.forEach(param -> { oidcSettings.forEach(param -> {
......
...@@ -24,7 +24,6 @@ public class XUserKeysServer { ...@@ -24,7 +24,6 @@ public class XUserKeysServer {
@PostMapping("validate") @PostMapping("validate")
public String validate(ServletRequest request) { public String validate(ServletRequest request) {
// return ApiKeyHandler.getUser(WebUtils.toHttp(request));
return null; return null;
} }
......
...@@ -14,10 +14,6 @@ public abstract class DatasourceProvider { ...@@ -14,10 +14,6 @@ public abstract class DatasourceProvider {
abstract public List<String> getTables(DatasourceRequest datasourceRequest) throws Exception; abstract public List<String> getTables(DatasourceRequest datasourceRequest) throws Exception;
// public List<TableFiled> getTableFileds(DatasourceRequest datasourceRequest) throws Exception {
// return new ArrayList<>();
// };
public void checkStatus(DatasourceRequest datasourceRequest) throws Exception { public void checkStatus(DatasourceRequest datasourceRequest) throws Exception {
getData(datasourceRequest); getData(datasourceRequest);
} }
......
...@@ -222,8 +222,7 @@ public class CKQueryProvider extends QueryProvider { ...@@ -222,8 +222,7 @@ public class CKQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -328,8 +327,7 @@ public class CKQueryProvider extends QueryProvider { ...@@ -328,8 +327,7 @@ public class CKQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -414,8 +412,7 @@ public class CKQueryProvider extends QueryProvider { ...@@ -414,8 +412,7 @@ public class CKQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -525,8 +522,7 @@ public class CKQueryProvider extends QueryProvider { ...@@ -525,8 +522,7 @@ public class CKQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -806,10 +802,8 @@ public class CKQueryProvider extends QueryProvider { ...@@ -806,10 +802,8 @@ public class CKQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -1028,10 +1022,8 @@ public class CKQueryProvider extends QueryProvider { ...@@ -1028,10 +1022,8 @@ public class CKQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -200,8 +200,7 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -200,8 +200,7 @@ public class DorisQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -306,8 +305,7 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -306,8 +305,7 @@ public class DorisQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -391,8 +389,7 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -391,8 +389,7 @@ public class DorisQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -502,8 +499,7 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -502,8 +499,7 @@ public class DorisQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -787,10 +783,8 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -787,10 +783,8 @@ public class DorisQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -962,10 +956,8 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -962,10 +956,8 @@ public class DorisQueryProvider extends QueryProvider {
whereName = originField; whereName = originField;
} }
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -1019,10 +1011,8 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -1019,10 +1011,8 @@ public class DorisQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -221,8 +221,7 @@ public class EsQueryProvider extends QueryProvider { ...@@ -221,8 +221,7 @@ public class EsQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -346,8 +345,7 @@ public class EsQueryProvider extends QueryProvider { ...@@ -346,8 +345,7 @@ public class EsQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -457,8 +455,7 @@ public class EsQueryProvider extends QueryProvider { ...@@ -457,8 +455,7 @@ public class EsQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -734,10 +731,8 @@ public class EsQueryProvider extends QueryProvider { ...@@ -734,10 +731,8 @@ public class EsQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -923,10 +918,8 @@ public class EsQueryProvider extends QueryProvider { ...@@ -923,10 +918,8 @@ public class EsQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -180,8 +180,7 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -180,8 +180,7 @@ public class HiveQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -286,8 +285,7 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -286,8 +285,7 @@ public class HiveQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -372,8 +370,7 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -372,8 +370,7 @@ public class HiveQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -483,8 +480,7 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -483,8 +480,7 @@ public class HiveQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -764,10 +760,8 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -764,10 +760,8 @@ public class HiveQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = HiveConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -937,10 +931,8 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -937,10 +931,8 @@ public class HiveQueryProvider extends QueryProvider {
whereName = originField; whereName = originField;
} }
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = HiveConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -993,10 +985,8 @@ public class HiveQueryProvider extends QueryProvider { ...@@ -993,10 +985,8 @@ public class HiveQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = HiveConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -166,8 +166,6 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -166,8 +166,6 @@ public class MongoQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -272,8 +270,6 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -272,8 +270,6 @@ public class MongoQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -358,8 +354,6 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -358,8 +354,6 @@ public class MongoQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -469,8 +463,6 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -469,8 +463,6 @@ public class MongoQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -735,26 +727,10 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -735,26 +727,10 @@ public class MongoQueryProvider extends QueryProvider {
} else { } else {
originName = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName()); originName = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
} }
// if (field.getDeType() == DeTypeConstants.DE_TIME) {
// if (field.getDeExtractType() == DeTypeConstants.DE_STRING || field.getDeExtractType() == 5) {
// whereName = String.format(MongoConstants.STR_TO_DATE, originName, MongoConstants.DEFAULT_DATE_FORMAT);
// }
// if (field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == DeTypeConstants.DE_FLOAT || field.getDeExtractType() == 4) {
// String cast = String.format(MongoConstants.CAST, originName, MongoConstants.DEFAULT_INT_FORMAT) + "/1000";
// whereName = String.format(MongoConstants.FROM_UNIXTIME, cast, MongoConstants.DEFAULT_DATE_FORMAT);
// }
// if (field.getDeExtractType() == DeTypeConstants.DE_TIME) {
// whereName = originName;
// }
// } else {
// whereName = originName;
// }
whereName = originName; whereName = originName;
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MongoConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -800,20 +776,6 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -800,20 +776,6 @@ public class MongoQueryProvider extends QueryProvider {
originName = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName()); originName = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
} }
// if (field.getDeType() == DeTypeConstants.DE_TIME) {
// if (field.getDeExtractType() == DeTypeConstants.DE_STRING || field.getDeExtractType() == 5) {
// whereName = String.format(MongoConstants.STR_TO_DATE, originName, MongoConstants.DEFAULT_DATE_FORMAT);
// }
// if (field.getDeExtractType() == DeTypeConstants.DE_INT || field.getDeExtractType() == DeTypeConstants.DE_FLOAT || field.getDeExtractType() == 4) {
// String cast = String.format(MongoConstants.CAST, originName, MongoConstants.DEFAULT_INT_FORMAT) + "/1000";
// whereName = String.format(MongoConstants.FROM_UNIXTIME, cast, MongoConstants.DEFAULT_DATE_FORMAT);
// }
// if (field.getDeExtractType() == DeTypeConstants.DE_TIME) {
// whereName = originName;
// }
// } else {
// whereName = originName;
// }
whereName = originName; whereName = originName;
if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) { if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) {
...@@ -882,28 +844,8 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -882,28 +844,8 @@ public class MongoQueryProvider extends QueryProvider {
private SQLObj getXFields(ChartViewFieldDTO x, String originField, String fieldAlias) { private SQLObj getXFields(ChartViewFieldDTO x, String originField, String fieldAlias) {
String fieldName = ""; String fieldName = "";
if (x.getDeExtractType() == DeTypeConstants.DE_TIME) { if (x.getDeExtractType() == DeTypeConstants.DE_TIME) {
// if (x.getDeType() == DeTypeConstants.DE_INT || x.getDeType() == DeTypeConstants.DE_FLOAT) {
// fieldName = String.format(MongoConstants.UNIX_TIMESTAMP, originField) + "*1000";
// } else if (x.getDeType() == DeTypeConstants.DE_TIME) {
// String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
// fieldName = String.format(MongoConstants.DATE_FORMAT, originField, format);
// } else {
// fieldName = originField;
// }
fieldName = originField; fieldName = originField;
} else { } else {
// if (x.getDeType() == DeTypeConstants.DE_TIME) {
// String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
// if (x.getDeExtractType() == DeTypeConstants.DE_STRING) {
// fieldName = String.format(MongoConstants.DATE_FORMAT, originField, format);
// } else {
// String cast = String.format(MongoConstants.CAST, originField, MongoConstants.DEFAULT_INT_FORMAT) + "/1000";
// String from_unixtime = String.format(MongoConstants.FROM_UNIXTIME, cast, MongoConstants.DEFAULT_DATE_FORMAT);
// fieldName = String.format(MongoConstants.DATE_FORMAT, from_unixtime, format);
// }
// } else {
// fieldName = originField;
// }
fieldName = originField; fieldName = originField;
} }
return SQLObj.builder() return SQLObj.builder()
...@@ -919,14 +861,6 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -919,14 +861,6 @@ public class MongoQueryProvider extends QueryProvider {
} else if (SQLConstants.DIMENSION_TYPE.contains(y.getDeType())) { } else if (SQLConstants.DIMENSION_TYPE.contains(y.getDeType())) {
fieldName = String.format(MongoConstants.AGG_FIELD, y.getSummary(), originField); fieldName = String.format(MongoConstants.AGG_FIELD, y.getSummary(), originField);
} else { } else {
// if (StringUtils.equalsIgnoreCase(y.getSummary(), "avg") || StringUtils.containsIgnoreCase(y.getSummary(), "pop")) {
// String cast = String.format(MongoConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? MongoConstants.DEFAULT_INT_FORMAT : MongoConstants.DEFAULT_FLOAT_FORMAT);
// String agg = String.format(MongoConstants.AGG_FIELD, y.getSummary(), cast);
// fieldName = String.format(MongoConstants.CAST, agg, MongoConstants.DEFAULT_FLOAT_FORMAT);
// } else {
// String cast = String.format(MongoConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? MongoConstants.DEFAULT_INT_FORMAT : MongoConstants.DEFAULT_FLOAT_FORMAT);
// fieldName = String.format(MongoConstants.AGG_FIELD, y.getSummary(), cast);
// }
fieldName = String.format(MongoConstants.AGG_FIELD, y.getSummary(), originField); fieldName = String.format(MongoConstants.AGG_FIELD, y.getSummary(), originField);
} }
return SQLObj.builder() return SQLObj.builder()
...@@ -943,10 +877,8 @@ public class MongoQueryProvider extends QueryProvider { ...@@ -943,10 +877,8 @@ public class MongoQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MongoConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -189,8 +189,6 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -189,8 +189,6 @@ public class MysqlQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -295,8 +293,6 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -295,8 +293,6 @@ public class MysqlQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -381,8 +377,6 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -381,8 +377,6 @@ public class MysqlQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -492,8 +486,6 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -492,8 +486,6 @@ public class MysqlQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -773,10 +765,8 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -773,10 +765,8 @@ public class MysqlQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -946,10 +936,8 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -946,10 +936,8 @@ public class MysqlQueryProvider extends QueryProvider {
whereName = originField; whereName = originField;
} }
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -1002,10 +990,8 @@ public class MysqlQueryProvider extends QueryProvider { ...@@ -1002,10 +990,8 @@ public class MysqlQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originField);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -237,8 +237,6 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -237,8 +237,6 @@ public class OracleQueryProvider extends QueryProvider {
String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i)); String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -344,8 +342,6 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -344,8 +342,6 @@ public class OracleQueryProvider extends QueryProvider {
String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i)); String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -430,8 +426,6 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -430,8 +426,6 @@ public class OracleQueryProvider extends QueryProvider {
String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i)); String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -542,8 +536,6 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -542,8 +536,6 @@ public class OracleQueryProvider extends QueryProvider {
String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i)); String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i));
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -828,10 +820,8 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -828,10 +820,8 @@ public class OracleQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -1020,10 +1010,8 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -1020,10 +1010,8 @@ public class OracleQueryProvider extends QueryProvider {
whereName = originField; whereName = originField;
} }
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -1076,10 +1064,8 @@ public class OracleQueryProvider extends QueryProvider { ...@@ -1076,10 +1064,8 @@ public class OracleQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -82,7 +82,6 @@ public class PgQueryProvider extends QueryProvider { ...@@ -82,7 +82,6 @@ public class PgQueryProvider extends QueryProvider {
case "float8": case "float8":
case "money": case "money":
return DeTypeConstants.DE_FLOAT;// 浮点 return DeTypeConstants.DE_FLOAT;// 浮点
// case "bool":
case "TINYINT": case "TINYINT":
return DeTypeConstants.DE_BOOL;// 布尔 return DeTypeConstants.DE_BOOL;// 布尔
case "bytea": case "bytea":
...@@ -212,8 +211,6 @@ public class PgQueryProvider extends QueryProvider { ...@@ -212,8 +211,6 @@ public class PgQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -319,8 +316,6 @@ public class PgQueryProvider extends QueryProvider { ...@@ -319,8 +316,6 @@ public class PgQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -406,8 +401,6 @@ public class PgQueryProvider extends QueryProvider { ...@@ -406,8 +401,6 @@ public class PgQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -518,8 +511,6 @@ public class PgQueryProvider extends QueryProvider { ...@@ -518,8 +511,6 @@ public class PgQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -803,10 +794,8 @@ public class PgQueryProvider extends QueryProvider { ...@@ -803,10 +794,8 @@ public class PgQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -991,10 +980,8 @@ public class PgQueryProvider extends QueryProvider { ...@@ -991,10 +980,8 @@ public class PgQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -91,7 +91,6 @@ public class RedshiftQueryProvider extends QueryProvider { ...@@ -91,7 +91,6 @@ public class RedshiftQueryProvider extends QueryProvider {
case "float8": case "float8":
case "money": case "money":
return DeTypeConstants.DE_FLOAT;// 浮点 return DeTypeConstants.DE_FLOAT;// 浮点
// case "bool":
case "TINYINT": case "TINYINT":
return DeTypeConstants.DE_BOOL;// 布尔 return DeTypeConstants.DE_BOOL;// 布尔
case "bytea": case "bytea":
...@@ -221,8 +220,6 @@ public class RedshiftQueryProvider extends QueryProvider { ...@@ -221,8 +220,6 @@ public class RedshiftQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -347,8 +344,6 @@ public class RedshiftQueryProvider extends QueryProvider { ...@@ -347,8 +344,6 @@ public class RedshiftQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -459,8 +454,6 @@ public class RedshiftQueryProvider extends QueryProvider { ...@@ -459,8 +454,6 @@ public class RedshiftQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
......
...@@ -189,8 +189,6 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -189,8 +189,6 @@ public class SqlserverQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -280,8 +278,6 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -280,8 +278,6 @@ public class SqlserverQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -359,8 +355,6 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -359,8 +355,6 @@ public class SqlserverQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -482,8 +476,6 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -482,8 +476,6 @@ public class SqlserverQueryProvider extends QueryProvider {
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i); String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
// 处理横轴字段 // 处理横轴字段
xFields.add(getXFields(x, originField, fieldAlias)); xFields.add(getXFields(x, originField, fieldAlias));
// 处理横轴过滤
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
// 处理横轴排序 // 处理横轴排序
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) { if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
xOrders.add(SQLObj.builder() xOrders.add(SQLObj.builder()
...@@ -753,10 +745,8 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -753,10 +745,8 @@ public class SqlserverQueryProvider extends QueryProvider {
whereName = originName; whereName = originName;
} }
if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(request.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(request.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
...@@ -948,10 +938,8 @@ public class SqlserverQueryProvider extends QueryProvider { ...@@ -948,10 +938,8 @@ public class SqlserverQueryProvider extends QueryProvider {
String whereValue = ""; String whereValue = "";
// 原始类型不是时间,在de中被转成时间的字段做处理 // 原始类型不是时间,在de中被转成时间的字段做处理
if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) { if (StringUtils.equalsIgnoreCase(f.getTerm(), "null")) {
// whereValue = MySQLConstants.WHERE_VALUE_NULL;
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "not_null")) {
// whereTerm = String.format(whereTerm, originName);
whereValue = ""; whereValue = "";
} else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) { } else if (StringUtils.equalsIgnoreCase(f.getTerm(), "empty")) {
whereValue = "''"; whereValue = "''";
......
...@@ -380,17 +380,6 @@ public class ChartViewService { ...@@ -380,17 +380,6 @@ public class ChartViewService {
} }
} }
data = datasourceProvider.getData(datasourceRequest); data = datasourceProvider.getData(datasourceRequest);
/**
* 直连不实用缓存
String key = "provider_sql_"+datasourceRequest.getDatasource().getId() + "_" + datasourceRequest.getTable() + "_" +datasourceRequest.getQuery();
Object cache;
if ((cache = CacheUtils.get(JdbcConstants.JDBC_PROVIDER_KEY, key)) == null) {
data = datasourceProvider.getData(datasourceRequest);
CacheUtils.put(JdbcConstants.JDBC_PROVIDER_KEY,key ,data, null, null);
}else {
data = (List<String[]>) cache;
}
*/
} else if (table.getMode() == 1) {// 抽取 } else if (table.getMode() == 1) {// 抽取
// 连接doris,构建doris数据源查询 // 连接doris,构建doris数据源查询
Datasource ds = (Datasource) CommonBeanFactory.getBean("DorisDatasource"); Datasource ds = (Datasource) CommonBeanFactory.getBean("DorisDatasource");
...@@ -410,22 +399,6 @@ public class ChartViewService { ...@@ -410,22 +399,6 @@ public class ChartViewService {
} else { } else {
datasourceRequest.setQuery(qp.getSQL(tableName, xAxis, yAxis, customFilter, extFilterList, ds, view)); datasourceRequest.setQuery(qp.getSQL(tableName, xAxis, yAxis, customFilter, extFilterList, ds, view));
} }
/*// 定时抽取使用缓存
Object cache;
// 仪表板有参数不实用缓存
if (CollectionUtils.isNotEmpty(requestList.getFilter())) {
data = datasourceProvider.getData(datasourceRequest);
}
// 仪表板无参数 且 未缓存过该视图 则查询后缓存
else if ((cache = CacheUtils.get(JdbcConstants.VIEW_CACHE_KEY, id)) == null) {
lock.lock();
data = datasourceProvider.getData(datasourceRequest);
CacheUtils.put(JdbcConstants.VIEW_CACHE_KEY, id, data, null, null);
}
// 仪表板有缓存 使用缓存
else {
data = (List<String[]>) cache;
}*/
// 仪表板有参数不实用缓存 // 仪表板有参数不实用缓存
if (!cache || CollectionUtils.isNotEmpty(requestList.getFilter()) if (!cache || CollectionUtils.isNotEmpty(requestList.getFilter())
|| CollectionUtils.isNotEmpty(requestList.getLinkageFilters()) || CollectionUtils.isNotEmpty(requestList.getLinkageFilters())
...@@ -444,10 +417,6 @@ public class ChartViewService { ...@@ -444,10 +417,6 @@ public class ChartViewService {
} }
} }
} }
// // 返回数据量判定
// if (StringUtils.equalsIgnoreCase("custom", view.getResultMode()) && data.size() > view.getResultCount()) {
// data = data.subList(0, view.getResultCount());
// }
Map<String, Object> map = new TreeMap<>(); Map<String, Object> map = new TreeMap<>();
// 图表组件可再扩展 // 图表组件可再扩展
...@@ -1303,11 +1272,7 @@ public class ChartViewService { ...@@ -1303,11 +1272,7 @@ public class ChartViewService {
chartQuotaDTO.setId(yAxis.get(j).getId()); chartQuotaDTO.setId(yAxis.get(j).getId());
quotaList.add(chartQuotaDTO); quotaList.add(chartQuotaDTO);
scatterChartDataDTO.setQuotaList(quotaList); scatterChartDataDTO.setQuotaList(quotaList);
// try {
// axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
// } catch (Exception e) {
// axisChartDataDTO.setValue(new BigDecimal(0));
// }
if (CollectionUtils.isNotEmpty(extBubble) && extBubble.size() > 0) { if (CollectionUtils.isNotEmpty(extBubble) && extBubble.size() > 0) {
try { try {
scatterChartDataDTO.setValue(new Object[]{ scatterChartDataDTO.setValue(new Object[]{
...@@ -1332,41 +1297,6 @@ public class ChartViewService { ...@@ -1332,41 +1297,6 @@ public class ChartViewService {
} }
} }
/*for (String[] d : data) {
StringBuilder a = new StringBuilder();
for (int i = 0; i < xAxis.size(); i++) {
if (i == xAxis.size() - 1) {
a.append(d[i]);
} else {
a.append(d[i]).append("\n");
}
}
x.add(a.toString());
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
int j = i - xAxis.size();
if (CollectionUtils.isNotEmpty(extBubble) && extBubble.size() > 0) {
try {
series.get(j).getData().add(new Object[]{
a.toString(),
new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]),
new BigDecimal(StringUtils.isEmpty(d[xAxis.size() + yAxis.size()]) ? "0" : d[xAxis.size() + yAxis.size()])
});
} catch (Exception e) {
series.get(j).getData().add(new Object[]{a.toString(), new BigDecimal(0), new BigDecimal(0)});
}
} else {
try {
series.get(j).getData().add(new Object[]{
a.toString(),
new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i])
});
} catch (Exception e) {
series.get(j).getData().add(new Object[]{a.toString(), new BigDecimal(0)});
}
}
}
}*/
map.put("x", x); map.put("x", x);
map.put("series", series); map.put("series", series);
return map; return map;
...@@ -1404,9 +1334,6 @@ public class ChartViewService { ...@@ -1404,9 +1334,6 @@ public class ChartViewService {
} }
private void checkName(ChartViewWithBLOBs chartView) { private void checkName(ChartViewWithBLOBs chartView) {
// if (StringUtils.isEmpty(chartView.getId())) {
// return;
// }
ChartViewExample chartViewExample = new ChartViewExample(); ChartViewExample chartViewExample = new ChartViewExample();
ChartViewExample.Criteria criteria = chartViewExample.createCriteria(); ChartViewExample.Criteria criteria = chartViewExample.createCriteria();
if (StringUtils.isNotEmpty(chartView.getId())) { if (StringUtils.isNotEmpty(chartView.getId())) {
......
...@@ -243,8 +243,6 @@ public class DataSetTableService { ...@@ -243,8 +243,6 @@ public class DataSetTableService {
// 更新数据和字段 // 更新数据和字段
if (update == 1) { if (update == 1) {
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql") || StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) { if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql") || StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
// 删除所有字段,重新抽象
// dataSetTableFieldsService.deleteByTableId(datasetTable.getId());
saveTableField(datasetTable); saveTableField(datasetTable);
} }
} }
...@@ -735,7 +733,6 @@ public class DataSetTableService { ...@@ -735,7 +733,6 @@ public class DataSetTableService {
String sql; String sql;
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
// JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);
Datasource ds; Datasource ds;
if (dataSetTableRequest.getMode() == 0) { if (dataSetTableRequest.getMode() == 0) {
ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId()); ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
...@@ -746,7 +743,6 @@ public class DataSetTableService { ...@@ -746,7 +743,6 @@ public class DataSetTableService {
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);
sql = getCustomSQLDoris(dataTableInfoDTO, list); sql = getCustomSQLDoris(dataTableInfoDTO, list);
} }
// String table = DorisTableUtils.dorisName(dataSetTableRequest.getId());
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
// 使用输入的sql先预执行一次,并拿到所有字段 // 使用输入的sql先预执行一次,并拿到所有字段
datasourceRequest.setQuery(sql); datasourceRequest.setQuery(sql);
......
...@@ -306,8 +306,5 @@ public class DataSetTableTaskService { ...@@ -306,8 +306,5 @@ public class DataSetTableTaskService {
if(!datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())){ if(!datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())){
scheduleService.fireNow(datasetTableTask); scheduleService.fireNow(datasetTableTask);
} }
// if(datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())){
// scheduleService.addSchedule(datasetTableTask);
// }
} }
} }
...@@ -189,7 +189,6 @@ public class ExtractDataService { ...@@ -189,7 +189,6 @@ public class ExtractDataService {
extractData(datasetTable, "all_scope"); extractData(datasetTable, "all_scope");
replaceTable(DorisTableUtils.dorisName(datasetTableId)); replaceTable(DorisTableUtils.dorisName(datasetTableId));
saveSucessLog(datasetTableTaskLog); saveSucessLog(datasetTableTaskLog);
// sendWebMsg(datasetTable, null, true);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime); updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
if(ops.equalsIgnoreCase("替换")){ if(ops.equalsIgnoreCase("替换")){
dataSetTableFieldsService.deleteByTableId(datasetTable.getId()); dataSetTableFieldsService.deleteByTableId(datasetTable.getId());
...@@ -199,7 +198,6 @@ public class ExtractDataService { ...@@ -199,7 +198,6 @@ public class ExtractDataService {
} }
} catch (Exception e) { } catch (Exception e) {
saveErrorLog(datasetTableId, null, e); saveErrorLog(datasetTableId, null, e);
// sendWebMsg(datasetTable, null, false);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null); updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId))); dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)));
} finally { } finally {
...@@ -218,11 +216,9 @@ public class ExtractDataService { ...@@ -218,11 +216,9 @@ public class ExtractDataService {
Long execTime = System.currentTimeMillis(); Long execTime = System.currentTimeMillis();
extractData(datasetTable, "incremental_add"); extractData(datasetTable, "incremental_add");
saveSucessLog(datasetTableTaskLog); saveSucessLog(datasetTableTaskLog);
// sendWebMsg(datasetTable, null, true);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime); updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
} catch (Exception e) { } catch (Exception e) {
saveErrorLog(datasetTableId, null, e); saveErrorLog(datasetTableId, null, e);
// sendWebMsg(datasetTable, null, false);
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null); updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
} finally { } finally {
deleteFile("incremental_add", datasetTableId); deleteFile("incremental_add", datasetTableId);
...@@ -691,20 +687,6 @@ public class ExtractDataService { ...@@ -691,20 +687,6 @@ public class ExtractDataService {
startEntry.setLocation(100, 100); startEntry.setLocation(100, 100);
jobMeta.addJobEntry(startEntry); jobMeta.addJobEntry(startEntry);
//trans
// JobEntryTrans transrans = new JobEntryTrans();
// transrans.clearResultFiles = true;
// transrans.clearResultRows = true;
// transrans.followingAbortRemotely = true;
// transrans.setTransname(transName);
// transrans.setName("Transformation");
// JobEntryCopy transEntry = new JobEntryCopy(transrans);
// transEntry.setDrawn(true);
// transEntry.setLocation(300, 100);
// jobMeta.addJobEntry(transEntry);
// jobMeta.addJobHop(new JobHopMeta(startEntry, transEntry));
//exec shell //exec shell
JobEntryShell shell = new JobEntryShell(); JobEntryShell shell = new JobEntryShell();
shell.setScript(script); shell.setScript(script);
...@@ -807,7 +789,6 @@ public class ExtractDataService { ...@@ -807,7 +789,6 @@ public class ExtractDataService {
case ck: case ck:
CHConfiguration chConfiguration = new Gson().fromJson(datasource.getConfiguration(), CHConfiguration.class); CHConfiguration chConfiguration = new Gson().fromJson(datasource.getConfiguration(), CHConfiguration.class);
dataMeta = new DatabaseMeta("db", "ORACLE", "Native", chConfiguration.getHost().trim(), chConfiguration.getDataBase().trim(), chConfiguration.getPort().toString(), chConfiguration.getUsername(), chConfiguration.getPassword()); dataMeta = new DatabaseMeta("db", "ORACLE", "Native", chConfiguration.getHost().trim(), chConfiguration.getDataBase().trim(), chConfiguration.getPort().toString(), chConfiguration.getUsername(), chConfiguration.getPassword());
// dataMeta.addExtraOption("MYSQL", "characterEncoding", "UTF-8");
dataMeta.setDatabaseType("Clickhouse"); dataMeta.setDatabaseType("Clickhouse");
transMeta.addDatabase(dataMeta); transMeta.addDatabase(dataMeta);
selectSQL = getSelectSQL(extractType, datasetTable, datasource, datasetTableFields, selectSQL); selectSQL = getSelectSQL(extractType, datasetTable, datasource, datasetTableFields, selectSQL);
...@@ -1010,7 +991,6 @@ public class ExtractDataService { ...@@ -1010,7 +991,6 @@ public class ExtractDataService {
} }
private StepMeta udjc(List<DatasetTableField> datasetTableFields, DatasourceTypes datasourceType) { private StepMeta udjc(List<DatasetTableField> datasetTableFields, DatasourceTypes datasourceType) {
// String needToChangeColumnType = "";
String handleBinaryTypeCode = ""; String handleBinaryTypeCode = "";
String excelCompletion = ""; String excelCompletion = "";
...@@ -1129,17 +1109,6 @@ public class ExtractDataService { ...@@ -1129,17 +1109,6 @@ public class ExtractDataService {
" get(Fields.Out, filed).getValueMeta().setType(2);\n" + " get(Fields.Out, filed).getValueMeta().setType(2);\n" +
" \t}"; " \t}";
// private final static String alterColumnTypeCode = " if(\"FILED\".equalsIgnoreCase(filed)){\n" +
// "\t if(tmp != null && tmp.equalsIgnoreCase(\"Y\")){\n" +
// " get(Fields.Out, filed).setValue(r, 1);\n" +
// " get(Fields.Out, filed).getValueMeta().setType(2);\n" +
// " }else{\n" +
// " get(Fields.Out, filed).setValue(r, 0);\n" +
// " get(Fields.Out, filed).getValueMeta().setType(2);\n" +
// " }\n" +
// " }\n" ;
private final static String handleExcelIntColumn = " \t\tif(tmp != null && tmp.endsWith(\".0\")){\n" + private final static String handleExcelIntColumn = " \t\tif(tmp != null && tmp.endsWith(\".0\")){\n" +
" try {\n" + " try {\n" +
" Long.valueOf(tmp.substring(0, tmp.length()-2));\n" + " Long.valueOf(tmp.substring(0, tmp.length()-2));\n" +
......
...@@ -264,7 +264,6 @@ public class DatasourceService { ...@@ -264,7 +264,6 @@ public class DatasourceService {
public void updateDatasourceStatus(){ public void updateDatasourceStatus(){
List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample()); List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample());
datasources.forEach(datasource -> { datasources.forEach(datasource -> {
// checkAndUpdateDatasourceStatus(datasource);
checkAndUpdateDatasourceStatus(datasource, true); checkAndUpdateDatasourceStatus(datasource, true);
}); });
} }
......
...@@ -56,33 +56,6 @@ public class SysMsgService { ...@@ -56,33 +56,6 @@ public class SysMsgService {
@Autowired @Autowired
private SystemParameterService systemParameterService; private SystemParameterService systemParameterService;
/* public List<SysMsg> query(Long userId, MsgRequest msgRequest) {
String orderClause = " create_time desc";
SysMsgExample example = new SysMsgExample();
SysMsgExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
List<String> orders = msgRequest.getOrders();
if (CollectionUtils.isNotEmpty(orders)) {
orderClause = String.join(", ", orders);
}
if (ObjectUtils.isNotEmpty(msgRequest.getType())) {
criteria.andTypeIdEqualTo(msgRequest.getType());
}
if (ObjectUtils.isNotEmpty(msgRequest.getStatus())) {
criteria.andStatusEqualTo(msgRequest.getStatus());
}
criteria.andCreateTimeGreaterThanOrEqualTo(overTime());
example.setOrderByClause(orderClause);
List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example);
return sysMsgs;
}
*/
public List<MsgGridDto> queryGrid(Long userId, MsgRequest msgRequest, List<Long> typeIds, Long startTime) { public List<MsgGridDto> queryGrid(Long userId, MsgRequest msgRequest, List<Long> typeIds, Long startTime) {
String orderClause = " create_time desc"; String orderClause = " create_time desc";
SysMsgExample example = new SysMsgExample(); SysMsgExample example = new SysMsgExample();
...@@ -95,14 +68,6 @@ public class SysMsgService { ...@@ -95,14 +68,6 @@ public class SysMsgService {
orderClause = String.join(", ", orders); orderClause = String.join(", ", orders);
} }
/*if (ObjectUtils.isNotEmpty(msgRequest.getType())) {
SysMsgTypeExample sysMsgTypeExample = new SysMsgTypeExample();
sysMsgTypeExample.createCriteria().andPidEqualTo(msgRequest.getType());
List<SysMsgType> sysMsgTypes = sysMsgTypeMapper.selectByExample(sysMsgTypeExample);
List<Long> typeIds = sysMsgTypes.stream().map(SysMsgType::getMsgTypeId).collect(Collectors.toList());
criteria.andTypeIdIn(typeIds);
}*/
if (CollectionUtils.isNotEmpty(typeIds)){ if (CollectionUtils.isNotEmpty(typeIds)){
criteria.andTypeIdIn(typeIds); criteria.andTypeIdIn(typeIds);
} }
...@@ -112,7 +77,6 @@ public class SysMsgService { ...@@ -112,7 +77,6 @@ public class SysMsgService {
} }
criteria.andCreateTimeGreaterThanOrEqualTo(startTime); criteria.andCreateTimeGreaterThanOrEqualTo(startTime);
/* criteria.andCreateTimeGreaterThanOrEqualTo(overTime()); */
example.setOrderByClause(orderClause); example.setOrderByClause(orderClause);
List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example); List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example);
...@@ -212,12 +176,10 @@ public class SysMsgService { ...@@ -212,12 +176,10 @@ public class SysMsgService {
sysMsgSetting1.setTypeId(2L); sysMsgSetting1.setTypeId(2L);
sysMsgSetting1.setChannelId(1L); sysMsgSetting1.setChannelId(1L);
sysMsgSetting1.setEnable(true); sysMsgSetting1.setEnable(true);
// sysMsgSetting1.setUserId(userId);
SysMsgSetting sysMsgSetting2 = new SysMsgSetting(); SysMsgSetting sysMsgSetting2 = new SysMsgSetting();
sysMsgSetting2.setTypeId(6L); sysMsgSetting2.setTypeId(6L);
sysMsgSetting2.setChannelId(1L); sysMsgSetting2.setChannelId(1L);
sysMsgSetting2.setEnable(true); sysMsgSetting2.setEnable(true);
//sysMsgSetting2.setUserId(userId);
List<SysMsgSetting> lists = new ArrayList<>(); List<SysMsgSetting> lists = new ArrayList<>();
lists.add(sysMsgSetting1); lists.add(sysMsgSetting1);
lists.add(sysMsgSetting2); lists.add(sysMsgSetting2);
...@@ -234,7 +196,6 @@ public class SysMsgService { ...@@ -234,7 +196,6 @@ public class SysMsgService {
public void updateSetting(MsgSettingRequest request, Long userId) { public void updateSetting(MsgSettingRequest request, Long userId) {
Long typeId = request.getTypeId(); Long typeId = request.getTypeId();
Long channelId = request.getChannelId(); Long channelId = request.getChannelId();
// Long userId = AuthUtils.getUser().getUserId();
SysMsgSettingExample example = new SysMsgSettingExample(); SysMsgSettingExample example = new SysMsgSettingExample();
example.createCriteria().andUserIdEqualTo(userId).andTypeIdEqualTo(typeId).andChannelIdEqualTo(channelId); example.createCriteria().andUserIdEqualTo(userId).andTypeIdEqualTo(typeId).andChannelIdEqualTo(channelId);
List<SysMsgSetting> sysMsgSettings = sysMsgSettingMapper.selectByExample(example); List<SysMsgSetting> sysMsgSettings = sysMsgSettingMapper.selectByExample(example);
...@@ -307,13 +268,11 @@ public class SysMsgService { ...@@ -307,13 +268,11 @@ public class SysMsgService {
@Cacheable(value = SysMsgConstants.SYS_MSG_USER_SUBSCRIBE, key = "#userId") @Cacheable(value = SysMsgConstants.SYS_MSG_USER_SUBSCRIBE, key = "#userId")
public List<SubscribeNode> subscribes(Long userId) { public List<SubscribeNode> subscribes(Long userId) {
SysMsgSettingExample example = new SysMsgSettingExample(); SysMsgSettingExample example = new SysMsgSettingExample();
/*example.createCriteria().andUserIdEqualTo(userId).andEnableEqualTo(true);*/
example.createCriteria().andUserIdEqualTo(userId); example.createCriteria().andUserIdEqualTo(userId);
List<SysMsgSetting> sysMsgSettings = sysMsgSettingMapper.selectByExample(example); List<SysMsgSetting> sysMsgSettings = sysMsgSettingMapper.selectByExample(example);
// 添加默认订阅 // 添加默认订阅
sysMsgSettings = addDefault(sysMsgSettings); sysMsgSettings = addDefault(sysMsgSettings);
sysMsgSettings = sysMsgSettings.stream().filter(SysMsgSetting::getEnable).collect(Collectors.toList()); sysMsgSettings = sysMsgSettings.stream().filter(SysMsgSetting::getEnable).collect(Collectors.toList());
// sysMsgSettings.addAll(defaultSettings());
List<SubscribeNode> resultLists = sysMsgSettings.stream().map(item -> { List<SubscribeNode> resultLists = sysMsgSettings.stream().map(item -> {
SubscribeNode subscribeNode = new SubscribeNode(); SubscribeNode subscribeNode = new SubscribeNode();
subscribeNode.setTypeId(item.getTypeId()); subscribeNode.setTypeId(item.getTypeId());
......
...@@ -84,10 +84,6 @@ public class PanelLinkJumpService { ...@@ -84,10 +84,6 @@ public class PanelLinkJumpService {
public PanelLinkJumpDTO queryWithView(String panelId, String viewId) { public PanelLinkJumpDTO queryWithView(String panelId, String viewId) {
PanelLinkJumpDTO resultInfo = extPanelLinkJumpMapper.queryWithViewId(panelId, viewId); PanelLinkJumpDTO resultInfo = extPanelLinkJumpMapper.queryWithViewId(panelId, viewId);
// 获取链接类型为仪表板的关联视图fieldId-PanelLinkJumpInfo Map 映射关系
// Map<String, PanelLinkJumpInfoDTO> mapJumpInfoArray = resultInfo.getLinkJumpInfoArray().stream().filter(jumpInfo -> StringUtils.isNotEmpty(jumpInfo.getFieldId()))
// .collect(Collectors.toMap(PanelLinkJumpInfoDTO::getFieldId, PanelViewLinkageDTO->PanelViewLinkageDTO));
// resultInfo.setMapJumpInfoArray(mapJumpInfoArray);
return resultInfo; return resultInfo;
} }
......
...@@ -159,7 +159,6 @@ public class PanelLinkService { ...@@ -159,7 +159,6 @@ public class PanelLinkService {
} }
if (StringUtils.isEmpty(panelLink.getPwd())) return false; if (StringUtils.isEmpty(panelLink.getPwd())) return false;
boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), panelLink.getPwd()); boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), panelLink.getPwd());
/* boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), decryptParam(panelLink.getPwd())); */
return verify; return verify;
} }
......
...@@ -76,9 +76,6 @@ public class ShareService { ...@@ -76,9 +76,6 @@ public class ShareService {
PanelShareExample example = new PanelShareExample(); PanelShareExample example = new PanelShareExample();
example.createCriteria().andPanelGroupIdEqualTo(panelGroupId); example.createCriteria().andPanelGroupIdEqualTo(panelGroupId);
List<PanelShare> panelShares = mapper.selectByExample(example); List<PanelShare> panelShares = mapper.selectByExample(example);
/*if (CollectionUtils.isEmpty(panelShares)) {
return;
}*/
Map<Integer, List<TempShareNode>> typeSharedMap = panelShares.stream().map(this::convertNode).collect(Collectors.groupingBy(TempShareNode::getType)); Map<Integer, List<TempShareNode>> typeSharedMap = panelShares.stream().map(this::convertNode).collect(Collectors.groupingBy(TempShareNode::getType));
for (Map.Entry<Integer, List<Long>> entry : authURDMap.entrySet()) { for (Map.Entry<Integer, List<Long>> entry : authURDMap.entrySet()) {
...@@ -169,11 +166,6 @@ public class ShareService { ...@@ -169,11 +166,6 @@ public class ShareService {
private Map<String, Object> filterData(List<Long> newTargets, List<TempShareNode> shareNodes) { private Map<String, Object> filterData(List<Long> newTargets, List<TempShareNode> shareNodes) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
/*if (null == newTargets) {
result.put("add", new ArrayList<>());
result.put("red", new ArrayList<>());
return result;
}*/
List<Long> newUserIds = new ArrayList<>(); List<Long> newUserIds = new ArrayList<>();
for (int i = 0; i < newTargets.size(); i++) { for (int i = 0; i < newTargets.size(); i++) {
Long newTargetId = newTargets.get(i); Long newTargetId = newTargets.get(i);
...@@ -264,7 +256,6 @@ public class ShareService { ...@@ -264,7 +256,6 @@ public class ShareService {
String msg = StringUtils.joinWith(",", panelGroups.stream().map(PanelGroup::getName).collect(Collectors.toList())); String msg = StringUtils.joinWith(",", panelGroups.stream().map(PanelGroup::getName).collect(Collectors.toList()));
Gson gson = new Gson(); Gson gson = new Gson();
userIdSet.forEach(userId -> { userIdSet.forEach(userId -> {
// DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!");
DeMsgutil.sendMsg(userId, 2L, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!", gson.toJson(panelIds)); DeMsgutil.sendMsg(userId, 2L, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!", gson.toJson(panelIds));
}); });
......
...@@ -79,8 +79,6 @@ public class DeptService { ...@@ -79,8 +79,6 @@ public class DeptService {
@Transactional @Transactional
public int batchDelete(List<DeptDeleteRequest> requests){ public int batchDelete(List<DeptDeleteRequest> requests){
/* Integer index = ids.stream().map(sysDeptMapper::deleteByPrimaryKey).reduce(Integer::sum).orElse(-1);
return index;*/
List<Long> ids = requests.stream().map(request -> { List<Long> ids = requests.stream().map(request -> {
Long pid = request.getPid(); Long pid = request.getPid();
if (pid != DEPT_ROOT_PID){ if (pid != DEPT_ROOT_PID){
...@@ -127,7 +125,6 @@ public class DeptService { ...@@ -127,7 +125,6 @@ public class DeptService {
public List<SysDept> nodesTreeByCondition(BaseGridRequest request){ public List<SysDept> nodesTreeByCondition(BaseGridRequest request){
//DeptService proxy = proxy();
List<SimpleTreeNode> allNodes = allNodes(); List<SimpleTreeNode> allNodes = allNodes();
List<SimpleTreeNode> targetNodes = nodeByCondition(request); List<SimpleTreeNode> targetNodes = nodeByCondition(request);
if(CollectionUtils.isEmpty(targetNodes)){ if(CollectionUtils.isEmpty(targetNodes)){
......
...@@ -133,8 +133,6 @@ public class EmailService { ...@@ -133,8 +133,6 @@ public class EmailService {
public void editMail(List<SystemParameter> parameters) { public void editMail(List<SystemParameter> parameters) {
/*List<SystemParameter> paramList = this.getParamList(ParamConstants.Classify.MAIL.getValue());
boolean empty = paramList.size() <= 0;*/
parameters.forEach(parameter -> { parameters.forEach(parameter -> {
SystemParameterExample example = new SystemParameterExample(); SystemParameterExample example = new SystemParameterExample();
if (parameter.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getValue())) { if (parameter.getParamKey().equals(ParamConstants.MAIL.PASSWORD.getValue())) {
......
...@@ -35,8 +35,6 @@ public class SystemParameterService { ...@@ -35,8 +35,6 @@ public class SystemParameterService {
@Resource @Resource
private FileService fileService; private FileService fileService;
public String searchEmail() { public String searchEmail() {
return extSystemParameterMapper.email(); return extSystemParameterMapper.email();
} }
...@@ -47,11 +45,9 @@ public class SystemParameterService { ...@@ -47,11 +45,9 @@ public class SystemParameterService {
if (!CollectionUtils.isEmpty(paramList)) { if (!CollectionUtils.isEmpty(paramList)) {
for (SystemParameter param : paramList) { for (SystemParameter param : paramList) {
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.FRONT_TIME_OUT.getValue())) { if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.FRONT_TIME_OUT.getValue())) {
/* result.setFrontTimeOut(StringUtils.isBlank(param.getParamValue()) ? 0 : Integer.parseInt(param.getParamValue())); */
result.setFrontTimeOut(param.getParamValue()); result.setFrontTimeOut(param.getParamValue());
} }
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.MSG_TIME_OUT.getValue())) { if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.MSG_TIME_OUT.getValue())) {
/* result.setMsgTimeOut(StringUtils.isBlank(param.getParamValue()) ? 0 : Integer.parseInt(param.getParamValue())); */
result.setMsgTimeOut(param.getParamValue()); result.setMsgTimeOut(param.getParamValue());
} }
} }
...@@ -59,10 +55,6 @@ public class SystemParameterService { ...@@ -59,10 +55,6 @@ public class SystemParameterService {
return result; return result;
} }
public String getSystemLanguage() { public String getSystemLanguage() {
String result = StringUtils.EMPTY; String result = StringUtils.EMPTY;
SystemParameterExample example = new SystemParameterExample(); SystemParameterExample example = new SystemParameterExample();
...@@ -77,10 +69,6 @@ public class SystemParameterService { ...@@ -77,10 +69,6 @@ public class SystemParameterService {
return result; return result;
} }
public void editBasic(List<SystemParameter> parameters) { public void editBasic(List<SystemParameter> parameters) {
parameters.forEach(parameter -> { parameters.forEach(parameter -> {
SystemParameterExample example = new SystemParameterExample(); SystemParameterExample example = new SystemParameterExample();
...@@ -102,14 +90,10 @@ public class SystemParameterService { ...@@ -102,14 +90,10 @@ public class SystemParameterService {
return systemParameterMapper.selectByExample(example); return systemParameterMapper.selectByExample(example);
} }
public String getVersion() { public String getVersion() {
return System.getenv("MS_VERSION"); return System.getenv("MS_VERSION");
} }
public void saveLdap(List<SystemParameter> parameters) { public void saveLdap(List<SystemParameter> parameters) {
SystemParameterExample example = new SystemParameterExample(); SystemParameterExample example = new SystemParameterExample();
parameters.forEach(param -> { parameters.forEach(param -> {
...@@ -135,7 +119,6 @@ public class SystemParameterService { ...@@ -135,7 +119,6 @@ public class SystemParameterService {
return param.getParamValue(); return param.getParamValue();
} }
public List<SystemParameterDTO> getSystemParameterInfo(String paramConstantsType) { public List<SystemParameterDTO> getSystemParameterInfo(String paramConstantsType) {
List<SystemParameter> paramList = this.getParamList(paramConstantsType); List<SystemParameter> paramList = this.getParamList(paramConstantsType);
List<SystemParameterDTO> dtoList = new ArrayList<>(); List<SystemParameterDTO> dtoList = new ArrayList<>();
...@@ -154,8 +137,6 @@ public class SystemParameterService { ...@@ -154,8 +137,6 @@ public class SystemParameterService {
return dtoList; return dtoList;
} }
public void saveUIInfo(Map<String,List<SystemParameterDTO>> request, List<MultipartFile> bodyFiles) throws IOException { public void saveUIInfo(Map<String,List<SystemParameterDTO>> request, List<MultipartFile> bodyFiles) throws IOException {
List<SystemParameterDTO> parameters = request.get("systemParams"); List<SystemParameterDTO> parameters = request.get("systemParams");
if (null != bodyFiles) if (null != bodyFiles)
......
...@@ -25,16 +25,6 @@ CREATE TABLE IF NOT EXISTS `system_parameter` ( ...@@ -25,16 +25,6 @@ CREATE TABLE IF NOT EXISTS `system_parameter` (
)ENGINE = InnoDB )ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4; DEFAULT CHARSET = utf8mb4;
/*CREATE TABLE IF NOT EXISTS `user_role` (
`id` varchar(50) NOT NULL COMMENT 'ID of user''s role info',
`user_id` varchar(50) NOT NULL COMMENT 'User ID of this user-role info',
`role_id` varchar(50) NOT NULL COMMENT 'Role ID of this user-role info',
`source_id` varchar(50) DEFAULT NULL COMMENT 'The (system|organization|workspace) ID of this user-role info',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
PRIMARY KEY (`id`)
)ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;*/
CREATE TABLE `datasource` ( CREATE TABLE `datasource` (
`id` varchar(50) NOT NULL DEFAULT '' COMMENT 'ID', `id` varchar(50) NOT NULL DEFAULT '' COMMENT 'ID',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论