修改表名及引用地方
This commit is contained in:
parent
af9702e58b
commit
9733882fab
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLivingDetails.dao;
|
||||
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 集成任务-实例详情(integration_task_living_details: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
public interface IIntegrationTaskLivingDetailsDao extends IBaseDao<IntegrationTaskLivingDetailsEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.impl;
|
||||
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 集成任务-实例详情(IntegrationTaskLivingDetails)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
@Repository(value = "IntegrationTaskLivingDetailsDaoImpl")
|
||||
public class IntegrationTaskLivingDetailsDaoImpl extends MybatisGenericDao<IntegrationTaskLivingDetailsEntity, String> implements IIntegrationTaskLivingDetailsDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLog.dao;
|
||||
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 集成任务-实例详情(integration_task_living_details: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
public interface IIntegrationTaskLogDao extends IBaseDao<IntegrationTaskLogEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLog.dao.impl;
|
||||
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.dao.IIntegrationTaskLogDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 集成任务-实例详情(IntegrationTaskLog)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
@Repository(value = "IntegrationTaskLogDaoImpl")
|
||||
public class IntegrationTaskLogDaoImpl extends MybatisGenericDao<IntegrationTaskLogEntity, String> implements IIntegrationTaskLogDao {
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLivingDetails.entity;
|
||||
package com.hzya.frame.sysnew.integtationTaskLog.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 集成任务-实例详情(IntegrationTaskLivingDetails)实体类
|
||||
* 集成任务-实例详情(IntegrationTaskLog)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
public class IntegrationTaskLivingDetailsEntity extends BaseEntity {
|
||||
public class IntegrationTaskLogEntity extends BaseEntity {
|
||||
|
||||
/** 集成任务-实例_id */
|
||||
private String taskLinvingId;
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.impl.IntegrationTaskLivingDetailsDaoImpl">
|
||||
<mapper namespace="com.hzya.frame.sysnew.integtationTaskLog.dao.impl.IntegrationTaskLogDaoImpl">
|
||||
|
||||
<resultMap id="get-IntegrationTaskLivingDetailsEntity-result"
|
||||
type="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
<resultMap id="get-IntegrationTaskLogEntity-result"
|
||||
type="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="taskLinvingId" column="task_linving_id" jdbcType="VARCHAR"/>
|
||||
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="IntegrationTaskLivingDetailsEntity_Base_Column_List">
|
||||
<sql id="IntegrationTaskLogEntity_Base_Column_List">
|
||||
id
|
||||
,task_linving_id
|
||||
,task_id
|
||||
|
@ -45,16 +45,16 @@
|
|||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLivingDetailsEntity-result">
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLogEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/>
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List"/>
|
||||
from integration_task_living_details where id = #{id} and sts = 'Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLivingDetailsEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLogEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/>
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List"/>
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
|
@ -83,7 +83,7 @@
|
|||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
select count(1) from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
|
@ -111,10 +111,10 @@
|
|||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLivingDetailsEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLogEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/>
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List"/>
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
|
@ -148,10 +148,10 @@
|
|||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="IntegrationTaskLivingDetailsentity_list_or" resultMap="get-IntegrationTaskLivingDetailsEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
<select id="IntegrationTaskLogentity_list_or" resultMap="get-IntegrationTaskLogEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/>
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List"/>
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
|
@ -180,7 +180,7 @@
|
|||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
insert into integration_task_living_details(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -269,7 +269,7 @@
|
|||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
update integration_task_living_details set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="taskLinvingId != null and taskLinvingId != ''">task_linving_id = #{taskLinvingId},</if>
|
||||
|
@ -294,13 +294,13 @@
|
|||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
|
||||
update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id =
|
||||
#{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
|
@ -1,17 +1,17 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLivingDetails.service;
|
||||
package com.hzya.frame.sysnew.integtationTaskLog.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 集成任务-实例详情(IntegrationTaskLivingDetails)表服务接口
|
||||
* 集成任务-实例详情(IntegrationTaskLog)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
public interface IIntegrationTaskLivingDetailsService extends IBaseService<IntegrationTaskLivingDetailsEntity, String>{
|
||||
public interface IIntegrationTaskLogService extends IBaseService<IntegrationTaskLogEntity, String>{
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
|
@ -1,35 +1,33 @@
|
|||
package com.hzya.frame.sysnew.integtationTaskLivingDetails.service.impl;
|
||||
package com.hzya.frame.sysnew.integtationTaskLog.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.dao.IIntegrationTaskLogDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.service.IIntegrationTaskLogService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 集成任务-实例详情(IntegrationTaskLivingDetails)表服务实现类
|
||||
* 集成任务-实例详情(IntegrationTaskLog)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:37:55
|
||||
*/
|
||||
@Service(value = "integrationTaskLivingDetailsService")
|
||||
public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<IntegrationTaskLivingDetailsEntity, String> implements IIntegrationTaskLivingDetailsService {
|
||||
@Service(value = "integrationTaskLogService")
|
||||
public class IntegrationTaskLogServiceImpl extends BaseService<IntegrationTaskLogEntity, String> implements IIntegrationTaskLogService {
|
||||
|
||||
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao;
|
||||
private IIntegrationTaskLogDao integrationTaskLogDao;
|
||||
|
||||
@Autowired
|
||||
public void setIntegrationTaskLivingDetailsDao(IIntegrationTaskLivingDetailsDao dao) {
|
||||
this.integrationTaskLivingDetailsDao = dao;
|
||||
public void setIntegrationTaskLogDao(IIntegrationTaskLogDao dao) {
|
||||
this.integrationTaskLogDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
|
@ -42,13 +40,13 @@ public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<Integra
|
|||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
|
||||
IntegrationTaskLivingDetailsEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLivingDetailsEntity.class);
|
||||
IntegrationTaskLogEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLogEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<IntegrationTaskLivingDetailsEntity> list = integrationTaskLivingDetailsDao.queryByLike(entity);
|
||||
List<IntegrationTaskLogEntity> list = integrationTaskLogDao.queryByLike(entity);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
@ -63,14 +61,14 @@ public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<Integra
|
|||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskLivingDetailsEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLivingDetailsEntity.class);
|
||||
IntegrationTaskLogEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLogEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = integrationTaskLivingDetailsDao.get(entity.getId());
|
||||
entity = integrationTaskLogDao.get(entity.getId());
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("获取任务日志失败");
|
||||
}
|
|
@ -2,18 +2,14 @@ package com.hzya.frame.web.quartz;
|
|||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.sys.apireflection.service.impl.ApiHandleServiceImpl;
|
||||
|
||||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.service.impl.IntegrationTaskServiceImpl;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.service.impl.IntegrationTaskLivingServiceImpl;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.dao.IIntegrationTaskLogDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.util.PluginUtils;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
@ -22,11 +18,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -38,7 +30,7 @@ public class QuartzJobFactory implements Job {
|
|||
@Resource
|
||||
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao;
|
||||
private IIntegrationTaskLogDao integrationTaskLogDao;
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
//当前开始时间
|
||||
|
@ -82,23 +74,23 @@ public class QuartzJobFactory implements Job {
|
|||
return;
|
||||
}
|
||||
//任务日志
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID());
|
||||
integrationTaskLivingDetailsEntity.setTaskLinvingId(integrationTaskLivingEntity.getId());
|
||||
integrationTaskLivingDetailsEntity.setTaskId(integrationTaskEntity.getId());
|
||||
integrationTaskLivingDetailsEntity.setTaskCode(integrationTaskEntity.getTaskCode());
|
||||
integrationTaskLivingDetailsEntity.setTaskName(integrationTaskEntity.getTaskName());
|
||||
integrationTaskLivingDetailsEntity.setTaskStatus("1");
|
||||
integrationTaskLivingDetailsEntity.setStartTime(startTime);//当前任务开始时间
|
||||
integrationTaskLivingDetailsEntity.setCompanyId(integrationTaskEntity.getCompanyId());
|
||||
integrationTaskLivingDetailsEntity.setOrg_id(integrationTaskEntity.getOrg_id());
|
||||
integrationTaskLivingDetailsEntity.setCreate_user_id(integrationTaskEntity.getCreate_user_id());
|
||||
integrationTaskLivingDetailsEntity.setModify_user_id(integrationTaskEntity.getModify_user_id());
|
||||
integrationTaskLivingDetailsEntity.setCreate_time(new Date());
|
||||
integrationTaskLivingDetailsEntity.setModify_time(new Date());
|
||||
integrationTaskLivingDetailsEntity.setSts("Y");
|
||||
integrationTaskLivingDetailsEntity.setRemark("任务执行中,请等待");
|
||||
integrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity);
|
||||
IntegrationTaskLogEntity integrationTaskLogEntity = new IntegrationTaskLogEntity();
|
||||
integrationTaskLogEntity.setId(UUIDUtils.getUUID());
|
||||
integrationTaskLogEntity.setTaskLinvingId(integrationTaskLivingEntity.getId());
|
||||
integrationTaskLogEntity.setTaskId(integrationTaskEntity.getId());
|
||||
integrationTaskLogEntity.setTaskCode(integrationTaskEntity.getTaskCode());
|
||||
integrationTaskLogEntity.setTaskName(integrationTaskEntity.getTaskName());
|
||||
integrationTaskLogEntity.setTaskStatus("1");
|
||||
integrationTaskLogEntity.setStartTime(startTime);//当前任务开始时间
|
||||
integrationTaskLogEntity.setCompanyId(integrationTaskEntity.getCompanyId());
|
||||
integrationTaskLogEntity.setOrg_id(integrationTaskEntity.getOrg_id());
|
||||
integrationTaskLogEntity.setCreate_user_id(integrationTaskEntity.getCreate_user_id());
|
||||
integrationTaskLogEntity.setModify_user_id(integrationTaskEntity.getModify_user_id());
|
||||
integrationTaskLogEntity.setCreate_time(new Date());
|
||||
integrationTaskLogEntity.setModify_time(new Date());
|
||||
integrationTaskLogEntity.setSts("Y");
|
||||
integrationTaskLogEntity.setRemark("任务执行中,请等待");
|
||||
integrationTaskLogDao.save(integrationTaskLogEntity);
|
||||
integrationTaskLivingEntity.setTaskStatus("1");//执行中
|
||||
integrationTaskLivingEntity.setStartTime(startTime);
|
||||
integrationTaskLivingEntity.setModify_time(new Date());
|
||||
|
@ -106,14 +98,14 @@ public class QuartzJobFactory implements Job {
|
|||
//判断插件是否启用
|
||||
SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(integrationTaskEntity.getTaskPlugin());
|
||||
if(sysApplicationPluginEntity == null || sysApplicationPluginEntity.getPluginCode() == null || !"1".equals(sysApplicationPluginEntity.getPluginStatus())){
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
|
||||
"2","3","插件未启用,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
|
||||
return;
|
||||
}
|
||||
//查找插件
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode());
|
||||
if(pluginBaseEntity == null ){
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
|
||||
"2","3","插件未找到,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
|
||||
return;
|
||||
}
|
||||
|
@ -125,15 +117,15 @@ public class QuartzJobFactory implements Job {
|
|||
JsonResultEntity jsonResultEntity = pluginBaseEntity.executeBusiness(req);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
//写日志,修改任务实例
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
|
||||
"2","2",jsonResultEntity.getMsg(),startTime,startTime,new Date());
|
||||
}else {
|
||||
//写日志,修改任务实例
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
|
||||
"3","3",jsonResultEntity.getMsg(),startTime,startTime,new Date());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
|
||||
"3","3","插件执行失败,请联系管理员",startTime,startTime,new Date());
|
||||
logger.error("插件执行失败:"+e.getMessage());
|
||||
}
|
||||
|
@ -150,7 +142,7 @@ public class QuartzJobFactory implements Job {
|
|||
* @return void
|
||||
**/
|
||||
private void saveLivingAndDetail(IntegrationTaskLivingEntity integrationTaskLivingEntity,
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity,
|
||||
IntegrationTaskLogEntity integrationTaskLogEntity,
|
||||
String livingtype,String detailtype, String msg,Date oldStartTime,Date startTime,Date endTime) {
|
||||
Long interval = (endTime.getTime() - startTime.getTime()) / (1000); // 计算间隔天数
|
||||
integrationTaskLivingEntity.setTaskStatus(livingtype);//待执行
|
||||
|
@ -161,12 +153,12 @@ public class QuartzJobFactory implements Job {
|
|||
integrationTaskLivingEntity.setRunNum(integrationTaskLivingEntity.getRunNum()+1);
|
||||
integrationTaskLivingEntity.setModify_time(new Date());
|
||||
iIntegrationTaskCacheableService.updateIntegrationTaskLivingEntity(integrationTaskLivingEntity);
|
||||
if(integrationTaskLivingDetailsEntity != null ){
|
||||
integrationTaskLivingDetailsEntity.setEndTime(endTime);
|
||||
integrationTaskLivingDetailsEntity.setDiffTime(interval.toString());
|
||||
integrationTaskLivingDetailsEntity.setTaskStatus(detailtype);//执行成功
|
||||
integrationTaskLivingDetailsEntity.setRemark(msg);
|
||||
integrationTaskLivingDetailsDao.update(integrationTaskLivingDetailsEntity);
|
||||
if(integrationTaskLogEntity != null ){
|
||||
integrationTaskLogEntity.setEndTime(endTime);
|
||||
integrationTaskLogEntity.setDiffTime(interval.toString());
|
||||
integrationTaskLogEntity.setTaskStatus(detailtype);//执行成功
|
||||
integrationTaskLogEntity.setRemark(msg);
|
||||
integrationTaskLogDao.update(integrationTaskLogEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue