From 97941cb48901f5553af20127e34f47ca085316eb Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Wed, 3 Nov 2021 21:51:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=9A=E5=8A=A1=E4=B8=8E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/business/BusinessController.java | 111 +++++++++++ .../businessuser/BusinessUserController.java | 111 +++++++++++ .../api/business/BusinessAppController.java | 121 +++++++++++ .../BusinessUserAppController.java | 121 +++++++++++ .../business/BusinessResourceController.java | 121 +++++++++++ .../BusinessUserResourceController.java | 121 +++++++++++ .../business/BusinessRouteController.java | 42 ++++ .../BusinessUserRouteController.java | 42 ++++ .../usercenter/dao/business/IBusinessDao.java | 121 +++++++++++ .../dao/businessuser/IBusinessUserDao.java | 121 +++++++++++ .../pojo/bos/business/BusinessBO.java | 96 +++++++++ .../pojo/bos/businessuser/BusinessUserBO.java | 42 ++++ .../pojo/dtos/business/BusinessDTO.java | 69 +++++++ .../dtos/businessuser/BusinessUserDTO.java | 49 +++++ .../pojo/pos/business/BusinessPO.java | 96 +++++++++ .../pojo/pos/businessuser/BusinessUserPO.java | 42 ++++ .../pojo/vos/business/BusinessVO.java | 51 +++++ .../pojo/vos/businessuser/BusinessUserVO.java | 41 ++++ .../service/business/IBusinessService.java | 188 ++++++++++++++++++ .../business/impl/BusinessServiceImpl.java | 171 ++++++++++++++++ .../businessuser/IBusinessUserService.java | 188 ++++++++++++++++++ .../impl/BusinessUserServiceImpl.java | 171 ++++++++++++++++ 22 files changed, 2236 insertions(+) create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/api/business/BusinessController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/api/businessuser/BusinessUserController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/app/api/business/BusinessAppController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/app/api/businessuser/BusinessUserAppController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/resource/business/BusinessResourceController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/resource/businessuser/BusinessUserResourceController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/route/business/BusinessRouteController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/route/businessuser/BusinessUserRouteController.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/dao/business/IBusinessDao.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/dao/businessuser/IBusinessUserDao.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/bos/business/BusinessBO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/bos/businessuser/BusinessUserBO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/dtos/business/BusinessDTO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/dtos/businessuser/BusinessUserDTO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/pos/business/BusinessPO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/pos/businessuser/BusinessUserPO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/vos/business/BusinessVO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/pojo/vos/businessuser/BusinessUserVO.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/service/business/IBusinessService.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/service/business/impl/BusinessServiceImpl.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/service/businessuser/IBusinessUserService.java create mode 100644 src/main/java/cn/com/tenlion/usercenter/service/businessuser/impl/BusinessUserServiceImpl.java diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/api/business/BusinessController.java b/src/main/java/cn/com/tenlion/usercenter/controller/api/business/BusinessController.java new file mode 100644 index 0000000..be4d919 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/api/business/BusinessController.java @@ -0,0 +1,111 @@ +package cn.com.tenlion.usercenter.controller.api.business; + +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 cn.com.tenlion.usercenter.pojo.dtos.business.BusinessDTO; +import cn.com.tenlion.usercenter.pojo.vos.business.BusinessVO; +import cn.com.tenlion.usercenter.service.business.IBusinessService; +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: BusinessController + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "业务接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/business") +public class BusinessController extends DefaultBaseController { + + @Autowired + private IBusinessService businessService; + + @ApiOperation(value = "新增业务", notes = "新增业务接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody BusinessVO businessVO) { + businessService.save(businessVO); + return new SuccessResult(); + } + + @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) { + businessService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改业务", notes = "修改业务接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "businessId", value = "业务ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{businessId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("businessId") String businessId, @RequestBody BusinessVO businessVO) { + businessService.update(businessId, businessVO); + return new SuccessResult(); + } + + @ApiOperation(value = "业务详情", notes = "业务详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "businessId", value = "业务ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{businessId}") + public BusinessDTO get(@PathVariable("businessId") String businessId) { + return businessService.get(businessId); + } + + @ApiOperation(value = "业务列表", notes = "业务列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return businessService.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 businessService.listPage(page); + } + + @ApiOperation(value = "业务统计", notes = "业务统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(businessService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/api/businessuser/BusinessUserController.java b/src/main/java/cn/com/tenlion/usercenter/controller/api/businessuser/BusinessUserController.java new file mode 100644 index 0000000..3fb6d4e --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/api/businessuser/BusinessUserController.java @@ -0,0 +1,111 @@ +package cn.com.tenlion.usercenter.controller.api.businessuser; + +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 cn.com.tenlion.usercenter.pojo.dtos.businessuser.BusinessUserDTO; +import cn.com.tenlion.usercenter.pojo.vos.businessuser.BusinessUserVO; +import cn.com.tenlion.usercenter.service.businessuser.IBusinessUserService; +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: BusinessUserController + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "业务用户接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/business-user") +public class BusinessUserController extends DefaultBaseController { + + @Autowired + private IBusinessUserService businessUserService; + + @ApiOperation(value = "新增业务用户", notes = "新增业务用户接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody BusinessUserVO businessUserVO) { + businessUserService.save(businessUserVO); + return new SuccessResult(); + } + + @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) { + businessUserService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改业务用户", notes = "修改业务用户接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "businessUserId", value = "业务用户ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{businessUserId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("businessUserId") String businessUserId, @RequestBody BusinessUserVO businessUserVO) { + businessUserService.update(businessUserId, businessUserVO); + return new SuccessResult(); + } + + @ApiOperation(value = "业务用户详情", notes = "业务用户详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "businessUserId", value = "业务用户ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{businessUserId}") + public BusinessUserDTO get(@PathVariable("businessUserId") String businessUserId) { + return businessUserService.get(businessUserId); + } + + @ApiOperation(value = "业务用户列表", notes = "业务用户列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list() { + Map params = requestParams(); + return businessUserService.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 businessUserService.listPage(page); + } + + @ApiOperation(value = "业务用户统计", notes = "业务用户统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(businessUserService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/app/api/business/BusinessAppController.java b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/business/BusinessAppController.java new file mode 100644 index 0000000..47fa081 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/business/BusinessAppController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.usercenter.controller.app.api.business; + +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 cn.com.tenlion.usercenter.pojo.dtos.business.BusinessDTO; +import cn.com.tenlion.usercenter.pojo.vos.business.BusinessVO; +import cn.com.tenlion.usercenter.service.business.IBusinessService; +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: BusinessAppController + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "业务接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/business") +public class BusinessAppController extends DefaultBaseController { + + @Autowired + private IBusinessService businessService; + + @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 BusinessVO businessVO) { + businessService.save(token, businessVO); + 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) { + businessService.remove(token, Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改业务", notes = "修改业务接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "businessId", value = "业务ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updatebusiness/{businessId}") + @CheckRequestBodyAnnotation + public SuccessResult updateBusiness(@RequestHeader("token") String token, @PathVariable("businessId") String businessId, @RequestBody BusinessVO businessVO) { + businessService.update(token, businessId, businessVO); + return new SuccessResult(); + } + + @ApiOperation(value = "业务详情(通过ID)", notes = "业务详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "businessId", value = "业务ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{businessId}") + public BusinessDTO get(@RequestHeader("token") String token, @PathVariable("businessId") String businessId) { + return businessService.get(businessId); + } + + @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 businessService.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("listpage") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return businessService.listPage(page); + } + + @ApiOperation(value = "业务统计", notes = "业务统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(businessService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/app/api/businessuser/BusinessUserAppController.java b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/businessuser/BusinessUserAppController.java new file mode 100644 index 0000000..3ba01c9 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/businessuser/BusinessUserAppController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.usercenter.controller.app.api.businessuser; + +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 cn.com.tenlion.usercenter.pojo.dtos.businessuser.BusinessUserDTO; +import cn.com.tenlion.usercenter.pojo.vos.businessuser.BusinessUserVO; +import cn.com.tenlion.usercenter.service.businessuser.IBusinessUserService; +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: BusinessUserAppController + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "业务用户接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/business-user") +public class BusinessUserAppController extends DefaultBaseController { + + @Autowired + private IBusinessUserService businessUserService; + + @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 BusinessUserVO businessUserVO) { + businessUserService.save(token, businessUserVO); + 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) { + businessUserService.remove(token, Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改业务用户", notes = "修改业务用户接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "businessUserId", value = "业务用户ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updatebusinessuser/{businessUserId}") + @CheckRequestBodyAnnotation + public SuccessResult updateBusinessUser(@RequestHeader("token") String token, @PathVariable("businessUserId") String businessUserId, @RequestBody BusinessUserVO businessUserVO) { + businessUserService.update(token, businessUserId, businessUserVO); + return new SuccessResult(); + } + + @ApiOperation(value = "业务用户详情(通过ID)", notes = "业务用户详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "businessUserId", value = "业务用户ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{businessUserId}") + public BusinessUserDTO get(@RequestHeader("token") String token, @PathVariable("businessUserId") String businessUserId) { + return businessUserService.get(businessUserId); + } + + @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 businessUserService.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("listpage") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + page.setParams(params); + return businessUserService.listPage(page); + } + + @ApiOperation(value = "业务用户统计", notes = "业务用户统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(businessUserService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/resource/business/BusinessResourceController.java b/src/main/java/cn/com/tenlion/usercenter/controller/resource/business/BusinessResourceController.java new file mode 100644 index 0000000..9cbf5b1 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/resource/business/BusinessResourceController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.usercenter.controller.resource.business; + +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 cn.com.tenlion.usercenter.pojo.dtos.business.BusinessDTO; +import cn.com.tenlion.usercenter.pojo.vos.business.BusinessVO; +import cn.com.tenlion.usercenter.service.business.IBusinessService; +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: BusinessResourceController + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "业务接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/business") +public class BusinessResourceController extends DefaultBaseController { + + @Autowired + private IBusinessService businessService; + + @ApiOperation(value = "新增业务", notes = "新增业务接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody BusinessVO businessVO) { + businessService.save(businessVO); + return new SuccessResult(); + } + + @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) { + businessService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改业务", notes = "修改业务接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "businessId", value = "业务ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{businessId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("businessId") String businessId, @RequestBody BusinessVO businessVO) { + businessService.update(businessId, businessVO); + return new SuccessResult(); + } + + @ApiOperation(value = "业务详情", notes = "业务详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "businessId", value = "业务ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{businessId}") + public BusinessDTO get(@PathVariable("businessId") String businessId) { + return businessService.get(businessId); + } + + @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 businessService.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 businessService.listPage(page); + } + + @ApiOperation(value = "业务统计", notes = "业务统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(businessService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/resource/businessuser/BusinessUserResourceController.java b/src/main/java/cn/com/tenlion/usercenter/controller/resource/businessuser/BusinessUserResourceController.java new file mode 100644 index 0000000..1b5a303 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/resource/businessuser/BusinessUserResourceController.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.usercenter.controller.resource.businessuser; + +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 cn.com.tenlion.usercenter.pojo.dtos.businessuser.BusinessUserDTO; +import cn.com.tenlion.usercenter.pojo.vos.businessuser.BusinessUserVO; +import cn.com.tenlion.usercenter.service.businessuser.IBusinessUserService; +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: BusinessUserResourceController + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "业务用户接口") +@RestController +@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/business-user") +public class BusinessUserResourceController extends DefaultBaseController { + + @Autowired + private IBusinessUserService businessUserService; + + @ApiOperation(value = "新增业务用户", notes = "新增业务用户接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("save") + @CheckRequestBodyAnnotation + public SuccessResult save(@RequestBody BusinessUserVO businessUserVO) { + businessUserService.save(businessUserVO); + return new SuccessResult(); + } + + @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) { + businessUserService.remove(Arrays.asList(ids.split("\\_"))); + return new SuccessResult(); + } + + @ApiOperation(value = "修改业务用户", notes = "修改业务用户接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "businessUserId", value = "业务用户ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("update/{businessUserId}") + @CheckRequestBodyAnnotation + public SuccessResult update(@PathVariable("businessUserId") String businessUserId, @RequestBody BusinessUserVO businessUserVO) { + businessUserService.update(businessUserId, businessUserVO); + return new SuccessResult(); + } + + @ApiOperation(value = "业务用户详情", notes = "业务用户详情接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"), + @ApiImplicitParam(name = "businessUserId", value = "业务用户ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{businessUserId}") + public BusinessUserDTO get(@PathVariable("businessUserId") String businessUserId) { + return businessUserService.get(businessUserId); + } + + @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 businessUserService.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 businessUserService.listPage(page); + } + + @ApiOperation(value = "业务用户统计", notes = "业务用户统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("count") + SuccessResultData count() { + Map params = requestParams(); + return new SuccessResultData<>(businessUserService.count(params)); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/route/business/BusinessRouteController.java b/src/main/java/cn/com/tenlion/usercenter/controller/route/business/BusinessRouteController.java new file mode 100644 index 0000000..7a5f6e0 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/route/business/BusinessRouteController.java @@ -0,0 +1,42 @@ +package cn.com.tenlion.usercenter.controller.route.business; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import cn.com.tenlion.usercenter.service.business.IBusinessService; +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: BusinessController + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "业务路由") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/business") +public class BusinessRouteController extends DefaultBaseController { + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("business/save"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("business/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("business/list"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/route/businessuser/BusinessUserRouteController.java b/src/main/java/cn/com/tenlion/usercenter/controller/route/businessuser/BusinessUserRouteController.java new file mode 100644 index 0000000..6e03603 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/route/businessuser/BusinessUserRouteController.java @@ -0,0 +1,42 @@ +package cn.com.tenlion.usercenter.controller.route.businessuser; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import cn.com.tenlion.usercenter.service.businessuser.IBusinessUserService; +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: BusinessUserController + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "业务用户路由") +@RestController +@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/business-user") +public class BusinessUserRouteController extends DefaultBaseController { + + @GetMapping("save") + public ModelAndView save() { + return new ModelAndView("business-user/save"); + } + + @GetMapping("update") + public ModelAndView update() { + return new ModelAndView("business-user/update"); + } + + @GetMapping("list") + public ModelAndView list() { + return new ModelAndView("business-user/list"); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/dao/business/IBusinessDao.java b/src/main/java/cn/com/tenlion/usercenter/dao/business/IBusinessDao.java new file mode 100644 index 0000000..0c0c54f --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/dao/business/IBusinessDao.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.usercenter.dao.business; + +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.exceptions.UpdateException; +import cn.com.tenlion.usercenter.pojo.bos.business.BusinessBO; +import cn.com.tenlion.usercenter.pojo.pos.business.BusinessPO; +import cn.com.tenlion.usercenter.pojo.dtos.business.BusinessDTO; +import ink.wgink.interfaces.init.IInitBaseTable; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IBusinessDao + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Repository +public interface IBusinessDao extends IInitBaseTable { + + /** + * 新增业务 + * + * @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 + */ + BusinessDTO get(Map params) throws SearchException; + + /** + * 业务详情 + * + * @param params + * @return + * @throws SearchException + */ + BusinessBO getBO(Map params) throws SearchException; + + /** + * 业务详情 + * + * @param params + * @return + * @throws SearchException + */ + BusinessPO 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/src/main/java/cn/com/tenlion/usercenter/dao/businessuser/IBusinessUserDao.java b/src/main/java/cn/com/tenlion/usercenter/dao/businessuser/IBusinessUserDao.java new file mode 100644 index 0000000..af477f8 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/dao/businessuser/IBusinessUserDao.java @@ -0,0 +1,121 @@ +package cn.com.tenlion.usercenter.dao.businessuser; + +import cn.com.tenlion.usercenter.pojo.bos.businessuser.BusinessUserBO; +import cn.com.tenlion.usercenter.pojo.dtos.businessuser.BusinessUserDTO; +import cn.com.tenlion.usercenter.pojo.pos.businessuser.BusinessUserPO; +import ink.wgink.exceptions.RemoveException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.exceptions.SearchException; +import ink.wgink.exceptions.UpdateException; +import ink.wgink.interfaces.init.IInitBaseTable; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IBusinessUserDao + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@Repository +public interface IBusinessUserDao extends IInitBaseTable { + + /** + * 新增业务用户 + * + * @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 + */ + BusinessUserDTO get(Map params) throws SearchException; + + /** + * 业务用户详情 + * + * @param params + * @return + * @throws SearchException + */ + BusinessUserBO getBO(Map params) throws SearchException; + + /** + * 业务用户详情 + * + * @param params + * @return + * @throws SearchException + */ + BusinessUserPO 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/src/main/java/cn/com/tenlion/usercenter/pojo/bos/business/BusinessBO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/bos/business/BusinessBO.java new file mode 100644 index 0000000..1611d10 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/bos/business/BusinessBO.java @@ -0,0 +1,96 @@ +package cn.com.tenlion.usercenter.pojo.bos.business; + +/** + * + * @ClassName: BusinessBO + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +public class BusinessBO { + + private String businessId; + private String businessName; + private String businessSummary; + private String businessCode; + private String creator; + private String gmtCreate; + private String modifier; + private String gmtModified; + private Integer isDelete; + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getBusinessName() { + return businessName == null ? "" : businessName.trim(); + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessSummary() { + return businessSummary == null ? "" : businessSummary.trim(); + } + + public void setBusinessSummary(String businessSummary) { + this.businessSummary = businessSummary; + } + + public String getBusinessCode() { + return businessCode == null ? "" : businessCode.trim(); + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + 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 String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/bos/businessuser/BusinessUserBO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/bos/businessuser/BusinessUserBO.java new file mode 100644 index 0000000..06cad97 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/bos/businessuser/BusinessUserBO.java @@ -0,0 +1,42 @@ +package cn.com.tenlion.usercenter.pojo.bos.businessuser; + +/** + * + * @ClassName: BusinessUserBO + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +public class BusinessUserBO { + + private String businessUserId; + private String businessId; + private String userId; + + public String getBusinessUserId() { + return businessUserId == null ? "" : businessUserId.trim(); + } + + public void setBusinessUserId(String businessUserId) { + this.businessUserId = businessUserId; + } + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/dtos/business/BusinessDTO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/dtos/business/BusinessDTO.java new file mode 100644 index 0000000..cba1295 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/dtos/business/BusinessDTO.java @@ -0,0 +1,69 @@ +package cn.com.tenlion.usercenter.pojo.dtos.business; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: BusinessDTO + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@ApiModel +public class BusinessDTO { + + @ApiModelProperty(name = "businessId", value = "主键") + private String businessId; + @ApiModelProperty(name = "businessName", value = "业务名称") + private String businessName; + @ApiModelProperty(name = "businessSummary", value = "业务描述") + private String businessSummary; + @ApiModelProperty(name = "businessCode", value = "业务编码") + private String businessCode; + @ApiModelProperty(name = "gmtCreate", value = "创建时间") + private String gmtCreate; + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getBusinessName() { + return businessName == null ? "" : businessName.trim(); + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessSummary() { + return businessSummary == null ? "" : businessSummary.trim(); + } + + public void setBusinessSummary(String businessSummary) { + this.businessSummary = businessSummary; + } + + public String getBusinessCode() { + return businessCode == null ? "" : businessCode.trim(); + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/dtos/businessuser/BusinessUserDTO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/dtos/businessuser/BusinessUserDTO.java new file mode 100644 index 0000000..20226f4 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/dtos/businessuser/BusinessUserDTO.java @@ -0,0 +1,49 @@ +package cn.com.tenlion.usercenter.pojo.dtos.businessuser; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: BusinessUserDTO + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@ApiModel +public class BusinessUserDTO { + + @ApiModelProperty(name = "businessUserId", value = "主键") + private String businessUserId; + @ApiModelProperty(name = "businessId", value = "业务ID") + private String businessId; + @ApiModelProperty(name = "userId", value = "用户ID") + private String userId; + + public String getBusinessUserId() { + return businessUserId == null ? "" : businessUserId.trim(); + } + + public void setBusinessUserId(String businessUserId) { + this.businessUserId = businessUserId; + } + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/pos/business/BusinessPO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/pos/business/BusinessPO.java new file mode 100644 index 0000000..133c3dd --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/pos/business/BusinessPO.java @@ -0,0 +1,96 @@ +package cn.com.tenlion.usercenter.pojo.pos.business; + +/** + * + * @ClassName: BusinessPO + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +public class BusinessPO { + + private String businessId; + private String businessName; + private String businessSummary; + private String businessCode; + private String creator; + private String gmtCreate; + private String modifier; + private String gmtModified; + private Integer isDelete; + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getBusinessName() { + return businessName == null ? "" : businessName.trim(); + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessSummary() { + return businessSummary == null ? "" : businessSummary.trim(); + } + + public void setBusinessSummary(String businessSummary) { + this.businessSummary = businessSummary; + } + + public String getBusinessCode() { + return businessCode == null ? "" : businessCode.trim(); + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + 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 String getModifier() { + return modifier == null ? "" : modifier.trim(); + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getGmtModified() { + return gmtModified == null ? "" : gmtModified.trim(); + } + + public void setGmtModified(String gmtModified) { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() { + return isDelete == null ? 0 : isDelete; + } + + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/pos/businessuser/BusinessUserPO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/pos/businessuser/BusinessUserPO.java new file mode 100644 index 0000000..7ffca3e --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/pos/businessuser/BusinessUserPO.java @@ -0,0 +1,42 @@ +package cn.com.tenlion.usercenter.pojo.pos.businessuser; + +/** + * + * @ClassName: BusinessUserPO + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +public class BusinessUserPO { + + private String businessUserId; + private String businessId; + private String userId; + + public String getBusinessUserId() { + return businessUserId == null ? "" : businessUserId.trim(); + } + + public void setBusinessUserId(String businessUserId) { + this.businessUserId = businessUserId; + } + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/vos/business/BusinessVO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/vos/business/BusinessVO.java new file mode 100644 index 0000000..88f4cef --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/vos/business/BusinessVO.java @@ -0,0 +1,51 @@ +package cn.com.tenlion.usercenter.pojo.vos.business; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import ink.wgink.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: BusinessVO + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@ApiModel +public class BusinessVO { + + @ApiModelProperty(name = "businessName", value = "业务名称") + private String businessName; + @ApiModelProperty(name = "businessSummary", value = "业务描述") + private String businessSummary; + @ApiModelProperty(name = "businessCode", value = "业务编码") + private String businessCode; + + public String getBusinessName() { + return businessName == null ? "" : businessName.trim(); + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessSummary() { + return businessSummary == null ? "" : businessSummary.trim(); + } + + public void setBusinessSummary(String businessSummary) { + this.businessSummary = businessSummary; + } + + public String getBusinessCode() { + return businessCode == null ? "" : businessCode.trim(); + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/vos/businessuser/BusinessUserVO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/vos/businessuser/BusinessUserVO.java new file mode 100644 index 0000000..da6d02e --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/vos/businessuser/BusinessUserVO.java @@ -0,0 +1,41 @@ +package cn.com.tenlion.usercenter.pojo.vos.businessuser; + +import ink.wgink.annotation.CheckEmptyAnnotation; +import ink.wgink.annotation.CheckNumberAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: BusinessUserVO + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@ApiModel +public class BusinessUserVO { + + @ApiModelProperty(name = "businessId", value = "业务ID") + private String businessId; + @ApiModelProperty(name = "userId", value = "用户ID") + private String userId; + + public String getBusinessId() { + return businessId == null ? "" : businessId.trim(); + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + + +} diff --git a/src/main/java/cn/com/tenlion/usercenter/service/business/IBusinessService.java b/src/main/java/cn/com/tenlion/usercenter/service/business/IBusinessService.java new file mode 100644 index 0000000..d891fbe --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/service/business/IBusinessService.java @@ -0,0 +1,188 @@ +package cn.com.tenlion.usercenter.service.business; + +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.usercenter.pojo.dtos.business.BusinessDTO; +import cn.com.tenlion.usercenter.pojo.vos.business.BusinessVO; +import cn.com.tenlion.usercenter.pojo.bos.business.BusinessBO; +import cn.com.tenlion.usercenter.pojo.pos.business.BusinessPO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IBusinessService + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +public interface IBusinessService { + + /** + * 新增业务 + * + * @param businessVO + * @return + */ + void save(BusinessVO businessVO); + + /** + * 新增业务 + * + * @param token + * @param businessVO + * @return + */ + void save(String token, BusinessVO businessVO); + + /** + * 新增业务 + * + * @param businessVO + * @return businessId + */ + String saveReturnId(BusinessVO businessVO); + + /** + * 新增业务 + * + * @param token + * @param businessVO + * @return businessId + */ + String saveReturnId(String token, BusinessVO businessVO); + + /** + * 删除业务 + * + * @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 businessId + * @param businessVO + * @return + */ + void update(String businessId, BusinessVO businessVO); + + /** + * 修改业务 + * + * @param token + * @param businessId + * @param businessVO + * @return + */ + void update(String token, String businessId, BusinessVO businessVO); + + /** + * 业务详情 + * + * @param params 参数Map + * @return + */ + BusinessDTO get(Map params); + + /** + * 业务详情 + * + * @param businessId + * @return + */ + BusinessDTO get(String businessId); + + /** + * 业务详情 + * + * @param params 参数Map + * @return + */ + BusinessBO getBO(Map params); + + /** + * 业务详情 + * + * @param businessId + * @return + */ + BusinessBO getBO(String businessId); + + /** + * 业务详情 + * + * @param params 参数Map + * @return + */ + BusinessPO getPO(Map params); + + /** + * 业务详情 + * + * @param businessId + * @return + */ + BusinessPO getPO(String businessId); + + /** + * 业务列表 + * + * @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/src/main/java/cn/com/tenlion/usercenter/service/business/impl/BusinessServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/business/impl/BusinessServiceImpl.java new file mode 100644 index 0000000..c46ddf1 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/service/business/impl/BusinessServiceImpl.java @@ -0,0 +1,171 @@ +package cn.com.tenlion.usercenter.service.business.impl; + +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.util.map.HashMapUtil; +import ink.wgink.util.UUIDUtil; +import cn.com.tenlion.usercenter.dao.business.IBusinessDao; +import cn.com.tenlion.usercenter.pojo.dtos.business.BusinessDTO; +import cn.com.tenlion.usercenter.pojo.vos.business.BusinessVO; +import cn.com.tenlion.usercenter.pojo.bos.business.BusinessBO; +import cn.com.tenlion.usercenter.pojo.pos.business.BusinessPO; +import cn.com.tenlion.usercenter.service.business.IBusinessService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: BusinessServiceImpl + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Service +public class BusinessServiceImpl extends DefaultBaseService implements IBusinessService { + + @Autowired + private IBusinessDao businessDao; + + @Override + public void save(BusinessVO businessVO) { + saveReturnId(businessVO); + } + + @Override + public void save(String token, BusinessVO businessVO) { + saveReturnId(token, businessVO); + } + + @Override + public String saveReturnId(BusinessVO businessVO) { + return saveReturnId(null, businessVO); + } + + @Override + public String saveReturnId(String token, BusinessVO businessVO) { + String businessId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(businessVO); + params.put("businessId", businessId); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } + businessDao.save(params); + return businessId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("businessIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + businessDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("businessIds", ids); + businessDao.delete(params); + } + + @Override + public void update(String businessId, BusinessVO businessVO) { + update(null, businessId, businessVO); + } + + @Override + public void update(String token, String businessId, BusinessVO businessVO) { + Map params = HashMapUtil.beanToMap(businessVO); + params.put("businessId", businessId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + businessDao.update(params); + } + + @Override + public BusinessDTO get(Map params) { + return businessDao.get(params); + } + + @Override + public BusinessDTO get(String businessId) { + Map params = super.getHashMap(2); + params.put("businessId", businessId); + return get(params); + } + + @Override + public BusinessBO getBO(Map params) { + return businessDao.getBO(params); + } + + @Override + public BusinessBO getBO(String businessId) { + Map params = super.getHashMap(2); + params.put("businessId", businessId); + return getBO(params); + } + + @Override + public BusinessPO getPO(Map params) { + return businessDao.getPO(params); + } + + @Override + public BusinessPO getPO(String businessId) { + Map params = super.getHashMap(2); + params.put("businessId", businessId); + return getPO(params); + } + + @Override + public List list(Map params) { + return businessDao.list(params); + } + + @Override + public List listBO(Map params) { + return businessDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return businessDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List businessDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(businessDTOs); + return new SuccessResultList<>(businessDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = businessDao.count(params); + return count == null ? 0 : count; + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/service/businessuser/IBusinessUserService.java b/src/main/java/cn/com/tenlion/usercenter/service/businessuser/IBusinessUserService.java new file mode 100644 index 0000000..48af288 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/service/businessuser/IBusinessUserService.java @@ -0,0 +1,188 @@ +package cn.com.tenlion.usercenter.service.businessuser; + +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResultList; +import cn.com.tenlion.usercenter.pojo.dtos.businessuser.BusinessUserDTO; +import cn.com.tenlion.usercenter.pojo.vos.businessuser.BusinessUserVO; +import cn.com.tenlion.usercenter.pojo.bos.businessuser.BusinessUserBO; +import cn.com.tenlion.usercenter.pojo.pos.businessuser.BusinessUserPO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IBusinessUserService + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +public interface IBusinessUserService { + + /** + * 新增业务用户 + * + * @param businessUserVO + * @return + */ + void save(BusinessUserVO businessUserVO); + + /** + * 新增业务用户 + * + * @param token + * @param businessUserVO + * @return + */ + void save(String token, BusinessUserVO businessUserVO); + + /** + * 新增业务用户 + * + * @param businessUserVO + * @return businessUserId + */ + String saveReturnId(BusinessUserVO businessUserVO); + + /** + * 新增业务用户 + * + * @param token + * @param businessUserVO + * @return businessUserId + */ + String saveReturnId(String token, BusinessUserVO businessUserVO); + + /** + * 删除业务用户 + * + * @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 businessUserId + * @param businessUserVO + * @return + */ + void update(String businessUserId, BusinessUserVO businessUserVO); + + /** + * 修改业务用户 + * + * @param token + * @param businessUserId + * @param businessUserVO + * @return + */ + void update(String token, String businessUserId, BusinessUserVO businessUserVO); + + /** + * 业务用户详情 + * + * @param params 参数Map + * @return + */ + BusinessUserDTO get(Map params); + + /** + * 业务用户详情 + * + * @param businessUserId + * @return + */ + BusinessUserDTO get(String businessUserId); + + /** + * 业务用户详情 + * + * @param params 参数Map + * @return + */ + BusinessUserBO getBO(Map params); + + /** + * 业务用户详情 + * + * @param businessUserId + * @return + */ + BusinessUserBO getBO(String businessUserId); + + /** + * 业务用户详情 + * + * @param params 参数Map + * @return + */ + BusinessUserPO getPO(Map params); + + /** + * 业务用户详情 + * + * @param businessUserId + * @return + */ + BusinessUserPO getPO(String businessUserId); + + /** + * 业务用户列表 + * + * @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/src/main/java/cn/com/tenlion/usercenter/service/businessuser/impl/BusinessUserServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/businessuser/impl/BusinessUserServiceImpl.java new file mode 100644 index 0000000..6fcc63b --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/service/businessuser/impl/BusinessUserServiceImpl.java @@ -0,0 +1,171 @@ +package cn.com.tenlion.usercenter.service.businessuser.impl; + +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.result.SuccessResult; +import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.util.map.HashMapUtil; +import ink.wgink.util.UUIDUtil; +import cn.com.tenlion.usercenter.dao.businessuser.IBusinessUserDao; +import cn.com.tenlion.usercenter.pojo.dtos.businessuser.BusinessUserDTO; +import cn.com.tenlion.usercenter.pojo.vos.businessuser.BusinessUserVO; +import cn.com.tenlion.usercenter.pojo.bos.businessuser.BusinessUserBO; +import cn.com.tenlion.usercenter.pojo.pos.businessuser.BusinessUserPO; +import cn.com.tenlion.usercenter.service.businessuser.IBusinessUserService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @ClassName: BusinessUserServiceImpl + * @Description: 业务用户 + * @Author: CodeFactory + * @Date: 2021-11-03 21:34:19 + * @Version: 3.0 + **/ +@Service +public class BusinessUserServiceImpl extends DefaultBaseService implements IBusinessUserService { + + @Autowired + private IBusinessUserDao businessUserDao; + + @Override + public void save(BusinessUserVO businessUserVO) { + saveReturnId(businessUserVO); + } + + @Override + public void save(String token, BusinessUserVO businessUserVO) { + saveReturnId(token, businessUserVO); + } + + @Override + public String saveReturnId(BusinessUserVO businessUserVO) { + return saveReturnId(null, businessUserVO); + } + + @Override + public String saveReturnId(String token, BusinessUserVO businessUserVO) { + String businessUserId = UUIDUtil.getUUID(); + Map params = HashMapUtil.beanToMap(businessUserVO); + params.put("businessUserId", businessUserId); + if (StringUtils.isBlank(token)) { + setSaveInfo(params); + } else { + setAppSaveInfo(token, params); + } + businessUserDao.save(params); + return businessUserId; + } + + @Override + public void remove(List ids) { + remove(null, ids); + } + + @Override + public void remove(String token, List ids) { + Map params = getHashMap(2); + params.put("businessUserIds", ids); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + businessUserDao.remove(params); + } + + @Override + public void delete(List ids) { + Map params = getHashMap(2); + params.put("businessUserIds", ids); + businessUserDao.delete(params); + } + + @Override + public void update(String businessUserId, BusinessUserVO businessUserVO) { + update(null, businessUserId, businessUserVO); + } + + @Override + public void update(String token, String businessUserId, BusinessUserVO businessUserVO) { + Map params = HashMapUtil.beanToMap(businessUserVO); + params.put("businessUserId", businessUserId); + if (StringUtils.isBlank(token)) { + setUpdateInfo(params); + } else { + setAppUpdateInfo(token, params); + } + businessUserDao.update(params); + } + + @Override + public BusinessUserDTO get(Map params) { + return businessUserDao.get(params); + } + + @Override + public BusinessUserDTO get(String businessUserId) { + Map params = super.getHashMap(2); + params.put("businessUserId", businessUserId); + return get(params); + } + + @Override + public BusinessUserBO getBO(Map params) { + return businessUserDao.getBO(params); + } + + @Override + public BusinessUserBO getBO(String businessUserId) { + Map params = super.getHashMap(2); + params.put("businessUserId", businessUserId); + return getBO(params); + } + + @Override + public BusinessUserPO getPO(Map params) { + return businessUserDao.getPO(params); + } + + @Override + public BusinessUserPO getPO(String businessUserId) { + Map params = super.getHashMap(2); + params.put("businessUserId", businessUserId); + return getPO(params); + } + + @Override + public List list(Map params) { + return businessUserDao.list(params); + } + + @Override + public List listBO(Map params) { + return businessUserDao.listBO(params); + } + + @Override + public List listPO(Map params) { + return businessUserDao.listPO(params); + } + + @Override + public SuccessResultList> listPage(ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + List businessUserDTOs = list(page.getParams()); + PageInfo pageInfo = new PageInfo<>(businessUserDTOs); + return new SuccessResultList<>(businessUserDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + @Override + public Integer count(Map params) { + Integer count = businessUserDao.count(params); + return count == null ? 0 : count; + } + +} \ No newline at end of file