Explorar o código

优化费用模板

java110 %!s(int64=4) %!d(string=hai) anos
pai
achega
cf8e310e60

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/RoomDto.java

@@ -47,6 +47,7 @@ public class RoomDto extends PageDto implements Serializable {
     private String apartmentName;
     private String communityId;
     private String floorId;
+    private String[] floorIds;
     private String floorNum;
     private String floorArea;
     private String userName;
@@ -390,4 +391,12 @@ public class RoomDto extends PageDto implements Serializable {
     public void setOweAmount(String oweAmount) {
         this.oweAmount = oweAmount;
     }
+
+    public String[] getFloorIds() {
+        return floorIds;
+    }
+
+    public void setFloorIds(String[] floorIds) {
+        this.floorIds = floorIds;
+    }
 }

+ 6 - 0
java110-db/src/main/resources/mapper/community/ParkingSpaceServiceDaoImplMapper.xml

@@ -175,6 +175,12 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="paIds != null ">
+                and t.pa_id in
+                <foreach collection="paIds" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
             <if test="communityId !=null and communityId != ''">
                 and t.community_id= #{communityId}
             </if>

+ 204 - 176
java110-db/src/main/resources/mapper/community/RoomV1ServiceDaoImplMapper.xml

@@ -5,201 +5,229 @@
 <mapper namespace="roomV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存房屋信息 add by wuxw 2018-07-03 -->
     <insert id="saveRoomInfo" parameterType="Map">
         insert into building_room(
-section,remark,room_sub_type,room_area,user_id,room_id,layer,fee_coefficient,built_up_area,room_num,unit_id,state,community_id,apartment,room_type,room_rent
-) values (
-#{section},#{remark},#{roomSubType},#{roomArea},#{userId},#{roomId},#{layer},#{feeCoefficient},#{builtUpArea},#{roomNum},#{unitId},#{state},#{communityId},#{apartment},#{roomType},#{roomRent}
-)
+        section,remark,room_sub_type,room_area,user_id,room_id,layer,fee_coefficient,built_up_area,room_num,unit_id,state,community_id,apartment,room_type,room_rent
+        ) values (
+        #{section},#{remark},#{roomSubType},#{roomArea},#{userId},#{roomId},#{layer},#{feeCoefficient},#{builtUpArea},#{roomNum},#{unitId},#{state},#{communityId},#{apartment},#{roomType},#{roomRent}
+        )
     </insert>
 
 
-
     <!-- 查询房屋信息 add by wuxw 2018-07-03 -->
     <select id="getRoomInfo" parameterType="Map" resultType="Map">
