维修工单
This commit is contained in:
@ -54,7 +54,35 @@ public class PipelineDataController {
|
|||||||
wherestr += " and pipe_material like '%" + request.getParameter("search_pipe_material") + "%'";
|
wherestr += " and pipe_material like '%" + request.getParameter("search_pipe_material") + "%'";
|
||||||
}
|
}
|
||||||
if (request.getParameter("search_associated_plant") != null && !request.getParameter("search_associated_plant").isEmpty()) {
|
if (request.getParameter("search_associated_plant") != null && !request.getParameter("search_associated_plant").isEmpty()) {
|
||||||
wherestr += " and associated_plant like '%" + request.getParameter("search_associated_plant") + "%'";
|
wherestr += " and associated_plant = '" + request.getParameter("search_associated_plant") + "'";
|
||||||
|
}
|
||||||
|
// 管道管径查询(支持范围或精确匹配)
|
||||||
|
if (request.getParameter("search_diameter_min") != null && !request.getParameter("search_diameter_min").isEmpty()) {
|
||||||
|
wherestr += " and diameter_mm >= " + request.getParameter("search_diameter_min");
|
||||||
|
}
|
||||||
|
if (request.getParameter("search_diameter_max") != null && !request.getParameter("search_diameter_max").isEmpty()) {
|
||||||
|
wherestr += " and diameter_mm <= " + request.getParameter("search_diameter_max");
|
||||||
|
}
|
||||||
|
// 管道管长查询(支持范围)
|
||||||
|
if (request.getParameter("search_length_min") != null && !request.getParameter("search_length_min").isEmpty()) {
|
||||||
|
wherestr += " and length_m >= " + request.getParameter("search_length_min");
|
||||||
|
}
|
||||||
|
if (request.getParameter("search_length_max") != null && !request.getParameter("search_length_max").isEmpty()) {
|
||||||
|
wherestr += " and length_m <= " + request.getParameter("search_length_max");
|
||||||
|
}
|
||||||
|
// 起点埋深查询(支持范围)
|
||||||
|
if (request.getParameter("search_start_depth_min") != null && !request.getParameter("search_start_depth_min").isEmpty()) {
|
||||||
|
wherestr += " and start_burial_depth_m >= " + request.getParameter("search_start_depth_min");
|
||||||
|
}
|
||||||
|
if (request.getParameter("search_start_depth_max") != null && !request.getParameter("search_start_depth_max").isEmpty()) {
|
||||||
|
wherestr += " and start_burial_depth_m <= " + request.getParameter("search_start_depth_max");
|
||||||
|
}
|
||||||
|
// 终点埋深查询(支持范围)
|
||||||
|
if (request.getParameter("search_end_depth_min") != null && !request.getParameter("search_end_depth_min").isEmpty()) {
|
||||||
|
wherestr += " and end_burial_depth_m >= " + request.getParameter("search_end_depth_min");
|
||||||
|
}
|
||||||
|
if (request.getParameter("search_end_depth_max") != null && !request.getParameter("search_end_depth_max").isEmpty()) {
|
||||||
|
wherestr += " and end_burial_depth_m <= " + request.getParameter("search_end_depth_max");
|
||||||
}
|
}
|
||||||
PageHelper.startPage(page, rows);
|
PageHelper.startPage(page, rows);
|
||||||
List<PipelineData> list = this.pipelineDataService.selectListByWhere(wherestr + orderstr);
|
List<PipelineData> list = this.pipelineDataService.selectListByWhere(wherestr + orderstr);
|
||||||
|
|||||||
@ -70,6 +70,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
|
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
|
||||||
|
import org.springframework.data.elasticsearch.core.query.SearchQuery;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
@ -573,7 +574,7 @@ public class MPointController {
|
|||||||
nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort(sort).order(sortOrder));
|
nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort(sort).order(sortOrder));
|
||||||
nativeSearchQueryBuilder.withQuery(boolQueryBuilder);
|
nativeSearchQueryBuilder.withQuery(boolQueryBuilder);
|
||||||
nativeSearchQueryBuilder.withPageable(PageRequest.of(page - 1, rows));
|
nativeSearchQueryBuilder.withPageable(PageRequest.of(page - 1, rows));
|
||||||
Page<MPoint> list = this.mPointService.selectListByES(nativeSearchQueryBuilder);
|
Page<MPoint> list = this.selectListByES(nativeSearchQueryBuilder);
|
||||||
|
|
||||||
// 查询工艺段
|
// 查询工艺段
|
||||||
for (MPoint mp : list) {
|
for (MPoint mp : list) {
|
||||||
@ -591,6 +592,42 @@ public class MPointController {
|
|||||||
return new ModelAndView("result");
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ES搜索查询,返回Page类型
|
||||||
|
*
|
||||||
|
* @param nativeSearchQueryBuilder
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Page<MPoint> selectListByES(NativeSearchQueryBuilder nativeSearchQueryBuilder) {
|
||||||
|
SearchQuery searchQuery = nativeSearchQueryBuilder.build();
|
||||||
|
Page<MPoint> mPage = mPointRepo.search(searchQuery);
|
||||||
|
for (MPoint mPoint : mPage) {
|
||||||
|
if (mPoint.getNumtail() != null) {
|
||||||
|
BigDecimal value = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate());
|
||||||
|
if (value != null) {
|
||||||
|
try {
|
||||||
|
mPoint.setParmvalue(value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mPoint.getBizid() != null && !mPoint.getBizid().isEmpty()) {
|
||||||
|
Unit unit = this.unitService.getUnitById(mPoint.getBizid());
|
||||||
|
if (unit != null) {
|
||||||
|
String unitName = unit.getSname();
|
||||||
|
if (unitName == null || unitName.isEmpty()) {
|
||||||
|
unitName = unit.getName();
|
||||||
|
}
|
||||||
|
mPoint.setBizname(unitName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mPage;
|
||||||
|
}
|
||||||
|
|
||||||
public void syncAllDbDataToEs() {
|
public void syncAllDbDataToEs() {
|
||||||
logger.info("ES与数据库数据总数不一致,开始全量同步数据库数据到ES...");
|
logger.info("ES与数据库数据总数不一致,开始全量同步数据库数据到ES...");
|
||||||
MPoint query = new MPoint();
|
MPoint query = new MPoint();
|
||||||
|
|||||||
@ -659,42 +659,6 @@ public class MPointService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ES搜索查询,返回Page类型
|
|
||||||
*
|
|
||||||
* @param nativeSearchQueryBuilder
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Page<MPoint> selectListByES(NativeSearchQueryBuilder nativeSearchQueryBuilder) {
|
|
||||||
SearchQuery searchQuery = nativeSearchQueryBuilder.build();
|
|
||||||
Page<MPoint> mPage = mPointRepo.search(searchQuery);
|
|
||||||
for (MPoint mPoint : mPage) {
|
|
||||||
if (mPoint.getNumtail() != null) {
|
|
||||||
BigDecimal value = CommUtil.formatMPointValue(mPoint.getParmvalue(), mPoint.getNumtail(), mPoint.getRate());
|
|
||||||
if (value != null) {
|
|
||||||
try {
|
|
||||||
mPoint.setParmvalue(value);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// TODO: handle exception
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mPoint.getBizid() != null && !mPoint.getBizid().isEmpty()) {
|
|
||||||
Unit unit = this.unitService.getUnitById(mPoint.getBizid());
|
|
||||||
if (unit != null) {
|
|
||||||
String unitName = unit.getSname();
|
|
||||||
if (unitName == null || unitName.isEmpty()) {
|
|
||||||
unitName = unit.getName();
|
|
||||||
}
|
|
||||||
mPoint.setBizname(unitName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取数据库中测量点总数
|
* 获取数据库中测量点总数
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
<%request.setAttribute("Code_Type_Wx", EquipmentPlanType.Code_Type_Wx); %>
|
||||||
|
|
||||||
<jsp:include page="/jsp/maintenance/workorderConsume.jsp"></jsp:include>
|
<jsp:include page="/jsp/maintenance/workorderConsume.jsp"></jsp:include>
|
||||||
<jsp:include page="/JS/workorder/workorderAchievement.js"></jsp:include>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/workorder/workorderAchievement.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.select2-container .select2-selection--single{
|
.select2-container .select2-selection--single{
|
||||||
|
|||||||
@ -26,6 +26,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载所属厂站下拉框
|
||||||
|
$(function() {
|
||||||
|
$.post(ext.contextPath + '/sparepart/sewage/getSewage4Select.do', {unitId: unitId}, function(data) {
|
||||||
|
var jsonData = data;
|
||||||
|
if(typeof data === 'string') {
|
||||||
|
try {
|
||||||
|
jsonData = JSON.parse(data);
|
||||||
|
} catch(e) {
|
||||||
|
jsonData = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var $select = $('#associatedPlant');
|
||||||
|
$select.empty().append('<option value="">请选择</option>');
|
||||||
|
if(jsonData && jsonData.length > 0) {
|
||||||
|
for(var i = 0; i < jsonData.length; i++) {
|
||||||
|
$select.append('<option value="' + jsonData[i].id + '">' + jsonData[i].text + '</option>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$("#subForm").bootstrapValidator({
|
$("#subForm").bootstrapValidator({
|
||||||
live: 'disabled',
|
live: 'disabled',
|
||||||
fields: {
|
fields: {
|
||||||
@ -125,7 +146,9 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">所属厂站</label>
|
<label class="col-sm-3 control-label">所属厂站</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" class="form-control" id="associatedPlant" name="associatedPlant" placeholder="请输入所属厂站">
|
<select class="form-control" id="associatedPlant" name="associatedPlant">
|
||||||
|
<option value="">请选择</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@ -27,6 +27,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载所属厂站下拉框并设置选中值
|
||||||
|
$(function() {
|
||||||
|
var savedValue = '${pipelineData.associatedPlant}';
|
||||||
|
$.post(ext.contextPath + '/sparepart/sewage/getSewage4Select.do', {unitId: unitId}, function(data) {
|
||||||
|
var jsonData = data;
|
||||||
|
if(typeof data === 'string') {
|
||||||
|
try {
|
||||||
|
jsonData = JSON.parse(data);
|
||||||
|
} catch(e) {
|
||||||
|
jsonData = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var $select = $('#associatedPlant');
|
||||||
|
$select.empty().append('<option value="">请选择</option>');
|
||||||
|
if(jsonData && jsonData.length > 0) {
|
||||||
|
for(var i = 0; i < jsonData.length; i++) {
|
||||||
|
var selected = (jsonData[i].id == savedValue) ? ' selected' : '';
|
||||||
|
$select.append('<option value="' + jsonData[i].id + '"' + selected + '>' + jsonData[i].text + '</option>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$("#subForm").bootstrapValidator({
|
$("#subForm").bootstrapValidator({
|
||||||
live: 'disabled',
|
live: 'disabled',
|
||||||
fields: {
|
fields: {
|
||||||
@ -129,8 +152,9 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">所属厂站</label>
|
<label class="col-sm-3 control-label">所属厂站</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" class="form-control" id="associatedPlant" name="associatedPlant"
|
<select class="form-control" id="associatedPlant" name="associatedPlant">
|
||||||
value="${pipelineData.associatedPlant}" placeholder="请输入所属厂站">
|
<option value="">请选择</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@ -140,7 +140,15 @@
|
|||||||
search_name: $('#search_name').val(),
|
search_name: $('#search_name').val(),
|
||||||
search_pipeline_area: $('#search_pipeline_area').val(),
|
search_pipeline_area: $('#search_pipeline_area').val(),
|
||||||
search_pipe_material: $('#search_pipe_material').val(),
|
search_pipe_material: $('#search_pipe_material').val(),
|
||||||
search_associated_plant: $('#search_associated_plant').val()
|
search_associated_plant: $('#search_associated_plant').val(),
|
||||||
|
search_diameter_min: $('#search_diameter_min').val(),
|
||||||
|
search_diameter_max: $('#search_diameter_max').val(),
|
||||||
|
search_length_min: $('#search_length_min').val(),
|
||||||
|
search_length_max: $('#search_length_max').val(),
|
||||||
|
search_start_depth_min: $('#search_start_depth_min').val(),
|
||||||
|
search_start_depth_max: $('#search_start_depth_max').val(),
|
||||||
|
search_end_depth_min: $('#search_end_depth_min').val(),
|
||||||
|
search_end_depth_max: $('#search_end_depth_max').val()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,6 +279,24 @@
|
|||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
initFun();
|
initFun();
|
||||||
|
// 加载所属厂站下拉框(从排污源信息获取)
|
||||||
|
$.post(ext.contextPath + '/sparepart/sewage/getSewage4Select.do', {unitId: unitId}, function(data) {
|
||||||
|
var jsonData = data;
|
||||||
|
if(typeof data === 'string') {
|
||||||
|
try {
|
||||||
|
jsonData = JSON.parse(data);
|
||||||
|
} catch(e) {
|
||||||
|
jsonData = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var $select = $('#search_associated_plant');
|
||||||
|
$select.empty().append('<option value="">全部厂站</option>');
|
||||||
|
if(jsonData && jsonData.length > 0) {
|
||||||
|
for(var i = 0; i < jsonData.length; i++) {
|
||||||
|
$select.append('<option value="' + jsonData[i].id + '">' + jsonData[i].text + '</option>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@ -301,21 +327,29 @@
|
|||||||
</button>
|
</button>
|
||||||
</security:authorize>
|
</security:authorize>
|
||||||
<div class="form-group pull-right form-inline">
|
<div class="form-group pull-right form-inline">
|
||||||
<select id="search_pipeline_area" name="search_pipeline_area" class="form-control input-sm" style="width: 120px;">
|
<div class="input-group input-group-sm" style="width: 150px;">
|
||||||
|
<input type="text" id="search_name" name="search_name" class="form-control" placeholder="管道名称">
|
||||||
|
</div>
|
||||||
|
<select id="search_pipeline_area" name="search_pipeline_area" class="form-control input-sm" style="width: 100px;">
|
||||||
<option value="">全部区域</option>
|
<option value="">全部区域</option>
|
||||||
<option value="OUT_SIDE">场外管道</option>
|
<option value="OUT_SIDE">场外管道</option>
|
||||||
<option value="In_SIDE">场内管道</option>
|
<option value="In_SIDE">场内管道</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" id="search_pipe_material" name="search_pipe_material" class="form-control input-sm" placeholder="管道材质" style="width: 100px;">
|
<input type="text" id="search_pipe_material" name="search_pipe_material" class="form-control input-sm" placeholder="管道材质" style="width: 80px;">
|
||||||
<input type="text" id="search_associated_plant" name="search_associated_plant" class="form-control input-sm" placeholder="所属厂站" style="width: 100px;">
|
<select id="search_associated_plant" name="search_associated_plant" class="form-control input-sm" style="width: 120px;">
|
||||||
<div class="input-group input-group-sm" style="width: 200px;">
|
<option value="">全部厂站</option>
|
||||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="管道名称">
|
</select>
|
||||||
<div class="input-group-btn">
|
<input type="text" id="search_diameter_min" name="search_diameter_min" class="form-control input-sm" placeholder="管径最小" style="width: 70px;" title="管径最小值(mm)">
|
||||||
<button type="button" class="btn btn-default" onclick="dosearch();">
|
<input type="text" id="search_diameter_max" name="search_diameter_max" class="form-control input-sm" placeholder="管径最大" style="width: 70px;" title="管径最大值(mm)">
|
||||||
<i class="fa fa-search"></i>
|
<input type="text" id="search_length_min" name="search_length_min" class="form-control input-sm" placeholder="管长最小" style="width: 70px;" title="管长最小值(m)">
|
||||||
</button>
|
<input type="text" id="search_length_max" name="search_length_max" class="form-control input-sm" placeholder="管长最大" style="width: 70px;" title="管长最大值(m)">
|
||||||
</div>
|
<input type="text" id="search_start_depth_min" name="search_start_depth_min" class="form-control input-sm" placeholder="起点埋深最小" style="width: 80px;" title="起点埋深最小值(m)">
|
||||||
</div>
|
<input type="text" id="search_start_depth_max" name="search_start_depth_max" class="form-control input-sm" placeholder="起点埋深最大" style="width: 80px;" title="起点埋深最大值(m)">
|
||||||
|
<input type="text" id="search_end_depth_min" name="search_end_depth_min" class="form-control input-sm" placeholder="终点埋深最小" style="width: 80px;" title="终点埋深最小值(m)">
|
||||||
|
<input type="text" id="search_end_depth_max" name="search_end_depth_max" class="form-control input-sm" placeholder="终点埋深最大" style="width: 80px;" title="终点埋深最大值(m)">
|
||||||
|
<button type="button" class="btn btn-primary btn-sm" onclick="dosearch();">
|
||||||
|
<i class="fa fa-search"></i> 查询
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user