|
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
|
|
+import java.util.List;
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -84,4 +85,23 @@ public class CenterDeviceImpl implements ICenterDevice {
|
|
log.info("同步更新数据中心端设备数据>>"+editEntity);
|
|
log.info("同步更新数据中心端设备数据>>"+editEntity);
|
|
return new Result(ResultCode.SUCCESS,editEntity);
|
|
return new Result(ResultCode.SUCCESS,editEntity);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result syncRemoveDevice(String deviceData) throws UnsupportedEncodingException {
|
|
|
|
+ //转义符号处理
|
|
|
|
+ Long dataId = Long.parseLong(textUtil.translateSymbol(deviceData));
|
|
|
|
+ //查询目标设备数据
|
|
|
|
+ List<Object[]> existList = deviceRepo.getDevice(dataId);
|
|
|
|
+ if(existList.size()>0) {
|
|
|
|
+ Object[] object = existList.get(0);
|
|
|
|
+ Integer id = (Integer) object[0];
|
|
|
|
+ deviceRepo.deleteById(id);
|
|
|
|
+ log.info("同步删除牧场端设备数据.");
|
|
|
|
+ return new Result(ResultCode.SUCCESS);
|
|
|
|
+ }else{
|
|
|
|
+ String ERR_INFO="暂无需要删除的设备数据.";
|
|
|
|
+ log.info(ERR_INFO);
|
|
|
|
+ return new Result(10001,ERR_INFO,false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|