Commit 948c25e5 by huangjy

fix:子女端登陆问题

parent 30b633af
...@@ -125,7 +125,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe ...@@ -125,7 +125,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
PlatElderChildrenInfo platElderChildrenInfo = platElderChildrenInfoService.getById(WechatUserUtil.getUserId()); PlatElderChildrenInfo platElderChildrenInfo = platElderChildrenInfoService.getById(WechatUserUtil.getUserId());
List<PlatElderChildrenInfo> platElderChildrenInfoList = getPlatElderChildrenInfosByOpenid(platElderChildrenInfo.getOpenid()); List<PlatElderChildrenInfo> platElderChildrenInfoList = getPlatElderChildrenInfosByOpenid(platElderChildrenInfo.getOpenid());
log.info("子女端账号:{}",JSON.toJSONString(platElderChildrenInfo)); log.info("子女端账号:{}",JSON.toJSONString(platElderChildrenInfo));
if(CollectionUtils.isNotEmpty(platElderChildrenInfoList)){ if(CollectionUtils.isEmpty(platElderChildrenInfoList)){
return new PageVO<>(); return new PageVO<>();
} }
List<String> elderIdList = platElderChildrenInfoList.stream().map(PlatElderChildrenInfo::getElderId).collect(Collectors.toList()); List<String> elderIdList = platElderChildrenInfoList.stream().map(PlatElderChildrenInfo::getElderId).collect(Collectors.toList());
...@@ -537,7 +537,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe ...@@ -537,7 +537,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
PlatElderChildrenInfo platElderChildrenInfo = platElderChildrenInfoService.getById(WechatUserUtil.getUserId()); PlatElderChildrenInfo platElderChildrenInfo = platElderChildrenInfoService.getById(WechatUserUtil.getUserId());
List<PlatElderChildrenInfo> platElderChildrenInfoList = getPlatElderChildrenInfosByOpenid(platElderChildrenInfo.getOpenid()); List<PlatElderChildrenInfo> platElderChildrenInfoList = getPlatElderChildrenInfosByOpenid(platElderChildrenInfo.getOpenid());
log.info("子女端账号:{}",JSON.toJSONString(platElderChildrenInfo)); log.info("子女端账号:{}",JSON.toJSONString(platElderChildrenInfo));
if(CollectionUtils.isNotEmpty(platElderChildrenInfoList)){ if(CollectionUtils.isEmpty(platElderChildrenInfoList)){
return 0; return 0;
} }
List<String> elderIdList = platElderChildrenInfoList.stream().map(PlatElderChildrenInfo::getElderId).collect(Collectors.toList()); List<String> elderIdList = platElderChildrenInfoList.stream().map(PlatElderChildrenInfo::getElderId).collect(Collectors.toList());
......
...@@ -67,7 +67,6 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild ...@@ -67,7 +67,6 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
.like(StringUtils.isNotBlank(dto.getPhone()), PlatElderChildrenInfo::getPhone, dto.getPhone()) .like(StringUtils.isNotBlank(dto.getPhone()), PlatElderChildrenInfo::getPhone, dto.getPhone())
.eq(StringUtils.isNotBlank(dto.getElderId()), PlatElderChildrenInfo::getElderId, dto.getElderId()) .eq(StringUtils.isNotBlank(dto.getElderId()), PlatElderChildrenInfo::getElderId, dto.getElderId())
.eq(StringUtils.isNotBlank(dto.getTenantId()), PlatElderChildrenInfo::getTenantId, dto.getTenantId()) .eq(StringUtils.isNotBlank(dto.getTenantId()), PlatElderChildrenInfo::getTenantId, dto.getTenantId())
.in(CollectionUtils.isNotEmpty(dto.getOrgIdList()), PlatElderChildrenInfo::getOrgId, dto.getOrgIdList())
.apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)"); .apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)");
} }
...@@ -94,11 +93,6 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild ...@@ -94,11 +93,6 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
String tenantId = RequestUtil.getTenantIdHeader(); String tenantId = RequestUtil.getTenantIdHeader();
dto.setTenantId(tenantId); dto.setTenantId(tenantId);
String dataScope = RequestUtil.getDataScope();
if (StringUtils.isNotBlank(dataScope)) {
dto.setOrgIdList(Lists.newArrayList(dataScope.split(Const.COMMON_SPLIT)));
}
LambdaQueryWrapper<PlatElderChildrenInfo> queryWrapper = lambdaQueryWrapper(dto); LambdaQueryWrapper<PlatElderChildrenInfo> queryWrapper = lambdaQueryWrapper(dto);
queryWrapper.groupBy(PlatElderChildrenInfo::getOpenid); queryWrapper.groupBy(PlatElderChildrenInfo::getOpenid);
Page<PlatElderChildrenInfo> voPage = page(p, queryWrapper); Page<PlatElderChildrenInfo> voPage = page(p, queryWrapper);
...@@ -116,7 +110,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild ...@@ -116,7 +110,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
for (PlatElderChildrenInfoListVO platElderChildrenInfoListVO : voList) { for (PlatElderChildrenInfoListVO platElderChildrenInfoListVO : voList) {
List<PlatElderChildrenInfo> platElderChildrenInfoList = map.get(platElderChildrenInfoListVO.getOpenid()); List<PlatElderChildrenInfo> platElderChildrenInfoList = map.get(platElderChildrenInfoListVO.getOpenid());
if (CollectionUtils.isNotEmpty(platElderChildrenInfoList)) { if (CollectionUtils.isNotEmpty(platElderChildrenInfoList)) {
String elderIds = platElderChildrenInfoList.stream().map(PlatElderChildrenInfo::getElderId).collect(Collectors.joining()); String elderIds = platElderChildrenInfoList.stream().map(PlatElderChildrenInfo::getElderId).collect(Collectors.joining(","));
platElderChildrenInfoListVO.setElderId(elderIds); platElderChildrenInfoListVO.setElderId(elderIds);
} }
} }
...@@ -178,16 +172,18 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild ...@@ -178,16 +172,18 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
} }
@Transactional @Transactional(rollbackFor = Exception.class)
@Override @Override
public void wechatEdit(PlatElderChildrenInfoWechatDTOVO dto) { public void wechatEdit(PlatElderChildrenInfoWechatDTOVO dto) {
check(BeanDtoVoUtils.convert(dto, PlatElderChildrenInfoDTOVO.class)); check(BeanDtoVoUtils.convert(dto, PlatElderChildrenInfoDTOVO.class));
PlatElderChildrenInfo db = getById(dto.getId()); PlatElderChildrenInfo db = getById(dto.getId());
BeanUtils.copyProperties(dto, db); List<PlatElderChildrenInfo> platElderChildrenInfoList = list(new QueryWrapper<PlatElderChildrenInfo>().lambda().eq(PlatElderChildrenInfo::getOpenid, db.getOpenid()));
for (PlatElderChildrenInfo platElderChildrenInfo : platElderChildrenInfoList) {
updateById(db); BeanUtils.copyProperties(dto, platElderChildrenInfo);
updateById(platElderChildrenInfo);
}
} }
......
...@@ -144,6 +144,9 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i ...@@ -144,6 +144,9 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
platBedService.remove(new QueryWrapper<PlatBed>().lambda() platBedService.remove(new QueryWrapper<PlatBed>().lambda()
.in(PlatBed::getRoomId, ids)); .in(PlatBed::getRoomId, ids));
platRoomBedDeviceService.remove(new QueryWrapper<PlatRoomBedDevice>().lambda()
.in(PlatRoomBedDevice::getRoomId, ids));
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment