package com.finaldesign.controller;
import com.finaldesign.bean.bo.*;
import com.finaldesign.bean.vo.*;
import com.finaldesign.service.CoachService;
import com.finaldesign.service.StudentService;
import com.finaldesign.service.TestService;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.*;
import java.sql.Date;
import static java.lang.Integer.parseInt;
@Controller
@RequestMapping("/coach")
public class CoachController {
@Resource
private CoachService coachService;
@Resource
private TestService testService;
@Resource
private StudentService studentService;
@RequestMapping("/index")
public String index() {
return null;
}
@RequestMapping("/information")
public String information(){
return null;
}
@RequestMapping("/comment")
public String comment(){return null;}
@RequestMapping("/myself")
public String myself(){return null;}
@RequestMapping("test_plan")
public String test_plan(){return null;}
// 根据教练id得到所有的训练计划
@RequestMapping("/getPlanByCoachId")
@ResponseBody
public Map<String, Object> getAllUserPlanById(HttpServletRequest req, HttpServletResponse resp, Plan plan) {
Map<String, Object> map = new HashMap<String, Object>();
HttpSession session = req.getSession();
User user0 = (User) session.getAttribute("user");
List<Plan> planList = coachService.getPlanBlurByPlanName(user0.getId(),plan);
// List<Plan> planList = coachService.getPlanByCoachId(id ,planId1);
List<Plan_vo> plan_voList = new ArrayList<>();
for (int i = 0; i < planList.size(); i++) {
//根据项目id得到项目名
// 得到项目列表
List<String> nameList = new ArrayList<>();
List<String> standardList = new ArrayList<>();
String projectId = planList.get(i).getProject_id();
String[] project_id = projectId.split(",");
for (int j=0;j<project_id.length;j++){
Project project = coachService.getProjectNameByProjectId(Integer.parseInt(project_id[j]));
nameList.add(project.getName());
standardList.add(project.getStandard());
}
Plan_vo plan_vo = new Plan_vo();
plan_vo.setExpected(planList.get(i).getExpected());
plan_vo.setPlan_id(planList.get(i).getId());
plan_vo.setUser_id(planList.get(i).getUser_id());
plan_vo.setPlan_name(planList.get(i).getName());
plan_vo.setProject_name(nameList);
plan_vo.setVenue(planList.get(i).getVenue());
plan_vo.setDate(planList.get(i).getDate());
plan_vo.setStandard(standardList);
plan_vo.setIntroduction(planList.get(i).getIntroduction());
plan_voList.add(plan_vo);
}
map.put("msg", "初始化成功");
map.put("count", plan_voList.size());
map.put("data", plan_voList);
map.put("code", 0);
return map;
}
// 根据计划id删除所有计划相关,包括plan和User_plan
@RequestMapping("/delRelativePlanByPlanId")
@ResponseBody
@Transactional
public Map<String, Object> delPlanByPlanId(HttpServletRequest req, HttpServletResponse resp, int id) {
Map<String, Object> map = new HashMap<String, Object>();
// 未发布过成绩
List<History> historyList = coachService.getHistoryById(id);
if(historyList.size()!=0){
map.put("msg", "已录入成绩,不可删除该计划");
}
else {
coachService.delUserPlanByPlanId(id);
coachService.delUserScoreByPlanId(id);
coachService.delPlanByPlanId(id);
map.put("msg", "删除成功");
}
// map.put("count", plan_voList.size());
// map.put("data", plan_voList);
map.put("code", 0);
return map;
}
// 修改训练计划
@RequestMapping("/updatePlan")
@ResponseBody
public Map<String, Object> updatePlan(HttpServletRequest req, HttpServletResponse resp, @org.jetbrains.annotations.NotNull Plan_vo plan_vo) {
Map<String, Object> map = new HashMap<String, Object>();
Plan plan = coachService.getPlanByPlanId(plan_vo.getPlan_id());
plan.setId(plan_vo.getPlan_id());
plan.setName(plan_vo.getPlan_name());
// plan.setUser_id(plan_vo.getUser_id());
plan.setDate(plan_vo.getDate());
plan.setIntroduction(plan_vo.getIntroduction());
plan.setVenue(plan_vo.getVenue());
coachService.updatePlan(plan);
map.put("msg", "初始化成功");
map.put("count", 1);
map.put("data", plan);
map.put("code", 0);
return map;
}
// 修改项目信息
@RequestMapping("/updateProject")
@ResponseBody
public Map<String, Object> updateProject(HttpServletRequest req, HttpServletResponse resp,Project project) {
Map<String, Object> map = new HashMap<String, Object>();
coachService.updateProject(project);
map.put("msg", "初始化成功");
// map.put("count", plan_voList.size());
// map.put("data", plan_voList);
map.put("code", 0);
return map;
}
// 根据教练id查询基本个人信息
@RequestMapping("/getCoachByCoachId")
@ResponseBody
public Map<String, Object> getCoachByCoachId(HttpServletRequest req, HttpServletResponse resp) {
HttpSession session = req.getSession();
User user = (User) session.getAttribute("user");
Map<String, Object> map = new HashMap<String, Object>();
List<User> userList = new ArrayList<>();
User user1 = coachService.getCoachByCoachId(user.getId());
userList.add(user1);
map.put("msg", "初始化成功");
map.put("count", 1);
map.put("data", userList);
map.put("code", 0);
return map;
}
// 根据教练信息查询所有所属学员
@RequestMapping("/getStuByCoachId")
@ResponseBody
public Map<String, Object> getStuByCoachId(HttpServletRequest req, HttpServletResponse resp,User user) {
Map<String, Object> map = new HashMap<String, Object>();
HttpSession session = req.getSession();
User user0 = (User) session.getAttribute("user");
List<User> userList = coachService.getStuByCoachId(user0.getId(),user);
map.put("msg", "初始化成功");
map.put("count", userList.size());
map.put("data", userList);
map.put("code", 0);
return map;
}
// 更新教练信息
@RequestMapping("/updateCoachByCoachId")
@ResponseBody
public Map<String, Object> updateCoachByCoachId(HttpServletRequest req, HttpServletResponse resp,User user) {
Map<String, Object> map = new HashMap<String, Object>();
int i = coachService.updateCoachByCoachId(user);
map.put("msg", "初始化成功");
// map.put("count", userList.size());
// map.put("data", userList);
map.put("code", 0);
return map;
}
// 根据plan_id查找参加plan的学员
@RequestMapping("/getStuByPlanId")
@ResponseBody
@Transactional
public Map<String, Object> getStuByPlanId(HttpServletRequest req, HttpServletResponse resp,int id) {
Map<String, Object> map = new HashMap<String, Object>();
List<UserPlan_vo> userPlan_voList = coachService.getStuByPlanId(id);
for (int i=0;i<userPlan_voList.size();i++){
userPlan_voList.get(i).setPlan_id(id);
User user =
没有合适的资源?快使用搜索试试~ 我知道了~
基于SpringBoot框架的Java Web少儿训练信息管理系统设计源码
共455个文件
png:68个
jpg:64个
js:64个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 8 浏览量
2024-10-04
03:14:34
上传
评论
收藏 28.79MB ZIP 举报
温馨提示
该系统是一款基于SpringBoot框架的Java Web少儿训练信息管理系统,源码包含455个文件,涵盖68个PNG图片、64个JavaScript、Java、HTML和CSS文件,以及19个XML配置文件。项目采用MySQL数据库和IDEA开发,旨在实现少儿训练信息的有效管理和高效查询。
资源推荐
资源详情
资源评论
收起资源包目录
基于SpringBoot框架的Java Web少儿训练信息管理系统设计源码 (455个子文件)
CoachController.class 24KB
TestController.class 15KB
StudentController.class 15KB
BodyTestController.class 10KB
AdminController.class 10KB
CoachServiceImpl.class 9KB
Index.class 7KB
TestServiceImpl.class 6KB
CoachMapper.class 5KB
CoachService.class 4KB
StudentServiceImpl.class 4KB
User.class 4KB
Comment_vo.class 4KB
TestMapper.class 3KB
SessionFilter.class 3KB
UserPlan_vo.class 3KB
UserTestPlan_vo.class 3KB
TestService.class 3KB
User_Body_vo.class 3KB
Testplan_vo.class 3KB
Plan_vo.class 3KB
User_Score_vo.class 3KB
Student_vo.class 3KB
BodyTestServiceImpl.class 3KB
History_vo.class 3KB
AdminServiceImpl.class 2KB
StudentMapper.class 2KB
MailService.class 2KB
Testplan.class 2KB
Plan.class 2KB
Incentive.class 2KB
User_Test_Score_vo.class 2KB
Body.class 2KB
Testhistory.class 2KB
History.class 2KB
StudentService.class 2KB
Comment.class 2KB
pageHelpder.class 1KB
Resource.class 1KB
Comment_Point_vo.class 1KB
LoginServiceImpl.class 1KB
BodyTestMapper.class 1KB
AdminMapper.class 1KB
Project.class 1KB
BodyTestService.class 1KB
Comment_stu_vo.class 1KB
AdminService.class 949B
Application.class 809B
LoginMapper.class 730B
LoginService.class 576B
UserLoginToken.class 479B
PassToken.class 469B
LoginUser.class 372B
bootstrap.min.css 114KB
bootstrap.min.css 114KB
layui.css 78KB
layui.css 78KB
layui.css 78KB
layui.css 78KB
style.css 53KB
style.css 53KB
css.css 42KB
css.css 42KB
bootsnav.css 34KB
bootsnav.css 34KB
font-awesome.css 32KB
font-awesome.css 32KB
layer.css 14KB
layer.css 14KB
layer.css 13KB
layer.css 13KB
main.css 13KB
main.css 13KB
laydate.css 7KB
laydate.css 7KB
cropper.css 4KB
cropper.css 4KB
cropper.min.css 4KB
cropper.min.css 4KB
layer.ext.css 3KB
layer.ext.css 3KB
custom.css 2KB
custom.css 2KB
normalize.css 2KB
normalize.css 2KB
sitelogo.css 2KB
sitelogo.css 2KB
code.css 1KB
code.css 1KB
product.css 84B
product.css 84B
fontawesome-webfont.eot 69KB
fontawesome-webfont.eot 69KB
iconfont.eot 46KB
iconfont.eot 46KB
loading-0.gif 6KB
loading-0.gif 6KB
loading-0.gif 6KB
loading-0.gif 6KB
loading-2.gif 2KB
共 455 条
- 1
- 2
- 3
- 4
- 5
资源评论
xyq2024
- 粉丝: 2713
- 资源: 5491
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ers智能推荐.rp
- 技术资料分享CH340很好的技术资料.zip
- e-payment-web.rp
- 基于大语言模型和 RAG 的知识库问答系统 开箱即用、模型中立、灵活编排,支持快速嵌入到第三方业务系统
- Etranss 管理系统.rp
- 卫星微波遥感植被含水量指数与火点数和火辐射能量研究
- 技术资料分享CM3技术参考手册很好的技术资料.zip
- e护工-管理后台原型 v1.0-医疗健康.rp
- e秒发行人版本.rp
- GIS原型设计.rp
- F-TIME(直播、动态、关注).rp
- IMG_2678.JPG
- 在 Go 中的单元测试中模拟 Redis .zip
- 技术资料分享Cortex-M3权威指南(中文)很好的技术资料.zip
- 技术资料分享CP-SecureMMC-1-00-test很好的技术资料.zip
- 判断回文-Python 实现回文串与回文数的判断方法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功