重写任务方法,修改统一接口,修改项目启动,任务初始化方法
This commit is contained in:
parent
52bc8c26ae
commit
b7c9ddd1b7
|
@ -2,6 +2,8 @@ package com.hzya.frame.plugin.sysMessageManageLogBack.plugin;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -38,20 +40,20 @@ public class SysMessageManageLogPluginInitializer extends PluginBaseEntity {
|
|||
public String getPluginLabel() {
|
||||
return "ESB消息日志备份";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String executeBusiness(JSONObject requestJson) throws Exception {
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
try {
|
||||
return "备份成功";
|
||||
logger.info("执行成功");
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.hzya.frame.base;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* @Content插件基类接口
|
||||
|
@ -70,5 +72,6 @@ public interface SystemPluginInitializer {
|
|||
* @param requestJson 执行业务代码的参数
|
||||
* @return void
|
||||
**/
|
||||
String executeBusiness(JSONObject requestJson) throws Exception;
|
||||
@DSTransactional()
|
||||
JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception;
|
||||
}
|
||||
|
|
|
@ -20,14 +20,11 @@ import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
|
|||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.service.IBipV32207Service;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import com.hzya.frame.seeyon.service.impl.SeeYonInterFaceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.util.PluginUtils;
|
||||
import com.hzya.frame.util.bipV3.Encryption;
|
||||
import com.hzya.frame.util.bipV3.SHA256Util;
|
||||
import com.hzya.frame.util.oldNcc.CompressUtil;
|
||||
import com.hzya.frame.util.oldNcc.Decryption;
|
||||
import com.hzya.frame.util.oldNcc.ResultMessageUtil;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -39,7 +36,6 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service(value = "bipV32207Service")
|
||||
|
@ -368,7 +364,7 @@ public class BipV32207ServiceImpl extends BaseService<BipSupplierEntity, String>
|
|||
public JsonResultEntity thirdInterfaceSendOa(JSONObject jsonObject) throws Exception {
|
||||
JSONObject jsonObjectStr = getstrObj("jsonStr", jsonObject);
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jsonObjectStr.getString("plug_id"));
|
||||
String s = pluginBaseEntity.executeBusiness(jsonObjectStr);
|
||||
JsonResultEntity s = pluginBaseEntity.executeBusiness(jsonObjectStr);
|
||||
return BaseResult.getSuccessMessageEntity("传递成功");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.classification.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity;
|
||||
|
||||
/**
|
||||
* @description: 任务分类 dao
|
||||
* @tableName: integration_task_classification
|
||||
* @entityName: IntegrationTaskClassificationEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskClassificationDao extends IBaseDao<IntegrationTaskClassificationEntity, String> {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.classification.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.classification.dao.IIntegrationTaskClassificationDao;
|
||||
import com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* @description: 任务分类 dao
|
||||
* @tableName: integration_task_classification
|
||||
* @entityName: IntegrationTaskClassificationEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_classificationdao")
|
||||
public class IntegrationTaskClassificationDaoImpl extends MybatisGenericDao<IntegrationTaskClassificationEntity, String> implements IIntegrationTaskClassificationDao {
|
||||
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.classification.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 任务分类 entity
|
||||
* @tableName: integration_task_classification
|
||||
* @entityName: IntegrationTaskClassificationEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskClassificationEntity extends BaseEntity {
|
||||
|
||||
/** 分类编码 */
|
||||
private String class_code;
|
||||
/** 分类名称 */
|
||||
private String class_name;
|
||||
/** 上级分类 */
|
||||
private String class_superiors;
|
||||
/** 排序 */
|
||||
private Long sorts;
|
||||
/** 组织机构ID */
|
||||
private String org_id;
|
||||
/** 等级 */
|
||||
private String lvl;
|
||||
/** 下级结构 */
|
||||
private List<IntegrationTaskClassificationEntity> childClassifications;
|
||||
|
||||
public List<IntegrationTaskClassificationEntity> getChildClassifications() {
|
||||
return childClassifications;
|
||||
}
|
||||
|
||||
public void setChildClassifications(List<IntegrationTaskClassificationEntity> childClassifications) {
|
||||
this.childClassifications = childClassifications;
|
||||
}
|
||||
|
||||
public String getLvl() {
|
||||
return lvl;
|
||||
}
|
||||
|
||||
public void setLvl(String lvl) {
|
||||
this.lvl = lvl;
|
||||
}
|
||||
|
||||
/** 分类编码 */
|
||||
public void setClass_code(String class_code) {
|
||||
this.class_code = class_code;
|
||||
}
|
||||
/** 分类编码 */
|
||||
public String getClass_code() {
|
||||
return class_code;
|
||||
}
|
||||
|
||||
|
||||
/** 分类名称 */
|
||||
public void setClass_name(String class_name) {
|
||||
this.class_name = class_name;
|
||||
}
|
||||
/** 分类名称 */
|
||||
public String getClass_name() {
|
||||
return class_name;
|
||||
}
|
||||
|
||||
|
||||
/** 上级分类 */
|
||||
public void setClass_superiors(String class_superiors) {
|
||||
this.class_superiors = class_superiors;
|
||||
}
|
||||
/** 上级分类 */
|
||||
public String getClass_superiors() {
|
||||
return class_superiors;
|
||||
}
|
||||
|
||||
|
||||
/** 排序 */
|
||||
public void setSorts(Long sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
/** 排序 */
|
||||
public Long getSorts() {
|
||||
return sorts;
|
||||
}
|
||||
|
||||
|
||||
/** 组织机构ID */
|
||||
public void setOrg_id(String org_id) {
|
||||
this.org_id = org_id;
|
||||
}
|
||||
/** 组织机构ID */
|
||||
public String getOrg_id() {
|
||||
return org_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,235 +0,0 @@
|
|||
<?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.sys.integrationtask.classification.dao.impl.IntegrationTaskClassificationDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskClassificationEntity-result" type="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
<!--主键ID -->
|
||||
<result property="id" column="id" />
|
||||
<!--分类编码 -->
|
||||
<result property="class_code" column="class_code" />
|
||||
<!--分类名称 -->
|
||||
<result property="class_name" column="class_name" />
|
||||
<!--上级分类 -->
|
||||
<result property="class_superiors" column="class_superiors" />
|
||||
<!--排序 -->
|
||||
<result property="sorts" column="sorts" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!--组织机构ID -->
|
||||
<result property="org_id" column="org_id" />
|
||||
<!--等级 -->
|
||||
<result property="lvl" column="lvl" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskClassificationEntity_Base_Column_List">
|
||||
id,
|
||||
class_code,
|
||||
class_name,
|
||||
class_superiors,
|
||||
sorts,
|
||||
create_user_id,
|
||||
create_time,
|
||||
modify_user_id,
|
||||
modify_time,
|
||||
sts,
|
||||
org_id,
|
||||
lvl
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="IntegrationTaskClassificationEntity_get" resultMap="get-IntegrationTaskClassificationEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskClassificationEntity_Base_Column_List" />
|
||||
from integration_task_classification where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskClassificationEntity-result" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskClassificationEntity_Base_Column_List" />
|
||||
from integration_task_classification
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">id = #{id} </if>
|
||||
<if test="class_code != null and class_code !='' "> and class_code = #{class_code}</if>
|
||||
<if test="class_name != null and class_name !='' "> and class_name = #{class_name}</if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> and class_superiors = #{class_superiors}</if>
|
||||
<if test="sorts != null "> and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id !='' "> and org_id = #{org_id}</if>
|
||||
<if test="lvl != null and lvl !='' "> and lvl = #{lvl}</if>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
select count(1) from integration_task_classification
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">id = #{id} </if>
|
||||
<if test="class_code != null and class_code !='' "> and class_code = #{class_code} </if>
|
||||
<if test="class_name != null and class_name !='' "> and class_name = #{class_name} </if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> and class_superiors = #{class_superiors} </if>
|
||||
<if test="sorts != null "> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id !='' "> and org_id = #{org_id} </if>
|
||||
<if test="lvl != null and lvl !='' "> and lvl = #{lvl}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskClassificationEntity-result" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskClassificationEntity_Base_Column_List" />
|
||||
from integration_task_classification
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' "> id like concat('%',#{id},'%') </if>
|
||||
<if test="class_code != null and class_code !='' "> and class_code like concat('%',#{class_code},'%') </if>
|
||||
<if test="class_name != null and class_name !='' "> and class_name like concat('%',#{class_name},'%') </if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> and class_superiors like concat('%',#{class_superiors},'%') </if>
|
||||
<if test="sorts != null "> and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id !='' "> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="lvl != null and lvl !='' "> and lvl like concat('%',#{lvl},'%')</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskClassificationEntity-result" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskClassificationEntity_Base_Column_List" />
|
||||
from integration_task_classification
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null and id !='' ">id = #{id} </if>
|
||||
<if test="class_code != null and class_code !='' "> or class_code = #{class_code} </if>
|
||||
<if test="class_name != null and class_name !='' "> or class_name = #{class_name} </if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> or class_superiors = #{class_superiors} </if>
|
||||
<if test="sorts != null "> or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id !='' "> or org_id = #{org_id} </if>
|
||||
<if test="lvl != null and lvl !='' "> or lvl = #{lvl}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
insert into integration_task_classification(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' "> id, </if>
|
||||
<if test="class_code != null and class_code !='' "> class_code, </if>
|
||||
<if test="class_name != null and class_name !='' "> class_name, </if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> class_superiors, </if>
|
||||
<if test="sorts != null ">sorts,</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="org_id != null and org_id !='' "> org_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="lvl != null and lvl !='' ">lvl,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' "> #{id}, </if>
|
||||
<if test="class_code != null and class_code !='' "> #{class_code}, </if>
|
||||
<if test="class_name != null and class_name !='' "> #{class_name}, </if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> #{class_superiors}, </if>
|
||||
<if test="sorts != null ">#{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="org_id != null and org_id !='' "> #{org_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_classification a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="lvl != null and lvl !='' ">#{lvl},</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now() ,</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="IntegrationTaskClassificationEntity_update" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
update integration_task_classification set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' "> id = #{id},</if>
|
||||
<if test="class_code != null and class_code !='' "> class_code = #{class_code},</if>
|
||||
<if test="class_name != null and class_name !='' "> class_name = #{class_name},</if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> class_superiors = #{class_superiors},</if>
|
||||
<if test="lvl != null and lvl !='' ">lvl = #{lvl},</if>
|
||||
<if test="sorts != null ">sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="org_id != null and org_id !='' "> org_id = #{org_id},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="IntegrationTaskClassificationEntity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
update integration_task_classification set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="IntegrationTaskClassificationEntity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
update integration_task_classification set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">id = #{id} </if>
|
||||
<if test="class_code != null and class_code !='' "> and class_code = #{class_code}</if>
|
||||
<if test="class_name != null and class_name !='' "> and class_name = #{class_name}</if>
|
||||
<if test="class_superiors != null and class_superiors !='' "> and class_superiors = #{class_superiors}</if>
|
||||
<if test="lvl != null and lvl !='' "> and lvl = #{lvl}</if>
|
||||
<if test="sorts != null "> and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id !='' "> and org_id = #{org_id}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity">
|
||||
delete from integration_task_classification where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,28 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.classification.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* @description: 任务分类 service
|
||||
* @tableName: integration_task_classification
|
||||
* @entityName: IntegrationTaskClassificationEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskClassificationService extends IBaseService<IntegrationTaskClassificationEntity, String> {
|
||||
|
||||
//新增任务分类
|
||||
JsonResultEntity saveTaskClassification(JSONObject jsonObject);
|
||||
|
||||
//修改任务分类
|
||||
JsonResultEntity updateTaskClassification(JSONObject jsonObject);
|
||||
|
||||
//删除任务分类
|
||||
JsonResultEntity updateTaskClassificationSts(JSONObject jsonObject);
|
||||
|
||||
//查询任务分类
|
||||
JsonResultEntity queryTaskClassification(JSONObject jsonObject);
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.classification.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.integrationtask.classification.dao.IIntegrationTaskClassificationDao;
|
||||
import com.hzya.frame.sys.integrationtask.classification.entity.IntegrationTaskClassificationEntity;
|
||||
import com.hzya.frame.sys.integrationtask.classification.service.IIntegrationTaskClassificationService;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 任务分类 service
|
||||
* @tableName: integration_task_classification
|
||||
* @entityName: IntegrationTaskClassificationEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integrationTaskClassificationService")
|
||||
public class IntegrationTaskClassificationServiceImpl extends BaseService<IntegrationTaskClassificationEntity, String> implements IIntegrationTaskClassificationService {
|
||||
|
||||
protected IIntegrationTaskClassificationDao integrationtaskclassificationDao;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskClassificationDao(IIntegrationTaskClassificationDao dao) {
|
||||
this.integrationtaskclassificationDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务分类
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity saveTaskClassification(JSONObject jsonObject) {
|
||||
IntegrationTaskClassificationEntity integrationTaskClassificationEntity = getData("jsonStr", jsonObject, IntegrationTaskClassificationEntity.class);
|
||||
//分类id
|
||||
long uuid = UUIDLong.longUUID();
|
||||
integrationTaskClassificationEntity.setId(String.valueOf(uuid));
|
||||
if(null==integrationTaskClassificationEntity.getClass_name()||"".equals(integrationTaskClassificationEntity.getClass_name())){
|
||||
return BaseResult.getFailureMessageEntity("任务分类名称不能为空");
|
||||
}
|
||||
if(null==integrationTaskClassificationEntity.getClass_code()||"".equals(integrationTaskClassificationEntity.getClass_code())){
|
||||
return BaseResult.getFailureMessageEntity("任务分类编码不能为空");
|
||||
}
|
||||
if(integrationtaskclassificationDao.getCount(integrationTaskClassificationEntity)>0){
|
||||
return BaseResult.getFailureMessageEntity("任务分类编码已经存在");
|
||||
}
|
||||
IntegrationTaskClassificationEntity taskClassificationEntity = integrationtaskclassificationDao.save(integrationTaskClassificationEntity);
|
||||
return BaseResult.getSuccessMessageEntity("任务分类保存成功",taskClassificationEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务分类
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateTaskClassification(JSONObject jsonObject) {
|
||||
IntegrationTaskClassificationEntity integrationTaskClassificationEntity = getData("jsonStr", jsonObject, IntegrationTaskClassificationEntity.class);
|
||||
if(null==integrationTaskClassificationEntity||"".equals(integrationTaskClassificationEntity)){
|
||||
return BaseResult.getFailureMessageEntity("需要修改的菜单树为空");
|
||||
}
|
||||
if(null==integrationTaskClassificationEntity.getClass_code()||"".equals(integrationTaskClassificationEntity.getClass_code())){
|
||||
return BaseResult.getFailureMessageEntity("修改时分类编码不能为空");
|
||||
}
|
||||
if(null==integrationTaskClassificationEntity.getClass_name()||"".equals(integrationTaskClassificationEntity.getClass_name())){
|
||||
return BaseResult.getFailureMessageEntity("修改时分类名称不能为空");
|
||||
}
|
||||
if(integrationtaskclassificationDao.getCount(integrationTaskClassificationEntity)>0){
|
||||
return BaseResult.getFailureMessageEntity("任务分类编码已经存在");
|
||||
}
|
||||
integrationtaskclassificationDao.update("IntegrationTaskClassificationEntity_update",integrationTaskClassificationEntity);
|
||||
return BaseResult.getSuccessMessageEntity("修改成功",integrationTaskClassificationEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务分类
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateTaskClassificationSts(JSONObject jsonObject) {
|
||||
IntegrationTaskClassificationEntity integrationTaskClassificationEntity = getData("jsonStr", jsonObject, IntegrationTaskClassificationEntity.class);
|
||||
if(null==integrationTaskClassificationEntity||"".equals(integrationTaskClassificationEntity)){
|
||||
return BaseResult.getFailureMessageEntity("需要删除的菜单树为空");
|
||||
}
|
||||
if(null==integrationTaskClassificationEntity.getId()||"".equals(integrationTaskClassificationEntity.getId())){
|
||||
return BaseResult.getFailureMessageEntity("需要删除的菜单树id为空");
|
||||
}
|
||||
IntegrationTaskClassificationEntity integrationTaskClassification=new IntegrationTaskClassificationEntity();
|
||||
integrationTaskClassification.setId(integrationTaskClassificationEntity.getId());
|
||||
integrationTaskClassification.setSts("Y");
|
||||
//根据id查询数据
|
||||
List<IntegrationTaskClassificationEntity> integrationTaskClassificationEntities = integrationtaskclassificationDao.query(integrationTaskClassification);
|
||||
//递归删除数据
|
||||
recursiveDeleteTaskClassification(integrationTaskClassificationEntities);
|
||||
return BaseResult.getSuccessMessageEntity("任务分类删除成功",integrationTaskClassificationEntity.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归删除任务分类
|
||||
* @param Classifications
|
||||
*/
|
||||
private void recursiveDeleteTaskClassification(List<IntegrationTaskClassificationEntity> Classifications){
|
||||
if(null!=Classifications && Classifications.size()>0){
|
||||
for (int i=0;i<Classifications.size();i++){
|
||||
IntegrationTaskClassificationEntity integrationTaskClassificationEntity=new IntegrationTaskClassificationEntity();
|
||||
integrationTaskClassificationEntity.setClass_superiors(Classifications.get(i).getId());
|
||||
integrationTaskClassificationEntity.setSts("Y");
|
||||
List<IntegrationTaskClassificationEntity> integrationTaskClassificationEntities = integrationtaskclassificationDao.query(integrationTaskClassificationEntity);
|
||||
if(null !=integrationTaskClassificationEntities && integrationTaskClassificationEntities.size()>0){
|
||||
recursiveDeleteTaskClassification(integrationTaskClassificationEntities);
|
||||
}
|
||||
//删除节点
|
||||
IntegrationTaskClassificationEntity integrationTaskClassification=new IntegrationTaskClassificationEntity();
|
||||
integrationTaskClassification.setId(Classifications.get(i).getId());
|
||||
integrationtaskclassificationDao.update("IntegrationTaskClassificationEntity_logicDelete",integrationTaskClassification);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务分类
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryTaskClassification(JSONObject jsonObject) {
|
||||
IntegrationTaskClassificationEntity integrationTaskClassificationEntity=new IntegrationTaskClassificationEntity();
|
||||
integrationTaskClassificationEntity.setSts("Y");
|
||||
integrationTaskClassificationEntity.setLvl("0");
|
||||
List<IntegrationTaskClassificationEntity> integrationTaskClassificationEntities = integrationtaskclassificationDao.query(integrationTaskClassificationEntity);
|
||||
recursiveQueryTaskClassification(integrationTaskClassificationEntities);
|
||||
return BaseResult.getSuccessMessageEntity("查询成功",integrationTaskClassificationEntities);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查询数据
|
||||
* @param Classifications
|
||||
*/
|
||||
private void recursiveQueryTaskClassification(List<IntegrationTaskClassificationEntity> Classifications){
|
||||
//判断是否有数据
|
||||
if(Classifications.size()>0 && Classifications !=null){
|
||||
for (int i=0;i<Classifications.size();i++){
|
||||
IntegrationTaskClassificationEntity integrationTaskClassificationEntity=new IntegrationTaskClassificationEntity();
|
||||
integrationTaskClassificationEntity.setClass_superiors(Classifications.get(i).getId());
|
||||
integrationTaskClassificationEntity.setSts("Y");
|
||||
List<IntegrationTaskClassificationEntity> integrationTaskClassificationEntities = integrationtaskclassificationDao.query(integrationTaskClassificationEntity);
|
||||
//判断查询出来的下级数据是否有数据
|
||||
if(integrationTaskClassificationEntities.size()>0 && integrationTaskClassificationEntities !=null){
|
||||
recursiveQueryTaskClassification(integrationTaskClassificationEntities);
|
||||
Classifications.get(i).setChildClassifications(integrationTaskClassificationEntities);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务 dao
|
||||
* @tableName: integration_task
|
||||
* @entityName: IntegrationTaskEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskDao extends IBaseDao<IntegrationTaskEntity, String> {
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务-任务详细策略 dao
|
||||
* @tableName: integration_task_details
|
||||
* @entityName: IntegrationTaskDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskDetailsDao extends IBaseDao<IntegrationTaskDetailsEntity, String> {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.dao.IIntegrationTaskDao;
|
||||
|
||||
/**
|
||||
* @description: 集成任务 dao
|
||||
* @tableName: integration_task
|
||||
* @entityName: IntegrationTaskEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_taskdao")
|
||||
public class IntegrationTaskDaoImpl extends MybatisGenericDao<IntegrationTaskEntity, String> implements IIntegrationTaskDao {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.dao.IIntegrationTaskDetailsDao;
|
||||
|
||||
/**
|
||||
* @description: 集成任务-任务详细策略 dao
|
||||
* @tableName: integration_task_details
|
||||
* @entityName: IntegrationTaskDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_detailsdao")
|
||||
public class IntegrationTaskDetailsDaoImpl extends MybatisGenericDao<IntegrationTaskDetailsEntity, String> implements IIntegrationTaskDetailsDao {
|
||||
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务-任务详细策略 entity
|
||||
* @tableName: integration_task_details
|
||||
* @entityName: IntegrationTaskDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskDetailsEntity extends BaseEntity {
|
||||
|
||||
/** integration_task_id */
|
||||
private String parent_id;
|
||||
/** 执行策略 */
|
||||
private String task_cron;
|
||||
/** N定时Y立即执行
|
||||
*/
|
||||
private String now_execution;
|
||||
|
||||
private Integer sorts;
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
/** integration_task_id */
|
||||
public void setParent_id(String parent_id) {
|
||||
this.parent_id = parent_id;
|
||||
}
|
||||
/** integration_task_id */
|
||||
public String getParent_id() {
|
||||
return parent_id;
|
||||
}
|
||||
|
||||
|
||||
/** 执行策略 */
|
||||
public void setTask_cron(String task_cron) {
|
||||
this.task_cron = task_cron;
|
||||
}
|
||||
/** 执行策略 */
|
||||
public String getTask_cron() {
|
||||
return task_cron;
|
||||
}
|
||||
|
||||
|
||||
/** N定时Y立即执行
|
||||
*/
|
||||
public void setNow_execution(String now_execution) {
|
||||
this.now_execution = now_execution;
|
||||
}
|
||||
/** N定时Y立即执行
|
||||
*/
|
||||
public String getNow_execution() {
|
||||
return now_execution;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,211 +0,0 @@
|
|||
<?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.sys.integrationtask.dao.impl.IntegrationTaskDetailsDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskDetailsEntity-result" type="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--integration_task_id -->
|
||||
<result property="parent_id" column="parent_id" />
|
||||
<!--执行策略 -->
|
||||
<result property="task_cron" column="task_cron" />
|
||||
<!--N定时Y立即执行
|
||||
-->
|
||||
<result property="now_execution" column="now_execution" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskDetailsEntity_Base_Column_List">
|
||||
id,
|
||||
parent_id,
|
||||
task_cron,
|
||||
now_execution,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
sorts
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskDetailsEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskDetailsEntity_Base_Column_List" />
|
||||
from integration_task_details where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskDetailsEntity-result" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskDetailsEntity_Base_Column_List" />
|
||||
from integration_task_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="parent_id != null and parent_id !='' "> and parent_id = #{parent_id}</if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron = #{task_cron}</if>
|
||||
<if test="now_execution != null and now_execution !='' "> and now_execution = #{now_execution}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
select count(1) from integration_task_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="parent_id != null "> and parent_id = #{parent_id} </if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron = #{task_cron} </if>
|
||||
<if test="now_execution != null and now_execution !='' "> and now_execution = #{now_execution} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskDetailsEntity-result" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskDetailsEntity_Base_Column_List" />
|
||||
from integration_task_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="parent_id != null "> and parent_id = #{parent_id}</if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron like concat('%',#{task_cron},'%') </if>
|
||||
<if test="now_execution != null and now_execution !='' "> and now_execution like concat('%',#{now_execution},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskDetailsEntity-result" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskDetailsEntity_Base_Column_List" />
|
||||
from integration_task_details
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="parent_id != null "> or parent_id = #{parent_id}</if>
|
||||
<if test="task_cron != null and task_cron !='' "> or task_cron = #{task_cron} </if>
|
||||
<if test="now_execution != null and now_execution !='' "> or now_execution = #{now_execution} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
insert into integration_task_details(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' ">id,</if>
|
||||
<if test="parent_id != null and parent_id !='' ">parent_id,</if>
|
||||
<if test="task_cron != null and task_cron !='' "> task_cron, </if>
|
||||
<if test="now_execution != null and now_execution !='' "> now_execution, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' ">#{id},</if>
|
||||
<if test="parent_id != null and parent_id !=''">#{parent_id},</if>
|
||||
<if test="task_cron != null and task_cron !='' "> #{task_cron}, </if>
|
||||
<if test="now_execution != null and now_execution !='' "> #{now_execution}, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_details a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now(),</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
update integration_task_details set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="parent_id != null ">parent_id = #{parent_id},</if>
|
||||
<if test="task_cron != null and task_cron !='' "> task_cron = #{task_cron},</if>
|
||||
<if test="now_execution != null and now_execution !='' "> now_execution = #{now_execution},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
update integration_task_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据任务id将sts修改为N -->
|
||||
<update id="IntegrationTaskDetailsEntity_updateSts" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
update integration_task_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
parent_id = #{parent_id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
update integration_task_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="parent_id != null "> and parent_id = #{parent_id}</if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron = #{task_cron}</if>
|
||||
<if test="now_execution != null and now_execution !='' "> and now_execution = #{now_execution}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity">
|
||||
delete from integration_task_details where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,204 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务 entity
|
||||
* @tableName: integration_task
|
||||
* @entityName: IntegrationTaskEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskEntity extends BaseEntity {
|
||||
|
||||
/** 任务编码 */
|
||||
private String task_code;
|
||||
/** 任务名称 */
|
||||
private String task_name;
|
||||
/** 任务分类 */
|
||||
private String task_classes;
|
||||
/** 任务策略 */
|
||||
private String task_cron;
|
||||
/** 任务标识 */
|
||||
private String task_tag;
|
||||
/** 功能介绍/任务描述 */
|
||||
private String fun_info;
|
||||
/** 场景id */
|
||||
private String sence_id;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
/** 任务状态 */
|
||||
private String task_status;
|
||||
/** 无备注 */
|
||||
private Integer user_id;
|
||||
/** 部署公司 */
|
||||
private String org_id;
|
||||
/** 服务名称 */
|
||||
private String server_name;
|
||||
|
||||
private Integer sorts;
|
||||
//任务ID集合
|
||||
private List<String> taskIdList;
|
||||
|
||||
/*是否插件*/
|
||||
private String plug;
|
||||
/*插件id*/
|
||||
private String plug_id;
|
||||
|
||||
public String getPlug() {
|
||||
return plug;
|
||||
}
|
||||
|
||||
public void setPlug(String plug) {
|
||||
this.plug = plug;
|
||||
}
|
||||
|
||||
public String getPlug_id() {
|
||||
return plug_id;
|
||||
}
|
||||
|
||||
public void setPlug_id(String plug_id) {
|
||||
this.plug_id = plug_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
/** 任务编码 */
|
||||
public void setTask_code(String task_code) {
|
||||
this.task_code = task_code;
|
||||
}
|
||||
/** 任务编码 */
|
||||
public String getTask_code() {
|
||||
return task_code;
|
||||
}
|
||||
|
||||
|
||||
/** 任务名称 */
|
||||
public void setTask_name(String task_name) {
|
||||
this.task_name = task_name;
|
||||
}
|
||||
/** 任务名称 */
|
||||
public String getTask_name() {
|
||||
return task_name;
|
||||
}
|
||||
|
||||
|
||||
/** 任务分类 */
|
||||
public void setTask_classes(String task_classes) {
|
||||
this.task_classes = task_classes;
|
||||
}
|
||||
/** 任务分类 */
|
||||
public String getTask_classes() {
|
||||
return task_classes;
|
||||
}
|
||||
|
||||
|
||||
/** 任务策略 */
|
||||
public void setTask_cron(String task_cron) {
|
||||
this.task_cron = task_cron;
|
||||
}
|
||||
/** 任务策略 */
|
||||
public String getTask_cron() {
|
||||
return task_cron;
|
||||
}
|
||||
|
||||
|
||||
/** 任务标识 */
|
||||
public void setTask_tag(String task_tag) {
|
||||
this.task_tag = task_tag;
|
||||
}
|
||||
/** 任务标识 */
|
||||
public String getTask_tag() {
|
||||
return task_tag;
|
||||
}
|
||||
|
||||
|
||||
/** 功能介绍/任务描述 */
|
||||
public void setFun_info(String fun_info) {
|
||||
this.fun_info = fun_info;
|
||||
}
|
||||
/** 功能介绍/任务描述 */
|
||||
public String getFun_info() {
|
||||
return fun_info;
|
||||
}
|
||||
|
||||
|
||||
/** 场景id */
|
||||
public void setSence_id(String sence_id) {
|
||||
this.sence_id = sence_id;
|
||||
}
|
||||
/** 场景id */
|
||||
public String getSence_id() {
|
||||
return sence_id;
|
||||
}
|
||||
|
||||
|
||||
/** 备注 */
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
/** 备注 */
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
|
||||
/** 任务状态 */
|
||||
public void setTask_status(String task_status) {
|
||||
this.task_status = task_status;
|
||||
}
|
||||
/** 任务状态 */
|
||||
public String getTask_status() {
|
||||
return task_status;
|
||||
}
|
||||
|
||||
|
||||
/** 无备注 */
|
||||
public void setUser_id(Integer user_id) {
|
||||
this.user_id = user_id;
|
||||
}
|
||||
/** 无备注 */
|
||||
public Integer getUser_id() {
|
||||
return user_id;
|
||||
}
|
||||
|
||||
|
||||
/** 部署公司 */
|
||||
@Override
|
||||
public void setOrg_id(String org_id) {
|
||||
this.org_id = org_id;
|
||||
}
|
||||
/** 部署公司 */
|
||||
@Override
|
||||
public String getOrg_id() {
|
||||
return org_id;
|
||||
}
|
||||
|
||||
|
||||
/** 服务名称 */
|
||||
public void setServer_name(String server_name) {
|
||||
this.server_name = server_name;
|
||||
}
|
||||
/** 服务名称 */
|
||||
public String getServer_name() {
|
||||
return server_name;
|
||||
}
|
||||
|
||||
public List<String> getTaskIdList() {
|
||||
return taskIdList;
|
||||
}
|
||||
|
||||
public void setTaskIdList(List<String> taskIdList) {
|
||||
this.taskIdList = taskIdList;
|
||||
}
|
||||
}
|
|
@ -1,349 +0,0 @@
|
|||
<?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.sys.integrationtask.dao.impl.IntegrationTaskDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskEntity-result" type="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
<!--id -->
|
||||
<result property="id" column="id" />
|
||||
<!--任务编码 -->
|
||||
<result property="task_code" column="task_code" />
|
||||
<!--任务名称 -->
|
||||
<result property="task_name" column="task_name" />
|
||||
<!--任务分类 -->
|
||||
<result property="task_classes" column="task_classes" />
|
||||
<!--任务策略 -->
|
||||
<result property="task_cron" column="task_cron" />
|
||||
<!--任务标识 -->
|
||||
<result property="task_tag" column="task_tag" />
|
||||
<!--功能介绍/任务描述 -->
|
||||
<result property="fun_info" column="fun_info" />
|
||||
<!--场景id -->
|
||||
<result property="sence_id" column="sence_id" />
|
||||
<!--备注 -->
|
||||
<result property="remark" column="remark" />
|
||||
<!--任务状态 -->
|
||||
<result property="task_status" column="task_status" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!--无备注 -->
|
||||
<result property="user_id" column="user_id" />
|
||||
<!--部署公司 -->
|
||||
<result property="org_id" column="org_id" />
|
||||
<!--服务名称 -->
|
||||
<result property="server_name" column="server_name" />
|
||||
<!--是否插件 -->
|
||||
<result property="plug" column="plug" />
|
||||
<!--插件id -->
|
||||
<result property="plug_id" column="plug_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskEntity_Base_Column_List">
|
||||
id,
|
||||
task_code,
|
||||
task_name,
|
||||
task_classes,
|
||||
task_cron,
|
||||
task_tag,
|
||||
fun_info,
|
||||
sence_id,
|
||||
remark,
|
||||
task_status,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
user_id,
|
||||
org_id,
|
||||
server_name,
|
||||
sorts,
|
||||
plug,
|
||||
plug_id
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!--查询最大编码+1-->
|
||||
<select id="IntegrationTaskEntity_maxCode" resultMap="get-IntegrationTaskEntity-result">
|
||||
select
|
||||
case when
|
||||
length(ifnull(max(right(task_code,4)), 0)+1)=2 then
|
||||
concat(concat(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-','00'),ifnull(max(right(task_code,4)), 0)+1)
|
||||
when
|
||||
length(ifnull(max(right(task_code,4)), 0)+1)=1 then
|
||||
concat(concat(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-','000'),ifnull(max(right(task_code,4)), 0)+1)
|
||||
when
|
||||
length(ifnull(max(right(task_code,4)), 0)+1)=3 then
|
||||
concat(concat(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-','0'),ifnull(max(right(task_code,4)), 0)+1)
|
||||
else
|
||||
concat(replace(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-',ifnull(max(right(task_code,4)), 0)+1)) end as task_code
|
||||
from integration_task where sts='Y' and task_code like concat('%',substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,10),'%')
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskEntity-result" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_code != null and task_code !='' "> and task_code = #{task_code}</if>
|
||||
<if test="task_name != null and task_name !='' "> and task_name = #{task_name}</if>
|
||||
<if test="task_classes != null and task_classes !='' "> and task_classes = #{task_classes}</if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron = #{task_cron}</if>
|
||||
<if test="task_tag != null and task_tag !='' "> and task_tag = #{task_tag}</if>
|
||||
<if test="fun_info != null and fun_info !='' "> and fun_info = #{fun_info}</if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id = #{sence_id}</if>
|
||||
<if test="remark != null and remark !='' "> and remark = #{remark}</if>
|
||||
<if test="task_status != null and task_status !='' "> and task_status = #{task_status}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="user_id != null "> and user_id = #{user_id}</if>
|
||||
<if test="org_id != null "> and org_id = #{org_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="plug != null and plug !='' "> and plug = #{plug}</if>
|
||||
<if test="plug_id != null and plug_id !='' "> and plug_id = #{plug_id}</if>
|
||||
<if test="taskIdList != null and taskIdList.size >0">
|
||||
and
|
||||
<foreach collection="taskIdList" open="(" close=")" separator="or" item="item">
|
||||
id = #{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
select count(1) from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_code != null and task_code !='' "> and task_code = #{task_code} </if>
|
||||
<if test="task_name != null and task_name !='' "> and task_name = #{task_name} </if>
|
||||
<if test="task_classes != null and task_classes !='' "> and task_classes = #{task_classes} </if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron = #{task_cron} </if>
|
||||
<if test="task_tag != null and task_tag !='' "> and task_tag = #{task_tag} </if>
|
||||
<if test="fun_info != null and fun_info !='' "> and fun_info = #{fun_info} </if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id = #{sence_id} </if>
|
||||
<if test="remark != null and remark !='' "> and remark = #{remark} </if>
|
||||
<if test="task_status != null and task_status !='' "> and task_status = #{task_status} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
<if test="user_id != null "> and user_id = #{user_id} </if>
|
||||
<if test="org_id != null "> and org_id = #{org_id} </if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name} </if>
|
||||
<if test="plug != null and plug !='' "> and plug = #{plug} </if>
|
||||
<if test="plug_id != null and plug_id !='' "> and plug_id = #{plug_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskEntity-result" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_code != null and task_code !='' "> and task_code like concat('%',#{task_code},'%') </if>
|
||||
<if test="task_name != null and task_name !='' "> and task_name like concat('%',#{task_name},'%') </if>
|
||||
<if test="task_classes != null and task_classes !='' "> and task_classes like concat('%',#{task_classes},'%') </if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron like concat('%',#{task_cron},'%') </if>
|
||||
<if test="task_tag != null and task_tag !='' "> and task_tag like concat('%',#{task_tag},'%') </if>
|
||||
<if test="fun_info != null and fun_info !='' "> and fun_info like concat('%',#{fun_info},'%') </if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id like concat('%',#{sence_id},'%') </if>
|
||||
<if test="remark != null and remark !='' "> and remark like concat('%',#{remark},'%') </if>
|
||||
<if test="task_status != null and task_status !='' "> and task_status like concat('%',#{task_status},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="user_id != null "> and user_id = #{user_id}</if>
|
||||
<if test="org_id != null "> and org_id = #{org_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name like concat('%',#{server_name},'%') </if>
|
||||
<if test="plug != null and plug !='' "> and plug like concat('%',#{plug},'%') </if>
|
||||
<if test="plug_id != null and plug_id !='' "> and plug_id like concat('%',#{plug_id},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskEntity-result" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_code != null and task_code !='' "> or task_code = #{task_code} </if>
|
||||
<if test="task_name != null and task_name !='' "> or task_name = #{task_name} </if>
|
||||
<if test="task_classes != null and task_classes !='' "> or task_classes = #{task_classes} </if>
|
||||
<if test="task_cron != null and task_cron !='' "> or task_cron = #{task_cron} </if>
|
||||
<if test="task_tag != null and task_tag !='' "> or task_tag = #{task_tag} </if>
|
||||
<if test="fun_info != null and fun_info !='' "> or fun_info = #{fun_info} </if>
|
||||
<if test="sence_id != null and sence_id !='' "> or sence_id = #{sence_id} </if>
|
||||
<if test="remark != null and remark !='' "> or remark = #{remark} </if>
|
||||
<if test="task_status != null and task_status !='' "> or task_status = #{task_status} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
<if test="user_id != null "> or user_id = #{user_id}</if>
|
||||
<if test="org_id != null "> or org_id = #{org_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> or server_name = #{server_name} </if>
|
||||
<if test="plug != null and plug !='' "> or plug = #{plug} </if>
|
||||
<if test="plug_id != null and plug_id !='' "> or plug_id = #{plug_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
insert into integration_task(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' "> id, </if>
|
||||
<if test="task_code != null and task_code !='' "> task_code, </if>
|
||||
<if test="task_name != null and task_name !='' "> task_name, </if>
|
||||
<if test="task_classes != null and task_classes !='' "> task_classes, </if>
|
||||
<if test="task_cron != null and task_cron !='' "> task_cron, </if>
|
||||
<if test="task_tag != null and task_tag !='' "> task_tag, </if>
|
||||
<if test="fun_info != null and fun_info !='' "> fun_info, </if>
|
||||
<if test="sence_id != null and sence_id !='' "> sence_id, </if>
|
||||
<if test="remark != null and remark !='' "> remark, </if>
|
||||
<if test="task_status != null and task_status !='' "> task_status, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="user_id != null ">user_id,</if>
|
||||
<if test="org_id != null ">org_id,</if>
|
||||
<if test="server_name != null and server_name !='' "> server_name, </if>
|
||||
<if test="plug != null and plug !='' "> plug, </if>
|
||||
<if test="plug_id != null and plug_id !='' "> plug_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' "> #{id}, </if>
|
||||
<if test="task_code != null and task_code !='' "> #{task_code}, </if>
|
||||
<if test="task_name != null and task_name !='' "> #{task_name}, </if>
|
||||
<if test="task_classes != null and task_classes !='' "> #{task_classes}, </if>
|
||||
<if test="task_cron != null and task_cron !='' "> #{task_cron}, </if>
|
||||
<if test="task_tag != null and task_tag !='' "> #{task_tag}, </if>
|
||||
<if test="fun_info != null and fun_info !='' "> #{fun_info}, </if>
|
||||
<if test="sence_id != null and sence_id !='' "> #{sence_id}, </if>
|
||||
<if test="remark != null and remark !='' "> #{remark}, </if>
|
||||
<if test="task_status != null and task_status !='' "> #{task_status}, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="user_id != null ">#{user_id},</if>
|
||||
<if test="org_id != null ">#{org_id},</if>
|
||||
<if test="server_name != null and server_name !='' "> #{server_name}, </if>
|
||||
<if test="plug != null and plug !='' "> #{plug}, </if>
|
||||
<if test="plug_id != null and plug_id !='' "> #{plug_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now() ,</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
update integration_task set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="task_code != null and task_code !='' "> task_code = #{task_code},</if>
|
||||
<if test="task_name != null and task_name !='' "> task_name = #{task_name},</if>
|
||||
<if test="task_classes != null and task_classes !='' "> task_classes = #{task_classes},</if>
|
||||
<if test="task_cron != null and task_cron !='' "> task_cron = #{task_cron},</if>
|
||||
<if test="task_tag != null and task_tag !='' "> task_tag = #{task_tag},</if>
|
||||
<if test="fun_info != null and fun_info !='' "> fun_info = #{fun_info},</if>
|
||||
<if test="sence_id != null and sence_id !='' "> sence_id = #{sence_id},</if>
|
||||
<if test="remark != null and remark !='' "> remark = #{remark},</if>
|
||||
<if test="task_status != null and task_status !='' "> task_status = #{task_status},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="user_id != null ">user_id = #{user_id},</if>
|
||||
<if test="org_id != null ">org_id = #{org_id},</if>
|
||||
<if test="server_name != null and server_name !='' "> server_name = #{server_name},</if>
|
||||
<if test="plug != null and plug !='' "> plug = #{plug},</if>
|
||||
<if test="plug_id != null and plug_id !='' "> plug_id = #{plug_id},</if>
|
||||
<if test="plug_id =='' "> plug_id = null,</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="IntegrationTaskEntity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
update integration_task set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
update integration_task set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_code != null and task_code !='' "> and task_code = #{task_code}</if>
|
||||
<if test="task_name != null and task_name !='' "> and task_name = #{task_name}</if>
|
||||
<if test="task_classes != null and task_classes !='' "> and task_classes = #{task_classes}</if>
|
||||
<if test="task_cron != null and task_cron !='' "> and task_cron = #{task_cron}</if>
|
||||
<if test="task_tag != null and task_tag !='' "> and task_tag = #{task_tag}</if>
|
||||
<if test="fun_info != null and fun_info !='' "> and fun_info = #{fun_info}</if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id = #{sence_id}</if>
|
||||
<if test="remark != null and remark !='' "> and remark = #{remark}</if>
|
||||
<if test="task_status != null and task_status !='' "> and task_status = #{task_status}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="user_id != null "> and user_id = #{user_id}</if>
|
||||
<if test="org_id != null "> and org_id = #{org_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="plug != null and plug !='' "> and plug = #{plug}</if>
|
||||
<if test="plug_id != null and plug_id !='' "> and plug_id = #{plug_id}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity">
|
||||
delete from integration_task where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例 dao
|
||||
* @tableName: integration_task_living
|
||||
* @entityName: IntegrationTaskLivingEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLivingDao extends IBaseDao<IntegrationTaskLivingEntity, String> {
|
||||
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例详情 dao
|
||||
* @tableName: integration_task_living_details
|
||||
* @entityName: IntegrationTaskLivingDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLivingDetailsDao extends IBaseDao<IntegrationTaskLivingDetailsEntity, String> {
|
||||
|
||||
List<IntegrationTaskLivingDetailsVo> queryPageLeftTask(IntegrationTaskLivingDetailsVo entity);
|
||||
|
||||
Integer entity_updatebyid(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity);
|
||||
|
||||
List<IntegrationTaskLivingDetailsEntity> queryFastIntegrationTaskLivingDetails(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity);
|
||||
|
||||
// List queryErrorDetailsId(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) throws Exception;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.living.dao.IIntegrationTaskLivingDao;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例 dao
|
||||
* @tableName: integration_task_living
|
||||
* @entityName: IntegrationTaskLivingEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_livingdao")
|
||||
public class IntegrationTaskLivingDaoImpl extends MybatisGenericDao<IntegrationTaskLivingEntity, String> implements IIntegrationTaskLivingDao {
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.living.dao.IIntegrationTaskLivingDetailsDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例详情 dao
|
||||
* @tableName: integration_task_living_details
|
||||
* @entityName: IntegrationTaskLivingDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_living_detailsdao")
|
||||
public class IntegrationTaskLivingDetailsDaoImpl extends MybatisGenericDao<IntegrationTaskLivingDetailsEntity, String> implements IIntegrationTaskLivingDetailsDao {
|
||||
|
||||
@Override
|
||||
public List<IntegrationTaskLivingDetailsVo> queryPageLeftTask(IntegrationTaskLivingDetailsVo entity) {
|
||||
List<IntegrationTaskLivingDetailsVo> o = (List<IntegrationTaskLivingDetailsVo>) super.selectList(getSqlIdPrifx() + "queryPageLeftTask", entity);
|
||||
return o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer entity_updatebyid(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
return super.update(getSqlIdPrifx() + "entity_updatebyid", integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IntegrationTaskLivingDetailsEntity> queryFastIntegrationTaskLivingDetails(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
return (List<IntegrationTaskLivingDetailsEntity>) super.selectList(getSqlIdPrifx() + "queryFastIntegrationTaskLivingDetails", integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,350 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例详情 entity
|
||||
* @tableName: integration_task_living_details
|
||||
* @entityName: IntegrationTaskLivingDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskLivingDetailsEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 集成任务-实例_id
|
||||
*/
|
||||
private String task_linving_id;
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
private String result;
|
||||
/**
|
||||
* 原始查询条件
|
||||
*/
|
||||
private String query_condition;
|
||||
/**
|
||||
* 源系统主键
|
||||
*/
|
||||
private String root_app_pk;
|
||||
|
||||
/**
|
||||
* 批量查询
|
||||
*/
|
||||
private String root_app_pk_s;
|
||||
|
||||
/**
|
||||
* 原系统单据
|
||||
*/
|
||||
private String root_app_bill;
|
||||
/**
|
||||
* 最新源系统数据详情(上游系统入参)
|
||||
*/
|
||||
private String root_app_new_data;
|
||||
/**
|
||||
* 最新传输信息(下游系统返回结果)
|
||||
*/
|
||||
private String new_transmit_info;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date new_push_date;
|
||||
/**
|
||||
* 是否补推(Y是N不是)
|
||||
*/
|
||||
private String repair_pust;
|
||||
|
||||
private Integer sorts;
|
||||
|
||||
//场景id
|
||||
private String sence_id;
|
||||
|
||||
// 插件id
|
||||
private String plugin_id;
|
||||
|
||||
/**
|
||||
* 推送状态
|
||||
*/
|
||||
private String new_state;
|
||||
|
||||
/**
|
||||
* 作为查询条件的推送状态
|
||||
*/
|
||||
private String param_new_state;
|
||||
|
||||
/**
|
||||
* 单据业务日期
|
||||
*/
|
||||
private String business_date;
|
||||
|
||||
/**
|
||||
* 下游系统主键
|
||||
*/
|
||||
private String new_system_primary;
|
||||
/**
|
||||
* 下游系统单号
|
||||
*/
|
||||
private String new_system_number;
|
||||
/**
|
||||
* 处理⼈
|
||||
*/
|
||||
private String processor;
|
||||
|
||||
/**
|
||||
* 处理⼈名称
|
||||
*/
|
||||
private String processor_name;
|
||||
|
||||
/**
|
||||
* 处理备注
|
||||
*/
|
||||
private String processing_remarks;
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date processing_time;
|
||||
|
||||
public String getParam_new_state() {
|
||||
return param_new_state;
|
||||
}
|
||||
|
||||
public void setParam_new_state(String param_new_state) {
|
||||
this.param_new_state = param_new_state;
|
||||
}
|
||||
|
||||
public String getBusiness_date() {
|
||||
return business_date;
|
||||
}
|
||||
|
||||
public void setBusiness_date(String business_date) {
|
||||
this.business_date = business_date;
|
||||
}
|
||||
|
||||
public String getNew_state() {
|
||||
return new_state;
|
||||
}
|
||||
|
||||
public void setNew_state(String new_state) {
|
||||
this.new_state = new_state;
|
||||
}
|
||||
|
||||
public String getSence_id() {
|
||||
return sence_id;
|
||||
}
|
||||
|
||||
public void setSence_id(String sence_id) {
|
||||
this.sence_id = sence_id;
|
||||
}
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 集成任务-实例_id
|
||||
*/
|
||||
public void setTask_linving_id(String task_linving_id) {
|
||||
this.task_linving_id = task_linving_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 集成任务-实例_id
|
||||
*/
|
||||
public String getTask_linving_id() {
|
||||
return task_linving_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 原始查询条件
|
||||
*/
|
||||
public void setQuery_condition(String query_condition) {
|
||||
this.query_condition = query_condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始查询条件
|
||||
*/
|
||||
public String getQuery_condition() {
|
||||
return query_condition;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 源系统主键
|
||||
*/
|
||||
public void setRoot_app_pk(String root_app_pk) {
|
||||
this.root_app_pk = root_app_pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* 源系统主键
|
||||
*/
|
||||
public String getRoot_app_pk() {
|
||||
return root_app_pk;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 原系统单据
|
||||
*/
|
||||
public void setRoot_app_bill(String root_app_bill) {
|
||||
this.root_app_bill = root_app_bill;
|
||||
}
|
||||
|
||||
/**
|
||||
* 原系统单据
|
||||
*/
|
||||
public String getRoot_app_bill() {
|
||||
return root_app_bill;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 最新源系统数据详情
|
||||
*/
|
||||
public void setRoot_app_new_data(String root_app_new_data) {
|
||||
this.root_app_new_data = root_app_new_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新源系统数据详情
|
||||
*/
|
||||
public String getRoot_app_new_data() {
|
||||
return root_app_new_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 最新传输信息
|
||||
*/
|
||||
public void setNew_transmit_info(String new_transmit_info) {
|
||||
this.new_transmit_info = new_transmit_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新传输信息
|
||||
*/
|
||||
public String getNew_transmit_info() {
|
||||
return new_transmit_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 最新推送时间
|
||||
*/
|
||||
public void setNew_push_date(Date new_push_date) {
|
||||
this.new_push_date = new_push_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新推送时间
|
||||
*/
|
||||
public Date getNew_push_date() {
|
||||
return new_push_date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否补推(Y是N不是)
|
||||
*/
|
||||
public void setRepair_pust(String repair_pust) {
|
||||
this.repair_pust = repair_pust;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否补推(Y是N不是)
|
||||
*/
|
||||
public String getRepair_pust() {
|
||||
return repair_pust;
|
||||
}
|
||||
|
||||
public String getPlugin_id() {
|
||||
return plugin_id;
|
||||
}
|
||||
|
||||
public void setPlugin_id(String plugin_id) {
|
||||
this.plugin_id = plugin_id;
|
||||
}
|
||||
|
||||
public String getRoot_app_pk_s() {
|
||||
return root_app_pk_s;
|
||||
}
|
||||
|
||||
public void setRoot_app_pk_s(String root_app_pk_s) {
|
||||
this.root_app_pk_s = root_app_pk_s;
|
||||
}
|
||||
|
||||
public String getNew_system_primary() {
|
||||
return new_system_primary;
|
||||
}
|
||||
|
||||
public void setNew_system_primary(String new_system_primary) {
|
||||
this.new_system_primary = new_system_primary;
|
||||
}
|
||||
|
||||
public String getNew_system_number() {
|
||||
return new_system_number;
|
||||
}
|
||||
|
||||
public void setNew_system_number(String new_system_number) {
|
||||
this.new_system_number = new_system_number;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public String getProcessor_name() {
|
||||
return processor_name;
|
||||
}
|
||||
|
||||
public void setProcessor_name(String processor_name) {
|
||||
this.processor_name = processor_name;
|
||||
}
|
||||
|
||||
public String getProcessing_remarks() {
|
||||
return processing_remarks;
|
||||
}
|
||||
|
||||
public void setProcessing_remarks(String processing_remarks) {
|
||||
this.processing_remarks = processing_remarks;
|
||||
}
|
||||
|
||||
public Date getProcessing_time() {
|
||||
return processing_time;
|
||||
}
|
||||
|
||||
public void setProcessing_time(Date processing_time) {
|
||||
this.processing_time = processing_time;
|
||||
}
|
||||
}
|
|
@ -1,559 +0,0 @@
|
|||
<?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.sys.integrationtask.living.dao.impl.IntegrationTaskLivingDetailsDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskLivingDetailsEntity-result" type="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--集成任务-实例_id -->
|
||||
<result property="task_linving_id" column="task_linving_id" />
|
||||
<!--返回结果 -->
|
||||
<result property="result" column="result" />
|
||||
<!--原始查询条件 -->
|
||||
<result property="query_condition" column="query_condition" />
|
||||
<!--源系统主键 -->
|
||||
<result property="root_app_pk" column="root_app_pk" />
|
||||
<!--原系统单据 -->
|
||||
<result property="root_app_bill" column="root_app_bill" />
|
||||
<!--最新源系统数据详情 -->
|
||||
<result property="root_app_new_data" column="root_app_new_data" />
|
||||
<!--最新传输信息 -->
|
||||
<result property="new_transmit_info" column="new_transmit_info" />
|
||||
<!--最新推送时间 -->
|
||||
<result property="new_push_date" column="new_push_date" />
|
||||
<!--是否补推(Y是N不是) -->
|
||||
<result property="repair_pust" column="repair_pust" />
|
||||
<!-- 场景id-->
|
||||
<result property="sence_id" column="sence_id"/>
|
||||
<!-- 插件id-->
|
||||
<result property="plugin_id" column="plugin_id"/>
|
||||
<!-- 推送状态-->
|
||||
<result property="new_state" column="new_state"/>
|
||||
<!-- 单据业务日期-->
|
||||
<result property="business_date" column="business_date"/>
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!-- 下游系统主键 -->
|
||||
<result property="new_system_primary" column="new_system_primary" />
|
||||
<!--下游系统单号 -->
|
||||
<result property="new_system_number" column="new_system_number" />
|
||||
<!--处理⼈ -->
|
||||
<result property="processor" column="processor" />
|
||||
<!--处理⼈名称 -->
|
||||
<result property="processor_name" column="processor_name" />
|
||||
<!-- 处理备注 -->
|
||||
<result property="processing_remarks" column="processing_remarks" />
|
||||
<!--处理时间 -->
|
||||
<result property="processing_time" column="processing_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskLivingDetailsEntity_Base_Column_List">
|
||||
id,
|
||||
task_linving_id,
|
||||
result,
|
||||
query_condition,
|
||||
root_app_pk,
|
||||
root_app_bill,
|
||||
root_app_new_data,
|
||||
new_transmit_info,
|
||||
new_push_date,
|
||||
repair_pust,
|
||||
sence_id,
|
||||
plugin_id,
|
||||
new_state,
|
||||
business_date,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
new_system_primary,
|
||||
new_system_number,
|
||||
processor,
|
||||
processor_name,
|
||||
processing_remarks,
|
||||
processing_time
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLivingDetailsEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List" />
|
||||
from integration_task_living_details where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!--筛选明细数据正常与删除 -->
|
||||
<select id="IntegrationTaskLivingDetailsEntity_list_sts" resultMap="get-IntegrationTaskLivingDetailsEntity-result">
|
||||
select
|
||||
ld.*
|
||||
from
|
||||
integration_task_living_details ld
|
||||
left join integration_task_living liv on liv.id=ld.task_linving_id
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="sts != null and sts !='' "> and ld.sts = #{sts}</if>
|
||||
and liv.id = #{task_linving_id}
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLivingDetailsEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List" />
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_linving_id != null and task_linving_id !='' "> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition = #{query_condition}</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk = #{root_app_pk}</if>
|
||||
<if test="root_app_pk_s != null and root_app_pk_s !='' "> and root_app_pk in (${root_app_pk_s})</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill = #{root_app_bill}</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data = #{root_app_new_data}</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info = #{new_transmit_info}</if>
|
||||
<if test="new_push_date != null "> and new_push_date = #{new_push_date}</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust = #{repair_pust}</if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id = #{sence_id}</if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> and plugin_id = #{plugin_id}</if>
|
||||
<if test="new_state != null and new_state !='' "> and new_state = #{new_state}</if>
|
||||
<if test="param_new_state != null and param_new_state !='' "> and new_state in (${param_new_state})</if>
|
||||
<if test="business_date != null and business_date !='' "> and business_date = #{business_date}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> and new_system_primary = #{new_system_primary}</if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> and new_system_number = #{new_system_number}</if>
|
||||
<if test="processor != null and processor !='' "> and processor = #{processor}</if>
|
||||
<if test="processor_name != null and processor_name !='' "> and processor_name = #{processor_name}</if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> and processing_remarks = #{processing_remarks}</if>
|
||||
<if test="processing_time != null "> and processing_time = #{processing_time}</if>
|
||||
|
||||
-- and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
select count(1) from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> and task_linving_id = #{task_linving_id} </if>
|
||||
<if test="result != null and result !='' "> and result = #{result} </if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition = #{query_condition} </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk = #{root_app_pk} </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill = #{root_app_bill} </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data = #{root_app_new_data} </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info = #{new_transmit_info} </if>
|
||||
<if test="new_push_date != null "> and new_push_date = #{new_push_date} </if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust = #{repair_pust} </if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id = #{sence_id} </if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> and plugin_id = #{plugin_id} </if>
|
||||
<if test="new_state != null and new_state !='' "> and new_state = #{new_state} </if>
|
||||
<if test="business_date != null and business_date !='' "> and business_date = #{business_date} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> and new_system_primary = #{new_system_primary}</if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> and new_system_number = #{new_system_number}</if>
|
||||
<if test="processor != null and processor !='' "> and processor = #{processor}</if>
|
||||
<if test="processor_name != null and processor_name !='' "> and processor_name = #{processor_name}</if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> and processing_remarks = #{processing_remarks}</if>
|
||||
<if test="processing_time != null "> and processing_time = #{processing_time}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLivingDetailsEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List" />
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result like concat('%',#{result},'%') </if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition like concat('%',#{query_condition},'%') </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk like concat('%',#{root_app_pk},'%') </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill like concat('%',#{root_app_bill},'%') </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data like concat('%',#{root_app_new_data},'%') </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info like concat('%',#{new_transmit_info},'%') </if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> and new_push_date like concat('%',#{new_push_date},'%') </if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust like concat('%',#{repair_pust},'%') </if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id like concat('%',#{sence_id},'%') </if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> and plugin_id like concat('%',#{plugin_id},'%') </if>
|
||||
<if test="new_state != null and new_state !='' "> and new_state like concat('%',#{new_state},'%') </if>
|
||||
<if test="business_date != null and business_date !='' "> and business_date like concat('%',#{business_date},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> and new_system_primary like concat('%',#{new_system_primary},'%') </if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> and new_system_number like concat('%',#{new_system_number},'%') </if>
|
||||
<if test="processor != null and processor !='' "> and processor like concat('%',#{processor},'%') </if>
|
||||
<if test="processor_name != null and processor_name !='' "> and processor_name like concat('%',#{processor_name},'%') </if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> and processing_remarks like concat('%',#{processing_remarks},'%') </if>
|
||||
<if test="processing_time != null and processing_time !='' "> and processing_time like concat('%',#{processing_time},'%') </if>
|
||||
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskLivingDetailsEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_Base_Column_List" />
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> or task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> or result = #{result} </if>
|
||||
<if test="query_condition != null and query_condition !='' "> or query_condition = #{query_condition} </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> or root_app_pk = #{root_app_pk} </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> or root_app_bill = #{root_app_bill} </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> or root_app_new_data = #{root_app_new_data} </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> or new_transmit_info = #{new_transmit_info} </if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> or new_push_date = #{new_push_date} </if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> or repair_pust = #{repair_pust} </if>
|
||||
<if test="sence_id != null and sence_id !='' "> or sence_id = #{sence_id} </if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> or plugin_id = #{plugin_id} </if>
|
||||
<if test="new_state != null and new_state !='' "> or new_state = #{new_state} </if>
|
||||
<if test="business_date != null and business_date !='' "> or business_date = #{business_date} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> or new_system_primary = #{new_system_primary}</if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> or new_system_number = #{new_system_number}</if>
|
||||
<if test="processor != null and processor !='' "> or processor = #{processor}</if>
|
||||
<if test="processor_name != null and processor_name !='' "> or processor_name = #{processor_name}</if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> or processing_remarks = #{processing_remarks}</if>
|
||||
<if test="processing_time != null "> or processing_time = #{processing_time}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
insert into integration_task_living_details(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">id,</if>
|
||||
<if test="task_linving_id != null and task_linving_id !='' ">task_linving_id,</if>
|
||||
<if test="result != null and result !='' "> result, </if>
|
||||
<if test="query_condition != null and query_condition !='' "> query_condition, </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> root_app_pk, </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> root_app_bill, </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> root_app_new_data, </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> new_transmit_info, </if>
|
||||
<if test="new_push_date != null ">new_push_date,</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> repair_pust, </if>
|
||||
<if test="sence_id != null and sence_id !='' "> sence_id, </if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> plugin_id, </if>
|
||||
<if test="new_state != null and new_state !='' "> new_state, </if>
|
||||
<if test="business_date != null and business_date !='' "> business_date, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> new_system_primary, </if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> new_system_number, </if>
|
||||
<if test="processor != null and processor !='' "> processor, </if>
|
||||
<if test="processor_name != null and processor_name !='' "> processor_name, </if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> processing_remarks, </if>
|
||||
<if test="processing_time != null ">processing_time,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">#{id},</if>
|
||||
<if test="task_linving_id != null and task_linving_id !=''">#{task_linving_id},</if>
|
||||
<if test="result != null and result !='' "> #{result}, </if>
|
||||
<if test="query_condition != null and query_condition !='' "> #{query_condition}, </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> #{root_app_pk}, </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> #{root_app_bill}, </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> #{root_app_new_data}, </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> #{new_transmit_info}, </if>
|
||||
<if test="new_push_date != null ">#{new_push_date},</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> #{repair_pust}, </if>
|
||||
<if test="sence_id != null and sence_id !='' "> #{sence_id}, </if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> #{plugin_id}, </if>
|
||||
<if test="new_state != null and new_state !='' "> #{new_state}, </if>
|
||||
<if test="business_date != null and business_date !='' "> #{business_date}, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_living_details a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> #{new_system_primary}, </if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> #{new_system_number}, </if>
|
||||
<if test="processor != null and processor !='' "> #{processor}, </if>
|
||||
<if test="processor_name != null and processor_name !='' "> #{processor_name}, </if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> #{processing_remarks}, </if>
|
||||
<if test="processing_time != null ">#{processing_time},</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now() ,</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
update integration_task_living_details set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="result != null and result !='' "> result = #{result},</if>
|
||||
<if test="query_condition != null and query_condition !='' "> query_condition = #{query_condition},</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> root_app_pk = #{root_app_pk},</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> root_app_bill = #{root_app_bill},</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> root_app_new_data = #{root_app_new_data},</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> new_transmit_info = #{new_transmit_info},</if>
|
||||
<if test="new_push_date != null ">new_push_date = #{new_push_date},</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> repair_pust = #{repair_pust},</if>
|
||||
<if test="sence_id != null and sence_id !='' "> sence_id = #{sence_id},</if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> plugin_id = #{plugin_id},</if>
|
||||
<if test="new_state != null and new_state !='' "> new_state = #{new_state},</if>
|
||||
<if test="business_date != null and business_date !='' "> business_date = #{business_date},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> new_system_primary = #{new_system_primary},</if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> new_system_number = #{new_system_number},</if>
|
||||
<if test="processor != null and processor !='' "> processor = #{processor},</if>
|
||||
<if test="processor_name != null and processor_name !='' "> processor_name = #{processor_name},</if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> processing_remarks = #{processing_remarks},</if>
|
||||
<if test="processing_time != null "> processing_time = #{processing_time},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
|
||||
</trim>
|
||||
where task_linving_id = #{task_linving_id}
|
||||
</update>
|
||||
|
||||
<!-- 修改:按主键修改 -->
|
||||
<update id="entity_updatebyid" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
update integration_task_living_details set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="result != null and result !='' "> result = #{result},</if>
|
||||
<if test="query_condition != null and query_condition !='' "> query_condition = #{query_condition},</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> root_app_pk = #{root_app_pk},</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> root_app_bill = #{root_app_bill},</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> root_app_new_data = #{root_app_new_data},</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> new_transmit_info = #{new_transmit_info},</if>
|
||||
<if test="new_push_date != null ">new_push_date = #{new_push_date},</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> repair_pust = #{repair_pust},</if>
|
||||
<if test="sence_id != null and sence_id !='' "> sence_id = #{sence_id},</if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> plugin_id = #{plugin_id},</if>
|
||||
<if test="new_state != null and new_state !='' "> new_state = #{new_state},</if>
|
||||
<if test="business_date != null and business_date !='' "> business_date = #{business_date},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> new_system_primary = #{new_system_primary},</if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> new_system_number = #{new_system_number},</if>
|
||||
<if test="processor != null and processor !='' "> processor = #{processor},</if>
|
||||
<if test="processor_name != null and processor_name !='' "> processor_name = #{processor_name},</if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> processing_remarks = #{processing_remarks},</if>
|
||||
<if test="processing_time != null "> processing_time = #{processing_time},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
update integration_task_living_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
update integration_task_living_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_linving_id != null and task_linving_id !='' "> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition = #{query_condition}</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk = #{root_app_pk}</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill = #{root_app_bill}</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data = #{root_app_new_data}</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info = #{new_transmit_info}</if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> and new_push_date = #{new_push_date}</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust = #{repair_pust}</if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id = #{sence_id}</if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> and plugin_id = #{plugin_id}</if>
|
||||
<if test="new_state != null and new_state !='' "> and new_state = #{new_state}</if>
|
||||
<if test="business_date != null and business_date !='' "> and business_date = #{business_date}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> and new_system_primary = #{new_system_primary}</if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> and new_system_number = #{new_system_number}</if>
|
||||
<if test="processor != null and processor !='' "> and processor = #{processor}</if>
|
||||
<if test="processor_name != null and processor_name !='' "> and processor_name = #{processor_name}</if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> and processing_remarks = #{processing_remarks}</if>
|
||||
<if test="processing_time != null "> and processing_time = #{processing_time}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity">
|
||||
delete from integration_task_living_details where id =#{id}
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
<sql id="IntegrationTaskLivingDetailsVo_Base_Column_List">
|
||||
id,
|
||||
task_linving_id,
|
||||
result,
|
||||
query_condition,
|
||||
root_app_pk,
|
||||
root_app_bill,
|
||||
root_app_new_data,
|
||||
new_transmit_info,
|
||||
new_push_date,
|
||||
repair_pust,
|
||||
sence_id,
|
||||
plugin_id,
|
||||
new_state,
|
||||
business_date,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
new_system_primary,
|
||||
new_system_number,
|
||||
processor,
|
||||
processor_name,
|
||||
processing_remarks,
|
||||
processing_time
|
||||
</sql>
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryPageLeftTask" resultMap="get-IntegrationTaskLivingDetailsVo-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsVo">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsVo_Base_Column_List" />
|
||||
from integration_task_living_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result like concat('%',#{result},'%') </if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition like concat('%',#{query_condition},'%') </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk like concat('%',#{root_app_pk},'%') </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill like concat(#{root_app_bill},'%') </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data like concat('%',#{root_app_new_data},'%') </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info like concat('%',#{new_transmit_info},'%') </if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> <![CDATA[ AND DATE_FORMAT(new_push_date , '%Y-%m-%d') = #{new_push_date} ]]> </if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust like concat('%',#{repair_pust},'%') </if>
|
||||
<if test="sence_id != null and sence_id !='' "> and sence_id like concat('%',#{sence_id},'%') </if>
|
||||
<if test="plugin_id != null and plugin_id !='' "> and plugin_id like concat(#{plugin_id},'%') </if>
|
||||
<if test="new_state != null and new_state !='' "> and new_state like concat(#{new_state},'%') </if>
|
||||
<if test="business_date != null and business_date !='' "> <![CDATA[ AND DATE_FORMAT(business_date , '%Y-%m-%d') = str_to_date(#{business_date},'%Y-%m-%d') ]]> </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat(#{sts},'%') </if>
|
||||
<if test="new_system_primary != null and new_system_primary !='' "> and new_system_primary like concat('%',#{new_system_primary},'%') </if>
|
||||
<if test="new_system_number != null and new_system_number !='' "> and new_system_number like concat(#{new_system_number},'%') </if>
|
||||
<if test="processor != null and processor !='' "> and processor like concat('%',#{processor},'%') </if>
|
||||
<if test="processor_name != null and processor_name !='' "> and processor_name like concat('%',#{processor_name},'%') </if>
|
||||
<if test="processing_remarks != null and processing_remarks !='' "> and processing_remarks like concat('%',#{processing_remarks},'%') </if>
|
||||
<if test="processing_time != null and processing_time !='' "> and processing_time like concat('%',#{processing_time},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<resultMap id="get-IntegrationTaskLivingDetailsVo-result" type="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsVo">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--集成任务-实例_id -->
|
||||
<result property="task_linving_id" column="task_linving_id" />
|
||||
<!--返回结果 -->
|
||||
<result property="result" column="result" />
|
||||
<!--原始查询条件 -->
|
||||
<result property="query_condition" column="query_condition" />
|
||||
<!--源系统主键 -->
|
||||
<result property="root_app_pk" column="root_app_pk" />
|
||||
<!--原系统单据 -->
|
||||
<result property="root_app_bill" column="root_app_bill" />
|
||||
<!--最新源系统数据详情 -->
|
||||
<result property="root_app_new_data" column="root_app_new_data" />
|
||||
<!--最新传输信息 -->
|
||||
<result property="new_transmit_info" column="new_transmit_info" />
|
||||
<!--最新推送时间 -->
|
||||
<result property="new_push_date" column="new_push_date" />
|
||||
<!--是否补推(Y是N不是) -->
|
||||
<result property="repair_pust" column="repair_pust" />
|
||||
<!-- 场景id-->
|
||||
<result property="sence_id" column="sence_id"/>
|
||||
<!-- 插件id-->
|
||||
<result property="plugin_id" column="plugin_id"/>
|
||||
<!-- 推送状态-->
|
||||
<result property="new_state" column="new_state"/>
|
||||
<!-- 单据业务日期-->
|
||||
<result property="business_date" column="business_date"/>
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!-- 下游系统主键 -->
|
||||
<result property="new_system_primary" column="new_system_primary" />
|
||||
<!--下游系统单号 -->
|
||||
<result property="new_system_number" column="new_system_number" />
|
||||
<!--处理⼈ -->
|
||||
<result property="processor" column="processor" />
|
||||
<!--处理⼈名称 -->
|
||||
<result property="processor_name" column="processor_name" />
|
||||
<!-- 处理备注 -->
|
||||
<result property="processing_remarks" column="processing_remarks" />
|
||||
<!--处理时间 -->
|
||||
<result property="processing_time" column="processing_time" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryFastIntegrationTaskLivingDetails" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity" resultMap="get-IntegrationTaskLivingDetailsEntity-result">
|
||||
SELECT
|
||||
root_app_pk
|
||||
FROM
|
||||
integration_task_living_details
|
||||
WHERE
|
||||
plugin_id = #{plugin_id}
|
||||
and new_state in (${param_new_state})
|
||||
and root_app_pk in (${root_app_pk_s})
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,356 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例详情 entity
|
||||
* @tableName: integration_task_living_details
|
||||
* @entityName: IntegrationTaskLivingDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskLivingDetailsVo extends BaseEntity{
|
||||
|
||||
/** task_name */
|
||||
private String task_name;
|
||||
/** integration_task_id */
|
||||
private String task_id;
|
||||
/**
|
||||
* 集成任务-实例_id
|
||||
*/
|
||||
private String task_linving_id;
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
private String result;
|
||||
/**
|
||||
* 原始查询条件
|
||||
*/
|
||||
private String query_condition;
|
||||
/**
|
||||
* 源系统主键
|
||||
*/
|
||||
private String root_app_pk;
|
||||
/**
|
||||
* 原系统单据
|
||||
*/
|
||||
private String root_app_bill;
|
||||
/**
|
||||
* 最新源系统数据详情(上游系统入参)
|
||||
*/
|
||||
private String root_app_new_data;
|
||||
/**
|
||||
* 最新传输信息(下游系统返回结果)
|
||||
*/
|
||||
private String new_transmit_info;
|
||||
private String new_push_date;
|
||||
/**
|
||||
* 是否补推(Y是N不是)
|
||||
*/
|
||||
private String repair_pust;
|
||||
|
||||
private Integer sorts;
|
||||
|
||||
//场景id
|
||||
private String sence_id;
|
||||
|
||||
// 插件id
|
||||
private String plugin_id;
|
||||
|
||||
// 插件名称
|
||||
private String plugin_name;
|
||||
/**
|
||||
* 推送状态
|
||||
*/
|
||||
private String new_state;
|
||||
|
||||
/**
|
||||
* 作为查询条件的推送状态
|
||||
*/
|
||||
private String param_new_state;
|
||||
|
||||
/**
|
||||
* 单据业务日期
|
||||
*/
|
||||
private String business_date;
|
||||
|
||||
|
||||
/**
|
||||
* 下游系统主键
|
||||
*/
|
||||
private String new_system_primary;
|
||||
/**
|
||||
* 下游系统单号
|
||||
*/
|
||||
private String new_system_number;
|
||||
/**
|
||||
* 处理⼈
|
||||
*/
|
||||
private String processor;
|
||||
|
||||
/**
|
||||
* 处理⼈名称
|
||||
*/
|
||||
private String processor_name;
|
||||
|
||||
/**
|
||||
* 处理备注
|
||||
*/
|
||||
private String processing_remarks;
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date processing_time;
|
||||
|
||||
|
||||
public String getParam_new_state() {
|
||||
return param_new_state;
|
||||
}
|
||||
|
||||
public void setParam_new_state(String param_new_state) {
|
||||
this.param_new_state = param_new_state;
|
||||
}
|
||||
|
||||
public String getBusiness_date() {
|
||||
return business_date;
|
||||
}
|
||||
|
||||
public void setBusiness_date(String business_date) {
|
||||
this.business_date = business_date;
|
||||
}
|
||||
|
||||
public String getNew_state() {
|
||||
return new_state;
|
||||
}
|
||||
|
||||
public void setNew_state(String new_state) {
|
||||
this.new_state = new_state;
|
||||
}
|
||||
|
||||
public String getSence_id() {
|
||||
return sence_id;
|
||||
}
|
||||
|
||||
public void setSence_id(String sence_id) {
|
||||
this.sence_id = sence_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 集成任务-实例_id
|
||||
*/
|
||||
public void setTask_linving_id(String task_linving_id) {
|
||||
this.task_linving_id = task_linving_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 集成任务-实例_id
|
||||
*/
|
||||
public String getTask_linving_id() {
|
||||
return task_linving_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 原始查询条件
|
||||
*/
|
||||
public void setQuery_condition(String query_condition) {
|
||||
this.query_condition = query_condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始查询条件
|
||||
*/
|
||||
public String getQuery_condition() {
|
||||
return query_condition;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 源系统主键
|
||||
*/
|
||||
public void setRoot_app_pk(String root_app_pk) {
|
||||
this.root_app_pk = root_app_pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* 源系统主键
|
||||
*/
|
||||
public String getRoot_app_pk() {
|
||||
return root_app_pk;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 原系统单据
|
||||
*/
|
||||
public void setRoot_app_bill(String root_app_bill) {
|
||||
this.root_app_bill = root_app_bill;
|
||||
}
|
||||
|
||||
/**
|
||||
* 原系统单据
|
||||
*/
|
||||
public String getRoot_app_bill() {
|
||||
return root_app_bill;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 最新源系统数据详情
|
||||
*/
|
||||
public void setRoot_app_new_data(String root_app_new_data) {
|
||||
this.root_app_new_data = root_app_new_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新源系统数据详情
|
||||
*/
|
||||
public String getRoot_app_new_data() {
|
||||
return root_app_new_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 最新传输信息
|
||||
*/
|
||||
public void setNew_transmit_info(String new_transmit_info) {
|
||||
this.new_transmit_info = new_transmit_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最新传输信息
|
||||
*/
|
||||
public String getNew_transmit_info() {
|
||||
return new_transmit_info;
|
||||
}
|
||||
|
||||
public String getNew_push_date() {
|
||||
return new_push_date;
|
||||
}
|
||||
|
||||
public void setNew_push_date(String new_push_date) {
|
||||
this.new_push_date = new_push_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否补推(Y是N不是)
|
||||
*/
|
||||
public void setRepair_pust(String repair_pust) {
|
||||
this.repair_pust = repair_pust;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否补推(Y是N不是)
|
||||
*/
|
||||
public String getRepair_pust() {
|
||||
return repair_pust;
|
||||
}
|
||||
|
||||
public String getPlugin_id() {
|
||||
return plugin_id;
|
||||
}
|
||||
|
||||
public void setPlugin_id(String plugin_id) {
|
||||
this.plugin_id = plugin_id;
|
||||
}
|
||||
|
||||
public String getTask_name() {
|
||||
return task_name;
|
||||
}
|
||||
|
||||
public void setTask_name(String task_name) {
|
||||
this.task_name = task_name;
|
||||
}
|
||||
|
||||
public String getTask_id() {
|
||||
return task_id;
|
||||
}
|
||||
|
||||
public void setTask_id(String task_id) {
|
||||
this.task_id = task_id;
|
||||
}
|
||||
|
||||
public String getPlugin_name() {
|
||||
return plugin_name;
|
||||
}
|
||||
|
||||
public void setPlugin_name(String plugin_name) {
|
||||
this.plugin_name = plugin_name;
|
||||
}
|
||||
|
||||
public String getNew_system_primary() {
|
||||
return new_system_primary;
|
||||
}
|
||||
|
||||
public void setNew_system_primary(String new_system_primary) {
|
||||
this.new_system_primary = new_system_primary;
|
||||
}
|
||||
|
||||
public String getNew_system_number() {
|
||||
return new_system_number;
|
||||
}
|
||||
|
||||
public void setNew_system_number(String new_system_number) {
|
||||
this.new_system_number = new_system_number;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public String getProcessor_name() {
|
||||
return processor_name;
|
||||
}
|
||||
|
||||
public void setProcessor_name(String processor_name) {
|
||||
this.processor_name = processor_name;
|
||||
}
|
||||
|
||||
public String getProcessing_remarks() {
|
||||
return processing_remarks;
|
||||
}
|
||||
|
||||
public void setProcessing_remarks(String processing_remarks) {
|
||||
this.processing_remarks = processing_remarks;
|
||||
}
|
||||
|
||||
public Date getProcessing_time() {
|
||||
return processing_time;
|
||||
}
|
||||
|
||||
public void setProcessing_time(Date processing_time) {
|
||||
this.processing_time = processing_time;
|
||||
}
|
||||
}
|
|
@ -1,154 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例 entity
|
||||
* @tableName: integration_task_living
|
||||
* @entityName: IntegrationTaskLivingEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskLivingEntity extends BaseEntity {
|
||||
|
||||
/** integration_task_id */
|
||||
private String task_id;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date start_time;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date end_time;
|
||||
/** 耗时 */
|
||||
private String diff_time;
|
||||
/** 返回结果 */
|
||||
private String result;
|
||||
/** 服务器名称 */
|
||||
private String server_name;
|
||||
/** 服务实例名称 */
|
||||
private String server_living;
|
||||
/** 说明
|
||||
*/
|
||||
private String instructions;
|
||||
|
||||
private Integer sorts;
|
||||
private String task_code;
|
||||
private String task_name;
|
||||
private String task_type;
|
||||
|
||||
public String getTask_type() {
|
||||
return task_type;
|
||||
}
|
||||
|
||||
public void setTask_type(String task_type) {
|
||||
this.task_type = task_type;
|
||||
}
|
||||
|
||||
public String getTask_code() {
|
||||
return task_code;
|
||||
}
|
||||
|
||||
public void setTask_code(String task_code) {
|
||||
this.task_code = task_code;
|
||||
}
|
||||
|
||||
public String getTask_name() {
|
||||
return task_name;
|
||||
}
|
||||
|
||||
public void setTask_name(String task_name) {
|
||||
this.task_name = task_name;
|
||||
}
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
/** integration_task_id */
|
||||
public void setTask_id(String task_id) {
|
||||
this.task_id = task_id;
|
||||
}
|
||||
/** integration_task_id */
|
||||
public String getTask_id() {
|
||||
return task_id;
|
||||
}
|
||||
|
||||
|
||||
/** 开始时间 */
|
||||
public void setStart_time(Date start_time) {
|
||||
this.start_time = start_time;
|
||||
}
|
||||
/** 开始时间 */
|
||||
public Date getStart_time() {
|
||||
return start_time;
|
||||
}
|
||||
|
||||
|
||||
/** 结束时间 */
|
||||
public void setEnd_time(Date end_time) {
|
||||
this.end_time = end_time;
|
||||
}
|
||||
/** 结束时间 */
|
||||
public Date getEnd_time() {
|
||||
return end_time;
|
||||
}
|
||||
|
||||
|
||||
/** 耗时 */
|
||||
public void setDiff_time(String diff_time) {
|
||||
this.diff_time = diff_time;
|
||||
}
|
||||
/** 耗时 */
|
||||
public String getDiff_time() {
|
||||
return diff_time;
|
||||
}
|
||||
|
||||
|
||||
/** 返回结果 */
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
/** 返回结果 */
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/** 服务器名称 */
|
||||
public void setServer_name(String server_name) {
|
||||
this.server_name = server_name;
|
||||
}
|
||||
/** 服务器名称 */
|
||||
public String getServer_name() {
|
||||
return server_name;
|
||||
}
|
||||
|
||||
|
||||
/** 服务实例名称 */
|
||||
public void setServer_living(String server_living) {
|
||||
this.server_living = server_living;
|
||||
}
|
||||
/** 服务实例名称 */
|
||||
public String getServer_living() {
|
||||
return server_living;
|
||||
}
|
||||
|
||||
|
||||
/** 说明
|
||||
*/
|
||||
public void setInstructions(String instructions) {
|
||||
this.instructions = instructions;
|
||||
}
|
||||
/** 说明
|
||||
*/
|
||||
public String getInstructions() {
|
||||
return instructions;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,309 +0,0 @@
|
|||
<?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.sys.integrationtask.living.dao.impl.IntegrationTaskLivingDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskLivingEntity-result" type="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--integration_task_id -->
|
||||
<result property="task_id" column="task_id" />
|
||||
<!--开始时间 -->
|
||||
<result property="start_time" column="start_time" />
|
||||
<!--结束时间 -->
|
||||
<result property="end_time" column="end_time" />
|
||||
<!--耗时 -->
|
||||
<result property="diff_time" column="diff_time" />
|
||||
<!--返回结果 -->
|
||||
<result property="result" column="result" />
|
||||
<!--服务器名称 -->
|
||||
<result property="server_name" column="server_name" />
|
||||
<!--服务实例名称 -->
|
||||
<result property="server_living" column="server_living" />
|
||||
<!--说明
|
||||
-->
|
||||
<result property="instructions" column="instructions" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!--任务编码 -->
|
||||
<result property="task_code" column="task_code" />
|
||||
<!--任务名称 -->
|
||||
<result property="task_name" column="task_name" />
|
||||
<!--任务名称 -->
|
||||
<result property="task_type" column="task_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskLivingEntity_Base_Column_List">
|
||||
id,
|
||||
task_id,
|
||||
start_time,
|
||||
end_time,
|
||||
diff_time,
|
||||
result,
|
||||
server_name,
|
||||
server_living,
|
||||
instructions,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
task_type
|
||||
</sql>
|
||||
|
||||
<sql id="IntegrationTaskLivingEntity_Base_Column_ListTask">
|
||||
task.id as task_id,
|
||||
living.id as id,
|
||||
task.task_code as task_code,
|
||||
task.task_name as task_name,
|
||||
living.start_time as start_time,
|
||||
living.end_time as end_time,
|
||||
living.diff_time as diff_time,
|
||||
living.result as result,
|
||||
living.task_type,
|
||||
living.server_name as server_name,
|
||||
living.server_living as server_living,
|
||||
living.instructions,
|
||||
living.sts,
|
||||
living.sorts
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLivingEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_List" />
|
||||
from integration_task_living where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!--通过task_id获取数据 -->
|
||||
<select id="IntegrationTaskLivingEntity_getIdByTaskId" resultMap="get-IntegrationTaskLivingEntity-result">
|
||||
select id from integration_task_living where task_id = #{task_id}
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLivingEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_List" />
|
||||
from integration_task_living
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id}</if>
|
||||
<if test="start_time != null "> and start_time = #{start_time}</if>
|
||||
<if test="end_time != null "> and end_time = #{end_time}</if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time = #{diff_time}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="task_type != null and task_type !='' "> and task_type = #{task_type}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living = #{server_living}</if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions = #{instructions}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
select count(1) from integration_task_living
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id} </if>
|
||||
<if test="start_time != null "> and start_time = #{start_time} </if>
|
||||
<if test="end_time != null "> and end_time = #{end_time} </if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time = #{diff_time} </if>
|
||||
<if test="result != null and result !='' "> and result = #{result} </if>
|
||||
<if test="task_type != null and task_type !='' "> and task_type = #{task_type} </if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name} </if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living = #{server_living} </if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions = #{instructions} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<!--<select id="IntegrationTaskLivingEntity_list_like" resultMap="get-IntegrationTaskLivingEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_List" />
|
||||
from integration_task_living
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id}</if>
|
||||
<if test="start_time != null and start_time !='' "> and start_time like concat('%',#{start_time},'%') </if>
|
||||
<if test="end_time != null and end_time !='' "> and end_time like concat('%',#{end_time},'%') </if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time like concat('%',#{diff_time},'%') </if>
|
||||
<if test="result != null and result !='' "> and result like concat('%',#{result},'%') </if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name like concat('%',#{server_name},'%') </if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living like concat('%',#{server_living},'%') </if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions like concat('%',#{instructions},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>-->
|
||||
|
||||
<!-- 分页查询列表 任务与实例连表查询-->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLivingEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_ListTask" />
|
||||
from integration_task task
|
||||
left join integration_task_living living on task.id=living.task_id
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="task_name != null and task_name !='' "> and task.task_name like concat('%',#{task_name},'%') </if>
|
||||
<if test="id != null and id !='' "> and living.id =#{id} </if>
|
||||
and living.sts='Y'
|
||||
</trim>
|
||||
order by living.start_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskLivingEntity-result" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_List" />
|
||||
from integration_task_living
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> or task_id = #{task_id}</if>
|
||||
<if test="start_time != null and start_time !='' "> or start_time = #{start_time} </if>
|
||||
<if test="end_time != null and end_time !='' "> or end_time = #{end_time} </if>
|
||||
<if test="diff_time != null and diff_time !='' "> or diff_time = #{diff_time} </if>
|
||||
<if test="result != null and result !='' "> or result = #{result} </if>
|
||||
<if test="task_type != null and task_type !='' "> or task_type = #{task_type} </if>
|
||||
<if test="server_name != null and server_name !='' "> or server_name = #{server_name} </if>
|
||||
<if test="server_living != null and server_living !='' "> or server_living = #{server_living} </if>
|
||||
<if test="instructions != null and instructions !='' "> or instructions = #{instructions} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
insert into integration_task_living(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">id,</if>
|
||||
<if test="task_id != null and task_id !=''">task_id,</if>
|
||||
<if test="start_time != null ">start_time,</if>
|
||||
<if test="end_time != null ">end_time,</if>
|
||||
<if test="diff_time != null and diff_time !='' "> diff_time, </if>
|
||||
<if test="result != null and result !='' "> result, </if>
|
||||
<if test="task_type != null and task_type !='' "> task_type, </if>
|
||||
<if test="server_name != null and server_name !='' "> server_name, </if>
|
||||
<if test="server_living != null and server_living !='' "> server_living, </if>
|
||||
<if test="instructions != null and instructions !='' "> instructions, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">#{id},</if>
|
||||
<if test="task_id != null and task_id !=''">#{task_id},</if>
|
||||
<if test="start_time != null ">#{start_time},</if>
|
||||
<if test="end_time != null ">#{end_time},</if>
|
||||
<if test="diff_time != null and diff_time !='' "> #{diff_time}, </if>
|
||||
<if test="result != null and result !='' "> #{result}, </if>
|
||||
<if test="task_type != null and task_type !='' "> #{task_type}, </if>
|
||||
<if test="server_name != null and server_name !='' "> #{server_name}, </if>
|
||||
<if test="server_living != null and server_living !='' "> #{server_living}, </if>
|
||||
<if test="instructions != null and instructions !='' "> #{instructions}, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_living a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now(),</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
update integration_task_living set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="task_id != null ">task_id = #{task_id},</if>
|
||||
<if test="start_time != null ">start_time = #{start_time},</if>
|
||||
<if test="end_time != null ">end_time = #{end_time},</if>
|
||||
<if test="diff_time != null and diff_time !='' "> diff_time = #{diff_time},</if>
|
||||
<if test="result != null and result !='' "> result = #{result},</if>
|
||||
<if test="task_type != null and task_type !='' "> task_type = #{task_type},</if>
|
||||
<if test="server_name != null and server_name !='' "> server_name = #{server_name},</if>
|
||||
<if test="server_living != null and server_living !='' "> server_living = #{server_living},</if>
|
||||
<if test="instructions != null and instructions !='' "> instructions = #{instructions},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
update integration_task_living set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
update integration_task_living set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_id != null and task_id !=''"> and task_id = #{task_id}</if>
|
||||
<if test="start_time != null and start_time !='' "> and start_time = #{start_time}</if>
|
||||
<if test="end_time != null and end_time !='' "> and end_time = #{end_time}</if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time = #{diff_time}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="task_type != null and task_type !='' "> and task_type = #{task_type}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living = #{server_living}</if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions = #{instructions}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity">
|
||||
delete from integration_task_living where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,71 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例详情 service
|
||||
* @tableName: integration_task_living_details
|
||||
* @entityName: IntegrationTaskLivingDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLivingDetailsService extends IBaseService<IntegrationTaskLivingDetailsEntity, String> {
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询列表 分页
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
JsonResultEntity queryPage(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取数据 根据id
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
JsonResultEntity queryEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 批量推送
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
JsonResultEntity batchPush(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 重新推送
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
JsonResultEntity repush(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 手工处理
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
JsonResultEntity manualProcessing(JSONObject jsonObject);
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
JsonResultEntity deleteEntity(JSONObject jsonObject);
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例 service
|
||||
* @tableName: integration_task_living
|
||||
* @entityName: IntegrationTaskLivingEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLivingService extends IBaseService<IntegrationTaskLivingEntity, String> {
|
||||
|
||||
//保存任务实例以及任务实例明细
|
||||
JsonResultEntity saveIntegrationTaskLiving(JSONObject jsonObject);
|
||||
|
||||
//根据task_id查询id
|
||||
JsonResultEntity queryIntegrationTaskLiving(IntegrationTaskLivingEntity integrationTaskLivingEntity);
|
||||
|
||||
|
||||
//实例补推 更新实例数据,新增日志数据
|
||||
JsonResultEntity updateIntegrationTaskLivingRetrofit(JSONObject jsonObject);
|
||||
|
||||
//根据实例id修改实例数据
|
||||
JsonResultEntity updateIntegrationTaskLiving(JSONObject jsonObject);
|
||||
|
||||
//查询单个实例
|
||||
JsonResultEntity queryTaskLivingOne(JSONObject jsonObject);
|
||||
|
||||
//筛选明细数据正常与删除
|
||||
JsonResultEntity queryTaskLivingDetails(JSONObject jsonObject);
|
||||
}
|
|
@ -1,209 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.basedao.entity.ConditionType;
|
||||
import com.hzya.frame.basedao.entity.ConnectType;
|
||||
import com.hzya.frame.basedao.entity.WhereCriterion;
|
||||
import com.hzya.frame.basedao.service.impl.BaseDaoUtilImpl;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsVo;
|
||||
import com.hzya.frame.util.PluginUtils;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.service.IIntegrationTaskLivingDetailsService;
|
||||
import com.hzya.frame.sys.integrationtask.living.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例详情 service
|
||||
* @tableName: integration_task_living_details
|
||||
* @entityName: IntegrationTaskLivingDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Service(value = "integration_task_living_detailsService")
|
||||
public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<IntegrationTaskLivingDetailsEntity, String> implements IIntegrationTaskLivingDetailsService {
|
||||
|
||||
protected IIntegrationTaskLivingDetailsDao integrationtasklivingdetailsDao;
|
||||
|
||||
//@Autowired
|
||||
private BaseDaoUtilImpl baseDaoUtilImpl;
|
||||
|
||||
@Autowired
|
||||
public void setIntegrationTaskLivingDetailsDao(IIntegrationTaskLivingDetailsDao dao) {
|
||||
this.integrationtasklivingdetailsDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询列表 分页
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryPage(JSONObject object) {
|
||||
IntegrationTaskLivingDetailsVo entity = getData("jsonStr", object, IntegrationTaskLivingDetailsVo.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<IntegrationTaskLivingDetailsVo> integrationTaskLivingDetailsEntityList = integrationtasklivingdetailsDao.queryPageLeftTask(entity);
|
||||
if (integrationTaskLivingDetailsEntityList != null && integrationTaskLivingDetailsEntityList.size() > 0) {
|
||||
for (int i = 0; i < integrationTaskLivingDetailsEntityList.size(); i++) {
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(integrationTaskLivingDetailsEntityList.get(i).getPlugin_id());
|
||||
if (pluginBaseEntity != null) {
|
||||
integrationTaskLivingDetailsEntityList.get(i).setPlugin_name(pluginBaseEntity.getPluginName());
|
||||
}
|
||||
}
|
||||
}
|
||||
PageInfo pageInfo = new PageInfo(integrationTaskLivingDetailsEntityList);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取数据 根据id
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntity(JSONObject object) {
|
||||
IntegrationTaskLivingDetailsEntity entity = getData("jsonStr", object, IntegrationTaskLivingDetailsEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先传递请求主键");
|
||||
}
|
||||
IntegrationTaskLivingDetailsEntity appApi = integrationtasklivingdetailsDao.queryOne(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", appApi);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 批量推送
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity batchPush(JSONObject object) {
|
||||
JSONObject jsonObject = getstrObj("jsonStr", object);
|
||||
String plugin_id = "com.hzya.frame.plugin.sowow.plugin.sales.SoSalePluginInitializerToB";
|
||||
|
||||
|
||||
String id = jsonObject.getString("id");
|
||||
if (!checkStr(id)) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择要推送的数据");
|
||||
}
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(plugin_id);
|
||||
JSONObject send = new JSONObject();
|
||||
send.put("type", "detailid");
|
||||
send.put("param", id);
|
||||
|
||||
try {
|
||||
pluginBaseEntity.executeBusiness(send);
|
||||
return BaseResult.getSuccessMessageEntity("批量推送成功");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("批量推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 重新推送
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity repush(JSONObject object) {
|
||||
JSONObject jsonObject = getstrObj("jsonStr", object);
|
||||
String plugin_id = jsonObject.getString("plugin_id");//"com.hzya.frame.plugin.sowow.plugin.sales.SoSalePluginInitializerToB";
|
||||
String id = jsonObject.getString("id");
|
||||
if (!checkStr(id)) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择要推送的数据");
|
||||
}
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(plugin_id);
|
||||
JSONObject send = new JSONObject();
|
||||
send.put("type", "details_error");
|
||||
send.put("pluginId", plugin_id);
|
||||
send.put("integration_task_living_details_id", id);
|
||||
|
||||
|
||||
try {
|
||||
pluginBaseEntity.executeBusiness(send);
|
||||
return BaseResult.getSuccessMessageEntity("重新推送成功");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("重新推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 手工处理
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity manualProcessing(JSONObject object) {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = getData("jsonStr", object, IntegrationTaskLivingDetailsEntity.class);
|
||||
if (integrationTaskLivingDetailsEntity == null && integrationTaskLivingDetailsEntity.getId() != null && !"".equals(integrationTaskLivingDetailsEntity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("请求参数不存在");
|
||||
}
|
||||
integrationTaskLivingDetailsEntity.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
integrationTaskLivingDetailsEntity.setModify_time(new Date());
|
||||
integrationTaskLivingDetailsEntity.setProcessor(StpUtil.getLoginIdAsString());
|
||||
//检查用户名密码是否正确
|
||||
List<WhereCriterion> whereList = new ArrayList<>();
|
||||
WhereCriterion passwordCondition = new WhereCriterion("", "id", ConditionType.等于.getValue(), StpUtil.getLoginIdAsString(), "", ConnectType.AND);
|
||||
whereList.add(passwordCondition);
|
||||
HashMap<String, Object> userMap = baseDaoUtilImpl.selectOne("sys_user", whereList);
|
||||
integrationTaskLivingDetailsEntity.setProcessor_name(userMap.get("login_code").toString());
|
||||
integrationTaskLivingDetailsEntity.setProcessing_time(new Date());
|
||||
integrationTaskLivingDetailsEntity.setNew_state("H");
|
||||
integrationtasklivingdetailsDao.entity_updatebyid(integrationTaskLivingDetailsEntity);
|
||||
return BaseResult.getSuccessMessageEntity("手工处理成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除
|
||||
* @Date 2:18 下午 2023/7/17
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject object) {
|
||||
IntegrationTaskLivingDetailsEntity entity = getData("jsonStr", object, IntegrationTaskLivingDetailsEntity.class);
|
||||
//判断编码是否重复
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择数据");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择数据");
|
||||
}
|
||||
//删除
|
||||
IntegrationTaskLivingDetailsEntity deleteEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
deleteEntity.setId(entity.getId());
|
||||
deleteEntity.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
deleteEntity.setModify_time(new Date());
|
||||
deleteEntity.setSts("Y");
|
||||
integrationtasklivingdetailsDao.logicRemove(deleteEntity);
|
||||
return BaseResult.getSuccessMessageEntity("删除成功");
|
||||
}
|
||||
}
|
|
@ -1,274 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.living.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.sys.integrationtask.living.dao.IIntegrationTaskLivingDao;
|
||||
import com.hzya.frame.sys.integrationtask.living.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.service.IIntegrationTaskLivingService;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务实例 service
|
||||
* @tableName: integration_task_living
|
||||
* @entityName: IntegrationTaskLivingEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integrationTaskLivingService")
|
||||
public class IntegrationTaskLivingServiceImpl extends BaseService<IntegrationTaskLivingEntity, String> implements IIntegrationTaskLivingService {
|
||||
|
||||
protected IIntegrationTaskLivingDao integrationtasklivingDao;
|
||||
//@Autowired
|
||||
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskLivingDao(IIntegrationTaskLivingDao dao) {
|
||||
this.integrationtasklivingDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实例保存
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
public JsonResultEntity saveIntegrationTaskLiving(JSONObject jsonObject) {
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity =jsonObject.toJavaObject(IntegrationTaskLivingEntity.class);
|
||||
String msg=null;
|
||||
String instructions=null;
|
||||
if(null!=jsonObject.getString("instructions")){
|
||||
instructions=jsonObject.getString("instructions");
|
||||
}
|
||||
//判断是否是插件执行 1:是插件 2:不是插件
|
||||
if("2".equals(jsonObject.getString("plug"))){
|
||||
String info = jsonObject.getString("info");
|
||||
//如果info为null,说明返回错误,
|
||||
if(null!=info && !"".equals(info)){
|
||||
JSONObject jsonObjectInfo = JSONObject.parseObject(info);
|
||||
msg = jsonObjectInfo.getString("msg");//最新传输信息
|
||||
//获取attribute里面得数据 循环保存明细
|
||||
if("false".equals(jsonObjectInfo.getString("success"))){
|
||||
jsonObject.put("instructions",jsonObjectInfo.getString("message"));
|
||||
jsonObject.put("msg",jsonObjectInfo.getString("message"));
|
||||
saveMainAndDetails(integrationTaskLivingEntity,jsonObject);
|
||||
}
|
||||
if("1".equals(jsonObjectInfo.getString("status"))){
|
||||
jsonObject.put("msg",jsonObjectInfo.getString("headMsg"));
|
||||
saveMainAndDetails(integrationTaskLivingEntity,jsonObject);
|
||||
}
|
||||
}else{
|
||||
jsonObject.put("instructions",instructions);
|
||||
jsonObject.put("msg",msg);
|
||||
saveMainAndDetails(integrationTaskLivingEntity,jsonObject);
|
||||
}
|
||||
}
|
||||
//如果是插件执行
|
||||
else{
|
||||
jsonObject.put("instructions",instructions);
|
||||
jsonObject.put("msg",msg);
|
||||
saveMainAndDetails(integrationTaskLivingEntity,jsonObject);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("任务实例保存成功", integrationTaskLivingEntity);
|
||||
}
|
||||
|
||||
private void saveMainAndDetails(IntegrationTaskLivingEntity integrationTaskLivingEntity,JSONObject jsonObject){
|
||||
//实例id
|
||||
long uuidLiving = UUIDLong.longUUID();
|
||||
integrationTaskLivingEntity.setId(String.valueOf(uuidLiving));
|
||||
integrationTaskLivingEntity.setInstructions(jsonObject.getString("instructions"));
|
||||
IntegrationTaskLivingEntity integrationTaskLiving = integrationtasklivingDao.save(integrationTaskLivingEntity);
|
||||
//实例明细id
|
||||
long uuidDetails = UUIDLong.longUUID();
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setId(String.valueOf(uuidDetails));
|
||||
integrationTaskLivingDetailsEntity.setTask_linving_id(String.valueOf(uuidLiving));
|
||||
integrationTaskLivingDetailsEntity.setCreate_user_id(jsonObject.getString("create_user_id"));
|
||||
integrationTaskLivingDetailsEntity.setModify_user_id(jsonObject.getString("modify_user_id"));
|
||||
integrationTaskLivingDetailsEntity.setResult(jsonObject.getString("result"));
|
||||
integrationTaskLivingDetailsEntity.setNew_transmit_info(jsonObject.getString("msg"));
|
||||
integrationTaskLivingDetailsEntity.setRoot_app_new_data(jsonObject.getString("msg"));
|
||||
integrationTaskLivingDetailsEntity.setQuery_condition(jsonObject.getString("query_condition"));
|
||||
integrationTaskLivingDetailsEntity.setNew_push_date(new Date());
|
||||
integrationTaskLivingDetailsEntity.setRepair_pust("N");
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetailsEntity = integrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据task_id查询实例id
|
||||
*
|
||||
* @param integrationTaskLivingEntity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryIntegrationTaskLiving(IntegrationTaskLivingEntity integrationTaskLivingEntity) {
|
||||
if(null==integrationTaskLivingEntity.getId()||"".equals(integrationTaskLivingEntity.getId())){
|
||||
return BaseResult.getFailureMessageEntity("请携带任务id");
|
||||
}
|
||||
List<IntegrationTaskLivingEntity> integrationTaskLivingEntities = integrationtasklivingDao.queryList(integrationTaskLivingEntity, "IntegrationTaskLivingEntity_getIdByTaskId");
|
||||
for (IntegrationTaskLivingEntity taskLivingEntity : integrationTaskLivingEntities) {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity=new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setTask_linving_id(taskLivingEntity.getId());
|
||||
integrationTaskLivingDetailsEntity.setModify_user_id(integrationTaskLivingEntity.getModify_user_id());
|
||||
//根据任务实例id修改任务实例明细id
|
||||
integrationTaskLivingDetailsDao.update("entity_logicDelete_Multi_Condition", integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
//根据task_id修改任务实例sts
|
||||
integrationtasklivingDao.update("entity_logicDelete_Multi_Condition", integrationTaskLivingEntity);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 实例补推
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateIntegrationTaskLivingRetrofit(JSONObject jsonObject) {
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = getData("json", jsonObject, IntegrationTaskLivingEntity.class);
|
||||
if (null == integrationTaskLivingEntity.getId() || "".equals(integrationTaskLivingEntity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("补推的时候请携带补推数据的id");
|
||||
}
|
||||
if (null == integrationTaskLivingEntity.getTask_id() || "".equals(integrationTaskLivingEntity.getTask_id())) {
|
||||
return BaseResult.getFailureMessageEntity("补推的时候请携带需要补推任务的id");
|
||||
}
|
||||
//补推返回结果不成功的
|
||||
if ("失败".equals(integrationTaskLivingEntity.getResult())) {
|
||||
//调用触发器 触发器中更新实例数据 新增日志数据
|
||||
//IntegrationTaskLivingJobUnit.createJob(getJob(jsonObject));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装需要传递到定时任务中的参数
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
private JSONObject getJob(JSONObject jsonObject) {
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("task_name", jsonObject.getString("task_name"));
|
||||
jsonObjectMap.put("task_code", jsonObject.getString("task_code"));
|
||||
jsonObjectMap.put("sence_id", jsonObject.getString("sence_id"));
|
||||
jsonObjectMap.put("task_cron", jsonObject.getString("task_cron"));
|
||||
jsonObjectMap.put("task_id", jsonObject.getString("task_id"));
|
||||
jsonObjectMap.put("create_user_id", jsonObject.getString("create_user_id"));
|
||||
jsonObjectMap.put("modify_user_id", jsonObject.getString("modify_user_id"));
|
||||
jsonObjectMap.put("id", jsonObject.getString("id"));
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实例id修改实例数据
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateIntegrationTaskLiving(JSONObject jsonObject) {
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = jsonObject.toJavaObject(IntegrationTaskLivingEntity.class);
|
||||
//更新实例数据
|
||||
integrationtasklivingDao.update("entity_update", integrationTaskLivingEntity);
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setTask_linving_id(integrationTaskLivingEntity.getId());
|
||||
integrationTaskLivingDetailsEntity.setResult(integrationTaskLivingEntity.getResult());
|
||||
integrationTaskLivingDetailsEntity.setModify_user_id(integrationTaskLivingEntity.getModify_user_id());
|
||||
//更新实例明细数据
|
||||
integrationTaskLivingDetailsDao.update("entity_update", integrationTaskLivingDetailsEntity);
|
||||
return BaseResult.getSuccessMessageEntity("任务实例修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单个实例
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryTaskLivingOne(JSONObject jsonObject) {
|
||||
try {
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = getData("jsonStr", jsonObject, IntegrationTaskLivingEntity.class);
|
||||
if(null==integrationTaskLivingEntity.getId()||"".equals(integrationTaskLivingEntity.getId())){
|
||||
return BaseResult.getFailureMessageEntity("查看单个时请携带id");
|
||||
}
|
||||
List<IntegrationTaskLivingEntity> integrationTaskLivingEntities = integrationtasklivingDao.queryByLike(integrationTaskLivingEntity);
|
||||
if(integrationTaskLivingEntities.size()==0){
|
||||
return BaseResult.getFailureMessageEntity("查看单个实例为null");
|
||||
}
|
||||
IntegrationTaskLivingEntity integrationTaskLiving = integrationTaskLivingEntities.get(0);
|
||||
if(null==integrationTaskLiving){
|
||||
return BaseResult.getSuccessMessageEntity("查询成功",integrationTaskLiving);
|
||||
}
|
||||
//查询明细数据
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity=new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setTask_linving_id(integrationTaskLiving.getId());
|
||||
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = integrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity);
|
||||
JSONObject jsonObjectMap=new JSONObject();
|
||||
jsonObjectMap.put("main",integrationTaskLiving);
|
||||
List<IntegrationTaskLivingDetailsEntity> list=new ArrayList<>();
|
||||
if(integrationTaskLivingDetailsEntities.size()>0){
|
||||
for (IntegrationTaskLivingDetailsEntity taskLivingDetailsEntity : integrationTaskLivingDetailsEntities) {
|
||||
list.add(taskLivingDetailsEntity);
|
||||
}
|
||||
}
|
||||
jsonObjectMap.put("details",list);
|
||||
return BaseResult.getSuccessMessageEntity("查询单个成功",jsonObjectMap);
|
||||
}catch (Exception e){
|
||||
logger.info("查询单个失败:"+e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("查询单个失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选明细数据为正常与删除
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryTaskLivingDetails(JSONObject jsonObject) {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity=new IntegrationTaskLivingDetailsEntity();
|
||||
List<IntegrationTaskLivingDetailsEntity> list=null;
|
||||
String jsonStr = jsonObject.getString("jsonStr");
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonStr);
|
||||
//判断刷选条件是正常还是删除
|
||||
String type = jsonObjectStr.getString("type");
|
||||
integrationTaskLivingDetailsEntity.setTask_linving_id(jsonObjectStr.getString("task_linving_id"));
|
||||
switch (type){
|
||||
//正常
|
||||
case "1":
|
||||
integrationTaskLivingDetailsEntity.setSts("Y");
|
||||
list = integrationTaskLivingDetailsDao.queryList(integrationTaskLivingDetailsEntity, "IntegrationTaskLivingDetailsEntity_list_sts");
|
||||
break;
|
||||
//删除
|
||||
case "2":
|
||||
integrationTaskLivingDetailsEntity.setSts("N");
|
||||
list = integrationTaskLivingDetailsDao.queryList(integrationTaskLivingDetailsEntity, "IntegrationTaskLivingDetailsEntity_list_sts");
|
||||
break;
|
||||
//全部
|
||||
case "3":
|
||||
list = integrationTaskLivingDetailsDao.queryList(integrationTaskLivingDetailsEntity, "IntegrationTaskLivingDetailsEntity_list_sts");
|
||||
break;
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("查询成功",list);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志 dao
|
||||
* @tableName: integration_task_log
|
||||
* @entityName: IntegrationTaskLogEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLogDao extends IBaseDao<IntegrationTaskLogEntity, String> {
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志详情 dao
|
||||
* @tableName: integration_task_log_details
|
||||
* @entityName: IntegrationTaskLogDetailEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLogDetailDao extends IBaseDao<IntegrationTaskLogDetailEntity, String> {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.log.dao.IIntegrationTaskLogDao;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志 dao
|
||||
* @tableName: integration_task_log
|
||||
* @entityName: IntegrationTaskLogEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_logdao")
|
||||
public class IntegrationTaskLogDaoImpl extends MybatisGenericDao<IntegrationTaskLogEntity, String> implements IIntegrationTaskLogDao {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.log.dao.IIntegrationTaskLogDetailDao;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志详情 dao
|
||||
* @tableName: integration_task_log_details
|
||||
* @entityName: IntegrationTaskLogDetailEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_log_detailsdao")
|
||||
public class IntegrationTaskLogDetailDaoImpl extends MybatisGenericDao<IntegrationTaskLogDetailEntity, String> implements IIntegrationTaskLogDetailDao {
|
||||
|
||||
}
|
|
@ -1,247 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志详情 entity
|
||||
* @tableName: integration_task_log_details
|
||||
* @entityName: IntegrationTaskLogDetailEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskLogDetailEntity extends BaseEntity {
|
||||
|
||||
/** 集成任务-实例_id */
|
||||
private String task_linving_id;
|
||||
/** 返回结果 */
|
||||
private String result;
|
||||
/** 原始查询条件 */
|
||||
private String query_condition;
|
||||
/** 源系统主键 */
|
||||
private String root_app_pk;
|
||||
/** 原系统单据 */
|
||||
private String root_app_bill;
|
||||
/** 最新源系统数据详情 */
|
||||
private String root_app_new_data;
|
||||
/** 最新传输信息 */
|
||||
private String new_transmit_info;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date new_push_date;
|
||||
/** 是否补推(Y是N不是) */
|
||||
private String repair_pust;
|
||||
|
||||
private Integer sorts;
|
||||
|
||||
/*源系统编码*/
|
||||
private String root_app_code;
|
||||
/*业务日期*/
|
||||
private String business_time;
|
||||
/*最新推送状态*/
|
||||
private String new_push_state;
|
||||
/*处理人*/
|
||||
private String processor;
|
||||
/*处理时间*/
|
||||
private String processor_time;
|
||||
/*处理备注*/
|
||||
private String processor_remark;
|
||||
/*最新元数据*/
|
||||
private String new_metadata;
|
||||
/*任务名称*/
|
||||
private String task_name;
|
||||
/*任务编码*/
|
||||
private String task_code;
|
||||
/*任务类型*/
|
||||
private String task_type;
|
||||
/*说明*/
|
||||
private String instructions;
|
||||
|
||||
public String getInstructions() {
|
||||
return instructions;
|
||||
}
|
||||
|
||||
public void setInstructions(String instructions) {
|
||||
this.instructions = instructions;
|
||||
}
|
||||
|
||||
public String getTask_name() {
|
||||
return task_name;
|
||||
}
|
||||
|
||||
public void setTask_name(String task_name) {
|
||||
this.task_name = task_name;
|
||||
}
|
||||
|
||||
public String getTask_code() {
|
||||
return task_code;
|
||||
}
|
||||
|
||||
public void setTask_code(String task_code) {
|
||||
this.task_code = task_code;
|
||||
}
|
||||
|
||||
public String getTask_type() {
|
||||
return task_type;
|
||||
}
|
||||
|
||||
public void setTask_type(String task_type) {
|
||||
this.task_type = task_type;
|
||||
}
|
||||
|
||||
public String getRoot_app_code() {
|
||||
return root_app_code;
|
||||
}
|
||||
|
||||
public void setRoot_app_code(String root_app_code) {
|
||||
this.root_app_code = root_app_code;
|
||||
}
|
||||
|
||||
public String getBusiness_time() {
|
||||
return business_time;
|
||||
}
|
||||
|
||||
public void setBusiness_time(String business_time) {
|
||||
this.business_time = business_time;
|
||||
}
|
||||
|
||||
public String getNew_push_state() {
|
||||
return new_push_state;
|
||||
}
|
||||
|
||||
public void setNew_push_state(String new_push_state) {
|
||||
this.new_push_state = new_push_state;
|
||||
}
|
||||
|
||||
public String getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(String processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public String getProcessor_time() {
|
||||
return processor_time;
|
||||
}
|
||||
|
||||
public void setProcessor_time(String processor_time) {
|
||||
this.processor_time = processor_time;
|
||||
}
|
||||
|
||||
public String getProcessor_remark() {
|
||||
return processor_remark;
|
||||
}
|
||||
|
||||
public void setProcessor_remark(String processor_remark) {
|
||||
this.processor_remark = processor_remark;
|
||||
}
|
||||
|
||||
public String getNew_metadata() {
|
||||
return new_metadata;
|
||||
}
|
||||
|
||||
public void setNew_metadata(String new_metadata) {
|
||||
this.new_metadata = new_metadata;
|
||||
}
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
|
||||
/** 集成任务-实例_id */
|
||||
public void setTask_linving_id(String task_linving_id) {
|
||||
this.task_linving_id = task_linving_id;
|
||||
}
|
||||
/** 集成任务-实例_id */
|
||||
public String getTask_linving_id() {
|
||||
return task_linving_id;
|
||||
}
|
||||
|
||||
|
||||
/** 返回结果 */
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
/** 返回结果 */
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/** 原始查询条件 */
|
||||
public void setQuery_condition(String query_condition) {
|
||||
this.query_condition = query_condition;
|
||||
}
|
||||
/** 原始查询条件 */
|
||||
public String getQuery_condition() {
|
||||
return query_condition;
|
||||
}
|
||||
|
||||
|
||||
/** 源系统主键 */
|
||||
public void setRoot_app_pk(String root_app_pk) {
|
||||
this.root_app_pk = root_app_pk;
|
||||
}
|
||||
/** 源系统主键 */
|
||||
public String getRoot_app_pk() {
|
||||
return root_app_pk;
|
||||
}
|
||||
|
||||
|
||||
/** 原系统单据 */
|
||||
public void setRoot_app_bill(String root_app_bill) {
|
||||
this.root_app_bill = root_app_bill;
|
||||
}
|
||||
/** 原系统单据 */
|
||||
public String getRoot_app_bill() {
|
||||
return root_app_bill;
|
||||
}
|
||||
|
||||
|
||||
/** 最新源系统数据详情 */
|
||||
public void setRoot_app_new_data(String root_app_new_data) {
|
||||
this.root_app_new_data = root_app_new_data;
|
||||
}
|
||||
/** 最新源系统数据详情 */
|
||||
public String getRoot_app_new_data() {
|
||||
return root_app_new_data;
|
||||
}
|
||||
|
||||
|
||||
/** 最新传输信息 */
|
||||
public void setNew_transmit_info(String new_transmit_info) {
|
||||
this.new_transmit_info = new_transmit_info;
|
||||
}
|
||||
/** 最新传输信息 */
|
||||
public String getNew_transmit_info() {
|
||||
return new_transmit_info;
|
||||
}
|
||||
|
||||
|
||||
/** 最新推送时间 */
|
||||
public void setNew_push_date(Date new_push_date) {
|
||||
this.new_push_date = new_push_date;
|
||||
}
|
||||
/** 最新推送时间 */
|
||||
public Date getNew_push_date() {
|
||||
return new_push_date;
|
||||
}
|
||||
|
||||
|
||||
/** 是否补推(Y是N不是) */
|
||||
public void setRepair_pust(String repair_pust) {
|
||||
this.repair_pust = repair_pust;
|
||||
}
|
||||
/** 是否补推(Y是N不是) */
|
||||
public String getRepair_pust() {
|
||||
return repair_pust;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,411 +0,0 @@
|
|||
<?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.sys.integrationtask.log.dao.impl.IntegrationTaskLogDetailDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskLogDetailEntity-result" type="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--集成任务-实例_id -->
|
||||
<result property="task_linving_id" column="task_linving_id" />
|
||||
<!--返回结果 -->
|
||||
<result property="result" column="result" />
|
||||
<!--原始查询条件 -->
|
||||
<result property="query_condition" column="query_condition" />
|
||||
<!--源系统主键 -->
|
||||
<result property="root_app_pk" column="root_app_pk" />
|
||||
<!--原系统单据 -->
|
||||
<result property="root_app_bill" column="root_app_bill" />
|
||||
<!--最新源系统数据详情 -->
|
||||
<result property="root_app_new_data" column="root_app_new_data" />
|
||||
<!--最新传输信息 -->
|
||||
<result property="new_transmit_info" column="new_transmit_info" />
|
||||
<!--最新推送时间 -->
|
||||
<result property="new_push_date" column="new_push_date" />
|
||||
<!--是否补推(Y是N不是) -->
|
||||
<result property="repair_pust" column="repair_pust" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!--源系统编码 -->
|
||||
<result property="root_app_code" column="root_app_code" />
|
||||
<!--业务日期 -->
|
||||
<result property="business_time" column="business_time" />
|
||||
<!--最新推送状态 -->
|
||||
<result property="new_push_state" column="new_push_state" />
|
||||
<!--处理人 -->
|
||||
<result property="processor" column="processor" />
|
||||
<!--处理日期 -->
|
||||
<result property="processor_time" column="processor_time" />
|
||||
<!--处理备注 -->
|
||||
<result property="processor_remark" column="processor_remark" />
|
||||
<!--最新元数据 -->
|
||||
<result property="new_metadata" column="new_metadata" />
|
||||
<!--类型 -->
|
||||
<result property="task_type" column="task_type" />
|
||||
<!--任务编码 -->
|
||||
<result property="task_code" column="task_code" />
|
||||
<!--任务名称 -->
|
||||
<result property="task_name" column="task_name" />
|
||||
<!--说明 -->
|
||||
<result property="instructions" column="instructions" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskLogDetailEntity_Base_Column_List">
|
||||
id,
|
||||
task_linving_id,
|
||||
result,
|
||||
query_condition,
|
||||
root_app_pk,
|
||||
root_app_bill,
|
||||
root_app_new_data,
|
||||
new_transmit_info,
|
||||
new_push_date,
|
||||
repair_pust,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
root_app_code,
|
||||
business_time,
|
||||
new_push_state,
|
||||
processor,
|
||||
processor_time,
|
||||
processor_remark,
|
||||
new_metadata
|
||||
</sql>
|
||||
|
||||
<sql id="IntegrationTaskLogDetailEntity_Base_Column_List_Task">
|
||||
task.id as task_id,
|
||||
log.id as log_id,
|
||||
details.id as id,
|
||||
task.task_code as task_code,
|
||||
task.task_name as task_name,
|
||||
log.task_type as task_type,
|
||||
details.result as result,
|
||||
log.instructions,
|
||||
details.query_condition as query_condition,
|
||||
details.root_app_pk as root_app_pk,
|
||||
details.root_app_bill as root_app_bill,
|
||||
details.root_app_new_data as root_app_new_data,
|
||||
details.new_transmit_info as new_transmit_info,
|
||||
details.new_push_date,
|
||||
details.root_app_code,
|
||||
details.business_time,
|
||||
details.new_push_state as new_push_state,
|
||||
details.processor ,
|
||||
details.processor_time ,
|
||||
details.processor_remark ,
|
||||
details.new_metadata ,
|
||||
details.repair_pust ,
|
||||
details.create_time,
|
||||
details.modify_time,
|
||||
details.sts
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLogDetailEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLogDetailEntity_Base_Column_List" />
|
||||
from integration_task_log_details where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!--通过sts获取正常与失败数据 -->
|
||||
<!--<select id="IntegrationTaskLogDetailEntity_list_sts" resultMap="get-IntegrationTaskLogDetailEntity-result">
|
||||
select
|
||||
ld.*
|
||||
from
|
||||
integration_task_log_details ld
|
||||
left join integration_task_log log on log.id=ld.task_linving_id
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="sts != null and sts !='' "> and ld.sts = #{sts}</if>
|
||||
and log.id= #{task_linving_id}
|
||||
</trim>
|
||||
</select>-->
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLogDetailEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogDetailEntity_Base_Column_List" />
|
||||
from integration_task_log_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_linving_id != null and task_linving_id !=''"> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition = #{query_condition}</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk = #{root_app_pk}</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill = #{root_app_bill}</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data = #{root_app_new_data}</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info = #{new_transmit_info}</if>
|
||||
<if test="new_push_date != null "> and new_push_date = #{new_push_date}</if>
|
||||
<if test="root_app_code != null and root_app_code !='' "> and root_app_code = #{root_app_code}</if>
|
||||
<if test="business_time != null and business_time !=''"> and business_time = #{business_time}</if>
|
||||
<if test="new_push_state != null and new_push_state !=''"> and new_push_state = #{new_push_state}</if>
|
||||
<if test="processor != null and processor !=''"> and processor = #{processor}</if>
|
||||
<if test="processor_time != null and processor_time !=''"> and processor_time = #{processor_time}</if>
|
||||
<if test="processor_remark != null and processor_remark !=''"> and processor_remark = #{processor_remark}</if>
|
||||
<if test="new_metadata != null and new_metadata !=''"> and new_metadata = #{new_metadata}</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust = #{repair_pust}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
-- and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
select count(1) from integration_task_log_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> and task_linving_id = #{task_linving_id} </if>
|
||||
<if test="result != null and result !='' "> and result = #{result} </if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition = #{query_condition} </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk = #{root_app_pk} </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill = #{root_app_bill} </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data = #{root_app_new_data} </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info = #{new_transmit_info} </if>
|
||||
<if test="new_push_date != null "> and new_push_date = #{new_push_date} </if>
|
||||
<if test="root_app_code != null and root_app_code !='' "> and root_app_code = #{root_app_code}</if>
|
||||
<if test="business_time != null and business_time !=''"> and business_time = #{business_time}</if>
|
||||
<if test="new_push_state != null and new_push_state !=''"> and new_push_state = #{new_push_state}</if>
|
||||
<if test="processor != null and processor !=''"> and processor = #{processor}</if>
|
||||
<if test="processor_time != null and processor_time !=''"> and processor_time = #{processor_time}</if>
|
||||
<if test="processor_remark != null and processor_remark !=''"> and processor_remark = #{processor_remark}</if>
|
||||
<if test="new_metadata != null and new_metadata !=''"> and new_metadata = #{new_metadata}</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust = #{repair_pust} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--<!– 分页查询列表 采用like格式 –>
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLogDetailEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogDetailEntity_Base_Column_List" />
|
||||
from integration_task_log_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result like concat('%',#{result},'%') </if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition like concat('%',#{query_condition},'%') </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk like concat('%',#{root_app_pk},'%') </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill like concat('%',#{root_app_bill},'%') </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data like concat('%',#{root_app_new_data},'%') </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info like concat('%',#{new_transmit_info},'%') </if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> and new_push_date like concat('%',#{new_push_date},'%') </if>
|
||||
<if test="root_app_code != null and root_app_code !='' "> and root_app_code like concat('%',#{root_app_code},'%')</if>
|
||||
<if test="business_time != null and business_time !=''"> and business_time like concat('%',#{business_time},'%')</if>
|
||||
<if test="new_push_state != null and new_push_state !=''"> and new_push_state like concat('%',#{new_push_state},'%')</if>
|
||||
<if test="processor != null and processor !=''"> and processor like concat('%',#{processor},'%')</if>
|
||||
<if test="processor_time != null and processor_time !=''"> and processor_time like concat('%',#{processor_time},'%')</if>
|
||||
<if test="processor_remark != null and processor_remark !=''"> and processor_remark like concat('%',#{processor_remark},'%')</if>
|
||||
<if test="new_metadata != null and new_metadata !=''"> and new_metadata like concat('%',#{new_metadata},'%')</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust like concat('%',#{repair_pust},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>-->
|
||||
|
||||
<!--分页连表查询-->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLogDetailEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogDetailEntity_Base_Column_List_Task" />
|
||||
from integration_task_log_details details
|
||||
left join integration_task_log log on log.id=details.task_linving_id
|
||||
left join integration_task task on task.id=log.task_id
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="task_name != null and task_name !='' "> and task.task_name like concat('%',#{task_name},'%') </if>
|
||||
<if test="id != null and id !='' "> and details.id = #{id} </if>
|
||||
<if test="result != null and result !='' "> and details.result = #{result} </if>
|
||||
and details.sts='Y'
|
||||
</trim>
|
||||
order by details.create_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskLogDetailEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogDetailEntity_Base_Column_List" />
|
||||
from integration_task_log_details
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_linving_id != null "> or task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> or result = #{result} </if>
|
||||
<if test="query_condition != null and query_condition !='' "> or query_condition = #{query_condition} </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> or root_app_pk = #{root_app_pk} </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> or root_app_bill = #{root_app_bill} </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> or root_app_new_data = #{root_app_new_data} </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> or new_transmit_info = #{new_transmit_info} </if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> or new_push_date = #{new_push_date} </if>
|
||||
<if test="root_app_code != null and root_app_code !='' "> or root_app_code = #{root_app_code}</if>
|
||||
<if test="business_time != null and business_time !=''"> or business_time = #{business_time}</if>
|
||||
<if test="new_push_state != null and new_push_state !=''"> or new_push_state = #{new_push_state}</if>
|
||||
<if test="processor != null and processor !=''"> or processor = #{processor}</if>
|
||||
<if test="processor_time != null and processor_time !=''"> or processor_time = #{processor_time}</if>
|
||||
<if test="processor_remark != null and processor_remark !=''"> or processor_remark = #{processor_remark}</if>
|
||||
<if test="new_metadata != null and new_metadata !=''"> or new_metadata = #{new_metadata}</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> or repair_pust = #{repair_pust} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
insert into integration_task_log_details(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' ">id,</if>
|
||||
<if test="task_linving_id != null and task_linving_id !='' ">task_linving_id,</if>
|
||||
<if test="result != null and result !='' "> result, </if>
|
||||
<if test="query_condition != null and query_condition !='' "> query_condition, </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> root_app_pk, </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> root_app_bill, </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> root_app_new_data, </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> new_transmit_info, </if>
|
||||
<if test="new_push_date != null ">new_push_date,</if>
|
||||
<if test="root_app_code != null and root_app_code !='' ">root_app_code,</if>
|
||||
<if test="business_time != null ">business_time,</if>
|
||||
<if test="new_push_state != null and new_push_state !=''">new_push_state,</if>
|
||||
<if test="processor != null and processor !=''">processor,</if>
|
||||
<if test="processor_time != null">processor_time,</if>
|
||||
<if test="processor_remark != null and processor_remark !=''">processor_remark,</if>
|
||||
<if test="new_metadata != null and new_metadata !=''">new_metadata,</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> repair_pust, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !='' ">#{id},</if>
|
||||
<if test="task_linving_id != null and task_linving_id !=''">#{task_linving_id},</if>
|
||||
<if test="result != null and result !='' "> #{result}, </if>
|
||||
<if test="query_condition != null and query_condition !='' "> #{query_condition}, </if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> #{root_app_pk}, </if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> #{root_app_bill}, </if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> #{root_app_new_data}, </if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> #{new_transmit_info}, </if>
|
||||
<if test="new_push_date != null ">#{new_push_date},</if>
|
||||
<if test="root_app_code != null and root_app_code !='' "> #{root_app_code},</if>
|
||||
<if test="business_time != null ">#{business_time},</if>
|
||||
<if test="new_push_state != null and new_push_state !=''">#{new_push_state},</if>
|
||||
<if test="processor != null and processor !=''">#{processor},</if>
|
||||
<if test="processor_time != null ">#{processor_time},</if>
|
||||
<if test="processor_remark != null and processor_remark !=''">#{processor_remark},</if>
|
||||
<if test="new_metadata != null and new_metadata !=''">#{new_metadata},</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> #{repair_pust}, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_log_details a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now() ,</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
update integration_task_log_details set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="task_linving_id != null ">task_linving_id = #{task_linving_id},</if>
|
||||
<if test="result != null and result !='' "> result = #{result},</if>
|
||||
<if test="query_condition != null and query_condition !='' "> query_condition = #{query_condition},</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> root_app_pk = #{root_app_pk},</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> root_app_bill = #{root_app_bill},</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> root_app_new_data = #{root_app_new_data},</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> new_transmit_info = #{new_transmit_info},</if>
|
||||
<if test="new_push_date != null ">new_push_date = #{new_push_date},</if>
|
||||
<if test="root_app_code != null and root_app_code !='' ">root_app_code = #{root_app_code},</if>
|
||||
<if test="business_time != null ">business_time = #{business_time},</if>
|
||||
<if test="new_push_state != null and new_push_state !=''">new_push_state = #{new_push_state},</if>
|
||||
<if test="processor != null and processor !=''">processor = #{processor},</if>
|
||||
<if test="processor_time != null ">processor_time = #{processor_time},</if>
|
||||
<if test="processor_remark != null and processor_remark !=''">processor_remark = #{processor_remark},</if>
|
||||
<if test="new_metadata != null and new_metadata !=''">new_metadata = #{new_metadata},</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> repair_pust = #{repair_pust},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
update integration_task_log_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
update integration_task_log_details set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_linving_id != null and task_linving_id !=''"> and task_linving_id = #{task_linving_id}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="query_condition != null and query_condition !='' "> and query_condition = #{query_condition}</if>
|
||||
<if test="root_app_pk != null and root_app_pk !='' "> and root_app_pk = #{root_app_pk}</if>
|
||||
<if test="root_app_bill != null and root_app_bill !='' "> and root_app_bill = #{root_app_bill}</if>
|
||||
<if test="root_app_new_data != null and root_app_new_data !='' "> and root_app_new_data = #{root_app_new_data}</if>
|
||||
<if test="new_transmit_info != null and new_transmit_info !='' "> and new_transmit_info = #{new_transmit_info}</if>
|
||||
<if test="new_push_date != null and new_push_date !='' "> and new_push_date = #{new_push_date}</if>
|
||||
<if test="root_app_code != null and root_app_code !='' "> and root_app_code = #{root_app_code}</if>
|
||||
<if test="business_time != null "> and business_time = #{business_time}</if>
|
||||
<if test="new_push_state != null and new_push_state !=''"> and new_push_state = #{new_push_state}</if>
|
||||
<if test="processor != null and processor !=''"> and processor = #{processor}</if>
|
||||
<if test="processor_time != null "> and processor_time = #{processor_time}</if>
|
||||
<if test="processor_remark != null and processor_remark !=''"> and processor_remark = #{processor_remark}</if>
|
||||
<if test="new_metadata != null and new_metadata !=''"> and new_metadata = #{new_metadata}</if>
|
||||
<if test="repair_pust != null and repair_pust !='' "> and repair_pust = #{repair_pust}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity">
|
||||
delete from integration_task_log_details where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,167 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志 entity
|
||||
* @tableName: integration_task_log
|
||||
* @entityName: IntegrationTaskLogEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskLogEntity extends BaseEntity {
|
||||
|
||||
/** integration_task_id */
|
||||
private String task_id;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date start_time;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date end_time;
|
||||
/** 耗时 */
|
||||
private String diff_time;
|
||||
/** 返回结果 */
|
||||
private String result;
|
||||
/** 服务器名称 */
|
||||
private String server_name;
|
||||
/** 服务实例名称 */
|
||||
private String server_living;
|
||||
/** 说明
|
||||
*/
|
||||
private String instructions;
|
||||
|
||||
private Integer sorts;
|
||||
private String id;
|
||||
|
||||
private String task_code;
|
||||
private String task_name;
|
||||
private String task_type;
|
||||
|
||||
public String getTask_type() {
|
||||
return task_type;
|
||||
}
|
||||
|
||||
public void setTask_type(String task_type) {
|
||||
this.task_type = task_type;
|
||||
}
|
||||
|
||||
public String getTask_code() {
|
||||
return task_code;
|
||||
}
|
||||
|
||||
public void setTask_code(String task_code) {
|
||||
this.task_code = task_code;
|
||||
}
|
||||
|
||||
public String getTask_name() {
|
||||
return task_name;
|
||||
}
|
||||
|
||||
public void setTask_name(String task_name) {
|
||||
this.task_name = task_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
/** integration_task_id */
|
||||
public void setTask_id(String task_id) {
|
||||
this.task_id = task_id;
|
||||
}
|
||||
/** integration_task_id */
|
||||
public String getTask_id() {
|
||||
return task_id;
|
||||
}
|
||||
|
||||
|
||||
/** 开始时间 */
|
||||
public void setStart_time(Date start_time) {
|
||||
this.start_time = start_time;
|
||||
}
|
||||
/** 开始时间 */
|
||||
public Date getStart_time() {
|
||||
return start_time;
|
||||
}
|
||||
|
||||
|
||||
/** 结束时间 */
|
||||
public void setEnd_time(Date end_time) {
|
||||
this.end_time = end_time;
|
||||
}
|
||||
/** 结束时间 */
|
||||
public Date getEnd_time() {
|
||||
return end_time;
|
||||
}
|
||||
|
||||
|
||||
/** 耗时 */
|
||||
public void setDiff_time(String diff_time) {
|
||||
this.diff_time = diff_time;
|
||||
}
|
||||
/** 耗时 */
|
||||
public String getDiff_time() {
|
||||
return diff_time;
|
||||
}
|
||||
|
||||
|
||||
/** 返回结果 */
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
/** 返回结果 */
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/** 服务器名称 */
|
||||
public void setServer_name(String server_name) {
|
||||
this.server_name = server_name;
|
||||
}
|
||||
/** 服务器名称 */
|
||||
public String getServer_name() {
|
||||
return server_name;
|
||||
}
|
||||
|
||||
|
||||
/** 服务实例名称 */
|
||||
public void setServer_living(String server_living) {
|
||||
this.server_living = server_living;
|
||||
}
|
||||
/** 服务实例名称 */
|
||||
public String getServer_living() {
|
||||
return server_living;
|
||||
}
|
||||
|
||||
|
||||
/** 说明
|
||||
*/
|
||||
public void setInstructions(String instructions) {
|
||||
this.instructions = instructions;
|
||||
}
|
||||
/** 说明
|
||||
*/
|
||||
public String getInstructions() {
|
||||
return instructions;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,309 +0,0 @@
|
|||
<?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.sys.integrationtask.log.dao.impl.IntegrationTaskLogDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskLogEntity-result" type="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--integration_task_id -->
|
||||
<result property="task_id" column="task_id" />
|
||||
<!--开始时间 -->
|
||||
<result property="start_time" column="start_time" />
|
||||
<!--结束时间 -->
|
||||
<result property="end_time" column="end_time" />
|
||||
<!--耗时 -->
|
||||
<result property="diff_time" column="diff_time" />
|
||||
<!--返回结果 -->
|
||||
<result property="result" column="result" />
|
||||
<!--服务器名称 -->
|
||||
<result property="server_name" column="server_name" />
|
||||
<!--服务实例名称 -->
|
||||
<result property="server_living" column="server_living" />
|
||||
<!--说明
|
||||
-->
|
||||
<result property="instructions" column="instructions" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!--任务编码 -->
|
||||
<result property="task_code" column="task_code" />
|
||||
<!--任务名称 -->
|
||||
<result property="task_name" column="task_name" />
|
||||
<!--任务类型 -->
|
||||
<result property="task_type" column="task_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskLogEntity_Base_Column_List">
|
||||
id,
|
||||
task_id,
|
||||
start_time,
|
||||
end_time,
|
||||
diff_time,
|
||||
result,
|
||||
task_type,
|
||||
server_name,
|
||||
server_living,
|
||||
instructions,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts
|
||||
</sql>
|
||||
|
||||
<sql id="IntegrationTaskLogEntity_Base_Column_List_Task">
|
||||
task.id as task_id,
|
||||
log.id as id,
|
||||
task.task_code as task_code,
|
||||
task.task_name as task_name,
|
||||
log.task_type as task_type,
|
||||
log.start_time as start_time,
|
||||
log.end_time as end_time,
|
||||
log.diff_time as diff_time,
|
||||
log.result as result,
|
||||
log.server_name as server_name,
|
||||
log.server_living as server_living,
|
||||
log.instructions,
|
||||
log.sts,
|
||||
log.sorts
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLogEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List_Task" />
|
||||
from integration_task_log where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!--通过任务ID获取数据 -->
|
||||
<select id="IntegrationTaskLogEntity_getByTaskId" resultMap="get-IntegrationTaskLogEntity-result">
|
||||
select id from integration_task_log where task_id = #{task_id}
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLogEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List" />
|
||||
from integration_task_log
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id}</if>
|
||||
<if test="start_time != null "> and start_time = #{start_time}</if>
|
||||
<if test="end_time != null "> and end_time = #{end_time}</if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time = #{diff_time}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="task_type != null and task_type !='' "> and task_type = #{task_type}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living = #{server_living}</if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions = #{instructions}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
select count(1) from integration_task_log
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id} </if>
|
||||
<if test="start_time != null "> and start_time = #{start_time} </if>
|
||||
<if test="end_time != null "> and end_time = #{end_time} </if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time = #{diff_time} </if>
|
||||
<if test="result != null and result !='' "> and result = #{result} </if>
|
||||
<if test="task_type != null and task_type !='' "> and task_type = #{task_type} </if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name} </if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living = #{server_living} </if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions = #{instructions} </if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<!--<select id="IntegrationTaskLogEntity_list_like" resultMap="get-IntegrationTaskLogEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List" />
|
||||
from integration_task_log
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id}</if>
|
||||
<if test="start_time != null and start_time !='' "> and start_time like concat('%',#{start_time},'%') </if>
|
||||
<if test="end_time != null and end_time !='' "> and end_time like concat('%',#{end_time},'%') </if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time like concat('%',#{diff_time},'%') </if>
|
||||
<if test="result != null and result !='' "> and result like concat('%',#{result},'%') </if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name like concat('%',#{server_name},'%') </if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living like concat('%',#{server_living},'%') </if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions like concat('%',#{instructions},'%') </if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>-->
|
||||
|
||||
<!--分页连表查询-->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskLogEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List_Task" />
|
||||
from integration_task task
|
||||
left join integration_task_log log on task.id=log.task_id
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="task_name != null and task_name !='' "> and task.task_name like concat('%',#{task_name},'%') </if>
|
||||
<if test="id != null and id !='' "> and log.id = #{id} </if>
|
||||
and log.sts='Y'
|
||||
</trim>
|
||||
order by log.start_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskLogEntity-result" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLogEntity_Base_Column_List" />
|
||||
from integration_task_log
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> or task_id = #{task_id}</if>
|
||||
<if test="start_time != null and start_time !='' "> or start_time = #{start_time} </if>
|
||||
<if test="end_time != null and end_time !='' "> or end_time = #{end_time} </if>
|
||||
<if test="diff_time != null and diff_time !='' "> or diff_time = #{diff_time} </if>
|
||||
<if test="result != null and result !='' "> or result = #{result} </if>
|
||||
<if test="task_type != null and task_type !='' "> or task_type = #{task_type} </if>
|
||||
<if test="server_name != null and server_name !='' "> or server_name = #{server_name} </if>
|
||||
<if test="server_living != null and server_living !='' "> or server_living = #{server_living} </if>
|
||||
<if test="instructions != null and instructions !='' "> or instructions = #{instructions} </if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
insert into integration_task_log(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">id,</if>
|
||||
<if test="task_id != null and task_id !=''">task_id,</if>
|
||||
<if test="start_time != null ">start_time,</if>
|
||||
<if test="end_time != null ">end_time,</if>
|
||||
<if test="diff_time != null and diff_time !='' "> diff_time, </if>
|
||||
<if test="result != null and result !='' "> result, </if>
|
||||
<if test="task_type != null and task_type !='' "> task_type, </if>
|
||||
<if test="server_name != null and server_name !='' "> server_name, </if>
|
||||
<if test="server_living != null and server_living !='' "> server_living, </if>
|
||||
<if test="instructions != null and instructions !='' "> instructions, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">#{id},</if>
|
||||
<if test="task_id != null and task_id !=''">#{task_id},</if>
|
||||
<if test="start_time != null ">#{start_time},</if>
|
||||
<if test="end_time != null ">#{end_time},</if>
|
||||
<if test="diff_time != null and diff_time !='' "> #{diff_time}, </if>
|
||||
<if test="result != null and result !='' "> #{result}, </if>
|
||||
<if test="task_type != null and task_type !='' "> #{task_type}, </if>
|
||||
<if test="server_name != null and server_name !='' "> #{server_name}, </if>
|
||||
<if test="server_living != null and server_living !='' "> #{server_living}, </if>
|
||||
<if test="instructions != null and instructions !='' "> #{instructions}, </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_log a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now(),</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
update integration_task_log set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="task_id != null ">task_id = #{task_id},</if>
|
||||
<if test="start_time != null ">start_time = #{start_time},</if>
|
||||
<if test="end_time != null ">end_time = #{end_time},</if>
|
||||
<if test="diff_time != null and diff_time !='' "> diff_time = #{diff_time},</if>
|
||||
<if test="result != null and result !='' "> result = #{result},</if>
|
||||
<if test="task_type != null and task_type !='' "> task_type = #{task_type},</if>
|
||||
<if test="server_name != null and server_name !='' "> server_name = #{server_name},</if>
|
||||
<if test="server_living != null and server_living !='' "> server_living = #{server_living},</if>
|
||||
<if test="instructions != null and instructions !='' "> instructions = #{instructions},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
update integration_task_log set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
update integration_task_log set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_id != null and task_id !='' "> and task_id = #{task_id}</if>
|
||||
<if test="start_time != null and start_time !='' "> and start_time = #{start_time}</if>
|
||||
<if test="end_time != null and end_time !='' "> and end_time = #{end_time}</if>
|
||||
<if test="diff_time != null and diff_time !='' "> and diff_time = #{diff_time}</if>
|
||||
<if test="result != null and result !='' "> and result = #{result}</if>
|
||||
<if test="task_type != null and task_type !='' "> and task_type = #{task_type}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="server_living != null and server_living !='' "> and server_living = #{server_living}</if>
|
||||
<if test="instructions != null and instructions !='' "> and instructions = #{instructions}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity">
|
||||
delete from integration_task_log where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志详情 service
|
||||
* @tableName: integration_task_log_details
|
||||
* @entityName: IntegrationTaskLogDetailEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLogDetailService extends IBaseService<IntegrationTaskLogDetailEntity, String> {
|
||||
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志 service
|
||||
* @tableName: integration_task_log
|
||||
* @entityName: IntegrationTaskLogEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskLogService extends IBaseService<IntegrationTaskLogEntity, String> {
|
||||
|
||||
//保存任务日志和任务日志明细
|
||||
JsonResultEntity saveIntegrationTaskLog(JSONObject jsonObject);
|
||||
|
||||
//根据任务id task_id查询任务日志id
|
||||
JsonResultEntity queryIntegrationTaskLog(IntegrationTaskLogEntity integrationTaskLogEntity);
|
||||
|
||||
|
||||
//日志输出成excel表格
|
||||
JsonResultEntity queryTaskLogExcel(JSONObject jsonObject);
|
||||
|
||||
//查询单个日志
|
||||
JsonResultEntity queryTaskLogOne(JSONObject jsonObject);
|
||||
|
||||
//刷选出明细正常与删除数据
|
||||
JsonResultEntity queryTaskLogDetail(JSONObject jsonObject);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
import com.hzya.frame.sys.integrationtask.log.service.IIntegrationTaskLogDetailService;
|
||||
import com.hzya.frame.sys.integrationtask.log.dao.IIntegrationTaskLogDetailDao;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志详情 service
|
||||
* @tableName: integration_task_log_details
|
||||
* @entityName: IntegrationTaskLogDetailEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integration_task_log_detailsService")
|
||||
public class IntegrationTaskLogDetailServiceImpl extends BaseService<IntegrationTaskLogDetailEntity, String> implements IIntegrationTaskLogDetailService {
|
||||
|
||||
protected IIntegrationTaskLogDetailDao integrationtasklogdetailDao;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskLogDetailDao(IIntegrationTaskLogDetailDao dao) {
|
||||
this.integrationtasklogdetailDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -1,278 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.log.service.impl;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sys.integrationtask.log.dao.IIntegrationTaskLogDetailDao;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogDetailEntity;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sys.integrationtask.log.entity.IntegrationTaskLogEntity;
|
||||
import com.hzya.frame.sys.integrationtask.log.service.IIntegrationTaskLogService;
|
||||
import com.hzya.frame.sys.integrationtask.log.dao.IIntegrationTaskLogDao;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务日志 service
|
||||
* @tableName: integration_task_log
|
||||
* @entityName: IntegrationTaskLogEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integrationTaskLogService")
|
||||
public class IntegrationTaskLogServiceImpl extends BaseService<IntegrationTaskLogEntity, String> implements IIntegrationTaskLogService {
|
||||
|
||||
protected IIntegrationTaskLogDao integrationtasklogDao;
|
||||
//@Autowired
|
||||
private IIntegrationTaskLogDetailDao integrationTaskLogDetailDao;
|
||||
//@Resource
|
||||
private HttpServletResponse httpServletResponse;
|
||||
|
||||
@Autowired
|
||||
public void setIntegrationTaskLogDao(IIntegrationTaskLogDao dao) {
|
||||
this.integrationtasklogDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单个日志
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryTaskLogOne(JSONObject jsonObject) {
|
||||
try {
|
||||
IntegrationTaskLogEntity integrationTaskLogEntity = getData("jsonStr", jsonObject, IntegrationTaskLogEntity.class);
|
||||
if(null==integrationTaskLogEntity.getId()||"".equals(integrationTaskLogEntity.getId())){
|
||||
return BaseResult.getFailureMessageEntity("查看单个时请携带id");
|
||||
}
|
||||
List<IntegrationTaskLogEntity> integrationTaskLogEntities = integrationtasklogDao.queryByLike(integrationTaskLogEntity);
|
||||
if(integrationTaskLogEntities.size()==0){
|
||||
return BaseResult.getFailureMessageEntity("查看单个为null");
|
||||
}
|
||||
IntegrationTaskLogEntity integrationTaskLog = integrationTaskLogEntities.get(0);
|
||||
//查询明细数据
|
||||
IntegrationTaskLogDetailEntity integrationTaskLogDetailEntity=new IntegrationTaskLogDetailEntity();
|
||||
integrationTaskLogDetailEntity.setTask_linving_id(integrationTaskLog.getId());
|
||||
List<IntegrationTaskLogDetailEntity> integrationTaskLogDetailEntityList = integrationTaskLogDetailDao.query(integrationTaskLogDetailEntity);
|
||||
JSONObject jsonObjectMap=new JSONObject();
|
||||
jsonObjectMap.put("main",integrationTaskLog);
|
||||
List<IntegrationTaskLogDetailEntity> list=new ArrayList<>();
|
||||
if(integrationTaskLogDetailEntityList.size()>0){
|
||||
for (IntegrationTaskLogDetailEntity taskLogDetailEntity : integrationTaskLogDetailEntityList) {
|
||||
list.add(taskLogDetailEntity);
|
||||
}
|
||||
}
|
||||
jsonObjectMap.put("details",list);
|
||||
return BaseResult.getSuccessMessageEntity("查询单个成功",jsonObjectMap);
|
||||
}catch (Exception e){
|
||||
logger.info("查询单个失败:"+e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("查询单个失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷选明细正常与失败数据还有全部数据
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryTaskLogDetail(JSONObject jsonObject) {
|
||||
IntegrationTaskLogDetailEntity integrationTaskLogDetailEntity=new IntegrationTaskLogDetailEntity();
|
||||
List<IntegrationTaskLogDetailEntity> integrationTaskLogDetailEntityList=null;
|
||||
String jsonStr = jsonObject.getString("jsonStr");
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonStr);
|
||||
//判断刷选条件是正常还是删除
|
||||
String type = jsonObjectStr.getString("type");
|
||||
if(null==type||"".equals(type)){
|
||||
type="3";
|
||||
}
|
||||
switch (type){
|
||||
//正常
|
||||
case "1":
|
||||
integrationTaskLogDetailEntity.setResult("执行成功");
|
||||
integrationTaskLogDetailEntityList = integrationTaskLogDetailDao.queryByLike(integrationTaskLogDetailEntity);
|
||||
break;
|
||||
//失败
|
||||
case "2":
|
||||
integrationTaskLogDetailEntity.setResult("执行失败");
|
||||
integrationTaskLogDetailEntityList = integrationTaskLogDetailDao.queryByLike(integrationTaskLogDetailEntity);
|
||||
break;
|
||||
//全部
|
||||
case "3":
|
||||
integrationTaskLogDetailEntityList = integrationTaskLogDetailDao.queryByLike(integrationTaskLogDetailEntity);
|
||||
break;
|
||||
//查看单个
|
||||
case "4":
|
||||
integrationTaskLogDetailEntity.setId(jsonObjectStr.getString("id"));
|
||||
integrationTaskLogDetailEntityList = integrationTaskLogDetailDao.queryByLike(integrationTaskLogDetailEntity);
|
||||
break;
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("查询成功",integrationTaskLogDetailEntityList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存日志和日志明细
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity saveIntegrationTaskLog(JSONObject jsonObject) {
|
||||
IntegrationTaskLogEntity integrationTaskLogEntity = jsonObject.toJavaObject(IntegrationTaskLogEntity.class);
|
||||
String msg=null;
|
||||
String instructions=null;
|
||||
if(null!=jsonObject.getString("instructions")){
|
||||
instructions=jsonObject.getString("instructions");
|
||||
}
|
||||
if("2".equals(jsonObject.getString("plug"))){
|
||||
String info = jsonObject.getString("info");
|
||||
if(null!=info && !"".equals(info)){
|
||||
JSONObject jsonObjectInfo = JSONObject.parseObject(info);
|
||||
msg = jsonObjectInfo.getString("msg");//最新传输信息
|
||||
//获取attribute里面得数据 循环保存明细
|
||||
if("false".equals(jsonObjectInfo.getString("success"))){
|
||||
jsonObject.put("instructions",jsonObjectInfo.getString("message"));
|
||||
jsonObject.put("msg",jsonObjectInfo.getString("message"));
|
||||
saveLog(integrationTaskLogEntity,jsonObject);
|
||||
}
|
||||
if("1".equals(jsonObjectInfo.getString("status"))){
|
||||
jsonObject.put("msg",jsonObjectInfo.getString("headMsg"));
|
||||
saveLog(integrationTaskLogEntity,jsonObject);
|
||||
}
|
||||
}else{
|
||||
jsonObject.put("instructions",instructions);
|
||||
jsonObject.put("msg",msg);
|
||||
saveLog(integrationTaskLogEntity,jsonObject);
|
||||
}
|
||||
}else{
|
||||
jsonObject.put("instructions",instructions);
|
||||
jsonObject.put("msg",msg);
|
||||
saveLog(integrationTaskLogEntity,jsonObject);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("任务日志保存成功",integrationTaskLogEntity);
|
||||
}
|
||||
|
||||
private void saveLog(IntegrationTaskLogEntity integrationTaskLogEntity,JSONObject jsonObject){
|
||||
//日志id
|
||||
long uuid = UUIDLong.longUUID();
|
||||
integrationTaskLogEntity.setId(String.valueOf(uuid));
|
||||
integrationTaskLogEntity.setInstructions(jsonObject.getString("instructions"));
|
||||
integrationtasklogDao.save(integrationTaskLogEntity);
|
||||
//日志明细id
|
||||
long uuidDetails = UUIDLong.longUUID();
|
||||
IntegrationTaskLogDetailEntity integrationTaskLogDetailEntity=new IntegrationTaskLogDetailEntity();
|
||||
integrationTaskLogDetailEntity.setCreate_user_id(jsonObject.getString("create_user_id"));
|
||||
integrationTaskLogDetailEntity.setModify_user_id(jsonObject.getString("modify_user_id"));
|
||||
integrationTaskLogDetailEntity.setId(String.valueOf(uuidDetails));
|
||||
integrationTaskLogDetailEntity.setTask_linving_id(String.valueOf(uuid));
|
||||
integrationTaskLogDetailEntity.setResult(jsonObject.getString("result"));
|
||||
integrationTaskLogDetailEntity.setNew_transmit_info(jsonObject.getString("msg"));
|
||||
integrationTaskLogDetailEntity.setRoot_app_new_data(jsonObject.getString("msg"));
|
||||
integrationTaskLogDetailEntity.setQuery_condition(jsonObject.getString("query_condition"));
|
||||
integrationTaskLogDetailEntity.setNew_push_date(new Date());
|
||||
integrationTaskLogDetailEntity.setRepair_pust("N");
|
||||
integrationTaskLogDetailDao.save(integrationTaskLogDetailEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务id task_id查询任务日志id
|
||||
* @param integrationTaskLogEntity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryIntegrationTaskLog(IntegrationTaskLogEntity integrationTaskLogEntity) {
|
||||
if(null==integrationTaskLogEntity.getTask_id()||"".equals(integrationTaskLogEntity.getId())){
|
||||
return BaseResult.getFailureMessageEntity("请携带任务id");
|
||||
}
|
||||
List<IntegrationTaskLogEntity> integrationTaskLogEntities = integrationtasklogDao.queryList(integrationTaskLogEntity, "IntegrationTaskLogEntity_getByTaskId");
|
||||
for (IntegrationTaskLogEntity taskLogEntity : integrationTaskLogEntities) {
|
||||
IntegrationTaskLogDetailEntity integrationTaskLogDetailEntity=new IntegrationTaskLogDetailEntity();
|
||||
integrationTaskLogDetailEntity.setTask_linving_id(taskLogEntity.getTask_id());
|
||||
integrationTaskLogDetailEntity.setModify_user_id(integrationTaskLogEntity.getModify_user_id());
|
||||
//根据任务日志id修改任务日志明细sts
|
||||
integrationTaskLogDetailDao.update("entity_logicDelete_Multi_Condition",integrationTaskLogDetailEntity);
|
||||
}
|
||||
//根基task_id修改任务日志sts
|
||||
integrationtasklogDao.update("entity_logicDelete_Multi_Condition",integrationTaskLogEntity);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 日志输出成excel
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryTaskLogExcel(JSONObject jsonObject) {
|
||||
try {
|
||||
IntegrationTaskLogEntity integrationTaskLogEntity = getData("jsonStr", jsonObject, IntegrationTaskLogEntity.class);
|
||||
//查询任务与日志的连表查询语句
|
||||
List<IntegrationTaskLogEntity> integrationTaskLogEntities = integrationtasklogDao.queryByLike(integrationTaskLogEntity);
|
||||
if(integrationTaskLogEntities.size()==0){
|
||||
return BaseResult.getFailureMessageEntity("输出的数据为null");
|
||||
}
|
||||
createExcel(integrationTaskLogEntity,integrationTaskLogEntities);
|
||||
return BaseResult.getSuccessMessageEntity("日志输出成功");
|
||||
}catch (Exception e){
|
||||
logger.info("日志输出失败:"+e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("日志输出失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建excel
|
||||
* @param logEntity
|
||||
* @param list
|
||||
* @throws Exception
|
||||
*/
|
||||
private void createExcel(IntegrationTaskLogEntity logEntity, List<IntegrationTaskLogEntity> list) throws Exception{
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter excelWriter= ExcelUtil.getWriter(true);
|
||||
//设置列名称
|
||||
excelWriter.addHeaderAlias("id","日志id");
|
||||
excelWriter.addHeaderAlias("task_name","任务名称");
|
||||
excelWriter.addHeaderAlias("task_code","任务编码");
|
||||
excelWriter.addHeaderAlias("task_tag","任务标识");
|
||||
excelWriter.addHeaderAlias("task_classes","类型");
|
||||
excelWriter.addHeaderAlias("start_time","开始时间");
|
||||
excelWriter.addHeaderAlias("end_time","完成时间");
|
||||
excelWriter.addHeaderAlias("diff_time","耗时");
|
||||
excelWriter.addHeaderAlias("result","结果");
|
||||
excelWriter.addHeaderAlias("server_name","服务器名");
|
||||
excelWriter.addHeaderAlias("server_living","服务器实例");
|
||||
excelWriter.addHeaderAlias("sts","状态");
|
||||
excelWriter.addHeaderAlias("explain","说明");
|
||||
//从第1行开始 第0行为列名称
|
||||
excelWriter.setCurrentRow(0);
|
||||
//导出有别名的表单
|
||||
excelWriter.setOnlyAlias(true);
|
||||
excelWriter.write(list,true);
|
||||
httpServletResponse.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
//设置excel名称
|
||||
String encodeName = URLEncoder.encode(list.get(0).getTask_name(), "UTF-8");
|
||||
httpServletResponse.setHeader("Content-Disposition","attachment;filename="+encodeName+".xlsx");
|
||||
ServletOutputStream out=httpServletResponse.getOutputStream();
|
||||
excelWriter.flush(out, true);
|
||||
// 关闭writer,释放内存
|
||||
excelWriter.close();
|
||||
IoUtil.close(out);
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.monitoring.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务任务监控 dao
|
||||
* @tableName: integration_task_monitoring
|
||||
* @entityName: IntegrationTaskMonitoringEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskMonitoringDao extends IBaseDao<IntegrationTaskMonitoringEntity, String> {
|
||||
Integer updateIntegrationTaskMonitoring(IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity);
|
||||
IntegrationTaskMonitoringEntity queryIntegrationTaskMonitoringEntity_countMax(IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.monitoring.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.dao.IIntegrationTaskMonitoringDao;
|
||||
|
||||
|
||||
/**
|
||||
* @description: 集成任务任务监控 dao
|
||||
* @tableName: integration_task_monitoring
|
||||
* @entityName: IntegrationTaskMonitoringEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
@Repository("integration_task_monitoringdao")
|
||||
public class IntegrationTaskMonitoringDaoImpl extends MybatisGenericDao<IntegrationTaskMonitoringEntity, String> implements IIntegrationTaskMonitoringDao {
|
||||
|
||||
@Override
|
||||
public Integer updateIntegrationTaskMonitoring(IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity) {
|
||||
//修改最大执行次数
|
||||
return super.update("IntegrationTaskMonitoringEntity_updateRunnum",integrationTaskMonitoringEntity);
|
||||
}
|
||||
|
||||
public IntegrationTaskMonitoringEntity queryIntegrationTaskMonitoringEntity_countMax(IntegrationTaskMonitoringEntity entity) {
|
||||
IntegrationTaskMonitoringEntity o = (IntegrationTaskMonitoringEntity) super.selectOne(getSqlIdPrifx() + "IntegrationTaskMonitoringEntity_countMax", entity);
|
||||
return o;
|
||||
}
|
||||
}
|
|
@ -1,139 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.monitoring.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务任务监控 entity
|
||||
* @tableName: integration_task_monitoring
|
||||
* @entityName: IntegrationTaskMonitoringEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class IntegrationTaskMonitoringEntity extends BaseEntity {
|
||||
|
||||
/** integration_task_id */
|
||||
private String task_id;
|
||||
/** 服务器名称 */
|
||||
private String server_name;
|
||||
/** 运行次数 */
|
||||
private Integer run_num;
|
||||
|
||||
private Integer sorts;
|
||||
|
||||
private String task_code;
|
||||
private String task_name;
|
||||
private String task_tag;
|
||||
private String org_name;
|
||||
/*计划时间*/
|
||||
private Date plan_time
|
||||
/*耗时*/;
|
||||
private String diff_time;
|
||||
/*执行与挂起状态*/
|
||||
private String type;
|
||||
private String task_type;
|
||||
|
||||
public String getTask_type() {
|
||||
return task_type;
|
||||
}
|
||||
|
||||
public void setTask_type(String task_type) {
|
||||
this.task_type = task_type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Date getPlan_time() {
|
||||
return plan_time;
|
||||
}
|
||||
|
||||
public void setPlan_time(Date plan_time) {
|
||||
this.plan_time = plan_time;
|
||||
}
|
||||
|
||||
public String getDiff_time() {
|
||||
return diff_time;
|
||||
}
|
||||
|
||||
public void setDiff_time(String diff_time) {
|
||||
this.diff_time = diff_time;
|
||||
}
|
||||
|
||||
public String getTask_code() {
|
||||
return task_code;
|
||||
}
|
||||
|
||||
public void setTask_code(String task_code) {
|
||||
this.task_code = task_code;
|
||||
}
|
||||
|
||||
public String getTask_name() {
|
||||
return task_name;
|
||||
}
|
||||
|
||||
public void setTask_name(String task_name) {
|
||||
this.task_name = task_name;
|
||||
}
|
||||
|
||||
public String getTask_tag() {
|
||||
return task_tag;
|
||||
}
|
||||
|
||||
public void setTask_tag(String task_tag) {
|
||||
this.task_tag = task_tag;
|
||||
}
|
||||
|
||||
public String getOrg_name() {
|
||||
return org_name;
|
||||
}
|
||||
|
||||
public void setOrg_name(String org_name) {
|
||||
this.org_name = org_name;
|
||||
}
|
||||
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
|
||||
/** integration_task_id */
|
||||
public void setTask_id(String task_id) {
|
||||
this.task_id = task_id;
|
||||
}
|
||||
/** integration_task_id */
|
||||
public String getTask_id() {
|
||||
return task_id;
|
||||
}
|
||||
|
||||
|
||||
/** 服务器名称 */
|
||||
public void setServer_name(String server_name) {
|
||||
this.server_name = server_name;
|
||||
}
|
||||
/** 服务器名称 */
|
||||
public String getServer_name() {
|
||||
return server_name;
|
||||
}
|
||||
|
||||
|
||||
/** 运行次数 */
|
||||
public void setRun_num(Integer run_num) {
|
||||
this.run_num = run_num;
|
||||
}
|
||||
/** 运行次数 */
|
||||
public Integer getRun_num() {
|
||||
return run_num;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,297 +0,0 @@
|
|||
<?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.sys.integrationtask.monitoring.dao.impl.IntegrationTaskMonitoringDaoImpl">
|
||||
<resultMap id="get-IntegrationTaskMonitoringEntity-result" type="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
<!--无备注 -->
|
||||
<result property="id" column="id" />
|
||||
<!--integration_task_id -->
|
||||
<result property="task_id" column="task_id" />
|
||||
<!--服务器名称 -->
|
||||
<result property="server_name" column="server_name" />
|
||||
<!--运行次数 -->
|
||||
<result property="run_num" column="run_num" />
|
||||
<!--创建时间 -->
|
||||
<result property="create_time" column="create_time" />
|
||||
<!--创建人id -->
|
||||
<result property="create_user_id" column="create_user_id" />
|
||||
<!--修改时间 -->
|
||||
<result property="modify_time" column="modify_time" />
|
||||
<!--修改人id -->
|
||||
<result property="modify_user_id" column="modify_user_id" />
|
||||
<!--状态(Y正常N删除) -->
|
||||
<result property="sts" column="sts" />
|
||||
<!--任务编码 -->
|
||||
<result property="task_code" column="task_code" />
|
||||
<!--任务名称 -->
|
||||
<result property="task_name" column="task_name" />
|
||||
<!--任务标识 -->
|
||||
<result property="task_tag" column="task_tag" />
|
||||
<!--部署公司 -->
|
||||
<result property="org_name" column="org_name" />
|
||||
<!--计划时间 -->
|
||||
<result property="plan_time" column="plan_time" />
|
||||
<!--耗时 -->
|
||||
<result property="diff_time" column="diff_time" />
|
||||
<!--执行与挂起状态 -->
|
||||
<result property="type" column="type" />
|
||||
<!--任务类型 -->
|
||||
<result property="task_type" column="task_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="IntegrationTaskMonitoringEntity_Base_Column_List">
|
||||
id,
|
||||
task_id,
|
||||
server_name,
|
||||
run_num,
|
||||
create_time,
|
||||
create_user_id,
|
||||
modify_time,
|
||||
modify_user_id,
|
||||
sts,
|
||||
plan_time,
|
||||
diff_time,
|
||||
type,
|
||||
task_type
|
||||
</sql>
|
||||
|
||||
<sql id="IntegrationTaskMonitoringEntity_Base_Column_List_Task">
|
||||
task.id as task_id,
|
||||
monitoring.id as id,
|
||||
task.task_code as task_code,
|
||||
task.task_name as task_name,
|
||||
task.task_tag as task_tag,
|
||||
org.organ_name as org_name,
|
||||
monitoring.server_name as server_name,
|
||||
monitoring.run_num,
|
||||
monitoring.sts,
|
||||
monitoring.type,
|
||||
monitoring.task_type,
|
||||
monitoring.sorts,
|
||||
monitoring.plan_time,
|
||||
monitoring.diff_time
|
||||
</sql>
|
||||
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskMonitoringEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskMonitoringEntity_Base_Column_List" />
|
||||
from integration_task_monitoring where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!--通过task_id获取最大执行次数 -->
|
||||
<select id="IntegrationTaskMonitoringEntity_countMax" resultMap="get-IntegrationTaskMonitoringEntity-result">
|
||||
select (max(IFNULL( a.run_num, 0 )) + 1) as run_num from integration_task_monitoring a WHERE task_id = #{task_id} and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskMonitoringEntity-result" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskMonitoringEntity_Base_Column_List" />
|
||||
from integration_task_monitoring
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">id=#{id}</if>
|
||||
<if test="task_id != null and task_id !='' "> and task_id = #{task_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="run_num != null and run_num !=''"> and run_num = #{run_num}</if>
|
||||
<if test="task_type != null and task_type !=''"> and task_type = #{task_type}</if>
|
||||
<if test="diff_time != null and diff_time !=''"> and diff_time = #{diff_time}</if>
|
||||
<if test="plan_time != null and plan_time !=''"> and plan_time = #{plan_time}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
<if test="type != null and type !='' "> and type = #{type}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
select count(1) from integration_task_monitoring
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id} </if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name} </if>
|
||||
<if test="run_num != null "> and run_num = #{run_num} </if>
|
||||
<if test="task_type != null "> and task_type = #{task_type} </if>
|
||||
<if test="diff_time != null and diff_time !=''"> and diff_time = #{diff_time}</if>
|
||||
<if test="plan_time != null and plan_time !=''"> and plan_time = #{plan_time}</if>
|
||||
<if test="create_time != null "> and create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null "> and modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts} </if>
|
||||
<if test="type != null and type !='' "> and type = #{type}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<!--<select id="IntegrationTaskMonitoringEntity_list_like" resultMap="get-IntegrationTaskMonitoringEntity-result" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskMonitoringEntity_Base_Column_List" />
|
||||
from integration_task_monitoring
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> and task_id = #{task_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name like concat('%',#{server_name},'%') </if>
|
||||
<if test="run_num != null "> and run_num = #{run_num}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>-->
|
||||
|
||||
<!--分页连表查询-->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskMonitoringEntity-result" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskMonitoringEntity_Base_Column_List_Task" />
|
||||
from integration_task task
|
||||
left join integration_task_monitoring monitoring on task.id=monitoring.task_id
|
||||
left join sys_user u on u.id=monitoring.create_user_id
|
||||
left join sys_organ org on org.id=u.org_id
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="task_name != null and task_name !='' "> and task.task_name like concat('%',#{task_name},'%') </if>
|
||||
and monitoring.sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by monitoring.sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="entity_list_or" resultMap="get-IntegrationTaskMonitoringEntity-result" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskMonitoringEntity_Base_Column_List" />
|
||||
from integration_task_monitoring
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="id != null ">id = #{id}</if>
|
||||
<if test="task_id != null "> or task_id = #{task_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> or server_name = #{server_name} </if>
|
||||
<if test="run_num != null and run_num !=''"> or run_num = #{run_num}</if>
|
||||
<if test="task_type != null and task_type !=''"> or task_type = #{task_type}</if>
|
||||
<if test="diff_time != null and diff_time !=''"> or diff_time = #{diff_time}</if>
|
||||
<if test="plan_time != null and plan_time !=''"> or plan_time = #{plan_time}</if>
|
||||
<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
|
||||
<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="sts != null and sts !='' "> or sts = #{sts} </if>
|
||||
<if test="type != null and type !='' "> or type = #{type}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
insert into integration_task_monitoring(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">id,</if>
|
||||
<if test="task_id != null and task_id !=''">task_id,</if>
|
||||
<if test="server_name != null and server_name !='' "> server_name, </if>
|
||||
<if test="run_num != null and run_num !='' ">run_num,</if>
|
||||
<if test="task_type != null and task_type !='' ">task_type,</if>
|
||||
<if test="type != null and type !='' ">type,</if>
|
||||
<if test="diff_time != null ">diff_time,</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="plan_time != null"> plan_time, </if>
|
||||
create_time,
|
||||
modify_time,
|
||||
sts
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id !=''">#{id},</if>
|
||||
<if test="task_id != null and task_id !=''">#{task_id},</if>
|
||||
<if test="server_name != null and server_name !='' "> #{server_name}, </if>
|
||||
<if test="run_num != null and run_num !='' ">#{run_num},</if>
|
||||
<if test="task_type != null and task_type !='' ">#{task_type},</if>
|
||||
<if test="type != null and type !='' ">#{type},</if>
|
||||
<if test="diff_time != null and diff_time !=''">#{diff_time},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_monitoring a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="plan_time != null "> #{plan_time},</if>
|
||||
<if test="create_time != null "> #{create_time} ,</if>
|
||||
<if test="create_time == null "> now() ,</if>
|
||||
<if test="modify_time != null "> #{modify_time},</if>
|
||||
<if test="modify_time == null "> now(),</if>
|
||||
'Y'
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
update integration_task_monitoring set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="task_id != null and task_id !='' ">task_id = #{task_id},</if>
|
||||
<if test="server_name != null and server_name !='' "> server_name = #{server_name},</if>
|
||||
<if test="run_num != null and run_num !=''">run_num = #{run_num},</if>
|
||||
<if test="task_type != null and task_type !=''">task_type = #{task_type},</if>
|
||||
<if test="type != null and type !=''">type = #{type},</if>
|
||||
<if test="plan_time != null and plan_time !=''"> plan_time = #{plan_time},</if>
|
||||
<if test="diff_time != null and diff_time !=''">diff_time = #{diff_time},</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null "> modify_time =#{modify_time} </if>
|
||||
<if test="modify_time == null "> modify_time = now()</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
update integration_task_monitoring set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据task_id修改执行次数 -->
|
||||
<update id="IntegrationTaskMonitoringEntity_updateRunnum" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
update integration_task_monitoring set
|
||||
run_num=${run_num},diff_time=#{diff_time},modify_time = now(),plan_time=#{plan_time} where
|
||||
task_id = #{task_id} and sts='Y'
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除多条件 -->
|
||||
<update id="IntegrationTaskMonitoringEntity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
update integration_task_monitoring set
|
||||
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null ">id=#{id}</if>
|
||||
<if test="task_id != null and task_id !=''"> and task_id = #{task_id}</if>
|
||||
<if test="server_name != null and server_name !='' "> and server_name = #{server_name}</if>
|
||||
<if test="run_num != null and run_num !=''"> and run_num = #{run_num}</if>
|
||||
<if test="task_type != null and task_type !=''"> and task_type = #{task_type}</if>
|
||||
<if test="type != null and type !=''"> and type = #{type}</if>
|
||||
<if test="plan_time != null and plan_time !=''"> and plan_time = #{plan_time}</if>
|
||||
<if test="diff_time != null and diff_time !=''"> and diff_time = #{diff_time}</if>
|
||||
<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
|
||||
<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
|
||||
<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="sts != null and sts !='' "> and sts = #{sts}</if>
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 物理删除 -->
|
||||
<delete id="entity_delete" parameterType="com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity">
|
||||
delete from integration_task_monitoring where id =#{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,37 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.monitoring.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务任务监控 service
|
||||
* @tableName: integration_task_monitoring
|
||||
* @entityName: IntegrationTaskMonitoringEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskMonitoringService extends IBaseService<IntegrationTaskMonitoringEntity, String> {
|
||||
//当触发器执行的时候,修改任务监控执行次数
|
||||
JsonResultEntity updateIntegrationTaskMonitoring(JSONObject jsonObject);
|
||||
|
||||
//监控输出
|
||||
JsonResultEntity queryMonitoringExportation(JSONObject jsonObject) throws Exception;
|
||||
|
||||
//保存监控
|
||||
JsonResultEntity saveIntegrationTaskMonitoring(JSONObject jsonObject);
|
||||
|
||||
//任务关闭或者删除时候,修改监控sts为N
|
||||
JsonResultEntity updateTaskMonitoringSts(JSONObject jsonObject);
|
||||
|
||||
//根据taskid判断是否在监控中存在
|
||||
List<IntegrationTaskMonitoringEntity> queryTaskMonitoringOne(JSONObject jsonObject);
|
||||
|
||||
//监控执行与挂起
|
||||
JsonResultEntity updateTaskMonitoringCarryAndHang(JSONObject jsonObject);
|
||||
|
||||
}
|
|
@ -1,208 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.monitoring.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.integrationtask.dao.IIntegrationTaskDao;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.quartz.QuartzJobFactoryUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.service.IIntegrationTaskMonitoringService;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.dao.IIntegrationTaskMonitoringDao;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务任务监控 service
|
||||
* @tableName: integration_task_monitoring
|
||||
* @entityName: IntegrationTaskMonitoringEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integrationTaskMonitoringService")
|
||||
public class IntegrationTaskMonitoringServiceImpl extends BaseService<IntegrationTaskMonitoringEntity, String> implements IIntegrationTaskMonitoringService {
|
||||
|
||||
protected IIntegrationTaskMonitoringDao integrationtaskmonitoringDao;
|
||||
//@Autowired
|
||||
private IIntegrationTaskDao integrationTaskDao;
|
||||
|
||||
//@Autowired
|
||||
private HttpServletResponse httpServletResponse;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskMonitoringDao(IIntegrationTaskMonitoringDao dao) {
|
||||
this.integrationtaskmonitoringDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当触发器执行的时候,修改任务监控执行次数
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateIntegrationTaskMonitoring(JSONObject jsonObject) {
|
||||
String taskId = jsonObject.getString("task_id");
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity=new IntegrationTaskMonitoringEntity();
|
||||
integrationTaskMonitoringEntity.setTask_id(taskId);
|
||||
integrationTaskMonitoringEntity.setPlan_time(jsonObject.getDate("plan_time"));
|
||||
integrationTaskMonitoringEntity.setDiff_time(jsonObject.getString("diff_time"));
|
||||
//修改最大执行次数
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntityCountMax = integrationtaskmonitoringDao.queryIntegrationTaskMonitoringEntity_countMax(integrationTaskMonitoringEntity);
|
||||
integrationTaskMonitoringEntity.setRun_num(integrationTaskMonitoringEntityCountMax.getRun_num());
|
||||
integrationtaskmonitoringDao.updateIntegrationTaskMonitoring(integrationTaskMonitoringEntity);
|
||||
return BaseResult.getSuccessMessageEntity("修改任务监控执行次数成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控输出 输出任务与监控连表查询的结果
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryMonitoringExportation(JSONObject jsonObject) throws Exception{
|
||||
try {
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = getData("jsonStr", jsonObject, IntegrationTaskMonitoringEntity.class);
|
||||
//根据任务查询监控数据
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntityListBase = integrationtaskmonitoringDao.queryByLike(integrationTaskMonitoringEntity);
|
||||
if(integrationTaskMonitoringEntityListBase.size()==0){
|
||||
return BaseResult.getFailureMessageEntity("输出的数据为null");
|
||||
}
|
||||
createExcel(integrationTaskMonitoringEntity,integrationTaskMonitoringEntityListBase);
|
||||
return BaseResult.getSuccessMessageEntity("监控输出成功");
|
||||
}catch (Exception e){
|
||||
logger.info("监控输出失败:"+e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("监控输出失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控保存
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity saveIntegrationTaskMonitoring(JSONObject jsonObject) {
|
||||
//监控id
|
||||
long uuidMonitor = UUIDLong.longUUID();
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = jsonObject.toJavaObject(IntegrationTaskMonitoringEntity.class);
|
||||
integrationTaskMonitoringEntity.setRun_num(0);
|
||||
integrationTaskMonitoringEntity.setId(String.valueOf(uuidMonitor));
|
||||
integrationtaskmonitoringDao.save(integrationTaskMonitoringEntity);
|
||||
return BaseResult.getSuccessMessageEntity("任务监控保存成功",integrationTaskMonitoringEntity);
|
||||
}
|
||||
|
||||
//修改监控sts为N
|
||||
@Override
|
||||
public JsonResultEntity updateTaskMonitoringSts(JSONObject jsonObject) {
|
||||
String taskId = jsonObject.getString("task_id");
|
||||
if(null==taskId||"".equals(taskId)){
|
||||
return BaseResult.getFailureMessageEntity("删除时请携带任务id");
|
||||
}
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity=new IntegrationTaskMonitoringEntity();
|
||||
integrationTaskMonitoringEntity.setTask_id(taskId);
|
||||
integrationTaskMonitoringEntity.setModify_user_id(jsonObject.getString("modify_user_id"));
|
||||
integrationtaskmonitoringDao.update("IntegrationTaskMonitoringEntity_logicDelete_Multi_Condition",integrationTaskMonitoringEntity);
|
||||
return BaseResult.getSuccessMessageEntity("监控删除成功");
|
||||
}
|
||||
|
||||
//根据taskid判断在监控中是否存在
|
||||
@Override
|
||||
public List<IntegrationTaskMonitoringEntity> queryTaskMonitoringOne(JSONObject jsonObject) {
|
||||
String taskId = jsonObject.getString("task_id");
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntities=null;
|
||||
if(null!=taskId||!"".equals(taskId)){
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity=new IntegrationTaskMonitoringEntity();
|
||||
integrationTaskMonitoringEntity.setTask_id(taskId);
|
||||
integrationTaskMonitoringEntities = integrationtaskmonitoringDao.query(integrationTaskMonitoringEntity);
|
||||
}
|
||||
return integrationTaskMonitoringEntities;
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控执行与挂起
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateTaskMonitoringCarryAndHang(JSONObject jsonObject) {
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = getData("jsonStr", jsonObject, IntegrationTaskMonitoringEntity.class);
|
||||
//查询单个任务,用于判断任务是开启还是关闭,正常还是不正常
|
||||
IntegrationTaskEntity integrationTaskEntity = integrationTaskDao.get(integrationTaskMonitoringEntity.getTask_id());
|
||||
if(null==integrationTaskEntity||"".equals(integrationTaskEntity)){
|
||||
return BaseResult.getFailureMessageEntity("任务查询为null");
|
||||
}
|
||||
//判断任务状态是否是开启状态 1:开启 2:关闭
|
||||
if("2".equals(integrationTaskEntity.getTask_status())){
|
||||
return BaseResult.getFailureMessageEntity("任务状态已经关闭");
|
||||
}
|
||||
String jsonStr = jsonObject.getString("jsonStr");
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonStr);
|
||||
jsonObjectStr.put("jobName",jsonObjectStr.getString("task_name"));
|
||||
jsonObjectStr.put("jobCode",jsonObjectStr.getString("task_code"));
|
||||
String type = jsonObjectStr.getString("type");
|
||||
//判断type是执行还是挂起 1:执行 2:挂起
|
||||
switch (type){
|
||||
//执行 定时器继续执行
|
||||
case "1":
|
||||
integrationTaskMonitoringEntity.setType("1");
|
||||
integrationtaskmonitoringDao.update(integrationTaskMonitoringEntity);
|
||||
QuartzJobFactoryUtils.pauseTrigger(jsonObjectStr);
|
||||
QuartzJobFactoryUtils.resumeTrigger(jsonObjectStr);
|
||||
break;
|
||||
//挂起 定时器关闭
|
||||
case "2":
|
||||
integrationTaskMonitoringEntity.setType("2");
|
||||
integrationtaskmonitoringDao.update(integrationTaskMonitoringEntity);
|
||||
QuartzJobFactoryUtils.pauseTrigger(jsonObjectStr);
|
||||
break;
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建excel
|
||||
* @param monitoring
|
||||
* @param list
|
||||
* @throws Exception
|
||||
*/
|
||||
private void createExcel(IntegrationTaskMonitoringEntity monitoring,List<IntegrationTaskMonitoringEntity> list) throws Exception{
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter excelWriter= ExcelUtil.getWriter(true);
|
||||
//设置列名称
|
||||
excelWriter.addHeaderAlias("id","监控id");
|
||||
excelWriter.addHeaderAlias("task_name","任务名称");
|
||||
excelWriter.addHeaderAlias("task_code","任务编码");
|
||||
excelWriter.addHeaderAlias("task_tag","任务标识");
|
||||
excelWriter.addHeaderAlias("org_id","部署公司");
|
||||
excelWriter.addHeaderAlias("server_name","服务器名称");
|
||||
excelWriter.addHeaderAlias("run_num","运行次数");
|
||||
excelWriter.addHeaderAlias("sts","状态");
|
||||
excelWriter.addHeaderAlias("sorts","序号");
|
||||
//从第1行开始 第0行为列名称
|
||||
excelWriter.setCurrentRow(0);
|
||||
//导出有别名的表单
|
||||
excelWriter.setOnlyAlias(true);
|
||||
excelWriter.write(list,true);
|
||||
httpServletResponse.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
//设置excel名称
|
||||
String encodeName = URLEncoder.encode(list.get(0).getTask_name(), "UTF-8");
|
||||
httpServletResponse.setHeader("Content-Disposition","attachment;filename="+encodeName+".xlsx");
|
||||
ServletOutputStream out=httpServletResponse.getOutputStream();
|
||||
excelWriter.flush(out, true);
|
||||
// 关闭writer,释放内存
|
||||
excelWriter.close();
|
||||
IoUtil.close(out);
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity;
|
||||
|
||||
/**
|
||||
* @description: 集成任务-任务详细策略 service
|
||||
* @tableName: integration_task_details
|
||||
* @entityName: IntegrationTaskDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskDetailsService extends IBaseService<IntegrationTaskDetailsEntity, String> {
|
||||
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务 service
|
||||
* @tableName: integration_task
|
||||
* @entityName: IntegrationTaskEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public interface IIntegrationTaskService extends IBaseService<IntegrationTaskEntity, String> {
|
||||
|
||||
//集成任务新增
|
||||
JsonResultEntity saveIntegrationTask(JSONObject jsonObject) throws Exception;
|
||||
|
||||
//集成任务修改
|
||||
JsonResultEntity updateIntegrationTask(JSONObject jsonObject) throws Exception;
|
||||
|
||||
//集成任务删除 将sts状态修改为N
|
||||
JsonResultEntity updateIntegrationTaskSts(JSONObject jsonObject);
|
||||
|
||||
|
||||
//查询单个
|
||||
JsonResultEntity queryIntegrationTaskById(JSONObject jsonObject);
|
||||
|
||||
//保存日志和实例
|
||||
void saveLogAndLiving(JSONObject jsonObjectStr, Date dateStart);
|
||||
|
||||
/***
|
||||
* 不同的项目工程内,需要初始化的插件不尽相同,需要按照自身项目组织初始化插件
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-09-22 15:45
|
||||
* @param taskIdList 需要初始化的ID集合
|
||||
* @return void
|
||||
**/
|
||||
void initTaskByIds(List<String> taskIdList);
|
||||
|
||||
void thirdInterfaceSaveTest(JSONObject jsonObject);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.service.IIntegrationTaskDetailsService;
|
||||
import com.hzya.frame.sys.integrationtask.dao.IIntegrationTaskDetailsDao;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* @description: 集成任务-任务详细策略 service
|
||||
* @tableName: integration_task_details
|
||||
* @entityName: IntegrationTaskDetailsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integration_task_detailsService")
|
||||
public class IntegrationTaskDetailsServiceImpl extends BaseService<IntegrationTaskDetailsEntity, String> implements IIntegrationTaskDetailsService {
|
||||
|
||||
protected IIntegrationTaskDetailsDao integrationtaskdetailsDao;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskDetailsDao(IIntegrationTaskDetailsDao dao) {
|
||||
this.integrationtaskdetailsDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -1,549 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.sys.apireflection.service.impl.ApiHandleServiceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.dao.IIntegrationTaskDao;
|
||||
import com.hzya.frame.sys.integrationtask.dao.IIntegrationTaskDetailsDao;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sys.integrationtask.living.service.IIntegrationTaskLivingService;
|
||||
import com.hzya.frame.sys.integrationtask.log.service.IIntegrationTaskLogService;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.service.IIntegrationTaskMonitoringService;
|
||||
import com.hzya.frame.sys.integrationtask.service.IIntegrationTaskService;
|
||||
import com.hzya.frame.sys.sysenum.SysEnum;
|
||||
import com.hzya.frame.util.PluginUtils;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.quartz.QuartzJobFactoryUtils;
|
||||
import org.quartz.CronExpression;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 集成任务 service
|
||||
* @tableName: integration_task
|
||||
* @entityName: IntegrationTaskEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
//@Service(value = "integrationTaskService")
|
||||
public class IntegrationTaskServiceImpl extends BaseService<IntegrationTaskEntity, String> implements IIntegrationTaskService {
|
||||
public static final String ATONCE = SysEnum.ATONCE.getValue();//执行策略 Y:立即执行
|
||||
public static final String TIMING = SysEnum.TIMING.getValue();//执行策略 N:定时
|
||||
public static final String OPEN = SysEnum.OPEN.getValue();//任务状态 1:开启
|
||||
public static final String SHUTDOWN = SysEnum.SHUTDOWN.getValue();//任务状态 2:关闭
|
||||
protected IIntegrationTaskDao integrationtaskDao;
|
||||
Logger logger = LoggerFactory.getLogger(IntegrationTaskServiceImpl.class);
|
||||
//@Autowired
|
||||
private IIntegrationTaskDetailsDao integrationTaskDetailsDao;//任务明细
|
||||
//@Autowired
|
||||
private IIntegrationTaskMonitoringService integrationTaskMonitoringService;//监控
|
||||
//@Autowired
|
||||
private IIntegrationTaskLivingService integrationTaskLivingService;//实例
|
||||
//@Autowired
|
||||
private IIntegrationTaskLogService integrationTaskLogService;//日志
|
||||
//@Autowired
|
||||
private ApiHandleServiceImpl apiHandleService;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskDao(IIntegrationTaskDao dao) {
|
||||
this.integrationtaskDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryIntegrationTaskById(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity integrationTaskEntity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (null == integrationTaskEntity.getId() || "".equals(integrationTaskEntity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("查看单个时请携带id");
|
||||
}
|
||||
IntegrationTaskEntity integrationTaskEntityGet = integrationtaskDao.get(integrationTaskEntity.getId());
|
||||
if (null == integrationTaskEntityGet) {
|
||||
return BaseResult.getSuccessMessageEntity("查询成功", integrationTaskEntityGet);
|
||||
}
|
||||
//查询明细数据
|
||||
IntegrationTaskDetailsEntity integrationTaskDetailsEntity = new IntegrationTaskDetailsEntity();
|
||||
integrationTaskDetailsEntity.setParent_id(integrationTaskEntityGet.getId());
|
||||
List<IntegrationTaskDetailsEntity> integrationTaskDetailsEntityListBase = integrationTaskDetailsDao.query(integrationTaskDetailsEntity);
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("main", integrationTaskEntityGet);
|
||||
List<IntegrationTaskDetailsEntity> list = new ArrayList<>();
|
||||
if (integrationTaskDetailsEntityListBase.size() > 0) {
|
||||
for (IntegrationTaskDetailsEntity taskDetailsEntity : integrationTaskDetailsEntityListBase) {
|
||||
list.add(taskDetailsEntity);
|
||||
}
|
||||
}
|
||||
jsonObjectMap.put("details", list);
|
||||
return BaseResult.getSuccessMessageEntity("查询成功", jsonObjectMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 集成任务新增
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity saveIntegrationTask(JSONObject jsonObject) throws Exception {
|
||||
JSONObject jsonObjectResult = saveOrUpdateDetails(jsonObject);
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonObjectResult.getString("jsonObjectStr"));
|
||||
IntegrationTaskEntity integrationTaskEntity = JSONObject.parseObject(jsonObjectResult.getString("integrationTaskEntity")).toJavaObject(IntegrationTaskEntity.class);
|
||||
//判断是否插件
|
||||
String plug = jsonObjectStr.getString("plug");
|
||||
jsonObjectStr.put("plug", plug);
|
||||
//1:是插件
|
||||
String isPlug = "1";
|
||||
//2:不是插件
|
||||
String isNotPlug = "2";
|
||||
//集成任务执行策略 N定时Y立即执行 当为Y立即执行时候,新增集成任务,实例,监控,日志,当为N时候,新增任务和监控,实例与日志在任务执行之后再新增
|
||||
String status = jsonObjectResult.getString("status");
|
||||
//开始时间
|
||||
Date dateStart = new Date();
|
||||
try {
|
||||
if (TIMING.equals(status)) {
|
||||
//根据cron,定时执行任务
|
||||
QuartzJobFactoryUtils.createJob(getJob(jsonObjectStr));
|
||||
}
|
||||
if (ATONCE.equals(status)) {
|
||||
try {
|
||||
JSONObject jsonObjectHand = new JSONObject();
|
||||
if (null == jsonObjectStr.getString("sence_id")) {
|
||||
jsonObjectStr.put("sence_id", jsonObjectStr.getString("task_tag"));
|
||||
}
|
||||
jsonObjectHand.put("ref_id", jsonObjectStr.getString("sence_id"));
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("jsonStr", jsonObjectHand.toJSONString());
|
||||
//定义空的 调用场景方法有返回得话,取返回值
|
||||
jsonObjectStr.put("result", "");
|
||||
jsonObjectStr.put("info", "");
|
||||
jsonObjectStr.put("task_type", "后台任务");
|
||||
//保存监控数据
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntities = integrationTaskMonitoringService.queryTaskMonitoringOne(jsonObjectStr);
|
||||
if (integrationTaskMonitoringEntities.size() == 0 || null == integrationTaskMonitoringEntities) {
|
||||
//触发时候,新增监控
|
||||
jsonObjectStr.put("plan_time", new Date());
|
||||
integrationTaskMonitoringService.saveIntegrationTaskMonitoring(jsonObjectStr);
|
||||
}
|
||||
//查询单个,得到上次修改时间,当前时间减去修改时间就是上次耗时时间
|
||||
int diff_timeMon = 0;
|
||||
if (integrationTaskMonitoringEntities.size() == 0) {
|
||||
diff_timeMon = 0;
|
||||
} else {
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = integrationTaskMonitoringEntities.get(0);
|
||||
diff_timeMon = Integer.valueOf((int) (dateStart.getTime() - integrationTaskMonitoringEntity.getModify_time().getTime()));
|
||||
}
|
||||
//将cron表达式转为时间
|
||||
CronExpression cronExpression = new CronExpression(jsonObjectStr.getString("task_cron"));
|
||||
Date nextValidTimeAfter = cronExpression.getNextValidTimeAfter(new Date());
|
||||
String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(nextValidTimeAfter);
|
||||
jsonObjectStr.put("plan_time", format);
|
||||
jsonObjectStr.put("diff_time", diff_timeMon);
|
||||
//触发时候,修改任务监控执行次数
|
||||
integrationTaskMonitoringService.updateIntegrationTaskMonitoring(jsonObjectStr);
|
||||
if (isPlug.equalsIgnoreCase(plug)) {
|
||||
try {
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jsonObjectStr.getString("plug_id"));
|
||||
String s = pluginBaseEntity.executeBusiness(req);
|
||||
logger.info("执行插件executeBusiness");
|
||||
if ("执行成功".equals(s)) {
|
||||
jsonObjectStr.put("result", "执行成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
jsonObjectStr.put("result", "执行失败");
|
||||
jsonObjectStr.put("instructions", e.getMessage());
|
||||
}
|
||||
} else {
|
||||
JsonResultEntity jsonResultEntity = apiHandleService.executeApi(req);
|
||||
if ("执行成功".equals(jsonResultEntity.getMsg())) {
|
||||
jsonObjectStr.put("result", jsonResultEntity.getMsg());
|
||||
jsonObjectStr.put("info", jsonResultEntity.getAttribute());
|
||||
} else {
|
||||
jsonObjectStr.put("result", "执行失败");
|
||||
jsonObjectStr.put("instructions", jsonResultEntity.getMsg());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
jsonObjectStr.put("result", "执行失败");
|
||||
//保存错误说明
|
||||
jsonObjectStr.put("instructions", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("任务保存失败:" + e.getMessage());
|
||||
} finally {
|
||||
saveLogAndLiving(jsonObjectStr, dateStart);
|
||||
}
|
||||
}
|
||||
IntegrationTaskEntity integrationTaskSave = integrationtaskDao.save(integrationTaskEntity);
|
||||
return BaseResult.getSuccessMessageEntity("任务保存成功", integrationTaskSave);
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("任务保存失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼接组装参数,传到定时器中
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
private JSONObject getJob(JSONObject jsonObject) {
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("jobName", jsonObject.getString("task_name"));
|
||||
jsonObjectMap.put("jobCode", jsonObject.getString("task_code"));
|
||||
jsonObjectMap.put("sceneId", jsonObject.getString("sence_id"));
|
||||
jsonObjectMap.put("task_tag", jsonObject.getString("task_tag"));
|
||||
jsonObjectMap.put("cronExpression", jsonObject.getString("task_cron"));
|
||||
jsonObjectMap.put("task_id", jsonObject.getString("task_id"));
|
||||
jsonObjectMap.put("create_user_id", jsonObject.getString("create_user_id"));
|
||||
jsonObjectMap.put("modify_user_id", jsonObject.getString("modify_user_id"));
|
||||
jsonObjectMap.put("plug_id", jsonObject.getString("plug_id"));
|
||||
jsonObjectMap.put("plug", jsonObject.getString("plug"));
|
||||
return jsonObjectMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼接组装参数,传到定时器中
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
private JSONObject getJobV2(JSONObject jsonObject) {
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("jobName", jsonObject.getString("task_name"));
|
||||
jsonObjectMap.put("jobCode", jsonObject.getString("task_code"));
|
||||
jsonObjectMap.put("sceneId", jsonObject.getString("sence_id"));
|
||||
jsonObjectMap.put("task_tag", jsonObject.getString("task_tag"));
|
||||
jsonObjectMap.put("cronExpression", jsonObject.getString("task_cron"));
|
||||
// jsonObjectMap.put("task_id", jsonObject.getString("task_id"));
|
||||
//TODO 没有task_id这个字段,通过com.hzya.frame.sys.integrationtask.service.impl.IntegrationTaskServiceImpl.initTask 调用
|
||||
jsonObjectMap.put("task_id", jsonObject.getString("id"));
|
||||
jsonObjectMap.put("create_user_id", jsonObject.getString("create_user_id"));
|
||||
jsonObjectMap.put("modify_user_id", jsonObject.getString("modify_user_id"));
|
||||
jsonObjectMap.put("plug_id", jsonObject.getString("plug_id"));
|
||||
jsonObjectMap.put("plug", jsonObject.getString("plug"));
|
||||
return jsonObjectMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者修改任务明细
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
private JSONObject saveOrUpdateDetails(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity integrationTaskEntity = JSONObject.parseObject(jsonObject.getString("jsonStr")).toJavaObject(IntegrationTaskEntity.class);
|
||||
String jsonStr = jsonObject.getString("jsonStr");
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonStr);
|
||||
IntegrationTaskDetailsEntity integrationTaskDetailsEntity = new IntegrationTaskDetailsEntity();
|
||||
//如果任务code为空,则是新增,如果不为空,则是修改
|
||||
if (null == integrationTaskEntity.getTask_code() || "".equals(integrationTaskEntity.getTask_code())) {
|
||||
//查询编码最大值
|
||||
IntegrationTaskEntity integrationTaskEntityMaxCode = integrationtaskDao.query(integrationTaskEntity, "IntegrationTaskEntity_maxCode");
|
||||
String taskCode = "Task-" + integrationTaskEntityMaxCode.getTask_code();
|
||||
integrationTaskEntity.setTask_code(taskCode);
|
||||
//任务id
|
||||
long uuid = UUIDLong.longUUID();
|
||||
integrationTaskEntity.setId(String.valueOf(uuid));
|
||||
jsonObjectStr.put("task_id", uuid);//将任务id存起来,定时触发时候需要传到任务实例与任务日志中
|
||||
jsonObjectStr.put("server_name", integrationTaskEntity.getServer_name());
|
||||
jsonObjectStr.put("task_code", taskCode);
|
||||
} else {
|
||||
jsonObjectStr.put("task_id", integrationTaskEntity.getId());//将任务id存起来,定时触发时候需要传到任务实例与任务日志中
|
||||
//修改任务主表数据
|
||||
IntegrationTaskEntity integrationTaskupdate = integrationtaskDao.update(integrationTaskEntity);
|
||||
//在修改明细之前先删除明细数据,将明细数据sts修改为N
|
||||
integrationTaskDetailsEntity.setParent_id(integrationTaskEntity.getId());
|
||||
integrationTaskDetailsEntity.setModify_user_id(jsonObject.getString("modify_user_id"));
|
||||
integrationTaskDetailsDao.update("IntegrationTaskDetailsEntity_updateSts", integrationTaskDetailsEntity);
|
||||
}
|
||||
//重新保存任务明细数据
|
||||
//任务明细id
|
||||
long uuidDetails = UUIDLong.longUUID();
|
||||
integrationTaskDetailsEntity.setId(String.valueOf(uuidDetails));
|
||||
integrationTaskDetailsEntity.setParent_id(integrationTaskEntity.getId());
|
||||
integrationTaskDetailsEntity.setTask_cron(jsonObjectStr.getString("task_cron"));
|
||||
integrationTaskDetailsEntity.setNow_execution(jsonObjectStr.getString("now_execution"));
|
||||
integrationTaskDetailsEntity.setCreate_user_id(jsonObjectStr.getString("create_user_id"));
|
||||
integrationTaskDetailsEntity.setModify_user_id(jsonObjectStr.getString("modify_user_id"));
|
||||
IntegrationTaskDetailsEntity taskDetailsEntity = integrationTaskDetailsDao.save(integrationTaskDetailsEntity);
|
||||
JSONObject jsonObjectResult = new JSONObject();
|
||||
jsonObjectResult.put("jsonObjectStr", jsonObjectStr);
|
||||
jsonObjectResult.put("status", taskDetailsEntity.getNow_execution());
|
||||
jsonObjectResult.put("integrationTaskEntity", JSONObject.toJSON(integrationTaskEntity));
|
||||
return jsonObjectResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 集成任务修改
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateIntegrationTask(JSONObject jsonObject) throws Exception {
|
||||
JSONObject jsonObjectResult = saveOrUpdateDetails(jsonObject);
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonObjectResult.getString("jsonObjectStr"));
|
||||
IntegrationTaskEntity integrationTaskEntity = JSONObject.parseObject(jsonObjectResult.getString("integrationTaskEntity")).toJavaObject(IntegrationTaskEntity.class);
|
||||
//判断是否插件
|
||||
String plug = jsonObjectStr.getString("plug");
|
||||
//1:是插件
|
||||
String isPlug = "1";
|
||||
//如果任务状态为开启,则需要修改监控的修改时间,修改任务和任务明细数据
|
||||
//如果任务为关闭,也需要修改任务和任务明细数据,还需要调整监控sts为N,将监控和日志触发器停止
|
||||
//任务状态
|
||||
String taskState = integrationTaskEntity.getTask_status();
|
||||
//开始时间
|
||||
Date dateStart = new Date();
|
||||
try {
|
||||
if (OPEN.equals(taskState)) {
|
||||
//定义启动状态 N定时Y立即执行 当为Y立即执行时候,新增集成任务,实例,监控,日志,当为N时候,新增任务和监控,实例与日志在任务执行之后再新增
|
||||
String status = jsonObjectResult.getString("status");
|
||||
if (TIMING.equals(status)) {
|
||||
//先关闭监控和日志定时器,然后再根据新的cron表达式开启新的定时器
|
||||
QuartzJobFactoryUtils.pauseJob(getJob(jsonObjectStr));
|
||||
//根据cron,定时执行任务
|
||||
QuartzJobFactoryUtils.createJob(getJob(jsonObjectStr));
|
||||
}
|
||||
if (ATONCE.equals(status)) {
|
||||
try {
|
||||
jsonObjectStr.put("task_type", "后台任务");
|
||||
JSONObject jsonObjectHand = new JSONObject();
|
||||
if (null == jsonObjectStr.getString("sence_id")) {
|
||||
jsonObjectStr.put("sence_id", jsonObjectStr.getString("task_tag"));
|
||||
}
|
||||
jsonObjectHand.put("ref_id", jsonObjectStr.getString("sence_id"));
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("jsonStr", jsonObjectHand.toJSONString());
|
||||
//立即执行的时候监控+1 查询单个得到上次修改时间,当前时间减去修改时间就是上次耗时时间
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntities = integrationTaskMonitoringService.queryTaskMonitoringOne(jsonObjectStr);
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = integrationTaskMonitoringEntities.get(0);
|
||||
int diff_timeMon = Integer.valueOf((int) (dateStart.getTime() - integrationTaskMonitoringEntity.getModify_time().getTime()));
|
||||
jsonObjectStr.put("diff_time", diff_timeMon);
|
||||
//将cron表达式转为时间
|
||||
CronExpression cronExpression = new CronExpression(jsonObjectStr.getString("task_cron"));
|
||||
Date nextValidTimeAfter = cronExpression.getNextValidTimeAfter(new Date());
|
||||
String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(nextValidTimeAfter);
|
||||
jsonObjectStr.put("plan_time", format);
|
||||
//触发时候,修改任务监控执行次数
|
||||
integrationTaskMonitoringService.updateIntegrationTaskMonitoring(jsonObjectStr);
|
||||
//判断是否是插件执行
|
||||
if (isPlug.equalsIgnoreCase(plug)) {
|
||||
try {
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jsonObjectStr.getString("plug_id"));
|
||||
String s = pluginBaseEntity.executeBusiness(req);
|
||||
logger.info("执行插件executeBusiness");
|
||||
if ("执行成功".equals(s)) {
|
||||
jsonObjectStr.put("result", "执行成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
jsonObjectStr.put("result", "执行失败");
|
||||
jsonObjectStr.put("instructions", e.getMessage());
|
||||
}
|
||||
} else {
|
||||
JsonResultEntity jsonResultEntity = apiHandleService.executeApi(req);
|
||||
if ("执行成功".equals(jsonResultEntity.getMsg())) {
|
||||
jsonObjectStr.put("result", jsonResultEntity.getMsg());
|
||||
jsonObjectStr.put("info", jsonResultEntity.getAttribute());
|
||||
} else {
|
||||
jsonObjectStr.put("result", "执行失败");
|
||||
jsonObjectStr.put("instructions", jsonResultEntity.getMsg());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
jsonObjectStr.put("result", "执行失败");
|
||||
jsonObjectStr.put("instructions", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("修改失败:" + e.getMessage());
|
||||
} finally {
|
||||
//根据场景返回结果新增日志和实例
|
||||
saveLogAndLiving(jsonObjectStr, dateStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SHUTDOWN.equals(taskState)) {
|
||||
//关闭定时器
|
||||
QuartzJobFactoryUtils.pauseTrigger(getJob(jsonObjectStr));
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("修改成功", integrationTaskEntity.getId());
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("任务保存失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 集成任务删除(修改sts状态为N)
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateIntegrationTaskSts(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity integrationTaskEntity = JSONObject.parseObject(jsonObject.getString("jsonStr")).toJavaObject(IntegrationTaskEntity.class);
|
||||
if (null == integrationTaskEntity.getId() || "".equals(integrationTaskEntity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("删除时请携带id");
|
||||
}
|
||||
//查询单个 得到任务编码与任务名称,用来停止定时器
|
||||
IntegrationTaskEntity integrationTaskEntityGet = integrationtaskDao.get(integrationTaskEntity.getId());
|
||||
String jsonStr = jsonObject.getString("jsonStr");
|
||||
JSONObject jsonObjectStr = JSONObject.parseObject(jsonStr);
|
||||
jsonObjectStr.put("task_id", integrationTaskEntity.getId());//将任务id存起来,定时触发时候需要传到任务实例与任务日志中
|
||||
jsonObjectStr.put("task_name", integrationTaskEntityGet.getTask_name());
|
||||
jsonObjectStr.put("task_code", integrationTaskEntityGet.getTask_code());
|
||||
//删除时 需要将任务和任务明细以及监控STS修改为N,将实例和日志定时器取消
|
||||
//修改任务主表sts
|
||||
integrationtaskDao.update("IntegrationTaskEntity_logicDelete", integrationTaskEntity);
|
||||
//修改任务明细STS
|
||||
IntegrationTaskDetailsEntity integrationTaskDetailsEntity = new IntegrationTaskDetailsEntity();
|
||||
integrationTaskDetailsEntity.setParent_id(integrationTaskEntity.getId());
|
||||
integrationTaskDetailsEntity.setModify_user_id(jsonObject.getString("modify_user_id"));
|
||||
integrationTaskDetailsDao.update("IntegrationTaskDetailsEntity_updateSts", integrationTaskDetailsEntity);
|
||||
//修改任务监控sts
|
||||
integrationTaskMonitoringService.updateTaskMonitoringSts(jsonObjectStr);
|
||||
//将实例和日志定时器取消掉
|
||||
QuartzJobFactoryUtils.pauseTrigger(getJob(jsonObjectStr));
|
||||
return BaseResult.getSuccessMessageEntity("删除成功", integrationTaskEntity.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据返回的结果新增日志和实例
|
||||
*/
|
||||
@Override
|
||||
public void saveLogAndLiving(JSONObject jsonObjectStr, Date dateStart) {
|
||||
//结束时间
|
||||
Date dateEndLiving = new Date();
|
||||
int diff_time = Integer.valueOf((int) (dateEndLiving.getTime() - dateStart.getTime()));
|
||||
jsonObjectStr.put("start_time", dateStart);
|
||||
jsonObjectStr.put("end_time", dateEndLiving);
|
||||
jsonObjectStr.put("diff_time", diff_time);
|
||||
integrationTaskLivingService.saveIntegrationTaskLiving(jsonObjectStr);
|
||||
//根据返回值保存集成任务日志
|
||||
Date dateEndLog = new Date();
|
||||
int diff_timeLog = Integer.valueOf((int) (dateEndLog.getTime() - dateStart.getTime()));
|
||||
jsonObjectStr.put("end_time", dateEndLog);
|
||||
jsonObjectStr.put("diff_time", diff_timeLog);
|
||||
integrationTaskLogService.saveIntegrationTaskLog(jsonObjectStr);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initTaskByIds(List<String> taskIdList) {
|
||||
if (taskIdList.size() == 0){
|
||||
return;
|
||||
}
|
||||
IntegrationTaskEntity integrationTaskEntity = new IntegrationTaskEntity();
|
||||
integrationTaskEntity.setTask_status("1");
|
||||
integrationTaskEntity.setTaskIdList(taskIdList);
|
||||
List<IntegrationTaskEntity> integrationTaskEntityList = integrationtaskDao.query(integrationTaskEntity);
|
||||
if (null != integrationTaskEntityList && integrationTaskEntityList.size() > 0) {
|
||||
logger.info("正在初始化任务计划>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
for (IntegrationTaskEntity taskEntity : integrationTaskEntityList) {
|
||||
String jsonObjectStr = JSON.toJSONString(taskEntity);
|
||||
JSONObject jsonObject = com.alibaba.fastjson.JSON.parseObject(jsonObjectStr);
|
||||
QuartzJobFactoryUtils.createJob(getJobV2(jsonObject));
|
||||
logger.info("初始化任务:" + taskEntity.getTask_name() + " 任务编号:" + taskEntity.getTask_code() + "完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void thirdInterfaceSaveTest( JSONObject reqJsonObject) {
|
||||
JSONObject reqObj = reqJsonObject.getJSONObject("jsonStr");
|
||||
|
||||
JobExecutionContext jobExecutionContext = JSON.parseObject(reqObj.getString("jobExecutionContext"),JobExecutionContext.class);
|
||||
JSONObject jobDetails = JSON.parseObject(reqObj.getString("jobDetails"),JSONObject.class);
|
||||
String sceneName = reqObj.getString("sceneName");
|
||||
String sceneId = reqObj.getString("sceneId");
|
||||
String isPlugin = reqObj.getString("isPlugin");
|
||||
String cronExpression = reqObj.getString("cronExpression");
|
||||
Date dateStart = reqObj.getDate("dateStart");
|
||||
try {
|
||||
//TODO 此处需要执行二林哥场景调用方法
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (null == sceneId) {
|
||||
sceneId = jobDetails.getString("task_tag");
|
||||
}
|
||||
jsonObject.put("ref_id", sceneId);
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("jsonStr", jsonObject.toJSONString());
|
||||
jobDetails.put("plan_time", new Date());
|
||||
jobDetails.put("task_type", "后台任务");
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntities = integrationTaskMonitoringService.queryTaskMonitoringOne(jobDetails);
|
||||
if (integrationTaskMonitoringEntities.size() == 0 || null == integrationTaskMonitoringEntities) {
|
||||
//触发时候,新增监控
|
||||
jobDetails.put("plan_time", new Date());
|
||||
integrationTaskMonitoringService.saveIntegrationTaskMonitoring(jobDetails);
|
||||
}
|
||||
//查询单个,得到上次修改时间,当前时间减去修改时间就是上次耗时时间
|
||||
int diff_timeMon = 0;
|
||||
if (integrationTaskMonitoringEntities.size() == 0) {
|
||||
diff_timeMon = 0;
|
||||
} else {
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = integrationTaskMonitoringEntities.get(0);
|
||||
diff_timeMon = Integer.valueOf((int) (dateStart.getTime() - integrationTaskMonitoringEntity.getModify_time().getTime()));
|
||||
}
|
||||
jobDetails.put("diff_time", diff_timeMon);
|
||||
//将cron表达式转为时间
|
||||
CronExpression cronExpressionPlan = new CronExpression(cronExpression);
|
||||
Date nextValidTimeAfter = cronExpressionPlan.getNextValidTimeAfter(new Date());
|
||||
String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(nextValidTimeAfter);
|
||||
jobDetails.put("plan_time", format);
|
||||
//触发时候,修改任务监控执行次数
|
||||
integrationTaskMonitoringService.updateIntegrationTaskMonitoring(jobDetails);
|
||||
// 是否是插件 1是 2否
|
||||
String plug = "1";
|
||||
if (plug.equalsIgnoreCase(isPlugin)) {
|
||||
try {
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jobDetails.getString("plug_id"));
|
||||
String s = pluginBaseEntity.executeBusiness(req);
|
||||
logger.info("执行插件executeBusiness");
|
||||
if ("执行成功".equals(s)) {
|
||||
jobDetails.put("result", "执行成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
jobDetails.put("result", "执行失败");
|
||||
jobDetails.put("instructions", e.getMessage());
|
||||
}
|
||||
} else {
|
||||
JsonResultEntity jsonResultEntity = apiHandleService.executeApi(req);
|
||||
if ("执行成功".equals(jsonResultEntity.getMsg())) {
|
||||
jobDetails.put("result", jsonResultEntity.getMsg());
|
||||
jobDetails.put("info", jsonResultEntity.getAttribute());
|
||||
} else {
|
||||
jobDetails.put("result", "执行失败");
|
||||
jobDetails.put("instructions", jsonResultEntity.getMsg());
|
||||
}
|
||||
}
|
||||
//System.out.println("正在执行定时任务…………");
|
||||
logger.info("当前执行的任务表达式:" + cronExpression + "当前执行的任务是:" + jobExecutionContext.getTrigger().getKey() + "场景名称: " + sceneName + "场景ID:" + sceneId);
|
||||
} catch (Exception e) {
|
||||
logger.info("执行任务失败:" + cronExpression + "当前执行的任务是:" + jobExecutionContext.getTrigger().getKey() + "场景名称: " + sceneName + "场景ID:" + sceneId);
|
||||
jobDetails.put("result", "执行失败");
|
||||
//保存错误说明
|
||||
jobDetails.put("instructions", e.getMessage());
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
//TODO 写入任务执行日志表
|
||||
saveLogAndLiving(jobDetails, dateStart);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.dao;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 任务工坊(integration_task_workshop: table)表数据库访问层
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-07 17:03:33
|
||||
*/
|
||||
public interface IIntegrationTaskWorkshopDao extends IBaseDao<IntegrationTaskWorkshopEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity;
|
||||
|
||||
/**
|
||||
* 参数列表(integration_task_workshop_details: table)表数据库访问层
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-10 14:41:34
|
||||
*/
|
||||
public interface IIntegrationTaskWorkshopDetailsDao extends IBaseDao<IntegrationTaskWorkshopDetailsEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.dao.IIntegrationTaskWorkshopDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 任务工坊(IntegrationTaskWorkshop)表数据库访问层
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-07 17:03:33
|
||||
*/
|
||||
@Repository("IntegrationTaskWorkshopDaoImpl")
|
||||
public class IntegrationTaskWorkshopDaoImpl extends MybatisGenericDao<IntegrationTaskWorkshopEntity, String> implements IIntegrationTaskWorkshopDao{
|
||||
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.dao.impl;
|
||||
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.dao.IIntegrationTaskWorkshopDetailsDao;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 参数列表(IntegrationTaskWorkshopDetails)表数据库访问层
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-10 14:41:34
|
||||
*/
|
||||
@Repository("IntegrationTaskWorkshopDetailsDaoImpl")
|
||||
public class IntegrationTaskWorkshopDetailsDaoImpl extends MybatisGenericDao<IntegrationTaskWorkshopDetailsEntity, String> implements IIntegrationTaskWorkshopDetailsDao{
|
||||
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 参数列表(IntegrationTaskWorkshopDetails)实体类
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-10 15:17:41
|
||||
*/
|
||||
public class IntegrationTaskWorkshopDetailsEntity extends BaseEntity {
|
||||
|
||||
/** formmain_id */
|
||||
private String formmainId;
|
||||
/** 参数名称 */
|
||||
private String code;
|
||||
/** 参数值 */
|
||||
private String value;
|
||||
private Long sorts;
|
||||
|
||||
public String getFormmainId() {
|
||||
return formmainId;
|
||||
}
|
||||
|
||||
public void setFormmainId(String formmainId) {
|
||||
this.formmainId = formmainId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long getSorts() {
|
||||
return sorts;
|
||||
}
|
||||
|
||||
public void setSorts(Long sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
<?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.sys.integrationtask.workshop.dao.impl.IntegrationTaskWorkshopDetailsDaoImpl">
|
||||
|
||||
<resultMap id="get-IntegrationTaskWorkshopDetailsEntity-result" type="com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="formmainId" column="formmain_id" jdbcType="VARCHAR"/>
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
<result property="value" column="value" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "IntegrationTaskWorkshopDetailsEntity_Base_Column_List">
|
||||
id
|
||||
,formmain_id
|
||||
,code
|
||||
,value
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskWorkshopDetailsEntity-result" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskWorkshopDetailsEntity_Base_Column_List" />
|
||||
from integration_task_workshop_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id = #{formmainId} </if>
|
||||
<if test="code != null and code != ''"> and code = #{code} </if>
|
||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity">
|
||||
select count(1) from integration_task_workshop_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id = #{formmainId} </if>
|
||||
<if test="code != null and code != ''"> and code = #{code} </if>
|
||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskWorkshopDetailsEntity-result" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskWorkshopDetailsEntity_Base_Column_List" />
|
||||
from integration_task_workshop_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id like concat('%',#{formmainId},'%') </if>
|
||||
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
|
||||
<if test="value != null and value != ''"> and value like concat('%',#{value},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="IntegrationTaskWorkshopDetailsentity_list_or" resultMap="get-IntegrationTaskWorkshopDetailsEntity-result" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskWorkshopDetailsEntity_Base_Column_List" />
|
||||
from integration_task_workshop_details
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> or formmain_id = #{formmainId} </if>
|
||||
<if test="code != null and code != ''"> or code = #{code} </if>
|
||||
<if test="value != null and value != ''"> or value = #{value} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_workshop_details(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="formmainId != null and formmainId != ''"> formmain_id , </if>
|
||||
<if test="code != null and code != ''"> code , </if>
|
||||
<if test="value != null and value != ''"> value , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="formmainId != null and formmainId != ''"> #{formmainId} ,</if>
|
||||
<if test="code != null and code != ''"> #{code} ,</if>
|
||||
<if test="value != null and value != ''"> #{value} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_workshop_details a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_workshop_details(formmain_id, code, value, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.formmainId},#{entity.code},#{entity.value},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_workshop_details(formmain_id, code, value, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.formmainId},#{entity.code},#{entity.value},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
formmain_id = values(formmain_id),
|
||||
code = values(code),
|
||||
value = values(value),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity" >
|
||||
update integration_task_workshop_details set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="formmainId != null and formmainId != ''"> formmain_id = #{formmainId},</if>
|
||||
<if test="code != null and code != ''"> code = #{code},</if>
|
||||
<if test="value != null and value != ''"> value = #{value},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity" >
|
||||
update integration_task_workshop_details set sts= 'N'
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity" >
|
||||
update integration_task_workshop_details set sts= 'N'
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="formmainId != null and formmainId != ''"> and formmain_id = #{formmainId} </if>
|
||||
<if test="code != null and code != ''"> and code = #{code} </if>
|
||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from integration_task_workshop_details where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 任务工坊(IntegrationTaskWorkshop)实体类
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-10 14:41:03
|
||||
*/
|
||||
public class IntegrationTaskWorkshopEntity extends BaseEntity {
|
||||
|
||||
/** 工坊名称 */
|
||||
private String workshopName;
|
||||
/** 描述 */
|
||||
private String workshopDescribe;
|
||||
/** 场景ID */
|
||||
private String sceneid;
|
||||
/** 推送人id */
|
||||
private String sendUserId;
|
||||
/** 推送人名称 */
|
||||
private String sendUserName;
|
||||
/** 参数数据 */
|
||||
private String parameter;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
private Long sorts;
|
||||
|
||||
public String getWorkshopName() {
|
||||
return workshopName;
|
||||
}
|
||||
|
||||
public void setWorkshopName(String workshopName) {
|
||||
this.workshopName = workshopName;
|
||||
}
|
||||
|
||||
public String getWorkshopDescribe() {
|
||||
return workshopDescribe;
|
||||
}
|
||||
|
||||
public void setWorkshopDescribe(String workshopDescribe) {
|
||||
this.workshopDescribe = workshopDescribe;
|
||||
}
|
||||
|
||||
public String getSceneid() {
|
||||
return sceneid;
|
||||
}
|
||||
|
||||
public void setSceneid(String sceneid) {
|
||||
this.sceneid = sceneid;
|
||||
}
|
||||
|
||||
public String getSendUserId() {
|
||||
return sendUserId;
|
||||
}
|
||||
|
||||
public void setSendUserId(String sendUserId) {
|
||||
this.sendUserId = sendUserId;
|
||||
}
|
||||
|
||||
public String getSendUserName() {
|
||||
return sendUserName;
|
||||
}
|
||||
|
||||
public void setSendUserName(String sendUserName) {
|
||||
this.sendUserName = sendUserName;
|
||||
}
|
||||
|
||||
public String getParameter() {
|
||||
return parameter;
|
||||
}
|
||||
|
||||
public void setParameter(String parameter) {
|
||||
this.parameter = parameter;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public void setSorts(Long sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
<?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.sys.integrationtask.workshop.dao.impl.IntegrationTaskWorkshopDaoImpl">
|
||||
|
||||
<resultMap id="get-IntegrationTaskWorkshopEntity-result" type="com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="workshopName" column="workshop_name" jdbcType="VARCHAR"/>
|
||||
<result property="workshopDescribe" column="workshop_describe" jdbcType="VARCHAR"/>
|
||||
<result property="sceneid" column="sceneid" jdbcType="VARCHAR"/>
|
||||
<result property="sendUserId" column="send_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="sendUserName" column="send_user_name" jdbcType="VARCHAR"/>
|
||||
<result property="parameter" column="parameter" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "IntegrationTaskWorkshopEntity_Base_Column_List">
|
||||
id
|
||||
,workshop_name
|
||||
,workshop_describe
|
||||
,sceneid
|
||||
,send_user_id
|
||||
,send_user_name
|
||||
,parameter
|
||||
,remark
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskWorkshopEntity-result" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskWorkshopEntity_Base_Column_List" />
|
||||
from integration_task_workshop
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="workshopName != null and workshopName != ''"> and workshop_name = #{workshopName} </if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> and workshop_describe = #{workshopDescribe} </if>
|
||||
<if test="sceneid != null and sceneid != ''"> and sceneid = #{sceneid} </if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> and send_user_id = #{sendUserId} </if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> and send_user_name = #{sendUserName} </if>
|
||||
<if test="parameter != null and parameter != ''"> and parameter = #{parameter} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity">
|
||||
select count(1) from integration_task_workshop
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="workshopName != null and workshopName != ''"> and workshop_name = #{workshopName} </if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> and workshop_describe = #{workshopDescribe} </if>
|
||||
<if test="sceneid != null and sceneid != ''"> and sceneid = #{sceneid} </if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> and send_user_id = #{sendUserId} </if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> and send_user_name = #{sendUserName} </if>
|
||||
<if test="parameter != null and parameter != ''"> and parameter = #{parameter} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort ==''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskWorkshopEntity-result" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskWorkshopEntity_Base_Column_List" />
|
||||
from integration_task_workshop
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%',#{workshopName},'%') </if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> and workshop_describe like concat('%',#{workshopDescribe},'%') </if>
|
||||
<if test="sceneid != null and sceneid != ''"> and sceneid like concat('%',#{sceneid},'%') </if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> and send_user_id like concat('%',#{sendUserId},'%') </if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> and send_user_name like concat('%',#{sendUserName},'%') </if>
|
||||
<if test="parameter != null and parameter != ''"> and parameter like concat('%',#{parameter},'%') </if>
|
||||
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="IntegrationTaskWorkshopentity_list_or" resultMap="get-IntegrationTaskWorkshopEntity-result" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskWorkshopEntity_Base_Column_List" />
|
||||
from integration_task_workshop
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="workshopName != null and workshopName != ''"> or workshop_name = #{workshopName} </if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> or workshop_describe = #{workshopDescribe} </if>
|
||||
<if test="sceneid != null and sceneid != ''"> or sceneid = #{sceneid} </if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> or send_user_id = #{sendUserId} </if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> or send_user_name = #{sendUserName} </if>
|
||||
<if test="parameter != null and parameter != ''"> or parameter = #{parameter} </if>
|
||||
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_workshop(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="workshopName != null and workshopName != ''"> workshop_name , </if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> workshop_describe , </if>
|
||||
<if test="sceneid != null and sceneid != ''"> sceneid , </if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> send_user_id , </if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> send_user_name , </if>
|
||||
<if test="parameter != null and parameter != ''"> parameter , </if>
|
||||
<if test="remark != null and remark != ''"> remark , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="workshopName != null and workshopName != ''"> #{workshopName} ,</if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> #{workshopDescribe} ,</if>
|
||||
<if test="sceneid != null and sceneid != ''"> #{sceneid} ,</if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> #{sendUserId} ,</if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> #{sendUserName} ,</if>
|
||||
<if test="parameter != null and parameter != ''"> #{parameter} ,</if>
|
||||
<if test="remark != null and remark != ''"> #{remark} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_workshop a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_workshop(workshop_name, workshop_describe, sceneid, send_user_id, send_user_name, parameter, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.workshopName},#{entity.workshopDescribe},#{entity.sceneid},#{entity.sendUserId},#{entity.sendUserName},#{entity.parameter},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_workshop(workshop_name, workshop_describe, sceneid, send_user_id, send_user_name, parameter, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.workshopName},#{entity.workshopDescribe},#{entity.sceneid},#{entity.sendUserId},#{entity.sendUserName},#{entity.parameter},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
workshop_name = values(workshop_name),
|
||||
workshop_describe = values(workshop_describe),
|
||||
sceneid = values(sceneid),
|
||||
send_user_id = values(send_user_id),
|
||||
send_user_name = values(send_user_name),
|
||||
parameter = values(parameter),
|
||||
remark = values(remark),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity" >
|
||||
update integration_task_workshop set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="workshopName != null and workshopName != ''"> workshop_name = #{workshopName},</if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> workshop_describe = #{workshopDescribe},</if>
|
||||
<if test="sceneid != null and sceneid != ''"> sceneid = #{sceneid},</if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> send_user_id = #{sendUserId},</if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> send_user_name = #{sendUserName},</if>
|
||||
<if test="parameter != null and parameter != ''"> parameter = #{parameter},</if>
|
||||
<if test="remark != null and remark != ''"> remark = #{remark},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity" >
|
||||
update integration_task_workshop set sts= 'N'
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity" >
|
||||
update integration_task_workshop set sts= 'N'
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="workshopName != null and workshopName != ''"> and workshop_name = #{workshopName} </if>
|
||||
<if test="workshopDescribe != null and workshopDescribe != ''"> and workshop_describe = #{workshopDescribe} </if>
|
||||
<if test="sceneid != null and sceneid != ''"> and sceneid = #{sceneid} </if>
|
||||
<if test="sendUserId != null and sendUserId != ''"> and send_user_id = #{sendUserId} </if>
|
||||
<if test="sendUserName != null and sendUserName != ''"> and send_user_name = #{sendUserName} </if>
|
||||
<if test="parameter != null and parameter != ''"> and parameter = #{parameter} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from integration_task_workshop where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity;
|
||||
|
||||
/**
|
||||
* 参数列表(IntegrationTaskWorkshopDetails)表服务接口
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-10 14:41:36
|
||||
*/
|
||||
public interface IIntegrationTaskWorkshopDetailsService extends IBaseService<IntegrationTaskWorkshopDetailsEntity, String>{
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 任务工坊(IntegrationTaskWorkshop)表服务接口
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-07 17:03:33
|
||||
*/
|
||||
public interface IIntegrationTaskWorkshopService extends IBaseService<IntegrationTaskWorkshopEntity, String>{
|
||||
|
||||
/***
|
||||
* 推送场景集成任务
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-08 15:14
|
||||
* @param requestJsonObj
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @exception 场景任务调用时有可能发生异常
|
||||
**/
|
||||
JsonResultEntity pushBusinessInterface(JSONObject requestJsonObj) throws Exception;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.service.impl;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.dao.IIntegrationTaskWorkshopDetailsDao;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.service.IIntegrationTaskWorkshopDetailsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 参数列表(IntegrationTaskWorkshopDetails)表服务实现类
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-10 14:41:37
|
||||
*/
|
||||
//@Service("integrationTaskWorkshopDetailsService")
|
||||
public class IntegrationTaskWorkshopDetailsServiceImpl extends BaseService<IntegrationTaskWorkshopDetailsEntity, String> implements IIntegrationTaskWorkshopDetailsService {
|
||||
|
||||
private IIntegrationTaskWorkshopDetailsDao integrationTaskWorkshopDetailsDao;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskWorkshopDetailsDao(IIntegrationTaskWorkshopDetailsDao dao) {
|
||||
this.integrationTaskWorkshopDetailsDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -1,226 +0,0 @@
|
|||
package com.hzya.frame.sys.integrationtask.workshop.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.sys.apireflection.dao.IApiReflectionDao;
|
||||
import com.hzya.frame.sys.apireflection.entity.ApiReflectionEntity;
|
||||
import com.hzya.frame.sys.apireflection.service.impl.ApiHandleServiceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.service.impl.IntegrationTaskMonitoringServiceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.service.IIntegrationTaskService;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.dao.IIntegrationTaskWorkshopDetailsDao;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopDetailsEntity;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.entity.IntegrationTaskWorkshopEntity;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.dao.IIntegrationTaskWorkshopDao;
|
||||
import com.hzya.frame.sys.integrationtask.workshop.service.IIntegrationTaskWorkshopService;
|
||||
import com.hzya.frame.util.PluginUtils;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.quartz.CronExpression;
|
||||
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.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务工坊(IntegrationTaskWorkshop)表服务实现类
|
||||
*
|
||||
* @author xiaoguo
|
||||
* @since 2023-08-07 17:03:33
|
||||
*/
|
||||
@Service("integrationTaskWorkshopService")
|
||||
public class IntegrationTaskWorkshopServiceImpl extends BaseService<IntegrationTaskWorkshopEntity, String> implements IIntegrationTaskWorkshopService {
|
||||
//@Resource
|
||||
private ApiHandleServiceImpl apiHandleService;
|
||||
//@Resource
|
||||
private IApiReflectionDao apiReflectionDao;
|
||||
//@Resource
|
||||
private IntegrationTaskMonitoringServiceImpl integrationTaskMonitoringService;
|
||||
//@Resource
|
||||
private IIntegrationTaskService integrationTaskService;
|
||||
|
||||
private IIntegrationTaskWorkshopDao integrationTaskWorkshopDao;
|
||||
|
||||
//@Resource
|
||||
private IIntegrationTaskWorkshopDetailsDao detailsDao;
|
||||
|
||||
//@Autowired
|
||||
public void setIntegrationTaskWorkshopDao(IIntegrationTaskWorkshopDao dao) {
|
||||
this.integrationTaskWorkshopDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/****
|
||||
* 重新保存方法,把明细表参数赋值给主表字段
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-10 10:29
|
||||
* @param
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveJson(JSONObject object) {
|
||||
JSONObject mainData = object.getJSONObject("jsonStr");
|
||||
JSONArray workshopDetails = mainData.getJSONArray("integration_task_workshop_details_Detail");
|
||||
IntegrationTaskWorkshopEntity integrationTaskWorkshopEntity = JSON.parseObject(mainData.toJSONString(),IntegrationTaskWorkshopEntity.class);
|
||||
integrationTaskWorkshopEntity.setParameter(workshopDetails.toJSONString());
|
||||
integrationTaskWorkshopDao.save(integrationTaskWorkshopEntity);
|
||||
//保存明细表
|
||||
for(Object detailsObj : workshopDetails){
|
||||
IntegrationTaskWorkshopDetailsEntity integrationTaskWorkshopDetailsEntity = JSON.parseObject(detailsObj.toString(),IntegrationTaskWorkshopDetailsEntity.class);
|
||||
integrationTaskWorkshopDetailsEntity.setFormmainId(integrationTaskWorkshopEntity.getId());
|
||||
integrationTaskWorkshopDetailsEntity.setId( UUIDLong.absLongUUIDStr());
|
||||
detailsDao.save(integrationTaskWorkshopDetailsEntity);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("任务工坊保存成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity updateJson(JSONObject object) {
|
||||
JSONObject mainData = object.getJSONObject("jsonStr");
|
||||
JSONArray workshopDetails = mainData.getJSONArray("integration_task_workshop_details_Detail");
|
||||
IntegrationTaskWorkshopEntity integrationTaskWorkshopEntity = JSON.parseObject(mainData.toJSONString(),IntegrationTaskWorkshopEntity.class);
|
||||
integrationTaskWorkshopEntity.setParameter(workshopDetails.toJSONString());
|
||||
integrationTaskWorkshopDao.update(integrationTaskWorkshopEntity);
|
||||
IntegrationTaskWorkshopDetailsEntity removeEntity = new IntegrationTaskWorkshopDetailsEntity();
|
||||
removeEntity.setFormmainId(integrationTaskWorkshopEntity.getId());
|
||||
detailsDao.logicRemoveMultiCondition(removeEntity);
|
||||
//保存明细表
|
||||
for(Object detailsObj : workshopDetails){
|
||||
IntegrationTaskWorkshopDetailsEntity integrationTaskWorkshopDetailsEntity = JSON.parseObject(detailsObj.toString(),IntegrationTaskWorkshopDetailsEntity.class);
|
||||
integrationTaskWorkshopDetailsEntity.setFormmainId(integrationTaskWorkshopEntity.getId());
|
||||
integrationTaskWorkshopDetailsEntity.setId( UUIDLong.absLongUUIDStr());
|
||||
detailsDao.save(integrationTaskWorkshopDetailsEntity);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("任务工坊修改成功");
|
||||
}
|
||||
|
||||
/***
|
||||
* 推送接口方法,此处需要根据场景id调用二林哥接口,同时需要处理查询左边数据接口时传递参数
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-08 9:00
|
||||
* @param
|
||||
* @return void
|
||||
**/
|
||||
/*@Override
|
||||
public JsonResultEntity pushBusinessInterface(JSONObject requestJsonObj) throws Exception {
|
||||
|
||||
JSONObject jsonData = requestJsonObj.getJSONObject("jsonStr");
|
||||
String sceneId = jsonData.getString("sceneid");
|
||||
JSONObject parameters = jsonData.getJSONObject("parameter");
|
||||
ApiReflectionEntity apiReflectionEntity = apiReflectionDao.get(sceneId);
|
||||
if(null == apiReflectionEntity){
|
||||
throw new BaseSystemException("根据场景ID未查询到场景集成!场景ID"+sceneId);
|
||||
}
|
||||
String plug = apiReflectionEntity.getPlug();
|
||||
String plug_id = apiReflectionEntity.getPlug_id();
|
||||
//是插件
|
||||
String isPlug = "1";
|
||||
// 如果是插件,调用插件方法,否则调用二林哥方法
|
||||
if(isPlug.equalsIgnoreCase(plug)){
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(plug_id);
|
||||
if(null != pluginBaseEntity){
|
||||
pluginBaseEntity.executeBusiness(jsonData);
|
||||
}
|
||||
}else{
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("ref_id",sceneId);
|
||||
jsonObject.put("left_interface_parameters",parameters.toJSONString());
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("jsonStr",jsonObject.toJSONString());
|
||||
apiHandleService.executeApi(req);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("推送成功!");
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
@Override
|
||||
public JsonResultEntity pushBusinessInterface(JSONObject requestJsonObj) throws Exception {
|
||||
JSONObject jsonData = requestJsonObj.getJSONObject("jsonStr");
|
||||
String sceneId = jsonData.getString("sceneid");
|
||||
JSONObject parameters = jsonData.getJSONObject("parameter");
|
||||
ApiReflectionEntity apiReflectionEntity = apiReflectionDao.get(sceneId);
|
||||
if(null == apiReflectionEntity){
|
||||
throw new BaseSystemException("根据场景ID未查询到场景集成!场景ID"+sceneId);
|
||||
}
|
||||
//定义空的 调用场景方法有返回得话,取返回值
|
||||
jsonData.put("result", "");
|
||||
jsonData.put("info", "");
|
||||
jsonData.put("task_type","前台任务");
|
||||
jsonData.put("task_id",jsonData.getString("id"));//将任务工坊id当作任务id
|
||||
//保存监控数据
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntities = integrationTaskMonitoringService.queryTaskMonitoringOne(jsonData);
|
||||
if (integrationTaskMonitoringEntities.size() == 0 || null == integrationTaskMonitoringEntities) {
|
||||
//触发时候,新增监控
|
||||
jsonData.put("plan_time",new Date());
|
||||
integrationTaskMonitoringService.saveIntegrationTaskMonitoring(jsonData);
|
||||
}
|
||||
//查询单个,得到上次修改时间,当前时间减去修改时间就是上次耗时时间
|
||||
int diff_timeMon = 0;
|
||||
if (integrationTaskMonitoringEntities.size() == 0) {
|
||||
diff_timeMon = 0;
|
||||
} else {
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = integrationTaskMonitoringEntities.get(0);
|
||||
diff_timeMon = Integer.valueOf((int) (new Date().getTime() - integrationTaskMonitoringEntity.getModify_time().getTime()));
|
||||
}
|
||||
jsonData.put("diff_time", diff_timeMon);
|
||||
//触发时候,修改任务监控执行次数
|
||||
integrationTaskMonitoringService.updateIntegrationTaskMonitoring(jsonData);
|
||||
String plug = apiReflectionEntity.getPlug();
|
||||
String plug_id = apiReflectionEntity.getPlug_id();
|
||||
//是插件
|
||||
String isPlug = "1";
|
||||
try {
|
||||
// 如果是插件,调用插件方法,否则调用二林哥方法
|
||||
if(isPlug.equalsIgnoreCase(plug)){
|
||||
try {
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(plug_id);
|
||||
if(null != pluginBaseEntity){
|
||||
String s = pluginBaseEntity.executeBusiness(jsonData);
|
||||
if("执行成功".equals(s)){
|
||||
jsonData.put("result","执行成功");
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
jsonData.put("result","执行失败");
|
||||
jsonData.put("instructions",e.getMessage());
|
||||
}
|
||||
}else{
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("ref_id",sceneId);
|
||||
jsonObject.put("left_interface_parameters",parameters.toJSONString());
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("jsonStr",jsonObject.toJSONString());
|
||||
JsonResultEntity jsonResultEntity = apiHandleService.executeApi(req);
|
||||
if ("执行成功".equals(jsonResultEntity.getMsg())) {
|
||||
jsonData.put("result", jsonResultEntity.getMsg());
|
||||
jsonData.put("info", jsonResultEntity.getAttribute());
|
||||
}else{
|
||||
jsonData.put("result", "执行失败");
|
||||
jsonData.put("instructions",jsonResultEntity.getMsg());
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("推送成功!");
|
||||
}catch (Exception e){
|
||||
jsonData.put("result","执行失败");
|
||||
//保存错误说明
|
||||
jsonData.put("instructions",e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("任务保存失败:"+e.getMessage());
|
||||
}finally {
|
||||
//保存日志和实例
|
||||
integrationTaskService.saveLogAndLiving(jsonData,new Date());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateTime;
|
|||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -36,6 +37,7 @@ import com.hzya.frame.sysnew.application.plugin.dao.ISysApplicationPluginDao;
|
|||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginDto;
|
||||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
|
||||
import com.hzya.frame.sysnew.application.service.ISysApplicationService;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.messageManage.dao.ISysMessageManageDao;
|
||||
import com.hzya.frame.sysnew.messageManage.entity.SysMessageManageEntity;
|
||||
import com.hzya.frame.sysnew.messageManageDetail.dao.ISysMessageManageDetailDao;
|
||||
|
@ -118,6 +120,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
@Resource
|
||||
private ISysMessageManageDetailDao sysMessageManageDetailDao; //明细表
|
||||
|
||||
@Resource
|
||||
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
@Resource
|
||||
private TaskExecutor taskExecutor;
|
||||
//
|
||||
|
@ -1325,7 +1329,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//查询接口
|
||||
SysApplicationPluginEntity sysApplicationPluginEntity = sysApplicationPluginDao.get(entity.getId());
|
||||
SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(entity.getId());
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationPluginEntity);
|
||||
}
|
||||
|
||||
|
@ -1347,7 +1351,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
}
|
||||
entity.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
entity.setModify_time(new Date());
|
||||
sysApplicationPluginDao.update(entity);
|
||||
iIntegrationTaskCacheableService.updateSysApplicationPluginEntity(entity);
|
||||
return BaseResult.getSuccessMessageEntity("修改插件成功", entity.getId());
|
||||
}
|
||||
|
||||
|
@ -1370,7 +1374,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
entity.setSts("N");
|
||||
entity.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
entity.setModify_time(new Date());
|
||||
sysApplicationPluginDao.update(entity);
|
||||
iIntegrationTaskCacheableService.updateSysApplicationPluginEntity(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除插件成功", entity.getId());
|
||||
}
|
||||
|
||||
|
@ -1395,7 +1399,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
}
|
||||
entity.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
entity.setModify_time(new Date());
|
||||
sysApplicationPluginDao.update(entity);
|
||||
iIntegrationTaskCacheableService.updateSysApplicationPluginEntity(entity);
|
||||
if ("1".equals(entity.getPluginStatus())) {// 1启用2停用
|
||||
return BaseResult.getSuccessMessageEntity("启用成功");
|
||||
} else {
|
||||
|
@ -1611,9 +1615,6 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
public JsonResultEntity externalCallInterface(ServletRequest servletRequest, ServletResponse servletResponse) {
|
||||
|
||||
//例如:A应用发送数据到中台,中台转发到B应用
|
||||
long jrff = System.currentTimeMillis();
|
||||
long fsqsj = 0L;
|
||||
long fshsj = 0L;
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
String oldbodys = ServletUtil.getBody(servletRequest);
|
||||
Map<String, String> oldheaderMap = ServletUtil.getHeaderMap(request);
|
||||
|
@ -1747,6 +1748,15 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
}
|
||||
List<String> a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"});
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
if(receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())){
|
||||
JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn());
|
||||
if(jsonArray != null && jsonArray.size() > 0){
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject object = jsonArray.getJSONObject(i);
|
||||
headers.put(object.getString("parameterName"), object.getString("example"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (headerMap != null && headerMap.size() > 0) {
|
||||
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
|
||||
if (!a.contains(entry.getKey())) {
|
||||
|
@ -1754,6 +1764,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ("POST".equals(method)) {
|
||||
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||
// HttpClient
|
||||
|
@ -1777,9 +1789,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
entity.setContentType("application/json");
|
||||
post.setEntity(entity);
|
||||
}
|
||||
fsqsj = System.currentTimeMillis();
|
||||
response = closeableHttpClient.execute(post);
|
||||
fshsj = System.currentTimeMillis();
|
||||
|
||||
HttpEntity entity = response.getEntity();
|
||||
synchronized (lock) {
|
||||
|
@ -1839,9 +1849,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
|
||||
boolean flag = true;
|
||||
try {
|
||||
fsqsj = System.currentTimeMillis();
|
||||
response = closeableHttpClient.execute(get);
|
||||
fshsj = System.currentTimeMillis();
|
||||
HttpEntity entity = response.getEntity();
|
||||
synchronized (lock) {
|
||||
body.append(EntityUtils.toString(entity));
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.hzya.frame.sysnew.integtationTask;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 集成任务(IntegrationTask)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:36:10
|
||||
*/
|
||||
public interface IIntegrationTaskCacheableService {
|
||||
|
||||
IntegrationTaskEntity getIntegrationTaskEntity(String id);
|
||||
|
||||
IntegrationTaskEntity updateIntegrationTaskEntity(IntegrationTaskEntity entity);
|
||||
|
||||
void deleteIntegrationTaskEntity(IntegrationTaskEntity entity);
|
||||
|
||||
|
||||
IntegrationTaskLivingEntity getIntegrationTaskLivingEntity(String id);
|
||||
|
||||
IntegrationTaskLivingEntity updateIntegrationTaskLivingEntity(IntegrationTaskLivingEntity entity);
|
||||
|
||||
void deleteIntegrationTaskLivingEntity(IntegrationTaskLivingEntity entity);
|
||||
|
||||
SysApplicationPluginEntity getSysApplicationPluginEntity(String id);
|
||||
|
||||
SysApplicationPluginEntity updateSysApplicationPluginEntity(SysApplicationPluginEntity entity);
|
||||
|
||||
void deleteSysApplicationPluginEntity(SysApplicationPluginEntity entity);
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
package com.hzya.frame.sysnew.integtationTask.dao;
|
||||
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 集成任务(integration_task: table)表数据库访问层
|
||||
|
@ -11,5 +13,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
|||
*/
|
||||
public interface IIntegrationTaskDao extends IBaseDao<IntegrationTaskEntity, String> {
|
||||
|
||||
List<IntegrationTaskEntity> IntegrationTaskEntity_maxCode(IntegrationTaskEntity entity);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,12 @@ package com.hzya.frame.sysnew.integtationTask.dao.impl;
|
|||
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.dao.IIntegrationTaskDao;
|
||||
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 集成任务(IntegrationTask)表数据库访问层
|
||||
*
|
||||
|
@ -12,6 +16,11 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
|||
*/
|
||||
@Repository(value = "IntegrationTaskDaoImpl")
|
||||
public class IntegrationTaskDaoImpl extends MybatisGenericDao<IntegrationTaskEntity, String> implements IIntegrationTaskDao{
|
||||
|
||||
|
||||
@Override
|
||||
public List<IntegrationTaskEntity> IntegrationTaskEntity_maxCode(IntegrationTaskEntity entity) {
|
||||
List<IntegrationTaskEntity> o = super.query(getSqlIdPrifx() + "IntegrationTaskEntity_maxCode", entity);
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@ public class IntegrationTaskEntity extends BaseEntity {
|
|||
private String funInfo;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
/** 执行策略1、立即执行2、定时 */
|
||||
private String taskRun;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
|
||||
|
@ -96,14 +94,6 @@ public class IntegrationTaskEntity extends BaseEntity {
|
|||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getTaskRun() {
|
||||
return taskRun;
|
||||
}
|
||||
|
||||
public void setTaskRun(String taskRun) {
|
||||
this.taskRun = taskRun;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
|
|
@ -2,28 +2,28 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sysnew.integtationTask.dao.impl.IntegrationTaskDaoImpl">
|
||||
|
||||
<resultMap id="get-IntegrationTaskEntity-result" type="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="taskCode" column="task_code" jdbcType="VARCHAR"/>
|
||||
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
|
||||
<result property="taskCron" column="task_cron" jdbcType="VARCHAR"/>
|
||||
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
|
||||
<result property="taskApp" column="task_app" jdbcType="VARCHAR"/>
|
||||
<result property="taskPlugin" column="task_plugin" jdbcType="VARCHAR"/>
|
||||
<result property="funInfo" column="fun_info" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="taskRun" column="task_run" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<resultMap id="get-IntegrationTaskEntity-result"
|
||||
type="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="taskCode" column="task_code" jdbcType="VARCHAR"/>
|
||||
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
|
||||
<result property="taskCron" column="task_cron" jdbcType="VARCHAR"/>
|
||||
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
|
||||
<result property="taskApp" column="task_app" jdbcType="VARCHAR"/>
|
||||
<result property="taskPlugin" column="task_plugin" jdbcType="VARCHAR"/>
|
||||
<result property="funInfo" column="fun_info" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "IntegrationTaskEntity_Base_Column_List">
|
||||
<sql id="IntegrationTaskEntity_Base_Column_List">
|
||||
id
|
||||
,task_code
|
||||
,task_name
|
||||
|
@ -33,8 +33,7 @@
|
|||
,task_plugin
|
||||
,fun_info
|
||||
,remark
|
||||
,task_run
|
||||
,sorts
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
|
@ -43,258 +42,281 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskEntity-result" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode} </if>
|
||||
<if test="taskName != null and taskName != ''"> and task_name = #{taskName} </if>
|
||||
<if test="taskCron != null and taskCron != ''"> and task_cron = #{taskCron} </if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus} </if>
|
||||
<if test="taskApp != null and taskApp != ''"> and task_app = #{taskApp} </if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> and task_plugin = #{taskPlugin} </if>
|
||||
<if test="funInfo != null and funInfo != ''"> and fun_info = #{funInfo} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="taskRun != null and taskRun != ''"> and task_run = #{taskRun} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List"/>
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name = #{taskName}</if>
|
||||
<if test="taskCron != null and taskCron != ''">and task_cron = #{taskCron}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status = #{taskStatus}</if>
|
||||
<if test="taskApp != null and taskApp != ''">and task_app = #{taskApp}</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">and task_plugin = #{taskPlugin}</if>
|
||||
<if test="funInfo != null and funInfo != ''">and fun_info = #{funInfo}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select count(1) from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode} </if>
|
||||
<if test="taskName != null and taskName != ''"> and task_name = #{taskName} </if>
|
||||
<if test="taskCron != null and taskCron != ''"> and task_cron = #{taskCron} </if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus} </if>
|
||||
<if test="taskApp != null and taskApp != ''"> and task_app = #{taskApp} </if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> and task_plugin = #{taskPlugin} </if>
|
||||
<if test="funInfo != null and funInfo != ''"> and fun_info = #{funInfo} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="taskRun != null and taskRun != ''"> and task_run = #{taskRun} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List"/>
|
||||
from integration_task where id = #{id} and sts = 'Y'
|
||||
</select>
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select count(1) from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name = #{taskName}</if>
|
||||
<if test="taskCron != null and taskCron != ''">and task_cron = #{taskCron}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status = #{taskStatus}</if>
|
||||
<if test="taskApp != null and taskApp != ''">and task_app = #{taskApp}</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">and task_plugin = #{taskPlugin}</if>
|
||||
<if test="funInfo != null and funInfo != ''">and fun_info = #{funInfo}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskEntity-result" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code like concat('%',#{taskCode},'%') </if>
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%',#{taskName},'%') </if>
|
||||
<if test="taskCron != null and taskCron != ''"> and task_cron like concat('%',#{taskCron},'%') </if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status like concat('%',#{taskStatus},'%') </if>
|
||||
<if test="taskApp != null and taskApp != ''"> and task_app like concat('%',#{taskApp},'%') </if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> and task_plugin like concat('%',#{taskPlugin},'%') </if>
|
||||
<if test="funInfo != null and funInfo != ''"> and fun_info like concat('%',#{funInfo},'%') </if>
|
||||
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
|
||||
<if test="taskRun != null and taskRun != ''"> and task_run like concat('%',#{taskRun},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||
<select id="entity_list_like" resultMap="get-IntegrationTaskEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List"/>
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code like concat('%',#{taskCode},'%')</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name like concat('%',#{taskName},'%')</if>
|
||||
<if test="taskCron != null and taskCron != ''">and task_cron like concat('%',#{taskCron},'%')</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status like concat('%',#{taskStatus},'%')</if>
|
||||
<if test="taskApp != null and taskApp != ''">and task_app like concat('%',#{taskApp},'%')</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">and task_plugin like concat('%',#{taskPlugin},'%')</if>
|
||||
<if test="funInfo != null and funInfo != ''">and fun_info like concat('%',#{funInfo},'%')</if>
|
||||
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="IntegrationTaskentity_list_or" resultMap="get-IntegrationTaskEntity-result" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List" />
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="taskCode != null and taskCode != ''"> or task_code = #{taskCode} </if>
|
||||
<if test="taskName != null and taskName != ''"> or task_name = #{taskName} </if>
|
||||
<if test="taskCron != null and taskCron != ''"> or task_cron = #{taskCron} </if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> or task_status = #{taskStatus} </if>
|
||||
<if test="taskApp != null and taskApp != ''"> or task_app = #{taskApp} </if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> or task_plugin = #{taskPlugin} </if>
|
||||
<if test="funInfo != null and funInfo != ''"> or fun_info = #{funInfo} </if>
|
||||
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
|
||||
<if test="taskRun != null and taskRun != ''"> or task_run = #{taskRun} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="IntegrationTaskentity_list_or" resultMap="get-IntegrationTaskEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskEntity_Base_Column_List"/>
|
||||
from integration_task
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="taskCode != null and taskCode != ''">or task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">or task_name = #{taskName}</if>
|
||||
<if test="taskCron != null and taskCron != ''">or task_cron = #{taskCron}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">or task_status = #{taskStatus}</if>
|
||||
<if test="taskApp != null and taskApp != ''">or task_app = #{taskApp}</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">or task_plugin = #{taskPlugin}</if>
|
||||
<if test="funInfo != null and funInfo != ''">or fun_info = #{funInfo}</if>
|
||||
<if test="remark != null and remark != ''">or remark = #{remark}</if>
|
||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="taskCode != null and taskCode != ''"> task_code , </if>
|
||||
<if test="taskName != null and taskName != ''"> task_name , </if>
|
||||
<if test="taskCron != null and taskCron != ''"> task_cron , </if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> task_status , </if>
|
||||
<if test="taskApp != null and taskApp != ''"> task_app , </if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> task_plugin , </if>
|
||||
<if test="funInfo != null and funInfo != ''"> fun_info , </if>
|
||||
<if test="remark != null and remark != ''"> remark , </if>
|
||||
<if test="taskRun != null and taskRun != ''"> task_run , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="taskCode != null and taskCode != ''"> #{taskCode} ,</if>
|
||||
<if test="taskName != null and taskName != ''"> #{taskName} ,</if>
|
||||
<if test="taskCron != null and taskCron != ''"> #{taskCron} ,</if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> #{taskStatus} ,</if>
|
||||
<if test="taskApp != null and taskApp != ''"> #{taskApp} ,</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> #{taskPlugin} ,</if>
|
||||
<if test="funInfo != null and funInfo != ''"> #{funInfo} ,</if>
|
||||
<if test="remark != null and remark != ''"> #{remark} ,</if>
|
||||
<if test="taskRun != null and taskRun != ''"> #{taskRun} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task(task_code, task_name, task_cron, task_status, task_app, task_plugin, fun_info, remark, task_run, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskCode},#{entity.taskName},#{entity.taskCron},#{entity.taskStatus},#{entity.taskApp},#{entity.taskPlugin},#{entity.funInfo},#{entity.remark},#{entity.taskRun},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task(task_code, task_name, task_cron, task_status, task_app, task_plugin, fun_info, remark, task_run, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskCode},#{entity.taskName},#{entity.taskCron},#{entity.taskStatus},#{entity.taskApp},#{entity.taskPlugin},#{entity.funInfo},#{entity.remark},#{entity.taskRun},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
task_code = values(task_code),
|
||||
task_name = values(task_name),
|
||||
task_cron = values(task_cron),
|
||||
task_status = values(task_status),
|
||||
task_app = values(task_app),
|
||||
task_plugin = values(task_plugin),
|
||||
fun_info = values(fun_info),
|
||||
remark = values(remark),
|
||||
task_run = values(task_run),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity" >
|
||||
update integration_task set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''"> task_code = #{taskCode},</if>
|
||||
<if test="taskName != null and taskName != ''"> task_name = #{taskName},</if>
|
||||
<if test="taskCron != null and taskCron != ''"> task_cron = #{taskCron},</if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> task_status = #{taskStatus},</if>
|
||||
<if test="taskApp != null and taskApp != ''"> task_app = #{taskApp},</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> task_plugin = #{taskPlugin},</if>
|
||||
<if test="funInfo != null and funInfo != ''"> fun_info = #{funInfo},</if>
|
||||
<if test="remark != null and remark != ''"> remark = #{remark},</if>
|
||||
<if test="taskRun != null and taskRun != ''"> task_run = #{taskRun},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity" >
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
insert into integration_task(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="taskCode != null and taskCode != ''">task_code ,</if>
|
||||
<if test="taskName != null and taskName != ''">task_name ,</if>
|
||||
<if test="taskCron != null and taskCron != ''">task_cron ,</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">task_status ,</if>
|
||||
<if test="taskApp != null and taskApp != ''">task_app ,</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">task_plugin ,</if>
|
||||
<if test="funInfo != null and funInfo != ''">fun_info ,</if>
|
||||
<if test="remark != null and remark != ''">remark ,</if>
|
||||
<if test="sorts != null">sorts ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||
<if test="create_time != null">create_time ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||
<if test="modify_time != null">modify_time ,</if>
|
||||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id} ,</if>
|
||||
<if test="taskCode != null and taskCode != ''">#{taskCode} ,</if>
|
||||
<if test="taskName != null and taskName != ''">#{taskName} ,</if>
|
||||
<if test="taskCron != null and taskCron != ''">#{taskCron} ,</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">#{taskStatus} ,</if>
|
||||
<if test="taskApp != null and taskApp != ''">#{taskApp} ,</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">#{taskPlugin} ,</if>
|
||||
<if test="funInfo != null and funInfo != ''">#{funInfo} ,</if>
|
||||
<if test="remark != null and remark != ''">#{remark} ,</if>
|
||||
<if test="sorts != null">#{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch">
|
||||
insert into integration_task(task_code, task_name, task_cron, task_status, task_app, task_plugin, fun_info,
|
||||
remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskCode},#{entity.taskName},#{entity.taskCron},#{entity.taskStatus},#{entity.taskApp},#{entity.taskPlugin},#{entity.funInfo},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch">
|
||||
insert into integration_task(task_code, task_name, task_cron, task_status, task_app, task_plugin, fun_info,
|
||||
remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskCode},#{entity.taskName},#{entity.taskCron},#{entity.taskStatus},#{entity.taskApp},#{entity.taskPlugin},#{entity.funInfo},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
task_code = values(task_code),
|
||||
task_name = values(task_name),
|
||||
task_cron = values(task_cron),
|
||||
task_status = values(task_status),
|
||||
task_app = values(task_app),
|
||||
task_plugin = values(task_plugin),
|
||||
fun_info = values(fun_info),
|
||||
remark = values(remark),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
update integration_task set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
|
||||
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
||||
<if test="taskCron != null and taskCron != ''">task_cron = #{taskCron},</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">task_status = #{taskStatus},</if>
|
||||
<if test="taskApp != null and taskApp != ''">task_app = #{taskApp},</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">task_plugin = #{taskPlugin},</if>
|
||||
<if test="funInfo != null and funInfo != ''">fun_info = #{funInfo},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null">create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
update integration_task 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.integtationTask.entity.IntegrationTaskEntity" >
|
||||
update integration_task set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode} </if>
|
||||
<if test="taskName != null and taskName != ''"> and task_name = #{taskName} </if>
|
||||
<if test="taskCron != null and taskCron != ''"> and task_cron = #{taskCron} </if>
|
||||
<if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus} </if>
|
||||
<if test="taskApp != null and taskApp != ''"> and task_app = #{taskApp} </if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''"> and task_plugin = #{taskPlugin} </if>
|
||||
<if test="funInfo != null and funInfo != ''"> and fun_info = #{funInfo} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="taskRun != null and taskRun != ''"> and task_run = #{taskRun} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity">
|
||||
update integration_task set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name = #{taskName}</if>
|
||||
<if test="taskCron != null and taskCron != ''">and task_cron = #{taskCron}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status = #{taskStatus}</if>
|
||||
<if test="taskApp != null and taskApp != ''">and task_app = #{taskApp}</if>
|
||||
<if test="taskPlugin != null and taskPlugin != ''">and task_plugin = #{taskPlugin}</if>
|
||||
<if test="funInfo != null and funInfo != ''">and fun_info = #{funInfo}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from integration_task where id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--查询最大编码+1-->
|
||||
<select id="IntegrationTaskEntity_maxCode" resultMap="get-IntegrationTaskEntity-result">
|
||||
select
|
||||
case when
|
||||
length(ifnull(max(right(task_code,4)), 0)+1)=2 then
|
||||
concat(concat(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-','00'),ifnull(max(right(task_code,4)), 0)+1)
|
||||
when
|
||||
length(ifnull(max(right(task_code,4)), 0)+1)=1 then
|
||||
concat(concat(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-','000'),ifnull(max(right(task_code,4)), 0)+1)
|
||||
when
|
||||
length(ifnull(max(right(task_code,4)), 0)+1)=3 then
|
||||
concat(concat(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-','0'),ifnull(max(right(task_code,4)), 0)+1)
|
||||
else
|
||||
concat(replace(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),'-',ifnull(max(right(task_code,4)), 0)+1)) end as task_code
|
||||
from integration_task where sts='Y' and task_code like concat('%',substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,10),'%')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
package com.hzya.frame.sysnew.integtationTask.service.impl;
|
||||
|
||||
import com.hzya.frame.sysnew.application.plugin.dao.ISysApplicationPluginDao;
|
||||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginDto;
|
||||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.integtationTask.dao.IIntegrationTaskDao;
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.dao.IIntegrationTaskLivingDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 集成任务缓存服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-05-06 15:36:12
|
||||
*/
|
||||
@Service(value = "integrationTaskCacheableService")
|
||||
public class IntegrationTaskCacheableServiceImpl implements IIntegrationTaskCacheableService {
|
||||
@Resource
|
||||
private IIntegrationTaskDao integrationTaskDao;
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDao iIntegrationTaskLivingDao;
|
||||
@Resource
|
||||
private ISysApplicationPluginDao iSysApplicationPluginDao;
|
||||
@Override
|
||||
@Cacheable(cacheNames="IntegrationTask",key = "#id")
|
||||
public IntegrationTaskEntity getIntegrationTaskEntity(String id) {
|
||||
IntegrationTaskEntity entity = null;
|
||||
if(id != null && !"".equals(id)){
|
||||
entity = integrationTaskDao.get(id);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@CachePut(cacheNames="IntegrationTask",key = "#entity.id",unless = "#result == null")
|
||||
public IntegrationTaskEntity updateIntegrationTaskEntity(IntegrationTaskEntity entity) {
|
||||
if(entity.getId() != null && !"".equals(entity.getId())){
|
||||
integrationTaskDao.update(entity);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@Override
|
||||
@CacheEvict(cacheNames="IntegrationTask",key = "#entity.id")
|
||||
public void deleteIntegrationTaskEntity(IntegrationTaskEntity entity) {
|
||||
integrationTaskDao.logicRemove(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Cacheable(cacheNames="IntegrationTaskLiving",key = "#id")
|
||||
public IntegrationTaskLivingEntity getIntegrationTaskLivingEntity(String id) {
|
||||
IntegrationTaskLivingEntity entity = null;
|
||||
if(id != null && !"".equals(id)){
|
||||
entity = iIntegrationTaskLivingDao.get(id);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@CachePut(cacheNames="IntegrationTaskLiving",key = "#entity.id",unless = "#result == null")
|
||||
public IntegrationTaskLivingEntity updateIntegrationTaskLivingEntity(IntegrationTaskLivingEntity entity) {
|
||||
if(entity.getId() != null && !"".equals(entity.getId())){
|
||||
iIntegrationTaskLivingDao.update(entity);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@Override
|
||||
@CacheEvict(cacheNames="IntegrationTaskLiving",key = "#entity.id")
|
||||
public void deleteIntegrationTaskLivingEntity(IntegrationTaskLivingEntity entity) {
|
||||
iIntegrationTaskLivingDao.logicRemove(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Cacheable(cacheNames="sysApplicationPlugin",key = "#id")
|
||||
public SysApplicationPluginEntity getSysApplicationPluginEntity(String id) {
|
||||
SysApplicationPluginEntity entity = null;
|
||||
if(id != null && !"".equals(id)){
|
||||
entity = iSysApplicationPluginDao.get(id);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@CachePut(cacheNames="sysApplicationPlugin",key = "#entity.id",unless = "#result == null")
|
||||
public SysApplicationPluginEntity updateSysApplicationPluginEntity(SysApplicationPluginEntity entity) {
|
||||
if(entity.getId() != null && !"".equals(entity.getId())){
|
||||
iSysApplicationPluginDao.update(entity);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@Override
|
||||
@CacheEvict(cacheNames="sysApplicationPlugin",key = "#entity.id")
|
||||
public void deleteSysApplicationPluginEntity(SysApplicationPluginEntity entity) {
|
||||
iSysApplicationPluginDao.logicRemove(entity);
|
||||
}
|
||||
}
|
|
@ -3,20 +3,27 @@ package com.hzya.frame.sysnew.integtationTask.service.impl;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.dao.IIntegrationTaskDao;
|
||||
import com.hzya.frame.sysnew.integtationTask.service.IIntegrationTaskService;
|
||||
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
|
||||
import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity;
|
||||
import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity;
|
||||
import com.hzya.frame.util.AESUtil;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.dao.IIntegrationTaskLivingDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import com.hzya.frame.web.quartz.QuartzJobFactoryUtils;
|
||||
import org.quartz.SchedulerException;
|
||||
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.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -27,207 +34,285 @@ import java.util.List;
|
|||
*/
|
||||
@Service(value = "integrationTaskService")
|
||||
public class IntegrationTaskServiceImpl extends BaseService<IntegrationTaskEntity, String> implements IIntegrationTaskService {
|
||||
|
||||
|
||||
private IIntegrationTaskDao integrationTaskDao;
|
||||
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDao iIntegrationTaskLivingDao;
|
||||
@Resource
|
||||
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
|
||||
@Autowired
|
||||
public void setIntegrationTaskDao(IIntegrationTaskDao dao) {
|
||||
this.integrationTaskDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
public void setIntegrationTaskDao(IIntegrationTaskDao dao) {
|
||||
this.integrationTaskDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询任务列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<IntegrationTaskEntity> list = integrationTaskDao.queryByLike(entity);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询任务列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<IntegrationTaskEntity> list = integrationTaskDao.queryByLike(entity);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询任务列表
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
entity = new IntegrationTaskEntity();
|
||||
}
|
||||
List<IntegrationTaskEntity> list = integrationTaskDao.queryByLike(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询任务列表
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
entity = new IntegrationTaskEntity();
|
||||
}
|
||||
List<IntegrationTaskEntity> list = integrationTaskDao.queryByLike(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存任务
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getTaskCode() == null || "".equals(entity.getTaskCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务编码");
|
||||
}
|
||||
if (entity.getTaskName() == null || "".equals(entity.getTaskName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务名称");
|
||||
}
|
||||
if (entity.getTaskApp() == null || "".equals(entity.getTaskApp())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用");
|
||||
}
|
||||
if (entity.getTaskPlugin() == null || "".equals(entity.getTaskPlugin())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用插件");
|
||||
}
|
||||
if (!checkIsUse(entity)) {
|
||||
return BaseResult.getFailureMessageEntity("当前任务编码已存在,请修改");
|
||||
}
|
||||
//保存
|
||||
integrationTaskDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存任务成功", entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param entity
|
||||
* @return boolean
|
||||
* @Author lvleigang
|
||||
* @Description 校验人员是否已经有配置
|
||||
* @Date 10:00 上午 2024/4/1
|
||||
**/
|
||||
private boolean checkIsUse(IntegrationTaskEntity entity) {
|
||||
IntegrationTaskEntity checkEntity = new IntegrationTaskEntity();
|
||||
checkEntity.setTaskCode(entity.getTaskCode());
|
||||
checkEntity.setSts("Y");//启用
|
||||
if (integrationTaskDao.getCount(checkEntity) > 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取任务
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = integrationTaskDao.get(entity.getId());
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("获取任务失败");
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("获取任务成功", entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改任务
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity updateEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getTaskCode() == null || "".equals(entity.getTaskCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务编码");
|
||||
}
|
||||
if (entity.getTaskName() == null || "".equals(entity.getTaskName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务名称");
|
||||
}
|
||||
if (entity.getTaskApp() == null || "".equals(entity.getTaskApp())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用");
|
||||
}
|
||||
if (entity.getTaskPlugin() == null || "".equals(entity.getTaskPlugin())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用插件");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
integrationTaskDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("修改任务成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除任务
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
integrationTaskDao.logicRemove(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除任务成功");
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存任务
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getTaskName() == null || "".equals(entity.getTaskName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务名称");
|
||||
}
|
||||
if (entity.getTaskApp() == null || "".equals(entity.getTaskApp())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用");
|
||||
}
|
||||
if (entity.getTaskPlugin() == null || "".equals(entity.getTaskPlugin())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用插件");
|
||||
}
|
||||
entity.setCreate();
|
||||
List<IntegrationTaskEntity> integrationTaskEntityMaxCode = integrationTaskDao.IntegrationTaskEntity_maxCode(entity);
|
||||
if (integrationTaskEntityMaxCode != null && integrationTaskEntityMaxCode.size() > 0) {
|
||||
String taskCode = "Task-" + integrationTaskEntityMaxCode.get(0).getTaskCode();
|
||||
entity.setTaskCode(taskCode);
|
||||
} else {
|
||||
String nowDateString = DateUtil.dateToString(new Date(), "yyyy-MM-dd");
|
||||
String taskCode = "Task-" + nowDateString + "-0000";
|
||||
entity.setTaskCode(taskCode);
|
||||
}
|
||||
//保存
|
||||
integrationTaskDao.save(entity);
|
||||
//保存实例表
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = new IntegrationTaskLivingEntity();
|
||||
integrationTaskLivingEntity.setTaskId(entity.getId());
|
||||
integrationTaskLivingEntity.setTaskCode(entity.getTaskCode());
|
||||
integrationTaskLivingEntity.setTaskName(entity.getTaskName());
|
||||
integrationTaskLivingEntity.setTaskStatus("2");
|
||||
integrationTaskLivingEntity.setRunNum(0);
|
||||
integrationTaskLivingEntity.setCreate();
|
||||
iIntegrationTaskLivingDao.save(integrationTaskLivingEntity);
|
||||
//任务状态1、启用2、停用
|
||||
if (entity.getTaskStatus() != null && "1".equals(entity.getTaskStatus())) {
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("integrationTaskId", entity.getId());//任务id
|
||||
jsonObjectMap.put("integrationTaskLivingId", integrationTaskLivingEntity.getId());//实例id
|
||||
//根据cron,定时执行任务
|
||||
try {
|
||||
QuartzJobFactoryUtils.createJob(jsonObjectMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("新增任务成功,创建任务失败");
|
||||
return BaseResult.getSuccessMessageEntity("新增任务成功,创建定时任务失败,请联系管理员", entity);
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("新增任务成功", entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用任务
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getTaskStatus() == null || "".equals(entity.getTaskStatus())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
integrationTaskDao.update(entity);//1、启用2、停用
|
||||
if ("1".equals(entity.getTaskStatus())) {
|
||||
return BaseResult.getSuccessMessageEntity("启用任务成功");
|
||||
} else {
|
||||
return BaseResult.getSuccessMessageEntity("停用任务成功");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param entity
|
||||
* @return boolean
|
||||
* @Author lvleigang
|
||||
* @Description 校验人员是否已经有配置
|
||||
* @Date 10:00 上午 2024/4/1
|
||||
**/
|
||||
private boolean checkIsUse(IntegrationTaskEntity entity) {
|
||||
IntegrationTaskEntity checkEntity = new IntegrationTaskEntity();
|
||||
checkEntity.setTaskCode(entity.getTaskCode());
|
||||
checkEntity.setSts("Y");//启用
|
||||
if (integrationTaskDao.getCount(checkEntity) > 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取任务
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = iIntegrationTaskCacheableService.getIntegrationTaskEntity(entity.getId());
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("获取任务失败");
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("获取任务成功", entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改任务
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity updateEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getTaskCode() == null || "".equals(entity.getTaskCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务编码");
|
||||
}
|
||||
if (entity.getTaskName() == null || "".equals(entity.getTaskName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入任务名称");
|
||||
}
|
||||
if (entity.getTaskApp() == null || "".equals(entity.getTaskApp())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用");
|
||||
}
|
||||
if (entity.getTaskPlugin() == null || "".equals(entity.getTaskPlugin())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择应用插件");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
entity = iIntegrationTaskCacheableService.updateIntegrationTaskEntity(entity);
|
||||
//实例表
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = new IntegrationTaskLivingEntity();
|
||||
integrationTaskLivingEntity.setTaskId(entity.getId());
|
||||
integrationTaskLivingEntity.setSts("Y");
|
||||
List<IntegrationTaskLivingEntity> integrationTaskLivingEntities = iIntegrationTaskLivingDao.queryBase(integrationTaskLivingEntity);
|
||||
if (integrationTaskLivingEntities != null && integrationTaskLivingEntities.size() == 1) {
|
||||
integrationTaskLivingEntity = integrationTaskLivingEntities.get(0);
|
||||
} else {
|
||||
throw new BaseSystemException("系统错误,请联系管理员");
|
||||
}
|
||||
//任务状态1、启用2、停用
|
||||
if (entity.getTaskStatus() != null && "1".equals(entity.getTaskStatus())) {
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("integrationTaskId", entity.getId());//任务id
|
||||
jsonObjectMap.put("integrationTaskLivingId", integrationTaskLivingEntity.getId());//实例id
|
||||
//根据cron,定时执行任务
|
||||
try {
|
||||
QuartzJobFactoryUtils.createJob(jsonObjectMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("修改任务成功,创建任务失败");
|
||||
return BaseResult.getSuccessMessageEntity("修改任务成功,修改定时任务失败,请联系管理员", entity);
|
||||
}
|
||||
} else if (entity.getTaskStatus() != null && "2".equals(entity.getTaskStatus())) {
|
||||
//停用的时候,由定时任务里面触发不自动停止任务
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("修改任务成功,修改定时任务成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除任务
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
iIntegrationTaskCacheableService.deleteIntegrationTaskEntity(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除任务成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用任务
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
|
||||
IntegrationTaskEntity entity = getData("jsonStr", jsonObject, IntegrationTaskEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getTaskStatus() == null || "".equals(entity.getTaskStatus())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
entity = iIntegrationTaskCacheableService.updateIntegrationTaskEntity(entity);
|
||||
if ("1".equals(entity.getTaskStatus())) {
|
||||
//实例表
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = new IntegrationTaskLivingEntity();
|
||||
integrationTaskLivingEntity.setTaskId(entity.getId());
|
||||
integrationTaskLivingEntity.setSts("Y");
|
||||
List<IntegrationTaskLivingEntity> integrationTaskLivingEntities = iIntegrationTaskLivingDao.queryBase(integrationTaskLivingEntity);
|
||||
if (integrationTaskLivingEntities != null && integrationTaskLivingEntities.size() == 1) {
|
||||
integrationTaskLivingEntity = integrationTaskLivingEntities.get(0);
|
||||
} else {
|
||||
throw new BaseSystemException("系统错误,请联系管理员");
|
||||
}
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("integrationTaskId", entity.getId());//任务id
|
||||
jsonObjectMap.put("integrationTaskLivingId", integrationTaskLivingEntity.getId());//实例id
|
||||
//根据cron,定时执行任务
|
||||
try {
|
||||
QuartzJobFactoryUtils.createJob(jsonObjectMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("修改任务成功,创建任务失败");
|
||||
return BaseResult.getSuccessMessageEntity("修改任务成功,修改定时任务失败,请联系管理员", entity);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("启用任务成功");
|
||||
} else {
|
||||
//停用的时候,由定时任务里面触发不自动停止任务
|
||||
return BaseResult.getSuccessMessageEntity("停用任务成功");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class IntegrationTaskLivingEntity extends BaseEntity {
|
|||
private String taskCode;
|
||||
/** 任务名称 */
|
||||
private String taskName;
|
||||
/** 任务状态1、执行中2、待执行3、错误 */
|
||||
/** 任务状态1、执行中2、待执行3、错误 4、当前任务已停止*/
|
||||
private String taskStatus;
|
||||
/** 上次开始时间 */
|
||||
private Date oldStartTime;
|
||||
|
|
|
@ -43,7 +43,15 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLivingEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_List"/>
|
||||
from integration_task_living where id = #{id} and sts = 'Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
|
||||
<select id="entity_list_base" resultMap="get-IntegrationTaskLivingEntity-result" parameterType = "com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingEntity_Base_Column_List" />
|
||||
|
@ -162,7 +170,7 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity" >
|
||||
insert into integration_task_living(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
|
@ -183,7 +191,6 @@
|
|||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -206,13 +213,12 @@
|
|||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from integration_task_living a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into integration_task_living(task_id, task_code, task_name, task_status, old_start_time, start_time, end_time, diff_time, run_num, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
|
@ -220,7 +226,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into integration_task_living(task_id, task_code, task_name, task_status, old_start_time, start_time, end_time, diff_time, run_num, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
|
|
|
@ -18,7 +18,7 @@ public class IntegrationTaskLivingDetailsEntity extends BaseEntity {
|
|||
private String taskCode;
|
||||
/** 任务名称 */
|
||||
private String taskName;
|
||||
/** 任务状态1、执行中2、执行成功 3、执行失败 */
|
||||
/** 任务状态1、执行中2、执行成功 3、执行失败 4\当前任务已停止*/
|
||||
private String taskStatus;
|
||||
/** 当前任务开始时间 */
|
||||
private Date startTime;
|
||||
|
@ -28,6 +28,8 @@ public class IntegrationTaskLivingDetailsEntity extends BaseEntity {
|
|||
private String diffTime;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
public String getTaskLinvingId() {
|
||||
|
@ -102,5 +104,12 @@ public class IntegrationTaskLivingDetailsEntity extends BaseEntity {
|
|||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
|
||||
<result property="taskCode" column="task_code" jdbcType="VARCHAR"/>
|
||||
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
|
||||
<result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
|
||||
|
@ -29,7 +30,8 @@
|
|||
,task_id
|
||||
,task_code
|
||||
,task_name
|
||||
,task_status
|
||||
,remark
|
||||
,task_status
|
||||
,start_time
|
||||
,end_time
|
||||
,diff_time
|
||||
|
@ -42,6 +44,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-IntegrationTaskLivingDetailsEntity-result">
|
||||
select
|
||||
<include refid="IntegrationTaskLivingDetailsEntity_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">
|
||||
|
@ -54,6 +62,7 @@
|
|||
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name = #{taskName}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status = #{taskStatus}</if>
|
||||
<if test="startTime != null">and start_time = #{startTime}</if>
|
||||
<if test="endTime != null">and end_time = #{endTime}</if>
|
||||
|
@ -82,6 +91,7 @@
|
|||
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name = #{taskName}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status = #{taskStatus}</if>
|
||||
<if test="startTime != null">and start_time = #{startTime}</if>
|
||||
<if test="endTime != null">and end_time = #{endTime}</if>
|
||||
|
@ -114,6 +124,7 @@
|
|||
<if test="taskId != null and taskId != ''">and task_id like concat('%',#{taskId},'%')</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code like concat('%',#{taskCode},'%')</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name like concat('%',#{taskName},'%')</if>
|
||||
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status like concat('%',#{taskStatus},'%')</if>
|
||||
<if test="startTime != null">and start_time like concat('%',#{startTime},'%')</if>
|
||||
<if test="endTime != null">and end_time like concat('%',#{endTime},'%')</if>
|
||||
|
@ -148,6 +159,7 @@
|
|||
<if test="taskId != null and taskId != ''">or task_id = #{taskId}</if>
|
||||
<if test="taskCode != null and taskCode != ''">or task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">or task_name = #{taskName}</if>
|
||||
<if test="remark != null and remark != ''">or remark = #{remark}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">or task_status = #{taskStatus}</if>
|
||||
<if test="startTime != null">or start_time = #{startTime}</if>
|
||||
<if test="endTime != null">or end_time = #{endTime}</if>
|
||||
|
@ -168,8 +180,7 @@
|
|||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert"
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
parameterType="com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity">
|
||||
insert into integration_task_living_details(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -177,6 +188,7 @@
|
|||
<if test="taskId != null and taskId != ''">task_id ,</if>
|
||||
<if test="taskCode != null and taskCode != ''">task_code ,</if>
|
||||
<if test="taskName != null and taskName != ''">task_name ,</if>
|
||||
<if test="remark != null and remark != ''">remark ,</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">task_status ,</if>
|
||||
<if test="startTime != null">start_time ,</if>
|
||||
<if test="endTime != null">end_time ,</if>
|
||||
|
@ -189,7 +201,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -199,6 +210,7 @@
|
|||
<if test="taskId != null and taskId != ''">#{taskId} ,</if>
|
||||
<if test="taskCode != null and taskCode != ''">#{taskCode} ,</if>
|
||||
<if test="taskName != null and taskName != ''">#{taskName} ,</if>
|
||||
<if test="remark != null and remark != ''">#{remark} ,</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">#{taskStatus} ,</if>
|
||||
<if test="startTime != null">#{startTime} ,</if>
|
||||
<if test="endTime != null">#{endTime} ,</if>
|
||||
|
@ -211,38 +223,37 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from
|
||||
integration_task_living_details a WHERE a.sts = 'Y' ),
|
||||
</if>
|
||||
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_living_details(task_linving_id, task_id, task_code, task_name, task_status,
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into integration_task_living_details(task_linving_id, task_id, task_code, task_name, remark, task_status,
|
||||
start_time, end_time, diff_time, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskLinvingId},#{entity.taskId},#{entity.taskCode},#{entity.taskName},#{entity.taskStatus},#{entity.startTime},#{entity.endTime},#{entity.diffTime},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
(#{entity.taskLinvingId},#{entity.taskId},#{entity.taskCode},#{entity.taskName},#{entity.remark},#{entity.taskStatus},#{entity.startTime},#{entity.endTime},#{entity.diffTime},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integration_task_living_details(task_linving_id, task_id, task_code, task_name, task_status,
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into integration_task_living_details(task_linving_id, task_id, task_code, task_name, remark, task_status,
|
||||
start_time, end_time, diff_time, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.taskLinvingId},#{entity.taskId},#{entity.taskCode},#{entity.taskName},#{entity.taskStatus},#{entity.startTime},#{entity.endTime},#{entity.diffTime},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
(#{entity.taskLinvingId},#{entity.taskId},#{entity.taskCode},#{entity.taskName},#{entity.remark},#{entity.taskStatus},#{entity.startTime},#{entity.endTime},#{entity.diffTime},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
task_linving_id = values(task_linving_id),
|
||||
task_id = values(task_id),
|
||||
task_code = values(task_code),
|
||||
task_name = values(task_name),
|
||||
remark = values(remark),
|
||||
task_status = values(task_status),
|
||||
start_time = values(start_time),
|
||||
end_time = values(end_time),
|
||||
|
@ -265,6 +276,7 @@
|
|||
<if test="taskId != null and taskId != ''">task_id = #{taskId},</if>
|
||||
<if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
|
||||
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">task_status = #{taskStatus},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
|
@ -297,6 +309,7 @@ where id = #{id}
|
|||
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
|
||||
<if test="taskCode != null and taskCode != ''">and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name = #{taskName}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">and task_status = #{taskStatus}</if>
|
||||
<if test="startTime != null">and start_time = #{startTime}</if>
|
||||
<if test="endTime != null">and end_time = #{endTime}</if>
|
||||
|
|
|
@ -16,7 +16,7 @@ public interface IIntegrationTaskLivingDetailsService extends IBaseService<Integ
|
|||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询任务列表分页
|
||||
* @Description 查询任务日志列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryEntityPage(JSONObject jsonObject);
|
||||
|
|
|
@ -82,7 +82,7 @@ public class PluginServiceImpl implements IPluginService {
|
|||
JSONObject requestData = jsonObject.getJSONObject("jsonStr");
|
||||
String pluginId = requestData.getString("pluginId");
|
||||
PluginBaseEntity pluginBaseEntity = null;
|
||||
String result;
|
||||
JsonResultEntity result;
|
||||
if (StrUtil.isEmpty(pluginId)) {
|
||||
throw new BaseSystemException("请传入pluginId参数!");
|
||||
} else {
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
package com.hzya.frame.web.quartz;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.sys.integrationtask.living.service.impl.IntegrationTaskLivingServiceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.log.service.impl.IntegrationTaskLogServiceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.dao.IIntegrationTaskMonitoringDao;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.entity.IntegrationTaskMonitoringEntity;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.service.IIntegrationTaskMonitoringService;
|
||||
import com.hzya.frame.sys.integrationtask.monitoring.service.impl.IntegrationTaskMonitoringServiceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.service.impl.IntegrationTaskServiceImpl;
|
||||
|
||||
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.util.PluginUtils;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.quartz.*;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -22,6 +23,8 @@ 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;
|
||||
|
@ -33,126 +36,137 @@ import java.util.Map;
|
|||
public class QuartzJobFactory implements Job {
|
||||
private static final Logger logger = LoggerFactory.getLogger(QuartzJobFactory.class);
|
||||
@Resource
|
||||
private ApiHandleServiceImpl apiHandleService;
|
||||
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
@Resource
|
||||
private IntegrationTaskLivingServiceImpl integrationTaskLivingService;
|
||||
@Resource
|
||||
private IIntegrationTaskMonitoringService integrationTaskMonitoringService;
|
||||
@Resource
|
||||
private IntegrationTaskServiceImpl integrationTaskService;
|
||||
|
||||
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao;
|
||||
@Override
|
||||
@DSTransactional()
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
//当前开始时间
|
||||
Date startTime = new Date();
|
||||
Date oldStartTime = new Date();
|
||||
|
||||
logger.info("执行定时任务");
|
||||
/** 获取JOB明细对象*/
|
||||
JobDetail jobDetail = jobExecutionContext.getJobDetail();
|
||||
/** 获取JobKey*/
|
||||
JobKey jobKey = jobDetail.getKey();
|
||||
/** 获取JobMap对象,用来获取实体类*/
|
||||
Map<String, Object> obDataMap = jobDetail.getJobDataMap();
|
||||
//获取job数据
|
||||
/*String jobStr = JSON.toJSONString(obDataMap.get(jobKey.getName()));
|
||||
logger.info("执行任务:当前任务json" + jobStr);
|
||||
JSONObject jobDetails = JSON.parseObject(jobStr);*/
|
||||
JSONObject jsonObjectMap = new JSONObject(obDataMap);
|
||||
JSONObject jobDetails = JSONObject.parseObject(jsonObjectMap.getString("job"));
|
||||
//场景名称
|
||||
String sceneName = jobDetails.getString("sceneName");
|
||||
//场景ID
|
||||
String sceneId = jobDetails.getString("sceneId");
|
||||
//原API id
|
||||
String sourceApiId = jobDetails.getString("sourceApiId");
|
||||
//目标API Id
|
||||
String targetApiId = jobDetails.getString("targetApiId");
|
||||
//插件ID
|
||||
String pluginId = jobDetails.getString("plug_id");
|
||||
/*是否是插件*/
|
||||
String isPlugin = jobDetails.getString("plug");
|
||||
//执行任务的cron表达式
|
||||
String cronExpression = jobDetails.getString("cronExpression");
|
||||
JSONObject attribute = null;
|
||||
//日志和实例开始时间
|
||||
Date dateStart = new Date();
|
||||
String result = null;
|
||||
String info = null;
|
||||
//任务id
|
||||
String integrationTaskId = jobDetails.getString("integrationTaskId");
|
||||
IntegrationTaskEntity integrationTaskEntity = iIntegrationTaskCacheableService.getIntegrationTaskEntity(integrationTaskId);
|
||||
//实例id
|
||||
String integrationTaskLivingId = jobDetails.getString("integrationTaskLivingId");
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = iIntegrationTaskCacheableService.getIntegrationTaskLivingEntity(integrationTaskLivingId);
|
||||
|
||||
if(integrationTaskEntity == null || integrationTaskEntity.getId() == null || "".equals(integrationTaskEntity.getId())){
|
||||
logger.error("当前任务不存在,请联系管理员");
|
||||
return;
|
||||
}
|
||||
if(integrationTaskLivingEntity == null || integrationTaskLivingEntity.getId() == null || "".equals(integrationTaskLivingEntity.getId())){
|
||||
logger.error("当前任务实例不存在,请联系管理员");
|
||||
return;
|
||||
}
|
||||
if(integrationTaskLivingEntity.getOldStartTime() != null ){
|
||||
oldStartTime = integrationTaskLivingEntity.getOldStartTime();
|
||||
}
|
||||
//判断任务是否启用,存在不启用情况,需要手动把任务关闭
|
||||
if(integrationTaskEntity.getTaskStatus() != null && !"1".equals(integrationTaskEntity.getTaskStatus())){
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,null,
|
||||
"4","4","当前任务已停止,不执行任务",integrationTaskLivingEntity.getOldStartTime(),integrationTaskLivingEntity.getStartTime(),integrationTaskLivingEntity.getEndTime());
|
||||
JSONObject stopJson = new JSONObject();
|
||||
stopJson.put("jobName",integrationTaskEntity.getTaskName());
|
||||
stopJson.put("jobCode",integrationTaskEntity.getTaskCode());
|
||||
QuartzJobFactoryUtils.pauseTrigger(stopJson);
|
||||
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);
|
||||
integrationTaskLivingEntity.setTaskStatus("1");//执行中
|
||||
integrationTaskLivingEntity.setStartTime(startTime);
|
||||
integrationTaskLivingEntity.setModify_time(new Date());
|
||||
iIntegrationTaskCacheableService.updateIntegrationTaskLivingEntity(integrationTaskLivingEntity);
|
||||
//判断插件是否启用
|
||||
SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(integrationTaskEntity.getTaskPlugin());
|
||||
if(sysApplicationPluginEntity == null || sysApplicationPluginEntity.getPluginCode() == null || !"1".equals(sysApplicationPluginEntity.getPluginStatus())){
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
"2","3","插件未启用,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
|
||||
return;
|
||||
}
|
||||
//查找插件
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode());
|
||||
if(pluginBaseEntity == null ){
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
"2","3","插件未找到,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
|
||||
return;
|
||||
}
|
||||
//调用插件
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("startTime",oldStartTime);
|
||||
req.put("endTime",startTime);
|
||||
try {
|
||||
//TODO 此处需要执行二林哥场景调用方法
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (null == sceneId) {
|
||||
sceneId = jobDetails.getString("task_tag");
|
||||
JsonResultEntity jsonResultEntity = pluginBaseEntity.executeBusiness(req);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
//写日志,修改任务实例
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
"2","2",jsonResultEntity.getMsg(),startTime,startTime,new Date());
|
||||
}else {
|
||||
//写日志,修改任务实例
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
"3","3",jsonResultEntity.getMsg(),startTime,startTime,new Date());
|
||||
}
|
||||
jsonObject.put("ref_id", sceneId);
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("jsonStr", jsonObject.toJSONString());
|
||||
jobDetails.put("plan_time", new Date());
|
||||
jobDetails.put("task_type", "后台任务");
|
||||
List<IntegrationTaskMonitoringEntity> integrationTaskMonitoringEntities = integrationTaskMonitoringService.queryTaskMonitoringOne(jobDetails);
|
||||
|
||||
//查询单个,得到上次修改时间,当前时间减去修改时间就是上次耗时时间
|
||||
int diff_timeMon = 0;
|
||||
if (integrationTaskMonitoringEntities.size() == 0) {
|
||||
diff_timeMon = 0;
|
||||
} else {
|
||||
IntegrationTaskMonitoringEntity integrationTaskMonitoringEntity = integrationTaskMonitoringEntities.get(0);
|
||||
diff_timeMon = Integer.valueOf((int) (dateStart.getTime() - integrationTaskMonitoringEntity.getModify_time().getTime()));
|
||||
}
|
||||
jobDetails.put("diff_time", diff_timeMon);
|
||||
//将cron表达式转为时间
|
||||
CronExpression cronExpressionPlan = new CronExpression(cronExpression);
|
||||
Date nextValidTimeAfter = cronExpressionPlan.getNextValidTimeAfter(new Date());
|
||||
String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(nextValidTimeAfter);
|
||||
jobDetails.put("plan_time", format);
|
||||
//触发时候,修改任务监控执行次数
|
||||
// integrationTaskMonitoringService.updateIntegrationTaskMonitoring(jobDetails);
|
||||
|
||||
// 是否是插件 1是 2否
|
||||
String plug = "1";
|
||||
if (plug.equalsIgnoreCase(isPlugin)) {
|
||||
try {
|
||||
logger.info("根据插件ID获取插件,ID: "+jobDetails.getString("plug_id"));
|
||||
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jobDetails.getString("plug_id"));
|
||||
String s = pluginBaseEntity.executeBusiness(req);
|
||||
logger.info("执行插件executeBusiness");
|
||||
if ("执行成功".equals(s)) {
|
||||
jobDetails.put("result", "执行成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("执行插件executeBusiness失败",e);
|
||||
jobDetails.put("result", "执行失败");
|
||||
jobDetails.put("instructions", e.getMessage());
|
||||
}
|
||||
} else {
|
||||
JsonResultEntity jsonResultEntity = apiHandleService.executeApi(req);
|
||||
if ("执行成功".equals(jsonResultEntity.getMsg())) {
|
||||
jobDetails.put("result", jsonResultEntity.getMsg());
|
||||
jobDetails.put("info", jsonResultEntity.getAttribute());
|
||||
} else {
|
||||
jobDetails.put("result", "执行失败");
|
||||
jobDetails.put("instructions", jsonResultEntity.getMsg());
|
||||
}
|
||||
}
|
||||
if (integrationTaskMonitoringEntities.size() == 0 || null == integrationTaskMonitoringEntities) {
|
||||
//触发时候,新增监控
|
||||
jobDetails.put("plan_time", new Date());
|
||||
integrationTaskMonitoringService.saveIntegrationTaskMonitoring(jobDetails);
|
||||
}
|
||||
//System.out.println("正在执行定时任务…………");
|
||||
logger.info("当前执行的任务表达式:" + cronExpression + "当前执行的任务是:" + jobExecutionContext.getTrigger().getKey() + "场景名称: " + sceneName + "场景ID:" + sceneId);
|
||||
} catch (Exception e) {
|
||||
logger.info("执行任务失败:" + cronExpression + "当前执行的任务是:" + jobExecutionContext.getTrigger().getKey() + "场景名称: " + sceneName + "场景ID:" + sceneId,e);
|
||||
jobDetails.put("result", "执行失败");
|
||||
//保存错误说明
|
||||
jobDetails.put("instructions", e.getMessage());
|
||||
logger.info(e.getMessage());
|
||||
saveLivingAndDetail(integrationTaskLivingEntity,integrationTaskLivingDetailsEntity,
|
||||
"3","3","插件执行失败,请联系管理员",startTime,startTime,new Date());
|
||||
logger.error("插件执行失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
} finally {
|
||||
// //TODO 写入任务执行日志表
|
||||
// integrationTaskService.saveLogAndLiving(jobDetails, dateStart);
|
||||
//// 触发时候,修改任务监控执行次数
|
||||
// integrationTaskMonitoringService.updateIntegrationTaskMonitoring(jobDetails);
|
||||
// integrationTaskService.saveLogAndLiving(jobDetails, dateStart);
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 保存任务日志
|
||||
* @Date 3:07 下午 2024/5/7
|
||||
* @param integrationTaskLivingEntity 任务实例
|
||||
* @param livingtype 1、执行中2、待执行3、错误 4、当前任务已停止
|
||||
* @param detailtype 1、执行中2、执行成功 3、执行失败 4\当前任务已停止
|
||||
* @param msg
|
||||
* @return void
|
||||
**/
|
||||
private void saveLivingAndDetail(IntegrationTaskLivingEntity integrationTaskLivingEntity,
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity,
|
||||
String livingtype,String detailtype, String msg,Date oldStartTime,Date startTime,Date endTime) {
|
||||
Long interval = (endTime.getTime() - startTime.getTime()) / (1000); // 计算间隔天数
|
||||
integrationTaskLivingEntity.setTaskStatus(livingtype);//待执行
|
||||
integrationTaskLivingEntity.setOldStartTime(oldStartTime);
|
||||
integrationTaskLivingEntity.setStartTime(startTime);
|
||||
integrationTaskLivingEntity.setEndTime(endTime);
|
||||
integrationTaskLivingEntity.setRunNum(interval.intValue());
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
package com.hzya.frame.web.quartz;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.quartz.*;
|
||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* @Content 任务计划操作工具类
|
||||
* @Content 任务计划操作工具类
|
||||
* @Author 👻👻👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 14:13
|
||||
* @Version 1.0
|
||||
|
@ -22,284 +27,260 @@ import javax.annotation.Resource;
|
|||
public class QuartzJobFactoryUtils {
|
||||
private static final Logger logger = LogManager.getLogger(QuartzJobFactoryUtils.class);
|
||||
|
||||
/** 定时器任务工厂类注入,因设置静态变量,通过set方法注入*/
|
||||
/**
|
||||
* 定时器任务工厂类注入,因设置静态变量,通过set方法注入
|
||||
*/
|
||||
private static SchedulerFactoryBean schedulerFactoryBean;
|
||||
|
||||
private static IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
|
||||
@Resource
|
||||
public void setSchedulerFactoryBean(SchedulerFactoryBean schedulerFactoryBean) {
|
||||
public void setiIntegrationTaskCacheableService(IIntegrationTaskCacheableService iIntegrationTaskCacheableService) {
|
||||
QuartzJobFactoryUtils.iIntegrationTaskCacheableService = iIntegrationTaskCacheableService;
|
||||
}
|
||||
|
||||
@Resource
|
||||
public void setSchedulerFactoryBean(SchedulerFactoryBean schedulerFactoryBean) {
|
||||
QuartzJobFactoryUtils.schedulerFactoryBean = schedulerFactoryBean;
|
||||
}
|
||||
private Scheduler scheduler =null;
|
||||
|
||||
private Scheduler scheduler = null;
|
||||
|
||||
/****
|
||||
* @Content:根据任务名称,获取TriggerKey
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 14:49
|
||||
* @Date 2021-5-7 14:49
|
||||
* @Param [job]
|
||||
* @return org.quartz.TriggerKey
|
||||
**/
|
||||
private static TriggerKey getTriggerKey(String job_name,String job_code){
|
||||
private static TriggerKey getTriggerKey(String job_name, String job_code) {
|
||||
|
||||
return TriggerKey.triggerKey(job_name, job_code);
|
||||
return TriggerKey.triggerKey(job_name, job_code);
|
||||
}
|
||||
private boolean validateJob(){
|
||||
|
||||
private boolean validateJob() {
|
||||
boolean flag = true;
|
||||
if(null == null){
|
||||
if (null == null) {
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content:获取ScheduleJobEntity对象,如果不传入任务名称,分组名称,返回整个对象
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 14:55
|
||||
* @Date 2021-5-7 14:55
|
||||
* @Param [jobName, jobGroup]
|
||||
* @return org.quartz.Scheduler
|
||||
**/
|
||||
private static Scheduler getScheduler(String jobName, String jobCode) throws SchedulerException {
|
||||
|
||||
if("".equalsIgnoreCase(jobName) || null == jobName || "".equalsIgnoreCase(jobCode) || null == jobCode){
|
||||
return schedulerFactoryBean.getScheduler();
|
||||
}else{
|
||||
TriggerKey triggerKey = getTriggerKey(jobName,jobCode);
|
||||
return schedulerFactoryBean.getScheduler();
|
||||
if ("".equalsIgnoreCase(jobName) || null == jobName || "".equalsIgnoreCase(jobCode) || null == jobCode) {
|
||||
return schedulerFactoryBean.getScheduler();
|
||||
} else {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName, jobCode);
|
||||
return schedulerFactoryBean.getScheduler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****
|
||||
* @Content:创建或者修改一个任务
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 14:49
|
||||
* @Date 2021-5-7 14:49
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void createJob(JSONObject job) {
|
||||
public static void createJob(JSONObject job) throws SchedulerException, ParseException {
|
||||
String integrationTaskId = job.getString("integrationTaskId");
|
||||
IntegrationTaskEntity integrationTaskEntity = iIntegrationTaskCacheableService.getIntegrationTaskEntity(integrationTaskId);
|
||||
logger.info("开始创建/更新任务:jobName" + integrationTaskEntity.getTaskName());
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
TriggerKey triggerKey = new TriggerKey(integrationTaskEntity.getTaskName(), integrationTaskEntity.getTaskCode());
|
||||
CronTriggerImpl trigger = (CronTriggerImpl) scheduler.getTrigger(triggerKey);
|
||||
if (trigger == null) {
|
||||
// 创建CronTrigger,设置错过触发时的处理策略为不执行,确保只有上次任务执行完毕后,才会进行下一次的调度
|
||||
Trigger cronTrigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(integrationTaskEntity.getTaskName(), integrationTaskEntity.getTaskCode())
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(integrationTaskEntity.getTaskCron())
|
||||
.withMisfireHandlingInstructionDoNothing()
|
||||
)
|
||||
.build();
|
||||
JobDetail jobDetail = JobBuilder.newJob(com.hzya.frame.web.quartz.QuartzJobFactory.class).withIdentity(integrationTaskEntity.getTaskName(), integrationTaskEntity.getTaskCode()).build();
|
||||
jobDetail.getJobDataMap().put("job", job);
|
||||
scheduler.scheduleJob(jobDetail, cronTrigger);
|
||||
logger.info("添加" + integrationTaskEntity.getTaskName() + "任务成功");
|
||||
} else {
|
||||
//修改策略
|
||||
trigger.setCronExpression(integrationTaskEntity.getTaskCron());
|
||||
scheduler.rescheduleJob(triggerKey, trigger);
|
||||
logger.info("修改" + integrationTaskEntity.getTaskName() + "任务成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/****
|
||||
* @Content:启动定时任务
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-20 8:09
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void startTimerTask(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
//场景名称
|
||||
String sceneName = job.getString("sceneName");
|
||||
//场景ID
|
||||
String sceneId = job.getString("sceneId");
|
||||
//原API id
|
||||
String sourceApiId = job.getString("sourceApiId");
|
||||
//目标API Id
|
||||
String targetApiId = job.getString("targetApiId");
|
||||
//执行任务的cron表达式
|
||||
String cronExpression = job.getString("cronExpression");
|
||||
logger.info("开始创建/更新任务:jobName"+jobName);
|
||||
// 创建CronTrigger,设置错过触发时的处理策略为不执行,确保只有上次任务执行完毕后,才会进行下一次的调度
|
||||
Trigger cronTrigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(jobName, jobCode)
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(cronExpression)
|
||||
.withMisfireHandlingInstructionDoNothing()
|
||||
)
|
||||
.build();
|
||||
try {
|
||||
Scheduler scheduler = getScheduler(jobName,jobCode);
|
||||
//获取触发器标识
|
||||
TriggerKey triggerKey = getTriggerKey(jobName,jobCode);
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(jobName, jobCode);
|
||||
//获取触发器trigger
|
||||
Trigger trigger = scheduler.getTrigger(triggerKey);
|
||||
//不存在任务的时候创建任务
|
||||
if (null == trigger) {
|
||||
//创建任务
|
||||
JobDetail jobDetail = JobBuilder.newJob(com.hzya.frame.web.quartz.QuartzJobFactory.class).withIdentity(jobCode, jobName).build();
|
||||
jobDetail.getJobDataMap().put("job", job);
|
||||
jobDetail.getJobDataMap().put("sceneId",sceneId);
|
||||
|
||||
//按新的cronExpression表达式构建一个新的trigger
|
||||
// trigger = TriggerBuilder.newTrigger().withIdentity(jobName, jobCode).startNow().withSchedule(d).build();
|
||||
//trigger = TriggerBuilder.newTrigger().withIdentity(jobName, jobCode).withSchedule(scheduleBuilder).build();
|
||||
//Trigger trigger1 = TriggerBuilder.newTrigger().withIdentity("myTrigger", "group1").startNow().withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInMilliseconds(5000).repeatForever().withFixedDelay() ).build();
|
||||
|
||||
|
||||
scheduler.scheduleJob(jobDetail,cronTrigger);
|
||||
logger.info("添加任务成功");
|
||||
} else {
|
||||
/** */
|
||||
JobKey jobKey = trigger.getJobKey();
|
||||
/** xian*/
|
||||
scheduler.deleteJob(jobKey);
|
||||
//按新的cronExpression表达式构建一个新的trigger
|
||||
JobDetail jobDetail = JobBuilder.newJob(com.hzya.frame.web.quartz.QuartzJobFactory.class).withIdentity(jobName, jobCode).build();
|
||||
jobDetail.getJobDataMap().put("job", job);
|
||||
jobDetail.getJobDataMap().put("sceneId",sceneId);
|
||||
scheduler.scheduleJob(jobDetail,cronTrigger);
|
||||
logger.info("更新任务成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("添加或者更新任务失败!");
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
scheduler.start();
|
||||
} catch (SchedulerException e) {
|
||||
logger.error("启动任务失败!当前任务" + jobName, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否启动
|
||||
*
|
||||
* @return
|
||||
* @throws org.quartz.SchedulerException
|
||||
*/
|
||||
public boolean isStartTimerTisk() throws SchedulerException {
|
||||
return this.scheduler.isStarted();
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content:启动定时任务
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-20 8:09
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void startTimerTask(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
//获取触发器标识
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(jobName, jobCode);
|
||||
//获取触发器trigger
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
scheduler.start();
|
||||
} catch (SchedulerException e) {
|
||||
logger.error("启动任务失败!当前任务"+jobName,e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**
|
||||
* 是否关闭
|
||||
*
|
||||
* @return
|
||||
* @throws org.quartz.SchedulerException
|
||||
*/
|
||||
public boolean isShutDownTimerTisk() throws SchedulerException {
|
||||
return this.scheduler.isShutdown();
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content: 停止一个定时作业
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 15:09
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void pauseJob(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
JobKey jobKey = JobKey.jobKey(jobName, jobCode);
|
||||
//获取触发器trigger
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
try {
|
||||
scheduler.pauseJob(jobKey);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BaseSystemException("停止任务:" + jobName + "失败!失败原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content: 恢复一个任务
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 15:10
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void resumeJob(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
JobKey jobKey = JobKey.jobKey(jobName, jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
try {
|
||||
scheduler.resumeJob(jobKey);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BaseSystemException("恢复任务:" + jobName + "失败!失败原因:" + e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否启动
|
||||
* @return
|
||||
* @throws org.quartz.SchedulerException
|
||||
*/
|
||||
public boolean isStartTimerTisk() throws SchedulerException {
|
||||
return this.scheduler.isStarted();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否关闭
|
||||
* @return
|
||||
* @throws org.quartz.SchedulerException
|
||||
*/
|
||||
public boolean isShutDownTimerTisk() throws SchedulerException {
|
||||
return this.scheduler.isShutdown();
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content: 停止一个定时作业
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 15:09
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void pauseJob(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
JobKey jobKey = JobKey.jobKey(jobName, jobCode);
|
||||
//获取触发器trigger
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
try {
|
||||
scheduler.pauseJob(jobKey);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new BaseSystemException("停止任务:"+jobName+"失败!失败原因:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content: 恢复一个任务
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 15:10
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void resumeJob(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
/****
|
||||
* @Content:删除指定的job
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 15:11
|
||||
* @Param [job]
|
||||
* @return boolean
|
||||
**/
|
||||
public static boolean deleteJob(JSONObject job) {
|
||||
boolean flag = false;
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
JobKey jobKey = JobKey.jobKey(jobName, jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
try {
|
||||
scheduler.resumeJob(jobKey);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new BaseSystemException("恢复任务:"+jobName+"失败!失败原因:"+e.getMessage());
|
||||
}
|
||||
|
||||
flag = scheduler.deleteJob(jobKey);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BaseSystemException("删除任务:" + jobName + "失败!失败原因:" + e.getMessage());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content:删除指定的job
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-7 15:11
|
||||
* @Param [job]
|
||||
* @return boolean
|
||||
**/
|
||||
public static boolean deleteJob(JSONObject job) {
|
||||
boolean flag = false;
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
JobKey jobKey = JobKey.jobKey(jobName, jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
flag = scheduler.deleteJob(jobKey);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new BaseSystemException("删除任务:"+jobName+"失败!失败原因:"+e.getMessage());
|
||||
}
|
||||
return flag;
|
||||
/****
|
||||
* @Content: 停止一个触发器
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-20 8:56
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void pauseTrigger(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName, jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
//停止触发器
|
||||
scheduler.pauseTrigger(triggerKey);
|
||||
} catch (SchedulerException e) {
|
||||
throw new BaseSystemException("停止任务:" + jobName + "失败!失败原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/****
|
||||
* @Content: 停止一个触发器
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2021-5-20 8:56
|
||||
* @Param [job]
|
||||
* @return void
|
||||
**/
|
||||
public static void pauseTrigger(JSONObject job){
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName,jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
//停止触发器
|
||||
scheduler.pauseTrigger(triggerKey);
|
||||
} catch (SchedulerException e) {
|
||||
throw new BaseSystemException("停止任务:"+jobName+"失败!失败原因:"+e.getMessage());
|
||||
}
|
||||
/**
|
||||
* 重启触发器
|
||||
*/
|
||||
public static void resumeTrigger(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName, jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
|
||||
scheduler.resumeTrigger(triggerKey);//重启触发器
|
||||
} catch (SchedulerException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重启触发器
|
||||
/**
|
||||
* 移除触发器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean removeTrigdger(JSONObject job) {
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName, jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
|
||||
*/
|
||||
public static void resumeTrigger(JSONObject job){
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName,jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler();
|
||||
|
||||
scheduler.resumeTrigger(triggerKey);//重启触发器
|
||||
} catch (SchedulerException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
scheduler.pauseTrigger(triggerKey);//停止触发器
|
||||
return scheduler.unscheduleJob(triggerKey);//移除触发器
|
||||
} catch (SchedulerException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除触发器
|
||||
|
||||
* @return
|
||||
*/
|
||||
public boolean removeTrigdger(JSONObject job){
|
||||
String jobName = job.getString("jobName");
|
||||
String jobCode = job.getString("jobCode");
|
||||
try {
|
||||
TriggerKey triggerKey = getTriggerKey(jobName,jobCode);
|
||||
Scheduler scheduler = schedulerFactoryBean.getScheduler( );
|
||||
|
||||
scheduler.pauseTrigger(triggerKey);//停止触发器
|
||||
return scheduler.unscheduleJob(triggerKey);//移除触发器
|
||||
} catch (SchedulerException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package com.hzya.frame.web.init;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||
import com.hzya.frame.datasource.DataSourceUtil;
|
||||
import com.hzya.frame.datasource.DataSourceUtilProperties;
|
||||
import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao;
|
||||
import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.integtationTask.dao.IIntegrationTaskDao;
|
||||
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.dao.IIntegrationTaskLivingDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
|
||||
import com.hzya.frame.web.quartz.QuartzJobFactoryUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
|
@ -14,10 +16,6 @@ import org.springframework.core.annotation.Order;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -31,232 +29,57 @@ import java.util.List;
|
|||
public class MyApplicationListener implements ApplicationListener<ApplicationReadyEvent> {
|
||||
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
@Resource
|
||||
private DataSource dataSource;
|
||||
private IIntegrationTaskDao integrationTaskDao;
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDao iIntegrationTaskLivingDao;
|
||||
@Resource
|
||||
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
//logger.info("***初始化数据源*******");
|
||||
//DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
||||
//DruidDataSource defaultDataSource = createDefaultDataSource(getDefaultDataSourceJsonObject());
|
||||
////创建SqlSessionFactory,添加到MAP缓存
|
||||
//DataSourceUtil.createSqlSessionFactoryToCache("master", defaultDataSource);
|
||||
//ds.addDataSource("master", defaultDataSource);
|
||||
//ds.setPrimary("master");
|
||||
//ds.setStrict(true);
|
||||
//logger.info("***初始化数据源成功!数据源编码:master ya251 *********");
|
||||
////数据源初始化完成后,执行初始化定时任务
|
||||
initTask();
|
||||
}
|
||||
|
||||
|
||||
/****
|
||||
* @Content:创建数据源,返回DruidDataSource
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-06-14 9:11
|
||||
* @Param [defaultDataSourceProperties]
|
||||
* @return com.alibaba.druid.pool.DruidDataSource
|
||||
**/
|
||||
private DruidDataSource createDefaultDataSource(JSONObject defaultDataSourceProperties) throws RuntimeException {
|
||||
//根据datasource_code查询数据源配置信息
|
||||
String datasource_code = String.valueOf(defaultDataSourceProperties.get("datasource_code"));
|
||||
String source_url = String.valueOf(defaultDataSourceProperties.get("source_url"));
|
||||
String login_name = String.valueOf(defaultDataSourceProperties.get("login_name"));
|
||||
String password = String.valueOf(defaultDataSourceProperties.get("password"));
|
||||
String db_name = String.valueOf(defaultDataSourceProperties.get("db_name"));
|
||||
String source_type = String.valueOf(defaultDataSourceProperties.get("source_type"));
|
||||
if (defaultDataSourceProperties != null) {
|
||||
String driveClass = "";
|
||||
if ("mysql".equalsIgnoreCase(source_type)) {
|
||||
driveClass = DataSourceUtilProperties.MYSQLDRIVER_6;
|
||||
} else if ("oracle".equalsIgnoreCase(source_type)) {
|
||||
driveClass = DataSourceUtilProperties.ORACLEDRIVER;
|
||||
} else if ("sqlserver2000".equalsIgnoreCase(source_type)) {
|
||||
driveClass = DataSourceUtilProperties.SQL2000DRIVER;
|
||||
} else if ("sqlServer".equalsIgnoreCase(source_type)) {
|
||||
driveClass = DataSourceUtilProperties.SQL2005DRIVER;
|
||||
} else if ("dm".equalsIgnoreCase(source_type)) {
|
||||
driveClass = DataSourceUtilProperties.dm;
|
||||
}
|
||||
try {
|
||||
//测试连接
|
||||
Class.forName(driveClass);
|
||||
Connection connection = DriverManager.getConnection(source_url, login_name, password);// 相当于连接数据库
|
||||
if (connection != null) {
|
||||
//初始化数据源信息
|
||||
DruidDataSource druidDataSource = new DruidDataSource();
|
||||
druidDataSource.setUrl(source_url);
|
||||
druidDataSource.setUsername(login_name);
|
||||
druidDataSource.setPassword(password);
|
||||
druidDataSource.setName(db_name);
|
||||
druidDataSource.setDriverClassName(driveClass);
|
||||
// 连接池连接信息
|
||||
druidDataSource.setInitialSize(40);//初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
|
||||
druidDataSource.setMaxActive(1000); //最大连接池数量 0表示无限制
|
||||
druidDataSource.setMaxWait(28000); //获取连接时最大等待时间,单位毫秒。当链接数已经达到了最大链接数的时候,应用如果还要获取链接就会出现等待的现象,等待链接释放并回到链接池,如果等待的时间过长就应该踢掉这个等待,不然应用很可能出现雪崩现象
|
||||
druidDataSource.setMinIdle(20); //最小空闲连接池数量
|
||||
//datasource.setMaxIdle(30); //最大空闲连接池数量 0表示无限制
|
||||
druidDataSource.setPoolPreparedStatements(false); //是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
|
||||
druidDataSource.setMaxPoolPreparedStatementPerConnectionSize(20);
|
||||
druidDataSource.setTestOnBorrow(true); //申请连接时执行validationQuery检测连接是否有效,这里建议配置为TRUE,防止取到的连接不可用
|
||||
druidDataSource.setTestWhileIdle(true);//建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
|
||||
if ("oracle".equals(source_type)) {
|
||||
druidDataSource.setValidationQuery("select 1 from dual");//用来检测连接是否有效的sql,要求是一个查询语句。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
|
||||
} else {
|
||||
druidDataSource.setValidationQuery("SELECT 1");
|
||||
}
|
||||
//datasource.setFilters("stat,wall");//属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有:监控统计用的filter:stat日志用的filter:log4j防御sql注入的filter:wall
|
||||
druidDataSource.setTimeBetweenEvictionRunsMillis(60000); //配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
druidDataSource.setMinEvictableIdleTimeMillis(300000); //配置一个连接在池中最小生存的时间,单位是毫秒,这里配置为3分钟180000
|
||||
druidDataSource.setKeepAlive(true); //打开druid.keepAlive之后,当连接池空闲时,池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作,即执行druid.validationQuery指定的查询SQL,一般为select * from dual,只要minEvictableIdleTimeMillis设置的小于防火墙切断连接时间,就可以保证当连接空闲时自动做保活检测,不会被防火墙切断
|
||||
druidDataSource.setRemoveAbandoned(true); //是否移除泄露的连接/超过时间限制是否回收。
|
||||
druidDataSource.setRemoveAbandonedTimeout(3600); //泄露连接的定义时间(要超过最大事务的处理时间);单位为秒。这里配置为1小时
|
||||
druidDataSource.setLogAbandoned(true); //移除泄露连接发生是是否记录日志
|
||||
druidDataSource.setTestOnReturn(false);
|
||||
|
||||
druidDataSource.init();
|
||||
return druidDataSource;
|
||||
private void initTask() {
|
||||
//查询所有任务,添加到任务执行计划中
|
||||
IntegrationTaskEntity queryEntity = new IntegrationTaskEntity();
|
||||
//任务状态1、启用
|
||||
queryEntity.setTaskStatus("1");
|
||||
queryEntity.setSts("Y");
|
||||
List<IntegrationTaskEntity> integrationTaskEntities = integrationTaskDao.queryByLike(queryEntity);
|
||||
//没有任务直接返回
|
||||
if (integrationTaskEntities == null || integrationTaskEntities.size() == 0) {
|
||||
return;
|
||||
}
|
||||
//循环任务,查看插件是否启用
|
||||
for (int i = 0; i < integrationTaskEntities.size(); i++) {
|
||||
IntegrationTaskEntity entity = integrationTaskEntities.get(i);
|
||||
if (entity.getTaskPlugin() != null && !"".equals(entity.getTaskPlugin())) {
|
||||
SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(entity.getTaskPlugin());
|
||||
//实例表
|
||||
IntegrationTaskLivingEntity integrationTaskLivingEntity = new IntegrationTaskLivingEntity();
|
||||
integrationTaskLivingEntity.setTaskId(entity.getId());
|
||||
integrationTaskLivingEntity.setSts("Y");
|
||||
List<IntegrationTaskLivingEntity> integrationTaskLivingEntities = iIntegrationTaskLivingDao.queryBase(integrationTaskLivingEntity);
|
||||
if (integrationTaskLivingEntities != null && integrationTaskLivingEntities.size() == 1) {
|
||||
integrationTaskLivingEntity = integrationTaskLivingEntities.get(0);
|
||||
} else {
|
||||
throw new RuntimeException("测试默认数据库连接失败datasource_code:" + datasource_code);
|
||||
logger.error("系统错误,请联系管理员");
|
||||
}
|
||||
//启用停用(1启用2停用)
|
||||
if (sysApplicationPluginEntity != null && sysApplicationPluginEntity.getPluginStatus() != null && "1".equals(sysApplicationPluginEntity.getPluginStatus())) {
|
||||
JSONObject jsonObjectMap = new JSONObject();
|
||||
jsonObjectMap.put("integrationTaskId", entity.getId());//任务id
|
||||
jsonObjectMap.put("integrationTaskLivingId", integrationTaskLivingEntity.getId());//实例id
|
||||
//根据cron,定时执行任务
|
||||
try {
|
||||
QuartzJobFactoryUtils.createJob(jsonObjectMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("创建任务失败");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("==================创建数据源失败===================");
|
||||
throw new RuntimeException("创建数据源失败" + e.getMessage());
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new RuntimeException("source_code:" + datasource_code + "不存在");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****
|
||||
* @Content:创建默认数据源配置文件
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-06-14 9:09
|
||||
* @Param []
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject getDefaultDataSourceJsonObject() {
|
||||
JSONObject defaultDataSourceProperties = new JSONObject();
|
||||
|
||||
///////////////////////////////////////////////////////////公司服务器
|
||||
defaultDataSourceProperties.put("datasource_code", "ya251");
|
||||
defaultDataSourceProperties.put("source_url", "jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true");
|
||||
defaultDataSourceProperties.put("source_type", "mysql");
|
||||
defaultDataSourceProperties.put("login_name", "root");
|
||||
defaultDataSourceProperties.put("password", "hzya1314");
|
||||
defaultDataSourceProperties.put("db_name", "businesscenternew");
|
||||
|
||||
|
||||
//defaultDataSourceProperties.put("datasource_code", "bopro");
|
||||
//defaultDataSourceProperties.put("source_url", "jdbc:mysql://127.0.0.1:3306/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true");
|
||||
//defaultDataSourceProperties.put("source_type", "mysql");
|
||||
//defaultDataSourceProperties.put("login_name", "root");
|
||||
//defaultDataSourceProperties.put("password", "Bh1591+-j");
|
||||
//defaultDataSourceProperties.put("db_name", "businesscenter");
|
||||
|
||||
/////////////////////////////////////////////////////////// 公司达梦数据库
|
||||
//defaultDataSourceProperties.put("datasource_code", "businesscenter");
|
||||
//defaultDataSourceProperties.put("source_url", "jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8");
|
||||
//defaultDataSourceProperties.put("source_type", "dm");
|
||||
//defaultDataSourceProperties.put("login_name", "HZYAZT");
|
||||
//defaultDataSourceProperties.put("password", "hzya@1314");
|
||||
//defaultDataSourceProperties.put("db_name", "businesscenter");
|
||||
|
||||
///////////////////////////////////////////////////////////本地服务器
|
||||
// defaultDataSourceProperties.put("datasource_code", "ya251");
|
||||
// defaultDataSourceProperties.put("source_url", "jdbc:mysql://localhost:3306/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false");
|
||||
// defaultDataSourceProperties.put("source_type", "mysql");
|
||||
// defaultDataSourceProperties.put("login_name", "root");
|
||||
// defaultDataSourceProperties.put("password", "seeyon123456");
|
||||
// defaultDataSourceProperties.put("db_name", "businesscenter");
|
||||
|
||||
///////////////////////////////////////////////////////////速网服务器
|
||||
// defaultDataSourceProperties.put("datasource_code", "ya251");
|
||||
// defaultDataSourceProperties.put("source_url", "jdbc:mysql://124.71.200.210:10216/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false");
|
||||
// defaultDataSourceProperties.put("source_type", "mysql");
|
||||
// defaultDataSourceProperties.put("login_name", "root");
|
||||
// defaultDataSourceProperties.put("password", "jSvtCVdRZR@10216");
|
||||
// defaultDataSourceProperties.put("db_name", "businesscenter");
|
||||
return defaultDataSourceProperties;
|
||||
}
|
||||
|
||||
private void initTask() {
|
||||
//需要初始化的taskID集合,如果默认不增加则查询所有的任务计划
|
||||
List<String> taskIdList = new ArrayList<>();
|
||||
//如不需要系统重新初始化任务计划,放开
|
||||
// taskIdList.add("系统不初始化插件");
|
||||
//杭泰致远销售合同推送钉钉任务
|
||||
// taskIdList.add("3497196579928427970");
|
||||
//杭泰BIP供应商传递OA
|
||||
// taskIdList.add("1343295077748918281");
|
||||
//杭泰BIP组织传递OA
|
||||
// taskIdList.add("1410297000456637817");
|
||||
//=====================速网start===================
|
||||
// //速网U8C存货档案生成旺店通货品档案
|
||||
// taskIdList.add("5480192946193190032");
|
||||
// //速网U8C供应商档案生成旺店通供应商档案
|
||||
// taskIdList.add("-3655259174701414288");
|
||||
// //速网U8C采购订单推送旺店通采购订单
|
||||
// taskIdList.add("8470345846677980957");
|
||||
// //速网旺店通采购入库单,生成U8C采购入库
|
||||
// taskIdList.add("-3281025020354081194");
|
||||
// //速网U8C红字采购订单,推送旺店通采购退货单
|
||||
// taskIdList.add("-8474333912293880929");
|
||||
// //速网旺店通采购退货出库单,生成U8C红字采购入库
|
||||
// taskIdList.add("-1925311264968064672");
|
||||
// //OMS达人寄样销售出库生成U8C销售订单
|
||||
// taskIdList.add("-2069765657546371358");
|
||||
// //达人寄样退货入库生成U8C红字销售销售出库单
|
||||
// taskIdList.add("-2601013958036799088");
|
||||
// //速网(TOC)旺店通换货出库,生成U8C销售订单
|
||||
// taskIdList.add("6073023852888933683");
|
||||
// //速网(TOB)红字销售订单同步旺店通退换单
|
||||
// taskIdList.add("-6740993577531585903");
|
||||
// //速网(TOB)旺店通退货入库单生成U8C红字销售出库单
|
||||
// taskIdList.add("8186943298008796570");
|
||||
// //速网(TOC)退货入库单生成U8C红字销售订单
|
||||
// taskIdList.add("-7347438162969149145");
|
||||
// //速网(TOB)旺店通销售出库单,生成U8C销售出库单
|
||||
// taskIdList.add("2307940401916365256");
|
||||
// //速网(TOC)旺店通销售出库单生成U8C销售订单
|
||||
// taskIdList.add("4313657280852938148");
|
||||
// //速网(TOB)U8C销售订单,推送旺店通原始订单
|
||||
// taskIdList.add("-1508341403276391185");
|
||||
//
|
||||
// //240142旺店通生产出库单推送U8C其他出库单202401041457
|
||||
// taskIdList.add("-1727593887180373437");
|
||||
// //240104速网U8C生产组装拆分单,同步旺店通生产单推送202401041501
|
||||
// taskIdList.add("-4332012689203573504");
|
||||
// //240104旺店通生产入库单推送U8C其他入库单202401041517
|
||||
// taskIdList.add("-9101527738616233282");
|
||||
// //240104旺店通盘亏出库、(报废)其他出库,同步u8c其他出库单202401041559
|
||||
// taskIdList.add("2565596441674991058");
|
||||
// //240104旺店通盘盈入库、其他入库,同步u8c其他入库单202401041607
|
||||
// taskIdList.add("337296389084038464");
|
||||
// //240104速网U8C调拨订单,推送旺店通调拨单202401041539
|
||||
// taskIdList.add("6800106772736788841");
|
||||
// //240117旺店通调拨出库单推送速网U8C调拨出库单202401171718
|
||||
// taskIdList.add("6268657196004560868");
|
||||
// //240117旺店通调拨入库单推送速网U8C调拨入库单202401171719
|
||||
// taskIdList.add("7472681518255458048");
|
||||
|
||||
|
||||
//=====================速网end=====================
|
||||
|
||||
// =====================测试===================
|
||||
//taskIdList.add("406774952091143809");
|
||||
//taskIdList.add("7445578911194825754");
|
||||
//taskIdList.add("3313595368368981850");
|
||||
//taskIdList.add("3497196579928427970");
|
||||
//taskIdList.add("3497196579928427970");
|
||||
//taskIdList.add("-6468742747231859632");
|
||||
//taskIdList.add("-8410742166114775252");
|
||||
//=====================测试=====================
|
||||
//初始化定时任务
|
||||
//if (null != iIntegrationTaskService) {
|
||||
// iIntegrationTaskService.initTaskByIds(taskIdList);
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -80,10 +80,10 @@ public class EntranceServiceImpl implements IEntranceService {
|
|||
logger.info("当前methods:" + methods + "methodsLength = " + methods.length);
|
||||
return BaseResult.getFailureMessageEntity(service + "未找到" + serviceMethod + "方法");
|
||||
} else {
|
||||
logger.error("当前methods:" + methods + "methodsLength = " + methods.length);
|
||||
logger.error("当前methods1:" + methods + "methodsLength = " + methods.length);
|
||||
}
|
||||
for (Method m : methods) {
|
||||
logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
|
||||
//logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
|
||||
if (null != m) {
|
||||
if (m.getName().equals(serviceMethod.trim())) {
|
||||
if (m.getName().startsWith("thirdInterface")) {//TODO 后续可能要加强校验规则
|
||||
|
@ -190,7 +190,7 @@ public class EntranceServiceImpl implements IEntranceService {
|
|||
logger.info("当前methods222222:" + methods + "methodsLength = " + methods.length);
|
||||
}
|
||||
for (Method m : methods) {
|
||||
logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
|
||||
//logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
|
||||
if (null != m) {
|
||||
if (m.getName().equals(serviceMethod.trim())) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
@ -262,10 +262,10 @@ public class EntranceServiceImpl implements IEntranceService {
|
|||
logger.info("当前methods:" + methods + "methodsLength = " + methods.length);
|
||||
return BaseResult.getFailureMessageEntity(service + "未找到" + serviceMethod + "方法");
|
||||
} else {
|
||||
logger.error("当前methods:" + methods + "methodsLength = " + methods.length);
|
||||
logger.error("当前methods2:" + methods + "methodsLength = " + methods.length);
|
||||
}
|
||||
for (Method m : methods) {
|
||||
logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
|
||||
//logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
|
||||
if (null != m) {
|
||||
if (m.getName().equals(serviceMethod.trim())) {
|
||||
logger.info("m.getNameEquals成功");
|
||||
|
|
Loading…
Reference in New Issue