Explorar o código

报销类型部分代码提交

user5 %!s(int64=2) %!d(string=hai) anos
pai
achega
c6736a114c
Modificáronse 14 ficheiros con 208 adicións e 65 borrados
  1. 1 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/controller/CwReimbursementTypeController.java
  2. 8 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/domain/CwReimbursementTypeInfo.java
  3. 34 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/CwReimbursementTypeMapper.java
  4. 98 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/xml/CwReimbursementTypeMapper.xml
  5. 4 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeForTreeDataService.java
  6. 31 14
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeService.java
  7. 0 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/domain/ZsReimbursementTypeInfo.java
  8. 0 7
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/ZsReimbursementTypeMapper.java
  9. 1 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/xml/ZsReimbursementTypeMapper.xml
  10. 0 13
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/service/ZsReimbursementTypeService.java
  11. 8 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java
  12. 6 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java
  13. 9 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml
  14. 8 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/controller/CwReimbursementTypeController.java

@@ -86,7 +86,7 @@ public class CwReimbursementTypeController {
     @ApiOperation(value = "根据id查询")
     @GetMapping("/findById")
     public ResponseEntity<CwReimbursementTypeInfo> findById(String id) {
-        CwReimbursementTypeInfo info = mapper.selectById(id);
+        CwReimbursementTypeInfo info = service.getById(id);
         return ResponseEntity.ok(info);
     }
 

+ 8 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/domain/CwReimbursementTypeInfo.java

@@ -3,9 +3,11 @@ package com.jeeplus.test.cw.reimbursementApproval.approvalType.domain;
 import com.baomidou.mybatisplus.annotation.*;
 import com.jeeplus.core.domain.TreeEntity;
 import com.jeeplus.core.query.Query;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 报销类型信息列表
@@ -83,11 +85,13 @@ public class CwReimbursementTypeInfo extends TreeEntity<CwReimbursementTypeInfo>
     @TableField(exist = false)
     private Boolean disabled = false;
 
+    @TableField(exist = false)
+    private String like;
+
     /**
-     * 业务类型
+     * 关联的officeIdList
      */
-    private String businessType;
+    private List<String> officeIdList;
 
-    @TableField(exist = false)
-    private String like;
+    private List<OfficeDTO> officeDTOList;
 }

+ 34 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/CwReimbursementTypeMapper.java

@@ -1,7 +1,14 @@
 package com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.core.domain.TreeMapper;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo;
 import org.apache.ibatis.annotations.Param;
 
@@ -14,6 +21,19 @@ import java.util.List;
 public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTypeInfo>, TreeMapper<CwReimbursementTypeInfo> {
 
     /**
+     * 查询数据集合
+     * @param queryWrapper
+     * @return
+     */
+    List<CwReimbursementTypeInfo> findList(@Param(Constants.WRAPPER) Wrapper<CwReimbursementTypeInfo> queryWrapper);
+
+    /**
+     * 根据id查询详情信息
+     * @param id
+     * @return
+     */
+    CwReimbursementTypeInfo getById(String id);
+    /**
      * 根据name和parentId查询名称是否重复
      * @param name
      * @param parentId
@@ -25,19 +45,24 @@ public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTyp
 
     Integer getLevel(@Param("parentId") String parentId);
 
-    /**
-     * 修改子级业务类型
-     * @param id
-     * @param businessType
-     */
-    void updateChildBusType(@Param("id") String id, @Param("businessType") String businessType);
-
     List<String> getChildId(String id);
 
     /**
      * 获取所有业务类型的数据
-     * @param type
      * @return
      */
-    List<CwReimbursementTypeInfo> getAllList(String type);
+    List<CwReimbursementTypeInfo> getAllList();
+
+    /**
+     * 删除报销类型关联表对应信息
+     * @param id
+     */
+    void deleteReimbursementTypeOfficeInfo(String id);
+
+    /**
+     * 新增报销类型和部门关联信息
+     * @param id
+     * @param OfficeIdList
+     */
+    void saveReimbursementTypeOfficeInfo(@Param("id") String id , @Param("officeIdList") List<String> OfficeIdList);
 }

+ 98 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/xml/CwReimbursementTypeMapper.xml

@@ -1,9 +1,93 @@
 <?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="com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper">
