修改表名及引用地方

This commit is contained in:
lvleigang 2024-05-15 11:31:44 +08:00
parent af9702e58b
commit 9733882fab
9 changed files with 105 additions and 115 deletions

View File

@ -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> {
}

View File

@ -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{
}

View File

@ -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> {
}

View File

@ -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 {
}

View File

@ -1,14 +1,14 @@
package com.hzya.frame.sysnew.integtationTaskLivingDetails.entity; package com.hzya.frame.sysnew.integtationTaskLog.entity;
import java.util.Date; import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity; import com.hzya.frame.web.entity.BaseEntity;
/** /**
* 集成任务-实例详情(IntegrationTaskLivingDetails)实体类 * 集成任务-实例详情(IntegrationTaskLog)实体类
* *
* @author makejava * @author makejava
* @since 2024-05-06 15:37:55 * @since 2024-05-06 15:37:55
*/ */
public class IntegrationTaskLivingDetailsEntity extends BaseEntity { public class IntegrationTaskLogEntity extends BaseEntity {
/** 集成任务-实例_id */ /** 集成任务-实例_id */
private String taskLinvingId; private String taskLinvingId;

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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" <resultMap id="get-IntegrationTaskLogEntity-result"
type="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity"> type="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
<result property="id" column="id" jdbcType="VARCHAR"/> <result property="id" column="id" jdbcType="VARCHAR"/>
<result property="taskLinvingId" column="task_linving_id" jdbcType="VARCHAR"/> <result property="taskLinvingId" column="task_linving_id" jdbcType="VARCHAR"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/> <result property="taskId" column="task_id" jdbcType="VARCHAR"/>
@ -24,7 +24,7 @@
<result property="companyId" column="company_id" jdbcType="VARCHAR"/> <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 查询的字段--> <!-- 查询的字段-->
<sql id="IntegrationTaskLivingDetailsEntity_Base_Column_List"> <sql id="IntegrationTaskLogEntity_Base_Column_List">
id id
,task_linving_id ,task_linving_id
,task_id ,task_id
@ -45,16 +45,16 @@
,company_id ,company_id
</sql> </sql>
<!--通过ID获取数据 --> <!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-IntegrationTaskLivingDetailsEntity-result"> <select id="entity_get" resultMap="get-IntegrationTaskLogEntity-result">
select select
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/> <include refid="IntegrationTaskLogEntity_Base_Column_List"/>
from integration_task_living_details where id = #{id} and sts = 'Y' from integration_task_living_details where id = #{id} and sts = 'Y'
</select> </select>
<!-- 查询 采用==查询 --> <!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-IntegrationTaskLivingDetailsEntity-result" <select id="entity_list_base" resultMap="get-IntegrationTaskLogEntity-result"
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity"> parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
select select
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/> <include refid="IntegrationTaskLogEntity_Base_Column_List"/>
from integration_task_living_details from integration_task_living_details
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if> <if test="id != null and id != ''">and id = #{id}</if>
@ -83,7 +83,7 @@
<!-- 查询符合条件的数量 --> <!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" <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 select count(1) from integration_task_living_details
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if> <if test="id != null and id != ''">and id = #{id}</if>
@ -111,10 +111,10 @@
</select> </select>
<!-- 分页查询列表 采用like格式 --> <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-IntegrationTaskLivingDetailsEntity-result" <select id="entity_list_like" resultMap="get-IntegrationTaskLogEntity-result"
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity"> parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
select select
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/> <include refid="IntegrationTaskLogEntity_Base_Column_List"/>
from integration_task_living_details from integration_task_living_details
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if> <if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
@ -148,10 +148,10 @@
</select> </select>
<!-- 查询列表 字段采用or格式 --> <!-- 查询列表 字段采用or格式 -->
<select id="IntegrationTaskLivingDetailsentity_list_or" resultMap="get-IntegrationTaskLivingDetailsEntity-result" <select id="IntegrationTaskLogentity_list_or" resultMap="get-IntegrationTaskLogEntity-result"
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity"> parameterType="com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity">
select select
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List"/> <include refid="IntegrationTaskLogEntity_Base_Column_List"/>
from integration_task_living_details from integration_task_living_details
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if> <if test="id != null and id != ''">or id = #{id}</if>
@ -180,7 +180,7 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="entity_insert" <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( insert into integration_task_living_details(
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if> <if test="id != null and id != ''">id ,</if>
@ -269,7 +269,7 @@
</insert> </insert>
<!--通过主键修改方法--> <!--通过主键修改方法-->
<update id="entity_update" <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 update integration_task_living_details set
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="taskLinvingId != null and taskLinvingId != ''">task_linving_id = #{taskLinvingId},</if> <if test="taskLinvingId != null and taskLinvingId != ''">task_linving_id = #{taskLinvingId},</if>
@ -294,13 +294,13 @@
</update> </update>
<!-- 逻辑删除 --> <!-- 逻辑删除 -->
<update id="entity_logicDelete" <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} update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id} where id = #{id}
</update> </update>
<!-- 多条件逻辑删除 --> <!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" <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 = update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id =
#{modify_user_id} #{modify_user_id}
<trim prefix="where" prefixOverrides="and"> <trim prefix="where" prefixOverrides="and">

View File

@ -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.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.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
/** /**
* 集成任务-实例详情(IntegrationTaskLivingDetails)表服务接口 * 集成任务-实例详情(IntegrationTaskLog)表服务接口
* *
* @author makejava * @author makejava
* @since 2024-05-06 15:37:55 * @since 2024-05-06 15:37:55
*/ */
public interface IIntegrationTaskLivingDetailsService extends IBaseService<IntegrationTaskLivingDetailsEntity, String>{ public interface IIntegrationTaskLogService extends IBaseService<IntegrationTaskLogEntity, String>{
/** /**
* @param jsonObject * @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity * @return com.hzya.frame.web.entity.JsonResultEntity

View File

@ -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.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity; import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLog.dao.IIntegrationTaskLogDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLog.service.IIntegrationTaskLogService;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List; import java.util.List;
/** /**
* 集成任务-实例详情(IntegrationTaskLivingDetails)表服务实现类 * 集成任务-实例详情(IntegrationTaskLog)表服务实现类
* *
* @author makejava * @author makejava
* @since 2024-05-06 15:37:55 * @since 2024-05-06 15:37:55
*/ */
@Service(value = "integrationTaskLivingDetailsService") @Service(value = "integrationTaskLogService")
public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<IntegrationTaskLivingDetailsEntity, String> implements IIntegrationTaskLivingDetailsService { public class IntegrationTaskLogServiceImpl extends BaseService<IntegrationTaskLogEntity, String> implements IIntegrationTaskLogService {
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao; private IIntegrationTaskLogDao integrationTaskLogDao;
@Autowired @Autowired
public void setIntegrationTaskLivingDetailsDao(IIntegrationTaskLivingDetailsDao dao) { public void setIntegrationTaskLogDao(IIntegrationTaskLogDao dao) {
this.integrationTaskLivingDetailsDao = dao; this.integrationTaskLogDao = dao;
this.dao = dao; this.dao = dao;
} }
@ -42,13 +40,13 @@ public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<Integra
**/ **/
@Override @Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) { 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) { if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在"); return BaseResult.getFailureMessageEntity("分页查询参数不存在");
} }
PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<IntegrationTaskLivingDetailsEntity> list = integrationTaskLivingDetailsDao.queryByLike(entity); List<IntegrationTaskLogEntity> list = integrationTaskLogDao.queryByLike(entity);
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
} }
@ -63,14 +61,14 @@ public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<Integra
**/ **/
@Override @Override
public JsonResultEntity getEntity(JSONObject jsonObject) { public JsonResultEntity getEntity(JSONObject jsonObject) {
IntegrationTaskLivingDetailsEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLivingDetailsEntity.class); IntegrationTaskLogEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLogEntity.class);
if (entity == null) { if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空"); return BaseResult.getFailureMessageEntity("参数不允许为空");
} }
if (entity.getId() == null || "".equals(entity.getId())) { if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误"); return BaseResult.getFailureMessageEntity("系统错误");
} }
entity = integrationTaskLivingDetailsDao.get(entity.getId()); entity = integrationTaskLogDao.get(entity.getId());
if (entity == null) { if (entity == null) {
return BaseResult.getFailureMessageEntity("获取任务日志失败"); return BaseResult.getFailureMessageEntity("获取任务日志失败");
} }

