package com.fuzamei.service.serviceImpl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.fuzamei.constant.Roles; import com.fuzamei.entity.User; import com.fuzamei.mapperInterface.PlannerMapper; import com.fuzamei.mapperInterface.ReceivingClerkMapper; import com.fuzamei.service.PlannerService; @Service public class PlannerServiceImpl implements PlannerService{ @Autowired private PlannerMapper plannerMapper; @Autowired private ReceivingClerkMapper receivingClerkMapper; @Override public List queryPlanner(Map map) { List user= null; //Map account = new LinkedHashMap(); int user_id=(int) map.get("user_id"); //String username=(String) map.get("username"); String role=receivingClerkMapper.selectRoleByUserId(user_id);//通过用户id查询角色 如果角色是管理员就可以看查看收货员列表 System.out.println(role+"lllllll"); if (role.equals(Roles.ADMIN)) { user=plannerMapper.queryPlanner(map); } else { throw new RuntimeException("账号异常5"); } return user; // 这几个列表判断 待改 } @Override public List queryAllSupplierByPlannerId(int plannerId) {//根据计划员id查询已经有的供应商 return plannerMapper.queryAllSupplierByPlannerId(plannerId); } @Override public List queryAllNoSupplierByPlannerId(int plannerId) {////根据计划员id查询未添加的供应商 return plannerMapper.queryAllNoSupplierByPlannerId(plannerId); } }