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

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;
public interface INuBaseInfoApi {
NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId);
NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId, String areaType);
List<NuBaseInfoEntity> queryByOpenId(String openId);

View File

@ -35,10 +35,11 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
@Override
@DS("#orgCode")
public NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId) {
public NuBaseInfoEntity queryInfoByNuId(String orgCode, String nuId, String areaType) {
QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>();
qw.eq("nu_id", nuId);
qw.eq("area_flag",areaType);//区域属性
qw.eq("del_flag", "0");
NuBaseInfo nuBaseInfo = baseMapper.selectOne(qw);
if (nuBaseInfo == null) {
@ -59,19 +60,19 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
@Override
public List<NuBaseInfoEntity> queryByOpenId(String openId) {
QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>();
qw.eq("open_id",openId);
qw.eq("open_id", openId);
List<NuBaseInfo> list = baseMapper.selectList(qw);
return BeanUtil.copyToList(list,NuBaseInfoEntity.class);
return BeanUtil.copyToList(list, NuBaseInfoEntity.class);
}
@Override
public NuBaseInfoEntity queryByElderIdNum(String idCard) {
NuBaseInfo resource = baseMapper.queryByElderIdNum(idCard);
NuBaseInfo resource = baseMapper.queryByElderIdNum(idCard);
NuBaseInfoEntity result = new NuBaseInfoEntity();
if(resource == null){
if (resource == null) {
return null;
}else{
BeanUtils.copyProperties(resource,result);
} else {
BeanUtils.copyProperties(resource, result);
return result;
}
}
@ -81,21 +82,21 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
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){
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())){
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())){
} else if ("2".equals(wlsb.getDeviceType())) {
dbStr = dbStr + wlsb.getDeviceSn() + ",";
}else if ("3".equals(wlsb.getDeviceType())){
} else if ("3".equals(wlsb.getDeviceType())) {
sbStr = sbStr + wlsb.getDeviceSn() + ",";
}else if ("4".equals(wlsb.getDeviceType())){
} else if ("4".equals(wlsb.getDeviceType())) {
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);
Map<String, Object> map = Map.of(
"nuId", info.getNuId(),
"nuType", dictUtils.translateDictValue("nu_type",info.getAreaFlag()),
"nuType", dictUtils.translateDictValue("nu_type", info.getAreaFlag()),
"status", info.getStatus(),
"sxtList", sxtStr,
"dbList", dbStr,

View File

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

View File

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