fix:修改acs上报设备错误接口返回

This commit is contained in:
songxiaopeng
2024-05-06 10:46:49 +08:00
parent d14cdcf4b1
commit 511bc79b5a

View File

@@ -1054,16 +1054,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override @Override
public JSONObject errorDeviceRecord(JSONObject param) { public JSONObject errorDeviceRecord(JSONObject param) {
String error = param.getString("error"); String error = param.getString("error");
JSONObject result = new JSONObject();
result.put("status", org.springframework.http.HttpStatus.OK.value());
result.put("message", "故障上报完成!");
if(StringUtils.isNotEmpty(error) && "0".equals(error)){ if(StringUtils.isNotEmpty(error) && "0".equals(error)){
return null; return result;
} }
DasDeviceErrorRecord dasDeviceErrorRecord = new DasDeviceErrorRecord(); DasDeviceErrorRecord dasDeviceErrorRecord = new DasDeviceErrorRecord();
dasDeviceErrorRecord.setDevice_code(param.getString("device_code")); dasDeviceErrorRecord.setDevice_code(param.getString("device_code"));
dasDeviceErrorRecord.setError(param.getString("error")); dasDeviceErrorRecord.setError(param.getString("error"));
dasDeviceErrorRecordService.create(dasDeviceErrorRecord); dasDeviceErrorRecordService.create(dasDeviceErrorRecord);
JSONObject result = new JSONObject();
result.put("status", org.springframework.http.HttpStatus.OK.value());
result.put("message", "故障上报完成!");
return result; return result;
} }