Merge branch 'dev' of http://192.168.2.237:3000/root/kangarooDataCenterV3 into yuecheng-project
# Conflicts: # buildpackage/src/test/java/com/hzya/frame/temButtom.java # pom.xml # service/src/main/java/com/hzya/frame/report/reportManage/service/impl/ReportManageServiceImpl.java # webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java
This commit is contained in:
commit
86a977160d
|
@ -0,0 +1,436 @@
|
|||
package com.hzya.frame.plugin.mdmDistribute.plugin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
||||
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
|
||||
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
|
||||
import com.hzya.frame.sysnew.application.dao.ISysApplicationDao;
|
||||
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
|
||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||
import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao;
|
||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||
import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ByteArrayEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 主数据模版(MdmModule)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-18 10:33:32
|
||||
*/
|
||||
public class MdmModulePluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(MdmModulePluginInitializer.class);
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDetailsDao integrationTaskLivingDetailsDao;
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
|
||||
@Resource
|
||||
private ISysApplicationApiDao sysApplicationApiDao;
|
||||
@Resource
|
||||
private ISysApplicationDao sysApplicationDao;
|
||||
@Resource
|
||||
private ISysApplicationScriptDao sysApplicationScriptDao;
|
||||
@Resource
|
||||
private IMdmModuleDistributeDao mdmModuleDistributeDao;
|
||||
@Resource
|
||||
private IGroovyIntegrationService groovyIntegrationService;
|
||||
@Resource
|
||||
private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao;
|
||||
@Resource
|
||||
private IMdmModuleDao mdmModuleDao;
|
||||
@Resource
|
||||
private IMdmServiceCache mdmServiceCache;
|
||||
|
||||
@Value("${ax.url}")
|
||||
private String url ;
|
||||
|
||||
//多线程请求加锁 HttpRequest 构造方法是静态的
|
||||
private final Object lock = new Object();
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "MdmModulePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "MdmModulePlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "MdmModulePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try{
|
||||
//重试方法
|
||||
if (null != requestJson) {
|
||||
//如果这个id不为空,说明是重试的
|
||||
String id = requestJson.getString("integration_task_living_details_id");
|
||||
//执行重新发送
|
||||
if (StrUtil.isNotEmpty(id)) {
|
||||
//查询日志表
|
||||
IntegrationTaskLivingDetailsEntity taskDetailEntity = taskLivingDetailsService.get(id);
|
||||
if (null != taskDetailEntity && JSONUtil.isTypeJSON(taskDetailEntity.getRootAppPk())){
|
||||
//拿到这张表的源系统ID
|
||||
JSONObject jsonObject = JSONObject.parseObject(taskDetailEntity.getRootAppPk());
|
||||
Long mdmCode = jsonObject.getLong("mdmCode");//主数据编码
|
||||
String documentRule = jsonObject.getString("documentRule");//行数据的单据规则编码
|
||||
String distributeId = jsonObject.getString("distributeId");//发送表id
|
||||
String type = jsonObject.getString("type");//发送类型,1、新增2、修改3、删除
|
||||
if(mdmCode == null || documentRule == null || distributeId == null || type == null
|
||||
|| "".equals(mdmCode) || "".equals(documentRule) || "".equals(distributeId) || "".equals(type)){
|
||||
taskDetailEntity.setResult("系统保存参数错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("系统保存参数错误");
|
||||
}
|
||||
String apiId = null;
|
||||
String scriptId = null;
|
||||
//查找对应数据,组装数据发送
|
||||
|
||||
//获取主数据信息
|
||||
MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(mdmCode);
|
||||
if(mdmModuleEntity == null || mdmModuleEntity.getId() == null ){
|
||||
taskDetailEntity.setResult("主数据不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("主数据不存在");
|
||||
|
||||
}
|
||||
|
||||
//获取主数据db
|
||||
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
|
||||
mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId());
|
||||
List<MdmModuleDbEntity> mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity);
|
||||
if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){
|
||||
taskDetailEntity.setResult("主数据数据源不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("主数据数据源不存在");
|
||||
|
||||
}
|
||||
|
||||
//获取分发表
|
||||
//获取分发的接口
|
||||
MdmModuleDistributeEntity mdmModuleDistributeEntity = mdmModuleDistributeDao.get(distributeId);
|
||||
if(mdmModuleDistributeEntity == null || mdmModuleDistributeEntity.getId() == null ){
|
||||
taskDetailEntity.setResult("分发不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("分发不存在");
|
||||
|
||||
}
|
||||
// 启用停用 0、停用
|
||||
if("0".equals(mdmModuleDistributeEntity.getEnabledState())){
|
||||
taskDetailEntity.setResult("分发已停用");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("分发已停用");
|
||||
|
||||
}
|
||||
// 启用停用 0、停用
|
||||
//if("1".equals(mdmModuleDistributeEntity.getEnabledType())){
|
||||
// taskDetailEntity.setResult("分发为手动下发");
|
||||
// taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
// return BaseResult.getFailureMessageEntity("分发为手动下发");
|
||||
//}
|
||||
//1、新增2、修改3、删除
|
||||
if("1".equals(type)){
|
||||
apiId = mdmModuleDistributeEntity.getAddApi();
|
||||
scriptId = mdmModuleDistributeEntity.getAddScript();
|
||||
}else if("2".equals(type)){
|
||||
apiId = mdmModuleDistributeEntity.getUpdateApi();
|
||||
scriptId = mdmModuleDistributeEntity.getUpdateScript();
|
||||
|
||||
}else if("3".equals(type)){
|
||||
apiId = mdmModuleDistributeEntity.getDeleteApi();
|
||||
scriptId = mdmModuleDistributeEntity.getDeleteScript();
|
||||
}
|
||||
if(apiId == null || "".equals(apiId)){
|
||||
taskDetailEntity.setResult("分发接口未选择,请先选择");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("分发接口未选择,请先选择");
|
||||
|
||||
}
|
||||
SysApplicationScriptEntity scriptEntity = null;
|
||||
if(scriptId != null && !"".equals(scriptId)){
|
||||
scriptEntity = sysApplicationScriptDao.get(scriptId);
|
||||
if(scriptEntity == null || scriptEntity.getId() == null ){
|
||||
taskDetailEntity.setResult("分发接口脚本不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("分发接口脚本不存在");
|
||||
}
|
||||
}
|
||||
SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(apiId);
|
||||
if(apiEntity == null || apiEntity.getId() == null ){
|
||||
taskDetailEntity.setResult("分发接口不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("分发接口不存在");
|
||||
|
||||
}
|
||||
SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId());
|
||||
if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){
|
||||
taskDetailEntity.setResult("应用不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("应用不存在");
|
||||
|
||||
}
|
||||
|
||||
//获取主数据db字段,以及字段的规则
|
||||
MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity();
|
||||
queryFild.setMdmId(mdmModuleEntity.getId());
|
||||
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild);
|
||||
MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity();
|
||||
queryFildRule.setMdmId(mdmModuleEntity.getId());
|
||||
queryFildRule.setRuleCode("service");
|
||||
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule);
|
||||
//获取主数据db对应的实体表的数据
|
||||
JSONObject object = new JSONObject();
|
||||
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||
if("1".equals(mdmModuleDbEntities.get(i).getDbType())){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("tableName",mdmModuleDbEntities.get(i).getDbName());
|
||||
map.put("documentRule",documentRule);
|
||||
object = mdmModuleDao.queryMdmST(map);
|
||||
if(object.getString("id") == null || "".equals(object.getString("id")) ){
|
||||
taskDetailEntity.setResult("当前数据不存在");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("当前数据不存在");
|
||||
}
|
||||
//查看主表是否有字段是关联的
|
||||
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
|
||||
for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){
|
||||
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
|
||||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||
Map<String,String> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||
if("2".equals(mdmModuleDbEntities.get(i).getDbType())){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("tableName",mdmModuleDbEntities.get(i).getDbName());
|
||||
map.put("formmainId",object.getString("id"));
|
||||
List<JSONObject> detail = mdmModuleDao.queryMdmSTDetail(map);
|
||||
//查看主表是否有字段是关联的
|
||||
if(detail != null && detail.size() > 0){
|
||||
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
|
||||
for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){
|
||||
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
|
||||
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||
for (int i3 = 0; i3 < detail.size(); i3++) {
|
||||
Map<String,String> mapDetail = new HashMap<>();
|
||||
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||
mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
object.put(mdmModuleDbEntities.get(i).getDbName(),detail);
|
||||
}
|
||||
}
|
||||
//执行脚本
|
||||
JSONObject groovy = new JSONObject();
|
||||
JSONObject parameterJson = new JSONObject();
|
||||
parameterJson.put("header",apiEntity.getHeaderIn());
|
||||
parameterJson.put("body",apiEntity.getBodyIn());
|
||||
parameterJson.put("query",apiEntity.getQueryIn());
|
||||
parameterJson.put("data",object);
|
||||
/** head */
|
||||
Map<String, String> header = null;
|
||||
/** query */
|
||||
String querys = null;
|
||||
/** body */
|
||||
String bodys = object.toJSONString();
|
||||
if(scriptEntity != null && scriptEntity.getId() != null ){
|
||||
groovy.put("code",scriptEntity.getScriptCode());
|
||||
groovy.put("className",scriptEntity.getClassName());
|
||||
groovy.put("name",scriptEntity.getScriptName());
|
||||
groovy.put("methodStr",scriptEntity.getScriptData());
|
||||
groovy.put("parameterJson",parameterJson);
|
||||
JSONObject groovyStr = new JSONObject();
|
||||
groovyStr.put("jsonStr",groovy);
|
||||
try {
|
||||
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||
header = jsonResultEntity.getHeaders();
|
||||
querys = jsonResultEntity.getQuerys();
|
||||
bodys = jsonResultEntity.getBodys();
|
||||
}catch (Exception e){
|
||||
taskDetailEntity.setResult("分发脚本转换错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
//return BaseResult.getFailureMessageEntity("分发脚本转换错误");
|
||||
}
|
||||
}
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||
headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||
headers.put("appId",sysApplicationEntity.getAppId().toString());
|
||||
headers.put("apiCode",apiEntity.getApiCode().toString());
|
||||
if(header != null){
|
||||
headers.putAll(header);
|
||||
}
|
||||
//组装数据发送
|
||||
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
taskDetailEntity.setResult("发送成功");
|
||||
taskLivingDetailsService.saveLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("发送成功");
|
||||
}else {
|
||||
taskDetailEntity.setResult("发送错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
return BaseResult.getFailureMessageEntity("发送错误");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//执行正常下发
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
logger.info("执行成功");
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("执行失败{}",e.getMessage());
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
}
|
||||
|
||||
private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map<String, String> headers ,String bodys ,String querys) {
|
||||
StringBuffer urls = new StringBuffer(url);
|
||||
if (querys != null) {
|
||||
urls.append("?");
|
||||
urls.append(querys);
|
||||
}
|
||||
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||
// HttpClient
|
||||
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
|
||||
HttpPost post = new HttpPost(urls.toString());
|
||||
CloseableHttpResponse response = null;
|
||||
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build();
|
||||
post.setConfig(requestConfig);//设置请求参数【超时时间】
|
||||
|
||||
if (headers != null && headers.size() > 0) {
|
||||
for (String key : headers.keySet()) {
|
||||
post.setHeader(key, headers.get(key));
|
||||
}
|
||||
}
|
||||
StringBuilder body = new StringBuilder();
|
||||
boolean flag = true;
|
||||
try {
|
||||
if (bodys != null && !"".equals(bodys)) {
|
||||
ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8"));
|
||||
entity.setContentType("application/json");
|
||||
post.setEntity(entity);
|
||||
}
|
||||
response = closeableHttpClient.execute(post);
|
||||
|
||||
HttpEntity entity = response.getEntity();
|
||||
synchronized (lock) {
|
||||
body.append(EntityUtils.toString(entity,"UTF-8"));
|
||||
}
|
||||
flag = true;
|
||||
logger.info("返回结果:" + body);
|
||||
} catch (Exception e) {
|
||||
logger.error("请求错误:" + e.getMessage());
|
||||
body.append(e.getMessage());
|
||||
flag = false;
|
||||
} finally {
|
||||
try {
|
||||
// 关闭响应对象
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
// 关闭响应对象
|
||||
if (closeableHttpClient != null) {
|
||||
closeableHttpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
if (flag) {
|
||||
if (JSONUtil.isTypeJSON(body.toString())) {
|
||||
JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(),JsonResultEntity.class);
|
||||
if(jsonResultEntity.isFlag()){
|
||||
return BaseResult.getSuccessMessageEntity("转发成功", body);
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>MdmModulePlugin</id>
|
||||
<name>MdmModulePlugin插件</name>
|
||||
<category>90000001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmModuleInitializer" class="com.hzya.frame.plugin.mdmDistribute.plugin.MdmModulePluginInitializer" />
|
||||
</beans>
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.mdm.mdmModule.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.mdm.entity.MdmDataDto;
|
||||
import com.hzya.frame.mdm.entity.MdmDto;
|
||||
import com.hzya.frame.mdm.entity.MdmQuery;
|
||||
|
@ -47,5 +48,9 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
|
|||
|
||||
Integer deleteTable(Map<String, Object> maps);
|
||||
|
||||
|
||||
JSONObject queryMdmST(Map<String, String> maps);
|
||||
List<JSONObject> queryMdmSTDetail(Map<String, String> maps);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.mdm.mdmModule.dao.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.mdm.entity.MdmDataDto;
|
||||
import com.hzya.frame.mdm.entity.MdmDto;
|
||||
import com.hzya.frame.mdm.entity.MdmQuery;
|
||||
|
@ -127,6 +128,9 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
|
|||
Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteTable", maps);
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Integer alterTable(Map<String, Object> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps);
|
||||
|
@ -144,5 +148,18 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
|
|||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryMdmST(Map<String, String> maps) {
|
||||
JSONObject o = (JSONObject) super.selectOne(getSqlIdPrifx() + "queryMdmST", maps);
|
||||
return o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryMdmSTDetail(Map<String, String> maps) {
|
||||
List<JSONObject> o = (List<JSONObject>) super.selectList(getSqlIdPrifx() + "queryMdmSTDetail", maps);
|
||||
return o;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -792,5 +792,23 @@ where id = #{id}
|
|||
<select id="queryMainCount" resultType="Integer" parameterType="com.hzya.frame.mdm.entity.MdmQuery">
|
||||
select count(1) from ${tableName} where sts='Y'
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryMdmST" resultType="com.alibaba.fastjson.JSONObject"
|
||||
parameterType="java.util.HashMap">
|
||||
select * from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="documentRule != null and documentRule !='' ">and document_rule = #{documentRule}</if>
|
||||
<if test="id != null and id !='' ">and id = #{id}</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryMdmSTDetail" resultType="com.alibaba.fastjson.JSONObject"
|
||||
parameterType="java.util.HashMap">
|
||||
select * from ${tableName} where sts='Y' and formmain_id = #{formmainId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -495,6 +495,16 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
|||
//新增 设置日志表
|
||||
setMdmField(mdmModuleDbEntity1, mdmModuleDbFiledsEntities);
|
||||
}
|
||||
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||
//查看表是否存在
|
||||
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
|
||||
mdmModuleDbEntity.setDbName(mdmModuleDbEntities.get(i).getDbName());
|
||||
mdmModuleDbEntity.setSts("Y");
|
||||
int a = mdmModuleDbDao.getCount(mdmModuleDbEntity);
|
||||
if(a > 0){
|
||||
return BaseResult.getFailureMessageEntity("表已存在,请修改");
|
||||
}
|
||||
}
|
||||
mdmServiceCache.saveOrUpdateMdmModuleDb(entity.getMdmId(), mdmModuleDbEntities);
|
||||
mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities);
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* 模版数据库字段表(MdmModuleDbFileds)实体类
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
|||
* 主数据功能应用分发表(mdm_module_distribute: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-14 10:06:36
|
||||
* @since 2024-06-18 11:39:46
|
||||
*/
|
||||
public interface IMdmModuleDistributeDao extends IBaseDao<MdmModuleDistributeEntity, String> {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
|||
* 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-14 10:06:36
|
||||
* @since 2024-06-18 11:39:46
|
||||
*/
|
||||
@Repository(value = "MdmModuleDistributeDaoImpl")
|
||||
public class MdmModuleDistributeDaoImpl extends MybatisGenericDao<MdmModuleDistributeEntity, String> implements IMdmModuleDistributeDao{
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.hzya.frame.web.entity.BaseEntity;
|
|||
* 主数据功能应用分发表(MdmModuleDistribute)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-14 10:06:36
|
||||
* @since 2024-06-18 11:39:46
|
||||
*/
|
||||
public class MdmModuleDistributeEntity extends BaseEntity {
|
||||
|
||||
|
@ -17,20 +17,29 @@ public class MdmModuleDistributeEntity extends BaseEntity {
|
|||
private String mdmId;
|
||||
/** 应用id */
|
||||
private String appId;
|
||||
/** 触发类型 0、手动1、自动 */
|
||||
private String enabledType;
|
||||
/** 修改接口 */
|
||||
private String updateApi;
|
||||
/** 修改插件 */
|
||||
private String updateScript;
|
||||
/** 新增接口 */
|
||||
private String addApi;
|
||||
/** 新增插件 */
|
||||
private String addScript;
|
||||
/** 删除接口 */
|
||||
private String deleteApi;
|
||||
/** 删除插件 */
|
||||
private String deleteScript;
|
||||
/** 启用停用 0、停用1、启用 */
|
||||
private String enabledState;
|
||||
/** 主表ID */
|
||||
private String dbId;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/** 公司id */
|
||||
private List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities;
|
||||
|
||||
private List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities;
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
|
@ -48,6 +57,14 @@ public class MdmModuleDistributeEntity extends BaseEntity {
|
|||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getEnabledType() {
|
||||
return enabledType;
|
||||
}
|
||||
|
||||
public void setEnabledType(String enabledType) {
|
||||
this.enabledType = enabledType;
|
||||
}
|
||||
|
||||
public String getUpdateApi() {
|
||||
return updateApi;
|
||||
}
|
||||
|
@ -56,6 +73,14 @@ public class MdmModuleDistributeEntity extends BaseEntity {
|
|||
this.updateApi = updateApi;
|
||||
}
|
||||
|
||||
public String getUpdateScript() {
|
||||
return updateScript;
|
||||
}
|
||||
|
||||
public void setUpdateScript(String updateScript) {
|
||||
this.updateScript = updateScript;
|
||||
}
|
||||
|
||||
public String getAddApi() {
|
||||
return addApi;
|
||||
}
|
||||
|
@ -64,6 +89,14 @@ public class MdmModuleDistributeEntity extends BaseEntity {
|
|||
this.addApi = addApi;
|
||||
}
|
||||
|
||||
public String getAddScript() {
|
||||
return addScript;
|
||||
}
|
||||
|
||||
public void setAddScript(String addScript) {
|
||||
this.addScript = addScript;
|
||||
}
|
||||
|
||||
public String getDeleteApi() {
|
||||
return deleteApi;
|
||||
}
|
||||
|
@ -72,6 +105,14 @@ public class MdmModuleDistributeEntity extends BaseEntity {
|
|||
this.deleteApi = deleteApi;
|
||||
}
|
||||
|
||||
public String getDeleteScript() {
|
||||
return deleteScript;
|
||||
}
|
||||
|
||||
public void setDeleteScript(String deleteScript) {
|
||||
this.deleteScript = deleteScript;
|
||||
}
|
||||
|
||||
public String getEnabledState() {
|
||||
return enabledState;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
|
||||
<result property="enabledType" column="enabled_type" jdbcType="VARCHAR"/>
|
||||
<result property="updateApi" column="update_api" jdbcType="VARCHAR"/>
|
||||
<result property="updateScript" column="update_script" jdbcType="VARCHAR"/>
|
||||
<result property="addApi" column="add_api" jdbcType="VARCHAR"/>
|
||||
<result property="addScript" column="add_script" jdbcType="VARCHAR"/>
|
||||
<result property="deleteApi" column="delete_api" jdbcType="VARCHAR"/>
|
||||
<result property="deleteScript" column="delete_script" jdbcType="VARCHAR"/>
|
||||
<result property="enabledState" column="enabled_state" jdbcType="VARCHAR"/>
|
||||
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
|
@ -25,9 +29,13 @@
|
|||
id
|
||||
,mdm_id
|
||||
,app_id
|
||||
,enabled_type
|
||||
,update_api
|
||||
,update_script
|
||||
,add_api
|
||||
,add_script
|
||||
,delete_api
|
||||
,delete_script
|
||||
,enabled_state
|
||||
,db_id
|
||||
,sorts
|
||||
|
@ -55,9 +63,13 @@
|
|||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="enabledType != null and enabledType != ''"> and enabled_type = #{enabledType} </if>
|
||||
<if test="updateApi != null and updateApi != ''"> and update_api = #{updateApi} </if>
|
||||
<if test="updateScript != null and updateScript != ''"> and update_script = #{updateScript} </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
|
||||
<if test="addScript != null and addScript != ''"> and add_script = #{addScript} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> and delete_script = #{deleteScript} </if>
|
||||
<if test="enabledState != null and enabledState != ''"> and enabled_state = #{enabledState} </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
|
@ -81,9 +93,13 @@
|
|||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="enabledType != null and enabledType != ''"> and enabled_type = #{enabledType} </if>
|
||||
<if test="updateApi != null and updateApi != ''"> and update_api = #{updateApi} </if>
|
||||
<if test="updateScript != null and updateScript != ''"> and update_script = #{updateScript} </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
|
||||
<if test="addScript != null and addScript != ''"> and add_script = #{addScript} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> and delete_script = #{deleteScript} </if>
|
||||
<if test="enabledState != null and enabledState != ''"> and enabled_state = #{enabledState} </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
|
@ -109,9 +125,13 @@
|
|||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
|
||||
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
|
||||
<if test="enabledType != null and enabledType != ''"> and enabled_type like concat('%',#{enabledType},'%') </if>
|
||||
<if test="updateApi != null and updateApi != ''"> and update_api like concat('%',#{updateApi},'%') </if>
|
||||
<if test="updateScript != null and updateScript != ''"> and update_script like concat('%',#{updateScript},'%') </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api like concat('%',#{addApi},'%') </if>
|
||||
<if test="addScript != null and addScript != ''"> and add_script like concat('%',#{addScript},'%') </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api like concat('%',#{deleteApi},'%') </if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> and delete_script like concat('%',#{deleteScript},'%') </if>
|
||||
<if test="enabledState != null and enabledState != ''"> and enabled_state like concat('%',#{enabledState},'%') </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
|
@ -137,9 +157,13 @@
|
|||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
|
||||
<if test="enabledType != null and enabledType != ''"> or enabled_type = #{enabledType} </if>
|
||||
<if test="updateApi != null and updateApi != ''"> or update_api = #{updateApi} </if>
|
||||
<if test="updateScript != null and updateScript != ''"> or update_script = #{updateScript} </if>
|
||||
<if test="addApi != null and addApi != ''"> or add_api = #{addApi} </if>
|
||||
<if test="addScript != null and addScript != ''"> or add_script = #{addScript} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> or delete_api = #{deleteApi} </if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> or delete_script = #{deleteScript} </if>
|
||||
<if test="enabledState != null and enabledState != ''"> or enabled_state = #{enabledState} </if>
|
||||
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
|
@ -157,15 +181,19 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
|
||||
<if test="appId != null and appId != ''"> app_id , </if>
|
||||
<if test="enabledType != null and enabledType != ''"> enabled_type , </if>
|
||||
<if test="updateApi != null and updateApi != ''"> update_api , </if>
|
||||
<if test="updateScript != null and updateScript != ''"> update_script , </if>
|
||||
<if test="addApi != null and addApi != ''"> add_api , </if>
|
||||
<if test="addScript != null and addScript != ''"> add_script , </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> delete_api , </if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> delete_script , </if>
|
||||
<if test="enabledState != null and enabledState != ''"> enabled_state , </if>
|
||||
<if test="dbId != null and dbId != ''"> db_id , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
|
@ -184,9 +212,13 @@
|
|||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
|
||||
<if test="appId != null and appId != ''"> #{appId} ,</if>
|
||||
<if test="enabledType != null and enabledType != ''"> #{enabledType} ,</if>
|
||||
<if test="updateApi != null and updateApi != ''"> #{updateApi} ,</if>
|
||||
<if test="updateScript != null and updateScript != ''"> #{updateScript} ,</if>
|
||||
<if test="addApi != null and addApi != ''"> #{addApi} ,</if>
|
||||
<if test="addScript != null and addScript != ''"> #{addScript} ,</if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> #{deleteApi} ,</if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> #{deleteScript} ,</if>
|
||||
<if test="enabledState != null and enabledState != ''"> #{enabledState} ,</if>
|
||||
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
|
@ -203,26 +235,30 @@
|
|||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute(mdm_id, app_id, enabled_type, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
(#{entity.mdmId},#{entity.appId},#{entity.enabledType},#{entity.updateApi},#{entity.updateScript},#{entity.addApi},#{entity.addScript},#{entity.deleteApi},#{entity.deleteScript},#{entity.enabledState},#{entity.dbId},#{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 mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute(mdm_id, app_id, enabled_type, update_api, update_script, add_api, add_script, delete_api, delete_script, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
(#{entity.mdmId},#{entity.appId},#{entity.enabledType},#{entity.updateApi},#{entity.updateScript},#{entity.addApi},#{entity.addScript},#{entity.deleteApi},#{entity.deleteScript},#{entity.enabledState},#{entity.dbId},#{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
|
||||
mdm_id = values(mdm_id),
|
||||
app_id = values(app_id),
|
||||
enabled_type = values(enabled_type),
|
||||
update_api = values(update_api),
|
||||
update_script = values(update_script),
|
||||
add_api = values(add_api),
|
||||
add_script = values(add_script),
|
||||
delete_api = values(delete_api),
|
||||
delete_script = values(delete_script),
|
||||
enabled_state = values(enabled_state),
|
||||
db_id = values(db_id),
|
||||
create_user_id = values(create_user_id),
|
||||
|
@ -238,9 +274,13 @@ update mdm_module_distribute set
|
|||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
|
||||
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
|
||||
<if test="enabledType != null and enabledType != ''"> enabled_type = #{enabledType},</if>
|
||||
<if test="updateApi != null and updateApi != ''"> update_api = #{updateApi},</if>
|
||||
<if test="updateScript != null and updateScript != ''"> update_script = #{updateScript},</if>
|
||||
<if test="addApi != null and addApi != ''"> add_api = #{addApi},</if>
|
||||
<if test="addScript != null and addScript != ''"> add_script = #{addScript},</if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> delete_api = #{deleteApi},</if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> delete_script = #{deleteScript},</if>
|
||||
<if test="enabledState != null and enabledState != ''"> enabled_state = #{enabledState},</if>
|
||||
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
|
@ -265,9 +305,13 @@ update mdm_module_distribute set sts= 'N' ,modify_time = #{modify_time},modify_
|
|||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="enabledType != null and enabledType != ''"> and enabled_type = #{enabledType} </if>
|
||||
<if test="updateApi != null and updateApi != ''"> and update_api = #{updateApi} </if>
|
||||
<if test="updateScript != null and updateScript != ''"> and update_script = #{updateScript} </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
|
||||
<if test="addScript != null and addScript != ''"> and add_script = #{addScript} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
|
||||
<if test="deleteScript != null and deleteScript != ''"> and delete_script = #{deleteScript} </if>
|
||||
<if test="enabledState != null and enabledState != ''"> and enabled_state = #{enabledState} </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* 主数据功能应用分发表(MdmModuleDistribute)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-14 10:06:36
|
||||
* @since 2024-06-18 11:39:46
|
||||
*/
|
||||
public interface IMdmModuleDistributeService extends IBaseService<MdmModuleDistributeEntity, String>{
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService;
|
|||
* 主数据功能应用分发表(MdmModuleDistribute)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-14 10:06:36
|
||||
* @since 2024-06-18 11:39:46
|
||||
*/
|
||||
@Service(value = "mdmModuleDistributeService")
|
||||
public class MdmModuleDistributeServiceImpl extends BaseService<MdmModuleDistributeEntity, String> implements IMdmModuleDistributeService {
|
||||
|
|
|
@ -196,7 +196,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(
|
||||
|
@ -220,7 +219,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 != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
|
|
|
@ -167,7 +167,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(
|
||||
|
@ -187,7 +186,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 != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
|
|
|
@ -161,7 +161,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(
|
||||
|
@ -180,7 +179,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 != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
|
|
|
@ -161,7 +161,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(
|
||||
|
@ -179,7 +178,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 != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_source a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
|
|
|
@ -3,20 +3,15 @@ package com.hzya.frame.report.reportManage.service.impl;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.report.reportManage.dao.IReportManageDao;
|
||||
import com.hzya.frame.report.reportManage.entity.JimuReportEntity;
|
||||
import com.hzya.frame.report.reportManage.entity.ReportManageEntity;
|
||||
import com.hzya.frame.report.reportManage.dao.IReportManageDao;
|
||||
import com.hzya.frame.report.reportManage.service.IReportManageService;
|
||||
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.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -28,272 +23,269 @@ import java.util.List;
|
|||
*/
|
||||
@Service(value = "reportManageService")
|
||||
public class ReportManageServiceImpl extends BaseService<ReportManageEntity, String> implements IReportManageService {
|
||||
|
||||
|
||||
private IReportManageDao reportManageDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void setReportManageDao(IReportManageDao dao) {
|
||||
this.reportManageDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
public void setReportManageDao(IReportManageDao dao) {
|
||||
this.reportManageDao = 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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<ReportManageEntity> list = reportManageDao.queryByLikeClassify(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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<ReportManageEntity> list = reportManageDao.queryByLikeClassify(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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
entity = new ReportManageEntity();
|
||||
}
|
||||
List<ReportManageEntity> list = reportManageDao.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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
entity = new ReportManageEntity();
|
||||
}
|
||||
List<ReportManageEntity> list = reportManageDao.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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getReportId() == null || "".equals(entity.getReportId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择报表");
|
||||
}
|
||||
if (entity.getReportName() == null || "".equals(entity.getReportName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入报表名称");
|
||||
}
|
||||
if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择分类");
|
||||
}
|
||||
if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setState("0");
|
||||
if (!checkIsUse(entity)) {
|
||||
return BaseResult.getFailureMessageEntity("当前报表已经配置,请勿重复配置");
|
||||
}
|
||||
entity.setCreate();
|
||||
//保存
|
||||
reportManageDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存报表成功", entity);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存报表
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject jsonObject) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getReportId() == null || "".equals(entity.getReportId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择报表");
|
||||
}
|
||||
if (entity.getReportName() == null || "".equals(entity.getReportName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入报表名称");
|
||||
}
|
||||
if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择分类");
|
||||
}
|
||||
if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setState("0");
|
||||
if (!checkIsUse(entity)) {
|
||||
return BaseResult.getFailureMessageEntity("当前报表已经配置,请勿重复配置");
|
||||
}
|
||||
entity.setCreate();
|
||||
//保存
|
||||
reportManageDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存报表成功", entity);
|
||||
}
|
||||
|
||||
|
||||
private boolean checkIsUse(ReportManageEntity entity) {
|
||||
ReportManageEntity checkUse = new ReportManageEntity();
|
||||
checkUse.setReportId(entity.getReportId());
|
||||
return reportManageDao.getCount(checkUse) <= 0;
|
||||
}
|
||||
|
||||
private boolean checkIsUse(ReportManageEntity entity) {
|
||||
ReportManageEntity checkUse = new ReportManageEntity();
|
||||
checkUse.setReportId(entity.getReportId());
|
||||
if (reportManageDao.getCount(checkUse) > 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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = reportManageDao.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:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = reportManageDao.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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getReportId() == null || "".equals(entity.getReportId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择报表");
|
||||
}
|
||||
if (entity.getReportName() == null || "".equals(entity.getReportName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入报表名称");
|
||||
}
|
||||
if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择分类");
|
||||
}
|
||||
if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
reportManageDao.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 updateEntity(JSONObject jsonObject) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getReportId() == null || "".equals(entity.getReportId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择报表");
|
||||
}
|
||||
if (entity.getReportName() == null || "".equals(entity.getReportName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入报表名称");
|
||||
}
|
||||
if (entity.getClassifyId() == null || "".equals(entity.getClassifyId())) {
|
||||
return BaseResult.getFailureMessageEntity("请先选择分类");
|
||||
}
|
||||
if (entity.getPreviewAddress() == null || "".equals(entity.getPreviewAddress())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
reportManageDao.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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
reportManageDao.logicRemove(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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
reportManageDao.logicRemove(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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getState() == null || "".equals(entity.getState())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
reportManageDao.update(entity);
|
||||
//0启用 1 停用
|
||||
if ("0".equals(entity.getState())) {
|
||||
return BaseResult.getSuccessMessageEntity("启用用户成功");
|
||||
} else {
|
||||
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) {
|
||||
ReportManageEntity entity = getData("jsonStr", jsonObject, ReportManageEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getState() == null || "".equals(entity.getState())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
reportManageDao.update(entity);
|
||||
//0启用 1 停用
|
||||
if ("0".equals(entity.getState())) {
|
||||
return BaseResult.getSuccessMessageEntity("启用用户成功");
|
||||
} else {
|
||||
return BaseResult.getSuccessMessageEntity("停用用户成功");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询报表
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryReport(JSONObject jsonObject) {
|
||||
JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<JimuReportEntity> list = reportManageDao.queryReportNotUse(entity);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询报表
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryReport(JSONObject jsonObject) {
|
||||
JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<JimuReportEntity> list = reportManageDao.queryReportNotUse(entity);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询报表
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryReportEntity(JSONObject jsonObject) {
|
||||
JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = reportManageDao.queryReportEntity(entity);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("获取报表失败");
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("获取报表成功", entity);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询报表
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryReportEntity(JSONObject jsonObject) {
|
||||
JimuReportEntity entity = getData("jsonStr", jsonObject, JimuReportEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = reportManageDao.queryReportEntity(entity);
|
||||
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 jurisdiction(JSONObject jsonObject) {
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 权限查询
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity jurisdiction(JSONObject jsonObject) {
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存权限查询
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveJurisdiction(JSONObject jsonObject) {
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存权限查询
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveJurisdiction(JSONObject jsonObject) {
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package com.hzya.frame.sysnew.application.api.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 应用api(SysApplicationApi)实体类
|
||||
|
@ -301,5 +306,38 @@ public class SysApplicationApiEntity extends BaseEntity {
|
|||
public void setAppUrl(String appUrl) {
|
||||
this.appUrl = appUrl;
|
||||
}
|
||||
|
||||
public List<JSONObject> getHeaderInValue() {
|
||||
List<JSONObject> jsonObjects = new ArrayList<>();
|
||||
if(headerIn != null && !"".equals(headerIn)){
|
||||
JSONArray headers = JSONArray.parseArray(headerIn);
|
||||
if(headers != null && headers.size() > 0){
|
||||
for (int i = 0; i < headers.size(); i++) {
|
||||
JSONObject object = new JSONObject();
|
||||
object.put(headers.getJSONObject(i).getString("parameterName"),headers.getJSONObject(i).getString("example"));
|
||||
jsonObjects.add(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
return jsonObjects;
|
||||
}
|
||||
|
||||
public String getQueryInValue() {
|
||||
StringBuffer jsonObjects = new StringBuffer();
|
||||
if(queryIn != null && !"".equals(queryIn)){
|
||||
JSONArray querys = JSONArray.parseArray(queryIn);
|
||||
if(querys != null && querys.size() > 0){
|
||||
for (int i = 0; i < querys.size(); i++) {
|
||||
if(i != 0){
|
||||
jsonObjects.append("&");
|
||||
}
|
||||
jsonObjects.append(querys.getJSONObject(i).getString("parameterName"));
|
||||
jsonObjects.append("=");
|
||||
jsonObjects.append(querys.getJSONObject(i).getString("example"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return jsonObjects.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
a.id,
|
||||
a.api_status,
|
||||
b.name as app_name,
|
||||
b.interfaceAddress as app_url,
|
||||
b.interface_address as app_url,
|
||||
a.app_id,
|
||||
a.catalogue_id,
|
||||
c.name as catalogue_name,
|
||||
|
@ -704,7 +704,7 @@ where id = #{id}
|
|||
<!-- </trim>-->
|
||||
<!-- order by a.sorts asc-->
|
||||
<!-- </select>-->
|
||||
<select id="queryVoList" databaseId="mysql" resultType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiVo" parameterType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity">
|
||||
<select id="queryVoList" resultType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiVo" parameterType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity">
|
||||
select
|
||||
a.id,
|
||||
a.catalogue_id AS catalogueId,
|
||||
|
|
|
@ -59,7 +59,8 @@ public class SysApplicationDto {
|
|||
private String systemAddress;
|
||||
//api接口参数表
|
||||
private List<SysApplicationApiParaEntity> apiParas;
|
||||
|
||||
/** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */
|
||||
private String appType;
|
||||
//数据源
|
||||
private SysApplicationDatabaseEntity databaseEntity;
|
||||
private Integer pageNum;
|
||||
|
@ -262,5 +263,13 @@ public class SysApplicationDto {
|
|||
public void setSystemAddress(String systemAddress) {
|
||||
this.systemAddress = systemAddress;
|
||||
}
|
||||
|
||||
public String getAppType() {
|
||||
return appType;
|
||||
}
|
||||
|
||||
public void setAppType(String appType) {
|
||||
this.appType = appType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ public class SysApplicationEntity extends BaseEntity {
|
|||
/** 数据源是否启用(1、开启 2、关闭) */
|
||||
private String dbStatus;
|
||||
|
||||
/** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */
|
||||
private String appType;
|
||||
/** appid */
|
||||
private Integer appId;
|
||||
/** ip白名单 */
|
||||
|
@ -191,5 +193,13 @@ public class SysApplicationEntity extends BaseEntity {
|
|||
public void setSystemAddress(String systemAddress) {
|
||||
this.systemAddress = systemAddress;
|
||||
}
|
||||
|
||||
public String getAppType() {
|
||||
return appType;
|
||||
}
|
||||
|
||||
public void setAppType(String appType) {
|
||||
this.appType = appType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<result property="interfaceAddress" column="interface_address" jdbcType="VARCHAR"/>
|
||||
<result property="interfaceStatus" column="interface_status" jdbcType="VARCHAR"/>
|
||||
<result property="dbStatus" column="db_status" jdbcType="VARCHAR"/>
|
||||
<result property="appType" column="app_type" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
|
@ -51,7 +52,8 @@
|
|||
,interface_address
|
||||
,interface_status
|
||||
,db_status
|
||||
,sorts
|
||||
,app_type
|
||||
,sorts
|
||||
,org_id
|
||||
,sts
|
||||
,create_time
|
||||
|
@ -90,6 +92,7 @@
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> and interface_address = #{interfaceAddress} </if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> and interface_status = #{interfaceStatus} </if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
|
||||
<if test="appType != null and appType != ''"> and app_type = #{appType} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
|
@ -126,6 +129,7 @@
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> and interface_address = #{interfaceAddress} </if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> and interface_status = #{interfaceStatus} </if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
|
||||
<if test="appType != null and appType != ''"> and app_type = #{appType} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
|
@ -164,6 +168,7 @@
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> and interface_address like concat('%',#{interfaceAddress},'%') </if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> and interface_status like concat('%',#{interfaceStatus},'%') </if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> and db_status like concat('%',#{dbStatus},'%') </if>
|
||||
<if test="appType != null and appType != ''"> and app_type like concat('%',#{appType},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
|
@ -202,6 +207,7 @@
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> or interface_address = #{interfaceAddress} </if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> or interface_status = #{interfaceStatus} </if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> or db_status = #{dbStatus} </if>
|
||||
<if test="appType != null and appType != ''"> or app_type = #{appType} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
|
@ -239,6 +245,7 @@
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> interface_address , </if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> interface_status , </if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> db_status , </if>
|
||||
<if test="appType != null and appType != ''"> app_type , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
|
@ -271,6 +278,7 @@
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> #{interfaceAddress} ,</if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> #{interfaceStatus} ,</if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> #{dbStatus} ,</if>
|
||||
<if test="appType != null and appType != ''"> #{appType} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
|
@ -285,18 +293,18 @@
|
|||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts)
|
||||
insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y')
|
||||
(#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id)
|
||||
insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id})
|
||||
(#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
app_logo = values(app_logo),
|
||||
|
@ -317,6 +325,7 @@
|
|||
interface_address = values(interface_address),
|
||||
interface_status = values(interface_status),
|
||||
db_status = values(db_status),
|
||||
app_type = values(app_type),
|
||||
sorts = values(sorts),
|
||||
org_id = values(org_id),
|
||||
sts = values(sts),
|
||||
|
@ -346,6 +355,7 @@ update sys_application set
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> interface_address = #{interfaceAddress},</if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> interface_status = #{interfaceStatus},</if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> db_status = #{dbStatus},</if>
|
||||
<if test="appType != null and appType != ''"> app_type = #{appType},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
|
@ -384,6 +394,7 @@ update sys_application set sts= 'N' ,modify_time = #{modify_time},modify_user_i
|
|||
<if test="interfaceAddress != null and interfaceAddress != ''"> and interface_address = #{interfaceAddress} </if>
|
||||
<if test="interfaceStatus != null and interfaceStatus != ''"> and interface_status = #{interfaceStatus} </if>
|
||||
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
|
||||
<if test="appType != null and appType != ''"> and app_type = #{appType} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
|
@ -411,6 +422,7 @@ update sys_application set sts= 'N' ,modify_time = #{modify_time},modify_user_i
|
|||
,a.app_introduction as appIntroduction
|
||||
,a.interface_status as interfaceStatus
|
||||
,a.db_status as dbStatus
|
||||
,a.app_type as appType
|
||||
from sys_application a
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="affiliationField != null and affiliationField != ''"> and a.affiliation_field = #{affiliationField} </if>
|
||||
|
|
|
@ -37,6 +37,8 @@ public class SysApplicationVo {
|
|||
/** 应用是否启用(1、启用 2、停用) */
|
||||
private String appStatus;
|
||||
|
||||
/** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */
|
||||
private String appType;
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -148,5 +150,13 @@ public class SysApplicationVo {
|
|||
public void setSystemAddress(String systemAddress) {
|
||||
this.systemAddress = systemAddress;
|
||||
}
|
||||
|
||||
public String getAppType() {
|
||||
return appType;
|
||||
}
|
||||
|
||||
public void setAppType(String appType) {
|
||||
this.appType = appType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ public class SysExtensionApiEntity {
|
|||
private String querys;
|
||||
/** body */
|
||||
private String bodys;
|
||||
//byteBodys
|
||||
private byte[] byteBodys;
|
||||
/** 发送方应用 */
|
||||
private SysApplicationEntity sendApp;
|
||||
/** 接收方应用 */
|
||||
|
@ -67,5 +69,13 @@ public class SysExtensionApiEntity {
|
|||
public void setReceiveApi(SysApplicationApiEntity receiveApi) {
|
||||
this.receiveApi = receiveApi;
|
||||
}
|
||||
|
||||
public byte[] getByteBodys() {
|
||||
return byteBodys;
|
||||
}
|
||||
|
||||
public void setByteBodys(byte[] byteBodys) {
|
||||
this.byteBodys = byteBodys;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.sysnew.application.script.dao;
|
||||
|
||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 脚本表(sys_application_script: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-17 11:07:21
|
||||
*/
|
||||
public interface ISysApplicationScriptDao extends IBaseDao<SysApplicationScriptEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.sysnew.application.script.dao.impl;
|
||||
|
||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||
import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 脚本表(SysApplicationScript)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-17 11:07:22
|
||||
*/
|
||||
@Repository(value = "SysApplicationScriptDaoImpl")
|
||||
public class SysApplicationScriptDaoImpl extends MybatisGenericDao<SysApplicationScriptEntity, String> implements ISysApplicationScriptDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.hzya.frame.sysnew.application.script.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 脚本表(SysApplicationScript)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-17 11:07:22
|
||||
*/
|
||||
public class SysApplicationScriptEntity extends BaseEntity {
|
||||
|
||||
/** 应用id */
|
||||
private String appId;
|
||||
/** 脚本名称 */
|
||||
private String scriptName;
|
||||
/** 脚本编号 */
|
||||
private String scriptCode;
|
||||
/** 脚本版本 */
|
||||
private String scriptVersion;
|
||||
/** classname */
|
||||
private String className;
|
||||
/** 脚本内容 */
|
||||
private String scriptData;
|
||||
/** 描述 */
|
||||
private String scriptRemark;
|
||||
/** 发布日期 */
|
||||
private Date releaseDate;
|
||||
/** 启用停用(1启用2停用) */
|
||||
private String scriptStatus;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getScriptName() {
|
||||
return scriptName;
|
||||
}
|
||||
|
||||
public void setScriptName(String scriptName) {
|
||||
this.scriptName = scriptName;
|
||||
}
|
||||
|
||||
public String getScriptCode() {
|
||||
return scriptCode;
|
||||
}
|
||||
|
||||
public void setScriptCode(String scriptCode) {
|
||||
this.scriptCode = scriptCode;
|
||||
}
|
||||
|
||||
public String getScriptVersion() {
|
||||
return scriptVersion;
|
||||
}
|
||||
|
||||
public void setScriptVersion(String scriptVersion) {
|
||||
this.scriptVersion = scriptVersion;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public String getScriptData() {
|
||||
return scriptData;
|
||||
}
|
||||
|
||||
public void setScriptData(String scriptData) {
|
||||
this.scriptData = scriptData;
|
||||
}
|
||||
|
||||
public String getScriptRemark() {
|
||||
return scriptRemark;
|
||||
}
|
||||
|
||||
public void setScriptRemark(String scriptRemark) {
|
||||
this.scriptRemark = scriptRemark;
|
||||
}
|
||||
|
||||
public Date getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setReleaseDate(Date releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
public String getScriptStatus() {
|
||||
return scriptStatus;
|
||||
}
|
||||
|
||||
public void setScriptStatus(String scriptStatus) {
|
||||
this.scriptStatus = scriptStatus;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,304 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sysnew.application.script.dao.impl.SysApplicationScriptDaoImpl">
|
||||
|
||||
<resultMap id="get-SysApplicationScriptEntity-result" type="com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
|
||||
<result property="scriptName" column="script_name" jdbcType="VARCHAR"/>
|
||||
<result property="scriptCode" column="script_code" jdbcType="VARCHAR"/>
|
||||
<result property="scriptVersion" column="script_version" jdbcType="VARCHAR"/>
|
||||
<result property="className" column="class_name" jdbcType="VARCHAR"/>
|
||||
<result property="scriptData" column="script_data" jdbcType="VARCHAR"/>
|
||||
<result property="scriptRemark" column="script_remark" jdbcType="VARCHAR"/>
|
||||
<result property="releaseDate" column="release_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="scriptStatus" column="script_status" 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 = "SysApplicationScriptEntity_Base_Column_List">
|
||||
id
|
||||
,app_id
|
||||
,script_name
|
||||
,script_code
|
||||
,script_version
|
||||
,class_name
|
||||
,script_data
|
||||
,script_remark
|
||||
,release_date
|
||||
,script_status
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysApplicationScriptEntity-result">
|
||||
select
|
||||
<include refid="SysApplicationScriptEntity_Base_Column_List"/>
|
||||
from sys_application_script where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysApplicationScriptEntity-result" parameterType = "com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity">
|
||||
select
|
||||
<include refid="SysApplicationScriptEntity_Base_Column_List" />
|
||||
from sys_application_script
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="scriptName != null and scriptName != ''"> and script_name = #{scriptName} </if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> and script_code = #{scriptCode} </if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> and script_version = #{scriptVersion} </if>
|
||||
<if test="className != null and className != ''"> and class_name = #{className} </if>
|
||||
<if test="scriptData != null and scriptData != ''"> and script_data = #{scriptData} </if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> and script_remark = #{scriptRemark} </if>
|
||||
<if test="releaseDate != null"> and release_date = #{releaseDate} </if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> and script_status = #{scriptStatus} </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.application.script.entity.SysApplicationScriptEntity">
|
||||
select count(1) from sys_application_script
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="scriptName != null and scriptName != ''"> and script_name = #{scriptName} </if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> and script_code = #{scriptCode} </if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> and script_version = #{scriptVersion} </if>
|
||||
<if test="className != null and className != ''"> and class_name = #{className} </if>
|
||||
<if test="scriptData != null and scriptData != ''"> and script_data = #{scriptData} </if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> and script_remark = #{scriptRemark} </if>
|
||||
<if test="releaseDate != null"> and release_date = #{releaseDate} </if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> and script_status = #{scriptStatus} </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>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-SysApplicationScriptEntity-result" parameterType = "com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity">
|
||||
select
|
||||
<include refid="SysApplicationScriptEntity_Base_Column_List" />
|
||||
from sys_application_script
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
|
||||
<if test="scriptName != null and scriptName != ''"> and script_name like concat('%',#{scriptName},'%') </if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> and script_code like concat('%',#{scriptCode},'%') </if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> and script_version like concat('%',#{scriptVersion},'%') </if>
|
||||
<if test="className != null and className != ''"> and class_name like concat('%',#{className},'%') </if>
|
||||
<if test="scriptData != null and scriptData != ''"> and script_data like concat('%',#{scriptData},'%') </if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> and script_remark like concat('%',#{scriptRemark},'%') </if>
|
||||
<if test="releaseDate != null"> and release_date like concat('%',#{releaseDate},'%') </if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> and script_status like concat('%',#{scriptStatus},'%') </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>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysApplicationScriptentity_list_or" resultMap="get-SysApplicationScriptEntity-result" parameterType = "com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity">
|
||||
select
|
||||
<include refid="SysApplicationScriptEntity_Base_Column_List" />
|
||||
from sys_application_script
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
|
||||
<if test="scriptName != null and scriptName != ''"> or script_name = #{scriptName} </if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> or script_code = #{scriptCode} </if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> or script_version = #{scriptVersion} </if>
|
||||
<if test="className != null and className != ''"> or class_name = #{className} </if>
|
||||
<if test="scriptData != null and scriptData != ''"> or script_data = #{scriptData} </if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> or script_remark = #{scriptRemark} </if>
|
||||
<if test="releaseDate != null"> or release_date = #{releaseDate} </if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> or script_status = #{scriptStatus} </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>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity" >
|
||||
insert into sys_application_script(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="appId != null and appId != ''"> app_id , </if>
|
||||
<if test="scriptName != null and scriptName != ''"> script_name , </if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> script_code , </if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> script_version , </if>
|
||||
class_name ,
|
||||
<if test="scriptData != null and scriptData != ''"> script_data , </if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> script_remark , </if>
|
||||
<if test="releaseDate != null"> release_date , </if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> script_status , </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="appId != null and appId != ''"> #{appId} ,</if>
|
||||
<if test="scriptName != null and scriptName != ''"> #{scriptName} ,</if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> #{scriptCode} ,</if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> #{scriptVersion} ,</if>
|
||||
CONCAT('g','_',LAST_INSERT_ID()) ,
|
||||
<if test="scriptData != null and scriptData != ''"> #{scriptData} ,</if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> #{scriptRemark} ,</if>
|
||||
<if test="releaseDate != null"> #{releaseDate} ,</if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> #{scriptStatus} ,</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 sys_application_script(app_id, script_name, script_code, script_version, class_name, script_data, script_remark, release_date, script_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.appId},#{entity.scriptName},#{entity.scriptCode},#{entity.scriptVersion},#{entity.className},#{entity.scriptData},#{entity.scriptRemark},#{entity.releaseDate},#{entity.scriptStatus},#{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 sys_application_script(app_id, script_name, script_code, script_version, class_name, script_data, script_remark, release_date, script_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.appId},#{entity.scriptName},#{entity.scriptCode},#{entity.scriptVersion},#{entity.className},#{entity.scriptData},#{entity.scriptRemark},#{entity.releaseDate},#{entity.scriptStatus},#{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
|
||||
app_id = values(app_id),
|
||||
script_name = values(script_name),
|
||||
script_code = values(script_code),
|
||||
script_version = values(script_version),
|
||||
class_name = values(class_name),
|
||||
script_data = values(script_data),
|
||||
script_remark = values(script_remark),
|
||||
release_date = values(release_date),
|
||||
script_status = values(script_status),
|
||||
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.application.script.entity.SysApplicationScriptEntity" >
|
||||
update sys_application_script set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
|
||||
<if test="scriptName != null and scriptName != ''"> script_name = #{scriptName},</if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> script_code = #{scriptCode},</if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> script_version = #{scriptVersion},</if>
|
||||
<if test="className != null and className != ''"> class_name = #{className},</if>
|
||||
<if test="scriptData != null and scriptData != ''"> script_data = #{scriptData},</if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> script_remark = #{scriptRemark},</if>
|
||||
<if test="releaseDate != null"> release_date = #{releaseDate},</if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> script_status = #{scriptStatus},</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.application.script.entity.SysApplicationScriptEntity" >
|
||||
update sys_application_script 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.application.script.entity.SysApplicationScriptEntity" >
|
||||
update sys_application_script 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="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="scriptName != null and scriptName != ''"> and script_name = #{scriptName} </if>
|
||||
<if test="scriptCode != null and scriptCode != ''"> and script_code = #{scriptCode} </if>
|
||||
<if test="scriptVersion != null and scriptVersion != ''"> and script_version = #{scriptVersion} </if>
|
||||
<if test="className != null and className != ''"> and class_name = #{className} </if>
|
||||
<if test="scriptData != null and scriptData != ''"> and script_data = #{scriptData} </if>
|
||||
<if test="scriptRemark != null and scriptRemark != ''"> and script_remark = #{scriptRemark} </if>
|
||||
<if test="releaseDate != null"> and release_date = #{releaseDate} </if>
|
||||
<if test="scriptStatus != null and scriptStatus != ''"> and script_status = #{scriptStatus} </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">
|
||||
delete from sys_application_script where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.sysnew.application.script.service;
|
||||
|
||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 脚本表(SysApplicationScript)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-17 11:07:22
|
||||
*/
|
||||
public interface ISysApplicationScriptService extends IBaseService<SysApplicationScriptEntity, String>{
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.hzya.frame.sysnew.application.script.service.impl;
|
||||
|
||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||
import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao;
|
||||
import com.hzya.frame.sysnew.application.script.service.ISysApplicationScriptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 脚本表(SysApplicationScript)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-17 11:07:22
|
||||
*/
|
||||
@Service(value = "sysApplicationScriptService")
|
||||
public class SysApplicationScriptServiceImpl extends BaseService<SysApplicationScriptEntity, String> implements ISysApplicationScriptService {
|
||||
|
||||
private ISysApplicationScriptDao sysApplicationScriptDao;
|
||||
|
||||
@Autowired
|
||||
public void setSysApplicationScriptDao(ISysApplicationScriptDao dao) {
|
||||
this.sysApplicationScriptDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -357,4 +357,74 @@ public interface ISysApplicationService extends IBaseService<SysApplicationEntit
|
|||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryPlugAndApi(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 脚本查询分页接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity queryAppScriptPage(JSONObject jsonObject);
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 脚本查询接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity queryAppScript(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 脚本修改接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity saveAppScript(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 脚本修改接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity updateAppScript(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 脚本删除接口
|
||||
* @Date 2:10 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity deleteAppScript(JSONObject jsonObject);
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 获取脚本接口
|
||||
* @Date 2:10 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity getAppScript(JSONObject jsonObject);
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 脚本启用停用接口
|
||||
* @Date 2:10 下午 2023/9/23
|
||||
* @param jsonObject
|
||||
* @return
|
||||
**/
|
||||
JsonResultEntity enableOrDisableAppScript(JSONObject jsonObject);
|
||||
|
||||
/****
|
||||
* ESB请求转发重载方法,临时处理传入请求对象
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2024-06-19 9:34
|
||||
* @param
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
JsonResultEntity externalCallInterfaceToESB(ServletRequest servletRequest, ServletResponse servletResponse);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hzya.frame.sysnew.application.service.impl;
|
||||
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
@ -11,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.serviceUtil.DsDataSourceUtil;
|
||||
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
|
||||
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiDto;
|
||||
|
@ -25,17 +25,15 @@ import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao;
|
|||
import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity;
|
||||
import com.hzya.frame.sysnew.application.apiType.dao.ISysApplicationApiTypeDao;
|
||||
import com.hzya.frame.sysnew.application.apiType.entity.SysApplicationApiTypeEntity;
|
||||
import com.hzya.frame.sysnew.application.dao.ISysApplicationDao;
|
||||
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.SysApplicationDatasourceDto;
|
||||
import com.hzya.frame.sysnew.application.entity.SysApplicationDto;
|
||||
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
|
||||
import com.hzya.frame.sysnew.application.dao.ISysApplicationDao;
|
||||
import com.hzya.frame.sysnew.application.entity.SysApplicationVo;
|
||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||
import com.hzya.frame.sysnew.application.entity.*;
|
||||
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.script.dao.ISysApplicationScriptDao;
|
||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||
import com.hzya.frame.sysnew.application.service.ISysApplicationService;
|
||||
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
|
||||
import com.hzya.frame.sysnew.messageManage.dao.ISysMessageManageDao;
|
||||
|
@ -45,17 +43,12 @@ import com.hzya.frame.sysnew.messageManageDetail.entity.SysMessageManageDetailEn
|
|||
import com.hzya.frame.sysnew.messageManageLog.dao.ISysMessageManageLogDao;
|
||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogPageVo;
|
||||
import com.hzya.frame.sysnew.popedomInterface.entity.SysPopedomInterfaceEntity;
|
||||
import com.hzya.frame.sysnew.sysInterface.entity.SysInterfaceEntity;
|
||||
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
|
||||
import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity;
|
||||
import com.hzya.frame.util.AESUtil;
|
||||
import com.hzya.frame.util.IPHelper;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.action.ApplicationContextUtil;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
|
@ -65,27 +58,17 @@ import org.apache.http.entity.ByteArrayEntity;
|
|||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 应用表(SysApplication)表服务实现类
|
||||
|
@ -116,6 +99,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
@Resource
|
||||
private ISysApplicationPluginDao sysApplicationPluginDao;
|
||||
@Resource
|
||||
private ISysApplicationScriptDao sysApplicationScriptDao;
|
||||
@Resource
|
||||
private ISysMessageManageDao sysMessageManageDao;
|
||||
@Resource
|
||||
private ISysMessageManageDetailDao sysMessageManageDetailDao; //明细表
|
||||
|
@ -2282,4 +2267,521 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
|
|||
jsonObject1.put("api",sysApplicationApiEntity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", jsonObject1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 脚本查询分页接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryAppScriptPage(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<SysApplicationScriptEntity> sysApplicationScriptEntities = sysApplicationScriptDao.queryByLike(entity);
|
||||
PageInfo pageInfo = new PageInfo(sysApplicationScriptEntities);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 脚本查询接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryAppScript(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
List<SysApplicationScriptEntity> sysApplicationScriptEntities = sysApplicationScriptDao.queryByLike(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationScriptEntities);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 脚本修改接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveAppScript(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getScriptCode() == null || "".equals(entity.getScriptCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入脚本编号");
|
||||
}
|
||||
if (entity.getScriptData() == null || "".equals(entity.getScriptData())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入脚本内容");
|
||||
}
|
||||
entity.setCreate();
|
||||
sysApplicationScriptDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存脚本成功", entity.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 脚本修改接口
|
||||
* @Date 2:09 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity updateAppScript(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getScriptCode() == null || "".equals(entity.getScriptCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入脚本编号");
|
||||
}
|
||||
if (entity.getScriptData() == null || "".equals(entity.getScriptData())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入脚本内容");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysApplicationScriptDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("修改脚本成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 脚本删除接口
|
||||
* @Date 2:10 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteAppScript(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysApplicationScriptDao.logicRemoveMultiCondition(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除脚本成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 获取脚本接口
|
||||
* @Date 2:10 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getAppScript(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//查询接口
|
||||
SysApplicationScriptEntity sysApplicationScriptEntity = sysApplicationScriptDao.get(entity.getId());
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationScriptEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return
|
||||
* @Author lvleigang
|
||||
* @Description 脚本启用停用接口
|
||||
* @Date 2:10 下午 2023/9/23
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity enableOrDisableAppScript(JSONObject object) {
|
||||
SysApplicationScriptEntity entity = getData("jsonStr", object, SysApplicationScriptEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getScriptStatus() == null || "".equals(entity.getScriptStatus())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysApplicationScriptDao.update(entity);
|
||||
if ("1".equals(entity.getScriptStatus())) {// 1启用2停用
|
||||
return BaseResult.getSuccessMessageEntity("启用成功");
|
||||
} else {
|
||||
return BaseResult.getSuccessMessageEntity("停用成功");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity externalCallInterfaceToESB(ServletRequest servletRequest, ServletResponse servletResponse) {
|
||||
|
||||
//例如:A应用发送数据到中台,中台转发到B应用
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
String oldbodys = ServletUtil.getBody(servletRequest);
|
||||
Map<String, String> oldheaderMap = ServletUtil.getHeaderMap(request);
|
||||
String oldquerys = request.getQueryString();
|
||||
//应用key
|
||||
String publicKey = request.getHeader("publicKey");
|
||||
//应用密钥
|
||||
String secretKey = request.getHeader("secretKey");
|
||||
//appId
|
||||
String appId = request.getHeader("appId");
|
||||
//apiCode
|
||||
String apiCode = request.getHeader("apiCode");
|
||||
|
||||
String ip = IPHelper.getIpAddr(request);
|
||||
if (publicKey == null || "".equals(publicKey)) {
|
||||
return BaseResult.getFailureMessageEntity("请先传递公钥");
|
||||
}
|
||||
if (secretKey == null || "".equals(secretKey)) {
|
||||
return BaseResult.getFailureMessageEntity("请先传递密钥");
|
||||
}
|
||||
if (appId == null || "".equals(appId)) {
|
||||
return BaseResult.getFailureMessageEntity("请先传递接收方应用");
|
||||
}
|
||||
if (apiCode == null || "".equals(apiCode)) {
|
||||
return BaseResult.getFailureMessageEntity("请先传递发送接口");
|
||||
}
|
||||
|
||||
logger.info("请求参数:publicKey:【" + publicKey + "】secretKey:【" + secretKey + "】appId:【" + appId + "】apiCode:【" + apiCode);
|
||||
//根据请求a应用的公钥、密钥是否能查找到一条数据
|
||||
|
||||
SysApplicationEntity sendApp = getAppByPublicKeySecretKey(publicKey, secretKey);
|
||||
if (sendApp == null) {
|
||||
//saveLog(new SysApplicationEntity(), new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"公钥、密钥错误");
|
||||
return BaseResult.getFailureMessageEntity("公钥、密钥错误,请联系管理员");
|
||||
}
|
||||
//判断应用是否启用
|
||||
if (sendApp.getAppStatus() == null || !"1".equals(sendApp.getAppStatus())) {
|
||||
saveLog(sendApp, new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,sendApp.getName() + "应用未启用");
|
||||
return BaseResult.getFailureMessageEntity(sendApp.getName() + "应用未启用,请联系管理员");
|
||||
}
|
||||
|
||||
|
||||
SysApplicationEntity receiveApp = getAppByAppId(appId);
|
||||
if (receiveApp == null) {
|
||||
saveLog(sendApp, new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"根据appId:" + appId + "未匹配到应用");
|
||||
return BaseResult.getFailureMessageEntity("根据appId:" + appId + "未匹配到应用,请联系管理员");
|
||||
}
|
||||
//判断应用是否启用
|
||||
if (receiveApp.getAppStatus() == null || !"1".equals(receiveApp.getAppStatus())) {
|
||||
saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用未启用" );
|
||||
return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用未启用,请联系管理员");
|
||||
}
|
||||
//判断应用接口是否启用
|
||||
if (receiveApp.getInterfaceStatus() == null || !"1".equals(receiveApp.getInterfaceStatus())) {
|
||||
saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用接口环境未启用" );
|
||||
return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用接口环境未启用,请联系管理员");
|
||||
}
|
||||
|
||||
SysApplicationApiEntity receiveApi = getApiByAppIdApiCode(receiveApp.getId(), apiCode);
|
||||
if (receiveApi == null) {
|
||||
saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + ":" + apiCode + "未启用或者未创建" );
|
||||
return BaseResult.getFailureMessageEntity(receiveApp.getName() + ":" + apiCode + "未启用或者未创建");
|
||||
}
|
||||
|
||||
SysApplicationApiAuthEntity sysApplicationApiAuthEntity = getApiAuthByNameAppId(sendApp.getId(), receiveApp.getId());
|
||||
if (sysApplicationApiAuthEntity == null) {
|
||||
saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用权限配置错误" );
|
||||
return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用权限配置错误");
|
||||
}
|
||||
if (sysApplicationApiAuthEntity.getSystemAddress() != null && !"".equals(sysApplicationApiAuthEntity.getSystemAddress())
|
||||
&& !sysApplicationApiAuthEntity.getSystemAddress().contains(ip)) {
|
||||
saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误" );
|
||||
return BaseResult.getFailureMessageEntity(receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误");
|
||||
}
|
||||
|
||||
SysApplicationApiAuthDetailEntity sysApplicationApiAuthDetailEntity = getApiAuthDetailByAppIdApiIdTripartiteSystemId(receiveApp.getId(), receiveApi.getId(), sysApplicationApiAuthEntity.getId());
|
||||
if (sysApplicationApiAuthDetailEntity == null) {
|
||||
saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApi.getApiName() + "未授权给" + sendApp.getName() );
|
||||
return BaseResult.getFailureMessageEntity(receiveApi.getApiName() + "未授权给" + sendApp.getName() + ",请联系管理员");
|
||||
}
|
||||
SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity();
|
||||
|
||||
|
||||
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 object1 = jsonArray.getJSONObject(i);
|
||||
headers.put(object1.getString("parameterName"), object1.getString("example"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldheaderMap != null && oldheaderMap.size() > 0) {
|
||||
for (Map.Entry<String, String> entry : oldheaderMap.entrySet()) {
|
||||
if (!a.contains(entry.getKey())) {
|
||||
headers.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sysExtensionApiEntity.setSendApp(sendApp);
|
||||
sysExtensionApiEntity.setReceiveApp(receiveApp);
|
||||
sysExtensionApiEntity.setReceiveApi(receiveApi);
|
||||
sysExtensionApiEntity.setHeaders(headers);
|
||||
sysExtensionApiEntity.setQuerys(oldquerys);
|
||||
sysExtensionApiEntity.setBodys(oldbodys);
|
||||
Method[] methods = null;
|
||||
Object object = null;
|
||||
|
||||
|
||||
|
||||
|
||||
// 判断是否有内部api 是否扩展api 1、启用 2、停用
|
||||
if (receiveApi.getExtensionApi() != null && "1".equals(receiveApi.getExtensionApi())
|
||||
&& receiveApi.getBeanName() != null && !"".equals(receiveApi.getBeanName())
|
||||
&& receiveApi.getFunName() != null && !"".equals(receiveApi.getFunName())
|
||||
) {
|
||||
//获取类
|
||||
try {
|
||||
object = ApplicationContextUtil.getBeanByName(receiveApi.getBeanName());
|
||||
} catch (SecurityException e) {
|
||||
|
||||
}
|
||||
//获取类下面的方法
|
||||
methods = object.getClass().getMethods();
|
||||
if (methods == null || methods.length == 0) {
|
||||
return BaseResult.getFailureMessageEntity("未找到内部方法,请联系管理员");
|
||||
}
|
||||
for (Method m : methods) {
|
||||
if (null != m) {
|
||||
if (m.getName().equals(receiveApi.getFunName().trim())) {
|
||||
try {
|
||||
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
sysExtensionApiEntity = (SysExtensionApiEntity) m.invoke(object, sysExtensionApiEntity);
|
||||
logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
} catch (Exception e) {
|
||||
logger.error("invokeException{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("内部方法执行错误,请联系管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
headers = sysExtensionApiEntity.getHeaders();
|
||||
String querys = sysExtensionApiEntity.getQuerys();
|
||||
|
||||
byte[] byteBodys = sysExtensionApiEntity.getByteBodys();
|
||||
//设置参数获取参数
|
||||
StringBuffer url = new StringBuffer();
|
||||
if(!receiveApi.getDestinationAddress().toLowerCase().startsWith("http")){
|
||||
url.append(receiveApp.getInterfaceAddress());
|
||||
}
|
||||
url.append(receiveApi.getDestinationAddress());
|
||||
if (querys != null) {
|
||||
url.append("?");
|
||||
url.append(querys);
|
||||
}
|
||||
Integer outTime = 6000;
|
||||
if (receiveApi.getTimeoutPeriod() != null && !"".equals(receiveApi.getTimeoutPeriod())) {
|
||||
outTime = Integer.valueOf(receiveApi.getTimeoutPeriod());
|
||||
}
|
||||
//1、POST 2、GET
|
||||
String method = "POST";
|
||||
if ("2".equals(receiveApi.getRequestMethod())) {
|
||||
method = "GET";
|
||||
}
|
||||
//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 object1 = jsonArray.getJSONObject(i);
|
||||
// headers.put(object1.getString("parameterName"), object1.getString("example"));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//if (headerMap != null && headerMap.size() > 0) {
|
||||
// for (Map.Entry<String, String> entry : headerMap.entrySet()) {
|
||||
// if (!a.contains(entry.getKey())) {
|
||||
// headers.put(entry.getKey(), entry.getValue());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if ("POST".equals(method)) {
|
||||
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||
// HttpClient
|
||||
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
|
||||
HttpPost post = new HttpPost(url.toString());
|
||||
CloseableHttpResponse response = null;
|
||||
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build();
|
||||
post.setConfig(requestConfig);//设置请求参数【超时时间】
|
||||
|
||||
if (headers != null && headers.size() > 0) {
|
||||
for (String key : headers.keySet()) {
|
||||
post.setHeader(key, headers.get(key));
|
||||
}
|
||||
}
|
||||
StringBuilder body = new StringBuilder();
|
||||
boolean flag = true;
|
||||
try {
|
||||
if (byteBodys != null && !"".equals(byteBodys)) {
|
||||
ByteArrayEntity entity = new ByteArrayEntity(byteBodys);
|
||||
entity.setContentType("application/json");
|
||||
post.setEntity(entity);
|
||||
}
|
||||
response = closeableHttpClient.execute(post);
|
||||
|
||||
HttpEntity entity = response.getEntity();
|
||||
synchronized (lock) {
|
||||
body.append(EntityUtils.toString(entity,"UTF-8"));
|
||||
}
|
||||
flag = true;
|
||||
logger.info("返回结果:" + body);
|
||||
} catch (Exception e) {
|
||||
logger.error("请求错误:" + e.getMessage());
|
||||
body.append(e.getMessage());
|
||||
flag = false;
|
||||
} finally {
|
||||
try {
|
||||
// 关闭响应对象
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
// 关闭响应对象
|
||||
if (closeableHttpClient != null) {
|
||||
closeableHttpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
logger.info("保存日志开始");
|
||||
SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,String.valueOf(byteBodys), oldheaderMap,headers, headers, oldquerys,querys, body.toString(),true,null);
|
||||
if (methods != null && methods.length > 0) {
|
||||
for (Method m : methods) {
|
||||
if (null != m) {
|
||||
if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) {
|
||||
try {
|
||||
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
m.invoke(object, sysMessageManageLogEntity);
|
||||
logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
} catch (Exception e) {
|
||||
logger.error("invokeException{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("保存日志结束");
|
||||
if (flag) {
|
||||
if (JSONUtil.isTypeJSON(body.toString())) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(body.toString());
|
||||
if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){
|
||||
return BaseResult.getSuccessMessageEntity("转发成功", jsonObject);
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", jsonObject);
|
||||
}
|
||||
} else {
|
||||
if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){
|
||||
return BaseResult.getSuccessMessageEntity("转发成功", body);
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
|
||||
} else {//GET
|
||||
|
||||
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||
// HttpClient
|
||||
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
|
||||
HttpGet get = new HttpGet(url.toString());
|
||||
CloseableHttpResponse response = null;
|
||||
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build();
|
||||
get.setConfig(requestConfig);//设置请求参数【超时时间】
|
||||
if (headers != null && headers.size() > 0) {
|
||||
for (String key : headers.keySet()) {
|
||||
get.setHeader(key, headers.get(key));
|
||||
}
|
||||
}
|
||||
StringBuilder body = new StringBuilder();
|
||||
|
||||
boolean flag = true;
|
||||
try {
|
||||
response = closeableHttpClient.execute(get);
|
||||
HttpEntity entity = response.getEntity();
|
||||
synchronized (lock) {
|
||||
body.append(EntityUtils.toString(entity,"UTF-8"));
|
||||
}
|
||||
flag = true;
|
||||
logger.info("返回结果:" + body);
|
||||
} catch (Exception e) {
|
||||
logger.error("请求错误:" + e.getMessage());
|
||||
body.append(e.getMessage());
|
||||
flag = false;
|
||||
} finally {
|
||||
try {
|
||||
// 关闭响应对象
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
// 关闭响应对象
|
||||
if (closeableHttpClient != null) {
|
||||
closeableHttpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
logger.info("保存日志开始");
|
||||
SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,String.valueOf(byteBodys), oldheaderMap,headers, headers, oldquerys,querys, body.toString(), true,null);
|
||||
if (methods != null && methods.length > 0) {
|
||||
for (Method m : methods) {
|
||||
if (null != m) {
|
||||
if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) {
|
||||
try {
|
||||
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
m.invoke(object, sysMessageManageLogEntity);
|
||||
logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
} catch (Exception e) {
|
||||
logger.error("invokeException{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("保存日志结束");
|
||||
if (flag) {
|
||||
if (JSONUtil.isTypeJSON(body.toString())) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(body.toString());
|
||||
if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){
|
||||
return BaseResult.getSuccessMessageEntity("转发成功", jsonObject);
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", jsonObject);
|
||||
}
|
||||
} else {
|
||||
if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){
|
||||
return BaseResult.getSuccessMessageEntity("转发成功", body);
|
||||
}else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("转发失败", body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.hzya.frame.sysnew.grovy.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
|
@ -21,5 +22,5 @@ public interface IGroovyIntegrationService {
|
|||
* @param jsonObject 请求参数对象
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
JsonResultEntity groovyScriptExecution(JSONObject jsonObject);
|
||||
SysExtensionApiEntity groovyScriptExecution(JSONObject jsonObject);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,11 @@ package com.hzya.frame.sysnew.grovy.service.impl;
|
|||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||
import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService;
|
||||
import com.hzya.frame.util.GroovyUtil;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import groovy.lang.GroovyClassLoader;
|
||||
import groovy.lang.GroovyObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -24,28 +23,41 @@ import org.springframework.stereotype.Service;
|
|||
public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(GroovyIntegrationServiceImpl.class);
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// HelloWorld helloWorld = new HelloWorld();
|
||||
// System.out.println(helloWorld.sayHello());
|
||||
// }
|
||||
|
||||
public static void main(String[] args) throws IllegalAccessException, InstantiationException {
|
||||
GroovyClassLoader groovyClassLoader = new GroovyClassLoader();
|
||||
|
||||
// 动态编译和加载Groovy脚本
|
||||
Class<?> groovyClass = groovyClassLoader.parseClass("println(\"1231231\")");
|
||||
|
||||
// 创建Groovy类的实例
|
||||
GroovyObject groovyObject = (GroovyObject) groovyClass.newInstance();
|
||||
// 执行Groovy脚本
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("name", "张三");
|
||||
Object returnObj = groovyObject.invokeMethod("run", jsonObject.toJSONString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity groovyScriptExecution(JSONObject jsonObject) {
|
||||
public SysExtensionApiEntity groovyScriptExecution(JSONObject jsonObject) {
|
||||
Object object = GroovyUtil.execute(jsonObject);
|
||||
return BaseResult.getSuccessMessageEntity(object);
|
||||
return new SysExtensionApiEntity();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
java.lang.String str = "{\"project_org\":\"\",\"modify_time\":\"2024-06-17 16:52:34\",\"project_duty_dept\":null,\"project_name\":\"凯伍德组织档案\",\"document_rule_num\":1,\"add_status\":\"0\",\"delete_status\":\"1\",\"project_dutier\":\"\",\"id\":\"fb12734c8267488b96833633e68a7abc\",\"data_status\":\"F\",\"modify_user_id\":\"c796fd9ba4c9f5ff3cc2fa41a040e443\",\"sorts\":1,\"project_memo\":\"\",\"document_rule\":\"XM-2024-06-17-00001\",\"create_user_id\":\"c796fd9ba4c9f5ff3cc2fa41a040e443\",\"create_time\":\"2024-06-17 16:42:18\",\"company_id\":null,\"project_sh_name\":\"\",\"project_code\":\"01004\",\"project_currtype\":\"\",\"update_status\":\"0\",\"sts\":\"Y\",\"org_id\":\"0\",\"project_parentpro\":\"\",\"project_bill_type\":\"\"}";
|
||||
|
||||
A88772 s = new A88772();
|
||||
s .execute(str);
|
||||
}
|
||||
static class A88772 {
|
||||
String execute(String jsonStr) {
|
||||
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
|
||||
com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
|
||||
com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();
|
||||
ufinterfaceObject.put("billtype", "supplier"); ufinterfaceObject.put("isexchange", "Y");
|
||||
ufinterfaceObject.put("replace", "Y"); ufinterfaceObject.put("sender", "OA");
|
||||
ufinterfaceObject.put("account", "01"); ufinterfaceObject.put("groupcode", "00");
|
||||
com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();
|
||||
com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();
|
||||
billheadObject.put("code", reqData.get("project_code")); billheadObject.put("supprop", "0");
|
||||
billheadObject.put("custstate", "1"); billheadObject.put("pk_supplierclass", "S01");
|
||||
billheadObject.put("pk_country", "CN"); billheadObject.put("pk_timezone", "P0800");
|
||||
billheadObject.put("pk_format", "ZH-CN"); billheadObject.put("enablestate", "2");
|
||||
billheadObject.put("name", reqData.get("project_sh_name")); billheadObject.put("pk_group", "00");
|
||||
billheadObject.put("pk_org", "003"); billheadObject.put("taxpayerid", "087981489021135119");
|
||||
returnObject.put("ufinterface",ufinterfaceObject); billObject.put("billhead", billheadObject); returnObject.put("bill",billObject);
|
||||
System.out.println( returnObject.toJSONString());
|
||||
return returnObject.toJSONString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
package com.hzya.frame.u8c.ax.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.u8c.ax.dao.IAxDao;
|
||||
import com.hzya.frame.u8c.ax.entity.ArchivesEntity;
|
||||
import com.hzya.frame.u8c.ax.entity.Ass;
|
||||
import com.hzya.frame.u8c.ax.entity.Voucher;
|
||||
import com.hzya.frame.u8c.ax.entity.VoucherDetails;
|
||||
import com.hzya.frame.u8c.ax.entity.VoucherRoot;
|
||||
import com.hzya.frame.u8c.ax.entity.*;
|
||||
import com.hzya.frame.u8c.ax.service.IAxService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
@ -22,14 +16,11 @@ import org.apache.http.entity.ByteArrayEntity;
|
|||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -218,6 +209,7 @@ public class AxServiceImpl extends BaseService<ArchivesEntity, String> implement
|
|||
post.setHeader("publicKey", publicKey);
|
||||
post.setHeader("secretKey", secretKey);
|
||||
post.setHeader("appId", appId);
|
||||
post.setHeader("needStackTrace", jsonObject.getString("needStackTrace"));
|
||||
switch (jsonObject.getString("voucherType")){
|
||||
case "add"://新增
|
||||
post.setHeader("apiCode", pzApiCodexz);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hzya.frame.webapp.entrance.controler;
|
||||
|
||||
import com.hzya.frame.bip.v3.v2207.service.IBipSsoService;
|
||||
import com.hzya.frame.sysnew.application.service.ISysApplicationService;
|
||||
import com.hzya.frame.sys.entity.EsbReturnEntity;
|
||||
import com.hzya.frame.sys.file.download.entity.FileDownloadEntity;
|
||||
|
@ -30,8 +29,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
|
@ -52,8 +49,6 @@ public class EntranceController {
|
|||
private IEntranceService entranceService;
|
||||
@Autowired
|
||||
protected IFileDownloadService filedownloadService;
|
||||
@Autowired
|
||||
protected IBipSsoService bipSsoService;
|
||||
@Resource
|
||||
protected ISysApplicationService sysApplicationService;
|
||||
@RequestMapping(value = "/option")
|
||||
|
@ -169,10 +164,9 @@ public class EntranceController {
|
|||
public JsonResultEntity externalCallInterface(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
|
||||
return sysApplicationService.externalCallInterface(servletRequest,servletResponse);
|
||||
}
|
||||
@RequestMapping(value = "/erpSso")
|
||||
@RequestMapping(value = "/externalCallInterface")
|
||||
@ResponseBody
|
||||
public String erpSso(HttpServletRequest request,HttpServletResponse response, String ticket) throws Exception {
|
||||
response.sendRedirect(bipSsoService.erpSso(request,ticket));
|
||||
return null;
|
||||
public JsonResultEntity externalCallInterfaceToESB(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
|
||||
return sysApplicationService.externalCallInterfaceToESB(servletRequest,servletResponse);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue