diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java index cf6ae80..295832f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitCompetitionStudentInfoController.java @@ -34,7 +34,7 @@ public class HitCompetitionStudentInfoController extends BaseController { /** * 查询大赛学生列表 */ - @PreAuthorize("@ss.hasPermi('system:info:list')") + @GetMapping("/list") public TableDataInfo list(HitCompetitionStudentInfo hitCompetitionStudentInfo) { @@ -46,7 +46,7 @@ public class HitCompetitionStudentInfoController extends BaseController { /** * 导出大赛学生列表 */ - @PreAuthorize("@ss.hasPermi('system:info:export')") + @Log(title = "大赛学生", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, HitCompetitionStudentInfo hitCompetitionStudentInfo) @@ -80,7 +80,7 @@ public class HitCompetitionStudentInfoController extends BaseController { /** * 修改大赛学生 */ - @PreAuthorize("@ss.hasPermi('system:info:edit')") + @Log(title = "大赛学生", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody HitCompetitionStudentInfo hitCompetitionStudentInfo) @@ -91,7 +91,7 @@ public class HitCompetitionStudentInfoController extends BaseController { /** * 删除大赛学生 */ - @PreAuthorize("@ss.hasPermi('system:info:remove')") + @Log(title = "大赛学生", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java index bc39e4f..3c6b066 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoController.java @@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 报名信息Controller - * + * * @author zcy * @date 2024-08-20 */ @@ -37,7 +37,7 @@ public class HitRegInfoController extends BaseController /** * 查询报名信息列表 */ - @PreAuthorize("@ss.hasPermi('system:hit_reg_info:list')") + @GetMapping("/list") public TableDataInfo list(HitRegInfo hitRegInfo) { @@ -49,7 +49,7 @@ public class HitRegInfoController extends BaseController /** * 导出报名信息列表 */ - @PreAuthorize("@ss.hasPermi('system:hit_reg_info:export')") + @Log(title = "报名信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, HitRegInfo hitRegInfo) @@ -62,7 +62,7 @@ public class HitRegInfoController extends BaseController /** * 获取报名信息详细信息 */ - @PreAuthorize("@ss.hasPermi('system:hit_reg_info:query')") + @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -72,7 +72,7 @@ public class HitRegInfoController extends BaseController /** * 新增报名信息 */ - @PreAuthorize("@ss.hasPermi('system:hit_reg_info:add')") + @Log(title = "报名信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody HitRegInfo hitRegInfo) @@ -83,18 +83,26 @@ public class HitRegInfoController extends BaseController /** * 修改报名信息 */ - @PreAuthorize("@ss.hasPermi('system:hit_reg_info:edit')") + @Log(title = "报名信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody HitRegInfo hitRegInfo) { return toAjax(hitRegInfoService.updateHitRegInfo(hitRegInfo)); } - + /** + * 修改报名信息 + */ + @Log(title = "报名信息", businessType = BusinessType.UPDATE) + @PutMapping("/edit2") + public AjaxResult edit2(@RequestBody HitRegInfo hitRegInfo) + { + return toAjax(hitRegInfoService.updateHitRegInfo(hitRegInfo)); + } /** * 删除报名信息 */ - @PreAuthorize("@ss.hasPermi('system:hit_reg_info:remove')") + @Log(title = "报名信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoUserController.java new file mode 100644 index 0000000..fa1e723 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegInfoUserController.java @@ -0,0 +1,105 @@ +package com.ruoyi.cms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.cms.domain.HitRegInfoUser; +import com.ruoyi.cms.service.IHitRegInfoUserService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 报名相关人员信息Controller + * + * @author ruoyi + * @date 2024-09-01 + */ +@RestController +@RequestMapping("/system/hitRegUser") +public class HitRegInfoUserController extends BaseController +{ + @Autowired + private IHitRegInfoUserService hitRegInfoUserService; + + /** + * 查询报名相关人员信息列表 + */ + + @GetMapping("/list") + public TableDataInfo list(HitRegInfoUser hitRegInfoUser) + { + startPage(); + List list = hitRegInfoUserService.selectHitRegInfoUserList(hitRegInfoUser); + return getDataTable(list); + } + + /** + * 导出报名相关人员信息列表 + */ + + @Log(title = "报名相关人员信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HitRegInfoUser hitRegInfoUser) + { + List list = hitRegInfoUserService.selectHitRegInfoUserList(hitRegInfoUser); + ExcelUtil util = new ExcelUtil(HitRegInfoUser.class); + util.exportExcel(response, list, "报名相关人员信息数据"); + } + + /** + * 获取报名相关人员信息详细信息 + */ + + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(hitRegInfoUserService.selectHitRegInfoUserById(id)); + } + + /** + * 新增报名相关人员信息 + */ + + @Log(title = "报名相关人员信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HitRegInfoUser hitRegInfoUser) + { + return toAjax(hitRegInfoUserService.insertHitRegInfoUser(hitRegInfoUser)); + } + + /** + * 修改报名相关人员信息 + */ + @Log(title = "报名相关人员信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HitRegInfoUser hitRegInfoUser) + { + return toAjax(hitRegInfoUserService.updateHitRegInfoUser(hitRegInfoUser)); + } + + /** + * 删除报名相关人员信息 + */ + + @Log(title = "报名相关人员信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(hitRegInfoUserService.deleteHitRegInfoUserByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java index c12592e..194c01d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationStudentInfoController.java @@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 报名信息Controller - * + * * @author 点亮信息 * @date 2024-08-20 */ @@ -37,7 +37,7 @@ public class HitRegistrationStudentInfoController extends BaseController /** * 查询报名信息列表 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationStudentInfo:HitRegistrationStudentInfo:list')") + @GetMapping("/list") public TableDataInfo list(HitRegistrationStudentInfo hitRegistrationStudentInfo) { @@ -49,7 +49,7 @@ public class HitRegistrationStudentInfoController extends BaseController /** * 导出报名信息列表 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationStudentInfo:HitRegistrationStudentInfo:export')") + @Log(title = "报名信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, HitRegistrationStudentInfo hitRegistrationStudentInfo) @@ -62,7 +62,7 @@ public class HitRegistrationStudentInfoController extends BaseController /** * 获取报名信息详细信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationStudentInfo:HitRegistrationStudentInfo:query')") + @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -72,7 +72,7 @@ public class HitRegistrationStudentInfoController extends BaseController /** * 新增报名信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationStudentInfo:HitRegistrationStudentInfo:add')") + @Log(title = "报名信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody HitRegistrationStudentInfo hitRegistrationStudentInfo) @@ -83,7 +83,7 @@ public class HitRegistrationStudentInfoController extends BaseController /** * 修改报名信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationStudentInfo:HitRegistrationStudentInfo:edit')") + @Log(title = "报名信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody HitRegistrationStudentInfo hitRegistrationStudentInfo) @@ -94,7 +94,7 @@ public class HitRegistrationStudentInfoController extends BaseController /** * 删除报名信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationStudentInfo:HitRegistrationStudentInfo:remove')") + @Log(title = "报名信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java index be70dcd..2e977ab 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitRegistrationTeachInfoController.java @@ -17,7 +17,7 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 教师信息Controller - * + * * @author 点亮信息 * @date 2024-08-20 */ @@ -44,7 +44,7 @@ public class HitRegistrationTeachInfoController extends BaseController /** * 导出教师信息列表 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationTeachInfo:HitRegistrationTeachInfo:export')") + @Log(title = "教师信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, HitRegistrationTeachInfo hitRegistrationTeachInfo) @@ -57,7 +57,7 @@ public class HitRegistrationTeachInfoController extends BaseController /** * 获取教师信息详细信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationTeachInfo:HitRegistrationTeachInfo:query')") + @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -67,7 +67,7 @@ public class HitRegistrationTeachInfoController extends BaseController /** * 新增教师信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationTeachInfo:HitRegistrationTeachInfo:add')") + @Log(title = "教师信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody HitRegistrationTeachInfo hitRegistrationTeachInfo) @@ -78,18 +78,18 @@ public class HitRegistrationTeachInfoController extends BaseController /** * 修改教师信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationTeachInfo:HitRegistrationTeachInfo:edit')") + @Log(title = "教师信息", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody HitRegistrationTeachInfo hitRegistrationTeachInfo) - { + public AjaxResult edit(@RequestBody HitRegistrationTeachInfo hitRegistrationTeachInfo) throws Exception { + return toAjax(hitRegistrationTeachInfoService.updateHitRegistrationTeachInfo(hitRegistrationTeachInfo)); } /** * 删除教师信息 */ - @PreAuthorize("@ss.hasPermi('HitRegistrationTeachInfo:HitRegistrationTeachInfo:remove')") + @Log(title = "教师信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitTeamsController.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitTeamsController.java index 3a69971..e1a6d10 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitTeamsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/controller/HitTeamsController.java @@ -32,7 +32,7 @@ public class HitTeamsController extends BaseController { * 初赛预报名 */ @PostMapping("/pre-register") - public AjaxResult preRegister(@RequestBody Preliminary preliminary){ + public AjaxResult preRegister(@RequestBody Preliminary preliminary) throws Exception { return toAjax(hitTeamsService.preRegister(preliminary)) ; } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java index 3f3d629..1b3b3a6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import java.util.Date; +import java.util.List; import com.ruoyi.common.core.domain.HitRegistrationTeachInfo; import io.swagger.annotations.ApiModel; @@ -44,6 +45,7 @@ public class HitCompetitionStudentInfo implements Serializable { @ApiModelProperty(value = "学生姓名") private String stuName; + //用户主键 private Long userId; @@ -55,6 +57,7 @@ public class HitCompetitionStudentInfo implements Serializable { @ApiModelProperty(value = "院系名称") private String collegeName; + private String sex; @ApiModelProperty(value = "专业") private String major; @@ -104,5 +107,15 @@ public class HitCompetitionStudentInfo implements Serializable { private String year; @TableField(exist = false) private HitRegistrationTeachInfo ldTeacherInfo; + @TableField(exist = false) + private List zdTeacherList; + @TableField(exist = false) + private List tdStudentList; + @TableField(exist = false) + private String zdStatus; + @TableField(exist = false) + private HitRegInfo hitRegInfo; + @TableField(exist = false) + private String zdTeacherStr; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfo.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfo.java index c92940d..e08a3aa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfo.java @@ -8,12 +8,13 @@ import lombok.Data; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.util.ArrayList; import java.util.Date; import java.util.List; /** * 报名信息对象 hit_reg_info - * + * * @author zcy * @date 2024-08-20 */ @@ -57,6 +58,7 @@ public class HitRegInfo extends BaseEntity /** 附件 */ @Excel(name = "附件") private String uploadFile; + private String dsFile; //0未审核1审核通过2审核拒绝 private String auditStatus; @@ -71,5 +73,16 @@ public class HitRegInfo extends BaseEntity @Excel(name = "大赛时间") private Date createTime; + @TableField(exist = false) + private List regInfoUsers =new ArrayList<>(); + @TableField(exist = false) + private List studentUser =new ArrayList<>(); + @TableField(exist = false) + private List zdTeacher =new ArrayList<>(); + @TableField(exist = false) + private HitRegistrationTeachInfo ldTeacher; + @TableField(exist = false) + private List studentUserss =new ArrayList<>(); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfoUser.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfoUser.java new file mode 100644 index 0000000..459efc3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitRegInfoUser.java @@ -0,0 +1,51 @@ +package com.ruoyi.cms.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 报名相关人员信息对象 hit_reg_info_user + * + * @author ruoyi + * @date 2024-09-01 + */ +@Data +public class HitRegInfoUser extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(type=IdType.AUTO) + private Long id; + + /** 团队报名主键 */ + @Excel(name = "团队报名主键") + private Long regId; + + /** 相关人主键 */ + @Excel(name = "相关人主键") + private Long userId; + + /** 相关人名称 */ + @Excel(name = "相关人名称") + private String userName; + + /** 类型 1 学生 2 指导老师 3领队老师 */ + @Excel(name = "类型 1 学生 2 指导老师 3领队老师") + private String type; + + /** 状态0待确认 1已同意 2拒绝 */ + @Excel(name = "状态0待确认 1已同意 2拒绝") + private String status; + /** 逻辑删除0未删除1真删除 */ + private Long delFlag; + @TableField(exist = false) + private String isOwn; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/Preliminary.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/Preliminary.java index 36ad2d7..5fb402b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/Preliminary.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/Preliminary.java @@ -1,6 +1,7 @@ package com.ruoyi.cms.domain; +import com.ruoyi.common.annotation.Excel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -24,83 +25,33 @@ public class Preliminary { private String schoolName; /** 队员1 */ - private String TeammateOne; + private Long TeammateOne; /** 队员2 */ - private String teammateTwo; + private Long teammateTwo; /** 领队老师 */ - private String LeaderTeacher; + private Long LeaderTeacher; /** 指导老师1 */ - private String teacherOne; - - public String getTeamName() { - return teamName; - } - - public void setTeamName(String teamName) { - this.teamName = teamName; - } - - public String getDivision() { - return division; - } - - public void setDivision(String division) { - this.division = division; - } - - public String getSchoolName() { - return schoolName; - } - - public void setSchoolName(String schoolName) { - this.schoolName = schoolName; - } - - public String getTeammateOne() { - return TeammateOne; - } - - public void setTeammateOne(String teammateOne) { - TeammateOne = teammateOne; - } - - public String getTeammateTwo() { - return teammateTwo; - } - - public void setTeammateTwo(String teammateTwo) { - this.teammateTwo = teammateTwo; - } - - public String getLeaderTeacher() { - return LeaderTeacher; - } - - public void setLeaderTeacher(String leaderTeacher) { - LeaderTeacher = leaderTeacher; - } - - public String getTeacherOne() { - return teacherOne; - } - - public void setTeacherOne(String teacherOne) { - this.teacherOne = teacherOne; - } - - public String getTeacherTwo() { - return teacherTwo; - } - - public void setTeacherTwo(String teacherTwo) { - this.teacherTwo = teacherTwo; - } - + private Long teacherOne; /** 指导老师2 */ - private String teacherTwo; + private Long teacherTwo; + /** 盲样联系人 */ + @Excel(name = "盲样联系人") + private String sampleConcat; + + /** 盲样联第人电话 */ + @Excel(name = "盲样联第人电话") + private String sampleNumber; + + /** 盲样邮寄地址 */ + @Excel(name = "盲样邮寄地址") + private String sampleAddress; + + /** 附件 */ + @Excel(name = "附件") + private String uploadFile; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitCompetitionStudentInfoMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitCompetitionStudentInfoMapper.java index c56bc3b..3ddee74 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitCompetitionStudentInfoMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitCompetitionStudentInfoMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.cms.mapper; import com.ruoyi.cms.domain.HitCompetitionStudentInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.common.core.domain.HitRegistrationTeachInfo; import java.util.List; @@ -22,6 +23,9 @@ public interface HitCompetitionStudentInfoMapper extends BaseMapper { /** * 查询报名信息 - * + * * @param id 报名信息主键 * @return 报名信息 */ @@ -23,7 +24,7 @@ public interface HitRegInfoMapper extends BaseMapper /** * 查询报名信息列表 - * + * * @param hitRegInfo 报名信息 * @return 报名信息集合 */ @@ -31,7 +32,7 @@ public interface HitRegInfoMapper extends BaseMapper /** * 新增报名信息 - * + * * @param hitRegInfo 报名信息 * @return 结果 */ @@ -39,7 +40,7 @@ public interface HitRegInfoMapper extends BaseMapper /** * 修改报名信息 - * + * * @param hitRegInfo 报名信息 * @return 结果 */ @@ -47,7 +48,7 @@ public interface HitRegInfoMapper extends BaseMapper /** * 删除报名信息 - * + * * @param id 报名信息主键 * @return 结果 */ @@ -55,9 +56,13 @@ public interface HitRegInfoMapper extends BaseMapper /** * 批量删除报名信息 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteHitRegInfoByIds(Long[] ids); + HitRegInfo selectHitByUserId(@Param("userId") Long userId,@Param("status") String status,@Param("year") String year); + HitRegInfo selectHitByUserId2(@Param("userId") Long userId,@Param("year") String year); + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegInfoUserMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegInfoUserMapper.java new file mode 100644 index 0000000..9faa423 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/mapper/HitRegInfoUserMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.cms.domain.HitRegInfoUser; + +import java.util.List; + + +/** + * 报名相关人员信息Mapper接口 + * + * @author ruoyi + * @date 2024-09-01 + */ +public interface HitRegInfoUserMapper extends BaseMapper +{ + /** + * 查询报名相关人员信息 + * + * @param id 报名相关人员信息主键 + * @return 报名相关人员信息 + */ + public HitRegInfoUser selectHitRegInfoUserById(Long id); + + /** + * 查询报名相关人员信息列表 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 报名相关人员信息集合 + */ + public List selectHitRegInfoUserList(HitRegInfoUser hitRegInfoUser); + + /** + * 新增报名相关人员信息 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 结果 + */ + public int insertHitRegInfoUser(HitRegInfoUser hitRegInfoUser); + + /** + * 修改报名相关人员信息 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 结果 + */ + public int updateHitRegInfoUser(HitRegInfoUser hitRegInfoUser); + + /** + * 删除报名相关人员信息 + * + * @param id 报名相关人员信息主键 + * @return 结果 + */ + public int deleteHitRegInfoUserById(Long id); + + /** + * 批量删除报名相关人员信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHitRegInfoUserByIds(Long[] ids); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java index 753c4e2..3cb19ed 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoService.java @@ -5,15 +5,15 @@ import com.ruoyi.cms.domain.HitRegInfo; /** * 报名信息Service接口 - * + * * @author zcy * @date 2024-08-20 */ -public interface IHitRegInfoService +public interface IHitRegInfoService { /** * 查询报名信息 - * + * * @param id 报名信息主键 * @return 报名信息 */ @@ -21,7 +21,7 @@ public interface IHitRegInfoService /** * 查询报名信息列表 - * + * * @param hitRegInfo 报名信息 * @return 报名信息集合 */ @@ -29,7 +29,7 @@ public interface IHitRegInfoService /** * 新增报名信息 - * + * * @param hitRegInfo 报名信息 * @return 结果 */ @@ -37,27 +37,32 @@ public interface IHitRegInfoService /** * 修改报名信息 - * + * * @param hitRegInfo 报名信息 * @return 结果 */ public int updateHitRegInfo(HitRegInfo hitRegInfo); + public int updateHitRegInfo2(HitRegInfo hitRegInfo); /** * 批量删除报名信息 - * + * * @param ids 需要删除的报名信息主键集合 * @return 结果 */ public int deleteHitRegInfoByIds(Long[] ids); - /** - * 删除报名信息信息 - * - * @param id 报名信息主键 - * @return 结果 - */ - public int deleteHitRegInfoById(Long id); void createRegInfo(String teamName,Integer teamCreatorId,String teacherId,Long teamId); + + /** + * 查询报名信息 + * + * @param + * @return 报名信息 + */ + HitRegInfo selectHitByUserId(Long userId,String status); + HitRegInfo selectHitByUserId2(Long userId); + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java new file mode 100644 index 0000000..bc91019 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegInfoUserService.java @@ -0,0 +1,71 @@ +package com.ruoyi.cms.service; + +import com.ruoyi.cms.domain.HitRegInfoUser; + +import java.util.List; + + +/** + * 报名相关人员信息Service接口 + * + * @author ruoyi + * @date 2024-09-01 + */ +public interface IHitRegInfoUserService +{ + /** + * 查询报名相关人员信息 + * + * @param id 报名相关人员信息主键 + * @return 报名相关人员信息 + */ + public HitRegInfoUser selectHitRegInfoUserById(Long id); + + /** + * 查询报名相关人员信息列表 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 报名相关人员信息集合 + */ + public List selectHitRegInfoUserList(HitRegInfoUser hitRegInfoUser); + + /** + * 新增报名相关人员信息 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 结果 + */ + public int insertHitRegInfoUser(HitRegInfoUser hitRegInfoUser); + + /** + * 修改报名相关人员信息 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 结果 + */ + public int updateHitRegInfoUser(HitRegInfoUser hitRegInfoUser); + + /** + * 批量删除报名相关人员信息 + * + * @param ids 需要删除的报名相关人员信息主键集合 + * @return 结果 + */ + public int deleteHitRegInfoUserByIds(Long[] ids); + + /** + * 删除报名相关人员信息信息 + * + * @param id 报名相关人员信息主键 + * @return 结果 + */ + public int deleteHitRegInfoUserById(Long id); + + /** + * 删除报名相关人员信息信息 + * + * @param regId 报名相关人员信息主键 + * @return 结果 + */ + public int deleteHitRegInfoUserByRegId(Long regId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java index 7253033..545bbd7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitRegistrationTeachInfoService.java @@ -8,15 +8,15 @@ import java.util.List; /** * 教师信息Service接口 - * + * * @author 点亮信息 * @date 2024-08-20 */ -public interface IHitRegistrationTeachInfoService +public interface IHitRegistrationTeachInfoService { /** * 查询教师信息 - * + * * @param id 教师信息主键 * @return 教师信息 */ @@ -24,7 +24,7 @@ public interface IHitRegistrationTeachInfoService /** * 查询教师信息列表 - * + * * @param hitRegistrationTeachInfo 教师信息 * @return 教师信息集合 */ @@ -32,7 +32,7 @@ public interface IHitRegistrationTeachInfoService /** * 新增教师信息 - * + * * @param hitRegistrationTeachInfo 教师信息 * @return 结果 */ @@ -40,15 +40,15 @@ public interface IHitRegistrationTeachInfoService /** * 修改教师信息 - * + * * @param hitRegistrationTeachInfo 教师信息 * @return 结果 */ - public int updateHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo); + public int updateHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo) throws Exception; /** * 批量删除教师信息 - * + * * @param ids 需要删除的教师信息主键集合 * @return 结果 */ @@ -56,7 +56,7 @@ public interface IHitRegistrationTeachInfoService /** * 删除教师信息信息 - * + * * @param id 教师信息主键 * @return 结果 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitTeamsService.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitTeamsService.java index ebca00a..c9b1845 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitTeamsService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/IHitTeamsService.java @@ -14,5 +14,5 @@ import com.ruoyi.cms.domain.Preliminary; */ public interface IHitTeamsService extends IService { - int preRegister(Preliminary preliminary); + int preRegister(Preliminary preliminary) throws Exception; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java index 96cd0e9..72d596a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java @@ -1,9 +1,8 @@ package com.ruoyi.cms.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.ruoyi.cms.domain.HitCompetitionStudentInfo; -import com.ruoyi.cms.domain.HitTeamMembers; -import com.ruoyi.cms.domain.HitTeams; +import com.ruoyi.cms.domain.*; import com.ruoyi.cms.domain.vo.TeamsVo; import com.ruoyi.cms.mapper.HitCompetitionStudentInfoMapper; import com.ruoyi.cms.mapper.HitRegistrationTeachInfoMapper; @@ -11,11 +10,13 @@ import com.ruoyi.cms.mapper.HitTeamMembersMapper; import com.ruoyi.cms.mapper.HitTeamsMapper; import com.ruoyi.cms.service.IHitCompetitionStudentInfoService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.cms.service.IHitRegInfoService; import com.ruoyi.common.core.domain.HitRegistrationTeachInfo; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.ISysDictDataService; import org.apache.commons.lang3.ObjectUtils; @@ -24,6 +25,7 @@ import org.springframework.stereotype.Service; import java.util.Calendar; import java.util.List; +import java.util.stream.Collectors; /** *

@@ -50,6 +52,8 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl queryWrapper1 =new LambdaQueryWrapper<>(); queryWrapper1.eq(HitRegistrationTeachInfo::getSchoolName,hitCompetitionStudentInfo.getSchoolName()) .likeRight(HitRegistrationTeachInfo::getCreateTime, year).eq(HitRegistrationTeachInfo::getType,1).eq(HitRegistrationTeachInfo::getStatus,1); HitRegistrationTeachInfo hitRegistrationTeachInfo = hitRegistrationTeachInfoMapper.selectOne(queryWrapper1); hitCompetitionStudentInfo.setLdTeacherInfo(hitRegistrationTeachInfo); + //根绝学校查询 团队成员 把自己排除掉 和 指导老师 + LambdaQueryWrapper queryWrapper2 =new LambdaQueryWrapper<>(); + queryWrapper2.eq(HitRegistrationTeachInfo::getSchoolName,hitCompetitionStudentInfo.getSchoolName()) + .likeRight(HitRegistrationTeachInfo::getCreateTime, year).eq(HitRegistrationTeachInfo::getType,0).eq(HitRegistrationTeachInfo::getStatus,1); + List hitRegistrationTeachInfos = hitRegistrationTeachInfoMapper.selectList(queryWrapper2); + hitCompetitionStudentInfo.setZdTeacherList(hitRegistrationTeachInfos); + + LambdaQueryWrapper queryWrapper3 =new LambdaQueryWrapper<>(); + queryWrapper3.eq(HitCompetitionStudentInfo::getSchoolName,hitCompetitionStudentInfo.getSchoolName()).ne(HitCompetitionStudentInfo::getUserId,user.getUserId()) + .likeRight(HitCompetitionStudentInfo::getCreateTime, year).eq(HitCompetitionStudentInfo::getIsPreliminary,1) + .and(it->{ + it.isNull(HitCompetitionStudentInfo::getHitRegId).or().eq(HitCompetitionStudentInfo::getHitRegId,""); + }); + List studentInfos = this.list(queryWrapper3); + hitCompetitionStudentInfo.setTdStudentList(studentInfos); + //查询是否存在已组队团队 + HitRegInfo hitRegInfos1 = regInfoService.selectHitByUserId(user.getUserId(), "1"); + String status="-1"; + if (ObjectUtils.isNotEmpty(hitRegInfos1)){ + status = "1"; + hitCompetitionStudentInfo.setHitRegInfo(hitRegInfos1); + List teachers = hitRegInfos1.getRegInfoUsers().stream().filter(it -> { + return it.getType().equals("2"); + }).collect(Collectors.toList()); + String tmpStr =""; + for (HitRegInfoUser teacher : teachers) { + tmpStr = teacher.getUserName()+","; + } + hitCompetitionStudentInfo.setZdTeacherStr(tmpStr.substring(0,tmpStr.length()-1)); + + }else { + //查询是否存在已确认团队 审核中 + HitRegInfo hitRegInfos2 = regInfoService.selectHitByUserId(user.getUserId(), "0"); + if (ObjectUtils.isNotEmpty(hitRegInfos2)){ + status = "0"; + hitCompetitionStudentInfo.setHitRegInfo(hitRegInfos2); + List teachers = hitRegInfos2.getRegInfoUsers().stream().filter(it -> { + return it.getType().equals("2"); + }).collect(Collectors.toList()); + String tmpStr =""; + for (HitRegInfoUser teacher : teachers) { + tmpStr = teacher.getUserName()+","; + } + hitCompetitionStudentInfo.setZdTeacherStr(tmpStr.substring(0,tmpStr.length()-1)); + }else { + //查询是否存在待确认团队 + HitRegInfo hitRegInfos3 = regInfoService.selectHitByUserId(user.getUserId(), "9"); + if (ObjectUtils.isNotEmpty(hitRegInfos3)){ + status = "9"; + hitCompetitionStudentInfo.setHitRegInfo(hitRegInfos3); + List teachers = hitRegInfos3.getRegInfoUsers().stream().filter(it -> { + return it.getType().equals("2"); + }).collect(Collectors.toList()); + String tmpStr =""; + for (HitRegInfoUser teacher : teachers) { + tmpStr =tmpStr+ teacher.getUserName()+","; + } + hitCompetitionStudentInfo.setZdTeacherStr(tmpStr.substring(0,tmpStr.length()-1)); + } + } + } + + + hitCompetitionStudentInfo.setZdStatus(status); return hitCompetitionStudentInfo; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java index 8eb9ffe..b03788d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoServiceImpl.java @@ -2,7 +2,10 @@ package com.ruoyi.cms.service.impl; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Calendar; import java.util.List; +import java.util.stream.Collectors; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -11,9 +14,13 @@ import com.ruoyi.cms.domain.*; import com.ruoyi.cms.mapper.*; import com.ruoyi.cms.service.ICmsContentService; import com.ruoyi.cms.service.IHitCompetitionStudentInfoService; +import com.ruoyi.cms.service.IHitRegInfoUserService; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.HitRegistrationTeachInfo; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.cms.service.IHitRegInfoService; @@ -21,18 +28,16 @@ import org.springframework.transaction.annotation.Transactional; /** * 报名信息Service业务层处理 - * + * * @author zcy * @date 2024-08-20 */ @Service -public class HitRegInfoServiceImpl implements IHitRegInfoService +public class HitRegInfoServiceImpl implements IHitRegInfoService { @Autowired private HitRegInfoMapper hitRegInfoMapper; @Autowired - private HitRegistrationStudentInfoMapper studentInfoMapper; - @Autowired private HitRegistrationTeachInfoMapper teachInfoMapper; @Autowired private ICmsContentService insertCmsContent; @@ -40,15 +45,18 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService private CmsContentMapper cmsContentMapper; @Autowired private HitCompetitionStudentInfoMapper competitionStudentInfo; - @Autowired - private IHitCompetitionStudentInfoService competitionStudentInfoService; + @Autowired private HitTeamMembersMapper teamMembersMapper; + @Autowired + private IHitRegInfoUserService regInfoUserService; + @Autowired + private HitCompetitionStudentInfoMapper hitCompetitionStudentInfoMapper; /** * 查询报名信息 - * + * * @param id 报名信息主键 * @return 报名信息 */ @@ -60,7 +68,7 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService /** * 查询报名信息列表 - * + * * @param hitRegInfo 报名信息 * @return 报名信息 */ @@ -69,22 +77,35 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService { List hitRegInfos = hitRegInfoMapper.selectHitRegInfoList(hitRegInfo); for (HitRegInfo regInfo : hitRegInfos) { - LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(HitCompetitionStudentInfo::getHitRegId,regInfo.getId()); - List hitRegistrationStudentInfos = competitionStudentInfo.selectList(queryWrapper); + HitRegInfoUser hitRegInfoUser =new HitRegInfoUser(); + hitRegInfoUser.setRegId(regInfo.getId()); + List hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser); + for (HitRegInfoUser regInfoUser : hitRegInfoUsers) { + switch (regInfoUser.getType()) { + case "3": { + HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId()); + regInfo.setLdTeacher(hitRegistrationTeachInfo); + break; + } + case "2": { + HitRegistrationTeachInfo hitRegistrationTeachInfo = teachInfoMapper.selectHitRegistrationTeachInfoByUserId(regInfoUser.getUserId()); + regInfo.getZdTeacher().add(hitRegistrationTeachInfo); + break; + } + case "1": + HitCompetitionStudentInfo studentInfo = hitCompetitionStudentInfoMapper.selectHitCompetitionStudentInfoByUserId(regInfoUser.getUserId()); + regInfo.getStudentUserss().add(studentInfo); + break; + } + } - LambdaQueryWrapper queryWrapper2 =new LambdaQueryWrapper<>(); - queryWrapper2.eq(HitRegistrationTeachInfo::getHitRegId,regInfo.getId()).orderByDesc(HitRegistrationTeachInfo::getType); - List teachInfos = teachInfoMapper.selectList(queryWrapper2); - regInfo.setStudentInfoList(hitRegistrationStudentInfos); - regInfo.setTeacherInfoList(teachInfos); } return hitRegInfos; } /** * 新增报名信息 - * + * * @param hitRegInfo 报名信息 * @return 结果 */ @@ -110,13 +131,14 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService /** * 修改报名信息及创建/删除大赛通知信息 - * + * * @param hitRegInfo 报名信息 * @return 结果 */ @Override public int updateHitRegInfo(HitRegInfo hitRegInfo) { + hitRegInfo.setUpdateTime(DateUtils.getNowDate()); //获取当前年份 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); @@ -205,12 +227,25 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService } content.setContentDetail(contentHeader + contentDetail + contentFooter); insertCmsContent.updateCmsContent(content); + if (hitRegInfo.getAuditStatus().equals("2")){ + //拒绝就要把信息删掉 + regInfoUserService.deleteHitRegInfoUserByRegId(hitRegInfo.getId()); + return hitRegInfoMapper.deleteHitRegInfoById(hitRegInfo.getId()); + + }else{ + return hitRegInfoMapper.updateHitRegInfo(hitRegInfo); + } + + } + + @Override + public int updateHitRegInfo2(HitRegInfo hitRegInfo) { return hitRegInfoMapper.updateHitRegInfo(hitRegInfo); } /** * 批量删除报名信息 - * + * * @param ids 需要删除的报名信息主键 * @return 结果 */ @@ -220,18 +255,6 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService return hitRegInfoMapper.deleteHitRegInfoByIds(ids); } - /** - * 删除报名信息信息 - * - * @param id 报名信息主键 - * @return 结果 - */ - @Override - public int deleteHitRegInfoById(Long id) - { - return hitRegInfoMapper.deleteHitRegInfoById(id); - } - /** * 创建报名信息 * @param teamName @@ -261,6 +284,47 @@ public class HitRegInfoServiceImpl implements IHitRegInfoService } + @Override + public HitRegInfo selectHitByUserId(Long userId, String status) { + //获取当前用户信息信息 + SysUser user = SecurityUtils.getLoginUser().getUser(); + Calendar calendar = Calendar.getInstance(); + int year = calendar.get(Calendar.YEAR); + HitRegInfo hitRegInfo = hitRegInfoMapper.selectHitByUserId(userId, status,String.valueOf(year)); + if (ObjectUtils.isNotEmpty(hitRegInfo)){ + HitRegInfoUser hitRegInfoUser = new HitRegInfoUser(); + hitRegInfoUser.setRegId(hitRegInfo.getId()); + List hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser); + hitRegInfo.setRegInfoUsers(hitRegInfoUsers); + List collect = hitRegInfoUsers.stream().filter(it -> { + return it.getType().equals("1"); + }).collect(Collectors.toList()); + for (HitRegInfoUser regInfoUser : collect) { + if (regInfoUser.getUserId().equals(user.getUserId())){ + regInfoUser.setIsOwn("1"); + }else { + regInfoUser.setIsOwn("0"); + } + } + hitRegInfo.setStudentUser(collect); + } + return hitRegInfo; + } + + @Override + public HitRegInfo selectHitByUserId2(Long userId) { + Calendar calendar = Calendar.getInstance(); + int year = calendar.get(Calendar.YEAR); + HitRegInfo hitRegInfo = hitRegInfoMapper.selectHitByUserId2(userId,String.valueOf(year)); + if (ObjectUtils.isNotEmpty(hitRegInfo)){ + HitRegInfoUser hitRegInfoUser = new HitRegInfoUser(); + hitRegInfoUser.setRegId(hitRegInfo.getId()); + List hitRegInfoUsers = regInfoUserService.selectHitRegInfoUserList(hitRegInfoUser); + hitRegInfo.setRegInfoUsers(hitRegInfoUsers); + } + return hitRegInfo; + } + /** * 更新队员信息 * @param teamId diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java new file mode 100644 index 0000000..7682ae4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegInfoUserServiceImpl.java @@ -0,0 +1,137 @@ +package com.ruoyi.cms.service.impl; + +import java.util.List; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.cms.domain.HitRegInfo; +import com.ruoyi.cms.domain.HitRegInfoUser; +import com.ruoyi.cms.mapper.HitRegInfoUserMapper; +import com.ruoyi.cms.service.IHitRegInfoService; +import com.ruoyi.cms.service.IHitRegInfoUserService; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + + +/** + * 报名相关人员信息Service业务层处理 + * + * @author ruoyi + * @date 2024-09-01 + */ +@Service +public class HitRegInfoUserServiceImpl implements IHitRegInfoUserService +{ + @Autowired + private HitRegInfoUserMapper hitRegInfoUserMapper; + @Autowired + private IHitRegInfoService hitRegInfoService; + + /** + * 查询报名相关人员信息 + * + * @param id 报名相关人员信息主键 + * @return 报名相关人员信息 + */ + @Override + public HitRegInfoUser selectHitRegInfoUserById(Long id) + { + return hitRegInfoUserMapper.selectHitRegInfoUserById(id); + } + + /** + * 查询报名相关人员信息列表 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 报名相关人员信息 + */ + @Override + public List selectHitRegInfoUserList(HitRegInfoUser hitRegInfoUser) + { + return hitRegInfoUserMapper.selectHitRegInfoUserList(hitRegInfoUser); + } + + /** + * 新增报名相关人员信息 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 结果 + */ + @Override + public int insertHitRegInfoUser(HitRegInfoUser hitRegInfoUser) + { + hitRegInfoUser.setCreateTime(DateUtils.getNowDate()); + return hitRegInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser); + } + + /** + * 修改报名相关人员信息 + * + * @param hitRegInfoUser 报名相关人员信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int updateHitRegInfoUser(HitRegInfoUser hitRegInfoUser) + { + if (hitRegInfoUser.getStatus().equals("2")){ + //一个拒绝直接解散 + Long regId = hitRegInfoUser.getRegId(); + hitRegInfoService.deleteHitRegInfoByIds(new Long[]{regId}); + //把人员信息也删除 + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(HitRegInfoUser::getRegId,regId); + hitRegInfoUserMapper.delete(queryWrapper); + }else { + //如果全部同意就要进行下一步 + hitRegInfoUser.setUpdateTime(DateUtils.getNowDate()); + hitRegInfoUserMapper.updateHitRegInfoUser(hitRegInfoUser); + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(HitRegInfoUser::getRegId,hitRegInfoUser.getRegId()) + .eq(HitRegInfoUser::getType,"1") + .eq(HitRegInfoUser::getStatus,"0"); + List hitRegInfoUsers = hitRegInfoUserMapper.selectList(queryWrapper); + if (CollectionUtil.isEmpty(hitRegInfoUsers)){ + //代表全部通过 + Long regId = hitRegInfoUser.getRegId(); + HitRegInfo hitRegInfo = hitRegInfoService.selectHitRegInfoById(regId); + hitRegInfo.setAuditStatus("0"); + hitRegInfoService.updateHitRegInfo(hitRegInfo); + } + } + return 1; + } + + /** + * 批量删除报名相关人员信息 + * + * @param ids 需要删除的报名相关人员信息主键 + * @return 结果 + */ + @Override + public int deleteHitRegInfoUserByIds(Long[] ids) + { + return hitRegInfoUserMapper.deleteHitRegInfoUserByIds(ids); + } + + /** + * 删除报名相关人员信息信息 + * + * @param id 报名相关人员信息主键 + * @return 结果 + */ + @Override + public int deleteHitRegInfoUserById(Long id) + { + return hitRegInfoUserMapper.deleteHitRegInfoUserById(id); + } + + @Override + public int deleteHitRegInfoUserByRegId(Long regId) { + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(HitRegInfoUser::getRegId,regId); + return hitRegInfoUserMapper.delete(queryWrapper); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java index b1c91c7..402f0cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java @@ -10,6 +10,7 @@ import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.HitRegistrationTeachInfo; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.RegisterBody; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.exception.user.CaptchaException; @@ -23,6 +24,7 @@ import com.ruoyi.framework.manager.factory.AsyncFactory; import com.ruoyi.framework.web.service.SysRegisterService; import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysUserService; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.cms.mapper.HitRegistrationTeachInfoMapper; @@ -31,7 +33,7 @@ import org.springframework.transaction.annotation.Transactional; /** * 教师信息Service业务层处理 - * + * * @author 点亮信息 * @date 2024-08-20 */ @@ -72,6 +74,12 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy"); String currentYear = LocalDate.now().format(formatter); hitRegistrationTeachInfo.setYear(currentYear); + //当前教师的学校 + LoginUser loginUser = SecurityUtils.getLoginUser(); + HitRegistrationTeachInfo hitRegistrationTeachInfo1 = hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoByUserId(loginUser.getUserId()); + if(ObjectUtils.isNotEmpty(hitRegistrationTeachInfo1)){ + hitRegistrationTeachInfo.setSchoolName(hitRegistrationTeachInfo1.getSchoolName()); + } return hitRegistrationTeachInfoMapper.selectHitRegistrationTeachInfoList(hitRegistrationTeachInfo); } @@ -94,7 +102,19 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac * @return 结果 */ @Override - public int updateHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo) { + public int updateHitRegistrationTeachInfo(HitRegistrationTeachInfo hitRegistrationTeachInfo) throws Exception { + if (hitRegistrationTeachInfo.getType().equals("1")&&hitRegistrationTeachInfo.getStatus().equals("1")){ + //查询系统中是否存在已审核通过的同学校领队老师 + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(HitRegistrationTeachInfo::getType,"1") + .eq(HitRegistrationTeachInfo::getSchoolName,hitRegistrationTeachInfo.getSchoolName()) + .eq(HitRegistrationTeachInfo::getStatus,"1").last("limit 1"); + HitRegistrationTeachInfo hitRegistrationTeachInfo1 = hitRegistrationTeachInfoMapper.selectOne(queryWrapper); + if (ObjectUtils.isNotEmpty(hitRegistrationTeachInfo1)){ + throw new Exception("已存在领队老师"); + } + + } hitRegistrationTeachInfo.setUpdateTime(DateUtils.getNowDate()); return hitRegistrationTeachInfoMapper.updateHitRegistrationTeachInfo(hitRegistrationTeachInfo); } @@ -141,7 +161,6 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac String msg = "", username = user.getUsername(), password = user.getPassword(); SysUser sysUser = new SysUser(); sysUser.setUserName(username); - // 验证码开关 boolean captchaEnabled = configService.selectCaptchaEnabled(); if (captchaEnabled) { @@ -164,7 +183,14 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac sysUser.setNickName(user.getNickName()); sysUser.setPassword(SecurityUtils.encryptPassword(password)); sysUser.setUserType(user.getUserType()); - boolean regFlag = userService.registerUser(sysUser); + boolean regFlag ; + if (user.getUserType().equals("03")){ + //领队老师 + sysUser.setRoleIds(new Long[]{102L}); + regFlag = userService.insertUser(sysUser)>0; + }else { + regFlag= userService.registerUser(sysUser); + } if (!regFlag) { msg = "注册失败,请联系系统管理人员"; } else { @@ -179,7 +205,7 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac HitRegistrationTeachInfo teachInfo = user.getHitRegistrationTeachInfo(); teachInfo.setRelatedAccounts(user.getUsername()); teachInfo.setStatus("1"); - teachInfo.setType(user.getUserType()); + teachInfo.setType("0"); teachInfo.setTeacherName(user.getNickName()); teachInfo.setUserId(sysUser.getUserId()); this.insertHitRegistrationTeachInfo(teachInfo); @@ -187,7 +213,7 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac HitRegistrationTeachInfo teachInfo = user.getHitRegistrationTeachInfo(); teachInfo.setRelatedAccounts(user.getUsername()); teachInfo.setStatus("0"); - teachInfo.setType(user.getUserType()); + teachInfo.setType("1"); teachInfo.setTeacherName(user.getNickName()); teachInfo.setUserId(sysUser.getUserId()); this.insertHitRegistrationTeachInfo(teachInfo); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitTeamMembersServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitTeamMembersServiceImpl.java index 84783fb..cbec1ff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitTeamMembersServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitTeamMembersServiceImpl.java @@ -47,21 +47,21 @@ public class HitTeamMembersServiceImpl extends ServiceImpl implements IHitTeamsService { @Autowired - private IHitCompetitionStudentInfoService hitStuService; - + private HitCompetitionStudentInfoMapper hitCompetitionStudentInfoMapper; @Autowired - private HitTeamsMapper hitTeamsMapper; - + private HitRegInfoMapper hitRegInfoMapper; @Autowired - private IHitTeamMembersService hitTeamMembersService; - + private HitRegInfoUserMapper regInfoUserMapper; @Autowired - private HitTeamMembersServiceImpl hitTeamMembersServiceImpl; + private ISysUserService userService; + @Autowired + private IHitRegInfoService regInfoService; /** * 初赛报名 @@ -46,33 +51,103 @@ public class HitTeamsServiceImpl extends ServiceImpl i * @return */ @Override - public int preRegister(Preliminary preliminary) { - //获取当前学生信息 + @Transactional(rollbackFor = Exception.class) + public int preRegister(Preliminary preliminary) throws Exception { + Calendar calendar = Calendar.getInstance(); + int year = calendar.get(Calendar.YEAR); + //判断所选三个队员是否存在待确认 + if (preliminary.getTeammateOne().equals(preliminary.getTeammateTwo())){ + throw new Exception("队员不可重复"); + } + HitRegInfo hitRegInfo1 = regInfoService.selectHitByUserId2(preliminary.getTeammateOne()); + if (ObjectUtils.isNotEmpty(hitRegInfo1)){ + throw new Exception("队员1已存在组队信息,不可重复组队"); + } + HitRegInfo hitRegInfo2 = regInfoService.selectHitByUserId2(preliminary.getTeammateTwo()); + if (ObjectUtils.isNotEmpty(hitRegInfo2)){ + throw new Exception("队员2已存在组队信息,不可重复组队"); + } + //获取当前用户信息信息 SysUser user = SecurityUtils.getLoginUser().getUser(); - - //查询当前学生报名表id LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(HitCompetitionStudentInfo::getStudentId, user.getUserName()); - HitCompetitionStudentInfo hitStu = hitStuService.getOne(queryWrapper); - Integer teamCreatorId = hitStu.getId(); + queryWrapper.eq(HitCompetitionStudentInfo::getUserId, user.getUserId()); + queryWrapper.likeRight(HitCompetitionStudentInfo::getCreateTime, year); + HitCompetitionStudentInfo hitStu = hitCompetitionStudentInfoMapper.selectOne(queryWrapper); + HitRegInfo hitRegInfo =new HitRegInfo(); + hitRegInfo.setSchoolName(preliminary.getSchoolName()); + hitRegInfo.setCollegeName(hitStu.getCollegeName()); + hitRegInfo.setDivision(preliminary.getDivision()); + hitRegInfo.setTeamName(preliminary.getTeamName()); + hitRegInfo.setSampleAddress(preliminary.getSampleAddress()); + hitRegInfo.setSampleConcat(preliminary.getSampleConcat()); + hitRegInfo.setSampleNumber(preliminary.getSampleNumber()); + hitRegInfo.setUploadFile(preliminary.getUploadFile()); + hitRegInfo.setAuditStatus("9"); + hitRegInfo.setCreateTime(new Date()); + int insert = hitRegInfoMapper.insert(hitRegInfo); + //插入人员信息 + HitRegInfoUser hitRegInfoUser1 =new HitRegInfoUser(); + hitRegInfoUser1.setRegId(hitRegInfo.getId()); + hitRegInfoUser1.setUserId(user.getUserId()); + hitRegInfoUser1.setUserName(user.getNickName()); + hitRegInfoUser1.setType("1"); + hitRegInfoUser1.setStatus("0"); + hitRegInfoUser1.setCreateTime(new Date()); + regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser1); - HitTeams hitTeams = new HitTeams(); - hitTeams.setTeamName(preliminary.getTeamName()); - hitTeams.setDivision(preliminary.getDivision()); - hitTeams.setSchoolName(preliminary.getSchoolName()); - hitTeams.setTeamCreatorId(teamCreatorId); - hitTeams.setCreateTime(LocalDateTime.now()); - hitTeams.setUpdateTime(LocalDateTime.now()); - hitTeams.setCreateBy(user.getUserName()); - hitTeams.setUpdateBy(user.getUserName()); - //创建团队 - int insert = hitTeamsMapper.insert(hitTeams); + //插入人员信息 + HitRegInfoUser hitRegInfoUser2 =new HitRegInfoUser(); + hitRegInfoUser2.setRegId(hitRegInfo.getId()); + hitRegInfoUser2.setUserId(preliminary.getTeammateOne()); + SysUser sysUser = userService.selectUserById(preliminary.getTeammateOne()); + hitRegInfoUser2.setUserName(sysUser.getNickName()); + hitRegInfoUser2.setType("1"); + hitRegInfoUser2.setStatus("0"); + hitRegInfoUser2.setCreateTime(new Date()); + regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser2); - Integer teamId = hitTeams.getId(); - hitTeamMembersServiceImpl.insertTeamMembers(String.valueOf(teamCreatorId),teamId,1); - //创建队友关系等待队友确认 - hitTeamMembersService.createTeamMembers(preliminary , teamId); + //插入人员信息 + HitRegInfoUser hitRegInfoUser3 =new HitRegInfoUser(); + hitRegInfoUser3.setRegId(hitRegInfo.getId()); + hitRegInfoUser3.setUserId(preliminary.getTeammateTwo()); + SysUser sysUser1 = userService.selectUserById(preliminary.getTeammateTwo()); + hitRegInfoUser3.setUserName(sysUser1.getNickName()); + hitRegInfoUser3.setType("1"); + hitRegInfoUser3.setStatus("0"); + hitRegInfoUser3.setCreateTime(new Date()); + regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser3); + + HitRegInfoUser hitRegInfoUser4 =new HitRegInfoUser(); + hitRegInfoUser4.setRegId(hitRegInfo.getId()); + hitRegInfoUser4.setUserId(preliminary.getLeaderTeacher()); + SysUser sysUser2 = userService.selectUserById(preliminary.getLeaderTeacher()); + hitRegInfoUser4.setUserName(sysUser2.getNickName()); + hitRegInfoUser4.setType("3"); + hitRegInfoUser4.setStatus("0"); + hitRegInfoUser4.setCreateTime(new Date()); + regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser4); + + HitRegInfoUser hitRegInfoUser5 =new HitRegInfoUser(); + hitRegInfoUser5.setRegId(hitRegInfo.getId()); + hitRegInfoUser5.setUserId(preliminary.getTeacherOne()); + SysUser sysUser3 = userService.selectUserById(preliminary.getTeacherOne()); + hitRegInfoUser5.setUserName(sysUser3.getNickName()); + hitRegInfoUser5.setType("2"); + hitRegInfoUser5.setStatus("0"); + hitRegInfoUser5.setCreateTime(new Date()); + regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser5); + if (ObjectUtils.isNotEmpty(preliminary.getTeacherTwo())){ + HitRegInfoUser hitRegInfoUser6 =new HitRegInfoUser(); + hitRegInfoUser6.setRegId(hitRegInfo.getId()); + hitRegInfoUser6.setUserId(preliminary.getTeacherTwo()); + SysUser sysUser4 = userService.selectUserById(preliminary.getTeacherTwo()); + hitRegInfoUser6.setUserName(sysUser4.getNickName()); + hitRegInfoUser6.setType("2"); + hitRegInfoUser6.setStatus("0"); + hitRegInfoUser6.setCreateTime(new Date()); + regInfoUserMapper.insertHitRegInfoUser(hitRegInfoUser6); + } return insert; } - + } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 118b291..cf9cc5b 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://122.51.230.86:3306/hgd_website?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: hgdRoot - password: qqzcy@1014 + url: jdbc:mysql://61.156.90.46:3360/hgd_website?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true + username: obrhgd + password: Obr7890&*() # master: # url: jdbc:mysql://localhost:3306/ry-cms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: root @@ -17,9 +17,9 @@ spring: slave: # 从数据源开关/默认关闭 enabled: false - url: - username: - password: + url: + username: + password: # 初始连接数 initialSize: 5 # 最小连接池数量 @@ -43,7 +43,7 @@ spring: testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true @@ -62,4 +62,4 @@ spring: merge-sql: true wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index ad9caf2..1166697 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -16,10 +16,10 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8080 + port: 8081 servlet: # 应用的访问路径 - context-path: / + context-path: /hgdWebsite tomcat: # tomcat的URI编码 uri-encoding: UTF-8 @@ -72,7 +72,7 @@ spring: # 端口,默认为6379 port: 6379 # 数据库索引 - database: 0 + database: 9 # 密码 password: # 连接超时时间 diff --git a/ruoyi-admin/src/main/resources/mapper/cms/HitCompetitionStudentInfoMapper.xml b/ruoyi-admin/src/main/resources/mapper/cms/HitCompetitionStudentInfoMapper.xml index b8b045c..0efbc34 100644 --- a/ruoyi-admin/src/main/resources/mapper/cms/HitCompetitionStudentInfoMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/cms/HitCompetitionStudentInfoMapper.xml @@ -19,6 +19,7 @@ + @@ -28,7 +29,7 @@ - id, hit_reg_id, stuName, schoolName, collegeName, major, division, phoneNumber, email, studentIdCard, trialsScore, isPreliminary, remark, del_flag, create_time, create_by, update_time, update_by + id, hit_reg_id, stuName, schoolName, collegeName, major, division, phoneNumber, email, studentIdCard, trialsScore, isPreliminary, remark,sex, del_flag, create_time, create_by, update_time, update_by + insert into hit_competition_student_info @@ -70,6 +76,7 @@ trials_score, is_preliminary, remark, + sex, del_flag, create_time, create_by, @@ -91,6 +98,7 @@ #{trialsScore}, #{isPreliminary}, #{remark}, + #{sex}, #{delFlag}, #{createTime}, #{createBy}, @@ -116,6 +124,7 @@ trials_score = #{trialsScore}, is_preliminary = #{isPreliminary}, remark = #{remark}, + sex = #{sex}, del_flag = #{delFlag}, create_time = #{createTime}, create_by = #{createBy}, diff --git a/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoMapper.xml b/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoMapper.xml index 900abed..bc5cdaf 100644 --- a/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -24,12 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, school_name, college_name, division, team_name, sample_concat, sample_number,audit_status, sample_address, remark, upload_file, del_flag, create_time, create_by, update_time, update_by from hit_reg_info + select id, school_name, college_name, division, team_name, sample_concat, sample_number,audit_status, sample_address, remark, upload_file,ds_file, del_flag, create_time, create_by, update_time, update_by from hit_reg_info - + - + + insert into hit_reg_info @@ -97,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" audit_status = #{auditStatus}, remark = #{remark}, upload_file = #{uploadFile}, + ds_file = #{dsFile}, del_flag = #{delFlag}, create_time = #{createTime}, create_by = #{createBy}, @@ -111,9 +122,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from hit_reg_info where id in + delete from hit_reg_info where id in #{id} - \ No newline at end of file + diff --git a/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoUserMapper.xml b/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoUserMapper.xml new file mode 100644 index 0000000..6f03a56 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/cms/HitRegInfoUserMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + select id, reg_id, user_id, user_name, type, status, del_flag, create_time, create_by, update_time, update_by from hit_reg_info_user + + + + + + + + insert into hit_reg_info_user + + id, + reg_id, + user_id, + user_name, + type, + status, + del_flag, + create_time, + create_by, + update_time, + update_by, + + + #{id}, + #{regId}, + #{userId}, + #{userName}, + #{type}, + #{status}, + #{delFlag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update hit_reg_info_user + + reg_id = #{regId}, + user_id = #{userId}, + user_name = #{userName}, + type = #{type}, + status = #{status}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where id = #{id} + + + + delete from hit_reg_info_user where id = #{id} + + + + delete from hit_reg_info_user where id in + + #{id} + + + diff --git a/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml b/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml index e910446..080776d 100644 --- a/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/cms/HitRegistrationTeachInfoMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -32,20 +32,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select * from hit_registration_teach_info - where user_id = #{userId} + where user_id = #{userId} and YEAR(create_time) = YEAR(CURRENT_DATE) @@ -94,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createBy}, #{updateTime}, #{updateBy}, - type, + #{type}, #{status}, #{schoolName}, #{division}, @@ -129,9 +130,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from hit_registration_teach_info where id in + delete from hit_registration_teach_info where id in #{id} - \ No newline at end of file + diff --git a/ruoyi-ui/src/api/officialWebsite/registerStudent.js b/ruoyi-ui/src/api/officialWebsite/registerStudent.js index 4d16153..1a1629f 100644 --- a/ruoyi-ui/src/api/officialWebsite/registerStudent.js +++ b/ruoyi-ui/src/api/officialWebsite/registerStudent.js @@ -87,3 +87,21 @@ export function refuseTeam(teamId){ }) } + +export function editRegUser(data){ + return request({ + url: "system/hitRegUser", + method: "put", + data + }) + +} + +export function editRegInfo(data){ + return request({ + url: "system/hit_reg_info/edit2", + method: "put", + data + }) + +} diff --git a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue index 7950e41..6208427 100644 --- a/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue +++ b/ruoyi-ui/src/views/hit/registrationStudentInfo/index.vue @@ -90,25 +90,23 @@ - + + +