Pārlūkot izejas kodu

优化删除费用

Your Name 2 gadi atpakaļ
vecāks
revīzija
99229bc2cc

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/fee/FeeDto.java

@@ -157,6 +157,8 @@ public class FeeDto extends PageDto implements Serializable {
     private String customStartTime;
     private String customEndTime;
 
+    private String deleteFlag;
+
     public String getAmount() {
         return amount;
     }
@@ -767,4 +769,12 @@ public class FeeDto extends PageDto implements Serializable {
     public void setCustomEndTime(String customEndTime) {
         this.customEndTime = customEndTime;
     }
+
+    public String getDeleteFlag() {
+        return deleteFlag;
+    }
+
+    public void setDeleteFlag(String deleteFlag) {
+        this.deleteFlag = deleteFlag;
+    }
 }

+ 17 - 1
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml

@@ -308,8 +308,16 @@
         left join c_business cb on t.b_id = cb.b_id
         left join c_orders co on cb.o_id = co.o_id
         left join u_user uu on co.user_id = uu.user_id
+        <if test="deleteFlag != null and deleteFlag != ''">
+            inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '1' and pf.b_id = t.b_id
+        </if>
         where 1=1
+        <if test="feeId != null and feeId != ''">
         and t.fee_id = #{feeId}
+        </if>
+        <if test="deleteFlag != null and deleteFlag != ''">
+            and t.operate = 'DEL'
+        </if>
         and t.community_id = #{communityId}
     </select>
 
@@ -322,8 +330,16 @@
         left join c_business cb on t.b_id = cb.b_id
         left join c_orders co on cb.o_id = co.o_id
         left join u_user uu on co.user_id = uu.user_id
+        <if test="deleteFlag != null and deleteFlag != ''">
+            inner join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '1' and pf.b_id = t.b_id
+        </if>
         where 1=1
-        and t.fee_id = #{feeId}
+        <if test="feeId != null and feeId != ''">
+            and t.fee_id = #{feeId}
+        </if>
+        <if test="deleteFlag != null and deleteFlag != ''">
+            and t.operate = 'DEL'
+        </if>
         and t.community_id = #{communityId}
         order by t.create_time desc,t.operate
         <if test="page != -1 and page != null ">

+ 5 - 1
service-report/src/main/java/com/java110/report/cmd/fee/QueryHisFeeCmd.java

@@ -30,8 +30,12 @@ public class QueryHisFeeCmd extends Cmd {
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
-        Assert.hasKeyAndValue(reqJson,"feeId","未包含费用ID");
         Assert.hasKeyAndValue(reqJson,"communityId","未包含小区");
+        if (reqJson.containsKey("deleteFlag")) {
+            return;
+        }
+        Assert.hasKeyAndValue(reqJson,"feeId","未包含费用ID");
+
 
     }