Parcourir la source

加入门禁 白名单

Your Name il y a 3 ans
Parent
commit
dabc9ac394

+ 140 - 0
java110-bean/src/main/java/com/java110/dto/accessControlWhite/AccessControlWhiteDto.java

@@ -0,0 +1,140 @@
+package com.java110.dto.accessControlWhite;
+
+import com.java110.dto.PageDto;
+import com.java110.dto.machine.MachineDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 门禁白名单数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class AccessControlWhiteDto extends MachineDto implements Serializable {
+
+    private String thirdId;
+    private String idCard;
+    private String accessControlKey;
+    private String personName;
+    private String machineId;
+    private String acwId;
+    private String personId;
+    private String tel;
+    private String startTime;
+    private String endTime;
+    private String communityId;
+    private String personType;
+
+    private String statusCd = "0";
+
+
+    public String getThirdId() {
+        return thirdId;
+    }
+
+    public void setThirdId(String thirdId) {
+        this.thirdId = thirdId;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getAccessControlKey() {
+        return accessControlKey;
+    }
+
+    public void setAccessControlKey(String accessControlKey) {
+        this.accessControlKey = accessControlKey;
+    }
+
+    public String getPersonName() {
+        return personName;
+    }
+
+    public void setPersonName(String personName) {
+        this.personName = personName;
+    }
+
+    public String getMachineId() {
+        return machineId;
+    }
+
+    public void setMachineId(String machineId) {
+        this.machineId = machineId;
+    }
+
+    public String getAcwId() {
+        return acwId;
+    }
+
+    public void setAcwId(String acwId) {
+        this.acwId = acwId;
+    }
+
+    public String getPersonId() {
+        return personId;
+    }
+
+    public void setPersonId(String personId) {
+        this.personId = personId;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getPersonType() {
+        return personType;
+    }
+
+    public void setPersonType(String personType) {
+        this.personType = personType;
+    }
+
+
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 3 - 0
java110-bean/src/main/java/com/java110/dto/visitSetting/VisitSettingDto.java

@@ -19,6 +19,9 @@ public class VisitSettingDto extends OaWorkflowDto implements Serializable {
     public static final String AUDIT_WAY_YES = "Y";
     public static final String AUDIT_WAY_NO = "N";
 
+    public static final String FACE_WAY_NO = "N";
+    public static final String CAR_NUM_WAY_NO = "N";
+
     private String carNumWay;
     private String faceWay;
     private String typeName;

+ 124 - 0
java110-bean/src/main/java/com/java110/po/accessControlWhite/AccessControlWhitePo.java

@@ -0,0 +1,124 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.po.accessControlWhite;
+
+import java.io.Serializable;
+import java.util.Date;
+/**
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public class AccessControlWhitePo implements Serializable {
+
+    private String thirdId;
+private String idCard;
+private String accessControlKey;
+private String statusCd = "0";
+private String personName;
+private String machineId;
+private String acwId;
+private String personId;
+private String tel;
+private String startTime;
+private String endTime;
+private String communityId;
+private String personType;
+public String getThirdId() {
+        return thirdId;
+    }
+public void setThirdId(String thirdId) {
+        this.thirdId = thirdId;
+    }
+public String getIdCard() {
+        return idCard;
+    }
+public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+public String getAccessControlKey() {
+        return accessControlKey;
+    }
+public void setAccessControlKey(String accessControlKey) {
+        this.accessControlKey = accessControlKey;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getPersonName() {
+        return personName;
+    }
+public void setPersonName(String personName) {
+        this.personName = personName;
+    }
+public String getMachineId() {
+        return machineId;
+    }
+public void setMachineId(String machineId) {
+        this.machineId = machineId;
+    }
+public String getAcwId() {
+        return acwId;
+    }
+public void setAcwId(String acwId) {
+        this.acwId = acwId;
+    }
+public String getPersonId() {
+        return personId;
+    }
+public void setPersonId(String personId) {
+        this.personId = personId;
+    }
+public String getTel() {
+        return tel;
+    }
+public void setTel(String tel) {
+        this.tel = tel;
+    }
+public String getStartTime() {
+        return startTime;
+    }
+public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+public String getEndTime() {
+        return endTime;
+    }
+public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getPersonType() {
+        return personType;
+    }
+public void setPersonType(String personType) {
+        this.personType = personType;
+    }
+
+
+
+}

+ 169 - 0
java110-db/src/main/resources/mapper/common/AccessControlWhiteV1ServiceDaoImplMapper.xml

@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="accessControlWhiteV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存门禁白名单信息 add by wuxw 2018-07-03 -->
+    <insert id="saveAccessControlWhiteInfo" parameterType="Map">
+        insert into access_control_white(
+third_id,id_card,access_control_key,person_name,machine_id,acw_id,person_id,tel,start_time,end_time,community_id,person_type
+) values (
+#{thirdId},#{idCard},#{accessControlKey},#{personName},#{machineId},#{acwId},#{personId},#{tel},#{startTime},#{endTime},#{communityId},#{personType}
+)
+    </insert>
+
+
+
+    <!-- 查询门禁白名单信息 add by wuxw 2018-07-03 -->
+    <select id="getAccessControlWhiteInfo" parameterType="Map" resultType="Map">
+        select  t.third_id,t.third_id thirdId,t.id_card,t.id_card idCard,t.access_control_key,t.access_control_key accessControlKey,t.status_cd,t.status_cd statusCd,t.person_name,t.person_name personName,t.machine_id,t.machine_id machineId,t.acw_id,t.acw_id acwId,t.person_id,t.person_id personId,t.tel,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.person_type,t.person_type personType 
+from access_control_white t 
+where 1 =1 
+<if test="thirdId !=null and thirdId != ''">
+   and t.third_id= #{thirdId}
+</if> 
+<if test="idCard !=null and idCard != ''">
+   and t.id_card= #{idCard}
+</if> 
+<if test="accessControlKey !=null and accessControlKey != ''">
+   and t.access_control_key= #{accessControlKey}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="personName !=null and personName != ''">
+   and t.person_name= #{personName}
+</if> 
+<if test="machineId !=null and machineId != ''">
+   and t.machine_id= #{machineId}
+</if> 
+<if test="acwId !=null and acwId != ''">
+   and t.acw_id= #{acwId}
+</if> 
+<if test="personId !=null and personId != ''">
+   and t.person_id= #{personId}
+</if> 
+<if test="tel !=null and tel != ''">
+   and t.tel= #{tel}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="personType !=null and personType != ''">
+   and t.person_type= #{personType}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改门禁白名单信息 add by wuxw 2018-07-03 -->
+    <update id="updateAccessControlWhiteInfo" parameterType="Map">
+        update  access_control_white t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="thirdId !=null and thirdId != ''">
+, t.third_id= #{thirdId}
+</if> 
+<if test="idCard !=null and idCard != ''">
+, t.id_card= #{idCard}
+</if> 
+<if test="accessControlKey !=null and accessControlKey != ''">
+, t.access_control_key= #{accessControlKey}
+</if> 
+<if test="personName !=null and personName != ''">
+, t.person_name= #{personName}
+</if> 
+<if test="machineId !=null and machineId != ''">
+, t.machine_id= #{machineId}
+</if> 
+<if test="personId !=null and personId != ''">
+, t.person_id= #{personId}
+</if> 
+<if test="tel !=null and tel != ''">
+, t.tel= #{tel}
+</if> 
+<if test="startTime !=null and startTime != ''">
+, t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+, t.end_time= #{endTime}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="personType !=null and personType != ''">
+, t.person_type= #{personType}
+</if> 
+ where 1=1 <if test="acwId !=null and acwId != ''">
+and t.acw_id= #{acwId}
+</if> 
+
+    </update>
+
+    <!-- 查询门禁白名单数量 add by wuxw 2018-07-03 -->
+     <select id="queryAccessControlWhitesCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from access_control_white t 
+where 1 =1 
+<if test="thirdId !=null and thirdId != ''">
+   and t.third_id= #{thirdId}
+</if> 
+<if test="idCard !=null and idCard != ''">
+   and t.id_card= #{idCard}
+</if> 
+<if test="accessControlKey !=null and accessControlKey != ''">
+   and t.access_control_key= #{accessControlKey}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="personName !=null and personName != ''">
+   and t.person_name= #{personName}
+</if> 
+<if test="machineId !=null and machineId != ''">
+   and t.machine_id= #{machineId}
+</if> 
+<if test="acwId !=null and acwId != ''">
+   and t.acw_id= #{acwId}
+</if> 
+<if test="personId !=null and personId != ''">
+   and t.person_id= #{personId}
+</if> 
+<if test="tel !=null and tel != ''">
+   and t.tel= #{tel}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="personType !=null and personType != ''">
+   and t.person_type= #{personType}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/common/IAccessControlWhiteV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.common;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.accessControlWhite.AccessControlWhiteDto;
+import com.java110.po.accessControlWhite.AccessControlWhitePo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "common-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/accessControlWhiteV1Api")
+public interface IAccessControlWhiteV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveAccessControlWhite", method = RequestMethod.POST)
+    public int saveAccessControlWhite(@RequestBody  AccessControlWhitePo accessControlWhitePo);
+
+    @RequestMapping(value = "/updateAccessControlWhite", method = RequestMethod.POST)
+    public int updateAccessControlWhite(@RequestBody  AccessControlWhitePo accessControlWhitePo);
+
+    @RequestMapping(value = "/deleteAccessControlWhite", method = RequestMethod.POST)
+    public int deleteAccessControlWhite(@RequestBody  AccessControlWhitePo accessControlWhitePo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param accessControlWhiteDto 数据对象分享
+     * @return AccessControlWhiteDto 对象数据
+     */
+    @RequestMapping(value = "/queryAccessControlWhites", method = RequestMethod.POST)
+    List<AccessControlWhiteDto> queryAccessControlWhites(@RequestBody AccessControlWhiteDto accessControlWhiteDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param accessControlWhiteDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryAccessControlWhitesCount", method = RequestMethod.POST)
+    int queryAccessControlWhitesCount(@RequestBody AccessControlWhiteDto accessControlWhiteDto);
+}

+ 10 - 0
java110-utils/src/main/java/com/java110/utils/constant/UserLevelConstant.java

@@ -23,4 +23,14 @@ public class UserLevelConstant {
      * 普通用户
      */
     public static final String USER_LEVEL_ORDINARY = "02";
+
+    /**
+     * 普通用户
+     */
+    public static final String USER_LEVEL_MALL = "03";
+
+    /**
+     * 临时人员
+     */
+    public static final String USER_LEVEL_TEMP = "05";
 }

+ 71 - 0
service-common/src/main/java/com/java110/common/cmd/machine/DeleteAccessControlWhiteCmd.java

@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.machine;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.common.IAccessControlWhiteV1InnerServiceSMO;
+import com.java110.po.accessControlWhite.AccessControlWhitePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:删除
+ * 服务编码:machine.deleteAccessControlWhite
+ * 请求路劲:/app/machine.DeleteAccessControlWhite
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "machine.deleteAccessControlWhite")
+public class DeleteAccessControlWhiteCmd extends Cmd {
+    private static Logger logger = LoggerFactory.getLogger(DeleteAccessControlWhiteCmd.class);
+
+    @Autowired
+    private IAccessControlWhiteV1InnerServiceSMO accessControlWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "acwId", "acwId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        AccessControlWhitePo accessControlWhitePo = BeanConvertUtil.covertBean(reqJson, AccessControlWhitePo.class);
+        int flag = accessControlWhiteV1InnerServiceSMOImpl.deleteAccessControlWhite(accessControlWhitePo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 82 - 0
service-common/src/main/java/com/java110/common/cmd/machine/ListAccessControlWhiteCmd.java

@@ -0,0 +1,82 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.machine;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.common.IAccessControlWhiteV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.java110.dto.accessControlWhite.AccessControlWhiteDto;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:machine.listAccessControlWhite
+ * 请求路劲:/app/machine.ListAccessControlWhite
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "machine.listAccessControlWhite")
+public class ListAccessControlWhiteCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(ListAccessControlWhiteCmd.class);
+    @Autowired
+    private IAccessControlWhiteV1InnerServiceSMO accessControlWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        AccessControlWhiteDto accessControlWhiteDto = BeanConvertUtil.covertBean(reqJson, AccessControlWhiteDto.class);
+
+        int count = accessControlWhiteV1InnerServiceSMOImpl.queryAccessControlWhitesCount(accessControlWhiteDto);
+
+        List<AccessControlWhiteDto> accessControlWhiteDtos = null;
+
+        if (count > 0) {
+            accessControlWhiteDtos = accessControlWhiteV1InnerServiceSMOImpl.queryAccessControlWhites(accessControlWhiteDto);
+        } else {
+            accessControlWhiteDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, accessControlWhiteDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 81 - 0
service-common/src/main/java/com/java110/common/cmd/machine/SaveAccessControlWhiteCmd.java

@@ -0,0 +1,81 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.machine;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.common.IAccessControlWhiteV1InnerServiceSMO;
+import com.java110.po.accessControlWhite.AccessControlWhitePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 类表述:保存
+ * 服务编码:machine.saveAccessControlWhite
+ * 请求路劲:/app/machine.SaveAccessControlWhite
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "machine.saveAccessControlWhite")
+public class SaveAccessControlWhiteCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveAccessControlWhiteCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IAccessControlWhiteV1InnerServiceSMO accessControlWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "machineId", "请求报文中未包含machineId");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "personName", "请求报文中未包含personName");
+        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
+        Assert.hasKeyAndValue(reqJson, "personType", "请求报文中未包含personType");
+        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
+        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        AccessControlWhitePo accessControlWhitePo = BeanConvertUtil.covertBean(reqJson, AccessControlWhitePo.class);
+        accessControlWhitePo.setAcwId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = accessControlWhiteV1InnerServiceSMOImpl.saveAccessControlWhite(accessControlWhitePo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 74 - 0
service-common/src/main/java/com/java110/common/cmd/machine/UpdateAccessControlWhiteCmd.java

@@ -0,0 +1,74 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.machine;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.common.IAccessControlWhiteV1InnerServiceSMO;
+import com.java110.po.accessControlWhite.AccessControlWhitePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:machine.updateAccessControlWhite
+ * 请求路劲:/app/machine.UpdateAccessControlWhite
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "machine.updateAccessControlWhite")
+public class UpdateAccessControlWhiteCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateAccessControlWhiteCmd.class);
+
+
+    @Autowired
+    private IAccessControlWhiteV1InnerServiceSMO accessControlWhiteV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "acwId", "acwId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        AccessControlWhitePo accessControlWhitePo = BeanConvertUtil.covertBean(reqJson, AccessControlWhitePo.class);
+        int flag = accessControlWhiteV1InnerServiceSMOImpl.updateAccessControlWhite(accessControlWhitePo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-common/src/main/java/com/java110/common/dao/IAccessControlWhiteV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2023-01-24 00:53:52 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IAccessControlWhiteV1ServiceDao {
+
+
+    /**
+     * 保存 门禁白名单信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveAccessControlWhiteInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询门禁白名单信息(instance过程)
+     * 根据bId 查询门禁白名单信息
+     * @param info bId 信息
+     * @return 门禁白名单信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getAccessControlWhiteInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改门禁白名单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateAccessControlWhiteInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询门禁白名单总数
+     *
+     * @param info 门禁白名单信息
+     * @return 门禁白名单数量
+     */
+    int queryAccessControlWhitesCount(Map info);
+
+}

+ 112 - 0
service-common/src/main/java/com/java110/common/dao/impl/AccessControlWhiteV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.common.dao.IAccessControlWhiteV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("accessControlWhiteV1ServiceDaoImpl")
+public class AccessControlWhiteV1ServiceDaoImpl extends BaseServiceDao implements IAccessControlWhiteV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(AccessControlWhiteV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存门禁白名单信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveAccessControlWhiteInfo(Map info) throws DAOException {
+        logger.debug("保存 saveAccessControlWhiteInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("accessControlWhiteV1ServiceDaoImpl.saveAccessControlWhiteInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询门禁白名单信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getAccessControlWhiteInfo(Map info) throws DAOException {
+        logger.debug("查询 getAccessControlWhiteInfo 入参 info : {}",info);
+
+        List<Map> businessAccessControlWhiteInfos = sqlSessionTemplate.selectList("accessControlWhiteV1ServiceDaoImpl.getAccessControlWhiteInfo",info);
+
+        return businessAccessControlWhiteInfos;
+    }
+
+
+    /**
+     * 修改门禁白名单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateAccessControlWhiteInfo(Map info) throws DAOException {
+        logger.debug("修改 updateAccessControlWhiteInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("accessControlWhiteV1ServiceDaoImpl.updateAccessControlWhiteInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询门禁白名单数量
+     * @param info 门禁白名单信息
+     * @return 门禁白名单数量
+     */
+    @Override
+    public int queryAccessControlWhitesCount(Map info) {
+        logger.debug("查询 queryAccessControlWhitesCount 入参 info : {}",info);
+
+        List<Map> businessAccessControlWhiteInfos = sqlSessionTemplate.selectList("accessControlWhiteV1ServiceDaoImpl.queryAccessControlWhitesCount", info);
+        if (businessAccessControlWhiteInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessAccessControlWhiteInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 156 - 0
service-common/src/main/java/com/java110/common/smo/impl/AccessControlWhiteV1InnerServiceSMOImpl.java

@@ -0,0 +1,156 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.smo.impl;
+
+
+import com.java110.common.dao.IAccessControlWhiteV1ServiceDao;
+import com.java110.core.factory.AuthenticationFactory;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.common.IAccessControlWhiteV1InnerServiceSMO;
+import com.java110.dto.accessControlWhite.AccessControlWhiteDto;
+import com.java110.intf.user.IUserV1InnerServiceSMO;
+import com.java110.po.accessControlWhite.AccessControlWhitePo;
+import com.java110.po.user.UserPo;
+import com.java110.utils.constant.UserLevelConstant;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import com.java110.utils.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-01-24 00:53:53 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class AccessControlWhiteV1InnerServiceSMOImpl extends BaseServiceSMO implements IAccessControlWhiteV1InnerServiceSMO {
+
+    @Autowired
+    private IAccessControlWhiteV1ServiceDao accessControlWhiteV1ServiceDaoImpl;
+
+    @Autowired
+    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
+
+
+    @Override
+    public int saveAccessControlWhite(@RequestBody AccessControlWhitePo accessControlWhitePo) {
+        UserDto userDto = new UserDto();
+        userDto.setTel(accessControlWhitePo.getTel());
+        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
+        int saveFlag = 0;
+        String personId= "";
+        if (userDtos == null || userDtos.size() < 1) {
+            UserPo userPo = new UserPo();
+            userPo.setTel(accessControlWhitePo.getTel());
+            userPo.setName(accessControlWhitePo.getPersonName());
+            userPo.setAddress("无");
+            userPo.setUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_userId));
+            userPo.setScore("0");
+            userPo.setAge("1");
+            userPo.setEmail("无");
+            userPo.setLevelCd(UserLevelConstant.USER_LEVEL_TEMP);
+            userPo.setSex("1");
+            userPo.setPassword(AuthenticationFactory.passwdMd5(accessControlWhitePo.getTel()));
+            userPo.setbId("-1");
+            saveFlag = userV1InnerServiceSMOImpl.saveUser(userPo);
+            if (saveFlag < 1) {
+                throw new CmdException("添加用户失败");
+            }
+            personId = userPo.getUserId();
+        }else {
+            personId = userDtos.get(0).getUserId();
+        }
+        accessControlWhitePo.setPersonId(personId);
+        saveFlag = accessControlWhiteV1ServiceDaoImpl.saveAccessControlWhiteInfo(BeanConvertUtil.beanCovertMap(accessControlWhitePo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateAccessControlWhite(@RequestBody AccessControlWhitePo accessControlWhitePo) {
+        int saveFlag = 0;
+        if(!StringUtil.isEmpty(accessControlWhitePo.getTel())) {
+            UserDto userDto = new UserDto();
+            userDto.setTel(accessControlWhitePo.getTel());
+            List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
+            String personId = "";
+            if (userDtos == null || userDtos.size() < 1) {
+                UserPo userPo = new UserPo();
+                userPo.setTel(accessControlWhitePo.getTel());
+                userPo.setName(accessControlWhitePo.getPersonName());
+                userPo.setAddress("无");
+                userPo.setUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_userId));
+                userPo.setScore("0");
+                userPo.setAge("1");
+                userPo.setEmail("无");
+                userPo.setLevelCd(UserLevelConstant.USER_LEVEL_TEMP);
+                userPo.setSex("1");
+                userPo.setPassword(AuthenticationFactory.passwdMd5(accessControlWhitePo.getTel()));
+                userPo.setbId("-1");
+                saveFlag = userV1InnerServiceSMOImpl.saveUser(userPo);
+                if (saveFlag < 1) {
+                    throw new CmdException("添加用户失败");
+                }
+                personId = userPo.getUserId();
+            } else {
+                personId = userDtos.get(0).getUserId();
+            }
+            accessControlWhitePo.setPersonId(personId);
+        }
+        saveFlag = accessControlWhiteV1ServiceDaoImpl.updateAccessControlWhiteInfo(BeanConvertUtil.beanCovertMap(accessControlWhitePo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteAccessControlWhite(@RequestBody AccessControlWhitePo accessControlWhitePo) {
+        accessControlWhitePo.setStatusCd("1");
+        int saveFlag = accessControlWhiteV1ServiceDaoImpl.updateAccessControlWhiteInfo(BeanConvertUtil.beanCovertMap(accessControlWhitePo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<AccessControlWhiteDto> queryAccessControlWhites(@RequestBody AccessControlWhiteDto accessControlWhiteDto) {
+
+        //校验是否传了 分页信息
+
+        int page = accessControlWhiteDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            accessControlWhiteDto.setPage((page - 1) * accessControlWhiteDto.getRow());
+        }
+
+        List<AccessControlWhiteDto> accessControlWhites = BeanConvertUtil.covertBeanList(accessControlWhiteV1ServiceDaoImpl.getAccessControlWhiteInfo(BeanConvertUtil.beanCovertMap(accessControlWhiteDto)), AccessControlWhiteDto.class);
+
+        return accessControlWhites;
+    }
+
+
+    @Override
+    public int queryAccessControlWhitesCount(@RequestBody AccessControlWhiteDto accessControlWhiteDto) {
+        return accessControlWhiteV1ServiceDaoImpl.queryAccessControlWhitesCount(BeanConvertUtil.beanCovertMap(accessControlWhiteDto));
+    }
+
+}

+ 57 - 3
service-community/src/main/java/com/java110/community/cmd/visit/SaveVisitCmd.java

@@ -10,19 +10,23 @@ import com.java110.core.factory.CommunitySettingFactory;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.smo.IPhotoSMO;
 import com.java110.dto.file.FileDto;
+import com.java110.dto.machine.CarBlackWhiteDto;
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.parking.ParkingSpaceDto;
 import com.java110.dto.visit.VisitDto;
 import com.java110.dto.visitSetting.VisitSettingDto;
+import com.java110.intf.common.ICarBlackWhiteInnerServiceSMO;
 import com.java110.intf.common.IFileInnerServiceSMO;
 import com.java110.intf.common.IFileRelInnerServiceSMO;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
 import com.java110.intf.community.IVisitInnerServiceSMO;
 import com.java110.intf.community.IVisitSettingV1InnerServiceSMO;
 import com.java110.intf.community.IVisitV1InnerServiceSMO;
+import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO;
 import com.java110.intf.user.IOwnerCarAttrInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarV1InnerServiceSMO;
+import com.java110.po.car.CarBlackWhitePo;
 import com.java110.po.car.OwnerCarPo;
 import com.java110.po.file.FileRelPo;
 import com.java110.po.owner.VisitPo;
@@ -70,6 +74,9 @@ public class SaveVisitCmd extends Cmd {
     @Autowired
     private IVisitSettingV1InnerServiceSMO visitSettingV1InnerServiceSMOImpl;
 
+    @Autowired
+    private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl;
+
 
     //键
     public static final String IS_NEED_REVIEW = "IS_NEED_REVIEW";
@@ -111,20 +118,67 @@ public class SaveVisitCmd extends Cmd {
         photoSMOImpl.savePhoto(reqJson, reqJson.getString("vId"), reqJson.getString("communityId"));
 
         // 是否需要审核
-        if(hasAuditVisit(visitPo,reqJson)){
+        if (hasAuditVisit(visitPo, reqJson)) {
             return; // 需要审核结束,审核时处理 相应 送图片 和车牌数据
         }
 
+        String faceWay = "Y";
+        String carNumWay = "N";
+
+        // 查询访客设置
+        VisitSettingDto visitSettingDto = new VisitSettingDto();
+        visitSettingDto.setCommunityId(reqJson.getString("communityId"));
+        List<VisitSettingDto> visitSettingDtos = visitSettingV1InnerServiceSMOImpl.queryVisitSettings(visitSettingDto);
+
+        if (visitSettingDtos != null && visitSettingDtos.size() > 0) {
+            faceWay = visitSettingDtos.get(0).getFaceWay();
+            carNumWay = visitSettingDtos.get(0).getCarNumWay();
+            // 同步车牌 这里需要停车场,所以没有配置访客设置,不同步
+            synchronizedVisitCarNum(visitPo, carNumWay, visitSettingDtos.get(0));
+        }
+
+        // 同步访客人脸
+        synchronousVisitFace(visitPo, faceWay);
 
+    }
 
+    private void synchronousVisitFace(VisitPo visitPo, String faceWay) {
+        if (VisitSettingDto.FACE_WAY_NO.equals(faceWay)) {
+            return;
+        }
+    }
 
+    /**
+     * 预约车辆 加入 白名单 是最合适的
+     * 不应该加入到业主车辆中
+     * @param visitPo
+     * @param carNumWay
+     * @param visitSettingDto
+     */
+    private void synchronizedVisitCarNum(VisitPo visitPo, String carNumWay, VisitSettingDto visitSettingDto) {
+        if (VisitSettingDto.CAR_NUM_WAY_NO.equals(carNumWay)) {
+            return;
+        }
 
+        CarBlackWhitePo carBlackWhitePo = new CarBlackWhitePo();
+        carBlackWhitePo.setCarNum(visitPo.getCarNum());
+        carBlackWhitePo.setBlackWhite(CarBlackWhiteDto.BLACK_WHITE_WHITE);
+        carBlackWhitePo.setCommunityId(visitPo.getCommunityId());
+        carBlackWhitePo.setPaId(visitSettingDto.getPaId());
+        carBlackWhitePo.setBwId(GenerateCodeFactory.getGeneratorId("11"));
+        carBlackWhitePo.setStartTime(visitPo.getVisitTime());
+        carBlackWhitePo.setEndTime(visitPo.getDepartureTime());
+        int flag = carBlackWhiteV1InnerServiceSMOImpl.saveCarBlackWhite(carBlackWhitePo);
+        if (flag < 1) {
+            throw new CmdException("预约车辆添加白名单失败");
+        }
 
 
     }
 
     /**
      * 是否需要审核
+     *
      * @param visitPo
      * @param reqJson
      */
@@ -135,12 +189,12 @@ public class SaveVisitCmd extends Cmd {
         visitSettingDto.setCommunityId(reqJson.getString("communityId"));
         List<VisitSettingDto> visitSettingDtos = visitSettingV1InnerServiceSMOImpl.queryVisitSettings(visitSettingDto);
 
-        if(visitSettingDtos == null || visitSettingDtos.size()< 1){
+        if (visitSettingDtos == null || visitSettingDtos.size() < 1) {
             return false;
         }
 
         // 需要审核
-        if(VisitSettingDto.AUDIT_WAY_YES.equals(visitSettingDtos.get(0).getAuditWay())){
+        if (VisitSettingDto.AUDIT_WAY_YES.equals(visitSettingDtos.get(0).getAuditWay())) {
             return false;
         }