This commit is contained in:
jiask 2025-09-23 18:57:08 +08:00
parent eb5c31e5a9
commit 45ab22e797
8 changed files with 160 additions and 4 deletions

View File

@ -103,4 +103,8 @@ public class KitchenStaffIllegalWarning extends BaseEntity {
private String encryptedSearchValue;
private String searchValue;
private String deviceName;
private String deviceSn;
private String subPlace;
private String deviceNo;
}

View File

@ -5,13 +5,18 @@ import com.bonus.canteen.core.screening.service.HardwareScreenService;
import com.bonus.canteen.core.screening.vo.DishVo;
import com.bonus.canteen.core.screening.vo.HydroPowerVo;
import com.bonus.canteen.core.screening.vo.MorningCheckVo;
import com.bonus.canteen.core.screening.vo.SensorVo;
import com.bonus.canteen.core.supermarket.domain.SupermarketInfo;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 水电数据Controller
*
@ -87,4 +92,16 @@ public class HardwareScreenController extends BaseController {
public AjaxResult getCertificatePicInfo(@RequestBody MorningCheckVo morningCheckVo) {
return success(hardwareScreenService.getCertificatePicInfo(morningCheckVo));
}
/**
* 获取设备记录信息
*/
@ApiOperation(value = "获取设备记录信息")
//@RequiresPermissions("supermarket:info:list")
@GetMapping("/getDeviceRecordListByDeviceType")
public TableDataInfo getDeviceRecordListByDeviceType(SensorVo vo) {
startPage();
List<SensorVo> list = hardwareScreenService.getDeviceRecordListByDeviceType(vo);
return getDataTable(list);
}
}

View File

@ -2,6 +2,7 @@ package com.bonus.canteen.core.screening.mapper;
import com.bonus.canteen.core.screening.vo.HydroPowerVo;
import com.bonus.canteen.core.screening.vo.MorningCheckVo;
import com.bonus.canteen.core.screening.vo.SensorVo;
import java.util.List;
@ -13,4 +14,8 @@ public interface HardwareScreenMapper {
public MorningCheckVo getMorningCheckInfo();
public MorningCheckVo getHealthCheckNum();
public List<MorningCheckVo> getCookCertificateInfo();
public List<SensorVo> selectHydroPowerByWater(SensorVo vo);
public List<SensorVo> selectHydroPowerByElectricity(SensorVo vo);
public List<SensorVo> selectHydroPowerBySensor(SensorVo vo);
}

View File

@ -3,6 +3,7 @@ package com.bonus.canteen.core.screening.service;
import com.bonus.canteen.core.screening.vo.DishVo;
import com.bonus.canteen.core.screening.vo.HydroPowerVo;
import com.bonus.canteen.core.screening.vo.MorningCheckVo;
import com.bonus.canteen.core.screening.vo.SensorVo;
import java.util.List;
@ -52,4 +53,6 @@ public interface HardwareScreenService {
* @return
*/
public MorningCheckVo getCertificatePicInfo(MorningCheckVo morningCheckVo);
public List<SensorVo> getDeviceRecordListByDeviceType(SensorVo vo);
}

View File

@ -4,6 +4,7 @@ import com.bonus.canteen.core.screening.mapper.HardwareScreenMapper;
import com.bonus.canteen.core.screening.vo.DishVo;
import com.bonus.canteen.core.screening.vo.HydroPowerVo;
import com.bonus.canteen.core.screening.vo.MorningCheckVo;
import com.bonus.canteen.core.screening.vo.SensorVo;
import com.bonus.common.houqin.constant.DeviceTypeEnum;
import org.springframework.stereotype.Service;
@ -151,4 +152,21 @@ public class HardwareScreenServiceImpl implements HardwareScreenService {
}
return vo;
}
@Override
public List<SensorVo> getDeviceRecordListByDeviceType(SensorVo vo) {
List<SensorVo> sensorVos=new ArrayList<>();
try{
if("10".equals(vo.getDeviceType())){
sensorVos=mapper.selectHydroPowerByWater(vo);
}else if("11".equals(vo.getDeviceType())){
sensorVos=mapper.selectHydroPowerByElectricity(vo);
}else if("14".equals(vo.getDeviceType())){
sensorVos=mapper.selectHydroPowerBySensor(vo);
}
}catch (Exception e){
e.printStackTrace();
}
return sensorVos;
}
}

View File

@ -0,0 +1,26 @@
package com.bonus.canteen.core.screening.vo;
import lombok.Data;
/**
* @author 19814
* 传感器
*/
@Data
public class SensorVo {
private String temperature ;//温度
private String humidity ;//湿度
private String usage ;///电使用量
private String deviceId ;
private String online ;//设备在线
private String deviceName ;//设备名称
private String createTime ;//获取时间
private String deviceType ;//设备类型
private String startTime ;// yyyy-MM-dd 格式
private String endTime ;// yyyy-MM-dd 格式
private String deviceNo ;//设备编号
private String deviceSn ;//设备SN
private String subPlace ;//位置
private String keyWord ;//关键字
}

View File

