package com.casic.missiles.modular.dept.service.impl;


import com.casic.missiles.core.common.service.ICommonPermissionService;
import com.casic.missiles.modular.dept.dao.BusDeptUserMapper;
import com.casic.missiles.modular.dept.dto.DeptUserView;
import com.casic.missiles.modular.dept.model.BusDeptUser;
import com.casic.missiles.modular.dept.service.IBusDeptUserService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 部门责任人关联表 服务实现类
 * </p>
 *
 * @author zhangyingjie123
 * @since 2020-05-07
 */
@Service
public class BusDeptUserServiceImpl extends ServiceImpl<BusDeptUserMapper, BusDeptUser> implements IBusDeptUserService {
    @Autowired
    private ICommonPermissionService permissionService;

    @Override
    public List<DeptUserView> selectDeptUserList(String deptType, String deptName) {
        List<DeptUserView> deptUserViews = this.baseMapper.selectDeptUserList(deptType, deptName);
        for (DeptUserView deptUserView : deptUserViews) {
            deptUserView.setpName(permissionService.getDeptName(deptUserView.getPid()));
        }
        return deptUserViews;
    }
}
