Commit 1adc6422 by qwmqiuwenmin

fix

parent f69de779
......@@ -33,4 +33,6 @@ public interface StaffApiService {
public StaffDTO selectByUserId(String userId);
public StaffDepartmentRelatedDTO getDepartmentIdAndStaffId(String departmentId, String staffId);
}
......@@ -34,4 +34,6 @@ public interface StaffDepartmentRelatedMapper {
int delByUserid(@Param("userid") String userId);
TabHaobanStaffDepartmentRelated getDepartmentIdAndStaffId(@Param("departmentId")String departmentId, @Param("staffId")String staffId);
}
\ No newline at end of file
......@@ -19,4 +19,6 @@ public interface StaffDepartmentRelatedService {
void del(StaffDepartmentRelatedDTO related);
void delByUserid(String userid);
TabHaobanStaffDepartmentRelated getDepartmentIdAndStaffId(String departmentId, String staffId);
}
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service;
import java.util.Set;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.github.pagehelper.Page;
public interface StaffService {
......@@ -20,4 +21,5 @@ public interface StaffService {
void updateByPrimaryKey(TabHaobanStaff tab);
int delByuserid(String staffId);
}
......@@ -64,5 +64,10 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
}
@Override
public TabHaobanStaffDepartmentRelated getDepartmentIdAndStaffId(String departmentId, String staffId) {
return mapper.getDepartmentIdAndStaffId(departmentId,staffId);
}
}
......@@ -313,4 +313,10 @@ public class StaffApiServiceImpl implements StaffApiService {
return EntityUtil.changeEntityByJSON(StaffDTO.class, staffService.selectByUserId(userId));
}
@Override
public StaffDepartmentRelatedDTO getDepartmentIdAndStaffId(String departmentId, String staffId) {
TabHaobanStaffDepartmentRelated tab = staffDepartmentRelatedService.getDepartmentIdAndStaffId(departmentId,staffId);
return EntityUtil.changeEntityByJSON(StaffDepartmentRelatedDTO.class, tab);
}
}
......@@ -198,4 +198,14 @@
status_flag = 0
where wx_user_id = #{userid,jdbcType=VARCHAR}
</update>
<select id="getDepartmentIdAndStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where staff_id = #{staffId,jdbcType=VARCHAR}
and department_id = #{departmentId}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
......@@ -20,6 +20,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.LoginVO;
......@@ -70,9 +71,13 @@ public class StaffController extends WebBaseController{
@RequestMapping("staff-list")
public HaobanResponse staffList(String departmentId,Integer activeFlag,String keyword,BasePageInfo pageInfo){
Page<StaffDTO> page = staffApiService.pageStaff(departmentId,activeFlag,keyword,pageInfo);
List<StaffDTO> list = page.getResult();
for (StaffDTO staffDTO : list) {
StaffDepartmentRelatedDTO related = staffApiService.getDepartmentIdAndStaffId(departmentId,staffDTO.getStaffId());
}
logger.info("【员工列表】page={}",JSON.toJSONString(page));
PageResult<StaffDTO> pageVo = new PageResult<>();
pageVo.setList(page.getResult());
pageVo.setList(list);
pageVo.setPageNum(page.getCurrentPage());
pageVo.setPages(page.getPages());
pageVo.setPageSize(page.getPageSize());
......
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