Your Name 3 年 前
コミット
b6987665e0

+ 14 - 0
java110-db/src/main/resources/mapper/report/ReportFeeStatisticsServiceDaoImplMapper.xml

@@ -753,4 +753,18 @@
         group by a.owner_id,pfc.fee_type_cd,a.community_id
     </select>
 
+
+    <!-- 优惠费用-->
+    <select id="getDiscountFee" parameterType="Map" resultType="Map">
+        select SUM(t.discount_amount) discountFee
+        from pay_fee_detail_month t
+        where 1=1
+        and t.status_cd = '0'
+        and t.community_id = '2023052267100146'
+        and t.detail_id != '-1'
+        and t.discount_amount> 0
+        and t.cur_month_time > '2023-05-01'
+        and t.cur_month_time < '2023-06-01'
+    </select>
+
 </mapper>

+ 16 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportFeeStatisticsInnerServiceSMO.java

@@ -111,4 +111,20 @@ public interface IReportFeeStatisticsInnerServiceSMO {
      */
     @RequestMapping(value = "/getOwnerFeeSummary", method = RequestMethod.POST)
     List<Map> getOwnerFeeSummary(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 优惠费用
+     * @param queryStatisticsDto
+     * @return
+     */
+    @RequestMapping(value = "/getDiscountFee", method = RequestMethod.POST)
+    double getDiscountFee(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 滞纳金
+     * @param queryStatisticsDto
+     * @return
+     */
+    @RequestMapping(value = "/getLateFee", method = RequestMethod.POST)
+    double getLateFee(@RequestBody QueryStatisticsDto queryStatisticsDto);
 }

+ 32 - 4
service-report/src/main/java/com/java110/report/cmd/dataReport/QueryFeeDataReportCmd.java

@@ -5,16 +5,27 @@ 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.dto.report.QueryStatisticsDto;
+import com.java110.report.statistics.IBaseDataStatistics;
+import com.java110.report.statistics.IFeeStatistics;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
 
+import javax.xml.ws.Action;
 import java.text.ParseException;
+import java.util.List;
 
 /**
  * 查询费用类统计
  */
 @Java110Cmd(serviceCode = "dataReport.queryFeeDataReport")
 public class QueryFeeDataReportCmd extends Cmd {
+
+    @Autowired
+    private IFeeStatistics feeStatisticsImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
         Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
@@ -22,22 +33,37 @@ public class QueryFeeDataReportCmd extends Cmd {
         Assert.hasKeyAndValue(reqJson, "endDate", "未包含结束时间");
         String startDate = reqJson.getString("startDate");
         String endDate = reqJson.getString("endDate");
-        if(!startDate.contains(":")){
+        if (!startDate.contains(":")) {
             startDate += " 00:00:00";
-            reqJson.put("startDate",startDate);
+            reqJson.put("startDate", startDate);
         }
-        if(!endDate.contains(":")){
+        if (!endDate.contains(":")) {
             endDate += " 23:59:59";
-            reqJson.put("endDate",endDate);
+            reqJson.put("endDate", endDate);
         }
     }
 
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        QueryStatisticsDto queryStatisticsDto = new QueryStatisticsDto();
+        queryStatisticsDto.setStartDate(reqJson.getString("startDate"));
+        queryStatisticsDto.setEndDate(reqJson.getString("endDate"));
+        queryStatisticsDto.setCommunityId(reqJson.getString("communityId"));
+
+        JSONObject data = new JSONObject();
 
         // todo 查询 实收金额
+        double receivedFee = feeStatisticsImpl.getReceivedFee(queryStatisticsDto);
+        data.put("receivedFee", receivedFee);
+
         // todo 查询 优惠金额
+        double discountFee = feeStatisticsImpl.getDiscountFee(queryStatisticsDto);
+        data.put("discountFee", discountFee);
+
         // todo 查询 滞纳金
+        double lateFee = feeStatisticsImpl.getLateFee(queryStatisticsDto);
+        data.put("lateFee", lateFee);
+
         // todo 查询 账户预存
         // todo 查询 账户扣款
         // todo 查询 临时车收入
@@ -48,5 +74,7 @@ public class QueryFeeDataReportCmd extends Cmd {
         // todo 查询 充电金额
 
 
+
+        context.setResponseEntity(ResultVo.createResponseEntity(data));
     }
 }

+ 14 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeStatisticsServiceDao.java

@@ -110,4 +110,18 @@ public interface IReportFeeStatisticsServiceDao {
      * @return
      */
     List<Map> getOwnerFeeSummary(Map info);
+
+    /**
+     * 查询优惠费用
+     * @param info
+     * @return
+     */
+    double getDiscountFee(Map info);
+
+    /**
+     * 查询滞纳金
+     * @param info
+     * @return
+     */
+    double getLateFee(Map info);
 }

+ 32 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeStatisticsServiceDaoImpl.java

@@ -203,4 +203,36 @@ public class ReportFeeStatisticsServiceDaoImpl extends BaseServiceDao implements
         return infos;
     }
 
+    /**
+     * 查询优惠费用
+     * @param info
+     * @return
+     */
+    @Override
+    public double getDiscountFee(Map info) {
+        List<Map> infos = sqlSessionTemplate.selectList("reportFeeStatisticsServiceDaoImpl.getDiscountFee", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("discountFee").toString());
+    }
+
+    /**
+     * 查询滞纳金
+     * @param info
+     * @return
+     */
+    @Override
+    public double getLateFee(Map info) {
+        List<Map> infos = sqlSessionTemplate.selectList("reportFeeStatisticsServiceDaoImpl.getLateFee", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("lateFee").toString());
+    }
+
 }

+ 12 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeStatisticsInnerServiceSMOImpl.java

@@ -157,4 +157,16 @@ public class ReportFeeStatisticsInnerServiceSMOImpl extends BaseServiceSMO imple
         List<Map> info = reportFeeStatisticsServiceDaoImpl.getOwnerFeeSummary(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
         return info;
     }
+
+    @Override
+    public double getDiscountFee(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportFeeStatisticsServiceDaoImpl.getDiscountFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public double getLateFee(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportFeeStatisticsServiceDaoImpl.getLateFee(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
 }

+ 14 - 0
service-report/src/main/java/com/java110/report/statistics/IFeeStatistics.java

@@ -102,4 +102,18 @@ public interface IFeeStatistics {
      * @return
      */
     List<Map> getOwnerFeeSummary(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 优惠金额
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getDiscountFee(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 滞纳金
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getLateFee(QueryStatisticsDto queryStatisticsDto);
 }

+ 20 - 0
service-report/src/main/java/com/java110/report/statistics/impl/FeeStatisticsImpl.java

@@ -133,4 +133,24 @@ public class FeeStatisticsImpl implements IFeeStatistics {
         return reportFeeStatisticsInnerServiceSMOImpl.getOwnerFeeSummary(queryStatisticsDto);
     }
 
+    /**
+     * 优惠金额
+     * @param queryStatisticsDto
+     * @return
+     */
+    @Override
+    public double getDiscountFee(QueryStatisticsDto queryStatisticsDto) {
+        return reportFeeStatisticsInnerServiceSMOImpl.getDiscountFee(queryStatisticsDto);
+    }
+
+    /**
+     * 滞纳金
+     * @param queryStatisticsDto
+     * @return
+     */
+    @Override
+    public double getLateFee(QueryStatisticsDto queryStatisticsDto) {
+        return reportFeeStatisticsInnerServiceSMOImpl.getLateFee(queryStatisticsDto);
+    }
+
 }

+ 4 - 2
springboot/src/main/java/com/java110/boot/aop/PageProcessAspect.java

@@ -217,8 +217,10 @@ public class PageProcessAspect {
      */
     private void writeCookieInfo(IPageData pd, ServletRequestAttributes attributes) throws IOException {
         // 这里目前只写到组件级别,如果需要 写成方法级别 && "login".equals(pd.getComponentCode())
-        if (!StringUtil.isNullOrNone(pd.getToken()) ) {
-            HttpServletResponse response = attributes.getResponse();
+        HttpServletResponse response = attributes.getResponse();
+        String contentType = response.getHeader("content-type");
+
+        if (!StringUtil.isNullOrNone(pd.getToken()) && contentType.indexOf("application/octet-stream") < 0) {
             Cookie cookie = new Cookie(CommonConstant.COOKIE_AUTH_TOKEN, pd.getToken());
             cookie.setHttpOnly(true);
             cookie.setPath("/");