| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.BattState; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.BattTestData; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattRtstateMapper; |
| | |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.MessageUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @Transactional |
| | | public class BattRtstateService { |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public Response searchBattLife(int pageNum, int pageSize, Battinf binf) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | List<BattState> list = battRtstateMapper.searchBattLife(binf,userInf.getUId().intValue()); |
| | | for (BattState bs:list) { |
| | | String lang = ActionUtil.getLang(); |
| | | List<BattState> list = battRtstateMapper.searchBattLife(binf, userInf.getUId().intValue()); |
| | | for (BattState bs : list) { |
| | | Battinf battinf = bs.getBinf(); |
| | | battinf.setStationName9(BattTestData.battState(battinf.getNum())); |
| | | battinf.setStationName9(MessageUtils.getMessageSocket(BattTestData.battState(battinf.getNum()), lang)); |
| | | } |
| | | PageInfo<BattState> pageInfo = new PageInfo<>(list); |
| | | return new Response().set(1,pageInfo,"查询成功"); |
| | | return new Response().set(1, pageInfo, "查询成功"); |
| | | } |
| | | |
| | | //查询实时组端信息 |
| | | @Transactional |
| | | public Response<BattRtstate> serchByCondition(int battGroupId) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("BattGroupId",battGroupId); |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("BattGroupId", battGroupId); |
| | | wrapper.last(" limit 1"); |
| | | BattRtstate brt=battRtstateMapper.selectOne(wrapper); |
| | | return new Response().setII(1,brt==null?false:true,brt,""); |
| | | BattRtstate brt = battRtstateMapper.selectOne(wrapper); |
| | | return new Response().setII(1, brt == null ? false : true, brt, ""); |
| | | } |
| | | |
| | | //9140设备要将2组电池的组端信息都给他 |
| | | public Response serch9140Info(int devId) { |
| | | List<BattRtstate> list = battRtstateMapper.serch9140Info(devId); |
| | | return new Response().setII(1, list.size() > 0 ? true : false, list, "9140数据"); |
| | | } |
| | | |
| | | //3D查询机房下电池组端信息 |
| | | public Response getStation3D(String stationId) { |
| | | List<BattRtstate> list=battRtstateMapper.getStation3D(stationId); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,""); |
| | | List<BattRtstate> list = battRtstateMapper.getStation3D(stationId); |
| | | PageInfo pageInfo = new PageInfo(list); |
| | | return new Response().setII(1, list.size() > 0 ? true : false, pageInfo, ""); |
| | | } |
| | | |
| | | |
| | | } |