Explorar o código

Merge remote-tracking branch 'origin/V0.0.8' into V0.0.8

jingyuanchao hai 1 ano
pai
achega
83fe704083

+ 9 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -29,6 +29,7 @@ import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.domain.SysUser;
 import com.xunmei.system.api.vo.FindOrgTypes;
 import com.xunmei.system.api.vo.SysOrgVO;
+import com.xunmei.system.dto.SysOrgDto;
 import com.xunmei.system.service.ISysDeptService;
 import com.xunmei.system.service.ISysOrgService;
 import com.xunmei.system.service.ISysUserService;
@@ -497,4 +498,12 @@ public class SysDeptController extends BaseController {
     SysOrg findByCode(@PathVariable("guid") String guid){
         return orgService.findByCode(guid);
     }
+
+
+    @ApiOperation(value = "根据查询条件获取机构列表")
+    @PostMapping("/selectOrgList")
+    public List<SysOrg> selectOrgList(@RequestBody SysOrgDto org){
+        List<SysOrg> sysOrgs = orgService.selectOrgList(org);
+        return sysOrgs;
+    }
 }

+ 41 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/dto/SysOrgDto.java

@@ -0,0 +1,41 @@
+package com.xunmei.system.dto;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @description:
+ * 机构查询实体
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class SysOrgDto {
+
+    /**
+     * 机构id
+     */
+    private Long orgId;
+
+    /**
+     * 机构名称
+     */
+    private String orgName;
+
+    /**
+     * 机构类型
+     */
+    private String orgType;
+
+    /**
+     * 机构路径
+     */
+    private String orgPath;
+
+    /**
+     * 是否下穿查询
+     */
+    private Boolean checkSub=Boolean.FALSE;
+}

+ 9 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysOrgMapper.java

@@ -6,6 +6,7 @@ import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.vo.FindOrgTypes;
 import com.xunmei.system.api.vo.SysOrgVO;
+import com.xunmei.system.dto.SysOrgDto;
 import com.xunmei.system.util.ConstructionDetailExport;
 import com.xunmei.system.util.OrgPhysicalDefenseConstructionExport;
 import org.apache.ibatis.annotations.Param;
@@ -187,4 +188,12 @@ public interface SysOrgMapper extends BaseMapper<SysOrg> {
     Integer oldRectificationStatus(@Param("orgPath") String orgPath, @Param("year") String year);
 
     Integer noRectificationStatus(@Param("orgPath") String orgPath, @Param("year") String year);
+
+
+    /**
+     * 根据查询条件获取机构数据
+     * @param org
+     * @return
+     */
+    List<SysOrg> selectOrgs(@Param("org") SysOrgDto org);
 }

+ 8 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysOrgService.java

@@ -7,6 +7,7 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.vo.FindOrgTypes;
 import com.xunmei.system.api.vo.SysOrgVO;
+import com.xunmei.system.dto.SysOrgDto;
 import com.xunmei.system.util.ConstructionDetailExport;
 import com.xunmei.system.util.OrgPhysicalDefenseConstructionExport;
 import com.xunmei.system.util.SecurityWorkExport;
@@ -175,4 +176,11 @@ public interface ISysOrgService extends IService<SysOrg> {
     List<SysOrg> selectDqAndHs();
 
     SysOrg findByCode(String guid);
+
+    /**
+     * 根据特定的查询条件获取机构数据
+     * @param org
+     * @return
+     */
+    List<SysOrg> selectOrgList(SysOrgDto org);
 }

+ 13 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -28,6 +28,7 @@ import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.vo.FindOrgTypes;
 import com.xunmei.system.api.vo.SysOrgVO;
+import com.xunmei.system.dto.SysOrgDto;
 import com.xunmei.system.mapper.SysOrgMapper;
 import com.xunmei.system.mapper.SysUserMapper;
 import com.xunmei.system.service.ISysOrgService;
@@ -1086,4 +1087,16 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     public SysOrg findByCode(String guid) {
         return lambdaQuery().eq(SysOrg::getCode, guid).last(Constants.LIMIT1).one();
     }
+
+    @Override
+    public List<SysOrg> selectOrgList(SysOrgDto org) {
+        if(ObjectUtil.isNotEmpty(org.getOrgId())){
+            SysOrg sysOrg = getById(org.getOrgId());
+
+            if(org.getCheckSub()){
+                org.setOrgPath(sysOrg.getPath());
+            }
+        }
+        return null;
+    }
 }

+ 69 - 12
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -806,6 +806,7 @@ and
                                     ( LOCATE( 3, GROUP_CONCAT( standard ))> 0, 1, 0 ))= 2
                    AND date_of_compliance LIKE concat(#{year}, '%')
             ) AND b.path LIKE concat(#{orgPath}, '%')
+
     </select>
     <select id="selectConstructionDetail" resultType="com.xunmei.system.util.ConstructionDetailExport">
         SELECT
@@ -847,6 +848,7 @@ and
                                     LEFT JOIN sys_org b on a.org_id = b.id
         where 1=1
           AND b.deleted = 0
+          and b.is_lock = 0
           AND b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getOwnership" resultType="java.lang.Integer">
@@ -855,7 +857,7 @@ and
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
-        WHERE b.type=4 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')
+        WHERE b.type=4 and b.deleted = 0 and b.is_lock = 0 and b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getOutside" resultType="java.lang.Integer">
         SELECT
@@ -864,7 +866,10 @@ and
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
                 where
-            b.path LIKE concat(#{orgPath}, '%')
+                1=1
+                and b.path LIKE concat(#{orgPath}, '%')
+                and b.is_lock = 0
+                and b.deleted = 0
     </select>
     <select id="getLibrary" resultType="java.util.Map">
         SELECT
@@ -877,7 +882,10 @@ and
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
         where
-            b.path LIKE concat(#{orgPath}, '%')
+        1=1
+        and    b.path LIKE concat(#{orgPath}, '%')
+        and b.is_lock = 0
+        and b.deleted = 0
     </select>
     <select id="getCollectLibrary" resultType="java.lang.Integer">
         SELECT
@@ -888,7 +896,10 @@ and
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
         WHERE
-              b.path LIKE concat(#{orgPath}, '%')
+          1=1
+        and    b.path LIKE concat(#{orgPath}, '%')
+        and b.is_lock = 0
+        and b.deleted = 0
     </select>
     <select id="getOnLine" resultType="java.util.Map">
 
@@ -900,12 +911,16 @@ and
                     sys_org a
                         LEFT JOIN sys_org_extend b ON a.id = b.org_id
                 WHERE
-                    a.path LIKE concat( #{orgPath}, '%' )) AS onLineTotal,
+                    1=1
+                    AND a.deleted = 0
+                    and a.is_lock = 0
+                    and a.path LIKE concat( #{orgPath}, '%' )) AS onLineTotal,
             (
                 select SUM(a.size) from (select org_id,if(count(1) > 0,1,0) as size from  sys_org_physical_defense_construction where standard =1 and type = 2 GROUP BY org_id) a
                                             LEFT JOIN sys_org b on a.org_id = b.id
                 where 1=1
                   AND b.deleted = 0
+                  and b.is_lock = 0
                   AND b.path LIKE concat(#{orgPath}, '%' )) AS onLineReachNumber
         FROM
             DUAL
@@ -921,6 +936,7 @@ and
                 WHERE
                     type = 5
                   AND deleted = 0
+                  AND is_lock = 0
                   AND path LIKE concat( #{orgPath}, '%' )) AS departureTotal,
             (
               select SUM(a.size) from (select org_id,if(count(1) > 0,1,0) as size from
@@ -928,6 +944,7 @@ and
                   LEFT JOIN sys_org b on a.org_id = b.id
                   where 1=1
                   AND b.deleted = 0
+                  and b.is_lock = 0
                   AND b.path LIKE concat(#{orgPath}, '%' )) AS departureReachNumber
         FROM
             DUAL
@@ -942,10 +959,10 @@ and
         from (
 
                  select
-                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.path LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
-                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.path LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
-                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls,
-                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement
+                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path  LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
+                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
+                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls,
+                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement
                  from dual
              ) t
     </select>
@@ -958,7 +975,7 @@ and
             IFNULL( b.hd_camera_count, 0 ) AS hdCameraCount,
             IFNULL( b.total_camera_count, 0 ) AS totalCameraCount
         FROM
-            ( SELECT id FROM sys_org WHERE type = 10 AND path LIKE concat( #{orgPath}, '%' ) ORDER BY create_time DESC LIMIT 0, 1 ) a
+            ( SELECT id FROM sys_org WHERE type = 10 and is_lock = 0 and deleted = 0 AND path LIKE concat( #{orgPath}, '%' ) ORDER BY create_time DESC LIMIT 0, 1 ) a
                 LEFT JOIN sys_org_extend b ON a.id = b.org_id
     </select>
     <select id="getCamera" resultType="java.util.Map">
@@ -972,6 +989,7 @@ and
             a.del_flag = 0
           AND a.device_type = 2
           AND b.deleted = 0
+          and b.is_lock = 0
           AND b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getRemote" resultType="java.util.Map">
@@ -986,6 +1004,7 @@ and
           and b.type != 10
           and a.remote_control = 1
           and b.deleted = 0
+          and b.is_lock = 0
           and b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getDuty" resultType="java.util.Map">
@@ -998,6 +1017,7 @@ and
         WHERE
             1=1
           and b.deleted = 0
+          and b.is_lock = 0
           and b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getCertificate" resultType="java.util.Map">
@@ -1018,12 +1038,16 @@ and
                   AND b.certificate_work = '1'
                   AND a.is_manage = 'Y'
                   AND c.deleted = 0
+                  and c.is_lock = 0
                   AND c.path LIKE concat(#{orgPath}, '%')) AS certificatePeopleNumber
         FROM
             sys_org_extend a
                 LEFT JOIN sys_org b ON a.org_id = b.id
         WHERE
-            b.path LIKE concat(#{orgPath}, '%')
+            1=1
+            AND b.deleted = 0
+            and b.is_lock = 0
+            and b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getSafe" resultType="java.lang.Integer">
         SELECT
@@ -1034,6 +1058,8 @@ and
                 LEFT JOIN core_safecheck_plan c ON a.plan_id = c.id
         WHERE
             a.deleted = 0
+          AND b.deleted = 0
+          and b.is_lock = 0
           AND c.check_type =3
 and a.org_path LIKE concat(#{orgPath}, '%')
  AND a.ymd_date BETWEEN #{startTime} and #{endTime}
@@ -1108,7 +1134,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
             sys_user_information a
                 LEFT JOIN sys_user b ON a.user_id = b.id
                 LEFT JOIN sys_org c ON b.org_id = c.id
-        WHERE c.deleted = 0 and  a.alone_dept='Y' and b.is_manage = 'Y' AND c.path LIKE concat(#{orgPath}, '%')
+        WHERE c.deleted = 0 and c.is_lock = 0 and  a.alone_dept='Y' and b.is_manage = 'Y' AND c.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getManager" resultType="java.lang.Integer">
         SELECT
@@ -1120,6 +1146,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         WHERE
             1 = 1
           AND c.deleted = 0
+          and c.is_lock = 0
           AND a.is_full_time = #{isFull}
           AND a.duties in ('1','2','3')
           AND b.is_manage = 'Y'
@@ -1135,6 +1162,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         WHERE
             1 = 1
           AND c.deleted = 0
+          and c.is_lock = 0
           AND a.certificate_work = 1
           AND a.duties in ('1','2','3')
           AND b.is_manage = 'Y'
@@ -1151,6 +1179,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         WHERE
             a.duties = #{duties}
           and c.deleted = 0
+          and c.is_lock = 0
           AND b.is_manage = 'Y'
           AND c.path LIKE concat(#{orgPath}, '%')
     </select>
@@ -1166,6 +1195,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         WHERE
             a.duties IN ( 2, 4, 5 )
           AND c.deleted = 0
+          and c.is_lock = 0
           AND b.is_manage = 'Y'
           AND c.path LIKE concat(#{orgPath}, '%')
     </select>
@@ -1178,6 +1208,8 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         WHERE
             a.type = #{type}
           AND a.sign_level = #{level}
+          AND b.deleted = 0
+          and b.is_lock = 0
           AND b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getJointHeadToNetwork" resultType="java.lang.Integer">
@@ -1196,6 +1228,8 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         LEFT JOIN sys_org_extend b  on a.id = b.org_id
         WHERE 1=1
           and (b.inner_count > 0 or b.outside_count > 0)
+          and a.deleted = 0
+          and a.is_lock = 0
           and a.path LIKE concat( #{orgPath}, '%' )
     </select>
     <select id="getHeadSafeCheckNumber" resultType="java.lang.Integer">
@@ -1217,6 +1251,8 @@ and a.org_path LIKE concat(#{orgPath}, '%')
                 LEFT JOIN sys_org c ON c.id = a.org_id
         WHERE
             b.check_type = 1
+            AND c.deleted = 0
+            and c.is_lock = 0
 --           AND c.type = 4
           AND a.org_path LIKE concat(#{orgPath}, '%')
     </select>
@@ -1259,5 +1295,26 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         sort
     </select>
 
+    <select id="selectOrgs">
+        SELECT
+        *
+        FROM
+        sys_org
+        WHERE 1=1
+        AND is_lock=0
+        AND deleted = 0
+        <if test="org.orgPath != null">
+            AND path LIKE concat(#{org.orgPath}, '%')
+        </if>
+        <if test="org.orgType != null">
+            AND type = #{org.orgType}
+        </if>
+        <if test="org.orgName != null">
+            AND short_name LIKE concat('%',#{org.orgName}, '%')
+        </if>
+        ORDER BY
+        affiliated_area,affiliated_bank,sort
+    </select>
+
 
 </mapper>