APP-吊装监控
This commit is contained in:
parent
cbc5718b11
commit
ef2c5ef6ae
|
|
@ -35,7 +35,11 @@ public class BusinessConstants {
|
|||
public final static String SHX = "shx";
|
||||
/** 安全帽设备类型*/
|
||||
public final static String AQM = "aqm";
|
||||
/**吊装预警设备*/
|
||||
public final static String DZYJ = "lift_warn";
|
||||
/**近电感应设备*/
|
||||
public final static String JD = "elec_induction";
|
||||
public final static String DL = "电量";
|
||||
|
||||
/** 管理员角色*/
|
||||
public final static String ADMINISTRATORS = "administrators";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.common.entity.app.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:DevInfoVo
|
||||
* @author:cwchen
|
||||
* @date:2024-08-12-16:27
|
||||
* @version:1.0
|
||||
* @description:设备-vo
|
||||
*/
|
||||
@Data
|
||||
public class DevInfoVo {
|
||||
|
||||
/**设备ID*/
|
||||
private Long devId;
|
||||
/**设备名称*/
|
||||
private String devName;
|
||||
/**设备编码*/
|
||||
private String devCode;
|
||||
/**设备下标*/
|
||||
private Integer devIndex;
|
||||
/**是否告警 0-否 1-是*/
|
||||
private Integer isWarn = 0;
|
||||
/**班组长*/
|
||||
private String teamLeader;
|
||||
/**班组长手机号*/
|
||||
private String leaderPhone;
|
||||
/**电量*/
|
||||
private String electricQuantity;
|
||||
}
|
||||
|
|
@ -1,9 +1,18 @@
|
|||
package com.bonus.app.controller;
|
||||
|
||||
import com.bonus.app.service.ICraneMonitorService;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.app.AppParamsDto;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @className:CraneMonitorController
|
||||
* @author:cwchen
|
||||
|
|
@ -15,4 +24,19 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping("/craneMonitor/")
|
||||
@Slf4j
|
||||
public class CraneMonitorController {
|
||||
|
||||
@Resource(name = "ICraneMonitorService")
|
||||
private ICraneMonitorService service;
|
||||
|
||||
@GetMapping("getDzWarnList")
|
||||
@SysLog(title = "APP->吊装监控", businessType = OperaType.QUERY,logType = 0,module = "APP->吊装监控",details ="查询吊装预警设备")
|
||||
public AjaxResult getDzWarnList(AppParamsDto dto){
|
||||
return service.getDzWarnList(dto);
|
||||
}
|
||||
|
||||
@GetMapping("getJdList")
|
||||
@SysLog(title = "APP->吊装监控", businessType = OperaType.QUERY,logType = 0,module = "APP->吊装监控",details ="查询近电感应设备")
|
||||
public AjaxResult getJdList(AppParamsDto dto){
|
||||
return service.getJdList(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
package com.bonus.app.mapper;
|
||||
|
||||
import com.bonus.common.entity.app.AppParamsDto;
|
||||
import com.bonus.common.entity.app.vo.DevInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:CraneMonitorMapper
|
||||
* @author:cwchen
|
||||
|
|
@ -7,5 +14,32 @@ package com.bonus.app.mapper;
|
|||
* @version:1.0
|
||||
* @description:吊车监控
|
||||
*/
|
||||
@Repository(value = "CraneMonitorMapper")
|
||||
public interface CraneMonitorMapper {
|
||||
/**
|
||||
* 查询班组领用的吊装预警设备
|
||||
* @param dto
|
||||
* @return List<DevInfoVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/12 16:31
|
||||
*/
|
||||
List<DevInfoVo> getDzWarnList(AppParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询班组领用的近电感应设备
|
||||
* @param dto
|
||||
* @return List<DevInfoVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/12 17:29
|
||||
*/
|
||||
List<DevInfoVo> getJdList(AppParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询近电感应设备的电量值
|
||||
* @param vo
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/8/12 17:54
|
||||
*/
|
||||
String getElectricQuantity(@Param("devId") Long devId, @Param("dataCode")String dataCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.bonus.app.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.app.AppParamsDto;
|
||||
|
||||
/**
|
||||
* @className:CraneMonitorService
|
||||
* @author:cwchen
|
||||
|
|
@ -8,4 +11,14 @@ package com.bonus.app.service;
|
|||
* @description:吊车监控
|
||||
*/
|
||||
public interface ICraneMonitorService {
|
||||
/**
|
||||
* 查询班组领用的吊装预警设备
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/8/12 16:24
|
||||
*/
|
||||
AjaxResult getDzWarnList(AppParamsDto dto);
|
||||
|
||||
AjaxResult getJdList(AppParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
package com.bonus.app.service.impl;
|
||||
|
||||
import cn.hutool.core.annotation.AliasFor;
|
||||
import com.bonus.app.mapper.CraneMonitorMapper;
|
||||
import com.bonus.app.service.ICraneMonitorService;
|
||||
import com.bonus.common.core.constant.BusinessConstants;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.entity.app.AppParamsDto;
|
||||
import com.bonus.common.entity.app.vo.DevInfoVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:CraneMonitorServiceImpl
|
||||
|
|
@ -9,5 +21,38 @@ import com.bonus.app.service.ICraneMonitorService;
|
|||
* @version:1.0
|
||||
* @description:吊车监控
|
||||
*/
|
||||
@Service(value = "ICraneMonitorService")
|
||||
@Slf4j
|
||||
public class CraneMonitorServiceImpl implements ICraneMonitorService {
|
||||
|
||||
@Resource(name = "CraneMonitorMapper")
|
||||
private CraneMonitorMapper mapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult getDzWarnList(AppParamsDto dto) {
|
||||
List<DevInfoVo> list = new ArrayList<>();
|
||||
try {
|
||||
dto.setDevType(BusinessConstants.DZYJ);
|
||||
list = mapper.getDzWarnList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getJdList(AppParamsDto dto) {
|
||||
List<DevInfoVo> list = new ArrayList<>();
|
||||
try {
|
||||
dto.setDevType(BusinessConstants.JD);
|
||||
list = mapper.getJdList(dto);
|
||||
for (DevInfoVo vo : list) {
|
||||
String electricQuantity = mapper.getElectricQuantity(vo.getDevId(),BusinessConstants.DL);
|
||||
vo.setElectricQuantity(electricQuantity);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,34 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.app.mapper.AppEquipmentReqMapper">
|
||||
<mapper namespace="com.bonus.app.mapper.CraneMonitorMapper">
|
||||
|
||||
<!--查询班组领用的吊装预警设备-->
|
||||
<select id="getDzWarnList" resultType="com.bonus.common.entity.app.vo.DevInfoVo">
|
||||
SELECT twt.team_leader AS teamLeader,
|
||||
twt.leader_phone AS leaderPhone,
|
||||
td.dev_code AS devCode,
|
||||
td.id AS devId,
|
||||
td.dev_index AS devIndex,
|
||||
td.dev_name AS devName
|
||||
FROM tb_device td
|
||||
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id
|
||||
LEFT JOIN t_work_team twt ON tdl.team_id = twt.team_id AND twt.del_flag = 0
|
||||
WHERE tdl.team_id = #{id} AND td.dev_type = #{devType} AND td.del_flag = 0
|
||||
ORDER BY dev_index
|
||||
</select>
|
||||
<!--查询班组领用的近电感应设备-->
|
||||
<select id="getJdList" resultType="com.bonus.common.entity.app.vo.DevInfoVo">
|
||||
SELECT td.dev_code AS devCode,
|
||||
td.id AS devId,
|
||||
td.dev_index AS devIndex,
|
||||
td.dev_name AS devName
|
||||
FROM tb_device td
|
||||
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id
|
||||
WHERE tdl.team_id = #{id} AND td.dev_type = #{devType} AND td.del_flag = 0
|
||||
</select>
|
||||
<!--查询近电感应设备的电量-->
|
||||
<select id="getElectricQuantity" resultType="java.lang.String">
|
||||
SELECT data_val FROM tb_dev_details WHERE dev_id = #{devId} AND data_code = #{dataCode} AND dev_type = 1 LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue