房屋加入有效期能力 修改可以修改结束时间 主要应付园区房屋租赁
4个文件已修改
148 ■■■■■ 已修改文件
service-community/src/main/java/com/java110/community/cmd/room/UpdateRoomCmd.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/smo/impl/RoomInnerServiceSMOImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/dao/impl/OwnerRoomRelV1ServiceDaoImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/dao/impl/OwnerServiceDaoImpl.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/room/UpdateRoomCmd.java
@@ -9,6 +9,7 @@
import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.doc.annotation.*;
import com.java110.dto.room.RoomDto;
import com.java110.dto.unit.UnitDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.intf.community.*;
@@ -17,10 +18,7 @@
import com.java110.po.room.RoomAttrPo;
import com.java110.po.room.RoomPo;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.DateUtil;
import com.java110.utils.util.StringUtil;
import com.java110.utils.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@@ -110,7 +108,7 @@
        }
        //获取房屋状态
        String state = reqJson.getString("state");
        if (!StringUtil.isEmpty(state) && state.equals("2006")) { //已出租
        if (RoomDto.STATE_SHOP_FIRE.equals(state)) { //已出租
            //获取起租时间
            Date startTime = null;
            Date endTime = null;
@@ -132,7 +130,7 @@
        unitDto.setUnitId(reqJson.getString("unitId"));
        //校验小区楼ID和小区是否有对应关系
        List<UnitDto> units = unitInnerServiceSMOImpl.queryUnitsByCommunityId(unitDto);
        if (units == null || units.size() < 1) {
        if (ListUtil.isNull(units)) {
            throw new IllegalArgumentException("传入单元ID不是该小区的单元");
        }
        Assert.judgeAttrValue(reqJson);
@@ -142,16 +140,10 @@
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        updateShellRoom(reqJson, cmdDataFlowContext);
        String state = reqJson.getString("state");
        if (!StringUtil.isEmpty(state) && state.equals("2006")) { //已出租
            OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
            ownerRoomRelDto.setRoomId(reqJson.getString("roomId"));
            List<OwnerRoomRelDto> ownerRoomRelDtoList = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
            OwnerRoomRelPo ownerRoomRelPo = BeanConvertUtil.covertBean(ownerRoomRelDtoList.get(0), OwnerRoomRelPo.class);
            ownerRoomRelPo.setStartTime(reqJson.getString("startTime"));
            ownerRoomRelPo.setEndTime(reqJson.getString("endTime") + " 23:59:59");
            ownerRoomRelInnerServiceSMOImpl.updateOwnerRoomRels(ownerRoomRelPo);
        }
        // todo 修改租期
        modifyRoomRateTime(reqJson,cmdDataFlowContext);
        if (!reqJson.containsKey("attrs")) {
            return;
        }
@@ -189,6 +181,34 @@
    }
    /**
     * 修改租期
     * @param reqJson
     * @param cmdDataFlowContext
     */
    private void modifyRoomRateTime(JSONObject reqJson, ICmdDataFlowContext cmdDataFlowContext) {
        OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
        ownerRoomRelDto.setRoomId(reqJson.getString("roomId"));
        List<OwnerRoomRelDto> ownerRoomRelDtoList = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
        if(ListUtil.isNull(ownerRoomRelDtoList)){
            return ;
        }
        String state = reqJson.getString("state");
        if (RoomDto.STATE_SHOP_FIRE.equals(state)) { //已出租
            OwnerRoomRelPo ownerRoomRelPo = BeanConvertUtil.covertBean(ownerRoomRelDtoList.get(0), OwnerRoomRelPo.class);
            ownerRoomRelPo.setStartTime(reqJson.getString("startTime"));
            ownerRoomRelPo.setEndTime(reqJson.getString("endTime") + " 23:59:59");
            ownerRoomRelInnerServiceSMOImpl.updateOwnerRoomRels(ownerRoomRelPo);
            return;
        }
        String endTime = reqJson.getString("endTime");
        if(!StringUtil.isEmpty(endTime)){
            OwnerRoomRelPo ownerRoomRelPo = BeanConvertUtil.covertBean(ownerRoomRelDtoList.get(0), OwnerRoomRelPo.class);
            ownerRoomRelPo.setEndTime(endTime + " 23:59:59");
            ownerRoomRelInnerServiceSMOImpl.updateOwnerRoomRels(ownerRoomRelPo);
        }
    }
    /**
     * 添加小区楼信息
     *
     * @param paramInJson        接口调用放传入入参
service-community/src/main/java/com/java110/community/smo/impl/RoomInnerServiceSMOImpl.java
@@ -17,10 +17,7 @@
import com.java110.po.room.RoomPo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.ListUtil;
import com.java110.utils.util.StringUtil;
import com.java110.utils.util.*;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
@@ -128,7 +125,7 @@
            }
        }
        if (roomAttrDtos == null || roomAttrDtos.size() == 0) {
        if (ListUtil.isNull(roomAttrDtos)) {
            return;
        }
@@ -270,19 +267,12 @@
    @Override
    public List<RoomDto> queryRoomsByOwner(@RequestBody RoomDto roomDto) {
//        List<RoomDto> rooms = BeanConvertUtil.covertBeanList(roomServiceDaoImpl.getRoomInfoByOwner(BeanConvertUtil.beanCovertMap(roomDto)),
//                RoomDto.class);
//
//        if (rooms == null || rooms.size() == 0) {
//            return rooms;
//        }
        OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
        ownerRoomRelDto.setOwnerId(roomDto.getOwnerId());
        ownerRoomRelDto.setOwnerNameLike(roomDto.getOwnerNameLike());
        ownerRoomRelDto.setStatusCd(roomDto.getStatusCd());
        List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
        if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
        if (ListUtil.isNull(ownerRoomRelDtos)) {
            return new ArrayList<>();
        }
@@ -296,7 +286,21 @@
        tmpRoomDto.setRoomIds(roomIds.toArray(new String[roomIds.size()]));
        tmpRoomDto.setRoomNum(roomDto.getRoomNum());
        tmpRoomDto.setCommunityId(roomDto.getCommunityId());
        return queryRooms(tmpRoomDto);
        List<RoomDto> roomDtos = queryRooms(tmpRoomDto);
        if(ListUtil.isNull(roomDtos)){
            return roomDtos;
        }
        for (OwnerRoomRelDto tmpOwnerRoomRelDto : ownerRoomRelDtos) {
            for(RoomDto tRoomDto:roomDtos){
                if(!tmpOwnerRoomRelDto.getRoomId().equals(tRoomDto.getRoomId())){
                    continue;
                }
                tRoomDto.setStartTime(tmpOwnerRoomRelDto.getStartTime());
                tRoomDto.setEndTime(tmpOwnerRoomRelDto.getEndTime());
            }
        }
        return roomDtos;
    }
service-user/src/main/java/com/java110/user/dao/impl/OwnerRoomRelV1ServiceDaoImpl.java
@@ -66,9 +66,9 @@
    public List<Map> getOwnerRoomRelInfo(Map info) throws DAOException {
        logger.debug("查询 getOwnerRoomRelInfo 入参 info : {}", info);
        List<Map> businessOwnerRoomRelInfos = sqlSessionTemplate.selectList("ownerRoomRelV1ServiceDaoImpl.getOwnerRoomRelInfo", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerRoomRelV1ServiceDaoImpl.getOwnerRoomRelInfo", info);
        return businessOwnerRoomRelInfos;
        return infos;
    }
@@ -97,12 +97,12 @@
    public int queryOwnerRoomRelsCount(Map info) {
        logger.debug("查询 queryOwnerRoomRelsCount 入参 info : {}", info);
        List<Map> businessOwnerRoomRelInfos = sqlSessionTemplate.selectList("ownerRoomRelV1ServiceDaoImpl.queryOwnerRoomRelsCount", info);
        if (businessOwnerRoomRelInfos.size() < 1) {
        List<Map> infos = sqlSessionTemplate.selectList("ownerRoomRelV1ServiceDaoImpl.queryOwnerRoomRelsCount", info);
        if (infos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOwnerRoomRelInfos.get(0).get("count").toString());
        return Integer.parseInt(infos.get(0).get("count").toString());
    }
    @Override
service-user/src/main/java/com/java110/user/dao/impl/OwnerServiceDaoImpl.java
@@ -54,9 +54,9 @@
        logger.debug("查询业主信息 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getBusinessOwnerInfo", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getBusinessOwnerInfo", info);
        return businessOwnerInfos;
        return infos;
    }
@@ -89,9 +89,9 @@
    public List<Map> getOwnerInfo(Map info) throws DAOException {
        logger.debug("查询业主信息 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfo", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfo", info);
        return businessOwnerInfos;
        return infos;
    }
    /**
@@ -104,12 +104,12 @@
    @Override
    public int getOwnerInfoCount(Map info) throws DAOException {
        logger.debug("查询业主信息 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfoCount", info);
        if (businessOwnerInfos.size() < 1) {
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfoCount", info);
        if (infos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOwnerInfos.get(0).get("count").toString());
        return Integer.parseInt(infos.get(0).get("count").toString());
    }
@@ -140,12 +140,12 @@
    public int queryOwnersCount(Map info) {
        logger.debug("查询业主数据 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersCount", info);
        if (businessOwnerInfos.size() < 1) {
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersCount", info);
        if (infos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOwnerInfos.get(0).get("count").toString());
        return Integer.parseInt(infos.get(0).get("count").toString());
    }
    /**
@@ -158,12 +158,12 @@
    public int queryOwnersCountByCondition(Map info) {
        logger.debug("查询业主数据 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersCountByCondition", info);
        if (businessOwnerInfos.size() < 1) {
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersCountByCondition", info);
        if (infos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOwnerInfos.get(0).get("count").toString());
        return Integer.parseInt(infos.get(0).get("count").toString());
    }
    /**
@@ -177,60 +177,60 @@
    public List<Map> getOwnerInfoByCondition(Map info) throws DAOException {
        logger.debug("查询业主信息 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfoByCondition", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfoByCondition", info);
        return businessOwnerInfos;
        return infos;
    }
    @Override
    public int queryNoEnterRoomOwnerCount(Map info) {
        logger.debug("查询业主数据 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryNoEnterRoomOwnerCount", info);
        if (businessOwnerInfos.size() < 1) {
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryNoEnterRoomOwnerCount", info);
        if (infos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOwnerInfos.get(0).get("count").toString());
        return Integer.parseInt(infos.get(0).get("count").toString());
    }
    @Override
    public List<Map> queryOwnersByRoom(Map info) throws DAOException {
        logger.debug("queryOwnersByRoom 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersByRoom", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersByRoom", info);
        return businessOwnerInfos;
        return infos;
    }
    @Override
    public List<Map> queryOwnersByParkingSpace(Map info) throws DAOException {
        logger.debug("queryOwnersByParkingSpace 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersByParkingSpace", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnersByParkingSpace", info);
        return businessOwnerInfos;
        return infos;
    }
    @Override
    public int queryOwnerLogsCountByRoom(Map info) {
        logger.debug("查询业主数据 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnerLogsCountByRoom", info);
        if (businessOwnerInfos.size() < 1) {
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnerLogsCountByRoom", info);
        if (infos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOwnerInfos.get(0).get("count").toString());
        return Integer.parseInt(infos.get(0).get("count").toString());
    }
    @Override
    public List<Map> queryOwnerLogsByRoom(Map info) {
        logger.debug("queryOwnerLogsByRoom 入参 info : {}", info);
        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnerLogsByRoom", info);
        List<Map> infos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.queryOwnerLogsByRoom", info);
        return businessOwnerInfos;
        return infos;
    }