zouyx 2 years ago
parent
commit
5d1af9c65a
  1. 2
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/StatisticsWarning/statisticsWarning.html
  2. 13
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html
  3. 15
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java
  4. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java

2
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/StatisticsWarning/statisticsWarning.html

@ -172,3 +172,5 @@
} }
} }
</script> </script>
</body>
</html>

13
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statisticalPanel.html

@ -186,8 +186,8 @@
</select> </select>
</li> </li>
<li> <li>
<a class="btn btn-success btn-sm" onclick="searchW()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-success btn-sm" onclick="searchP()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="restW()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-reset btn-sm" onclick="restP()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-warning btn-sm" onclick="download1()"><i class="fa fa-download"></i>导出</a> <a class="btn btn-warning btn-sm" onclick="download1()"><i class="fa fa-download"></i>导出</a>
</li> </li>
</ul> </ul>
@ -377,15 +377,14 @@
var prefix = ctx + "code/enforcementInspectionProgram"; var prefix = ctx + "code/enforcementInspectionProgram";
var prefix2 = ctx + "code/statisticalPanel"; var prefix2 = ctx + "code/statisticalPanel";
window.onload=function (){ window.onload=function (){
// wTable();
$("#quarter").hide(); $("#quarter").hide();
$("#month").hide(); $("#month").hide();
this.initData(); this.initData();
}; };
function restW(){ function restP(){
$('form').eq(0).trigger("reset"); $('form').eq(0).trigger("reset");
console.log($.common.formToJSON($('form').eq(0).attr('id'))); console.log($.common.formToJSON($('form').eq(0).attr('id')));
searchW(); this.initData();
timeType(); timeType();
} }
function timeType() { function timeType() {
@ -629,6 +628,10 @@
$("#" + hideTarget).hide(); $("#" + hideTarget).hide();
} }
function searchP(){
this.initData();
}
</script> </script>
</body> </body>
</html> </html>

15
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java

@ -1,5 +1,7 @@
package com.zdxt.code.controller; package com.zdxt.code.controller;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.hutool.core.bean.BeanUtil; 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.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.zdxt.code.domain.EnforcementInspectionProgram; import com.zdxt.code.domain.EnforcementInspectionProgram;
@ -53,8 +56,9 @@ public class EnforcementInspectionProgramController extends BaseController
@GetMapping("/statisticalPanel") @GetMapping("/statisticalPanel")
public String statisticalPanel() public String statisticalPanel(Model model)
{ {
model.addAttribute("yearList",yearMake());
return prefix2 + "/statisticalPanel"; return prefix2 + "/statisticalPanel";
} }
@ -249,5 +253,12 @@ public class EnforcementInspectionProgramController extends BaseController
} }
} }
public List<Integer> yearMake(){
int current= LocalDate.now().getYear();
List<Integer> yearList=new ArrayList<>();
for(int i=current;i>=2023;i--){
yearList.add(i);
}
return yearList;
}
} }

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java

@ -148,6 +148,7 @@ public class EnforcementRegistrationController extends BaseController
@GetMapping("/searchType") @GetMapping("/searchType")
public String searchType(EnforcementRegistration enforcementRegistration,Model model) public String searchType(EnforcementRegistration enforcementRegistration,Model model)
{ {
DecimalFormat str1=new DecimalFormat("0.00%");
model.addAttribute("year",enforcementRegistration.getYear()); model.addAttribute("year",enforcementRegistration.getYear());
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList1(enforcementRegistration); List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList1(enforcementRegistration);
System.out.println(1); System.out.println(1);
@ -162,7 +163,7 @@ public class EnforcementRegistrationController extends BaseController
checkName = iDictDataService.selectDictLabel("check_category", "01"); checkName = iDictDataService.selectDictLabel("check_category", "01");
} }
model.addAttribute("unite",uniteList.size()); 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")){ if(uniteDouble.equals("NaN")){
model.addAttribute("uniteDouble","-"); model.addAttribute("uniteDouble","-");
}else { }else {
@ -170,7 +171,7 @@ public class EnforcementRegistrationController extends BaseController
} }
model.addAttribute("check",checkName); model.addAttribute("check",checkName);
model.addAttribute("checkNumber",checkList.size()); 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")){ if(checkDouble.equals("NaN")){
model.addAttribute("checkDouble","-"); model.addAttribute("checkDouble","-");
}else { }else {
@ -254,7 +255,6 @@ public class EnforcementRegistrationController extends BaseController
DateTimeFormatter str=DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter str=DateTimeFormatter.ofPattern("yyyy-MM-dd");
DateTimeFormatter str3=DateTimeFormatter.ofPattern("MM"); DateTimeFormatter str3=DateTimeFormatter.ofPattern("MM");
LocalDate localDate=LocalDate.now(); LocalDate localDate=LocalDate.now();
localDate=localDate.minusMonths(3);
int quarter=(int)Math.ceil(Double.valueOf(str3.format(localDate))/3); int quarter=(int)Math.ceil(Double.valueOf(str3.format(localDate))/3);
LocalDate beginTime=localDate.withMonth(quarter*3-2).withDayOfMonth(1); LocalDate beginTime=localDate.withMonth(quarter*3-2).withDayOfMonth(1);
LocalDate endTime=localDate.withMonth(quarter*3).with(TemporalAdjusters.lastDayOfMonth()); LocalDate endTime=localDate.withMonth(quarter*3).with(TemporalAdjusters.lastDayOfMonth());

Loading…
Cancel
Save