Commit a94d9250 by 墨竹

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

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