bug修改
This commit is contained in:
parent
c1905e88c3
commit
ff1d2ca1ad
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zhgd.jeecg.common.execption.OpenPromptException;
|
||||||
import com.zhgd.xmgl.call.HikvisionCall;
|
import com.zhgd.xmgl.call.HikvisionCall;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||||
import com.zhgd.xmgl.modules.car.entity.CarInfo;
|
import com.zhgd.xmgl.modules.car.entity.CarInfo;
|
||||||
@ -77,6 +78,8 @@ public class AsyncHikvision {
|
|||||||
String msg;
|
String msg;
|
||||||
if (e instanceof java.net.ConnectException) {
|
if (e instanceof java.net.ConnectException) {
|
||||||
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:网络超时";
|
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:网络超时";
|
||||||
|
} else if (e instanceof OpenPromptException) {
|
||||||
|
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:" + e.getMessage();
|
||||||
} else {
|
} else {
|
||||||
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:下发异常";
|
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:下发异常";
|
||||||
}
|
}
|
||||||
@ -294,7 +297,7 @@ public class AsyncHikvision {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof java.net.ConnectException) {
|
if (e instanceof java.net.ConnectException) {
|
||||||
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), "下发异常", "人员下发设备提醒", "1");
|
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), "网络异常", "人员下发设备提醒", "1");
|
||||||
} else {
|
} else {
|
||||||
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), e.getMessage(), "人员下发设备提醒", "1");
|
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), e.getMessage(), "人员下发设备提醒", "1");
|
||||||
}
|
}
|
||||||
@ -342,7 +345,11 @@ public class AsyncHikvision {
|
|||||||
hikvisionCall.updatePersonAuth(workerInfo, ds, sucSb, failSb, 2);
|
hikvisionCall.updatePersonAuth(workerInfo, ds, sucSb, failSb, 2);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), e.getMessage(), "人员下发设备提醒", "1");
|
if (e instanceof java.net.ConnectException) {
|
||||||
|
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), "网络异常", "人员下发设备提醒", "1");
|
||||||
|
} else {
|
||||||
|
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), e.getMessage(), "人员下发设备提醒", "1");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -865,7 +865,13 @@ public class HikvisionCall {
|
|||||||
msg = "同步成功,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard();
|
msg = "同步成功,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard();
|
||||||
title += "成功";
|
title += "成功";
|
||||||
} else {
|
} else {
|
||||||
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:" + rs;
|
JSONObject jo = JSONObject.parseObject(rs);
|
||||||
|
String code = jo.getString("code");
|
||||||
|
if (Objects.equals(code, "0x00072002")) {
|
||||||
|
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:人脸照片校验失败";
|
||||||
|
} else {
|
||||||
|
msg = "同步失败,人员名称:" + workerInfo.getWorkerName() + ",身份证号:" + workerInfo.getIdCard() + "。失败原因:" + rs;
|
||||||
|
}
|
||||||
title += "失败";
|
title += "失败";
|
||||||
}
|
}
|
||||||
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
|
noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, type);
|
||||||
@ -1933,14 +1939,14 @@ public class HikvisionCall {
|
|||||||
"}";
|
"}";
|
||||||
JSONObject rs = doorSearchV2ForHttp(project, JSONObject.parseObject(json));
|
JSONObject rs = doorSearchV2ForHttp(project, JSONObject.parseObject(json));
|
||||||
if (HikvisionUtil.isFail(rs)) {
|
if (HikvisionUtil.isFail(rs)) {
|
||||||
log.error(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail:" + rs.toJSONString() + ",");
|
log.error(workerInfo.getWorkerName() + "," + dev.getDevName() + " fail:" + rs.toJSONString() + ",");
|
||||||
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + ";");
|
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",下发异常;");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jo = HikvisionUtil.getJSONObjectData(rs);
|
JSONObject jo = HikvisionUtil.getJSONObjectData(rs);
|
||||||
JSONArray listJa = jo.getJSONArray("list");
|
JSONArray listJa = jo.getJSONArray("list");
|
||||||
if (CollUtil.isEmpty(listJa)) {
|
if (CollUtil.isEmpty(listJa)) {
|
||||||
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail:isc不存在该设备,");
|
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",失败信息:isc不存在该设备,");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String channelNo = listJa.getJSONObject(0).getString("channelNo");
|
String channelNo = listJa.getJSONObject(0).getString("channelNo");
|
||||||
@ -1958,17 +1964,22 @@ public class HikvisionCall {
|
|||||||
"}";
|
"}";
|
||||||
JSONObject sdRs = simpleDownload(project, sdStr);
|
JSONObject sdRs = simpleDownload(project, sdStr);
|
||||||
if (HikvisionUtil.isFail(sdRs)) {
|
if (HikvisionUtil.isFail(sdRs)) {
|
||||||
log.error(workerInfo.getWorkerName() + " " + dev.getDevName() + " fail:" + sdRs.toJSONString() + ",");
|
log.error(workerInfo.getWorkerName() + "," + dev.getDevName() + " fail:" + sdRs.toJSONString() + ",");
|
||||||
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + ";");
|
String code = sdRs.getString("code");
|
||||||
|
if (Objects.equals(code, "0x15403007") || Objects.equals(code, "0x02401033")) {
|
||||||
|
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",失败原因:网络超时;");
|
||||||
|
} else {
|
||||||
|
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",下发异常;");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject sdRsJo = HikvisionUtil.getJSONObjectData(sdRs);
|
JSONObject sdRsJo = HikvisionUtil.getJSONObjectData(sdRs);
|
||||||
Integer downloadResult = sdRsJo.getJSONObject("resourceDownloadResult").getInteger("downloadResult");
|
Integer downloadResult = sdRsJo.getJSONObject("resourceDownloadResult").getInteger("downloadResult");
|
||||||
if (downloadResult == 0) {
|
if (downloadResult == 0) {
|
||||||
sucSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + ";");
|
sucSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ";");
|
||||||
} else {
|
} else {
|
||||||
log.error(workerInfo.getWorkerName() + " " + dev.getDevName() + ";");
|
log.error(workerInfo.getWorkerName() + "," + dev.getDevName() + ",fail:" + sdRsJo.toJSONString());
|
||||||
failSb.append(workerInfo.getWorkerName() + " " + dev.getDevName() + ",fail:" + sdRsJo.toJSONString());
|
failSb.append(workerInfo.getWorkerName() + "," + dev.getDevName() + ",下发异常;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import com.zhgd.xmgl.modules.basicdata.service.IBaseMenuService;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||||
import com.zhgd.xmgl.modules.mechanicalequipmentposition.entity.MechanicalEquipmentPositionDev;
|
import com.zhgd.xmgl.modules.mechanicalequipmentposition.entity.MechanicalEquipmentPositionDev;
|
||||||
import com.zhgd.xmgl.modules.mechanicalequipmentposition.mapper.MechanicalEquipmentPositionDataMapper;
|
|
||||||
import com.zhgd.xmgl.modules.mechanicalequipmentposition.mapper.MechanicalEquipmentPositionDevMapper;
|
import com.zhgd.xmgl.modules.mechanicalequipmentposition.mapper.MechanicalEquipmentPositionDevMapper;
|
||||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||||
import com.zhgd.xmgl.modules.project.entity.ProjectExternalSystemService;
|
import com.zhgd.xmgl.modules.project.entity.ProjectExternalSystemService;
|
||||||
@ -1304,11 +1303,12 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
}
|
}
|
||||||
result.put("devInfoList", devs);
|
result.put("devInfoList", devs);
|
||||||
} else if (Objects.equals(type, 2)) {
|
} else if (Objects.equals(type, 2)) {
|
||||||
//List<MechanicalEquipmentPositionDev> devs =mechanicalEquipmentPositionDevMapper.selectDevListByIdCard(carNumber);
|
MechanicalEquipmentPositionDev dev = mechanicalEquipmentPositionDevMapper.selectOne(new LambdaQueryWrapper<MechanicalEquipmentPositionDev>()
|
||||||
//if (CollUtil.isEmpty(devs)) {
|
.eq(MechanicalEquipmentPositionDev::getDevSn, carNumber));
|
||||||
// throw new OpenAlertException("该人员的安全帽设备不存在");
|
if (dev == null) {
|
||||||
//}
|
throw new OpenAlertException("该机械设备定位设备不存在");
|
||||||
//result.put("devInfoList", devs);
|
}
|
||||||
|
result.put("devInfoList", Arrays.asList(dev));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package com.zhgd.xmgl.modules.dangerous.service.impl;
|
package com.zhgd.xmgl.modules.dangerous.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringTypeDescribeControl;
|
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringTypeDescribeControl;
|
||||||
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringTypeDescribeControlMapper;
|
import com.zhgd.xmgl.modules.dangerous.mapper.DangerousEngineeringTypeDescribeControlMapper;
|
||||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeDescribeControlService;
|
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeDescribeControlService;
|
||||||
@ -28,13 +30,15 @@ public class DangerousEngineeringTypeDescribeControlServiceImpl extends ServiceI
|
|||||||
@Override
|
@Override
|
||||||
public void saveTypeDescribeControlData(Map<String, Object> map) {
|
public void saveTypeDescribeControlData(Map<String, Object> map) {
|
||||||
String describeId = MapUtils.getString(map, "describeId");
|
String describeId = MapUtils.getString(map, "describeId");
|
||||||
|
if (StrUtil.isBlank(describeId)) {
|
||||||
|
throw new OpenAlertException("类别描述id不能为空");
|
||||||
|
}
|
||||||
|
QueryWrapper<DangerousEngineeringTypeDescribeControl> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.lambda().eq(DangerousEngineeringTypeDescribeControl::getDescribeId, describeId);
|
||||||
|
dangerousEngineeringTypeDescribeControlMapper.delete(queryWrapper);
|
||||||
String controlId = MapUtils.getString(map, "controlId");
|
String controlId = MapUtils.getString(map, "controlId");
|
||||||
if (StringUtils.isNotEmpty(controlId)) {
|
if (StringUtils.isNotEmpty(controlId)) {
|
||||||
for (String id : controlId.split(",")) {
|
for (String id : controlId.split(",")) {
|
||||||
QueryWrapper<DangerousEngineeringTypeDescribeControl> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.lambda().eq(DangerousEngineeringTypeDescribeControl::getControlId, id)
|
|
||||||
.eq(DangerousEngineeringTypeDescribeControl::getDescribeId, describeId);
|
|
||||||
dangerousEngineeringTypeDescribeControlMapper.delete(queryWrapper);
|
|
||||||
DangerousEngineeringTypeDescribeControl typeDescribeControl = new DangerousEngineeringTypeDescribeControl();
|
DangerousEngineeringTypeDescribeControl typeDescribeControl = new DangerousEngineeringTypeDescribeControl();
|
||||||
typeDescribeControl.setControlId(Long.valueOf(id));
|
typeDescribeControl.setControlId(Long.valueOf(id));
|
||||||
typeDescribeControl.setDescribeId(Long.valueOf(describeId));
|
typeDescribeControl.setDescribeId(Long.valueOf(describeId));
|
||||||
|
|||||||
@ -303,6 +303,8 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
|||||||
workerInfo.setAddTime(new Date());
|
workerInfo.setAddTime(new Date());
|
||||||
workerInfo.setInserviceType(1);
|
workerInfo.setInserviceType(1);
|
||||||
workerInfoMapper.insert(workerInfo);
|
workerInfoMapper.insert(workerInfo);
|
||||||
|
//同步海康
|
||||||
|
asyncHikvision.addWorkerForHikvision(workerInfo);
|
||||||
projectUfaceConfigService.addWorkerInfo(workerInfo);
|
projectUfaceConfigService.addWorkerInfo(workerInfo);
|
||||||
//上传住建
|
//上传住建
|
||||||
asyncWorker.sendWorkerInfoById(workerInfo);
|
asyncWorker.sendWorkerInfoById(workerInfo);
|
||||||
@ -322,9 +324,6 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
|||||||
.eq(WorkerInfoDelete::getProjectSn, workerInfo.getProjectSn())
|
.eq(WorkerInfoDelete::getProjectSn, workerInfo.getProjectSn())
|
||||||
.eq(WorkerInfoDelete::getIdCard, workerInfo.getIdCard())
|
.eq(WorkerInfoDelete::getIdCard, workerInfo.getIdCard())
|
||||||
);
|
);
|
||||||
//同步海康
|
|
||||||
asyncHikvision.addWorkerForHikvision(workerInfo);
|
|
||||||
|
|
||||||
return workerInfo;
|
return workerInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -90,6 +90,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
|
|
||||||
http.authorizeRequests()
|
http.authorizeRequests()
|
||||||
//请求路径允许访问
|
//请求路径允许访问
|
||||||
|
.antMatchers("/xmgl/base/device/login").permitAll()
|
||||||
.antMatchers("/xmgl/magic/**").permitAll()
|
.antMatchers("/xmgl/magic/**").permitAll()
|
||||||
.antMatchers("/xmgl/magic/web/**").permitAll()
|
.antMatchers("/xmgl/magic/web/**").permitAll()
|
||||||
.antMatchers("/xmgl/base/**").permitAll()
|
.antMatchers("/xmgl/base/**").permitAll()
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public class HikvisionUtil {
|
|||||||
headers.put("Accept", "*/*");
|
headers.put("Accept", "*/*");
|
||||||
headers.put("Content-Type", "application/json");
|
headers.put("Content-Type", "application/json");
|
||||||
//Request request = new Request(Method.POST_STRING, host, path, appKey, appSecret, Constants.DEFAULT_TIMEOUT);
|
//Request request = new Request(Method.POST_STRING, host, path, appKey, appSecret, Constants.DEFAULT_TIMEOUT);
|
||||||
Request request = new Request(Method.POST_STRING, host, path, appKey, appSecret, Constants.DEFAULT_TIMEOUT * 60);
|
Request request = new Request(Method.POST_STRING, host, path, appKey, appSecret, Constants.DEFAULT_TIMEOUT * 10);
|
||||||
request.setHeaders(headers);
|
request.setHeaders(headers);
|
||||||
request.setQuerys(querys);
|
request.setQuerys(querys);
|
||||||
request.setStringBody(body);
|
request.setStringBody(body);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user