Commit a94d9250 by 墨竹

feat:企微同步通讯录处理部门

parent 24c5f1ea
...@@ -4,12 +4,12 @@ package com.gic.haoban.manage.api.enums; ...@@ -4,12 +4,12 @@ package com.gic.haoban.manage.api.enums;
* Created by tgs on 2020/2/20. * Created by tgs on 2020/2/20.
*/ */
public enum WxEditType { public enum WxEditType {
ADDDEPART("create_party", "创建部门"), ADD_DEPART("create_party", "创建部门"),
UPDATEDEPART("update_party", "更新部门"), UPDATE_DEPART("update_party", "更新部门"),
DELETEDEPART("delete_party", "删除部门"), DELETE_DEPART("delete_party", "删除部门"),
ADDUSER("create_user", "新增用户"), ADD_USER("create_user", "新增用户"),
UPDATEUSER("update_user", "更新用户"), UPDATE_USER("update_user", "更新用户"),
DELETEUSER("delete_user", "删除用户"); DELETE_USER("delete_user", "删除用户");
WxEditType(String type, String desc){ WxEditType(String type, String desc){
this.code = type; this.code = type;
......
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import java.util.List;
import com.gic.api.base.commons.Page; 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; import com.gic.haoban.manage.api.dto.DepartmentShortDTO;
import java.util.List;
public interface DepartmentApiService { public interface DepartmentApiService {
List<DepartmentDTO> listByParentId(String parentId); List<DepartmentDTO> listByParentId(String parentId);
...@@ -49,18 +49,21 @@ public interface DepartmentApiService { ...@@ -49,18 +49,21 @@ public interface DepartmentApiService {
* @param department * @param department
* @return * @return
*/ */
@Deprecated
ServiceResponse<DepartmentDTO> add(DepartmentDTO department); ServiceResponse<DepartmentDTO> add(DepartmentDTO department);
/** /**
* 修改部门 * 修改部门
* @param department * @param department
* @return * @return
*/ */
@Deprecated
ServiceResponse edit(DepartmentDTO department); ServiceResponse edit(DepartmentDTO department);
/** /**
* 删除部门 * 删除部门
* @param departmentId * @param departmentId
* @return * @return
*/ */
@Deprecated
ServiceResponse del(String departmentId); ServiceResponse del(String departmentId);
/** /**
* 根据关联id 获取部门 * 根据关联id 获取部门
......
...@@ -25,6 +25,7 @@ public interface StaffApiService { ...@@ -25,6 +25,7 @@ public interface StaffApiService {
Page<StaffDTO> pageStaff(List<String> departmentId, Integer activeFlag, String keyword, BasePageInfo pageInfo, Integer relationFlag); Page<StaffDTO> pageStaff(List<String> departmentId, Integer activeFlag, String keyword, BasePageInfo pageInfo, Integer relationFlag);
@Deprecated
void del(String staffDepartmentStaffRelatedId); void del(String staffDepartmentStaffRelatedId);
/** /**
......
...@@ -244,7 +244,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -244,7 +244,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
return hr; return hr;
} }
} }
departmentService.del(departmentId); departmentService.del(departmentId);
return hr; return hr;
} }
...@@ -325,23 +324,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -325,23 +324,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public ServiceResponse wxCallBackrecycle(String departmentId) { public ServiceResponse wxCallBackrecycle(String departmentId) {
ServiceResponse hr = new ServiceResponse(); ServiceResponse hr = new ServiceResponse();
hr.setCode(1); hr.setCode(1);
List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId); List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId);
logger.info("【部门删除】list.size={}", list.size()); logger.info("【部门删除】list.size={}", list.size());
if (!list.isEmpty()) { if (CollectionUtils.isNotEmpty(list)) {
hr.setCode(0); hr.setCode(0);
hr.setMessage("存在子部门,删除部门失败"); hr.setMessage("存在子部门,删除部门失败");
return hr; return hr;
} }
List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId); List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId);
logger.info("【部门删除】staffList.size={}", staffList.size()); logger.info("【部门删除】staffList.size={}", staffList.size());
if (!staffList.isEmpty()) { if (CollectionUtils.isNotEmpty(staffList)) {
hr.setCode(0); hr.setCode(0);
hr.setMessage("存在成员,删除部门失败"); hr.setMessage("存在成员,删除部门失败");
return hr; return hr;
} }
departmentService.recycle(departmentId); departmentService.recycle(departmentId);
return hr; return hr;
} }
......
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