| | |
| | | import com.whyc.mapper.PwrdevAlarmMapper; |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.MessageUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | public Response serchByCondition(AlarmPar par) { |
| | | //分页信息 |
| | | PageHelper.startPage(par.getPage().getPageCurr(), par.getPage().getPageSize()); |
| | | UserInf uinf= ActionUtil.getUser(); |
| | | UserInf uinf = ActionUtil.getUser(); |
| | | par.setUId(uinf.getUId().intValue()); |
| | | List<AlarmRes> list=mapper.serchByCondition(par); |
| | | for (AlarmRes a:list) { |
| | | List<BattalarmData> l=a.getAdatas(); |
| | | for (BattalarmData adata:l) { |
| | | List<AlarmRes> list = mapper.serchByCondition(par); |
| | | for (AlarmRes a : list) { |
| | | List<BattalarmData> l = a.getAdatas(); |
| | | for (BattalarmData adata : l) { |
| | | adata.setAlmSignalIdName(AlarmDaoFactory.getAlarmName(adata.getAlmSignalId())); |
| | | adata.setAlmLevelName(AlarmDaoFactory.getAlarmType(adata.getAlmLevel())); |
| | | } |
| | | } |
| | | PageInfo<AlarmRes> pinfo=new PageInfo<AlarmRes>(list); |
| | | return new Response().set(1,pinfo); |
| | | PageInfo<AlarmRes> pinfo = new PageInfo<AlarmRes>(list); |
| | | return new Response().set(1, pinfo); |
| | | } |
| | | |
| | | //电池告警实时查询-websocket使用 |
| | | @Transactional |
| | | public Response serchByConditionOfWebSocket(AlarmPar par) { |
| | | public Response serchByConditionOfWebSocket(AlarmPar par, String lang) { |
| | | //分页信息 |
| | | PageHelper.startPage(par.getPage().getPageCurr(), par.getPage().getPageSize()); |
| | | List<AlarmRes> list=mapper.serchByCondition(par); |
| | | for (AlarmRes a:list) { |
| | | List<BattalarmData> l=a.getAdatas(); |
| | | for (BattalarmData adata:l) { |
| | | adata.setAlmSignalIdName(AlarmDaoFactory.getAlarmName(adata.getAlmSignalId())); |
| | | adata.setAlmLevelName(AlarmDaoFactory.getAlarmType(adata.getAlmLevel())); |
| | | List<AlarmRes> list = mapper.serchByCondition(par); |
| | | for (AlarmRes a : list) { |
| | | List<BattalarmData> l = a.getAdatas(); |
| | | for (BattalarmData adata : l) { |
| | | adata.setAlmSignalIdName(MessageUtils.getMessageSocket(AlarmDaoFactory.getAlarmName(adata.getAlmSignalId()), lang)); |
| | | adata.setAlmLevelName(MessageUtils.getMessageSocket(AlarmDaoFactory.getAlarmType(adata.getAlmLevel()), lang)); |
| | | } |
| | | } |
| | | PageInfo<AlarmRes> pinfo=new PageInfo<AlarmRes>(list); |
| | | return new Response().set(1,pinfo); |
| | | PageInfo<AlarmRes> pinfo = new PageInfo<AlarmRes>(list); |
| | | return new Response().set(1, pinfo); |
| | | } |
| | | |
| | | |