|
@@ -1116,6 +1116,8 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
List<String> sampleIds = baseMapper.selectSelfSampleRecord(id);
|
|
|
if (sampleIds.size() > 0) {
|
|
|
List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectBatchIds(sampleIds);
|
|
|
+ List<EntrustInfo> entrustInfoList = entrustInfoService.list(Wrappers.<EntrustInfo>lambdaQuery().in(EntrustInfo::getSampleId, sampleIds));
|
|
|
+ Map<Long, EntrustInfo> entrustInfoMap = entrustInfoList.stream().collect(Collectors.toMap(EntrustInfo::getSampleId, item -> item, (v1, v2) -> v1));
|
|
|
Map<Long, User> map = iUserClient.selectUserAll().stream().collect(Collectors.toMap(User::getId, Function.identity()));
|
|
|
if (trialSampleInfos.size() > 0) {
|
|
|
for (TrialSampleInfo trialSampleInfo : trialSampleInfos) {
|
|
@@ -1124,6 +1126,20 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
TrialSampleInfoVO trialSampleInfoVO = BeanUtil.copyProperties(trialSampleInfo, TrialSampleInfoVO.class);
|
|
|
if (trialSampleInfoVO != null) {
|
|
|
trialSampleInfoVO.setUserName(ObjectUtil.isNotEmpty(user.getName()) ? user.getName() : user.getRealName());
|
|
|
+ EntrustInfo entrustInfo = entrustInfoMap.get(trialSampleInfo.getId());
|
|
|
+ if (entrustInfo != null && entrustInfo.getSampleStatus() != null) {
|
|
|
+ if (entrustInfo.getSampleStatus().equals("6")) {
|
|
|
+ trialSampleInfoVO.setSampleProcessing("处理");
|
|
|
+ trialSampleInfoVO.setSampleProcessingResult(entrustInfo.getRepealReason() == null ? "" : entrustInfo.getRepealReason());
|
|
|
+ } else if (entrustInfo.getSampleStatus().equals("5")) {
|
|
|
+ trialSampleInfoVO.setSampleProcessing("留样");
|
|
|
+ Date endTime = entrustInfo.getResamEndTime();
|
|
|
+ Date startTime = entrustInfo.getResamStartTime();
|
|
|
+ if (startTime != null && endTime != null) {
|
|
|
+ trialSampleInfoVO.setSampleProcessingResult(DateUtil.format(startTime, "yyyy-MM-dd") + " 至 " + DateUtil.format(endTime, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
result.add(trialSampleInfoVO);
|
|
|
}
|
|
|
}
|
|
@@ -1359,7 +1375,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
String key = first.attr("id");
|
|
|
//记录编号或者报告编号的值
|
|
|
String recordOrReportNo = jsonObject.getString(key);
|
|
|
- if (!"".equals(recordOrReportNo) && !(recordOrReportNo == null)) {
|
|
|
+ if (!"".equals(recordOrReportNo) && recordOrReportNo != null && !"/".equals(recordOrReportNo)) {
|
|
|
String updateSql = "update u_trial_self_inspection_record set " + fileVlue + "='" + recordOrReportNo + "' where id='" + dto.getId() + "'";
|
|
|
if (fileVlue.equals("record_no")) {
|
|
|
dto.setRecordNo(recordOrReportNo);
|
|
@@ -1812,7 +1828,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
if (StringUtils.isNotEmpty(maxRecordNo)) {
|
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
|
stringStringHashMap.put("type", "记录表");
|
|
|
- if (trialSelfInspectionRecord != null) {
|
|
|
+ if (trialSelfInspectionRecord != null && StringUtils.isNotEmpty(trialSelfInspectionRecord.getRecordNo())) {
|
|
|
stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getRecordNo());
|
|
|
return stringStringHashMap;
|
|
|
}
|
|
@@ -1829,7 +1845,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
if (StringUtils.isNotEmpty(maxReportNo)) {
|
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
|
stringStringHashMap.put("type", "报告单");
|
|
|
- if (trialSelfInspectionRecord != null) {
|
|
|
+ if (trialSelfInspectionRecord != null && StringUtils.isNotEmpty(trialSelfInspectionRecord.getReportNo())) {
|
|
|
stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getReportNo());
|
|
|
return stringStringHashMap;
|
|
|
}
|
|
@@ -1876,7 +1892,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
//记录表
|
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
|
stringStringHashMap.put("type", "记录表");
|
|
|
- if (trialSelfInspectionRecord != null) {
|
|
|
+ if (trialSelfInspectionRecord != null && StringUtils.isNotEmpty(trialSelfInspectionRecord.getRecordNo())) {
|
|
|
stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getRecordNo());
|
|
|
return stringStringHashMap;
|
|
|
}
|
|
@@ -1923,7 +1939,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
//报告单
|
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
|
stringStringHashMap.put("type", "报告单");
|
|
|
- if (trialSelfInspectionRecord != null) {
|
|
|
+ if (trialSelfInspectionRecord != null && StringUtils.isNotEmpty(trialSelfInspectionRecord.getReportNo())) {
|
|
|
stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getReportNo());
|
|
|
return stringStringHashMap;
|
|
|
}
|
|
@@ -2185,6 +2201,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
public R getSamplePdfUrl(String id, String contrctId) {
|
|
|
try {
|
|
|
String pdf = this.getMergePdfToTrial(Func.toLong(contrctId), Func.toLong(id));
|
|
|
+ if (pdf == null || pdf.isEmpty()) {
|
|
|
+ return R.fail("获取pdf文件失败");
|
|
|
+ }
|
|
|
return R.data(pdf);
|
|
|
} catch (FileNotFoundException e) {
|
|
|
throw new RuntimeException(e);
|