添加用户定位ID

This commit is contained in:
wanggeng 2021-11-25 16:11:43 +08:00
parent 6b8bb6c308
commit 02782aca97
2 changed files with 3 additions and 40 deletions

View File

@ -41,7 +41,8 @@ public class UserRealtimeLocationServiceImpl extends DefaultBaseService implemen
@Override
public void save(UserLocationVO userLocationVO) {
userLocationVO.setGmtCreate(DateUtil.getTime());
userLocationService.save(userLocationVO.getCreator(), userLocationVO);
String userLocationId = userLocationService.saveAndReturnId(userLocationVO.getCreator(), userLocationVO);
userLocationVO.setUserLocationId(userLocationId);
mongoTemplate.insert(userLocationVO, MongoCollectionEnum.USER_REALTIME_LOCATION.getCollection());
}

View File

@ -35,12 +35,6 @@
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
<i class="fa fa-lg fa-trash"></i> 删除
</button>
@ -223,39 +217,7 @@
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/user-location/save', []),
end: function() {
reloadTable();
}
});
} else if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectEdit);
} else if(checkDatas.length > 1) {
top.dialog.msg(top.dataMessage.table.selectOneEdit);
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/user-location/update?userLocationId={userLocationId}', [checkDatas[0].userLocationId]),
end: function() {
reloadTable();
}
});
}
} else if(layEvent === 'removeEvent') {
if(layEvent === 'removeEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectDelete);
} else {