管道,流程,数据源切换,大屏,测量点位

This commit is contained in:
Timer
2026-03-08 04:20:59 +08:00
parent d60f8aa1f5
commit 5fa4d814aa

View File

@ -432,7 +432,12 @@ public class MPointController {
// 比对ES全量数据总数和数据库全量数据总数
long dbCount = this.mPointService.getDbTotalCount();
long esCount = this.mPointService.getEsTotalCount();
long esCount = 0;
try {
esCount = this.mPointService.getEsTotalCount();
} catch (Exception e) {
logger.warn("ES数据查询异常跳过ES", e);
}
logger.info("getlistES数据比对 -> DB总数:" + dbCount + ", ES总数:" + esCount);
String result;
@ -543,34 +548,21 @@ public class MPointController {
units.add(unit);
}
String bizids = "";
StringBuilder bizids = new StringBuilder();
if (searchName != null && !searchName.isEmpty()) {
int lastMatchNum = 1;
String keyword = "";
char[] sNchars = searchName.toCharArray();
for (int u = 0; u < units.size(); u++) {
int matchNum = 0;
for (char item : sNchars) {
if (units.get(u).getSname().contains(String.valueOf(item))) {
matchNum++;
}
}
if (matchNum > lastMatchNum) {
keyword = units.get(u).getId();
}
}
String keyword = getKeyword(searchName, units);
if (!keyword.isEmpty()) {
units = this.getParent(keyword, units);
bizids = keyword;
bizids = new StringBuilder(keyword);
}
}
for (int u = 0; u < units.size(); u++) {
if (!bizids.isEmpty()) {
bizids += " ";
for (Unit value : units) {
if (bizids.length() > 0) {
bizids.append(" ");
}
bizids += units.get(u).getId();
bizids.append(value.getId());
}
childBoolQueryBuilder.must(QueryBuilders.matchQuery("bizid", bizids));
childBoolQueryBuilder.must(QueryBuilders.matchQuery("bizid", bizids.toString()));
}
boolQueryBuilder.should(childBoolQueryBuilder);
@ -582,7 +574,7 @@ public class MPointController {
// 查询工艺段
for (MPoint mp : list) {
List<ProcessSection> processSections = processSectionService.selectSimpleListByWhere("where code = '" + mp.getProcesssectioncode() + "'");
if (processSections != null && processSections.size() > 0) {
if (processSections != null && !processSections.isEmpty()) {
mp.setProcessSection(processSections.get(0));
}
}
@ -595,6 +587,24 @@ public class MPointController {
return new ModelAndView("result");
}
private static String getKeyword(String searchName, List<Unit> units) {
int lastMatchNum = 1;
String keyword = "";
char[] sNchars = searchName.toCharArray();
for (int u = 0; u < units.size(); u++) {
int matchNum = 0;
for (char item : sNchars) {
if (units.get(u).getSname().contains(String.valueOf(item))) {
matchNum++;
}
}
if (matchNum > lastMatchNum) {
keyword = units.get(u).getId();
}
}
return keyword;
}
@RequestMapping("/getKPIList.do")
public ModelAndView getKPIList(HttpServletRequest request, Model model,
@RequestParam(value = "page") Integer page,
@ -4520,7 +4530,7 @@ public class MPointController {
}
PageHelper.startPage(page, rows);
List<MPointHistory> list = mPointHistoryService.selectMpHisDataLeftMpHisChange(bizid, mpid,"'"+mpid+"'", wherestr + orderstr, dbname);
List<MPointHistory> list = mPointHistoryService.selectMpHisDataLeftMpHisChange(bizid, mpid, "'" + mpid + "'", wherestr + orderstr, dbname);
PageInfo<MPointHistory> pi = new PageInfo<MPointHistory>(list);
JSONArray json = JSONArray.fromObject(list);
@ -4668,7 +4678,7 @@ public class MPointController {
*/
@RequestMapping("/hisDataImportExcel.do")
public ModelAndView hisDataImportExcel(@RequestParam(value = "filelist", required = false)
MultipartFile file, HttpServletRequest request, Model model) throws IOException {
MultipartFile file, HttpServletRequest request, Model model) throws IOException {
MultipartRequest multipartRequest = (MultipartRequest) request;
MultipartFile excelFile = multipartRequest.getFile("filelist");
@ -4709,7 +4719,7 @@ public class MPointController {
*/
@RequestMapping("/hisDataMultipleImportExcel.do")
public ModelAndView hisDataMultipleImportExcel(@RequestParam(value = "filelist", required = false)
MultipartFile file, HttpServletRequest request, Model model) throws IOException {
MultipartFile file, HttpServletRequest request, Model model) throws IOException {
MultipartRequest multipartRequest = (MultipartRequest) request;
MultipartFile excelFile = multipartRequest.getFile("filelist");
@ -4859,7 +4869,7 @@ public class MPointController {
*/
@RequestMapping("/saveExcelData.do")
public ModelAndView dosaveExcelData(@RequestParam(value = "filelist", required = false)
MultipartFile file, HttpServletRequest request, Model model) throws IOException {
MultipartFile file, HttpServletRequest request, Model model) throws IOException {
MultipartRequest multipartRequest = (MultipartRequest) request;
MultipartFile excelFile = multipartRequest.getFile("filelist");