Browse Source

优化修改费用项代码

wuxw 2 years ago
parent
commit
337da4d075

+ 12 - 3
java110-db/src/main/resources/mapper/fee/FeeConfigServiceDaoImplMapper.xml

@@ -142,7 +142,7 @@
         t.payment_cd,t.payment_cycle,t.payment_cd paymentCd,t.payment_cycle paymentCycle,
         t.computing_formula_text,t.computing_formula_text computingFormulaText,t.deduct_from,t.deduct_from
         deductFrom,td4.name computingFormulaName,t.pay_online payOnline,t.scale,t.decimal_place decimalPlace,t.units,
-        t.prepayment_period,t.prepayment_period prepaymentPeriod
+        t.prepayment_period,t.prepayment_period prepaymentPeriod,t.state
         from pay_fee_config t
         left join t_dict td1 on t.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and
         td1.table_columns = 'fee_type_cd'
@@ -217,6 +217,9 @@
         <if test="prepaymentPeriod !=null and prepaymentPeriod != ''">
             and t.prepayment_period = #{prepaymentPeriod}
         </if>
+        <if test="state !=null and state != ''">
+            and t.state = #{state}
+        </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -277,6 +280,9 @@
         <if test="prepaymentPeriod !=null and prepaymentPeriod != ''">
             , t.prepayment_period = #{prepaymentPeriod}
         </if>
+        <if test="state !=null and state != ''">
+            , t.state = #{state}
+        </if>
         where 1=1
         <if test="configId !=null and configId != ''">
             and t.config_id= #{configId}
@@ -356,6 +362,9 @@
         <if test="prepaymentPeriod !=null and prepaymentPeriod != ''">
             and t.prepayment_period = #{prepaymentPeriod}
         </if>
+        <if test="state !=null and state != ''">
+            and t.state = #{state}
+        </if>
     </select>
 
     <!-- 保存费用配置信息 add by wuxw 2018-07-03 -->
@@ -364,10 +373,10 @@
                                    is_default, config_id, fee_flag, fee_name,
                                    start_time, end_time, community_id, b_id, bill_type, payment_cd, payment_cycle,
                                    computing_formula_text, deduct_from, pay_online, scale, decimal_place, units,
-                                   prepayment_period)
+                                   prepayment_period,state)
         values (#{feeTypeCd}, #{computingFormula}, #{additionalAmount}, '0', #{squarePrice}, #{isDefault}, #{configId},
                 #{feeFlag}, #{feeName}, #{startTime}, #{endTime}, #{communityId}, '-1', #{billType}, #{paymentCd},
                 #{paymentCycle}, #{computingFormulaText}, #{deductFrom}, #{payOnline}, #{scale}, #{decimalPlace},
-                #{units}, #{prepaymentPeriod})
+                #{units}, #{prepaymentPeriod},#{state})
     </insert>
 </mapper>

+ 2 - 2
service-fee/src/main/java/com/java110/fee/cmd/returnPayFee/UpdateReturnPayFeeCmd.java

@@ -173,8 +173,8 @@ public class UpdateReturnPayFeeCmd extends Cmd {
         Assert.hasKeyAndValue(reqJson, "state", "state不能为空");
         Assert.hasKeyAndValue(reqJson, "feeId", "feeId不能为空");
         if (reqJson.containsKey("cycles")) {
-            String cycles = reqJson.getString("cycles");
-            if (!cycles.startsWith("-")) {
+            double cycles = reqJson.getDouble("cycles");
+            if (cycles < 0) {
                 throw new IllegalArgumentException("退费周期必须负数");// 这里必须传入负数,否则费用自动相加不会退费
             }
         }