添加机构信息查询护理单元信息
This commit is contained in:
parent
d222704c97
commit
a05a686623
|
|
@ -3,6 +3,7 @@ package com.nu.modules.baseinfo.api;
|
|||
import com.nu.entity.NuBaseInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface INuBaseInfoApi {
|
||||
NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId);
|
||||
|
|
@ -10,4 +11,6 @@ public interface INuBaseInfoApi {
|
|||
List<NuBaseInfoEntity> queryByOpenId(String openId);
|
||||
|
||||
NuBaseInfoEntity queryByElderIdNum(String idCard);
|
||||
|
||||
List<Map<String, Object>> getNuListByOrgCode(String orgCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ public class NuBaseInfo implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private String deviceName;//摄像头名称
|
||||
@TableField(exist = false)
|
||||
private String deviceSn;//设备编号
|
||||
@TableField(exist = false)
|
||||
private String deviceStatus;//摄像头状态
|
||||
@TableField(exist = false)
|
||||
private String deviceMac;//摄像头状态
|
||||
|
|
@ -135,5 +137,9 @@ public class NuBaseInfo implements Serializable {
|
|||
|
||||
@TableField(exist = false)
|
||||
private String elderTableId;
|
||||
@TableField(exist = false)
|
||||
private String maintainStatus;//设备状态
|
||||
@TableField(exist = false)
|
||||
private String deviceType;//设备类型
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.nu.modules.baseinfo.entity.NuBaseInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元
|
||||
* @Author: jeecg-boot
|
||||
|
|
@ -14,4 +16,5 @@ public interface NuBaseInfoMapper extends BaseMapper<NuBaseInfo> {
|
|||
|
||||
NuBaseInfo queryByElderIdNum(@Param("idCard") String idCard);
|
||||
|
||||
List<NuBaseInfo> selectWlsbList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,14 @@
|
|||
left join nu_base_info baseinfo on baseinfo.elder_id = elderinfo.id
|
||||
where elderinfo.id_card = #{idCard}
|
||||
</select>
|
||||
|
||||
<select id="selectWlsbList" resultType="com.nu.modules.baseinfo.entity.NuBaseInfo">
|
||||
select sn as device_sn,device_name,'1' as device_type,nu_id,maintain_status from nu_iot_tplink_camera
|
||||
union all
|
||||
select cid as device_sn,cid as device_name,'2' as device_type,nu_id,maintain_status from nu_iot_tq_electricity_meter
|
||||
union all
|
||||
select cid as device_sn,cid as device_name,'3' as device_type,nu_id,maintain_status from nu_iot_tq_water_meter
|
||||
union all
|
||||
select sn as device_sn,device_name,'4' as device_type,nu_id,maintain_status from nu_iot_yiweilian_humid_device
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -10,11 +10,14 @@ import com.nu.modules.baseinfo.entity.NuBaseInfo;
|
|||
import com.nu.modules.baseinfo.mapper.NuBaseInfoMapper;
|
||||
import com.nu.modules.baseinfo.service.INuBaseInfoService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.DictUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元
|
||||
|
|
@ -27,6 +30,8 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Autowired
|
||||
private DictUtils dictUtils;
|
||||
|
||||
@Override
|
||||
@DS("#orgCode")
|
||||
|
|
@ -74,4 +79,48 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#orgCode")
|
||||
public List<Map<String, Object>> getNuListByOrgCode(String orgCode) {
|
||||
List<NuBaseInfo> list = baseMapper.selectList(new QueryWrapper<>());
|
||||
List<Map<String, Object>> mapList = new ArrayList<>();
|
||||
List<NuBaseInfo> wlsbList =baseMapper.selectWlsbList();
|
||||
for(NuBaseInfo info:list){
|
||||
String sxtStr = "";//摄像头集合
|
||||
String dbStr = "";//电表集合
|
||||
String sbStr = "";//水表集合
|
||||
String wsdjStr = "";//温湿度计集合
|
||||
for(NuBaseInfo wlsb:wlsbList){
|
||||
if(info.getNuId().equals(wlsb.getNuId())){
|
||||
if("1".equals(wlsb.getDeviceType())){
|
||||
sxtStr = sxtStr + wlsb.getDeviceSn() + ",";
|
||||
}else if ("2".equals(wlsb.getDeviceType())){
|
||||
dbStr = dbStr + wlsb.getDeviceSn() + ",";
|
||||
}else if ("3".equals(wlsb.getDeviceType())){
|
||||
sbStr = sbStr + wlsb.getDeviceSn() + ",";
|
||||
}else if ("4".equals(wlsb.getDeviceType())){
|
||||
wsdjStr = wsdjStr + wlsb.getDeviceSn() + ",";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (sxtStr.length() > 0) sxtStr = sxtStr.substring(0, sxtStr.length() - 1);
|
||||
if (dbStr.length() > 0) dbStr = dbStr.substring(0, dbStr.length() - 1);
|
||||
if (sbStr.length() > 0) sbStr = sbStr.substring(0, sbStr.length() - 1);
|
||||
if (wsdjStr.length() > 0) wsdjStr = wsdjStr.substring(0, wsdjStr.length() - 1);
|
||||
Map<String, Object> map = Map.of(
|
||||
"nuId", info.getNuId(),
|
||||
"nuType", dictUtils.translateDictValue("nu_type",info.getAreaFlag()),
|
||||
"status", info.getStatus(),
|
||||
"sxtList", sxtStr,
|
||||
"dbList", dbStr,
|
||||
"sbList", sbStr,
|
||||
"wsdjList", wsdjStr
|
||||
);
|
||||
mapList.add(map);
|
||||
}
|
||||
|
||||
return mapList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,4 +215,21 @@ public class NuBaseInfoApi {
|
|||
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据orgCode获取护理单元信息
|
||||
*
|
||||
* @param orgCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getNuListByOrgCode")
|
||||
public Result<List<Map<String,Object>>> getNuListByOrgCode(@RequestParam("orgCode") String orgCode) {
|
||||
if(StringUtils.isBlank(orgCode)){
|
||||
return Result.error("orgCode不能为空");
|
||||
}
|
||||
List<Map<String,Object>> result =nuBaseInfoApi.getNuListByOrgCode(orgCode);
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue