From 46e7cd9daeb5072eb562317520307a1d60b1446e Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期四, 25 二月 2021 13:15:47 +0800 Subject: [PATCH] all --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java | 45 ++++++++++++++++++++++++++++++++------------- 1 files changed, 32 insertions(+), 13 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java index 694976f..ca18247 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructHouseServiceImpl.java @@ -8,6 +8,7 @@ import com.panzhihua.common.model.vos.community.BatchhouseVO; import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; +import com.panzhihua.common.model.vos.user.CommunityUserInfoVO; import com.panzhihua.service_community.dao.ComMngStructHouseDAO; import com.panzhihua.service_community.dao.ComMngStructHouseUserDAO; import com.panzhihua.service_community.model.dos.ComMngStructAreaDO; @@ -23,6 +24,7 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -48,19 +50,36 @@ @Override public R detailHouse(Long userId) { List<ComMngStructHouseVO> comMngStructHouseVOS = new ArrayList<>(); - List<ComMngStructHouseUserDO> comMngStructHouseUserDOS = comMngStructHouseUserDAO.selectList(new QueryWrapper<ComMngStructHouseUserDO>().lambda().eq(ComMngStructHouseUserDO::getUserId, userId)); - if (!ObjectUtils.isEmpty(comMngStructHouseUserDOS)) { - String areaCode = comMngStructHouseUserDOS.get(0).getAreaCode(); - ComMngStructHouseDO comMngStructHouseDO1 = comMngStructHouseDAO.selectOne(new QueryWrapper<ComMngStructHouseDO>().lambda().eq(ComMngStructHouseDO::getHouseCode, areaCode)); - String houseName = comMngStructHouseDO1.getHouseName(); - comMngStructHouseUserDOS.forEach(comMngStructHouseUserDO -> { - ComMngStructHouseDO comMngStructHouseDO = comMngStructHouseDAO.selectOne(new QueryWrapper<ComMngStructHouseDO>().lambda().eq(ComMngStructHouseDO::getHouseCode, comMngStructHouseUserDO.getHouseCode())); - ComMngStructHouseVO comMngStructHouseVO = new ComMngStructHouseVO(); - BeanUtils.copyProperties(comMngStructHouseDO, comMngStructHouseVO); - comMngStructHouseVO.setIdentity(comMngStructHouseUserDO.getIdentity()); - comMngStructHouseVOS.add(comMngStructHouseVO); - }); - return R.ok(comMngStructHouseVOS); + if ( userId< 100000000l) { + List<ComMngStructHouseUserDO> comMngStructHouseUserDOS = comMngStructHouseUserDAO.selectList(new QueryWrapper<ComMngStructHouseUserDO>().lambda().eq(ComMngStructHouseUserDO::getUserId, userId)); + if (!ObjectUtils.isEmpty(comMngStructHouseUserDOS)) { + String areaCode = comMngStructHouseUserDOS.get(0).getAreaCode(); + ComMngStructHouseDO comMngStructHouseDO1 = comMngStructHouseDAO.selectOne(new QueryWrapper<ComMngStructHouseDO>().lambda().eq(ComMngStructHouseDO::getHouseCode, areaCode)); + String houseName = comMngStructHouseDO1.getHouseName(); + comMngStructHouseUserDOS.forEach(comMngStructHouseUserDO -> { + ComMngStructHouseDO comMngStructHouseDO = comMngStructHouseDAO.selectOne(new QueryWrapper<ComMngStructHouseDO>().lambda().eq(ComMngStructHouseDO::getHouseCode, comMngStructHouseUserDO.getHouseCode())); + ComMngStructHouseVO comMngStructHouseVO = new ComMngStructHouseVO(); + BeanUtils.copyProperties(comMngStructHouseDO, comMngStructHouseVO); + comMngStructHouseVO.setIdentity(comMngStructHouseUserDO.getIdentity()); + comMngStructHouseVOS.add(comMngStructHouseVO); + }); + return R.ok(comMngStructHouseVOS); + } + }else{ + userId=userId-100000000l; +// 查导入人员的房屋 + Map<String,Object> map=comMngStructHouseUserDAO.selectHouseCode(userId); + String houseCode = map.get("house_code").toString(); + String isRent = map.get("is_rent").toString(); + ComMngStructHouseDO comMngStructHouseDO = comMngStructHouseDAO.selectOne(new QueryWrapper<ComMngStructHouseDO>().lambda().eq(ComMngStructHouseDO::getHouseCode, houseCode)); + ComMngStructHouseVO comMngStructHouseVO = new ComMngStructHouseVO(); + BeanUtils.copyProperties(comMngStructHouseDO, comMngStructHouseVO); + if (isRent.equals("1")) { + comMngStructHouseVO.setIdentity(1); + }else{ + comMngStructHouseVO.setIdentity(2); + } + comMngStructHouseVOS.add(comMngStructHouseVO); } return R.ok(comMngStructHouseVOS); } -- Gitblit v1.7.1