|
|
@ -180,8 +180,18 @@ public class ToolServiceImpl implements ToolService { |
|
|
if(propertyNo != null && !propertyNo.equals("")){ |
|
|
if(propertyNo != null && !propertyNo.equals("")){ |
|
|
//调用方法 传工具的属性 |
|
|
//调用方法 传工具的属性 |
|
|
try { |
|
|
try { |
|
|
//调用api方法执行技术等级的新增 |
|
|
|
|
|
this.syncIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
|
|
|
|
|
|
String luName = "ManufTool"; |
|
|
|
|
|
String keyRef = "CONTRACT="+site+"^TOOL_ID="+toolId+"^"; |
|
|
|
|
|
int countFlag = this.checkIfsToolPropertyTemplate(srv, luName, keyRef); |
|
|
|
|
|
//如果不存在 则调用新增 否则则调用修改 |
|
|
|
|
|
if (countFlag == 0){ |
|
|
|
|
|
//调用api方法执行技术等级的新增 |
|
|
|
|
|
this.syncIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
|
|
|
}else{ |
|
|
|
|
|
//先删除再新增 |
|
|
|
|
|
this.removeIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
|
|
|
this.syncIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
|
|
|
} |
|
|
} catch(Exception e){ |
|
|
} catch(Exception e){ |
|
|
//调用删除的api 删除传过去的ifs 工具信息 |
|
|
//调用删除的api 删除传过去的ifs 工具信息 |
|
|
this.removeIfsToolInfo(srv, ifsToolData); |
|
|
this.removeIfsToolInfo(srv, ifsToolData); |
|
|
@ -281,11 +291,12 @@ public class ToolServiceImpl implements ToolService { |
|
|
}else if ("".equals(rawPropertyNo) && rawPropertyNo.equals(propertyNo)){ |
|
|
}else if ("".equals(rawPropertyNo) && rawPropertyNo.equals(propertyNo)){ |
|
|
//无需新增或者修改 |
|
|
//无需新增或者修改 |
|
|
}else if(!"".equals(rawPropertyNo) && !"".equals(propertyNo) && !rawPropertyNo.equals(propertyNo)){ |
|
|
}else if(!"".equals(rawPropertyNo) && !"".equals(propertyNo) && !rawPropertyNo.equals(propertyNo)){ |
|
|
//需要调用修改的接口即可 |
|
|
|
|
|
this.modifyIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
|
|
|
|
|
|
//需要调用先删除 后修改 |
|
|
|
|
|
this.removeIfsToolInfoPropertyTemplate(srv, site, toolId, rawPropertyNo); |
|
|
|
|
|
this.syncIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
}else if(!"".equals(rawPropertyNo) && "".equals(propertyNo)){ |
|
|
}else if(!"".equals(rawPropertyNo) && "".equals(propertyNo)){ |
|
|
//需要调用删除的接口即可 |
|
|
//需要调用删除的接口即可 |
|
|
this.removeIfsToolInfoPropertyTemplate(srv, site, toolId); |
|
|
|
|
|
|
|
|
this.removeIfsToolInfoPropertyTemplate(srv, site, toolId, rawPropertyNo); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//3.调用存储过程处理 工具的属性模版数据 |
|
|
//3.调用存储过程处理 工具的属性模版数据 |
|
|
@ -369,6 +380,13 @@ public class ToolServiceImpl implements ToolService { |
|
|
String ifsPassword = ifsUser.getIfsPassword(); |
|
|
String ifsPassword = ifsUser.getIfsPassword(); |
|
|
//获取链接 |
|
|
//获取链接 |
|
|
Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); |
|
|
Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); |
|
|
|
|
|
//存在则调用删除的方法 |
|
|
|
|
|
// 调用删除工具属性模版的方法 2025-09-10 LR 新增 |
|
|
|
|
|
String propertyNo = tool.getPropertyNo(); |
|
|
|
|
|
if (!(null == propertyNo || "".equals(propertyNo.trim()))){ |
|
|
|
|
|
//1.首先删掉属性值 |
|
|
|
|
|
this.removeIfsToolInfoPropertyTemplate(srv, site, toolId, propertyNo); |
|
|
|
|
|
} |
|
|
//校验删除调用接口 |
|
|
//校验删除调用接口 |
|
|
this.removeIfsToolInfo(srv, ifsToolData); |
|
|
this.removeIfsToolInfo(srv, ifsToolData); |
|
|
} |
|
|
} |
|
|
@ -378,6 +396,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
toolDao.deleteToolInstanceDateByTool(inData); |
|
|
toolDao.deleteToolInstanceDateByTool(inData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @description: 调用存储过程删除工具的信息 |
|
|
* @description: 调用存储过程删除工具的信息 |
|
|
* @author LR |
|
|
* @author LR |
|
|
@ -460,7 +479,18 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
|
|
|
|
|
//2.调用api处理工具实例部分的属性数据 |
|
|
//2.调用api处理工具实例部分的属性数据 |
|
|
if(propertyNo != null && !propertyNo.equals("")){ |
|
|
if(propertyNo != null && !propertyNo.equals("")){ |
|
|
this.syncIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
|
|
|
|
|
|
//首选查询当前工具是否存在技术等级模版 如果存在则调用修改的方法 |
|
|
|
|
|
//组装数据 |
|
|
|
|
|
String luName = "ManufToolDetail"; |
|
|
|
|
|
String keyRef = "CONTRACT="+site+"^TOOL_ID="+toolId+"^TOOL_INSTANCE="+toolInstance+"^"; |
|
|
|
|
|
int countFlag = this.checkIfsToolPropertyTemplate(srv, luName, keyRef); |
|
|
|
|
|
//如果不存在 则调用新增 否则则调用修改 |
|
|
|
|
|
if (countFlag == 0){ |
|
|
|
|
|
this.syncIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.removeIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
|
|
|
this.syncIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (Exception e){ |
|
|
} catch (Exception e){ |
|
|
//2.调用IFS API接口 |
|
|
//2.调用IFS API接口 |
|
|
@ -470,6 +500,25 @@ public class ToolServiceImpl implements ToolService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @description: 查询技术等级是否存在 |
|
|
|
|
|
* @author DouDou |
|
|
|
|
|
* @date 2025/9/10 10:54 |
|
|
|
|
|
* @version 1.0 |
|
|
|
|
|
*/ |
|
|
|
|
|
public int checkIfsToolPropertyTemplate(Server srv, String luName, String keyRef) { |
|
|
|
|
|
PartIfsCatalogModel checkData = new PartIfsCatalogModel(); |
|
|
|
|
|
//设置参数 |
|
|
|
|
|
checkData.setLuName(luName); |
|
|
|
|
|
checkData.setKeyRef(keyRef); |
|
|
|
|
|
Map<String, String> returnMap = technicalClassBean.getTechnicalClass(srv, checkData); |
|
|
|
|
|
// 判断调用是否成功 |
|
|
|
|
|
if (!"200".equals(returnMap.get("resultCode"))) { |
|
|
|
|
|
return 0; |
|
|
|
|
|
}else { |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -591,11 +640,13 @@ public class ToolServiceImpl implements ToolService { |
|
|
}else if ("".equals(rawPropertyNo) && rawPropertyNo.equals(propertyNo)){ |
|
|
}else if ("".equals(rawPropertyNo) && rawPropertyNo.equals(propertyNo)){ |
|
|
//无需新增或者修改 |
|
|
//无需新增或者修改 |
|
|
}else if(!"".equals(rawPropertyNo) && !"".equals(propertyNo) && !rawPropertyNo.equals(propertyNo)){ |
|
|
}else if(!"".equals(rawPropertyNo) && !"".equals(propertyNo) && !rawPropertyNo.equals(propertyNo)){ |
|
|
|
|
|
//需要调用删除的接口即可 |
|
|
|
|
|
this.removeIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, rawPropertyNo); |
|
|
//需要调用修改的接口即可 |
|
|
//需要调用修改的接口即可 |
|
|
this.modifyIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
|
|
|
|
|
|
this.syncIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
}else if(!"".equals(rawPropertyNo) && "".equals(propertyNo)){ |
|
|
}else if(!"".equals(rawPropertyNo) && "".equals(propertyNo)){ |
|
|
//需要调用删除的接口即可 |
|
|
//需要调用删除的接口即可 |
|
|
this.removeIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance); |
|
|
|
|
|
|
|
|
this.removeIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, rawPropertyNo); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//3.调用存储过程处理 工具的属性模版数据 |
|
|
//3.调用存储过程处理 工具的属性模版数据 |
|
|
@ -656,6 +707,12 @@ public class ToolServiceImpl implements ToolService { |
|
|
String ifsPassword = ifsUser.getIfsPassword(); |
|
|
String ifsPassword = ifsUser.getIfsPassword(); |
|
|
//获取链接 |
|
|
//获取链接 |
|
|
Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); |
|
|
Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); |
|
|
|
|
|
//调用删除工具属性模版的方法 2025-09-10 LR 新增 |
|
|
|
|
|
String propertyNo = toolInstanceData.getPropertyNo(); |
|
|
|
|
|
if (!(null == propertyNo || "".equals(propertyNo.trim()))){ |
|
|
|
|
|
//1.先删除属性 |
|
|
|
|
|
this.removeIfsToolInstancePropertyTemplate(srv, site, toolId, toolInstance, propertyNo); |
|
|
|
|
|
} |
|
|
//调用新的api方法 |
|
|
//调用新的api方法 |
|
|
this.removeIfsToolInstance(srv, toolInstanceData); |
|
|
this.removeIfsToolInstance(srv, toolInstanceData); |
|
|
} |
|
|
} |
|
|
@ -950,7 +1007,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
Map<String, String> returnMap = toolServiceBean.removeToolHeader(srv, ifsTool); |
|
|
Map<String, String> returnMap = toolServiceBean.removeToolHeader(srv, ifsTool); |
|
|
// 判断调用是否成功 |
|
|
// 判断调用是否成功 |
|
|
if (!"200".equals(returnMap.get("resultCode"))) { |
|
|
if (!"200".equals(returnMap.get("resultCode"))) { |
|
|
throw new RuntimeException("Tool Header 新增异常:" + returnMap.get("resultMsg")); |
|
|
|
|
|
|
|
|
throw new RuntimeException("Tool Header 删除异常:" + returnMap.get("resultMsg")); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1068,17 +1125,23 @@ public class ToolServiceImpl implements ToolService { |
|
|
* @date 2024/10/28 14:44 |
|
|
* @date 2024/10/28 14:44 |
|
|
* @version 1.0 |
|
|
* @version 1.0 |
|
|
*/ |
|
|
*/ |
|
|
public void removeIfsToolInfoPropertyTemplate(Server srv, String site, String toolId) { |
|
|
|
|
|
|
|
|
public void removeIfsToolInfoPropertyTemplate(Server srv, String site, String toolId, String propertyNo) { |
|
|
//查询ifs的使用的账号 |
|
|
//查询ifs的使用的账号 |
|
|
PartIfsCatalogModel technicalClass = new PartIfsCatalogModel(); |
|
|
PartIfsCatalogModel technicalClass = new PartIfsCatalogModel(); |
|
|
String keyRef = "CONTRACT="+site+"^TOOL_ID="+toolId+"^"; |
|
|
String keyRef = "CONTRACT="+site+"^TOOL_ID="+toolId+"^"; |
|
|
technicalClass.setLuName("ManufTool"); |
|
|
technicalClass.setLuName("ManufTool"); |
|
|
technicalClass.setKeyRef(keyRef); |
|
|
technicalClass.setKeyRef(keyRef); |
|
|
|
|
|
//先删除技术等级的属性数据 |
|
|
|
|
|
Map<String, String> returnMap1 = technicalClassBean.removeTechnicalClassAttributesByTechnicalClass(srv, technicalClass); |
|
|
|
|
|
// 判断调用是否成功 |
|
|
|
|
|
if (!"200".equals(returnMap1.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("Tool 技术等级属性 删除异常:" + returnMap1.get("resultMsg")); |
|
|
|
|
|
} |
|
|
//调用ifs的api |
|
|
//调用ifs的api |
|
|
Map<String, String> returnMap = technicalClassBean.removeTechnicalClass(srv, technicalClass); |
|
|
|
|
|
|
|
|
Map<String, String> returnMap2 = technicalClassBean.removeTechnicalClass(srv, technicalClass); |
|
|
// 判断调用是否成功 |
|
|
// 判断调用是否成功 |
|
|
if (!"200".equals(returnMap.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("Tool 技术等级 删除异常:" + returnMap.get("resultMsg")); |
|
|
|
|
|
|
|
|
if (!"200".equals(returnMap2.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("Tool 技术等级模版 删除异常:" + returnMap2.get("resultMsg")); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1139,17 +1202,24 @@ public class ToolServiceImpl implements ToolService { |
|
|
* @date 2024/10/29 17:38 |
|
|
* @date 2024/10/29 17:38 |
|
|
* @version 1.0 |
|
|
* @version 1.0 |
|
|
*/ |
|
|
*/ |
|
|
public void removeIfsToolInstancePropertyTemplate(Server srv, String site, String toolId, String toolInstance) { |
|
|
|
|
|
|
|
|
public void removeIfsToolInstancePropertyTemplate(Server srv, String site, String toolId, String toolInstance, String propertyNo) { |
|
|
//查询ifs的使用的账号 |
|
|
//查询ifs的使用的账号 |
|
|
PartIfsCatalogModel technicalClass = new PartIfsCatalogModel(); |
|
|
PartIfsCatalogModel technicalClass = new PartIfsCatalogModel(); |
|
|
String keyRef = "CONTRACT="+site+"^TOOL_ID="+toolId+"^TOOL_INSTANCE="+toolInstance+"^"; |
|
|
String keyRef = "CONTRACT="+site+"^TOOL_ID="+toolId+"^TOOL_INSTANCE="+toolInstance+"^"; |
|
|
technicalClass.setLuName("ManufToolDetail"); |
|
|
technicalClass.setLuName("ManufToolDetail"); |
|
|
technicalClass.setKeyRef(keyRef); |
|
|
technicalClass.setKeyRef(keyRef); |
|
|
|
|
|
technicalClass.setTechnicalClass(propertyNo); |
|
|
|
|
|
//先删除技术等级的属性数据 |
|
|
|
|
|
Map<String, String> returnMap1 = technicalClassBean.removeTechnicalClassAttributesByTechnicalClass(srv, technicalClass); |
|
|
|
|
|
// 判断调用是否成功 |
|
|
|
|
|
if (!"200".equals(returnMap1.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("Tool 技术等级属性 删除异常:" + returnMap1.get("resultMsg")); |
|
|
|
|
|
} |
|
|
//调用新的api方法 |
|
|
//调用新的api方法 |
|
|
Map<String, String> returnMap = technicalClassBean.removeTechnicalClass(srv, technicalClass); |
|
|
|
|
|
|
|
|
Map<String, String> returnMap2 = technicalClassBean.removeTechnicalClass(srv, technicalClass); |
|
|
// 判断调用是否成功 |
|
|
// 判断调用是否成功 |
|
|
if (!"200".equals(returnMap.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("Tool Instance技术等级 删除异常:" + returnMap.get("resultMsg")); |
|
|
|
|
|
|
|
|
if (!"200".equals(returnMap2.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("Tool Instance技术等级 删除异常:" + returnMap2.get("resultMsg")); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |