ソースを参照

未测体温记录改为查询考勤表,这样未到的考勤时间段就可以不显示。

zhengqiang 5 年 前
コミット
a47cf5d0a5

+ 0 - 2
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceFilterLogServiceImpl.java

@@ -182,10 +182,8 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
                 checkNumCompanyService.insert(checkNumCompany1);
             }
         }
-
     }
 
-
     @Override
     public Page<PersonDeviceFilterLog> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize, boolean count, List<Sort> sortList) {
         Page<PersonDeviceFilterLog> page = PageHelper.startPage(pageNumber, pageSize, count).doSelectPage(() -> {

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/business/dao/WorkAttendanceDAO.java

@@ -3,6 +3,7 @@ package com.jpsoft.smart.modules.business.dao;
 import java.util.Date;
 import java.util.List;
 
+import com.jpsoft.smart.modules.base.entity.PersonInfo;
 import org.joda.time.DateTime;
 import org.springframework.stereotype.Repository;
 import com.jpsoft.smart.modules.business.entity.WorkAttendance;
@@ -21,4 +22,5 @@ public interface WorkAttendanceDAO {
     List<WorkAttendance> findByPersonIdAndDate(Long personId, Date startDate, Date endDate);
     int deleteByCompanyCodeAndDate(String companyCode, Date startDate, Date endDate);
     List<WorkAttendance> findByPeriod(Long personId, String alarmConfigId, Date recordTime);
+	List<PersonInfo> queryUnAttendanceList(String companyCode, Date startDate, Date endDate);
 }

+ 4 - 0
common/src/main/java/com/jpsoft/smart/modules/business/service/WorkAttendanceService.java

@@ -4,6 +4,8 @@ import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+
+import com.jpsoft.smart.modules.base.entity.PersonInfo;
 import com.jpsoft.smart.modules.business.entity.WorkAttendance;
 import com.github.pagehelper.Page;
 import com.jpsoft.smart.modules.common.dto.Sort;
@@ -25,4 +27,6 @@ public interface WorkAttendanceService {
 	 * @param recordDate
 	 */
 	boolean punchIn(Long personId, BigDecimal temperature,Date recordDate);
+
+    List<PersonInfo> queryUnAttendanceList(String companyCode, Date startDate, Date endDate);
 }

+ 5 - 0
common/src/main/java/com/jpsoft/smart/modules/business/service/impl/WorkAttendanceServiceImpl.java

@@ -206,4 +206,9 @@ public class WorkAttendanceServiceImpl implements WorkAttendanceService {
 
 		return result;
 	}
+
+	@Override
+	public List<PersonInfo> queryUnAttendanceList(String companyCode, Date startDate, Date endDate) {
+		return workAttendanceDAO.queryUnAttendanceList(companyCode,startDate,endDate);
+	}
 }

+ 1 - 1
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -164,7 +164,7 @@
         select * from base_person_device_log where id_=#{0}
     </select>
     <select id="queryUnAttendanceList" resultMap="com.jpsoft.smart.modules.base.dao.PersonInfoDAO.PersonInfoMap">
-        <![CDATA[
+    <![CDATA[
         select a.*,b.name_ as company_name
         from base_person_info a,base_company_info b
         where a.company_id=b.id_ and b.code_ like #{companyCode}

+ 15 - 0
common/src/main/resources/mapper/business/WorkAttendance.xml

@@ -125,6 +125,21 @@
         and del_flag=0
         order by record_time asc
     </select>
+    <select id="queryUnAttendanceList" resultMap="com.jpsoft.smart.modules.base.dao.PersonInfoDAO.PersonInfoMap">
+        <![CDATA[
+        select a.*,b.name_ as company_name
+        from base_person_info a,base_company_info b
+        where a.company_id=b.id_ and b.code_ like #{companyCode}
+        and a.del_flag=0
+        and a.id_ in (
+            select person_id from business_work_attendance
+            where record_time>=#{startDate}
+            and record_time <=#{endDate}
+            and result_='0'
+            and del_flag=0
+        )
+    ]]>
+    </select>
     <delete id="deleteByCompanyCodeAndDate">
         delete from business_work_attendance
         where person_id in (

+ 3 - 1
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonDeviceFilterLogController.java

@@ -222,7 +222,9 @@ public class PersonDeviceFilterLogController {
                             DateTime startTime = new DateTime(sdf.parse(dateStr + " " + alarmConfig.getStartTime()));
                             DateTime endTime = new DateTime(sdf.parse(dateStr + " " + alarmConfig.getEndTime()));
 
-                            List<PersonInfo> unmeasuredList = personDeviceLogService.queryUnAttendanceList(companyInfo.getCode() + "%", startTime.toDate(), endTime.toDate());
+                            //todo 查询考勤表
+                            List<PersonInfo> unmeasuredList = workAttendanceService.queryUnAttendanceList(companyInfo.getCode() + "%", startTime.toDate(), endTime.toDate());
+                            //List<PersonInfo> unmeasuredList = personDeviceLogService.queryUnAttendanceList(companyInfo.getCode() + "%", startTime.toDate(), endTime.toDate());
 
                             map.put("startTime", alarmConfig.getStartTime());
                             map.put("endTime", alarmConfig.getEndTime());