From 28c65b61cb0587a36ec8ef6b8fde85808616a0a8 Mon Sep 17 00:00:00 2001 From: sonjinyon <2476687577@qq.com> Date: Fri, 9 Aug 2024 14:53:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 +- yudao-module-subscribe/pom.xml | 22 ++++ .../yudao-module-subscribe-api/pom.xml | 21 ++++ .../subscribe/enums/ErrorCodeConstants.java | 11 ++ .../yudao-module-subscribe-biz/pom.xml | 69 ++++++++++++ .../organization/OrganizationController.java | 105 ++++++++++++++++++ .../vo/OrganizationPageReqVO.java | 43 +++++++ .../organization/vo/OrganizationRespVO.java | 54 +++++++++ .../vo/OrganizationSaveReqVO.java | 36 ++++++ .../admin/staff/StaffController.java | 103 +++++++++++++++++ .../admin/staff/vo/StaffPageReqVO.java | 65 +++++++++++ .../admin/staff/vo/StaffRespVO.java | 87 +++++++++++++++ .../admin/staff/vo/StaffSaveReqVO.java | 57 ++++++++++ .../SubscribeManageController.java | 97 ++++++++++++++++ .../vo/SubscribeManagePageReqVO.java | 43 +++++++ .../vo/SubscribeManageRespVO.java | 55 +++++++++ .../vo/SubscribeManageSaveReqVO.java | 35 ++++++ .../organization/OrganizationDO.java | 61 ++++++++++ .../organization/OrganizationOptions.java | 11 ++ .../dal/dataobject/staff/StaffDO.java | 100 +++++++++++++++++ .../subscribemanage/SubscribeManageDO.java | 65 +++++++++++ .../organization/OrganizationMapper.java | 34 ++++++ .../dal/mysql/staff/StaffMapper.java | 36 ++++++ .../SubscribeManageMapper.java | 31 ++++++ .../organization/OrganizationService.java | 61 ++++++++++ .../organization/OrganizationServiceImpl.java | 77 +++++++++++++ .../srbscribe/service/staff/StaffService.java | 55 +++++++++ .../service/staff/StaffServiceImpl.java | 80 +++++++++++++ .../SubscribeManageService.java | 57 ++++++++++ .../SubscribeManageServiceImpl.java | 87 +++++++++++++++ .../src/test/resources/sql/clean.sql | 3 + .../src/test/resources/sql/create_tables.sql | 57 ++++++++++ yudao-server/pom.xml | 6 + 33 files changed, 1727 insertions(+), 1 deletion(-) create mode 100644 yudao-module-subscribe/pom.xml create mode 100644 yudao-module-subscribe/yudao-module-subscribe-api/pom.xml create mode 100644 yudao-module-subscribe/yudao-module-subscribe-api/src/main/java/cn/iocoder/yudao/module/subscribe/enums/ErrorCodeConstants.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/pom.xml create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/OrganizationController.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationPageReqVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationRespVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationSaveReqVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/StaffController.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffPageReqVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffRespVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffSaveReqVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/SubscribeManageController.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManagePageReqVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageRespVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageSaveReqVO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationDO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationOptions.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/staff/StaffDO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/subscribemanage/SubscribeManageDO.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/organization/OrganizationMapper.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/staff/StaffMapper.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/subscribemanage/SubscribeManageMapper.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationService.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationServiceImpl.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffService.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffServiceImpl.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageService.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageServiceImpl.java create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/clean.sql create mode 100644 yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/create_tables.sql diff --git a/pom.xml b/pom.xml index a91d437..b4dfb64 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,9 @@ yudao-module-mall yudao-module-crm yudao-module-erp - + yudao-module-subscribe + + ${project.artifactId} diff --git a/yudao-module-subscribe/pom.xml b/yudao-module-subscribe/pom.xml new file mode 100644 index 0000000..6bca7d3 --- /dev/null +++ b/yudao-module-subscribe/pom.xml @@ -0,0 +1,22 @@ + + + + yudao + cn.iocoder.boot + ${revision} + + 4.0.0 + + + yudao-module-subscribe-api + yudao-module-subscribe-biz + + + yudao-module-subscribe + pom + + + + \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-api/pom.xml b/yudao-module-subscribe/yudao-module-subscribe-api/pom.xml new file mode 100644 index 0000000..26d12bc --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-api/pom.xml @@ -0,0 +1,21 @@ + + + + yudao-module-subscribe + cn.iocoder.boot + ${revision} + + 4.0.0 + + yudao-module-subscribe-api + + + + cn.iocoder.boot + yudao-common + + + + \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-api/src/main/java/cn/iocoder/yudao/module/subscribe/enums/ErrorCodeConstants.java b/yudao-module-subscribe/yudao-module-subscribe-api/src/main/java/cn/iocoder/yudao/module/subscribe/enums/ErrorCodeConstants.java new file mode 100644 index 0000000..ea8f195 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-api/src/main/java/cn/iocoder/yudao/module/subscribe/enums/ErrorCodeConstants.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.subscribe.enums; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; + +public interface ErrorCodeConstants { + + ErrorCode MANAGE_NOT_EXISTS = new ErrorCode(11111, "预约不存在"); + ErrorCode STAFF_NOT_EXISTS = new ErrorCode(22222, "预约人员不存在"); + ErrorCode ORGANIZATION_NOT_EXISTS = new ErrorCode(33333, "机构不存在"); + +} diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/pom.xml b/yudao-module-subscribe/yudao-module-subscribe-biz/pom.xml new file mode 100644 index 0000000..2bb1f44 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/pom.xml @@ -0,0 +1,69 @@ + + + + yudao-module-subscribe + cn.iocoder.boot + ${revision} + + 4.0.0 + + yudao-module-subscribe-biz + + + + + cn.iocoder.boot + yudao-module-subscribe-api + ${revision} + + + + cn.iocoder.boot + yudao-module-system-api + ${revision} + + + + + cn.iocoder.boot + yudao-spring-boot-starter-biz-tenant + + + + + cn.iocoder.boot + yudao-spring-boot-starter-web + + + + cn.iocoder.boot + yudao-spring-boot-starter-security + + + + + cn.iocoder.boot + yudao-spring-boot-starter-mybatis + + + + + cn.iocoder.boot + yudao-spring-boot-starter-test + + + + + cn.iocoder.boot + yudao-spring-boot-starter-excel + + + cn.com.kingbase + kingbase8 + + + + + \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/OrganizationController.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/OrganizationController.java new file mode 100644 index 0000000..d14e913 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/OrganizationController.java @@ -0,0 +1,105 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.organization; + +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationRespVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationOptions; +import cn.iocoder.yudao.module.srbscribe.service.organization.OrganizationService; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - 机构") +@RestController +@RequestMapping("/subscribe/organization") +@Validated +public class OrganizationController { + + @Resource + private OrganizationService organizationService; + + @PostMapping("/create") + @Operation(summary = "创建机构") + @PreAuthorize("@ss.hasPermission('subscribe:organization:create')") + public CommonResult createOrganization(@Valid @RequestBody OrganizationSaveReqVO createReqVO) { + return success(organizationService.createOrganization(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新机构") + @PreAuthorize("@ss.hasPermission('subscribe:organization:update')") + public CommonResult updateOrganization(@Valid @RequestBody OrganizationSaveReqVO updateReqVO) { + organizationService.updateOrganization(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除机构") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('subscribe:organization:delete')") + public CommonResult deleteOrganization(@RequestParam("id") Integer id) { + organizationService.deleteOrganization(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得机构") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('subscribe:organization:query')") + public CommonResult getOrganization(@RequestParam("id") Integer id) { + OrganizationDO organization = organizationService.getOrganization(id); + return success(BeanUtils.toBean(organization, OrganizationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得机构分页") + @PreAuthorize("@ss.hasPermission('subscribe:organization:query')") + public CommonResult> getOrganizationPage(@Valid OrganizationPageReqVO pageReqVO) { + PageResult pageResult = organizationService.getOrganizationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, OrganizationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出机构 Excel") + @PreAuthorize("@ss.hasPermission('subscribe:organization:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportOrganizationExcel(@Valid OrganizationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = organizationService.getOrganizationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "机构.xls", "数据", OrganizationRespVO.class, + BeanUtils.toBean(list, OrganizationRespVO.class)); + } + + @GetMapping("/getOrganization") + @Operation(summary = "获得机构名称数据") + public CommonResult> getOrganization() { + List organization = organizationService.getOrganization(); + return success(organization); + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationPageReqVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationPageReqVO.java new file mode 100644 index 0000000..814867e --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationPageReqVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 机构分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OrganizationPageReqVO extends PageParam { + + @Schema(description = "机构名称", example = "芋艿") + private String name; + + @Schema(description = "机构电话") + private String phone; + + @Schema(description = "机构邮箱") + private String email; + + @Schema(description = "机构图片") + private String picture; + + @Schema(description = "机构地址") + private String address; + + @Schema(description = "机构简介") + private String depict; + + @Schema(description = "状态", example = "1") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationRespVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationRespVO.java new file mode 100644 index 0000000..c59e28e --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationRespVO.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 机构 Response VO") +@Data +@ExcelIgnoreUnannotated +public class OrganizationRespVO { + + @Schema(description = "机构id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9041") + @ExcelProperty("机构id") + private Integer id; + + @Schema(description = "机构名称", example = "芋艿") + @ExcelProperty("机构名称") + private String name; + + @Schema(description = "机构电话") + @ExcelProperty("机构电话") + private String phone; + + @Schema(description = "机构邮箱") + @ExcelProperty("机构邮箱") + private String email; + + @Schema(description = "机构图片") + @ExcelProperty("机构图片") + private String picture; + + @Schema(description = "机构地址") + @ExcelProperty("机构地址") + private String address; + + @Schema(description = "机构简介") + @ExcelProperty("机构简介") + private String depict; + + @Schema(description = "状态", example = "1") + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat("organization_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer status; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationSaveReqVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationSaveReqVO.java new file mode 100644 index 0000000..a33c2c5 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/organization/vo/OrganizationSaveReqVO.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 机构新增/修改 Request VO") +@Data +public class OrganizationSaveReqVO { + + @Schema(description = "机构id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9041") + private Integer id; + + @Schema(description = "机构名称", example = "芋艿") + private String name; + + @Schema(description = "机构电话") + private String phone; + + @Schema(description = "机构邮箱") + private String email; + + @Schema(description = "机构图片") + private String picture; + + @Schema(description = "机构地址") + private String address; + + @Schema(description = "机构简介") + private String depict; + + @Schema(description = "状态", example = "1") + private Integer status; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/StaffController.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/StaffController.java new file mode 100644 index 0000000..b8490ca --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/StaffController.java @@ -0,0 +1,103 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.staff; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationRespVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffRespVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationOptions; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO; +import cn.iocoder.yudao.module.srbscribe.service.organization.OrganizationService; +import cn.iocoder.yudao.module.srbscribe.service.staff.StaffService; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; +import javax.validation.*; +import javax.servlet.http.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - 预约人员") +@RestController +@RequestMapping("/subscribe/staff") +@Validated +public class StaffController { + + @Resource + private StaffService staffService; + + @Resource + private OrganizationService organizationService; + + @PostMapping("/create") + @Operation(summary = "创建预约人员") + @PreAuthorize("@ss.hasPermission('subscribe:staff:create')") + public CommonResult createStaff(@Valid @RequestBody StaffSaveReqVO createReqVO) { + return success(staffService.createStaff(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新预约人员") + @PreAuthorize("@ss.hasPermission('subscribe:staff:update')") + public CommonResult updateStaff(@Valid @RequestBody StaffSaveReqVO updateReqVO) { + staffService.updateStaff(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除预约人员") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('subscribe:staff:delete')") + public CommonResult deleteStaff(@RequestParam("id") Long id) { + staffService.deleteStaff(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得预约人员") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('subscribe:staff:query')") + public CommonResult getStaff(@RequestParam("id") Long id) { + StaffDO staff = staffService.getStaff(id); + return success(BeanUtils.toBean(staff, StaffRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得预约人员分页") + @PreAuthorize("@ss.hasPermission('subscribe:staff:query')") + public CommonResult> getStaffPage(@Valid StaffPageReqVO pageReqVO) { + PageResult pageResult = staffService.getStaffPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StaffRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出预约人员 Excel") + @PreAuthorize("@ss.hasPermission('subscribe:staff:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = staffService.getStaffPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "预约人员.xls", "数据", StaffRespVO.class, + BeanUtils.toBean(list, StaffRespVO.class)); + } + + + + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffPageReqVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffPageReqVO.java new file mode 100644 index 0000000..fa6834a --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffPageReqVO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 预约人员分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class StaffPageReqVO extends PageParam { + + @Schema(description = "机构id", example = "26075") + private Long organizationId; + + @Schema(description = "编号") + private String serialNumber; + + @Schema(description = "类型", example = "1") + private Integer type; + + @Schema(description = "名称", example = "张三") + private String name; + + @Schema(description = "性别") + private Integer sex; + + @Schema(description = "照片") + private String photo; + + @Schema(description = "手机号") + private String phone; + + @Schema(description = "服务时间段") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] serviceTime; + + @Schema(description = "服务开始时间") + private String serviceStartTime; + + @Schema(description = "服务结束时间") + private String serviceEndTime; + + @Schema(description = "服务范围") + private String serviceScope; + + @Schema(description = "约满标记") + private Integer sign; + + @Schema(description = "状态", example = "2") + private Integer status; + + @Schema(description = "介绍") + private String content; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffRespVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffRespVO.java new file mode 100644 index 0000000..392830f --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffRespVO.java @@ -0,0 +1,87 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 预约人员 Response VO") +@Data +@ExcelIgnoreUnannotated +public class StaffRespVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21490") + @ExcelProperty("id") + private Long id; + + @Schema(description = "机构id", example = "26075") + @ExcelProperty("机构id") + private Long organizationId; + + @Schema(description = "编号") + @ExcelProperty("编号") + private String serialNumber; + + @Schema(description = "类型", example = "1") + @ExcelProperty(value = "类型", converter = DictConvert.class) + @DictFormat("staff_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer type; + + @Schema(description = "名称", example = "张三") + @ExcelProperty("名称") + private String name; + + @Schema(description = "性别") + @ExcelProperty(value = "性别", converter = DictConvert.class) + @DictFormat("stall_sex") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer sex; + + @Schema(description = "照片") + @ExcelProperty("照片") + private String photo; + + @Schema(description = "手机号") + @ExcelProperty("手机号") + private String phone; + + @Schema(description = "服务时间段") + @ExcelProperty("服务时间段") + private String serviceTime; + + @Schema(description = "服务开始时间") + private String serviceStartTime; + + @Schema(description = "服务结束时间") + private String serviceEndTime; + + @Schema(description = "服务范围") + @ExcelProperty("服务范围") + private String serviceScope; + + @Schema(description = "约满标记") + @ExcelProperty(value = "约满标记", converter = DictConvert.class) + @DictFormat("staff_full") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer sign; + + @Schema(description = "状态", example = "2") + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat("staff_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer status; + + @Schema(description = "介绍") + @ExcelProperty("介绍") + private String content; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "所属机构") + @ExcelProperty("所属机构") + private String organizationName; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffSaveReqVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffSaveReqVO.java new file mode 100644 index 0000000..4aa2824 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/staff/vo/StaffSaveReqVO.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 预约人员新增/修改 Request VO") +@Data +public class StaffSaveReqVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21490") + private Long id; + + @Schema(description = "机构id", example = "26075") + private Long organizationId; + + @Schema(description = "编号") + private String serialNumber; + + @Schema(description = "类型", example = "1") + private Integer type; + + @Schema(description = "名称", example = "张三") + private String name; + + @Schema(description = "性别") + private Integer sex; + + @Schema(description = "照片") + private String photo; + + @Schema(description = "手机号") + private String phone; + + @Schema(description = "服务时间段") + private String serviceTime; + + @Schema(description = "服务开始时间") + private String serviceStartTime; + + @Schema(description = "服务结束时间") + private String serviceEndTime; + + @Schema(description = "服务范围") + private String serviceScope; + + @Schema(description = "约满标记") + private Integer sign; + + @Schema(description = "状态", example = "2") + private Integer status; + + @Schema(description = "介绍") + private String content; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/SubscribeManageController.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/SubscribeManageController.java new file mode 100644 index 0000000..3ec8972 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/SubscribeManageController.java @@ -0,0 +1,97 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage; + +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageRespVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO; +import cn.iocoder.yudao.module.srbscribe.service.subscribemanage.SubscribeManageService; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - 预约") +@RestController +@RequestMapping("/subscribe/manage") +@Validated +public class SubscribeManageController { + + @Resource + private SubscribeManageService manageService; + + @PostMapping("/create") + @Operation(summary = "创建预约") + @PreAuthorize("@ss.hasPermission('subscribe:manage:create')") + public CommonResult createManage(@Valid @RequestBody SubscribeManageSaveReqVO createReqVO) { + return success(manageService.createManage(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新预约") + @PreAuthorize("@ss.hasPermission('subscribe:manage:update')") + public CommonResult updateManage(@Valid @RequestBody SubscribeManageSaveReqVO updateReqVO) { + manageService.updateManage(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除预约") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('subscribe:manage:delete')") + public CommonResult deleteManage(@RequestParam("id") Long id) { + manageService.deleteManage(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得预约") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('subscribe:manage:query')") + public CommonResult getManage(@RequestParam("id") Long id) { + SubscribeManageDO manage = manageService.getManage(id); + return success(BeanUtils.toBean(manage, SubscribeManageRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得预约分页") + @PreAuthorize("@ss.hasPermission('subscribe:manage:query')") + public CommonResult> getManagePage(@Valid SubscribeManagePageReqVO pageReqVO) { + PageResult pageResult = manageService.getManagePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, SubscribeManageRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出预约 Excel") + @PreAuthorize("@ss.hasPermission('subscribe:manage:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportManageExcel(@Valid SubscribeManagePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = manageService.getManagePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "预约.xls", "数据", SubscribeManageRespVO.class, + BeanUtils.toBean(list, SubscribeManageRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManagePageReqVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManagePageReqVO.java new file mode 100644 index 0000000..1466b1a --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManagePageReqVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 预约分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class SubscribeManagePageReqVO extends PageParam { + + @Schema(description = "用户id", example = "20637") + private Long userId; + + @Schema(description = "预约类型", example = "2") + private Integer type; + + @Schema(description = "预约人员id", example = "23520") + private Long staffId; + + @Schema(description = "预约时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] subscribeTime; + + @Schema(description = "预约状态", example = "1") + private String subscribeStatus; + + @Schema(description = "审核状态", example = "1") + private Integer checkStatus; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + private String staffName; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageRespVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageRespVO.java new file mode 100644 index 0000000..b8d9600 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageRespVO.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 预约 Response VO") +@Data +@ExcelIgnoreUnannotated +public class SubscribeManageRespVO { + + @Schema(description = "表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20273") + @ExcelProperty("表id") + private Long id; + + @Schema(description = "用户id", example = "20637") + @ExcelProperty("用户id") + private Long userId; + + @Schema(description = "预约类型", example = "2") + @ExcelProperty(value = "预约类型", converter = DictConvert.class) + @DictFormat("subscribe_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer type; + + @Schema(description = "预约人员id", example = "23520") + @ExcelProperty("预约人员id") + private Long staffId; + + @Schema(description = "预约时间") + @ExcelProperty("预约时间") + private LocalDateTime subscribeTime; + + @Schema(description = "预约状态", example = "1") + @ExcelProperty("预约状态") + private String subscribeStatus; + + @Schema(description = "审核状态", example = "1") + @ExcelProperty(value = "审核状态", converter = DictConvert.class) + @DictFormat("subscribe_check_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer checkStatus; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "预约人员") + @ExcelProperty("预约人员") + private String staffName; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageSaveReqVO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageSaveReqVO.java new file mode 100644 index 0000000..0fd80f9 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/controller/admin/subscribemanage/vo/SubscribeManageSaveReqVO.java @@ -0,0 +1,35 @@ +package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 预约新增/修改 Request VO") +@Data +public class SubscribeManageSaveReqVO { + + @Schema(description = "表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20273") + private Long id; + + @Schema(description = "用户id", example = "20637") + private Long userId; + + @Schema(description = "预约类型", example = "2") + private Integer type; + + @Schema(description = "预约人员id", example = "23520") + private Long staffId; + + @Schema(description = "预约时间") + private LocalDateTime subscribeTime; + + @Schema(description = "预约状态", example = "1") + private String subscribeStatus; + + @Schema(description = "审核状态", example = "1") + private Integer checkStatus; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationDO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationDO.java new file mode 100644 index 0000000..3670e90 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationDO.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 机构 DO + * + * @author 管理员 + */ +@TableName("subscribe_organization") +@KeySequence("subscribe_organization_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OrganizationDO extends BaseDO { + + /** + * 机构id + */ + @TableId + private Integer id; + /** + * 机构名称 + */ + private String name; + /** + * 机构电话 + */ + private String phone; + /** + * 机构邮箱 + */ + private String email; + /** + * 机构图片 + */ + private String picture; + /** + * 机构地址 + */ + private String address; + /** + * 机构简介 + */ + private String depict; + /** + * 状态 + * + * 枚举 {@link TODO organization_status 对应的类} + */ + private Integer status; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationOptions.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationOptions.java new file mode 100644 index 0000000..be11b18 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/organization/OrganizationOptions.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization; + +import lombok.Data; + +@Data +public class OrganizationOptions { + + private String value; + private String label; + +} diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/staff/StaffDO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/staff/StaffDO.java new file mode 100644 index 0000000..7491802 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/staff/StaffDO.java @@ -0,0 +1,100 @@ +package cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 预约人员 DO + * + * @author 管理员 + */ +@TableName("subscribe_staff") +@KeySequence("subscribe_staff_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StaffDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 机构id + */ + private Long organizationId; + /** + * 编号 + */ + private String serialNumber; + /** + * 类型 + * + * 枚举 {@link TODO staff_type 对应的类} + */ + private Integer type; + /** + * 名称 + */ + private String name; + /** + * 性别 + * + * 枚举 {@link TODO stall_sex 对应的类} + */ + private Integer sex; + /** + * 照片 + */ + private String photo; + /** + * 手机号 + */ + private String phone; + /** + * 服务时间段 + */ + private String serviceTime; + /** + * 服务开始时间 + */ + private String serviceStartTime; + /** + * 服务结束时间 + */ + private String serviceEndTime; + /** + * 服务范围 + */ + private String serviceScope; + /** + * 约满标记 + * + * 枚举 {@link TODO staff_full 对应的类} + */ + private Integer sign; + /** + * 状态 + * + * 枚举 {@link TODO staff_status 对应的类} + */ + private Integer status; + /** + * 介绍 + */ + private String content; + + //机构名称 + @TableField(exist = false) + private String organizationName; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/subscribemanage/SubscribeManageDO.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/subscribemanage/SubscribeManageDO.java new file mode 100644 index 0000000..bf233c2 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/dataobject/subscribemanage/SubscribeManageDO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 预约 DO + * + * @author 管理员 + */ +@TableName("subscribe_subscribe_manage") +@KeySequence("subscribe_subscribe_manage_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SubscribeManageDO extends BaseDO { + + /** + * 表id + */ + @TableId + private Long id; + /** + * 用户id + */ + private Long userId; + /** + * 预约类型 + * + * 枚举 {@link TODO subscribe_type 对应的类} + */ + private Integer type; + /** + * 预约人员id + */ + private Long staffId; + /** + * 预约时间 + */ + private LocalDateTime subscribeTime; + /** + * 预约状态 + */ + private String subscribeStatus; + /** + * 审核状态 + * + * 枚举 {@link TODO subscribe_check_status 对应的类} + */ + private Integer checkStatus; + + + //预约人员名称 + @TableField(exist=false) + private String staffName; + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/organization/OrganizationMapper.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/organization/OrganizationMapper.java new file mode 100644 index 0000000..33fd1cd --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/organization/OrganizationMapper.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.srbscribe.dal.mysql.organization; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 机构 Mapper + * + * @author 管理员 + */ +@Mapper +public interface OrganizationMapper extends BaseMapperX { + + default PageResult selectPage(OrganizationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(OrganizationDO::getName, reqVO.getName()) + .eqIfPresent(OrganizationDO::getPhone, reqVO.getPhone()) + .eqIfPresent(OrganizationDO::getEmail, reqVO.getEmail()) + .eqIfPresent(OrganizationDO::getPicture, reqVO.getPicture()) + .eqIfPresent(OrganizationDO::getAddress, reqVO.getAddress()) + .eqIfPresent(OrganizationDO::getDepict, reqVO.getDepict()) + .eqIfPresent(OrganizationDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(OrganizationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(OrganizationDO::getId)); + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/staff/StaffMapper.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/staff/StaffMapper.java new file mode 100644 index 0000000..4015ea9 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/staff/StaffMapper.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.module.srbscribe.dal.mysql.staff; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 预约人员 Mapper + * + * @author 管理员 + */ +@Mapper +public interface StaffMapper extends BaseMapperX { + + default PageResult selectPage(StaffPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StaffDO::getOrganizationId, reqVO.getOrganizationId()) + .eqIfPresent(StaffDO::getSerialNumber, reqVO.getSerialNumber()) + .eqIfPresent(StaffDO::getType, reqVO.getType()) + .likeIfPresent(StaffDO::getName, reqVO.getName()) + .eqIfPresent(StaffDO::getSex, reqVO.getSex()) + .eqIfPresent(StaffDO::getPhoto, reqVO.getPhoto()) + .eqIfPresent(StaffDO::getPhone, reqVO.getPhone()) + .betweenIfPresent(StaffDO::getServiceTime, reqVO.getServiceTime()) + .eqIfPresent(StaffDO::getServiceScope, reqVO.getServiceScope()) + .eqIfPresent(StaffDO::getSign, reqVO.getSign()) + .eqIfPresent(StaffDO::getStatus, reqVO.getStatus()) + .eqIfPresent(StaffDO::getContent, reqVO.getContent()) + .betweenIfPresent(StaffDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(StaffDO::getId)); + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/subscribemanage/SubscribeManageMapper.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/subscribemanage/SubscribeManageMapper.java new file mode 100644 index 0000000..9eee006 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/dal/mysql/subscribemanage/SubscribeManageMapper.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.srbscribe.dal.mysql.subscribemanage; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 预约 Mapper + * + * @author 管理员 + */ +@Mapper +public interface SubscribeManageMapper extends BaseMapperX { + + default PageResult selectPage(SubscribeManagePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SubscribeManageDO::getUserId, reqVO.getUserId()) + .eqIfPresent(SubscribeManageDO::getType, reqVO.getType()) + .eqIfPresent(SubscribeManageDO::getStaffId, reqVO.getStaffId()) + .betweenIfPresent(SubscribeManageDO::getSubscribeTime, reqVO.getSubscribeTime()) + .eqIfPresent(SubscribeManageDO::getSubscribeStatus, reqVO.getSubscribeStatus()) + .eqIfPresent(SubscribeManageDO::getCheckStatus, reqVO.getCheckStatus()) + .betweenIfPresent(SubscribeManageDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SubscribeManageDO::getId)); + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationService.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationService.java new file mode 100644 index 0000000..a981c1e --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationService.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.srbscribe.service.organization; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO; + +import javax.validation.*; +import java.util.List; + +/** + * 机构 Service 接口 + * + * @author 管理员 + */ +public interface OrganizationService { + + /** + * 创建机构 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Integer createOrganization(@Valid OrganizationSaveReqVO createReqVO); + + /** + * 更新机构 + * + * @param updateReqVO 更新信息 + */ + void updateOrganization(@Valid OrganizationSaveReqVO updateReqVO); + + /** + * 删除机构 + * + * @param id 编号 + */ + void deleteOrganization(Integer id); + + /** + * 获得机构 + * + * @param id 编号 + * @return 机构 + */ + OrganizationDO getOrganization(Integer id); + + /** + * 获得机构分页 + * + * @param pageReqVO 分页查询 + * @return 机构分页 + */ + PageResult getOrganizationPage(OrganizationPageReqVO pageReqVO); + + /** + * 获取机构所有数据 + */ + List getOrganization(); + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationServiceImpl.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationServiceImpl.java new file mode 100644 index 0000000..8f6c2c7 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/organization/OrganizationServiceImpl.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.srbscribe.service.organization; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO; +import cn.iocoder.yudao.module.srbscribe.dal.mysql.organization.OrganizationMapper; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*; + +/** + * 机构 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class OrganizationServiceImpl implements OrganizationService { + + @Resource + private OrganizationMapper organizationMapper; + + @Override + public Integer createOrganization(OrganizationSaveReqVO createReqVO) { + // 插入 + OrganizationDO organization = BeanUtils.toBean(createReqVO, OrganizationDO.class); + organizationMapper.insert(organization); + // 返回 + return organization.getId(); + } + + @Override + public void updateOrganization(OrganizationSaveReqVO updateReqVO) { + // 校验存在 + validateOrganizationExists(updateReqVO.getId()); + // 更新 + OrganizationDO updateObj = BeanUtils.toBean(updateReqVO, OrganizationDO.class); + organizationMapper.updateById(updateObj); + } + + @Override + public void deleteOrganization(Integer id) { + // 校验存在 + validateOrganizationExists(id); + // 删除 + organizationMapper.deleteById(id); + } + + private void validateOrganizationExists(Integer id) { + if (organizationMapper.selectById(id) == null) { + throw exception(ORGANIZATION_NOT_EXISTS); + } + } + + @Override + public OrganizationDO getOrganization(Integer id) { + return organizationMapper.selectById(id); + } + + @Override + public PageResult getOrganizationPage(OrganizationPageReqVO pageReqVO) { + return organizationMapper.selectPage(pageReqVO); + } + + @Override + public List getOrganization() { + return organizationMapper.selectList(); + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffService.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffService.java new file mode 100644 index 0000000..3b102fc --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffService.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.srbscribe.service.staff; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO; + +import javax.validation.*; + +/** + * 预约人员 Service 接口 + * + * @author 管理员 + */ +public interface StaffService { + + /** + * 创建预约人员 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStaff(@Valid StaffSaveReqVO createReqVO); + + /** + * 更新预约人员 + * + * @param updateReqVO 更新信息 + */ + void updateStaff(@Valid StaffSaveReqVO updateReqVO); + + /** + * 删除预约人员 + * + * @param id 编号 + */ + void deleteStaff(Long id); + + /** + * 获得预约人员 + * + * @param id 编号 + * @return 预约人员 + */ + StaffDO getStaff(Long id); + + /** + * 获得预约人员分页 + * + * @param pageReqVO 分页查询 + * @return 预约人员分页 + */ + PageResult getStaffPage(StaffPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffServiceImpl.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffServiceImpl.java new file mode 100644 index 0000000..4498da7 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/staff/StaffServiceImpl.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.srbscribe.service.staff; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO; +import cn.iocoder.yudao.module.srbscribe.dal.mysql.organization.OrganizationMapper; +import cn.iocoder.yudao.module.srbscribe.dal.mysql.staff.StaffMapper; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*; + +/** + * 预约人员 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class StaffServiceImpl implements StaffService { + + @Resource + private StaffMapper staffMapper; + + @Resource + private OrganizationMapper organizationMapper; + + @Override + public Long createStaff(StaffSaveReqVO createReqVO) { + // 插入 + StaffDO staff = BeanUtils.toBean(createReqVO, StaffDO.class); + staffMapper.insert(staff); + // 返回 + return staff.getId(); + } + + @Override + public void updateStaff(StaffSaveReqVO updateReqVO) { + // 校验存在 + validateStaffExists(updateReqVO.getId()); + // 更新 + StaffDO updateObj = BeanUtils.toBean(updateReqVO, StaffDO.class); + staffMapper.updateById(updateObj); + } + + @Override + public void deleteStaff(Long id) { + // 校验存在 + validateStaffExists(id); + // 删除 + staffMapper.deleteById(id); + } + + private void validateStaffExists(Long id) { + if (staffMapper.selectById(id) == null) { + throw exception(STAFF_NOT_EXISTS); + } + } + + @Override + public StaffDO getStaff(Long id) { + return staffMapper.selectById(id); + } + + @Override + public PageResult getStaffPage(StaffPageReqVO pageReqVO) { + PageResult staffDOPageResult = staffMapper.selectPage(pageReqVO); + for (int i = 0; i < staffDOPageResult.getList().size(); i++) { + StaffDO staffDO = staffDOPageResult.getList().get(i); + OrganizationDO organizationDO = organizationMapper.selectOne("id", staffDO.getOrganizationId()); + staffDO.setOrganizationName(organizationDO.getName()); + } + return staffDOPageResult; + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageService.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageService.java new file mode 100644 index 0000000..7c2227c --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageService.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.module.srbscribe.service.subscribemanage; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO; + +import java.util.*; +import javax.validation.*; + + +/** + * 预约 Service 接口 + * + * @author 管理员 + */ +public interface SubscribeManageService { + + /** + * 创建预约 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createManage(@Valid SubscribeManageSaveReqVO createReqVO); + + /** + * 更新预约 + * + * @param updateReqVO 更新信息 + */ + void updateManage(@Valid SubscribeManageSaveReqVO updateReqVO); + + /** + * 删除预约 + * + * @param id 编号 + */ + void deleteManage(Long id); + + /** + * 获得预约 + * + * @param id 编号 + * @return 预约 + */ + SubscribeManageDO getManage(Long id); + + /** + * 获得预约分页 + * + * @param pageReqVO 分页查询 + * @return 预约分页 + */ + PageResult getManagePage(SubscribeManagePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageServiceImpl.java b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageServiceImpl.java new file mode 100644 index 0000000..10e7005 --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/main/java/cn/iocoder/yudao/module/srbscribe/service/subscribemanage/SubscribeManageServiceImpl.java @@ -0,0 +1,87 @@ +package cn.iocoder.yudao.module.srbscribe.service.subscribemanage; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO; +import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageSaveReqVO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO; +import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO; +import cn.iocoder.yudao.module.srbscribe.dal.mysql.staff.StaffMapper; +import cn.iocoder.yudao.module.srbscribe.dal.mysql.subscribemanage.SubscribeManageMapper; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*; + +/** + * 预约 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class SubscribeManageServiceImpl implements SubscribeManageService { + + @Resource + private SubscribeManageMapper manageMapper; + + @Resource + private StaffMapper staffMapper; + + + @Override + public Long createManage(SubscribeManageSaveReqVO createReqVO) { + // 插入 + SubscribeManageDO manage = BeanUtils.toBean(createReqVO, SubscribeManageDO.class); + manageMapper.insert(manage); + // 返回 + return manage.getId(); + } + + @Override + public void updateManage(SubscribeManageSaveReqVO updateReqVO) { + // 校验存在 + validateManageExists(updateReqVO.getId()); + // 更新 + SubscribeManageDO updateObj = BeanUtils.toBean(updateReqVO, SubscribeManageDO.class); + manageMapper.updateById(updateObj); + } + + @Override + public void deleteManage(Long id) { + // 校验存在 + validateManageExists(id); + // 删除 + manageMapper.deleteById(id); + } + + private void validateManageExists(Long id) { + if (manageMapper.selectById(id) == null) { + throw exception(MANAGE_NOT_EXISTS); + } + } + + @Override + public SubscribeManageDO getManage(Long id) { + return manageMapper.selectById(id); + } + + @Override + public PageResult getManagePage(SubscribeManagePageReqVO pageReqVO) { + + if (pageReqVO.getStaffName() != null){ + StaffDO staffDO = staffMapper.selectOne("name", pageReqVO.getStaffName()); + pageReqVO.setStaffId(staffDO.getId()); + } + + PageResult subscribeManageDOPageResult = manageMapper.selectPage(pageReqVO); + for (int i = 0; i < subscribeManageDOPageResult.getList().size(); i++) { + SubscribeManageDO subscribeManageDO = subscribeManageDOPageResult.getList().get(i); + StaffDO staffDO = staffMapper.selectOne("id", subscribeManageDO.getStaffId()); + subscribeManageDO.setStaffName(staffDO.getName());//设置预约人员名称 + } + return subscribeManageDOPageResult; + } + +} \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/clean.sql b/yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/clean.sql new file mode 100644 index 0000000..7d68f8c --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/clean.sql @@ -0,0 +1,3 @@ +DELETE FROM "subscribe_subscribe_manage"; +DELETE FROM "subscribe_organization"; +DELETE FROM "subscribe_staff"; \ No newline at end of file diff --git a/yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/create_tables.sql b/yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/create_tables.sql new file mode 100644 index 0000000..430dd1c --- /dev/null +++ b/yudao-module-subscribe/yudao-module-subscribe-biz/src/test/resources/sql/create_tables.sql @@ -0,0 +1,57 @@ +CREATE TABLE IF NOT EXISTS "subscribe_subscribe_manage" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "user_id" bigint, + "type" int, + "staff_id" bigint, + "subscribe_time" varchar, + "subscribe_status" varchar, + "check_status" int, + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "creator" varchar DEFAULT '', + "updater" varchar DEFAULT '', + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint, + PRIMARY KEY ("id") +) COMMENT '预约表'; + +CREATE TABLE IF NOT EXISTS "subscribe_organization" ( + "id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "name" varchar, + "phone" varchar, + "email" varchar, + "picture" varchar, + "address" varchar, + "depict" varchar, + "status" int, + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "creator" varchar DEFAULT '', + "updater" varchar DEFAULT '', + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint, + PRIMARY KEY ("id") +) COMMENT '机构'; + +CREATE TABLE IF NOT EXISTS "subscribe_staff" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "organization_id" bigint, + "serial_number" varchar, + "type" int, + "name" varchar, + "sex" int, + "photo" varchar, + "phone" varchar, + "service_time" varchar, + "service_scope" varchar, + "sign" int, + "status" int, + "content" varchar, + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "creator" varchar DEFAULT '', + "updater" varchar DEFAULT '', + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint, + PRIMARY KEY ("id") +) COMMENT '预约人员'; \ No newline at end of file diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 788c96e..0627011 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -65,6 +65,12 @@ ${revision} + + cn.iocoder.boot + yudao-module-subscribe-biz + ${revision} + + cn.iocoder.boot -- 2.45.2 From 8913b2215f1be482cff01771da001dc944428b5a Mon Sep 17 00:00:00 2001 From: sonjinyon <2476687577@qq.com> Date: Fri, 9 Aug 2024 15:06:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/subscribe/organization/index.ts | 52 +++ .../src/api/subscribe/staff/index.ts | 57 +++ .../api/subscribe/subscribemanage/index.ts | 45 +++ .../level/components/MemberLevelSelect.vue | 1 + .../organization/OrganizationForm.vue | 130 ++++++ .../views/subscribe/organization/index.vue | 264 +++++++++++++ .../src/views/subscribe/staff/StaffForm.vue | 242 ++++++++++++ .../src/views/subscribe/staff/index.vue | 372 ++++++++++++++++++ .../subscribe/subscribemanage/ManageForm.vue | 138 +++++++ .../views/subscribe/subscribemanage/index.vue | 273 +++++++++++++ 10 files changed, 1574 insertions(+) create mode 100644 yudao-admin-vue3/src/api/subscribe/organization/index.ts create mode 100644 yudao-admin-vue3/src/api/subscribe/staff/index.ts create mode 100644 yudao-admin-vue3/src/api/subscribe/subscribemanage/index.ts create mode 100644 yudao-admin-vue3/src/views/subscribe/organization/OrganizationForm.vue create mode 100644 yudao-admin-vue3/src/views/subscribe/organization/index.vue create mode 100644 yudao-admin-vue3/src/views/subscribe/staff/StaffForm.vue create mode 100644 yudao-admin-vue3/src/views/subscribe/staff/index.vue create mode 100644 yudao-admin-vue3/src/views/subscribe/subscribemanage/ManageForm.vue create mode 100644 yudao-admin-vue3/src/views/subscribe/subscribemanage/index.vue diff --git a/yudao-admin-vue3/src/api/subscribe/organization/index.ts b/yudao-admin-vue3/src/api/subscribe/organization/index.ts new file mode 100644 index 0000000..01ab6f5 --- /dev/null +++ b/yudao-admin-vue3/src/api/subscribe/organization/index.ts @@ -0,0 +1,52 @@ +import request from '@/config/axios' + +// 机构 VO +export interface OrganizationVO { + id: number // 机构id + name: string // 机构名称 + phone: string // 机构电话 + email: string // 机构邮箱 + picture: string // 机构图片 + address: string // 机构地址 + depict: string // 机构简介 + status: number // 状态 +} + +// 机构 API +export const OrganizationApi = { + // 查询机构分页 + getOrganizationPage: async (params: any) => { + return await request.get({ url: `/subscribe/organization/page`, params }) + }, + + // 查询机构详情 + getOrganization: async (id: number) => { + return await request.get({ url: `/subscribe/organization/get?id=` + id }) + }, + + // 新增机构 + createOrganization: async (data: OrganizationVO) => { + return await request.post({ url: `/subscribe/organization/create`, data }) + }, + + // 修改机构 + updateOrganization: async (data: OrganizationVO) => { + return await request.put({ url: `/subscribe/organization/update`, data }) + }, + + // 删除机构 + deleteOrganization: async (id: number) => { + return await request.delete({ url: `/subscribe/organization/delete?id=` + id }) + }, + + // 导出机构 Excel + exportOrganization: async (params) => { + return await request.download({ url: `/subscribe/organization/export-excel`, params }) + }, + + // 查询机构名称数据 + getOrganizations: async () => { + return await request.get({ url: `/subscribe/organization/getOrganization`}) + }, + +} \ No newline at end of file diff --git a/yudao-admin-vue3/src/api/subscribe/staff/index.ts b/yudao-admin-vue3/src/api/subscribe/staff/index.ts new file mode 100644 index 0000000..edb03b0 --- /dev/null +++ b/yudao-admin-vue3/src/api/subscribe/staff/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +// 预约人员 VO +export interface StaffVO { + id: number // id + organizationId: number // 机构id + organizationName: string + serialNumber: string // 编号 + type: number // 类型 + name: string // 名称 + sex: number // 性别 + photo: string // 照片 + phone: string // 手机号 + serviceTime: string // 服务时间段 + serviceStartTime: string + serviceEndTime: string + serviceScope: string // 服务范围 + sign: number // 约满标记 + status: number // 状态 + content: string // 介绍 +} + +// 预约人员 API +export const StaffApi = { + // 查询预约人员分页 + getStaffPage: async (params: any) => { + return await request.get({ url: `/subscribe/staff/page`, params }) + }, + + // 查询预约人员详情 + getStaff: async (id: number) => { + return await request.get({ url: `/subscribe/staff/get?id=` + id }) + }, + + // 新增预约人员 + createStaff: async (data: StaffVO) => { + return await request.post({ url: `/subscribe/staff/create`, data }) + }, + + // 修改预约人员 + updateStaff: async (data: StaffVO) => { + return await request.put({ url: `/subscribe/staff/update`, data }) + }, + + // 删除预约人员 + deleteStaff: async (id: number) => { + return await request.delete({ url: `/subscribe/staff/delete?id=` + id }) + }, + + // 导出预约人员 Excel + exportStaff: async (params) => { + return await request.download({ url: `/subscribe/staff/export-excel`, params }) + }, + + + +} \ No newline at end of file diff --git a/yudao-admin-vue3/src/api/subscribe/subscribemanage/index.ts b/yudao-admin-vue3/src/api/subscribe/subscribemanage/index.ts new file mode 100644 index 0000000..e788781 --- /dev/null +++ b/yudao-admin-vue3/src/api/subscribe/subscribemanage/index.ts @@ -0,0 +1,45 @@ +import request from '@/config/axios' + +// 预约 VO +export interface ManageVO { + id: number // 表id + userId: number // 用户id + type: number // 预约类型 + staffId: number // 预约人员id + subscribeTime: Date // 预约时间 + subscribeStatus: string // 预约状态 + checkStatus: number // 审核状态 +} + +// 预约 API +export const ManageApi = { + // 查询预约分页 + getManagePage: async (params: any) => { + return await request.get({ url: `/subscribe/manage/page`, params }) + }, + + // 查询预约详情 + getManage: async (id: number) => { + return await request.get({ url: `/subscribe/manage/get?id=` + id }) + }, + + // 新增预约 + createManage: async (data: ManageVO) => { + return await request.post({ url: `/subscribe/manage/create`, data }) + }, + + // 修改预约 + updateManage: async (data: ManageVO) => { + return await request.put({ url: `/subscribe/manage/update`, data }) + }, + + // 删除预约 + deleteManage: async (id: number) => { + return await request.delete({ url: `/subscribe/manage/delete?id=` + id }) + }, + + // 导出预约 Excel + exportManage: async (params) => { + return await request.download({ url: `/subscribe/manage/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/member/level/components/MemberLevelSelect.vue b/yudao-admin-vue3/src/views/member/level/components/MemberLevelSelect.vue index 2a603e6..e885da3 100644 --- a/yudao-admin-vue3/src/views/member/level/components/MemberLevelSelect.vue +++ b/yudao-admin-vue3/src/views/member/level/components/MemberLevelSelect.vue @@ -36,6 +36,7 @@ const levelOptions = ref([]) const getList = async () => { levelOptions.value = await LevelApi.getSimpleLevelList() + console.log('2222222',levelOptions.value) } /** 初始化 */ diff --git a/yudao-admin-vue3/src/views/subscribe/organization/OrganizationForm.vue b/yudao-admin-vue3/src/views/subscribe/organization/OrganizationForm.vue new file mode 100644 index 0000000..b37de29 --- /dev/null +++ b/yudao-admin-vue3/src/views/subscribe/organization/OrganizationForm.vue @@ -0,0 +1,130 @@ + + \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/subscribe/organization/index.vue b/yudao-admin-vue3/src/views/subscribe/organization/index.vue new file mode 100644 index 0000000..61b54c7 --- /dev/null +++ b/yudao-admin-vue3/src/views/subscribe/organization/index.vue @@ -0,0 +1,264 @@ + + + \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/subscribe/staff/StaffForm.vue b/yudao-admin-vue3/src/views/subscribe/staff/StaffForm.vue new file mode 100644 index 0000000..e65669d --- /dev/null +++ b/yudao-admin-vue3/src/views/subscribe/staff/StaffForm.vue @@ -0,0 +1,242 @@ + + \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/subscribe/staff/index.vue b/yudao-admin-vue3/src/views/subscribe/staff/index.vue new file mode 100644 index 0000000..8df95db --- /dev/null +++ b/yudao-admin-vue3/src/views/subscribe/staff/index.vue @@ -0,0 +1,372 @@ + + + diff --git a/yudao-admin-vue3/src/views/subscribe/subscribemanage/ManageForm.vue b/yudao-admin-vue3/src/views/subscribe/subscribemanage/ManageForm.vue new file mode 100644 index 0000000..970864c --- /dev/null +++ b/yudao-admin-vue3/src/views/subscribe/subscribemanage/ManageForm.vue @@ -0,0 +1,138 @@ + + \ No newline at end of file diff --git a/yudao-admin-vue3/src/views/subscribe/subscribemanage/index.vue b/yudao-admin-vue3/src/views/subscribe/subscribemanage/index.vue new file mode 100644 index 0000000..cdb6ce8 --- /dev/null +++ b/yudao-admin-vue3/src/views/subscribe/subscribemanage/index.vue @@ -0,0 +1,273 @@ + + + \ No newline at end of file -- 2.45.2