| | |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @GetMapping("/map/getSiteList") |
| | | @ApiOperation(value = "获取站点", tags = {"2.0-管理后台-数据分析-电站分布"}) |
| | | public R<List<GetSiteListDTO>> getMapSiteList(GetSiteList siteList){ |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | |
| | | if (data.getRoleType()==3){ |
| | | siteList.setSiteId(data.getSiteId()); |
| | | } |
| | | List<GetSiteListDTO> list = siteService.getSiteListNolimit(siteList); |
| | | SysUser sysUser = tokenService.getLoginUser().getSysUser(); |
| | | List<GetSiteListDTO> list = siteService.getSiteListNolimit(siteList,sysUser); |
| | | List<GetSiteListDTO> records = list; |
| | | |
| | | for (GetSiteListDTO record : records) { |
| | |
| | | long daysBetween = ChronoUnit.DAYS.between(chargingPercentProvinceDto.getDate1(), chargingPercentProvinceDto.getDate2()); |
| | | BigDecimal multiply = bigDecimal1.multiply(new BigDecimal("24")).multiply(BigDecimal.valueOf(daysBetween)); |
| | | //得到利用率 |
| | | BigDecimal divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); |
| | | BigDecimal divide; |
| | | if(CollectionUtils.isEmpty(chargingPiles)){ |
| | | divide = BigDecimal.ZERO; |
| | | }else { |
| | | divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //如果利用率大于等于10 |
| | | if (divide.compareTo(BigDecimal.valueOf(10))>=0){ |
| | | chargingPercentBack.setCount1(chargingPercentBack.getCount1()+1); |
| | |
| | | SysUser data = sysUserClient.getSysUser(site.getUserId()).getData(); |
| | | if (data!=null){ |
| | | res.setAccount(data.getUserName()); |
| | | res.setPassword("********"); |
| | | // res.setPassword("********"); |
| | | } |
| | | BeanUtils.copyProperties(site, res); |
| | | return R.ok(res); |
| | |
| | | @PostMapping("/editSite") |
| | | @ApiOperation(value = "编辑站点", tags = {"管理后台-站点管理"}) |
| | | @Log(title = "【站点管理】编辑站点", businessType = BusinessType.UPDATE) |
| | | public AjaxResult editSite(@RequestBody Site site){ |
| | | return siteService.editSite(site); |
| | | public AjaxResult editSite(@RequestBody SiteDTO dto){ |
| | | return siteService.editSite(dto); |
| | | } |
| | | |
| | | @ResponseBody |