View File

@ -2,18 +2,14 @@ package com.hzya.frame.web.quartz;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.hzya.frame.base.PluginBaseEntity; 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.application.plugin.entity.SysApplicationPluginEntity;
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService; import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity; 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.entity.IntegrationTaskLivingEntity;
import com.hzya.frame.sysnew.integtationTaskLiving.service.impl.IntegrationTaskLivingServiceImpl; import com.hzya.frame.sysnew.integtationTaskLog.dao.IIntegrationTaskLogDao;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; import com.hzya.frame.sysnew.integtationTaskLog.entity.IntegrationTaskLogEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
import com.hzya.frame.util.PluginUtils; import com.hzya.frame.util.PluginUtils;
import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
@ -22,11 +18,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -38,7 +30,7 @@ public class QuartzJobFactory implements Job {
@Resource @Resource
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService; private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
@Resource @Resource
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao; private IIntegrationTaskLogDao integrationTaskLogDao;
@Override @Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
//当前开始时间 //当前开始时间
@ -82,23 +74,23 @@ public class QuartzJobFactory implements Job {
return; return;
} }
//任务日志 //任务日志
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLogEntity integrationTaskLogEntity = new IntegrationTaskLogEntity();
integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); integrationTaskLogEntity.setId(UUIDUtils.getUUID());
integrationTaskLivingDetailsEntity.setTaskLinvingId(integrationTaskLivingEntity.getId()); integrationTaskLogEntity.setTaskLinvingId(integrationTaskLivingEntity.getId());
integrationTaskLivingDetailsEntity.setTaskId(integrationTaskEntity.getId()); integrationTaskLogEntity.setTaskId(integrationTaskEntity.getId());
integrationTaskLivingDetailsEntity.setTaskCode(integrationTaskEntity.getTaskCode()); integrationTaskLogEntity.setTaskCode(integrationTaskEntity.getTaskCode());
integrationTaskLivingDetailsEntity.setTaskName(integrationTaskEntity.getTaskName()); integrationTaskLogEntity.setTaskName(integrationTaskEntity.getTaskName());
integrationTaskLivingDetailsEntity.setTaskStatus("1"); integrationTaskLogEntity.setTaskStatus("1");
integrationTaskLivingDetailsEntity.setStartTime(startTime);//当前任务开始时间 integrationTaskLogEntity.setStartTime(startTime);//当前任务开始时间
integrationTaskLivingDetailsEntity.setCompanyId(integrationTaskEntity.getCompanyId()); integrationTaskLogEntity.setCompanyId(integrationTaskEntity.getCompanyId());
integrationTaskLivingDetailsEntity.setOrg_id(integrationTaskEntity.getOrg_id()); integrationTaskLogEntity.setOrg_id(integrationTaskEntity.getOrg_id());
integrationTaskLivingDetailsEntity.setCreate_user_id(integrationTaskEntity.getCreate_user_id()); integrationTaskLogEntity.setCreate_user_id(integrationTaskEntity.getCreate_user_id());
integrationTaskLivingDetailsEntity.setModify_user_id(integrationTaskEntity.getModify_user_id()); integrationTaskLogEntity.setModify_user_id(integrationTaskEntity.getModify_user_id());
integrationTaskLivingDetailsEntity.setCreate_time(new Date()); integrationTaskLogEntity.setCreate_time(new Date());
integrationTaskLivingDetailsEntity.setModify_time(new Date()); integrationTaskLogEntity.setModify_time(new Date());
integrationTaskLivingDetailsEntity.setSts("Y"); integrationTaskLogEntity.setSts("Y");
integrationTaskLivingDetailsEntity.setRemark("任务执行中,请等待"); integrationTaskLogEntity.setRemark("任务执行中,请等待");
integrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity); integrationTaskLogDao.save(integrationTaskLogEntity);
integrationTaskLivingEntity.setTaskStatus("1");//执行中 integrationTaskLivingEntity.setTaskStatus("1");//执行中
integrationTaskLivingEntity.setStartTime(startTime); integrationTaskLivingEntity.setStartTime(startTime);
integrationTaskLivingEntity.setModify_time(new Date()); integrationTaskLivingEntity.setModify_time(new Date());
@ -106,14 +98,14 @@ public class QuartzJobFactory implements Job {
//判断插件是否启用 //判断插件是否启用
SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(integrationTaskEntity.getTaskPlugin()); SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(integrationTaskEntity.getTaskPlugin());
if(sysApplicationPluginEntity == null || sysApplicationPluginEntity.getPluginCode() == null || !"1".equals(sysApplicationPluginEntity.getPluginStatus())){ if(sysApplicationPluginEntity == null || sysApplicationPluginEntity.getPluginCode() == null || !"1".equals(sysApplicationPluginEntity.getPluginStatus())){
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity, saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"2","3","插件未启用,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date()); "2","3","插件未启用,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
return; return;
} }
//查找插件 //查找插件
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode()); PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode());
if(pluginBaseEntity == null ){ if(pluginBaseEntity == null ){
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity, saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"2","3","插件未找到,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date()); "2","3","插件未找到,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
return; return;
} }
@ -125,15 +117,15 @@ public class QuartzJobFactory implements Job {
JsonResultEntity jsonResultEntity = pluginBaseEntity.executeBusiness(req); JsonResultEntity jsonResultEntity = pluginBaseEntity.executeBusiness(req);
if(jsonResultEntity.isFlag()){ if(jsonResultEntity.isFlag()){
//写日志修改任务实例 //写日志修改任务实例
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity, saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"2","2",jsonResultEntity.getMsg(),startTime,startTime,new Date()); "2","2",jsonResultEntity.getMsg(),startTime,startTime,new Date());
}else { }else {
//写日志修改任务实例 //写日志修改任务实例
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity, saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"3","3",jsonResultEntity.getMsg(),startTime,startTime,new Date()); "3","3",jsonResultEntity.getMsg(),startTime,startTime,new Date());
} }
} catch (Exception e) { } catch (Exception e) {
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity, saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"3","3","插件执行失败,请联系管理员",startTime,startTime,new Date()); "3","3","插件执行失败,请联系管理员",startTime,startTime,new Date());
logger.error("插件执行失败:"+e.getMessage()); logger.error("插件执行失败:"+e.getMessage());
} }
@ -150,7 +142,7 @@ public class QuartzJobFactory implements Job {
* @return void * @return void
**/ **/
private void saveLivingAndDetail(IntegrationTaskLivingEntity integrationTaskLivingEntity, private void saveLivingAndDetail(IntegrationTaskLivingEntity integrationTaskLivingEntity,
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity, IntegrationTaskLogEntity integrationTaskLogEntity,
String livingtype,String detailtype, String msg,Date oldStartTime,Date startTime,Date endTime) { String livingtype,String detailtype, String msg,Date oldStartTime,Date startTime,Date endTime) {
Long interval = (endTime.getTime() - startTime.getTime()) / (1000); // 计算间隔天数 Long interval = (endTime.getTime() - startTime.getTime()) / (1000); // 计算间隔天数
integrationTaskLivingEntity.setTaskStatus(livingtype);//待执行 integrationTaskLivingEntity.setTaskStatus(livingtype);//待执行
@ -161,12 +153,12 @@ public class QuartzJobFactory implements Job {
integrationTaskLivingEntity.setRunNum(integrationTaskLivingEntity.getRunNum()+1); integrationTaskLivingEntity.setRunNum(integrationTaskLivingEntity.getRunNum()+1);
integrationTaskLivingEntity.setModify_time(new Date()); integrationTaskLivingEntity.setModify_time(new Date());
iIntegrationTaskCacheableService.updateIntegrationTaskLivingEntity(integrationTaskLivingEntity); iIntegrationTaskCacheableService.updateIntegrationTaskLivingEntity(integrationTaskLivingEntity);
if(integrationTaskLivingDetailsEntity != null ){ if(integrationTaskLogEntity != null ){
integrationTaskLivingDetailsEntity.setEndTime(endTime); integrationTaskLogEntity.setEndTime(endTime);
integrationTaskLivingDetailsEntity.setDiffTime(interval.toString()); integrationTaskLogEntity.setDiffTime(interval.toString());
integrationTaskLivingDetailsEntity.setTaskStatus(detailtype);//执行成功 integrationTaskLogEntity.setTaskStatus(detailtype);//执行成功
integrationTaskLivingDetailsEntity.setRemark(msg); integrationTaskLogEntity.setRemark(msg);
integrationTaskLivingDetailsDao.update(integrationTaskLivingDetailsEntity); integrationTaskLogDao.update(integrationTaskLogEntity);
} }
} }
} }