Bläddra i källkod

加入报表功能

java110 5 år sedan
förälder
incheckning
f0d00580d3

+ 493 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportFeeDto.java

@@ -0,0 +1,493 @@
+package com.java110.dto.report;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName ReportRoomDto
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:20
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+public class ReportFeeDto extends PageDto implements Serializable {
+    private String amount;
+    private String incomeObjId;
+    private String incomeObjName;
+    private String feeTypeCd;
+    private Date startTime;
+    private Date endTime;
+    private String communityId;
+    private String feeId;
+    private String userId;
+    private String payerObjId;
+    private String payerObjName;
+    private String configId;
+
+    private String squarePrice;
+    private String additionalAmount;
+    private String state;
+    private String stateName;
+    private String feeFlag;
+
+    private String feeName;
+    private String feeTypeCdName;
+    private String feeFlagName;
+
+    private double feePrice;
+    private String payerObjType;
+    private String computingFormula;
+    private String isDefault;
+    private double oweFee; // 欠费金额
+    private String billType;
+    private String billTypeName;
+
+    private String paymentCd;
+
+    private String paymentCycle;
+
+    private String importFeeName;
+
+    private String amountOwed;
+
+    private String roomName;
+
+    private String ownerName;
+
+    private String ownerTel;
+
+
+    private Date createTime;
+
+    /**
+     * 费用项开始时间
+     */
+    private Date configStartTime;
+    /**
+     * 费用项结束时间
+     */
+    private Date configEndTime;
+
+    private Date deadlineTime;
+
+    private Date importFeeEndTime;
+
+
+    private String curDegrees;
+    private String preDegrees;
+
+    private Date preReadingTime;
+    private Date curReadingTime;
+
+    private String roomId;
+    private String roomNum;
+    private String carId;
+    private String carNum;
+    private String storeId;
+    private String storeName;
+    private String storeTypeCd;
+
+
+    public String getAmount() {
+        return amount;
+    }
+
+    public void setAmount(String amount) {
+        this.amount = amount;
+    }
+
+    public String getIncomeObjId() {
+        return incomeObjId;
+    }
+
+    public void setIncomeObjId(String incomeObjId) {
+        this.incomeObjId = incomeObjId;
+    }
+
+    public String getIncomeObjName() {
+        return incomeObjName;
+    }
+
+    public void setIncomeObjName(String incomeObjName) {
+        this.incomeObjName = incomeObjName;
+    }
+
+    public String getFeeTypeCd() {
+        return feeTypeCd;
+    }
+
+    public void setFeeTypeCd(String feeTypeCd) {
+        this.feeTypeCd = feeTypeCd;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getFeeId() {
+        return feeId;
+    }
+
+    public void setFeeId(String feeId) {
+        this.feeId = feeId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getPayerObjId() {
+        return payerObjId;
+    }
+
+    public void setPayerObjId(String payerObjId) {
+        this.payerObjId = payerObjId;
+    }
+
+    public String getPayerObjName() {
+        return payerObjName;
+    }
+
+    public void setPayerObjName(String payerObjName) {
+        this.payerObjName = payerObjName;
+    }
+
+    public String getConfigId() {
+        return configId;
+    }
+
+    public void setConfigId(String configId) {
+        this.configId = configId;
+    }
+
+    public String getSquarePrice() {
+        return squarePrice;
+    }
+
+    public void setSquarePrice(String squarePrice) {
+        this.squarePrice = squarePrice;
+    }
+
+    public String getAdditionalAmount() {
+        return additionalAmount;
+    }
+
+    public void setAdditionalAmount(String additionalAmount) {
+        this.additionalAmount = additionalAmount;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getStateName() {
+        return stateName;
+    }
+
+    public void setStateName(String stateName) {
+        this.stateName = stateName;
+    }
+
+    public String getFeeFlag() {
+        return feeFlag;
+    }
+
+    public void setFeeFlag(String feeFlag) {
+        this.feeFlag = feeFlag;
+    }
+
+    public String getFeeName() {
+        return feeName;
+    }
+
+    public void setFeeName(String feeName) {
+        this.feeName = feeName;
+    }
+
+    public String getFeeTypeCdName() {
+        return feeTypeCdName;
+    }
+
+    public void setFeeTypeCdName(String feeTypeCdName) {
+        this.feeTypeCdName = feeTypeCdName;
+    }
+
+    public String getFeeFlagName() {
+        return feeFlagName;
+    }
+
+    public void setFeeFlagName(String feeFlagName) {
+        this.feeFlagName = feeFlagName;
+    }
+
+    public double getFeePrice() {
+        return feePrice;
+    }
+
+    public void setFeePrice(double feePrice) {
+        this.feePrice = feePrice;
+    }
+
+    public String getPayerObjType() {
+        return payerObjType;
+    }
+
+    public void setPayerObjType(String payerObjType) {
+        this.payerObjType = payerObjType;
+    }
+
+    public String getComputingFormula() {
+        return computingFormula;
+    }
+
+    public void setComputingFormula(String computingFormula) {
+        this.computingFormula = computingFormula;
+    }
+
+    public String getIsDefault() {
+        return isDefault;
+    }
+
+    public void setIsDefault(String isDefault) {
+        this.isDefault = isDefault;
+    }
+
+    public double getOweFee() {
+        return oweFee;
+    }
+
+    public void setOweFee(double oweFee) {
+        this.oweFee = oweFee;
+    }
+
+    public String getBillType() {
+        return billType;
+    }
+
+    public void setBillType(String billType) {
+        this.billType = billType;
+    }
+
+    public String getBillTypeName() {
+        return billTypeName;
+    }
+
+    public void setBillTypeName(String billTypeName) {
+        this.billTypeName = billTypeName;
+    }
+
+    public String getPaymentCd() {
+        return paymentCd;
+    }
+
+    public void setPaymentCd(String paymentCd) {
+        this.paymentCd = paymentCd;
+    }
+
+    public String getPaymentCycle() {
+        return paymentCycle;
+    }
+
+    public void setPaymentCycle(String paymentCycle) {
+        this.paymentCycle = paymentCycle;
+    }
+
+    public String getImportFeeName() {
+        return importFeeName;
+    }
+
+    public void setImportFeeName(String importFeeName) {
+        this.importFeeName = importFeeName;
+    }
+
+    public String getAmountOwed() {
+        return amountOwed;
+    }
+
+    public void setAmountOwed(String amountOwed) {
+        this.amountOwed = amountOwed;
+    }
+
+    public String getRoomName() {
+        return roomName;
+    }
+
+    public void setRoomName(String roomName) {
+        this.roomName = roomName;
+    }
+
+    public String getOwnerName() {
+        return ownerName;
+    }
+
+    public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
+    }
+
+    public String getOwnerTel() {
+        return ownerTel;
+    }
+
+    public void setOwnerTel(String ownerTel) {
+        this.ownerTel = ownerTel;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getConfigStartTime() {
+        return configStartTime;
+    }
+
+    public void setConfigStartTime(Date configStartTime) {
+        this.configStartTime = configStartTime;
+    }
+
+    public Date getConfigEndTime() {
+        return configEndTime;
+    }
+
+    public void setConfigEndTime(Date configEndTime) {
+        this.configEndTime = configEndTime;
+    }
+
+    public Date getDeadlineTime() {
+        return deadlineTime;
+    }
+
+    public void setDeadlineTime(Date deadlineTime) {
+        this.deadlineTime = deadlineTime;
+    }
+
+    public Date getImportFeeEndTime() {
+        return importFeeEndTime;
+    }
+
+    public void setImportFeeEndTime(Date importFeeEndTime) {
+        this.importFeeEndTime = importFeeEndTime;
+    }
+
+    public String getCurDegrees() {
+        return curDegrees;
+    }
+
+    public void setCurDegrees(String curDegrees) {
+        this.curDegrees = curDegrees;
+    }
+
+    public String getPreDegrees() {
+        return preDegrees;
+    }
+
+    public void setPreDegrees(String preDegrees) {
+        this.preDegrees = preDegrees;
+    }
+
+    public Date getPreReadingTime() {
+        return preReadingTime;
+    }
+
+    public void setPreReadingTime(Date preReadingTime) {
+        this.preReadingTime = preReadingTime;
+    }
+
+    public Date getCurReadingTime() {
+        return curReadingTime;
+    }
+
+    public void setCurReadingTime(Date curReadingTime) {
+        this.curReadingTime = curReadingTime;
+    }
+
+    public String getRoomId() {
+        return roomId;
+    }
+
+    public void setRoomId(String roomId) {
+        this.roomId = roomId;
+    }
+
+    public String getRoomNum() {
+        return roomNum;
+    }
+
+    public void setRoomNum(String roomNum) {
+        this.roomNum = roomNum;
+    }
+
+    public String getCarId() {
+        return carId;
+    }
+
+    public void setCarId(String carId) {
+        this.carId = carId;
+    }
+
+    public String getCarNum() {
+        return carNum;
+    }
+
+    public void setCarNum(String carNum) {
+        this.carNum = carNum;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getStoreTypeCd() {
+        return storeTypeCd;
+    }
+
+    public void setStoreTypeCd(String storeTypeCd) {
+        this.storeTypeCd = storeTypeCd;
+    }
+}

+ 232 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportRoomAttrDto.java

@@ -0,0 +1,232 @@
+package com.java110.dto.report;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName ReportRoomDto
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:20
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+public class ReportRoomAttrDto extends PageDto implements Serializable {
+    private String feeCoefficient;
+    private String section;
+    private String remark;
+    private String userId;
+    private String roomId;
+    private String layer;
+    private String builtUpArea;
+    private String roomNum;
+    private String unitId;
+    private String unitArea;
+    private String apartment;
+    private String apartmentName;
+    private String communityId;
+    private String floorId;
+    private String floorNum;
+    private String floorArea;
+    private String userName;
+    private String ownerId;
+    private String ownerName;
+    private String idCard;
+    private String link;
+    private String state;
+    private String stateName;
+    private String unitNum;
+
+    public String getFeeCoefficient() {
+        return feeCoefficient;
+    }
+
+    public void setFeeCoefficient(String feeCoefficient) {
+        this.feeCoefficient = feeCoefficient;
+    }
+
+    public String getSection() {
+        return section;
+    }
+
+    public void setSection(String section) {
+        this.section = section;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getRoomId() {
+        return roomId;
+    }
+
+    public void setRoomId(String roomId) {
+        this.roomId = roomId;
+    }
+
+    public String getLayer() {
+        return layer;
+    }
+
+    public void setLayer(String layer) {
+        this.layer = layer;
+    }
+
+    public String getBuiltUpArea() {
+        return builtUpArea;
+    }
+
+    public void setBuiltUpArea(String builtUpArea) {
+        this.builtUpArea = builtUpArea;
+    }
+
+    public String getRoomNum() {
+        return roomNum;
+    }
+
+    public void setRoomNum(String roomNum) {
+        this.roomNum = roomNum;
+    }
+
+    public String getUnitId() {
+        return unitId;
+    }
+
+    public void setUnitId(String unitId) {
+        this.unitId = unitId;
+    }
+
+    public String getUnitArea() {
+        return unitArea;
+    }
+
+    public void setUnitArea(String unitArea) {
+        this.unitArea = unitArea;
+    }
+
+    public String getApartment() {
+        return apartment;
+    }
+
+    public void setApartment(String apartment) {
+        this.apartment = apartment;
+    }
+
+    public String getApartmentName() {
+        return apartmentName;
+    }
+
+    public void setApartmentName(String apartmentName) {
+        this.apartmentName = apartmentName;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getFloorId() {
+        return floorId;
+    }
+
+    public void setFloorId(String floorId) {
+        this.floorId = floorId;
+    }
+
+    public String getFloorNum() {
+        return floorNum;
+    }
+
+    public void setFloorNum(String floorNum) {
+        this.floorNum = floorNum;
+    }
+
+    public String getFloorArea() {
+        return floorArea;
+    }
+
+    public void setFloorArea(String floorArea) {
+        this.floorArea = floorArea;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
+    }
+
+    public String getOwnerName() {
+        return ownerName;
+    }
+
+    public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getLink() {
+        return link;
+    }
+
+    public void setLink(String link) {
+        this.link = link;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getStateName() {
+        return stateName;
+    }
+
+    public void setStateName(String stateName) {
+        this.stateName = stateName;
+    }
+
+    public String getUnitNum() {
+        return unitNum;
+    }
+
+    public void setUnitNum(String unitNum) {
+        this.unitNum = unitNum;
+    }
+}

+ 232 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportRoomDto.java

@@ -0,0 +1,232 @@
+package com.java110.dto.report;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+
+/**
+ * @ClassName ReportRoomDto
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:20
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+public class ReportRoomDto extends PageDto implements Serializable {
+    private String feeCoefficient;
+    private String section;
+    private String remark;
+    private String userId;
+    private String roomId;
+    private String layer;
+    private String builtUpArea;
+    private String roomNum;
+    private String unitId;
+    private String unitArea;
+    private String apartment;
+    private String apartmentName;
+    private String communityId;
+    private String floorId;
+    private String floorNum;
+    private String floorArea;
+    private String userName;
+    private String ownerId;
+    private String ownerName;
+    private String idCard;
+    private String link;
+    private String state;
+    private String stateName;
+    private String unitNum;
+
+    public String getFeeCoefficient() {
+        return feeCoefficient;
+    }
+
+    public void setFeeCoefficient(String feeCoefficient) {
+        this.feeCoefficient = feeCoefficient;
+    }
+
+    public String getSection() {
+        return section;
+    }
+
+    public void setSection(String section) {
+        this.section = section;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getRoomId() {
+        return roomId;
+    }
+
+    public void setRoomId(String roomId) {
+        this.roomId = roomId;
+    }
+
+    public String getLayer() {
+        return layer;
+    }
+
+    public void setLayer(String layer) {
+        this.layer = layer;
+    }
+
+    public String getBuiltUpArea() {
+        return builtUpArea;
+    }
+
+    public void setBuiltUpArea(String builtUpArea) {
+        this.builtUpArea = builtUpArea;
+    }
+
+    public String getRoomNum() {
+        return roomNum;
+    }
+
+    public void setRoomNum(String roomNum) {
+        this.roomNum = roomNum;
+    }
+
+    public String getUnitId() {
+        return unitId;
+    }
+
+    public void setUnitId(String unitId) {
+        this.unitId = unitId;
+    }
+
+    public String getUnitArea() {
+        return unitArea;
+    }
+
+    public void setUnitArea(String unitArea) {
+        this.unitArea = unitArea;
+    }
+
+    public String getApartment() {
+        return apartment;
+    }
+
+    public void setApartment(String apartment) {
+        this.apartment = apartment;
+    }
+
+    public String getApartmentName() {
+        return apartmentName;
+    }
+
+    public void setApartmentName(String apartmentName) {
+        this.apartmentName = apartmentName;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getFloorId() {
+        return floorId;
+    }
+
+    public void setFloorId(String floorId) {
+        this.floorId = floorId;
+    }
+
+    public String getFloorNum() {
+        return floorNum;
+    }
+
+    public void setFloorNum(String floorNum) {
+        this.floorNum = floorNum;
+    }
+
+    public String getFloorArea() {
+        return floorArea;
+    }
+
+    public void setFloorArea(String floorArea) {
+        this.floorArea = floorArea;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getOwnerId() {
+        return ownerId;
+    }
+
+    public void setOwnerId(String ownerId) {
+        this.ownerId = ownerId;
+    }
+
+    public String getOwnerName() {
+        return ownerName;
+    }
+
+    public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getLink() {
+        return link;
+    }
+
+    public void setLink(String link) {
+        this.link = link;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getStateName() {
+        return stateName;
+    }
+
+    public void setStateName(String stateName) {
+        this.stateName = stateName;
+    }
+
+    public String getUnitNum() {
+        return unitNum;
+    }
+
+    public void setUnitNum(String unitNum) {
+        this.unitNum = unitNum;
+    }
+}

+ 45 - 0
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="reportCommunityServiceDaoImpl">
+
+    <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
+    <select id="getRoomCount" parameterType="com.java110.dto.report.ReportRoomDto" resultType="Map">
+        select count(1) count
+        from building_room t
+        where t.status_cd = '0'
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+    </select>
+
+    <!-- 查询 房屋 楼栋 单元 业主 -->
+    <select id="getRoomFloorUnitAndOwner" parameterType="com.java110.dto.report.ReportRoomDto"
+            resultType="com.java110.dto.report.ReportRoomDto">
+        select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
+        t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
+        t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
+        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.owner_id ownerId
+        from building_room t
+        INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
+        inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'
+        LEFT JOIN building_owner_room_rel borr on t.room_id = borr.room_id and borr.status_cd = '0'
+        left join building_owner bo on borr.owner_id = bo.member_id and bo.status_cd = '0'
+        where t.status_cd = '0'
+        <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>

+ 52 - 0
java110-db/src/main/resources/mapper/report/ReportFeeServiceDaoImplMapper.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="reportFeeServiceDaoImpl">
+
+    <!-- 查询房屋个数 add by wuxw 2018-07-03 -->
+    <select id="getFeeCount" parameterType="com.java110.dto.report.ReportFeeDto" resultType="Map">
+        select count(1) count
+        from pay_fee t
+        where t.status_cd = '0'
+        <if test="payerObjId !=null and payerObjId != ''">
+            and t.payer_obj_id = #{payerObjId}
+        </if>
+        <if test="payerObjType !=null and payerObjType != ''">
+            and t.payer_obj_type= #{payerObjType}
+        </if>
+    </select>
+
+    <!-- 查询 费用 -->
+    <select id="getFees" parameterType="com.java110.dto.report.ReportFeeDto"
+            resultType="com.java110.dto.report.ReportFeeDto">
+        select pfc.fee_name,pfc.start_time configStartTime,pfc.end_time configEndTime,pfc.config_id configId,pfc.fee_type_cd feeTypeCd,
+        pfc.additional_amount additionalAmount,pfc.bill_type billType,pfc.computing_formula computingFormula,pfc.payment_cd paymentCd,
+        pfc.payment_cycle paymentCycle,pfc.square_price squarePrice,pfc.fee_flag feeFlag,t.payer_obj_id payerObjId,t.payer_obj_type payerObjType,
+        t.amount,t.create_time createTime,t.end_time endTime,t.fee_id feeId,t.income_obj_id incomeObjId,t.start_time startTime,t.state,
+        br.room_id roomId,br.room_num roomNum,oc.car_num carNum,ss.store_id storeId,ss.`name` storeName,ss.store_type_cd storeTypeCd
+        from pay_fee t
+        INNER JOIN pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+        left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
+        left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
+        left join s_store ss on t.income_obj_id = ss.store_id and ss.status_cd = '0'
+        where t.status_cd = '0'
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="payerObjId !=null and payerObjId != ''">
+            and t.payer_obj_id= #{payerObjId}
+        </if>
+        <if test="payerObjType !=null and payerObjType != ''">
+            and t.payer_obj_type= #{payerObjType}
+        </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>

+ 27 - 0
java110-interface/src/main/java/com/java110/intf/report/IGeneratorFeeMonthStatisticsInnerServiceSMO.java

@@ -0,0 +1,27 @@
+package com.java110.intf.report;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * @ClassName IGeneratorFeeMonthStatisticsInnerServiceSMO
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 21:51
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+@FeignClient(name = "report-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/generatorFeeMonthStatisticsApi")
+public interface IGeneratorFeeMonthStatisticsInnerServiceSMO {
+
+
+
+    @RequestMapping(value = "/generatorData", method = RequestMethod.POST)
+    public int generatorData(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
+
+}

+ 5 - 0
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java

@@ -1,9 +1,12 @@
 package com.java110.report.bmo.reportFeeMonthStatistics.impl;
 
+import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
 import com.java110.intf.IReportFeeMonthStatisticsInnerServiceSMO;
 import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO;
 import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -15,6 +18,8 @@ import java.util.List;
 @Service("getReportFeeMonthStatisticsBMOImpl")
 public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthStatisticsBMO {
 
+    private static final Logger logger = LoggerFactory.getLogger(GetReportFeeMonthStatisticsBMOImpl.class);
+
     @Autowired
     private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
 

+ 29 - 0
service-report/src/main/java/com/java110/report/dao/IReportCommunityServiceDao.java

@@ -0,0 +1,29 @@
+package com.java110.report.dao;
+
+import com.java110.dto.report.ReportRoomDto;
+
+import java.util.List;
+
+/**
+ * @ClassName ICommunityServiceDao
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:10
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+public interface IReportCommunityServiceDao {
+
+    /**
+     * 查询房屋个数
+     * @param reportRoomDto
+     * @return
+     */
+    int getRoomCount(ReportRoomDto reportRoomDto);
+
+    /**
+     * 查询 房屋 楼栋 单元 和 业主 信息
+     * @return
+     */
+    List<ReportRoomDto> getRoomFloorUnitAndOwner(ReportRoomDto reportRoomDto);
+}

+ 1 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java

@@ -1,6 +1,7 @@
 package com.java110.report.dao;
 
 
+import com.java110.dto.RoomDto;
 import com.java110.utils.exception.DAOException;
 import com.java110.entity.merchant.BoMerchant;
 import com.java110.entity.merchant.BoMerchantAttr;

+ 30 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeServiceDao.java

@@ -0,0 +1,30 @@
+package com.java110.report.dao;
+
+import com.java110.dto.report.ReportFeeDto;
+import com.java110.dto.report.ReportRoomDto;
+
+import java.util.List;
+
+/**
+ * @ClassName ICommunityServiceDao
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:10
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+public interface IReportFeeServiceDao {
+
+    /**
+     * 查询房屋个数
+     * @param reportFeeDto
+     * @return
+     */
+    int getFeeCount(ReportFeeDto reportFeeDto);
+
+    /**
+     * 查询 房屋 楼栋 单元 和 业主 信息
+     * @return
+     */
+    List<ReportFeeDto> getFees(ReportFeeDto reportFeeDto);
+}

+ 47 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportCommunityServiceDaoImpl.java

@@ -0,0 +1,47 @@
+package com.java110.report.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.dto.report.ReportRoomDto;
+import com.java110.report.dao.IReportCommunityServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName ReportCommunityServiceDaoImpl
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:15
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+@Service("reportCommunityServiceDaoImpl")
+public class ReportCommunityServiceDaoImpl extends BaseServiceDao implements IReportCommunityServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(ReportCommunityServiceDaoImpl.class);
+
+    @Override
+    public int getRoomCount(ReportRoomDto reportRoomDto) {
+        logger.debug("查询费用月统计数据 入参 info : {}", JSONObject.toJSONString(reportRoomDto));
+
+        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportCommunityServiceDaoImpl.getRoomCount", reportRoomDto);
+        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
+    }
+
+    @Override
+    public List<ReportRoomDto> getRoomFloorUnitAndOwner(ReportRoomDto reportRoomDto) {
+        logger.debug("查询房屋信息 入参 info : {}", JSONObject.toJSONString(reportRoomDto));
+
+        List<ReportRoomDto> roomDtos = sqlSessionTemplate.selectList("reportCommunityServiceDaoImpl.getRoomFloorUnitAndOwner", reportRoomDto);
+
+        return roomDtos;
+    }
+}

+ 47 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeServiceDaoImpl.java

@@ -0,0 +1,47 @@
+package com.java110.report.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.dto.report.ReportFeeDto;
+import com.java110.report.dao.IReportFeeServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName ReportCommunityServiceDaoImpl
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 22:15
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+@Service("reportFeeServiceDaoImpl")
+public class ReportFeeServiceDaoImpl extends BaseServiceDao implements IReportFeeServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(ReportFeeServiceDaoImpl.class);
+
+    @Override
+    public int getFeeCount(ReportFeeDto reportFeeDto) {
+        logger.debug("查询费用月统计数据 入参 info : {}", JSONObject.toJSONString(reportFeeDto));
+
+        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeServiceDaoImpl.getFeeCount", reportFeeDto);
+        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
+    }
+
+    @Override
+    public List<ReportFeeDto> getFees(ReportFeeDto reportFeeDto) {
+        logger.debug("查询费用信息 入参 info : {}", JSONObject.toJSONString(reportFeeDto));
+
+        List<ReportFeeDto> roomDtos = sqlSessionTemplate.selectList("reportFeeServiceDaoImpl.getFees", reportFeeDto);
+
+        return roomDtos;
+    }
+}

+ 10 - 0
service-report/src/main/java/com/java110/report/package-info.java

@@ -0,0 +1,10 @@
+/**
+ * <b>report主要实现报表统计:</b><br>
+ *     微服务 数据 分布在不通的数据库的不通片上,导致报表复杂SQL无法实现,
+ *     特意涉及 报表服务是为了 报表服务连接融合库 方便写复杂SQL
+ *
+ *     add by wuxw 2020-10-15
+ * @site http://www.homecommunity.cn
+ * @gitee https://gitee.com/wuxw7/MicroCommunity.git
+ */
+package com.java110.report;

+ 115 - 0
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java

@@ -0,0 +1,115 @@
+package com.java110.report.smo.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.report.ReportFeeDto;
+import com.java110.dto.report.ReportRoomDto;
+import com.java110.intf.report.IGeneratorFeeMonthStatisticsInnerServiceSMO;
+import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+import com.java110.report.dao.IReportCommunityServiceDao;
+import com.java110.report.dao.IReportFeeMonthStatisticsServiceDao;
+import com.java110.report.dao.IReportFeeServiceDao;
+import com.java110.utils.util.Assert;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @ClassName GeneratorFeeMonthStatisticsInnerServiceSMOImpl
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 21:53
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+@RestController
+public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGeneratorFeeMonthStatisticsInnerServiceSMO {
+    private static final Logger logger = LoggerFactory.getLogger(GeneratorFeeMonthStatisticsInnerServiceSMOImpl.class);
+
+    //默认 处理房屋数量
+    private static final int DEFAULT_DEAL_ROOM_COUNT = 1000;
+
+    @Autowired
+    private IReportFeeMonthStatisticsServiceDao reportFeeMonthStatisticsServiceDaoImpl;
+
+    @Autowired
+    private IReportCommunityServiceDao reportCommunityServiceDaoImpl;
+
+    @Autowired
+    private IReportFeeServiceDao reportFeeServiceDaoImpl;
+
+    @Override
+    public int generatorData(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) {
+
+        String communityId = reportFeeMonthStatisticsPo.getCommunityId();
+
+        Assert.hasLength(communityId, "未包含小区信息");
+
+        //处理房屋费用
+        dealRoomFee(reportFeeMonthStatisticsPo);
+
+
+        return 0;
+    }
+
+
+    /**
+     * 处理 房屋费用
+     *
+     * @param reportFeeMonthStatisticsPo
+     */
+    private void dealRoomFee(ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) {
+
+        int page = 0;
+        int max = DEFAULT_DEAL_ROOM_COUNT;
+
+        ReportRoomDto reportRoomDto = new ReportRoomDto();
+        reportRoomDto.setCommunityId(reportFeeMonthStatisticsPo.getCommunityId());
+        int count = reportCommunityServiceDaoImpl.getRoomCount(reportRoomDto);
+
+
+        if (count < DEFAULT_DEAL_ROOM_COUNT) {
+            page = 1;
+            max = count;
+        } else {
+            page = (int) Math.ceil((double) count / (double) DEFAULT_DEAL_ROOM_COUNT);
+            max = DEFAULT_DEAL_ROOM_COUNT;
+        }
+
+        for (int pageIndex = 0; pageIndex < page; pageIndex++) {
+            reportRoomDto.setPage(pageIndex * max);
+            reportRoomDto.setRow(max);
+            List<ReportRoomDto> reportRoomDtos = reportCommunityServiceDaoImpl.getRoomFloorUnitAndOwner(reportRoomDto);
+            for (ReportRoomDto tmpReportRoomDto : reportRoomDtos) {
+                try {
+                    doDealRoomFee(tmpReportRoomDto);
+                } catch (Exception e) {
+                    logger.error("生成费用报表失败" + JSONObject.toJSONString(tmpReportRoomDto), e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 处理费用
+     *
+     * @param reportRoomDto
+     */
+    private void doDealRoomFee(ReportRoomDto reportRoomDto) {
+        ReportFeeDto reportFeeDto = new ReportFeeDto();
+        reportFeeDto.setPayerObjId(reportRoomDto.getRoomId());
+        reportFeeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
+        reportFeeDto.setState(FeeDto.STATE_DOING);
+        List<ReportFeeDto> feeDtos = reportFeeServiceDaoImpl.getFees(reportFeeDto);
+
+        if (feeDtos == null || feeDtos.size() < 1) {
+            return;
+        }
+
+
+    }
+}

+ 0 - 26
service-report/src/main/resources/application-dev.yml

@@ -45,33 +45,7 @@ spring:
       max-idle: 100
       min-idle: 0
       timeout: 0
-  activiti:
-    database-schema-update: false
-#  false:false为默认值,设置为该值后,Activiti在启动时,会对比数据库表中保存的版本,如果版本不匹配时,将在启动时抛出异常。
-#  true:设置为该值后,Activiti会对数据库中所有的表进行更新,如果表不存在,则Activiti会自动创建。
-#  create-drop:Activiti启动时,会执行数据库表的创建操作,在Activiti关闭时,执行数据库表的删除操作。
-#  drop-create:Activiti启动时,执行数据库表的删除操作在Activiti关闭时,会执行数据库表的创建操作。
 
-#  datasource:
-#    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
-#    minIdle: 5
-#    validationQuery: SELECT 1 FROM DUAL
-#    initialSize: 5
-#    maxWait: 60000
-#    filters: stat,wall,log4j
-#    poolPreparedStatements: true
-#    type: com.alibaba.druid.pool.DruidDataSource
-#    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-#    maxPoolPreparedStatementPerConnectionSize: 20
-#    password: TT@12345678
-#    testOnBorrow: false
-#    testWhileIdle: true
-#    minEvictableIdleTimeMillis: 300000
-#    timeBetweenEvictionRunsMillis: 60000
-#    testOnReturn: false
-#    driverClassName: com.mysql.jdbc.Driver
-#    maxActive: 20
-#    username: TT
 
 #============== kafka ===================
 kafka: