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} />
); );
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<Field label="手机号码" prop="phone" v-model="form.phone" placeholder="请输入手机号码"/> <Field label="手机号码" prop="phone" v-model="form.phone" placeholder="请输入手机号码"/>
<Field label="出生日期" prop="birthday" v-model="form.birthday" type="date" /> <Field label="出生日期" prop="birthday" v-model="form.birthday" type="date" />
<Field label="家庭住址" prop="address" v-model="form.address" type="textarea" placeholder="请输入家庭住址"/> <Field label="家庭住址" prop="address" v-model="form.address" type="textarea" placeholder="请输入家庭住址"/>
<Field label="照片路径" prop="photo" v-model="form.photo" placeholder="请输入照片路径"/> <Field label="照片路径"><imageUpload v-model="form.photo" prePath="/file/preview"/></Field>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/> <Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="注册人员来源" prop="source" v-model="form.source" type="select" :enumData="dict.source" placeholder="请选择注册人员来源"/> <Field label="注册人员来源" prop="source" v-model="form.source" type="select" :enumData="dict.source" placeholder="请选择注册人员来源"/>
<Field label="是否添加到海康人脸库" prop="inFaceHk" v-model="form.inFaceHk" type="select" :enumData="dict.inFaceHk" placeholder="请选择是否添加到海康人脸库"/> <Field label="是否添加到海康人脸库" prop="inFaceHk" v-model="form.inFaceHk" type="select" :enumData="dict.inFaceHk" placeholder="请选择是否添加到海康人脸库"/>
...@@ -29,12 +29,14 @@ ...@@ -29,12 +29,14 @@
</template> </template>
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
import dialogShow from "./dialogshow"; import dialogShow from "./dialogshow";
export default { import ImageUpload from '@/components/ImageUpload';
export default {
mixins: [form], mixins: [form],
components: { components: {
dialogShow , dialogShow ,
ImageUpload,
}, },
data() { data() {
return { return {
...@@ -142,5 +144,5 @@ ...@@ -142,5 +144,5 @@
} }
}, },
}, },
}; };
</script> </script>
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
</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() {
}, },
...@@ -44,10 +44,6 @@ ...@@ -44,10 +44,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: "idCard"}, {label: "身份证号码", prop: "idCard"},
{label: "性别", prop: "gender",formatter: this.formatter}, {label: "性别", prop: "gender",formatter: this.formatter},
...@@ -56,6 +52,12 @@ ...@@ -56,6 +52,12 @@
{label: "家庭住址", prop: "address"}, {label: "家庭住址", prop: "address"},
{label: "照片路径", prop: "photo"},
{label: "注册人员来源", prop: "source",formatter: this.formatter},
{label: "是否添加到海康人脸库", prop: "inFaceHk",formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter}, {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{ {
label: "操作", label: "操作",
...@@ -70,5 +72,5 @@ ...@@ -70,5 +72,5 @@
} }
}; };
} }
}; };
</script> </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