From d4050c6a00648d603f08b53476a821b657565efc Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Mon, 1 Nov 2021 11:25:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=BA=E5=91=98=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../userlocation/UserLocationController.java | 102 ++++++ .../UserLocationAppController.java | 121 +++++++ .../UserLocationResourceController.java | 109 ++++++ .../UserLocationRouteController.java | 42 +++ .../dao/userlocation/IUserLocationDao.java | 120 +++++++ .../pojo/bos/userlocation/UserLocationBO.java | 99 ++++++ .../dtos/userlocation/UserLocationDTO.java | 102 ++++++ .../pojo/pos/userlocation/UserLocationPO.java | 99 ++++++ .../pojo/vos/userlocation/UserLocationVO.java | 87 +++++ .../userlocation/IUserLocationService.java | 174 ++++++++++ .../impl/UserLocationServiceImpl.java | 157 +++++++++ .../user-location/user-location-mapper.xml | 315 ++++++++++++++++++ .../templates/user-location/list.html | 272 +++++++++++++++ .../templates/user-location/save.html | 117 +++++++ .../templates/user-location/update.html | 134 ++++++++ 15 files changed, 2050 insertions(+) create mode 100644 module-map/src/main/java/ink/wgink/module/map/controller/api/userlocation/UserLocationController.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/controller/app/api/userlocation/UserLocationAppController.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/controller/resource/userlocation/UserLocationResourceController.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/controller/route/userlocation/UserLocationRouteController.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/dao/userlocation/IUserLocationDao.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/pojo/bos/userlocation/UserLocationBO.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/pojo/dtos/userlocation/UserLocationDTO.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/pojo/pos/userlocation/UserLocationPO.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/pojo/vos/userlocation/UserLocationVO.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/service/userlocation/IUserLocationService.java create mode 100644 module-map/src/main/java/ink/wgink/module/map/service/userlocation/impl/UserLocationServiceImpl.java create mode 100644 module-map/src/main/resources/mybatis/mapper/user-location/user-location-mapper.xml create mode 100644 module-map/src/main/resources/templates/user-location/list.html create mode 100644 module-map/src/main/resources/templates/user-location/save.html create mode 100644 module-map/src/main/resources/templates/user-location/update.html diff --git a/module-map/src/main/java/ink/wgink/module/map/controller/api/userlocation/UserLocationController.java b/module-map/src/main/java/ink/wgink/module/map/controller/api/userlocation/UserLocationController.java new file mode 100644 index 00000000..792a87ce --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/controller/api/userlocation/UserLocationController.java @@ -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 list() { + Map 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> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return userLocationService.listPage(page); + } + + @ApiOperation(value = "用户定位统计", notes = "用户定位统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(userLocationService.count(params)); + } + +} \ No newline at end of file diff --git a/module-map/src/main/java/ink/wgink/module/map/controller/app/api/userlocation/UserLocationAppController.java b/module-map/src/main/java/ink/wgink/module/map/controller/app/api/userlocation/UserLocationAppController.java new file mode 100644 index 00000000..a45cca56 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/controller/app/api/userlocation/UserLocationAppController.java @@ -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 list(@RequestHeader("token") String token) { + Map 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> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return userLocationService.listPage(page); + } + + @ApiOperation(value = "用户定位统计", notes = "用户定位统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(userLocationService.count(params)); + } + +} \ No newline at end of file diff --git a/module-map/src/main/java/ink/wgink/module/map/controller/resource/userlocation/UserLocationResourceController.java b/module-map/src/main/java/ink/wgink/module/map/controller/resource/userlocation/UserLocationResourceController.java new file mode 100644 index 00000000..e9a18dbb --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/controller/resource/userlocation/UserLocationResourceController.java @@ -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 list() { + Map 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> listPage(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return userLocationService.listPage(page); + } + + @ApiOperation(value = "用户定位统计", notes = "用户定位统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(userLocationService.count(params)); + } + +} \ No newline at end of file diff --git a/module-map/src/main/java/ink/wgink/module/map/controller/route/userlocation/UserLocationRouteController.java b/module-map/src/main/java/ink/wgink/module/map/controller/route/userlocation/UserLocationRouteController.java new file mode 100644 index 00000000..cbeb62e4 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/controller/route/userlocation/UserLocationRouteController.java @@ -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"); + } + +} \ No newline at end of file diff --git a/module-map/src/main/java/ink/wgink/module/map/dao/userlocation/IUserLocationDao.java b/module-map/src/main/java/ink/wgink/module/map/dao/userlocation/IUserLocationDao.java new file mode 100644 index 00000000..387914b3 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/dao/userlocation/IUserLocationDao.java @@ -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 params) throws SaveException; + + /** + * 删除用户定位 + * + * @param params + * @throws RemoveException + */ + void remove(Map params) throws RemoveException; + + /** + * 删除用户定位(物理) + * + * @param params + * @throws RemoveException + */ + void delete(Map params) throws RemoveException; + + /** + * 修改用户定位 + * + * @param params + * @throws UpdateException + */ + void update(Map params) throws UpdateException; + + /** + * 用户定位详情 + * + * @param params + * @return + * @throws SearchException + */ + UserLocationDTO get(Map params) throws SearchException; + + /** + * 用户定位详情 + * + * @param params + * @return + * @throws SearchException + */ + UserLocationBO getBO(Map params) throws SearchException; + + /** + * 用户定位详情 + * + * @param params + * @return + * @throws SearchException + */ + UserLocationPO getPO(Map params) throws SearchException; + + /** + * 用户定位列表 + * + * @param params + * @return + * @throws SearchException + */ + List list(Map params) throws SearchException; + + /** + * 用户定位列表 + * + * @param params + * @return + * @throws SearchException + */ + List listBO(Map params) throws SearchException; + + /** + * 用户定位列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; + + /** + * 用户定位统计 + * + * @param params + * @return + * @throws SearchException + */ + Integer count(Map params) throws SearchException; + +} \ No newline at end of file diff --git a/module-map/src/main/java/ink/wgink/module/map/pojo/bos/userlocation/UserLocationBO.java b/module-map/src/main/java/ink/wgink/module/map/pojo/bos/userlocation/UserLocationBO.java new file mode 100644 index 00000000..c8f7aac2 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/pojo/bos/userlocation/UserLocationBO.java @@ -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; + } + + +} diff --git a/module-map/src/main/java/ink/wgink/module/map/pojo/dtos/userlocation/UserLocationDTO.java b/module-map/src/main/java/ink/wgink/module/map/pojo/dtos/userlocation/UserLocationDTO.java new file mode 100644 index 00000000..24927386 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/pojo/dtos/userlocation/UserLocationDTO.java @@ -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; + } + + +} diff --git a/module-map/src/main/java/ink/wgink/module/map/pojo/pos/userlocation/UserLocationPO.java b/module-map/src/main/java/ink/wgink/module/map/pojo/pos/userlocation/UserLocationPO.java new file mode 100644 index 00000000..87c8d162 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/pojo/pos/userlocation/UserLocationPO.java @@ -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; + } + + +} diff --git a/module-map/src/main/java/ink/wgink/module/map/pojo/vos/userlocation/UserLocationVO.java b/module-map/src/main/java/ink/wgink/module/map/pojo/vos/userlocation/UserLocationVO.java new file mode 100644 index 00000000..ae12d602 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/pojo/vos/userlocation/UserLocationVO.java @@ -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; + } +} diff --git a/module-map/src/main/java/ink/wgink/module/map/service/userlocation/IUserLocationService.java b/module-map/src/main/java/ink/wgink/module/map/service/userlocation/IUserLocationService.java new file mode 100644 index 00000000..ac50cd4a --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/service/userlocation/IUserLocationService.java @@ -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 ids); + + + /** + * 删除用户定位 + * + * @param token + * @param ids id列表 + * @return + */ + void remove(String token, List ids); + + /** + * 删除用户定位(物理删除) + * + * @param ids id列表 + */ + void delete(List 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 params); + + /** + * 用户定位详情 + * + * @param userLocationId + * @return + */ + UserLocationDTO get(String userLocationId); + + /** + * 用户定位详情 + * + * @param params 参数Map + * @return + */ + UserLocationBO getBO(Map params); + + /** + * 用户定位详情 + * + * @param userLocationId + * @return + */ + UserLocationBO getBO(String userLocationId); + + /** + * 用户定位详情 + * + * @param params 参数Map + * @return + */ + UserLocationPO getPO(Map params); + + /** + * 用户定位详情 + * + * @param userLocationId + * @return + */ + UserLocationPO getPO(String userLocationId); + + /** + * 用户定位列表 + * + * @param params + * @return + */ + List list(Map params); + + /** + * 用户定位列表 + * + * @param params + * @return + */ + List listBO(Map params); + + /** + * 用户定位列表 + * + * @param params + * @return + */ + List listPO(Map params); + + /** + * 用户定位分页列表 + * + * @param page + * @return + */ + SuccessResultList> listPage(ListPage page); + + /** + * 用户定位统计 + * + * @param params + * @return + */ + Integer count(Map params); + +} \ No newline at end of file diff --git a/module-map/src/main/java/ink/wgink/module/map/service/userlocation/impl/UserLocationServiceImpl.java b/module-map/src/main/java/ink/wgink/module/map/service/userlocation/impl/UserLocationServiceImpl.java new file mode 100644 index 00000000..84e662c0 --- /dev/null +++ b/module-map/src/main/java/ink/wgink/module/map/service/userlocation/impl/UserLocationServiceImpl.java @@ -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 params = HashMapUtil.beanToMap(userLocationVO); + params.put("userLocationId", userLocationId); + params.put("isDelete", 0); + userLocationDao.save(params); + return userLocationId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map 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 ids) { + Map 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 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 params) { + return userLocationDao.get(params); + } + + @Override + public UserLocationDTO get(String userLocationId) { + Map params = super.getHashMap(2); + params.put("userLocationId", userLocationId); + return get(params); + } + + @Override + public UserLocationBO getBO(Map params) { + return userLocationDao.getBO(params); + } + + @Override + public UserLocationBO getBO(String userLocationId) { + Map params = super.getHashMap(2); + params.put("userLocationId", userLocationId); + return getBO(params); + } + + @Override + public UserLocationPO getPO(Map params) { + return userLocationDao.getPO(params); + } + + @Override + public UserLocationPO getPO(String userLocationId) { + Map params = super.getHashMap(2); + params.put("userLocationId", userLocationId); + return getPO(params); + } + + @Override + public List list(Map params) { + return userLocationDao.list(params); + } + + @Override + public List listBO(Map params) { + return userLocationDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return userLocationDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List userLocationDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(userLocationDTOs); + return new SuccessResultList<>(userLocationDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = userLocationDao.count(params); + return count == null ? 0 : count; + } + +} \ No newline at end of file diff --git a/module-map/src/main/resources/mybatis/mapper/user-location/user-location-mapper.xml b/module-map/src/main/resources/mybatis/mapper/user-location/user-location-mapper.xml new file mode 100644 index 00000000..b2baa549 --- /dev/null +++ b/module-map/src/main/resources/mybatis/mapper/user-location/user-location-mapper.xml @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} + ) + + + + + UPDATE + map_user_location + SET + is_delete = 1 + WHERE + user-location_id IN + + #{userLocationIds[${index}]} + + + + + + DELETE FROM + map_user_location + WHERE + user_location_id IN + + #{userLocationIds[${index}]} + + + + + + UPDATE + map_user_location + SET + + user_lng = #{userLng}, + + + user_lat = #{userLat}, + + + is_overstep = #{isOverstep}, + + user_location_id = user_location_id + WHERE + user_location_id = #{userLocationId} + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/module-map/src/main/resources/templates/user-location/list.html b/module-map/src/main/resources/templates/user-location/list.html new file mode 100644 index 00000000..0e97d233 --- /dev/null +++ b/module-map/src/main/resources/templates/user-location/list.html @@ -0,0 +1,272 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+ 新增时间 +
+ +
+
+ +
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/module-map/src/main/resources/templates/user-location/save.html b/module-map/src/main/resources/templates/user-location/save.html new file mode 100644 index 00000000..f0564048 --- /dev/null +++ b/module-map/src/main/resources/templates/user-location/save.html @@ -0,0 +1,117 @@ + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/module-map/src/main/resources/templates/user-location/update.html b/module-map/src/main/resources/templates/user-location/update.html new file mode 100644 index 00000000..73f343f5 --- /dev/null +++ b/module-map/src/main/resources/templates/user-location/update.html @@ -0,0 +1,134 @@ + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ + + + \ No newline at end of file