Compare commits

..

No commits in common. "d4c5e58b2b1454be12d8eee78b322213e9d1d333" and "d56cc9facb4be5632281cc78de37b8fbf5fc86fb" have entirely different histories.

9 changed files with 202 additions and 482 deletions

View File

@ -26,9 +26,5 @@ public interface IZjMaterielSynchronizationEventDao extends IBaseDao<ZjMaterielS
Integer updatewlbm(ZjMaterielSynchronizationEventEntity entity); Integer updatewlbm(ZjMaterielSynchronizationEventEntity entity);
List<ZjMaterielSynchronizationEventEntity> queryById(ZjMaterielSynchronizationEventEntity entity1); List<ZjMaterielSynchronizationEventEntity> queryById(ZjMaterielSynchronizationEventEntity entity1);
List<ZjMaterielSynchronizationEventEntity> getmeiji(ZjMaterielSynchronizationEventEntity zjMaterielSynchronizationEventEntity);
List<ZjMaterielSynchronizationEventEntity> getuser(ZjMaterielSynchronizationEventEntity user);
} }

View File

@ -44,15 +44,5 @@ public class ZjMaterielSynchronizationEventDaoImpl extends MybatisGenericDao<ZjM
public List<ZjMaterielSynchronizationEventEntity> queryById(ZjMaterielSynchronizationEventEntity entity) { public List<ZjMaterielSynchronizationEventEntity> queryById(ZjMaterielSynchronizationEventEntity entity) {
return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "queryById",entity); return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "queryById",entity);
} }
@Override
@DS("#entity.dataSourceCode")
public List<ZjMaterielSynchronizationEventEntity> getmeiji(ZjMaterielSynchronizationEventEntity entity) {
return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "getmeiji",entity);
}
@Override
@DS("#entity.dataSourceCode")
public List<ZjMaterielSynchronizationEventEntity> getuser(ZjMaterielSynchronizationEventEntity entity) {
return (List<ZjMaterielSynchronizationEventEntity>) super.selectList(getSqlIdPrifx() + "getuser",entity);
}
} }

View File

@ -47,38 +47,5 @@
where id = #{id} where id = #{id}
</update> </update>
<select id="getmeiji" resultType="com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity"
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
SELECT
id,
showvalue as accName
from CTP_ENUM_ITEM
where REF_ENUMID in (
'-183521076637120167', -- field0038
'8744672489280851787', -- field0008
'-7143577122323478491', -- field0009 field0010 field0022 field0035
'-9054856313904676186', -- field0012
'-8777711854515435336', -- field0014
'7306464606663623197', -- field0017
'3731163912961082997', -- field0018
'612018623748066455', -- field0019
'-5893688452217157155', -- field0020
'-8682849565428789486', -- field0033
'3282520586982344070', -- field0034
'1314047672872420014', -- field0040
'6435913155541223805', -- field0042
'7788441092115810835', -- field0047
'-7568576445236623045' -- field0048
)
</select>
<select id="getuser" resultType="com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity"
parameterType = "com.hzya.frame.plugin.zjmaterielsynchronizationevent.entity.ZjMaterielSynchronizationEventEntity">
SELECT
id,
name as accName
from v_user_view_all
where id = #{id}
</select>
</mapper> </mapper>

View File

@ -14,7 +14,7 @@ spring:
master: master:
url: jdbc:mysql://ufidahz.com.cn:9014/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 url: jdbc:mysql://ufidahz.com.cn:9014/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
username: root username: root
password: bd993088e8a7c3dc5f44441617f9b4bf password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile: savefile:
# 文件保存路径 # 文件保存路径

View File

@ -32,7 +32,7 @@ spring:
# type: com.alibaba.druid.pool.DruidDataSource # type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://ufidahz.com.cn:9014/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 url: jdbc:mysql://ufidahz.com.cn:9014/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
username: root username: root
password: bd993088e8a7c3dc5f44441617f9b4bf password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 # url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle # url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle

View File

