From b2f572e926af3539af9fc5b84222e4ad637f29e3 Mon Sep 17 00:00:00 2001 From: qjq <1766193529@qq.com> Date: Mon, 11 Nov 2024 13:36:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=9A=84=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/enums/ErrorCodeConstants.java | 4 + .../admin/billing/BillingController.java | 96 +++++++++++++++++++ .../admin/billing/vo/BillingPageReqVO.java | 65 +++++++++++++ .../admin/billing/vo/BillingRespVO.java | 79 +++++++++++++++ .../admin/billing/vo/BillingSaveReqVO.java | 67 +++++++++++++ .../InvoiceInformationController.java | 96 +++++++++++++++++++ .../vo/InvoiceInformationPageReqVO.java | 43 +++++++++ .../vo/InvoiceInformationRespVO.java | 52 ++++++++++ .../vo/InvoiceInformationSaveReqVO.java | 39 ++++++++ .../app/billing/AppBillingController.java | 65 +++++++++++++ .../AppInvoiceInformationController.java | 80 ++++++++++++++++ .../dal/dataobject/billing/BillingDO.java | 89 +++++++++++++++++ .../InvoiceInformationDO.java | 59 ++++++++++++ .../OrderSpaceCapsuleDO.java | 2 + .../dal/mysql/billing/BillingMapper.java | 39 ++++++++ .../InvoiceInformationMapper.java | 32 +++++++ .../yudao/module/member/enums/TypeEnum.java | 22 +++++ .../service/billing/BillingService.java | 56 +++++++++++ .../service/billing/BillingServiceImpl.java | 75 +++++++++++++++ .../InvoiceInformationService.java | 55 +++++++++++ .../InvoiceInformationServiceImpl.java | 72 ++++++++++++++ .../OrderSpaceCapsuleServiceImpl.java | 4 +- .../mapper/billing/BillingMapper.xml | 12 +++ .../InvoiceInformationMapper.xml | 12 +++ 24 files changed, 1213 insertions(+), 2 deletions(-) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/BillingController.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingPageReqVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingRespVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingSaveReqVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/InvoiceInformationController.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationPageReqVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationRespVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationSaveReqVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/billing/AppBillingController.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/invoiceinformation/AppInvoiceInformationController.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/billing/BillingDO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/invoiceinformation/InvoiceInformationDO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/billing/BillingMapper.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/invoiceinformation/InvoiceInformationMapper.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/TypeEnum.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingService.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingServiceImpl.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationService.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationServiceImpl.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/billing/BillingMapper.xml create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/invoiceinformation/InvoiceInformationMapper.xml diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java index 57fd9795..1c34d008 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java @@ -143,5 +143,9 @@ public interface ErrorCodeConstants { ErrorCode STORE_REFUND_NOT_STATISTICS_EXISTS = new ErrorCode(1_004_023_001, "太空舱营业不存在"); ErrorCode STATISTICS_SPACE_CAPSULE_ORDER_NOT_EXISTS = new ErrorCode(1_004_021_001, "太空舱订单营业额统计不存在"); + + ErrorCode INVOICE_INFORMATION_NOT_EXISTS = new ErrorCode(1_004_022_001, "用户发票信息不存在"); + + ErrorCode BILLING_NOT_EXISTS = new ErrorCode(1_004_023_00, "开票记录不存在"); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/BillingController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/BillingController.java new file mode 100644 index 00000000..ed69838b --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/BillingController.java @@ -0,0 +1,96 @@ +package cn.iocoder.yudao.module.member.controller.admin.billing; + +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingRespVO; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.billing.BillingDO; +import cn.iocoder.yudao.module.member.service.billing.BillingService; +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.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.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - 开票记录") +@RestController +@RequestMapping("/t/billing") +@Validated +public class BillingController { + + @Resource + private BillingService billingService; + + @PostMapping("/create") + @Operation(summary = "创建开票记录") + @PreAuthorize("@ss.hasPermission('t:billing:create')") + public CommonResult createBilling(@Valid @RequestBody BillingSaveReqVO createReqVO) { + return success(billingService.createBilling(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新开票记录") + @PreAuthorize("@ss.hasPermission('t:billing:update')") + public CommonResult updateBilling(@Valid @RequestBody BillingSaveReqVO updateReqVO) { + billingService.updateBilling(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除开票记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('t:billing:delete')") + public CommonResult deleteBilling(@RequestParam("id") String id) { + billingService.deleteBilling(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得开票记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('t:billing:query')") + public CommonResult getBilling(@RequestParam("id") String id) { + BillingDO billing = billingService.getBilling(id); + return success(BeanUtils.toBean(billing, BillingRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得开票记录分页") + @PreAuthorize("@ss.hasPermission('t:billing:query')") + public CommonResult> getBillingPage(@Valid BillingPageReqVO pageReqVO) { + PageResult pageResult = billingService.getBillingPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BillingRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出开票记录 Excel") + @PreAuthorize("@ss.hasPermission('t:billing:export')") + @OperateLog(type = EXPORT) + public void exportBillingExcel(@Valid BillingPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = billingService.getBillingPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "开票记录.xls", "数据", BillingRespVO.class, + BeanUtils.toBean(list, BillingRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingPageReqVO.java new file mode 100644 index 00000000..575c814f --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingPageReqVO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.member.controller.admin.billing.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.math.BigDecimal; +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 BillingPageReqVO extends PageParam { + + @Schema(description = "用户名称", example = "王五") + private String userName; + + @Schema(description = "用户手机号") + private String userPhone; + + @Schema(description = "申请开票时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] requestBillingTime; + + @Schema(description = "发票金额") + private BigDecimal billingMoney; + + @Schema(description = "开票人,谁要开票", example = "6477") + private Long userId; + + @Schema(description = "开票主体.(发票抬头)", example = "30533") + private Long invoiceId; + + @Schema(description = "0开票中,1开票完成,2开票回拒", example = "2") + private Integer status; + + @Schema(description = "同意人。谁通过的", example = "21936") + private Long systemId; + + @Schema(description = "0食堂发票,1超市发票,2太空舱发票", example = "2") + private Integer billingType; + + @Schema(description = "拒绝理由") + private String refuseDetails; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "拒绝时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] refuseTime; + + @Schema(description = "pdf地址", example = "https://www.iocoder.cn") + private String pdfUrl; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + @Schema(description = "发票商品名称") + private String billingName; +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingRespVO.java new file mode 100644 index 00000000..20bc1715 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingRespVO.java @@ -0,0 +1,79 @@ +package cn.iocoder.yudao.module.member.controller.admin.billing.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 开票记录 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BillingRespVO { + + @Schema(description = "发票编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24631") + @ExcelProperty("发票编号") + private String id; + + @Schema(description = "用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("用户名称") + private String userName; + + @Schema(description = "用户手机号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("用户手机号") + private String userPhone; + + @Schema(description = "申请开票时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("申请开票时间") + private LocalDateTime requestBillingTime; + + @Schema(description = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("发票金额") + private BigDecimal billingMoney; + + @Schema(description = "开票人,谁要开票", requiredMode = Schema.RequiredMode.REQUIRED, example = "6477") + @ExcelProperty("开票人,谁要开票") + private Long userId; + + @Schema(description = "开票主体.(发票抬头)", requiredMode = Schema.RequiredMode.REQUIRED, example = "30533") + @ExcelProperty("开票主体.(发票抬头)") + private Long invoiceId; + + @Schema(description = "0开票中,1开票完成,2开票回拒", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("0开票中,1开票完成,2开票回拒") + private Integer status; + + @Schema(description = "同意人。谁通过的", example = "21936") + @ExcelProperty("同意人。谁通过的") + private Long systemId; + + @Schema(description = "0食堂发票,1超市发票,2太空舱发票", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("0食堂发票,1超市发票,2太空舱发票") + private Integer billingType; + + @Schema(description = "拒绝理由") + @ExcelProperty("拒绝理由") + private String refuseDetails; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "拒绝时间") + @ExcelProperty("拒绝时间") + private LocalDateTime refuseTime; + + @Schema(description = "pdf地址", example = "https://www.iocoder.cn") + @ExcelProperty("pdf地址") + private String pdfUrl; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + @Schema(description = "发票商品名称") + @ExcelProperty("发票商品名称") + private String billingName; +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingSaveReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingSaveReqVO.java new file mode 100644 index 00000000..0ce7e340 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/billing/vo/BillingSaveReqVO.java @@ -0,0 +1,67 @@ +package cn.iocoder.yudao.module.member.controller.admin.billing.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 开票记录新增/修改 Request VO") +@Data +public class BillingSaveReqVO { + + @Schema(description = "发票编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24631") + private String id; + + @Schema(description = "用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "用户名称不能为空") + private String userName; + + @Schema(description = "用户手机号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "用户手机号不能为空") + private String userPhone; + + @Schema(description = "申请开票时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "申请开票时间不能为空") + private LocalDateTime requestBillingTime; + + @Schema(description = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "发票金额不能为空") + private BigDecimal billingMoney; + + @Schema(description = "开票人,谁要开票", requiredMode = Schema.RequiredMode.REQUIRED, example = "6477") + @NotNull(message = "开票人,谁要开票不能为空") + private Long userId; + + @Schema(description = "开票主体.(发票抬头)", requiredMode = Schema.RequiredMode.REQUIRED, example = "30533") + @NotNull(message = "开票主体.(发票抬头)不能为空") + private Long invoiceId; + + @Schema(description = "0开票中,1开票完成,2开票回拒", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "0开票中,1开票完成,2开票回拒不能为空") + private Integer status; + + @Schema(description = "同意人。谁通过的", example = "21936") + private Long systemId; + + @Schema(description = "0食堂发票,1超市发票,2太空舱发票", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "0食堂发票,1超市发票,2太空舱发票不能为空") + private Integer billingType; + + @Schema(description = "拒绝理由") + private String refuseDetails; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "拒绝时间") + private LocalDateTime refuseTime; + + @Schema(description = "pdf地址", example = "https://www.iocoder.cn") + private String pdfUrl; + @Schema(description = "发票商品名称") + private String billingName; + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/InvoiceInformationController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/InvoiceInformationController.java new file mode 100644 index 00000000..58bdae10 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/InvoiceInformationController.java @@ -0,0 +1,96 @@ +package cn.iocoder.yudao.module.member.controller.admin.invoiceinformation; + +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationRespVO; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation.InvoiceInformationDO; +import cn.iocoder.yudao.module.member.service.invoiceinformation.InvoiceInformationService; +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.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.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + + +@Tag(name = "管理后台 - 用户发票信息") +@RestController +@RequestMapping("/t/invoice-information") +@Validated +public class InvoiceInformationController { + + @Resource + private InvoiceInformationService invoiceInformationService; + + @PostMapping("/create") + @Operation(summary = "创建用户发票信息") + @PreAuthorize("@ss.hasPermission('t:invoice-information:create')") + public CommonResult createInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO createReqVO) { + return success(invoiceInformationService.createInvoiceInformation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新用户发票信息") + @PreAuthorize("@ss.hasPermission('t:invoice-information:update')") + public CommonResult updateInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO updateReqVO) { + invoiceInformationService.updateInvoiceInformation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除用户发票信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('t:invoice-information:delete')") + public CommonResult deleteInvoiceInformation(@RequestParam("id") Long id) { + invoiceInformationService.deleteInvoiceInformation(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得用户发票信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('t:invoice-information:query')") + public CommonResult getInvoiceInformation(@RequestParam("id") Long id) { + InvoiceInformationDO invoiceInformation = invoiceInformationService.getInvoiceInformation(id); + return success(BeanUtils.toBean(invoiceInformation, InvoiceInformationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得用户发票信息分页") + @PreAuthorize("@ss.hasPermission('t:invoice-information:query')") + public CommonResult> getInvoiceInformationPage(@Valid InvoiceInformationPageReqVO pageReqVO) { + PageResult pageResult = invoiceInformationService.getInvoiceInformationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, InvoiceInformationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出用户发票信息 Excel") + @PreAuthorize("@ss.hasPermission('t:invoice-information:export')") + @OperateLog(type = EXPORT) + public void exportInvoiceInformationExcel(@Valid InvoiceInformationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = invoiceInformationService.getInvoiceInformationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "用户发票信息.xls", "数据", InvoiceInformationRespVO.class, + BeanUtils.toBean(list, InvoiceInformationRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationPageReqVO.java new file mode 100644 index 00000000..19157bf7 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationPageReqVO.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.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 InvoiceInformationPageReqVO extends PageParam { + + @Schema(description = "名称", example = "王五") + private String name; + + @Schema(description = "税号") + private String taxNum; + + @Schema(description = "单位地址") + private String unitAddress; + + @Schema(description = "用户编号", example = "16335") + private Long userId; + + @Schema(description = "电话号码") + private String phoneNum; + + @Schema(description = "开户银行") + private String accountBank; + + @Schema(description = "银行账户") + private String bankNum; + + @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-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationRespVO.java new file mode 100644 index 00000000..967a7a7f --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationRespVO.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 用户发票信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class InvoiceInformationRespVO { + + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1489") + @ExcelProperty("编号") + private Long id; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("名称") + private String name; + + @Schema(description = "税号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("税号") + private String taxNum; + + @Schema(description = "单位地址") + @ExcelProperty("单位地址") + private String unitAddress; + + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "16335") + @ExcelProperty("用户编号") + private Long userId; + + @Schema(description = "电话号码") + @ExcelProperty("电话号码") + private String phoneNum; + + @Schema(description = "开户银行") + @ExcelProperty("开户银行") + private String accountBank; + + @Schema(description = "银行账户") + @ExcelProperty("银行账户") + private String bankNum; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationSaveReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationSaveReqVO.java new file mode 100644 index 00000000..b051780d --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/invoiceinformation/vo/InvoiceInformationSaveReqVO.java @@ -0,0 +1,39 @@ +package cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.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 InvoiceInformationSaveReqVO { + + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1489") + private Long id; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "名称不能为空") + private String name; + + @Schema(description = "税号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "税号不能为空") + private String taxNum; + + @Schema(description = "单位地址") + private String unitAddress; + + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "16335") + @NotNull(message = "用户编号不能为空") + private Long userId; + + @Schema(description = "电话号码") + private String phoneNum; + + @Schema(description = "开户银行") + private String accountBank; + + @Schema(description = "银行账户") + private String bankNum; + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/billing/AppBillingController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/billing/AppBillingController.java new file mode 100644 index 00000000..5b8351a5 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/billing/AppBillingController.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.member.controller.app.billing; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingRespVO; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.billing.BillingDO; +import cn.iocoder.yudao.module.member.service.billing.BillingService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import javax.validation.Valid; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + + +@Tag(name = "小程序 - 开票记录") +@RestController +@RequestMapping("/t/billing") +@Validated +public class AppBillingController { + + @Resource + private BillingService billingService; + + @PostMapping("/create") + @Operation(summary = "创建开票记录") + public CommonResult createBilling(@Valid @RequestBody BillingSaveReqVO createReqVO) { + return success(billingService.createBilling(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新开票记录") + public CommonResult updateBilling(@Valid @RequestBody BillingSaveReqVO updateReqVO) { + billingService.updateBilling(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除开票记录") + @Parameter(name = "id", description = "编号", required = true) + public CommonResult deleteBilling(@RequestParam("id") String id) { + billingService.deleteBilling(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得开票记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getBilling(@RequestParam("id") String id) { + BillingDO billing = billingService.getBilling(id); + return success(BeanUtils.toBean(billing, BillingRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得开票记录分页") + public CommonResult> getBillingPage(@Valid BillingPageReqVO pageReqVO) { + PageResult pageResult = billingService.getBillingPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BillingRespVO.class)); + } +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/invoiceinformation/AppInvoiceInformationController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/invoiceinformation/AppInvoiceInformationController.java new file mode 100644 index 00000000..8ec452c6 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/invoiceinformation/AppInvoiceInformationController.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.member.controller.app.invoiceinformation; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationRespVO; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation.InvoiceInformationDO; +import cn.iocoder.yudao.module.member.service.invoiceinformation.InvoiceInformationService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + + +@Tag(name = "小程序 - 用户发票信息") +@RestController +@RequestMapping("/t/invoice-information") +@Validated +public class AppInvoiceInformationController { + + @Resource + private InvoiceInformationService invoiceInformationService; + + @PostMapping("/create") + @Operation(summary = "创建用户发票信息") + public CommonResult createInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO createReqVO) { + return success(invoiceInformationService.createInvoiceInformation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新用户发票信息") + public CommonResult updateInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO updateReqVO) { + invoiceInformationService.updateInvoiceInformation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除用户发票信息") + @Parameter(name = "id", description = "编号", required = true) + public CommonResult deleteInvoiceInformation(@RequestParam("id") Long id) { + invoiceInformationService.deleteInvoiceInformation(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得用户发票信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getInvoiceInformation(@RequestParam("id") Long id) { + InvoiceInformationDO invoiceInformation = invoiceInformationService.getInvoiceInformation(id); + return success(BeanUtils.toBean(invoiceInformation, InvoiceInformationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得用户发票信息分页") + public CommonResult> getInvoiceInformationPage(@Valid InvoiceInformationPageReqVO pageReqVO) { + PageResult pageResult = invoiceInformationService.getInvoiceInformationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, InvoiceInformationRespVO.class)); + } + + /*@GetMapping("/export-excel") + @Operation(summary = "导出用户发票信息 Excel") + @OperateLog(type = EXPORT) + public void exportInvoiceInformationExcel(@Valid InvoiceInformationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = invoiceInformationService.getInvoiceInformationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "用户发票信息.xls", "数据", InvoiceInformationRespVO.class, + BeanUtils.toBean(list, InvoiceInformationRespVO.class)); + }*/ + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/billing/BillingDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/billing/BillingDO.java new file mode 100644 index 00000000..5c82df48 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/billing/BillingDO.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.member.dal.dataobject.billing; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.math.BigDecimal; +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("t_billing") +@KeySequence("t_billing_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BillingDO extends BaseDO { + + /** + * 发票编号 + */ + @TableId(type = IdType.INPUT) + private String id; + /** + * 用户名称 + */ + private String userName; + /** + * 用户手机号 + */ + private String userPhone; + /** + * 申请开票时间 + */ + private LocalDateTime requestBillingTime; + /** + * 发票金额 + */ + private BigDecimal billingMoney; + /** + * 开票人,谁要开票 + */ + private Long userId; + /** + * 开票主体.(发票抬头) + */ + private Long invoiceId; + /** + * 0开票中,1开票完成,2开票回拒 + */ + private Integer status; + /** + * 同意人。谁通过的 + */ + private Long systemId; + /** + * 0食堂发票,1超市发票,2太空舱发票 + */ + private Integer billingType; + /** + * 拒绝理由 + */ + private String refuseDetails; + /** + * 备注 + */ + private String remark; + /** + * 拒绝时间 + */ + private LocalDateTime refuseTime; + /** + * pdf地址 + */ + private String pdfUrl; + /** + * 发票商品名称 + */ + private String billingName; +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/invoiceinformation/InvoiceInformationDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/invoiceinformation/InvoiceInformationDO.java new file mode 100644 index 00000000..0ef68dcb --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/invoiceinformation/InvoiceInformationDO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation; + +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("t_invoice_information") +@KeySequence("t_invoice_information_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class InvoiceInformationDO extends BaseDO { + + /** + * 编号 + */ + @TableId + private Long id; + /** + * 名称 + */ + private String name; + /** + * 税号 + */ + private String taxNum; + /** + * 单位地址 + */ + private String unitAddress; + /** + * 用户编号 + */ + private Long userId; + /** + * 电话号码 + */ + private String phoneNum; + /** + * 开户银行 + */ + private String accountBank; + /** + * 银行账户 + */ + private String bankNum; + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/orderspacecapsule/OrderSpaceCapsuleDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/orderspacecapsule/OrderSpaceCapsuleDO.java index f34dd3f7..ccf1c247 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/orderspacecapsule/OrderSpaceCapsuleDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/orderspacecapsule/OrderSpaceCapsuleDO.java @@ -104,4 +104,6 @@ public class OrderSpaceCapsuleDO extends BaseDO { private String machineNum; private String phone; private String spaceName; + private Boolean billingExist; + private String billingNum; } \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/billing/BillingMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/billing/BillingMapper.java new file mode 100644 index 00000000..9d1593f0 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/billing/BillingMapper.java @@ -0,0 +1,39 @@ +package cn.iocoder.yudao.module.member.dal.mysql.billing; + +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.member.controller.admin.billing.vo.BillingPageReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.billing.BillingDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 开票记录 Mapper + * + * @author 管理员 + */ +@Mapper +public interface BillingMapper extends BaseMapperX { + + default PageResult selectPage(BillingPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(BillingDO::getUserName, reqVO.getUserName()) + .eqIfPresent(BillingDO::getUserPhone, reqVO.getUserPhone()) + .betweenIfPresent(BillingDO::getRequestBillingTime, reqVO.getRequestBillingTime()) + .eqIfPresent(BillingDO::getBillingMoney, reqVO.getBillingMoney()) + .eqIfPresent(BillingDO::getUserId, reqVO.getUserId()) + .eqIfPresent(BillingDO::getInvoiceId, reqVO.getInvoiceId()) + .eqIfPresent(BillingDO::getStatus, reqVO.getStatus()) + .eqIfPresent(BillingDO::getSystemId, reqVO.getSystemId()) + .eqIfPresent(BillingDO::getBillingType, reqVO.getBillingType()) + .eqIfPresent(BillingDO::getRefuseDetails, reqVO.getRefuseDetails()) + .eqIfPresent(BillingDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(BillingDO::getRefuseTime, reqVO.getRefuseTime()) + .eqIfPresent(BillingDO::getPdfUrl, reqVO.getPdfUrl()) + .betweenIfPresent(BillingDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(BillingDO::getId)); + } + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/invoiceinformation/InvoiceInformationMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/invoiceinformation/InvoiceInformationMapper.java new file mode 100644 index 00000000..ff29179d --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/invoiceinformation/InvoiceInformationMapper.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.member.dal.mysql.invoiceinformation; + + +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.member.controller.admin.invoiceinformation.vo.InvoiceInformationPageReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation.InvoiceInformationDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户发票信息 Mapper + * + * @author 管理员 + */ +@Mapper +public interface InvoiceInformationMapper extends BaseMapperX { + + default PageResult selectPage(InvoiceInformationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(InvoiceInformationDO::getName, reqVO.getName()) + .eqIfPresent(InvoiceInformationDO::getTaxNum, reqVO.getTaxNum()) + .eqIfPresent(InvoiceInformationDO::getUnitAddress, reqVO.getUnitAddress()) + .eqIfPresent(InvoiceInformationDO::getUserId, reqVO.getUserId()) + .eqIfPresent(InvoiceInformationDO::getPhoneNum, reqVO.getPhoneNum()) + .eqIfPresent(InvoiceInformationDO::getAccountBank, reqVO.getAccountBank()) + .eqIfPresent(InvoiceInformationDO::getBankNum, reqVO.getBankNum()) + .betweenIfPresent(InvoiceInformationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(InvoiceInformationDO::getId)); + } + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/TypeEnum.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/TypeEnum.java new file mode 100644 index 00000000..a490bb4e --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/enums/TypeEnum.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.member.enums; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum TypeEnum { + TYPE_CANTEEN("1", "食堂"), + TYPE_SUPERMARKET("2", "超市"), + TYPE_SPACE_CAPSULE("3", "太空舱"); + + /** + * 编码 + */ + private final String code; + /** + * 类型 + */ + private final String name; +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingService.java new file mode 100644 index 00000000..d8e9c632 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingService.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.member.service.billing; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.billing.BillingDO; + +import java.util.*; +import javax.validation.*; + +/** + * 开票记录 Service 接口 + * + * @author 管理员 + */ +public interface BillingService { + + /** + * 创建开票记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createBilling(@Valid BillingSaveReqVO createReqVO); + + /** + * 更新开票记录 + * + * @param updateReqVO 更新信息 + */ + void updateBilling(@Valid BillingSaveReqVO updateReqVO); + + /** + * 删除开票记录 + * + * @param id 编号 + */ + void deleteBilling(String id); + + /** + * 获得开票记录 + * + * @param id 编号 + * @return 开票记录 + */ + BillingDO getBilling(String id); + + /** + * 获得开票记录分页 + * + * @param pageReqVO 分页查询 + * @return 开票记录分页 + */ + PageResult getBillingPage(BillingPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingServiceImpl.java new file mode 100644 index 00000000..1dda2caf --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/billing/BillingServiceImpl.java @@ -0,0 +1,75 @@ +package cn.iocoder.yudao.module.member.service.billing; + +import cn.hutool.core.lang.UUID; +import cn.hutool.core.util.IdUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.billing.vo.BillingSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.billing.BillingDO; +import cn.iocoder.yudao.module.member.dal.mysql.billing.BillingMapper; +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.member.enums.ErrorCodeConstants.BILLING_NOT_EXISTS; + +/** + * 开票记录 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class BillingServiceImpl implements BillingService { + + @Resource + private BillingMapper billingMapper; + + @Override + public String createBilling(BillingSaveReqVO createReqVO) { + // 插入 + BillingDO billing = BeanUtils.toBean(createReqVO, BillingDO.class); + //这里使用雪花算法 作为主键 + billing.setId(IdUtil.getSnowflakeNextId()+""); + billingMapper.insert(billing); + // 返回 + return billing.getId(); + } + @Override + public void updateBilling(BillingSaveReqVO updateReqVO) { + // 校验存在 + validateBillingExists(updateReqVO.getId()); + // 更新 + BillingDO updateObj = BeanUtils.toBean(updateReqVO, BillingDO.class); + billingMapper.updateById(updateObj); + } + + @Override + public void deleteBilling(String id) { + // 校验存在 + validateBillingExists(id); + // 删除 + billingMapper.deleteById(id); + } + + private void validateBillingExists(String id) { + if (billingMapper.selectById(id) == null) { + throw exception(BILLING_NOT_EXISTS); + } + } + + @Override + public BillingDO getBilling(String id) { + return billingMapper.selectById(id); + } + + @Override + public PageResult getBillingPage(BillingPageReqVO pageReqVO) { + return billingMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationService.java new file mode 100644 index 00000000..bef8b84a --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationService.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.member.service.invoiceinformation; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation.InvoiceInformationDO; + +import javax.validation.*; + +/** + * 用户发票信息 Service 接口 + * + * @author 管理员 + */ +public interface InvoiceInformationService { + + /** + * 创建用户发票信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createInvoiceInformation(@Valid InvoiceInformationSaveReqVO createReqVO); + + /** + * 更新用户发票信息 + * + * @param updateReqVO 更新信息 + */ + void updateInvoiceInformation(@Valid InvoiceInformationSaveReqVO updateReqVO); + + /** + * 删除用户发票信息 + * + * @param id 编号 + */ + void deleteInvoiceInformation(Long id); + + /** + * 获得用户发票信息 + * + * @param id 编号 + * @return 用户发票信息 + */ + InvoiceInformationDO getInvoiceInformation(Long id); + + /** + * 获得用户发票信息分页 + * + * @param pageReqVO 分页查询 + * @return 用户发票信息分页 + */ + PageResult getInvoiceInformationPage(InvoiceInformationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationServiceImpl.java new file mode 100644 index 00000000..e85accf8 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/invoiceinformation/InvoiceInformationServiceImpl.java @@ -0,0 +1,72 @@ +package cn.iocoder.yudao.module.member.service.invoiceinformation; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.invoiceinformation.vo.InvoiceInformationSaveReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.invoiceinformation.InvoiceInformationDO; +import cn.iocoder.yudao.module.member.dal.mysql.invoiceinformation.InvoiceInformationMapper; +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.member.enums.ErrorCodeConstants.INVOICE_INFORMATION_NOT_EXISTS; + +/** + * 用户发票信息 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class InvoiceInformationServiceImpl implements InvoiceInformationService { + + @Resource + private InvoiceInformationMapper invoiceInformationMapper; + + @Override + public Long createInvoiceInformation(InvoiceInformationSaveReqVO createReqVO) { + // 插入 + InvoiceInformationDO invoiceInformation = BeanUtils.toBean(createReqVO, InvoiceInformationDO.class); + invoiceInformationMapper.insert(invoiceInformation); + // 返回 + return invoiceInformation.getId(); + } + + @Override + public void updateInvoiceInformation(InvoiceInformationSaveReqVO updateReqVO) { + // 校验存在 + validateInvoiceInformationExists(updateReqVO.getId()); + // 更新 + InvoiceInformationDO updateObj = BeanUtils.toBean(updateReqVO, InvoiceInformationDO.class); + invoiceInformationMapper.updateById(updateObj); + } + + @Override + public void deleteInvoiceInformation(Long id) { + // 校验存在 + validateInvoiceInformationExists(id); + // 删除 + invoiceInformationMapper.deleteById(id); + } + + private void validateInvoiceInformationExists(Long id) { + if (invoiceInformationMapper.selectById(id) == null) { + throw exception(INVOICE_INFORMATION_NOT_EXISTS); + } + } + + @Override + public InvoiceInformationDO getInvoiceInformation(Long id) { + return invoiceInformationMapper.selectById(id); + } + + @Override + public PageResult getInvoiceInformationPage(InvoiceInformationPageReqVO pageReqVO) { + return invoiceInformationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/orderspacecapsule/OrderSpaceCapsuleServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/orderspacecapsule/OrderSpaceCapsuleServiceImpl.java index 650cecd2..fc3527d6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/orderspacecapsule/OrderSpaceCapsuleServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/orderspacecapsule/OrderSpaceCapsuleServiceImpl.java @@ -235,8 +235,8 @@ public class OrderSpaceCapsuleServiceImpl implements OrderSpaceCapsuleService { SpaceCapsuleDO payNum = spaceCapsuleService.getPayNum(adminVo.getZfCode()); OrderSpaceCapsuleDO capsuleDO=new OrderSpaceCapsuleDO(); if(adminVo.getType().equals("0")){ - capsuleDO.setComboNum(9999); - capsuleDO.setComboMinutes(9999); + capsuleDO.setComboNum(24); + capsuleDO.setComboMinutes(60); handleFirstOpening(capsuleDO,payNum); }else if(adminVo.getType().equals("2")){ capsuleDO.setComboNum(5); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/billing/BillingMapper.xml b/yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/billing/BillingMapper.xml new file mode 100644 index 00000000..eea4a1a4 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/billing/BillingMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/invoiceinformation/InvoiceInformationMapper.xml b/yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/invoiceinformation/InvoiceInformationMapper.xml new file mode 100644 index 00000000..6ed56539 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/resources/mapper/invoiceinformation/InvoiceInformationMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file