Commit eecda0c8 by fudahua

Merge remote-tracking branch 'origin/developer' into developer

parents 8ce1d154 4af4c85f
...@@ -15,7 +15,7 @@ public interface DepartmentApiService { ...@@ -15,7 +15,7 @@ public interface DepartmentApiService {
* @param parentId * @param parentId
* @return * @return
*/ */
List<DepartmentDTO> listByDepartmentIds(List<String> departmentIds,int storeFlag); List<DepartmentDTO> listByDepartmentIds(List<String> departmentIds,Integer storeFlag);
/** /**
* 查门店列表 * 查门店列表
* @param relatedIds * @param relatedIds
...@@ -171,4 +171,7 @@ public interface DepartmentApiService { ...@@ -171,4 +171,7 @@ public interface DepartmentApiService {
*/ */
Integer totalStoreCountByEnterpriseId(String wxEnterpriseId); Integer totalStoreCountByEnterpriseId(String wxEnterpriseId);
List<DepartmentDTO> listSonByDepartmentIds(List<String> departmentIdSet, String wxEnterpriseId);
} }
...@@ -32,7 +32,7 @@ public interface DepartmentMapper { ...@@ -32,7 +32,7 @@ public interface DepartmentMapper {
List<TabHaobanDepartment> getByWxId(@Param("wxDepartmentId")String wxDepartmentId, @Param("wxEnterpriseId") String wxEnterpriseId); List<TabHaobanDepartment> getByWxId(@Param("wxDepartmentId")String wxDepartmentId, @Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanDepartment> listByDepartmentIds(@Param("departmentIds")List<String> departmentIds,@Param("storeFlag")int storeFlag); List<TabHaobanDepartment> listByDepartmentIds(@Param("departmentIds")List<String> departmentIds,@Param("storeFlag")Integer storeFlag);
List<TabHaobanDepartment> listByRelatedIds(@Param("relatedIds")List<String> relatedIds); List<TabHaobanDepartment> listByRelatedIds(@Param("relatedIds")List<String> relatedIds);
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
...@@ -370,7 +373,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -370,7 +373,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Override @Override
public List<DepartmentDTO> listByDepartmentIds(List<String> departmentIds, public List<DepartmentDTO> listByDepartmentIds(List<String> departmentIds,
int storeFlag) { Integer storeFlag) {
List<TabHaobanDepartment> list= departmentMapper.listByDepartmentIds(departmentIds, storeFlag); List<TabHaobanDepartment> list= departmentMapper.listByDepartmentIds(departmentIds, storeFlag);
if(list==null){ if(list==null){
return new ArrayList<DepartmentDTO>(); return new ArrayList<DepartmentDTO>();
...@@ -758,4 +761,26 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -758,4 +761,26 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public Integer totalStoreCountByEnterpriseId(String wxEnterpriseId) { public Integer totalStoreCountByEnterpriseId(String wxEnterpriseId) {
return departmentService.totalStoreCountByEnterpriseId(wxEnterpriseId); return departmentService.totalStoreCountByEnterpriseId(wxEnterpriseId);
} }
@Override
public List<DepartmentDTO> listSonByDepartmentIds(List<String> departmentIdList,String wxEnterpriseId) {
List<DepartmentDTO> list = new ArrayList<>();
for (String departmentId : departmentIdList) {
String chainId = "";
TabHaobanDepartment department = departmentService.selectById(departmentId);
if(department != null){
chainId = department.getChainId() + Constant.ID_SEPARATOR + departmentId;
}
list.add(EntityUtil.changeEntityByJSON(DepartmentDTO.class, department));
if(StringUtils.isNotBlank(chainId)){
List<TabHaobanDepartment> tabList = departmentService.listByChainId(chainId,wxEnterpriseId);
for (TabHaobanDepartment tabHaobanDepartment : tabList) {
list.add(EntityUtil.changeEntityByJSON(DepartmentDTO.class, tabHaobanDepartment));
}
}
}
return list;
}
} }
...@@ -305,7 +305,9 @@ ...@@ -305,7 +305,9 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_haoban_department from tab_haoban_department
where status_flag = 1 where status_flag = 1
and is_store = #{storeFlag,jdbcType=INTEGER} <if test="storeFlag != null">
and is_store = #{storeFlag}
</if>
<if test="departmentIds != null and departmentIds.size() > 0"> <if test="departmentIds != null and departmentIds.size() > 0">
and department_id IN and department_id IN
<foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=",">
......
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