This commit is contained in:
Timer
2026-04-09 14:16:18 +08:00
parent f89ab0f90d
commit 5c576ddfcb
21 changed files with 137 additions and 130 deletions

View File

@ -89,11 +89,26 @@ public class KPIPointController {
// List<MPointHistory> lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
for (int i=0; i < list.size(); i++) {
String rawBizId = list.get(i).getBizid();
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
if (processSection == null && list.get(i).getProcesssectionid() != null && !list.get(i).getProcesssectionid().isEmpty()) {
// KPI里历史数据存在按code保存工艺段的场景优先按厂区code匹配再回退到系统库
List<ProcessSection> processSectionList = this.processSectionService.selectSimpleListByWhere(
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + rawBizId + "' "
);
if (processSectionList == null || processSectionList.isEmpty()) {
processSectionList = this.processSectionService.selectSimpleListByWhere(
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + ProcessSection.UnitId_Sys + "' "
);
}
if (processSectionList != null && !processSectionList.isEmpty()) {
processSection = processSectionList.get(0);
}
}
if (processSection != null) {
list.get(i).setProcessectionname(processSection.getName());
}
Company company = this.unitService.getCompById(list.get(i).getBizid());
Company company = this.unitService.getCompById(rawBizId);
if (company != null) {
list.get(i).setBizid(company.getName());
}

View File

@ -173,8 +173,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on('change', function () {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
//工艺段选择后,清空原有工艺段选择的设备
$("#equipmentIds").val("");
$("#equipname").val("");

View File

@ -159,7 +159,7 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${abnormity.processSectionId}').trigger("change");
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
},'json');
};
var companyId = "${abnormity.bizId}";
@ -181,9 +181,9 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val('${abnormity.processSectionId}').trigger("change");
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
}
selelct_.on('change',function(){
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
//工艺段选择后,清空原有工艺段选择的设备
$("#equipmentIds").val("");
$("#equipname").val("");

View File

@ -195,8 +195,8 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(e){
dosearch();
});
},'json');

View File

@ -156,8 +156,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
initAPPFun();
});
}, 'json');
@ -493,8 +493,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
// dosearch();
$("#table").bootstrapTable('refresh');
});

View File

@ -170,16 +170,16 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');
var statusSelect = $("#statusSelect").select2({
minimumResultsForSearch: 10,
placeholder: '请选择',
}).val('').trigger("change");
statusSelect.on("change", function (e) {
}).val('').trigger("change.select2");
statusSelect.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
$("#table").bootstrapTable({ // 对应table标签的id

View File

@ -174,8 +174,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val("").trigger("change");
selelct_.on("change", function (e) {
selelct_.val("").trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -187,8 +187,8 @@
return repo.text;
} // 函数用于呈现当前的选择
});
selelct_.val("").trigger("change");
selelct_.on("change", function (e) {
selelct_.val("").trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -271,8 +271,8 @@
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
});
selelct_.val("").trigger("change");
selelct_.on("change", function (e) {
selelct_.val("").trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -113,7 +113,7 @@ var selectMPint = function(pid) {
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change");
selelct_.val(data[0].id).trigger("change.select2");
}
},'json');
}else{
@ -131,8 +131,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('').trigger("change");
selelct.on("change",function(e){
selelct.val('').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
var companyId= $(this).val();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processsectionid").empty();
@ -147,7 +147,7 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json');
});
}

View File

@ -89,7 +89,7 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json');
};
@ -116,7 +116,7 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
},'json');
}else{
$("#hidden_bizid").attr("disabled","disabled");
@ -133,8 +133,8 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('${kPIPoint.bizid}').trigger("change");
selelct.on("change",function(e){
selelct.val('${kPIPoint.bizid}').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
var companyId= $(this).val();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processsectionid").empty();
@ -149,7 +149,7 @@ var selectMPint = function(pid) {
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct_.val('').trigger("change");
selelct_.val('').trigger("change.select2");
},'json');
});
}

View File

@ -179,9 +179,14 @@
}
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
selelct_.val('').trigger("change");
selelct_.off("change").on("change", function () {
// 初始化时仅刷新控件显示,不触发查询
selelct_.val('').trigger("change.select2");
// 用select2事件触发查询避免普通change导致选中文本被立即重置
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
// 让select2先完成渲染再执行查询
setTimeout(function () {
dosearch();
}, 0);
});
}, 'json');
};
@ -239,9 +244,9 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
refreshSelect();
selelct.on("change", function (e) {
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function () {
companyId = $(this).val();
dosearch();
refreshSelect();

View File

@ -139,6 +139,34 @@ var companyId = "";
var dosearch = function() {
$("#table").bootstrapTable('refresh');
};
var loadProcessSectionSelect = function(companyId) {
if (!companyId) {
refreshSelect();
return;
}
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',
allowClear: true,
escapeMarkup: function (markup) { return markup; },
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,
formatResult: function formatRepo(repo){return repo.text;},
formatSelection: function formatRepoSelection(repo){return repo.text;}
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
setTimeout(function(){
dosearch();
},0);
});
},'json');
};
var refreshSelect = function() {
var selelct_ =$("#processSection").select2({
data: null,
@ -163,27 +191,7 @@ var companyId = "";
$("#company").text(data[0].text);
companyId=data[0].id;
dosearch();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
loadProcessSectionSelect(companyId);
}else{
$("#company").css("display", "none");
var selelct=$("#search_code").select2({
@ -198,32 +206,13 @@ var companyId = "";
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
refreshSelect();
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val();
dosearch();
refreshSelect();
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
$("#processSection").empty();
var selelct_ =$("#processSection").select2({
data: data,
cache : false,
placeholder:'请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
dosearch();
});
},'json');
loadProcessSectionSelect(companyId);
});
}
},'json');

View File

@ -366,8 +366,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');
@ -394,9 +394,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change");
//refreshSelect();
selelct.on("change", function (e) {
selelct.val('').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
companyId = $(this).val();
//dosearch();
//refreshSelect();
@ -422,8 +421,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -325,8 +325,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');
@ -353,9 +353,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct.val('').trigger("change");
//refreshSelect();
selelct.on("change", function (e) {
selelct.val('').trigger("change.select2");
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
companyId = $(this).val();
//dosearch();
//refreshSelect();
@ -381,8 +380,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
dosearch();
});
}, 'json');

View File

@ -133,8 +133,8 @@
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});

View File

@ -149,8 +149,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val('').trigger("change");
select.on("change", function (e) {
select.val('').trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});
@ -166,8 +166,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val("").trigger("change");
select.on("change", function (e) {
select.val("").trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});
@ -196,8 +196,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh');
});

View File

@ -181,8 +181,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val('').trigger("change");
select.on("change", function (e) {
select.val('').trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1});
});
@ -200,8 +200,8 @@
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
});
select.val("").trigger("change");
select.on("change", function (e) {
select.val("").trigger("change.select2");
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1});
});
@ -231,8 +231,8 @@
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
$("#table").bootstrapTable('refresh', {pageNumber: 1});
});

View File

@ -108,7 +108,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change");
selelct_.val(data[0].id).trigger("change.select2");
}
},'json');
}else{
@ -126,7 +126,7 @@
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val();
//重新选择厂区后清空设备和工艺段数据
$("#equipname").val("");
@ -134,7 +134,7 @@
$("#processSectionId").val("");
$("#processectionname").val("");
});
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
}
},'json');
@ -149,8 +149,8 @@
.updateStatus('plannedenddt', 'NOT_VALIDATED',null)
.validateField('plannedenddt');
});
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change");
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change.select2");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change.select2");
});
//选择设备根据厂区id选择厂内设备
var selectEquipmentCard = function() {

View File

@ -101,7 +101,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
if(data!=null && data.length>0){
selelct_.val(data[0].id).trigger("change");
selelct_.val(data[0].id).trigger("change.select2");
}
},'json');
}else{
@ -119,7 +119,7 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function(e){
companyId = $(this).val();
//重新选择厂区后清空设备和工艺段数据
if(companyId != "${maintenanceDetail.companyid}"){
@ -129,10 +129,10 @@
$("#processectionname").val("");
}
});
selelct.val('${maintenanceDetail.companyid}').trigger("change");
selelct.val('${maintenanceDetail.companyid}').trigger("change.select2");
}
},'json');
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change");
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change.select2");
//选择时间
$('#startDate').datepicker({
language: 'zh-CN',

View File

@ -133,8 +133,8 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
dosearch();
});
@ -153,9 +153,9 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct.val('').trigger("change");
selelct.val('').trigger("change.select2");
refreshSelect();
selelct.on("change",function(e){
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
companyId= $(this).val();
dosearch();
refreshSelect();
@ -174,8 +174,8 @@
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
selelct_.val('').trigger("change");
selelct_.on("change",function(e){
selelct_.val('').trigger("change.select2");
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
dosearch();
});
},'json');