Commit 59f8655d authored by 赵啸非's avatar 赵啸非

添加服务追踪

parent 62b44130
INSERT INTO `mortals_xhx_param` VALUES (null, '注册人员来源', 'Person', 'source', '3', '海康考勤系统', 1, 4, 0, 'source', NULL, NULL, NULL);
...@@ -251,23 +251,25 @@ CREATE TABLE mortals_xhx_person( ...@@ -251,23 +251,25 @@ CREATE TABLE mortals_xhx_person(
`siteId` bigint(20) COMMENT '站点Id', `siteId` bigint(20) COMMENT '站点Id',
`siteName` varchar(256) COMMENT '站点名称', `siteName` varchar(256) COMMENT '站点名称',
`name` varchar(128) COMMENT '用户名称', `name` varchar(128) COMMENT '用户名称',
`idCard` varchar(18) COMMENT '身份证号码', `idCard` varchar(32) COMMENT '身份证号码',
`gender` tinyint(2) NOT NULL DEFAULT '0' COMMENT '性别(0.男,1.女)', `gender` tinyint(2) DEFAULT '0' COMMENT '性别(0.男,1.女)',
`phone` varchar(20) COMMENT '手机号码', `phone` varchar(20) COMMENT '手机号码',
`birthday` datetime NOT NULL COMMENT '出生日期', `birthday` datetime COMMENT '出生日期',
`address` varchar(256) NOT NULL COMMENT '家庭住址', `address` varchar(256) COMMENT '家庭住址',
`photo` varchar(128) NOT NULL COMMENT '本地照片路径', `photo` varchar(128) COMMENT '本地照片路径',
`sourcePhotoUri` varchar(128) COMMENT '原始照片路径', `sourcePhotoUri` varchar(128) COMMENT '原始照片路径',
`sourceId` bigint(20) COMMENT 'Php原始注册用户id', `sourceId` bigint(20) COMMENT 'Php原始注册用户id',
`remark` varchar(256) COMMENT '备注', `remark` varchar(256) COMMENT '备注',
`source` tinyint(2) COMMENT '注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它)', `source` tinyint(2) DEFAULT '0' COMMENT '注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)',
`inFaceHk` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否添加到海康人脸库(0.否,1.是)', `inFaceHk` tinyint(2) DEFAULT '0' COMMENT '是否添加到海康人脸库(0.否,1.是)',
`indexCode` varchar(256) COMMENT '人脸的唯一标识', `indexCode` varchar(256) COMMENT '人脸的唯一标识',
`ifaceGroupIndexCode` varchar(256) COMMENT '人脸所属的人脸分组的唯一标识', `ifaceGroupIndexCode` varchar(256) COMMENT '人脸所属的人脸分组的唯一标识',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户', `createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户', `updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间', `updateTime` datetime COMMENT '更新时间',
`picUrl` varchar(256) COMMENT '海康人脸图片url',
`serverIndexCode` varchar(256) COMMENT '海康人脸服务标识',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='注册人员'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='注册人员';
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>refined-manager</artifactId> <artifactId>refined-manager</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<description>精细化管理平台</description> <description>精细化管理平台</description>
<parent> <parent>
<groupId>com.mortals.xhx</groupId> <groupId>com.mortals.xhx</groupId>
...@@ -14,312 +14,313 @@ ...@@ -14,312 +14,313 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<profiles> <profiles>
<profile> <profile>
<id>develop</id> <id>develop</id>
<activation> <activation>
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
<properties> <properties>
<profiles.active>develop</profiles.active> <profiles.active>develop</profiles.active>
<profiles.platform.type>standalone</profiles.platform.type> <profiles.platform.type>standalone</profiles.platform.type>
<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.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1: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>/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.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/api/index/index</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.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://10.12.185.213:11080/refined/hik/eventRcv</profiles.hik.callback>
<package.environment>serve</package.environment> <package.environment>serve</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
</properties> <showSql>true</showSql>
</profile> </properties>
<profile> </profile>
<id>test</id> <profile>
<properties> <id>test</id>
<profiles.active>test</profiles.active> <properties>
<profiles.platform.type>cloud</profiles.platform.type> <profiles.active>test</profiles.active>
<profiles.server.port>21080</profiles.server.port> <profiles.platform.type>cloud</profiles.platform.type>
<profiles.server.path>/refined</profiles.server.path> <profiles.server.port>21080</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.server.path>/refined</profiles.server.path>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.php.host>http://192.168.0.98:8090</profiles.php.host> <profiles.log.level>INFO</profiles.log.level>
<profiles.sms.smsSendUrl>http://sms.wx3.com.cn</profiles.sms.smsSendUrl> <profiles.php.host>http://192.168.0.98:8090</profiles.php.host>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId> <profiles.sms.smsSendUrl>http://sms.wx3.com.cn</profiles.sms.smsSendUrl>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<profiles.hik.protocol>http://</profiles.hik.protocol> <profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<package.environment>test</package.environment> <profiles.hik.callback>http://8.136.255.30:11080/refined/hik/eventRcv</profiles.hik.callback>
<skipUi>false</skipUi> <package.environment>test</package.environment>
</properties> <skipUi>false</skipUi>
</profile> </properties>
<profile> </profile>
<id>yibin</id> <profile>
<properties> <id>yibin</id>
<profiles.active>yibin</profiles.active> <properties>
<profiles.platform.type>cloud</profiles.platform.type> <profiles.active>yibin</profiles.active>
<profiles.server.port>21080</profiles.server.port> <profiles.platform.type>cloud</profiles.platform.type>
<profiles.server.path>/refined</profiles.server.path> <profiles.server.port>21080</profiles.server.port>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr> <profiles.server.path>/refined</profiles.server.path>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>info</profiles.log.level> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.log.level>info</profiles.log.level>
<profiles.php.host>http://172.15.28.116:8090</profiles.php.host> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.sms.smsSendUrl>http://172.15.28.113:8901/api/index/index</profiles.sms.smsSendUrl> <profiles.php.host>http://172.15.28.116:8090</profiles.php.host>
<profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId> <profiles.sms.smsSendUrl>http://172.15.28.113:8901/api/index/index</profiles.sms.smsSendUrl>
<profiles.hik.host>10.12.177.245:443</profiles.hik.host> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<profiles.hik.protocol>https://</profiles.hik.protocol> <profiles.hik.host>10.12.177.245:443</profiles.hik.host>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.protocol>https://</profiles.hik.protocol>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.callback>http://10.12.185.213:11080/refined/hik/eventRcv</profiles.hik.callback> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<package.environment>build</package.environment> <profiles.hik.callback>http://10.12.185.213:11080/refined/hik/eventRcv</profiles.hik.callback>
<skipUi>false</skipUi> <package.environment>build</package.environment>
</properties> <skipUi>false</skipUi>
</profile> </properties>
</profile>
</profiles> </profiles>
<properties>
</properties>
<dependencies> <properties>
<dependency> </properties>
<groupId>com.mortals.xhx</groupId>
<artifactId>common-lib</artifactId>
</dependency>
<dependency> <dependencies>
<groupId>org.springframework.boot</groupId> <dependency>
<artifactId>spring-boot-starter-web</artifactId> <groupId>com.mortals.xhx</groupId>
</dependency> <artifactId>common-lib</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>druid-spring-boot-starter</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>com.alibaba</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>druid-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.5.2</version> </dependency>
</dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> <version>2.5.2</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>mysql</groupId>
<artifactId>spring-data-redis</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<!--Token生成与解析--> <dependency>
<dependency> <groupId>org.springframework.data</groupId>
<groupId>io.jsonwebtoken</groupId> <artifactId>spring-data-redis</artifactId>
<artifactId>jjwt</artifactId> </dependency>
</dependency>
<!--Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<dependency>
<groupId>com.hikvision.ga</groupId>
<artifactId>artemis-http-client</artifactId>
<version>1.1.8</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>com.hikvision.ga</groupId>
<artifactId>junit</artifactId> <artifactId>artemis-http-client</artifactId>
<scope>test</scope> <version>1.1.8</version>
</dependency> </dependency>
</dependencies> <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins> <build>
<plugin> <resources>
<groupId>org.apache.maven.plugins</groupId> <resource>
<artifactId>maven-surefire-plugin</artifactId> <directory>src/main/resources</directory>
<version>2.19.1</version> <filtering>true</filtering>
<configuration> </resource>
<skipTests>true</skipTests> <!--默认关掉单元测试 --> </resources>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin> <plugins>
<groupId>org.apache.maven.plugins</groupId> <plugin>
<artifactId>maven-resources-plugin</artifactId> <groupId>org.apache.maven.plugins</groupId>
<executions> <artifactId>maven-surefire-plugin</artifactId>
<execution> <version>2.19.1</version>
<id>copy-bin</id> <configuration>
<phase>package</phase> <skipTests>true</skipTests> <!--默认关掉单元测试 -->
<goals> </configuration>
<goal>copy-resources</goal> </plugin>
</goals> <plugin>
<configuration> <groupId>org.springframework.boot</groupId>
<encoding>UTF-8</encoding> <artifactId>spring-boot-maven-plugin</artifactId>
<outputDirectory>target/bin </plugin>
</outputDirectory> <plugin>
<resources> <groupId>org.apache.maven.plugins</groupId>
<resource> <artifactId>maven-compiler-plugin</artifactId>
<directory>src/main/bin/</directory> <configuration>
<excludes> <source>${java.version}</source>
<exclude>deploy.sh</exclude> <target>${java.version}</target>
</excludes> <encoding>${project.build.sourceEncoding}</encoding>
<filtering>true</filtering> </configuration>
</resource> </plugin>
</resources>
</configuration>
</execution>
<execution> <plugin>
<id>copy-deploy</id> <groupId>org.apache.maven.plugins</groupId>
<phase>package</phase> <artifactId>maven-resources-plugin</artifactId>
<goals> <executions>
<goal>copy-resources</goal> <execution>
</goals> <id>copy-bin</id>
<configuration> <phase>package</phase>
<encoding>UTF-8</encoding> <goals>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}/ <goal>copy-resources</goal>
</outputDirectory> </goals>
<resources> <configuration>
<resource> <encoding>UTF-8</encoding>
<directory>src/main/bin</directory> <outputDirectory>target/bin
<includes> </outputDirectory>
<include>deploy.sh</include> <resources>
</includes> <resource>
<filtering>true</filtering> <directory>src/main/bin/</directory>
</resource> <excludes>
</resources> <exclude>deploy.sh</exclude>
</configuration> </excludes>
</execution> <filtering>true</filtering>
</executions> </resource>
</plugin> </resources>
</configuration>
</execution>
<plugin> <execution>
<groupId>org.codehaus.mojo</groupId> <id>copy-deploy</id>
<artifactId>exec-maven-plugin</artifactId> <phase>package</phase>
<version>1.6.0</version> <goals>
<configuration> <goal>copy-resources</goal>
<skip>${skipUi}</skip> </goals>
</configuration> <configuration>
<executions> <encoding>UTF-8</encoding>
<execution> <outputDirectory>${project.parent.basedir}/dist/${project.artifactId}/
<id>exec-npm-install</id> </outputDirectory>
<phase>generate-resources</phase> <resources>
<goals> <resource>
<goal>exec</goal> <directory>src/main/bin</directory>
</goals> <includes>
<configuration> <include>deploy.sh</include>
<executable>yarn</executable> </includes>
<arguments> <filtering>true</filtering>
<argument></argument> </resource>
</arguments> </resources>
<workingDirectory>${project.parent.basedir}/refined-manager-ui/admin</workingDirectory> </configuration>
</configuration> </execution>
</execution> </executions>
</plugin>
<execution> <plugin>
<id>exec-npm-run-build</id> <groupId>org.codehaus.mojo</groupId>
<phase>generate-resources</phase> <artifactId>exec-maven-plugin</artifactId>
<goals> <version>1.6.0</version>
<goal>exec</goal> <configuration>
</goals> <skip>${skipUi}</skip>
<configuration> </configuration>
<executable>yarn</executable> <executions>
<arguments> <execution>
<argument>run</argument> <id>exec-npm-install</id>
<arguments>${package.environment}</arguments> <phase>generate-resources</phase>
</arguments> <goals>
<workingDirectory>${project.parent.basedir}/refined-manager-ui/admin</workingDirectory> <goal>exec</goal>
</configuration> </goals>
</execution> <configuration>
<executable>yarn</executable>
<arguments>
<argument></argument>
</arguments>
<workingDirectory>${project.parent.basedir}/refined-manager-ui/admin</workingDirectory>
</configuration>
</execution>
</executions> <execution>
</plugin> <id>exec-npm-run-build</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>run</argument>
<arguments>${package.environment}</arguments>
</arguments>
<workingDirectory>${project.parent.basedir}/refined-manager-ui/admin</workingDirectory>
</configuration>
</execution>
<plugin> </executions>
<artifactId>maven-assembly-plugin</artifactId> </plugin>
<version>3.3.0</version>
<executions> <plugin>
<execution> <artifactId>maven-assembly-plugin</artifactId>
<id>make-assembly</id> <version>3.3.0</version>
<phase>package</phase>
<goals> <executions>
<goal>single</goal> <execution>
</goals> <id>make-assembly</id>
<configuration> <phase>package</phase>
<finalName>${project.artifactId}</finalName> <goals>
<appendAssemblyId>false</appendAssemblyId> <goal>single</goal>
<descriptors> </goals>
<descriptor>../assembly/assembly.xml</descriptor> <configuration>
</descriptors> <finalName>${project.artifactId}</finalName>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory> <appendAssemblyId>false</appendAssemblyId>
</configuration> <descriptors>
</execution> <descriptor>../assembly/assembly.xml</descriptor>
<execution> </descriptors>
<id>make-assembly-ui</id> <outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
<phase>package</phase> </configuration>
<goals> </execution>
<goal>single</goal> <execution>
</goals> <id>make-assembly-ui</id>
<configuration> <phase>package</phase>
<skipAssembly>${skipUi}</skipAssembly> <goals>
<finalName>${project.artifactId}-ui</finalName> <goal>single</goal>
<appendAssemblyId>false</appendAssemblyId> </goals>
<descriptors> <configuration>
<descriptor>../assembly/assembly-manager-ui.xml</descriptor> <skipAssembly>${skipUi}</skipAssembly>
</descriptors> <finalName>${project.artifactId}-ui</finalName>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory> <appendAssemblyId>false</appendAssemblyId>
</configuration> <descriptors>
</execution> <descriptor>../assembly/assembly-manager-ui.xml</descriptor>
</executions> </descriptors>
</plugin> <outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</plugins> </configuration>
</build> </execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>
...@@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSON; ...@@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSON;
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.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.module.face.service.FacePlanService;
import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq; import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq;
import com.mortals.xhx.module.hik.door.model.rsp.door.DoorEventDataInfo; import com.mortals.xhx.module.hik.door.model.rsp.door.DoorEventDataInfo;
import com.mortals.xhx.module.hik.door.service.IHikDoorService; import com.mortals.xhx.module.hik.door.service.IHikDoorService;
import com.mortals.xhx.module.hik.event.model.rsp.EventInfo; import com.mortals.xhx.module.hik.event.model.rsp.EventInfo;
import com.mortals.xhx.module.hik.event.service.IHikEventService; import com.mortals.xhx.module.hik.event.service.IHikEventService;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import com.mortals.xhx.module.hik.person.model.req.org.OrgListReq; import com.mortals.xhx.module.hik.person.model.req.org.OrgListReq;
import com.mortals.xhx.module.hik.person.model.req.person.PersonReq; import com.mortals.xhx.module.hik.person.model.req.person.PersonReq;
import com.mortals.xhx.module.hik.person.model.rsp.org.OrgDataInfo; import com.mortals.xhx.module.hik.person.model.rsp.org.OrgDataInfo;
...@@ -40,6 +42,9 @@ public class TestController { ...@@ -40,6 +42,9 @@ public class TestController {
private IHikDoorService hikDoorService; private IHikDoorService hikDoorService;
@Autowired @Autowired
private IHikEventService hikEventService; private IHikEventService hikEventService;
@Autowired
private FacePlanService facePlanService;
@GetMapping("webservice") @GetMapping("webservice")
...@@ -72,6 +77,13 @@ public class TestController { ...@@ -72,6 +77,13 @@ public class TestController {
} }
@PostMapping("addStrangePlan")
public String addStrangePlan() {
Rest<List<PlanRecognInfo>> strangerPlanByDay = facePlanService.createStrangerPlanByDay();
return JSON.toJSONString(strangerPlanByDay);
}
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -9,7 +9,7 @@ import java.util.Map; ...@@ -9,7 +9,7 @@ import java.util.Map;
* @author zxfei * @author zxfei
*/ */
public enum RecognitionResourceEnum { public enum RecognitionResourceEnum {
SUPER_BRAIN("BLACK_LIST", "超脑"), SUPER_BRAIN("SUPER_BRAIN", "超脑"),
FACE_RECOGNITION_SERVER("FACE_RECOGNITION_SERVER", "脸谱"), FACE_RECOGNITION_SERVER("FACE_RECOGNITION_SERVER", "脸谱"),
COMPARISON("COMPARISON", "深眸"); COMPARISON("COMPARISON", "深眸");
private String value; private String value;
......
...@@ -12,6 +12,7 @@ public enum SourceEnum { ...@@ -12,6 +12,7 @@ public enum SourceEnum {
预约系统(0, "预约系统"), 预约系统(0, "预约系统"),
排队叫号系统(1, "排队叫号系统"), 排队叫号系统(1, "排队叫号系统"),
自助服务系统(2, "自助服务系统"), 自助服务系统(2, "自助服务系统"),
海康系统(3, "海康"),
其它(99, "其它"); 其它(99, "其它");
private Integer value; private Integer value;
private String desc; private String desc;
......
package com.mortals.xhx.common.utils; package com.mortals.xhx.common.utils;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hikvision.artemis.sdk.ArtemisHttpUtil; import com.hikvision.artemis.sdk.ArtemisHttpUtil;
...@@ -127,13 +128,13 @@ public class ArtemisPostTest { ...@@ -127,13 +128,13 @@ public class ArtemisPostTest {
*/ */
public static String callPostImgs() throws Exception { public static String callPostImgs() throws Exception {
ArtemisConfig config = new ArtemisConfig(); ArtemisConfig config = new ArtemisConfig();
config.setHost("127.0.0.1"); // 代理API网关nginx服务器ip端口 config.setHost("8.136.255.30:8001"); // 代理API网关nginx服务器ip端口
config.setAppKey("20469790"); // 秘钥appkey config.setAppKey("25128371"); // 秘钥appkey
config.setAppSecret("lofnD6DbnBllHmk5YOyx");// 秘钥appSecret config.setAppSecret("2m9RcPJOKq5j2QPQM4v5");// 秘钥appSecret
final String getSecurityApi = "/artemis" + "/api/visitor/v1/record/pictures"; // 接口路径 final String getSecurityApi = "/artemis" + "/api/visitor/v1/record/pictures"; // 接口路径
Map<String, String> path = new HashMap<String, String>(2) { Map<String, String> path = new HashMap<String, String>(2) {
{ {
put("https://", getSecurityApi); put("http://", getSecurityApi);
} }
}; };
Map<String, String> head = new HashMap<String, String>(2) { //get请求的head参数 Map<String, String> head = new HashMap<String, String>(2) { //get请求的head参数
...@@ -147,11 +148,11 @@ public class ArtemisPostTest { ...@@ -147,11 +148,11 @@ public class ArtemisPostTest {
} }
}; };
JSONObject jsonBody = new JSONObject(); JSONObject jsonBody = new JSONObject();
jsonBody.put("svrIndexCode", "9ff58bc2-65a5-464b-b28c-daea67ba9569"); jsonBody.put("svrIndexCode", "5027ba75-d30b-499c-b42c-ee91e2b9e8f7");
jsonBody.put("picUri", "/pic?9dda12i40-e*5b84626c4105m5ep=t=i3p*i=d1s*i=d3b*i1d3b*855925cea-96008b--2718943z855s=5i76="); jsonBody.put("picUri", "/pic?8d00=4a01l4b-do4b1a*71dc*6o1=7=6453*2l4532999176*7t1=9*3ps===121**bbed34e5b-812d30b-130oe0-pi0dd8=007d0");
String body = jsonBody.toJSONString(); String body = jsonBody.toJSONString();
//参数根据接口实际情况设置 //参数根据接口实际情况设置
HttpResponse result = ArtemisHttpUtil.doPostStringImgArtemis(config, path, body, query, null,"application/json",head); HttpResponse result = ArtemisHttpUtil.doPostStringImgArtemis(config, path, body, query, null,"application/json",null);
try { try {
HttpResponse resp = result; HttpResponse resp = result;
if (302==resp.getStatusLine().getStatusCode()) { if (302==resp.getStatusLine().getStatusCode()) {
...@@ -162,12 +163,14 @@ public class ArtemisPostTest { ...@@ -162,12 +163,14 @@ public class ArtemisPostTest {
*/ */
Header header= resp.getFirstHeader("location"); Header header= resp.getFirstHeader("location");
String newUrl = header.getValue(); String newUrl = header.getValue();
HttpGet httpget = new HttpGet(newUrl); String replace = StrUtil.replace(newUrl, "https://10.12.177.245:6114", "http://8.136.255.30:8002");
HttpGet httpget = new HttpGet(replace);
HttpClient httpClient = wrapClient(httpget.getURI().getScheme()+"://"+httpget.getURI().getHost()); HttpClient httpClient = wrapClient(httpget.getURI().getScheme()+"://"+httpget.getURI().getHost());
HttpResponse execute = httpClient.execute(httpget); HttpResponse execute = httpClient.execute(httpget);
HttpEntity entity = execute.getEntity(); HttpEntity entity = execute.getEntity();
InputStream in = entity.getContent(); InputStream in = entity.getContent();
Tools.savePicToDisk(in, "d:/", "test311.jpg"); Tools.savePicToDisk(in, "E:/", "test311.jpg");
}else{ }else{
System.out.println("下载出错"); System.out.println("下载出错");
} }
...@@ -186,10 +189,14 @@ public class ArtemisPostTest { ...@@ -186,10 +189,14 @@ public class ArtemisPostTest {
// System.out.println(VechicleDataResult); // System.out.println(VechicleDataResult);
String result = callPostApiGetPersonList(); /* String result = callPostApiGetPersonList();
System.out.println(result); System.out.println(result);*/
//callPostApiGetPersonList //callPostApiGetPersonList
String result =callPostImgs();
System.out.println(result);
} }
} }
...@@ -5,26 +5,23 @@ import com.alibaba.fastjson.JSON; ...@@ -5,26 +5,23 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.springcloud.service.IApplicationStartedService; import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.code.RecognitionResourceEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant; import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.module.device.model.DeviceEntity;
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.face.model.FaceGroupEntity; import com.mortals.xhx.module.face.model.FaceGroupEntity;
import com.mortals.xhx.module.face.model.FaceGroupQuery; import com.mortals.xhx.module.face.model.FaceGroupQuery;
import com.mortals.xhx.module.face.model.FacePlanEntity;
import com.mortals.xhx.module.face.model.FacePlanQuery;
import com.mortals.xhx.module.face.service.FaceGroupService; import com.mortals.xhx.module.face.service.FaceGroupService;
import com.mortals.xhx.module.face.service.FacePlanService; import com.mortals.xhx.module.face.service.FacePlanService;
import com.mortals.xhx.module.hik.event.model.req.sub.EventSubReq; import com.mortals.xhx.module.hik.event.model.req.sub.EventSubReq;
import com.mortals.xhx.module.hik.event.model.rsp.EventInfo; import com.mortals.xhx.module.hik.event.model.rsp.EventInfo;
import com.mortals.xhx.module.hik.event.service.IHikEventService; import com.mortals.xhx.module.hik.event.service.IHikEventService;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq; import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq; import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq;
import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import com.mortals.xhx.module.hik.face.service.IHikFaceService; import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.hik.face.service.IHikPlanService; import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -33,7 +30,6 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -33,7 +30,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -105,6 +101,26 @@ public class SubEventStartedService implements IApplicationStartedService { ...@@ -105,6 +101,26 @@ public class SubEventStartedService implements IApplicationStartedService {
} }
} }
//创建陌生人计划
facePlanService.createStrangerPlanByDay();
//删除重点人员计划
/* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq();
Rest<List<PlanRecognInfo>> planRecognBlackRest = hikPlanService.findPlanRecognBlackList(planRecognBlackListReq);
if (planRecognBlackRest.getCode() == YesNoEnum.YES.getValue()) {
List<PlanRecognInfo> delPlanList = planRecognBlackRest.getData();
if (!ObjectUtils.isEmpty(delPlanList)) {
//删除计划
PlanRecognReq planRecognBlackReq = new PlanRecognReq();
planRecognBlackReq.setRecognitionResourceIndexCodes(delPlanList.stream().map(i -> i.getIndexCode()).collect(Collectors.toList()));
Rest<Boolean> delRest = hikPlanService.planRecognBlackDel(planRecognBlackReq);
if (delRest.getCode() == YesNoEnum.YES.getValue() && delRest.getData()) {
log.info("预约计划删除成功!");
}
}
}*/
//删除创建陌生人员识别计划,todo //删除创建陌生人员识别计划,todo
// String planBlackName = GlobalSysInfo.getParamValue(ParamKey.PARAM_FACE_PLAN_BLACK, "取号监控"); // String planBlackName = GlobalSysInfo.getParamValue(ParamKey.PARAM_FACE_PLAN_BLACK, "取号监控");
......
package com.mortals.xhx.daemon.applicationservice;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.face.service.FaceGroupService;
import com.mortals.xhx.module.face.service.FacePlanService;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import com.mortals.xhx.module.hik.person.model.req.person.PersonReq;
import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo;
import com.mortals.xhx.module.hik.person.service.IHikPersonService;
import com.mortals.xhx.module.person.model.PersonEntity;
import com.mortals.xhx.module.person.service.PersonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 同步工作人员到本地注册人员中
*
* @author:
* @date: 2023/4/24 10:50
*/
//@Component
@Slf4j
public class SyncWorkmanStartedService implements IApplicationStartedService {
@Autowired
private PersonService personService;
@Autowired
private IHikPersonService hikPersonService;
@Override
public void start() {
log.info("开始服务..[工作人员同步]");
PersonReq personReq = new PersonReq();
personReq.setPageNo(1);
personReq.setPageSize(3);
Rest<PersonDataInfo> personListRest = hikPersonService.getPersonList(personReq);
if (personListRest.getCode() == YesNoEnum.YES.getValue()) {
List<PersonEntity> collect = personListRest.getData().getList().parallelStream().map(work -> {
//判断是否存在,存在更新,
if (work.getCertificateType() == 990) {
work.setCertificateNo(StrUtil.subSufByLength(work.getPersonId(), 20));
}
PersonEntity personEntity = personService.getExtCache(work.getCertificateNo());
if (ObjectUtils.isEmpty(personEntity)) {
personEntity = new PersonEntity();
personEntity.initAttrValue();
personEntity.setName(work.getPersonName());
personEntity.setGender(work.getGender() == 1 ? 0 : 1);
personEntity.setIdCard(work.getCertificateNo());
personEntity.setPhone(work.getPhoneNo());
try {
personEntity.setBirthday(DateUtil.parse(IdcardUtil.getBirth(work.getCertificateNo()), "yyyyMMdd"));
} catch (Exception e) {
}
personEntity.setServerIndexCode(work.getPersonPhoto().getServerIndexCode());
personEntity.setPicUrl(work.getPersonPhoto().getPicUri());
personEntity.setSource(SourceEnum.海康系统.getValue());
personEntity.setCreateTime(new Date());
personEntity.setCreateUserId(1L);
personEntity.setCreateUserName("system");
return personEntity;
}
return personEntity;
}).collect(Collectors.toList());
Map<Boolean, List<PersonEntity>> booleanListMap = collect.parallelStream().collect(Collectors.partitioningBy(x -> x.getId() == null));
List<PersonEntity> savePersonList = booleanListMap.get(true);
List<PersonEntity> updatePersonList = booleanListMap.get(false);
if (!ObjectUtils.isEmpty(savePersonList)) {
log.info("新增人员数量:{}", savePersonList.size());
personService.save(savePersonList);
}
if (!ObjectUtils.isEmpty(updatePersonList)) {
log.info("更新人员数量:{}", updatePersonList.size());
// personService.update(updatePersonList);
}
}
}
@Override
public void stop() {
log.info("停止服务..");
}
@Override
public int getOrder() {
return 11;
}
}
...@@ -92,15 +92,22 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { ...@@ -92,15 +92,22 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
log.info("{}=>创建陌生人计划任务", DateUtils.getCurrStrDate()); log.info("{}=>创建陌生人计划任务", DateUtils.getCurrStrDate());
createStrangerPlanByDay(); //createStrangerPlanByDay();
facePlanService.createStrangerPlanByDay();
log.info("{}=>创建陌生人计划任务完成", DateUtils.getCurrStrDate()); log.info("{}=>创建陌生人计划任务完成", DateUtils.getCurrStrDate());
log.info("{}=>创建预约计划任务", DateUtils.getCurrStrDate()); log.info("{}=>创建预约计划任务", DateUtils.getCurrStrDate());
createAppointmentPlanByDay(); facePlanService.createAppointmentPlanByDay();
//createAppointmentPlanByDay();
log.info("{}=>创建预约计划任务完成", DateUtils.getCurrStrDate()); log.info("{}=>创建预约计划任务完成", DateUtils.getCurrStrDate());
} }
private void createStrangerPlanByDay() { private void createStrangerPlanByDay() {
facePlanService.createStrangerPlanByDay();
/*
int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80); int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80);
//创建或者更新 //创建或者更新
PlanRecognListReq planRecognListReq = new PlanRecognListReq(); PlanRecognListReq planRecognListReq = new PlanRecognListReq();
...@@ -129,10 +136,26 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { ...@@ -129,10 +136,26 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
faceGroupIndexCodes.add(faceGroupEntity.getIndexCode()); faceGroupIndexCodes.add(faceGroupEntity.getIndexCode());
planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes); planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes);
//设置监控点 //设置监控点
List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().map(DeviceEntity::getDeviceCode).collect(Collectors.toList()); List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().distinct().map(DeviceEntity::getDeviceCode).collect(Collectors.toList());
planRecognBlackReq.setCameraIndexCodes(cameraIndexCodes);
ArrayList<String> temp = new ArrayList<>();
temp.add(cameraIndexCodes.get(0));
planRecognBlackReq.setCameraIndexCodes(temp);
//设置识别方式 //设置识别方式
planRecognBlackReq.setRecognitionResourceType(RecognitionResourceEnum.COMPARISON.getValue()); planRecognBlackReq.setRecognitionResourceType(RecognitionResourceEnum.COMPARISON.getValue());
// List<String> faceGroupIndexCodes = new ArrayList<>();
List<String> recognitionResourceIndexCodes = faceGroupPersonService.find(new FaceGroupPersonQuery().faceGroupId(faceGroupEntity.getId())).stream().map(i -> i.getIndexCode()).filter(f->!ObjectUtils.isEmpty(f)).collect(Collectors.toList());
ArrayList<String> temp1 = new ArrayList<>();
// temp1.add(recognitionResourceIndexCodes.get(0));
// temp1.add(recognitionResourceIndexCodes.get(1));
temp1.add(recognitionResourceIndexCodes.get(3));
//temp1.add(recognitionResourceIndexCodes.get(4));
// planRecognBlackReq.setRecognitionResourceIndexCodes(temp1);
//设置时间段 默认全天候 //设置时间段 默认全天候
if (ObjectUtils.isEmpty(planRecognWhiteInfo)) { if (ObjectUtils.isEmpty(planRecognWhiteInfo)) {
Rest<String> planRecognWhiteAddRest = hikPlanService.planRecognWhiteAdd(planRecognBlackReq); Rest<String> planRecognWhiteAddRest = hikPlanService.planRecognWhiteAdd(planRecognBlackReq);
...@@ -154,23 +177,30 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { ...@@ -154,23 +177,30 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
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.setUpdateUserId(1L); if(!ObjectUtils.isEmpty(whitePlan)){
whitePlan.setUpdateUserName("system"); whitePlan.setUpdateTime(new Date());
facePlanService.update(whitePlan); whitePlan.setUpdateUserId(1L);
whitePlan.setUpdateUserName("system");
facePlanService.update(whitePlan);
}
} }
} }
} }*/
} }
private void createAppointmentPlanByDay() { private void createAppointmentPlanByDay() {
PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq();
facePlanService.createAppointmentPlanByDay();
/* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq();
Rest<List<PlanRecognInfo>> planRecognBlackRest = hikPlanService.findPlanRecognBlackList(planRecognBlackListReq); Rest<List<PlanRecognInfo>> planRecognBlackRest = hikPlanService.findPlanRecognBlackList(planRecognBlackListReq);
if (planRecognBlackRest.getCode() == YesNoEnum.YES.getValue()) { if (planRecognBlackRest.getCode() == YesNoEnum.YES.getValue()) {
List<PlanRecognInfo> delPlanList = planRecognBlackRest.getData().stream().map(i -> { List<PlanRecognInfo> delPlanList = planRecognBlackRest.getData().stream().map(i -> {
...@@ -315,7 +345,7 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { ...@@ -315,7 +345,7 @@ public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService {
} }
} else { } else {
log.info("当天无预约人员,不创建监控计划=>{}", DateUtils.getCurrStrDate()); log.info("当天无预约人员,不创建监控计划=>{}", DateUtils.getCurrStrDate());
} }*/
} }
......
...@@ -7,6 +7,10 @@ import com.mortals.framework.service.ITask; ...@@ -7,6 +7,10 @@ import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.utils.ServletUtils; import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.InFaceHkEnum;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.person.model.PersonEntity; import com.mortals.xhx.module.person.model.PersonEntity;
import com.mortals.xhx.module.person.model.PersonQuery; import com.mortals.xhx.module.person.model.PersonQuery;
import com.mortals.xhx.module.person.service.PersonService; import com.mortals.xhx.module.person.service.PersonService;
...@@ -14,6 +18,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -14,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.checkerframework.checker.units.qual.A;
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.http.MediaType; import org.springframework.http.MediaType;
...@@ -40,6 +45,8 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { ...@@ -40,6 +45,8 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService {
private PersonService personService; private PersonService personService;
@Autowired @Autowired
private UploadService uploadService; private UploadService uploadService;
@Autowired
private IHikFaceService hikFaceService;
@Value("${php.host:''}") @Value("${php.host:''}")
private String host; private String host;
...@@ -56,6 +63,7 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { ...@@ -56,6 +63,7 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService {
private void syncRegisterUsersPhotos() { private void syncRegisterUsersPhotos() {
String url = host.endsWith("/") ? host : host + "/"; String url = host.endsWith("/") ? host : host + "/";
List<PersonEntity> collect = personService.find(new PersonQuery()).stream() List<PersonEntity> collect = personService.find(new PersonQuery()).stream()
.filter(item -> ObjectUtils.isEmpty(item.getPhoto())) .filter(item -> ObjectUtils.isEmpty(item.getPhoto()))
.filter(item -> !ObjectUtils.isEmpty(item.getSourcePhotoUri())).collect(Collectors.toList()); .filter(item -> !ObjectUtils.isEmpty(item.getSourcePhotoUri())).collect(Collectors.toList());
...@@ -63,16 +71,38 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { ...@@ -63,16 +71,38 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService {
//下载图片到本地保存并更新 //下载图片到本地保存并更新
String downUrl = url + personEntity.getSourcePhotoUri(); String downUrl = url + personEntity.getSourcePhotoUri();
//String downUrl = "http://192.168.0.98:11078/file/fileupload/1679215657433.jpg"; //String downUrl = "http://192.168.0.98:11078/file/fileupload/1679215657433.jpg";
log.info("downUrl:{}",downUrl); log.info("downUrl:{}", downUrl);
byte[] bytes = HttpUtil.downloadBytes(downUrl); byte[] bytes = HttpUtil.downloadBytes(downUrl);
if(bytes.length>0){ if (bytes.length > 0) {
InputStream inputStream = new ByteArrayInputStream(bytes); InputStream inputStream = new ByteArrayInputStream(bytes);
MultipartFile file = ServletUtils.getMultipartFile(inputStream, "photo.jpg"); MultipartFile file = ServletUtils.getMultipartFile(inputStream, "photo.jpg");
String filePath = uploadService.saveFileUpload(file, "file/fileupload",null); String filePath = uploadService.saveFileUpload(file, "file/fileupload", null);
personEntity.setPhoto(filePath); personEntity.setPhoto(filePath);
personService.update(personEntity); personService.update(personEntity);
} }
} }
List<PersonEntity> hikPerson = personService.find(new PersonQuery().source(SourceEnum.海康系统.getValue())).stream().filter(f -> ObjectUtils.isEmpty(f.getPhoto())).collect(Collectors.toList());
for (PersonEntity person : hikPerson) {
ImgReq imgReq = new ImgReq();
imgReq.setSvrIndexCode(person.getServerIndexCode());
imgReq.setPicUri(person.getPicUrl());
try {
InputStream inputStream = hikFaceService.callPostImgs(imgReq);
if (!ObjectUtils.isEmpty(inputStream)) {
MultipartFile file = ServletUtils.getMultipartFile(inputStream, "photo.jpg");
String filePath = uploadService.saveFileUpload(file, "file/fileupload", null);
person.setPhoto(filePath);
personService.update(person);
} else {
log.error("获取图片异常!");
}
} catch (Exception e) {
log.error("下载图片异常", e.getMessage());
}
}
} }
......
...@@ -92,7 +92,7 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService { ...@@ -92,7 +92,7 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
int count=0; int count=0;
List<PersonEntity> max = personService.getDao().getMax(); List<PersonEntity> max = personService.getDao().getMax();
if(!ObjectUtils.isEmpty(max)){ if(!ObjectUtils.isEmpty(max)){
count=max.get(0).getSiteId().intValue(); count=max.get(0).getSourceId().intValue();
} }
String registerPath = "/inter/Actuary/peopleList"; String registerPath = "/inter/Actuary/peopleList";
String url = host + registerPath; String url = host + registerPath;
...@@ -194,7 +194,6 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService { ...@@ -194,7 +194,6 @@ public class SyncRegisterUserTaskImpl implements ITaskExcuteService {
} }
} }
} }
......
...@@ -26,7 +26,7 @@ import java.util.List; ...@@ -26,7 +26,7 @@ import java.util.List;
*/ */
@Slf4j @Slf4j
@Service("SyncUserTask") @Service("SyncUserTask")
@ConditionalOnExpression("'${platform.type:null}'=='cloud'") @ConditionalOnExpression("'${spring.profiles.active}'!='develop'")
public class SyncUserTaskImpl implements ITaskExcuteService { public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.daemon.task; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.daemon.task;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
......
...@@ -440,14 +440,14 @@ public class DeviceEntity extends DeviceVo { ...@@ -440,14 +440,14 @@ public class DeviceEntity extends DeviceVo {
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getEncodeDevIndexCode().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) return false; if (obj == null) return false;
if (obj instanceof DeviceEntity) { if (obj instanceof DeviceEntity) {
DeviceEntity tmp = (DeviceEntity) obj; DeviceEntity tmp = (DeviceEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getEncodeDevIndexCode() .equals( tmp.getEncodeDevIndexCode())) {
return true; return true;
} }
} }
......
package com.mortals.xhx.module.face.service; package com.mortals.xhx.module.face.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.face.model.FacePlanEntity; import com.mortals.xhx.module.face.model.FacePlanEntity;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import java.util.List;
/** /**
* FacePlanService * FacePlanService
* * <p>
* 人员识别计划信息 service接口 * 人员识别计划信息 service接口
* *
* @author zxfei * @author zxfei
* @date 2023-04-15 * @date 2023-04-15
*/ */
public interface FacePlanService extends ICRUDService<FacePlanEntity,Long>{ public interface FacePlanService extends ICRUDService<FacePlanEntity, Long> {
/**
* 创建陌生人监控计划
*/
Rest<List<PlanRecognInfo>> createStrangerPlanByDay();
/**
* 创建预约人员监控计划
*/
void createAppointmentPlanByDay();
} }
\ No newline at end of file
package com.mortals.xhx.module.face.service.impl; package com.mortals.xhx.module.face.service.impl;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.GenderEnum;
import com.mortals.xhx.common.code.RecognitionResourceEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.module.appointment.model.*;
import com.mortals.xhx.module.appointment.service.AppointmentConfigService;
import com.mortals.xhx.module.appointment.service.AppointmentConfigTimesService;
import com.mortals.xhx.module.appointment.service.AppointmentPersonService;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.face.model.*;
import com.mortals.xhx.module.face.service.FaceGroupPersonService;
import com.mortals.xhx.module.face.service.FaceGroupService;
import com.mortals.xhx.module.hik.face.model.req.face.FaceInfo;
import com.mortals.xhx.module.hik.face.model.req.face.FacePic;
import com.mortals.xhx.module.hik.face.model.req.face.FaceReq;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq;
import com.mortals.xhx.module.hik.face.model.req.plan.TimeBlockListItem;
import com.mortals.xhx.module.hik.face.model.req.plan.TimeRangeItem;
import com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq;
import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import com.mortals.xhx.module.person.model.PersonEntity;
import com.mortals.xhx.module.person.service.PersonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.xhx.module.face.dao.FacePlanDao; import com.mortals.xhx.module.face.dao.FacePlanDao;
import com.mortals.xhx.module.face.model.FacePlanEntity;
import com.mortals.xhx.module.face.service.FacePlanService; import com.mortals.xhx.module.face.service.FacePlanService;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP_REGISTER;
/** /**
* FacePlanService * FacePlanService
* 人员识别计划信息 service实现 * 人员识别计划信息 service实现
* *
* @author zxfei * @author zxfei
* @date 2023-04-15 * @date 2023-04-15
*/ */
@Service("facePlanService") @Service("facePlanService")
@Slf4j
public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, FacePlanEntity, Long> implements FacePlanService { public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, FacePlanEntity, Long> implements FacePlanService {
@Autowired
private PersonService personService;
@Autowired
private IHikFaceService hikFaceService;
@Autowired
private IHikPlanService hikPlanService;
@Autowired
private DeviceService deviceService;
@Autowired
private FacePlanService facePlanService;
@Autowired
private UploadService uploadService;
@Autowired
private FaceGroupService faceGroupService;
@Autowired
private FaceGroupPersonService faceGroupPersonService;
@Autowired
private AppointmentPersonService appointmentPersonService;
@Autowired
private AppointmentConfigService appointmentConfigService;
@Autowired
private AppointmentConfigTimesService appointmentConfigTimesService;
@Override
public Rest<List<PlanRecognInfo>> createStrangerPlanByDay() {
int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80);
//创建或者更新
PlanRecognListReq planRecognListReq = new PlanRecognListReq();
Rest<List<PlanRecognInfo>> planRecognWhiteListRest = hikPlanService.findPlanRecognWhiteList(planRecognListReq);
if (planRecognWhiteListRest.getCode() == YesNoEnum.YES.getValue()) {
PlanRecognInfo planRecognWhiteInfo = planRecognWhiteListRest.getData().stream().map(i -> {
i.getName();
if (i.getName().equals(Constant.STRANGER_PLAN)) {
return i;
}
return null;
}).filter(f -> f != null).findFirst().orElseGet(() -> null);
//初始化新增取号监控识别计划
PlanRecognReq planRecognWhiteReq = new PlanRecognReq();
planRecognWhiteReq.setName(Constant.STRANGER_PLAN);
planRecognWhiteReq.setDescription(Constant.STRANGER_PLAN);
planRecognWhiteReq.setThreshold(threshold);
//设置人脸分组
FaceGroupEntity faceGroupEntity = faceGroupService.selectOne(new FaceGroupQuery().name(PARAM_FACE_GROUP_REGISTER));
if (ObjectUtils.isEmpty(faceGroupEntity)) {
log.info("人脸组不存在!");
return Rest.fail();
}
List<String> faceGroupIndexCodes = new ArrayList<>();
faceGroupIndexCodes.add(faceGroupEntity.getIndexCode());
planRecognWhiteReq.setFaceGroupIndexCodes(faceGroupIndexCodes);
//设置监控点
List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().distinct().map(DeviceEntity::getDeviceCode).collect(Collectors.toList());
// ArrayList<String> temp = new ArrayList<>();
//temp.add(cameraIndexCodes.get(0));
planRecognWhiteReq.setCameraIndexCodes(cameraIndexCodes);
//设置识别方式
planRecognWhiteReq.setRecognitionResourceType(RecognitionResourceEnum.SUPER_BRAIN.getValue());
// List<String> faceGroupIndexCodes = new ArrayList<>();
ResourceReq resourceReq = new ResourceReq();
resourceReq.setRecognitionResourceType(RecognitionResourceEnum.SUPER_BRAIN.getValue());
Rest<List<ResourceDataInfo>> resourceRecognition = hikFaceService.getResourceRecognition(resourceReq);
if(resourceRecognition.getCode()==YesNoEnum.YES.getValue()&&!ObjectUtils.isEmpty(resourceRecognition.getData())){
ArrayList<String> recognitionResourceIndexCodes = new ArrayList<>();
recognitionResourceIndexCodes.add(resourceRecognition.getData().get(0).getIndexCode());
planRecognWhiteReq.setRecognitionResourceIndexCodes(recognitionResourceIndexCodes);
}
// List<String> recognitionResourceIndexCodes = faceGroupPersonService.find(new FaceGroupPersonQuery().faceGroupId(faceGroupEntity.getId())).stream().map(i -> i.getIndexCode()).filter(f -> !ObjectUtils.isEmpty(f)).collect(Collectors.toList());
// ArrayList<String> recognitionResourceIndexCodes = new ArrayList<>();
//temp1.add(recognitionResourceIndexCodes.get(0));
// temp1.add("2c24aa3bb9af4911a269bb887b5502f9");
// temp1.add(recognitionResourceIndexCodes.get(2));
// temp1.add(recognitionResourceIndexCodes.get(3));
// planRecognWhiteReq.setRecognitionResourceIndexCodes(temp1);
//planRecognWhiteReq.setRecognitionResourceIndexCodes(recognitionResourceIndexCodes);
//设置时间段 默认全天候
if (ObjectUtils.isEmpty(planRecognWhiteInfo)) {
Rest<String> planRecognWhiteAddRest = hikPlanService.planRecognWhiteAdd(planRecognWhiteReq);
if (planRecognWhiteAddRest.getCode() == YesNoEnum.YES.getValue()) {
FacePlanEntity planEntity = new FacePlanEntity();
planEntity.initAttrValue();
planEntity.setIndexCode(planRecognWhiteAddRest.getData());
planEntity.setName(Constant.STRANGER_PLAN);
planEntity.setDescription(Constant.STRANGER_PLAN);
planEntity.setCreateTime(new Date());
planEntity.setCreateUserId(1L);
planEntity.setCreateUserName("admin");
facePlanService.save(planEntity);
}
} else {
//更新计划
planRecognWhiteReq.setIndexCode(planRecognWhiteInfo.getIndexCode());
Rest<Boolean> planRecognWhiteUpdateRest = hikPlanService.planRecognWhiteUpdate(planRecognWhiteReq);
if (planRecognWhiteUpdateRest.getCode() == YesNoEnum.YES.getValue() && planRecognWhiteUpdateRest.getData()) {
FacePlanEntity whitePlan = facePlanService.selectOne(new FacePlanQuery().indexCode(planRecognWhiteInfo.getIndexCode()));
if (!ObjectUtils.isEmpty(whitePlan)) {
whitePlan.setUpdateTime(new Date());
whitePlan.setUpdateUserId(1L);
whitePlan.setUpdateUserName("system");
facePlanService.update(whitePlan);
}
}
}
}
return planRecognWhiteListRest;
}
@Override
public void createAppointmentPlanByDay() {
PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq();
Rest<List<PlanRecognInfo>> planRecognBlackRest = hikPlanService.findPlanRecognBlackList(planRecognBlackListReq);
if (planRecognBlackRest.getCode() == YesNoEnum.YES.getValue()) {
List<PlanRecognInfo> delPlanList = planRecognBlackRest.getData().stream().map(i -> {
if (StrUtil.startWith(i.getName(), Constant.APPOINTMENT_PLAN_PREFIX) && !i.getName().equals(Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate())) {
return i;
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(delPlanList)) {
//删除计划
PlanRecognReq planRecognBlackReq = new PlanRecognReq();
planRecognBlackReq.setRecognitionResourceIndexCodes(delPlanList.stream().map(i -> i.getIndexCode()).collect(Collectors.toList()));
Rest<Boolean> delRest = hikPlanService.planRecognBlackDel(planRecognBlackReq);
if (delRest.getCode() == YesNoEnum.YES.getValue() && delRest.getData()) {
log.info("预约计划删除成功!");
}
}
}
log.info("每日创建预约人员监控计划");
//获取当天预约
AppointmentPersonQuery appointmentPersonQuery = new AppointmentPersonQuery();
appointmentPersonQuery.setAppointmentStartTimeStart(DateUtils.getCurrStrDate());
appointmentPersonQuery.setAppointmentStartTimeEnd(DateUtils.getCurrStrDate());
List<AppointmentPersonEntity> appointmentPersonEntities = appointmentPersonService.find(appointmentPersonQuery);
if (!ObjectUtils.isEmpty(appointmentPersonEntities)) {
//创建人脸分组
String group = Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate();
FaceGroupEntity faceGroup = faceGroupService.selectOne(new FaceGroupQuery().name(group));
if (ObjectUtils.isEmpty(faceGroup)) {
//创建分组
log.info("创建人脸分组...");
FaceGroupReq faceGroupReq = new FaceGroupReq();
faceGroupReq.setName(group);
faceGroupReq.setDescription(group);
Rest<FaceGroupEntity> rest = faceGroupService.saveFaceGroupToHik(faceGroupReq);
if (rest.getCode() == YesNoEnum.YES.getValue()) {
FaceGroupEntity newFaceGroupEntity = rest.getData();
//创建人脸tohik
for (AppointmentPersonEntity appointmentPersonEntity : appointmentPersonEntities) {
PersonEntity personEntity = personService.getCache(appointmentPersonEntity.getPersonId().toString());
if (ObjectUtils.isEmpty(personEntity)) {
log.info("注册人员未空,persionId:{}", appointmentPersonEntity.getPersonId());
continue;
}
//查询图片并转成base64
if (!ObjectUtils.isEmpty(personEntity.getPhoto())) {
String filePath = uploadService.getFilePath(personEntity.getPhoto());
byte[] bytes = FileUtil.readBytes(filePath);
if (bytes.length > 0) {
String picBase64Data = Base64.encode(bytes);
FaceReq faceReq = new FaceReq();
FaceInfo faceInfo = new FaceInfo();
faceInfo.setName(personEntity.getName());
faceInfo.setSex(personEntity.getGender() == GenderEnum..getValue() ? "1" : "2");
faceInfo.setCertificateType("111");
faceInfo.setCertificateNum(personEntity.getIdCard());
faceReq.setFaceInfo(faceInfo);
FacePic facePic = new FacePic();
facePic.setFaceBinaryData(picBase64Data);
faceReq.setFacePic(facePic);
faceReq.setFaceGroupIndexCode(faceGroup.getIndexCode());
Rest<FaceDataInfo> faceDataInfoRest = hikFaceService.faceSingleAdd(faceReq);
if (faceDataInfoRest.getCode() == YesNoEnum.YES.getValue()) {
//人脸添加成功,保存人脸组
FaceGroupPersonEntity faceGroupPersonEntity = new FaceGroupPersonEntity();
faceGroupPersonEntity.initAttrValue();
faceGroupPersonEntity.setFaceGroupId(newFaceGroupEntity.getId());
faceGroupPersonEntity.setIndexCode(faceDataInfoRest.getData().getIndexCode());
faceGroupPersonEntity.setCreateTime(new Date());
faceGroupPersonEntity.setCreateUserId(1L);
faceGroupPersonService.save(faceGroupPersonEntity);
} else {
log.info("添加人脸异常=>{}", faceDataInfoRest.getMsg());
}
} else {
log.info("图片数据为空,filePath=>{}", filePath);
}
} else {
log.info("人员图片photo为空,person=>{}", personEntity.getName());
}
}
log.info("添加当天预约监控计划");
String appointPlanName = Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate();
int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80);
//初始化新增取号监控识别计划
PlanRecognReq planRecognBlackReq = new PlanRecognReq();
planRecognBlackReq.setName(appointPlanName);
planRecognBlackReq.setDescription(appointPlanName);
planRecognBlackReq.setThreshold(threshold);
//设置人脸分组
List<String> faceGroupIndexCodes = new ArrayList<>();
faceGroupIndexCodes.add(newFaceGroupEntity.getIndexCode());
planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes);
//设置监控点
List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().map(DeviceEntity::getDeviceCode).collect(Collectors.toList());
planRecognBlackReq.setCameraIndexCodes(cameraIndexCodes);
//设置识别方式
planRecognBlackReq.setRecognitionResourceType(RecognitionResourceEnum.FACE_RECOGNITION_SERVER.getValue());
//设置时间段 默认全天候
AppointmentConfigEntity appointmentConfigEntity = appointmentConfigService.selectOne(new AppointmentConfigQuery());
if (!ObjectUtils.isEmpty(appointmentConfigEntity)) {
List<AppointmentConfigTimesEntity> timesEntities = appointmentConfigTimesService.find(new AppointmentConfigTimesQuery().aotoCheckCfgId(appointmentConfigEntity.getId()));
if (!ObjectUtils.isEmpty(timesEntities)) {
List<TimeBlockListItem> timeBlockList = new ArrayList<>();
TimeBlockListItem timeBlockListItem = new TimeBlockListItem();
//周一至周日
timeBlockListItem.setDayOfWeek("1-7");
List<TimeRangeItem> timeRange = new ArrayList<>();
for (AppointmentConfigTimesEntity timesEntity : timesEntities) {
TimeRangeItem timeRangeItem = new TimeRangeItem();
String startTimeStr = DateUtils.convertTime2Str(timesEntity.getServiceTimeStart().getTime(), "HH:ss");
String endTimeStr = DateUtils.convertTime2Str(timesEntity.getServiceTimeEnd().getTime(), "HH:ss");
timeRangeItem.setStartTime(startTimeStr);
timeRangeItem.setEndTime(endTimeStr);
timeRange.add(timeRangeItem);
}
timeBlockListItem.setTimeRange(timeRange);
timeBlockList.add(timeBlockListItem);
planRecognBlackReq.setTimeBlockList(timeBlockList);
}
}
Rest<String> planRecognBlackAddRest = hikPlanService.planRecognBlackAdd(planRecognBlackReq);
if (planRecognBlackAddRest.getCode() == YesNoEnum.YES.getValue()) {
FacePlanEntity planEntity = new FacePlanEntity();
planEntity.initAttrValue();
planEntity.setIndexCode(planRecognBlackAddRest.getData());
planEntity.setName(appointPlanName);
planEntity.setDescription(appointPlanName);
planEntity.setCreateTime(new Date());
planEntity.setCreateUserId(1L);
planEntity.setCreateUserName("admin");
facePlanService.save(planEntity);
}
} else {
log.info("人员分组创建失败=>{}", rest.getMsg());
}
} else {
log.info("当天人员分组以存在,人员分组名称=>{}", group);
}
} else {
log.info("当天无预约人员,不创建监控计划=>{}", DateUtils.getCurrStrDate());
}
}
} }
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.req.img;
import lombok.Data;
@Data
public class ImgReq {
private String svrIndexCode;
private String picUri;
}
package com.mortals.xhx.module.hik.face.model.req.resource;
import java.util.List;
import lombok.Data;
@Data
public class ResourceReq{
private String name;
private String recognitionResourceType;
private List<String> indexCodes;
}
\ No newline at end of file
package com.mortals.xhx.module.hik.face.model.rsp.resource;
import lombok.Data;
@Data
public class ResourceDataInfo{
private String name;
private String indexCode;
private String recognitionResourceType;
}
\ No newline at end of file
...@@ -6,10 +6,14 @@ import com.mortals.xhx.module.hik.face.model.req.face.FaceListReq; ...@@ -6,10 +6,14 @@ import com.mortals.xhx.module.hik.face.model.req.face.FaceListReq;
import com.mortals.xhx.module.hik.face.model.req.face.FaceReq; import com.mortals.xhx.module.hik.face.model.req.face.FaceReq;
import com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq; import com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq; import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq;
import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.face.ResRecognDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.face.ResRecognDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo;
import java.io.InputStream;
import java.util.List; import java.util.List;
/** /**
...@@ -79,4 +83,15 @@ public interface IHikFaceService { ...@@ -79,4 +83,15 @@ public interface IHikFaceService {
Rest<List<ResRecognDataInfo>> findResRecognList(ResRecognReq recognReq); Rest<List<ResRecognDataInfo>> findResRecognList(ResRecognReq recognReq);
/**
* 获取识别资源
* @param recognReq
* @return
*/
Rest<List<ResourceDataInfo>> getResourceRecognition(ResourceReq recognReq);
InputStream callPostImgs(ImgReq imgReq) throws Exception;
} }
package com.mortals.xhx.module.hik.face.service.impl; package com.mortals.xhx.module.hik.face.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.hikvision.artemis.sdk.ArtemisHttpUtil; import com.hikvision.artemis.sdk.ArtemisHttpUtil;
...@@ -11,14 +12,27 @@ import com.mortals.xhx.module.hik.face.model.req.face.FaceListReq; ...@@ -11,14 +12,27 @@ import com.mortals.xhx.module.hik.face.model.req.face.FaceListReq;
import com.mortals.xhx.module.hik.face.model.req.face.FaceReq; import com.mortals.xhx.module.hik.face.model.req.face.FaceReq;
import com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq; import com.mortals.xhx.module.hik.face.model.req.face.ResRecognReq;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq; import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq;
import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.face.FaceDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.face.ResRecognDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.face.ResRecognDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo;
import com.mortals.xhx.module.hik.face.service.IHikFaceService; import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import static com.hikvision.artemis.sdk.util.HttpUtil.wrapClient;
/** /**
* 海康人员接口类 * 海康人员接口类
...@@ -206,4 +220,62 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe ...@@ -206,4 +220,62 @@ public class HikFaceServiceImpl extends AbstractHikService implements IHikFaceSe
return Rest.fail(e.getMessage()); return Rest.fail(e.getMessage());
} }
} }
@Override
public Rest<List<ResourceDataInfo>> getResourceRecognition(ResourceReq recognReq) {
ArtemisConfig config = getArtemisConfig();
String getCamsApi = ARTEMIS_PATH + "/api/frs/v1/resource/recognition";
path.put(protocol, getCamsApi);
try {
String respJson = ArtemisHttpUtil.doPostStringArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
Rest<List<ResourceDataInfo>> rest = JSON.parseObject(respJson, new TypeReference<Rest<List<ResourceDataInfo>>>() {
});
if (rest.getCode() == 0) {
return Rest.ok(rest.getData());
} else {
log.info("resource recognition list error resp=>{}", respJson);
return Rest.fail(rest.getMsg());
}
} catch (Exception e) {
log.error("resource recognition", e);
return Rest.fail(e.getMessage());
}
}
//下载图片
@Override
public InputStream callPostImgs(ImgReq imgReq) throws Exception {
ArtemisConfig config = getArtemisConfig();
String getSecurityApi = ARTEMIS_PATH + "/api/visitor/v1/record/pictures";
path.put(protocol, getSecurityApi);
//ArtemisHttpUtil.doPostStringImgArtemis(config, path, JSON.toJSONString(recognReq), null, null, "application/json");
Map<String, String> query = new HashMap<String, String>(2) { //get请求的head参数
{
put("domainId", "0");
}
};
//参数根据接口实际情况设置
HttpResponse result = ArtemisHttpUtil.doPostStringImgArtemis(config, path, JSON.toJSONString(imgReq), query, null, "application/json", null);
HttpResponse resp = result;
if (302 == resp.getStatusLine().getStatusCode()) {
Header header = resp.getFirstHeader("location");
String newUrl = header.getValue();
//本地测试
String replace = StrUtil.replace(newUrl, "https://10.12.177.245:6114", "http://8.136.255.30:8002");
HttpGet httpget = new HttpGet(replace);
//HttpGet httpget = new HttpGet(newUrl);
HttpClient httpClient = wrapClient(httpget.getURI().getScheme() + "://" + httpget.getURI().getHost());
HttpResponse execute = httpClient.execute(httpget);
HttpEntity entity = execute.getEntity();
InputStream in = entity.getContent();
return in;
} else {
System.out.println("下载出错");
return null;
}
}
} }
package com.mortals.xhx.module.person.model; package com.mortals.xhx.module.person.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.person.model.vo.PersonVo; import com.mortals.xhx.module.person.model.vo.PersonVo;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* 注册人员实体对象 * 注册人员实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-04-16 * @date 2023-04-24
*/ */
@Data @Data
public class PersonEntity extends PersonVo { public class PersonEntity extends PersonVo {
...@@ -43,12 +44,10 @@ public class PersonEntity extends PersonVo { ...@@ -43,12 +44,10 @@ public class PersonEntity extends PersonVo {
/** /**
* 出生日期 * 出生日期
*/ */
@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday; private Date birthday;
/** /**
* 家庭住址 * 家庭住址
*/ */
@Excel(name = "家庭住址")
private String address; private String address;
/** /**
* 本地照片路径 * 本地照片路径
...@@ -67,7 +66,7 @@ public class PersonEntity extends PersonVo { ...@@ -67,7 +66,7 @@ public class PersonEntity extends PersonVo {
*/ */
private String remark; private String remark;
/** /**
* 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
*/ */
private Integer source; private Integer source;
/** /**
...@@ -82,12 +81,18 @@ public class PersonEntity extends PersonVo { ...@@ -82,12 +81,18 @@ public class PersonEntity extends PersonVo {
* 人脸所属的人脸分组的唯一标识 * 人脸所属的人脸分组的唯一标识
*/ */
private String ifaceGroupIndexCode; private String ifaceGroupIndexCode;
/**
* 海康人脸图片url
*/
private String picUrl;
/**
* 海康人脸服务标识
*/
private String serverIndexCode;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) return false; if (obj == null) return false;
...@@ -100,8 +105,7 @@ public class PersonEntity extends PersonVo { ...@@ -100,8 +105,7 @@ public class PersonEntity extends PersonVo {
return false; return false;
} }
public void initAttrValue(){
public void initAttrValue() {
this.siteId = null; this.siteId = null;
...@@ -134,5 +138,9 @@ public class PersonEntity extends PersonVo { ...@@ -134,5 +138,9 @@ public class PersonEntity extends PersonVo {
this.indexCode = ""; this.indexCode = "";
this.ifaceGroupIndexCode = ""; this.ifaceGroupIndexCode = "";
this.picUrl = "";
this.serverIndexCode = "";
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.person.model.PersonEntity; ...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.person.model.PersonEntity;
* 注册人员查询对象 * 注册人员查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-04-16 * @date 2023-04-24
*/ */
public class PersonQuery extends PersonEntity { public class PersonQuery extends PersonEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -116,19 +116,19 @@ public class PersonQuery extends PersonEntity { ...@@ -116,19 +116,19 @@ public class PersonQuery extends PersonEntity {
/** 备注排除列表 */ /** 备注排除列表 */
private List <String> remarkNotList; private List <String> remarkNotList;
/** 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) */ /** 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它) */
private Integer sourceStart; private Integer sourceStart;
/** 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) */ /** 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它) */
private Integer sourceEnd; private Integer sourceEnd;
/** 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) */ /** 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它) */
private Integer sourceIncrement; private Integer sourceIncrement;
/** 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它)列表 */ /** 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)列表 */
private List <Integer> sourceList; private List <Integer> sourceList;
/** 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它)排除列表 */ /** 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)排除列表 */
private List <Integer> sourceNotList; private List <Integer> sourceNotList;
/** 开始 是否添加到海康人脸库(0.否,1.是) */ /** 开始 是否添加到海康人脸库(0.否,1.是) */
...@@ -198,6 +198,16 @@ public class PersonQuery extends PersonEntity { ...@@ -198,6 +198,16 @@ public class PersonQuery extends PersonEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 海康人脸图片url */
private List<String> picUrlList;
/** 海康人脸图片url排除列表 */
private List <String> picUrlNotList;
/** 海康人脸服务标识 */
private List<String> serverIndexCodeList;
/** 海康人脸服务标识排除列表 */
private List <String> serverIndexCodeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<PersonQuery> orConditionList; private List<PersonQuery> orConditionList;
...@@ -819,7 +829,7 @@ public class PersonQuery extends PersonEntity { ...@@ -819,7 +829,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 获取 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 获取 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @return sourceStart * @return sourceStart
*/ */
public Integer getSourceStart(){ public Integer getSourceStart(){
...@@ -827,7 +837,7 @@ public class PersonQuery extends PersonEntity { ...@@ -827,7 +837,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceStart * @param sourceStart
*/ */
public void setSourceStart(Integer sourceStart){ public void setSourceStart(Integer sourceStart){
...@@ -835,7 +845,7 @@ public class PersonQuery extends PersonEntity { ...@@ -835,7 +845,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 获取 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 获取 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @return $sourceEnd * @return $sourceEnd
*/ */
public Integer getSourceEnd(){ public Integer getSourceEnd(){
...@@ -843,7 +853,7 @@ public class PersonQuery extends PersonEntity { ...@@ -843,7 +853,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceEnd * @param sourceEnd
*/ */
public void setSourceEnd(Integer sourceEnd){ public void setSourceEnd(Integer sourceEnd){
...@@ -851,7 +861,7 @@ public class PersonQuery extends PersonEntity { ...@@ -851,7 +861,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 获取 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 获取 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @return sourceIncrement * @return sourceIncrement
*/ */
public Integer getSourceIncrement(){ public Integer getSourceIncrement(){
...@@ -859,7 +869,7 @@ public class PersonQuery extends PersonEntity { ...@@ -859,7 +869,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceIncrement * @param sourceIncrement
*/ */
public void setSourceIncrement(Integer sourceIncrement){ public void setSourceIncrement(Integer sourceIncrement){
...@@ -867,7 +877,7 @@ public class PersonQuery extends PersonEntity { ...@@ -867,7 +877,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 获取 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 获取 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @return sourceList * @return sourceList
*/ */
public List<Integer> getSourceList(){ public List<Integer> getSourceList(){
...@@ -875,7 +885,7 @@ public class PersonQuery extends PersonEntity { ...@@ -875,7 +885,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceList * @param sourceList
*/ */
public void setSourceList(List<Integer> sourceList){ public void setSourceList(List<Integer> sourceList){
...@@ -883,7 +893,7 @@ public class PersonQuery extends PersonEntity { ...@@ -883,7 +893,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 获取 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 获取 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @return sourceNotList * @return sourceNotList
*/ */
public List<Integer> getSourceNotList(){ public List<Integer> getSourceNotList(){
...@@ -891,7 +901,7 @@ public class PersonQuery extends PersonEntity { ...@@ -891,7 +901,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceNotList * @param sourceNotList
*/ */
public void setSourceNotList(List<Integer> sourceNotList){ public void setSourceNotList(List<Integer> sourceNotList){
...@@ -1270,6 +1280,70 @@ public class PersonQuery extends PersonEntity { ...@@ -1270,6 +1280,70 @@ public class PersonQuery extends PersonEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 海康人脸图片url
* @return picUrlList
*/
public List<String> getPicUrlList(){
return this.picUrlList;
}
/**
* 设置 海康人脸图片url
* @param picUrlList
*/
public void setPicUrlList(List<String> picUrlList){
this.picUrlList = picUrlList;
}
/**
* 获取 海康人脸图片url
* @return picUrlNotList
*/
public List<String> getPicUrlNotList(){
return this.picUrlNotList;
}
/**
* 设置 海康人脸图片url
* @param picUrlNotList
*/
public void setPicUrlNotList(List<String> picUrlNotList){
this.picUrlNotList = picUrlNotList;
}
/**
* 获取 海康人脸服务标识
* @return serverIndexCodeList
*/
public List<String> getServerIndexCodeList(){
return this.serverIndexCodeList;
}
/**
* 设置 海康人脸服务标识
* @param serverIndexCodeList
*/
public void setServerIndexCodeList(List<String> serverIndexCodeList){
this.serverIndexCodeList = serverIndexCodeList;
}
/**
* 获取 海康人脸服务标识
* @return serverIndexCodeNotList
*/
public List<String> getServerIndexCodeNotList(){
return this.serverIndexCodeNotList;
}
/**
* 设置 海康人脸服务标识
* @param serverIndexCodeNotList
*/
public void setServerIndexCodeNotList(List<String> serverIndexCodeNotList){
this.serverIndexCodeNotList = serverIndexCodeNotList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -1640,7 +1714,7 @@ public class PersonQuery extends PersonEntity { ...@@ -1640,7 +1714,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param source * @param source
*/ */
public PersonQuery source(Integer source){ public PersonQuery source(Integer source){
...@@ -1649,7 +1723,7 @@ public class PersonQuery extends PersonEntity { ...@@ -1649,7 +1723,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 开始 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceStart * @param sourceStart
*/ */
public PersonQuery sourceStart(Integer sourceStart){ public PersonQuery sourceStart(Integer sourceStart){
...@@ -1658,7 +1732,7 @@ public class PersonQuery extends PersonEntity { ...@@ -1658,7 +1732,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 结束 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceEnd * @param sourceEnd
*/ */
public PersonQuery sourceEnd(Integer sourceEnd){ public PersonQuery sourceEnd(Integer sourceEnd){
...@@ -1667,7 +1741,7 @@ public class PersonQuery extends PersonEntity { ...@@ -1667,7 +1741,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 增加 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceIncrement * @param sourceIncrement
*/ */
public PersonQuery sourceIncrement(Integer sourceIncrement){ public PersonQuery sourceIncrement(Integer sourceIncrement){
...@@ -1676,7 +1750,7 @@ public class PersonQuery extends PersonEntity { ...@@ -1676,7 +1750,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceList * @param sourceList
*/ */
public PersonQuery sourceList(List<Integer> sourceList){ public PersonQuery sourceList(List<Integer> sourceList){
...@@ -1685,7 +1759,7 @@ public class PersonQuery extends PersonEntity { ...@@ -1685,7 +1759,7 @@ public class PersonQuery extends PersonEntity {
} }
/** /**
* 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,99.其它) * 设置 注册人员来源(0.预约系统,1.排队叫号系统,2.自助服务系统,3.海康,99.其它)
* @param sourceNotList * @param sourceNotList
*/ */
public PersonQuery sourceNotList(List<Integer> sourceNotList){ public PersonQuery sourceNotList(List<Integer> sourceNotList){
...@@ -1895,6 +1969,44 @@ public class PersonQuery extends PersonEntity { ...@@ -1895,6 +1969,44 @@ public class PersonQuery extends PersonEntity {
} }
/**
* 设置 海康人脸图片url
* @param picUrl
*/
public PersonQuery picUrl(String picUrl){
setPicUrl(picUrl);
return this;
}
/**
* 设置 海康人脸图片url
* @param picUrlList
*/
public PersonQuery picUrlList(List<String> picUrlList){
this.picUrlList = picUrlList;
return this;
}
/**
* 设置 海康人脸服务标识
* @param serverIndexCode
*/
public PersonQuery serverIndexCode(String serverIndexCode){
setServerIndexCode(serverIndexCode);
return this;
}
/**
* 设置 海康人脸服务标识
* @param serverIndexCodeList
*/
public PersonQuery serverIndexCodeList(List<String> serverIndexCodeList){
this.serverIndexCodeList = serverIndexCodeList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -16,5 +16,9 @@ ...@@ -16,5 +16,9 @@
<property name="dialect" value="MySql" /> <property name="dialect" value="MySql" />
<property name="showSql" value="MySql" /> <property name="showSql" value="MySql" />
</plugin> </plugin>
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="true" />
<property name="showSql" value="false" />
</plugin>
</plugins> </plugins>
</configuration> </configuration>
\ No newline at end of file
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="picUrl" column="picUrl" />
<result property="serverIndexCode" column="serverIndexCode" />
</resultMap> </resultMap>
...@@ -96,23 +98,29 @@ ...@@ -96,23 +98,29 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('picUrl') or colPickMode == 1 and data.containsKey('picUrl')))">
a.picUrl,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('serverIndexCode') or colPickMode == 1 and data.containsKey('serverIndexCode')))">
a.serverIndexCode,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="PersonEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="PersonEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_person insert into mortals_xhx_person
(siteId,siteName,name,idCard,gender,phone,birthday,address,photo,sourcePhotoUri,sourceId,remark,source,inFaceHk,indexCode,ifaceGroupIndexCode,createUserId,createTime,updateUserId,updateTime) (siteId,siteName,name,idCard,gender,phone,birthday,address,photo,sourcePhotoUri,sourceId,remark,source,inFaceHk,indexCode,ifaceGroupIndexCode,createUserId,createTime,updateUserId,updateTime,picUrl,serverIndexCode)
VALUES VALUES
(#{siteId},#{siteName},#{name},#{idCard},#{gender},#{phone},#{birthday},#{address},#{photo},#{sourcePhotoUri},#{sourceId},#{remark},#{source},#{inFaceHk},#{indexCode},#{ifaceGroupIndexCode},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{siteId},#{siteName},#{name},#{idCard},#{gender},#{phone},#{birthday},#{address},#{photo},#{sourcePhotoUri},#{sourceId},#{remark},#{source},#{inFaceHk},#{indexCode},#{ifaceGroupIndexCode},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{picUrl},#{serverIndexCode})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_person insert into mortals_xhx_person
(siteId,siteName,name,idCard,gender,phone,birthday,address,photo,sourcePhotoUri,sourceId,remark,source,inFaceHk,indexCode,ifaceGroupIndexCode,createUserId,createTime,updateUserId,updateTime) (siteId,siteName,name,idCard,gender,phone,birthday,address,photo,sourcePhotoUri,sourceId,remark,source,inFaceHk,indexCode,ifaceGroupIndexCode,createUserId,createTime,updateUserId,updateTime,picUrl,serverIndexCode)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.siteId},#{item.siteName},#{item.name},#{item.idCard},#{item.gender},#{item.phone},#{item.birthday},#{item.address},#{item.photo},#{item.sourcePhotoUri},#{item.sourceId},#{item.remark},#{item.source},#{item.inFaceHk},#{item.indexCode},#{item.ifaceGroupIndexCode},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.siteId},#{item.siteName},#{item.name},#{item.idCard},#{item.gender},#{item.phone},#{item.birthday},#{item.address},#{item.photo},#{item.sourcePhotoUri},#{item.sourceId},#{item.remark},#{item.source},#{item.inFaceHk},#{item.indexCode},#{item.ifaceGroupIndexCode},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.picUrl},#{item.serverIndexCode})
</foreach> </foreach>
</insert> </insert>
...@@ -203,6 +211,12 @@ ...@@ -203,6 +211,12 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('picUrl')) or (colPickMode==1 and !data.containsKey('picUrl'))">
a.picUrl=#{data.picUrl},
</if>
<if test="(colPickMode==0 and data.containsKey('serverIndexCode')) or (colPickMode==1 and !data.containsKey('serverIndexCode'))">
a.serverIndexCode=#{data.serverIndexCode},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -390,6 +404,20 @@ ...@@ -390,6 +404,20 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="picUrl=(case" suffix="ELSE picUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('picUrl')) or (colPickMode==1 and !item.containsKey('picUrl'))">
when a.id=#{item.id} then #{item.picUrl}
</if>
</foreach>
</trim>
<trim prefix="serverIndexCode=(case" suffix="ELSE serverIndexCode end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('serverIndexCode')) or (colPickMode==1 and !item.containsKey('serverIndexCode'))">
when a.id=#{item.id} then #{item.serverIndexCode}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -977,6 +1005,48 @@ ...@@ -977,6 +1005,48 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('picUrl')">
<if test="conditionParamRef.picUrl != null and conditionParamRef.picUrl != ''">
${_conditionType_} a.picUrl like #{${_conditionParam_}.picUrl}
</if>
<if test="conditionParamRef.picUrl == null">
${_conditionType_} a.picUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('picUrlList') and conditionParamRef.picUrlList.size() > 0">
${_conditionType_} a.picUrl in
<foreach collection="conditionParamRef.picUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('picUrlNotList') and conditionParamRef.picUrlNotList.size() > 0">
${_conditionType_} a.picUrl not in
<foreach collection="conditionParamRef.picUrlNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('serverIndexCode')">
<if test="conditionParamRef.serverIndexCode != null and conditionParamRef.serverIndexCode != ''">
${_conditionType_} a.serverIndexCode like #{${_conditionParam_}.serverIndexCode}
</if>
<if test="conditionParamRef.serverIndexCode == null">
${_conditionType_} a.serverIndexCode is null
</if>
</if>
<if test="conditionParamRef.containsKey('serverIndexCodeList') and conditionParamRef.serverIndexCodeList.size() > 0">
${_conditionType_} a.serverIndexCode in
<foreach collection="conditionParamRef.serverIndexCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('serverIndexCodeNotList') and conditionParamRef.serverIndexCodeNotList.size() > 0">
${_conditionType_} a.serverIndexCode not in
<foreach collection="conditionParamRef.serverIndexCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -1095,6 +1165,16 @@ ...@@ -1095,6 +1165,16 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('picUrl')">
a.picUrl
<if test='orderCol.picUrl != null and "DESC".equalsIgnoreCase(orderCol.picUrl)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('serverIndexCode')">
a.serverIndexCode
<if test='orderCol.serverIndexCode != null and "DESC".equalsIgnoreCase(orderCol.serverIndexCode)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
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