Commit a6716bdb by 向延琳

Merge branch 'develop' of http://192.168.3.233:8090/eshiled-new/ne-shield-standa…

…rd-interfaces-api into develop
2 parents f184bf0c 1be92af8
package cn.com.glsx.stdinterface.api;
import cn.com.glsx.stdinterface.dto.AlarmWarnAlarmTypeDTO;
import cn.com.glsx.stdinterface.dto.AlarmWarnAnalyseDTO;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
/**
* 警情中心
*
* @author Yanglinlong
* @date 2022/6/8 18:09
*/
@FeignClient(name = "ne-shield-standard-interfaces", path = "/nesi/alarmCenter", decode404 = true)
public interface AlarmWarnAnalyseClient {
/**
* 保存警情中心数据
*
* @param alarmWarnAnalyseDTO 警情中心
* @return
*/
@PostMapping("saveEshieldAlarm")
R saveEshieldAlarm(AlarmWarnAnalyseDTO alarmWarnAnalyseDTO);
/**
* 获取所有警情类型
*
* @return
*/
@GetMapping("getAllAlarmType")
R<List<AlarmWarnAlarmTypeDTO>> getAllAlarmType();
}
...@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/** /**
* Vehicle feign * Vehicle feign
* *
...@@ -35,4 +37,14 @@ public interface VehicleServiceClient { ...@@ -35,4 +37,14 @@ public interface VehicleServiceClient {
*/ */
@PostMapping(value = "/verifyDevicesCompose") @PostMapping(value = "/verifyDevicesCompose")
R verifyDevicesCompose(@RequestBody DevicesComposeVerifyBO verifyBO); R verifyDevicesCompose(@RequestBody DevicesComposeVerifyBO verifyBO);
/**
* 通过车架号和姓名获取车辆信息
*
* @param vin 车架号
* @param name 姓名
* @return
*/
@GetMapping(value = "/getVehicleByVinAndName")
R<List<VehicleDto>> getVehicleByVinAndName(@RequestParam String vin, @RequestParam String name);
} }
package cn.com.glsx.stdinterface.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 警情类型实体类
*
* @author yangll
*/
@Data
public class AlarmWarnAlarmTypeDTO {
private Long id;
/**
* 警情类型
*/
private Integer alarmType;
/**
* 类型描述
*/
private String typeDesc;
/**
* 警情等级
*/
private Integer alarmLevel;
private static final long serialVersionUID = 1L;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
* 创建人用户id
*/
private Long createdBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 更新人用户id
*/
private Long updatedBy;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.stdinterface.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @author xiangyanlin
* @date 2022/6/8
*/
@Data
public class AlarmWarnAnalyseDTO {
private Long id;
/**
* 多个设备号
*/
private String deviceNoes;
/**
* 报警时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date alarmTime;
/**
* 状态
*/
private Integer dealStatus;
/**
* 车辆id
*/
private Long vehicleId;
/**
* 警情等级
*/
private Integer alarmLevel;
/**
* 警情说明
*/
private String alarmExplain;
/**
* 警情建议
*/
private String alarmSuggest;
/**
* 警情类型
*/
private Integer alarmType;
/**
* 删除标识
*/
private Integer delFlag;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
* 创建人用户id
*/
private Long createdBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 更新人用户id
*/
private Long updatedBy;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.stdinterface.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 警情中心处理状态枚举
*
* @author Yanglinlong
* @date 2022/6/9 15:04
*/
@Getter
@AllArgsConstructor
public enum EshieldAlarmStatusEnum {
DEL_STATUS(1, "已处理"),
UNDEL_STATUS(2, "未处理");
private Integer type;
private String desc;
public static String getDescByStatus(Integer status) {
for (FakeOfficeTypeEnum typeEnum : FakeOfficeTypeEnum.values()) {
if (typeEnum.getType().equals(status)) {
return typeEnum.getDesc();
}
}
return "";
}
}
...@@ -8,6 +8,8 @@ import lombok.Setter; ...@@ -8,6 +8,8 @@ import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j @Slf4j
@Component @Component
public class VehicleServiceFallbackImpl implements VehicleServiceClient { public class VehicleServiceFallbackImpl implements VehicleServiceClient {
...@@ -27,4 +29,9 @@ public class VehicleServiceFallbackImpl implements VehicleServiceClient { ...@@ -27,4 +29,9 @@ public class VehicleServiceFallbackImpl implements VehicleServiceClient {
return R.ok("服务异常"); return R.ok("服务异常");
} }
@Override
public R<List<VehicleDto>> getVehicleByVinAndName(String vin, String name) {
log.warn("getVehicleByVinAndName 熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!