@ -34,8 +34,8 @@ import java.util.Map;
* @Author llg * @Author llg
* Date 2023/7/16 8:18 上午 * Date 2023/7/16 8:18 上午
*/ */
//@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
//@SpringBootTest(classes = {WebappApplication.class}) @SpringBootTest(classes = {WebappApplication.class})
public class temButtom { public class temButtom {
@Test @Test

View File

@ -6,7 +6,6 @@ import com.hzya.frame.web.entity.JsonResultEntity;
/** /**
* 致远OA接口类 * 致远OA接口类
*
* @author 👻👻👻👻👻👻👻👻👻👻 gjh * @author 👻👻👻👻👻👻👻👻👻👻 gjh
* @version 1.0 * @version 1.0
* @content * @content
@ -25,6 +24,7 @@ public interface ISeeYonInterFace {
JsonResultEntity thirdInterfaceSend(JSONObject requestData); JsonResultEntity thirdInterfaceSend(JSONObject requestData);
/*** /***
* @Content: 提供给OA的标准接口方法包含参数 entity 为OA 的data信息 , eventType 为事件类型 * @Content: 提供给OA的标准接口方法包含参数 entity 为OA 的data信息 , eventType 为事件类型
* @Author 👻👻👻👻👻👻👻👻 gjh * @Author 👻👻👻👻👻👻👻👻 gjh
@ -59,16 +59,13 @@ public interface ISeeYonInterFace {
/** /**
* seeyon流程事件监听前置方法绑定数据源 * seeyon流程事件监听前置方法绑定数据源
*
* @param sysExtensionApi * @param sysExtensionApi
* @return * @return
* @throws Exception * @throws Exception
*/ */
SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception;
/** /**
* seeyon流程事件监听 * seeyon流程事件监听
*
* @param jsonObject * @param jsonObject
* @return * @return
* @throws Exception * @throws Exception
@ -77,18 +74,11 @@ public interface ISeeYonInterFace {
/** /**
* seeyon流程事件监听后置方法调用三方接口 * seeyon流程事件监听后置方法调用三方接口
*
* @param jsonStr * @param jsonStr
* @param formAppId * @param formAppId
* @param eventType * @param eventType
* @return * @return
* @throws Exception * @throws Exception
*/ */
JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception; String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception;
JsonResultEntity chengeBody(JSONObject jsonObject) throws Exception;
SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity);
} }

View File

@ -2,13 +2,13 @@ package com.hzya.frame.seeyon.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao;
import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity;
import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity;
@ -19,7 +19,6 @@ import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.util.PluginUtils;
import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException; import com.hzya.frame.web.exception.BaseSystemException;
@ -29,7 +28,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -52,30 +50,14 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
private static final String sendUrl = "http://60.204.152.210/seeyon/"; private static final String sendUrl = "http://60.204.152.210/seeyon/";
//速网esb地址 //速网esb地址
private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface"; private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface";
/**
* 定义所支持的事件静态代码块
*/
private static final StringBuffer eventTypeBuffer = new StringBuffer();
//基础档案类型
private final String ARCHIVESTYPE = "archives";
//流程表单类型
private final String FLOWTYPE = "flow";
//创建基础档案
private final String CREATEARCHIVES = "create";
//更新基础档案
private final String UPDATEARCHIVES = "update";
//创建基础档案
private final String CREATEARCHIVESURL = "rest/form/import/";
//创建基础档案
private final String UPDATEARCHIVESURL = "rest/form/update";
@Resource @Resource
private ISysApplicationDatabaseDao sysApplicationDatabaseDao; private ISysApplicationDatabaseDao sysApplicationDatabaseDao;
@Autowired @Autowired
private ISysApplicationApiService sysApplicationApiService; private ISysApplicationApiService sysApplicationApiService;
@Resource /**
private ISeeYonInterFaceDao seeYonInterFaceDao; * 定义所支持的事件静态代码块
//上一次同步时间 */
private final String LAST_SYNCHRONISED_TIME = ""; private static final StringBuffer eventTypeBuffer = new StringBuffer();
{ {
eventTypeBuffer.append("发起前事件 onBeforeStart ,"); eventTypeBuffer.append("发起前事件 onBeforeStart ,");
@ -93,6 +75,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
eventTypeBuffer.append("取回事件 onTakeBack,"); eventTypeBuffer.append("取回事件 onTakeBack,");
} }
//基础档案类型
private final String ARCHIVESTYPE = "archives";
//流程表单类型
private final String FLOWTYPE = "flow";
//创建基础档案
private final String CREATEARCHIVES = "create";
//更新基础档案
private final String UPDATEARCHIVES = "update";
//创建基础档案
private final String CREATEARCHIVESURL = "rest/form/import/";
//创建基础档案
private final String UPDATEARCHIVESURL = "rest/form/update";
@Resource
private ISeeYonInterFaceDao seeYonInterFaceDao;
//上一次同步时间
private String LAST_SYNCHRONISED_TIME = "";
/**** /****
* @Content:发起无流程表单接口实现 * @Content:发起无流程表单接口实现
* @Author 👻👻👻👻👻👻👻👻 gjh * @Author 👻👻👻👻👻👻👻👻 gjh
@ -223,74 +223,73 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
//formApp 最好过滤一下 //formApp 最好过滤一下
JsonResultEntity result = null; String result = null;
try { try {
//流程事件处理 //流程事件处理
result = colEventPost(jsonStr, formApp, eventType); result = colEventPost(jsonStr, formApp, eventType);
}catch (Exception e){ }catch (Exception e){
return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); return BaseResult.getFailureMessageEntity("传递失败",e.getMessage());
} }
return result; try {
// try { /** 根据事件类型处理相关事件*/
// /** 根据事件类型处理相关事件*/ switch (eventType) {
// switch (eventType) { /** 发起前事件*/
// /** 发起前事件*/ case "onBeforeStart":
// case "onBeforeStart": break;
// break; /** 发起事件*/
// /** 发起事件*/ case "onStart":
// case "onStart": //流程发起 新增grpu8单据
// //流程发起 新增grpu8单据 break;
// break; /** 终止前事件*/
// /** 终止前事件*/ case "onBeforeStop":
// case "onBeforeStop": break;
// break; /** 终止事件*/
// /** 终止事件*/ case "onStop":
// case "onStop": //流程终止更新grpu8单据
// //流程终止更新grpu8单据 break;
// break; /** 撤销前事件*/
// /** 撤销前事件*/ case "onBeforeCancel":
// case "onBeforeCancel": break;
// break; /** 撤销事件*/
// /** 撤销事件*/ case "onCancel":
// case "onCancel": //流程撤销更新grpu8单据
// //流程撤销更新grpu8单据 break;
// break; /** 结束事件*/
// /** 结束事件*/ case "onProcessFinished":
// case "onProcessFinished": break;
// break; /** 处理前事件*/
// /** 处理前事件*/ case "onBeforeFinishWorkitem":
// case "onBeforeFinishWorkitem": /** 根据form处理相关业务表单的数据*/
// /** 根据form处理相关业务表单的数据*/ switch (formApp) {
// switch (formApp) { case "abc123":
// case "abc123": break;
// break; default:
// default: return BaseResult.getFailureMessageEntity("未匹配到表单当前formID" + formApp, "");
// return BaseResult.getFailureMessageEntity("未匹配到表单当前formID" + formApp, ""); }
// } break;
// break; /** 处理事件*/
// /** 处理事件*/ case "onFinishWorkitem":
// case "onFinishWorkitem": break;
// break; /** 回退前事件*/
// /** 回退前事件*/ case "onBeforeStepBack":
// case "onBeforeStepBack": break;
// break; /** 回退事件*/
// /** 回退事件*/ case "onStepBack":
// case "onStepBack": break;
// break; /** 取回前事件*/
// /** 取回前事件*/ case "onBeforeTakeBack":
// case "onBeforeTakeBack": break;
// break; /** 取回事件*/
// /** 取回事件*/ case "onTakeBack":
// case "onTakeBack": break;
// break; default:
// default: // throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString());
//// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", "");
// return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); }
// } return BaseResult.getSuccessMessageEntity("传递成功", result);
// return BaseResult.getSuccessMessageEntity("传递成功", result); }catch (Exception e){
// }catch (Exception e){ return BaseResult.getFailureMessageEntity("传递失败",e.getMessage());
// return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); }
// }
} }
@ -413,7 +412,6 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
/** /**
* seeyon流程事件监听前置方法绑定数据源 * seeyon流程事件监听前置方法绑定数据源
*
* @param entity * @param entity
* @return * @return
* @throws Exception * @throws Exception
@ -482,7 +480,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
* @throws Exception * @throws Exception
*/ */
@Override @Override
public JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { public String colEventPost(String jsonStr, String formAppId, String eventType) throws Exception {
if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){ if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){
SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity();
sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType); sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType);
@ -491,92 +489,19 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
if (applist.size() > 1){ if (applist.size() > 1){
throw new BaseSystemException("根据formID" + formAppId+"查询出多条数据"); throw new BaseSystemException("根据formID" + formAppId+"查询出多条数据");
} }
if (applist.size() == 0 ) {
throw new BaseSystemException("根据formID" + formAppId + "eventType:"+eventType+"未查询到API配置");
}
SysApplicationApiEntity sysApp = applist.get(0); SysApplicationApiEntity sysApp = applist.get(0);
JSONArray headerArray = JSONArray.parseArray(sysApp.getHeaderIn()); Map<String, String> headerMap = MapBuilder.<String, String>create(true)
if (null != headerArray && headerArray.size() > 0) { .put("apiCode", String.valueOf(sysApp.getApiCode()))
String plugId = null; //这里用中台做为发送方
for (int i = 0; i < headerArray.size(); i++) { .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
JSONObject querys = headerArray.getJSONObject(i); .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
//query 只有基本类型不用循环判断下级 .put("appId",String.valueOf(sysApp.getAppCode()))
//判断参数是否有值 .build();
//获取对象下面的层级数据 String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body();
String parameterName = querys.getString("parameterName"); logger.info("调用中台返回的参数:{}",body);
if (null != parameterName && "plugId".equals(parameterName)) { return body;
plugId = querys.getString("example");
break;
} }
} }
if (null == plugId) {
throw new BaseSystemException("根据formID" + formAppId + "未获取到head参数");
} else {
PluginBaseEntity pluginBaseEntity = null;
JsonResultEntity result;
pluginBaseEntity = PluginUtils.getPluginsById(plugId);
if (null == pluginBaseEntity) {
throw new BaseSystemException("根据ID获取插件错误请传入正确的 pluginId");
} else {
//执行业务逻辑代码
JSONObject reqJson = new JSONObject();
reqJson.put("jsonStr",jsonStr);
reqJson.put("formAppId",formAppId);
reqJson.put("eventType",eventType);
result = pluginBaseEntity.executeBusiness(reqJson);
return result;
}
}
} else {
throw new BaseSystemException("根据formID" + formAppId + "未获取到head参数");
}
// Map<String, String> headerMap = MapBuilder.<String, String>create(true)
// .put("apiCode", String.valueOf(sysApp.getApiCode()))
// //这里用中台做为发送方
// .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
// .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
// .put("appId",String.valueOf(sysApp.getAppCode()))
// .build();
// String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body();
// logger.info("调用中台返回的参数:{}",body);
// return body;
}
}else{
// StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)
logger.info("jsonStr,formAppId,eventType为空执行错误"+jsonStr+formAppId+eventType);
throw new BaseSystemException("jsonStr,formAppId,eventType为空执行错误");
}
return null; return null;
} }
@Override
public JsonResultEntity chengeBody(JSONObject object) throws Exception {
JSONObject jsonstr = object.getJSONObject("jsonStr");
PluginBaseEntity pluginBaseEntity = null;
JsonResultEntity result;
String pluginId = jsonstr.getString("plugId");
pluginBaseEntity = PluginUtils.getPluginsById(pluginId);
if (null == pluginBaseEntity) {
throw new BaseSystemException("根据ID获取插件错误请传入正确的 pluginId");
} else {
//执行业务逻辑代码
result = pluginBaseEntity.executeBusiness(object);
}
return result;
}
@Override
public SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity) {
Map<String, String> headers = entity.getHeaders();
JSONObject jsonObject = JSONObject.parseObject(entity.getBodys());
jsonObject.put("plugId", headers.get("plugId"));
entity.setBodys(jsonObject.toJSONString());
return entity;
}
} }