poi版本降低.加入redis队列
This commit is contained in:
parent
a81ca0a5bb
commit
ed9277506d
|
|
@ -115,6 +115,19 @@
|
|||
<artifactId>jtds</artifactId>
|
||||
<version>1.2.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
|
|
|
|||
|
|
@ -72,10 +72,16 @@ public class KettleJob extends BaseEntity
|
|||
/** */
|
||||
@Excel(name = "")
|
||||
private String tplKey;
|
||||
@Excel(name = "最后一次成功时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastSucceedTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
public Date getLastSucceedTime() {
|
||||
return lastSucceedTime;
|
||||
}
|
||||
|
||||
public void setLastSucceedTime(Date lastSucceedTime) {
|
||||
this.lastSucceedTime = lastSucceedTime;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
|
|
|
|||
|
|
@ -68,6 +68,17 @@ public class KettleTrans extends BaseEntity
|
|||
@Excel(name = "可执行角色key")
|
||||
private String roleKey;
|
||||
|
||||
@Excel(name = "最后一次成功时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastSucceedTime;
|
||||
|
||||
public Date getLastSucceedTime() {
|
||||
return lastSucceedTime;
|
||||
}
|
||||
|
||||
public void setLastSucceedTime(Date lastSucceedTime) {
|
||||
this.lastSucceedTime = lastSucceedTime;
|
||||
}
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
@ -217,4 +228,5 @@ public class KettleTrans extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,8 +200,7 @@ public class KettleJobServiceImpl implements IKettleJobService
|
|||
log.error("资源库不存在!");
|
||||
return;
|
||||
}
|
||||
//加入队列中,等待执行
|
||||
redisStreamUtil.addKettleJob(kettleJob);
|
||||
|
||||
//更新一下状态
|
||||
kettleJob.setJobStatus("运行中");
|
||||
kettleJobMapper.updateKettleJob(kettleJob);
|
||||
|
|
@ -212,7 +211,8 @@ public class KettleJobServiceImpl implements IKettleJobService
|
|||
kettleUtil.KETTLE_REPO_NAME=repository.getRepoName();
|
||||
kettleUtil.KETTLE_REPO_PATH=repository.getBaseDir();
|
||||
kettleUtil.callJob(path,kettleJob.getJobName(),null,null);
|
||||
kettleJob.setJobStatus("已结束");
|
||||
kettleJob.setJobStatus("成功");
|
||||
kettleJob.setLastSucceedTime(DateUtils.getNowDate());
|
||||
kettleJobMapper.updateKettleJob(kettleJob);
|
||||
} catch (Exception e) {
|
||||
kettleJob.setJobStatus("异常");
|
||||
|
|
|
|||
|
|
@ -207,7 +207,8 @@ public class KettleTransServiceImpl implements IKettleTransService
|
|||
kettleUtil.KETTLE_REPO_NAME=repository.getRepoName();
|
||||
kettleUtil.KETTLE_REPO_PATH=repository.getBaseDir();
|
||||
kettleUtil.callTrans(path,kettleTrans.getTransName(),null,null);
|
||||
kettleTrans.setTransStatus("已结束");
|
||||
kettleTrans.setTransStatus("成功");
|
||||
kettleTrans.setLastSucceedTime(DateUtils.getNowDate());
|
||||
kettleTransMapper.updateKettleTrans(kettleTrans);
|
||||
} catch (Exception e) {
|
||||
kettleTrans.setTransStatus("异常");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.ruoyi.kettle.tools;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.kettle.domain.KettleJob;
|
||||
import com.ruoyi.kettle.domain.KettleTrans;
|
||||
import com.ruoyi.kettle.service.IKettleJobService;
|
||||
|
|
@ -8,10 +7,7 @@ import com.ruoyi.kettle.service.IKettleTransService;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
import redis.clients.jedis.StreamEntry;
|
||||
|
|
@ -59,7 +55,7 @@ public class RedisStreamUtil {
|
|||
map.put("trans_"+trandId, transName);
|
||||
Jedis jedis = jedisPool.getResource();
|
||||
|
||||
jedis.xadd(koneStream, new StreamEntryID().NEW_ENTRY, map);
|
||||
StreamEntryID id =jedis.xadd(koneStream, new StreamEntryID().NEW_ENTRY, map);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,10 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="isMonitorEnabled" column="is_monitor_enabled" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="tplKey" column="tpl_key" />
|
||||
<result property="lastSucceedTime" column="last_succeed_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKettleJobVo">
|
||||
select id, created_time, update_time, created_by, update_by, job_name, job_description, job_type, job_path, job_repository_id, job_log_level, job_status, is_del, is_monitor_enabled, role_key, tpl_key from kettle_job
|
||||
select id, created_time, update_time, created_by, update_by, job_name, job_description, job_type, job_path, job_repository_id, job_log_level, job_status, is_del, is_monitor_enabled, role_key, tpl_key,last_succeed_time from kettle_job
|
||||
</sql>
|
||||
|
||||
<select id="selectKettleJobList" parameterType="KettleJob" resultMap="KettleJobResult">
|
||||
|
|
@ -123,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isMonitorEnabled != null">is_monitor_enabled = #{isMonitorEnabled},</if>
|
||||
<if test="roleKey != null">role_key = #{roleKey},</if>
|
||||
<if test="tplKey != null">tpl_key = #{tplKey},</if>
|
||||
<if test="lastSucceedTime != null">last_succeed_time = #{lastSucceedTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="tplKey" column="tpl_key" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="lastSucceedTime" column="last_succeed_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKettleTransVo">
|
||||
select id, trans_name, trans_description, created_time, update_time, created_by, update_by, trans_type, trans_path, trans_repository_id, trans_log_level, trans_status, is_del, is_monitor_enabled, tpl_key, role_key, remark from kettle_trans
|
||||
select id, trans_name, trans_description, created_time, update_time, created_by, update_by, trans_type, trans_path, trans_repository_id, trans_log_level, trans_status, is_del, is_monitor_enabled, tpl_key, role_key, remark,last_succeed_time from kettle_trans
|
||||
</sql>
|
||||
|
||||
<select id="selectKettleTransList" parameterType="KettleTrans" resultMap="KettleTransResult">
|
||||
|
|
@ -126,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tplKey != null">tpl_key = #{tplKey},</if>
|
||||
<if test="roleKey != null">role_key = #{roleKey},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="lastSucceedTime != null">last_succeed_time = #{lastSucceedTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -53,13 +53,27 @@
|
|||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
$("#transPath").val(path);
|
||||
var pNodeId = treeId;
|
||||
if(/^[0-9]+.?[0-9]*$/.test(treeId)){
|
||||
$("#transRepositoryId").val(treeId);
|
||||
|
||||
}
|
||||
|
||||
console.log("pathpathpathpath::"+path);
|
||||
console.log("pathpathpathpath::"+path+"_id:"+treeId);
|
||||
var treeObj = $.fn.zTree.getZTreeObj( "tree");
|
||||
var selectedNode = treeObj .getSelectedNodes();
|
||||
|
||||
var pNode = selectedNode[0].getParentNode();
|
||||
while(!!pNode) {
|
||||
var id = pNode.id;
|
||||
pNode = pNode.getParentNode();
|
||||
if(pNode == null){
|
||||
pNodeId = id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("#transRepositoryId").val(pNodeId);
|
||||
if(/^[0-9]+.?[0-9]*$/.test(treeId) && !selectedNode[0].isParent){
|
||||
console.log("进来了");
|
||||
qryRepoSubTree(treeId);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@
|
|||
var quartzFlag=[[${@permission.hasPermi('kettle:job:setquartz')}]];
|
||||
|
||||
var prefix = ctx + "kettle/job";
|
||||
|
||||
var logLevel = [[${@dict.getType('kettle_log_level')}]];
|
||||
var jobStatus = [[${@dict.getType('kettle_trans_status')}]];
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
|
|
@ -110,11 +111,21 @@
|
|||
},*/
|
||||
{
|
||||
field: 'jobLogLevel',
|
||||
title: '日志级别'
|
||||
title: '日志级别',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(logLevel, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'jobStatus',
|
||||
title: '状态'
|
||||
title: '状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(jobStatus, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'lastSucceedTime',
|
||||
title: '最后成功时间',
|
||||
},
|
||||
/* {
|
||||
field: 'isDel',
|
||||
|
|
|
|||
|
|
@ -109,17 +109,21 @@
|
|||
return $.table.selectDictLabel(transStatus, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'lastSucceedTime',
|
||||
title: '最后成功时间',
|
||||
},
|
||||
// {
|
||||
// field: 'isDel',
|
||||
// title: '是否删除'
|
||||
// },
|
||||
{
|
||||
field: 'isMonitorEnabled',
|
||||
title: '是否启用',
|
||||
formatter: function(value, row, index) {
|
||||
return value==1?"是":"否";
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'isMonitorEnabled',
|
||||
// title: '是否启用',
|
||||
// formatter: function(value, row, index) {
|
||||
// return value==1?"是":"否";
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// field: 'tplKey',
|
||||
// title: '保留备用'
|
||||
|
|
|
|||
2
pom.xml
2
pom.xml
|
|
@ -30,7 +30,7 @@
|
|||
<jna.version>5.8.0</jna.version>
|
||||
<commons.io.version>2.10.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<poi.version>3.17</poi.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
</properties>
|
||||
|
||||
|
|
|
|||
|
|
@ -1102,7 +1102,7 @@ public class ExcelUtil<T>
|
|||
Cell cell = row.getCell(column);
|
||||
if (StringUtils.isNotNull(cell))
|
||||
{
|
||||
if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA)
|
||||
if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA)
|
||||
{
|
||||
val = cell.getNumericCellValue();
|
||||
if (DateUtil.isCellDateFormatted(cell))
|
||||
|
|
@ -1121,15 +1121,15 @@ public class ExcelUtil<T>
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (cell.getCellType() == CellType.STRING)
|
||||
else if (cell.getCellTypeEnum() == CellType.STRING)
|
||||
{
|
||||
val = cell.getStringCellValue();
|
||||
}
|
||||
else if (cell.getCellType() == CellType.BOOLEAN)
|
||||
else if (cell.getCellTypeEnum() == CellType.BOOLEAN)
|
||||
{
|
||||
val = cell.getBooleanCellValue();
|
||||
}
|
||||
else if (cell.getCellType() == CellType.ERROR)
|
||||
else if (cell.getCellTypeEnum() == CellType.ERROR)
|
||||
{
|
||||
val = cell.getErrorCellValue();
|
||||
}
|
||||
|
|
@ -1158,7 +1158,7 @@ public class ExcelUtil<T>
|
|||
for (int i = row.getFirstCellNum(); i < row.getLastCellNum(); i++)
|
||||
{
|
||||
Cell cell = row.getCell(i);
|
||||
if (cell != null && cell.getCellType() != CellType.BLANK)
|
||||
if (cell != null && cell.getCellTypeEnum() != CellType.BLANK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue