|
@@ -1221,66 +1221,74 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
ele.stream().filter(s->s.getOffset()>0).forEach(FormData::restore);
|
|
ele.stream().filter(s->s.getOffset()>0).forEach(FormData::restore);
|
|
}else{
|
|
}else{
|
|
// 做特殊监抽检76 现浇墩、台帽或盖梁抽检记录 特殊处理
|
|
// 做特殊监抽检76 现浇墩、台帽或盖梁抽检记录 特殊处理
|
|
- Object data;
|
|
|
|
- if(f.contains("G8") && f.contains("dx")){
|
|
|
|
- String data2 ="";
|
|
|
|
- String map = formula.getMap();
|
|
|
|
- JSONObject jsonObject = JSON.parseObject(map);
|
|
|
|
- String tabKey =jsonObject.keySet().stream().toArray()[0]+"";
|
|
|
|
- String[] split = tabKey.split(":");
|
|
|
|
-
|
|
|
|
- List<NodeTable> tableList = tec.getTableAll();
|
|
|
|
- List<Map<String, String>> dataMap = new ArrayList<>();
|
|
|
|
- List<TableInfo> tableAll = tec.getTableInfoList();
|
|
|
|
-
|
|
|
|
- for(NodeTable appwbsTree : tableList){
|
|
|
|
- if(appwbsTree.getInitTableName().equals(split[0])){
|
|
|
|
- String p_key= appwbsTree.getPKeyId()+"";
|
|
|
|
- for(TableInfo nodeTable:tableAll){
|
|
|
|
- if(p_key.contains(nodeTable.getPkeyId())){
|
|
|
|
- System.out.println(appwbsTree.getNodeName());
|
|
|
|
- dataMap.add(nodeTable.getDataMap());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- List<KeyMapper> keyMappers = tec.getKeyMappers();
|
|
|
|
- // 高程偏差 key
|
|
|
|
- String dataKeyVal = "key_3";
|
|
|
|
- /*for(KeyMapper datakey:keyMappers){
|
|
|
|
- if(datakey.getEName().indexOf("高程偏差")>=0 && split[0].equals(datakey.getTableName()) && p_key.contains(datakey.getPkId()+"")){
|
|
|
|
- dataKeyVal = datakey.getField();
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
- //
|
|
|
|
- for(Map<String, String> dataMa:dataMap){
|
|
|
|
- String dataVal = dataMa.get(split[1]);
|
|
|
|
- String[] split1 = dataVal.split("☆");
|
|
|
|
- Arrays.sort(split1, Comparator.comparingInt(valu -> Integer.parseInt(((valu+"").split("_\\^_")[1]).split("_")[0])));
|
|
|
|
- String dataVal2 = dataMa.get(dataKeyVal);
|
|
|
|
- String[] split2 = dataVal2.split("☆");
|
|
|
|
- Arrays.sort(split2, Comparator.comparingInt(valu -> Integer.parseInt(((valu+"").split("_\\^_")[1]).split("_")[0])));
|
|
|
|
- for(String s:split1){
|
|
|
|
- if(s.indexOf("K")>=0){
|
|
|
|
- String s1 = "_^_"+s.split("_\\^_")[1].split("_")[0];
|
|
|
|
- for(String s2:split2){
|
|
|
|
- if(s2.indexOf(s1)>=0){
|
|
|
|
- data2 = data2 + s2.split("_\\^_")[0] + ",";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(!data2.isEmpty()){
|
|
|
|
- data = data2.substring(0,data2.length()-1);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
|
|
- }
|
|
|
|
|
|
+ Object data = null;
|
|
|
|
+// Boolean flage=true;
|
|
|
|
+// List<TableInfo> tableInfos = tec.getTableInfoList();
|
|
|
|
+// if(!tableInfos.isEmpty()){
|
|
|
|
+// //只有监理才特殊处理
|
|
|
|
+// flage=tableInfos.get(0).getClassify().equals("2");
|
|
|
|
+// }
|
|
|
|
+// if(flage){
|
|
|
|
+// if(f.contains("G8") && f.contains("dx")){
|
|
|
|
+// String data2 ="";
|
|
|
|
+// String map = formula.getMap();
|
|
|
|
+// JSONObject jsonObject = JSON.parseObject(map);
|
|
|
|
+// String tabKey =jsonObject.keySet().stream().toArray()[0]+"";
|
|
|
|
+// String[] split = tabKey.split(":");
|
|
|
|
+//
|
|
|
|
+// List<NodeTable> tableList = tec.getTableAll();
|
|
|
|
+// List<Map<String, String>> dataMap = new ArrayList<>();
|
|
|
|
+// List<TableInfo> tableAll = tec.getTableInfoList();
|
|
|
|
+//
|
|
|
|
+// for(NodeTable appwbsTree : tableList){
|
|
|
|
+// if(appwbsTree.getInitTableName().equals(split[0])){
|
|
|
|
+// String p_key= appwbsTree.getPKeyId()+"";
|
|
|
|
+// for(TableInfo nodeTable:tableAll){
|
|
|
|
+// if(p_key.contains(nodeTable.getPkeyId())){
|
|
|
|
+// System.out.println(appwbsTree.getNodeName());
|
|
|
|
+// dataMap.add(nodeTable.getDataMap());
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// List<KeyMapper> keyMappers = tec.getKeyMappers();
|
|
|
|
+// // 高程偏差 key
|
|
|
|
+// String dataKeyVal = "key_3";
|
|
|
|
+// /*for(KeyMapper datakey:keyMappers){
|
|
|
|
+// if(datakey.getEName().indexOf("高程偏差")>=0 && split[0].equals(datakey.getTableName()) && p_key.contains(datakey.getPkId()+"")){
|
|
|
|
+// dataKeyVal = datakey.getField();
|
|
|
|
+// }
|
|
|
|
+// }*/
|
|
|
|
+// //
|
|
|
|
+// for(Map<String, String> dataMa:dataMap){
|
|
|
|
+// String dataVal = dataMa.get(split[1]);
|
|
|
|
+// String[] split1 = dataVal.split("☆");
|
|
|
|
+// Arrays.sort(split1, Comparator.comparingInt(valu -> Integer.parseInt(((valu+"").split("_\\^_")[1]).split("_")[0])));
|
|
|
|
+// String dataVal2 = dataMa.get(dataKeyVal);
|
|
|
|
+// String[] split2 = dataVal2.split("☆");
|
|
|
|
+// Arrays.sort(split2, Comparator.comparingInt(valu -> Integer.parseInt(((valu+"").split("_\\^_")[1]).split("_")[0])));
|
|
|
|
+// for(String s:split1){
|
|
|
|
+// if(s.indexOf("K")>=0){
|
|
|
|
+// String s1 = "_^_"+s.split("_\\^_")[1].split("_")[0];
|
|
|
|
+// for(String s2:split2){
|
|
|
|
+// if(s2.indexOf(s1)>=0){
|
|
|
|
+// data2 = data2 + s2.split("_\\^_")[0] + ",";
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// if(!data2.isEmpty()){
|
|
|
|
+// data = data2.substring(0,data2.length()-1);
|
|
|
|
+// }
|
|
|
|
+// else {
|
|
|
|
+// data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }else{
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+ data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
write(tec,fd,data);
|
|
write(tec,fd,data);
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -2487,7 +2495,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
try {
|
|
try {
|
|
inputStreamByUrl = FileUtils.getInputStreamByUrl(htmlUrl);
|
|
inputStreamByUrl = FileUtils.getInputStreamByUrl(htmlUrl);
|
|
String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
- org.jsoup.nodes.Document doc = Jsoup.parse(htmlString);
|
|
|
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
Element table = doc.select("table").first();
|
|
Element table = doc.select("table").first();
|
|
for (Map<String, Object> da :maps){
|
|
for (Map<String, Object> da :maps){
|
|
Elements elements = table.getElementsByAttributeValue("keyname", da.get("time_col_key")+"");
|
|
Elements elements = table.getElementsByAttributeValue("keyname", da.get("time_col_key")+"");
|