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

添加海康对接接口数据

parent b352a552
...@@ -44,18 +44,12 @@ ...@@ -44,18 +44,12 @@
{type: "selection", width: 60}, {type: "selection", width: 60},
{type: "index",label: "序号",width: 50}, {type: "index",label: "序号",width: 50},
{label: "站点Id", prop: "siteId", formatter: this.formatter}, {label: "设备ID", prop: "deviceId"},
{label: "站点名称", prop: "siteName"},
{label: "设备ID,海康", prop: "deviceId"},
{label: "设备名称", prop: "deviceName"}, {label: "设备名称", prop: "deviceName"},
{label: "设备编码", prop: "deviceCode"}, {label: "设备编码", prop: "deviceCode"},
{label: "设备的MAC地址", prop: "deviceMac"},
{label: "设备位置", prop: "deviceLocation"}, {label: "设备位置", prop: "deviceLocation"},
{label: "经度", prop: "lon"}, {label: "经度", prop: "lon"},
...@@ -66,13 +60,10 @@ ...@@ -66,13 +60,10 @@
{label: "楼栋", prop: "build",formatter: this.formatter}, {label: "楼栋", prop: "build",formatter: this.formatter},
{label: "负责人", prop: "leadingOfficial"},
{label: "联系电话", prop: "leadingOfficialTelephone"},
{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},
...@@ -82,7 +73,7 @@ ...@@ -82,7 +73,7 @@
width: 240, width: 240,
formatter: row => { formatter: row => {
return ( return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <table-buttons noAdd noEdit row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
); );
} }
} }
...@@ -91,4 +82,4 @@ ...@@ -91,4 +82,4 @@
}; };
} }
}; };
</script> </script>
\ No newline at end of file
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" :config="tableConfig"> <LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow"; import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "PersonList", name: "PersonList",
components: { components: {
dialogShow dialogShow
}, },
mixins: [table], mixins: [table],
created() { created() {
}, },
methods: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
this.$refs.dialogform.add(row); this.$refs.dialogform.add(row);
}, },
/** 重写编辑方法 */ /** 重写编辑方法 */
toEdit(row) { toEdit(row) {
this.$refs.dialogform.edit(row); this.$refs.dialogform.edit(row);
}, },
/** 重写查看方法 */ /** 重写查看方法 */
toView(row) { toView(row) {
this.$refs.dialogform.view(row); this.$refs.dialogform.view(row);
}, },
}, },
data() { data() {
return { return {
config: { config: {
search: [ search: [
], ],
columns: [ columns: [
{type: "selection", width: 60}, {type: "selection", width: 60},
{type: "index",label: "序号",width: 50}, {type: "index",label: "序号",width: 50},
{label: "站点Id", prop: "siteId", formatter: this.formatter}, {label: "身份证号码", prop: "idCard"},
{label: "站点名称", prop: "siteName"}, {label: "性别", prop: "gender",formatter: this.formatter},
{label: "身份证号码", prop: "idCard"}, {label: "出生日期", prop: "birthday", formatter: this.formatterDate},
{label: "性别", prop: "gender",formatter: this.formatter}, {label: "家庭住址", prop: "address"},
{label: "出生日期", prop: "birthday", formatter: this.formatterDate}, {label: "照片路径", prop: "photo"},
{label: "家庭住址", prop: "address"}, {label: "注册人员来源", prop: "source",formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter}, {label: "是否添加到海康人脸库", prop: "inFaceHk",formatter: this.formatter},
{
label: "操作", {label: "创建用户", prop: "createUserId", formatter: this.formatter},
width: 240, {
formatter: row => { label: "操作",
return ( width: 240,
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> formatter: row => {
); return (
} <table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
} );
] }
} }
}; ]
} }
}; };
</script> }
\ No newline at end of file };
</script>
...@@ -77,10 +77,6 @@ ...@@ -77,10 +77,6 @@
{type: "selection", width: 60}, {type: "selection", width: 60},
{type: "index",label: "序号",width: 50}, {type: "index",label: "序号",width: 50},
{label: "站点Id", prop: "siteId", formatter: this.formatter},
{label: "站点名称", prop: "siteName"},
{label: "姓名", prop: "name"}, {label: "姓名", prop: "name"},
{label: "监测设备", prop: "device"}, {label: "监测设备", prop: "device"},
......
...@@ -31,6 +31,13 @@ ...@@ -31,6 +31,13 @@
<profiles.log.path>/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>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>k6BVS1PEbyzcJAE4</profiles.sms.apiId>
<profiles.sms.type>3</profiles.sms.type>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.appKey>k6BVS1PEbyzcJAE4</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<package.environment>serve</package.environment> <package.environment>serve</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
</properties> </properties>
......
package com.mortals.xhx.module.hik;
import org.springframework.beans.factory.annotation.Value;
public abstract class AbstractHikService {
@Value("${hik.host:''")
protected String host;
@Value("${hik.appKey:''}")
protected String appKey;
@Value("${hik.appSecret:''}")
protected String appSecret;
@Value("${hik.protocol:'http://'}")
protected String protocol;
public String ARTEMIS_PATH = "/artemis";
}
package com.mortals.xhx.module.hik.model;
import lombok.Data;
/**
* 海康请求基础类
* @author:
* @date: 2023/4/12 17:57
*/
@Data
public class BaseReq {
/**
* 当前页
*/
private String pageNo;
/**
* 每页大小
*/
private String pageSize;
// /**
// * http协议
// */
// private String httpProtocol="http://";
}
package com.mortals.xhx.module.hik.model.person.req;
import com.mortals.xhx.module.hik.model.BaseReq;
import lombok.Data;
import java.io.Serializable;
@Data
public class PersonReq extends BaseReq implements Serializable {
/**
* 当前页
*/
private String pageNo;
/**
* 每页大小
*/
private String pageSize;
}
package com.mortals.xhx.module.hik.service;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.model.person.req.PersonReq;
/**
* 海康人员接口对接类
* @author:
* @date: 2023/4/12 17:47
*/
public interface IHikPersonService {
/**
* 请求人员接口
* @param personReq
* @return
*/
Rest<String> callPostApiGetPersonList(PersonReq personReq);
}
package com.mortals.xhx.module.hik.service.impl;
import com.alibaba.fastjson.JSON;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.hik.AbstractHikService;
import com.mortals.xhx.module.hik.model.person.req.PersonReq;
import com.mortals.xhx.module.hik.service.IHikPersonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* 海康人员接口类
*
* @author: zxfei
* @date: 2023/4/12 17:51
*/
@Service("hikPersonService")
@Slf4j
public class HikPersonServiceImpl extends AbstractHikService implements IHikPersonService {
@Override
public Rest<String> callPostApiGetPersonList(PersonReq personReq) {
ArtemisConfig config = new ArtemisConfig();
config.setHost(super.host);
config.setAppKey(appKey); // 秘钥appkey
config.setAppSecret(appSecret);// 秘钥appSecret
String getCamsApi = ARTEMIS_PATH + "/api/resource/v1/person/personList";
Map<String, String> path = new HashMap<String, String>(2) {
{
put(protocol, getCamsApi);
}
};
try {
String resp = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(personReq), null, null, "application/json");
log.info("person resp=>", resp);
return Rest.ok(resp);
} catch (Exception e) {
log.error("获取人员异常", e);
return Rest.fail(e.getMessage());
}
}
}
...@@ -53,3 +53,11 @@ hystrix: ...@@ -53,3 +53,11 @@ hystrix:
isolation: isolation:
thread: thread:
timeoutInMilliseconds: 60000 timeoutInMilliseconds: 60000
sms:
smsSendUrl: @profiles.sms.smsSendUrl@
apiId: @profiles.sms.apiId@
type: @profiles.sms.type@
hik:
host: @profiles.hik.host@
appKey: @profiles.hik.appKey@
appSecret: @profiles.hik.appSecret@
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