|
@@ -13,6 +13,7 @@ import com.huimv.video.dhicc.icc.CommonConstant;
|
|
|
import com.huimv.video.dhicc.result.R;
|
|
|
import com.huimv.video.dhicc.service.IClientAllEventService;
|
|
|
import com.huimv.video.dhicc.util.GetResponse;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import net.sf.json.JSONObject;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -35,6 +36,7 @@ import java.util.Map;
|
|
|
* @Create : 2020-12-25
|
|
|
**/
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class ClientAllEventServiceImpl implements IClientAllEventService {
|
|
|
|
|
|
@Override
|
|
@@ -49,42 +51,42 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
|
|
|
//大门事件
|
|
|
paramsMap.put("alarmStartDateString",startDateText);
|
|
|
paramsMap.put("alarmEndDateString",endDateText);
|
|
|
- System.out.println("大门事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("大门事件输入参数>>"+paramsMap.toString());
|
|
|
return getGateEvent(paramsMap);
|
|
|
case 2:
|
|
|
//洗消事件
|
|
|
paramsMap.put("alarmStartDateString",startDateText);
|
|
|
paramsMap.put("alarmEndDateString",endDateText);
|
|
|
- System.out.println("洗消事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("洗消事件输入参数>>"+paramsMap.toString());
|
|
|
return getWashEvent(paramsMap);
|
|
|
case 3:
|
|
|
//死猪通道事件
|
|
|
paramsMap.put("alarmStartDateString",startDateText);
|
|
|
paramsMap.put("alarmEndDateString",endDateText);
|
|
|
- System.out.println("死猪通道事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("死猪通道事件输入参数>>"+paramsMap.toString());
|
|
|
return getDeadPigChannel(paramsMap);
|
|
|
case 4:
|
|
|
//熏蒸事件
|
|
|
paramsMap.put("alarmStartDateString",startDateText);
|
|
|
paramsMap.put("alarmEndDateString",endDateText);
|
|
|
- System.out.println("熏蒸事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("熏蒸事件输入参数>>"+paramsMap.toString());
|
|
|
return getFumigateChannel(paramsMap);
|
|
|
case 5:
|
|
|
//卖猪事件
|
|
|
paramsMap.put("alarmStartDateString",startDateText);
|
|
|
paramsMap.put("alarmEndDateString",endDateText);
|
|
|
- System.out.println("卖猪事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("卖猪事件输入参数>>"+paramsMap.toString());
|
|
|
return getSellPigsChannel(paramsMap);
|
|
|
case 6:
|
|
|
//人员门禁事件
|
|
|
paramsMap.put("alarmStartDateString",startDateText);
|
|
|
paramsMap.put("alarmEndDateString",endDateText);
|
|
|
paramsMap.put("openType",61);
|
|
|
- System.out.println("人员门禁事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("人员门禁事件输入参数>>"+paramsMap.toString());
|
|
|
return getEntranceGuard(paramsMap);
|
|
|
default:
|
|
|
//车辆闸机事件
|
|
|
- System.out.println("车辆闸机事件输入参数>>"+paramsMap.toString());
|
|
|
+ log.info("车辆闸机事件输入参数>>"+paramsMap.toString());
|
|
|
return getCarAutoGate(request,paramsMap);
|
|
|
}
|
|
|
}
|
|
@@ -130,7 +132,7 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
|
|
|
total = "0";
|
|
|
}
|
|
|
//
|
|
|
- return R.ok("请求成功").put("data", getAccidentRecord1(paramsMap)).put("total", Integer.parseInt(total)).put("isVideo",false);
|
|
|
+ return R.ok("请求成功").put("data", getAccidentRecord(paramsMap)).put("total", Integer.parseInt(total)).put("isVideo",false);
|
|
|
}
|
|
|
|
|
|
//解析总页码
|
|
@@ -271,8 +273,44 @@ public class ClientAllEventServiceImpl implements IClientAllEventService {
|
|
|
return jsonObject1.get("value").toString();
|
|
|
}
|
|
|
|
|
|
+ //刷脸失败记录 by Yangdi
|
|
|
+ public R getAccidentRecord(Map<String, Object> params1 ) throws ClientException {
|
|
|
+ Integer farmId= (int) params1.get("farmId");
|
|
|
+ if(farmId!=1){
|
|
|
+ //返回为空数据
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ 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?";
|
|
|
+ IClient iClient = new DefaultClient();
|
|
|
+ GeneralRequest generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
|
|
|
+ generalRequest.header("Content-Type", " application/json");
|
|
|
+ generalRequest.body(JSON.toJSONString(params1));
|
|
|
+ GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
|
|
|
+ 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")));
|
|
|
+ }
|
|
|
+
|
|
|
//查询人员违规记录 by Yangdi
|
|
|
- public GeneralResponse getAccidentRecord1( @RequestBody Map<String, Object> params ) throws ClientException {
|
|
|
+ public GeneralResponse getAccidentRecord1(Map<String, Object> params ) throws ClientException {
|
|
|
Integer farmId= (int) params.get("farmId");
|
|
|
if(farmId!=1){
|
|
|
//返回为空数据
|