-	<update id="updateChildBusType">
-		update cw_reimbursement_type_info set business_type = #{businessType} where parent_id = #{id}
-	</update>
+	<resultMap id="BaseResultMap" type="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
+		<id property="id" column="id" jdbcType="VARCHAR"/>
+		<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+		<result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+		<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+		<result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+		<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+
+		<result property="level" column="level" jdbcType="VARCHAR"/>
+		<result property="name" column="name" jdbcType="VARCHAR"/>
+		<result property="sort" column="sort" jdbcType="VARCHAR"/>
+		<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+		<result property="parentIds" column="parent_ids" jdbcType="VARCHAR"/>
+		<collection property="officeDTOList" ofType="com.jeeplus.sys.service.dto.OfficeDTO" column="id" select="getOfficeClient"></collection>
+
+	</resultMap>
+
+
+	<sql id="Base_Column_List">
+        a.id,
+        a.create_by,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.level,
+		a.name,
+		a.sort,
+		a.parent_id,
+		a.parent_ids
+    </sql>
+
+	<sql id="officeColumns">
+    	so.id as "id",
+        so.parent_id as "parent.id",
+        so.parent_ids as "parentIds",
+        so.name as "name",
+        so.sort as "sort",
+        so.area_id as "areaId",
+        so.code as "code",
+        so.type as "type",
+        so.grade as "grade",
+        so.address as "address",
+        so.zip_code as "zipCode",
+        so.master as "master",
+        so.phone as "phone",
+        so.fax as "fax",
+        so.email as "email",
+        so.useable as "useable",
+        so.primary_person as "primaryPerson",
+        so.deputy_person as "deputyPerson",
+		so.create_by as "createBy.id",
+		so.create_date as "createDate",
+		so.update_by as "updateBy.id",
+		so.update_date as "updateDate",
+        so.remarks as "remarks",
+        so.del_flag as "delFlag",
+        so.is_public as "isPublic",
+        so.administrator as "administrator"
+    </sql>
+
+	<select id="getOfficeClient" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+		select
+		<include refid="officeColumns"></include>
+		from sys_office so
+		left join cw_reimbursement_type_office_info rtoi on rtoi.office_id = so.id and so.del_flag = '0'
+		where rtoi.reimbursement_type_id = #{id}
+	</select>
+
+
+	<select id="findList" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List"></include>
+		from cw_reimbursement_type_info a
+		${ew.customSqlSegment}
+	</select>
+
+
+	<select id="getById" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List"></include>
+		from cw_reimbursement_type_info a
+		<where>
+			a.del_flag = 0 and a.id = #{id}
+		</where>
+	</select>
+
 	<select id="checkNameIsExist" resultType="java.lang.Integer">
         SELECT
 			COUNT( 0 )
@@ -37,6 +121,16 @@
 	</select>
 	<select id="getAllList"
 			resultType="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
-		select * from cw_reimbursement_type_info where business_type = #{type} and del_flag = '0' order by sort asc
+		select * from cw_reimbursement_type_info where  del_flag = '0' order by sort asc
 	</select>
