|
@@ -40,68 +40,22 @@ public class TrialCyAccessoriesClientImpl implements TrialCyAccessoriesClient {
|
|
|
@Override
|
|
|
public List<JSONObject> getTrialFilePdfRecord(String primaryKeyId, List<Integer> list) {
|
|
|
//获取id
|
|
|
- List<Map<String, Object>> trialFilePdfRecord = trialSelfInspectionRecordMapper.getTrialFilePdfRecord(primaryKeyId, list);
|
|
|
+ List<String> trialFilePdfRecord = trialSelfInspectionRecordMapper.getTrialFilePdfRecord(primaryKeyId, list);
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(trialFilePdfRecord)) {
|
|
|
|
|
|
- //试验报告ids
|
|
|
- List<Long> listOne = new ArrayList<>();
|
|
|
- //第三方外委ids
|
|
|
- List<Long> listTwo = new ArrayList<>();
|
|
|
-
|
|
|
- for (Map<String, Object> stringObjectMap : trialFilePdfRecord) {
|
|
|
-
|
|
|
- Integer type = (Integer) stringObjectMap.get("type");
|
|
|
- Long recordId = (Long) stringObjectMap.get("record_id");
|
|
|
- //试验报告
|
|
|
- if (type == 11) {
|
|
|
- listOne.add(recordId);
|
|
|
- } else {
|
|
|
- //第三方、外委
|
|
|
- listTwo.add(recordId);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
List<JSONObject> result = new ArrayList<>();
|
|
|
-
|
|
|
- if (CollectionUtil.isNotEmpty(listOne)) {
|
|
|
- List<TrialCyFinishTestReport> list1 = trialCyFinishTestReportService.list(Wrappers.<TrialCyFinishTestReport>lambdaQuery()
|
|
|
- .isNotNull(TrialCyFinishTestReport::getAssembleFile)
|
|
|
- .in(TrialCyFinishTestReport::getTaskId, listOne)
|
|
|
- );
|
|
|
-
|
|
|
- if (CollectionUtil.isNotEmpty(list1)) {
|
|
|
- list1.forEach(f -> {
|
|
|
- String[] split = f.getAssembleFile().split("/");
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("id", f.getTaskId());
|
|
|
- jsonObject.put("name", split[split.length - 1]);
|
|
|
- jsonObject.put("contractId", f.getContractId());
|
|
|
- jsonObject.put("domainUrl", f.getAssembleFile());
|
|
|
- jsonObject.put("domainPdfUrl", f.getAssembleFile());
|
|
|
- jsonObject.put("tabId", primaryKeyId);
|
|
|
- jsonObject.put("extension", "pdf");
|
|
|
- //是否为试验关联的附件
|
|
|
- jsonObject.put("isTrial", true);
|
|
|
- result.add(jsonObject);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(listTwo)) {
|
|
|
- List<TrialCyThirdReport> list1 = trialCyThirdReportService.list(Wrappers.<TrialCyThirdReport>lambdaQuery()
|
|
|
- .isNotNull(TrialCyThirdReport::getAssembleFile)
|
|
|
- .in(TrialCyThirdReport::getId, listTwo)
|
|
|
- );
|
|
|
-
|
|
|
+ if (CollectionUtil.isNotEmpty(trialFilePdfRecord)) {
|
|
|
+ List<Map<String,Object>> list1 = trialCyFinishTestReportService.selectViewList(trialFilePdfRecord);
|
|
|
if (CollectionUtil.isNotEmpty(list1)) {
|
|
|
list1.forEach(f -> {
|
|
|
- String[] split = f.getAssembleFile().split("/");
|
|
|
+ String[] split = f.get("assembleFile").toString().split("/");
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("id", f.getId());
|
|
|
+ jsonObject.put("id", f.get("id"));
|
|
|
jsonObject.put("name", split[split.length - 1]);
|
|
|
- jsonObject.put("contractId", f.getContractId());
|
|
|
- jsonObject.put("domainUrl", f.getAssembleFile());
|
|
|
- jsonObject.put("domainPdfUrl", f.getAssembleFile());
|
|
|
+ jsonObject.put("contractId", f.get("contractId"));
|
|
|
+ jsonObject.put("domainUrl", f.get("assembleFile"));
|
|
|
+ jsonObject.put("domainPdfUrl", f.get("assembleFile"));
|
|
|
jsonObject.put("tabId", primaryKeyId);
|
|
|
jsonObject.put("extension", "pdf");
|
|
|
//是否为试验关联的附件
|