职务分类左侧树接口
This commit is contained in:
parent
f576df3495
commit
6f24a67ff0
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.organization.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/13
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TreeData {
|
||||
private String title;
|
||||
private String key;
|
||||
private ArrayList<TreeData> children;
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
package com.engine.organization.mapper.post;
|
||||
|
||||
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.post.po.PostPO;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -43,6 +45,12 @@ public interface PostMapper {
|
|||
@MapKey("id")
|
||||
List<Map<String, Object>> listPostsByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取左侧树
|
||||
* @return
|
||||
*/
|
||||
ArrayList<TreeData> getTreeData();
|
||||
|
||||
/**
|
||||
* 插入职务分类
|
||||
*
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@
|
|||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="TreeResultMap" type="com.engine.organization.entity.TreeData">
|
||||
<result column="id" property="key"/>
|
||||
<result column="post_name" property="title"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
|
|
@ -52,6 +57,10 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getTreeData" resultMap="TreeResultMap">
|
||||
select id , post_name from jcl_org_post where delete_type ='0'
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="com.engine.organization.entity.post.po.PostPO">
|
||||
update jcl_org_post
|
||||
<set>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.post.po.PostPO;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -44,4 +45,11 @@ public interface PostService {
|
|||
Map<String, Object> getPostForm(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 获取左侧树
|
||||
* @return
|
||||
*/
|
||||
TreeData getTreeData();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.service.impl;
|
|||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.post.dto.PostDTO;
|
||||
import com.engine.organization.entity.post.po.PostPO;
|
||||
import com.engine.organization.mapper.post.PostMapper;
|
||||
|
|
@ -75,4 +76,10 @@ public class PostServiceImpl extends Service implements PostService {
|
|||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeData getTreeData() {
|
||||
ArrayList<TreeData> treeDataList = getPostMapper().getTreeData();
|
||||
return TreeData.builder().children(treeDataList).title("全部类型").key("").build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,4 +114,22 @@ public class PostController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取左侧树
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getTreeData")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getTreeData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getPostWrapper(user).getTreeData());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.organization.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.post.po.PostPO;
|
||||
import com.engine.organization.service.PostService;
|
||||
import com.engine.organization.service.impl.PostServiceImpl;
|
||||
|
|
@ -61,4 +62,12 @@ public class PostWrapper extends Service {
|
|||
return getPostService(user).getPostForm(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取左侧树
|
||||
* @return
|
||||
*/
|
||||
public TreeData getTreeData() {
|
||||
return getPostService(user).getTreeData();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue