发票的功能生成
This commit is contained in:
@ -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, "开票记录不存在");
|
||||
}
|
||||
|
||||
|
@ -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<String> createBilling(@Valid @RequestBody BillingSaveReqVO createReqVO) {
|
||||
return success(billingService.createBilling(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新开票记录")
|
||||
@PreAuthorize("@ss.hasPermission('t:billing:update')")
|
||||
public CommonResult<Boolean> 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<Boolean> 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<BillingRespVO> 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<PageResult<BillingRespVO>> getBillingPage(@Valid BillingPageReqVO pageReqVO) {
|
||||
PageResult<BillingDO> 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<BillingDO> list = billingService.getBillingPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "开票记录.xls", "数据", BillingRespVO.class,
|
||||
BeanUtils.toBean(list, BillingRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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<Long> createInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO createReqVO) {
|
||||
return success(invoiceInformationService.createInvoiceInformation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户发票信息")
|
||||
@PreAuthorize("@ss.hasPermission('t:invoice-information:update')")
|
||||
public CommonResult<Boolean> 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<Boolean> 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<InvoiceInformationRespVO> 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<PageResult<InvoiceInformationRespVO>> getInvoiceInformationPage(@Valid InvoiceInformationPageReqVO pageReqVO) {
|
||||
PageResult<InvoiceInformationDO> 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<InvoiceInformationDO> list = invoiceInformationService.getInvoiceInformationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户发票信息.xls", "数据", InvoiceInformationRespVO.class,
|
||||
BeanUtils.toBean(list, InvoiceInformationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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<String> createBilling(@Valid @RequestBody BillingSaveReqVO createReqVO) {
|
||||
return success(billingService.createBilling(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新开票记录")
|
||||
public CommonResult<Boolean> updateBilling(@Valid @RequestBody BillingSaveReqVO updateReqVO) {
|
||||
billingService.updateBilling(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除开票记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> 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<BillingRespVO> getBilling(@RequestParam("id") String id) {
|
||||
BillingDO billing = billingService.getBilling(id);
|
||||
return success(BeanUtils.toBean(billing, BillingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得开票记录分页")
|
||||
public CommonResult<PageResult<BillingRespVO>> getBillingPage(@Valid BillingPageReqVO pageReqVO) {
|
||||
PageResult<BillingDO> pageResult = billingService.getBillingPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BillingRespVO.class));
|
||||
}
|
||||
}
|
@ -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<Long> createInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO createReqVO) {
|
||||
return success(invoiceInformationService.createInvoiceInformation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户发票信息")
|
||||
public CommonResult<Boolean> updateInvoiceInformation(@Valid @RequestBody InvoiceInformationSaveReqVO updateReqVO) {
|
||||
invoiceInformationService.updateInvoiceInformation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户发票信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> 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<InvoiceInformationRespVO> getInvoiceInformation(@RequestParam("id") Long id) {
|
||||
InvoiceInformationDO invoiceInformation = invoiceInformationService.getInvoiceInformation(id);
|
||||
return success(BeanUtils.toBean(invoiceInformation, InvoiceInformationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户发票信息分页")
|
||||
public CommonResult<PageResult<InvoiceInformationRespVO>> getInvoiceInformationPage(@Valid InvoiceInformationPageReqVO pageReqVO) {
|
||||
PageResult<InvoiceInformationDO> 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<InvoiceInformationDO> list = invoiceInformationService.getInvoiceInformationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户发票信息.xls", "数据", InvoiceInformationRespVO.class,
|
||||
BeanUtils.toBean(list, InvoiceInformationRespVO.class));
|
||||
}*/
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -104,4 +104,6 @@ public class OrderSpaceCapsuleDO extends BaseDO {
|
||||
private String machineNum;
|
||||
private String phone;
|
||||
private String spaceName;
|
||||
private Boolean billingExist;
|
||||
private String billingNum;
|
||||
}
|
@ -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<BillingDO> {
|
||||
|
||||
default PageResult<BillingDO> selectPage(BillingPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BillingDO>()
|
||||
.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));
|
||||
}
|
||||
|
||||
}
|
@ -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<InvoiceInformationDO> {
|
||||
|
||||
default PageResult<InvoiceInformationDO> selectPage(InvoiceInformationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<InvoiceInformationDO>()
|
||||
.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));
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
@ -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<BillingDO> getBillingPage(BillingPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -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<BillingDO> getBillingPage(BillingPageReqVO pageReqVO) {
|
||||
return billingMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -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<InvoiceInformationDO> getInvoiceInformationPage(InvoiceInformationPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -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<InvoiceInformationDO> getInvoiceInformationPage(InvoiceInformationPageReqVO pageReqVO) {
|
||||
return invoiceInformationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.t.dal.mysql.billing.BillingMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.member.dal.mysql.invoiceinformation.InvoiceInformationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user