|
@@ -10,9 +10,7 @@ import com.jpsoft.smart.config.TemperatureConfig;
|
|
|
import com.jpsoft.smart.modules.base.dao.PersonDeviceFilterLogDAO;
|
|
|
import com.jpsoft.smart.modules.base.dao.PersonDeviceLogDAO;
|
|
|
import com.jpsoft.smart.modules.base.entity.*;
|
|
|
-import com.jpsoft.smart.modules.base.service.CheckNumCompanyService;
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonDeviceFilterLogService;
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
|
+import com.jpsoft.smart.modules.base.service.*;
|
|
|
import com.jpsoft.smart.modules.common.dto.Sort;
|
|
|
import com.jpsoft.smart.modules.common.utils.LApiUtil;
|
|
|
import com.jpsoft.smart.modules.common.utils.OSSUtil;
|
|
@@ -46,6 +44,9 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
|
|
|
@Autowired
|
|
|
private PersonInfoService personInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DeviceInfoService deviceInfoService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private CheckNumCompanyService checkNumCompanyService;
|
|
|
|
|
@@ -93,6 +94,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
|
|
|
String recordTimeZons = DateUtil.format(date, "yyyy-MM-dd-HH-mm");
|
|
|
String timeZones = TimeZonesUtil.getUpperTimeZone(recordTimeZons);
|
|
|
PersonInfo personInfo = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
|
|
|
+ DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(deviceNo);
|
|
|
|
|
|
// PersonInfo personInfoReturn = personInfoService.addPersonForCompany(personInfo,deviceNo);
|
|
|
// Integer personId = LApiUtil.getPersonCode(libMatInfoListJson, matchPersonInfo);
|
|
@@ -159,6 +161,9 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
|
|
|
}
|
|
|
}).start();
|
|
|
}
|
|
|
+ if (personInfo.getId() == 0L && temperature.compareTo(BigDecimal.valueOf(temperatureConfig.getMax())) == 1){
|
|
|
+ addVisitorCheckNumForCompany(deviceInfo.getCompanyId(), temperature, date);
|
|
|
+ }
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
@@ -190,6 +195,28 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void addVisitorCheckNumForCompany(String companyId, BigDecimal temperature, Date date) {
|
|
|
+
|
|
|
+ String recordTime = DateUtil.format(date, "yyyy-MM-dd");
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(companyId)) {
|
|
|
+ CheckNumCompany checkNumCompany = checkNumCompanyService.findByCompanyIdAndRecordTime(companyId, recordTime);
|
|
|
+ if (checkNumCompany != null) {
|
|
|
+ Integer checkNum = checkNumCompany.getCheckNum().intValue() + 1;
|
|
|
+ checkNumCompany.setCheckNum(checkNum.longValue());
|
|
|
+ checkNumCompanyService.update(checkNumCompany);
|
|
|
+ } else {
|
|
|
+ CheckNumCompany checkNumCompany1 = new CheckNumCompany();
|
|
|
+ checkNumCompany1.setCompanyId(companyId);
|
|
|
+ checkNumCompany1.setCheckNum(1L);
|
|
|
+ checkNumCompany1.setDelFlag(false);
|
|
|
+ checkNumCompany1.setRecordTime(recordTime);
|
|
|
+ checkNumCompany1.setCreateTime(new Date());
|
|
|
+ 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(() -> {
|
|
@@ -272,7 +299,13 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
|
|
|
|
|
|
@Override
|
|
|
public Integer getDayAbnormalNumByCompanyList(Date startTime, Date endTime, List<CompanyInfo> list) {
|
|
|
- return personDeviceFilterLogDAO.getDayAbnormalNumByCompanyList(startTime,endTime,list,temperatureConfig.getMax());
|
|
|
+ Integer total = personDeviceFilterLogDAO.getDayAbnormalNumByCompanyList(startTime,endTime,list,temperatureConfig.getMax());
|
|
|
+ if (total == null){
|
|
|
+ return 0;
|
|
|
+ }else {
|
|
|
+ return total;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|