diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java index 071287f6..b3f7a07b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java @@ -1,19 +1,32 @@ package org.jeecg.modules.demo.annualcompetitionprojectregistration.controller; -import java.io.IOException; -import java.util.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.lang3.StringUtils; -import org.checkerframework.checker.units.qual.A; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.demo.annual.service.IAnnualService; -import org.jeecg.modules.demo.annual.service.impl.AnnualServiceImpl; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.InstructorSheet; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IInstructorSheetService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.AnnualCompetitionProjectRegistrationPage; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.StudentSignUpVo; import org.jeecg.modules.system.entity.*; import org.jeecg.modules.system.service.*; import org.jeecgframework.poi.excel.ExcelImportUtil; @@ -21,41 +34,26 @@ 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.vo.LoginUser; -import org.apache.shiro.SecurityUtils; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.InstructorSheet; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.AnnualCompetitionProjectRegistrationPage; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IInstructorSheetService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; -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 io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; - /** +/** * @Description: 年度比赛项目报名 * @Author: jeecg-boot - * @Date: 2023-08-17 + * @Date: 2023-08-17 * @Version: V1.0 */ -@Api(tags="年度比赛项目报名") +@Api(tags = "年度比赛项目报名") @RestController @RequestMapping("/annualcompetitionprojectregistration/annualCompetitionProjectRegistration") @Slf4j @@ -74,14 +72,31 @@ public class AnnualCompetitionProjectRegistrationController { private ISysRoleService sysRoleService; @Autowired private IAnnualCompPointService annualCompPointService; - @Autowired - private ISysUserDepartService sysUserDepartService; - @Autowired - private ISysDepartService sysDepartService; - @Autowired - private IAnnualService annualService; - @Autowired - private IAnnualCompService annualCompService; + @Autowired + private ISysUserDepartService sysUserDepartService; + @Autowired + private ISysDepartService sysDepartService; + @Autowired + private IAnnualService annualService; + @Autowired + private IAnnualCompService annualCompService; + + + /** + * @description: 学生端-报名 + * @param: [studentSignUpVo] + * @return: org.jeecg.common.api.vo.Result + * @author: z.h.c + * @date: 23/12/13 16:42 + */ + @ApiOperation(value = "年度比赛项目-学生端-报名", notes = "年度比赛项目-学生端-报名") + @PostMapping(value = "/studentSignUp") + public Result studentSignUp(@RequestBody StudentSignUpVo studentSignUpVo) { + log.info("the studentSignUpVo:{}", studentSignUpVo); + annualCompetitionProjectRegistrationService.studentSignUp(studentSignUpVo); + return Result.OK(); + } + /** * 1分页列表查询 @@ -112,209 +127,212 @@ public class AnnualCompetitionProjectRegistrationController { return Result.OK(pageList); } - //@AutoLog(value = "已审核查询年度比赛项目报名-分页列表查询") - @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") - @GetMapping(value = "/list_audited") - public Result> queryPageListAudited(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { - //处理查询信息 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); - queryWrapper.eq("enroll_static", "2"); - //查询 - IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); - //处理返回信息 - processData(pageList.getRecords()); - - return Result.OK(pageList); - } - - //@AutoLog(value = "申请驳回查询年度比赛项目报名-分页列表查询") - @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") - @GetMapping(value = "/list_requestDenied") - public Result> queryPageListRequestDenied(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { - //处理查询信息 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); - queryWrapper.eq("enroll_static", "4"); - //查询 - IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); - //处理返回信息 - processData(pageList.getRecords()); - - return Result.OK(pageList); - } - - - //@AutoLog(value = "待审核查询年度比赛项目报名-分页列表查询") - @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") - @GetMapping(value = "/list_reviewed") - public Result> queryPageListReviewed(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { - //处理查询信息 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); - queryWrapper.eq("enroll_static", "1"); - //查询 - IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); - //处理返回信息 - processData(pageList.getRecords()); - - return Result.OK(pageList); - } - - //@AutoLog(value = "待提交查询年度比赛项目报名-分页列表查询") - @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") - @GetMapping(value = "/list_submitted") - public Result> queryPageListSubmitted(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { - //处理查询信息 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); - queryWrapper.eq("enroll_static", "0"); - //查询 - IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); - //处理返回信息 - processData(pageList.getRecords()); - - return Result.OK(pageList); - } - - //@AutoLog(value = "已驳回查询年度比赛项目报名-分页列表查询") - @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") - @GetMapping(value = "/list_rejected") - public Result> queryPageListRejected(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { - //处理查询信息 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); - queryWrapper.eq("enroll_static", "3"); - //查询 - IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); - //处理返回信息 - processData(pageList.getRecords()); - - return Result.OK(pageList); - } - - /** - * 1.1根据用户角色封装queryWrapper - */ - public void queryWrapperAddRoleInfo(QueryWrapper queryWrapper){ - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - List roles = getRoleByUserId(loginUser.getId()); - for (String role : roles) { - if (role.equals("用户角色") || role.equals("学生")){ - List eCodes = getEnrollCodeByUserId(loginUser.getId()); - queryWrapper.in("enroll_code", eCodes); - return; - } - else if (role.equals("组委会")){ - List annualCompPointList = annualCompPointService.query().eq("create_by", loginUser.getUsername()).list(); - List aIds = new ArrayList<>(); - aIds.add(""); - for (AnnualCompPoint annualCompPoint : annualCompPointList) - aIds.add(annualCompPoint.getId()); - queryWrapper.in("annual_compid", aIds); - return; - }else if (role.equals("学院") || role.equals("院系管理员")){ - List departIds = getDepartIdsByUserId(loginUser.getId()); - List userIdList = new ArrayList<>(); - List enrollCodeList = new ArrayList<>(); - enrollCodeList.add(""); - userIdList.add(""); - for (String departId : departIds) - userIdList.addAll(getUserIdByDepId(departId)); - for (String userId : userIdList) { - List teamManagements = teamManagementService.query().eq("user_id", userId).list(); - for (TeamManagement teamManagement : teamManagements) - enrollCodeList.add(teamManagement.getEnrollCode()); - } - queryWrapper.in("enroll_code", enrollCodeList); - return; - } - - - } - } - - /** - * 查询比赛是否在规定报名时间内 - * @param id - * @return - */ - public Boolean isStipulateTime(String id){ - AnnualCompPoint compPoint = annualCompPointService.query().eq("id", id).one(); - Date date = new Date(); - Date start = compPoint.getApplyStartTime(); - Date end = compPoint.getApplyEndTime(); - if (date.compareTo(start) > 0 && date.compareTo(end) < 0) - return false; - return true; - } - - /** - * 根据部门id获取部门中所有用户id - * @param depId - * @return - */ - public List getUserIdByDepId(String depId){ - List idList = new ArrayList<>(); - List userDeparts = sysUserDepartService.query().eq("dep_id", depId).list(); - for (SysUserDepart userDepart : userDeparts) - idList.add(userDepart.getUserId()); - return idList; - } - - /** - * 根据学生id获取学生所有的报名编号 - * @param userId - * @return - */ - public List getEnrollCodeByUserId(String userId){ - List teamManagementList = teamManagementService.query().eq("user_id", userId).list(); - List eCodes = new ArrayList<>(); - eCodes.add(""); - for (TeamManagement teamManagement : teamManagementList) - eCodes.add(teamManagement.getEnrollCode()); - return eCodes; - } - - /** - * 根据用户id获取部门信息 - * @param userId - * @return - */ - public List getDepartIdsByUserId(String userId){ - List departList = new ArrayList<>(); - List userDeparts = sysUserDepartService.query().eq("user_id", userId).list(); - for (SysUserDepart userDepart : userDeparts) { - SysDepart depart = sysDepartService.query().eq("id", userDepart.getDepId()).one(); - departList.add(depart.getId()); - } - return departList; - } + //@AutoLog(value = "已审核查询年度比赛项目报名-分页列表查询") + @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") + @GetMapping(value = "/list_audited") + public Result> queryPageListAudited(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + //处理查询信息 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + //根据用户角色决定查询信息 + queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.eq("enroll_static", "2"); + //查询 + IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); + //处理返回信息 + processData(pageList.getRecords()); + + return Result.OK(pageList); + } + + //@AutoLog(value = "申请驳回查询年度比赛项目报名-分页列表查询") + @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") + @GetMapping(value = "/list_requestDenied") + public Result> queryPageListRequestDenied(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + //处理查询信息 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + //根据用户角色决定查询信息 + queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.eq("enroll_static", "4"); + //查询 + IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); + //处理返回信息 + processData(pageList.getRecords()); + + return Result.OK(pageList); + } + + + //@AutoLog(value = "待审核查询年度比赛项目报名-分页列表查询") + @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") + @GetMapping(value = "/list_reviewed") + public Result> queryPageListReviewed(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + //处理查询信息 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + //根据用户角色决定查询信息 + queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.eq("enroll_static", "1"); + //查询 + IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); + //处理返回信息 + processData(pageList.getRecords()); + + return Result.OK(pageList); + } + + //@AutoLog(value = "待提交查询年度比赛项目报名-分页列表查询") + @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") + @GetMapping(value = "/list_submitted") + public Result> queryPageListSubmitted(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + //处理查询信息 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + //根据用户角色决定查询信息 + queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.eq("enroll_static", "0"); + //查询 + IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); + //处理返回信息 + processData(pageList.getRecords()); + + return Result.OK(pageList); + } + + //@AutoLog(value = "已驳回查询年度比赛项目报名-分页列表查询") + @ApiOperation(value = "年度比赛项目报名-分页列表查询", notes = "年度比赛项目报名-分页列表查询") + @GetMapping(value = "/list_rejected") + public Result> queryPageListRejected(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + //处理查询信息 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + //根据用户角色决定查询信息 + queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.eq("enroll_static", "3"); + //查询 + IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); + //处理返回信息 + processData(pageList.getRecords()); + + return Result.OK(pageList); + } + + /** + * 1.1根据用户角色封装queryWrapper + */ + public void queryWrapperAddRoleInfo(QueryWrapper queryWrapper) { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List roles = getRoleByUserId(loginUser.getId()); + for (String role : roles) { + if (role.equals("用户角色") || role.equals("学生")) { + List eCodes = getEnrollCodeByUserId(loginUser.getId()); + queryWrapper.in("enroll_code", eCodes); + return; + } else if (role.equals("组委会")) { + List annualCompPointList = annualCompPointService.query().eq("create_by", loginUser.getUsername()).list(); + List aIds = new ArrayList<>(); + aIds.add(""); + for (AnnualCompPoint annualCompPoint : annualCompPointList) + aIds.add(annualCompPoint.getId()); + queryWrapper.in("annual_compid", aIds); + return; + } else if (role.equals("学院") || role.equals("院系管理员")) { + List departIds = getDepartIdsByUserId(loginUser.getId()); + List userIdList = new ArrayList<>(); + List enrollCodeList = new ArrayList<>(); + enrollCodeList.add(""); + userIdList.add(""); + for (String departId : departIds) + userIdList.addAll(getUserIdByDepId(departId)); + for (String userId : userIdList) { + List teamManagements = teamManagementService.query().eq("user_id", userId).list(); + for (TeamManagement teamManagement : teamManagements) + enrollCodeList.add(teamManagement.getEnrollCode()); + } + queryWrapper.in("enroll_code", enrollCodeList); + return; + } + + + } + } + + /** + * 查询比赛是否在规定报名时间内 + * + * @param id + * @return + */ + public Boolean isStipulateTime(String id) { + AnnualCompPoint compPoint = annualCompPointService.query().eq("id", id).one(); + Date date = new Date(); + Date start = compPoint.getApplyStartTime(); + Date end = compPoint.getApplyEndTime(); + if (date.compareTo(start) > 0 && date.compareTo(end) < 0) + return false; + return true; + } + + /** + * 根据部门id获取部门中所有用户id + * + * @param depId + * @return + */ + public List getUserIdByDepId(String depId) { + List idList = new ArrayList<>(); + List userDeparts = sysUserDepartService.query().eq("dep_id", depId).list(); + for (SysUserDepart userDepart : userDeparts) + idList.add(userDepart.getUserId()); + return idList; + } + + /** + * 根据学生id获取学生所有的报名编号 + * + * @param userId + * @return + */ + public List getEnrollCodeByUserId(String userId) { + List teamManagementList = teamManagementService.query().eq("user_id", userId).list(); + List eCodes = new ArrayList<>(); + eCodes.add(""); + for (TeamManagement teamManagement : teamManagementList) + eCodes.add(teamManagement.getEnrollCode()); + return eCodes; + } + + /** + * 根据用户id获取部门信息 + * + * @param userId + * @return + */ + public List getDepartIdsByUserId(String userId) { + List departList = new ArrayList<>(); + List userDeparts = sysUserDepartService.query().eq("user_id", userId).list(); + for (SysUserDepart userDepart : userDeparts) { + SysDepart depart = sysDepartService.query().eq("id", userDepart.getDepId()).one(); + departList.add(depart.getId()); + } + return departList; + } /** @@ -333,553 +351,563 @@ public class AnnualCompetitionProjectRegistrationController { return roleList; } - /** - * 1.3处理展示信息 - * @param records - * @return - */ - public void processData(List records){ - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - List roles = getRoleByUserId(loginUser.getId()); - - //处理参赛形式 - for (AnnualCompetitionProjectRegistration record : records) { - if (record.getEntryFormat().equals("0")) - record.setEntryFormat("个人"); - else - record.setEntryFormat("团队"); - //查询比赛名称放入 + /** + * 1.3处理展示信息 + * + * @param records + * @return + */ + public void processData(List records) { + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List roles = getRoleByUserId(loginUser.getId()); + + //处理参赛形式 + for (AnnualCompetitionProjectRegistration record : records) { + if (record.getEntryFormat().equals("0")) + record.setEntryFormat("个人"); + else + record.setEntryFormat("团队"); + //查询比赛名称放入 // AnnualCompPoint compPoint = annualCompPointService.query().eq("id", record.getAnnualCompid()).one(); // record.setAnnualCompid(compPoint.getObjName()); - String enrollStatic = record.getEnrollStatic(); - //对驳回信息添加默认信息 - // 学生端年度比赛项目之后在驳回状态下才显示驳回原因 modify by zhc 11.21 + String enrollStatic = record.getEnrollStatic(); + //对驳回信息添加默认信息 + // 学生端年度比赛项目之后在驳回状态下才显示驳回原因 modify by zhc 11.21 // if (!enrollStatic.equals("3")){ // record.setBackinfo("无驳回信息"); // } - record.setAnnual(record.getEnrollCode().substring(0, 4)); - } - } - - /** - * 2添加 - * - * @param annualCompetitionProjectRegistrationPage - * @return - */ - @AutoLog(value = "年度比赛项目报名-添加") - @ApiOperation(value="年度比赛项目报名-添加", notes="年度比赛项目报名-添加") + record.setAnnual(record.getEnrollCode().substring(0, 4)); + } + } + + /** + * 2添加 + * + * @param annualCompetitionProjectRegistrationPage + * @return + */ + @AutoLog(value = "年度比赛项目报名-添加") + @ApiOperation(value = "年度比赛项目报名-添加", notes = "年度比赛项目报名-添加") // @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:add") - @PostMapping(value = "/add") - public Result add(@RequestBody AnnualCompetitionProjectRegistrationPage annualCompetitionProjectRegistrationPage) { - //判断是否在报名时间内 - Boolean st = isStipulateTime(annualCompetitionProjectRegistrationPage.getAnnualCompid()); - if (st) - return Result.error("不在操作时间内"); - - //补全报名信息 - parameterSettings(annualCompetitionProjectRegistrationPage); - //判断参数信息的合理性 - Result stringResult = pdParameter(annualCompetitionProjectRegistrationPage); - if (stringResult != null) - return stringResult; - - //添加 - AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); - BeanUtils.copyProperties(annualCompetitionProjectRegistrationPage, annualCompetitionProjectRegistration); - annualCompetitionProjectRegistrationService.saveMain(annualCompetitionProjectRegistration, annualCompetitionProjectRegistrationPage.getTeamManagementList(),annualCompetitionProjectRegistrationPage.getInstructorSheetList()); - return Result.OK("添加成功!"); - } - - /** - * 2.1判断参数信息的合理性 - * @param info - * @return - */ - public Result pdParameter(AnnualCompetitionProjectRegistrationPage info){ - - //获取队伍信息 - List managements = info.getTeamManagementList(); - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - List instructorSheetList = info.getInstructorSheetList(); - Boolean st = false; - - //判断队伍人数是否合格 - AnnualCompPoint compPoint = annualCompPointService.query().eq("id", info.getAnnualCompid()).one(); - if (managements.size() != compPoint.getTeamNumber()) - return Result.error("队伍人数要求" + compPoint.getTeamNumber() + "人,请重新组队"); - if (instructorSheetList.size() != compPoint.getTeacherNumber()) - return Result.error("老师人数要求" + compPoint.getTeacherNumber() + "人,请重新选择"); - - //判断队员是否已经参加这个比赛 - int i = 1; - for (TeamManagement management : managements) { - //获取队员所有的报名编号 - List managementList = teamManagementService.query().eq("user_id", management.getUserId()).list(); - for (TeamManagement teamManagement : managementList) { - AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query() - .eq("enroll_code", teamManagement.getEnrollCode()) - .eq("annual_compid", info.getAnnualCompid()).one(); - if (one != null) - return Result.error("第" + i + "个队员不能重复参加本次比赛"); - } - i ++; - } - - //队伍中要包含自己 - st = false; - for (TeamManagement management : managements) - if (management.getUserId().equals(loginUser.getId())) - st = true; - if (!st) - return Result.error("报名必须包含自己"); - - if (info.getEntryFormat().equals("个人") || info.getEntryFormat().equals("0")){ - // *** 个人比赛类型信息判断,先空着吧,个人不一定传很多参数 - return null; - } - else { - //团队比赛类型信息判断 - if (info.getTeamName() == null) - return Result.error("队伍名称不能为空"); - if (info.getTeamName().length() > 35) - return Result.error("队伍名称长度不能大于35"); - //判断队长和队员信息 - st = false; - Map teamMap = new HashMap<>(); - for (TeamManagement management : managements) { - if (StringUtils.isEmpty(management.getUserId())) - return Result.error("报名队员名称不能为空"); - if (management.getCaptain().equals("1") && st) - return Result.error("一个队伍只能有一个队长"); - if (management.getCaptain().equals("1")) - st = true; - if (teamMap.get(management.getUserId()) != null) - return Result.error("队员重复"); - teamMap.put(management.getUserId(), 1); - } - if (!st) - return Result.error("请选择一个人为队伍队长"); - } - - //指导老师信息核对 - Map teacherMap = new HashMap<>(); - for (InstructorSheet instructorSheet : instructorSheetList) { - if (instructorSheet.getTeacherName() == null) - return Result.error("指导老师姓名不能为空"); - if (instructorSheet.getTeacherType() == null) - return Result.error("指导老师类型不能为空"); - if (teacherMap.get(instructorSheet.getTeacherName()) != null) - return Result.error("老师重复"); - teacherMap.put(instructorSheet.getTeacherName(), 1); - } - - return null; - } - - /** - * 2.2手动补全报名中的参数 - * - * 此方法修改和新增时都要使用,但在修改时,有一些报名状态不能改变:报名编号,报名状态... - * - * @param info - */ - public void parameterSettings(AnnualCompetitionProjectRegistrationPage info){ - AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", info.getId()).one(); - if (one != null){ - info.setEnrollCode(one.getEnrollCode()); - info.setEnrollStatic(one.getEnrollStatic()); - } - - //生成报名编号 - String enrollCode; - //查询年度 - String annualCompId = annualCompPointService.query().eq("id", info.getAnnualCompid()).one().getAnnualCompId(); - String annualId = annualCompService.query().eq("id", annualCompId).one().getAnnualid(); - String annualName = annualService.query().eq("id", annualId).one().getAnnualName(); - - - //设置报名初始状态:已提交 - if (one == null) - info.setEnrollStatic("1"); - - //设置参赛形式 - if (info.getEntryFormat().equals("个人") || info.getEntryFormat().equals("0")){ - info.setEntryFormat("0"); - enrollCode = getEnrollCode(annualName + "gr"); - } else{ - info.setEntryFormat("1"); - enrollCode = getEnrollCode(annualName + "td"); - } - //设置报名编号 - if (one == null) - info.setEnrollCode(enrollCode); - enrollCode = info.getEnrollCode(); - - - //设置队员报名编号,userId - List managements = info.getTeamManagementList(); - for (TeamManagement management : managements) { - //设置报名编号 - management.setEnrollCode(enrollCode); - //根据名称查用户id(如果前端传的只是姓名的话) - SysUser user = sysUserService.query().eq("realname", management.getUserId()).one(); - management.setUserId(user.getId()); - //补全用户未输入信息 -- 是否队长 - if (management.getCaptain() == null) - management.setCaptain("0"); - } - - //设置老师队伍报名编号,项目id - List instructorSheetList = info.getInstructorSheetList(); - for (InstructorSheet instructorSheet : instructorSheetList) { - //设置报名编号 - instructorSheet.setEnrollCode(enrollCode); - //年度项目id - instructorSheet.setAnnualCompid(info.getAnnualCompid()); - } - } - - /** - * 2.3生成全局唯一报名编号 - * @param type - * @return - */ - public String getEnrollCode(String type){ - String enrollCode = type; - String uuid = IdUtil.randomUUID().replaceAll("-","");; - enrollCode += uuid.substring(0, 16); - List list = annualCompetitionProjectRegistrationService.query().eq("enroll_code", enrollCode).list(); - if (list == null || list.size() == 0) - return enrollCode.toUpperCase(); - else - return getEnrollCode(type); - } - - /** - * 编辑 - * - * @param annualCompetitionProjectRegistrationPage - * @return - */ - @AutoLog(value = "年度比赛项目报名-编辑") - @ApiOperation(value="年度比赛项目报名-编辑", notes="年度比赛项目报名-编辑") + @PostMapping(value = "/add") + public Result add(@RequestBody AnnualCompetitionProjectRegistrationPage annualCompetitionProjectRegistrationPage) { + //判断是否在报名时间内 + Boolean st = isStipulateTime(annualCompetitionProjectRegistrationPage.getAnnualCompid()); + if (st) + return Result.error("不在操作时间内"); + + //补全报名信息 + parameterSettings(annualCompetitionProjectRegistrationPage); + //判断参数信息的合理性 + Result stringResult = pdParameter(annualCompetitionProjectRegistrationPage); + if (stringResult != null) + return stringResult; + + //添加 + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); + BeanUtils.copyProperties(annualCompetitionProjectRegistrationPage, annualCompetitionProjectRegistration); + annualCompetitionProjectRegistrationService.saveMain(annualCompetitionProjectRegistration, annualCompetitionProjectRegistrationPage.getTeamManagementList(), annualCompetitionProjectRegistrationPage.getInstructorSheetList()); + return Result.OK("添加成功!"); + } + + /** + * 2.1判断参数信息的合理性 + * + * @param info + * @return + */ + public Result pdParameter(AnnualCompetitionProjectRegistrationPage info) { + + //获取队伍信息 + List managements = info.getTeamManagementList(); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List instructorSheetList = info.getInstructorSheetList(); + Boolean st = false; + + //判断队伍人数是否合格 + AnnualCompPoint compPoint = annualCompPointService.query().eq("id", info.getAnnualCompid()).one(); + if (managements.size() != compPoint.getTeamNumber()) + return Result.error("队伍人数要求" + compPoint.getTeamNumber() + "人,请重新组队"); + if (instructorSheetList.size() != compPoint.getTeacherNumber()) + return Result.error("老师人数要求" + compPoint.getTeacherNumber() + "人,请重新选择"); + + //判断队员是否已经参加这个比赛 + int i = 1; + for (TeamManagement management : managements) { + //获取队员所有的报名编号 + List managementList = teamManagementService.query().eq("user_id", management.getUserId()).list(); + for (TeamManagement teamManagement : managementList) { + AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query() + .eq("enroll_code", teamManagement.getEnrollCode()) + .eq("annual_compid", info.getAnnualCompid()).one(); + if (one != null) + return Result.error("第" + i + "个队员不能重复参加本次比赛"); + } + i++; + } + + //队伍中要包含自己 + st = false; + for (TeamManagement management : managements) + if (management.getUserId().equals(loginUser.getId())) + st = true; + if (!st) + return Result.error("报名必须包含自己"); + + if (info.getEntryFormat().equals("个人") || info.getEntryFormat().equals("0")) { + // *** 个人比赛类型信息判断,先空着吧,个人不一定传很多参数 + return null; + } else { + //团队比赛类型信息判断 + if (info.getTeamName() == null) + return Result.error("队伍名称不能为空"); + if (info.getTeamName().length() > 35) + return Result.error("队伍名称长度不能大于35"); + //判断队长和队员信息 + st = false; + Map teamMap = new HashMap<>(); + for (TeamManagement management : managements) { + if (StringUtils.isEmpty(management.getUserId())) + return Result.error("报名队员名称不能为空"); + if (management.getCaptain().equals("1") && st) + return Result.error("一个队伍只能有一个队长"); + if (management.getCaptain().equals("1")) + st = true; + if (teamMap.get(management.getUserId()) != null) + return Result.error("队员重复"); + teamMap.put(management.getUserId(), 1); + } + if (!st) + return Result.error("请选择一个人为队伍队长"); + } + + //指导老师信息核对 + Map teacherMap = new HashMap<>(); + for (InstructorSheet instructorSheet : instructorSheetList) { + if (instructorSheet.getTeacherName() == null) + return Result.error("指导老师姓名不能为空"); + if (instructorSheet.getTeacherType() == null) + return Result.error("指导老师类型不能为空"); + if (teacherMap.get(instructorSheet.getTeacherName()) != null) + return Result.error("老师重复"); + teacherMap.put(instructorSheet.getTeacherName(), 1); + } + + return null; + } + + /** + * 2.2手动补全报名中的参数 + *

+ * 此方法修改和新增时都要使用,但在修改时,有一些报名状态不能改变:报名编号,报名状态... + * + * @param info + */ + public void parameterSettings(AnnualCompetitionProjectRegistrationPage info) { + AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", info.getId()).one(); + if (one != null) { + info.setEnrollCode(one.getEnrollCode()); + info.setEnrollStatic(one.getEnrollStatic()); + } + + //生成报名编号 + String enrollCode; + //查询年度 + String annualCompId = annualCompPointService.query().eq("id", info.getAnnualCompid()).one().getAnnualCompId(); + String annualId = annualCompService.query().eq("id", annualCompId).one().getAnnualid(); + String annualName = annualService.query().eq("id", annualId).one().getAnnualName(); + + + //设置报名初始状态:已提交 + if (one == null) + info.setEnrollStatic("1"); + + //设置参赛形式 + if (info.getEntryFormat().equals("个人") || info.getEntryFormat().equals("0")) { + info.setEntryFormat("0"); + enrollCode = getEnrollCode(annualName + "gr"); + } else { + info.setEntryFormat("1"); + enrollCode = getEnrollCode(annualName + "td"); + } + //设置报名编号 + if (one == null) + info.setEnrollCode(enrollCode); + enrollCode = info.getEnrollCode(); + + + //设置队员报名编号,userId + List managements = info.getTeamManagementList(); + for (TeamManagement management : managements) { + //设置报名编号 + management.setEnrollCode(enrollCode); + //根据名称查用户id(如果前端传的只是姓名的话) + SysUser user = sysUserService.query().eq("realname", management.getUserId()).one(); + management.setUserId(user.getId()); + //补全用户未输入信息 -- 是否队长 + if (management.getCaptain() == null) + management.setCaptain("0"); + } + + //设置老师队伍报名编号,项目id + List instructorSheetList = info.getInstructorSheetList(); + for (InstructorSheet instructorSheet : instructorSheetList) { + //设置报名编号 + instructorSheet.setEnrollCode(enrollCode); + //年度项目id + instructorSheet.setAnnualCompid(info.getAnnualCompid()); + } + } + + /** + * 2.3生成全局唯一报名编号 + * + * @param type + * @return + */ + public String getEnrollCode(String type) { + String enrollCode = type; + String uuid = IdUtil.randomUUID().replaceAll("-", ""); + ; + enrollCode += uuid.substring(0, 16); + List list = annualCompetitionProjectRegistrationService.query().eq("enroll_code", enrollCode).list(); + if (list == null || list.size() == 0) + return enrollCode.toUpperCase(); + else + return getEnrollCode(type); + } + + /** + * 编辑 + * + * @param annualCompetitionProjectRegistrationPage + * @return + */ + @AutoLog(value = "年度比赛项目报名-编辑") + @ApiOperation(value = "年度比赛项目报名-编辑", notes = "年度比赛项目报名-编辑") // @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody AnnualCompetitionProjectRegistrationPage annualCompetitionProjectRegistrationPage) { - //判断是否为新增,以为前端访问的也是这个页面 - if (annualCompetitionProjectRegistrationPage.getAnnualCompid().length() < 11){//说明走的新增,判断有点儿问题 - annualCompetitionProjectRegistrationPage.setAnnualCompid(annualCompetitionProjectRegistrationPage.getId()); - annualCompetitionProjectRegistrationPage.setId(null); - String entryFormat = annualCompetitionProjectRegistrationPage.getEntryFormat(); - if (entryFormat.equals("个人")) - annualCompetitionProjectRegistrationPage.setEntryFormat("0"); - else - annualCompetitionProjectRegistrationPage.setEntryFormat("1"); - //调用报名方法 - return add(annualCompetitionProjectRegistrationPage); - } - //根据报名状态判断是否能够进行修改 - String id = annualCompetitionProjectRegistrationPage.getId(); - AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - String enrollStatic = one.getEnrollStatic(); - String enrollCode = one.getEnrollCode(); - String userId = loginUser.getId(); - if (!enrollStatic.equals("3") && !enrollStatic.equals("0")) - return Result.error("报名信息已提交,不能修改,如需修改请申请驳回,待驳回成功后方可修改"); - //判断用户身份只有小队的队长可以修改 - TeamManagement management = teamManagementService.query().eq("enroll_code", enrollCode).eq("user_id", userId).one(); - if (management == null) - return Result.error("请联系参赛队长修改参赛信息!"); - if (management.getCaptain().equals("0")) - return Result.error("队员不能修改参赛信息,请联系参赛队长修改参赛信息!"); - - //补全报名信息 - parameterSettings(annualCompetitionProjectRegistrationPage); - //判断信息合理性 - pdParameter(annualCompetitionProjectRegistrationPage); - - AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); - BeanUtils.copyProperties(annualCompetitionProjectRegistrationPage, annualCompetitionProjectRegistration); - AnnualCompetitionProjectRegistration annualCompetitionProjectRegistrationEntity = annualCompetitionProjectRegistrationService.getById(annualCompetitionProjectRegistration.getId()); - if(annualCompetitionProjectRegistrationEntity==null) { - return Result.error("未找到对应数据"); - } - annualCompetitionProjectRegistrationService.updateMain(annualCompetitionProjectRegistration, annualCompetitionProjectRegistrationPage.getTeamManagementList(),annualCompetitionProjectRegistrationPage.getInstructorSheetList()); - return Result.OK("编辑成功!"); - } - - /** - * 改造后:申请驳回/驳回申请 - * @param id - * @return - */ - @AutoLog(value = "年度比赛项目报名-通过id和身份申请驳回/驳回申请") - @ApiOperation(value="年度比赛项目报名-通过id申请驳回", notes="年度比赛项目报名-通过id和身份申请驳回/驳回申请") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AnnualCompetitionProjectRegistrationPage annualCompetitionProjectRegistrationPage) { + //判断是否为新增,以为前端访问的也是这个页面 + if (annualCompetitionProjectRegistrationPage.getAnnualCompid().length() < 11) {//说明走的新增,判断有点儿问题 + annualCompetitionProjectRegistrationPage.setAnnualCompid(annualCompetitionProjectRegistrationPage.getId()); + annualCompetitionProjectRegistrationPage.setId(null); + String entryFormat = annualCompetitionProjectRegistrationPage.getEntryFormat(); + if (entryFormat.equals("个人")) + annualCompetitionProjectRegistrationPage.setEntryFormat("0"); + else + annualCompetitionProjectRegistrationPage.setEntryFormat("1"); + //调用报名方法 + return add(annualCompetitionProjectRegistrationPage); + } + //根据报名状态判断是否能够进行修改 + String id = annualCompetitionProjectRegistrationPage.getId(); + AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String enrollStatic = one.getEnrollStatic(); + String enrollCode = one.getEnrollCode(); + String userId = loginUser.getId(); + if (!enrollStatic.equals("3") && !enrollStatic.equals("0")) + return Result.error("报名信息已提交,不能修改,如需修改请申请驳回,待驳回成功后方可修改"); + //判断用户身份只有小队的队长可以修改 + TeamManagement management = teamManagementService.query().eq("enroll_code", enrollCode).eq("user_id", userId).one(); + if (management == null) + return Result.error("请联系参赛队长修改参赛信息!"); + if (management.getCaptain().equals("0")) + return Result.error("队员不能修改参赛信息,请联系参赛队长修改参赛信息!"); + + //补全报名信息 + parameterSettings(annualCompetitionProjectRegistrationPage); + //判断信息合理性 + pdParameter(annualCompetitionProjectRegistrationPage); + + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); + BeanUtils.copyProperties(annualCompetitionProjectRegistrationPage, annualCompetitionProjectRegistration); + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistrationEntity = annualCompetitionProjectRegistrationService.getById(annualCompetitionProjectRegistration.getId()); + if (annualCompetitionProjectRegistrationEntity == null) { + return Result.error("未找到对应数据"); + } + annualCompetitionProjectRegistrationService.updateMain(annualCompetitionProjectRegistration, annualCompetitionProjectRegistrationPage.getTeamManagementList(), annualCompetitionProjectRegistrationPage.getInstructorSheetList()); + return Result.OK("编辑成功!"); + } + + /** + * 改造后:申请驳回/驳回申请 + * + * @param id + * @return + */ + @AutoLog(value = "年度比赛项目报名-通过id和身份申请驳回/驳回申请") + @ApiOperation(value = "年度比赛项目报名-通过id申请驳回", notes = "年度比赛项目报名-通过id和身份申请驳回/驳回申请") // @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - //判断用户身份 - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - List roles = getRoleByUserId(loginUser.getId()); - for (String role : roles) { - if (role.equals("学生") || role.equals("用户角色")) - return applicationRefusal(id); - else if (role.equals("组委会")) - return refusalApplication(id); - } - - return Result.error("没有权限操作!"); - } - - /** - * 组委会将申请进行驳回 - * @param id - * @return - */ - public Result refusalApplication(String id){ - AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - String enrollStatic = one.getEnrollStatic(); - if (enrollStatic.equals("1") || enrollStatic.equals("2") || enrollStatic.equals("4")){ - one.setEnrollStatic("3"); - one.setBackinfo("申请已驳回,请重新修改并提交"); - annualCompetitionProjectRegistrationService.updateById(one); - return Result.OK("驳回申请成功"); - } - - return Result.error("不需要申请驳回!"); - } - - /** - * 学生申请驳回操作 - * @return - */ - public Result applicationRefusal(String id){ - AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - - if (!(one.getEnrollStatic().equals("3") || one.getEnrollStatic().equals("4") || one.getEnrollStatic().equals("0"))) { - AnnualCompetitionProjectRegistration a = new AnnualCompetitionProjectRegistration(); - a.setId(id); - a.setEnrollStatic("4"); - annualCompetitionProjectRegistrationService.updateById(a); - return Result.OK("已申请驳回!"); - } - - return Result.error("不需要申请驳回!"); - } - - - /** - * 学生提交申请,组委会通过申请 - * @param id - * @return - */ - @AutoLog(value = "年度比赛项目报名-学生提交申请,组委会通过申请") - @ApiOperation(value="年度比赛项目报名-学生提交申请,组委会通过申请", notes="年度比赛项目报名-学生提交申请,组委会通过申请") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + //判断用户身份 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List roles = getRoleByUserId(loginUser.getId()); + for (String role : roles) { + if (role.equals("学生") || role.equals("用户角色")) + return applicationRefusal(id); + else if (role.equals("组委会")) + return refusalApplication(id); + } + + return Result.error("没有权限操作!"); + } + + /** + * 组委会将申请进行驳回 + * + * @param id + * @return + */ + public Result refusalApplication(String id) { + AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + String enrollStatic = one.getEnrollStatic(); + if (enrollStatic.equals("1") || enrollStatic.equals("2") || enrollStatic.equals("4")) { + one.setEnrollStatic("3"); + one.setBackinfo("申请已驳回,请重新修改并提交"); + annualCompetitionProjectRegistrationService.updateById(one); + return Result.OK("驳回申请成功"); + } + + return Result.error("不需要申请驳回!"); + } + + /** + * 学生申请驳回操作 + * + * @return + */ + public Result applicationRefusal(String id) { + AnnualCompetitionProjectRegistration one = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + + if (!(one.getEnrollStatic().equals("3") || one.getEnrollStatic().equals("4") || one.getEnrollStatic().equals("0"))) { + AnnualCompetitionProjectRegistration a = new AnnualCompetitionProjectRegistration(); + a.setId(id); + a.setEnrollStatic("4"); + annualCompetitionProjectRegistrationService.updateById(a); + return Result.OK("已申请驳回!"); + } + + return Result.error("不需要申请驳回!"); + } + + + /** + * 学生提交申请,组委会通过申请 + * + * @param id + * @return + */ + @AutoLog(value = "年度比赛项目报名-学生提交申请,组委会通过申请") + @ApiOperation(value = "年度比赛项目报名-学生提交申请,组委会通过申请", notes = "年度比赛项目报名-学生提交申请,组委会通过申请") // @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:delete") - @DeleteMapping(value = "/committed") - public Result committed(@RequestParam(name="id",required=true) String id) { - //判断用户身份 - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - List roles = getRoleByUserId(loginUser.getId()); - for (String role : roles) { - if (role.equals("学生")) - return commitApplication(id); - else if (role.equals("组委会")) - return passApplication(id); - } - - return Result.error("没有权限操作!"); - } - - /** - * 组委会通过申请 - * @return - */ - public Result passApplication(String id){ - AnnualCompetitionProjectRegistration compRegistration = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - String enrollStatic = compRegistration.getEnrollStatic(); - if (enrollStatic.equals("1")){ - compRegistration.setEnrollStatic("2"); - annualCompetitionProjectRegistrationService.updateById(compRegistration); - return Result.OK("通过申请成功"); - } - return Result.error("当前状态不能通过申请"); - } - - /** - * 学生提交申请 - * @return - */ - public Result commitApplication(String id){ - AnnualCompetitionProjectRegistration compRegistration = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - String enrollStatic = compRegistration.getEnrollStatic(); - if (!enrollStatic.equals("0") && !enrollStatic.equals("3")) - return Result.error("当前状态不需要提交"); - compRegistration.setEnrollStatic("1"); - compRegistration.setBackinfo(""); - annualCompetitionProjectRegistrationService.updateById(compRegistration); - return Result.OK("提交报名信息成功"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "年度比赛项目报名-批量删除") - @ApiOperation(value="年度比赛项目报名-批量删除", notes="年度比赛项目报名-批量删除") + @DeleteMapping(value = "/committed") + public Result committed(@RequestParam(name = "id", required = true) String id) { + //判断用户身份 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List roles = getRoleByUserId(loginUser.getId()); + for (String role : roles) { + if (role.equals("学生")) + return commitApplication(id); + else if (role.equals("组委会")) + return passApplication(id); + } + + return Result.error("没有权限操作!"); + } + + /** + * 组委会通过申请 + * + * @return + */ + public Result passApplication(String id) { + AnnualCompetitionProjectRegistration compRegistration = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + String enrollStatic = compRegistration.getEnrollStatic(); + if (enrollStatic.equals("1")) { + compRegistration.setEnrollStatic("2"); + annualCompetitionProjectRegistrationService.updateById(compRegistration); + return Result.OK("通过申请成功"); + } + return Result.error("当前状态不能通过申请"); + } + + /** + * 学生提交申请 + * + * @return + */ + public Result commitApplication(String id) { + AnnualCompetitionProjectRegistration compRegistration = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + String enrollStatic = compRegistration.getEnrollStatic(); + if (!enrollStatic.equals("0") && !enrollStatic.equals("3")) + return Result.error("当前状态不需要提交"); + compRegistration.setEnrollStatic("1"); + compRegistration.setBackinfo(""); + annualCompetitionProjectRegistrationService.updateById(compRegistration); + return Result.OK("提交报名信息成功"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "年度比赛项目报名-批量删除") + @ApiOperation(value = "年度比赛项目报名-批量删除", notes = "年度比赛项目报名-批量删除") // @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.annualCompetitionProjectRegistrationService.delBatchMain(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "年度比赛项目报名-通过id查询") - @ApiOperation(value="年度比赛项目报名-通过id查询", notes="年度比赛项目报名-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = annualCompetitionProjectRegistrationService.getById(id); - if(annualCompetitionProjectRegistration==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(annualCompetitionProjectRegistration); - - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "团队成员表通过主表ID查询") - @ApiOperation(value="团队成员表主表ID查询", notes="团队成员表-通主表ID查询") - @GetMapping(value = "/queryTeamManagementByMainId") - public Result> queryTeamManagementListByMainId(@RequestParam(name="id",required=true) String id) { - //获取报名编号用来查询 - AnnualCompetitionProjectRegistration annualCompInfo = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - if (annualCompInfo == null) - return Result.error("查询对应队伍信息失败"); - List teamManagementList = teamManagementService.selectByMainId(annualCompInfo.getEnrollCode()); - //将获取的用户id查询对应名称 - for (TeamManagement teamManagement: teamManagementList){ - SysUser user = sysUserService.query().eq("id", teamManagement.getUserId()).one(); - teamManagement.setUserId(user.getRealname()); - } - return Result.OK(teamManagementList); - } - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "指导老师表通过主表ID查询") - @ApiOperation(value="指导老师表主表ID查询", notes="指导老师表-通主表ID查询") - @GetMapping(value = "/queryInstructorSheetByMainId") - public Result> queryInstructorSheetListByMainId(@RequestParam(name="id",required=true) String id) { - //获取报名编号用来查询 - AnnualCompetitionProjectRegistration annualCompInfo = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); - if (annualCompInfo == null) - return Result.error("查询对应队伍信息失败"); - List instructorSheetList = instructorSheetService.selectByMainId(annualCompInfo.getEnrollCode()); - return Result.OK(instructorSheetList); - } + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.annualCompetitionProjectRegistrationService.delBatchMain(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } /** - * 导出excel - * - * @param request - * @param annualCompetitionProjectRegistration - */ + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "年度比赛项目报名-通过id查询") + @ApiOperation(value = "年度比赛项目报名-通过id查询", notes = "年度比赛项目报名-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = annualCompetitionProjectRegistrationService.getById(id); + if (annualCompetitionProjectRegistration == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(annualCompetitionProjectRegistration); + + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "团队成员表通过主表ID查询") + @ApiOperation(value = "团队成员表主表ID查询", notes = "团队成员表-通主表ID查询") + @GetMapping(value = "/queryTeamManagementByMainId") + public Result> queryTeamManagementListByMainId(@RequestParam(name = "id", required = true) String id) { + //获取报名编号用来查询 + AnnualCompetitionProjectRegistration annualCompInfo = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + if (annualCompInfo == null) + return Result.error("查询对应队伍信息失败"); + List teamManagementList = teamManagementService.selectByMainId(annualCompInfo.getEnrollCode()); + //将获取的用户id查询对应名称 + for (TeamManagement teamManagement : teamManagementList) { + SysUser user = sysUserService.query().eq("id", teamManagement.getUserId()).one(); + teamManagement.setUserId(user.getRealname()); + } + return Result.OK(teamManagementList); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "指导老师表通过主表ID查询") + @ApiOperation(value = "指导老师表主表ID查询", notes = "指导老师表-通主表ID查询") + @GetMapping(value = "/queryInstructorSheetByMainId") + public Result> queryInstructorSheetListByMainId(@RequestParam(name = "id", required = true) String id) { + //获取报名编号用来查询 + AnnualCompetitionProjectRegistration annualCompInfo = annualCompetitionProjectRegistrationService.query().eq("id", id).one(); + if (annualCompInfo == null) + return Result.error("查询对应队伍信息失败"); + List instructorSheetList = instructorSheetService.selectByMainId(annualCompInfo.getEnrollCode()); + return Result.OK(instructorSheetList); + } + + /** + * 导出excel + * + * @param request + * @param annualCompetitionProjectRegistration + */ @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration) { - // Step.1 组装查询条件查询数据 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, request.getParameterMap()); - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - - //配置选中数据查询条件 - String selections = request.getParameter("selections"); - if(oConvertUtils.isNotEmpty(selections)) { - List selectionList = Arrays.asList(selections.split(",")); - queryWrapper.in("id",selectionList); - } - //Step.2 获取导出数据 - List annualCompetitionProjectRegistrationList = annualCompetitionProjectRegistrationService.list(queryWrapper); - - // Step.3 组装pageList - List pageList = new ArrayList(); - for (AnnualCompetitionProjectRegistration main : annualCompetitionProjectRegistrationList) { - AnnualCompetitionProjectRegistrationPage vo = new AnnualCompetitionProjectRegistrationPage(); - BeanUtils.copyProperties(main, vo); - List teamManagementList = teamManagementService.selectByMainId(main.getId()); - vo.setTeamManagementList(teamManagementList); - List instructorSheetList = instructorSheetService.selectByMainId(main.getId()); - vo.setInstructorSheetList(instructorSheetList); - pageList.add(vo); - } - - // Step.4 AutoPoi 导出Excel - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); - mv.addObject(NormalExcelConstants.FILE_NAME, "年度比赛项目报名列表"); - mv.addObject(NormalExcelConstants.CLASS, AnnualCompetitionProjectRegistrationPage.class); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("年度比赛项目报名数据", "导出人:"+sysUser.getRealname(), "年度比赛项目报名")); - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); - return mv; + // Step.1 组装查询条件查询数据 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, request.getParameterMap()); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + //配置选中数据查询条件 + String selections = request.getParameter("selections"); + if (oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id", selectionList); + } + //Step.2 获取导出数据 + List annualCompetitionProjectRegistrationList = annualCompetitionProjectRegistrationService.list(queryWrapper); + + // Step.3 组装pageList + List pageList = new ArrayList(); + for (AnnualCompetitionProjectRegistration main : annualCompetitionProjectRegistrationList) { + AnnualCompetitionProjectRegistrationPage vo = new AnnualCompetitionProjectRegistrationPage(); + BeanUtils.copyProperties(main, vo); + List teamManagementList = teamManagementService.selectByMainId(main.getId()); + vo.setTeamManagementList(teamManagementList); + List instructorSheetList = instructorSheetService.selectByMainId(main.getId()); + vo.setInstructorSheetList(instructorSheetList); + pageList.add(vo); + } + + // Step.4 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + mv.addObject(NormalExcelConstants.FILE_NAME, "年度比赛项目报名列表"); + mv.addObject(NormalExcelConstants.CLASS, AnnualCompetitionProjectRegistrationPage.class); + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("年度比赛项目报名数据", "导出人:" + sysUser.getRealname(), "年度比赛项目报名")); + mv.addObject(NormalExcelConstants.DATA_LIST, pageList); + return mv; } /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ @RequiresPermissions("annualcompetitionprojectregistration:annual_competition_project_registration:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - // 获取上传文件对象 - MultipartFile file = entity.getValue(); - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List list = ExcelImportUtil.importExcel(file.getInputStream(), AnnualCompetitionProjectRegistrationPage.class, params); - for (AnnualCompetitionProjectRegistrationPage page : list) { - AnnualCompetitionProjectRegistration po = new AnnualCompetitionProjectRegistration(); - BeanUtils.copyProperties(page, po); - annualCompetitionProjectRegistrationService.saveMain(po, page.getTeamManagementList(),page.getInstructorSheetList()); - } - return Result.OK("文件导入成功!数据行数:" + list.size()); - } catch (Exception e) { - log.error(e.getMessage(),e); - return Result.error("文件导入失败:"+e.getMessage()); - } finally { - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return Result.OK("文件导入失败!"); + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map fileMap = multipartRequest.getFileMap(); + for (Map.Entry entity : fileMap.entrySet()) { + // 获取上传文件对象 + MultipartFile file = entity.getValue(); + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List list = ExcelImportUtil.importExcel(file.getInputStream(), AnnualCompetitionProjectRegistrationPage.class, params); + for (AnnualCompetitionProjectRegistrationPage page : list) { + AnnualCompetitionProjectRegistration po = new AnnualCompetitionProjectRegistration(); + BeanUtils.copyProperties(page, po); + annualCompetitionProjectRegistrationService.saveMain(po, page.getTeamManagementList(), page.getInstructorSheetList()); + } + return Result.OK("文件导入成功!数据行数:" + list.size()); + } catch (Exception e) { + log.error(e.getMessage(), e); + return Result.error("文件导入失败:" + e.getMessage()); + } finally { + try { + file.getInputStream().close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return Result.OK("文件导入失败!"); } @PostMapping(value = "/choose") diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/IAnnualCompetitionProjectRegistrationService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/IAnnualCompetitionProjectRegistrationService.java index 8e3f4372..7e76a4b1 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/IAnnualCompetitionProjectRegistrationService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/IAnnualCompetitionProjectRegistrationService.java @@ -1,9 +1,12 @@ package org.jeecg.modules.demo.annualcompetitionprojectregistration.service; +import org.jeecg.common.api.vo.Result; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.InstructorSheet; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.StudentSignUpVo; + import java.io.Serializable; import java.util.Collection; import java.util.List; @@ -24,7 +27,7 @@ public interface IAnnualCompetitionProjectRegistrationService extends IService teamManagementList,List instructorSheetList) ; - + /** * 修改一对多 * @@ -33,14 +36,14 @@ public interface IAnnualCompetitionProjectRegistrationService extends IService teamManagementList,List instructorSheetList); - + /** * 删除一对多 * * @param id */ public void delMain (String id); - + /** * 批量删除一对多 * @@ -49,5 +52,6 @@ public interface IAnnualCompetitionProjectRegistrationService extends IService idList); AnnualCompetitionProjectRegistration getRegistrationByAnnualCompPointId(String annualCompPointId); - + + void studentSignUp(StudentSignUpVo studentSignUpVo); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/impl/AnnualCompetitionProjectRegistrationServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/impl/AnnualCompetitionProjectRegistrationServiceImpl.java index 71a58816..1baf9b5f 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/impl/AnnualCompetitionProjectRegistrationServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/impl/AnnualCompetitionProjectRegistrationServiceImpl.java @@ -1,9 +1,17 @@ package org.jeecg.modules.demo.annualcompetitionprojectregistration.service.impl; +import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; 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.annualCompPoint.entity.AnnualCompPoint; +import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; +import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; +import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.InstructorSheet; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement; @@ -11,127 +19,261 @@ import org.jeecg.modules.demo.annualcompetitionprojectregistration.mapper.Annual import org.jeecg.modules.demo.annualcompetitionprojectregistration.mapper.InstructorSheetMapper; import org.jeecg.modules.demo.annualcompetitionprojectregistration.mapper.TeamManagementMapper; import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IInstructorSheetService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.StudentSignUpVo; +import org.jeecg.modules.system.entity.SysUser; +import org.jeecg.modules.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @Description: 年度比赛项目报名 * @Author: jeecg-boot - * @Date: 2023-08-17 + * @Date: 2023-08-17 * @Version: V1.0 */ @Service public class AnnualCompetitionProjectRegistrationServiceImpl extends ServiceImpl implements IAnnualCompetitionProjectRegistrationService { - @Autowired - private AnnualCompetitionProjectRegistrationMapper annualCompetitionProjectRegistrationMapper; - @Autowired - private TeamManagementMapper teamManagementMapper; - @Autowired - private InstructorSheetMapper instructorSheetMapper; - - @Override - @Transactional(rollbackFor = Exception.class) - public void saveMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, List teamManagementList,List instructorSheetList) { - annualCompetitionProjectRegistrationMapper.insert(annualCompetitionProjectRegistration); - if(teamManagementList!=null && teamManagementList.size()>0) { - for(TeamManagement entity:teamManagementList) { - //外键设置 - entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); - teamManagementMapper.insert(entity); - } - } - if(instructorSheetList!=null && instructorSheetList.size()>0) { - for(InstructorSheet entity:instructorSheetList) { - //外键设置 - entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); - instructorSheetMapper.insert(entity); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration,List teamManagementList,List instructorSheetList) { - annualCompetitionProjectRegistrationMapper.updateById(annualCompetitionProjectRegistration); - - //1.先删除子表数据 - teamManagementMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode()); - instructorSheetMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode()); - - //2.子表数据重新插入 - if(teamManagementList!=null && teamManagementList.size()>0) { - for(TeamManagement entity:teamManagementList) { - //外键设置 - entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); - teamManagementMapper.insert(entity); - } - } - if(instructorSheetList!=null && instructorSheetList.size()>0) { - for(InstructorSheet entity:instructorSheetList) { - //外键设置 - entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); - instructorSheetMapper.insert(entity); - } - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delMain(String id) { - teamManagementMapper.deleteByMainId(id); - instructorSheetMapper.deleteByMainId(id); - annualCompetitionProjectRegistrationMapper.deleteById(id); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delBatchMain(Collection idList) { - for(Serializable id:idList) { - teamManagementMapper.deleteByMainId(id.toString()); - instructorSheetMapper.deleteByMainId(id.toString()); - annualCompetitionProjectRegistrationMapper.deleteById(id); - } - } - - @Override - public AnnualCompetitionProjectRegistration getRegistrationByAnnualCompPointId( - String annualCompPointId - ) { - // 获取当前用户的登录信息 - LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - // 获取当前用户所有的报名编号 - List teamManagementList = teamManagementMapper.selectList( - Wrappers.lambdaQuery(TeamManagement.class) - .eq(TeamManagement::getUserId, loginUser.getId()) - ); - if(teamManagementList==null||teamManagementList.isEmpty()){ - return null; - } - // 报名编号列表 - List enrollCodes = new ArrayList<>(); - teamManagementList.forEach(team -> - enrollCodes.add(team.getEnrollCode())); - if(enrollCodes.isEmpty()) { - return null; - } - // 获取报名信息 - return annualCompetitionProjectRegistrationMapper.selectOne( - Wrappers.lambdaQuery( - AnnualCompetitionProjectRegistration.class - ) - .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, - annualCompPointId) - .in(AnnualCompetitionProjectRegistration::getEnrollCode, - enrollCodes) - .last("limit 1") - ); - } + @Autowired + private AnnualCompetitionProjectRegistrationMapper annualCompetitionProjectRegistrationMapper; + @Autowired + private TeamManagementMapper teamManagementMapper; + + @Autowired + private ITeamManagementService iTeamManagementService; + + @Autowired + private InstructorSheetMapper instructorSheetMapper; + + @Autowired + private IInstructorSheetService iInstructorSheetService; + + @Autowired + private IAnnualCompPointService iAnnualCompPointService; + + @Autowired + IAnnualCompService iannualCompService; + + @Autowired + IAnnualService iAnnualService; + + @Autowired + private ISysUserService iSysUserService; + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, List teamManagementList, List instructorSheetList) { + annualCompetitionProjectRegistrationMapper.insert(annualCompetitionProjectRegistration); + if (teamManagementList != null && teamManagementList.size() > 0) { + for (TeamManagement entity : teamManagementList) { + //外键设置 + entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); + teamManagementMapper.insert(entity); + } + } + if (instructorSheetList != null && instructorSheetList.size() > 0) { + for (InstructorSheet entity : instructorSheetList) { + //外键设置 + entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); + instructorSheetMapper.insert(entity); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, List teamManagementList, List instructorSheetList) { + annualCompetitionProjectRegistrationMapper.updateById(annualCompetitionProjectRegistration); + + //1.先删除子表数据 + teamManagementMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode()); + instructorSheetMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode()); + + //2.子表数据重新插入 + if (teamManagementList != null && teamManagementList.size() > 0) { + for (TeamManagement entity : teamManagementList) { + //外键设置 + entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); + teamManagementMapper.insert(entity); + } + } + if (instructorSheetList != null && instructorSheetList.size() > 0) { + for (InstructorSheet entity : instructorSheetList) { + //外键设置 + entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode()); + instructorSheetMapper.insert(entity); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delMain(String id) { + teamManagementMapper.deleteByMainId(id); + instructorSheetMapper.deleteByMainId(id); + annualCompetitionProjectRegistrationMapper.deleteById(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delBatchMain(Collection idList) { + for (Serializable id : idList) { + teamManagementMapper.deleteByMainId(id.toString()); + instructorSheetMapper.deleteByMainId(id.toString()); + annualCompetitionProjectRegistrationMapper.deleteById(id); + } + } + + @Override + public AnnualCompetitionProjectRegistration getRegistrationByAnnualCompPointId( + String annualCompPointId + ) { + // 获取当前用户的登录信息 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + // 获取当前用户所有的报名编号 + List teamManagementList = teamManagementMapper.selectList( + Wrappers.lambdaQuery(TeamManagement.class) + .eq(TeamManagement::getUserId, loginUser.getId()) + ); + if (teamManagementList == null || teamManagementList.isEmpty()) { + return null; + } + // 报名编号列表 + List enrollCodes = new ArrayList<>(); + teamManagementList.forEach(team -> + enrollCodes.add(team.getEnrollCode())); + if (enrollCodes.isEmpty()) { + return null; + } + // 获取报名信息 + return annualCompetitionProjectRegistrationMapper.selectOne( + Wrappers.lambdaQuery( + AnnualCompetitionProjectRegistration.class + ) + .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, + annualCompPointId) + .in(AnnualCompetitionProjectRegistration::getEnrollCode, + enrollCodes) + .last("limit 1") + ); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void studentSignUp(StudentSignUpVo studentSignUpVo) { + + AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(studentSignUpVo.getId()); + AnnualComp annualComp = iannualCompService.getById(annualCompPoint.getAnnualCompId()); + Annual annual = iAnnualService.getById(annualComp.getAnnualid()); + if (ObjectUtils.isEmpty(annualCompPoint) || ObjectUtils.isEmpty(annualComp) || ObjectUtils.isEmpty(annual)) + return; + + String enrollCode = ""; + List saveTeamManagementList = new LinkedList<>(); +// String signUpName = studentSignUpVo.getSignUpName(); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); +// 个人、团队,键值对 N-个人 Y-团队 + if (StringUtils.equals("N", annualCompPoint.getEntryForm())) { + enrollCode = builderEnrollCode(annual.getAnnualName() + "gr"); + TeamManagement person = new TeamManagement(); + person.setEnrollCode(enrollCode); + person.setSysOrgCode(annualCompPoint.getSysOrgCode()); + person.setCreateBy(sysUser.getUsername()); + person.setUserId(sysUser.getId()); + person.setCaptain("1"); + saveTeamManagementList.add(person); + } else {//团队赛 + enrollCode = builderEnrollCode(annual.getAnnualName() + "td"); + String finalEnrollCode = enrollCode; + // 放入队长 + TeamManagement teamManagement = new TeamManagement(); + teamManagement.setEnrollCode(finalEnrollCode); + teamManagement.setSysOrgCode(annualCompPoint.getSysOrgCode()); + teamManagement.setCreateBy(sysUser.getUsername()); + teamManagement.setCaptain("1"); + teamManagement.setUserId(sysUser.getId()); + saveTeamManagementList.add(teamManagement); + + // 团队队员 + String teamManagementStr = studentSignUpVo.getTeamManagementList(); + List teamMemberList = new LinkedList<>(); + if (StringUtils.isNotBlank(teamManagementStr)) { + teamMemberList.addAll(Arrays.stream(teamManagementStr.split(",")).collect(Collectors.toList())); + } + if (!ObjectUtils.isEmpty(teamMemberList)) { + teamMemberList.forEach(userNameStr -> { + TeamManagement teamMember = new TeamManagement(); + teamMember.setEnrollCode(finalEnrollCode); + teamMember.setSysOrgCode(annualCompPoint.getSysOrgCode()); + teamMember.setCreateBy(sysUser.getUsername()); + teamMember.setCaptain("0"); + SysUser user = iSysUserService.getUserByName(userNameStr); + teamMember.setUserId(user.getId()); + saveTeamManagementList.add(teamMember); + }); + } + } + + AnnualCompetitionProjectRegistration registration = new AnnualCompetitionProjectRegistration(); + registration.setAnnualCompid(annualCompPoint.getId()); + registration.setEnrollCode(enrollCode); + registration.setEnrollStatic("2"); + if ("N".equals(annualCompPoint.getEntryForm())) { + registration.setEntryFormat("0"); + } else { + registration.setEntryFormat("1"); + } + registration.setTeamName(studentSignUpVo.getTeamName()); + registration.setSysOrgCode(annualCompPoint.getSysOrgCode()); + registration.setCreateBy(sysUser.getUsername()); + + List saveInstructorSheetList = new LinkedList<>(); + String advisorTeacherInstructorSheet = studentSignUpVo.getAdvisorTeacherInstructorSheet(); + if (StringUtils.isNotBlank(advisorTeacherInstructorSheet)) { + InstructorSheet instructorSheet = new InstructorSheet(); + instructorSheet.setAnnualCompid(annualCompPoint.getId()); + instructorSheet.setCreateBy(sysUser.getUsername()); + instructorSheet.setSysOrgCode(annualCompPoint.getSysOrgCode()); + instructorSheet.setTeacherType(1); + instructorSheet.setTeacherName(advisorTeacherInstructorSheet); + instructorSheet.setEnrollCode(enrollCode); + saveInstructorSheetList.add(instructorSheet); + } + String leaderTeacherInstructorSheet = studentSignUpVo.getLeaderTeacherInstructorSheet(); + if (StringUtils.isNotBlank(leaderTeacherInstructorSheet)) { + InstructorSheet leaderTeacher = new InstructorSheet(); + leaderTeacher.setAnnualCompid(annualCompPoint.getId()); + leaderTeacher.setCreateBy(sysUser.getUsername()); + leaderTeacher.setSysOrgCode(annualCompPoint.getSysOrgCode()); + leaderTeacher.setTeacherType(2); + leaderTeacher.setTeacherName(leaderTeacherInstructorSheet); + leaderTeacher.setEnrollCode(enrollCode); + saveInstructorSheetList.add(leaderTeacher); + } + + this.save(registration); + iTeamManagementService.saveBatch(saveTeamManagementList); + iInstructorSheetService.saveBatch(saveInstructorSheetList); + } + + public String builderEnrollCode(final String type) { + String enrollCode = type; + String uuid = IdUtil.randomUUID().replaceAll("-", ""); + enrollCode += uuid.substring(0, 16); + List list = this.query().eq("enroll_code", enrollCode).list(); + if (ObjectUtils.isEmpty(list)) { + return enrollCode.toUpperCase(); + } else { + return builderEnrollCode(type); + } + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/vo/StudentSignUpVo.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/vo/StudentSignUpVo.java new file mode 100644 index 00000000..a71b8c28 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/vo/StudentSignUpVo.java @@ -0,0 +1,53 @@ +package org.jeecg.modules.demo.annualcompetitionprojectregistration.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description: TODO + * @Author: Z.H.C + * @CreateTime: 2023-12-13 11:22 + * @Version: 1.0 + */ +@Data +public class StudentSignUpVo implements Serializable { + + @ApiModelProperty(value = "年度比赛项目id") + private String id; + + @ApiModelProperty(value = "参赛人姓名") + private String signUpName; + + /** + * 老师类型 1:指导老师,2:领队老师 + */ + + /** + * 指导老师 + */ + @ApiModelProperty(value = "指导老师") + private String advisorTeacherInstructorSheet; + + /** + * 领队老师名称 + */ + @ApiModelProperty(value = "领队老师") + private String leaderTeacherInstructorSheet; + + + /** + * 1:是,0:否 + * 个人赛,自己是队长,团队赛,报名人是队长 + */ +// @ApiModelProperty(value = "是否队长") +// private String captain; + + @ApiModelProperty(value = "团队赛成员名称") + private String teamManagementList; + + @ApiModelProperty(value = "队伍名称") + private String teamName; +} diff --git a/jeecgboot-vue3-master/src/assets/loginmini/icon/黄淮学院北门.png b/jeecgboot-vue3-master/src/assets/loginmini/icon/黄淮学院北门.png new file mode 100644 index 00000000..2f8a425a Binary files /dev/null and b/jeecgboot-vue3-master/src/assets/loginmini/icon/黄淮学院北门.png differ diff --git a/jeecgboot-vue3-master/src/assets/loginmini/style/home.less b/jeecgboot-vue3-master/src/assets/loginmini/style/home.less index 908dc7a5..dbba18d7 100644 --- a/jeecgboot-vue3-master/src/assets/loginmini/style/home.less +++ b/jeecgboot-vue3-master/src/assets/loginmini/style/home.less @@ -34,7 +34,8 @@ flex-basis: 60%; -webkit-flex-basis: 60%; background-color: #0198cd; - background-image: url(../icon/jeecg_ad.png); + //background-image: url(../icon/jeecg_ad.png); + background-image: url(../icon/黄淮学院北门.png); background-size: cover; } diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.api.ts b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.api.ts new file mode 100644 index 00000000..bab3f65a --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.api.ts @@ -0,0 +1,101 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/AnnualCompPoint/annualCompPoint/listStudent', + save='/AnnualCompPoint/annualCompPoint/add', + edit='/AnnualCompPoint/annualCompPoint/edit', + deleteOne = '/AnnualCompPoint/annualCompPoint/delete', + deleteBatch = '/AnnualCompPoint/annualCompPoint/deleteBatch', + importExcel = '/AnnualCompPoint/annualCompPoint/importExcel', + exportXls = '/AnnualCompPoint/annualCompPoint/exportXls', + updateApply = '/AnnualCompPoint/annualCompPoint/updateApply', + studentSignUp = '/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/studentSignUp', +} + +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; + +/** + * 列表接口 + * @param params + */ +export const list = (params) => defHttp.get({ url: Api.list, params }); + +/** + * 删除单个 + * @param params + * @param handleSuccess + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} + +/** + * 批量删除 + * @param params + * @param handleSuccess + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({ url: url, params }, { isTransformResponse: false }); +} + +/** + * 提交或申请修改 + * @param params + * @param handleSuccess + */ +export const updateApply = (params,handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认操作', + content: '确认发送请求吗', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.post({url: Api.updateApply,params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} + +/** + * 学生端-学生报名接口 + */ +export const studentSignUp = (params) => { + return defHttp.post({ url: Api.studentSignUp, params }); +}; diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.data.ts b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.data.ts new file mode 100644 index 00000000..346c8df7 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.data.ts @@ -0,0 +1,444 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import {rules} from '/@/utils/helper/validator'; +import {render} from '/@/utils/common/renderUtils'; + +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '年度比赛', + align: "center", + dataIndex: 'annualCompId_dictText' + }, + { + title: '项目名称', + align: "center", + dataIndex: 'objName' + }, + { + title: '项目层次', + align: "center", + dataIndex: 'objLevel_dictText', + }, + { + title: '参与形式', + align: "center", + dataIndex: 'entryForm', + customRender: ({text}) => { + return render.renderSwitch(text, [{text: '团队赛', value: 'Y'}, {text: '个人赛', value: 'N'}]); + }, + }, + { + title: '是否报名', + align: "center", + dataIndex: 'requireApply', + customRender: ({text}) => { + return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); + }, + }, + { + title: '是否选题', + align: "center", + dataIndex: 'requireTopic', + customRender: ({text}) => { + return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); + }, + }, + { + title: '是否上传作品', + align: "center", + dataIndex: 'requireUploadWorks', + customRender: ({text}) => { + return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); + }, + }, + { + title: '是否评分', + align: "center", + dataIndex: 'requireScore', + customRender: ({text}) => { + return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]); + }, + }, + { + title: '开始时间', + align: "center", + dataIndex: 'starttime' + }, + { + title: '结束时间', + align: "center", + dataIndex: 'endtime' + }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = []; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '年度比赛', + field: 'annualCompId', + component: 'JPopup', + componentProps: ({formActionType}) => { + const {setFieldsValue} = formActionType; + return { + setFieldsValue: setFieldsValue, + code: "ndbs", + fieldConfig: [ + {source: 'name', target: 'annualCompId'}, + ], + multi: true + } + }, + + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入年度比赛id!'}, + ]; + }, + }, + { + label: '项目名称', + field: 'objName', + component: 'Input', + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入项目名称!'}, + ]; + }, + }, + { + label: '简介', + field: 'introduce', + component: 'InputTextArea', + }, + { + label: '项目层次', + field: 'objLevel', + component: 'JPopup', + componentProps: ({formActionType}) => { + const {setFieldsValue} = formActionType; + return { + setFieldsValue: setFieldsValue, + code: "xmcc", + fieldConfig: [ + {source: 'level_name', target: 'objLevel'}, + ], + multi: false + } + }, + }, + { + label: '参与形式', + field: 'entryForm', + component: 'JSwitch', + componentProps: {}, + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入参与形式!'}, + ]; + }, + }, + { + label: '队伍人数', + field: 'teamNumber', + component: 'InputNumber', + }, + { + label: '指导老师人数', + field: 'teacherNumber', + component: 'InputNumber', + }, + { + label: '是否需要领队', + field: 'requireLeader', + component: 'JSwitch', + componentProps: {}, + }, + { + label: '是否需要队伍名称', + field: 'requireTeamName', + component: 'JDictSelectTag', + componentProps: { + dictCode: "" + }, + }, + { + label: '是否报名', + field: 'requireApply', + component: 'JSwitch', + componentProps: {}, + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入是否报名!'}, + ]; + }, + }, + { + label: '是否选题', + field: 'requireTopic', + component: 'JSwitch', + componentProps: {}, + + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入是否选题!'}, + ]; + }, + }, + { + label: '是否上传作品', + field: 'requireUploadWorks', + component: 'JSwitch', + componentProps: {}, + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入是否上传作品!'}, + ]; + }, + }, + { + label: '上传作品类型', + field: 'uploadWorksType', + component: 'JSelectMultiple', + componentProps: { + dictCode: "" + }, + }, + { + label: '是否评分', + field: 'requireScore', + component: 'JSwitch', + componentProps: {}, + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入是否评分!'}, + ]; + }, + }, + { + label: '开始时间', + field: 'starttime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入开始时间!'}, + ]; + }, + }, + { + label: '结束时间', + field: 'endtime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + dynamicRules: ({model, schema}) => { + return [ + {required: true, message: '请输入结束时间!'}, + ]; + }, + }, + { + label: '开关', + field: 'annualCompSwitch', + component: 'JSwitch', + componentProps: {}, + }, + { + label: '驳回信息', + field: 'message', + component: 'InputTextArea', + }, + { + label: '报名开始时间', + field: 'applyStartTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '报名结束时间', + field: 'applyEndTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '选题开始时间', + field: 'topicStartTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '选题结束时间', + field: 'topicEndTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '上传作品开始时间', + field: 'uploadStartTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '上传作品结束时间', + field: 'uploadEndTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '评分开始时间', + field: 'scoreStartTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '评分结束时间', + field: 'scoreEndTime', + component: 'DatePicker', + componentProps: { + showTime: true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; + +export const formStudentSignUp4PersonSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + field: 'signUpName', + label: '参赛人', + component: 'Input', + componentProps: { + readOnly: true, + allowClear: false, + }, + }, + { + field: 'advisorTeacherInstructorSheet', + label: '指导老师', + required: false, + component: 'Input', + // componentProps: { + // rowKey: 'username', + // labelKey: 'realname', + // maxSelectCount: 5, + // }, + }, + { + field: 'leaderTeacherInstructorSheet', + label: '领队老师', + required: false, + component: 'Input', + // componentProps: { + // rowKey: 'username', + // labelKey: 'realname', + // maxSelectCount: 5, + // }, + }, +]; + +export const formStudentSignUp4TeamSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, + { + field: 'signUpName', + label: '参赛人(队长)', + component: 'Input', + componentProps: { + readOnly: true, + allowClear: false, + }, + }, + { + field: 'teamName', + label: '队伍名称', + required: true, + component: 'Input', + // componentProps: { + // rowKey: 'username', + // labelKey: 'realname', + // maxSelectCount: 5, + // }, + }, + { + field: 'teamManagementList', + label: '团队成员', + required: true, + component: 'JSelectUser', + componentProps: { + rowKey: 'username', + labelKey: 'realname', + maxSelectCount: 8, + }, + }, + { + field: 'advisorTeacherInstructorSheet', + label: '指导老师', + required: false, + component: 'Input', + // componentProps: { + // rowKey: 'username', + // labelKey: 'realname', + // maxSelectCount: 5, + // }, + }, + { + field: 'leaderTeacherInstructorSheet', + label: '领队老师', + required: false, + component: 'Input', + // componentProps: { + // rowKey: 'username', + // labelKey: 'realname', + // maxSelectCount: 5, + // }, + }, +]; + + diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList.vue new file mode 100644 index 00000000..314be7b8 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList.vue @@ -0,0 +1,293 @@ + + + + + + diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList2.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList2.vue new file mode 100644 index 00000000..5fd25209 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList2.vue @@ -0,0 +1,336 @@ + + + + + + diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointForm.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointForm.vue new file mode 100644 index 00000000..714edf41 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointForm.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointModal.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointModal.vue new file mode 100644 index 00000000..bb59d6f1 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointModal.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4PersonModal.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4PersonModal.vue new file mode 100644 index 00000000..ad34fb2b --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4PersonModal.vue @@ -0,0 +1,52 @@ + + diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4TeamModal.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4TeamModal.vue new file mode 100644 index 00000000..bd413c99 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4TeamModal.vue @@ -0,0 +1,51 @@ + + diff --git a/jeecgboot-vue3-master/src/views/system/loginmini/MiniLogin.vue b/jeecgboot-vue3-master/src/views/system/loginmini/MiniLogin.vue index 700d8294..db398b27 100644 --- a/jeecgboot-vue3-master/src/views/system/loginmini/MiniLogin.vue +++ b/jeecgboot-vue3-master/src/views/system/loginmini/MiniLogin.vue @@ -21,7 +21,7 @@