|
|
|
@ -1,59 +1,45 @@ |
|
|
|
|
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.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.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
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.service.IAnnualService; |
|
|
|
|
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; |
|
|
|
|
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.comp.entity.Comp; |
|
|
|
|
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.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
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 com.alibaba.fastjson.JSON; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Description: 年度比赛管理 |
|
|
|
|
* @Author: jeecg-boot |
|
|
|
|
* @Date: 2023-08-17 |
|
|
|
|
* @Version: V1.0 |
|
|
|
|
*/ |
|
|
|
|
@Api(tags="年度比赛管理") |
|
|
|
|
@Api(tags = "年度比赛管理") |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/annualcomp/annualComp") |
|
|
|
|
@Slf4j |
|
|
|
@ -75,48 +61,70 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
//@AutoLog(value = "年度比赛管理-分页列表查询")
|
|
|
|
|
@ApiOperation(value="年度比赛管理-分页列表查询", notes="年度比赛管理-分页列表查询") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-分页列表查询", notes = "年度比赛管理-分页列表查询") |
|
|
|
|
@GetMapping(value = "/list") |
|
|
|
|
public Result<IPage<AnnualCompVo>> queryPageList(AnnualCompVo annualComp, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
// QueryWrapper<AnnualComp> queryWrapper = QueryGenerator.initQueryWrapper(annualComp, req.getParameterMap());
|
|
|
|
|
// Page<AnnualComp> page = new Page<AnnualComp>(pageNo, pageSize);
|
|
|
|
|
// 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 compId = null; |
|
|
|
|
LambdaQueryWrapper<Comp> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName,compname); |
|
|
|
|
if (StringUtils.isNotBlank(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); |
|
|
|
|
if (serviceOne != null){ |
|
|
|
|
if (serviceOne != null) { |
|
|
|
|
compId = serviceOne.getId(); |
|
|
|
|
} |
|
|
|
|
Page<AnnualComp> page = new Page<>(pageNo, pageSize); |
|
|
|
|
Page<AnnualCompVo> pageInfo = new Page<>(); |
|
|
|
|
LambdaQueryWrapper<AnnualComp> queryWrapper = new LambdaQueryWrapper(); |
|
|
|
|
if (compId != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getCompid,compId); |
|
|
|
|
if (compId != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getCompid, compId); |
|
|
|
|
} |
|
|
|
|
if (annualComp.getAnnualid() != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getAnnualid,annualComp.getAnnualid()); |
|
|
|
|
if (annualComp.getAnnualid() != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getAnnualid, annualComp.getAnnualid()); |
|
|
|
|
} |
|
|
|
|
if (annualComp.getName() != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getName,annualComp.getName()); |
|
|
|
|
if (annualComp.getName() != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getName, annualComp.getName()); |
|
|
|
|
} |
|
|
|
|
queryWrapper.orderByDesc(AnnualComp::getCreateTime); |
|
|
|
|
annualCompService.page(page,queryWrapper); |
|
|
|
|
BeanUtils.copyProperties(page,pageInfo,"records"); |
|
|
|
|
annualCompService.page(page, queryWrapper); |
|
|
|
|
BeanUtils.copyProperties(page, pageInfo, "records"); |
|
|
|
|
List<AnnualComp> records = page.getRecords(); |
|
|
|
|
List<AnnualCompVo> list = records.stream().map((item)->{ |
|
|
|
|
List<AnnualCompVo> list = records.stream().map((item) -> { |
|
|
|
|
AnnualCompVo annualCompVo = new AnnualCompVo(); |
|
|
|
|
BeanUtils.copyProperties(item,annualCompVo); |
|
|
|
|
BeanUtils.copyProperties(item, annualCompVo); |
|
|
|
|
String state = item.getState(); |
|
|
|
|
switch (state){ |
|
|
|
|
case "0":annualCompVo.setState_dictText("待提交");break; |
|
|
|
|
case "1":annualCompVo.setState_dictText("已提交");break; |
|
|
|
|
case "2":annualCompVo.setState_dictText("已审核");break; |
|
|
|
|
case "3":annualCompVo.setState_dictText("已驳回");break; |
|
|
|
|
switch (state) { |
|
|
|
|
case "0": |
|
|
|
|
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(); |
|
|
|
|
Comp comp = compService.getById(compid); |
|
|
|
@ -129,68 +137,72 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
pageInfo.setRecords(list); |
|
|
|
|
return Result.OK(pageInfo); |
|
|
|
|
} |
|
|
|
|
@ApiOperation(value="年度比赛管理-未审核-分页列表查询", notes="年度比赛管理-未审核-分页列表查询") |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-未审核-分页列表查询", notes = "年度比赛管理-未审核-分页列表查询") |
|
|
|
|
@GetMapping(value = "/submittedlist") |
|
|
|
|
public Result<IPage<AnnualCompVo>> queryPagesubmittedList(AnnualCompVo annualCompVo, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
String state = "1"; |
|
|
|
|
return getiPageResult(pageNo, pageSize,state,annualCompVo); |
|
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
|
} |
|
|
|
|
@ApiOperation(value="年度比赛管理-已审核-分页列表查询", notes="年度比赛管理-已审核-分页列表查询") |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-已审核-分页列表查询", notes = "年度比赛管理-已审核-分页列表查询") |
|
|
|
|
@GetMapping(value = "/auditedlist") |
|
|
|
|
public Result<IPage<AnnualCompVo>> queryPageauditedList(AnnualCompVo annualCompVo, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
String state = "2"; |
|
|
|
|
return getiPageResult(pageNo, pageSize,state,annualCompVo); |
|
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
|
} |
|
|
|
|
@ApiOperation(value="年度比赛管理-已驳回-分页列表查询", notes="年度比赛管理-已驳回-分页列表查询") |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-已驳回-分页列表查询", notes = "年度比赛管理-已驳回-分页列表查询") |
|
|
|
|
@GetMapping(value = "/rejectedlist") |
|
|
|
|
public Result<IPage<AnnualCompVo>> queryPagerejectedList(AnnualCompVo annualCompVo, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
String state = "3"; |
|
|
|
|
return getiPageResult(pageNo, pageSize,state,annualCompVo); |
|
|
|
|
return getiPageResult(pageNo, pageSize, state, annualCompVo); |
|
|
|
|
} |
|
|
|
|
@ApiOperation(value="年度比赛管理-学校/学生-分页列表查询", notes="年度比赛管理-学校/学生-分页列表查询") |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "年度比赛管理-学校/学生-分页列表查询", notes = "年度比赛管理-学校/学生-分页列表查询") |
|
|
|
|
@GetMapping(value = "/schoollist") |
|
|
|
|
public Result<IPage<AnnualCompVo>> queryPagereschoollist(AnnualCompVo annualComp, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
String compname = annualComp.getCompname(); |
|
|
|
|
String compId = null; |
|
|
|
|
LambdaQueryWrapper<Comp> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName,compname); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName, compname); |
|
|
|
|
Comp serviceOne = compService.getOne(queryWrapper1); |
|
|
|
|
if (serviceOne != null){ |
|
|
|
|
if (serviceOne != null) { |
|
|
|
|
compId = serviceOne.getId(); |
|
|
|
|
} |
|
|
|
|
Page<AnnualComp> page = new Page<>(pageNo, pageSize); |
|
|
|
|
Page<AnnualCompVo> pageInfo = new Page<>(); |
|
|
|
|
LambdaQueryWrapper<AnnualComp> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
if (compId != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getCompid,compId); |
|
|
|
|
if (compId != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getCompid, compId); |
|
|
|
|
} |
|
|
|
|
if (annualComp.getAnnualid() != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getAnnualid,annualComp.getAnnualid()); |
|
|
|
|
if (annualComp.getAnnualid() != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getAnnualid, annualComp.getAnnualid()); |
|
|
|
|
} |
|
|
|
|
if (annualComp.getName() != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getName,annualComp.getName()); |
|
|
|
|
if (annualComp.getName() != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getName, annualComp.getName()); |
|
|
|
|
} |
|
|
|
|
queryWrapper.orderByDesc(AnnualComp::getCreateTime); |
|
|
|
|
queryWrapper.eq(AnnualComp::getState,"2"); |
|
|
|
|
queryWrapper.eq(AnnualComp::getIsopen,"1"); |
|
|
|
|
queryWrapper.eq(AnnualComp::getState, "2"); |
|
|
|
|
queryWrapper.eq(AnnualComp::getIsopen, "1"); |
|
|
|
|
annualCompService.page(page, queryWrapper); |
|
|
|
|
BeanUtils.copyProperties(page,pageInfo,"records"); |
|
|
|
|
BeanUtils.copyProperties(page, pageInfo, "records"); |
|
|
|
|
List<AnnualComp> records = page.getRecords(); |
|
|
|
|
List<AnnualCompVo> list = records.stream().map((item)->{ |
|
|
|
|
List<AnnualCompVo> list = records.stream().map((item) -> { |
|
|
|
|
AnnualCompVo annualCompVo = new AnnualCompVo(); |
|
|
|
|
BeanUtils.copyProperties(item,annualCompVo); |
|
|
|
|
BeanUtils.copyProperties(item, annualCompVo); |
|
|
|
|
String compid = item.getCompid(); |
|
|
|
|
Comp comp = compService.getById(compid); |
|
|
|
|
annualCompVo.setCompname(comp.getCompName()); |
|
|
|
@ -204,35 +216,35 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@NotNull |
|
|
|
|
private Result<IPage<AnnualCompVo>> getiPageResult(Integer pageNo, Integer pageSize, String mystate,AnnualCompVo annualComp) { |
|
|
|
|
private Result<IPage<AnnualCompVo>> getiPageResult(Integer pageNo, Integer pageSize, String mystate, AnnualCompVo annualComp) { |
|
|
|
|
String compname = annualComp.getCompname(); |
|
|
|
|
String compId = null; |
|
|
|
|
LambdaQueryWrapper<Comp> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName,compname); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName, compname); |
|
|
|
|
Comp serviceOne = compService.getOne(queryWrapper1); |
|
|
|
|
if (serviceOne != null){ |
|
|
|
|
if (serviceOne != null) { |
|
|
|
|
compId = serviceOne.getId(); |
|
|
|
|
} |
|
|
|
|
Page<AnnualComp> page = new Page<>(pageNo, pageSize); |
|
|
|
|
Page<AnnualCompVo> pageInfo = new Page<>(); |
|
|
|
|
LambdaQueryWrapper<AnnualComp> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
if (compId != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getCompid,compId); |
|
|
|
|
if (compId != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getCompid, compId); |
|
|
|
|
} |
|
|
|
|
if (annualComp.getAnnualid() != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getAnnualid,annualComp.getAnnualid()); |
|
|
|
|
if (annualComp.getAnnualid() != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getAnnualid, annualComp.getAnnualid()); |
|
|
|
|
} |
|
|
|
|
if (annualComp.getName() != null){ |
|
|
|
|
queryWrapper.eq(AnnualComp::getName,annualComp.getName()); |
|
|
|
|
if (annualComp.getName() != null) { |
|
|
|
|
queryWrapper.eq(AnnualComp::getName, annualComp.getName()); |
|
|
|
|
} |
|
|
|
|
queryWrapper.eq(AnnualComp::getState,mystate); |
|
|
|
|
queryWrapper.eq(AnnualComp::getState, mystate); |
|
|
|
|
queryWrapper.orderByDesc(AnnualComp::getCreateTime); |
|
|
|
|
annualCompService.page(page, queryWrapper); |
|
|
|
|
BeanUtils.copyProperties(page,pageInfo,"records"); |
|
|
|
|
BeanUtils.copyProperties(page, pageInfo, "records"); |
|
|
|
|
List<AnnualComp> records = page.getRecords(); |
|
|
|
|
List<AnnualCompVo> list = records.stream().map((item)->{ |
|
|
|
|
List<AnnualCompVo> list = records.stream().map((item) -> { |
|
|
|
|
AnnualCompVo annualCompVo = new AnnualCompVo(); |
|
|
|
|
BeanUtils.copyProperties(item,annualCompVo); |
|
|
|
|
BeanUtils.copyProperties(item, annualCompVo); |
|
|
|
|
String compid = item.getCompid(); |
|
|
|
|
Comp comp = compService.getById(compid); |
|
|
|
|
annualCompVo.setCompname(comp.getCompName()); |
|
|
|
@ -252,25 +264,25 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-添加") |
|
|
|
|
@ApiOperation(value="年度比赛管理-添加", notes="年度比赛管理-添加") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-添加", notes = "年度比赛管理-添加") |
|
|
|
|
//@RequiresPermissions("annualcomp:annual_comp:add")
|
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<String> add(@RequestBody AnnualCompVo annualCompVo) { |
|
|
|
|
long start = 0,end = 0; |
|
|
|
|
if (annualCompVo.getStarttime() != null){ |
|
|
|
|
long start = 0, end = 0; |
|
|
|
|
if (annualCompVo.getStarttime() != null) { |
|
|
|
|
start = annualCompVo.getStarttime().getTime(); |
|
|
|
|
} |
|
|
|
|
if (annualCompVo.getEndtime() != null){ |
|
|
|
|
if (annualCompVo.getEndtime() != null) { |
|
|
|
|
end = annualCompVo.getEndtime().getTime(); |
|
|
|
|
} |
|
|
|
|
if (start < end){ |
|
|
|
|
if (start < end) { |
|
|
|
|
Result.error("开始时间不能小于结束时间"); |
|
|
|
|
} |
|
|
|
|
String compname = annualCompVo.getCompname(); |
|
|
|
|
String annualname = annualCompVo.getAnnualname(); |
|
|
|
|
annualCompVo.setState("0"); |
|
|
|
|
LambdaQueryWrapper<Comp> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName,compname); |
|
|
|
|
queryWrapper1.eq(Comp::getCompName, compname); |
|
|
|
|
Comp comp = compService.getOne(queryWrapper1); |
|
|
|
|
String compId = comp.getId(); |
|
|
|
|
annualCompVo.setCompid(compId); |
|
|
|
@ -290,24 +302,24 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-编辑") |
|
|
|
|
@ApiOperation(value="年度比赛管理-编辑", notes="年度比赛管理-编辑") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-编辑", notes = "年度比赛管理-编辑") |
|
|
|
|
//@RequiresPermissions("annualcomp:annual_comp:edit")
|
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
|
|
|
|
public Result<String> edit(@RequestBody AnnualComp annualComp) { |
|
|
|
|
if (annualComp.getBackinfo() != null && annualComp.getBackinfo() != ""){ |
|
|
|
|
if (annualComp.getBackinfo() != null && annualComp.getBackinfo() != "") { |
|
|
|
|
annualComp.setState("3"); |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
|
return Result.OK("驳回成功!"); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@AutoLog(value = "年度比赛管理-驳回") |
|
|
|
|
@ApiOperation(value="年度比赛管理-驳回", notes="年度比赛管理-驳回") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-驳回", notes = "年度比赛管理-驳回") |
|
|
|
|
//@RequiresPermissions("annualcomp:annual_comp:bohui")
|
|
|
|
|
@RequestMapping(value = "/bohui", method = {RequestMethod.PUT,RequestMethod.POST}) |
|
|
|
|
@RequestMapping(value = "/bohui", method = {RequestMethod.PUT, RequestMethod.POST}) |
|
|
|
|
public Result<String> bohui(@RequestBody AnnualComp annualComp) { |
|
|
|
|
annualComp.setState("3"); |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
@ -321,7 +333,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-通过") |
|
|
|
|
@ApiOperation(value="年度比赛管理-通过", notes="年度比赛管理-通过") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-通过", notes = "年度比赛管理-通过") |
|
|
|
|
@GetMapping(value = "/pass") |
|
|
|
|
public Result<String> pass(@RequestParam String id) { |
|
|
|
|
AnnualComp annualComp = annualCompService.getById(id); |
|
|
|
@ -330,6 +342,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
|
return Result.OK("已通过!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 驳回 |
|
|
|
|
* |
|
|
|
@ -337,7 +350,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-驳回") |
|
|
|
|
@ApiOperation(value="年度比赛管理-驳回", notes="年度比赛管理-驳回") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-驳回", notes = "年度比赛管理-驳回") |
|
|
|
|
@GetMapping(value = "/unpass") |
|
|
|
|
public Result<String> unpass(@RequestParam String id) { |
|
|
|
|
AnnualComp annualComp = annualCompService.getById(id); |
|
|
|
@ -345,6 +358,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
|
return Result.OK("已驳回!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 提交 |
|
|
|
|
* |
|
|
|
@ -352,7 +366,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-提交") |
|
|
|
|
@ApiOperation(value="年度比赛管理-提交", notes="年度比赛管理-提交") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-提交", notes = "年度比赛管理-提交") |
|
|
|
|
@GetMapping(value = "/submit") |
|
|
|
|
public Result<String> submit(@RequestParam String id) { |
|
|
|
|
AnnualComp annualComp = annualCompService.getById(id); |
|
|
|
@ -361,6 +375,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
|
return Result.OK("已提交!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 启用 |
|
|
|
|
* |
|
|
|
@ -368,7 +383,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-启用") |
|
|
|
|
@ApiOperation(value="年度比赛管理-启用", notes="年度比赛管理-启用") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-启用", notes = "年度比赛管理-启用") |
|
|
|
|
@GetMapping(value = "/enable") |
|
|
|
|
public Result<String> enable(@RequestParam String id) { |
|
|
|
|
AnnualComp annualComp = annualCompService.getById(id); |
|
|
|
@ -376,6 +391,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
annualCompService.updateById(annualComp); |
|
|
|
|
return Result.OK("已启用!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 停用 |
|
|
|
|
* |
|
|
|
@ -383,7 +399,7 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-停用") |
|
|
|
|
@ApiOperation(value="年度比赛管理-停用", notes="年度比赛管理-停用") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-停用", notes = "年度比赛管理-停用") |
|
|
|
|
@GetMapping(value = "/deactivate") |
|
|
|
|
public Result<String> deactivate(@RequestParam String id) { |
|
|
|
|
AnnualComp annualComp = annualCompService.getById(id); |
|
|
|
@ -399,10 +415,10 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-通过id删除") |
|
|
|
|
@ApiOperation(value="年度比赛管理-通过id删除", notes="年度比赛管理-通过id删除") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-通过id删除", notes = "年度比赛管理-通过id删除") |
|
|
|
|
//@RequiresPermissions("annualcomp:annual_comp:delete")
|
|
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
|
annualCompService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
@ -414,10 +430,10 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "年度比赛管理-批量删除") |
|
|
|
|
@ApiOperation(value="年度比赛管理-批量删除", notes="年度比赛管理-批量删除") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-批量删除", notes = "年度比赛管理-批量删除") |
|
|
|
|
@RequiresPermissions("annualcomp:annual_comp:deleteBatch") |
|
|
|
|
@DeleteMapping(value = "/deleteBatch") |
|
|
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
|
|
|
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
|
|
|
|
this.annualCompService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
|
} |
|
|
|
@ -429,11 +445,11 @@ public class AnnualCompController extends JeecgController<AnnualComp, IAnnualCom |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
//@AutoLog(value = "年度比赛管理-通过id查询")
|
|
|
|
|
@ApiOperation(value="年度比赛管理-通过id查询", notes="年度比赛管理-通过id查询") |
|
|
|
|
@ApiOperation(value = "年度比赛管理-通过id查询", notes = "年度比赛管理-通过id查询") |
|
|
|
|
@GetMapping(value = "/queryById") |
|
|
|
|
public Result<AnnualComp> queryById(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
public Result<AnnualComp> queryById(@RequestParam(name = "id", required = true) String id) { |
|
|
|
|
AnnualComp annualComp = annualCompService.getById(id); |
|
|
|
|
if(annualComp==null) { |
|
|
|
|
if (annualComp == null) { |
|
|
|
|
return Result.error("未找到对应数据"); |
|
|
|
|
} |
|
|
|
|
return Result.OK(annualComp); |
|
|
|
|