ソースを参照

健康公示上面数字与曲线匹配。

zhengqiang 5 年 前
コミット
cee79987f7

+ 5 - 1
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonDeviceFilterLogDAO.java

@@ -1,4 +1,5 @@
 package com.jpsoft.smart.modules.base.dao;
+import com.github.pagehelper.Page;
 import com.jpsoft.smart.modules.base.entity.CompanyInfo;
 import org.apache.ibatis.annotations.Param;
 
@@ -48,7 +49,6 @@ public interface PersonDeviceFilterLogDAO {
     PersonDeviceFilterLog get(Long id);
 
     long countByTimeRangeAndCompanyCode(String companyCode,Long personId,int status,float temperatureMax, Date startDate, Date endDate);
-    long countUndetectedByCompanyCode(String companyCode,Long personId, Date startTime, Date endTime);
 
     Integer getDayAbnormalNum(@Param("startTime") Date startTime, @Param("endTime") Date endTime,float temperatureMax);
 
@@ -59,4 +59,8 @@ public interface PersonDeviceFilterLogDAO {
     Integer countDayByPersonIdAndDate(Long personId, Date startDate, Date endDate);
 
     Integer countDetectedByCompanyId(String companyId, Date startDate, Date endDate);
+
+    long countUndetectedByCompanyCode(String companyCode,Long personId, Date startTime, Date endTime);
+
+    List<PersonInfo> findUndetectedByCompanyCode(@Param("searchParams") Map<String, Object> searchParams);
 }

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

@@ -71,4 +71,6 @@ public interface PersonDeviceFilterLogService {
     Integer countDayByPersonIdAndDate(Long personId, Date startDate, Date endDate);
 
     Integer countDetectedByCompanyId(String companyId, Date startDate, Date endDate);
+
+    Page<PersonInfo> findUndetectedPersonList(Map<String,Object> searchParams,int pageNumber,int pageSize,boolean count);
 }

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

@@ -245,6 +245,15 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
         return personDeviceFilterLogDAO.countUndetectedByCompanyCode(companyCode, personId, startTime, endTime);
     }
 
+    @Override
+    public Page<PersonInfo> findUndetectedPersonList(Map<String,Object> searchParams,int pageNumber,int pageSize,boolean count) {
+        Page<PersonInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            personDeviceFilterLogDAO.findUndetectedByCompanyCode(searchParams);
+        });
+
+        return page;
+    }
+
     @Override
     public Integer getDayAbnormalNum(Date startTime, Date endTime) {
         return personDeviceFilterLogDAO.getDayAbnormalNum(startTime,endTime,temperatureConfig.getMax());

+ 24 - 0
common/src/main/resources/mapper/base/PersonDeviceFilterLog.xml

@@ -344,4 +344,28 @@
             and b.del_flag=0
         ]]>
     </select>
+    <select id="findUndetectedByCompanyCode"
+            parameterType="hashmap"
+            resultMap="com.jpsoft.smart.modules.base.dao.PersonInfoDAO.PersonInfoMap">
+        <![CDATA[
+            select a.* from base_person_info a,base_company_info b
+            where a.company_id = b.id_
+            and b.del_flag=0
+            and a.del_flag=0
+            and a.id_ not in (
+                select person_id from base_person_device_filter_log
+                where record_time>=#{searchParams.startTime}
+                and record_time <= #{searchParams.endTime}
+            )
+        ]]>
+        and (
+        b.code_ like #{searchParams.companyCode}
+        <if test="searchParams.personId!=null">
+            or b.id_ in (
+                select d.company_id from base_person_company d where d.person_id = #{searchParams.personId}
+            )
+        </if>
+        )
+        order by a.id_ asc
+    </select>
 </mapper>

+ 8 - 5
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/IndividualLogApiController.java

