Commit 15ffd874 by qwmqiuwenmin

fix

parent ff2d4a06
...@@ -51,4 +51,6 @@ public interface StaffApiService { ...@@ -51,4 +51,6 @@ public interface StaffApiService {
public void cleanGicClerk(String clerkCode, String departmentId); public void cleanGicClerk(String clerkCode, String departmentId);
public String insertUserLoginLog(UserLoginLogDTO userLoginLogDTO); public String insertUserLoginLog(UserLoginLogDTO userLoginLogDTO);
public int countByDepartmentIds(List<String> departmentIds);
} }
...@@ -42,4 +42,6 @@ public interface StaffDepartmentRelatedMapper { ...@@ -42,4 +42,6 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(@Param("departmentId")String departmentId, @Param("keyword")String keyword); List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(@Param("departmentId")String departmentId, @Param("keyword")String keyword);
int countByDepartmentIds(@Param("departmentIds")List<String> departmentIds);
} }
\ No newline at end of file
...@@ -744,4 +744,12 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -744,4 +744,12 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override
public int countByDepartmentIds(List<String> departmentIds) {
if(departmentIds == null || departmentIds.isEmpty()){
return 0;
}
return staffDepartmentRelatedMapper.countByDepartmentIds(departmentIds);
}
} }
...@@ -261,4 +261,15 @@ ...@@ -261,4 +261,15 @@
and (clerk_code like CONCAT('%',#{keyword},'%') or phone_number like CONCAT('%',#{keyword},'%') or staff_name like CONCAT('%',#{keyword},'%')) and (clerk_code like CONCAT('%',#{keyword},'%') or phone_number like CONCAT('%',#{keyword},'%') or staff_name like CONCAT('%',#{keyword},'%'))
</if> </if>
</select> </select>
<select id="countByDepartmentId" resultType="java.lang.Integer" >
select
count(1)
from tab_haoban_staff_department_related
where department_id in
<foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
and status_flag = 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -94,10 +94,13 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -94,10 +94,13 @@ public class DepartmentContoller extends WebBaseController{
for (DepartmentDTO departmentDTO : result) { for (DepartmentDTO departmentDTO : result) {
String chainId = departmentDTO.getChainId() + Constant.ID_SEPARATOR + departmentDTO.getDepartmentId(); String chainId = departmentDTO.getChainId() + Constant.ID_SEPARATOR + departmentDTO.getDepartmentId();
List<DepartmentDTO> sonList = departmentApiService.listByChainId(chainId,wxEnterpriseId); List<DepartmentDTO> sonList = departmentApiService.listByChainId(chainId,wxEnterpriseId);
int staffCount = staffApiService.countByDepartmentId(departmentDTO.getDepartmentId());; int staffCount = 0;
List<String> departmentIds = new ArrayList<>();
departmentIds.add(departmentDTO.getDepartmentId());
for (DepartmentDTO departmentDTO2 : sonList) { for (DepartmentDTO departmentDTO2 : sonList) {
staffCount += staffApiService.countByDepartmentId(departmentDTO2.getDepartmentId()); departmentIds.add(departmentDTO2.getDepartmentId());
} }
staffCount += staffApiService.countByDepartmentIds(departmentIds);
departmentDTO.setStaffCount(staffCount); departmentDTO.setStaffCount(staffCount);
departmentDTO.setHasSonNode(departmentApiService.hasSonNode(departmentDTO.getDepartmentId())); departmentDTO.setHasSonNode(departmentApiService.hasSonNode(departmentDTO.getDepartmentId()));
} }
......
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