| | |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuListVo; |
| | | import com.dsh.account.model.vo.exploreDetail.ExploreDatasVo; |
| | | import com.dsh.account.model.vo.exploreDetail.LonLatRequest; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionDetailsVo; |
| | |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.DateTimeHelper; |
| | | import com.dsh.account.util.DateUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | return datasVo; |
| | | } |
| | | |
| | | @Override |
| | | public List<StuListVo> switchStudentActions(Integer appUserId, Integer stuId) { |
| | | List<StuListVo> stuListVos = new ArrayList<>(); |
| | | List<TStudent> tStudents = this.baseMapper.selectList(new QueryWrapper<TStudent>() |
| | | .eq("appUserId", appUserId) |
| | | .eq("state",1)); |
| | | if (tStudents.size() > 0) { |
| | | tStudents.forEach(sts -> { |
| | | if (Objects.equals(sts.getId(), stuId)) { |
| | | sts.setIsDefault(1); |
| | | } else { |
| | | sts.setIsDefault(2); |
| | | } |
| | | this.baseMapper.updateById(sts); |
| | | |
| | | StuListVo vo = new StuListVo(); |
| | | vo.setStuId(sts.getId()); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | vo.setBirthday(simpleDateFormat.format(sts.getBirthday())); |
| | | vo.setStuName(sts.getName()); |
| | | vo.setStuAge(DateUtil.age(sts.getBirthday())); |
| | | vo.setStuHeight(sts.getHeight()); |
| | | vo.setStuWeight(sts.getWeight()); |
| | | vo.setIsNot(sts.getIsDefault()); |
| | | stuListVos.add(vo); |
| | | }); |
| | | } |
| | | return stuListVos; |
| | | } |
| | | |
| | | |
| | | public static List<PurchaseRecordVo> dealDataOfTime(List<PurchaseRecordVo> purchaseRecords) { |
| | | Collections.sort(purchaseRecords, new Comparator<PurchaseRecordVo>() { |