ysh 2 years ago
parent
commit
df687995dd

+ 24 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/controller/bdClockinMonthController.java

@@ -244,11 +244,32 @@ public class bdClockinMonthController extends JeecgController<bdClockinMonth, Ib
    * 导出excel
    *
    * @param request
-   * @param bdClockinMonth
+   * @param clockinMonth
    */
   @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, bdClockinMonth bdClockinMonth) {
-      return super.exportXls(request, bdClockinMonth, bdClockinMonth.class, "考勤月报");
+  public ModelAndView exportXls(HttpServletRequest request, bdClockinMonth clockinMonth) {
+
+	  Page<bdClockinMonth> page = new Page<bdClockinMonth>(1,1000);
+	  Map<String,String> map = new HashMap<>();
+	  if(clockinMonth.getMonthTime() == null || clockinMonth.getMonthTime() == ""){
+		  DateFormat sdf = new SimpleDateFormat("yyyy-MM");
+		  map.put("months",sdf.format(new Date()));
+	  }else{
+		  map.put("months",clockinMonth.getMonthTime());
+	  }
+	  if(clockinMonth.getPersonName() != null && clockinMonth.getPersonName() != ""){
+		  map.put("personName", StringUtils.deleteWhitespace(clockinMonth.getPersonName()));
+	  }
+	  if(clockinMonth.getPersonId() != null && clockinMonth.getPersonId() != ""){
+		  map.put("personId", StringUtils.deleteWhitespace(clockinMonth.getPersonId()));
+	  }
+	  if(clockinMonth.getSyU8() != null){
+		  map.put("syU8", clockinMonth.getSyU8().toString());
+	  }
+
+	  Page<bdClockinMonth> pageList = bdClockinMonthService.selectByPage(page,map);
+
+      return super.exportXls2(request, pageList.getRecords(), bdClockinMonth.class, "考勤月报");
   }
 
   /**

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/controller/viewClockInController.java

@@ -432,8 +432,8 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
 			 	StringBuffer sb = new StringBuffer();
 			 	for(Map<String,Object> m:map1){
 			 		i++;
-					sb.append("工号:"+m.get("person"));
-					sb.append("/"+m.get("overTime")+"加班信息还未处理,无法生成月报");
+					sb.append("工号:"+m.get("username"));
+					sb.append("/"+m.get("overTime")+"加班信息还未处理,无法生成月报;   ");
 					if(i > 10){
 						break;
 					}

+ 14 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/entity/bdClockinMonth.java

@@ -29,11 +29,19 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 @ApiModel(value="bd_clockin_month对象", description="考勤月报")
 public class bdClockinMonth {
 
-//	@TableField(exist = false)
+	@TableField(exist = false)
+	@Excel(name = "日期", width = 15)
 	private String monthdate;//前台传入月份
+	@TableField(exist = false)
+	@Excel(name = "人员姓名", width = 15)
 	private String realname;//人员档案中的姓名
+	@TableField(exist = false)
+	@Excel(name = "工号", width = 15)
 	private String username;//人员档案中工号
 
+	@TableField(exist = false)
+	private String userId;//人员档案中id
+
 	private String basePay;//基本工资1
 	private String basePay_2;//
 	private String wagesBase;//缴交基数1
@@ -83,15 +91,13 @@ public class bdClockinMonth {
     @ApiModelProperty(value = "主键id考勤月报")
 	private String id;
 	/**月报月份*/
-	@Excel(name = "日期", width = 15)
     @ApiModelProperty(value = "月报月份")
 	private String monthTime;
 	/**人员姓名*/
-	@Excel(name = "人员姓名", width = 15)
     @ApiModelProperty(value = "人员姓名")
 	private String personName;
 	/**人员编码*/
-	@Excel(name = "工号", width = 15)
+
     @ApiModelProperty(value = "人员编码")
 	private String personCode;
 	@Excel(name = "考勤天数", width = 15)
@@ -107,6 +113,10 @@ public class bdClockinMonth {
 	private String holidayTimeSj;//本月请假时长(事假小时)1
 	@Excel(name = "病假时长(天)", width = 15)
 	private String holidayTimeBj;//本月请假时长(病假天数)1
+
+	@TableField(exist = false)
+	@Excel(name = "是否同步U8", width = 15)
+	private String syInfo;//虚拟字段 仅用于导出
 	/**人员主键*/
     @ApiModelProperty(value = "人员主键")
 	private String personId;

+ 10 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/mapper/xml/bdClockinMonthMapper.xml

@@ -4,13 +4,22 @@
 
     <select id="selectByPage" resultType="org.jeecg.modules.viewClockIn.entity.bdClockinMonth">
 
-        select #{map.months} monthdate, b.realname realname,b.username username,a.*
+        select #{map.months} monthdate,b.id user_id, b.realname realname,b.username username,
+            case
+                when sy_u8 = 0 then "未同步"
+                when sy_u8 = 1 then "已同步"
+                else null
+            end syInfo,
+            a.*
         from bd_clockin_month a
         right join sys_user b on b.id = a.person_id
         where b.del_flag='0'
         <if test="map.personName != null and map.personName != ''">
             and b.realname like concat('%',#{map.personName},'%')
         </if>
+        <if test="map.months != null and map.months != ''">
+            and (a.month_time = #{map.months} or a.month_time is null)
+        </if>
         <if test="map.personId != null and map.personId != ''">
             and b.username = #{map.personId}
         </if>

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/mapper/xml/viewClockInMapper.xml

@@ -303,8 +303,9 @@
     
     <select id="selectByOvertime" resultType="Map">
 
-        select person,date_format(begin_date, '%Y-%m-%d') as overTime from bd_work_overtime where #{monthTime}
-            BETWEEN date_format(begin_date, '%Y-%m' ) AND date_format(end_date, '%Y-%m' )
+        select person,b.username,date_format(begin_date, '%Y-%m-%d') as overTime from bd_work_overtime a
+            left join sys_user b on a.person = b.id
+            where #{monthTime} BETWEEN date_format(begin_date, '%Y-%m' ) AND date_format(end_date, '%Y-%m' )
             and set_info is null
         <if test="userList != null and userList != '' and userList.size >0">
             and person in(