@@ -219,7 +219,7 @@ public class IndividualLogApiController {
 
                 if (personDeviceFilterLog != null) {
                     boolean isDanger = false;
-                    map1.put("name", today.toString("MM-dd"));
+                    map1.put("name", curDay.toString("MM-dd"));
                     map1.put("value", personDeviceFilterLog.getTemperature());
 
                     if (personDeviceFilterLog.getTemperature().floatValue() > temperatureConfig.getMax()) {
@@ -231,20 +231,23 @@ public class IndividualLogApiController {
                 }
                 else{
                     //如果没有记录,先判断是否非工作日
-                    if (!weekdaySet.contains(startTime.getDayOfWeek())){
+                    if (!weekdaySet.contains(curDay.getDayOfWeek())){
                         //先排除一周非工作日
                         continue;
                     }
-                    else if (holidaySet.contains(startTime.toString("yyyy-MM-dd"))){
+
+                    else if (holidaySet.contains(curDay.toString("yyyy-MM-dd"))){
                         //再排除节假日
                         continue;
                     }
 
                     //工作日没有记录,则显示为0
-                    map1.put("name", today.toString("MM-dd"));
+                    map1.put("name", curDay.toString("MM-dd"));
                     map1.put("value", 0);
                     map1.put("danger", false);
-                    undetectedCount++;
+
+                    totalDays=0; //连续正常数清零
+                    undetectedCount++; //未检测数增加
                 }
 
                 list1.add(map1);

+ 0 - 12
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonDeviceFilterLogController.java

@@ -133,18 +133,6 @@ public class PersonDeviceFilterLogController {
             if(fever != null){
                 searchParams.put("fever", fever);
             }
-//            if(StringUtils.isNotEmpty(recordDate)) {
-//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-//                Calendar calendar = Calendar.getInstance();
-//                calendar.setTime(sdf.parse(recordDate));
-//                Date beginTime = calendar.getTime();
-//                calendar.add(Calendar.DATE, 1);
-//                calendar.add(Calendar.SECOND, -1);
-//                Date endTime = calendar.getTime();
-//
-//                searchParams.put("beginTime", beginTime);
-//                searchParams.put("endTime", endTime);
-//            }
 
             Page<PersonDeviceFilterLog> page = personDeviceFilterLogService.pageSearch(searchParams,pageIndex,pageSize,true, sortList);
             Page<PersonDeviceFilterLogDTO> pageDTO = PojoUtils.convertPage(page, PersonDeviceFilterLogDTO.class);

+ 53 - 0
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonDeviceLogApiController.java

@@ -608,6 +608,59 @@ public class PersonDeviceLogApiController {
     }
 
 
+    @ApiOperation(value="未测温人员列表")
+    @RequestMapping(value = "undetectedPersonList",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="startTime",value = "开始时间(格式:yyyy-MM-dd)",paramType = "form"),
+            @ApiImplicitParam(name="endTime",value = "截止时间(格式:yyyy-MM-dd)",paramType = "form"),
+            @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
+            @ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
+    })
+    public MessageResult<Map> undetectedPersonList(
+            @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
+            @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            String token,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            PersonInfo personInfo = personInfoService.get(Long.valueOf(subject));
+            CompanyInfo companyInfo = companyInfoService.get(personInfo.getCompanyId());
+
+            if (startTime==null){
+                startTime = DateTime.now().plusDays(-14).toDate();
+            }
+
+            if (endTime==null){
+                endTime = DateTime.now().plusDays(1).toDate();
+            }
+            else{
+                endTime = new DateTime(endTime).plusDays(1).toDate();
+            }
+
+            Map<String,Object> searchParams = new HashMap<>();
+            searchParams.put("companyCode",companyInfo.getCode() + "%");
+            searchParams.put("personId",personInfo.getId());
+            searchParams.put("startTime",startTime);
+            searchParams.put("endTime",endTime);
+
+            Page<PersonInfo> page = personDeviceFilterLogService.findUndetectedPersonList(searchParams,pageIndex,pageSize,true);
+
+            msgResult.setResult(true);
+            msgResult.setData(PojoUtils.pageWrapper(page));
+        }
+        catch (Exception e) {
+            log.error(e.getMessage(),e);
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
     @ApiOperation(value="获取设备列表")
     @RequestMapping(value = "getDeviceList",method = RequestMethod.POST)
     @ApiImplicitParams({