|
@@ -5459,6 +5459,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
format= simpleDateFormat.format(mobilizationDate);
|
|
format= simpleDateFormat.format(mobilizationDate);
|
|
}
|
|
}
|
|
|
|
+ String jingchang;
|
|
|
|
+ if(StringUtils.isNotEmpty(format)&&StringUtils.isNotEmpty(representativeCount)){
|
|
|
|
+ jingchang=format+"/"+representativeCount;
|
|
|
|
+ } else if (StringUtils.isNotEmpty(format)&&StringUtils.isEmpty(representativeCount)) {
|
|
|
|
+ jingchang=format;
|
|
|
|
+ }else {
|
|
|
|
+ jingchang=representativeCount;
|
|
|
|
+ }
|
|
setFirstData(doc,"批号",sampleInfo.getBatchNumber(),reData,isCancelList);
|
|
setFirstData(doc,"批号",sampleInfo.getBatchNumber(),reData,isCancelList);
|
|
setFirstData(doc,"生产批号",sampleInfo.getBatchNumber(),reData,isCancelList);
|
|
setFirstData(doc,"生产批号",sampleInfo.getBatchNumber(),reData,isCancelList);
|
|
setFirstData(doc,"生产厂家",sampleInfo.getSupplierUnit(),reData,isCancelList);
|
|
setFirstData(doc,"生产厂家",sampleInfo.getSupplierUnit(),reData,isCancelList);
|
|
@@ -5488,7 +5496,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
setFirstData(doc,"用途(使用在何工程部位)",sampleInfo.getProposedPosition(),reData,isCancelList);
|
|
setFirstData(doc,"用途(使用在何工程部位)",sampleInfo.getProposedPosition(),reData,isCancelList);
|
|
setFirstData(doc,"成型日期",null,reData,isCancelList);
|
|
setFirstData(doc,"成型日期",null,reData,isCancelList);
|
|
// setFirstData(doc,"试件编号",sampleInfo.getSpecificationNumber(),reData,isCancel,isCancelList);
|
|
// setFirstData(doc,"试件编号",sampleInfo.getSpecificationNumber(),reData,isCancel,isCancelList);
|
|
- setFirstData(doc,"进场日期代表数量",format+"/"+representativeCount+calculationUnit,reData,isCancelList);
|
|
|
|
|
|
+ setFirstData(doc,"进场日期/ 代表数量",jingchang,reData,isCancelList);
|
|
setFirstData(doc,"材料进场日期",format,reData,isCancelList);
|
|
setFirstData(doc,"材料进场日期",format,reData,isCancelList);
|
|
|
|
|
|
if(entrustInfo != null){
|
|
if(entrustInfo != null){
|
|
@@ -5566,12 +5574,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
* @param reData
|
|
* @param reData
|
|
*/
|
|
*/
|
|
private static void setFirstData(Document doc, String elementValue,Object value,Map<String, Object> reData,List<String> isCancelList) {
|
|
private static void setFirstData(Document doc, String elementValue,Object value,Map<String, Object> reData,List<String> isCancelList) {
|
|
-
|
|
|
|
if(value==null){
|
|
if(value==null){
|
|
value="";
|
|
value="";
|
|
}
|
|
}
|
|
Elements select = doc.select("[placeholderxx=" + elementValue + "]");
|
|
Elements select = doc.select("[placeholderxx=" + elementValue + "]");
|
|
-
|
|
|
|
if(select.isEmpty()){//没找到加上:继续找
|
|
if(select.isEmpty()){//没找到加上:继续找
|
|
String elementValueNew = elementValue + ":";
|
|
String elementValueNew = elementValue + ":";
|
|
select = doc.select("[placeholderxx=" + elementValueNew + "]");
|
|
select = doc.select("[placeholderxx=" + elementValueNew + "]");
|
|
@@ -5579,9 +5585,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
if(select.isEmpty()){// 以传入的参数为结尾 继续找
|
|
if(select.isEmpty()){// 以传入的参数为结尾 继续找
|
|
select = doc.select("[placeholderxx$=" + elementValue + "]");
|
|
select = doc.select("[placeholderxx$=" + elementValue + "]");
|
|
}
|
|
}
|
|
-
|
|
|
|
if (!select.isEmpty()) {//找到元素后 获取输入框
|
|
if (!select.isEmpty()) {//找到元素后 获取输入框
|
|
-
|
|
|
|
Element textareaElement = select.stream().filter(element -> element.tagName().equals("el-input")).findFirst().orElse(null);
|
|
Element textareaElement = select.stream().filter(element -> element.tagName().equals("el-input")).findFirst().orElse(null);
|
|
if( (elementValue.contains("时间") || elementValue.contains("日期")) && textareaElement == null){//特殊处理日期 没有id属性获取keyName
|
|
if( (elementValue.contains("时间") || elementValue.contains("日期")) && textareaElement == null){//特殊处理日期 没有id属性获取keyName
|
|
textareaElement = select.first();
|
|
textareaElement = select.first();
|
|
@@ -5589,7 +5593,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
if(ObjectUtil.isNotEmpty(value)){
|
|
if(ObjectUtil.isNotEmpty(value)){
|
|
reData.put(keyName, value);
|
|
reData.put(keyName, value);
|
|
}
|
|
}
|
|
-
|
|
|
|
return ;
|
|
return ;
|
|
}
|
|
}
|
|
if(textareaElement != null){//正常情况
|
|
if(textareaElement != null){//正常情况
|
|
@@ -5599,27 +5602,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
reData.put(id, value);
|
|
reData.put(id, value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
} else {// 没有找到 可能格式不同 换一种方式找
|
|
} else {// 没有找到 可能格式不同 换一种方式找
|
|
Elements select2 = doc.select("[titlexx$="+elementValue+"]");
|
|
Elements select2 = doc.select("[titlexx$="+elementValue+"]");
|
|
- if(select2.isEmpty()){//还是没找到 进入特殊情况
|
|
|
|
- if(elementValue.equals("进场日期代表数量")){
|
|
|
|
- Elements select1 = doc.select("[titlexx=\"进场日期/ 代表数量\"]");
|
|
|
|
- Element textareaElement = select1.stream().filter(element -> element.tagName().equals("el-input")).findFirst().orElse(null);
|
|
|
|
- if(textareaElement != null){
|
|
|
|
- List<Node> nodes = textareaElement.childNodes();
|
|
|
|
- Node node = nodes.get(1);
|
|
|
|
- String id = node.attributes().get("id");
|
|
|
|
- if(ObjectUtil.isNotEmpty(value)){
|
|
|
|
- reData.put(id, value);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- System.out.println("没有找到[" + elementValue + "]的元素");
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- //另一种方式找到后 获取id的值并赋值到map
|
|
|
|
|
|
+ if(!select2.isEmpty()){
|
|
Element textareaElement = select2.first();
|
|
Element textareaElement = select2.first();
|
|
if(textareaElement != null){//正常情况
|
|
if(textareaElement != null){//正常情况
|
|
String id = textareaElement.attr("id");
|
|
String id = textareaElement.attr("id");
|