|
|
|
@ -8,7 +8,6 @@ import com.google.common.base.Joiner; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
import org.apache.shiro.subject.Subject; |
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
@ -21,9 +20,10 @@ import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; |
|
|
|
|
import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
|
import org.jeecg.modules.demo.comp.service.ICompService; |
|
|
|
|
import org.jeecg.modules.demo.comptype.service.ICompTypeService; |
|
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
|
import org.jeecg.modules.system.entity.SysRole; |
|
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
|
import org.jeecg.modules.system.service.ISysUserRoleService; |
|
|
|
|
import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
@ -32,9 +32,8 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Description: 比赛 |
|
|
|
@ -61,6 +60,9 @@ public class CompController extends JeecgController<Comp, ICompService> { |
|
|
|
|
@Autowired |
|
|
|
|
private IAnnualCompService annualCompService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysUserRoleService iSysUserRoleService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
@ -83,8 +85,16 @@ public class CompController extends JeecgController<Comp, ICompService> { |
|
|
|
|
// 获取当前登录用户
|
|
|
|
|
LoginUser loginUser = (LoginUser) subject.getPrincipal(); |
|
|
|
|
//角色名称 管理员&教务处可以查看所有
|
|
|
|
|
String realname = loginUser.getRealname(); |
|
|
|
|
if (StringUtils.equals("管理员", realname) || StringUtils.equals("教务处", realname)) { |
|
|
|
|
List<SysRole> roleList = iSysUserRoleService.getUserRoleByUserId(loginUser.getId()); |
|
|
|
|
Map<String, String> roleMap = Optional.ofNullable(roleList).orElse(new LinkedList<>()).stream().collect(Collectors.toMap(SysRole::getRoleCode, SysRole::getRoleCode)); |
|
|
|
|
//角色编码 管理员&组委会&教务处 可以看到所有,其它用户可见到所属自己数据
|
|
|
|
|
Map<String, String> efficientRoleMap = new LinkedHashMap<>(); |
|
|
|
|
efficientRoleMap.put("admin", "admin"); |
|
|
|
|
efficientRoleMap.put("committee", "committee"); |
|
|
|
|
efficientRoleMap.put("superAdmin", "superAdmin"); |
|
|
|
|
if (efficientRoleMap.containsValue(roleMap.get("admin")) |
|
|
|
|
||efficientRoleMap.containsValue(roleMap.get("committee")) |
|
|
|
|
||efficientRoleMap.containsValue(roleMap.get("superAdmin"))) { |
|
|
|
|
} else { |
|
|
|
|
comp.setCompAdmin(loginUser.getUsername()); |
|
|
|
|
} |
|
|
|
@ -116,12 +126,12 @@ public class CompController extends JeecgController<Comp, ICompService> { |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
//@AutoLog(value = "比赛专家-分页列表查询")
|
|
|
|
|
@ApiOperation(value="比赛专家-分页列表查询", notes="比赛专家-分页列表查询") |
|
|
|
|
@ApiOperation(value = "比赛专家-分页列表查询", notes = "比赛专家-分页列表查询") |
|
|
|
|
@GetMapping(value = "/listSTU") |
|
|
|
|
public Result<IPage<Comp>> listSTU(Comp compExp, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
QueryWrapper<Comp> queryWrapper = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap()); |
|
|
|
|
Page<Comp> page = new Page<Comp>(pageNo, pageSize); |
|
|
|
|
IPage<Comp> pageList = compService.page(page, queryWrapper); |
|
|
|
@ -180,7 +190,7 @@ public class CompController extends JeecgController<Comp, ICompService> { |
|
|
|
|
comp.setCompAdmin(join);*/ |
|
|
|
|
|
|
|
|
|
//现业务只有一个有效负责人,值为 sys_user表username modify by zhc 11.21
|
|
|
|
|
if(!ObjectUtils.isEmpty(list)){ |
|
|
|
|
if (!ObjectUtils.isEmpty(list)) { |
|
|
|
|
comp.setCompAdmin(list.get(0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|