f785d31d 康伟

kangwei : 修改bug

1 个父辈 1452c252
1 package com.skua.modules.edu.entity; 1 package com.skua.modules.edu.entity;
2 2
3 import java.io.Serializable; 3 import java.io.Serializable;
4 import java.util.Arrays;
4 import java.util.Date; 5 import java.util.Date;
5 import com.baomidou.mybatisplus.annotation.IdType; 6 import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId; 7 import com.baomidou.mybatisplus.annotation.TableId;
...@@ -12,6 +13,7 @@ import lombok.Data; ...@@ -12,6 +13,7 @@ import lombok.Data;
12 import lombok.EqualsAndHashCode; 13 import lombok.EqualsAndHashCode;
13 import lombok.experimental.Accessors; 14 import lombok.experimental.Accessors;
14 import com.fasterxml.jackson.annotation.JsonFormat; 15 import com.fasterxml.jackson.annotation.JsonFormat;
16 import org.apache.commons.lang3.StringUtils;
15 import org.springframework.format.annotation.DateTimeFormat; 17 import org.springframework.format.annotation.DateTimeFormat;
16 import org.jeecgframework.poi.excel.annotation.Excel; 18 import org.jeecgframework.poi.excel.annotation.Excel;
17 19
...@@ -53,4 +55,16 @@ public class UserAnswer { ...@@ -53,4 +55,16 @@ public class UserAnswer {
53 @Excel(name = "试题分值", width = 15) 55 @Excel(name = "试题分值", width = 15)
54 @ApiModelProperty(value = "试题分值") 56 @ApiModelProperty(value = "试题分值")
55 private String score; 57 private String score;
58
59 /***
60 * 答案 分割后排序
61 */
62 public void splitAndSort(){
63 if(StringUtils.isNotEmpty(this.getAnswer())){
64 String[] parts = this.getAnswer().split(",");
65 Arrays.sort(parts);
66 String result = String.join(",", parts);
67 this.setAnswer(result );
68 }
69 }
56 } 70 }
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
4 4
5 <!-- 校对答案,设置试题分值--> 5 <!-- 校对答案,设置试题分值-->
6 <update id="checkAnswerByUserPaperId" > 6 <update id="checkAnswerByUserPaperId" >
7 update edu_user_answer ua , edu_question q ,edu_paper_question pq 7 update edu_user_answer ua
8 set ua.score = pq.score 8 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)
9 where q.id = ua.question_id and q.id = pq.question_id and ua.paper_id = pq.paper_id 9 where ua.user_paper_id = = #{userPaperId}
10 and ua.user_paper_id =#{userPaperId}
11 </update> 10 </update>
12 11
13 </mapper> 12 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -200,19 +200,18 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements ...@@ -200,19 +200,18 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
200 userAnswer.setUserPaperId( userPaper.getId()); 200 userAnswer.setUserPaperId( userPaper.getId());
201 userAnswer.setPaperId(userPaper.getPaperId()); 201 userAnswer.setPaperId(userPaper.getPaperId());
202 userAnswer.setUserId( userPaper.getUserId()) ; 202 userAnswer.setUserId( userPaper.getUserId()) ;
203 // 答案排序
204 userAnswer.splitAndSort();
203 userAnswerMapper.insert( userAnswer ) ; 205 userAnswerMapper.insert( userAnswer ) ;
204 } 206 }
205 userAnswerMapper.checkAnswerByUserPaperId( userPaper.getId() ); 207 userAnswerMapper.checkAnswerByUserPaperId( userPaper.getId() );
206 totalScore = userPaperMapper.queryPaperScore(userPaper.getId()); 208 totalScore = userPaperMapper.queryPaperScore(userPaper.getId());
207 } 209 }
208
209
210 userPaper.setScore(totalScore ) ; 210 userPaper.setScore(totalScore ) ;
211 userPaperMapper.updateById( userPaper); 211 userPaperMapper.updateById( userPaper);
212 212
213 // 修改开始人次 213 // 修改开始人次
214 Paper paper = paperMapper.selectById( paperVO.getPaperId() ) ; 214 Paper paper = paperMapper.selectById( paperVO.getPaperId() ) ;
215
216 paper.setUserCount( paper.getUserCount() + 1 ) ; 215 paper.setUserCount( paper.getUserCount() + 1 ) ;
217 paperMapper.updateById( paper ) ; 216 paperMapper.updateById( paper ) ;
218 //计算分数 217 //计算分数
......
...@@ -157,6 +157,7 @@ public class MaterialINController { ...@@ -157,6 +157,7 @@ public class MaterialINController {
157 if(StringUtils.isNotBlank(materialIN.getEndTime())){ 157 if(StringUtils.isNotBlank(materialIN.getEndTime())){
158 queryWrapper.le("arrive_time",materialIN.getEndTime()); 158 queryWrapper.le("arrive_time",materialIN.getEndTime());
159 } 159 }
160 queryWrapper.gt("audit_tatus",0);
160 IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper); 161 IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper);
161 result.setSuccess(true); 162 result.setSuccess(true);
162 result.setResult(pageList); 163 result.setResult(pageList);
...@@ -227,6 +228,9 @@ public class MaterialINController { ...@@ -227,6 +228,9 @@ public class MaterialINController {
227 Result<MaterialIN> result = new Result<MaterialIN>(); 228 Result<MaterialIN> result = new Result<MaterialIN>();
228 try { 229 try {
229 materialINService.save(materialIN); 230 materialINService.save(materialIN);
231 MaterialAcceptanceForm materialAcceptanceForm = new MaterialAcceptanceForm();
232 materialAcceptanceForm.setId( materialIN.getId() ) ;
233 materialAcceptanceFormService.save(materialAcceptanceForm);
230 result.success("添加成功!"); 234 result.success("添加成功!");
231 } catch (Exception e) { 235 } catch (Exception e) {
232 log.error(e.getMessage(),e); 236 log.error(e.getMessage(),e);
......
...@@ -244,7 +244,7 @@ public class DangerLevelManageController { ...@@ -244,7 +244,7 @@ public class DangerLevelManageController {
244 //导出文件名称 244 //导出文件名称
245 mv.addObject(NormalExcelConstants.FILE_NAME, "风险分级管控清单列表"); 245 mv.addObject(NormalExcelConstants.FILE_NAME, "风险分级管控清单列表");
246 mv.addObject(NormalExcelConstants.CLASS, DangerLevelManage.class); 246 mv.addObject(NormalExcelConstants.CLASS, DangerLevelManage.class);
247 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("风险分级管控清单列表数据", "导出人:Jeecg", "导出信息")); 247 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("风险分级管控清单列表数据", "", "风险分级管控清单列表"));
248 mv.addObject(NormalExcelConstants.DATA_LIST, pageList); 248 mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
249 return mv; 249 return mv;
250 } 250 }
......
...@@ -33,6 +33,7 @@ public class AccidentCase { ...@@ -33,6 +33,7 @@ public class AccidentCase {
33 /**所属机构*/ 33 /**所属机构*/
34 @Excel(name = "所属机构", width = 15) 34 @Excel(name = "所属机构", width = 15)
35 @ApiModelProperty(value = "所属机构") 35 @ApiModelProperty(value = "所属机构")
36 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
36 private String departId; 37 private String departId;
37 /**事故名称*/ 38 /**事故名称*/
38 @Excel(name = "事故名称", width = 15) 39 @Excel(name = "事故名称", width = 15)
...@@ -58,6 +59,7 @@ public class AccidentCase { ...@@ -58,6 +59,7 @@ public class AccidentCase {
58 /**责任人员(用户id)*/ 59 /**责任人员(用户id)*/
59 @Excel(name = "责任人员(用户id)", width = 15) 60 @Excel(name = "责任人员(用户id)", width = 15)
60 @ApiModelProperty(value = "责任人员(用户id)") 61 @ApiModelProperty(value = "责任人员(用户id)")
62 @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
61 private String dutyUser; 63 private String dutyUser;
62 /**事故描述*/ 64 /**事故描述*/
63 @Excel(name = "事故描述", width = 15) 65 @Excel(name = "事故描述", width = 15)
......
...@@ -31,12 +31,12 @@ public class DangerLevelManage{ ...@@ -31,12 +31,12 @@ public class DangerLevelManage{
31 @ApiModelProperty(value = "id") 31 @ApiModelProperty(value = "id")
32 private String id; 32 private String id;
33 /**厂区*/ 33 /**厂区*/
34 @Excel(name = "厂区", width = 15) 34 @Excel(name = "厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
35 @ApiModelProperty(value = "厂区") 35 @ApiModelProperty(value = "厂区")
36 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") 36 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
37 private String departId; 37 private String departId;
38 /**风险点类型*/ 38 /**风险点类型*/
39 @Excel(name = "风险点类型", width = 15) 39 @Excel(name = "风险点类型", width = 15 ,dicCode = "dangerType")
40 @ApiModelProperty(value = "风险点类型") 40 @ApiModelProperty(value = "风险点类型")
41 @Dict(dicCode = "dangerType") 41 @Dict(dicCode = "dangerType")
42 private String dangerType; 42 private String dangerType;
...@@ -53,7 +53,7 @@ public class DangerLevelManage{ ...@@ -53,7 +53,7 @@ public class DangerLevelManage{
53 @ApiModelProperty(value = "安全态(标准情况)") 53 @ApiModelProperty(value = "安全态(标准情况)")
54 private String dangerStandard; 54 private String dangerStandard;
55 /**风险等级*/ 55 /**风险等级*/
56 @Excel(name = "风险等级", width = 15) 56 @Excel(name = "风险等级", width = 15 ,dicCode = "dangerLevel")
57 @ApiModelProperty(value = "风险等级") 57 @ApiModelProperty(value = "风险等级")
58 @Dict(dicCode = "dangerLevel") 58 @Dict(dicCode = "dangerLevel")
59 private String dangerLevel; 59 private String dangerLevel;
...@@ -66,7 +66,7 @@ public class DangerLevelManage{ ...@@ -66,7 +66,7 @@ public class DangerLevelManage{
66 @ApiModelProperty(value = "管控措施") 66 @ApiModelProperty(value = "管控措施")
67 private String dangerWay; 67 private String dangerWay;
68 /**管控层级*/ 68 /**管控层级*/
69 @Excel(name = "管控层级", width = 15) 69 @Excel(name = "管控层级", width = 15,dicCode = "dangerRank")
70 @ApiModelProperty(value = "管控层级") 70 @ApiModelProperty(value = "管控层级")
71 @Dict(dicCode = "dangerRank") 71 @Dict(dicCode = "dangerRank")
72 private String dangerRank; 72 private String dangerRank;
...@@ -79,15 +79,16 @@ public class DangerLevelManage{ ...@@ -79,15 +79,16 @@ public class DangerLevelManage{
79 @ApiModelProperty(value = "责任人") 79 @ApiModelProperty(value = "责任人")
80 private String dangerUser; 80 private String dangerUser;
81 /**安全四色图*/ 81 /**安全四色图*/
82 @Excel(name = "安全四色图", width = 15) 82 //@Excel(name = "安全四色图", width = 15)
83 @ApiModelProperty(value = "安全四色图") 83 @ApiModelProperty(value = "安全四色图")
84 private String dangerFour; 84 private String dangerFour;
85 85
86 @Excel(name = "风险点位置", width = 15) 86 @Excel(name = "风险点位置", width = 15,dicCode = "id",dicText = "struct_name",dictTable = "sys_struct_dict")
87 @ApiModelProperty(value = "风险点位置") 87 @ApiModelProperty(value = "风险点位置")
88 @Dict(dicCode = "id",dicText = "struct_name",dictTable = "sys_struct_dict")
88 private String dangerPlace; 89 private String dangerPlace;
89 90
90 @Excel(name = "关联设备", width = 15) 91 @Excel(name = "关联设备", width = 15,dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info")
91 @ApiModelProperty(value = "关联设备") 92 @ApiModelProperty(value = "关联设备")
92 @Dict(dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info") 93 @Dict(dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info")
93 private String equipInfoId; 94 private String equipInfoId;
...@@ -96,7 +97,7 @@ public class DangerLevelManage{ ...@@ -96,7 +97,7 @@ public class DangerLevelManage{
96 @ApiModelProperty(value = "是否共享") 97 @ApiModelProperty(value = "是否共享")
97 private String is_share; 98 private String is_share;
98 99
99 @Excel(name = "二维码", width = 15) 100 //@Excel(name = "二维码", width = 15)
100 @ApiModelProperty(value = "二维码") 101 @ApiModelProperty(value = "二维码")
101 private String qrCode; 102 private String qrCode;
102 103
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!