Commit 69dd9110 by guojx

老板接口优化,删除数据库连接

parent 12684af0
package com.gic.cloud.data.hook.vo;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.Date;
/**
* @Author guojx
* @Date 2024/5/17 15:33
*/
public class FreeQueryRecordVO implements Serializable {
/** 查询定义编号(timestamp) */
protected String id = "";
/** 查询定义编号(timestamp)
* @return
*/
public String getId() {
return id;
}
/** 查询定义编号(timestamp)
* @param id
*/
public void setId(String id) {
this.id = id;
}
/** 更新时间 */
protected Date updateTime = null;
/** 更新时间
* @return
*/
public Date getUpdateTime() {
return updateTime;
}
/** 更新时间
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/** 用户编号 */
protected String userId = "";
/** 用户编号
* @return
*/
public String getUserId() {
return userId;
}
/** 用户编号
* @param userId
*/
public void setUserId(String userId) {
this.userId = userId;
}
/** 查询定义名称 */
protected String name = "";
/** 查询定义名称
* @return
*/
public String getName() {
return name;
}
/** 查询定义名称
* @param name
*/
public void setName(String name) {
this.name = name;
}
/** 查询内容 */
protected String content = "";
/** 查询内容
* @return
*/
public String getContent() {
return content;
}
/** 查询内容
* @param content
*/
public void setContent(String content) {
this.content = content;
}
/**
* 是否否有旧的表extract开头的表,1:有 需要提示:老版取数平台extract表将停止更新并下线,请根据映射关系表调整查询语句
*/
private Integer hasOldTable;
public Integer getHasOldTable() {
if (StringUtils.isNotBlank(content) && content.contains("extract_")) {
return 1;
}
return 0;
}
}
package com.gic.cloud.data.hook.vo;
import java.io.Serializable;
import java.util.Date;
/**
* @Author guojx
* @Date 2024/5/17 15:36
*/
public class FreeQuerySourceVO implements Serializable {
/** 自定义查询编号 */
protected String id = "";
/** 自定义查询编号
* @return
*/
public String getId() {
return id;
}
/** 自定义查询编号
* @param id
*/
public void setId(String id) {
this.id = id;
}
/** 商户编号 */
protected String enterpriseId = "";
/** 商户编号
* @return
*/
public String getEnterpriseId() {
return enterpriseId;
}
/** 商户编号
* @param enterpriseId
*/
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
/** 商户名称 */
protected String enterpriseName = "";
/** 商户名称
* @return
*/
public String getEnterpriseName() {
return enterpriseName;
}
/** 商户名称
* @param enterpriseName
*/
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
private Integer isPrivate = 0;
private Date dbExpiration;
public Integer getIsPrivate() {
return isPrivate;
}
public void setIsPrivate(Integer isPrivate) {
this.isPrivate = isPrivate;
}
public Date getDbExpiration() {
return dbExpiration;
}
public void setDbExpiration(Date dbExpiration) {
this.dbExpiration = dbExpiration;
}
}
...@@ -10,6 +10,9 @@ import com.gic.cloud.data.hook.api.entity.GeneralResult; ...@@ -10,6 +10,9 @@ import com.gic.cloud.data.hook.api.entity.GeneralResult;
import com.gic.cloud.data.hook.api.service.IFlatQueryResultService; import com.gic.cloud.data.hook.api.service.IFlatQueryResultService;
import com.gic.cloud.data.hook.api.service.IFreeQueryService; import com.gic.cloud.data.hook.api.service.IFreeQueryService;
import com.gic.cloud.data.hook.api.service.SearchLogService; import com.gic.cloud.data.hook.api.service.SearchLogService;
import com.gic.cloud.data.hook.vo.FreeQueryRecordVO;
import com.gic.cloud.data.hook.vo.FreeQuerySourceVO;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.EnterpriseDTO; import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService; import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.web.common.utils.SessionContextUtils; import com.gic.web.common.utils.SessionContextUtils;
...@@ -56,8 +59,9 @@ public class FreeQueryController { ...@@ -56,8 +59,9 @@ public class FreeQueryController {
* @return * @return
*/ */
@RequestMapping("/free-query-record-list") @RequestMapping("/free-query-record-list")
public List<FreeQueryRecord> freeQueryRecordList(String userId, String fuzzy, HttpServletRequest request, HttpServletResponse response) { public List<FreeQueryRecordVO> freeQueryRecordList(String userId, String fuzzy, HttpServletRequest request, HttpServletResponse response) {
return this.freeQueryService.getFreeQueryRecordListByUserId(userId, fuzzy); // 限定 10 个/分页 List<FreeQueryRecord> list = this.freeQueryService.getFreeQueryRecordListByUserId(userId, fuzzy); // 限定 10 个/分页
return EntityUtil.changeEntityListNew(FreeQueryRecordVO.class, list);
} }
/** 创建自定义查询记录 /** 创建自定义查询记录
...@@ -236,14 +240,13 @@ public class FreeQueryController { ...@@ -236,14 +240,13 @@ public class FreeQueryController {
@RequestMapping("/get-custom-database") @RequestMapping("/get-custom-database")
public FreeQuerySource getCustomDatabase(){ public FreeQuerySourceVO getCustomDatabase(){
FreeQuerySource freeQuerySource = this.freeQueryService.getFreeQuerySource(SessionContextUtils.getLoginUserEnterpriseId()); FreeQuerySource freeQuerySource = this.freeQueryService.getFreeQuerySource(SessionContextUtils.getLoginUserEnterpriseId());
System.out.println(JSON.toJSONString(freeQuerySource));
if(freeQuerySource == null){ if(freeQuerySource == null){
freeQuerySource = new FreeQuerySource(); freeQuerySource = new FreeQuerySource();
freeQuerySource.setDatabase(this.enterpriseService.getEnterpriseById(SessionContextUtils.getLoginUserEnterpriseId()).getFactoryCode()); freeQuerySource.setDatabase(this.enterpriseService.getEnterpriseById(SessionContextUtils.getLoginUserEnterpriseId()).getFactoryCode());
} }
return freeQuerySource; return EntityUtil.changeEntityNew(FreeQuerySourceVO.class, freeQuerySource);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment