Commit 906de071 by huangZW

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0.git into developer

parents ab5f9f22 daa06492
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class DepartmentShortDTO implements Serializable {
private String departmentId;
private String departmentName;
private String parentDepartmentId;
private String wxDepartmentId;
private Integer level;
private Long sort;
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getParentDepartmentId() {
return parentDepartmentId;
}
public void setParentDepartmentId(String parentDepartmentId) {
this.parentDepartmentId = parentDepartmentId;
}
public String getWxDepartmentId() {
return wxDepartmentId;
}
public void setWxDepartmentId(String wxDepartmentId) {
this.wxDepartmentId = wxDepartmentId;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Long getSort() {
return sort;
}
public void setSort(Long sort) {
this.sort = sort;
}
}
...@@ -6,6 +6,7 @@ import com.gic.api.base.commons.Page; ...@@ -6,6 +6,7 @@ import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
public interface DepartmentApiService { public interface DepartmentApiService {
...@@ -174,4 +175,19 @@ public interface DepartmentApiService { ...@@ -174,4 +175,19 @@ public interface DepartmentApiService {
List<DepartmentDTO> listSonByDepartmentIds(List<String> departmentIdSet, String wxEnterpriseId); List<DepartmentDTO> listSonByDepartmentIds(List<String> departmentIdSet, String wxEnterpriseId);
/**
* 搜索
* @param search
* @param wxEnterpriseId
* @return
*/
List<DepartmentDTO> searchDepartment(String search, String wxEnterpriseId);
/**
* 获取所有部门
* @param wxEnterpriseId
* @return
*/
List<DepartmentShortDTO> listAllDepartment(String wxEnterpriseId);
} }
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.dao.mapper; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.dao.mapper;
import java.util.List; import java.util.List;
import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.xpath.operations.Bool; import org.apache.xpath.operations.Bool;
...@@ -71,4 +72,13 @@ public interface DepartmentMapper { ...@@ -71,4 +72,13 @@ public interface DepartmentMapper {
public int cleanDepartment(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("dIds") List<String> wxDeIds); public int cleanDepartment(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("dIds") List<String> wxDeIds);
public List<TabHaobanDepartment> listDepartmentByWxDepartIds(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("dIds") List<String> wxDeIds); public List<TabHaobanDepartment> listDepartmentByWxDepartIds(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("dIds") List<String> wxDeIds);
/**
* 查询所有部门
* @param wxEnterpriseId
* @return
*/
public List<TabHaobanDepartment> listAllDepartment(String wxEnterpriseId);
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service; ...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service;
import java.util.List; import java.util.List;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
...@@ -72,4 +73,18 @@ public interface DepartmentService { ...@@ -72,4 +73,18 @@ public interface DepartmentService {
*/ */
List<DepartmentDTO> listDepartmentByWxDepartIds(String wxEnterpriseId,List<String> wxDepartmentList); List<DepartmentDTO> listDepartmentByWxDepartIds(String wxEnterpriseId,List<String> wxDepartmentList);
/**
* 搜索 返回10条
* @param search
* @param wxEnterpriseId
* @return
*/
List<DepartmentDTO> searchDepartment(String search,String wxEnterpriseId);
/**
* 获取搜友部门
* @param wxEnterpriseId
* @return
*/
List<DepartmentShortDTO> listAllDepartment(String wxEnterpriseId);
} }
...@@ -4,6 +4,7 @@ import java.util.Date; ...@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.gic.haoban.base.api.common.Constant; import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -206,4 +207,14 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -206,4 +207,14 @@ public class DepartmentServiceImpl implements DepartmentService {
public List<DepartmentDTO> listDepartmentByWxDepartIds(String wxEnterpriseId, List<String> wxDepartmentList) { public List<DepartmentDTO> listDepartmentByWxDepartIds(String wxEnterpriseId, List<String> wxDepartmentList) {
return EntityUtil.changeEntityListByJSON(DepartmentDTO.class, mapper.listDepartmentByWxDepartIds(wxEnterpriseId,wxDepartmentList)); return EntityUtil.changeEntityListByJSON(DepartmentDTO.class, mapper.listDepartmentByWxDepartIds(wxEnterpriseId,wxDepartmentList));
} }
@Override
public List<DepartmentDTO> searchDepartment(String search, String wxEnterpriseId) {
return null;
}
@Override
public List<DepartmentShortDTO> listAllDepartment(String wxEnterpriseId) {
return EntityUtil.changeEntityListByJSON(DepartmentShortDTO.class, mapper.listAllDepartment(wxEnterpriseId));
}
} }
...@@ -13,6 +13,7 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -13,6 +13,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.gic.haoban.base.api.common.Constant; import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
...@@ -787,5 +788,15 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -787,5 +788,15 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
} }
return list; return list;
} }
@Override
public List<DepartmentDTO> searchDepartment(String search, String wxEnterpriseId) {
return null;
}
@Override
public List<DepartmentShortDTO> listAllDepartment(String wxEnterpriseId) {
List<DepartmentShortDTO> list = departmentService.listAllDepartment(wxEnterpriseId);
return list;
}
} }
...@@ -22,11 +22,17 @@ ...@@ -22,11 +22,17 @@
<result column="level" property="level" jdbcType="INTEGER" /> <result column="level" property="level" jdbcType="INTEGER" />
<result column="temp_flag" property="tempFlag" jdbcType="INTEGER"/> <result column="temp_flag" property="tempFlag" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
department_id, department_name, parent_department_id, related_id, related_code,chain_id, is_store, department_id, department_name, parent_department_id, related_id, related_code,chain_id, is_store,
status_flag, recycle_flag, create_time, status_flag, recycle_flag, create_time,
update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name,enterprise_id,gic_del_flag,temp_flag update_time,wx_department_id,sort,level,wx_enterprise_id,chain_name,enterprise_id,gic_del_flag,temp_flag
</sql> </sql>
<sql id="Base_Column_List_short" >
department_id, department_name, parent_department_id,wx_department_id,sort,level
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
...@@ -522,4 +528,11 @@ ...@@ -522,4 +528,11 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="listAllDepartment" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List_short" />
from tab_haoban_department
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -8,6 +8,7 @@ import java.util.Map; ...@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -847,6 +848,20 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -847,6 +848,20 @@ public class DepartmentContoller extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
/**
* 加载
* @return
*/
@RequestMapping("department-list-cache")
public HaobanResponse departmentCachelist() {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
if (StringUtils.isBlank(wxEnterpriseId)) {
return resultResponse(HaoBanErrCode.ERR_6);
}
List<DepartmentShortDTO> list = departmentApiService.listAllDepartment(wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1,list);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment