change - 传感器阈值维护优化

main
wenjy 3 years ago
parent 3bd43a964a
commit ca77cb7830

@ -174,10 +174,15 @@ public class BaseSensorInfoController extends BaseController {
baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]);
baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag());
/*List<BaseAlarmInfoDto> baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo);
List<BaseAlarmInfoDto> baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo);
if(baseAlarmInfoDtos.size() > 0){
return AjaxResult.error("已包括该阈值,请勿重复添加");
}*/
baseAlarmInfoDtos.forEach(x->{
x.setMaxValue(baseAlarmInfo.getMaxValue());
x.setMinValue(baseAlarmInfo.getMinValue());
baseAlarmInfoService.updateBaseAlarmInfo(x);
});
continue;
}
baseAlarmInfoService.insertBaseAlarmInfo(baseAlarmInfo);
}
return AjaxResult.success();

@ -57,6 +57,7 @@ public class SysParamConfigController extends BaseController {
public String getParameter(String sensorTypeId) {
SysParamConfig sysParamConfig = new SysParamConfig();
sysParamConfig.setParamType(sensorTypeId);
sysParamConfig.setVisibleFlag(0);
List<SysParamConfig> sysParamConfigs =
sysParamConfigService.selectSysParamConfigList(sysParamConfig);
return JSONArray.toJSONString(sysParamConfigs);

@ -50,7 +50,6 @@
</div>
</div>
</div>
<div class="form-group" id="product"/>
</div>
@ -67,9 +66,6 @@
});
function submitHandler() {
/*if ($.validate.form()) {
$.operate.save(prefix + "/set", $('#form-sensorInfo-edit').serialize());
}*/
if ($.validate.form()) {
if (arrList.length<1){
@ -120,11 +116,35 @@
dataType: "json",
success: function(result) {
result.forEach(function (value,index) {
arrList.push(value.alarmtypeId);
/*arrList.push(value.alarmtypeId);
console.log(value);*/
createParams(value);
})
}
});
const createParams = function (paramNames) {
$("#product").append(
"<div><label class=\"col-sm-2 control-label is-required\">参数名称:</label>\n" +
" <div class=\"col-sm-2\">\n" +
" <input name=\"paramCode\" value='" + paramNames.alarmTypeName + "' data-id='" + paramNames.alarmtypeId + "' class=\"form-control\" type=\"text\" readonly='true' required>\n" +
" </div>\n" +
" <label class=\"col-sm-2 control-label is-required\" style='margin-left: -35px'>最小值:</label>" +
" <div class=\"col-sm-2\">\n" +
" <input name=\"minValue\" class=\"form-control\" value='" + paramNames.minValue + "' type=\"text\" required>\n" +
" </div>\n" +
" <label class=\"col-sm-2 control-label is-required\" style='margin-left: -35px'>最大值:</label>" +
" <div class=\"col-sm-2\">\n" +
" <input name=\"maxValue\" class=\"form-control\" value='" + paramNames.maxValue + "' type=\"text\" required>\n" +
" </div>\n" +
" <div class=\"col-sm-1\">\n" +
" <p style=\"margin-top: 10px\" class=\"glyphicon glyphicon-trash\" aria-hidden=\"true\"></p>\n" +
" </div>" +
"</div>"
);
arrList.push(paramNames.alarmtypeId);
}
var productid;
//动态添加成品数量
var testBsSuggest = $("#suggest-demo-1").bsSuggest({
@ -135,6 +155,7 @@
effectiveFieldsAlias: {paramCode: "参数编码", paramName: "参数名称"},
searchFields: ["paramName"],
}).on('onDataRequestSuccess', function (e, result) {
console.log(arrList);
console.log('onDataRequestSuccess: ', result);
}).on('onSetSelectValue', function (e, keyword) {
productid = keyword.id;

Loading…
Cancel
Save