فهرست منبع

人脸信息发送逻辑修改,设备库添加默认人脸库id字段default_face_library_id

M墨鱼—_mo 5 سال پیش
والد
کامیت
056204ace2

+ 3 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/DeviceInfo.java

@@ -140,6 +140,9 @@ public class DeviceInfo {
 	@ApiModelProperty(value = "是否绑定人员(只做查询作用,不写入数据库)")
 	private Boolean isBindPerson;
 
+	@ApiModelProperty(value = "默认人脸库id")
+	private String defaultFaceLibraryId;
+
 	public String getIsOnlineN() {
 		if(isOnline!=null) {
 			if (isOnline) {

+ 4 - 0
common/src/main/java/com/jpsoft/smart/modules/lapi/service/impl/LapiServiceImpl.java

@@ -179,6 +179,10 @@ public class LapiServiceImpl implements ILapiService {
                 faceDbId = jsonObject1.getString("ID");
             }
         }
+        //人员所属的公司库不存在,保存到默认库
+        if (StringUtils.isBlank(faceDbId)){
+            faceDbId = deviceInfo.getDefaultFaceLibraryId();
+        }
         return faceDbId;
     }
 }

+ 8 - 3
common/src/main/resources/mapper/base/DeviceInfo.xml

@@ -22,6 +22,7 @@
 			<result property="createTime" column="create_time" />
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
+		    <result property="defaultFaceLibraryId" column="default_face_library_id" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.smart.modules.base.entity.DeviceInfo">
 	<!--
@@ -31,7 +32,7 @@
 	-->
 	<![CDATA[
 		insert into base_device_info
-	    (id_,header_,device_no,alias_name,address_,is_online,company_id,unlock_password,code_address,ip_address,port_,type_,is_auto_update,del_flag,create_by,create_time,update_by,update_time)
+	    (id_,header_,device_no,alias_name,address_,is_online,company_id,unlock_password,code_address,ip_address,port_,type_,is_auto_update,del_flag,create_by,create_time,update_by,update_time,default_face_library_id)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -52,6 +53,7 @@
 ,#{createTime,jdbcType= TIMESTAMP }
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
+,#{defaultFaceLibraryId,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -112,16 +114,19 @@
 				<if test="updateTime!=null">
 		update_time=#{updateTime,jdbcType= TIMESTAMP },
 		</if>
+			<if test="defaultFaceLibraryId!=null">
+				default_face_library_id=#{defaultFaceLibraryId,jdbcType= VARCHAR },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="DeviceInfoMap">
 		select
-id_, header_,device_no,alias_name,address_,is_online,company_id,unlock_password,code_address,ip_address,port_,type_,is_auto_update,del_flag,create_by,create_time,update_by,update_time		from base_device_info where id_=#{0}
+id_, header_,device_no,alias_name,address_,is_online,company_id,unlock_password,code_address,ip_address,port_,type_,is_auto_update,del_flag,create_by,create_time,update_by,update_time,default_face_library_id		from base_device_info where id_=#{0}
 	</select>
 	<select id="getByDeviceNo" parameterType="string" resultMap="DeviceInfoMap">
 		select
-id_, header_,device_no,alias_name,address_,is_online,company_id,unlock_password,code_address,ip_address,port_,type_,is_auto_update,del_flag,create_by,create_time,update_by,update_time		from base_device_info where device_no=#{0}
+id_, header_,device_no,alias_name,address_,is_online,company_id,unlock_password,code_address,ip_address,port_,type_,is_auto_update,del_flag,create_by,create_time,update_by,update_time,default_face_library_id		from base_device_info where device_no=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_device_info where id_=#{0} and  del_flag=false