rong.liu 4 years ago
commit 44b86fcf58
  1. 3
      src/main/java/com/msdw/tms/dao/ClassTeachingDao.java
  2. 29
      src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java
  3. 10
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  4. 6
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  5. 4
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  6. 10
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  7. 3
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml

@ -23,4 +23,7 @@ public interface ClassTeachingDao {
void updateSurplusTimeLe(ProjectRecordVo recordVo);
void updateSurplusTimeGt(ProjectRecordVo recordVo);
int updateExperimentalNumber(Integer number, Integer id);
}

@ -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;
}

@ -36,6 +36,16 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
Page<T> page1 = new Page<>(page, size);
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;
}

@ -75,11 +75,11 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId, isdel);
Double totalTime = projectRecordVo.getTotalTime();
if (totalTime != null) {
/*DecimalFormat df = new DecimalFormat("0.00");
DecimalFormat df = new DecimalFormat("0.0");
double time = totalTime / 60;
String format = df.format(time);
projectRecordVo.setTotalTime(Double.parseDouble(format));*/
projectRecordVo.setTotalTime(projectRecordVo.getTotalTime());
projectRecordVo.setTotalTime(Double.parseDouble(format));
//projectRecordVo.setTotalTime(projectRecordVo.getTotalTime());
}

@ -363,7 +363,7 @@
<select id="list" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM
hr_experimental_report her where hpm.projectId = her.projectId ) as number
tms_project_record her where hpm.projectId = her.projectId ) as number
FROM hr_project_management hpm WHERE systemId = #{systemId}
AND hpm.isdel = 0
<if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPermissions =
@ -384,7 +384,7 @@
SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as
experimentalName,et.project_id as projectId,
pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM
hr_experimental_report her where et.project_id = her.projectId ) as number
tms_project_record her where et.project_id = her.projectId ) as number
FROM tms_experimental_teaching et,hr_project_management pm
WHERE user_id = #{userId}
AND et.project_id = pm.projectId

@ -13,7 +13,8 @@
surplus_time,
experiment_duration,
experimental_name,
experimental_number,
(select count(*)
from tms_project_record WHERE projectId = project_id) as experimental_number,
start_time,
stop_time,
`status`,
@ -109,4 +110,11 @@
<select id="querySimulationPlayList" resultType="com.msdw.tms.entity.BroadcastEntity">
SELECT id,title,links,isdel FROM tms_broadcast
</select>
<update id="updateExperimentalNumber">
UPDATE tms_experimental_teaching
SET experimental_number = #{number}
WHERE
id = #{id}
</update>
</mapper>

@ -10,7 +10,8 @@
experimental_name,
project_id,
project_name,
experimental_number,
(select count(*)
from tms_project_record WHERE projectId = project_id) as experimental_number,
experiment_duration,
type,
start_time,

Loading…
Cancel
Save