班级实验列表和成绩管理修改删除实验报告

hehai
mzh820631607 4 years ago
parent 9eff617749
commit d069a94f21
  1. 12
      src/main/java/com/msdw/tms/api/AchievementManagementApi.java
  2. 2
      src/main/java/com/msdw/tms/api/ClassTeachingApi.java
  3. 14
      src/main/java/com/msdw/tms/controller/AchievementManagementController.java
  4. 3
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  5. 4
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  6. 4
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  7. 2
      src/main/java/com/msdw/tms/service/AchievementManagementService.java
  8. 30
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  9. 4
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  10. 92
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  11. 4
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml
  12. 2
      src/test/java/com/msdw/tms/service/AchievementManagementTest.java

@ -28,7 +28,7 @@ public interface AchievementManagementApi {
// R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); // R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity);
@ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") @ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告")
R deleteReport(@ApiParam(value = "实验记录主键reportId(此处为ids集合)",required = true) AchievementManagementVo vo); R deleteReport(@ApiParam(value = "实验记录主键",required = true) Integer reportId);
@ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询") @ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询")
R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant, R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant,
@ -41,15 +41,15 @@ public interface AchievementManagementApi {
@ApiOperation(value = "成绩管理列表",notes = "成绩管理列表筛选查询") @ApiOperation(value = "成绩管理列表",notes = "成绩管理列表筛选查询")
R queryAchievement(@ApiParam(value = "平台id",required = false) Integer systemId, R queryAchievement(@ApiParam(value = "平台id",required = false) Integer systemId,
@ApiParam(value = "项目类型",required = false) Integer projectPermissions, @ApiParam(value = "项目类型(0练习,1考核)",required = false) Integer projectPermissions,
@ApiParam(value = "搜索内容",required = false) String searchContant, @ApiParam(value = "搜索内容(项目名称/实验班级)",required = false) String searchContant,
@ApiParam(value = "开始时间",required = false) String startingtime, @ApiParam(value = "开始时间",required = false) String startingtime,
@ApiParam(value = "结束时间",required = false) String endtime, @ApiParam(value = "结束时间",required = false) String endtime,
@ApiParam(value = "最近几月",required = false) Integer month); @ApiParam(value = "最近几月",required = false) Integer month);
@ApiOperation(value = "修改教师评语",notes = "修改教师评语:评语comment和实验报告主键reportId") // @ApiOperation(value = "修改教师评语",notes = "修改教师评语:评语comment和实验报告主键reportId")
R updateComment(@ApiParam(value = "评语comment和实验报告主键reportId",required = true) ExperimentalReportEntity entity); // R updateComment(@ApiParam(value = "评语comment和实验报告主键reportId",required = true) ExperimentalReportEntity entity);
@ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名") @ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名")
R updateSignatrue(@ApiParam(value = "实验报告主键reportId+是否使用教师签名isSignature+教师签名id signatureId") ExperimentalReportEntity entity); R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity);
} }

