Your Name лет назад: 2
Родитель
Сommit
6c46f4ea19

+ 40 - 0
service-fee/src/main/java/com/java110/fee/cmd/fee/PayMonthFeeCmd.java

@@ -0,0 +1,40 @@
+package com.java110.fee.cmd.fee;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+
+import java.text.ParseException;
+
+/**
+ * 按月交费
+ */
+@Java110Cmd(serviceCode = "fee.payMonthFee")
+public class PayMonthFeeCmd extends Cmd {
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
+        Assert.hasKeyAndValue(reqJson, "primeRate", "未包含支付方式");
+        if (!reqJson.containsKey("selectMonthIds")) {
+            throw new CmdException("未包含缴费月份");
+        }
+
+        JSONArray selectMonthIds = reqJson.getJSONArray("selectMonthIds");
+        if (selectMonthIds == null || selectMonthIds.size() < 1) {
+            throw new CmdException("未包含缴费月份");
+        }
+
+        // todo 检查是否跳月了
+
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
+    }
+}

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

@@ -402,6 +402,7 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
 
     /**
      * 前台查询分页查询
+     *
      * @param reportFeeMonthStatisticsDto
      * @return
      */
@@ -992,16 +993,16 @@ public class GetReportFeeMonthStatisticsBMOImpl implements IGetReportFeeMonthSta
     }
 
     private void freshReportOweDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) {
+
+        int day = 0;
         for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) {
             try {
-                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                int day = DateUtil.daysBetween(DateUtil.getDateFromString(format.format(new Date()), DateUtil.DATE_FORMATE_STRING_A), DateUtil.getDateFromString(reportFeeMonthStatisticsDto.getFeeCreateTime(),
-                        DateUtil.DATE_FORMATE_STRING_A));
+                day = DateUtil.daysBetween(DateUtil.getDateFromStringA(reportFeeMonthStatisticsDto.getDeadlineTime()),
+                        DateUtil.getDateFromStringA(reportFeeMonthStatisticsDto.getFeeCreateTime()));
                 reportFeeMonthStatisticsDto.setOweDay(day);
             } catch (Exception e) {
                 logger.error("计算欠费天数失败", e);
             }
-
         }
     }
 

+ 1 - 1
service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java

@@ -241,7 +241,7 @@ public class GeneratorOweFeeInnerServiceSMOImpl implements IGeneratorOweFeeInner
     }
 
     @Override
-    public int computeOweFee(FeeDto feeDto) {
+    public int computeOweFee(@RequestBody FeeDto feeDto) {
         //刷入欠费金额
         computeFeeSMOImpl.computeEveryOweFee(feeDto);