屏蔽异常

This commit is contained in:
wangshilong 2024-12-21 16:05:47 +08:00
parent 042dbfcecf
commit fa231d9d44
1 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ public class DeviceOptLogServiceImpl extends ServiceImpl<DeviceOptLogDao, Device
private SnowflakeConfig snowflakeConfig;
@Override
public void saveGasWellOptLog(Integer isOpen, Long deviceId,String source) {
public void saveGasWellOptLog(Integer isOpen, Long deviceId, String source) {
DeviceVO deviceVO = this.deviceDao.getDeviceById(deviceId);
DeviceOptLog deviceOptLog = new DeviceOptLog();
deviceOptLog.setId(this.snowflakeConfig.snowflakeId());
@ -47,11 +47,11 @@ public class DeviceOptLogServiceImpl extends ServiceImpl<DeviceOptLogDao, Device
deviceOptLog.setDeviceDetail(deviceVO.getDeviceType().getName() + "-" + deviceVO.getProduct().getName());
deviceOptLog.setGasStation(deviceVO.getGasStation());
String content = "";
if("device".equalsIgnoreCase(source)){
content = isOpen == 1 ? "检测到气井开启" : "检测到气井关闭";
if ("device".equalsIgnoreCase(source)) {
content = isOpen == null ? "" : isOpen == 1 ? "检测到气井开启" : "检测到气井关闭";
deviceOptLog.setUsername("系统");
deviceOptLog.setName("系统");
}else{
} else {
content = isOpen == null ? "设置成功" : (isOpen == 1 ? "开井成功" : "关井成功");
UserLoginInfoVO userLoginInfoVO = (UserLoginInfoVO) StpUtil.getTokenSession().get(UserConstant.TOKEN_SESSION);
deviceOptLog.setUsername(userLoginInfoVO.getUserVO().getUsername());