@ -17,7 +17,7 @@ public interface ClassTeachingApi {
@ApiOperation(value = "查询班级实验列表信息",notes = "查询班级实验列表信息") @ApiOperation(value = "查询班级实验列表信息",notes = "查询班级实验列表信息")
R queryTestRecord(Integer page, Integer size, Integer month, String startTime, String endTime, R queryTestRecord(Integer page, Integer size, Integer month, String startTime, String endTime,
String condition, Integer status); String condition, Integer status,Integer schoolId);
@ApiOperation(value = "查看成绩",notes = "查看成绩") @ApiOperation(value = "查看成绩",notes = "查看成绩")
R queryAchievement(); R queryAchievement();

@ -66,11 +66,12 @@ public class AchievementManagementController implements AchievementManagementApi
*/ */
@Override @Override
@PostMapping("/deleteReport") @PostMapping("/deleteReport")
public R deleteReport(@RequestBody AchievementManagementVo vo){ public R deleteReport(@RequestParam Integer reportId){
R result = service.deleteReport(vo); R result = service.deleteReport(reportId);
return result; return result;
} }
/** /**
* 班级实验报告列表查询 * 班级实验报告列表查询
* @param searchContant * @param searchContant
@ -98,6 +99,7 @@ public class AchievementManagementController implements AchievementManagementApi
service.exportAchievement(response,ids);//SearchAchievementVo vo service.exportAchievement(response,ids);//SearchAchievementVo vo
} }
//成绩管理列表
@Override @Override
@GetMapping("/queryAchievement") @GetMapping("/queryAchievement")
public R queryAchievement(@RequestParam(required = false) Integer systemId, public R queryAchievement(@RequestParam(required = false) Integer systemId,
@ -115,13 +117,19 @@ public class AchievementManagementController implements AchievementManagementApi
* @param entity * @param entity
* @return * @return
*/ */
@Override // @Override
@PostMapping("/updateComment") @PostMapping("/updateComment")
public R updateComment(@RequestBody ExperimentalReportEntity entity){ public R updateComment(@RequestBody ExperimentalReportEntity entity){
R result = service.updateComment(entity); R result = service.updateComment(entity);
return result; return result;
} }
/**
* 发布成绩
* 修改教师签名+修改教师评语
* @param entity isSignaturesignatureIdreportIdcomment
* @return
*/
@Override @Override
@PostMapping("/release") @PostMapping("/release")
public R updateSignatrue(@RequestBody ExperimentalReportEntity entity){ public R updateSignatrue(@RequestBody ExperimentalReportEntity entity){

@ -44,7 +44,7 @@ public class ClassTeachingController implements ClassTeachingApi {
@Override @Override
@GetMapping("userRecord") @GetMapping("userRecord")
public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month,String startTime,String endTime, public R queryTestRecord(@RequestParam Integer page, @RequestParam Integer size, Integer month,String startTime,String endTime,
String condition, @RequestParam Integer status){ String condition, @RequestParam Integer status,@RequestParam Integer schoolId){
ProjectRecordVo recordVo = new ProjectRecordVo(); ProjectRecordVo recordVo = new ProjectRecordVo();
if (status==1||status==2||status==3) {//限定实验状态 if (status==1||status==2||status==3) {//限定实验状态
recordVo.setStatus(status); recordVo.setStatus(status);
@ -64,6 +64,7 @@ public class ClassTeachingController implements ClassTeachingApi {
recordVo.setEndTime(endTime); recordVo.setEndTime(endTime);
} }
} }
recordVo.setSchoolId(schoolId);
PageUtils page1 = classTeachingService.queryClassRecord(page,size,recordVo); PageUtils page1 = classTeachingService.queryClassRecord(page,size,recordVo);
return R.ok().put("page", page1); return R.ok().put("page", page1);
} }

@ -22,7 +22,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
AchievementManagementVo queryReport(Integer reportId); AchievementManagementVo queryReport(Integer reportId);
void deleteReport(AchievementManagementVo vo); void deleteReport(Integer reportId);
IPage<AchievementManagementVo> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId); IPage<AchievementManagementVo> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
@ -46,5 +46,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); void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment);
} }

@ -96,5 +96,9 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
* 学生ID * 学生ID
*/ */
private Integer studentId; private Integer studentId;
/**
* 学校id
*/
private Integer schoolId;
} }

@ -17,7 +17,7 @@ public interface AchievementManagementService extends IService<ExperimentalRepor
R queryReport(Integer reportId ); R queryReport(Integer reportId );
R deleteReport(AchievementManagementVo vo); R deleteReport(Integer reportId);
R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size); R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size);

@ -67,9 +67,23 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
//2.根据实验得分 自动获取评语信息 //2.根据实验得分 自动获取评语信息
//3.将评语对应的commentId放入entity以便一齐存入实验报告表 //3.将评语对应的commentId放入entity以便一齐存入实验报告表
//(无判分系统暂写commentId=4,score=100) //(无判分系统暂写score=100)
entity.setCommentId(4);
record.setScore(100); record.setScore(100);
//根据成绩取出对应的评语和评语id
Integer score = record.getScore();
if (score!=null) {
if (score<60){
entity.setCommentId(1);//成绩不合格
}else if (score>=60&&score<70){
entity.setCommentId(2);//合格
}else if (score>=70&&score<90){
entity.setCommentId(3);//良好
}else {
entity.setCommentId(4);//优秀
}
}else {
return R.error("系统异常,成绩为空!");
}
//4.添加实验记录表信息 //4.添加实验记录表信息
projectRecordDao.addReport(record);//保存至tms_project_record并返回主键 projectRecordDao.addReport(record);//保存至tms_project_record并返回主键
@ -105,8 +119,8 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
@Override @Override
@Transactional @Transactional
public R deleteReport(AchievementManagementVo vo) { public R deleteReport(Integer reportId) {
achievementManagementDao.deleteReport(vo); achievementManagementDao.deleteReport(reportId);
return R.ok(); return R.ok();
} }
@ -201,10 +215,14 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer isSignature = entity.getIsSignature(); Integer isSignature = entity.getIsSignature();
Integer signatureId = entity.getSignatureId(); Integer signatureId = entity.getSignatureId();
Integer reportId = entity.getReportId(); Integer reportId = entity.getReportId();
String comment = entity.getComment();
if (comment==""){
comment = null;
}
if (isSignature==1){ if (isSignature==1){
achievementManagementDao.updateSignatrue(1,signatureId,reportId); achievementManagementDao.updateSignatrue(1,signatureId,reportId,comment);
}else { }else {
achievementManagementDao.updateSignatrue(0,null,reportId); achievementManagementDao.updateSignatrue(0,null,reportId,comment);
} }
} }

