parent
dff3876895
commit
d270366f1a
@ -0,0 +1,47 @@ |
||||
package com.psdc.service.impl; |
||||
|
||||
import com.psdc.entity.PsdcDevicePowerHdata96; |
||||
import com.psdc.entity.res.PsdcDevicePowerRes; |
||||
import com.psdc.mapper.PsdcDevicePowerHdata96Mapper; |
||||
import com.psdc.mapper.PsdcElectricRtdataMapper; |
||||
import com.psdc.service.IPsdcElectricRtdataService; |
||||
import com.psdc.utils.SecurityUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.text.SimpleDateFormat; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @Author:戴仕崑 |
||||
* @Project:psdc |
||||
* @Filename:PsdcElectricRtdataServiceImpl |
||||
* @Date:2023/5/10 16:08 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Service |
||||
public class PsdcElectricRtdataServiceImpl implements IPsdcElectricRtdataService { |
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
||||
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMdd"); |
||||
|
||||
@Resource |
||||
PsdcElectricRtdataMapper electricRtdataMapper; |
||||
|
||||
@Resource |
||||
PsdcDevicePowerHdata96Mapper devicePowerHdata96Mapper; |
||||
|
||||
/** |
||||
* 电磁锅炉查询 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public PsdcDevicePowerRes queryById() { |
||||
long userId = SecurityUtils.getUserId(); |
||||
Date date = new Date(); |
||||
PsdcDevicePowerRes devicePowerRes = electricRtdataMapper.queryById(1, sdf.format(date)); |
||||
PsdcDevicePowerHdata96 hdata96 = devicePowerHdata96Mapper.queryById(userId, 13, sdf2.format(date)); |
||||
devicePowerRes.setTodayUsePowers(hdata96); |
||||
return devicePowerRes; |
||||
} |
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.psdc.controller.monitor; |
||||
|
||||
import com.psdc.core.domain.AjaxResult; |
||||
import com.psdc.service.IPsdcElectricHtdataService; |
||||
import com.psdc.service.IPsdcElectricRtdataService; |
||||
import com.psdc.service.IPsdcThermometerHtdataService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestMethod; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @Author:戴仕崑 |
||||
* @Project:psdc |
||||
* @Filename:ElectromagneticBoilerController |
||||
* @Date:2023/5/10 16:12 |
||||
* @Version 1.0 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/api/monitor/drgl/index") |
||||
public class ElectromagneticBoilerController { |
||||
|
||||
@Autowired |
||||
IPsdcElectricRtdataService psdcElectricRtdataService; |
||||
@Autowired |
||||
IPsdcThermometerHtdataService psdcThermometerHtdataService; |
||||
@Autowired |
||||
IPsdcElectricHtdataService psdcElectricHtdataService; |
||||
|
||||
@PreAuthorize("@ss.hasPermi('emonitor:drgl')") |
||||
@RequestMapping(value = "/sel1", method = RequestMethod.GET) |
||||
public AjaxResult seldrgl1() { |
||||
AjaxResult ajax = AjaxResult.success(psdcElectricRtdataService.queryById()); |
||||
return ajax; |
||||
} |
||||
|
||||
@PreAuthorize("@ss.hasPermi('emonitor:drgl')") |
||||
@RequestMapping(value = "/sel2", method = RequestMethod.GET) |
||||
public AjaxResult seldrgl2() { |
||||
AjaxResult ajax = psdcThermometerHtdataService.selDzglWenDu(); |
||||
ajax.put("dcglqhour", psdcElectricHtdataService.selDcglThisHourUseElectric()); |
||||
ajax.put("dcglqday", psdcElectricHtdataService.selDcglThisDayUseElectric()); |
||||
return ajax; |
||||
} |
||||
} |
Loading…
Reference in new issue