Browse Source

修改bug

v6
Chendy 1 year ago
parent
commit
774788bdd6
  1. 129
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html
  2. 2
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/nonRegistration/nonRegistrationView.html
  3. 37
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java
  4. 12
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

129
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/staticProgram.html

@ -38,12 +38,12 @@
<input type="text" name="bureauDeptName"/> <input type="text" name="bureauDeptName"/>
</li> </li>
<li> <li>
<p>时段:</p> <p>发布时段:</p>
<select id="year" name="year"> <select id="year" name="year">
<!--<option value="2024">2024</option>--> <!--<option value="2024">2024</option>-->
<option th:each="y:${yearList}" th:text="${y}" th:value="${y}"></option> <option th:each="y:${yearList}" th:text="${y}" th:value="${y}"></option>
</select> </select>
<select id="dateSearch" name="dateSearch" onchange="timeType()"> <select id="dateSearch" name="dateSearch" onchange="timeChange()">
<option value="year">年度</option> <option value="year">年度</option>
<option value="quarter">季度</option> <option value="quarter">季度</option>
<option value="month">月度</option> <option value="month">月度</option>
@ -152,23 +152,13 @@
var echarts2 = echarts.init(document.getElementById('echars3')); var echarts2 = echarts.init(document.getElementById('echars3'));
var echarts3 = echarts.init(document.getElementById('echars4')); var echarts3 = echarts.init(document.getElementById('echars4'));
window.onload = function () { window.onload = function () {
// selectDate();
staticAllProgram();
/*staticProgramWithAll();*/
/*staticProgramWithYear();
staticProgramWithQuarter();
staticProgramWithMonth();*/
//初始化默认隐藏
/*$("#yearDom").hide();
$("#quarterDom").hide();
$("#monthDom").hide();*/
$("#quarter").hide(); $("#quarter").hide();
$("#month").hide(); $("#month").hide();
$("#day").hide(); $("#day").hide();
// $("#select-time").hide();
$("#chart-box-1").hide(); $("#chart-box-1").hide();
$("#chart-box-2").hide(); $("#chart-box-2").hide();
$("#chart-box-3").hide(); $("#chart-box-3").hide();
staticAllProgram();
echartsTotal(); echartsTotal();
$(".fixed-table-toolbar").hide(); $(".fixed-table-toolbar").hide();
$("#detail").hide(); $("#detail").hide();
@ -359,39 +349,6 @@
}); });
} }
/**
*
*/
/*function changeSelect(){
var options = $("#timeType option:selected");
if("year" == options.val()){
$("#yearDom").show();
$("#quarterDom").hide();
$("#monthDom").hide();
document.getElementById("quarter").selectedIndex = -1;
$("input[name='month']").val("")
}else if("quarter" == options.val()){
$("#yearDom").hide();
$("#quarterDom").show();
$("#monthDom").hide();
$("input[name='year']").val("");
document.getElementById("quarter").selectedIndex = -1;
$("input[name='month']").val("")
}else if("month" == options.val()){
$("#yearDom").hide();
$("#quarterDom").hide();
$("#monthDom").show();
$("input[name='year']").val("");
document.getElementById("quarter").selectedIndex = -1;
$("input[name='month']").val("")
}
if("year" != options.val()){
$("input[name='year']").val("");
var date = new Date();
$("#yearDate").text(date.getFullYear());
}
}*/
$(function() { $(function() {
var options = { var options = {
@ -485,7 +442,7 @@
}, },
{ {
field : 'enforcementTime', field : 'enforcementTime',
title : '上传时间', title : '发布时间',
align : 'center' align : 'center'
}, },
{ {
@ -585,79 +542,35 @@
function query() { function query() {
var params = $("#formId").bootstrapTable('getOptions'); var params = $("#formId").bootstrapTable('getOptions');
console.log(params);
$("#bootstrap-table").bootstrapTable('refresh', params); $("#bootstrap-table").bootstrapTable('refresh', params);
/*this.changeEcharts();*/
staticAllProgram(); staticAllProgram();
$("#detail").hide();
} }
function queryP2() { function queryP2() {
echartsTotal(); echartsTotal();
} }
function timeType() { function timeChange() {
var dateSearch = document.getElementById("dateSearch"); $("#quarter option:first").prop("selected",true);
console.log(dateSearch.value); $("#month option:first").prop("selected",true);
/* if(dateSearch.value=="quarter"){ $("#quarter").hide();
$("#quarter").show(); $("#month").hide();
$("#month").hide(); $("#day").hide();
document.getElementById("month").value=""; var type = $("#dateSearch option:selected").val();
}else if(dateSearch.value=="month"){ if(type==="year")$("#year").show();
$("#quarter").hide(); if(type==="quarter") $("#quarter").show();
document.getElementById("quarter").value=""; if(type==="month") $("#month").show();
$("#month").show(); if(type==="day"){
}else {
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").hide();
document.getElementById("month").value="";
}*/
if(dateSearch.value=="quarter"){
$("#year").show();
if(document.getElementById("year").value==''){
document.getElementById("year").value=document.getElementById("year").options[0].value;
}
$("#day").hide();
document.getElementById("beginTime").value="";
document.getElementById("endTime").value="";
$("#quarter").show();
$("#month").hide();
document.getElementById("month").value="";
}else if(dateSearch.value=="month"){
$("#year").show();
if(document.getElementById("year").value==''){
document.getElementById("year").value=document.getElementById("year").options[0].value;
}
$("#day").hide();
document.getElementById("beginTime").value="";
document.getElementById("endTime").value="";
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").show();
}else if(dateSearch.value=="day"){
$("#day").show();
$("#year").hide(); $("#year").hide();
document.getElementById("year").value=""; $("#day").show();
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").hide();
document.getElementById("month").value="";
}else {
$("#year").show();
if(document.getElementById("year").value==''){
document.getElementById("year").value=document.getElementById("year").options[0].value;
}
$("#day").hide();
document.getElementById("beginTime").value="";
document.getElementById("endTime").value="";
$("#quarter").hide();
document.getElementById("quarter").value="";
$("#month").hide();
document.getElementById("month").value="";
} }
} }
function resetP(){ function resetP(){
$("#year").show();
$("#quarter").hide();
$("#month").hide();
$("#day").hide();
$('form').eq(0).trigger("reset"); $('form').eq(0).trigger("reset");
query(); query();
timeType();
} }
function resetP2(){ function resetP2(){
$('form').eq(1).trigger("reset"); $('form').eq(1).trigger("reset");

2
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/nonRegistration/nonRegistrationView.html

@ -201,6 +201,8 @@
// 时间选择 // 时间选择
function timeChange() { function timeChange() {
$("#quarter option:first").prop("selected",true);
$("#month option:first").prop("selected",true);
$("#quarter").hide(); $("#quarter").hide();
$("#month").hide(); $("#month").hide();
$("#selectTime").hide(); $("#selectTime").hide();

37
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java

@ -17,6 +17,7 @@ import com.zdxt.auth.project.system.notice.mapper.NoticeMapper;
import com.zdxt.code.domain.dto.EnforcementInspectionProgramDto; import com.zdxt.code.domain.dto.EnforcementInspectionProgramDto;
import com.zdxt.common.annotation.DataScope; import com.zdxt.common.annotation.DataScope;
import com.zdxt.common.util.DateUtils; import com.zdxt.common.util.DateUtils;
import com.zdxt.common.util.StringUtils;
import com.zdxt.common.zdxtFile.ZdxtFileCommon; import com.zdxt.common.zdxtFile.ZdxtFileCommon;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.pdfbox.Loader; import org.apache.pdfbox.Loader;
@ -280,7 +281,41 @@ public class EnforcementInspectionProgramServiceImpl implements IEnforcementInsp
@DataScope(deptField = "enforcement_department_id") @DataScope(deptField = "enforcement_department_id")
public List<EnforcementInspectionProgram> getPlanInfo(EnforcementInspectionProgramDto dto) { public List<EnforcementInspectionProgram> getPlanInfo(EnforcementInspectionProgramDto dto) {
getPublish(dto); getPublish(dto);
return enforcementInspectionProgramMapper.getPlanInfo(dto); List<EnforcementInspectionProgram> list= enforcementInspectionProgramMapper.getPlanInfo(dto);
if(CollectionUtils.isNotEmpty(list)){
list.forEach(li->{
StringBuilder title=new StringBuilder();
if(StringUtils.isNotEmpty(li.getBureauDeptName()))title.append(li.getBureauDeptName());
title.append(li.getPlanYear());
title.append("年");
if(li.getTimeType().equals("year")){
title.append(li.getPlanName());
}else if(li.getTimeType().equals("quarter")){
title.append(getQurText(li.getQuarter()));
}else if(li.getTimeType().equals("month")){
title.append(li.getMouth().length()==1?"0"+li.getMouth():li.getMouth());
title.append("月");
}
title.append(li.getPlanName());
li.setPlanName(title.toString());
});
}
return list;
}
// 季度text
private String getQurText(String qua){
switch (qua){
case "1":
return "第一季度";
case "2":
return "第二季度";
case "3":
return "第三季度";
case "4":
return "第四季度";
}
return "";
} }
/** /**

12
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

@ -452,7 +452,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getPlanInfo" parameterType="EnforcementInspectionProgramDto" resultType="EnforcementInspectionProgram"> <select id="getPlanInfo" parameterType="EnforcementInspectionProgramDto" resultType="EnforcementInspectionProgram">
SELECT SELECT
id,plan_name,bureau_dept_name,enforcement_area,enforcement_time id,plan_name,bureau_dept_name,enforcement_area,enforcement_time,time_type,mouth,plan_year,quarter
FROM FROM
enforcement_inspection_program enforcement_inspection_program
<where> <where>
@ -460,19 +460,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and bureau_dept_name like concat('%', #{bureauDeptName}, '%') and bureau_dept_name like concat('%', #{bureauDeptName}, '%')
</if> </if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(create_time,'%Y-%m-%d') >= #{beginTime} and DATE_FORMAT(enforcement_time,'%Y-%m-%d') >= #{beginTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and #{endTime} >= DATE_FORMAT(create_time,'%Y-%m-%d') and #{endTime} >= DATE_FORMAT(enforcement_time,'%Y-%m-%d')
</if> </if>
<if test="year != null and year != ''"> <if test="year != null and year != ''">
and YEAR(create_time) = #{year} and YEAR(enforcement_time) = #{year}
</if> </if>
<if test="quarter != null and quarter != '' "> <if test="quarter != null and quarter != '' ">
and QUARTER(create_time) = #{quarter} and QUARTER(enforcement_time) = #{quarter}
</if> </if>
<if test="month != null and month != '' "> <if test="month != null and month != '' ">
and DATE_FORMAT(create_time, '%m') = #{month} and DATE_FORMAT(enforcement_time, '%m') = #{month}
</if> </if>
<if test="params.dataScope != null and params.dataScope != ''"> <if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope} ${params.dataScope}

Loading…
Cancel
Save