From 5d1af9c65a30b19ebecc0984125f022dcfefb90f Mon Sep 17 00:00:00 2001 From: zouyx <1798599149@qq.com> Date: Sun, 3 Nov 2024 16:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/StatisticsWarning/statisticsWarning.html | 4 +++- .../code/statistical/statisticalPanel.html | 13 ++++++++----- .../EnforcementInspectionProgramController.java | 15 +++++++++++++-- .../EnforcementRegistrationController.java | 6 +++--- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/StatisticsWarning/statisticsWarning.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/StatisticsWarning/statisticsWarning.html index d4413b93..a87172b2 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/StatisticsWarning/statisticsWarning.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/StatisticsWarning/statisticsWarning.html @@ -171,4 +171,6 @@ document.getElementById("month").value=""; } } - \ No newline at end of file + + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html index ee41dc55..407d1962 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html @@ -186,8 +186,8 @@
  • -  搜索 -  重置 +  搜索 +  重置 导出
  • @@ -377,15 +377,14 @@ var prefix = ctx + "code/enforcementInspectionProgram"; var prefix2 = ctx + "code/statisticalPanel"; window.onload=function (){ - // wTable(); $("#quarter").hide(); $("#month").hide(); this.initData(); }; - function restW(){ + function restP(){ $('form').eq(0).trigger("reset"); console.log($.common.formToJSON($('form').eq(0).attr('id'))); - searchW(); + this.initData(); timeType(); } function timeType() { @@ -629,6 +628,10 @@ $("#" + hideTarget).hide(); } + function searchP(){ + this.initData(); + } + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java index f94b7bc9..9e5cef06 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java @@ -1,5 +1,7 @@ package com.zdxt.code.controller; +import java.time.LocalDate; +import java.util.ArrayList; import java.util.List; import cn.hutool.core.bean.BeanUtil; @@ -14,6 +16,7 @@ import com.zdxt.common.util.TableDataInfo; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import com.zdxt.code.domain.EnforcementInspectionProgram; @@ -53,8 +56,9 @@ public class EnforcementInspectionProgramController extends BaseController @GetMapping("/statisticalPanel") - public String statisticalPanel() + public String statisticalPanel(Model model) { + model.addAttribute("yearList",yearMake()); return prefix2 + "/statisticalPanel"; } @@ -249,5 +253,12 @@ public class EnforcementInspectionProgramController extends BaseController } } - + public List yearMake(){ + int current= LocalDate.now().getYear(); + List yearList=new ArrayList<>(); + for(int i=current;i>=2023;i--){ + yearList.add(i); + } + return yearList; + } } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java index 955e1e87..cdb73667 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java @@ -148,6 +148,7 @@ public class EnforcementRegistrationController extends BaseController @GetMapping("/searchType") public String searchType(EnforcementRegistration enforcementRegistration,Model model) { + DecimalFormat str1=new DecimalFormat("0.00%"); model.addAttribute("year",enforcementRegistration.getYear()); List list = enforcementRegistrationService.selectEnforcementRegistrationList1(enforcementRegistration); System.out.println(1); @@ -162,7 +163,7 @@ public class EnforcementRegistrationController extends BaseController checkName = iDictDataService.selectDictLabel("check_category", "01"); } model.addAttribute("unite",uniteList.size()); - String uniteDouble=String.format("%.3f",((double)uniteList.size()/list.size())); + String uniteDouble=str1.format((double)uniteList.size()/list.size()); if(uniteDouble.equals("NaN")){ model.addAttribute("uniteDouble","-"); }else { @@ -170,7 +171,7 @@ public class EnforcementRegistrationController extends BaseController } model.addAttribute("check",checkName); model.addAttribute("checkNumber",checkList.size()); - String checkDouble=String.format("%.3f",((double)checkList.size()/list.size())); + String checkDouble=str1.format((double)checkList.size()/list.size()); if(checkDouble.equals("NaN")){ model.addAttribute("checkDouble","-"); }else { @@ -254,7 +255,6 @@ public class EnforcementRegistrationController extends BaseController DateTimeFormatter str=DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter str3=DateTimeFormatter.ofPattern("MM"); LocalDate localDate=LocalDate.now(); - localDate=localDate.minusMonths(3); int quarter=(int)Math.ceil(Double.valueOf(str3.format(localDate))/3); LocalDate beginTime=localDate.withMonth(quarter*3-2).withDayOfMonth(1); LocalDate endTime=localDate.withMonth(quarter*3).with(TemporalAdjusters.lastDayOfMonth());