forked from dyf/fys-Multi-tenant
代码优化2
This commit is contained in:
@ -104,6 +104,15 @@ public class AppAuthController {
|
|||||||
return R.ok("退出成功");
|
return R.ok("退出成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注销
|
||||||
|
*/
|
||||||
|
@PostMapping("/cancelAccount")
|
||||||
|
public R<Void> cancelAccount() {
|
||||||
|
loginService.cancelAccount();
|
||||||
|
return R.ok("用户注销成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户注册
|
* 用户注册
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@ import com.fuyuanshen.app.domain.vo.AppPersonnelInfoVo;
|
|||||||
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
||||||
import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper;
|
import com.fuyuanshen.app.mapper.AppPersonnelInfoMapper;
|
||||||
import com.fuyuanshen.app.mapper.equipment.APPDeviceMapper;
|
import com.fuyuanshen.app.mapper.equipment.APPDeviceMapper;
|
||||||
|
import com.fuyuanshen.common.core.constant.GlobalConstants;
|
||||||
import com.fuyuanshen.common.core.exception.ServiceException;
|
import com.fuyuanshen.common.core.exception.ServiceException;
|
||||||
import com.fuyuanshen.common.core.utils.ImageToCArrayConverter;
|
import com.fuyuanshen.common.core.utils.ImageToCArrayConverter;
|
||||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||||
@ -320,6 +321,16 @@ public class AppDeviceBizService {
|
|||||||
}else{
|
}else{
|
||||||
vo.setBatteryPercentage("0");
|
vo.setBatteryPercentage("0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取经度纬度
|
||||||
|
String locationInfo = GlobalConstants.GLOBAL_REDIS_KEY+DeviceRedisKeyConstants.DEVICE_LOCATION_KEY_PREFIX + device.getDeviceImei();
|
||||||
|
if(StringUtils.isNotBlank(locationInfo)){
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(locationInfo);
|
||||||
|
vo.setLongitude((String)jsonObject.get("longitude"));
|
||||||
|
vo.setLatitude((String)jsonObject.get("latitude"));
|
||||||
|
vo.setAddress((String)jsonObject.get("address"));
|
||||||
|
}
|
||||||
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public class AppLoginService {
|
|||||||
private Integer lockTime;
|
private Integer lockTime;
|
||||||
|
|
||||||
private final ISysTenantService tenantService;
|
private final ISysTenantService tenantService;
|
||||||
private final IAppRoleService roleService;
|
private final IAppUserService appUserService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -185,4 +185,24 @@ public class AppLoginService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cancelAccount() {
|
||||||
|
try {
|
||||||
|
AppLoginUser loginUser = AppLoginHelper.getLoginUser();
|
||||||
|
if (ObjectUtil.isNull(loginUser)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
appUserService.deleteWithValidByIds(Collections.singletonList(loginUser.getUserId()),true);
|
||||||
|
if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) {
|
||||||
|
// 超级管理员 登出清除动态租户
|
||||||
|
TenantHelper.clearDynamic();
|
||||||
|
}
|
||||||
|
recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, "用户注销成功");
|
||||||
|
} catch (NotLoginException ignored) {
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
StpUtil.logout();
|
||||||
|
} catch (NotLoginException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,4 +90,13 @@ public class AppDeviceDetailVo {
|
|||||||
* 在线状态(0离线,1在线)
|
* 在线状态(0离线,1在线)
|
||||||
*/
|
*/
|
||||||
private Integer onlineStatus;
|
private Integer onlineStatus;
|
||||||
|
|
||||||
|
// 经度
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
// 纬度
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
// 逆解析地址
|
||||||
|
private String address;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user