|
@@ -8,11 +8,19 @@ import com.dahuatech.icc.oauth.http.DefaultClient;
|
|
|
import com.dahuatech.icc.oauth.http.IClient;
|
|
|
import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
|
|
|
import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
|
|
|
+import com.huimv.common.utils.StringUtilsWork;
|
|
|
+import com.huimv.video.dhicc.result.R;
|
|
|
+import com.huimv.video.dhicc.util.GetResponse;
|
|
|
+import com.huimv.video.dhicc.util.Result;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
//门禁是不一样的
|
|
@@ -20,6 +28,52 @@ import java.util.Map;
|
|
|
@RequestMapping("person")
|
|
|
|
|
|
public class ClientPersonManageController {
|
|
|
+
|
|
|
+
|
|
|
+ //
|
|
|
+ @RequestMapping("/getPersonOpenDoorFail")
|
|
|
+ public R getAccidentRecord(@RequestBody Map<String, Object> params1 ) throws ClientException {
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ Date date = new Date();
|
|
|
+ c.setTime(date);
|
|
|
+ c.set(Calendar.HOUR, 0);
|
|
|
+ c.set(Calendar.MINUTE, 0);
|
|
|
+ c.set(Calendar.SECOND, 0);
|
|
|
+ Date A = c.getTime();
|
|
|
+ String formatA = format.format(A);
|
|
|
+ c.set(Calendar.HOUR, +24);
|
|
|
+ Date d = c.getTime();
|
|
|
+ String formatD = format.format(d);
|
|
|
+ if (!StringUtilsWork.isNotEmpty( (String) params1.get("startSwingTime"))){
|
|
|
+ params1.put("startSwingTime",formatA);
|
|
|
+ params1.put("endSwingTime",formatD);
|
|
|
+ }
|
|
|
+ params1.put("containDomain","1");
|
|
|
+ params1.put("openResult",0);
|
|
|
+ String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?"; //获取事件URL post请求
|
|
|
+ IClient iClient = new DefaultClient();
|
|
|
+ String timestamp = String.valueOf((new Date()).getTime());
|
|
|
+ Long aLong = Long.valueOf(timestamp);
|
|
|
+ String NewUrl = URL + aLong;
|
|
|
+ System.out.println("开始执行");
|
|
|
+ //这种已经在配置文件里面安排了账号ip以及密码
|
|
|
+ GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
|
|
|
+ System.out.println(NewUrl);
|
|
|
+ generalRequest.header("Content-Type", " application/json");
|
|
|
+ System.out.println(JSON.toJSONString(params1));
|
|
|
+ //里面是
|
|
|
+ generalRequest.body(JSON.toJSONString(params1));
|
|
|
+ //发起请求处理应答
|
|
|
+ GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
|
|
|
+ System.out.println("执行结束");
|
|
|
+ JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
|
|
|
+ GetResponse getResponse = new GetResponse();
|
|
|
+
|
|
|
+ return R.ok("请求成功").put("data", jsonObject ).put("total", getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"),(String) params1.get("endSwingTime")));
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/*
|
|
|
* @param params
|
|
|
* 下面是前端提交的参数 直接让她写死了 这个是查不同部门的人的接口
|
|
@@ -73,7 +127,7 @@ public class ClientPersonManageController {
|
|
|
*/
|
|
|
|
|
|
@RequestMapping("/get_person_record")
|
|
|
- public GeneralResponse getAccidentRecord( @RequestBody Map<String, Object> params ) throws ClientException {
|
|
|
+ public GeneralResponse getAccidentRecord1( @RequestBody Map<String, Object> params ) throws ClientException {
|
|
|
|
|
|
Integer farmId= (int) params.get("farmId");
|
|
|
if(farmId!=1){
|
|
@@ -95,6 +149,9 @@ public class ClientPersonManageController {
|
|
|
System.out.println("执行结束");
|
|
|
return generalResponse;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//总页数
|
|
|
@RequestMapping("/get_person_record_totalpage")
|
|
|
public GeneralResponse get_person_record_totalpage( @RequestBody Map<String, Object> params ) throws ClientException {
|
|
@@ -103,8 +160,6 @@ public class ClientPersonManageController {
|
|
|
//返回为空数据
|
|
|
return new GeneralResponse() ;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime="; //获取事件URL post请求
|
|
|
IClient iClient = new DefaultClient();
|
|
|
String timestamp = String.valueOf((new Date()).getTime());
|
|
@@ -124,6 +179,11 @@ public class ClientPersonManageController {
|
|
|
return generalResponse;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping("/get_person_detail")
|
|
|
public GeneralResponse getPersonDetail( @RequestBody Map<String, Object> params ) throws ClientException {
|
|
|
|