Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
hehai
jiakun.lin 4 years ago
commit 26b1ac4d40
  1. 2
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  2. 4
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  3. 6
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  4. 2
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  5. 2
      src/main/java/com/msdw/tms/dao/UserDao.java
  6. 9
      src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java
  7. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  8. 71
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  9. 4
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  10. 39
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  11. 4
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  12. 2
      src/main/resources/mapper/tms/StudentDao.xml
  13. 4
      src/main/resources/mapper/tms/UserInfoDao.xml

@ -18,7 +18,7 @@ public interface ProjectRcordControllerApi {
Integer recordState,String condition); Integer recordState,String condition);
@ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录") @ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录")
R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions); R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions,Integer systemId);
@ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录") @ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录")
R getUserExperimentscore(Integer page,Integer size,Integer userid); R getUserExperimentscore(Integer page,Integer size,Integer userid);

@ -63,8 +63,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@GetMapping("/user/record") @GetMapping("/user/record")
public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions){ public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions,@RequestParam Integer systemId){
PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions); PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions,systemId);
return R.ok().put("data", page1); return R.ok().put("data", page1);
} }

@ -16,7 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Mapper @Mapper
@ -48,7 +47,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
AchievementManagementVO queryReport(Integer reportId); AchievementManagementVO queryReport(Integer reportId);
void deleteReport(Integer reportId,Integer recordId); void deleteReport(Integer reportId);
IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId); IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
@ -73,7 +72,4 @@ 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);
void deleteReportById(Integer projectId);
} }

@ -23,7 +23,7 @@ import java.util.List;
@Mapper @Mapper
public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> { public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<GetByUserRecordResp> getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions); IPage<GetByUserRecordResp> getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions,@Param("systemId") Integer systemId);
IPage<ProjectRecordVo> getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity); IPage<ProjectRecordVo> getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity);

@ -41,7 +41,7 @@ public interface UserDao extends BaseMapper<UserEntity> {
List<String> findPhoneSetTime(String phone, String checkCode,Integer types); List<String> findPhoneSetTime(String phone, String checkCode,Integer types);
boolean saveCheckPhoneCode(CheckVo checkVo); // boolean saveCheckPhoneCode(CheckVo checkVo);
List<Integer> queryPhone(CheckVo checkVo); List<Integer> queryPhone(CheckVo checkVo);
} }

@ -22,6 +22,15 @@ public class GetByUserRecordResp {
private String submitTime; private String submitTime;
private Integer timeSum; private Integer timeSum;
private Integer userId; private Integer userId;
private Integer systemId;
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public String getProjectName() { public String getProjectName() {
return projectName; return projectName;

@ -17,7 +17,7 @@ import java.util.List;
*/ */
public interface ProjectRecordService extends IService<ProjectRecordEntity> { public interface ProjectRecordService extends IService<ProjectRecordEntity> {
PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions); PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions,Integer systemId);
PageUtils queryExperimentPage(Integer page, Integer size, Integer userid); PageUtils queryExperimentPage(Integer page, Integer size, Integer userid);

@ -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,14 @@ 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);
PageUtils result = new PageUtils(data); PageUtils result = new PageUtils(data);
return R.ok().put("data",result); return R.ok().put("data", result);
} }
@Override @Override
@ -190,7 +193,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 +208,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 +216,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 +250,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 +272,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);
} }
} }

@ -38,7 +38,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
@Override @Override
public PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions) { public PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions,Integer systemId) {
/*GetByUserRecordResp projectRecord = new GetByUserRecordResp(); /*GetByUserRecordResp projectRecord = new GetByUserRecordResp();
projectRecord.setUserId(userId);*/ projectRecord.setUserId(userId);*/
@ -46,7 +46,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
//分页对象 //分页对象
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
IPage<GetByUserRecordResp> projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions); IPage<GetByUserRecordResp> projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions,systemId);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);

@ -132,7 +132,8 @@
LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId
WHERE reportId = #{reportId} WHERE reportId = #{reportId}
</select> </select>
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
<!--
SELECT SELECT
u.userName, u.userName,
sch.schoolName, sch.schoolName,
@ -158,14 +159,46 @@
AND tcr.isdel = 0 AND tcr.isdel = 0
AND u.isdel = 0 AND u.isdel = 0
AND tpr.projectId = #{projectId} AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''">AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') <if test="searchContant!=null and searchContant!=''">
AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') ) OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if> </if>
GROUP BY GROUP BY
tcr.reportId tcr.reportId
ORDER BY tpr.submitTime DESC ORDER BY tpr.submitTime DESC
-->
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
r.reportId,
re.recordId,
sch.schoolName,
s.workNumber,
u.userName,
re.score,
re.submitTime,
r.eventId
FROM
tms_experimental_report r
INNER JOIN tms_experimental_teaching t ON t.id = r.projectId
INNER JOIN student s ON s.studentId = r.studentId
INNER JOIN school sch ON sch.schoolId = s.schoolId
INNER JOIN hr_user_info u ON u.userId = s.userId
INNER JOIN tms_project_record re ON re.projectId = t.project_id
WHERE
t.id = r.projectId
and r.eventId = re.recordId
AND r.projectId = #{projectId}
AND r.isdel = 0
AND t.is_del = 0
AND u.isdel = 0
<if test="searchContant!=null and searchContant!=''">
AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if>
GROUP BY r.reportId DESC
</select> </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,
@ -363,7 +396,7 @@
FROM hr_project_management hpm FROM hr_project_management hpm
WHERE systemId = #{systemId} 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.projectPer missions =
#{projectPermissions} #{projectPermissions}
</if> </if>
<if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%') <if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')

@ -52,13 +52,15 @@
r.startingTime, r.startingTime,
r.submitTime, r.submitTime,
r.timeSum, r.timeSum,
c.userId c.userId,
t.systemId
FROM hr_experiment_code c FROM hr_experiment_code c
INNER JOIN hr_project_management t ON t.projectId = c.projectId INNER JOIN hr_project_management t ON t.projectId = c.projectId
INNER JOIN tms_project_record r ON r.recordId = c.recordId INNER JOIN tms_project_record r ON r.recordId = c.recordId
WHERE c.userId = #{userId} WHERE c.userId = #{userId}
and r.isdel = 0 and r.isdel = 0
and projectPermissions = #{projectPermissions} and projectPermissions = #{projectPermissions}
and t.systemId = #{systemId}
GROUP BY c.recordId desc GROUP BY c.recordId desc
</select> </select>

@ -43,7 +43,7 @@
AND u.isdel = 0 AND u.isdel = 0
AND l.isdel = 0 AND l.isdel = 0
AND s.isdel = 0 AND s.isdel = 0
<if test="searchContent!=null">AND (u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%'))</if> <if test="searchContent!=null">AND (u.account LIKE CONCAT('%',#{searchContent},'%') OR u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%'))</if>
ORDER BY ORDER BY
lastLoginTime DESC,studentId DESC lastLoginTime DESC,studentId DESC
</select> </select>

@ -215,7 +215,7 @@
</update> </update>
<select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity" <select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity"
resultType="hashMap"> resultType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
SELECT SELECT
personalFileId, personalFileId,
schoolId, schoolId,
@ -233,7 +233,7 @@
userId = #{userId} userId = #{userId}
</select> </select>
<select id="queryPersonalInfo" parameterType="com.msdw.tms.entity.UserInfoEntity" <select id="queryPersonalInfo" parameterType="com.msdw.tms.entity.UserInfoEntity"
resultType="hashMap"> resultType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
SELECT SELECT
u.userId, u.userId,
userName, userName,

Loading…
Cancel
Save