Explorar el Código

样式调整,批量归档SQL查询调整

user5 hace 2 años
padre
commit
31827f708f

+ 6 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -100,6 +100,7 @@ import java.net.URI;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.nio.charset.Charset;
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
+import java.time.*;
 import java.util.*;
 import java.util.*;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 import java.util.zip.ZipFile;
@@ -5192,7 +5193,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 
 
 	/**
 	/**
 	 * B类项目批量归档
 	 * B类项目批量归档
-	 * 质量复核后40天后开始进行计算
+	 * 质量复核后90天后开始进行计算
 	 * @return
 	 * @return
 	 */
 	 */
 	@Transactional(readOnly = false)
 	@Transactional(readOnly = false)
@@ -5202,13 +5203,14 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_record_count");
 		List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_record_count");
 		if(adventCount.size()>0){
 		if(adventCount.size()>0){
 			//获取超期时间天数转int
 			//获取超期时间天数转int
-			Integer endingCount = Integer.parseInt(adventCount.get(0).getLabel());
+			//Integer endingCount = Integer.parseInt(adventCount.get(0).getLabel());
+			Integer endingCount = 90;
 			//设置开始时间为还有7天开始通知
 			//设置开始时间为还有7天开始通知
-			projectRecords.setStartCount(endingCount-7);
+			projectRecords.setStartCount(endingCount);
 			projectRecords.setEndingCount(endingCount);
 			projectRecords.setEndingCount(endingCount);
 		}
 		}
 
 
-		//查询B类项目未进行批量归档的项目(质量复核后40天)
+		//查询B类项目未进行批量归档的项目(质量复核后90天)
 		List<RuralProjectRecords> batchArchiveProjectReportedList = dao.getBatchArchiveProjectReportedList(projectRecords);
 		List<RuralProjectRecords> batchArchiveProjectReportedList = dao.getBatchArchiveProjectReportedList(projectRecords);
 
 
 
 

+ 13 - 11
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -233,13 +233,15 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
     public void getStatementCompanyComprehensiveOnQuarter() {
     public void getStatementCompanyComprehensiveOnQuarter() {
         final Calendar c = Calendar.getInstance();
         final Calendar c = Calendar.getInstance();
         Integer year = c.get(Calendar.YEAR);
         Integer year = c.get(Calendar.YEAR);
-            //当月最后一天
-            logger.info("-----------公司级—季度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementCompany(year,1,1);
-            logger.info("------------公司级—季度报表(结束)------------------");
-            logger.info("-----------部门级—季度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementOffice(year,1,1);
-            logger.info("------------部门级—季度报表(结束)------------------");
+        Integer month = c.get(Calendar.MONTH)+3; //第一个月从0开始,所以得到月份+1
+        Integer quarter = month/3;
+        //当月最后一天
+        logger.info("-----------公司级—季度报表(开始)------------------");
+        statementCompanyComprehensiveService.disposeStatementCompany(year,1,quarter);
+        logger.info("------------公司级—季度报表(结束)------------------");
+        logger.info("-----------部门级—季度报表(开始)------------------");
+        statementCompanyComprehensiveService.disposeStatementOffice(year,1,quarter);
+        logger.info("------------部门级—季度报表(结束)------------------");
 
 
     }
     }
 
 
@@ -298,19 +300,19 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         logger.info("------------项目超期未质量符合定时任务开始--------------------");
         logger.info("------------项目超期未质量符合定时任务开始--------------------");
         projectRecordsService.getJudgeAdvanceWeekNotice();
         projectRecordsService.getJudgeAdvanceWeekNotice();
         logger.info("------------项目超期未质量符合定时任务结束--------------------");*/
         logger.info("------------项目超期未质量符合定时任务结束--------------------");*/
-        logger.info("------------项目超期未质量符合定时任务开始--------------------");
+        /*logger.info("------------项目超期未质量符合定时任务开始--------------------");
         projectRecordsService.getJudgeAdvanceWeekNotice();
         projectRecordsService.getJudgeAdvanceWeekNotice();
-        logger.info("------------项目超期未质量符合定时任务结束--------------------");
+        logger.info("------------项目超期未质量符合定时任务结束--------------------");*/
 
 
         /*logger.info("-----------项目超期未归档定时任务开始(A类纸质归档)------------------");
         /*logger.info("-----------项目超期未归档定时任务开始(A类纸质归档)------------------");
         //projectRecordsService.saveProjectRecordListByPaperFiling();
         //projectRecordsService.saveProjectRecordListByPaperFiling();
         logger.info("------------项目超期未归档定时任务结束(A类纸质归档)------------------");
         logger.info("------------项目超期未归档定时任务结束(A类纸质归档)------------------");
         logger.info("-----------项目纸质归档长期未处理通知(开始)------------------");
         logger.info("-----------项目纸质归档长期未处理通知(开始)------------------");
         projectRecordsService.getPaperArchiveNotify();
         projectRecordsService.getPaperArchiveNotify();
-        logger.info("-----------项目纸质归档长期未处理通知(结束)------------------");
+        logger.info("-----------项目纸质归档长期未处理通知(结束)------------------");*/
         logger.info("-----------项目批量归档长期未处理通知(开始)------------------");
         logger.info("-----------项目批量归档长期未处理通知(开始)------------------");
         projectRecordsService.getBatchArchiveNotify();
         projectRecordsService.getBatchArchiveNotify();
-        logger.info("-----------项目批量归档长期未处理通知(结束)------------------");*/
+        logger.info("-----------项目批量归档长期未处理通知(结束)------------------");
         map.put("msg","处理完成");
         map.put("msg","处理完成");
         return map;
         return map;
     }
     }

+ 59 - 8
src/main/java/com/jeeplus/modules/statement/service/StatementCompanyComprehensiveService.java

@@ -18,6 +18,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.Month;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**
@@ -903,10 +908,19 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
         //查询A类纸质归档超期归档信息
         //查询A类纸质归档超期归档信息
         List<ReportDataEntity> getOverPaperFilingProjectList = dao.getOverPaperFilingProjectListAll(beginDate, endDate);
         List<ReportDataEntity> getOverPaperFilingProjectList = dao.getOverPaperFilingProjectListAll(beginDate, endDate);
 
 
-        //查询B类批量归档超期未归档信息
-        List<ReportDataEntity> getOverDueBatchArchiveProjectIdList = dao.getOverDueBatchArchiveProjectIdListAll();
-        //查询B类批量归档超期归档信息
-        List<ReportDataEntity> getOverBatchArchiveProjectList = dao.getOverPaperFilingProjectListAll(beginDate, endDate);
+        List<ReportDataEntity> getOverDueBatchArchiveProjectIdList = Lists.newArrayList();
+        List<ReportDataEntity> getOverBatchArchiveProjectList = Lists.newArrayList();
+        //判定是否是季度数据整理
+        if(1 == bigDateType){
+            //上个季度开始时间
+            String startDayOfQuarter = getStartOrEndDayOfQuarter(-1, true);
+            //上个季度结束时间
+            String endDayOfQuarter = getStartOrEndDayOfQuarter(0, true);
+            //查询B类批量归档超期未归档信息
+            getOverDueBatchArchiveProjectIdList = dao.getOverDueBatchArchiveProjectIdListAll();
+            //查询B类批量归档超期归档信息
+            getOverBatchArchiveProjectList = dao.getOverBatchArchiveProjectIdListAll(startDayOfQuarter, endDayOfQuarter);
+        }
 
 
         //查询项目未质量符合信息
         //查询项目未质量符合信息
         List<ReportDataEntity> getProjectReportDataList = dao.getProjectReportDataList();
         List<ReportDataEntity> getProjectReportDataList = dao.getProjectReportDataList();
@@ -2719,10 +2733,20 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
         //查询A类纸质归档超期归档信息
         //查询A类纸质归档超期归档信息
         List<ReportDataEntity> getOverPaperFilingProjectList = dao.getOfficeOverPaperFilingProjectListAll(beginDate, endDate);
         List<ReportDataEntity> getOverPaperFilingProjectList = dao.getOfficeOverPaperFilingProjectListAll(beginDate, endDate);
 
 
