diff --git a/db/800pjcloudx_wallet.sql b/db/800pjcloudx_wallet.sql index b8bcbc595..6d996aeca 100644 --- a/db/800pjcloudx_wallet.sql +++ b/db/800pjcloudx_wallet.sql @@ -385,6 +385,33 @@ CREATE TABLE wallet_recharge_apply COLLATE = utf8mb4_general_ci COMMENT ='充值申请表'; CREATE INDEX idx_dept_id ON wallet_recharge_apply (user_id); +-- ---------------------------- +-- Table structure for wallet_recharge_invoice +-- ---------------------------- +DROP TABLE IF EXISTS wallet_recharge_invoice; +CREATE TABLE wallet_recharge_invoice +( + id bigint NOT NULL COMMENT '主键ID', + apply_id bigint NOT NULL COMMENT '申请id', + code varchar(32) NOT NULL COMMENT '发票代码(七位数)', + time datetime DEFAULT NULL COMMENT '发票日期', + dept_or_user varchar(64) DEFAULT NULL COMMENT '交款单位或个人', + total_price int DEFAULT NULL COMMENT '合计人民币', + payee_dept varchar(64) DEFAULT NULL COMMENT '收款单位', + payee_user varchar(64) DEFAULT NULL COMMENT '收款人', + remark varchar(1024) DEFAULT '' COMMENT '备注', + status varchar(32) DEFAULT '' COMMENT '状态', + create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', + create_time datetime DEFAULT NULL COMMENT '创建时间', + update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人', + update_time datetime DEFAULT NULL COMMENT '修改时间', + del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记', + tenant_id bigint DEFAULT NULL COMMENT '租户ID', + PRIMARY KEY (id) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT ='充值申请发票表'; + -- ---------------------------- -- Table structure for wallet_recharge_import -- ---------------------------- diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/recharge/WalletRechargeInvoiceEntity.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/recharge/WalletRechargeInvoiceEntity.java new file mode 100644 index 000000000..26dfdd249 --- /dev/null +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/recharge/WalletRechargeInvoiceEntity.java @@ -0,0 +1,124 @@ +package com.bsd.pjcloud.wallet.api.entity.recharge; + +import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.bsd.pjcloud.common.core.util.TenantTable; +import java.time.LocalDateTime; + +/** + * 充值/扣款申请发票记录 + */ +@Data +@TenantTable +@TableName("wallet_recharge_invoice") +@EqualsAndHashCode(callSuper = true) +@Schema(description = "充值/扣款申请发票记录") +public class WalletRechargeInvoiceEntity extends Model { + + + /** + * 主键ID + */ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description="主键ID") + private Long id; + + /** + * 申请id + */ + @Schema(description="申请id") + private Long applyId; + + /** + * 发票代码(七位数) + */ + @Schema(description="发票代码(七位数)") + private String code; + + /** + * 发票日期 + */ + @Schema(description="发票日期") + private LocalDateTime time; + + /** + * 交款单位或个人 + */ + @Schema(description="交款单位或个人") + private String deptOrUser; + + /** + * 合计人民币 + */ + @Schema(description="合计人民币") + private Integer totalPrice; + + /** + * 收款单位 + */ + @Schema(description="收款单位") + private String payeeDept; + + /** + * 收款人 + */ + @Schema(description="收款人") + private String payeeUser; + + /** + * 备注 + */ + @Schema(description="备注") + private String remark; + + /** + * 状态 + */ + @Schema(description="状态") + private String status; + + /** + * 创建人 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description="创建人") + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description="创建时间") + private LocalDateTime createTime; + + /** + * 修改人 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description="修改人") + private String updateBy; + + /** + * 修改时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description="修改时间") + private LocalDateTime updateTime; + + /** + * 删除标记 + */ + @TableLogic + @TableField(fill = FieldFill.INSERT) + @Schema(description="删除标记") + private String delFlag; + + /** + * 租户ID + */ + @Schema(description="租户ID") + private Long tenantId; +} \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletApplyInvoiceVo.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletApplyInvoiceVo.java new file mode 100644 index 000000000..eed6fbaf4 --- /dev/null +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletApplyInvoiceVo.java @@ -0,0 +1,12 @@ +package com.bsd.pjcloud.wallet.api.vo.recharge; + +import lombok.Data; + +/** + * 充值扣款发票信息 + */ +@Data +public class WalletApplyInvoiceVo { + + +} diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java index 3caa85ad5..3553138eb 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java @@ -14,6 +14,7 @@ import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto; import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto; import com.bsd.pjcloud.wallet.api.dto.recharge.excel.WalletRechargeExcelDto; import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity; +import com.bsd.pjcloud.wallet.api.vo.recharge.WalletApplyInvoiceVo; import com.bsd.pjcloud.wallet.api.vo.recharge.excel.WalletRechargeByApplyExcelVo; import com.bsd.pjcloud.wallet.service.WalletRechargeApplyService; import com.bsd.pjcloud.wallet.service.WalletRechargeApplyComposeService; @@ -54,6 +55,12 @@ public class WalletRechargeApplyController { return R.ok(walletTransactionComposeService.pageJoin(page, dto)); } + @GetMapping("/get-invoice") + @Operation(summary = "批量充值/扣款发票信息") + public R getInvoice(@RequestParam Long id) { + return R.ok(walletRechargeApplyService.getInvoice(id)); + } + @Operation(summary = "提交申请", description = "提交申请") @SysLog("提交申请") @GetMapping("/apply") diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java new file mode 100644 index 000000000..310c9e416 --- /dev/null +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java @@ -0,0 +1,82 @@ +package com.bsd.pjcloud.wallet.controller.recharge; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bsd.pjcloud.common.core.util.R; +import com.bsd.pjcloud.common.log.annotation.SysLog; +import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity; +import com.bsd.pjcloud.wallet.service.WalletRechargeInvoiceService; +import org.springframework.security.access.prepost.PreAuthorize; +import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import org.springdoc.core.annotations.ParameterObject; +import org.springframework.http.HttpHeaders; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Objects; + +/** + * 充值/扣款申请发票记录 + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/walletRechargeInvoice") +@Tag(description = "walletRechargeInvoice", name = "充值/扣款申请发票记录管理") +@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) +public class WalletRechargeInvoiceController { + + private final WalletRechargeInvoiceService walletRechargeInvoiceService; + + @Operation(summary = "分页查询", description = "分页查询") + @GetMapping("/page") + @PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_view')") + public R getWalletRechargeInvoicePage(@ParameterObject Page page, @ParameterObject WalletRechargeInvoiceEntity walletRechargeInvoice) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + return R.ok(walletRechargeInvoiceService.page(page, wrapper)); + } + + @Operation(summary = "通过id查询", description = "通过id查询") + @GetMapping("/{id}") + @PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_view')") + public R getById(@PathVariable("id") Long id) { + return R.ok(walletRechargeInvoiceService.getById(id)); + } + + @Operation(summary = "新增充值/扣款申请发票记录", description = "新增充值/扣款申请发票记录") + @SysLog("新增充值/扣款申请发票记录") + @PostMapping + @PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_add')") + public R save(@RequestBody WalletRechargeInvoiceEntity walletRechargeInvoice) { + return R.ok(walletRechargeInvoiceService.save(walletRechargeInvoice)); + } + + @Operation(summary = "修改充值/扣款申请发票记录", description = "修改充值/扣款申请发票记录") + @SysLog("修改充值/扣款申请发票记录") + @PutMapping + @PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_edit')") + public R updateById(@RequestBody WalletRechargeInvoiceEntity walletRechargeInvoice) { + return R.ok(walletRechargeInvoiceService.updateById(walletRechargeInvoice)); + } + + @Operation(summary = "通过id删除充值/扣款申请发票记录", description = "通过id删除充值/扣款申请发票记录") + @SysLog("通过id删除充值/扣款申请发票记录") + @DeleteMapping + @PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_del')") + public R removeById(@RequestBody Long[] ids) { + return R.ok(walletRechargeInvoiceService.removeBatchByIds(CollUtil.toList(ids))); + } + + @ResponseExcel + @GetMapping("/export") + @PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_export')") + public List export(WalletRechargeInvoiceEntity walletRechargeInvoice, Long[] ids) { + return walletRechargeInvoiceService.list(Wrappers.lambdaQuery(walletRechargeInvoice).in(ArrayUtil.isNotEmpty(ids), WalletRechargeInvoiceEntity::getId, ids)); + } +} \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargeInvoiceMapper.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargeInvoiceMapper.java new file mode 100644 index 000000000..f210863f8 --- /dev/null +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargeInvoiceMapper.java @@ -0,0 +1,10 @@ +package com.bsd.pjcloud.wallet.mapper.recharge; + +import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper; +import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface WalletRechargeInvoiceMapper extends PjcloudBaseMapper { + +} \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyComposeService.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyComposeService.java index 1b0298d92..a773c73e4 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyComposeService.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyComposeService.java @@ -2,10 +2,10 @@ package com.bsd.pjcloud.wallet.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto; +import com.bsd.pjcloud.wallet.api.vo.recharge.WalletApplyInvoiceVo; import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyCompareAceVo; public interface WalletRechargeApplyComposeService { WalletRechargeApplyCompareAceVo pageJoin(Page page, WalletRechargeApplyDto dto); - } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyService.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyService.java index b4628cfb2..72199fbf5 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyService.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/WalletRechargeApplyService.java @@ -8,6 +8,7 @@ import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto; import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto; import com.bsd.pjcloud.wallet.api.dto.recharge.excel.WalletRechargeExcelDto; import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity; +import com.bsd.pjcloud.wallet.api.vo.recharge.WalletApplyInvoiceVo; import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo; import com.bsd.pjcloud.wallet.api.vo.recharge.excel.WalletRechargeByApplyExcelVo; import org.springframework.validation.BindingResult; @@ -21,6 +22,11 @@ public interface WalletRechargeApplyService extends IService { + +} \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java index 2221fecc8..8cd08a19d 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java @@ -46,6 +46,7 @@ import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity; import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity; import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil; import com.bsd.pjcloud.wallet.api.vo.WalletManageVo; +import com.bsd.pjcloud.wallet.api.vo.recharge.WalletApplyInvoiceVo; import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo; import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeImportVo; import com.bsd.pjcloud.wallet.api.vo.recharge.excel.WalletRechargeByApplyExcelVo; @@ -124,6 +125,14 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl implements WalletRechargeInvoiceService { +} \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml new file mode 100644 index 000000000..617e41c0e --- /dev/null +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file