|
|
@ -40,6 +40,8 @@ public class ToolServiceImpl implements ToolService { |
|
|
|
|
|
|
|
|
@Value("${ifs-api.api-url}") |
|
|
@Value("${ifs-api.api-url}") |
|
|
private String apiUrl; |
|
|
private String apiUrl; |
|
|
|
|
|
@Value("${ifs-control.control-flag}") |
|
|
|
|
|
private Boolean controlFlag; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<IfsToolData> getToolInfoList(IfsTool inData) { |
|
|
public List<IfsToolData> getToolInfoList(IfsTool inData) { |
|
|
@ -122,6 +124,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
//属性拷贝 |
|
|
//属性拷贝 |
|
|
BeanUtils.copyProperties(inData, ifsToolData); |
|
|
BeanUtils.copyProperties(inData, ifsToolData); |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
|
|
|
if (controlFlag) { |
|
|
String toolURL = apiUrl + "/tool/ifs/syncToolDataToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/syncToolDataToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, ifsToolData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, ifsToolData); |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
@ -142,7 +145,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
throw new RuntimeException("IFS ToolInstance新增异常:" + toolResponse.getMsg()); |
|
|
throw new RuntimeException("IFS ToolInstance新增异常:" + toolResponse.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
//2.调用方法保存当前的数据 |
|
|
//2.调用方法保存当前的数据 |
|
|
toolDao.insertToolInfo(inData); |
|
|
toolDao.insertToolInfo(inData); |
|
|
} |
|
|
} |
|
|
@ -193,6 +196,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
//属性拷贝 |
|
|
//属性拷贝 |
|
|
BeanUtils.copyProperties(inData, ifsToolData); |
|
|
BeanUtils.copyProperties(inData, ifsToolData); |
|
|
|
|
|
|
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolDataToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolDataToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, ifsToolData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, ifsToolData); |
|
|
@ -204,6 +208,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
IfsToolData ifsTool = JSON.parseObject(objStr, IfsToolData.class); |
|
|
IfsToolData ifsTool = JSON.parseObject(objStr, IfsToolData.class); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
|
|
} |
|
|
//2.调用方法保存当前的数据 |
|
|
//2.调用方法保存当前的数据 |
|
|
toolDao.updateToolInfo(inData); |
|
|
toolDao.updateToolInfo(inData); |
|
|
} |
|
|
} |
|
|
@ -253,6 +258,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
IfsToolData ifsToolData = new IfsToolData(); |
|
|
IfsToolData ifsToolData = new IfsToolData(); |
|
|
//属性拷贝 |
|
|
//属性拷贝 |
|
|
BeanUtils.copyProperties(inData, ifsToolData); |
|
|
BeanUtils.copyProperties(inData, ifsToolData); |
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
//判断是否存在替代的 |
|
|
//判断是否存在替代的 |
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolDataToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolDataToIfs"; |
|
|
@ -260,6 +266,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
throw new RuntimeException("IFS Tool删除异常:" + toolResponse.getMsg()); |
|
|
throw new RuntimeException("IFS Tool删除异常:" + toolResponse.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
//3.调用方法保存当前的数据 |
|
|
//3.调用方法保存当前的数据 |
|
|
toolDao.deleteToolInfo(inData); |
|
|
toolDao.deleteToolInfo(inData); |
|
|
toolDao.deleteToolInstanceByTool(inData); |
|
|
toolDao.deleteToolInstanceByTool(inData); |
|
|
@ -307,6 +314,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
String resultMsg = String.valueOf(resultMap.get("result_msg")); |
|
|
String resultMsg = String.valueOf(resultMap.get("result_msg")); |
|
|
throw new RuntimeException(resultMsg); |
|
|
throw new RuntimeException(resultMsg); |
|
|
} |
|
|
} |
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
toolInstanceData = new IfsToolInstanceDateData(); |
|
|
toolInstanceData = new IfsToolInstanceDateData(); |
|
|
inData.setCreateDate(new Date()); |
|
|
inData.setCreateDate(new Date()); |
|
|
@ -331,6 +339,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
//设置版本号 |
|
|
//设置版本号 |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
|
|
} |
|
|
//2.调用方法保存当前的数据 |
|
|
//2.调用方法保存当前的数据 |
|
|
toolDao.insertToolInstance(inData); |
|
|
toolDao.insertToolInstance(inData); |
|
|
} |
|
|
} |
|
|
@ -394,6 +403,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
toolInstanceData.setLastCalibrationDate(lastCalibrationTime); |
|
|
toolInstanceData.setLastCalibrationDate(lastCalibrationTime); |
|
|
inData.setCreateDate(new Date()); |
|
|
inData.setCreateDate(new Date()); |
|
|
inData.setState("Active"); |
|
|
inData.setState("Active"); |
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolInstanceToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolInstanceToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
@ -405,6 +415,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
//设置版本号 |
|
|
//设置版本号 |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
|
|
} |
|
|
//2.调用方法保存当前的数据 |
|
|
//2.调用方法保存当前的数据 |
|
|
toolDao.updateToolInstance(inData); |
|
|
toolDao.updateToolInstance(inData); |
|
|
} |
|
|
} |
|
|
@ -450,12 +461,14 @@ public class ToolServiceImpl implements ToolService { |
|
|
//拷贝属性 设置参数 |
|
|
//拷贝属性 设置参数 |
|
|
BeanUtils.copyProperties(inData, toolInstanceData); |
|
|
BeanUtils.copyProperties(inData, toolInstanceData); |
|
|
|
|
|
|
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolInstanceToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolInstanceToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, toolInstanceData); |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
throw new RuntimeException("IFS ToolInstance删除异常:" + toolResponse.getMsg()); |
|
|
throw new RuntimeException("IFS ToolInstance删除异常:" + toolResponse.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
//2.调用方法保存当前的数据 |
|
|
//2.调用方法保存当前的数据 |
|
|
toolDao.deleteToolInstance(inData); |
|
|
toolDao.deleteToolInstance(inData); |
|
|
} |
|
|
} |
|
|
@ -494,6 +507,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
//设置时间的信息 |
|
|
//设置时间的信息 |
|
|
instanceDateData.setBeginDate(beginTime); |
|
|
instanceDateData.setBeginDate(beginTime); |
|
|
instanceDateData.setEndDate(endTime); |
|
|
instanceDateData.setEndDate(endTime); |
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
String toolURL = apiUrl + "/tool/ifs/syncToolInstanceDateToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/syncToolInstanceDateToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, instanceDateData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, instanceDateData); |
|
|
@ -505,6 +519,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
IfsToolInstanceDateData ifsTool = JSON.parseObject(objStr, IfsToolInstanceDateData.class); |
|
|
IfsToolInstanceDateData ifsTool = JSON.parseObject(objStr, IfsToolInstanceDateData.class); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
|
|
} |
|
|
//保存新增的数据 |
|
|
//保存新增的数据 |
|
|
toolDao.insertToolInstanceDate(inData); |
|
|
toolDao.insertToolInstanceDate(inData); |
|
|
} |
|
|
} |
|
|
@ -563,6 +578,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
//设置时间的信息 |
|
|
//设置时间的信息 |
|
|
instanceDateData.setBeginDate(beginTime); |
|
|
instanceDateData.setBeginDate(beginTime); |
|
|
instanceDateData.setEndDate(endTime); |
|
|
instanceDateData.setEndDate(endTime); |
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolInstanceDateToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/modifyToolInstanceDateToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, instanceDateData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, instanceDateData); |
|
|
@ -574,6 +590,7 @@ public class ToolServiceImpl implements ToolService { |
|
|
IfsToolInstanceDateData ifsTool = JSON.parseObject(objStr, IfsToolInstanceDateData.class); |
|
|
IfsToolInstanceDateData ifsTool = JSON.parseObject(objStr, IfsToolInstanceDateData.class); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowId(ifsTool.getIfsRowId()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
inData.setIfsRowVersion(ifsTool.getIfsRowVersion()); |
|
|
|
|
|
} |
|
|
//保存新增的数据 |
|
|
//保存新增的数据 |
|
|
toolDao.updateToolInstanceDate(inData); |
|
|
toolDao.updateToolInstanceDate(inData); |
|
|
} |
|
|
} |
|
|
@ -612,12 +629,14 @@ public class ToolServiceImpl implements ToolService { |
|
|
IfsToolInstanceDateData instanceDateData = new IfsToolInstanceDateData(); |
|
|
IfsToolInstanceDateData instanceDateData = new IfsToolInstanceDateData(); |
|
|
//属性拷贝 |
|
|
//属性拷贝 |
|
|
BeanUtils.copyProperties(inData, instanceDateData); |
|
|
BeanUtils.copyProperties(inData, instanceDateData); |
|
|
|
|
|
if (controlFlag) { |
|
|
//2.校验存在调用接口 |
|
|
//2.校验存在调用接口 |
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolInstanceDateToIfs"; |
|
|
String toolURL = apiUrl + "/tool/ifs/removeToolInstanceDateToIfs"; |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, instanceDateData); |
|
|
ResponseData toolResponse = HttpClientUtil.doPostByRawWithPLM(toolURL, instanceDateData); |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
if (!"200".equals(toolResponse.getCode())) { |
|
|
throw new RuntimeException("IFS ToolInstanceDate删除异常:" + toolResponse.getMsg()); |
|
|
throw new RuntimeException("IFS ToolInstanceDate删除异常:" + toolResponse.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
//保存新增的数据 |
|
|
//保存新增的数据 |
|
|
toolDao.deleteToolInstanceDate(inData); |
|
|
toolDao.deleteToolInstanceDate(inData); |
|
|
} |
|
|
} |
|
|
|