-        //查询B类批量归档超期未归档信息
-        List<ReportDataEntity> getOverDueBatchArchiveProjectIdList = dao.getOfficeOverDueBatchArchiveProjectIdListAll();
-        //查询B类批量归档超期归档信息
-        List<ReportDataEntity> getOverBatchArchiveProjectList = dao.getOfficeOverPaperFilingProjectListAll(beginDate, endDate);
+
+        List<ReportDataEntity> getOverDueBatchArchiveProjectIdList = Lists.newArrayList();
+        List<ReportDataEntity> getOverBatchArchiveProjectList = Lists.newArrayList();
+        //判定是否是季度数据整理
+        if(1 == bigDateType){
+            //上个季度开始时间
+            String startDayOfQuarter = getStartOrEndDayOfQuarter(-1, true);
+            //上个季度结束时间
+            String endDayOfQuarter = getStartOrEndDayOfQuarter(0, true);
+            //查询B类批量归档超期未归档信息
+            getOverDueBatchArchiveProjectIdList = dao.getOfficeOverDueBatchArchiveProjectIdListAll();
+            //查询B类批量归档超期归档信息
+            getOverBatchArchiveProjectList = dao.getOfficeOverBatchArchiveProjectIdListAll(startDayOfQuarter, endDayOfQuarter);
+        }
 
 
         //查询项目未质量符合信息
         //查询项目未质量符合信息
         List<ReportDataEntity> getProjectReportDataList = dao.getOfficeProjectReportDataList();
         List<ReportDataEntity> getProjectReportDataList = dao.getOfficeProjectReportDataList();
@@ -4619,4 +4643,31 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
 
 
         }
         }
     }
     }
+
+
+    /**
+     * 获取季度 第一天或最后一天
+     *
+     * @param quarters 0本季度,1下季度,-1上季度 以此类推
+     * @param isFirst  true获取开始时间 false获取结束时间
+     * @return java.lang.String
+     */
+    public static String getStartOrEndDayOfQuarter(long quarters, Boolean isFirst) {
+        LocalDate resDate = LocalDate.now().plusMonths(quarters * 3);
+        Month month = resDate.getMonth();
+        Month firstMonthOfQuarter = month.firstMonthOfQuarter();
+        Month endMonthOfQuarter = Month.of(firstMonthOfQuarter.getValue() + 2);
+        if (isFirst) {
+            resDate = LocalDate.of(resDate.getYear(), firstMonthOfQuarter, 1);
+        } else {
+            resDate = LocalDate.of(resDate.getYear(), endMonthOfQuarter, endMonthOfQuarter.length(resDate.isLeapYear()));
+        }
+
+        ZonedDateTime zonedDateTime = resDate.atStartOfDay(((ZoneId.systemDefault())));
+        Date date = Date.from(zonedDateTime.toInstant()); //ZoneDateTime 转换成Date
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String time = simpleDateFormat.format(date);
+
+        return time;
+    }
 }
 }

+ 1 - 1
src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java

