| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.model.QueryCoursePackageSchedulingList; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingsById") |
| | | public List<CoursePackageScheduling> queryCoursePackageSchedulingsById(@RequestBody Long id){ |
| | | CoursePackageScheduling byId = coursePackageSchedulingService.getById(id); |
| | | Date date = new Date(); // 假设你有一个 Date 对象 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String formattedDate = sdf.format(byId.getClassDate()); |
| | | List<CoursePackageScheduling> list = coursePackageSchedulingService.list(new LambdaQueryWrapper<CoursePackageScheduling>().eq(CoursePackageScheduling::getCoursePackageId,byId.getCoursePackageId()).eq(CoursePackageScheduling::getClassDate,formattedDate)); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * @param coursePackageScheduling |
| | |
| | | coursePackageScheduling.setCoursePackageId(null); |
| | | coursePackageSchedulingService.updateById(coursePackageScheduling); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling") |
| | | public void addCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){ |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | } |
| | | } |