|
@@ -1,21 +1,23 @@
|
|
|
package com.jpsoft.smart;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
+import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.smart.modules.base.dao.PersonInfoDAO;
|
|
|
import com.jpsoft.smart.modules.base.dao.WarningPusherDAO;
|
|
|
import com.jpsoft.smart.modules.base.dto.PersonDeviceLogDTO;
|
|
|
-import com.jpsoft.smart.modules.base.entity.DeviceInfo;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonDeviceLog;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
|
-import com.jpsoft.smart.modules.base.entity.WarningPusher;
|
|
|
+import com.jpsoft.smart.modules.base.entity.*;
|
|
|
+import com.jpsoft.smart.modules.base.service.CompanyInfoService;
|
|
|
import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
|
|
|
import com.jpsoft.smart.modules.base.service.impl.PersonDeviceLogServiceImpl;
|
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
|
+import com.jpsoft.smart.modules.common.service.IRedisService;
|
|
|
import com.jpsoft.smart.modules.common.utils.WechatMessageUtil;
|
|
|
import com.jpsoft.smart.modules.lapi.service.ILapiService;
|
|
|
import com.jpsoft.smart.modules.lapi.service.impl.LapiServiceImpl;
|
|
|
import com.jpsoft.smart.modules.lapi.vo.LapiMsgResult;
|
|
|
import com.jpsoft.smart.modules.lapi.vo.LapiResult;
|
|
|
+import jdk.nashorn.internal.objects.annotations.Setter;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -45,6 +47,12 @@ public class LApiTest {
|
|
|
@Autowired
|
|
|
private PersonDeviceLogServiceImpl personDeviceLogService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IRedisService redisService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyInfoService companyInfoService;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Test
|
|
@@ -236,9 +244,27 @@ public class LApiTest {
|
|
|
public void testSetDeviceRule(){
|
|
|
try {
|
|
|
|
|
|
- Boolean success = lapiService.setDeviceRule("32acfc7d-e7d4-4ebb-8170-035d00dc92a8",0,1,1,1,new BigDecimal(30),new BigDecimal(45),new BigDecimal(37.3));
|
|
|
+ redisService.put("personInfo","11130","99898",-1);
|
|
|
+ // List list = redisService.getAll("personInfo");
|
|
|
+ // Boolean success = lapiService.setDeviceRule("32acfc7d-e7d4-4ebb-8170-035d00dc92a8",0,1,1,1,new BigDecimal(30),new BigDecimal(45),new BigDecimal(37.3));
|
|
|
|
|
|
- System.out.println(success);
|
|
|
+ // System.out.println(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ String message = e.getMessage();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testFindLastPersonLogByCompanyList(){
|
|
|
+ try {
|
|
|
+
|
|
|
+ List<CompanyInfo> list = companyInfoService.list();
|
|
|
+
|
|
|
+ Page<PersonDeviceLog> personDeviceLogList = personDeviceLogService.findLastPersonLogByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list,0,1);
|
|
|
+
|
|
|
+ System.out.println(personDeviceLogList);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
String message = e.getMessage();
|
|
@@ -247,4 +273,5 @@ public class LApiTest {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|