|
|
|
@ -8,6 +8,7 @@ import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.Resrce;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.ResrceService;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
|
import com.foreverwin.modular.core.util.CommonMethods;
|
|
|
|
|
import com.foreverwin.modular.core.util.FrontPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
@ -62,6 +63,7 @@ public class ResourceFaultReceiveServiceImpl extends ServiceImpl<ResourceFaultRe
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String parseResourceFaultInfo(String text) {
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(text);
|
|
|
|
|
|
|
|
|
|
String handle = jsonObject.getString("TRANID");
|
|
|
|
@ -81,6 +83,10 @@ public class ResourceFaultReceiveServiceImpl extends ServiceImpl<ResourceFaultRe
|
|
|
|
|
logger.error("站点不能为空!");
|
|
|
|
|
throw BusinessException.build("站点不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isBlank(faultList)) {
|
|
|
|
|
logger.error("故障参数列表不能为空!");
|
|
|
|
|
throw BusinessException.build("故障参数列表不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isBlank(resource)) {
|
|
|
|
|
logger.error("设备编号不能为空!");
|
|
|
|
|
throw BusinessException.build("设备编号不能为空!");
|
|
|
|
@ -95,13 +101,17 @@ public class ResourceFaultReceiveServiceImpl extends ServiceImpl<ResourceFaultRe
|
|
|
|
|
List<ResourceFaultReceive> list = new ArrayList<>();
|
|
|
|
|
// 故障编码及故障时间
|
|
|
|
|
JSONArray jsonArray = JSON.parseArray(faultList);
|
|
|
|
|
if (jsonArray == null || jsonArray.size() < 1){
|
|
|
|
|
logger.error("设备编号:" + resource + ",故障参数列表不能为空!");
|
|
|
|
|
throw BusinessException.build("设备编号:" + resource + ",故障参数列表不能为空!");
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
ResourceFaultReceive resourceFaultReceive = new ResourceFaultReceive();
|
|
|
|
|
// 设备编号、站点、创建时间-使用SEND_TIME、创建用户
|
|
|
|
|
resourceFaultReceive.setResrce(resource);
|
|
|
|
|
resourceFaultReceive.setSite(site);
|
|
|
|
|
resourceFaultReceive.setCreatedDateTime(sendDate);
|
|
|
|
|
resourceFaultReceive.setCreateUser("SITE_ADMIN");
|
|
|
|
|
resourceFaultReceive.setCreateUser(user);
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObj = (JSONObject) jsonArray.get(i);
|
|
|
|
|
String faultCode = jsonObj.getString("FAULT_CODE");
|
|
|
|
|