Commit efa695ac by qwmqiuwenmin

fix

parent 41fca5e1
......@@ -48,6 +48,8 @@ public class DepartmentDTO implements Serializable {
private String gicEnterpriseName;
private String enterpriseId;
private Boolean hasSonNode;
private static final long serialVersionUID = 1L;
......@@ -226,6 +228,14 @@ public class DepartmentDTO implements Serializable {
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Boolean getHasSonNode() {
return hasSonNode;
}
public void setHasSonNode(Boolean hasSonNode) {
this.hasSonNode = hasSonNode;
}
......
......@@ -133,5 +133,11 @@ public interface DepartmentApiService {
* @return
*/
HaobanResponse wxCallBackrecycle(String departmentId);
/**
* 判断节点下面有没有子节点
* @param departmentId
* @return
*/
boolean hasSonNode(String departmentId);
}
......@@ -51,4 +51,6 @@ public interface DepartmentMapper {
Integer departmentRecycleCount(@Param("wxEnterpriseId")String wxEnterpriseId);
int countSyncDepartmentByEnterpriseId(@Param("enterpriseId")String enterpriseId);
int countByDepartment(@Param("departmentId")String departmentId);
}
\ No newline at end of file
......@@ -40,4 +40,6 @@ public interface DepartmentService {
int countSyncDepartmentByEnterpriseId(String enterpriseId);
int countByDepartment(String departmentId);
}
......@@ -154,4 +154,9 @@ public class DepartmentServiceImpl implements DepartmentService {
return mapper.countSyncDepartmentByEnterpriseId(enterpriseId);
}
@Override
public int countByDepartment(String departmentId) {
return mapper.countByDepartment(departmentId);
}
}
......@@ -521,4 +521,13 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public Integer departmentRecycleCount(String wxEnterpriseId) {
return departmentService.departmentRecycleCount(wxEnterpriseId);
}
@Override
public boolean hasSonNode(String departmentId) {
int departmentCount = departmentService.countByDepartment(departmentId);
if(departmentCount > 0){
return true;
}
return false;
}
}
......@@ -415,4 +415,13 @@
where enterprise_id = #{enterpriseId}
and status_flag = 1
</select>
<select id="countByDepartment" resultType="java.lang.Integer" parameterType="java.lang.String" >
select
count(1)
from tab_haoban_department
where parent_department_id = #{departmentId}
and status_flag = 1
and recycle_flag != 1
</select>
</mapper>
\ No newline at end of file
......@@ -94,6 +94,7 @@ public class DepartmentContoller extends WebBaseController{
staffCount += staffApiService.countByDepartmentId(departmentDTO2.getDepartmentId());
}
departmentDTO.setStaffCount(staffCount);
boolean flag = departmentApiService.hasSonNode(departmentDTO.getDepartmentId());
}
PageResult<DepartmentDTO> pageVo = new PageResult<>();
pageVo.setList(result);
......
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