瀏覽代碼

修改首页付款数据图表根据type查询数据

LiFei 5 年之前
父節點
當前提交
446ea83a4b

+ 8 - 3
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/controller/HlwPaymentDetailController.java

@@ -367,17 +367,22 @@ public class HlwPaymentDetailController extends JeecgController<HlwPaymentDetail
     @AutoLog(value = "获取首页中间左侧付款图表所需数据")
     @ApiOperation(value = "获取首页中间左侧付款图表所需数据", notes = "获取首页中间左侧付款图表所需数据")
     @GetMapping(value = "/getIndexMiddlePaymentChartInfo")
-    public Result<?> getIndexMiddlePaymentChartInfo() throws ParseException {
+    public Result<?> getIndexMiddlePaymentChartInfo(@RequestParam(name = "type", required = true) String type) throws ParseException {
         //存放返回数据结果
         List list = new ArrayList();
         //存放图表所需年月+付款数据
         List<Map> list1 = new ArrayList<>();
         //当天时间
-        LocalDate localDate = LocalDate.now();
+        LocalDate lastDate = LocalDate.now();
         //前一个月开始倒推6个月
         for (int i = 0; i < 6; i++) {
             Map map = new HashMap();
-            LocalDate lastDate = localDate.minusMonths(i + 1);
+            //type=1获取前6个数据,type=2获取前前6个月数据
+            if("1".equals(type)){
+                 lastDate = lastDate.minusMonths(i + 1);
+            }else{
+                 lastDate = lastDate.minusMonths(i + 7);
+            }
             Double monthPayment1 = hlwPaymentDetailService.monthPayment(DateUtils.asDate(lastDate));
             map.put("value", monthPayment1);
             map.put("x", lastDate.toString().substring(0, 7));