Bladeren bron

优化代码

Your Name 3 jaren geleden
bovenliggende
commit
8067f46dde

+ 22 - 21
java110-bean/src/main/java/com/java110/dto/accessControlWhiteAuth/AccessControlWhiteAuthDto.java

@@ -1,6 +1,8 @@
-package com.java110.dto.accessControlWhiteAuth;
+package com.java110.dto.accessControlWhite;
 
 import com.java110.dto.PageDto;
+import com.java110.dto.machine.MachineDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -12,15 +14,15 @@ import java.util.Date;
  * @Version 1.0
  * add by wuxw 2019/4/24
  **/
-public class AccessControlWhiteAuthDto extends PageDto implements Serializable {
+public class AccessControlWhiteAuthDto extends MachineDto implements Serializable {
 
     private String machineId;
-private String acwId;
-private String acwaId;
-private String communityId;
+    private String acwId;
+    private String acwaId;
+    private String communityId;
+
 
 
-    private Date createTime;
 
     private String statusCd = "0";
 
@@ -28,36 +30,35 @@ private String communityId;
     public String getMachineId() {
         return machineId;
     }
-public void setMachineId(String machineId) {
+
+    public void setMachineId(String machineId) {
         this.machineId = machineId;
     }
-public String getAcwId() {
+
+    public String getAcwId() {
         return acwId;
     }
-public void setAcwId(String acwId) {
+
+    public void setAcwId(String acwId) {
         this.acwId = acwId;
     }
-public String getAcwaId() {
+
+    public String getAcwaId() {
         return acwaId;
     }
-public void setAcwaId(String acwaId) {
+
+    public void setAcwaId(String acwaId) {
         this.acwaId = acwaId;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
-        this.communityId = communityId;
-    }
 
-
-    public Date getCreateTime() {
-        return createTime;
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
     }
 
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
 
     public String getStatusCd() {
         return statusCd;

+ 10 - 2
java110-bean/src/main/java/com/java110/dto/accessControlWhite/AccessControlWhiteDto.java

@@ -14,7 +14,7 @@ import java.util.Date;
  * @Version 1.0
  * add by wuxw 2019/4/24
  **/
-public class AccessControlWhiteDto extends MachineDto implements Serializable {
+public class AccessControlWhiteDto extends PageDto implements Serializable {
 
     public static final String PERSON_TYPE_VISIT = "4004";
 
@@ -34,7 +34,7 @@ public class AccessControlWhiteDto extends MachineDto implements Serializable {
     private String personType;
     private String personTypeName;
 
-
+    private Date createTime;
     private String statusCd = "0";
     private String personFace;
 
@@ -168,4 +168,12 @@ public class AccessControlWhiteDto extends MachineDto implements Serializable {
     public void setPersonNameLike(String personNameLike) {
         this.personNameLike = personNameLike;
     }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
 }

+ 66 - 68
java110-db/src/main/resources/mapper/common/AccessControlWhiteAuthV1ServiceDaoImplMapper.xml

@@ -5,93 +5,91 @@
 <mapper namespace="accessControlWhiteAuthV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存门禁授权信息 add by wuxw 2018-07-03 -->
     <insert id="saveAccessControlWhiteAuthInfo" parameterType="Map">
         insert into access_control_white_auth(
-machine_id,acw_id,acwa_id,community_id
-) values (
-#{machineId},#{acwId},#{acwaId},#{communityId}
-)
+        machine_id,acw_id,acwa_id,community_id
+        ) values (
+        #{machineId},#{acwId},#{acwaId},#{communityId}
+        )
     </insert>
 
 
-
     <!-- 查询门禁授权信息 add by wuxw 2018-07-03 -->
     <select id="getAccessControlWhiteAuthInfo" parameterType="Map" resultType="Map">
-        select  t.machine_id,t.machine_id machineId,t.acw_id,t.acw_id acwId,t.acwa_id,t.acwa_id acwaId,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId 
-from access_control_white_auth t 
-where 1 =1 
-<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="acwaId !=null and acwaId != ''">
-   and t.acwa_id= #{acwaId}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.machine_id,t.machine_id machineId,t.acw_id,t.acw_id acwId,t.acwa_id,t.acwa_id
+        acwaId,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,
+        t.create_time createTime,m.machine_code machineCode,m.machine_name machineName
+        from access_control_white_auth t
+        left join machine m on t.machine_id = m.machine_id and m.status_cd = '0'
+        where 1 =1
+        <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="acwaId !=null and acwaId != ''">
+            and t.acwa_id= #{acwaId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </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="updateAccessControlWhiteAuthInfo" parameterType="Map">
-        update  access_control_white_auth t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="machineId !=null and machineId != ''">
-, t.machine_id= #{machineId}
-</if> 
-<if test="acwId !=null and acwId != ''">
-, t.acw_id= #{acwId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
- where 1=1 <if test="acwaId !=null and acwaId != ''">
-and t.acwa_id= #{acwaId}
-</if> 
+        update access_control_white_auth t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            , t.machine_id= #{machineId}
+        </if>
+        <if test="acwId !=null and acwId != ''">
+            , t.acw_id= #{acwId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        where 1=1
+        <if test="acwaId !=null and acwaId != ''">
+            and t.acwa_id= #{acwaId}
+        </if>
 
     </update>
 
     <!-- 查询门禁授权数量 add by wuxw 2018-07-03 -->
-     <select id="queryAccessControlWhiteAuthsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from access_control_white_auth t 
-where 1 =1 
-<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="acwaId !=null and acwaId != ''">
-   and t.acwa_id= #{acwaId}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
+    <select id="queryAccessControlWhiteAuthsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from access_control_white_auth t
+        where 1 =1
+        <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="acwaId !=null and acwaId != ''">
+            and t.acwa_id= #{acwaId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 2 - 3
java110-db/src/main/resources/mapper/common/AccessControlWhiteV1ServiceDaoImplMapper.xml

@@ -21,10 +21,9 @@
         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,t.create_time createTime,m.machine_code machineCode,m.machine_name machineName,
-        td.`name` personTypeName
+        communityId,t.person_type,t.person_type personType,td.`name` personTypeName
         from access_control_white t
-        left join machine m on t.machine_id = m.machine_id and m.status_cd = '0'
+
         left join t_dict td on t.person_type = td.status_cd and td.table_name ='access_control_white' and td.table_columns = 'person_type'
         where 1 =1
         <if test="thirdId !=null and thirdId != ''">

+ 1 - 1
java110-interface/src/main/java/com/java110/intf/common/IAccessControlWhiteAuthV1InnerServiceSMO.java

@@ -16,7 +16,7 @@
 package com.java110.intf.common;
 
 import com.java110.config.feign.FeignConfiguration;
-import com.java110.dto.accessControlWhiteAuth.AccessControlWhiteAuthDto;
+import com.java110.dto.accessControlWhite.AccessControlWhiteAuthDto;
 import com.java110.po.accessControlWhiteAuth.AccessControlWhiteAuthPo;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;

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

@@ -22,7 +22,7 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.doc.annotation.*;
-import com.java110.dto.accessControlWhiteAuth.AccessControlWhiteAuthDto;
+import com.java110.dto.accessControlWhite.AccessControlWhiteAuthDto;
 import com.java110.intf.common.IAccessControlWhiteAuthV1InnerServiceSMO;
 import com.java110.intf.common.IAccessControlWhiteV1InnerServiceSMO;
 import com.java110.po.accessControlWhite.AccessControlWhitePo;

+ 1 - 1
service-common/src/main/java/com/java110/common/cmd/machine/ListAccessControlWhiteAuthCmd.java

@@ -25,7 +25,7 @@ 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.accessControlWhiteAuth.AccessControlWhiteAuthDto;
+import com.java110.dto.accessControlWhite.AccessControlWhiteAuthDto;
 
 import java.util.List;
 import java.util.ArrayList;

+ 1 - 3
service-common/src/main/java/com/java110/common/smo/impl/AccessControlWhiteAuthV1InnerServiceSMOImpl.java

@@ -18,17 +18,15 @@ package com.java110.common.smo.impl;
 
 import com.java110.common.dao.IAccessControlWhiteAuthV1ServiceDao;
 import com.java110.intf.common.IAccessControlWhiteAuthV1InnerServiceSMO;
-import com.java110.dto.accessControlWhiteAuth.AccessControlWhiteAuthDto;
+import com.java110.dto.accessControlWhite.AccessControlWhiteAuthDto;
 import com.java110.po.accessControlWhiteAuth.AccessControlWhiteAuthPo;
 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 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;
 
 /**

+ 1 - 1
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/AddAccessControlWhiteToIotAdapt.java

@@ -137,7 +137,7 @@ public class AddAccessControlWhiteToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("name", tmpAccessControlWhiteDto.getPersonName());
         postParameters.put("idNumber", tmpAccessControlWhiteDto.getIdCard());
         postParameters.put("link", tmpAccessControlWhiteDto.getTel());
-        postParameters.put("machineCode", tmpAccessControlWhiteDto.getMachineCode());
+        //postParameters.put("machineCode", tmpAccessControlWhiteDto.getMachineCode());
         postParameters.put("extMachineId", tmpAccessControlWhiteDto.getMachineId());
         postParameters.put("extCommunityId", tmpAccessControlWhiteDto.getCommunityId());
         List<OwnerAttrDto> ownerAttrDtos = new ArrayList<>();

+ 1 - 1
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/DeleteAccessControlWhiteToIotAdapt.java

@@ -87,7 +87,7 @@ public class DeleteAccessControlWhiteToIotAdapt extends DatabusAdaptImpl {
 
         AccessControlWhiteDto tmpAccessControlWhiteDto = accessControlWhiteDtos.get(0);
         JSONObject postParameters = new JSONObject();
-        postParameters.put("machineCode", tmpAccessControlWhiteDto.getMachineCode());
+        //postParameters.put("machineCode", tmpAccessControlWhiteDto.getMachineCode());
         postParameters.put("userId", tmpAccessControlWhiteDto.getPersonId());
         postParameters.put("name", tmpAccessControlWhiteDto.getPersonName());
         postParameters.put("extMachineId", tmpAccessControlWhiteDto.getMachineId());

+ 1 - 1
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/EditAccessControlWhiteToIotAdapt.java

@@ -129,7 +129,7 @@ public class EditAccessControlWhiteToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("name", tmpAccessControlWhiteDto.getPersonName());
         postParameters.put("idNumber", tmpAccessControlWhiteDto.getIdCard());
         postParameters.put("link", tmpAccessControlWhiteDto.getTel());
-        postParameters.put("machineCode", tmpAccessControlWhiteDto.getMachineCode());
+       // postParameters.put("machineCode", tmpAccessControlWhiteDto.getMachineCode());
         postParameters.put("extMachineId", tmpAccessControlWhiteDto.getMachineId());
         postParameters.put("extCommunityId", tmpAccessControlWhiteDto.getCommunityId());
         List<OwnerAttrDto> ownerAttrDtos = new ArrayList<>();