|
|
@ -1,51 +1,37 @@ |
|
|
|
package org.jeecg.modules.demo.annualcomp.controller; |
|
|
|
package org.jeecg.modules.demo.annualcomp.controller; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
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.authz.annotation.RequiresPermissions; |
|
|
|
|
|
|
|
import org.apache.shiro.subject.Subject; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
import org.jeecg.modules.demo.annual.entity.Annual; |
|
|
|
import org.jeecg.modules.demo.annual.entity.Annual; |
|
|
|
import org.jeecg.modules.demo.annual.service.IAnnualService; |
|
|
|
import org.jeecg.modules.demo.annual.service.IAnnualService; |
|
|
|
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; |
|
|
|
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; |
|
|
|
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; |
|
|
|
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.jeecg.modules.demo.annualcomp.vo.AnnualCompVo; |
|
|
|
import org.jeecg.modules.demo.annualcomp.vo.AnnualCompVo; |
|
|
|
import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
import org.jeecg.modules.demo.comp.service.ICompService; |
|
|
|
import org.jeecg.modules.demo.comp.service.ICompService; |
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
|
|
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams; |
|
|
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ImportParams; |
|
|
|
|
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
|
|
|
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
import java.util.Arrays; |
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @Description: 年度比赛管理 |
|
|
|
* @Description: 年度比赛管理 |
|
|
@ -84,10 +70,24 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
// QueryWrapper<AnnualComp> queryWrapper = QueryGenerator.initQueryWrapper(annualComp, req.getParameterMap());
|
|
|
|
// QueryWrapper<AnnualComp> queryWrapper = QueryGenerator.initQueryWrapper(annualComp, req.getParameterMap());
|
|
|
|
// Page<AnnualComp> page = new Page<AnnualComp>(pageNo, pageSize);
|
|
|
|
// Page<AnnualComp> page = new Page<AnnualComp>(pageNo, pageSize);
|
|
|
|
// IPage<AnnualComp> pageList = annualCompService.page(page, queryWrapper);
|
|
|
|
// IPage<AnnualComp> pageList = annualCompService.page(page, queryWrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subject subject = SecurityUtils.getSubject(); |
|
|
|
|
|
|
|
// 获取当前登录用户
|
|
|
|
|
|
|
|
LoginUser loginUser = (LoginUser) subject.getPrincipal(); |
|
|
|
|
|
|
|
//角色名称 管理员&教务处可以查看所有
|
|
|
|
|
|
|
|
String realname = loginUser.getRealname(); |
|
|
|
|
|
|
|
|
|
|
|
String compname = annualComp.getCompname(); |
|
|
|
String compname = annualComp.getCompname(); |
|
|
|
String compId = null; |
|
|
|
String compId = null; |
|
|
|
LambdaQueryWrapper<Comp> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Comp> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(compname)) { |
|
|
|
queryWrapper1.eq(Comp::getCompName, compname); |
|
|
|
queryWrapper1.eq(Comp::getCompName, compname); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.equals("管理员", realname) || StringUtils.equals("教务处", realname)) { |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
queryWrapper1.eq(Comp::getCompAdmin, loginUser.getUsername()); |
|
|
|
|
|
|
|
} |
|
|
|
Comp serviceOne = compService.getOne(queryWrapper1); |
|
|
|
Comp serviceOne = compService.getOne(queryWrapper1); |
|
|
|
if (serviceOne != null) { |
|
|
|
if (serviceOne != null) { |
|
|
|
compId = serviceOne.getId(); |
|
|
|
compId = serviceOne.getId(); |
|
|
@ -113,10 +113,18 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
BeanUtils.copyProperties(item, annualCompVo); |
|
|
|
BeanUtils.copyProperties(item, annualCompVo); |
|
|
|
String state = item.getState(); |
|
|
|
String state = item.getState(); |
|
|
|
switch (state) { |
|
|
|
switch (state) { |
|
|
|
case "0":annualCompVo.setState_dictText("待提交");break; |
|
|
|
case "0": |
|
|
|
case "1":annualCompVo.setState_dictText("已提交");break; |
|
|
|
annualCompVo.setState_dictText("待提交"); |
|
|
|
case "2":annualCompVo.setState_dictText("已审核");break; |
|
|
|
break; |
|
|
|
case "3":annualCompVo.setState_dictText("已驳回");break; |
|
|
|
case "1": |
|
|
|
|
|
|
|
annualCompVo.setState_dictText("已提交"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "2": |
|
|
|
|
|
|
|
annualCompVo.setState_dictText("已审核"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "3": |
|
|
|
|
|
|
|
annualCompVo.setState_dictText("已驳回"); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
String compid = item.getCompid(); |
|
|
|
String compid = item.getCompid(); |
|
|
|
Comp comp = compService.getById(compid); |
|
|
|
Comp comp = compService.getById(compid); |
|
|
@ -129,6 +137,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
pageInfo.setRecords(list); |
|
|
|
pageInfo.setRecords(list); |
|
|
|
return Result.OK(pageInfo); |
|
|
|
return Result.OK(pageInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-未审核-分页列表查询", notes = "年度比赛管理-未审核-分页列表查询") |
|
|
|
@ApiOperation(value = "年度比赛管理-未审核-分页列表查询", notes = "年度比赛管理-未审核-分页列表查询") |
|
|
|
@GetMapping(value = "/submittedlist") |
|
|
|
@GetMapping(value = "/submittedlist") |
|
|
|
public Result<IPage<AnnualCompVo>> queryPagesubmittedList(AnnualCompVo annualCompVo, |
|
|
|
public Result<IPage<AnnualCompVo>> queryPagesubmittedList(AnnualCompVo annualCompVo, |
|
|
@ -138,6 +147,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
String state = "1"; |
|
|
|
String state = "1"; |
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-已审核-分页列表查询", notes = "年度比赛管理-已审核-分页列表查询") |
|
|
|
@ApiOperation(value = "年度比赛管理-已审核-分页列表查询", notes = "年度比赛管理-已审核-分页列表查询") |
|
|
|
@GetMapping(value = "/auditedlist") |
|
|
|
@GetMapping(value = "/auditedlist") |
|
|
|
public Result<IPage<AnnualCompVo>> queryPageauditedList(AnnualCompVo annualCompVo, |
|
|
|
public Result<IPage<AnnualCompVo>> queryPageauditedList(AnnualCompVo annualCompVo, |
|
|
@ -147,6 +157,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
String state = "2"; |
|
|
|
String state = "2"; |
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-已驳回-分页列表查询", notes = "年度比赛管理-已驳回-分页列表查询") |
|
|
|
@ApiOperation(value = "年度比赛管理-已驳回-分页列表查询", notes = "年度比赛管理-已驳回-分页列表查询") |
|
|
|
@GetMapping(value = "/rejectedlist") |
|
|
|
@GetMapping(value = "/rejectedlist") |
|
|
|
public Result<IPage<AnnualCompVo>> queryPagerejectedList(AnnualCompVo annualCompVo, |
|
|
|
public Result<IPage<AnnualCompVo>> queryPagerejectedList(AnnualCompVo annualCompVo, |
|
|
@ -156,6 +167,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
String state = "3"; |
|
|
|
String state = "3"; |
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-学校/学生-分页列表查询", notes = "年度比赛管理-学校/学生-分页列表查询") |
|
|
|
@ApiOperation(value = "年度比赛管理-学校/学生-分页列表查询", notes = "年度比赛管理-学校/学生-分页列表查询") |
|
|
|
@GetMapping(value = "/schoollist") |
|
|
|
@GetMapping(value = "/schoollist") |
|
|
|
public Result<IPage<AnnualCompVo>> queryPagereschoollist(AnnualCompVo annualComp, |
|
|
|
public Result<IPage<AnnualCompVo>> queryPagereschoollist(AnnualCompVo annualComp, |
|
|
@ -330,6 +342,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
return Result.OK("已通过!"); |
|
|
|
return Result.OK("已通过!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 驳回 |
|
|
|
* 驳回 |
|
|
|
* |
|
|
|
* |
|
|
@ -345,6 +358,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
return Result.OK("已驳回!"); |
|
|
|
return Result.OK("已驳回!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 提交 |
|
|
|
* 提交 |
|
|
|
* |
|
|
|
* |
|
|
@ -361,6 +375,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
return Result.OK("已提交!"); |
|
|
|
return Result.OK("已提交!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 启用 |
|
|
|
* 启用 |
|
|
|
* |
|
|
|
* |
|
|
@ -376,6 +391,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
return Result.OK("已启用!"); |
|
|
|
return Result.OK("已启用!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 停用 |
|
|
|
* 停用 |
|
|
|
* |
|
|
|
* |
|
|
|