4 changed files with 531 additions and 63 deletions
-
2src/main/java/com/spring/ifs/api/ToolApiTest.java
-
73src/main/java/com/spring/ifs/bean/ToolServiceBean.java
-
517src/main/java/com/spring/ifs/bean/ToolServiceBeanTest.java
-
2src/main/java/com/spring/ifs/controller/TestIfsController.java
@ -0,0 +1,517 @@ |
|||||
|
package com.spring.ifs.bean; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.spring.ifs.api.IfsServer; |
||||
|
import com.spring.ifs.api.ToolApi; |
||||
|
import com.spring.ifs.data.ToolHeader; |
||||
|
import com.spring.ifs.data.ToolInstance; |
||||
|
import com.spring.ifs.data.ToolInstanceDate; |
||||
|
import ifs.fnd.ap.APException; |
||||
|
import ifs.fnd.ap.Server; |
||||
|
import org.slf4j.Logger; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @description: Tool的实现类 |
||||
|
* @author LR |
||||
|
* @date 2024/12/9 15:44 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class ToolServiceBeanTest { |
||||
|
|
||||
|
@Autowired |
||||
|
private IfsServer ifsServer; |
||||
|
|
||||
|
private static final Logger logger = LoggerFactory.getLogger(ToolServiceBeanTest.class); |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Tool Header |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:49 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Header查询:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Tool Header新增 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:52 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Header新增结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Tool Header修改 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:55 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Header修改结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: Tool Header删除 |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 15:58 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Header 删除结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 查询Tool Instance |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 16:59 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Instance 查询结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 插入Tool Instance |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:03 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Instance 新增结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改Tool Instance |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:06 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Instance 修改结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 删除Tool Instance |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:07 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Instance 删除结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 获取Tool Instance Date |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 9:53 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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 returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 新增Tool Instance Date |
||||
|
* @author LR |
||||
|
* @date 2024/12/12 17:23 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Bom替代明细集合新增开始:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 修改Tool Instance Date |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 10:24 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Instance Date新增结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @description: 删除Tool Instance Date |
||||
|
* @author LR |
||||
|
* @date 2024/12/13 10:26 |
||||
|
* @version 1.0 |
||||
|
*/ |
||||
|
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(); |
||||
|
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删除数据 |
||||
|
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()); |
||||
|
} |
||||
|
//打印日志 |
||||
|
logger.info("Tool Instance Date删除结束:"+JSON.toJSONString(inData)); |
||||
|
//返回结果集 |
||||
|
return returnMap; |
||||
|
} |
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue