Commit c0855d36 by lal Committed by chenzg

提交

parent ca460307
package cn.timer.api.controller.zzgl; package cn.timer.api.controller.zzgl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -26,10 +25,10 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp ...@@ -26,10 +25,10 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeNodeConfig; import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil; import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -49,8 +48,10 @@ import cn.timer.api.dao.zzgl.ZzglBmgwMMapper; ...@@ -49,8 +48,10 @@ import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper; import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dao.zzgl.ZzglMenuMapper; import cn.timer.api.dao.zzgl.ZzglMenuMapper;
import cn.timer.api.dao.zzgl.ZzglPostMenuMapper; import cn.timer.api.dao.zzgl.ZzglPostMenuMapper;
import cn.timer.api.dto.zzgl.DepartmentStaffDto;
import cn.timer.api.dto.zzgl.LogDgjlsDto; import cn.timer.api.dto.zzgl.LogDgjlsDto;
import cn.timer.api.dto.zzgl.LogDgjlsQueryDto; import cn.timer.api.dto.zzgl.LogDgjlsQueryDto;
import cn.timer.api.dto.zzgl.ObtainDepartmentDto;
import cn.timer.api.dto.zzgl.UpEmpDeptDto; import cn.timer.api.dto.zzgl.UpEmpDeptDto;
import cn.timer.api.dto.zzgl.ZzglPostMenuDto; import cn.timer.api.dto.zzgl.ZzglPostMenuDto;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
...@@ -572,4 +573,25 @@ public class ZzglController { ...@@ -572,4 +573,25 @@ public class ZzglController {
return ResultUtil.success(); return ResultUtil.success();
} }
@GetMapping(value = "/appdeptlist")
@ApiOperation(value = "APP获取部门岗位", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> selectapplistdept(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ObtainDepartmentDto> tmen = new ArrayList<ObtainDepartmentDto>();
List<ZzglBmgwM> zzglbmgwms = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()).eq(ZzglBmgwM::getType, 0).list();
for(ZzglBmgwM gw : zzglbmgwms) {
ObtainDepartmentDto tm = ObtainDepartmentDto.builder().build();
BeanUtil.copyProperties(gw, tm);
List<DepartmentStaffDto> destff = ygglMainEmpMapper.DepartmentStaff(orgCode,gw.getId());
tm.setUser(destff);
tmen.add(tm);
}
return ResultUtil.data(tmen);
}
} }
...@@ -15,6 +15,7 @@ import cn.timer.api.dto.yggl.EmpQuery; ...@@ -15,6 +15,7 @@ import cn.timer.api.dto.yggl.EmpQuery;
import cn.timer.api.dto.yggl.YgQueryDto; import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgbintuDto; import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto; import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.zzgl.DepartmentStaffDto;
/** /**
* 员工档案+统计图查询 * 员工档案+统计图查询
...@@ -128,4 +129,6 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> { ...@@ -128,4 +129,6 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return * @return
*/ */
IPage<YgglMainEmp> selectME(Page<YgglMainEmp> page,@Param("param") EmpQuery empQuery); IPage<YgglMainEmp> selectME(Page<YgglMainEmp> page,@Param("param") EmpQuery empQuery);
List<DepartmentStaffDto> DepartmentStaff(Integer orgcode,Integer upid);
} }
package cn.timer.api.dto.zzgl;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DepartmentStaffDto {
private Integer empNum;
private String empname;
private String phone;
private String bmgwname;
}
package cn.timer.api.dto.zzgl;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ObtainDepartmentDto implements Serializable {
private static final long serialVersionUID = 8644456442638650462L;
@ApiModelProperty(value = "编号", example = "101")
private Integer id;
@ApiModelProperty(value = "名称 ", example = "名称")
private String name;
private List<DepartmentStaffDto> user;
}
...@@ -67,6 +67,14 @@ ...@@ -67,6 +67,14 @@
<result column="jobStatus" property="jobStatus" /> <result column="jobStatus" property="jobStatus" />
<result column="workage" property="workage" /> <result column="workage" property="workage" />
</resultMap> </resultMap>
<resultMap id="DepartmentStaffMap" type="cn.timer.api.dto.zzgl.DepartmentStaffDto" >
<id column="id" property="id" />
<result column="empNum" property="empNum" />
<result column="name" property="name" />
<result column="phone" property="phone" />
<result column="bmgwname" property="bmgwname" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id,
...@@ -204,6 +212,17 @@ ...@@ -204,6 +212,17 @@
WHERE e.org_code = #{orgCode} WHERE e.org_code = #{orgCode}
</select> </select>
<select id="DepartmentStaff" resultMap="DepartmentStaffMap">
select em.emp_num as empNum,
em.`name` as empname,
bm.`name` as bmgwname,
em.phone
from yggl_main_emp em
LEFT JOIN zzgl_bmgw_m as bm on bm.id = em.bmgw_id
where em.org_code = #{orgcode}
and em.bmgw_id in (select bm.id from zzgl_bmgw_m bm
WHERE bm.up_id = #{upid})
</select>
<select id="selectME" resultMap="BaseResultMap"> <select id="selectME" resultMap="BaseResultMap">
SELECT SELECT
......
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