-        select  t.section,t.remark,t.status_cd,t.status_cd statusCd,t.room_sub_type,t.room_sub_type roomSubType,t.room_area,t.room_area roomArea,t.user_id,t.user_id userId,t.room_id,t.room_id roomId,t.layer,t.fee_coefficient,t.fee_coefficient feeCoefficient,t.built_up_area,t.built_up_area builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.state,t.community_id,t.community_id communityId,t.apartment,t.room_type,t.room_type roomType,t.room_rent,t.room_rent roomRent 
-from building_room t 
-where 1 =1 
-<if test="section !=null and section != ''">
-   and t.section= #{section}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="roomSubType !=null and roomSubType != ''">
-   and t.room_sub_type= #{roomSubType}
-</if> 
-<if test="roomArea !=null and roomArea != ''">
-   and t.room_area= #{roomArea}
-</if> 
-<if test="userId !=null and userId != ''">
-   and t.user_id= #{userId}
-</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="feeCoefficient !=null and feeCoefficient != ''">
-   and t.fee_coefficient= #{feeCoefficient}
-</if> 
-<if test="builtUpArea !=null and builtUpArea != ''">
-   and t.built_up_area= #{builtUpArea}
-</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="apartment !=null and apartment != ''">
-   and t.apartment= #{apartment}
-</if> 
-<if test="roomType !=null and roomType != ''">
-   and t.room_type= #{roomType}
-</if> 
-<if test="roomRent !=null and roomRent != ''">
-   and t.room_rent= #{roomRent}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.section,t.remark,t.status_cd,t.status_cd statusCd,t.room_sub_type,t.room_sub_type
+        roomSubType,t.room_area,t.room_area roomArea,t.user_id,t.user_id userId,t.room_id,t.room_id
+        roomId,t.layer,t.fee_coefficient,t.fee_coefficient feeCoefficient,t.built_up_area,t.built_up_area
+        builtUpArea,t.room_num,t.room_num roomNum,t.unit_id,t.unit_id unitId,t.state,t.community_id,t.community_id
+        communityId,t.apartment,t.room_type,t.room_type roomType,t.room_rent,t.room_rent roomRent,f.floor_num floorNum,bu.unit_num unitNum
+        from building_room t
+        left join  building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+        where 1 =1
+        <if test="section !=null and section != ''">
+            and t.section= #{section}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="unitId !=null and unitId != ''">
+            and bu.unit_id= #{unitId}
+        </if>
+        <if test="floorId !=null and floorId != ''">
+            and f.floor_id= #{floorId}
+        </if>
+        <if test="floorIds !=null ">
+            and f.floor_id in
+            <foreach collection="floorIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="roomSubType !=null and roomSubType != ''">
+            and t.room_sub_type= #{roomSubType}
+        </if>
+        <if test="roomArea !=null and roomArea != ''">
+            and t.room_area= #{roomArea}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </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="feeCoefficient !=null and feeCoefficient != ''">
+            and t.fee_coefficient= #{feeCoefficient}
+        </if>
+        <if test="builtUpArea !=null and builtUpArea != ''">
+            and t.built_up_area= #{builtUpArea}
+        </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="apartment !=null and apartment != ''">
+            and t.apartment= #{apartment}
+        </if>
+        <if test="roomType !=null and roomType != ''">
+            and t.room_type= #{roomType}
+        </if>
+        <if test="roomRent !=null and roomRent != ''">
+            and t.room_rent= #{roomRent}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改房屋信息 add by wuxw 2018-07-03 -->
     <update id="updateRoomInfo" parameterType="Map">
-        update  building_room t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="section !=null and section != ''">
-, t.section= #{section}
-</if> 
-<if test="remark !=null and remark != ''">
-, t.remark= #{remark}
-</if> 
-<if test="roomSubType !=null and roomSubType != ''">
-, t.room_sub_type= #{roomSubType}
-</if> 
-<if test="roomArea !=null and roomArea != ''">
-, t.room_area= #{roomArea}
-</if> 
-<if test="userId !=null and userId != ''">
-, t.user_id= #{userId}
-</if> 
-<if test="layer !=null and layer != ''">
-, t.layer= #{layer}
-</if> 
-<if test="feeCoefficient !=null and feeCoefficient != ''">
-, t.fee_coefficient= #{feeCoefficient}
-</if> 
-<if test="builtUpArea !=null and builtUpArea != ''">
-, t.built_up_area= #{builtUpArea}
-</if> 
-<if test="roomNum !=null and roomNum != ''">
-, t.room_num= #{roomNum}
-</if> 
-<if test="unitId !=null and unitId != ''">
-, t.unit_id= #{unitId}
-</if> 
-<if test="state !=null and state != ''">
-, t.state= #{state}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
-<if test="apartment !=null and apartment != ''">
-, t.apartment= #{apartment}
-</if> 
-<if test="roomType !=null and roomType != ''">
-, t.room_type= #{roomType}
-</if> 
-<if test="roomRent !=null and roomRent != ''">
-, t.room_rent= #{roomRent}
-</if> 
- where 1=1 <if test="roomId !=null and roomId != ''">
-and t.room_id= #{roomId}
-</if> 
+        update building_room t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="section !=null and section != ''">
+            , t.section= #{section}
+        </if>
+        <if test="remark !=null and remark != ''">
+            , t.remark= #{remark}
+        </if>
+        <if test="roomSubType !=null and roomSubType != ''">
+            , t.room_sub_type= #{roomSubType}
+        </if>
+        <if test="roomArea !=null and roomArea != ''">
+            , t.room_area= #{roomArea}
+        </if>
+        <if test="userId !=null and userId != ''">
+            , t.user_id= #{userId}
+        </if>
+        <if test="layer !=null and layer != ''">
+            , t.layer= #{layer}
+        </if>
+        <if test="feeCoefficient !=null and feeCoefficient != ''">
+            , t.fee_coefficient= #{feeCoefficient}
+        </if>
+        <if test="builtUpArea !=null and builtUpArea != ''">
+            , t.built_up_area= #{builtUpArea}
+        </if>
+        <if test="roomNum !=null and roomNum != ''">
+            , t.room_num= #{roomNum}
+        </if>
+        <if test="unitId !=null and unitId != ''">
+            , t.unit_id= #{unitId}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="apartment !=null and apartment != ''">
+            , t.apartment= #{apartment}
+        </if>
+        <if test="roomType !=null and roomType != ''">
+            , t.room_type= #{roomType}
+        </if>
+        <if test="roomRent !=null and roomRent != ''">
+            , t.room_rent= #{roomRent}
+        </if>
+        where 1=1
+        <if test="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
 
     </update>
 
     <!-- 查询房屋数量 add by wuxw 2018-07-03 -->
-     <select id="queryRoomsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from building_room t 
-where 1 =1 
-<if test="section !=null and section != ''">
-   and t.section= #{section}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="roomSubType !=null and roomSubType != ''">
-   and t.room_sub_type= #{roomSubType}
-</if> 
-<if test="roomArea !=null and roomArea != ''">
-   and t.room_area= #{roomArea}
-</if> 
-<if test="userId !=null and userId != ''">
-   and t.user_id= #{userId}
-</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="feeCoefficient !=null and feeCoefficient != ''">
-   and t.fee_coefficient= #{feeCoefficient}
-</if> 
-<if test="builtUpArea !=null and builtUpArea != ''">
-   and t.built_up_area= #{builtUpArea}
-</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="apartment !=null and apartment != ''">
-   and t.apartment= #{apartment}
-</if> 
-<if test="roomType !=null and roomType != ''">
-   and t.room_type= #{roomType}
-</if> 
-<if test="roomRent !=null and roomRent != ''">
-   and t.room_rent= #{roomRent}
-</if> 
+    <select id="queryRoomsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from building_room t
+        from building_room t
+        left join  building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        left join f_floor f on bu.floor_id = f.floor_id and f.status_cd = '0'
+        where 1 =1
+        <if test="unitId !=null and unitId != ''">
+            and bu.unit_id= #{unitId}
+        </if>
+        <if test="floorId !=null and floorId != ''">
+            and f.floor_id= #{floorId}
+        </if>
+        <if test="floorIds !=null ">
+            and f.floor_id in
+            <foreach collection="floorIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="section !=null and section != ''">
+            and t.section= #{section}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="roomSubType !=null and roomSubType != ''">
+            and t.room_sub_type= #{roomSubType}
+        </if>
+        <if test="roomArea !=null and roomArea != ''">
+            and t.room_area= #{roomArea}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </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="feeCoefficient !=null and feeCoefficient != ''">
+            and t.fee_coefficient= #{feeCoefficient}
+        </if>
+        <if test="builtUpArea !=null and builtUpArea != ''">
+            and t.built_up_area= #{builtUpArea}
+        </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="apartment !=null and apartment != ''">
+            and t.apartment= #{apartment}
+        </if>
+        <if test="roomType !=null and roomType != ''">
+            and t.room_type= #{roomType}
+        </if>
+        <if test="roomRent !=null and roomRent != ''">
+            and t.room_rent= #{roomRent}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 14 - 0
java110-db/src/main/resources/mapper/fee/PayFeeConfigV1ServiceDaoImplMapper.xml

@@ -54,6 +54,13 @@
         <if test="configId !=null and configId != ''">
             and t.config_id= #{configId}
         </if>
+        <if test="configIds !=null">
+            and t.config_id in
+            <foreach collection="configIds" open="(" close=")"
+                     separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
         <if test="feeFlag !=null and feeFlag != ''">
             and t.fee_flag= #{feeFlag}
         </if>
@@ -170,6 +177,13 @@
         <if test="configId !=null and configId != ''">
             and t.config_id= #{configId}
         </if>
+        <if test="configIds !=null">
+            and t.config_id in
+            <foreach collection="configIds" open="(" close=")"
+                     separator="," item="item">
+                #{item}
+            </foreach>
+        </if>
         <if test="feeFlag !=null and feeFlag != ''">
             and t.fee_flag= #{feeFlag}
         </if>

+ 55 - 0
service-api/src/main/java/com/java110/api/components/assetImport/ImportAndExportFeeComponent.java

@@ -0,0 +1,55 @@
+package com.java110.api.components.assetImport;
+
+import com.java110.api.smo.assetExport.IExportRoomSMO;
+import com.java110.api.smo.assetImport.IImportRoomFeeSMO;
+import com.java110.core.context.IPageData;
+import com.java110.core.context.PageData;
+import com.java110.core.log.LoggerFactory;
+import com.java110.dto.app.AppDto;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 添加应用组件
+ */
+@Component("importAndExportFee")
+public class ImportAndExportFeeComponent {
+
+    private final static Logger logger = LoggerFactory.getLogger(ImportAndExportFeeComponent.class);
+
+
+    @Autowired
+    private IImportRoomFeeSMO importRoomFeeSMOImpl;
+
+    @Autowired
+    private IExportRoomSMO exportRoomSMOImpl;
+
+    /**
+     * 添加应用数据
+     *
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<String> importData(IPageData pd, MultipartFile uploadFile) throws Exception {
+
+        return importRoomFeeSMOImpl.importExcelData(pd, uploadFile);
+    }
+
+
+    /**
+     * 添加应用数据
+     *
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<Object> exportData(IPageData pd) throws Exception {
+        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), pd.getReqData(), pd.getComponentCode(), pd.getComponentMethod(), "",
+                pd.getSessionId(), AppDto.WEB_APP_ID, pd.getHeaders());
+        return exportRoomSMOImpl.exportRoomExcelData(newPd);
+    }
+
+
+}

+ 9 - 0
service-api/src/main/java/com/java110/api/smo/assetExport/IExportRoomSMO.java

@@ -15,8 +15,17 @@ public interface IExportRoomSMO {
 
     /**
      * 导入excel数据
+     *
      * @param pd 前台数据封装
      * @return ResponseEntity
      */
     public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception;
+
+    /**
+     * 导入房屋资产excel数据
+     *
+     * @param pd 前台数据封装
+     * @return ResponseEntity
+     */
+     ResponseEntity<Object> exportRoomExcelData(IPageData pd) throws Exception;
 }

+ 177 - 4
service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportRoomSMOImpl.java

@@ -3,19 +3,23 @@ package com.java110.api.smo.assetExport.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.api.smo.DefaultAbstractComponentSMO;
-import com.java110.core.component.BaseComponentSMO;
+import com.java110.api.smo.assetExport.IExportRoomSMO;
 import com.java110.core.context.IPageData;
+import com.java110.core.log.LoggerFactory;
+import com.java110.dto.RoomDto;
+import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.fee.FeeDto;
+import com.java110.dto.parking.ParkingSpaceDto;
 import com.java110.entity.component.ComponentValidateResult;
