|
|
|
|
@ -166,7 +166,7 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String resultPicture(MultipartFile file) { |
|
|
|
|
public String resultPicture(MultipartFile file, String examineId) { |
|
|
|
|
String fileName = ""; |
|
|
|
|
if (file != null) { |
|
|
|
|
Random random = new Random(); |
|
|
|
|
@ -182,6 +182,23 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (examineId != null) { |
|
|
|
|
// 检测对应结果对象
|
|
|
|
|
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(ExamineResult::getExamineId, examineId); |
|
|
|
|
ExamineResult examineResult1 = this.getOne(wrapper); |
|
|
|
|
|
|
|
|
|
if (examineResult1 != null) { |
|
|
|
|
String name = examineResult1.getPicturePath() + "," + fileName; |
|
|
|
|
examineResult1.setPicturePath(name); |
|
|
|
|
this.updateById(examineResult1); |
|
|
|
|
} else { |
|
|
|
|
ExamineResult examineResult = new ExamineResult(); |
|
|
|
|
examineResult.setExamineId(Long.parseLong(examineId)); |
|
|
|
|
examineResult.setPicturePath(fileName); |
|
|
|
|
this.save(examineResult); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return fileName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -203,9 +220,9 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
} |
|
|
|
|
electronicSignature(); |
|
|
|
|
saves(entry); |
|
|
|
|
Examine currExamine = examineService.getById(entry.getExamineId()); |
|
|
|
|
Examine byId = examineService.getById(entry.getExamineId()); |
|
|
|
|
// 判断当前检验是否是本科室里的最后一个检验
|
|
|
|
|
Long eTaskId = currExamine.getETaskId(); |
|
|
|
|
Long eTaskId = byId.getETaskId(); |
|
|
|
|
LambdaQueryWrapper<Examine> examineQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
examineQueryWrapper.eq(Examine::getETaskId, eTaskId); |
|
|
|
|
List<Examine> list = examineService.list(examineQueryWrapper); |
|
|
|
|
@ -225,8 +242,11 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
// wrapper.eq(ETask::getDeptId, eTask.getFlowTo());
|
|
|
|
|
// ETask downTask = eTaskService.getOne(wrapper);
|
|
|
|
|
// currExamine.setTempTaskId(currExamine.getETaskId());
|
|
|
|
|
examineService.updateSimpleCurrPlace(currExamine.getETaskId(), currExamine.getDeptId(), 2); |
|
|
|
|
examineService.updateSimpleCurrPlace(byId.getETaskId(), byId.getDeptId(), 2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 照片路径
|
|
|
|
|
String realPath = sysClient.getParamValue("electronic_signature_real_path").getData(); |
|
|
|
|
// 如果第一次提交实验结果
|
|
|
|
|
if (entry.getIsUpdate() == null || entry.getIsUpdate() != 1) { |
|
|
|
|
// 发送提示消息
|
|
|
|
|
@ -245,7 +265,7 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
// if (entry.getExamineId() == null) {
|
|
|
|
|
// throw new Exception("必填参数为空!");
|
|
|
|
|
// }
|
|
|
|
|
Examine byId = examineService.getById(entry.getExamineId()); |
|
|
|
|
// Examine byId = examineService.getById(entry.getExamineId());
|
|
|
|
|
byId.setIsFinished("1"); |
|
|
|
|
byId.setStatus(0); |
|
|
|
|
byId.setFinishTime(new Date()); |
|
|
|
|
@ -282,13 +302,27 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
wrapper.eq(ExamineResult::getExamineId, byId.getId()); |
|
|
|
|
// wrapper.eq(ExamineResult::getStatus, 0);
|
|
|
|
|
wrapper.isNull(ExamineResult::getInstrumentId); |
|
|
|
|
// TODO 当有多个检测结果的时候,getOne报错
|
|
|
|
|
ExamineResult examineResult = this.getOne(wrapper); |
|
|
|
|
entry.setId(examineResult.getId()); |
|
|
|
|
// 上传图片文件名
|
|
|
|
|
List<String> path = entry.getPath(); |
|
|
|
|
// 所有上传过的照片
|
|
|
|
|
String[] split = examineResult.getPicturePath().split(","); |
|
|
|
|
if (CollectionUtils.isNotEmpty(path)) { |
|
|
|
|
String picturePath = ""; |
|
|
|
|
// 过滤无用照片并删除
|
|
|
|
|
for (String s : split) { |
|
|
|
|
boolean contains = path.contains(s); |
|
|
|
|
if (!contains) { |
|
|
|
|
// 获取图片路径
|
|
|
|
|
String realPath1 = realPath + s; |
|
|
|
|
File file = new File(realPath1); |
|
|
|
|
if (file.exists()) { |
|
|
|
|
file.delete(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (path.size() > 1) { |
|
|
|
|
for (String s : path) { |
|
|
|
|
String s1 = s + ","; |
|
|
|
|
@ -298,6 +332,16 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
picturePath = path.get(0); |
|
|
|
|
} |
|
|
|
|
entry.setPicturePath(picturePath); |
|
|
|
|
} else { |
|
|
|
|
for (String s : split) { |
|
|
|
|
// 获取图片路径
|
|
|
|
|
String realPath1 = realPath + s; |
|
|
|
|
File file = new File(realPath1); |
|
|
|
|
if (file.exists()) { |
|
|
|
|
file.delete(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
entry.setPicturePath(""); |
|
|
|
|
} |
|
|
|
|
return this.updateById(entry); |
|
|
|
|
} |
|
|
|
|
@ -305,8 +349,21 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe |
|
|
|
|
else { |
|
|
|
|
// 上传图片文件名
|
|
|
|
|
List<String> path = entry.getPath(); |
|
|
|
|
String[] split = entry.getPicturePath().split(","); |
|
|
|
|
if (CollectionUtils.isNotEmpty(path)) { |
|
|
|
|
String picturePath = ""; |
|
|
|
|
// 过滤无用照片并删除
|
|
|
|
|
for (String s : split) { |
|
|
|
|
boolean contains = path.contains(s); |
|
|
|
|
if (!contains) { |
|
|
|
|
// 获取图片路径
|
|
|
|
|
String realPath1 = realPath + s; |
|
|
|
|
File file = new File(realPath1); |
|
|
|
|
if (file.exists()) { |
|
|
|
|
file.delete(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (path.size() > 1) { |
|
|
|
|
for (String s : path) { |
|
|
|
|
String s1 = s + ","; |
|
|
|
|
|