Bladeren bron

优化代码

wuxw 4 jaren geleden
bovenliggende
commit
4c29e45148

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

@@ -27,6 +27,7 @@ public class OwnerRoomRelDto extends PageDto implements Serializable {
     private String roomId;
     private String bId;
     private boolean byOwnerInfo = false;
+    private String communityId;
 
     private Date startTime;
     private Date endTime;
@@ -165,4 +166,12 @@ public class OwnerRoomRelDto extends PageDto implements Serializable {
     public void setOwnerNameLike(String ownerNameLike) {
         this.ownerNameLike = ownerNameLike;
     }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
 }

+ 2 - 0
java110-db/src/main/resources/mapper/user/OwnerRoomRelServiceDaoImplMapper.xml

@@ -107,6 +107,7 @@
         where 1 =1
         <if test="byOwnerInfo == true">
             and t.owner_id = bow.owner_id
+            and bow.community_id = #{communityId}
             and bow.status_cd = '0'
         </if>
         <if test="byOwnerInfo == true and ownerName !=null and ownerName != ''">
@@ -197,6 +198,7 @@
         where 1 =1
         <if test="byOwnerInfo == true">
             and t.owner_id = bow.owner_id
+            and bow.community_id = #{communityId}
             and bow.status_cd = '0'
         </if>
         <if test="byOwnerInfo == true and ownerName !=null and ownerName != ''">

+ 1 - 0
service-api/src/main/java/com/java110/api/listener/fee/ListRoomsWhereFeeSetListener.java

@@ -114,6 +114,7 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
 
         OwnerRoomRelDto ownerRoomRelDto = BeanConvertUtil.covertBean(reqJson, OwnerRoomRelDto.class);
         ownerRoomRelDto.setByOwnerInfo(true);
+        ownerRoomRelDto.setCommunityId(reqJson.getString("communityId"));
         int total = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRelsCount(ownerRoomRelDto);
 
         apiRoomVo.setTotal(total);

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

@@ -569,6 +569,9 @@ public class GeneratorFeeMonthStatisticsInnerServiceSMOImpl implements IGenerato
             }
             double month = computeFeeSMOImpl.dayCompare(tmpReportFeeDto.getDeadlineTime(), tmpReportFeeDto.getEndTime());
             month = Math.ceil(month);
+            if(month == 0){ // 防止除数为0
+                return 0;
+            }
             double money = feePriceDec.divide(new BigDecimal(month), 2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
             return money;
         }