| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.Ld9StateMapper; |
| | | import com.whyc.mapper.Ld9UpdateStatusMapper; |
| | | import com.whyc.pojo.Fbs9100State; |
| | | import com.whyc.pojo.Ld9State; |
| | | import com.whyc.pojo.Ld9UpdateStatus; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class Ld9StateService { |
| | | |
| | | @Resource |
| | | private Ld9StateMapper mapper; |
| | | @Resource |
| | | private Ld9UpdateStatusMapper updateStatueMapper; |
| | | |
| | | //通过设备id查询LD9数据 |
| | | @Transactional |
| | |
| | | } |
| | | return new Response().setII(1,ld9State==null?false:true,ld9State,""); |
| | | } |
| | | |
| | | public Response getPageLd9(int pageNum,int pageSize,String stationName1,String stationName2,String stationName5,int uId){ |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<Ld9UpdateStatus> list = mapper.getLd9(stationName1,stationName2,stationName5,uId); |
| | | for (Ld9UpdateStatus ld9:list) { |
| | | if (ld9.getNum()== null || ld9.getNum() == 0){ |
| | | Ld9UpdateStatus updateStatue = new Ld9UpdateStatus(); |
| | | updateStatue.setDevId(ld9.getFbsDeviceId().longValue()); |
| | | updateStatueMapper.insert(updateStatue); |
| | | } |
| | | } |
| | | PageInfo<Ld9UpdateStatus> pageInfo = new PageInfo<>(list); |
| | | return new Response().set(1,pageInfo,"查询成功"); |
| | | } |
| | | |
| | | |
| | | public Response updateUpdateFile(Ld9UpdateStatus ld9UpdateStatus){ |
| | | updateStatueMapper.updateById(ld9UpdateStatus); |
| | | return new Response().set(1,true,"更新成功"); |
| | | } |
| | | |
| | | //webSocket使用(FbsStateSocket) |
| | | public Response searchByCondition(int pageNum,int pageSize,int devErrcommcount,int uId){ |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<Fbs9100State> list = mapper.getLd9State(devErrcommcount,uId); |
| | | PageInfo<Fbs9100State> pageInfo = new PageInfo<>(list); |
| | | return new Response().set(1,pageInfo,"查询成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |