Explorar el Código

归档上报数据导出内容整理

user5 hace 3 años
padre
commit
750176384d

+ 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");

+ 8 - 3
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",
@@ -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">
@@ -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"