|
|
|
@ -2,24 +2,32 @@ package com.msdw.tms.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.msdw.tms.common.utils.Constant; |
|
|
|
|
import com.msdw.tms.common.utils.PageUtils; |
|
|
|
|
import com.msdw.tms.dao.ClassTeachingDao; |
|
|
|
|
import com.msdw.tms.dao.ExperimentalTeachingDao; |
|
|
|
|
import com.msdw.tms.entity.BroadcastEntity; |
|
|
|
|
import com.msdw.tms.entity.ExperimentalTeachingEntity; |
|
|
|
|
import com.msdw.tms.entity.ProjectRecordEntity; |
|
|
|
|
import com.msdw.tms.entity.vo.ExperimentalTeachingVO; |
|
|
|
|
import com.msdw.tms.entity.vo.ProjectRecordVo; |
|
|
|
|
import com.msdw.tms.service.ClassTeachingService; |
|
|
|
|
import org.apache.poi.ss.formula.functions.T; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
public class ClassTeachingServiceImpl implements ClassTeachingService { |
|
|
|
|
public class ClassTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ClassTeachingService { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ClassTeachingDao classMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ClassTeachingDao classTeachingDao; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public ExperimentalTeachingEntity queryInvitationcode(ExperimentalTeachingEntity experimentEntity) { |
|
|
|
|
ExperimentalTeachingEntity ex = classMapper.queryInvitationCode(experimentEntity); |
|
|
|
@ -44,8 +52,23 @@ public class ClassTeachingServiceImpl implements ClassTeachingService { |
|
|
|
|
this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间
|
|
|
|
|
this.classMapper.updateSurplusTimeLe(recordVo); |
|
|
|
|
this.classMapper.updateSurplusTimeGt(recordVo); |
|
|
|
|
IPage<ProjectRecordVo> schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); |
|
|
|
|
PageUtils pageUtils = new PageUtils(schoolRecord); |
|
|
|
|
// IPage<ProjectRecordVo> schoolRecord = this.classMapper.getByClassRecord(page1, recordVo);
|
|
|
|
|
// PageUtils pageUtils = new PageUtils(schoolRecord);
|
|
|
|
|
ExperimentalTeachingVO vo = new ExperimentalTeachingVO(); |
|
|
|
|
BeanUtils.copyProperties(recordVo,vo); |
|
|
|
|
ExperimentalTeachingDao userDao = this.getBaseMapper(); |
|
|
|
|
IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo); |
|
|
|
|
for (int i = 0; i < list.getRecords().size(); i++) { |
|
|
|
|
Integer number = list.getRecords().get(i).getExperimentalNumber(); |
|
|
|
|
Integer id = list.getRecords().get(i).getId(); |
|
|
|
|
//读取另一个表,将数据更新进 tms_experimental_teaching
|
|
|
|
|
int isTure = classTeachingDao.updateExperimentalNumber(number,id); |
|
|
|
|
if(isTure < 0){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PageUtils pageUtils = new PageUtils(list); |
|
|
|
|
return pageUtils; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|