-import com.java110.api.smo.assetExport.IExportRoomSMO;
-import com.java110.utils.constant.ServiceConstant;
+import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.intf.fee.IPayFeeConfigV1InnerServiceSMO;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.DateUtil;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -27,6 +31,7 @@ import org.springframework.web.client.RestTemplate;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.util.List;
 
 /**
  * @ClassName AssetImportSmoImpl
@@ -40,9 +45,22 @@ import java.io.IOException;
 public class ExportRoomSMOImpl extends DefaultAbstractComponentSMO implements IExportRoomSMO {
     private final static Logger logger = LoggerFactory.getLogger(ExportRoomSMOImpl.class);
 
+    public static final String TYPE_ROOM = "1001";
+    public static final String TYPE_PARKSPACE = "2002";
+    public static final String TYPE_CONTRACT = "3003"; //合同
+
     @Autowired
     private RestTemplate restTemplate;
 
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IPayFeeConfigV1InnerServiceSMO payFeeConfigV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
+
     @Override
     public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception {
 
@@ -88,6 +106,161 @@ public class ExportRoomSMOImpl extends DefaultAbstractComponentSMO implements IE
         return new ResponseEntity<Object>(context, headers, HttpStatus.OK);
     }
 
+    /**
+     * 导出房产信息
+     *
+     * @param pd 前台数据封装
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public ResponseEntity<Object> exportRoomExcelData(IPageData pd) throws Exception {
+        ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
+
+        Assert.hasKeyAndValue(paramIn, "communityId", "请求中未包含小区");
+        //Assert.hasKeyAndValue(paramIn, "floorIds", "请求中未包含楼栋");
+        Assert.hasKeyAndValue(paramIn, "configIds", "请求中未包含费用项");
+        Assert.hasKeyAndValue(paramIn, "type", "请求中未包含类型");
+
+        Workbook workbook = null;  //工作簿
+        //工作表
+        workbook = new XSSFWorkbook();
+
+        //查询资产和费用项
+        if (TYPE_ROOM.equals(paramIn.getString("type"))) {
+            getRoomAndConfigs(paramIn, workbook);
+        } else if (TYPE_PARKSPACE.equals(paramIn.getString("type"))) {
+            getParkspaceAndConfigs(paramIn, workbook);
+        }
+
+
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        MultiValueMap headers = new HttpHeaders();
+        headers.add("content-type", "application/octet-stream;charset=UTF-8");
+        headers.add("Content-Disposition", "attachment;filename=customImport_" + DateUtil.getyyyyMMddhhmmssDateString() + ".xlsx");
+        headers.add("Pargam", "no-cache");
+        headers.add("Cache-Control", "no-cache");
+        //headers.add("Content-Disposition", "attachment; filename=" + outParam.getString("fileName"));
+        headers.add("Accept-Ranges", "bytes");
+        byte[] context = null;
+        try {
+            workbook.write(os);
+            context = os.toByteArray();
+            os.close();
+            workbook.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+            // 保存数据
+            return new ResponseEntity<Object>("导出失败", HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+        // 保存数据
+        return new ResponseEntity<Object>(context, headers, HttpStatus.OK);
+    }
+
+    private void getParkspaceAndConfigs(JSONObject paramIn, Workbook workbook) {
+        Sheet sheet = workbook.createSheet("创建费用");
+        Row row = sheet.createRow(0);
+        Cell cell0 = row.createCell(0);
+        cell0.setCellValue("费用名称: 请填写系统中费用类型,如物业费,押金等 ;\n计费起始时间: " +
+                "计费起始时间时间,格式为YYYY-MM-DD;\n建账时间: 建账时间,格式为YYYY-MM-DD; \n 类型:表明是合同 房屋 还是车辆 房屋 1001 车辆 2002 合同 3003" +
+                "\n注意:所有单元格式为文本");
+        CellStyle cs = workbook.createCellStyle();
+        cs.setWrapText(true);  //关键
+        cell0.setCellStyle(cs);
+        row.setHeight((short) (200 * 10));
+        row = sheet.createRow(1);
+        row.createCell(0).setCellValue("房号/车牌号");
+        row.createCell(1).setCellValue("类型");
+        row.createCell(2).setCellValue("费用项ID");
+        row.createCell(3).setCellValue("收费项目");
+        row.createCell(4).setCellValue("建账时间");
+        row.createCell(5).setCellValue("计费起始时间");
+
+        ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
+        parkingSpaceDto.setCommunityId(paramIn.getString("communityId"));
+        parkingSpaceDto.setPsIds(paramIn.getString("psIds").split(","));
+        List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto);
+
+        if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) {
+            return;
+        }
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setConfigIds(paramIn.getString("configIds").split(","));
+        feeConfigDto.setCommunityId(paramIn.getString("communityId"));
+        List<FeeConfigDto> feeConfigDtos = payFeeConfigV1InnerServiceSMOImpl.queryPayFeeConfigs(feeConfigDto);
+
+        if (feeConfigDtos == null || feeConfigDtos.size() < 1) {
+            return;
+        }
+
+        int roomIndex = 2;
+        for (ParkingSpaceDto tmpParkingSpaceDto : parkingSpaceDtos) {
+            for (FeeConfigDto tmpFeeConfigDto : feeConfigDtos) {
+                row = sheet.createRow(roomIndex);
+                row.createCell(0).setCellValue(tmpParkingSpaceDto.getAreaNum() + "-" + tmpParkingSpaceDto.getNum());
+                row.createCell(1).setCellValue("2002");
+                row.createCell(2).setCellValue(tmpFeeConfigDto.getConfigId());
+                row.createCell(3).setCellValue(tmpFeeConfigDto.getFeeName());
+                row.createCell(4).setCellValue("");
+                row.createCell(5).setCellValue("");
+                roomIndex += 1;
+            }
+        }
+    }
+
+    private void getRoomAndConfigs(JSONObject paramIn, Workbook workbook) {
+        Sheet sheet = workbook.createSheet("创建费用");
+        Row row = sheet.createRow(0);
+        Cell cell0 = row.createCell(0);
+        cell0.setCellValue("费用名称: 请填写系统中费用类型,如物业费,押金等 ;\n计费起始时间: " +
+                "计费起始时间时间,格式为YYYY-MM-DD;\n建账时间: 建账时间,格式为YYYY-MM-DD; \n 类型:表明是合同 房屋 还是车辆 房屋 1001 车辆 2002 合同 3003" +
+                "\n注意:所有单元格式为文本");
+        CellStyle cs = workbook.createCellStyle();
+        cs.setWrapText(true);  //关键
+        cell0.setCellStyle(cs);
+        row.setHeight((short) (200 * 10));
+        row = sheet.createRow(1);
+        row.createCell(0).setCellValue("房号/车牌号");
+        row.createCell(1).setCellValue("类型");
+        row.createCell(2).setCellValue("费用项ID");
+        row.createCell(3).setCellValue("收费项目");
+        row.createCell(4).setCellValue("建账时间");
+        row.createCell(5).setCellValue("计费起始时间");
+
+        RoomDto roomDto = new RoomDto();
+        roomDto.setCommunityId(paramIn.getString("communityId"));
+        roomDto.setFloorIds(paramIn.getString("floorIds").split(","));
+        List<RoomDto> roomDtos = roomV1InnerServiceSMOImpl.queryRooms(roomDto);
+
+        if (roomDtos == null || roomDtos.size() < 1) {
+            return;
+        }
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setConfigIds(paramIn.getString("configIds").split(","));
+        feeConfigDto.setCommunityId(paramIn.getString("communityId"));
+        List<FeeConfigDto> feeConfigDtos = payFeeConfigV1InnerServiceSMOImpl.queryPayFeeConfigs(feeConfigDto);
+
+        if (feeConfigDtos == null || feeConfigDtos.size() < 1) {
+            return;
+        }
+
+        int roomIndex = 2;
+        for (RoomDto tmpRoomDto : roomDtos) {
+            for (FeeConfigDto tmpFeeConfigDto : feeConfigDtos) {
+                row = sheet.createRow(roomIndex);
+                row.createCell(0).setCellValue(tmpRoomDto.getFloorNum() + "-" + tmpRoomDto.getUnitNum() + "-" + tmpRoomDto.getRoomNum());
+                row.createCell(1).setCellValue("1001");
+                row.createCell(2).setCellValue(tmpFeeConfigDto.getConfigId());
+                row.createCell(3).setCellValue(tmpFeeConfigDto.getFeeName());
+                row.createCell(4).setCellValue("");
+                row.createCell(5).setCellValue("");
+                roomIndex += 1;
+            }
+        }
+    }
+
     /**
      * 查询车辆
      *