1、增加接续数据功能
This commit is contained in:
parent
7555c4c72b
commit
d250bfc671
@ -341,6 +341,55 @@ public class GnssDeviceController extends BasicController{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/gnss/device/cont_loc")
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject contLoc(String deviceid,String createtime){
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
//old data
|
||||||
|
QueryWrapper<GnssCalcData> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("deviceid",deviceid);
|
||||||
|
queryWrapper.eq("enabled",1);
|
||||||
|
queryWrapper.eq("createtime",createtime);
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
|
queryWrapper.isNotNull("rpose");
|
||||||
|
GnssCalcData calcOldData = gnssCalcDataMapper.selectOne(queryWrapper);
|
||||||
|
if(calcOldData==null) {
|
||||||
|
jsonObject.put("code",1);
|
||||||
|
jsonObject.put("msg","该时间无有效解算结果");
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// new data
|
||||||
|
QueryWrapper<GnssCalcData> queryWrapper1 = new QueryWrapper<>();
|
||||||
|
queryWrapper1.eq("deviceid",deviceid);
|
||||||
|
queryWrapper1.eq("enabled",1);
|
||||||
|
queryWrapper1.orderByDesc("createtime");
|
||||||
|
queryWrapper1.last("limit 1");
|
||||||
|
queryWrapper1.isNotNull("rpose");
|
||||||
|
GnssCalcData calcNewData = gnssCalcDataMapper.selectOne(queryWrapper1);
|
||||||
|
if(calcNewData==null) {
|
||||||
|
jsonObject.put("code",1);
|
||||||
|
jsonObject.put("msg","无有效解算结果");
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 原来的初始值
|
||||||
|
QueryWrapper<GnssDevice> deviceQueryWrapper = new QueryWrapper<>();
|
||||||
|
deviceQueryWrapper.eq("deviceid",deviceid);
|
||||||
|
deviceQueryWrapper.last("limit 1");
|
||||||
|
GnssDevice device = gnssDeviceMapper.selectOne(deviceQueryWrapper);
|
||||||
|
if(device.getIpose()==null) device.setIpose(0.0);
|
||||||
|
if(device.getIposn()==null) device.setIposn(0.0);
|
||||||
|
if(device.getIposd()==null) device.setIposd(0.0);
|
||||||
|
|
||||||
|
jsonObject.put("code",0);
|
||||||
|
jsonObject.put("ipose", NumberUtils.scaleTwo(calcNewData.getRpose()-calcOldData.getRpose()+device.getIpose()));
|
||||||
|
jsonObject.put("iposn",NumberUtils.scaleTwo(calcNewData.getRposn()-calcOldData.getRposn()+device.getIposn()));
|
||||||
|
jsonObject.put("iposd",NumberUtils.scaleTwo(calcNewData.getRposd()-calcOldData.getRposd()+device.getIposd()));
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
void updateBasicGroupAssociatedNum(GnssDevice newCfg, GnssDevice oldCfg){
|
void updateBasicGroupAssociatedNum(GnssDevice newCfg, GnssDevice oldCfg){
|
||||||
updateBasicGroupAssociatedNum(newCfg.getGroup_id());
|
updateBasicGroupAssociatedNum(newCfg.getGroup_id());
|
||||||
updateCalcGroupAssociatedNum(newCfg.getCalc_group_id());
|
updateCalcGroupAssociatedNum(newCfg.getCalc_group_id());
|
||||||
|
|||||||
@ -230,8 +230,9 @@
|
|||||||
<hr th:if="${role=='SUPER_ADMIN'}">
|
<hr th:if="${role=='SUPER_ADMIN'}">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-input-block" style="float:right" >
|
<div class="layui-input-block" style="float:right" >
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
|
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">保存</button>
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="initLocBtn">取初值</button>
|
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="initLocBtn">取初值</button>
|
||||||
|
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="contBtn">续数据</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -286,6 +287,47 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
form.on('submit(contBtn)', function (data) {
|
||||||
|
// 弹出输入框
|
||||||
|
layer.prompt({
|
||||||
|
title: '请输入接续记录日期', // 弹窗标题
|
||||||
|
formType: 0, // 0-文本输入框
|
||||||
|
maxlength: 50, // 最大输入长度
|
||||||
|
value: '', // 初始值
|
||||||
|
btn: ['确定', '取消'] // 按钮组
|
||||||
|
}, function(value, index) { // 确定按钮回调
|
||||||
|
// 处理输入结果
|
||||||
|
if(value) {
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
url:"/gnss/device/cont_loc",
|
||||||
|
data:{
|
||||||
|
'deviceid':$('#deviceid').val(),
|
||||||
|
'createtime':value
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
if(result.code == 0) {
|
||||||
|
$('#ipose').val(result.ipose);
|
||||||
|
$('#iposn').val(result.iposn);
|
||||||
|
$('#iposd').val(result.iposd);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
layer.alert(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
console.log("ajax error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg('输入内容不能为空!', {icon: 2});
|
||||||
|
}
|
||||||
|
// 关闭当前弹窗
|
||||||
|
layer.close(index);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
form.on('select(device_type)', function (data) {
|
form.on('select(device_type)', function (data) {
|
||||||
setEcefEditor();
|
setEcefEditor();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user