|
@ -4,13 +4,15 @@ import com.yihu.jw.feign.iot.device.IotPatientDeviceFeign;
|
|
|
import com.yihu.jw.restmodel.common.Envelop;
|
|
|
import com.yihu.jw.restmodel.iot.device.IotDeviceVO;
|
|
|
import com.yihu.jw.restmodel.iot.device.IotPatientDeviceVO;
|
|
|
import com.yihu.jw.restmodel.iot.device.LocationDataVO;
|
|
|
import feign.hystrix.FallbackFactory;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cloud.sleuth.Tracer;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author yeshijie on 2018/2/8.
|
|
|
*/
|
|
@ -25,8 +27,8 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
return new IotPatientDeviceFeign() {
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> create(@ApiParam(name = "json_data", value = "", defaultValue = "")
|
|
|
@RequestParam String jsonData) {
|
|
|
public Envelop<IotPatientDeviceVO> create(
|
|
|
@RequestParam String jsonData) {
|
|
|
tracer.getCurrentSpan().logEvent("设备绑定失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("jsonData:" + jsonData);
|
|
|
return null;
|
|
@ -34,9 +36,7 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> findByDeviceSnAndUserType(
|
|
|
@ApiParam(name = "deviceSn", value = "sn码", defaultValue = "")
|
|
|
@RequestParam(value = "deviceSn",required = true) String deviceSn,
|
|
|
@ApiParam(name = "userType", value = "按键号", defaultValue = "")
|
|
|
@RequestParam(value = "userType",required = true) String userType) {
|
|
|
tracer.getCurrentSpan().logEvent("按sn码和按键号查找失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("deviceSn:" + deviceSn);
|
|
@ -46,7 +46,6 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> findByPatient(
|
|
|
@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
@RequestParam(value = "patient",required = true) String patient) {
|
|
|
tracer.getCurrentSpan().logEvent("按居民code查找失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("patient:" + patient);
|
|
@ -55,9 +54,7 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> findByPatientAndDeviceSn(
|
|
|
@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
@RequestParam(value = "patient",required = true) String patient,
|
|
|
@ApiParam(name = "deviceSn", value = "sn码", defaultValue = "")
|
|
|
@RequestParam(value = "deviceSn",required = true) String deviceSn) {
|
|
|
tracer.getCurrentSpan().logEvent("按居民和sn码查找失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("patient:" + patient);
|
|
@ -67,11 +64,8 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotDeviceVO> findListByPatient(
|
|
|
@ApiParam(name = "patient", value = "居民code", defaultValue = "")
|
|
|
@RequestParam(value = "patient", required = true) String patient,
|
|
|
@ApiParam(name = "page", value = "第几页", defaultValue = "")
|
|
|
@RequestParam(value = "page", required = true) Integer page,
|
|
|
@ApiParam(name = "pagesize", value = "页面大小", defaultValue = "")
|
|
|
@RequestParam(value = "pagesize", required = true) Integer pagesize){
|
|
|
tracer.getCurrentSpan().logEvent("按居民分页查找失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("patient:" + patient);
|
|
@ -82,9 +76,7 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> findByDeviceSnAndCategoryCode(
|
|
|
@ApiParam(name = "categoryCode", value = "设备类型", defaultValue = "")
|
|
|
@RequestParam(value = "categoryCode",required = true) String categoryCode,
|
|
|
@ApiParam(name = "deviceSn", value = "sn码", defaultValue = "")
|
|
|
@RequestParam(value = "deviceSn",required = true) String deviceSn) {
|
|
|
tracer.getCurrentSpan().logEvent("按sn码和设备类型查找失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("categoryCode:" + categoryCode);
|
|
@ -94,11 +86,8 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> findByDeviceSnAndCategoryCodeAndUserType(
|
|
|
@ApiParam(name = "deviceSn", value = "sn码", defaultValue = "")
|
|
|
@RequestParam(value = "deviceSn",required = true) String deviceSn,
|
|
|
@ApiParam(name = "categoryCode", value = "设备类型", defaultValue = "")
|
|
|
@RequestParam(value = "categoryCode",required = true) String categoryCode,
|
|
|
@ApiParam(name = "userType", value = "按键号", defaultValue = "")
|
|
|
@RequestParam(value = "userType",required = true) String userType) {
|
|
|
tracer.getCurrentSpan().logEvent("按sn码,设备类型及按键号查找失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("categoryCode:" + categoryCode);
|
|
@ -109,15 +98,10 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
|
|
|
@Override
|
|
|
public Envelop<IotPatientDeviceVO> updatePatientDevice(
|
|
|
@ApiParam(name = "patient", value = "sn码", defaultValue = "")
|
|
|
@RequestParam(value = "patient",required = true) String patient,
|
|
|
@ApiParam(name = "deviceSN", value = "设备类型", defaultValue = "")
|
|
|
@RequestParam(value = "deviceSN",required = true) String deviceSN,
|
|
|
@ApiParam(name = "newDeviceSN", value = "设备类型", defaultValue = "")
|
|
|
@RequestParam(value = "newDeviceSN",required = true) String newDeviceSN,
|
|
|
@ApiParam(name = "userType", value = "sn码", defaultValue = "")
|
|
|
@RequestParam(value = "userType",required = true) String userType,
|
|
|
@ApiParam(name = "sim", value = "按键号", defaultValue = "")
|
|
|
@RequestParam(value = "sim",required = true) String sim) {
|
|
|
tracer.getCurrentSpan().logEvent("更换患者绑定的血糖仪失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("patient:" + patient);
|
|
@ -128,6 +112,14 @@ public class IotPatientDeviceFallbackFactory implements FallbackFactory<IotPatie
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Envelop<List<LocationDataVO>> findDeviceLocationsByIdCard(
|
|
|
@RequestParam(value = "jsonData",required = true) String jsonData) {
|
|
|
tracer.getCurrentSpan().logEvent("查询设备地址失败:原因:" + e.getMessage());
|
|
|
tracer.getCurrentSpan().logEvent("jsonData:" + jsonData);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
};
|
|
|
}
|
|
|
|