feat:批量充值/扣款发票生成

This commit is contained in:
dzc committed 2025-06-24 10:24:46 +08:00
1 parent 65e43b0821
commit 2d3226d970
12 files changed
+323 -1

No files matched your search

+27
View File
@@ -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
-- ----------------------------
@@ -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<WalletRechargeInvoiceEntity> {
/**
* 主键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;
}
@@ -0,0 +1,12 @@
package com.bsd.pjcloud.wallet.api.vo.recharge;
import lombok.Data;
/**
* 充值扣款发票信息
*/
@Data
public class WalletApplyInvoiceVo {
}
@@ -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<WalletApplyInvoiceVo> getInvoice(@RequestParam Long id) {
return R.ok(walletRechargeApplyService.getInvoice(id));
}
@Operation(summary = "提交申请", description = "提交申请")
@SysLog("提交申请")
@GetMapping("/apply")
@@ -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<WalletRechargeInvoiceEntity> 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<WalletRechargeInvoiceEntity> export(WalletRechargeInvoiceEntity walletRechargeInvoice, Long[] ids) {
return walletRechargeInvoiceService.list(Wrappers.lambdaQuery(walletRechargeInvoice).in(ArrayUtil.isNotEmpty(ids), WalletRechargeInvoiceEntity::getId, ids));
}
}
@@ -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<WalletRechargeInvoiceEntity> {
}
@@ -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);
}
@@ -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<WalletRechargeApply
Boolean edit(WalletRechargeApplyDto dto);
/**
* 批量充值/扣款发票信息
*/
WalletApplyInvoiceVo getInvoice(Long id);
/**
* 通过id删除充值/扣款申请
*/
@@ -0,0 +1,8 @@
package com.bsd.pjcloud.wallet.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
public interface WalletRechargeInvoiceService extends IService<WalletRechargeInvoiceEntity> {
}
@@ -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<WalletRechargeAp
return true;
}
/**
* 批量充值/扣款发票信息
*/
@Override
public WalletApplyInvoiceVo getInvoice(Long id) {
return null;
}
/**
* 通过id删除充值/扣款申请
*/
@@ -0,0 +1,13 @@
package com.bsd.pjcloud.wallet.service.impl.recharge;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeInvoiceMapper;
import com.bsd.pjcloud.wallet.service.WalletRechargeInvoiceService;
import org.springframework.stereotype.Service;
/**
* 充值/扣款申请发票记录
*/
@Service
public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRechargeInvoiceMapper, WalletRechargeInvoiceEntity> implements WalletRechargeInvoiceService {
}
@@ -0,0 +1,24 @@
<?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="com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeInvoiceMapper">
<resultMap id="walletRechargeInvoiceMap" type="com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity">
<id property="id" column="id"/>
<result property="applyId" column="apply_id"/>
<result property="code" column="code"/>
<result property="time" column="time"/>
<result property="deptOrUser" column="dept_or_user"/>
<result property="totalPrice" column="total_price"/>
<result property="payeeDept" column="payee_dept"/>
<result property="payeeUser" column="payee_user"/>
<result property="remark" column="remark"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
</mapper>