Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

[user3] před 3 roky
rodič
revize
3e26597c02

+ 1 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/DownloadProjectRecords.java

@@ -423,6 +423,7 @@ public class DownloadProjectRecords extends ActEntity<DownloadProjectRecords> {
 	public String getRemarks() {
 		return remarks;
 	}
+	@ExcelField(title="登记日期", align=2, sort=11)
 	public Date getCreateDate() {
 		return createDate;
 	}

+ 1 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/DownloadProjectReporteds.java

@@ -423,6 +423,7 @@ public class DownloadProjectReporteds extends ActEntity<DownloadProjectReporteds
 	public String getRemarks() {
 		return remarks;
 	}
+	@ExcelField(title="登记日期", align=2, sort=11)
 	public Date getCreateDate() {
 		return createDate;
 	}

+ 57 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java

@@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -768,11 +769,39 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
                 }
             }
         }
+        downloadProjectRecordsListSort(recordsList);
         page.setList(recordsList);
         return page;
     }
 
     /**
+     * 归档导出时间排序
+     * @param list
+     */
+    private static void downloadProjectRecordsListSort(List<DownloadProjectRecords> list) {
+        Collections.sort(list, new Comparator<DownloadProjectRecords>() {
+            @Override
+            public int compare(DownloadProjectRecords o1, DownloadProjectRecords o2) {
+                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+                try {
+                    Date dt1 = o1.getCreateDate();
+                    Date dt2 = o2.getCreateDate();
+                    if (dt1.getTime() > dt2.getTime()) {
+                        return -1;
+                    } else if (dt1.getTime() < dt2.getTime()) {
+                        return 1;
+                    } else {
+                        return 0;
+                    }
+                } catch (Exception e) {
+                    return 1;
+                }
+
+            }
+        });
+    }
+
+    /**
      * 上报数据导出
      * @param page
      * @param projectRecords
@@ -960,10 +989,38 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
             }
             recordsList.addAll(recordsListOnType);
         }
+        downloadProjectReportedsListSort(recordsList);
         page.setList(recordsList);
         return page;
     }
 
+    /**
+     * 上报导出时间排序
+     * @param list
+     */
+    private static void downloadProjectReportedsListSort(List<DownloadProjectReporteds> list) {
+        Collections.sort(list, new Comparator<DownloadProjectReporteds>() {
+            @Override
+            public int compare(DownloadProjectReporteds o1, DownloadProjectReporteds o2) {
+                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+                try {
+                    Date dt1 = o1.getCreateDate();
+                    Date dt2 = o2.getCreateDate();
+                    if (dt1.getTime() > dt2.getTime()) {
+                        return -1;
+                    } else if (dt1.getTime() < dt2.getTime()) {
+                        return 1;
+                    } else {
+                        return 0;
+                    }
+                } catch (Exception e) {
+                    return 1;
+                }
+
+            }
+        });
+    }
+
     public Page<RuralProjectRecords> findPageByExport(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords) {
         //查询超期时间天数
         List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_count");

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

@@ -1640,7 +1640,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		}
 		//获取项目数据(获取已经超期的项目数据,进行修改超期状态)
 		List<RuralProjectRecords> projectNotReportList = dao.getProjectNotReportList(projectRecords);
-		List<RuralProjectRecords> projectNotReportListNoUrgency = dao.getProjectNotReportList(projectRecords);
+		List<RuralProjectRecords> projectNotReportListNoUrgency = dao.getProjectNotReportListNoUrgency(projectRecords);
 		projectNotReportList.addAll(projectNotReportListNoUrgency);
 		List<String> idList = Lists.newArrayList();
 		if(projectNotReportList.size()>0) {

+ 30 - 25
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -103,7 +103,12 @@
 		,sub.name as "projectMasterName"
 		,sob.name as "projectMasterOffice"
 		,a.submit_money as "submitMoney"
-		,(case when a.submit_money = '1' then 'B级' when a.submit_money = '2' then 'A级' else '' end) as projectScale
+		,(CASE
+		WHEN a.submit_money = '1' THEN
+		 (CASE WHEN emergency_project ='1' THEN 'B级紧急' ELSE 'B级非紧急' END)
+		WHEN a.submit_money = '2' THEN
+	'A级' ELSE ''
+END) as projectScale
 		,a.project_type as projectType,
 		wci.name AS "workContractInfo.name",
 		wct.id AS "workContractInfo.client.id",
@@ -658,10 +663,10 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and (timestampdiff(day,prd.audit_pass_date,now()) &lt;#{endingCount} or prd.audit_pass_date is null)
+					and a.emergency_project = 1 and (timestampdiff(day,prd.audit_pass_date,now()) &lt;#{endingCount} or prd.audit_pass_date is null)
 				</when>
 				<otherwise>
-					and (timestampdiff(day,prdt.audit_pass_date,now())&lt;#{endingCount} or prdt.audit_pass_date is null)
+					and prdt.status = 5 and prdt.audit_pass_date is not null and (timestampdiff(day,prdt.audit_pass_date,now())&lt;#{endingCount} or prdt.audit_pass_date is null)
 				</otherwise>
 			</choose>
 		</where>
@@ -692,10 +697,10 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,prr.record_date) &lt; #{endingCount}
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,prr.record_date) &lt; #{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,prr.record_date) &lt; #{endingCount}
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,prr.record_date) &lt; #{endingCount}
 				</otherwise>
 			</choose>
 		</where>
@@ -725,10 +730,10 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 				/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,now())>#{endingCount}
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,now())>=#{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,now())>#{endingCount}
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,now())>=#{endingCount}
 				</otherwise>
 			</choose>
 			<if test="beginDate !=null">
@@ -744,7 +749,7 @@
 	<select id="getExeedRecordList" resultType="DownloadProjectRecords" >
 		SELECT
 		<include refid="recordDownloadSql"/>
-		,ifnull(prr.status,0) as  "projectReportRecordStatus"
+		,"7" as  "projectReportRecordStatus"
 		,prr.record_date as  "recordStartAuditDate"
 		<choose>
 			<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
@@ -765,10 +770,10 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 				/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,prr.record_date)>#{endingCount}
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,prr.record_date)>=#{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,prr.record_date)>#{endingCount}
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,prr.record_date)>=#{endingCount}
 				</otherwise>
 			</choose>
 			<if test="beginDate !=null">
@@ -820,10 +825,10 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and (timestampdiff(day,prd.audit_pass_date,now()) &lt;#{endingCount} or prd.audit_pass_date is null)
+					and a.emergency_project = 1 and (timestampdiff(day,prd.audit_pass_date,now()) &lt;#{endingCount} or prd.audit_pass_date is null)
 				</when>
 				<otherwise>
-					and (timestampdiff(day,prdt.audit_pass_date,now())&lt;#{endingCount} or prdt.audit_pass_date is null)
+					and prdt.status = 5 and prdt.audit_pass_date is not null and (timestampdiff(day,prdt.audit_pass_date,now())&lt;#{endingCount} or prdt.audit_pass_date is null)
 				</otherwise>
 			</choose>
 		</where>
@@ -854,12 +859,12 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 					order by create_date
 					limit 1))&lt;#{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 					order by create_date
 					limit 1))&lt;#{endingCount}
 				</otherwise>
@@ -893,10 +898,10 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,now())>#{endingCount}
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,now())>=#{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,now())>#{endingCount}
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,now())>=#{endingCount}
 				</otherwise>
 			</choose>
 			<if test="beginDate !=null">
@@ -912,7 +917,7 @@
 	<select id="getExeedReportedList" resultType="DownloadProjectReporteds" >
 		SELECT
 		<include refid="recordDownloadSql"/>
-		,ifnull(rprr.report_status,0) as  "projectReportRecordStatus"
+		,"7" as  "projectReportRecordStatus"
 		,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 		order by create_date
 		limit 1) as "recordStartAuditDate"
@@ -939,14 +944,14 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 					order by create_date
-					limit 1))>#{endingCount}
+					limit 1))>=#{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 					order by create_date
-					limit 1))>#{endingCount}
+					limit 1))>=#{endingCount}
 				</otherwise>
 			</choose>
 			<if test="beginDate !=null">
@@ -990,14 +995,14 @@
 			<choose>
 				<when test="emergencyProject != null and emergencyProject != '' and emergencyProject == 1">
 					/*B类紧急*/
-					and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
+					and a.emergency_project = 1 and timestampdiff(day,prd.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 					order by create_date
-					limit 1))>#{endingCount}
+					limit 1))>=#{endingCount}
 				</when>
 				<otherwise>
-					and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
+					and prdt.status = 5 and prdt.audit_pass_date is not null and timestampdiff(day,prdt.audit_pass_date,(select create_date from work_activity_process wap where wap.process_instance_id = rprr.process_instance_id
 					order by create_date
-					limit 1))>#{endingCount}
+					limit 1))>=#{endingCount}
 				</otherwise>
 			</choose>
 			<if test="beginDate !=null">