f785d31d 康伟

kangwei : 修改bug

1 个父辈 1452c252
package com.skua.modules.edu.entity;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -12,6 +13,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
......@@ -53,4 +55,16 @@ public class UserAnswer {
@Excel(name = "试题分值", width = 15)
@ApiModelProperty(value = "试题分值")
private String score;
/***
* 答案 分割后排序
*/
public void splitAndSort(){
if(StringUtils.isNotEmpty(this.getAnswer())){
String[] parts = this.getAnswer().split(",");
Arrays.sort(parts);
String result = String.join(",", parts);
this.setAnswer(result );
}
}
}
......
......@@ -4,10 +4,9 @@
<!-- 校对答案,设置试题分值-->
<update id="checkAnswerByUserPaperId" >
update edu_user_answer ua , edu_question q ,edu_paper_question pq
set ua.score = pq.score
where q.id = ua.question_id and q.id = pq.question_id and ua.paper_id = pq.paper_id
and ua.user_paper_id =#{userPaperId}
update edu_user_answer ua
set ua.score = IFNULL((select pq.score from edu_question q ,edu_paper_question pq where q.id = pq.question_id and ua.answer = q.question_answer and ua.paper_id= pq.paper_id and ua.question_id = q.id) , 0)
where ua.user_paper_id = = #{userPaperId}
</update>
</mapper>
\ No newline at end of file
......
......@@ -200,19 +200,18 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
userAnswer.setUserPaperId( userPaper.getId());
userAnswer.setPaperId(userPaper.getPaperId());
userAnswer.setUserId( userPaper.getUserId()) ;
// 答案排序
userAnswer.splitAndSort();
userAnswerMapper.insert( userAnswer ) ;
}
userAnswerMapper.checkAnswerByUserPaperId( userPaper.getId() );
totalScore = userPaperMapper.queryPaperScore(userPaper.getId());
}
userPaper.setScore(totalScore ) ;
userPaperMapper.updateById( userPaper);
// 修改开始人次
Paper paper = paperMapper.selectById( paperVO.getPaperId() ) ;
paper.setUserCount( paper.getUserCount() + 1 ) ;
paperMapper.updateById( paper ) ;
//计算分数
......
......@@ -157,6 +157,7 @@ public class MaterialINController {
if(StringUtils.isNotBlank(materialIN.getEndTime())){
queryWrapper.le("arrive_time",materialIN.getEndTime());
}
queryWrapper.gt("audit_tatus",0);
IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......@@ -227,6 +228,9 @@ public class MaterialINController {
Result<MaterialIN> result = new Result<MaterialIN>();
try {
materialINService.save(materialIN);
MaterialAcceptanceForm materialAcceptanceForm = new MaterialAcceptanceForm();
materialAcceptanceForm.setId( materialIN.getId() ) ;
materialAcceptanceFormService.save(materialAcceptanceForm);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
......
......@@ -244,7 +244,7 @@ public class DangerLevelManageController {
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "风险分级管控清单列表");
mv.addObject(NormalExcelConstants.CLASS, DangerLevelManage.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("风险分级管控清单列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("风险分级管控清单列表数据", "", "风险分级管控清单列表"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
......
......@@ -33,6 +33,7 @@ public class AccidentCase {
/**所属机构*/
@Excel(name = "所属机构", width = 15)
@ApiModelProperty(value = "所属机构")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**事故名称*/
@Excel(name = "事故名称", width = 15)
......@@ -58,6 +59,7 @@ public class AccidentCase {
/**责任人员(用户id)*/
@Excel(name = "责任人员(用户id)", width = 15)
@ApiModelProperty(value = "责任人员(用户id)")
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
private String dutyUser;
/**事故描述*/
@Excel(name = "事故描述", width = 15)
......
......@@ -31,12 +31,12 @@ public class DangerLevelManage{
@ApiModelProperty(value = "id")
private String id;
/**厂区*/
@Excel(name = "厂区", width = 15)
@Excel(name = "厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
@ApiModelProperty(value = "厂区")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**风险点类型*/
@Excel(name = "风险点类型", width = 15)
@Excel(name = "风险点类型", width = 15 ,dicCode = "dangerType")
@ApiModelProperty(value = "风险点类型")
@Dict(dicCode = "dangerType")
private String dangerType;
......@@ -53,7 +53,7 @@ public class DangerLevelManage{
@ApiModelProperty(value = "安全态(标准情况)")
private String dangerStandard;
/**风险等级*/
@Excel(name = "风险等级", width = 15)
@Excel(name = "风险等级", width = 15 ,dicCode = "dangerLevel")
@ApiModelProperty(value = "风险等级")
@Dict(dicCode = "dangerLevel")
private String dangerLevel;
......@@ -66,7 +66,7 @@ public class DangerLevelManage{
@ApiModelProperty(value = "管控措施")
private String dangerWay;
/**管控层级*/
@Excel(name = "管控层级", width = 15)
@Excel(name = "管控层级", width = 15,dicCode = "dangerRank")
@ApiModelProperty(value = "管控层级")
@Dict(dicCode = "dangerRank")
private String dangerRank;
......@@ -79,15 +79,16 @@ public class DangerLevelManage{
@ApiModelProperty(value = "责任人")
private String dangerUser;
/**安全四色图*/
@Excel(name = "安全四色图", width = 15)
//@Excel(name = "安全四色图", width = 15)
@ApiModelProperty(value = "安全四色图")
private String dangerFour;
@Excel(name = "风险点位置", width = 15)
@Excel(name = "风险点位置", width = 15,dicCode = "id",dicText = "struct_name",dictTable = "sys_struct_dict")
@ApiModelProperty(value = "风险点位置")
@Dict(dicCode = "id",dicText = "struct_name",dictTable = "sys_struct_dict")
private String dangerPlace;
@Excel(name = "关联设备", width = 15)
@Excel(name = "关联设备", width = 15,dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info")
@ApiModelProperty(value = "关联设备")
@Dict(dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info")
private String equipInfoId;
......@@ -96,7 +97,7 @@ public class DangerLevelManage{
@ApiModelProperty(value = "是否共享")
private String is_share;
@Excel(name = "二维码", width = 15)
//@Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码")
private String qrCode;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!