|
|
|
@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.function.Function; |
|
|
|
@ -36,26 +37,35 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 15:49 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolHeader getToolHeader(ToolHeader inData) throws APException { |
|
|
|
public Map<String, String> getToolHeader(ToolHeader inData) throws APException { |
|
|
|
logger.info("Tool Header查询参数:"+JSON.toJSONString(inData)); |
|
|
|
//查询的参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Header查询:"+JSON.toJSONString(inData)); |
|
|
|
return inData; |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -64,36 +74,37 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 15:52 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolHeader syncToolHeader(ToolHeader inData) throws APException { |
|
|
|
public Map<String, String> syncToolHeader(ToolHeader inData) throws APException { |
|
|
|
logger.info("Tool Header新增开始:"+JSON.toJSONString(inData)); |
|
|
|
//查询的参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
} |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap != null && headerMap.size() > 0) { |
|
|
|
throw new RuntimeException("Tool Header已存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap != null && headerMap.size() > 0) { |
|
|
|
throw new RuntimeException("Tool Header已存在!"); |
|
|
|
} |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.insertToolHeader(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(resultMap.get("OBJID")); |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置IFS信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
|
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.insertToolHeader(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Header新增结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return inData; |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -102,32 +113,40 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 15:55 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolHeader modifyToolHeader(ToolHeader inData) throws APException { |
|
|
|
public Map<String, String> modifyToolHeader(ToolHeader inData) throws APException { |
|
|
|
logger.info("Tool Header修改开始:"+JSON.toJSONString(inData)); |
|
|
|
//查询的参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询 |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询 |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
//调用修改api |
|
|
|
Map<String, String> resultMap = ToolApi.modifyToolHeader(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
//调用修改api |
|
|
|
Map<String, String> resultMap = ToolApi.modifyToolHeader(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Header修改结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果 |
|
|
|
return inData; |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -136,27 +155,37 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 15:58 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public void removeToolHeader(ToolHeader inData) throws APException { |
|
|
|
public Map<String, String> removeToolHeader(ToolHeader inData) throws APException { |
|
|
|
logger.info("Tool Header删除开始:"+JSON.toJSONString(inData)); |
|
|
|
//查询的参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询 |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询 |
|
|
|
Map<String, String> headerMap = ToolApi.getToolHeader(srv, contract, toolId); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(headerMap == null || headerMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Header不存在!"); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
ToolApi.removeToolHeader(srv, inData); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(headerMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(headerMap.get("IFSROWVERSION")); |
|
|
|
ToolApi.removeToolHeader(srv, inData); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Header 删除结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -165,28 +194,37 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 16:59 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolInstance getToolInstance(ToolInstance inData) throws APException { |
|
|
|
public Map<String, String> getToolInstance(ToolInstance inData) throws APException { |
|
|
|
logger.info("Tool Instance 查询开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null) { |
|
|
|
throw new RuntimeException("Tool Instance 不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null) { |
|
|
|
throw new RuntimeException("Tool Instance 不存在!"); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(instanceMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(instanceMap.get("IFSROWVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(instanceMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(instanceMap.get("IFSROWVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance 查询结束:"+JSON.toJSONString(inData)); |
|
|
|
return inData; |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -195,31 +233,39 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 17:03 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolInstance syncToolInstance(ToolInstance inData) throws APException { |
|
|
|
public Map<String, String> syncToolInstance(ToolInstance inData) throws APException { |
|
|
|
logger.info("Tool Instance 新增开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap != null && instanceMap.size() > 0) { |
|
|
|
throw new RuntimeException("Tool Instance 已存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap != null && instanceMap.size() > 0) { |
|
|
|
throw new RuntimeException("Tool Instance 已存在!"); |
|
|
|
} |
|
|
|
//调用新增api |
|
|
|
Map<String, String> resultMap = ToolApi.insertToolInstance(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(resultMap.get("OBJID")); |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//调用新增api |
|
|
|
Map<String, String> resultMap = ToolApi.insertToolInstance(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(resultMap.get("OBJID")); |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance 新增结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果 |
|
|
|
return inData; |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -228,33 +274,41 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 17:06 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolInstance modifyToolInstance(ToolInstance inData) throws APException { |
|
|
|
public Map<String, String> modifyToolInstance(ToolInstance inData) throws APException { |
|
|
|
logger.info("Tool Instance 修改开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(instanceMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(instanceMap.get("IFSROWVERSION")); |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.modifyToolInstance(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(instanceMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(instanceMap.get("IFSROWVERSION")); |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.modifyToolInstance(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance 修改结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果 |
|
|
|
return inData; |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -263,30 +317,39 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 17:07 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public void removeToolInstance(ToolInstance inData) throws APException { |
|
|
|
public Map<String, String> removeToolInstance(ToolInstance inData) throws APException { |
|
|
|
logger.info("Tool Instance 删除开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询工具实例的信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(instanceMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(instanceMap.get("IFSROWVERSION")); |
|
|
|
//调用api |
|
|
|
ToolApi.removeToolInstance(srv, inData); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(instanceMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(instanceMap.get("IFSROWVERSION")); |
|
|
|
//调用api |
|
|
|
ToolApi.removeToolInstance(srv, inData); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance 删除结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -295,32 +358,40 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/13 9:53 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public List<ToolInstanceDate> getToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
public Map<String, String> getToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
logger.info("Tool Instance Date查询开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//查询结果集 |
|
|
|
List<ToolInstanceDate> resultList = ToolApi.getToolInstanceDateList(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否查询数据 |
|
|
|
if(resultList.size() == 0 || resultList.isEmpty()) { |
|
|
|
throw new RuntimeException("不存在时间信息!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//查询结果集 |
|
|
|
List<ToolInstanceDate> resultList = ToolApi.getToolInstanceDateList(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否查询数据 |
|
|
|
if(resultList.size() == 0 || resultList.isEmpty()) { |
|
|
|
throw new RuntimeException("工具实例不存在时间信息!"); |
|
|
|
} |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(resultList)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance Date查询结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return resultList; |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -329,31 +400,39 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/12 17:23 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolInstanceDate syncToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
public Map<String, String> syncToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
logger.info("Bom替代明细集合新增开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.insertToolInstanceDate(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(resultMap.get("OBJID")); |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.insertToolInstanceDate(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(resultMap.get("OBJID")); |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Bom替代明细集合新增开始:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return inData; |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -362,29 +441,38 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/13 10:24 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public ToolInstanceDate modifyToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
public Map<String, String> modifyToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
logger.info("Tool Instance Date新增开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.modifyToolInstanceDate(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//调用api |
|
|
|
Map<String, String> resultMap = ToolApi.modifyToolInstanceDate(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance Date新增结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return inData; |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -393,27 +481,37 @@ public class ToolServiceBean { |
|
|
|
* @date 2024/12/13 10:26 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public void removeToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
public Map<String, String> removeToolInstanceDate(ToolInstanceDate inData) throws APException { |
|
|
|
logger.info("Tool Instance Date删除开始:"+JSON.toJSONString(inData)); |
|
|
|
//公共参数 |
|
|
|
Map<String, String> returnMap = new HashMap<>(); |
|
|
|
String username = inData.getIfsUsername(); |
|
|
|
String password = inData.getIfsPassword(); |
|
|
|
String contract = inData.getContract(); |
|
|
|
String toolId = inData.getToolId(); |
|
|
|
String toolInstance = inData.getToolInstance(); |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
try{ |
|
|
|
//获取连接 |
|
|
|
Server srv = ifsServer.getIfsServer(username, password); |
|
|
|
|
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
//查询制造商信息 |
|
|
|
Map<String, String> instanceMap = ToolApi.getToolInstance(srv, contract, toolId, toolInstance); |
|
|
|
//判断是否需要插入到ifs |
|
|
|
if(instanceMap == null || instanceMap.size() == 0) { |
|
|
|
throw new RuntimeException("Tool Instance不存在!"); |
|
|
|
} |
|
|
|
//调用api删除数据 |
|
|
|
ToolApi.removeToolInstanceDate(srv, inData); |
|
|
|
returnMap.put("resultCode", "200"); |
|
|
|
returnMap.put("obj", JSON.toJSONString(inData)); |
|
|
|
} catch(APException e){ |
|
|
|
returnMap.put("resultCode", "400"); |
|
|
|
returnMap.put("resultMsg", e.getMessage()); |
|
|
|
} |
|
|
|
//调用api删除数据 |
|
|
|
ToolApi.removeToolInstanceDate(srv, inData); |
|
|
|
//打印日志 |
|
|
|
logger.info("Tool Instance Date删除结束:"+JSON.toJSONString(inData)); |
|
|
|
//返回结果集 |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
} |