| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.AlarmDaoFactory; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.filter.AccessFilter; |
| | | import com.whyc.mapper.PwrDevAlarmVerifyMapper; |
| | | import com.whyc.pojo.BattAlarmDataVerify; |
| | | import com.whyc.pojo.PwrDevAlarmVerify; |
| | | import com.whyc.pojo.PwrdevAlarm; |
| | | import com.whyc.pojo.WorkflowMain; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private PwrDevAlarmVerifyMapper mapper; |
| | | |
| | | public Response<Object> getPage(int pageNum, int pageSize) { |
| | | int userId = ActionUtil.getUser().getUId().intValue(); |
| | | List<PwrDevAlarmVerify> list = mapper.getList(userId); |
| | | @Autowired |
| | | @Lazy |
| | | private AlarmManualClearService clearService; |
| | | |
| | | public Response<Object> getPage(PwrdevAlarm param) { |
| | | List<Integer> allMainIds = clearService.getAllMainIds(); |
| | | //int userId = ActionUtil.getUser().getUId().intValue(); |
| | | List<PwrDevAlarmVerify> list = mapper.getList(param); |
| | | list.stream().forEach(data -> { |
| | | data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType())); |
| | | WorkflowMain main = data.getMain(); |
| | | if (main != null && allMainIds.contains(main.getId())){ |
| | | main.setFaultUploadDone(true); |
| | | } |
| | | }); |
| | | PageInfo<PwrDevAlarmVerify> pageInfo = new PageInfo<>(list); |
| | | return new Response<>().set(1,pageInfo); |
| | |
| | | mapper.deleteById(num); |
| | | } |
| | | |
| | | public Response getPageOfWebSocket(PwrdevAlarm pwrdevAlarm) { |
| | | public Response getPageOfWebSocket(PwrdevAlarm param) { |
| | | try { |
| | | int userId = ActionUtil.getUser().getUId().intValue(); |
| | | PageHelper.startPage(pwrdevAlarm.getPage().getPageCurr(), pwrdevAlarm.getPage().getPageSize()); |
| | | List<PwrDevAlarmVerify> list = mapper.getList(userId); |
| | | PageHelper.startPage(param.getPage().getPageCurr(), param.getPage().getPageSize()); |
| | | List<PwrDevAlarmVerify> list = mapper.getList(param); |
| | | list.stream().forEach(data -> { |
| | | data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType())); |
| | | }); |