万盛修改接口方法
This commit is contained in:
parent
5d21e1e201
commit
5d45dd740e
|
@ -2,6 +2,7 @@ package com.hzya.frame.plugin.masterData.plugin;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -51,6 +52,7 @@ public class MdmPluginInitializer extends PluginBaseEntity{
|
|||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行主数据信息同步========");
|
||||
//return BaseResult.getSuccessMessageEntity("成功123");
|
||||
return masterDataService.queryArchives(requestJson);
|
||||
}catch (Exception e){
|
||||
logger.info("======执行主数据同步失败:{}========",e.getMessage());
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Map;
|
|||
* Date 2023/7/16 8:18 上午
|
||||
*/
|
||||
//@RunWith(SpringRunner.class)
|
||||
//@SpringBootTest(classes = {WebappApplication.class})
|
||||
//@SpringBootTest(classes = a{WebappApplication.class})
|
||||
public class temButtom {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -81,4 +81,10 @@ public interface ISeeYonInterFace {
|
|||
* @throws Exception
|
||||
*/
|
||||
String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception;
|
||||
|
||||
|
||||
|
||||
JsonResultEntity chengeBody(JSONObject jsonObject) throws Exception;
|
||||
SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity);
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import cn.hutool.http.HttpUtil;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao;
|
||||
import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity;
|
||||
import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity;
|
||||
|
@ -19,6 +20,7 @@ import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao
|
|||
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
|
||||
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
|
||||
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.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
|
@ -497,11 +499,38 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace {
|
|||
.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
|
||||
.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 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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue