ソースを参照

健康公示参数展示修改

M墨鱼—_mo 5 年 前
コミット
54630d5a79

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonDeviceLogDAO.java

@@ -46,4 +46,6 @@ public interface PersonDeviceLogDAO {
     List<PersonDeviceLog> findLastTeacherLogByCompanyList(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("list") List<CompanyInfo> list);
 
     List<PersonDeviceLog> findLastStudentLogByCompanyList(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("list") List<CompanyInfo> list);
+
+    Integer getDayCheckedPersonNumByCompanyList(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("list") List<CompanyInfo> list,  @Param("popedom") String popedom);
 }

+ 3 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/TotalCheckCompanyDAO.java

@@ -33,4 +33,7 @@ public interface TotalCheckCompanyDAO {
     Integer  getTotalCheckNum(@Param("list") List<CompanyInfo> list);
 
 
+    List<TotalCheckCompany> findAll();
+
+
 }

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

@@ -50,4 +50,6 @@ public interface PersonDeviceLogService {
     Page<PersonDeviceLog> findLastTeacherLogByCompanyList(Date beginOfDay, Date endOfDay, List<CompanyInfo> list, int pageIndex, int pageSize);
 
     Page<PersonDeviceLog> findLastStudentLogByCompanyList(Date beginOfDay, Date endOfDay, List<CompanyInfo> list, int pageIndex, int pageSize);
+
+    Integer getDayCheckedPersonTotalByCompanyList(Date startTime,Date endTime, List<CompanyInfo> list,String popedom);
 }

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

@@ -26,4 +26,6 @@ public interface TotalCheckCompanyService {
     int update(TotalCheckCompany totalCheckCompany);
 
     Integer getTotalCheckNum(List<CompanyInfo> list);
+
+    List<TotalCheckCompany> findAll();
 }

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

@@ -266,5 +266,10 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
         return page;
     }
 
+    @Override
+    public Integer getDayCheckedPersonTotalByCompanyList(Date startTime, Date endTime, List<CompanyInfo> list, String popedom) {
+        return personDeviceLogDAO.getDayCheckedPersonNumByCompanyList(startTime, endTime, list, popedom) == null?0:personDeviceLogDAO.getDayCheckedPersonNumByCompanyList(startTime, endTime, list, popedom);
+
+    }
 
 }

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

@@ -60,4 +60,9 @@ public class TotalCheckCompanyServiceImpl implements TotalCheckCompanyService {
     public Integer getTotalCheckNum(List<CompanyInfo> list) {
         return totalCheckCompanyDAO.getTotalCheckNum(list);
     }
+
+    @Override
+    public List<TotalCheckCompany> findAll() {
+        return totalCheckCompanyDAO.findAll();
+    }
 }

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

@@ -204,6 +204,7 @@
             select count(*) from base_person_device_log where person_id = 0
             and record_time >=#{startTime}
             and record_time <= #{endTime}
+            and temperature_ > 0
         ]]>
         <foreach collection="list" index="index" item="item" open="and device_no in(" separator="," close=")">
             #{item}
@@ -278,4 +279,18 @@
         where person_id <> 0 and temperature_>0  GROUP BY a.person_id ORDER BY record_time desc
         ]]>
     </select>
+
+    <select id="getDayCheckedPersonNumByCompanyList" resultType="Integer">
+        select count(*) from base_person_device_log a left join base_person_info b
+        on a.person_id = b.id_
+        where a.record_time >=#{startTime}
+        and a.record_time &lt;= #{endTime}
+        and b.company_id in
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">   #{item.id}
+        </foreach>
+        and a.del_flag = 0
+        <if test="popedom!=null">
+            and b.popedom_ like #{popedom}
+        </if>
+    </select>
 </mapper>

+ 7 - 0
common/src/main/resources/mapper/base/TotalCheckCompany.xml

@@ -119,4 +119,11 @@
             </foreach>
         </if>
     </select>
+
+<!--auto generated by MybatisCodeHelper on 2020-04-04-->
+    <select id="findAll" resultMap="TotalCheckCompanyMap">
+        select
+        <include refid="Base_Column_List"/>
+        from base_total_check_company where del_flag = 0
+    </select>
 </mapper>

+ 8 - 1
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/HealthShowApiController.java

@@ -114,17 +114,24 @@ public class HealthShowApiController {
                 Integer personNum = Math.toIntExact(personInfoService.countByCompanyList(list));
                 Integer checkedPersonNum = personDeviceFilterLogService.getDayCheckedPersonNumByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, null);
 
+                //已测访客数
                 Integer checkedVisitorNum = 0;
                 if (deviceNoList.size()>0){
                      checkedVisitorNum = personDeviceLogService.getDayCheckedVistorNumByDeviceNoList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), deviceNoList);
                 }
 
+                //已测员工人次
+                Integer checkPersonTotal = personDeviceLogService.getDayCheckedPersonTotalByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, null);
+
 
 
                 Integer num = checkNumCompanyService.getDayCheckNumByCompanyList(DateUtil.format(new Date(), "yyyy-MM-dd"), list);
                 Integer totalNum = totalCheckCompanyService.getTotalCheckNum(list);
                 Integer dayCheckNum = num == null ? 0 : num;
-                Integer totalCheckNum = totalNum == null ? dayCheckNum : totalNum + dayCheckNum;
+
+                //当日累计检测数
+             //   Integer totalCheckNum = totalNum == null ? dayCheckNum : totalNum + dayCheckNum;
+                Integer totalCheckNum = checkPersonTotal + checkedVisitorNum;
 
                 Integer num2 = personDeviceFilterLogService.getDayAbnormalNumByCompanyList(DateUtil.beginOfDay(new Date()), new Date(), list);
                 Integer totalNum2 = totalCheckCompanyService.getTotalAbnormalNumByCompanyList(list);

+ 12 - 0
web/src/main/java/com/jpsoft/smart/schduled/CheckPersonTask.java

@@ -48,8 +48,18 @@ public class CheckPersonTask {
         Date endTime = DateUtil.endOfDay(date);
         String recordTime = DateUtil.format(new Date(),"yyyy-MM-dd");
         List<CheckNumCompany> checkNumCompanyList = checkNumCompanyService.findByRecordTime(recordTime);
+        List<TotalCheckCompany> totalCheckCompanyList = totalCheckCompanyService.findAll();
+
+        List<String> totalCompanyIds =  new ArrayList<>();
+
+        for (TotalCheckCompany totalCheckCompany:totalCheckCompanyList){
+            totalCompanyIds.add(totalCheckCompany.getCompanyId());
+        }
+
+        List<String> checkCompanyIds = new ArrayList<>();
         if (checkNumCompanyList.size()>0){
             for (CheckNumCompany checkNumCompany: checkNumCompanyList){
+                checkCompanyIds.add(checkNumCompany.getCompanyId());
                 CompanyInfo companyInfo = companyInfoService.get(checkNumCompany.getCompanyId());
                 List<CompanyInfo> list = new ArrayList<>();
                 list.add(companyInfo);
@@ -91,5 +101,7 @@ public class CheckPersonTask {
         }
 
 
+
+
     }
 }