|
|
|
@ -309,6 +309,8 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
} |
|
|
|
//2.校验存在调用接口 |
|
|
|
toolInstanceData = new IfsToolInstanceDateData(); |
|
|
|
inData.setCreateDate(new Date()); |
|
|
|
inData.setState("Active"); |
|
|
|
//拷贝属性 设置参数 |
|
|
|
BeanUtils.copyProperties(inData, toolInstanceData); |
|
|
|
String lastCalibrationTime = ""; |
|
|
|
@ -318,16 +320,17 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
} |
|
|
|
toolInstanceData.setLastCalibrationDate(lastCalibrationTime); |
|
|
|
|
|
|
|
/*//2.校验存在调用接口 |
|
|
|
//2.校验存在调用接口 |
|
|
|
String toolURL = apiUrl + "/tool/ifs/syncToolInstanceToIfs"; |
|
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, inData); |
|
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
|
throw new RuntimeException("IFS ToolInstance新增异常:" + toolResponse.getMsg()); |
|
|
|
} |
|
|
|
String objStr = String.valueOf(toolResponse.getObj()); |
|
|
|
IfsToolData ifsTool = JSON.parseObject(objStr, IfsToolData.class);*/ |
|
|
|
inData.setCreateDate(new Date()); |
|
|
|
inData.setState("Active"); |
|
|
|
IfsToolData ifsTool = JSON.parseObject(objStr, IfsToolData.class); |
|
|
|
//设置版本号 |
|
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
//2.调用方法保存当前的数据 |
|
|
|
toolDao.insertToolInstance(inData); |
|
|
|
} |
|
|
|
@ -377,6 +380,8 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
String resultMsg = String.valueOf(resultMap.get("result_msg")); |
|
|
|
throw new RuntimeException(resultMsg); |
|
|
|
} |
|
|
|
inData.setCreateDate(new Date()); |
|
|
|
inData.setState("Active"); |
|
|
|
|
|
|
|
toolInstanceData = new IfsToolInstanceDateData(); |
|
|
|
//拷贝属性 设置参数 |
|
|
|
@ -387,16 +392,19 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
inData.setNextCalibrationDate(lastCalibrationDate); |
|
|
|
} |
|
|
|
toolInstanceData.setLastCalibrationDate(lastCalibrationTime); |
|
|
|
/* //2.校验存在调用接口 |
|
|
|
inData.setCreateDate(new Date()); |
|
|
|
inData.setState("Active"); |
|
|
|
//2.校验存在调用接口 |
|
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolInstanceToIfs"; |
|
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, inData); |
|
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
|
throw new RuntimeException("IFS ToolInstance修改异常:" + toolResponse.getMsg()); |
|
|
|
} |
|
|
|
String objStr = String.valueOf(toolResponse.getObj()); |
|
|
|
IfsToolData ifsTool = JSON.parseObject(objStr, IfsToolData.class);*/ |
|
|
|
inData.setCreateDate(new Date()); |
|
|
|
inData.setState("Active"); |
|
|
|
IfsToolData ifsTool = JSON.parseObject(objStr, IfsToolData.class); |
|
|
|
//设置版本号 |
|
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
//2.调用方法保存当前的数据 |
|
|
|
toolDao.updateToolInstance(inData); |
|
|
|
} |
|
|
|
@ -434,14 +442,20 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
if(toolInstanceData == null){ |
|
|
|
throw new RuntimeException("当前工具实例不存在!"); |
|
|
|
} |
|
|
|
inData.setCreateDate(new Date()); |
|
|
|
inData.setState("Active"); |
|
|
|
//1.校验是否可以删除 目前不用校验 |
|
|
|
|
|
|
|
toolInstanceData = new IfsToolInstanceDateData(); |
|
|
|
//拷贝属性 设置参数 |
|
|
|
BeanUtils.copyProperties(inData, toolInstanceData); |
|
|
|
|
|
|
|
//2.校验存在调用接口 |
|
|
|
/* String toolURL = apiUrl + "/tool/ifs/removeToolInstanceToIfs"; |
|
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, inData); |
|
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolInstanceToIfs"; |
|
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
|
throw new RuntimeException("IFS ToolInstance删除异常:" + toolResponse.getMsg()); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
//2.调用方法保存当前的数据 |
|
|
|
toolDao.deleteToolInstance(inData); |
|
|
|
} |
|
|
|
|