|
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.xujie.sys.modules.reader.dao.GetInformationForExcelMapper; |
|
|
import com.xujie.sys.modules.reader.dao.GetInformationForExcelMapper; |
|
|
import com.xujie.sys.modules.reader.entity.EquipmentDataDetail; |
|
|
import com.xujie.sys.modules.reader.entity.EquipmentDataDetail; |
|
|
import com.xujie.sys.modules.reader.entity.EquipmentFolderDetailEntity; |
|
|
|
|
|
import com.xujie.sys.modules.reader.entity.EquipmentFolderLocation; |
|
|
import com.xujie.sys.modules.reader.entity.EquipmentFolderLocation; |
|
|
import com.xujie.sys.modules.reader.service.EquipmentFolderDetailService; |
|
|
import com.xujie.sys.modules.reader.service.EquipmentFolderDetailService; |
|
|
import com.xujie.sys.modules.reader.service.EquipmentFolderLocationService; |
|
|
import com.xujie.sys.modules.reader.service.EquipmentFolderLocationService; |
|
|
@ -23,7 +22,10 @@ import java.io.File; |
|
|
import java.io.FileReader; |
|
|
import java.io.FileReader; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.nio.file.*; |
|
|
import java.nio.file.*; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
import java.util.concurrent.ExecutorService; |
|
|
import java.util.concurrent.ExecutorService; |
|
|
import java.util.concurrent.Executors; |
|
|
import java.util.concurrent.Executors; |
|
|
import java.util.concurrent.TimeUnit; |
|
|
import java.util.concurrent.TimeUnit; |
|
|
@ -180,10 +182,10 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
txtName.add(excel.getFolderPath() + "\\" + file); |
|
|
txtName.add(excel.getFolderPath() + "\\" + file); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//用一个统一的时间搓保证新增和复制删除的文件名是一样的 |
|
|
|
|
|
String timestamp1 = String.valueOf(System.currentTimeMillis()); |
|
|
//excel(csv)不为空就做新增 |
|
|
//excel(csv)不为空就做新增 |
|
|
if (CollectionUtils.isNotEmpty(fileName)) { |
|
|
if (CollectionUtils.isNotEmpty(fileName)) { |
|
|
String timestamp1 = String.valueOf(System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
|
|
|
List<EquipmentDataDetail> equipmentDataDetails = saveExcel(fileName, excel, batchNo, timestamp1); |
|
|
List<EquipmentDataDetail> equipmentDataDetails = saveExcel(fileName, excel, batchNo, timestamp1); |
|
|
if (CollectionUtils.isNotEmpty(equipmentDataDetails)) { |
|
|
if (CollectionUtils.isNotEmpty(equipmentDataDetails)) { |
|
|
//批量新增 |
|
|
//批量新增 |
|
|
@ -202,7 +204,6 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
} |
|
|
} |
|
|
//txt(tff)不为空就做新增 |
|
|
//txt(tff)不为空就做新增 |
|
|
if (CollectionUtils.isNotEmpty(tffName)) { |
|
|
if (CollectionUtils.isNotEmpty(tffName)) { |
|
|
String timestamp1 = String.valueOf(System.currentTimeMillis()); |
|
|
|
|
|
List<EquipmentDataDetail> equipmentDataDetails = saveTxt(tffName, excel, batchNo,timestamp1); |
|
|
List<EquipmentDataDetail> equipmentDataDetails = saveTxt(tffName, excel, batchNo,timestamp1); |
|
|
//新增数据 |
|
|
//新增数据 |
|
|
saveInformation(equipmentDataDetails); |
|
|
saveInformation(equipmentDataDetails); |
|
|
@ -217,7 +218,6 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
} |
|
|
} |
|
|
//txt文件不为空就做新增 |
|
|
//txt文件不为空就做新增 |
|
|
if (CollectionUtils.isNotEmpty(txtName)) { |
|
|
if (CollectionUtils.isNotEmpty(txtName)) { |
|
|
String timestamp1 = String.valueOf(System.currentTimeMillis()); |
|
|
|
|
|
List<EquipmentDataDetail> equipmentDataDetails1 = saveTxtFile(txtName, excel, batchNo,timestamp1); |
|
|
List<EquipmentDataDetail> equipmentDataDetails1 = saveTxtFile(txtName, excel, batchNo,timestamp1); |
|
|
saveInformation(equipmentDataDetails1); |
|
|
saveInformation(equipmentDataDetails1); |
|
|
for (String s : txtName) { |
|
|
for (String s : txtName) { |
|
|
@ -365,223 +365,10 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
group++; |
|
|
group++; |
|
|
} |
|
|
} |
|
|
equipmentDataDetail.setNum(index); |
|
|
equipmentDataDetail.setNum(index); |
|
|
equipmentDataDetail.setFileValue1(file); |
|
|
|
|
|
equipmentDataDetails.add(equipmentDataDetail); |
|
|
equipmentDataDetails.add(equipmentDataDetail); |
|
|
index++; |
|
|
index++; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
|
|
|
// for (EquipmentFolderDetailEntity one : entityList) { |
|
|
|
|
|
// for (EquipmentDataDetail equipmentDataDetail : equipmentDataDetails) { |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value0")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue0())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue0()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue0("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue0("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value1")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue1())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue1()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue1("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue1("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value2")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue2())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue2()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue2("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue2("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value3")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue3())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue3()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue3("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue3("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value4")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue4())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue4()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue4("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue4("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value5")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue5())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue5()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue5("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue5("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value6")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue6())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue6()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue6("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue6("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value7")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue7())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue7()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue7("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue7("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value8")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue8())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue8()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue8("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue8("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value9")) { |
|
|
|
|
|
// if (StringUtils.isEmpty(equipmentDataDetail.getValue9())) { |
|
|
|
|
|
// continue; |
|
|
|
|
|
// } |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue9()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue9("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue9("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
equipmentDataDetails.get(equipmentDataDetails.size()-1).setFileValue1(file); |
|
|
bufferedReader.close(); |
|
|
bufferedReader.close(); |
|
|
} catch (IOException e) { |
|
|
} catch (IOException e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
@ -638,51 +425,11 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
equipmentDataDetail.setValue0(list.get(i).get(1)); |
|
|
equipmentDataDetail.setValue0(list.get(i).get(1)); |
|
|
equipmentDataDetail.setValue1(list.get(i).get(3)); |
|
|
equipmentDataDetail.setValue1(list.get(i).get(3)); |
|
|
equipmentDataDetail.setNum(index); |
|
|
equipmentDataDetail.setNum(index); |
|
|
equipmentDataDetail.setFileValue1(file); |
|
|
|
|
|
equipmentDataDetails.add(equipmentDataDetail); |
|
|
equipmentDataDetails.add(equipmentDataDetail); |
|
|
index++; |
|
|
index++; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
|
|
|
// for (EquipmentFolderDetailEntity one : entityList) { |
|
|
|
|
|
// for (EquipmentDataDetail equipmentDataDetail : equipmentDataDetails) { |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value0")) { |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue0()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue0("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue0("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value1")) { |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue1()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue1("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue1("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
equipmentDataDetails.get(equipmentDataDetails.size()-1).setFileValue1(file); |
|
|
} |
|
|
} |
|
|
return equipmentDataDetails; |
|
|
return equipmentDataDetails; |
|
|
} |
|
|
} |
|
|
@ -691,14 +438,14 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
public List<EquipmentDataDetail> saveTxtFile(List<String> fileName, EquipmentFolderLocation excel, Integer batchNo,String timestamp1) { |
|
|
public List<EquipmentDataDetail> saveTxtFile(List<String> fileName, EquipmentFolderLocation excel, Integer batchNo,String timestamp1) { |
|
|
int index = 1; |
|
|
int index = 1; |
|
|
List<EquipmentDataDetail> detailList = new ArrayList<>(); |
|
|
List<EquipmentDataDetail> detailList = new ArrayList<>(); |
|
|
//查询EquipmentFolderDetail表,判断是否对添加的值进行校验判断是否insert |
|
|
|
|
|
LambdaQueryWrapper<EquipmentFolderDetailEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
lambdaQueryWrapper.eq(EquipmentFolderDetailEntity::getBuNo, excel.getBuNo()) |
|
|
|
|
|
.eq(EquipmentFolderDetailEntity::getSite, excel.getSite()) |
|
|
|
|
|
.eq(EquipmentFolderDetailEntity::getEquipmentNo, excel.getEquipmentNo()); |
|
|
|
|
|
List<EquipmentFolderDetailEntity> entityList = equipmentFolderDetailService.list(lambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
for (String name : fileName) { |
|
|
for (String name : fileName) { |
|
|
|
|
|
//获取复制之后的文件路径 |
|
|
|
|
|
//找到\\的最后索引 |
|
|
|
|
|
int num =1; |
|
|
|
|
|
int dotIndex = name.lastIndexOf("\\"); |
|
|
|
|
|
String byName = name.substring(dotIndex + 1); |
|
|
|
|
|
String file =excel.getBackupFolderPath()+"\\"+num + timestamp1 + "$" + byName; |
|
|
|
|
|
num++; |
|
|
try { |
|
|
try { |
|
|
|
|
|
|
|
|
BufferedReader bufferedReader = new BufferedReader(new FileReader(name)); |
|
|
BufferedReader bufferedReader = new BufferedReader(new FileReader(name)); |
|
|
@ -713,15 +460,6 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
list.add(line); |
|
|
list.add(line); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//获取复制之后的文件路径 |
|
|
|
|
|
//找到\\的最后索引 |
|
|
|
|
|
int num =1; |
|
|
|
|
|
int dotIndex = name.lastIndexOf("\\"); |
|
|
|
|
|
String byName = name.substring(dotIndex + 1); |
|
|
|
|
|
String file =excel.getBackupFolderPath()+"\\"+num + timestamp1 + "$" + byName; |
|
|
|
|
|
num++; |
|
|
|
|
|
|
|
|
|
|
|
for (String s : list) { |
|
|
for (String s : list) { |
|
|
EquipmentDataDetail equipmentDataDetail = new EquipmentDataDetail(); |
|
|
EquipmentDataDetail equipmentDataDetail = new EquipmentDataDetail(); |
|
|
String[] data = s.split("\t"); |
|
|
String[] data = s.split("\t"); |
|
|
@ -743,92 +481,14 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
equipmentDataDetail.setValue3(data[3]); |
|
|
equipmentDataDetail.setValue3(data[3]); |
|
|
} |
|
|
} |
|
|
equipmentDataDetail.setNum(index); |
|
|
equipmentDataDetail.setNum(index); |
|
|
equipmentDataDetail.setFileValue1(file); |
|
|
|
|
|
detailList.add(equipmentDataDetail); |
|
|
detailList.add(equipmentDataDetail); |
|
|
index++; |
|
|
index++; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
|
|
|
// for (EquipmentFolderDetailEntity one : entityList) { |
|
|
|
|
|
// for (EquipmentDataDetail equipmentDataDetail : detailList) { |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value0")) { |
|
|
|
|
|
// |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue0()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue0("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue0("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value1")) { |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue1()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue1("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue1("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value2")) { |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue2()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue2("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue2("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (StringUtils.equals(one.getCollectionSource(), "value3")) { |
|
|
|
|
|
// double value = Double.parseDouble(equipmentDataDetail.getValue3()); |
|
|
|
|
|
// if (StringUtils.isNotEmpty(one.getDefaultValue())) { |
|
|
|
|
|
// //规定参数 |
|
|
|
|
|
// double defaultValue = Double.parseDouble(one.getDefaultValue()); |
|
|
|
|
|
// if (defaultValue != value) { |
|
|
|
|
|
// equipmentDataDetail.setValue3("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //获取表的最大值和最小值 |
|
|
|
|
|
// double max = Double.parseDouble(one.getMaxValue()); |
|
|
|
|
|
// double min = Double.parseDouble(one.getMinValue()); |
|
|
|
|
|
// if (max <= value || value <= min) { |
|
|
|
|
|
// equipmentDataDetail.setValue3("不合格"); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
} |
|
|
} |
|
|
|
|
|
detailList.get(detailList.size()-1).setFileValue1(file); |
|
|
} |
|
|
} |
|
|
return detailList; |
|
|
return detailList; |
|
|
} |
|
|
} |
|
|
|