java110 6 роки тому
батько
коміт
69769109eb

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

@@ -55,6 +55,7 @@ public class FeeDto extends PageDto implements Serializable {
     private String isDefault;
     private double oweFee; // 欠费金额
     private String billType;
+    private String billTypeName;
 
     private String paymentCd;
 
@@ -366,4 +367,12 @@ public class FeeDto extends PageDto implements Serializable {
     public void setBillType(String billType) {
         this.billType = billType;
     }
+
+    public String getBillTypeName() {
+        return billTypeName;
+    }
+
+    public void setBillTypeName(String billTypeName) {
+        this.billTypeName = billTypeName;
+    }
 }

+ 10 - 3
java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml

@@ -138,8 +138,8 @@
         additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
         pfc.fee_name feeName,td1.name feeTypeCdName,td2.name stateName,td3.name feeFlagName,pfc.computing_formula computingFormula,
         pfc.bill_type billType,t.payer_obj_type,t.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
-        configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle
-        from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3
+        configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle,td4.name billTypeName
+        from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3,t_dict td4
         where 1 =1
         and t.fee_type_cd = pfc.fee_type_cd
         and t.config_id = pfc.config_id
@@ -153,6 +153,9 @@
         and t.fee_flag = td3.status_cd
         and td3.table_name = 'pay_fee'
         and td3.table_columns = 'fee_flag'
+        and pfc.bill_type = td4.status_cd
+        and td4.table_name = 'bill_type'
+        and td4.table_columns = 'pay_fee_config'
         <if test="amount !=null and amount != ''">
             and t.amount= #{amount}
         </if>
@@ -271,7 +274,7 @@
     <!-- 查询费用数量 add by wuxw 2018-07-03 -->
     <select id="queryFeesCount" parameterType="Map" resultType="Map">
         select count(1) count
-        from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3
+        from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3,t_dict td4
         where 1 =1
         and t.fee_type_cd = pfc.fee_type_cd
         and t.config_id = pfc.config_id
@@ -285,6 +288,9 @@
         and t.fee_flag = td3.status_cd
         and td3.table_name = 'pay_fee'
         and td3.table_columns = 'fee_flag'
+        and pfc.bill_type = td4.status_cd
+        and td4.table_name = 'bill_type'
+        and td4.table_columns = 'pay_fee_config'
         <if test="amount !=null and amount != ''">
             and t.amount= #{amount}
         </if>
@@ -549,6 +555,7 @@
 
     <update id="updateBillOweFees" parameterType="Map">
         update bill_owe_fee t set t.state = #{state} where t.fee_id = #{feeId} and t.community_id=#{communityId}
+        and t.bill_id=#{billId}
     </update>
 
     <insert id="insertBill" parameterType="Map">

+ 13 - 6
service-fee/src/main/java/com/java110/fee/bmo/impl/PayOweFeeImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.RoomDto;
+import com.java110.dto.fee.BillDto;
 import com.java110.dto.fee.BillOweFeeDto;
 import com.java110.dto.fee.FeeAttrDto;
 import com.java110.dto.fee.FeeConfigDto;
@@ -148,16 +149,21 @@ public class PayOweFeeImpl implements IPayOweFee {
         if (FeeConfigDto.BILL_TYPE_EVERY.equals(feeObj.getString("billType"))) {
             return;
         }
-
+        BillDto billDto = new BillDto();
+        billDto.setCommunityId(feeObj.getString("communityId"));
+        billDto.setConfigId(feeObj.getString("configId"));
+        billDto.setCurBill("T");
+        List<BillDto> billDtos = feeInnerServiceSMOImpl.queryBills(billDto);
+        if (billDtos == null || billDtos.size() < 1) {
+            return;
+        }
         BillOweFeeDto billOweFeeDto = new BillOweFeeDto();
         billOweFeeDto.setCommunityId(feeObj.getString("communityId"));
         billOweFeeDto.setFeeId(feeObj.getString("feeId"));
         billOweFeeDto.setState(BillOweFeeDto.STATE_FINISH_FEE);
-        int updateFlag = feeInnerServiceSMOImpl.updateBillOweFees(billOweFeeDto);
+        billOweFeeDto.setBillId(billDtos.get(0).getBillId());
+        feeInnerServiceSMOImpl.updateBillOweFees(billOweFeeDto);
 
-        if (updateFlag < 1) {
-            throw new IllegalArgumentException("修改账单失败");
-        }
     }
 
     /**
@@ -181,7 +187,8 @@ public class PayOweFeeImpl implements IPayOweFee {
         Assert.listOnlyOne(feeConfigDtos, "未找到费用配置");
         payFeePo.setEndTime(DateUtil.getFormatTimeString(endCalender.getTime(), DateUtil.DATE_FORMATE_STRING_A));
         feeObj.put("billType", feeConfigDtos.get(0).getBillType());
-        // 一次性收费类型,缴费后,则设置费用状态为收费结束、设置结束日期为费用项终止日期
+        feeObj.put("configId", feeConfigDtos.get(0).getConfigId());
+        // 一次性收费类型,缴费后,则设置费用状态为收费结束、设置结束日期为费用 项终止日期
         if (FeeFlagTypeConstant.ONETIME.equals(feeConfigDtos.get(0).getFeeFlag())) {
             payFeePo.setState(FeeStateConstant.END);
             payFeePo.setEndTime(feeConfigDtos.get(0).getEndTime());