@ -19,7 +19,7 @@ VALUES
</update> </update>
<update id="updateSignatrue"> <update id="updateSignatrue">
UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId} WHERE reportId = #{reportId} UPDATE tms_experimental_report SET isSignature = #{isSignature} , signatureId = #{signatureId}, `comment` = #{comment} WHERE reportId = #{reportId}
</update> </update>
<select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVo"> <select id="queryReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVo">
SELECT SELECT
@ -177,7 +177,7 @@ WHERE
AND hpm.projectPermissions = 1 AND hpm.projectPermissions = 1
AND tcr.isdel = 0 AND tcr.isdel = 0
<if test="systemId!=null and systemId!=''"> AND hpm.systemId = #{systemId} </if> <if test="systemId!=null and systemId!=''"> AND hpm.systemId = #{systemId} </if>
<if test="searchContant!=null and searchContant!=''"> and hpm.projectName like concat('%',#{searchContant},'%')</if> <if test="searchContant!=null and searchContant!=''"> and (hpm.projectName like concat('%',#{searchContant},'%') OR tet.experimental_class_name like concat('%',#{searchContant},'%') )</if>
<if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if> <if test="startingtime!=null and startingtime!='' and endtime!=null and endtime != ''"> and hpm.creationTime between #{endtime} and #{startingtime}</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(creation_time)</if> <if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;= date(creation_time)</if>
<if test="projectIds.size!=null"> <if test="projectIds.size!=null">

@ -7,55 +7,57 @@
</select> </select>
<select id="getByClassRecord" resultType="com.msdw.tms.entity.ExperimentalTeachingEntity"> <select id="getByClassRecord" resultType="com.msdw.tms.entity.ExperimentalTeachingEntity">
SELECT SELECT
id, id,
experimental_class_name, experimental_class_name,
surplus_time, surplus_time,
experiment_duration, experiment_duration,
experimental_name, experimental_name,
experimental_number, experimental_number,
start_time, start_time,
stop_time, stop_time,
`status`, `status`,
project_id, project_id,
is_code, is_code,
creation_time creation_time
FROM FROM
tms_experimental_teaching tms_experimental_teaching
WHERE WHERE
is_del=0 is_del=0
AND (user_id in (select userId FROM staff WHERE schoolId = #{cla.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,2,3') )
OR user_id IN ( SELECT userId FROM hr_user_info WHERE disableAccount = 0 AND isdel = 0 AND FIND_IN_SET( roleId, '1' ) ) )
<if test="cla.status!=null">and `status` = #{cla.status}</if> <if test="cla.status!=null">and `status` = #{cla.status}</if>
<if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if> <if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>
<if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if> <if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if>
<if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(creation_time)</if> <if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(creation_time)</if>
ORDER BY creation_time DESC ORDER BY creation_time DESC
</select> </select>
<!-- <select id="getByClassRecord" resultType="com.msdw.tms.entity.ExperimentalTeachingEntity">--> <!-- <select id="getByClassRecord" resultType="com.msdw.tms.entity.ExperimentalTeachingEntity">-->
<!-- SELECT--> <!-- SELECT-->
<!-- id,--> <!-- id,-->
<!-- experimental_class_name,--> <!-- experimental_class_name,-->
<!-- surplus_time,--> <!-- surplus_time,-->
<!-- experiment_duration,--> <!-- experiment_duration,-->
<!-- experimental_name,--> <!-- experimental_name,-->
<!-- experimental_number,--> <!-- experimental_number,-->
<!-- start_time,--> <!-- start_time,-->
<!-- stop_time,--> <!-- stop_time,-->
<!-- `status`,--> <!-- `status`,-->
<!-- project_id,--> <!-- project_id,-->
<!-- is_code,--> <!-- is_code,-->
<!-- creation_time--> <!-- creation_time-->
<!-- FROM--> <!-- FROM-->
<!-- tms_experimental_teaching--> <!-- tms_experimental_teaching-->
<!-- WHERE--> <!-- WHERE-->
<!-- is_del=0--> <!-- is_del=0-->
<!-- AND--> <!-- AND-->
<!-- start_time >='2020-01-01 00:00:00'--> <!-- start_time >='2020-01-01 00:00:00'-->
<!-- <if test="cla.status!=null">and `status` = #{cla.status}</if>--> <!-- <if test="cla.status!=null">and `status` = #{cla.status}</if>-->
<!-- <if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>--> <!-- <if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>-->
<!-- <if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if>--> <!-- <if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if>-->
<!-- <if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(creation_time)</if>--> <!-- <if test="cla.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) &lt;= date(creation_time)</if>-->
<!-- ORDER BY creation_time DESC--> <!-- ORDER BY creation_time DESC-->
<!-- </select>--> <!-- </select>-->
<update id="updateSurplusTime" parameterType="com.msdw.tms.entity.ExperimentalTeachingEntity"> <update id="updateSurplusTime" parameterType="com.msdw.tms.entity.ExperimentalTeachingEntity">
UPDATE tms_experimental_teaching UPDATE tms_experimental_teaching

@ -41,6 +41,10 @@
<if test="exp.month!=null"> <if test="exp.month!=null">
AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) &lt;= date(creation_time) AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) &lt;= date(creation_time)
</if> </if>
<if test='exp.schoolId!=null and exp.schoolId!=null'>
AND (user_id in (select userId FROM staff WHERE schoolId = #{exp.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,2,3') )
OR user_id IN ( SELECT userId FROM hr_user_info WHERE disableAccount = 0 AND isdel = 0 AND FIND_IN_SET( roleId, '1' ) ) )
</if>
order by creation_time desc order by creation_time desc
</select> </select>

@ -91,7 +91,7 @@ public class AchievementManagementTest {
entity.setRecordid(recordId); entity.setRecordid(recordId);
vo.setReportId(reportId); vo.setReportId(reportId);
vo.setEntity(entity); vo.setEntity(entity);
R r = achievementManagementService.deleteReport(vo); R r = achievementManagementService.deleteReport(reportId);
System.out.println(r); System.out.println(r);
} }

Loading…
Cancel
Save