小程序查询可入住护理单元增加区域属性筛选:必须是护理单元类型

This commit is contained in:
1378012178@qq.com 2026-01-07 09:39:46 +08:00
parent b6fca0d966
commit 20a19c23dc
4 changed files with 21 additions and 20 deletions

View File

@ -6,7 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public interface INuBaseInfoApi { public interface INuBaseInfoApi {
NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId); NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId, String areaType);
List<NuBaseInfoEntity> queryByOpenId(String openId); List<NuBaseInfoEntity> queryByOpenId(String openId);

View File

@ -35,10 +35,11 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
@Override @Override
@DS("#orgCode") @DS("#orgCode")
public NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId) { public NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId, String areaType) {
QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>(); QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>();
qw.eq("nu_id", nuId); qw.eq("nu_id", nuId);
qw.eq("area_flag",areaType);//区域属性
qw.eq("del_flag", "0"); qw.eq("del_flag", "0");
NuBaseInfo nuBaseInfo = baseMapper.selectOne(qw); NuBaseInfo nuBaseInfo = baseMapper.selectOne(qw);
if (nuBaseInfo == null) { if (nuBaseInfo == null) {
@ -59,19 +60,19 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
@Override @Override
public List<NuBaseInfoEntity> queryByOpenId(String openId) { public List<NuBaseInfoEntity> queryByOpenId(String openId) {
QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>(); QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>();
qw.eq("open_id",openId); qw.eq("open_id", openId);
List<NuBaseInfo> list = baseMapper.selectList(qw); List<NuBaseInfo> list = baseMapper.selectList(qw);
return BeanUtil.copyToList(list,NuBaseInfoEntity.class); return BeanUtil.copyToList(list, NuBaseInfoEntity.class);
} }
@Override @Override
public NuBaseInfoEntity queryByElderIdNum(String idCard) { public NuBaseInfoEntity queryByElderIdNum(String idCard) {
NuBaseInfo resource = baseMapper.queryByElderIdNum(idCard); NuBaseInfo resource = baseMapper.queryByElderIdNum(idCard);
NuBaseInfoEntity result = new NuBaseInfoEntity(); NuBaseInfoEntity result = new NuBaseInfoEntity();
if(resource == null){ if (resource == null) {
return null; return null;
}else{ } else {
BeanUtils.copyProperties(resource,result); BeanUtils.copyProperties(resource, result);
return result; return result;
} }
} }
@ -81,21 +82,21 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
public List<Map<String, Object>> getNuListByOrgCode(String orgCode) { public List<Map<String, Object>> getNuListByOrgCode(String orgCode) {
List<NuBaseInfo> list = baseMapper.selectList(new QueryWrapper<>()); List<NuBaseInfo> list = baseMapper.selectList(new QueryWrapper<>());
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
List<NuBaseInfo> wlsbList =baseMapper.selectWlsbList(); List<NuBaseInfo> wlsbList = baseMapper.selectWlsbList();
for(NuBaseInfo info:list){ for (NuBaseInfo info : list) {
String sxtStr = "";//摄像头集合 String sxtStr = "";//摄像头集合
String dbStr = "";//电表集合 String dbStr = "";//电表集合
String sbStr = "";//水表集合 String sbStr = "";//水表集合
String wsdjStr = "";//温湿度计集合 String wsdjStr = "";//温湿度计集合
for(NuBaseInfo wlsb:wlsbList){ for (NuBaseInfo wlsb : wlsbList) {
if(info.getNuId().equals(wlsb.getNuId())){ if (info.getNuId().equals(wlsb.getNuId())) {
if("1".equals(wlsb.getDeviceType())){ if ("1".equals(wlsb.getDeviceType())) {
sxtStr = sxtStr + wlsb.getDeviceSn() + ","; sxtStr = sxtStr + wlsb.getDeviceSn() + ",";
}else if ("2".equals(wlsb.getDeviceType())){ } else if ("2".equals(wlsb.getDeviceType())) {
dbStr = dbStr + wlsb.getDeviceSn() + ","; dbStr = dbStr + wlsb.getDeviceSn() + ",";
}else if ("3".equals(wlsb.getDeviceType())){ } else if ("3".equals(wlsb.getDeviceType())) {
sbStr = sbStr + wlsb.getDeviceSn() + ","; sbStr = sbStr + wlsb.getDeviceSn() + ",";
}else if ("4".equals(wlsb.getDeviceType())){ } else if ("4".equals(wlsb.getDeviceType())) {
wsdjStr = wsdjStr + wlsb.getDeviceSn() + ","; wsdjStr = wsdjStr + wlsb.getDeviceSn() + ",";
} }
@ -107,7 +108,7 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
if (wsdjStr.length() > 0) wsdjStr = wsdjStr.substring(0, wsdjStr.length() - 1); if (wsdjStr.length() > 0) wsdjStr = wsdjStr.substring(0, wsdjStr.length() - 1);
Map<String, Object> map = Map.of( Map<String, Object> map = Map.of(
"nuId", info.getNuId(), "nuId", info.getNuId(),
"nuType", dictUtils.translateDictValue("nu_type",info.getAreaFlag()), "nuType", dictUtils.translateDictValue("nu_type", info.getAreaFlag()),
"status", info.getStatus(), "status", info.getStatus(),
"sxtList", sxtStr, "sxtList", sxtStr,
"dbList", dbStr, "dbList", dbStr,

View File

@ -88,7 +88,7 @@ public class NuCommonApi {
* @param code 数据字典编码 * @param code 数据字典编码
* @return * @return
*/ */
@GetMapping("/queryAreaNameById") @GetMapping("/queryDictItemByCode")
public Result<Object> queryDictItemByCode(@RequestParam("code") String code) { public Result<Object> queryDictItemByCode(@RequestParam("code") String code) {
return Result.ok(); return Result.ok();
} }

View File

@ -195,7 +195,7 @@ public class ElderApi {
DynamicDataSourceContextHolder.push(orgCode); DynamicDataSourceContextHolder.push(orgCode);
JSONObject orgInfo = null; JSONObject orgInfo = null;
try { try {
orgInfo = sysBaseAPI.getOrgInfo(orgCode,"payable_amount"); orgInfo = sysBaseAPI.getOrgInfo(orgCode, "payable_amount");
} finally { } finally {
DynamicDataSourceContextHolder.clear(); DynamicDataSourceContextHolder.clear();
} }
@ -205,7 +205,7 @@ public class ElderApi {
return Result.ok(null); return Result.ok(null);
} }
NuBaseInfoEntity baseInfo = nuBaseInfoApi.queryInfoByNuId(orgCode, nuId); NuBaseInfoEntity baseInfo = nuBaseInfoApi.queryInfoByNuId(orgCode, nuId, "1");
if (baseInfo == null) { if (baseInfo == null) {
return Result.ok(null); return Result.ok(null);
} }