新增人员定位接口
This commit is contained in:
parent
9d64a329a7
commit
d4050c6a00
@ -0,0 +1,102 @@
|
||||
package ink.wgink.module.map.controller.api.userlocation;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO;
|
||||
import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO;
|
||||
import ink.wgink.module.map.service.userlocation.IUserLocationService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: UserLocationController
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "用户定位接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/user-location")
|
||||
public class UserLocationController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IUserLocationService userLocationService;
|
||||
|
||||
@ApiOperation(value = "删除用户定位", notes = "删除用户定位接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||
userLocationService.remove(Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改用户定位", notes = "修改用户定位接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{userLocationId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("userLocationId") String userLocationId, @RequestBody UserLocationVO userLocationVO) {
|
||||
userLocationService.update(userLocationId, userLocationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位详情", notes = "用户定位详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{userLocationId}")
|
||||
public UserLocationDTO get(@PathVariable("userLocationId") String userLocationId) {
|
||||
return userLocationService.get(userLocationId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位列表", notes = "用户定位列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<UserLocationDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return userLocationService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位分页列表", notes = "用户定位分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<UserLocationDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return userLocationService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位统计", notes = "用户定位统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return new SuccessResultData<>(userLocationService.count(params));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package ink.wgink.module.map.controller.app.api.userlocation;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO;
|
||||
import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO;
|
||||
import ink.wgink.module.map.service.userlocation.IUserLocationService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: UserLocationAppController
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "用户定位接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.APP_PREFIX + "/user-location")
|
||||
public class UserLocationAppController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IUserLocationService userLocationService;
|
||||
|
||||
@ApiOperation(value = "新增用户定位", notes = "新增用户定位接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("save")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult save(@RequestHeader("token") String token, @RequestBody UserLocationVO userLocationVO) {
|
||||
userLocationService.save(token, userLocationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除用户定位(id列表)", notes = "删除用户定位(id列表)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
|
||||
userLocationService.remove(token, Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改用户定位", notes = "修改用户定位接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("updateuserlocation/{userLocationId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateUserLocation(@RequestHeader("token") String token, @PathVariable("userLocationId") String userLocationId, @RequestBody UserLocationVO userLocationVO) {
|
||||
userLocationService.update(token, userLocationId, userLocationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位详情(通过ID)", notes = "用户定位详情(通过ID)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{userLocationId}")
|
||||
public UserLocationDTO get(@RequestHeader("token") String token, @PathVariable("userLocationId") String userLocationId) {
|
||||
return userLocationService.get(userLocationId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位列表", notes = "用户定位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<UserLocationDTO> list(@RequestHeader("token") String token) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return userLocationService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位分页列表", notes = "用户定位分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpageuserlocation")
|
||||
public SuccessResultList<List<UserLocationDTO>> listPage(@RequestHeader("token") String token, ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return userLocationService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位统计", notes = "用户定位统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return new SuccessResultData<>(userLocationService.count(params));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package ink.wgink.module.map.controller.resource.userlocation;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO;
|
||||
import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO;
|
||||
import ink.wgink.module.map.service.userlocation.IUserLocationService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: UserLocationResourceController
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "用户定位接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/user-location")
|
||||
public class UserLocationResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IUserLocationService userLocationService;
|
||||
|
||||
@ApiOperation(value = "删除用户定位(id列表)", notes = "删除用户定位(id列表)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
public SuccessResult remove(@PathVariable("ids") String ids) {
|
||||
userLocationService.remove(Arrays.asList(ids.split("\\_")));
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改用户定位", notes = "修改用户定位接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{userLocationId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult update(@PathVariable("userLocationId") String userLocationId, @RequestBody UserLocationVO userLocationVO) {
|
||||
userLocationService.update(userLocationId, userLocationVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位详情", notes = "用户定位详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{userLocationId}")
|
||||
public UserLocationDTO get(@PathVariable("userLocationId") String userLocationId) {
|
||||
return userLocationService.get(userLocationId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位列表", notes = "用户定位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<UserLocationDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return userLocationService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位分页列表", notes = "用户定位分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<UserLocationDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return userLocationService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位统计", notes = "用户定位统计接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return new SuccessResultData<>(userLocationService.count(params));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package ink.wgink.module.map.controller.route.userlocation;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.map.service.userlocation.IUserLocationService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: UserLocationController
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "用户定位路由")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/user-location")
|
||||
public class UserLocationRouteController extends DefaultBaseController {
|
||||
|
||||
@GetMapping("save")
|
||||
public ModelAndView save() {
|
||||
return new ModelAndView("user-location/save");
|
||||
}
|
||||
|
||||
@GetMapping("update")
|
||||
public ModelAndView update() {
|
||||
return new ModelAndView("user-location/update");
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
public ModelAndView list() {
|
||||
return new ModelAndView("user-location/list");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package ink.wgink.module.map.dao.userlocation;
|
||||
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.module.map.pojo.bos.userlocation.UserLocationBO;
|
||||
import ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO;
|
||||
import ink.wgink.module.map.pojo.pos.userlocation.UserLocationPO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IUserLocationDao
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Repository
|
||||
public interface IUserLocationDao {
|
||||
|
||||
/**
|
||||
* 新增用户定位
|
||||
*
|
||||
* @param params
|
||||
* @throws SaveException
|
||||
*/
|
||||
void save(Map<String, Object> params) throws SaveException;
|
||||
|
||||
/**
|
||||
* 删除用户定位
|
||||
*
|
||||
* @param params
|
||||
* @throws RemoveException
|
||||
*/
|
||||
void remove(Map<String, Object> params) throws RemoveException;
|
||||
|
||||
/**
|
||||
* 删除用户定位(物理)
|
||||
*
|
||||
* @param params
|
||||
* @throws RemoveException
|
||||
*/
|
||||
void delete(Map<String, Object> params) throws RemoveException;
|
||||
|
||||
/**
|
||||
* 修改用户定位
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void update(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
UserLocationDTO get(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
UserLocationBO getBO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
UserLocationPO getPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 用户定位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<UserLocationDTO> list(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 用户定位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<UserLocationBO> listBO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 用户定位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<UserLocationPO> listPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 用户定位统计
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
Integer count(Map<String, Object> params) throws SearchException;
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package ink.wgink.module.map.pojo.bos.userlocation;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: UserLocationBO
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
public class UserLocationBO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2436889054050643503L;
|
||||
private String userLocationId;
|
||||
private String userLng;
|
||||
private String userLat;
|
||||
private Integer isOverstep;
|
||||
private String userUsername;
|
||||
private String userName;
|
||||
private String creator;
|
||||
private String gmtCreate;
|
||||
private Integer isDelete;
|
||||
|
||||
public String getUserLocationId() {
|
||||
return userLocationId == null ? "" : userLocationId.trim();
|
||||
}
|
||||
|
||||
public void setUserLocationId(String userLocationId) {
|
||||
this.userLocationId = userLocationId;
|
||||
}
|
||||
|
||||
public String getUserLng() {
|
||||
return userLng == null ? "" : userLng.trim();
|
||||
}
|
||||
|
||||
public void setUserLng(String userLng) {
|
||||
this.userLng = userLng;
|
||||
}
|
||||
|
||||
public String getUserLat() {
|
||||
return userLat == null ? "" : userLat.trim();
|
||||
}
|
||||
|
||||
public void setUserLat(String userLat) {
|
||||
this.userLat = userLat;
|
||||
}
|
||||
|
||||
public Integer getIsOverstep() {
|
||||
return isOverstep == null ? 0 : isOverstep;
|
||||
}
|
||||
|
||||
public void setIsOverstep(Integer isOverstep) {
|
||||
this.isOverstep = isOverstep;
|
||||
}
|
||||
|
||||
public String getUserUsername() {
|
||||
return userUsername == null ? "" : userUsername.trim();
|
||||
}
|
||||
|
||||
public void setUserUsername(String userUsername) {
|
||||
this.userUsername = userUsername;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName == null ? "" : userName.trim();
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package ink.wgink.module.map.pojo.dtos.userlocation;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: UserLocationDTO
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class UserLocationDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4565373502011728209L;
|
||||
@ApiModelProperty(name = "userLocationId", value = "主键")
|
||||
private String userLocationId;
|
||||
@ApiModelProperty(name = "userLng", value = "用户经度")
|
||||
private String userLng;
|
||||
@ApiModelProperty(name = "userLat", value = "用户精度")
|
||||
private String userLat;
|
||||
@ApiModelProperty(name = "isOverstep", value = "是否越界")
|
||||
private Integer isOverstep;
|
||||
@ApiModelProperty(name = "userUsername", value = "用户名")
|
||||
private String userUsername;
|
||||
@ApiModelProperty(name = "userName", value = "昵称")
|
||||
private String userName;
|
||||
@ApiModelProperty(name = "creator", value = "创建人")
|
||||
private String creator;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
|
||||
private String gmtCreate;
|
||||
|
||||
public String getUserLocationId() {
|
||||
return userLocationId == null ? "" : userLocationId.trim();
|
||||
}
|
||||
|
||||
public void setUserLocationId(String userLocationId) {
|
||||
this.userLocationId = userLocationId;
|
||||
}
|
||||
|
||||
public String getUserLng() {
|
||||
return userLng == null ? "" : userLng.trim();
|
||||
}
|
||||
|
||||
public void setUserLng(String userLng) {
|
||||
this.userLng = userLng;
|
||||
}
|
||||
|
||||
public String getUserLat() {
|
||||
return userLat == null ? "" : userLat.trim();
|
||||
}
|
||||
|
||||
public void setUserLat(String userLat) {
|
||||
this.userLat = userLat;
|
||||
}
|
||||
|
||||
public Integer getIsOverstep() {
|
||||
return isOverstep == null ? 0 : isOverstep;
|
||||
}
|
||||
|
||||
public void setIsOverstep(Integer isOverstep) {
|
||||
this.isOverstep = isOverstep;
|
||||
}
|
||||
|
||||
public String getUserUsername() {
|
||||
return userUsername == null ? "" : userUsername.trim();
|
||||
}
|
||||
|
||||
public void setUserUsername(String userUsername) {
|
||||
this.userUsername = userUsername;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName == null ? "" : userName.trim();
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package ink.wgink.module.map.pojo.pos.userlocation;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: UserLocationPO
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
public class UserLocationPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2017142466144325446L;
|
||||
private String userLocationId;
|
||||
private String userLng;
|
||||
private String userLat;
|
||||
private Integer isOverstep;
|
||||
private String userUsername;
|
||||
private String userName;
|
||||
private String creator;
|
||||
private String gmtCreate;
|
||||
private Integer isDelete;
|
||||
|
||||
public String getUserLocationId() {
|
||||
return userLocationId == null ? "" : userLocationId.trim();
|
||||
}
|
||||
|
||||
public void setUserLocationId(String userLocationId) {
|
||||
this.userLocationId = userLocationId;
|
||||
}
|
||||
|
||||
public String getUserLng() {
|
||||
return userLng == null ? "" : userLng.trim();
|
||||
}
|
||||
|
||||
public void setUserLng(String userLng) {
|
||||
this.userLng = userLng;
|
||||
}
|
||||
|
||||
public String getUserLat() {
|
||||
return userLat == null ? "" : userLat.trim();
|
||||
}
|
||||
|
||||
public void setUserLat(String userLat) {
|
||||
this.userLat = userLat;
|
||||
}
|
||||
|
||||
public String getUserUsername() {
|
||||
return userUsername == null ? "" : userUsername.trim();
|
||||
}
|
||||
|
||||
public void setUserUsername(String userUsername) {
|
||||
this.userUsername = userUsername;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName == null ? "" : userName.trim();
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Integer getIsOverstep() {
|
||||
return isOverstep == null ? 0 : isOverstep;
|
||||
}
|
||||
|
||||
public void setIsOverstep(Integer isOverstep) {
|
||||
this.isOverstep = isOverstep;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete == null ? 0 : isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package ink.wgink.module.map.pojo.vos.userlocation;
|
||||
|
||||
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||
import ink.wgink.annotation.CheckNumberAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: UserLocationVO
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class UserLocationVO {
|
||||
|
||||
@CheckEmptyAnnotation(name = "用户经度")
|
||||
private String userLng;
|
||||
@CheckEmptyAnnotation(name = "用户维度")
|
||||
private String userLat;
|
||||
@CheckNumberAnnotation(name = "是否越界")
|
||||
private Integer isOverstep;
|
||||
@CheckEmptyAnnotation(name = "创建人")
|
||||
private String creator;
|
||||
@CheckEmptyAnnotation(name = "用户名")
|
||||
private String userUsername;
|
||||
@CheckEmptyAnnotation(name = "昵称")
|
||||
private String userName;
|
||||
private String gmtCreate;
|
||||
|
||||
public String getUserLng() {
|
||||
return userLng == null ? "" : userLng.trim();
|
||||
}
|
||||
|
||||
public void setUserLng(String userLng) {
|
||||
this.userLng = userLng;
|
||||
}
|
||||
|
||||
public String getUserLat() {
|
||||
return userLat == null ? "" : userLat.trim();
|
||||
}
|
||||
|
||||
public void setUserLat(String userLat) {
|
||||
this.userLat = userLat;
|
||||
}
|
||||
|
||||
public Integer getIsOverstep() {
|
||||
return isOverstep == null ? 0 : isOverstep;
|
||||
}
|
||||
|
||||
public void setIsOverstep(Integer isOverstep) {
|
||||
this.isOverstep = isOverstep;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getUserUsername() {
|
||||
return userUsername == null ? "" : userUsername.trim();
|
||||
}
|
||||
|
||||
public void setUserUsername(String userUsername) {
|
||||
this.userUsername = userUsername;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName == null ? "" : userName.trim();
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
package ink.wgink.module.map.service.userlocation;
|
||||
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO;
|
||||
import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO;
|
||||
import ink.wgink.module.map.pojo.bos.userlocation.UserLocationBO;
|
||||
import ink.wgink.module.map.pojo.pos.userlocation.UserLocationPO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IUserLocationService
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
public interface IUserLocationService {
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户定位
|
||||
*
|
||||
* @param userId
|
||||
* @param userLocationVO
|
||||
* @return
|
||||
*/
|
||||
void save(String userId, UserLocationVO userLocationVO);
|
||||
|
||||
/**
|
||||
* 新增用户定位
|
||||
*
|
||||
* @param userId
|
||||
* @param userLocationVO
|
||||
* @return userLocationId
|
||||
*/
|
||||
String saveReturnId(String userId, UserLocationVO userLocationVO);
|
||||
|
||||
|
||||
/**
|
||||
* 删除用户定位
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(List<String> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 删除用户定位
|
||||
*
|
||||
* @param token
|
||||
* @param ids id列表
|
||||
* @return
|
||||
*/
|
||||
void remove(String token, List<String> ids);
|
||||
|
||||
/**
|
||||
* 删除用户定位(物理删除)
|
||||
*
|
||||
* @param ids id列表
|
||||
*/
|
||||
void delete(List<String> ids);
|
||||
|
||||
/**
|
||||
* 修改用户定位
|
||||
*
|
||||
* @param userLocationId
|
||||
* @param userLocationVO
|
||||
* @return
|
||||
*/
|
||||
void update(String userLocationId, UserLocationVO userLocationVO);
|
||||
|
||||
/**
|
||||
* 修改用户定位
|
||||
*
|
||||
* @param token
|
||||
* @param userLocationId
|
||||
* @param userLocationVO
|
||||
* @return
|
||||
*/
|
||||
void update(String token, String userLocationId, UserLocationVO userLocationVO);
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param params 参数Map
|
||||
* @return
|
||||
*/
|
||||
UserLocationDTO get(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param userLocationId
|
||||
* @return
|
||||
*/
|
||||
UserLocationDTO get(String userLocationId);
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param params 参数Map
|
||||
* @return
|
||||
*/
|
||||
UserLocationBO getBO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param userLocationId
|
||||
* @return
|
||||
*/
|
||||
UserLocationBO getBO(String userLocationId);
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param params 参数Map
|
||||
* @return
|
||||
*/
|
||||
UserLocationPO getPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 用户定位详情
|
||||
*
|
||||
* @param userLocationId
|
||||
* @return
|
||||
*/
|
||||
UserLocationPO getPO(String userLocationId);
|
||||
|
||||
/**
|
||||
* 用户定位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<UserLocationDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 用户定位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<UserLocationBO> listBO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 用户定位列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<UserLocationPO> listPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 用户定位分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<UserLocationDTO>> listPage(ListPage page);
|
||||
|
||||
/**
|
||||
* 用户定位统计
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Integer count(Map<String, Object> params);
|
||||
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
package ink.wgink.module.map.service.userlocation.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.module.map.dao.userlocation.IUserLocationDao;
|
||||
import ink.wgink.module.map.pojo.bos.userlocation.UserLocationBO;
|
||||
import ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO;
|
||||
import ink.wgink.module.map.pojo.pos.userlocation.UserLocationPO;
|
||||
import ink.wgink.module.map.pojo.vos.userlocation.UserLocationVO;
|
||||
import ink.wgink.module.map.service.userlocation.IUserLocationService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: UserLocationServiceImpl
|
||||
* @Description: 用户定位
|
||||
* @Author: CodeFactory
|
||||
* @Date: 2021-10-29 15:37:01
|
||||
* @Version: 3.0
|
||||
**/
|
||||
@Service
|
||||
public class UserLocationServiceImpl extends DefaultBaseService implements IUserLocationService {
|
||||
|
||||
@Autowired
|
||||
private IUserLocationDao userLocationDao;
|
||||
|
||||
@Override
|
||||
public void save(String userId, UserLocationVO userLocationVO) {
|
||||
saveReturnId(userId, userLocationVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String saveReturnId(String userId, UserLocationVO userLocationVO) {
|
||||
String userLocationId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(userLocationVO);
|
||||
params.put("userLocationId", userLocationId);
|
||||
params.put("isDelete", 0);
|
||||
userLocationDao.save(params);
|
||||
return userLocationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(List<String> ids) {
|
||||
remove(null, ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(String token, List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("userLocationIds", ids);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setUpdateInfo(params);
|
||||
} else {
|
||||
setAppUpdateInfo(token, params);
|
||||
}
|
||||
userLocationDao.remove(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(List<String> ids) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("userLocationIds", ids);
|
||||
userLocationDao.delete(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String userLocationId, UserLocationVO userLocationVO) {
|
||||
update(null, userLocationId, userLocationVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String token, String userLocationId, UserLocationVO userLocationVO) {
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(userLocationVO);
|
||||
params.put("userLocationId", userLocationId);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
setUpdateInfo(params);
|
||||
} else {
|
||||
setAppUpdateInfo(token, params);
|
||||
}
|
||||
userLocationDao.update(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLocationDTO get(Map<String, Object> params) {
|
||||
return userLocationDao.get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLocationDTO get(String userLocationId) {
|
||||
Map<String, Object> params = super.getHashMap(2);
|
||||
params.put("userLocationId", userLocationId);
|
||||
return get(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLocationBO getBO(Map<String, Object> params) {
|
||||
return userLocationDao.getBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLocationBO getBO(String userLocationId) {
|
||||
Map<String, Object> params = super.getHashMap(2);
|
||||
params.put("userLocationId", userLocationId);
|
||||
return getBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLocationPO getPO(Map<String, Object> params) {
|
||||
return userLocationDao.getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLocationPO getPO(String userLocationId) {
|
||||
Map<String, Object> params = super.getHashMap(2);
|
||||
params.put("userLocationId", userLocationId);
|
||||
return getPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserLocationDTO> list(Map<String, Object> params) {
|
||||
return userLocationDao.list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserLocationBO> listBO(Map<String, Object> params) {
|
||||
return userLocationDao.listBO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserLocationPO> listPO(Map<String, Object> params) {
|
||||
return userLocationDao.listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<UserLocationDTO>> listPage(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<UserLocationDTO> userLocationDTOs = list(page.getParams());
|
||||
PageInfo<UserLocationDTO> pageInfo = new PageInfo<>(userLocationDTOs);
|
||||
return new SuccessResultList<>(userLocationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer count(Map<String, Object> params) {
|
||||
Integer count = userLocationDao.count(params);
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,315 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="ink.wgink.module.map.dao.userlocation.IUserLocationDao">
|
||||
|
||||
<cache/>
|
||||
|
||||
<resultMap id="userLocationDTO" type="ink.wgink.module.map.pojo.dtos.userlocation.UserLocationDTO">
|
||||
<result column="user_location_id" property="userLocationId"/>
|
||||
<result column="user_lng" property="userLng"/>
|
||||
<result column="user_lat" property="userLat"/>
|
||||
<result column="is_overstep" property="isOverstep"/>
|
||||
<result column="user_username" property="userUsername"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="userLocationBO" type="ink.wgink.module.map.pojo.bos.userlocation.UserLocationBO">
|
||||
<result column="user_location_id" property="userLocationId"/>
|
||||
<result column="user_lng" property="userLng"/>
|
||||
<result column="user_lat" property="userLat"/>
|
||||
<result column="is_overstep" property="isOverstep"/>
|
||||
<result column="user_username" property="userUsername"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="userLocationPO" type="ink.wgink.module.map.pojo.pos.userlocation.UserLocationPO">
|
||||
<result column="user_location_id" property="userLocationId"/>
|
||||
<result column="user_lng" property="userLng"/>
|
||||
<result column="user_lat" property="userLat"/>
|
||||
<result column="is_overstep" property="isOverstep"/>
|
||||
<result column="user_username" property="userUsername"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 新增用户定位 -->
|
||||
<insert id="save" parameterType="map" flushCache="true">
|
||||
INSERT INTO map_user_location(
|
||||
user_location_id,
|
||||
user_lng,
|
||||
user_lat,
|
||||
is_overstep,
|
||||
creator,
|
||||
user_username,
|
||||
user_name,
|
||||
gmt_create,
|
||||
is_delete
|
||||
) VALUES(
|
||||
#{userLocationId},
|
||||
#{userLng},
|
||||
#{userLat},
|
||||
#{isOverstep},
|
||||
#{creator},
|
||||
#{userUsername},
|
||||
#{userName},
|
||||
#{gmtCreate},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除用户定位 -->
|
||||
<update id="remove" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
map_user_location
|
||||
SET
|
||||
is_delete = 1
|
||||
WHERE
|
||||
user-location_id IN
|
||||
<foreach collection="userLocationIds" index="index" open="(" separator="," close=")">
|
||||
#{userLocationIds[${index}]}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 删除用户定位(物理) -->
|
||||
<update id="delete" parameterType="map" flushCache="true">
|
||||
DELETE FROM
|
||||
map_user_location
|
||||
WHERE
|
||||
user_location_id IN
|
||||
<foreach collection="userLocationIds" index="index" open="(" separator="," close=")">
|
||||
#{userLocationIds[${index}]}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 修改用户定位 -->
|
||||
<update id="update" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
map_user_location
|
||||
SET
|
||||
<if test="userLng != null and userLng != ''">
|
||||
user_lng = #{userLng},
|
||||
</if>
|
||||
<if test="userLat != null and userLat != ''">
|
||||
user_lat = #{userLat},
|
||||
</if>
|
||||
<if test="isOverstep != null">
|
||||
is_overstep = #{isOverstep},
|
||||
</if>
|
||||
user_location_id = user_location_id
|
||||
WHERE
|
||||
user_location_id = #{userLocationId}
|
||||
</update>
|
||||
|
||||
<!-- 用户定位详情 -->
|
||||
<select id="get" parameterType="map" resultMap="userLocationDTO" useCache="false">
|
||||
SELECT
|
||||
t1.user_lng,
|
||||
t1.user_lat,
|
||||
t1.is_overstep,
|
||||
t1.creator,
|
||||
t1.user_username,
|
||||
t1.user_name,
|
||||
t1.user_location_id
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="userLocationId != null and userLocationId != ''">
|
||||
AND
|
||||
t1.user_location_id = #{userLocationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 用户定位详情 -->
|
||||
<select id="getBO" parameterType="map" resultMap="userLocationBO" useCache="false">
|
||||
SELECT
|
||||
t1.user_location_id,
|
||||
t1.user_lng,
|
||||
t1.user_lat,
|
||||
t1.is_overstep,
|
||||
t1.creator,
|
||||
t1.user_username,
|
||||
t1.user_name,
|
||||
t1.gmt_create,
|
||||
t1.is_delete
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="userLocationId != null and userLocationId != ''">
|
||||
AND
|
||||
t1.user_location_id = #{userLocationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 用户定位详情 -->
|
||||
<select id="getPO" parameterType="map" resultMap="userLocationPO" useCache="false">
|
||||
SELECT
|
||||
t1.user_location_id,
|
||||
t1.user_lng,
|
||||
t1.user_lat,
|
||||
t1.is_overstep,
|
||||
t1.creator,
|
||||
t1.user_username,
|
||||
t1.user_name,
|
||||
t1.gmt_create,
|
||||
t1.is_delete
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="userLocationId != null and userLocationId != ''">
|
||||
AND
|
||||
t1.user_location_id = #{userLocationId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 用户定位列表 -->
|
||||
<select id="list" parameterType="map" resultMap="userLocationDTO" useCache="true">
|
||||
SELECT
|
||||
t1.user_location_id,
|
||||
t1.user_lng,
|
||||
t1.user_lat,
|
||||
t1.is_overstep,
|
||||
t1.creator,
|
||||
t1.user_username,
|
||||
t1.user_name,
|
||||
t1.gmt_create
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
t1.creator = #{userId}
|
||||
</if>
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
t1.creator IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userLocationIds != null and userLocationIds.size > 0">
|
||||
AND
|
||||
t1.user_location_id IN
|
||||
<foreach collection="userLocationIds" index="index" open="(" separator="," close=")">
|
||||
#{userLocationIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 用户定位列表 -->
|
||||
<select id="listBO" parameterType="map" resultMap="userLocationBO" useCache="true">
|
||||
SELECT
|
||||
t1.user_location_id,
|
||||
t1.user_lng,
|
||||
t1.user_lat,
|
||||
t1.is_overstep,
|
||||
t1.creator,
|
||||
t1.user_username,
|
||||
t1.user_name,
|
||||
t1.gmt_create,
|
||||
t1.is_delete
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
t1.creator = #{userId}
|
||||
</if>
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
t1.creator IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userLocationIds != null and userLocationIds.size > 0">
|
||||
AND
|
||||
t1.user_location_id IN
|
||||
<foreach collection="userLocationIds" index="index" open="(" separator="," close=")">
|
||||
#{userLocationIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 用户定位列表 -->
|
||||
<select id="listPO" parameterType="map" resultMap="userLocationPO" useCache="true">
|
||||
SELECT
|
||||
t1.user_location_id,
|
||||
t1.user_lng,
|
||||
t1.user_lat,
|
||||
t1.is_overstep,
|
||||
t1.creator,
|
||||
t1.user_username,
|
||||
t1.user_name,
|
||||
t1.gmt_create,
|
||||
t1.is_delete
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND
|
||||
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
t1.creator = #{userId}
|
||||
</if>
|
||||
<if test="userIds != null and userIds.size > 0">
|
||||
AND
|
||||
t1.creator IN
|
||||
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||
#{userIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userLocationIds != null and userLocationIds.size > 0">
|
||||
AND
|
||||
t1.user_location_id IN
|
||||
<foreach collection="userLocationIds" index="index" open="(" separator="," close=")">
|
||||
#{userLocationIds[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 用户定位统计 -->
|
||||
<select id="count" parameterType="map" resultType="Integer" useCache="true">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
map_user_location t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
272
module-map/src/main/resources/templates/user-location/list.html
Normal file
272
module-map/src/main/resources/templates/user-location/list.html
Normal file
@ -0,0 +1,272 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入关键字">
|
||||
</div>
|
||||
新增时间
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item search-item-width-100" placeholder="结束时间" readonly>
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
<!-- 表头按钮组 -->
|
||||
<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>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/user-location/listpage';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 90,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
toolbar: '#headerToolBar',
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'userLocationId', width: 180, title: '主键', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'userLng', width: 180, title: '用户经度', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'userLat', width: 180, title: '用户精度', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isOverstep', width: 180, title: '是否越界', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'creator', width: 180, title: '创建人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
where: {
|
||||
keywords: $('#keywords').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
});
|
||||
}
|
||||
// 初始化日期
|
||||
function initDate() {
|
||||
// 日期选择
|
||||
laydate.render({
|
||||
elem: '#startTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime',
|
||||
format: 'yyyy-MM-dd'
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function removeData(ids) {
|
||||
top.dialog.msg(top.dataMessage.delete, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function (index) {
|
||||
top.dialog.close(index);
|
||||
var layIndex;
|
||||
top.restAjax.delete(top.restAjax.path('api/user-location/remove/{ids}', [ids]), {}, null, function (code, data) {
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
|
||||
reloadTable();
|
||||
}, function (code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
initDate();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
// 事件 - 增删改
|
||||
table.on('toolbar(dataTable)', function(obj) {
|
||||
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(checkDatas.length === 0) {
|
||||
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||
} else {
|
||||
var ids = '';
|
||||
for(var i = 0, item; item = checkDatas[i++];) {
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item['userLocationId'];
|
||||
}
|
||||
removeData(ids);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
117
module-map/src/main/resources/templates/user-location/save.html
Normal file
117
module-map/src/main/resources/templates/user-location/save.html
Normal file
@ -0,0 +1,117 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>新增内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户经度</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="userLng" name="userLng" class="layui-input" value="" placeholder="请输入用户经度" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户精度</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="userLat" name="userLat" class="layui-input" value="" placeholder="请输入用户精度" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否越界</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="isOverstep" name="isOverstep" class="layui-input" value="0" placeholder="请输入是否越界" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/user-location/save', []), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,134 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
|
||||
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
|
||||
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户经度</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="userLng" name="userLng" class="layui-input" value="" placeholder="请输入用户经度" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户精度</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="userLat" name="userLat" class="layui-input" value="" placeholder="请输入用户精度" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否越界</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="isOverstep" name="isOverstep" class="layui-input" value="0" placeholder="请输入是否越界" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
var laytpl = layui.laytpl;
|
||||
var laydate = layui.laydate;
|
||||
var userLocationId = top.restAjax.params(window.location.href).userLocationId;
|
||||
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/user-location/get/{userLocationId}', [userLocationId]), {}, null, function(code, data) {
|
||||
var dataFormData = {};
|
||||
for(var i in data) {
|
||||
dataFormData[i] = data[i] +'';
|
||||
}
|
||||
form.val('dataForm', dataFormData);
|
||||
form.render(null, 'dataForm');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put(top.restAjax.path('api/user-location/update/{userLocationId}', [userLocationId]), formData.field, null, function(code, data) {
|
||||
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||
time: 0,
|
||||
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||
shade: 0.3,
|
||||
yes: function(index) {
|
||||
top.dialog.close(index);
|
||||
window.location.reload();
|
||||
},
|
||||
btn2: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user