123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- package com.ruoyi.system.service.impl;
- import java.util.*;
- import com.ruoyi.common.core.domain.AjaxResult;
- import com.ruoyi.common.exception.ServiceException;
- import com.ruoyi.common.utils.DateUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import com.ruoyi.system.mapper.StudentInfoOldMapper;
- import com.ruoyi.system.domain.StudentInfoOld;
- import com.ruoyi.system.service.IStudentInfoOldService;
- /**
- * 学生档案历史信息Service业务层处理
- *
- * @author ruoyi
- * @date 2023-07-28
- */
- @Service
- public class StudentInfoOldServiceImpl implements IStudentInfoOldService
- {
- @Autowired
- private StudentInfoOldMapper studentInfoOldMapper;
- /**
- * 查询学生档案历史信息
- *
- * @param id 学生档案历史信息主键
- * @return 学生档案历史信息
- */
- @Override
- public StudentInfoOld selectStudentInfoOldById(Long id)
- {
- return studentInfoOldMapper.selectStudentInfoOldById(id);
- }
- /**
- * 查询学生档案历史信息列表
- *
- * @param studentInfoOld 学生档案历史信息
- * @return 学生档案历史信息
- */
- @Override
- public List<StudentInfoOld> selectStudentInfoOldList(StudentInfoOld studentInfoOld)
- {
- if(studentInfoOld.getStudentId()==null || studentInfoOld.getStudentId()==0L){
- throw new ServiceException("参数错误");
- }
- return studentInfoOldMapper.selectStudentInfoOldList(studentInfoOld);
- }
- /**
- * 新增学生档案历史信息
- *
- * @param studentInfoOld 学生档案历史信息
- * @return 结果
- */
- @Override
- public int insertStudentInfoOld(StudentInfoOld studentInfoOld)
- {
- studentInfoOld.setCreateTime(DateUtils.getNowDate());
- return studentInfoOldMapper.insertStudentInfoOld(studentInfoOld);
- }
- /**
- * 修改学生档案历史信息
- *
- * @param studentInfoOld 学生档案历史信息
- * @return 结果
- */
- @Override
- public int updateStudentInfoOld(StudentInfoOld studentInfoOld)
- {
- studentInfoOld.setUpdateTime(DateUtils.getNowDate());
- return studentInfoOldMapper.updateStudentInfoOld(studentInfoOld);
- }
- /**
- * 批量删除学生档案历史信息
- *
- * @param ids 需要删除的学生档案历史信息主键
- * @return 结果
- */
- @Override
- public int deleteStudentInfoOldByIds(Long[] ids)
- {
- return studentInfoOldMapper.deleteStudentInfoOldByIds(ids);
- }
- /**
- * 删除学生档案历史信息信息
- *
- * @param id 学生档案历史信息主键
- * @return 结果
- */
- @Override
- public int deleteStudentInfoOldById(Long id)
- {
- return studentInfoOldMapper.deleteStudentInfoOldById(id);
- }
- @Override
- public AjaxResult selectStudentInfoOldListEcharts(StudentInfoOld studentInfoOld) {
- if(studentInfoOld.getStudentId()==null || studentInfoOld.getStudentId()==0L){
- throw new ServiceException("参数错误");
- }
- List<StudentInfoOld> StudentInfoOldList = studentInfoOldMapper.selectStudentInfoOldListEcharts(studentInfoOld);
- Map<String,Object> map = new HashMap<>();
- List<Object> x = new ArrayList<>();
- List<Object> y1 = new ArrayList<>();
- List<Object> y2 = new ArrayList<>();
- for (StudentInfoOld infoOld : StudentInfoOldList) {
- x.add(DateUtils.dateTime(infoOld.getUpdateTime()));
- y1.add(infoOld.getHeight());
- y2.add(infoOld.getWeight());
- }
- map.put("X",x);
- map.put("Y1",y1);
- map.put("Y2",y2);
- return AjaxResult.success("成功",map);
- }
- }
|