Merge remote-tracking branch 'origin/master'

hehai
zhiyong.ning 4 years ago
commit 89f91a440b
  1. 5
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  2. 3
      src/main/java/com/msdw/tms/dao/ClassTeachingDao.java
  3. 3
      src/main/java/com/msdw/tms/entity/UserInfoEntity.java
  4. 74
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  5. 29
      src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java
  6. 10
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  7. 3
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  8. 8
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  9. 10
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  10. 3
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml

@ -51,6 +51,9 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId); IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
//实验成绩管理查看成绩 统计平均分
String getAVG(Integer projectId);
List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids); List<AchievementImportRequest> queryAchievement(@Param("ids") List<Integer> ids);
List<AchievementManagementVO> queryFictitiousRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List<Integer> projectIds); List<AchievementManagementVO> queryFictitiousRecord(Integer systemId, String searchContant, String startingtime, String endtime, Integer month, List<Integer> projectIds);
@ -71,5 +74,5 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
List<AchievementManagementVO> queryPythonTest(Integer eventId); List<AchievementManagementVO> queryPythonTest(Integer eventId);
void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment); void updateSignatrue(Integer isSignature, Integer signatureId, Integer reportId, String comment);
} }

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

@ -17,7 +17,8 @@ public class UserInfoEntity {
//用户姓名 //用户姓名
private String userName; private String userName;
//用户账号 //用户账号
@Pattern(regexp = "/^[1-9]([0-9]{1,5})?$/", message = "账号只能为数字!") //@Pattern(regexp = "/^[1-9]([0-9]{1,5})?$/", message = "账号只能为数字!")
@Pattern(regexp = "^[0-9a-zA-Z]*$",message = "账号只能为数字或字母!")
private String account; private String account;
//用户密码 //用户密码
private String password; private String password;

@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.*; import java.util.*;
@Slf4j @Slf4j
@Service @Service
public class AchievementManagementServiceImpl extends ServiceImpl<AchievementManagementDao, ExperimentalReportEntity> implements AchievementManagementService { public class AchievementManagementServiceImpl extends ServiceImpl<AchievementManagementDao, ExperimentalReportEntity> implements AchievementManagementService {
@ -58,39 +59,39 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
experimentalReportEntity.setReportId(reportId); experimentalReportEntity.setReportId(reportId);
ExperimentalReportEntity experimentalReportEntity1 = baseMapper.getReport(experimentalReportEntity); ExperimentalReportEntity experimentalReportEntity1 = baseMapper.getReport(experimentalReportEntity);
List<UserScoreVO> score = baseMapper.getScore(userScoreVO); List<UserScoreVO> score = baseMapper.getScore(userScoreVO);
obj.put("score",score); obj.put("score", score);
obj.put("experimentalReportEntity",experimentalReportEntity1); obj.put("experimentalReportEntity", experimentalReportEntity1);
List<Integer> tradingJudgmentPointsIds = baseMapper.queryTradingJudgmentPointsId(reportId); List<Integer> tradingJudgmentPointsIds = baseMapper.queryTradingJudgmentPointsId(reportId);
Integer size = tradingJudgmentPointsIds.size(); Integer size = tradingJudgmentPointsIds.size();
for (int i = 0;i<size; i++){ for (int i = 0; i < size; i++) {
Integer tradingJudgmentPointsId = tradingJudgmentPointsIds.get(i); Integer tradingJudgmentPointsId = tradingJudgmentPointsIds.get(i);
List<JudgmentPointsRuleVO> judgmentPointsRuleList = baseMapper.getUserAnswers(tradingJudgmentPointsId); List<JudgmentPointsRuleVO> judgmentPointsRuleList = baseMapper.getUserAnswers(tradingJudgmentPointsId);
map.put("judgmentPointsRuleList"+i,judgmentPointsRuleList); map.put("judgmentPointsRuleList" + i, judgmentPointsRuleList);
} }
obj.put("userAnswersList",map); obj.put("userAnswersList", map);
return R.ok().put("data",obj); return R.ok().put("data", obj);
} }
@Override @Override
public R getTeacher(Integer projectId) { public R getTeacher(Integer projectId) {
String name = baseMapper.getTeacher(projectId); String name = baseMapper.getTeacher(projectId);
return R.ok().put("name",name); return R.ok().put("name", name);
} }
@Override @Override
public List<ResultsEntity> list(ResultsVo vo,Integer page,Integer size) { public List<ResultsEntity> list(ResultsVo vo, Integer page, Integer size) {
List<ResultsEntity> list = achievementManagementDao.list(vo); List<ResultsEntity> list = achievementManagementDao.list(vo);
return list; return list;
} }
@Override @Override
public List<ReportEntity> reportList(ResultsVo vo,Integer page,Integer size) { public List<ReportEntity> reportList(ResultsVo vo, Integer page, Integer size) {
List<ReportEntity> reportList = achievementManagementDao.reportList(vo); List<ReportEntity> reportList = achievementManagementDao.reportList(vo);
return reportList; return reportList;
} }
@Override @Override
public List<ResultsEntity> newList(ResultsVo vo,Integer page,Integer size) { public List<ResultsEntity> newList(ResultsVo vo, Integer page, Integer size) {
List<ResultsEntity> newList = achievementManagementDao.newList(vo); List<ResultsEntity> newList = achievementManagementDao.newList(vo);
return newList; return newList;
} }
@ -152,20 +153,20 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer eventId = report.getEventId(); Integer eventId = report.getEventId();
ProjectRecordEntity record = projectRecordDao.queryReport(eventId); ProjectRecordEntity record = projectRecordDao.queryReport(eventId);
String userName = userInfoDao.queryUserReport(record.getUserid()); String userName = userInfoDao.queryUserReport(record.getUserid());
if (report.getProjectId()!=null){ if (report.getProjectId() != null) {
String evaluationName = achievementManagementDao.queryEvaluationName(report.getProjectId()); String evaluationName = achievementManagementDao.queryEvaluationName(report.getProjectId());
report.setEvaluationName(evaluationName); report.setEvaluationName(evaluationName);
} }
//python实验数据 //python实验数据
Integer systemId = report.getSystemId(); Integer systemId = report.getSystemId();
if (systemId==1|systemId==4|systemId==5) { if (systemId == 1 | systemId == 4 | systemId == 5) {
List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(eventId); List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(eventId);
map.put("data", data); map.put("data", data);
} }
report.setUserName(userName); report.setUserName(userName);
map.put("report",report); map.put("report", report);
map.put("record",record); map.put("record", record);
return R.ok().put("data",map); return R.ok().put("data", map);
} }
@Override @Override
@ -176,12 +177,17 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
@Override @Override
public R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size) { public R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size) {
Page<T> tPage = new Page<>(page,size); Page<T> tPage = new Page<>(page, size);
IPage<AchievementManagementVO> data = achievementManagementDao.queryEvaluationReport(tPage,searchContant,projectId); IPage<AchievementManagementVO> data = achievementManagementDao.queryEvaluationReport(tPage, searchContant, projectId);
String avg = achievementManagementDao.getAVG(projectId);
PageUtils result = new PageUtils(data); PageUtils result = new PageUtils(data);
return R.ok().put("data",result); return R.ok().put("data", result).put("avg", avg);
} }
@Override @Override
@ -190,7 +196,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
List<Integer> list = new ArrayList<>(); List<Integer> list = new ArrayList<>();
String[] split = ids.split(","); String[] split = ids.split(",");
for (int i = 0;i<split.length;i++){ for (int i = 0; i < split.length; i++) {
list.add(Integer.parseInt(split[i])); list.add(Integer.parseInt(split[i]));
} }
List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list); List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list);
@ -205,7 +211,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
@Override @Override
public R queryAchievement(Integer systemId,Integer projectPermissions, String searchContant, String startingtime, public R queryAchievement(Integer systemId, Integer projectPermissions, String searchContant, String startingtime,
String endtime, Integer month) { String endtime, Integer month) {
try { try {
List<AchievementManagementVO> fictitious; List<AchievementManagementVO> fictitious;
@ -213,14 +219,16 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
List<AchievementManagementVO> vo = new ArrayList<>(); List<AchievementManagementVO> vo = new ArrayList<>();
List<Integer> educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id List<Integer> educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id
List<Integer> fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id List<Integer> fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id
if (projectPermissions==null){projectPermissions=-9999;} if (projectPermissions == null) {
if (projectPermissions==0){//只查询练习项目 projectPermissions = -9999;
}
if (projectPermissions == 0) {//只查询练习项目
fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult);
vo = fictitious; vo = fictitious;
}else if (projectPermissions==1){//只查询考核项目 } else if (projectPermissions == 1) {//只查询考核项目
education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult); education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult);
vo = education; vo = education;
}else {//查询练习+考核项目 } else {//查询练习+考核项目
if (educationResult.size() == 0) { if (educationResult.size() == 0) {
if (fictitiousResult.size() > 0) { if (fictitiousResult.size() > 0) {
fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult);
@ -245,10 +253,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
} }
} }
return R.ok().put("data",vo); return R.ok().put("data", vo);
}catch (RuntimeException e){ } catch (RuntimeException e) {
log.info(e.getMessage()); log.info(e.getMessage());
return R.error(500,"系统异常!!!"); return R.error(500, "系统异常!!!");
} }
} }
@ -267,13 +275,13 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer signatureId = entity.getSignatureId(); Integer signatureId = entity.getSignatureId();
Integer reportId = entity.getReportId(); Integer reportId = entity.getReportId();
String comment = entity.getComment(); String comment = entity.getComment();
if (comment==""){ if (comment == "") {
comment = null; comment = null;
} }
if (isSignature==1){ if (isSignature == 1) {
achievementManagementDao.updateSignatrue(1,signatureId,reportId,comment); achievementManagementDao.updateSignatrue(1, signatureId, reportId, comment);
}else { } else {
achievementManagementDao.updateSignatrue(0,null,reportId,comment); achievementManagementDao.updateSignatrue(0, null, reportId, comment);
} }
} }

@ -2,24 +2,32 @@ package com.msdw.tms.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.Constant;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.dao.ClassTeachingDao; import com.msdw.tms.dao.ClassTeachingDao;
import com.msdw.tms.dao.ExperimentalTeachingDao;
import com.msdw.tms.entity.BroadcastEntity; import com.msdw.tms.entity.BroadcastEntity;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingVO;
import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.service.ClassTeachingService; import com.msdw.tms.service.ClassTeachingService;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@Service @Service
public class ClassTeachingServiceImpl implements ClassTeachingService { public class ClassTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ClassTeachingService {
@Autowired @Autowired
private ClassTeachingDao classMapper; private ClassTeachingDao classMapper;
@Autowired
private ClassTeachingDao classTeachingDao;
@Override @Override
public ExperimentalTeachingEntity queryInvitationcode(ExperimentalTeachingEntity experimentEntity) { public ExperimentalTeachingEntity queryInvitationcode(ExperimentalTeachingEntity experimentEntity) {
ExperimentalTeachingEntity ex = classMapper.queryInvitationCode(experimentEntity); ExperimentalTeachingEntity ex = classMapper.queryInvitationCode(experimentEntity);
@ -44,8 +52,23 @@ public class ClassTeachingServiceImpl implements ClassTeachingService {
this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间 this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间
this.classMapper.updateSurplusTimeLe(recordVo); this.classMapper.updateSurplusTimeLe(recordVo);
this.classMapper.updateSurplusTimeGt(recordVo); this.classMapper.updateSurplusTimeGt(recordVo);
IPage<ProjectRecordVo> schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); // IPage<ProjectRecordVo> schoolRecord = this.classMapper.getByClassRecord(page1, recordVo);
PageUtils pageUtils = new PageUtils(schoolRecord); // 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; return pageUtils;
} }

@ -36,6 +36,16 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
ExperimentalTeachingDao userDao = this.getBaseMapper(); ExperimentalTeachingDao userDao = this.getBaseMapper();
IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo); 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); PageUtils pageUtils = new PageUtils(list);
return pageUtils; return pageUtils;
} }

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

@ -166,6 +166,10 @@
ORDER BY tpr.submitTime DESC ORDER BY tpr.submitTime DESC
</select> </select>
<select id="getAVG" parameterType="java.lang.Integer" resultType="java.lang.String">
SELECT AVG(score) from tms_project_record WHERE projectId = #{projectId}
</select>
<select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest"> <select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest">
SELECT SELECT
u.userName, u.userName,
@ -359,7 +363,7 @@
<select id="list" resultType="com.msdw.tms.entity.ResultsEntity"> <select id="list" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM 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} FROM hr_project_management hpm WHERE systemId = #{systemId}
AND hpm.isdel = 0 AND hpm.isdel = 0
<if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPermissions = <if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPermissions =
@ -380,7 +384,7 @@
SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as
experimentalName,et.project_id as projectId, experimentalName,et.project_id as projectId,
pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM 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 FROM tms_experimental_teaching et,hr_project_management pm
WHERE user_id = #{userId} WHERE user_id = #{userId}
AND et.project_id = pm.projectId AND et.project_id = pm.projectId

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

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

Loading…
Cancel
Save