Commit cba37d01 authored by 赵啸非's avatar 赵啸非

添加服务追踪

parent 514e8130
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
{type: "selection", width: 60}, {type: "selection", width: 60},
{type: "index",label: "序号",width: 50}, {type: "index",label: "序号",width: 50},
{label: "设备ID", prop: "deviceId"},
{label: "设备名称", prop: "deviceName"}, {label: "设备名称", prop: "deviceName"},
...@@ -60,10 +59,9 @@ ...@@ -60,10 +59,9 @@
{label: "楼栋", prop: "build",formatter: this.formatter}, {label: "楼栋", prop: "build",formatter: this.formatter},
/* {label: "超时时间", prop: "timeOutPeriod",formatter: this.formatter},
{label: "超时时间", prop: "timeOutPeriod",formatter: this.formatter}, {label: "临近时间", prop: "nearTime",formatter: this.formatter},*/
{label: "临近时间", prop: "nearTime",formatter: this.formatter},
{label: "设备状态 ", prop: "deviceStatus",formatter: this.formatter}, {label: "设备状态 ", prop: "deviceStatus",formatter: this.formatter},
...@@ -73,7 +71,7 @@ ...@@ -73,7 +71,7 @@
width: 240, width: 240,
formatter: row => { formatter: row => {
return ( return (
<table-buttons noAdd noEdit row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <table-buttons noAdd noEdit noDel row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
); );
} }
} }
......
...@@ -32,9 +32,10 @@ ...@@ -32,9 +32,10 @@
<profiles.log.level>info</profiles.log.level> <profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.php.host>http://192.168.0.98:8090</profiles.php.host> <profiles.php.host>http://192.168.0.98:8090</profiles.php.host>
<profiles.sms.smsSendUrl>http://sms.wx3.com.cn</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://sms.wx3.com.cn/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host> <profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback> <profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback>
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
<profiles.sms.smsSendUrl>http://sms.wx3.com.cn</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://sms.wx3.com.cn</profiles.sms.smsSendUrl>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host> <profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback> <profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback>
...@@ -67,18 +69,27 @@ ...@@ -67,18 +69,27 @@
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>product</id> <id>yibin</id>
<properties> <properties>
<profiles.active>test</profiles.active> <profiles.active>yibin</profiles.active>
<profiles.server.port>21080</profiles.server.port>
<profiles.server.port>21080</profiles.server.port> <profiles.server.port>21080</profiles.server.port>
<profiles.server.path>/refined</profiles.server.path> <profiles.server.path>/refined</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/mortals/app/logs</profiles.log.path>
<profiles.log.level>INFO</profiles.log.level> <profiles.log.level>info</profiles.log.level>
<package.environment>test</package.environment> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.php.host>http://172.15.28.116:8090</profiles.php.host>
<profiles.sms.smsSendUrl>http://172.15.28.113:8901/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<profiles.hik.host>10.12.177.245:443</profiles.hik.host>
<profiles.hik.protocol>https://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.hik.callback>http://10.12.185.213:11080/refined/hik/eventRcv</profiles.hik.callback>
<package.environment>build</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
</properties> </properties>
</profile> </profile>
......
...@@ -3,12 +3,15 @@ package com.mortals.xhx.base.system.task.web; ...@@ -3,12 +3,15 @@ package com.mortals.xhx.base.system.task.web;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.task.model.TaskQuery; import com.mortals.xhx.base.system.task.model.TaskQuery;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -48,19 +51,26 @@ public class TaskController extends BaseCRUDJsonBodyMappingController<TaskServic ...@@ -48,19 +51,26 @@ public class TaskController extends BaseCRUDJsonBodyMappingController<TaskServic
status.put("status", TaskExcuteStatusEnum.getEnumMap()); status.put("status", TaskExcuteStatusEnum.getEnumMap());
status.put("excuteStrategy", TaskExcuteStrategyEnum.getEnumMap()); status.put("excuteStrategy", TaskExcuteStrategyEnum.getEnumMap());
status.put("interimExcuteStatus", TaskInterimExcuteStatusEnum.getEnumMap()); status.put("interimExcuteStatus", TaskInterimExcuteStatusEnum.getEnumMap());
Set<String> existServiceSet = this.service.find(new TaskQuery()).stream().map(i -> i.getExcuteService()).collect(Collectors.toSet());
Map<String, ITaskExcuteService> serviceMap = GlobalSysInfo.getBeansByType(ITaskExcuteService.class); Map<String, ITaskExcuteService> serviceMap = GlobalSysInfo.getBeansByType(ITaskExcuteService.class);
Map<String, Object> serviceList = new HashMap<String, Object>(); Map<String, Object> serviceList = new HashMap<String, Object>();
if (serviceMap != null) { if (serviceMap != null) {
try { try {
serviceMap.forEach((k, v) -> { serviceMap.forEach((k, v) -> {
if (null != v) { if (null != v) {
if(!existServiceSet.contains(k)){
serviceList.put(k, k); serviceList.put(k, k);
} }
}
}); });
} catch (Exception ex) { } catch (Exception ex) {
log.error("", ex); log.error("", ex);
} }
} }
model.put("excuteService", serviceList); model.put("excuteService", serviceList);
model.put(KEY_RESULT_DICT, status); model.put(KEY_RESULT_DICT, status);
} }
......
package com.mortals.xhx.busiz.req; package com.mortals.xhx.busiz.req;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
...@@ -33,7 +34,7 @@ public class SmsThirdPartyReq { ...@@ -33,7 +34,7 @@ public class SmsThirdPartyReq {
/** /**
* 内容 * 内容
*/ */
private String json; private JSONObject json;
public static void main(String[] args) { public static void main(String[] args) {
...@@ -42,7 +43,7 @@ public class SmsThirdPartyReq { ...@@ -42,7 +43,7 @@ public class SmsThirdPartyReq {
smsThirdPartyReq.setAppid("12"); smsThirdPartyReq.setAppid("12");
smsThirdPartyReq.setPhone("31"); smsThirdPartyReq.setPhone("31");
smsThirdPartyReq.setType("123"); smsThirdPartyReq.setType("123");
smsThirdPartyReq.setJson("13213"); smsThirdPartyReq.setJson(new JSONObject());
System.out.println(JSON.toJSONString(smsThirdPartyReq)); System.out.println(JSON.toJSONString(smsThirdPartyReq));
......
...@@ -30,6 +30,7 @@ import com.mortals.xhx.module.hik.face.service.IHikPlanService; ...@@ -30,6 +30,7 @@ import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -41,7 +42,7 @@ import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP; ...@@ -41,7 +42,7 @@ import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP;
import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP_REGISTER; import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP_REGISTER;
//@Component @Component
@Slf4j @Slf4j
public class SubEventStartedService implements IApplicationStartedService { public class SubEventStartedService implements IApplicationStartedService {
...@@ -79,8 +80,6 @@ public class SubEventStartedService implements IApplicationStartedService { ...@@ -79,8 +80,6 @@ public class SubEventStartedService implements IApplicationStartedService {
//查询本地指定人脸分组 如果没有则添加 并更新 //查询本地指定人脸分组 如果没有则添加 并更新
String groupStr = GlobalSysInfo.getParamValue(PARAM_FACE_GROUP, PARAM_FACE_GROUP_REGISTER); String groupStr = GlobalSysInfo.getParamValue(PARAM_FACE_GROUP, PARAM_FACE_GROUP_REGISTER);
List<String> groupList = StrUtil.split(groupStr, ",".charAt(0)); List<String> groupList = StrUtil.split(groupStr, ",".charAt(0));
......
...@@ -121,6 +121,10 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { ...@@ -121,6 +121,10 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
planRecognBlackReq.setThreshold(threshold); planRecognBlackReq.setThreshold(threshold);
//设置人脸分组 //设置人脸分组
FaceGroupEntity faceGroupEntity = faceGroupService.selectOne(new FaceGroupQuery().name(PARAM_FACE_GROUP_REGISTER)); FaceGroupEntity faceGroupEntity = faceGroupService.selectOne(new FaceGroupQuery().name(PARAM_FACE_GROUP_REGISTER));
if (ObjectUtils.isEmpty(faceGroupEntity)) {
log.info("人脸组不存在!");
return;
}
List<String> faceGroupIndexCodes = new ArrayList<>(); List<String> faceGroupIndexCodes = new ArrayList<>();
faceGroupIndexCodes.add(faceGroupEntity.getIndexCode()); faceGroupIndexCodes.add(faceGroupEntity.getIndexCode());
planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes); planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes);
...@@ -147,7 +151,7 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { ...@@ -147,7 +151,7 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
//更新计划 //更新计划
planRecognBlackReq.setIndexCode(planRecognWhiteInfo.getIndexCode()); planRecognBlackReq.setIndexCode(planRecognWhiteInfo.getIndexCode());
Rest<Boolean> planRecognWhiteUpdateRest = hikPlanService.planRecognWhiteUpdate(planRecognBlackReq); Rest<Boolean> planRecognWhiteUpdateRest = hikPlanService.planRecognWhiteUpdate(planRecognBlackReq);
if (planRecognWhiteUpdateRest.getCode() == YesNoEnum.YES.getValue()&&planRecognWhiteUpdateRest.getData()) { if (planRecognWhiteUpdateRest.getCode() == YesNoEnum.YES.getValue() && planRecognWhiteUpdateRest.getData()) {
FacePlanEntity whitePlan = facePlanService.selectOne(new FacePlanQuery().indexCode(planRecognWhiteInfo.getIndexCode())); FacePlanEntity whitePlan = facePlanService.selectOne(new FacePlanQuery().indexCode(planRecognWhiteInfo.getIndexCode()));
whitePlan.setUpdateTime(new Date()); whitePlan.setUpdateTime(new Date());
......
...@@ -10,6 +10,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity; ...@@ -10,6 +10,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.hik.camera.model.req.CameraListReq; import com.mortals.xhx.module.hik.camera.model.req.CameraListReq;
import com.mortals.xhx.module.hik.camera.model.req.CameraReq;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo;
import com.mortals.xhx.module.hik.camera.service.IHikCameraService; import com.mortals.xhx.module.hik.camera.service.IHikCameraService;
...@@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -83,12 +85,10 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -83,12 +85,10 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
* "updateTime": "2023-04-10T15:11:56.446+08:00" * "updateTime": "2023-04-10T15:11:56.446+08:00"
*/ */
private void syncDevice() { private void syncDevice() {
CameraListReq cameraListReq = new CameraListReq(); CameraListReq cameraListReq = new CameraListReq();
cameraListReq.setPageNo(1); cameraListReq.setPageNo(1);
cameraListReq.setPageSize(200); cameraListReq.setPageSize(200);
cameraListReq.setRegionIndexCode("root000000");
Rest<CameraDataInfo> rest = hikCameraService.findCameraList(cameraListReq); Rest<CameraDataInfo> rest = hikCameraService.findCameraList(cameraListReq);
if (rest.getCode() == YesNoEnum.YES.getValue()) { if (rest.getCode() == YesNoEnum.YES.getValue()) {
List<CameraInfo> cameraDataInfoList = rest.getData().getList(); List<CameraInfo> cameraDataInfoList = rest.getData().getList();
...@@ -142,103 +142,12 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -142,103 +142,12 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
if (!ObjectUtils.isEmpty(delDeviceList)) { if (!ObjectUtils.isEmpty(delDeviceList)) {
log.info("设备删除,size:{}", delDeviceList.size()); log.info("设备删除,size:{}", delDeviceList.size());
deviceService.remove(delDeviceList,null); deviceService.remove(delDeviceList, null);
}
}
}else{
log.info("同步设备异常=>{}", JSON.toJSONString(rest));
}
// planRecognBlackListReq.set
//hikCameraService.findPlanRecognBlackList()
/* SitePdu sitePdu = new SitePdu();
sitePdu.setId(1L);
Rest<List<SitePdu>> siteRest = siteFeign.getFlatSitesBySiteId(sitePdu);
if (siteRest.getCode() == YesNoEnum.YES.getValue()) {
log.info("站点总数量:{}", siteRest.getData().size());
siteRest.getData().forEach(site -> {
log.info("站点名称:{}",site.getSiteName());
DevicePdu devicePdu = new DevicePdu();
devicePdu.setProductCode("ybj");
devicePdu.setSize(-1);
Rest<RespData<List<DevicePdu>>> deviceRest = deviceFeign.list(devicePdu);
log.info("deviceRest:{}",JSON.toJSONString(deviceRest));
if (YesNoEnum.YES.getValue() == deviceRest.getCode()) {
List<DevicePdu> devicePduList = deviceRest.getData().getData();
log.info("样表机总数量:{}", devicePduList.size());
if (!ObjectUtils.isEmpty(devicePduList)) {
List<DeviceEntity> newDeviceList = devicePduList.stream().map(newDevice -> {
DeviceEntity deviceEntity = new DeviceEntity();
deviceEntity.initAttrValue();
BeanUtils.copyProperties(newDevice, deviceEntity, BeanUtil.getNullPropertyNames(newDevice));
return deviceEntity;
}).collect(Collectors.toList());
List<DeviceEntity> oldDeviceList = deviceService.find(new DeviceQuery().siteId(site.getId()));
Map<String, DeviceEntity> oldDeviceMap = oldDeviceList.stream().collect(Collectors.toMap(x -> x.getDeviceCode(), y -> y, (o, n) -> n));
Map<String, DeviceEntity> newDeviceMap = newDeviceList.stream().collect(Collectors.toMap(x -> x.getDeviceCode(), y -> y, (o, n) -> n));
List<DeviceEntity> updateDeviceLsit = newDeviceList.stream().map(item -> {
if (oldDeviceMap.containsKey(item.getDeviceCode())) {
item.setId(oldDeviceMap.get(item.getDeviceCode()).getId());
item.setDeviceId(item.getId());
item.setProductCode(oldDeviceMap.get(item.getDeviceCode()).getProductCode());
item.setProductName(oldDeviceMap.get(item.getDeviceCode()).getProductName());
item.setUpdateTime(new Date());
return item;
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
List<DeviceEntity> saveDeviceList = newDeviceList.stream().map(item -> {
if (!oldDeviceMap.containsKey(item.getDeviceCode())) {
item.setDeviceId(item.getId());
item.setCreateUserId(1L);
item.setCreateUserName("系统管理员");
item.setCreateTime(new Date());
return item;
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
//做差集
List<Long> delDeviceList = oldDeviceList.stream().map(item -> {
if (!newDeviceMap.containsKey(item.getDeviceCode())) {
return item.getId();
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(updateDeviceLsit)) {
log.info("设备更新,size:{}", updateDeviceLsit.size());
deviceService.update(updateDeviceLsit);
}
if (!ObjectUtils.isEmpty(saveDeviceList)) {
log.info("设备新增,size:{}", saveDeviceList.size());
deviceService.save(saveDeviceList);
}
if (!ObjectUtils.isEmpty(delDeviceList)) {
log.info("设备删除,size:{}", delDeviceList.size());
deviceService.remove(delDeviceList,null);
} }
} }
} else { } else {
log.info("设备列表查询异常,{}", JSON.toJSONString(deviceRest)); log.info("同步设备异常=>{}", JSON.toJSONString(rest));
} }
});
} else {
log.info("站点列表查询异常,{}", JSON.toJSONString(siteRest));
}*/
} }
......
...@@ -41,9 +41,9 @@ public class SyncSubmitAppointTaskImpl implements ITaskExcuteService { ...@@ -41,9 +41,9 @@ public class SyncSubmitAppointTaskImpl implements ITaskExcuteService {
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
log.info("同步提交预约任务"); log.debug("同步提交预约任务");
syncSubmitAppoint(); syncSubmitAppoint();
log.info("同步提交预约任务完成"); log.debug("同步提交预约任务完成");
} }
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.care.service.impl; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.module.care.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -117,20 +118,28 @@ public class CareRecordsServiceImpl extends AbstractCRUDServiceImpl<CareRecordsD ...@@ -117,20 +118,28 @@ public class CareRecordsServiceImpl extends AbstractCRUDServiceImpl<CareRecordsD
smsThirdPartyReq.setAppid(apiId); smsThirdPartyReq.setAppid(apiId);
smsThirdPartyReq.setPhone(careRecordsEntity.getContact()); smsThirdPartyReq.setPhone(careRecordsEntity.getContact());
smsThirdPartyReq.setType(ParamKey.SYS_PARAM_SMS_PERSON_CARE_TYPE); smsThirdPartyReq.setType(ParamKey.SYS_PARAM_SMS_PERSON_CARE_TYPE);
Map<String, String> form = new HashMap<>(); smsThirdPartyReq.setJson(new JSONObject());
EntityUtil.entityToMap(smsThirdPartyReq, form);
resp = HttpUtil.doPost(smsSendUrl, form); Map<String, Object> form = BeanUtil.beanToMap(smsThirdPartyReq, false, true);
log.info("sms req sendUrl:{} params:{}", smsSendUrl, JSON.toJSONString(form));
resp = cn.hutool.http.HttpUtil.post(smsSendUrl, form);
log.info("sms resp:{}", resp);
// resp = HttpUtil.doPost(smsSendUrl, form);
ApiSmsResp<Void> apiSmsResp = JSON.parseObject(resp, new TypeReference<ApiSmsResp<Void>>() { ApiSmsResp<Void> apiSmsResp = JSON.parseObject(resp, new TypeReference<ApiSmsResp<Void>>() {
}); });
if (apiSmsResp.getCode() == YesNoEnum.YES.getValue()) {
//更新发送数量 //更新发送数量
CareRecordsQuery condition = new CareRecordsQuery(); CareRecordsQuery condition = new CareRecordsQuery();
condition.setId(careRecordsEntity.getId()); condition.setId(careRecordsEntity.getId());
condition.setSmsCountIncrement(1); condition.setSmsCountIncrement(1);
condition.setCareCount(1);
if (apiSmsResp.getCode() == YesNoEnum.YES.getValue()) {
this.update(condition, context); this.update(condition, context);
return Rest.ok(); return Rest.ok();
} else { } else {
throw new AppException(apiSmsResp.getMessage()); this.update(condition, context);
return Rest.fail(apiSmsResp.getMessage());
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -496,7 +496,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -496,7 +496,7 @@ public class DeviceEntity extends DeviceVo {
this.deviceMac = ""; this.deviceMac = "";
this.deviceLocation = "2"; this.deviceLocation = "";
this.lon = ""; this.lon = "";
......
...@@ -8,4 +8,10 @@ import java.util.List; ...@@ -8,4 +8,10 @@ import java.util.List;
public class CameraListReq { public class CameraListReq {
private int pageNo; private int pageNo;
private int pageSize; private int pageSize;
private String cameraIndexCodes;
private String encodeDevIndexCode;
private String regionIndexCode;
} }
\ No newline at end of file
package com.mortals.xhx.module.hik.camera.model.req;
import java.util.List;
import lombok.Data;
@Data
public class CameraReq{
private List<String> regionIndexCodes;
private String orderType;
private int pageNo;
private String name;
private List<String> authCodes;
private int pageSize;
private String orderBy;
private List<ExpressionsItem> expressions;
private boolean isSubRegion;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.camera.model.req;
import java.util.List;
import lombok.Data;
@Data
public class ExpressionsItem{
private List<String> values;
private String key;
private int operator;
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.mortals.xhx.module.hik.camera.service; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.module.hik.camera.service;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.camera.model.req.CameraListReq; import com.mortals.xhx.module.hik.camera.model.req.CameraListReq;
import com.mortals.xhx.module.hik.camera.model.req.CameraReq;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo;
/** /**
......
...@@ -8,6 +8,7 @@ import com.mortals.framework.common.Rest; ...@@ -8,6 +8,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.AbstractHikService; import com.mortals.xhx.module.hik.AbstractHikService;
import com.mortals.xhx.module.hik.HikApiRest; import com.mortals.xhx.module.hik.HikApiRest;
import com.mortals.xhx.module.hik.camera.model.req.CameraListReq; import com.mortals.xhx.module.hik.camera.model.req.CameraListReq;
import com.mortals.xhx.module.hik.camera.model.req.CameraReq;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo;
import com.mortals.xhx.module.hik.camera.service.IHikCameraService; import com.mortals.xhx.module.hik.camera.service.IHikCameraService;
...@@ -30,7 +31,7 @@ public class HikCameraServiceImpl extends AbstractHikService implements IHikCame ...@@ -30,7 +31,7 @@ public class HikCameraServiceImpl extends AbstractHikService implements IHikCame
@Override @Override
public Rest<CameraDataInfo> findCameraList(CameraListReq cameraListReq) { public Rest<CameraDataInfo> findCameraList(CameraListReq cameraListReq) {
ArtemisConfig config = getArtemisConfig(); ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/resource/v1/cameras"; String getCamsApi = ARTEMIS_PATH + "/api/resource/v1/camera/advance/cameraList";
path.put(protocol, getCamsApi); path.put(protocol, getCamsApi);
try { try {
log.info("camera list req=>{}", JSON.toJSONString(cameraListReq)); log.info("camera list req=>{}", JSON.toJSONString(cameraListReq));
......
...@@ -66,5 +66,6 @@ php: ...@@ -66,5 +66,6 @@ php:
hik: hik:
host: @profiles.hik.host@ host: @profiles.hik.host@
appKey: @profiles.hik.appKey@ appKey: @profiles.hik.appKey@
protocol: @profiles.hik.protocol@
appSecret: @profiles.hik.appSecret@ appSecret: @profiles.hik.appSecret@
callback: @profiles.hik.callback@ callback: @profiles.hik.callback@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment