| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattCapperformanceEnum; |
| | | import com.whyc.constant.PwrCapperformanceEnum; |
| | | import com.whyc.dto.Param.ParamAlmDto; |
| | | import com.whyc.dto.PowerDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.Pwr7Stic; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.mapper.BaojigroupPowerMapper; |
| | | import com.whyc.mapper.BaojigroupUsrMapper; |
| | |
| | | import com.whyc.mapper.StationInfMapper; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import com.whyc.pojo.db_station.PowerInf; |
| | | import com.whyc.pojo.db_station.PowerInfChange; |
| | | import com.whyc.pojo.db_station.StationInf; |
| | | import com.whyc.pojo.db_user.BaojigroupPower; |
| | | import com.whyc.pojo.db_user.BaojigroupUsr; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PowerInfService { |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BaojigroupPowerMapper bjPowerMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private InfoChangeService changeService; |
| | | |
| | | @Autowired |
| | | private PowerheartParamService heartService; |
| | | |
| | | /*添加电源 |
| | | 1.判断当前用户是否是包组用户 |
| | |
| | | //当前人所在的包机组添加电源机房 |
| | | insertInbaoji(stationId,powerId); |
| | | } |
| | | |
| | | //添加完电源需要插入默认实时页面电源的心跳数据 |
| | | heartService.insertHeartData(powerId); |
| | | } |
| | | //当前人所在的包机组添加电源机房 |
| | | public void insertInbaoji(Integer stationId,Integer powerId){ |
| | |
| | | wrapper.eq("power_id",powerId); |
| | | wrapper.last("limit 1"); |
| | | PowerInf pinf=mapper.selectOne(wrapper); |
| | | List<PowerInfChange> pinfChangeList=changeService.getPinfChange(powerId); |
| | | pinf.setPinfChangeList(pinfChangeList); |
| | | return pinf; |
| | | } |
| | | //电源信息统计 |
| | |
| | | PageInfo<PowerInf> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"电源信息统计"); |
| | | } |
| | | //优良电源数量统计(1.2.7) |
| | | public List<PowerInf> getPwr7Statistic(Pwr7Stic stic) { |
| | | return mapper.getPwr7Statistic(stic); |
| | | } |
| | | |
| | | public List<PowerInf> getListByUserId(Integer userId) { |
| | | return mapper.getListByUserId(userId); |
| | | } |
| | | //根据查询条件获取电源集合 |
| | | public PowerInf getPowerIdList(Integer powerId) { |
| | | return mapper.getPowerIdList(powerId); |
| | | } |
| | | //获取电源性能(下拉) |
| | | public Response getPwrCapperformance() { |
| | | Map<Integer,String> map= PwrCapperformanceEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取电源性能(下拉)"); |
| | | } |
| | | } |