Commit a6d2090c authored by zengtianlai3's avatar zengtianlai3

Merge remote-tracking branch 'origin/for-yx' into for-yx

parents 006da383 f92d2851
...@@ -104,9 +104,6 @@ public class OperateController { ...@@ -104,9 +104,6 @@ public class OperateController {
String user = UserUtils.getLoginUserId(); String user = UserUtils.getLoginUserId();
int userI = Integer.valueOf(user); int userI = Integer.valueOf(user);
List<AlarmVo> alarmList = alarmService.getAlarmList(userI); List<AlarmVo> alarmList = alarmService.getAlarmList(userI);
for (AlarmVo alarmVo : alarmList) {
alarmVo.setLevelDescribe(ESAPI.encoder().encodeForHTML(alarmVo.getLevelDescribe()));
}
return ResResult.success().goRecord(alarmList); return ResResult.success().goRecord(alarmList);
} }
...@@ -114,9 +111,9 @@ public class OperateController { ...@@ -114,9 +111,9 @@ public class OperateController {
@PostMapping("alarm/read") @PostMapping("alarm/read")
@MyLog(title = "将告警信息状态设为已读", businessType = BusinessType.OTHER) @MyLog(title = "将告警信息状态设为已读", businessType = BusinessType.OTHER)
public BaseResult readAlarm() { public BaseResult readAlarm() {
String id = UserUtils.getLoginUserId(); String i = UserUtils.getLoginUserId();
int userId = Integer.valueOf(id); int uI = Integer.valueOf(i);
boolean res = alarmReadService.readAlarm(userId); boolean res = alarmReadService.readAlarm(uI);
if (res) { if (res) {
return BaseResult.success(); return BaseResult.success();
} else { } else {
......
...@@ -8,9 +8,11 @@ import iot.sixiang.license.mapper.AlarmMapper; ...@@ -8,9 +8,11 @@ import iot.sixiang.license.mapper.AlarmMapper;
import iot.sixiang.license.mapper.AlarmReadMapper; import iot.sixiang.license.mapper.AlarmReadMapper;
import iot.sixiang.license.model.vo.AlarmVo; import iot.sixiang.license.model.vo.AlarmVo;
import iot.sixiang.license.service.AlarmReadService; import iot.sixiang.license.service.AlarmReadService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
...@@ -29,12 +31,14 @@ public class AlarmReadServiceImpl extends ServiceImpl<AlarmReadMapper, AlarmRead ...@@ -29,12 +31,14 @@ public class AlarmReadServiceImpl extends ServiceImpl<AlarmReadMapper, AlarmRead
@Resource @Resource
AlarmReadMapper alarmReadMapper; AlarmReadMapper alarmReadMapper;
@Override @Override
public boolean readAlarm(int userId) { public boolean readAlarm(int userId) {
if (userId == 0) { if (userId == 0) {
throw new IotLicenseException(ResultCode.VALIDATE_FAILED.getCode(),ResultCode.VALIDATE_FAILED.getMsg()); throw new IotLicenseException(ResultCode.VALIDATE_FAILED.getCode(),ResultCode.VALIDATE_FAILED.getMsg());
} }
List<AlarmVo> alarmList = alarmMapper.getAlarmList(userId); List<AlarmVo> alarmList = alarmMapper.getAlarmList(userId);
for (AlarmVo alarm: alarmList) { for (AlarmVo alarm: alarmList) {
if (alarm.getReadFlag() == 0) { if (alarm.getReadFlag() == 0) {
int alarmId = alarm.getId(); int alarmId = alarm.getId();
......
...@@ -56,7 +56,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { ...@@ -56,7 +56,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
if (isMultipartContent || isMultipart) { if (isMultipartContent || isMultipart) {
fileUpload = true; fileUpload = true;
} }
try (BufferedReader isr = new BufferedReader(new InputStreamReader(ins, StandardCharsets.UTF_8));) { try (BufferedReader isr = new BufferedReader(new InputStreamReader(ins, StandardCharsets.UTF_8))) {
String line = ""; String line = "";
while ((line = isr.readLine()) != null) { while ((line = isr.readLine()) != null) {
sb.append(line); sb.append(line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment