瀏覽代碼

考勤明细导出修改

LiFei 4 年之前
父節點
當前提交
4d3faf915a

+ 4 - 1
happy-job-base-system/src/main/webapp/webpage/modules/wspunch/wsPunchClockList.js

@@ -215,7 +215,10 @@ $(document).ready(function() {
             if(sortName != undefined && sortOrder != undefined){
                 values = values + "orderBy=" + sortName + " "+sortOrder;
             }
-
+             if(!searchParam.startPunchClock || !searchParam.endPunchClock){
+            	jp.error("请先选择上下班卡时间再导出")
+				 return;
+			 }
 			jp.downloadFile('${ctx}/wspunch/wsPunchClock/export?'+values);
 	  })
 

+ 5 - 4
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/wspunch/entity/WsPunchClock.java

@@ -111,7 +111,7 @@ public class WsPunchClock extends DataEntity<WsPunchClock> {
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @NotNull(message = "上班卡不能为空")
-    @ExcelField(title = "上班卡时间", align = 2, sort = 4)
+    @ExcelField(title = "上班卡时间", align = 2, sort = 5)
     public Date getStartPunchClock() {
         return startPunchClock;
     }
@@ -137,7 +137,7 @@ public class WsPunchClock extends DataEntity<WsPunchClock> {
     }
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @ExcelField(title = "下班卡时间", align = 2, sort = 5)
+    @ExcelField(title = "下班卡时间", align = 2, sort = 6)
     public Date getEndPunchClock() {
         return endPunchClock;
     }
@@ -146,7 +146,7 @@ public class WsPunchClock extends DataEntity<WsPunchClock> {
         this.endPunchClock = endPunchClock;
     }
 
-    @ExcelField(title = "打卡工时", align = 2, sort = 6)
+    @ExcelField(title = "打卡工时", align = 2, sort = 7)
     public Integer getDuration() {
         return duration;
     }
@@ -155,6 +155,7 @@ public class WsPunchClock extends DataEntity<WsPunchClock> {
         this.duration = duration;
     }
 
+    @ExcelField(title = "所在企业", align = 2, sort = 4)
     public String getCompanyName() {
         return companyName;
     }
@@ -299,7 +300,7 @@ public class WsPunchClock extends DataEntity<WsPunchClock> {
         this.week = week;
     }
 
-    @ExcelField(title = "状态", align = 2, sort = 7, dictType = "grant_status")
+    @ExcelField(title = "状态", align = 2, sort = 8, dictType = "grant_status")
     public Integer getGrantStatus() {
         return grantStatus;
     }

+ 4 - 1
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/wspunch/web/WsPunchClockController.java

@@ -3,6 +3,8 @@
  */
 package com.jeeplus.modules.wspunch.web;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.Map;
 
@@ -173,9 +175,10 @@ public class WsPunchClockController extends BaseController {
     public AjaxJson exportFile(WsPunchClock wsPunchClock, HttpServletRequest request, HttpServletResponse response) {
 		AjaxJson j = new AjaxJson();
 		try {
+			DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
             String fileName = "打卡信息表"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
             Page<WsPunchClock> page = wsPunchClockService.findPage1(new Page<WsPunchClock>(request, response, -1), wsPunchClock);
-    		new ExportExcel("考勤明细表", WsPunchClock.class).setDataList(page.getList()).write(response, fileName).dispose();
+    		new ExportExcel("考勤明细表("+sdf.format(wsPunchClock.getStartPunchClock())+"~"+sdf.format(wsPunchClock.getEndPunchClock())+")", WsPunchClock.class).setDataList(page.getList()).write(response, fileName).dispose();
     		j.setSuccess(true);
     		j.setMsg("导出成功!");
     		return j;