|
|
|
@ -106,19 +106,7 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
|
|
|
|
|
} |
|
|
|
|
// 拼装检查列表
|
|
|
|
|
List<CarCheckItemEntity> itemList = carCheckItemService.getListByCarCheckRecordId(id); |
|
|
|
|
List<CarCheckItemEntity> checkItemList = new ArrayList<>(); |
|
|
|
|
itemList.forEach(item -> { |
|
|
|
|
String[] contents = item.getCheckContent().split(",|,"); |
|
|
|
|
String[] results = item.getCheckResult().split(",|,"); |
|
|
|
|
for (int i = 0; i < contents.length; i++) { |
|
|
|
|
CarCheckItemEntity carCheckItemEntity = new CarCheckItemEntity(); |
|
|
|
|
carCheckItemEntity.setCheckItem(item.getCheckItem()); |
|
|
|
|
carCheckItemEntity.setCheckContent(contents[i]); |
|
|
|
|
carCheckItemEntity.setCheckResult(results[i]); |
|
|
|
|
checkItemList.add(carCheckItemEntity); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
carCheckRecordDetailVO.setCheckItemList(checkItemList); |
|
|
|
|
carCheckRecordDetailVO.setCheckItemList(itemList); |
|
|
|
|
return carCheckRecordDetailVO; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
@ -187,7 +175,6 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
|
|
|
|
|
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList(); |
|
|
|
|
itemList.forEach(x -> { |
|
|
|
|
x.setCarCheckRecordId(carCheckRecordDTO.getId()); |
|
|
|
|
// x.setId(null);
|
|
|
|
|
}); |
|
|
|
|
return carCheckItemService.saveBatch(itemList); |
|
|
|
|
} |
|
|
|
@ -212,6 +199,21 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
|
|
|
|
|
public void exportCarCheckRecordData(Long id, HttpServletResponse response) { |
|
|
|
|
CarCheckRecordDetailVO carCheckRecordDetailVO = this.getCarCheckRecord(id); |
|
|
|
|
// 数据处理
|
|
|
|
|
// 检查项
|
|
|
|
|
List<CarCheckItemEntity> checkList = carCheckRecordDetailVO.getCheckItemList(); |
|
|
|
|
List<CarCheckItemEntity> res = new ArrayList<>(); |
|
|
|
|
checkList.forEach(item -> { |
|
|
|
|
String[] checkContent = item.getCheckContent().split(","); |
|
|
|
|
String[] checkResult = item.getCheckResult().split(","); |
|
|
|
|
for (int i = 0; i < checkContent.length; i++) { |
|
|
|
|
CarCheckItemEntity carCheckItemEntity = new CarCheckItemEntity(); |
|
|
|
|
carCheckItemEntity.setCheckItem(item.getCheckItem()); |
|
|
|
|
carCheckItemEntity.setCheckContent(checkContent[i]); |
|
|
|
|
carCheckItemEntity.setCheckResult(checkResult[i]); |
|
|
|
|
res.add(carCheckItemEntity); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
carCheckRecordDetailVO.setCheckItemList(res); |
|
|
|
|
// 表头年月
|
|
|
|
|
String code = carCheckRecordDetailVO.getCode(); |
|
|
|
|
carCheckRecordDetailVO.setYear(code.substring(4, 8)); |
|
|
|
|