|
@@ -5,16 +5,17 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.izouma.wenlvju.domain.Record;
|
|
import com.izouma.wenlvju.domain.Record;
|
|
|
|
|
+import com.izouma.wenlvju.domain.RecordExpert;
|
|
|
import com.izouma.wenlvju.domain.RecordSpecialty;
|
|
import com.izouma.wenlvju.domain.RecordSpecialty;
|
|
|
import com.izouma.wenlvju.dto.PageQuery;
|
|
import com.izouma.wenlvju.dto.PageQuery;
|
|
|
import com.izouma.wenlvju.dto.RecordDTO;
|
|
import com.izouma.wenlvju.dto.RecordDTO;
|
|
|
|
|
+import com.izouma.wenlvju.repo.RecordExpertRepo;
|
|
|
import com.izouma.wenlvju.repo.RecordRepo;
|
|
import com.izouma.wenlvju.repo.RecordRepo;
|
|
|
import com.izouma.wenlvju.repo.RecordSpecialtyRepo;
|
|
import com.izouma.wenlvju.repo.RecordSpecialtyRepo;
|
|
|
import com.izouma.wenlvju.utils.JpaUtils;
|
|
import com.izouma.wenlvju.utils.JpaUtils;
|
|
|
import com.izouma.wenlvju.utils.excel.ExcelUtils;
|
|
import com.izouma.wenlvju.utils.excel.ExcelUtils;
|
|
|
import jodd.util.StringUtil;
|
|
import jodd.util.StringUtil;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -36,6 +37,7 @@ public class RecordService {
|
|
|
|
|
|
|
|
private RecordRepo recordRepo;
|
|
private RecordRepo recordRepo;
|
|
|
private RecordSpecialtyRepo recordSpecialtyRepo;
|
|
private RecordSpecialtyRepo recordSpecialtyRepo;
|
|
|
|
|
+ private RecordExpertRepo recordExpertRepo;
|
|
|
|
|
|
|
|
public Page<Record> all(PageQuery pageQuery) {
|
|
public Page<Record> all(PageQuery pageQuery) {
|
|
|
return recordRepo.findAll(JpaUtils.toSpecification(pageQuery, Record.class), JpaUtils.toPageRequest(pageQuery));
|
|
return recordRepo.findAll(JpaUtils.toSpecification(pageQuery, Record.class), JpaUtils.toPageRequest(pageQuery));
|
|
@@ -107,10 +109,13 @@ public class RecordService {
|
|
|
for (Record record : data) {
|
|
for (Record record : data) {
|
|
|
List<RecordSpecialty> specialtyList = listMap.get(record.getId());
|
|
List<RecordSpecialty> specialtyList = listMap.get(record.getId());
|
|
|
if (CollUtil.isEmpty(specialtyList)) {
|
|
if (CollUtil.isEmpty(specialtyList)) {
|
|
|
- dtos.add(new RecordDTO(record, null, no));
|
|
|
|
|
|
|
+ dtos.add(new RecordDTO(record, null, null, no));
|
|
|
} else {
|
|
} else {
|
|
|
long finalNo = no;
|
|
long finalNo = no;
|
|
|
- specialtyList.forEach(specialty -> dtos.add(new RecordDTO(record, specialty, finalNo)));
|
|
|
|
|
|
|
+ specialtyList.forEach(specialty -> {
|
|
|
|
|
+ List<RecordExpert> experts = recordExpertRepo.findAllByRecordSpecialtyId(specialty.getId());
|
|
|
|
|
+ experts.forEach(expert -> dtos.add(new RecordDTO(record, specialty, expert, finalNo)));
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
no = no + 1;
|
|
no = no + 1;
|
|
|
}
|
|
}
|
|
@@ -154,6 +159,10 @@ public class RecordService {
|
|
|
specialty.setRecordId(recordId);
|
|
specialty.setRecordId(recordId);
|
|
|
specialty.setExaminerQuantity(dto.getSpeExaQuantity());
|
|
specialty.setExaminerQuantity(dto.getSpeExaQuantity());
|
|
|
specialties.add(specialty);
|
|
specialties.add(specialty);
|
|
|
|
|
+
|
|
|
|
|
+ RecordExpert expert = new RecordExpert();
|
|
|
|
|
+ BeanUtil.copyProperties(dto,expert);
|
|
|
|
|
+ expert.setName(dto.getExpertName());
|
|
|
}
|
|
}
|
|
|
recordSpecialtyRepo.saveAll(specialties);
|
|
recordSpecialtyRepo.saveAll(specialties);
|
|
|
|
|
|