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

添加服务追踪

parent 514e8130
......@@ -44,7 +44,6 @@
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "设备ID", prop: "deviceId"},
{label: "设备名称", prop: "deviceName"},
......@@ -60,10 +59,9 @@
{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},
......@@ -73,7 +71,7 @@
width: 240,
formatter: row => {
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 @@
<profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path>
<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.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.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback>
......@@ -59,6 +60,7 @@
<profiles.sms.smsSendUrl>http://sms.wx3.com.cn</profiles.sms.smsSendUrl>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<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.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback>
......@@ -67,18 +69,27 @@
</properties>
</profile>
<profile>
<id>product</id>
<id>yibin</id>
<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.path>/refined</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>INFO</profiles.log.level>
<package.environment>test</package.environment>
<profiles.log.path>/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<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>
</properties>
</profile>
......
......@@ -3,12 +3,15 @@ package com.mortals.xhx.base.system.task.web;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -48,19 +51,26 @@ public class TaskController extends BaseCRUDJsonBodyMappingController<TaskServic
status.put("status", TaskExcuteStatusEnum.getEnumMap());
status.put("excuteStrategy", TaskExcuteStrategyEnum.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, Object> serviceList = new HashMap<String, Object>();
if (serviceMap != null) {
try {
serviceMap.forEach((k, v) -> {
if (null != v) {
serviceList.put(k, k);
if(!existServiceSet.contains(k)){
serviceList.put(k, k);
}
}
});
} catch (Exception ex) {
log.error("", ex);
}
}
model.put("excuteService", serviceList);
model.put(KEY_RESULT_DICT, status);
}
......
package com.mortals.xhx.busiz.req;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
......@@ -33,7 +34,7 @@ public class SmsThirdPartyReq {
/**
* 内容
*/
private String json;
private JSONObject json;
public static void main(String[] args) {
......@@ -42,7 +43,7 @@ public class SmsThirdPartyReq {
smsThirdPartyReq.setAppid("12");
smsThirdPartyReq.setPhone("31");
smsThirdPartyReq.setType("123");
smsThirdPartyReq.setJson("13213");
smsThirdPartyReq.setJson(new JSONObject());
System.out.println(JSON.toJSONString(smsThirdPartyReq));
......
......@@ -30,6 +30,7 @@ import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
......@@ -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;
//@Component
@Component
@Slf4j
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);
List<String> groupList = StrUtil.split(groupStr, ",".charAt(0));
......
......@@ -121,6 +121,10 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
planRecognBlackReq.setThreshold(threshold);
//设置人脸分组
FaceGroupEntity faceGroupEntity = faceGroupService.selectOne(new FaceGroupQuery().name(PARAM_FACE_GROUP_REGISTER));
if (ObjectUtils.isEmpty(faceGroupEntity)) {
log.info("人脸组不存在!");
return;
}
List<String> faceGroupIndexCodes = new ArrayList<>();
faceGroupIndexCodes.add(faceGroupEntity.getIndexCode());
planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes);
......@@ -147,7 +151,7 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
//更新计划
planRecognBlackReq.setIndexCode(planRecognWhiteInfo.getIndexCode());
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()));
whitePlan.setUpdateTime(new Date());
......
......@@ -41,9 +41,9 @@ public class SyncSubmitAppointTaskImpl implements ITaskExcuteService {
@Override
public void excuteTask(ITask task) throws AppException {
log.info("同步提交预约任务");
log.debug("同步提交预约任务");
syncSubmitAppoint();
log.info("同步提交预约任务完成");
log.debug("同步提交预约任务完成");
}
......
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.care.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -117,20 +118,28 @@ public class CareRecordsServiceImpl extends AbstractCRUDServiceImpl<CareRecordsD
smsThirdPartyReq.setAppid(apiId);
smsThirdPartyReq.setPhone(careRecordsEntity.getContact());
smsThirdPartyReq.setType(ParamKey.SYS_PARAM_SMS_PERSON_CARE_TYPE);
Map<String, String> form = new HashMap<>();
EntityUtil.entityToMap(smsThirdPartyReq, form);
resp = HttpUtil.doPost(smsSendUrl, form);
smsThirdPartyReq.setJson(new JSONObject());
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>>() {
});
//更新发送数量
CareRecordsQuery condition = new CareRecordsQuery();
condition.setId(careRecordsEntity.getId());
condition.setSmsCountIncrement(1);
condition.setCareCount(1);
if (apiSmsResp.getCode() == YesNoEnum.YES.getValue()) {
//更新发送数量
CareRecordsQuery condition = new CareRecordsQuery();
condition.setId(careRecordsEntity.getId());
condition.setSmsCountIncrement(1);
this.update(condition, context);
return Rest.ok();
} else {
throw new AppException(apiSmsResp.getMessage());
this.update(condition, context);
return Rest.fail(apiSmsResp.getMessage());
}
} catch (Exception e) {
......
......@@ -496,7 +496,7 @@ public class DeviceEntity extends DeviceVo {
this.deviceMac = "";
this.deviceLocation = "2";
this.deviceLocation = "";
this.lon = "";
......
......@@ -8,4 +8,10 @@ import java.util.List;
public class CameraListReq {
private int pageNo;
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;
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.CameraReq;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo;
/**
......
......@@ -8,6 +8,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.AbstractHikService;
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.CameraReq;
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.service.IHikCameraService;
......@@ -30,7 +31,7 @@ public class HikCameraServiceImpl extends AbstractHikService implements IHikCame
@Override
public Rest<CameraDataInfo> findCameraList(CameraListReq cameraListReq) {
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);
try {
log.info("camera list req=>{}", JSON.toJSONString(cameraListReq));
......
......@@ -66,5 +66,6 @@ php:
hik:
host: @profiles.hik.host@
appKey: @profiles.hik.appKey@
protocol: @profiles.hik.protocol@
appSecret: @profiles.hik.appSecret@
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