java110
2020-08-06 9718b4bba4af89d7da8dc50d51645348d613155c
加入费用导入逻辑
8个文件已修改
1个文件已添加
164 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/entity/assetImport/ImportRoomFee.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/RoomServiceDaoImplMapper.xml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/community/IRoomInnerServiceSMO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/api/RoomApi.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/IRoomServiceDao.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/impl/RoomServiceDaoImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/smo/impl/RoomInnerServiceSMOImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/api/FeeApi.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bmo/impl/ImportRoomFeeImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/entity/assetImport/ImportRoomFee.java
@@ -19,6 +19,8 @@
    private String amount;
    private String roomId;
    public String getFloorNum() {
        return floorNum;
@@ -75,4 +77,12 @@
    public void setAmount(String amount) {
        this.amount = amount;
    }
    public String getRoomId() {
        return roomId;
    }
    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }
}
java110-db/src/main/resources/mapper/community/RoomServiceDaoImplMapper.xml
@@ -723,4 +723,51 @@
            and bo.owner_type_cd= #{ownerTypeCd}
        </if>
    </select>
    <!-- 查询小区房屋信息 add by wuxw 2018-07-03 -->
    <select id="getRoomInfos" parameterType="Map" resultType="Map">
        SELECT t.unit_price,t.unit_price unitPrice,t.section,t.status_cd,t.status_cd statusCd,t.remark,t.user_id,
        t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.built_up_area,t.built_up_area builtUpArea,t.room_num,
        t.room_num roomNum,t.unit_id,t.unit_id unitId,t.b_id,t.b_id bId,t.apartment,t.state,u.`unit_num` unitNum
        FROM
        building_room t
        INNER JOIN building_unit u on t.`unit_id` = u.`unit_id` and u.`status_cd` = '0'
        INNER JOIN f_floor f on u.`floor_id` = f.`floor_id` and f.`community_id` = t.`community_id` and f.`status_cd` = '0'
        WHERE and t.status_cd= '0'
        <if test="floorId !=null and floorId != ''">
            and f.`floor_id`= #{floorId}
        </if>
        <if test="floorNum !=null and floorNum != ''">
            and f.`floor_num`= #{floorNum}
        </if>
        <if test="unitNum !=null and unitNum != ''">
            and u.`unit_num`= #{unitNum}
        </if>
        <if test="section !=null and section != ''">
            and t.section= #{section}
        </if>
        <if test="roomId !=null and roomId != ''">
            and t.room_id= #{roomId}
        </if>
        <if test="layer !=null and layer != ''">
            and t.layer= #{layer}
        </if>
        <if test="roomNum !=null and roomNum != ''">
            and t.room_num= #{roomNum}
        </if>
        <if test="unitId !=null and unitId != ''">
            and t.unit_id= #{unitId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="page != -1 and page != null">
            limit #{page},#{row}
        </if>
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/community/IRoomInnerServiceSMO.java
@@ -2,6 +2,7 @@
import com.java110.config.feign.FeignConfiguration;
import com.java110.dto.RoomDto;
import com.java110.entity.assetImport.ImportRoomFee;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -88,4 +89,14 @@
     */
    @RequestMapping(value = "/queryRoomsByOwner", method = RequestMethod.POST)
    List<RoomDto> queryRoomsByOwner(@RequestBody RoomDto roomDto);
    /**
     * <p>根据业主查询房屋信息</p>
     *
     *
     * @param importRoomFees 数据对象分享
     */
    @RequestMapping(value = "/freshRoomIds", method = RequestMethod.POST)
    List<ImportRoomFee> freshRoomIds(@RequestBody List<ImportRoomFee> importRoomFees);
}
service-community/src/main/java/com/java110/community/api/RoomApi.java
New file
@@ -0,0 +1,37 @@
package com.java110.community.api;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.utils.util.Assert;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
 * @ClassName RoomApi
 * @Description TODO
 * @Author wuxw
 * @Date 2020/8/6 23:27
 * @Version 1.0
 * add by wuxw 2020/8/6
 **/
@RestController
@RequestMapping(value = "/room")
public class RoomApi {
    /**
     * 查询房屋信息
     *
     * @param reqJson
     * @return
     * @path /room/getRoom
     */
    @RequestMapping(value = "/getRoom", method = RequestMethod.POST)
    public ResponseEntity<String> getRoom(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "code", "未包含小区ID");
        return null;
    }
}
service-community/src/main/java/com/java110/community/dao/IRoomServiceDao.java
@@ -136,4 +136,7 @@
     */
    List<Map> getRoomInfoWithSellByCommunityId(Map info);
    public List<Map> getRoomInfos(Map info);
}
service-community/src/main/java/com/java110/community/dao/impl/RoomServiceDaoImpl.java
@@ -203,6 +203,12 @@
        return businessRoomInfos;
    }
    public List<Map> getRoomInfos(Map info){
        logger.debug("查询小区房屋信息 getRoomInfos入参 info : {}", info);
        List<Map> businessRoomInfos = sqlSessionTemplate.selectList("roomServiceDaoImpl.getRoomInfos", info);
        return businessRoomInfos;
    }
}
service-community/src/main/java/com/java110/community/smo/impl/RoomInnerServiceSMOImpl.java
@@ -1,18 +1,19 @@
package com.java110.community.smo.impl;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.community.dao.IRoomAttrServiceDao;
import com.java110.community.dao.IRoomServiceDao;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.intf.community.IRoomInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.dto.PageDto;
import com.java110.dto.RoomAttrDto;
import com.java110.dto.RoomDto;
import com.java110.dto.user.UserDto;
import com.java110.entity.assetImport.ImportRoomFee;
import com.java110.intf.community.IRoomInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.BeanConvertUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -271,6 +272,25 @@
        return rooms;
    }
    /**
     * 刷新roomId
     *
     * @param importRoomFees 数据对象分享
     * @return
     */
    @Override
    public List<ImportRoomFee> freshRoomIds(@RequestBody List<ImportRoomFee> importRoomFees) {
        for (ImportRoomFee importRoomFee : importRoomFees) {
            List<Map> infos = roomServiceDaoImpl.getRoomInfos(BeanConvertUtil.beanCovertMap(importRoomFee));
            if (infos == null || infos.size() < 1) {
                continue;
            }
            importRoomFee.setRoomId(infos.get(0).get("roomId").toString());
        }
        return importRoomFees;
    }
    public IRoomServiceDao getRoomServiceDaoImpl() {
        return roomServiceDaoImpl;
    }
service-fee/src/main/java/com/java110/fee/api/FeeApi.java
@@ -6,6 +6,7 @@
import com.java110.core.factory.DataTransactionFactory;
import com.java110.dto.fee.FeeAttrDto;
import com.java110.dto.fee.FeeDto;
import com.java110.fee.bmo.IImportRoomFee;
import com.java110.fee.bmo.IPayOweFee;
import com.java110.fee.bmo.IQueryFeeByAttr;
import com.java110.fee.bmo.IQueryOweFee;
@@ -19,7 +20,11 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@@ -48,6 +53,9 @@
    @Autowired
    private IPayOweFee payOweFeeImpl;
    @Autowired
    private IImportRoomFee importRoomFeeImpl;
    @RequestMapping(path = "/service", method = RequestMethod.GET)
    public String serviceGet(HttpServletRequest request) {
@@ -215,7 +223,10 @@
     */
    @RequestMapping(value = "/importRoomFees", method = RequestMethod.POST)
    public ResponseEntity<String> importRoomFees(@RequestBody JSONObject reqJson) {
        return null;
        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
        Assert.hasKeyAndValue(reqJson, "feeTypeCd", "未包含费用类型");
        return importRoomFeeImpl.importFee(reqJson);
    }
}
service-fee/src/main/java/com/java110/fee/bmo/impl/ImportRoomFeeImpl.java
@@ -8,6 +8,7 @@
import com.java110.dto.fee.*;
import com.java110.dto.parking.ParkingSpaceDto;
import com.java110.dto.repair.RepairDto;
import com.java110.entity.assetImport.ImportRoomFee;
import com.java110.fee.bmo.IImportRoomFee;
import com.java110.fee.bmo.IPayOweFee;
import com.java110.fee.listener.fee.UpdateFeeInfoListener;
@@ -87,6 +88,10 @@
        JSONArray importRoomFees = reqJson.getJSONArray("importRoomFees");
        List<ImportRoomFee> tmpImportRoomFees = importRoomFees.toJavaList(ImportRoomFee.class);
        tmpImportRoomFees = roomInnerServiceSMOImpl.freshRoomIds(tmpImportRoomFees);
        JSONObject feeObj = null;
        for (int feeIndex = 0; feeIndex < importRoomFees.size(); feeIndex++) {