+
+	<delete id="deleteReimbursementTypeOfficeInfo">
+		delete from cw_reimbursement_type_office_info where reimbursement_type_id = #{id}
+	</delete>
+
+	<insert id="saveReimbursementTypeOfficeInfo">
+		<foreach collection="officeIdList" item="officeId" separator=";">
+			insert into cw_reimbursement_type_office_info(reimbursement_type_id,office_id) values(#{id},#{officeId})
+		</foreach>
+	</insert>
 </mapper>

+ 4 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeForTreeDataService.java

@@ -35,7 +35,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
     public List<CwReimbursementTypeInfo> treeDataForType(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
 //        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("1");
-        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        List<CwReimbursementTypeInfo> allList = typeMapper.findList (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );
         List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
@@ -51,7 +51,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      */
     public List<CwReimbursementTypeInfo> treeDataForType1(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
-        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("1");
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
 //        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );
@@ -68,7 +68,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      */
     public List<CwReimbursementTypeInfo> summaryTreeData(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
-        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("2");
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );
         List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
@@ -84,7 +84,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      */
     public List<CwReimbursementTypeInfo> treeDataForType2(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
-        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("2");
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
 //        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );

+ 31 - 14
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeService.java

@@ -3,11 +3,16 @@ package com.jeeplus.test.cw.reimbursementApproval.approvalType.service;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo;
 import com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper;
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientContact;
+import org.apache.commons.compress.utils.Lists;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -37,7 +42,25 @@ public class CwReimbursementTypeService {
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
-        return mapper.selectList(wrapper);
+        return mapper.findList(wrapper);
+    }
+
+
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    public CwReimbursementTypeInfo getById(String id) {
+        CwReimbursementTypeInfo info = mapper.getById(id);
+        if(null != info.getOfficeDTOList() && info.getOfficeDTOList().size()>0){
+            List<String> officeIdList = Lists.newArrayList();
+            for (OfficeDTO office : info.getOfficeDTOList()) {
+                officeIdList.add(office.getId());
+            }
+            info.setOfficeIdList(officeIdList);
+        }
+        return info;
     }
 
     public List<CwReimbursementTypeInfo> bxList(CwReimbursementTypeInfo info) {
@@ -53,7 +76,6 @@ public class CwReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "1");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
@@ -68,7 +90,6 @@ public class CwReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "2");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
@@ -124,18 +145,14 @@ public class CwReimbursementTypeService {
         UserDTO userDto = UserUtils.getCurrentUserDTO();
         info.setUpdateBy(userDto.getId());
         info.setUpdateDate(new Date());
-        //父级
-        if (info.getParentId().equals("0")){
-            //修改所有子集的业务类型
-            List<String> childId = mapper.getChildId(info.getId());
-            childId.forEach(chidId->{
-                //修改子级的子级
-                mapper.updateChildBusType(chidId,info.getBusinessType());
-            });
-            //修改子级
-            mapper.updateChildBusType(info.getId(),info.getBusinessType());
+        //对关联的公司id进行处理
+        if (null != info.getOfficeIdList() && info.getOfficeIdList().size()>0) {
+            //首先删除原有关联信息
+            mapper.deleteReimbursementTypeOfficeInfo(info.getId());
+            //将新的关联信息进行保存
+            mapper.saveReimbursementTypeOfficeInfo(info.getId(),info.getOfficeIdList());
+            info.setOfficeIdList(null);
         }
-
         mapper.updateById(info);
         return "操作完成";
     }

+ 0 - 5
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/domain/ZsReimbursementTypeInfo.java

@@ -83,11 +83,6 @@ public class ZsReimbursementTypeInfo extends TreeEntity<ZsReimbursementTypeInfo>
     @TableField(exist = false)
     private Boolean disabled = false;
 
-    /**
-     * 业务类型
-     */
-    private String businessType;
-
     @TableField(exist = false)
     private String like;
 }

+ 0 - 7
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/ZsReimbursementTypeMapper.java

@@ -26,13 +26,6 @@ public interface ZsReimbursementTypeMapper extends BaseMapper<ZsReimbursementTyp
 
     Integer getLevel(@Param("parentId") String parentId);
 
-    /**
-     * 修改子级业务类型
-     * @param id
-     * @param businessType
-     */
-    void updateChildBusType(@Param("id") String id, @Param("businessType") String businessType);
-
     List<String> getChildId(String id);
 
     /**

+ 1 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/xml/ZsReimbursementTypeMapper.xml

@@ -1,9 +1,6 @@
 <?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="com.jeeplus.test.zs.zsReimbursement.approvalType.mapper.ZsReimbursementTypeMapper">
-	<update id="updateChildBusType">
-		update cw_reimbursement_type_info set business_type = #{businessType} where parent_id = #{id}
-	</update>
 	<select id="checkNameIsExist" resultType="java.lang.Integer">
         SELECT
 			COUNT( 0 )
@@ -37,6 +34,6 @@
 	</select>
 	<select id="getAllList"
 			resultType="com.jeeplus.test.zs.zsReimbursement.approvalType.domain.ZsReimbursementTypeInfo">
-		select * from cw_reimbursement_type_info where business_type = #{type} and del_flag = '0' order by sort asc
+		select * from cw_reimbursement_type_info where del_flag = '0' order by sort asc
 	</select>
 </mapper>

+ 0 - 13
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/service/ZsReimbursementTypeService.java

@@ -53,7 +53,6 @@ public class ZsReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(ZsReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(ZsReimbursementTypeInfo::getBusinessType, "1");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(ZsReimbursementTypeInfo::getSort);
@@ -68,7 +67,6 @@ public class ZsReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(ZsReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(ZsReimbursementTypeInfo::getBusinessType, "2");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(ZsReimbursementTypeInfo::getSort);
@@ -124,17 +122,6 @@ public class ZsReimbursementTypeService {
         UserDTO userDto = UserUtils.getCurrentUserDTO();
         info.setUpdateBy(userDto.getId());
         info.setUpdateDate(new Date());
-        //父级
-        if (info.getParentId().equals("0")){
-            //修改所有子集的业务类型
-            List<String> childId = mapper.getChildId(info.getId());
-            childId.forEach(chidId->{
-                //修改子级的子级
-                mapper.updateChildBusType(chidId,info.getBusinessType());
-            });
-            //修改子级
-            mapper.updateChildBusType(info.getId(),info.getBusinessType());
-        }
 
         mapper.updateById(info);
         return "操作完成";

+ 8 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java

@@ -132,5 +132,13 @@ public class OfficeController {
         return ResponseEntity.ok (result);
     }
 
+    @ApiLog("获取二级节点数据信息")
+
+    @GetMapping("getSecondLevelData")
+    public ResponseEntity getSecondLevelData() {
+        List<OfficeDTO> list = officeService.getSecondLevelData ();
+        return ResponseEntity.ok (list);
+    }
+
 
 }

+ 6 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java

@@ -51,4 +51,10 @@ public interface OfficeMapper extends TreeMapper<Office> {
 
     List<String> getOfficeIdByNames(List<String> nameList);
 
+    /**
+     * 获取二级节点数据信息
+     * @return
+     */
+    List<OfficeDTO> getSecondLevelData();
+
 }

+ 9 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml

@@ -130,4 +130,13 @@
             </foreach>
         </where>
     </select>
+
+    <select id="getSecondLevelData" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+        select
+        <include refid="officeColumns"/>
+        from sys_office a
+        <where>
+            a.parent_id in (select id from sys_office where parent_id = 0)
+        </where>
+    </select>
 </mapper>

+ 8 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -375,4 +375,12 @@ public class OfficeService extends TreeService<OfficeMapper, Office> {
        return officeMapper.getOfficeIdByNames(nameList);
     }
 
+    /**
+     * 获取二级节点数据信息
+     * @return
+     */
+    public List<OfficeDTO> getSecondLevelData(){
+        return officeMapper.getSecondLevelData();
+    }
+
 }