Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

LiGuang před 2 roky
rodič
revize
907cb61d75

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

@@ -453,7 +453,7 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
 
 	/**
 	 * 分页列表查询
-	 *
+	 * 员工考勤信息,点击左侧树形菜单时调用
 	 * @param viewClockIn
 	 * @param pageNo
 	 * @param pageSize
@@ -513,7 +513,25 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
 			query.eq(ViewClockIn::getHeadMonth,DateUtils.getNYTime());//月份
 		}
 		query.orderByAsc(ViewClockIn::getViewDate);
+
+		Map<String,String> map = new HashMap<>();
+
+		map.put("userName",userName);
+		map.put("mDate",mDate);
+
+		//showState = 1 异常打卡
+		//duration = 1 加班打卡
+		if(viewClockIn.getDuration() != null && viewClockIn.getDuration() != ""){
+			map.put("duration","duration");
+		}
+		if(viewClockIn.getShowState() != null && viewClockIn.getShowState() != ""){
+			map.put("showState","showState");
+		}
+
 		Page<ViewClockIn> page = new Page<ViewClockIn>(pageNo, pageSize);
+
+//		Page<ViewClockIn> pageList = viewClockInService.selectByPage(page,map);
+
 		IPage<ViewClockIn> pageList = viewClockInService.page(page, query);
 		return Result.OK(pageList);
 	}
@@ -670,6 +688,32 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
 	  @RequestMapping(value = "/exportXls")
 	  public ModelAndView exportXls(HttpServletRequest request, ViewClockIn viewClockIn,String userName,String mDate,String userType) {
 	  	  List<ExportClockInfo> list = viewClockInService.exportErrotInfo(userName,mDate,userType);
+		  List<ExportClockInfo> list2 = new ArrayList<>();
+//
+		  String realname = null;
+		  String oneDept = null;
+		  String twoDept = null;
+		  String lastDept = null;
+	  	  for(ExportClockInfo l:list){
+			if(l.getRealname() != null && l.getRealname() != ""){
+				realname = l.getRealname();
+				oneDept = l.getOneDept();
+				twoDept = l.getTwoDept();
+				lastDept = l.getLastDept();
+				break;
+			}
+		  }
+		for(ExportClockInfo l:list){
+			l.setRealname(realname);
+			l.setOneDept(oneDept);
+			l.setTwoDept(twoDept);
+			l.setLastDept(lastDept);
+			if(l.getAttendanceCount() == null || l.getAttendanceCount() == ""){
+				l.setAttendanceCount("0");
+			}
+			list2.add(l);
+		}
+
 		  LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 		  ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
 		  mv.addObject(NormalExcelConstants.FILE_NAME, "员工考勤信息"); //此处设置的filename无效 ,前端会重更新设置一下
@@ -679,7 +723,7 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
 		  exportParams.setImageBasePath(upLoadPath);
 		  //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
 		  mv.addObject(NormalExcelConstants.PARAMS,exportParams);
-		  mv.addObject(NormalExcelConstants.DATA_LIST, list);
+		  mv.addObject(NormalExcelConstants.DATA_LIST, list2);
 		  return mv;
 	  }
 

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/entity/ExportClockInfo.java

@@ -28,8 +28,8 @@ public class ExportClockInfo {
 	@Excel(name = "二级部门", width = 15)
 	private String twoDept;
 
-	@Excel(name = "三级部门", width = 15)
-	private String threeDept;
+//	@Excel(name = "三级部门", width = 15)
+//	private String threeDept;
 
 	@Excel(name = "末级部门", width = 15)
 	private String lastDept;

+ 10 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/entity/ViewClockIn.java

@@ -104,6 +104,11 @@ public class ViewClockIn {
     @ApiModelProperty(value = "viewDate")
 	private String viewDate;
 
+//	/**viewDate*/
+//	@Excel(name = "日期1", width = 15)
+//    @ApiModelProperty(value = "viewDate1")
+//	private String viewDate1;
+
 	/**月份 2021-12*/
 	@Excel(name = "月份", width = 15)
     @ApiModelProperty(value = "headMonth")
@@ -114,6 +119,11 @@ public class ViewClockIn {
     @ApiModelProperty(value = "weekDate")
 	private String weekDate;
 
+//	/**weekDate*/
+//	@Excel(name = "星期", width = 15)
+//    @ApiModelProperty(value = "weekDate1")
+//	private String weekDate1;
+
 	/**gotoTime*/
 	@Excel(name = "上班1", width = 15)
 	@ApiModelProperty(value = "oneTime")

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

@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.poi.ss.formula.functions.T;
-import org.jeecg.modules.viewClockIn.entity.ExportClockDay;
-import org.jeecg.modules.viewClockIn.entity.ExportClockInfo;
-import org.jeecg.modules.viewClockIn.entity.NumEntity;
-import org.jeecg.modules.viewClockIn.entity.ViewClockIn;
+import org.jeecg.modules.viewClockIn.entity.*;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 import java.util.List;
@@ -23,6 +20,8 @@ import java.util.Map;
  */
 public interface viewClockInMapper extends BaseMapper<ViewClockIn> {
 
+    public List<ViewClockIn> selectByPage(Page<ViewClockIn> page, @Param("map")Map<String,String> map);
+
     int fuXinInfo(@Param("multiple")String multiple,@Param("st")String st,@Param("userId")String userId,
                   @Param("viewDate")String viewDate,@Param("username")String username);
 

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

@@ -62,6 +62,7 @@
         left join geke_attendance_rule b on a.id = b.user_id
         left join bd_clockin_month m on a.id = m.person_id and m.month_time = #{nowDate}
         where a.del_flag = 0 and date_format(IFNULL(a.term_date,NOW()),'%Y-%m') >= #{nowDate}
+          and date_format(IFNULL(a.entry_date,NOW()),'%Y-%m') &lt;= #{nowDate}
         <if test="userId != null and userId != '' and userId.size >0">
             and a.id in(
             <foreach collection="userId" item="item" index="index" separator=",">

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

@@ -2,6 +2,62 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.viewClockIn.mapper.viewClockInMapper">
 
+    <select id="selectByPage" resultType="org.jeecg.modules.viewClockIn.entity.ViewClockIn">
+
+        select a.date view_date1,
+            case
+                when DAYOFWEEK(a.date) = '1' then '星期日'
+                when DAYOFWEEK(a.date) = '2' then '星期一'
+                when DAYOFWEEK(a.date) = '3' then '星期二'
+                when DAYOFWEEK(a.date) = '4' then '星期三'
+                when DAYOFWEEK(a.date) = '5' then '星期四'
+                when DAYOFWEEK(a.date) = '6' then '星期五'
+                when DAYOFWEEK(a.date) = '7' then '星期六'
+            end as week_date1,
+            b.*,
+            case when (latetime_s &lt; 0 or latetime_x > 0
+                or (rule_type = 1 and ifwork > 0 and attendance_count &lt; 2 and shift_real_time_s is not null)
+                or (rule_type = 1 and ifwork > 0 and shift_real_time_s is not null and goto_time is null)
+                or (rule_type = 2 and attendance_count &lt; 2 and shift_real_time_s is not null)
+                or (rule_type = 2 and shift_real_time_s is not null and goto_time is null)
+                or (duration is not null and (work_overtime > 0 or work_overtime is null))
+                or (shift_type = 1 and (latetime1_s &lt; 0 or latetime1_x > 0 or latetime2_s &lt; 0 or latetime2_x > 0))
+                and set_info > 0 ) and error_state is null
+
+            then '1'
+
+            when shift_real_time_s is null and goto_time is not null and (set_info > 0 or set_info is null ) and error_state is null
+
+            then '2'
+
+            else '0'
+
+            end as show_state
+
+        from temp_date a
+        left join view_clock_in_0 b ON a.date = b.view_date and b.realname = a.temp_realname
+
+        where DATE_FORMAT(date,'%Y-%m') = #{map.mDate}
+            and b.realname = #{map.userName}
+            and date &lt;= date_format(IFNULL(b.term_date,NOW()),'%Y-%m-%d')
+
+            <if test="map.duration != null and map.duration != ''">
+                and b.duration is not null
+            </if>
+            <if test="map.showState != null and map.showState != ''">
+               and (latetime_s &lt; 0 or latetime_x > 0
+                or (rule_type = 1 and ifwork > 0 and attendance_count &lt; 2 and shift_real_time_s is not null)
+                or (rule_type = 1 and ifwork > 0 and shift_real_time_s is not null and goto_time is null)
+                or (rule_type = 2 and attendance_count &lt; 2 and shift_real_time_s is not null)
+                or (rule_type = 2 and shift_real_time_s is not null and goto_time is null)
+                or (duration is not null and (work_overtime > 0 or work_overtime is null))
+                or (shift_type = 1 and (latetime1_s &lt; 0 or latetime1_x > 0 or latetime2_s &lt; 0 or latetime2_x > 0))
+                and set_info > 0 ) and error_state is null
+            </if>
+        group by date
+        order by date asc
+    </select>
+
     <select id="exportErrotInfo" resultType = "org.jeecg.modules.viewClockIn.entity.ExportClockInfo">
         select CONCAT(shift_real_time_s,'-',shift_real_time_x) shiftTime,#{userType} as category,
                case a.show_state
@@ -9,7 +65,23 @@
                    else  '正常'
                    end as state
                 ,
-               a.*  from view_clock_in_1 a where a.realname = #{realname} and a.head_month = #{headMonth}
+               b.date view_date,
+               case
+                   when DAYOFWEEK(b.date) = '1' then '星期日'
+                   when DAYOFWEEK(b.date) = '2' then '星期一'
+                   when DAYOFWEEK(b.date) = '3' then '星期二'
+                   when DAYOFWEEK(b.date) = '4' then '星期三'
+                   when DAYOFWEEK(b.date) = '5' then '星期四'
+                   when DAYOFWEEK(b.date) = '6' then '星期五'
+                   when DAYOFWEEK(b.date) = '7' then '星期六'
+               end as week_date,
+               a.*  from  temp_date b
+               left join view_clock_in_1 a on b.date = a.view_date
+                and a.realname = #{realname}
+        where DATE_FORMAT(date,'%Y-%m') = #{headMonth}
+        and date &lt;= date_format(IFNULL(a.term_date,NOW()),'%Y-%m-%d')
+        group by date
+        order by date
     </select>
 
     <select id="exportXlsDay" resultType = "org.jeecg.modules.viewClockIn.entity.ExportClockDay">

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/service/IviewClockInService.java

@@ -1,8 +1,6 @@
 package org.jeecg.modules.viewClockIn.service;
 
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.poi.ss.formula.functions.T;
 import org.jeecg.modules.viewClockIn.entity.ExportClockDay;
 import org.jeecg.modules.viewClockIn.entity.ExportClockInfo;
 import org.jeecg.modules.viewClockIn.entity.ViewClockIn;
@@ -19,6 +17,8 @@ import java.util.Map;
  */
 public interface IviewClockInService extends IService<ViewClockIn> {
 
+    Page<ViewClockIn> selectByPage(Page<ViewClockIn> page, Map<String,String> map);
+
     public int fuXinInfo(String multiple, String st, String userId, String viewDate,String username);
     public int updateOvertime(String multiple,String st,String id,String username);
     public Page<ViewClockIn> selectPage(Page<ViewClockIn> page);

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/service/impl/bdClockinMonthServiceImpl.java

@@ -59,7 +59,6 @@ public class bdClockinMonthServiceImpl extends ServiceImpl<bdClockinMonthMapper,
      */
     @Transactional
     public String handleInfo(String nowDate,List<String> userList){
-        userList.add("100089");
         //获取要生成月报用户信息
         List<bdClockinMonth> selectUserBy = clockinMonthMapper.selectUserBy(userList,nowDate);
         //请假信息(事假,病假)天

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/viewClockIn/service/impl/viewClockInServiceImpl.java

@@ -7,6 +7,7 @@ import org.apache.poi.ss.formula.functions.T;
 import org.jeecg.modules.viewClockIn.entity.ExportClockDay;
 import org.jeecg.modules.viewClockIn.entity.ExportClockInfo;
 import org.jeecg.modules.viewClockIn.entity.ViewClockIn;
+import org.jeecg.modules.viewClockIn.entity.bdClockinMonth;
 import org.jeecg.modules.viewClockIn.mapper.viewClockInMapper;
 import org.jeecg.modules.viewClockIn.service.IviewClockInService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +30,10 @@ public class viewClockInServiceImpl extends ServiceImpl<viewClockInMapper, ViewC
     @Autowired
     private viewClockInMapper viewClockInMapper1;
 
+    @Override
+    public Page<ViewClockIn> selectByPage(Page<ViewClockIn> page, Map<String,String> map) {
+        return page.setRecords(viewClockInMapper1.selectByPage(page,map));
+    }
 
     public List<Map<String,Object>> selectByOvertime(String monthTime,List<String> userList){
         return viewClockInMapper1.selectByOvertime(monthTime,userList);

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/workOvertime/entity/workOvertime.java

@@ -95,6 +95,7 @@ public class workOvertime {
 	private Date updateDate; //薪资处理时间
 	private String setInfo;//薪资处理方式
 	private String updateName;//薪资处理人
+	private String multiple;//倍数
 
 	/**备用虚拟字段**/
 	private transient  String deptCode;