@@ -238,7 +238,7 @@ public class WorkCalendarTaskService  {
      * B类项目批量归档质量复核后40天提醒通知
      * B类项目批量归档质量复核后40天提醒通知
      */
      */
     //设置每日凌晨30分调用通知方法
     //设置每日凌晨30分调用通知方法
-    //@Scheduled(cron= "0 30 0 * * ?")
+    @Scheduled(cron= "0 30 0 * * ?")
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
     public void getBatchArchiveNotify() {
     public void getBatchArchiveNotify() {
         logger.info("-----------B类项目批量归档长期未处理通知(开始)------------------");
         logger.info("-----------B类项目批量归档长期未处理通知(开始)------------------");

+ 14 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -4306,6 +4306,20 @@ public class WorkProjectNotifyController extends BaseController {
 							bzshbConsultant.setRole("技术负责人");
 							bzshbConsultant.setRole("技术负责人");
 							consultants.add(bzshbConsultant);
 							consultants.add(bzshbConsultant);
 						}
 						}
+						//2为工程咨询
+						if ("2".equals(ruralProjectRecords.getProjectType())){
+							model.addAttribute("identification", "projectReportData");
+							model.addAttribute("identifications","ReportDataRatingComments");
+							model.addAttribute("identificationstwo","projectReportDataLeader");
+						}
+						if ("1".equals(ruralProjectRecords.getProjectType())){
+							model.addAttribute("identification", "consultProjectReportData");
+							model.addAttribute("identifications"," consultReportDataRatingComments");
+							model.addAttribute("identificationstwo","consultProjectReportDataLeader");
+						}
+
+//						model.addAttribute("projectRecords",ruralProjectRecords.getProjectType());
+						model.addAttribute("identificationName","报告审核意见");
 						model.addAttribute("consultantinfo", consultants);
 						model.addAttribute("consultantinfo", consultants);
 						model.addAttribute("consultantCount", consultants.size());
 						model.addAttribute("consultantCount", consultants.size());
 						projectcontentinfo.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));
 						projectcontentinfo.setFileAttachmentList(ruralProjectRecordsService.disposeDataAttachment(projectcontentinfo.getFileAttachmentList()));

+ 5 - 5
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -2491,7 +2491,7 @@
 		left join sys_office so on so.id = su.office_id
 		left join sys_office so on so.id = su.office_id
 		<where>
 		<where>
 			/*判定是否紧急项目【紧急项目 质量复核状态为5】【非紧急项目 签发状态为5】*/
 			/*判定是否紧急项目【紧急项目 质量复核状态为5】【非紧急项目 签发状态为5】*/
-			IF( a.emergency_project = 0 or a.emergency_project is null , prdt.`status` = 5, prd.`status` = 5 )
+			IF( a.emergency_project = 0 or a.emergency_project is null , prdt.`status` = 5, prd.`status` = 5 or prd.`status` = 7 )
 			and a.submit_money = 1
 			and a.submit_money = 1
 			AND (a.paper_filing_status != 10 or a.paper_filing_status is null)
 			AND (a.paper_filing_status != 10 or a.paper_filing_status is null)
 			and a.del_flag = 0 and project_type in (1,2)
 			and a.del_flag = 0 and project_type in (1,2)
@@ -2529,7 +2529,7 @@
 		left join sys_office so on so.id = su.office_id
 		left join sys_office so on so.id = su.office_id
 		<where>
 		<where>
 		    /*判定是否紧急项目【紧急项目 质量复核状态为5】【非紧急项目 签发状态为5】*/
 		    /*判定是否紧急项目【紧急项目 质量复核状态为5】【非紧急项目 签发状态为5】*/
