diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index d07777427a..fab7dfae57 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -27,7 +27,9 @@ public enum EpmetErrorCode { MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), CANNOT_AUDIT_WARM(8201, "请完善居民信息"), - NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"); + NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), + NOT_DEL_AGENCY_PER(8203, "该机关存在工作人员,不允许删除"), + NOT_DEL_DEPARTMENT(8204, "该部门存在工作人员,不允许删除"); private int code; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java new file mode 100644 index 0000000000..07e5b1f0f4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 添加部门-接口入参 + * + * @author sun + */ +@Data +public class AddDepartmentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 所属组织机构ID(customer_agency.id) + */ + @NotBlank(message = "组织机构Id不能为空") + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java new file mode 100644 index 0000000000..bb70330a2c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentInAgencyFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织首页-获取机关下部门列表-接口入参 + * + * @author sun + */ +@Data +public class DepartmentInAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java new file mode 100644 index 0000000000..a651dad1c3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentListFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 获取部门列表-接口入参 + * + * @author sun + */ +@Data +public class DepartmentListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + @NotBlank(message = "组织机构ID不能为空") + private String agencyId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java new file mode 100644 index 0000000000..8e01785bf2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentdetailFormDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 获取部门详情-接口入参 + * + * @author sun + */ +@Data +public class DepartmentdetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + @NotBlank(message = "部门ID不能为空") + private String departmentId; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java new file mode 100644 index 0000000000..949ac45ace --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 部门信息修改-接口入参 + * + * @author sun + */ +@Data +public class EditDepartmentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + @NotBlank(message = "部门ID不能为空") + private String departmentId; + + /** + * 部门名称 + */ + @NotBlank(message = "部门名称不能为空") + private String departmentName; + + /** + * 部门职责 + */ + @NotBlank(message = "部门职责不能为空") + private String departmentDuty; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java new file mode 100644 index 0000000000..749a157deb --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/RemoveDepartmentFormDTO.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 删除部门-接口入参 + * + * @author sun + */ +@Data +public class RemoveDepartmentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + @NotBlank(message = "部门ID不能为空") + private String departmentId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java new file mode 100644 index 0000000000..b6206d0c6d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AddDepartmentResultDTO.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加部门-接口返参 + * + * @author sun + */ +@Data +public class AddDepartmentResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 新增部门Id + */ + private String departmentId; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java new file mode 100644 index 0000000000..e63020a209 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartInStaffListResultDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 获取部门详情-部门下工作人员列表 + * + * @author sun + */ +@Data +public class DepartInStaffListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String staffId; + + /** + * 用户姓名 + */ + private String staffName; + + /** + * 用户头像 + */ + private String staffHeadPhoto; + + /** + * 性别 + */ + private Integer gender; + + /** + * 角色名称 + */ + private String roleName; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java new file mode 100644 index 0000000000..d36a4222ee --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 获取部门详情-接口返参 + * + * @author sun + */ +@Data +public class DepartmentDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 部门下工作人员列表 + */ + private List staffList; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java new file mode 100644 index 0000000000..33880e5c1b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentInAgencyResultDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 组织首页-获取机关下部门列表-接口返参 + * + * @author sun + */ +@Data +public class DepartmentInAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关下总部门数 + */ + private Integer departmentCount; + + /** + * 机关下部门列表 + */ + private List departmentList; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java new file mode 100644 index 0000000000..7fafa0238d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 组织首页-获取机关下部门列表-部门详情数据 + * + * @author sun + */ +@Data +public class DepartmentListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门下总人数 + */ + private Integer totalUser; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java new file mode 100644 index 0000000000..2a530cba0b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerDepartmentConstant.java @@ -0,0 +1,30 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription + */ +public interface CustomerDepartmentConstant { + + /** + * 部门信息编辑修改失败 + */ + String UPDATE_EXCEPTION = "部门信息更新失败"; + /** + * 添加部门失败 + */ + String SAVE_EXCEPTION = "添加部门失败"; + /** + * 部门删除失败 + */ + String DEL_EXCEPTION = "删除部门失败"; + /** + * 查询用户基本信息失败 + */ + String SELECT_STAFFINFO_EXCEPTION = "根据用户Id未查询到用户基本信息"; + + /** + * 查询部门人员角色 + */ + String SELECT_ROLE_EXCEPTION = "查询部门人员角色失败"; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java new file mode 100644 index 0000000000..05189cdc57 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.service.DepartmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 部门 + * + * @author sun + */ +@RestController +@RequestMapping("department") +public class DepartmentController { + + @Autowired + private DepartmentService departmentService; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加部门 + */ + @PostMapping("adddepartment") + public Result addDepartment(@RequestBody AddDepartmentFormDTO formDTO) { + return departmentService.addDepartment(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 部门信息修改 + */ + @PostMapping("editdepartment") + public Result editDepartment(@RequestBody EditDepartmentFormDTO formDTO) { + return departmentService.editDepartment(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除部门 + */ + @PostMapping("removedepartment") + public Result removeDepartment(@RequestBody RemoveDepartmentFormDTO formDTO) { + return departmentService.removeDepartment(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取部门详情 + */ + @PostMapping("departmentdetail") + public Result departmentDetail(@RequestBody DepartmentdetailFormDTO formDTO) { + return departmentService.departmentDetail(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取机关下部门列表 + */ + @PostMapping("departmentinagencylist") + public Result departmentInAgencyList(@RequestBody DepartmentInAgencyFormDTO formDTO) { + return departmentService.departmentInAgencyList(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取机构下部门列表 + */ + @PostMapping("departmentlist") + public Result> departmentList(@RequestBody DepartmentListFormDTO formDTO) { + return departmentService.departmentList(formDTO); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index bd188f8351..b7569a1396 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -18,8 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.DepartmentListResultDTO; +import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户部门表 @@ -29,5 +34,19 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerDepartmentDao extends BaseDao { - + + /** + * @param agencyId + * @return + * @Author sun + * @Description 根据当前机关Id查询该机关下的直属部门列表,只查询前十条 + **/ + List selectDepartmentListByAgencyId(@Param("agencyId") String agencyId); + /** + * @param agencyId + * @return + * @Author sun + * @Description 根据当前机关Id查询该机关下的直属部门列表 + **/ + List selectDepartmentList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 8a79a0dd2e..dfdba500d7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -20,6 +20,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.CustomerStaffDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 部门人员关系表 @@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffDepartmentDao extends BaseDao { - + + List selectUserIdByDepartmentId(@Param("departmentId") String departmentId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 217d37c0bb..c9e67f87ff 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -5,7 +5,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; @@ -43,4 +45,13 @@ public interface EpmetUserFeignClient { @PostMapping("/epmetuser/customerstaff/staffsinagency") Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + /** + * @param departmentInStaffFormDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + @PostMapping("/epmetuser/customerstaff/getdepartmentstafflist") + Result> getDepartmentStaffList(DepartmentInStaffFormDTO departmentInStaffFormDTO); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index a4cf20b805..dd508f6f12 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -6,7 +6,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.feign.EpmetUserFeignClient; import org.springframework.stereotype.Component; @@ -32,4 +34,10 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoForHome", fromDTO); } + + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO departmentInStaffFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getDepartmentStaffList", departmentInStaffFormDTO); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java new file mode 100644 index 0000000000..48fe029fb0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; + +import java.util.List; + +/** + * 机关单位信息 + * + * @author sun + */ +public interface DepartmentService { + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加部门 + */ + Result addDepartment(AddDepartmentFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 部门信息修改 + */ + Result editDepartment(EditDepartmentFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除部门 + */ + Result removeDepartment(RemoveDepartmentFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取部门详情 + */ + Result departmentDetail(DepartmentdetailFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取机关下部门列表 + */ + Result departmentInAgencyList(DepartmentInAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取机构下部门列表 + */ + Result> departmentList(DepartmentListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java new file mode 100644 index 0000000000..263daff4ac --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -0,0 +1,200 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CustomerDepartmentConstant; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.CustomerDepartmentDao; +import com.epmet.dao.CustomerStaffDepartmentDao; +import com.epmet.dto.StaffRoleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.CustomerDepartmentEntity; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.service.DepartmentService; +import com.epmet.util.ModuleConstant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; + +/** + * 机关单位信息 + * + * @author sun + */ +@Service +public class DepartmentServiceImpl implements DepartmentService { + + private static final Logger log = LoggerFactory.getLogger(DepartmentServiceImpl.class); + @Autowired + private CustomerAgencyDao customerAgencyDao; + @Autowired + private CustomerDepartmentDao customerDepartmentDao; + @Autowired + private CustomerStaffDepartmentDao customerStaffDepartmentDao; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 添加部门 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result addDepartment(AddDepartmentFormDTO formDTO) { + Result result = new Result(); + AddDepartmentResultDTO addDepartmentResultDTO = new AddDepartmentResultDTO(); + CustomerDepartmentEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerDepartmentEntity.class); + entity.setTotalUser(NumConstant.ZERO); + //1:查询当前组织机构信息,获取客户Id + CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); + entity.setCustomerId(parentEntity.getCustomerId()); + //2:保存部门信息 + if (customerDepartmentDao.insert(entity) < NumConstant.ONE) { + log.error(CustomerDepartmentConstant.SAVE_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.SAVE_EXCEPTION); + } + //3:返回新部门Id + addDepartmentResultDTO.setDepartmentId(entity.getId()); + return result.ok(addDepartmentResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 部门信息修改 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result editDepartment(EditDepartmentFormDTO formDTO) { + Result result = new Result(); + CustomerDepartmentEntity entity = new CustomerDepartmentEntity(); + entity.setId(formDTO.getDepartmentId()); + entity.setDepartmentName(formDTO.getDepartmentName()); + entity.setDepartmentDuty(formDTO.getDepartmentDuty()); + if (customerDepartmentDao.updateById(entity) < NumConstant.ONE) { + log.error(CustomerDepartmentConstant.UPDATE_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.UPDATE_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 删除部门 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Result removeDepartment(RemoveDepartmentFormDTO formDTO) { + Result result = new Result(); + //1:判断当前部门下是否存在工作人员,不存在的可以删除 + CustomerDepartmentEntity entity = customerDepartmentDao.selectById(formDTO.getDepartmentId()); + if (null != entity && entity.getTotalUser() > NumConstant.ZERO) { + result.setCode(EpmetErrorCode.NOT_DEL_DEPARTMENT.getCode()); + result.setMsg(EpmetErrorCode.NOT_DEL_DEPARTMENT.getMsg()); + return result; + } + //2:删除部门信息(逻辑删) + if (customerDepartmentDao.deleteById(formDTO.getDepartmentId()) < NumConstant.ONE) { + log.error(CustomerDepartmentConstant.DEL_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.DEL_EXCEPTION); + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取部门详情 + */ + @Override + public Result departmentDetail(DepartmentdetailFormDTO formDTO) { + Result result = new Result(); + DepartmentDetailResultDTO departmentDetailResultDTO = new DepartmentDetailResultDTO(); + //1:根据部门Id查询部门详情信息 + CustomerDepartmentEntity entity = customerDepartmentDao.selectById(formDTO.getDepartmentId()); + departmentDetailResultDTO = ConvertUtils.sourceToTarget(entity, DepartmentDetailResultDTO.class); + departmentDetailResultDTO.setDepartmentId(entity.getId()); + //2:查询部门下工作人员的用户Id集合 + List userIdList = customerStaffDepartmentDao.selectUserIdByDepartmentId(formDTO.getDepartmentId()); + if (null == userIdList || userIdList.size() < NumConstant.ONE) { + return result.ok(departmentDetailResultDTO); + } + DepartmentInStaffFormDTO departmentInStaffFormDTO = new DepartmentInStaffFormDTO(); + //部门Id用于查询部门领导角色使用 + departmentInStaffFormDTO.setDepartmentId(formDTO.getDepartmentId()); + departmentInStaffFormDTO.setCustomerId(entity.getCustomerId()); + departmentInStaffFormDTO.setUserIdList(userIdList); + //3:调用epmet_user服务,查询人员基本信息,按姓名对应的拼音升序 + Result> resultList = epmetUserFeignClient.getDepartmentStaffList(departmentInStaffFormDTO); + if (!resultList.success() || null == resultList.getData()) { + log.error(CustomerDepartmentConstant.SELECT_STAFFINFO_EXCEPTION); + throw new RenException(CustomerDepartmentConstant.SELECT_STAFFINFO_EXCEPTION); + } + //部门下所有工作人员基本信息 + List staffList = resultList.getData(); + departmentDetailResultDTO.setStaffList(staffList); + return new Result().ok(departmentDetailResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 组织首页-获取机关下部门列表 + */ + @Override + public Result departmentInAgencyList(DepartmentInAgencyFormDTO formDTO) { + DepartmentInAgencyResultDTO departmentInAgencyResultDTO = new DepartmentInAgencyResultDTO(); + //1:根据当前机关Id查询该机关下的直属部门列表 + List departmentList = customerDepartmentDao.selectDepartmentListByAgencyId(formDTO.getAgencyId()); + departmentInAgencyResultDTO.setDepartmentList(departmentList); + //2:统计下一级机关数 + departmentInAgencyResultDTO.setDepartmentCount(departmentList.size()); + return new Result().ok(departmentInAgencyResultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取机构下部门列表 + */ + @Override + public Result> departmentList(DepartmentListFormDTO formDTO) { + List departmentList = customerDepartmentDao.selectDepartmentList(formDTO.getAgencyId()); + return new Result>().ok(departmentList); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 50ff491aa3..90b926b729 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -57,7 +57,8 @@ FROM customer_agency WHERE del_flag = '0' AND pid = #{pId} - ORDER BY CREATED_TIME DESC + ORDER BY created_time DESC + LIMIT 10 \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 5ab8b90e9c..86c597d402 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -15,6 +15,16 @@ + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java new file mode 100644 index 0000000000..5810659515 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DepartmentInStaffFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据客户Id和用户Id查询用户基本信息 + * @Author sun + */ +@Data +public class DepartmentInStaffFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 用户Id集合 + */ + private List userIdList; + +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java index ce710319bd..48b3e77940 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java @@ -11,4 +11,10 @@ public interface UserRoleConstant { * 角色表对应的是居民角色时grid_id的默认值 */ String DEFAULT_GRID_ID = "all"; + + /** + * 部门领导角色值 + */ + String DEPT_LEADER = "dept_leader"; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 42c39a6022..38fa2fcc45 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -28,9 +28,10 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; @@ -155,4 +156,15 @@ public class CustomerStaffController { public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { return customerStaffService.getStaffInfoForHome(fromDTO); } + + /** + * @param fromDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + @PostMapping("getdepartmentstafflist") + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO) { + return customerStaffService.getDepartmentStaffList(fromDTO); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index b552832c2d..c6c000bf3c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -22,7 +22,9 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; @@ -82,4 +84,12 @@ public interface CustomerStaffDao extends BaseDao { * @Date 2020/4/23 16:46 **/ CustomerStaffEntity selectByUserId(String userId); + + /** + * @param fromDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + List selectDepartmentStaffList(DepartmentInStaffFormDTO fromDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 4a7ceb335f..1388b741b9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -24,7 +24,9 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; @@ -140,4 +142,12 @@ public interface CustomerStaffService extends BaseService { * @return */ Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO); + + /** + * @param fromDTO + * @return + * @Author sun + * @Description 根据客户Id及userId集合查询用户基本信息 + */ + Result> getDepartmentStaffList(DepartmentInStaffFormDTO fromDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 560fe0008c..5d8ef70ba5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -22,16 +22,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; +import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffGridListDTO; +import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.DepartmentInStaffFormDTO; +import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.result.DepartInStaffListResultDTO; import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.entity.CustomerStaffEntity; import com.epmet.redis.CustomerStaffRedis; @@ -156,4 +162,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(list); } + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { + //1:根据userId集合查询人员基本信息 + List list = baseDao.selectDepartmentStaffList(formDTO); + //2:根据部门Id查询部门下是领导角色的用户 + StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); + staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); + staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); + + return new Result>().ok(list); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index ab8ad974a5..d8d149da1f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -79,4 +79,21 @@ cs.DEL_FLAG = '0' AND CS.USER_ID =#{userId} + \ No newline at end of file