| | |
| | | |
| | | public Response searchById(int id){ |
| | | WorkAlarm result = mapper.selectById(id); |
| | | UserInf userInf = userInfMapper.selectById(result.getUserId()); |
| | | result.setUserName(userInf.getUName()); |
| | | if (result.getUserId()!=null && result.getUserId()!=0){ |
| | | UserInf userInf = userInfMapper.selectById(result.getUserId()); |
| | | result.setUserName(userInf.getUName()); |
| | | } |
| | | //去告警表查询是否存在 |
| | | int flag = 1; |
| | | if (result.getAlarmRecordId()==null){ |
| | | if (result.getAlarmRecId()==null){ |
| | | flag = 0; |
| | | } |
| | | boolean bl = alarmIsExist(result.getAlarmRecId(),result.getAlarmRecordId()); |
| | | boolean bl = alarmIsExist(result.getAlarmRecId()); |
| | | if (!bl){ |
| | | flag = 0; |
| | | } |
| | |
| | | return new Response().set(1,result,"查询成功"); |
| | | } |
| | | |
| | | public boolean alarmIsExist(int num,long recordId){ |
| | | public boolean alarmIsExist(int num){ |
| | | boolean bl = false; |
| | | List<BattalarmData> list = mapper.getBattAlarm(num,recordId); |
| | | List<BattalarmData> list = mapper.getBattAlarm(num); |
| | | if (list != null && list.size() > 0) { |
| | | bl = true; |
| | | } |
| | | List<BattDevAlarmData> list2 = mapper.getDevAlarm(num,recordId); |
| | | List<BattDevAlarmData> list2 = mapper.getDevAlarm(num); |
| | | if (list2 != null && list2.size() > 0) { |
| | | bl = true; |
| | | } |
| | |
| | | Integer status = null; |
| | | Integer checkStatus = null; |
| | | //查询未派单列表 |
| | | if(note==1){ |
| | | if (note == 1) { |
| | | status = 0; |
| | | //此时还没生成user_work表记录 |
| | | checkStatus = null; |
| | | } |
| | | //查询已派单列表 |
| | | else if(note==2){ |
| | | else if (note == 2) { |
| | | status = 1; |
| | | checkStatus = null; |
| | | } |
| | | //查询待审核列表 |
| | | else if(note==3){ |
| | | else if (note == 3) { |
| | | status = 2; |
| | | checkStatus = 2; |
| | | } |
| | | //查询已完成列表 |
| | | else if(note==4){ |
| | | else if (note == 4) { |
| | | status = 3; |
| | | checkStatus = 3; |
| | | } |
| | | List<WorkAlarm> list = mapper.getTaskListWithFlag(uId,status,checkStatus); |
| | | List<WorkAlarm> list = mapper.getTaskListWithFlag(uId, status, checkStatus); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().set(1,pageInfo,"查询成功"); |
| | | return new Response().set(1, pageInfo, "查询成功"); |
| | | } |
| | | |
| | | public Response getTaskListWithFlagNew(Integer uId, Integer note, int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | Integer status = null; |
| | | Integer checkStatus = null; |
| | | //查询未派单列表 |
| | | if (note == 1) { |
| | | status = 0; |
| | | //此时还没生成user_work表记录 |
| | | checkStatus = null; |
| | | } |
| | | //查询已派单列表 |
| | | else if (note == 2) { |
| | | status = 1; |
| | | checkStatus = null; |
| | | } |
| | | //查询待审核列表 |
| | | else if (note == 3) { |
| | | status = 2; |
| | | checkStatus = 2; |
| | | } |
| | | //查询已完成列表 |
| | | else if (note == 4) { |
| | | status = 3; |
| | | checkStatus = 3; |
| | | } |
| | | List<WorkAlarm> list = mapper.getTaskListWithFlagNew(uId, status, checkStatus); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().set(1, pageInfo, "查询成功"); |
| | | } |
| | | |
| | | |
| | | public Response dispatchTask(List<WorkAlarm> alarmList){ |
| | | for (WorkAlarm alarm: alarmList) { |
| | | public Response dispatchTask(List<WorkAlarm> alarmList) { |
| | | for (WorkAlarm alarm : alarmList) { |
| | | mapper.dispatchTask(alarm); |
| | | } |
| | | return new Response().set(1,true,"更新完成"); |
| | | return new Response().set(1, true, "更新完成"); |
| | | } |
| | | |
| | | |