-			IF( a.emergency_project = 0 or a.emergency_project is null , prdt.`status` = 5, prd.`status` = 5 )
+			IF( a.emergency_project = 0 or a.emergency_project is null , prdt.`status` = 5, prd.`status` = 5 or prd.`status` = 7 )
 			<if test="projectName != null and projectName != ''">
 			<if test="projectName != null and projectName != ''">
 				AND a.project_name like concat(concat('%',#{projectName}),'%')
 				AND a.project_name like concat(concat('%',#{projectName}),'%')
 			</if>
 			</if>
@@ -4717,10 +4717,10 @@
 		,date_add(date_format(prd.audit_pass_date, '%Y-%m-%d'),interval #{endingCount} day) as adventDateDate
 		,date_add(date_format(prd.audit_pass_date, '%Y-%m-%d'),interval #{endingCount} day) as adventDateDate
 		,ifnull(pfp.status,0) as "batchArchiveStatus"
 		,ifnull(pfp.status,0) as "batchArchiveStatus"
 		FROM rural_project_records a
 		FROM rural_project_records a
-		LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id
+		LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id and pfp.del_flag = 0
 		left join work_contract_info wci on a.contract_id = wci.id
 		left join work_contract_info wci on a.contract_id = wci.id
-		left join project_report_data prd on prd.project_id = a.id
-		left join rural_project_report_record prr on prr.report_id = prd.id
+		left join project_report_data prd on prd.project_id = a.id and prd.del_flag = 0
+		left join rural_project_report_record prr on prr.report_id = prd.id and prr.del_flag = 0
 		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id and pmdrd.del_flag = 0
 		left join project_material_defect_record pmdrd on prd.id = pmdrd.report_id and pmdrd.del_flag = 0
 		left join sys_user u on u.id = a.create_by
 		left join sys_user u on u.id = a.create_by
 		left join sys_office o on o.id = a.office_id
 		left join sys_office o on o.id = a.office_id

+ 4 - 4
src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml

@@ -2380,8 +2380,8 @@
 		<where>
 		<where>
 			a.del_flag=0
 			a.del_flag=0
 			and a.status = 5
 			and a.status = 5
-			and (a.batch_archive_status is null or a.batch_archive_status == 7
-			and a.batch_archive_status == 5)
+			and (a.batch_archive_status is null or a.batch_archive_status = 7
+			and a.batch_archive_status = 5)
 			and a.over_batch_archive_status = 1
 			and a.over_batch_archive_status = 1
 			and pfr.status = 5
 			and pfr.status = 5
 			and pfr.audit_pass_date >= #{beginDate}
 			and pfr.audit_pass_date >= #{beginDate}
@@ -2457,8 +2457,8 @@
 		<where>
 		<where>
 			a.del_flag=0
 			a.del_flag=0
 			and a.status = 5
 			and a.status = 5
-			and (a.batch_archive_status is null or a.batch_archive_status == 7
-			and a.batch_archive_status == 5)
+			and (a.batch_archive_status is null or a.batch_archive_status = 7
+			and a.batch_archive_status = 5)
 			and a.over_batch_archive_status = 1
 			and a.over_batch_archive_status = 1
 			and pfr.status = 5
 			and pfr.status = 5
 			and pfr.audit_pass_date >= #{beginDate}
 			and pfr.audit_pass_date >= #{beginDate}

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/adminReportEditForm.jsp

@@ -532,7 +532,7 @@
 		}
 		}
 		function openDialogre(title,url,width,height,target,buttons) {
 		function openDialogre(title,url,width,height,target,buttons) {
 			var status = $("#status").val();
 			var status = $("#status").val();
-			if(5 != status){
+			if(5 != status && 7 != status){
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				return false;
 				return false;
 			}
 			}

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/all/adminReportEditFormAlls.jsp

@@ -539,7 +539,7 @@
 		}
 		}
 		function openDialogre(title,url,width,height,target,buttons) {
 		function openDialogre(title,url,width,height,target,buttons) {
 			var status = $("#status").val();
 			var status = $("#status").val();
-			if(5 != status){
+			if(5 != status && 7 != status){
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				return false;
 				return false;
 			}
 			}

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/adminReportEditForms.jsp

@@ -531,7 +531,7 @@
 		}
 		}
 		function openDialogre(title,url,width,height,target,buttons) {
 		function openDialogre(title,url,width,height,target,buttons) {
 			var status = $("#status").val();
 			var status = $("#status").val();
-			if(5 != status){
+			if(5 != status && 7 != status){
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				return false;
 				return false;
 			}
 			}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1624 - 838
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/projectRecordsMessageView.jsp


+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/view/reportIssueView.jsp

@@ -83,7 +83,7 @@
 
 
 		function openDialogre(title,url,width,height,target,buttons) {
 		function openDialogre(title,url,width,height,target,buttons) {
 			var status = $("#status").val();
 			var status = $("#status").val();
-			if(5 != status){
+			if(5 != status && 7 != status){
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				return false;
 				return false;
 			}
 			}

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/view/reportView.jsp

@@ -83,7 +83,7 @@
 
 
 		function openDialogre(title,url,width,height,target,buttons) {
 		function openDialogre(title,url,width,height,target,buttons) {
 			var status = $("#status").val();
 			var status = $("#status").val();
-			if(5 != status){
+			if(5 != status && 7 != status){
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				parent.layer.msg("报告未审批完成,无法下载!", {icon: 5});
 				return false;
 				return false;
 			}
 			}