@ -27,13 +27,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectKitchenStaffIllegalWarningVo">
select illegal_warning_id, ksiw.staff_id, device_id, ksiw.img_url, record_desc, record_time,
select illegal_warning_id, ksiw.device_id, ksiw.img_url, record_desc, record_time,
illegal_warning_type, handle_state, handle_time, handler_person, notify_state,
notify_desc, alarm_type, ksiw.create_by, ksiw.create_time, ksiw.update_by, ksiw.update_time,
ksi.staff_name, ksi.staff_no, bc.canteen_name
ksi.device_name as devicename, ksi.device_no as deviceno, ksi.device_sn,CONCAT(ba.area_name, '-', ksp.sub_place_name) AS subplace
from kitchen_staff_illegal_warning ksiw
left join kitchen_staff_info ksi on ksiw.staff_id = ksi.staff_id
left join basic_canteen bc on bc.canteen_id = ksi.canteen_id
left join kitchen_device_info ksi on ksiw.device_id = ksi.device_id
left join basic_canteen bc on bc.canteen_id = ksi.canteen_id
LEFT JOIN kitchen_sub_place ksp ON ksp.sub_place_id = ksi.sub_place
LEFT JOIN basic_area ba ON ksi.area_id = ba.area_id
</sql>
<select id="selectKitchenStaffIllegalWarningList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffIllegalWarning" resultMap="KitchenStaffIllegalWarningResult">

View File

@ -53,4 +53,85 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where DATE(record_time)=DATE(NOW())
</select>
<select id="selectHydroPowerByWater" resultType="com.bonus.canteen.core.screening.vo.SensorVo">
SELECT
bc.canteen_name AS canteen,
m.device_network_state AS online,w.record_time as createTime,
CONCAT(ba.area_name, '-', ksp.sub_place_name) AS subplace,
w.usage_power as `usage`,
m.device_name as deviceName,'水表' as deviceType,m.device_no as deviceNo,m.device_sn as deviceSn,m.ip as ip
FROM kitchen_device_info m
LEFT JOIN kitchen_water_info w ON m.device_id = w.device_id
LEFT JOIN basic_area ba ON m.area_id = ba.area_id
LEFT JOIN basic_canteen bc ON bc.canteen_id = m.canteen_id
LEFT JOIN kitchen_sub_place ksp ON ksp.sub_place_id = m.sub_place
WHERE m.device_type = 10 and w.id is not null
<if test="startTime!=null and startTime!=''">
and substr(w.record_time,1,10)>=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and #{endTime}>=substr(w.record_time,1,10)
</if>
<if test="keyWord!=null and keyWord!=''">
and (ksp.sub_place_name like concat('%', #{keyWord}, '%') or m.device_no like concat('%', #{keyWord}, '%')
or m.device_sn like concat('%', #{keyWord}, '%') or m.device_name like concat('%', #{keyWord}, '%')
)
</if>
</select>
<select id="selectHydroPowerByElectricity" resultType="com.bonus.canteen.core.screening.vo.SensorVo">
SELECT
bc.canteen_name AS canteen,
m.device_network_state AS online,w.record_time as createTime,
CONCAT(ba.area_name, '-', ksp.sub_place_name) AS subplace,
w.usage_power as `usage`,
m.device_name as deviceName,'电表' as deviceType,m.device_no as deviceNo,m.device_sn as deviceSn,m.ip as ip
FROM kitchen_device_info m
LEFT JOIN kitchen_water_info w ON m.device_id = w.device_id
LEFT JOIN basic_area ba ON m.area_id = ba.area_id
LEFT JOIN basic_canteen bc ON bc.canteen_id = m.canteen_id
LEFT JOIN kitchen_sub_place ksp ON ksp.sub_place_id = m.sub_place
WHERE m.device_type = 11 and w.id is not null
<if test="startTime!=null and startTime!=''">
and substr(w.record_time,1,10)>=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and #{endTime}>=substr(w.record_time,1,10)
</if>
<if test="keyWord!=null and keyWord!=''">
and (ksp.sub_place_name like concat('%', #{keyWord}, '%') or m.device_no like concat('%', #{keyWord}, '%')
or m.device_sn like concat('%', #{keyWord}, '%') or m.device_name like concat('%', #{keyWord}, '%')
)
</if>
</select>
<select id="selectHydroPowerBySensor" resultType="com.bonus.canteen.core.screening.vo.SensorVo">
SELECT
bc.canteen_name AS canteen,
m.device_network_state AS online,w.create_time as createTime,
CONCAT(ba.area_name, '-', ksp.sub_place_name) AS subplace,
w.temperature as temperature,w.humidity as humidity,
m.device_name as deviceName,'温湿度传感器' as deviceType,m.device_no as deviceNo,m.device_sn as deviceSn,m.ip as ip
FROM kitchen_device_info m
LEFT JOIN kitchen_device_sensor_record w ON m.device_id = w.device_id
LEFT JOIN basic_area ba ON m.area_id = ba.area_id
LEFT JOIN basic_canteen bc ON bc.canteen_id = m.canteen_id
LEFT JOIN kitchen_sub_place ksp ON ksp.sub_place_id = m.sub_place
WHERE m.device_type = 14 and w.record_id is not null
<if test="startTime!=null and startTime!=''">
and substr(w.record_time,1,10)>=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and #{endTime}>=substr(w.record_time,1,10)
</if>
<if test="keyWord!=null and keyWord!=''">
and (ksp.sub_place_name like concat('%', #{keyWord}, '%') or m.device_no like concat('%', #{keyWord}, '%')
or m.device_sn like concat('%', #{keyWord}, '%') or m.device_name like concat('%', #{keyWord}, '%')
)
</if>
</select>
</mapper>