feat:款项
This commit is contained in:
1 parent
4791451af3
commit
b899a3a4c5
4 files changed
+109
-71
No files matched your search
@@ -399,8 +399,9 @@ CREATE TABLE wallet_recharge_invoice
|
||||
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 '状态',
|
||||
item_json varchar(2048) DEFAULT NULL COMMENT '备注',
|
||||
remark varchar(1024) DEFAULT NULL COMMENT '备注',
|
||||
status varchar(32) DEFAULT NULL 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 '修改人',
|
||||
|
||||
+76
-69
@@ -6,6 +6,7 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -19,106 +20,112 @@ import java.time.LocalDateTime;
|
||||
public class WalletRechargeInvoiceEntity extends Model<WalletRechargeInvoiceEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键ID")
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 申请id
|
||||
*/
|
||||
@Schema(description="申请id")
|
||||
/**
|
||||
* 申请id
|
||||
*/
|
||||
@Schema(description = "申请id")
|
||||
private Long applyId;
|
||||
|
||||
/**
|
||||
* 发票代码(七位数)
|
||||
*/
|
||||
@Schema(description="发票代码(七位数)")
|
||||
/**
|
||||
* 发票代码(七位数)
|
||||
*/
|
||||
@Schema(description = "发票代码(七位数)")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 发票日期
|
||||
*/
|
||||
@Schema(description="发票日期")
|
||||
/**
|
||||
* 发票日期
|
||||
*/
|
||||
@Schema(description = "发票日期")
|
||||
private LocalDateTime time;
|
||||
|
||||
/**
|
||||
* 交款单位或个人
|
||||
*/
|
||||
@Schema(description="交款单位或个人")
|
||||
/**
|
||||
* 交款单位或个人
|
||||
*/
|
||||
@Schema(description = "交款单位或个人")
|
||||
private String deptOrUser;
|
||||
|
||||
/**
|
||||
* 合计人民币
|
||||
*/
|
||||
@Schema(description="合计人民币")
|
||||
/**
|
||||
* 合计人民币
|
||||
*/
|
||||
@Schema(description = "合计人民币")
|
||||
private Integer totalPrice;
|
||||
|
||||
/**
|
||||
* 收款单位
|
||||
*/
|
||||
@Schema(description="收款单位")
|
||||
/**
|
||||
* 收款单位
|
||||
*/
|
||||
@Schema(description = "收款单位")
|
||||
private String payeeDept;
|
||||
|
||||
/**
|
||||
* 收款人
|
||||
*/
|
||||
@Schema(description="收款人")
|
||||
/**
|
||||
* 收款人
|
||||
*/
|
||||
@Schema(description = "收款人")
|
||||
private String payeeUser;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description="状态")
|
||||
/**
|
||||
* 款项json
|
||||
*/
|
||||
@Schema(description = "款项json")
|
||||
private String itemJson;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.recharge;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 充值/扣款申请发票记录款项
|
||||
*/
|
||||
@Data
|
||||
public class WalletRechargeInvoiceEntityItemVo {
|
||||
|
||||
/**
|
||||
* 款项内容
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 款项金额
|
||||
*/
|
||||
private double price;
|
||||
|
||||
}
|
||||
+9
@@ -1,6 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
@@ -12,6 +15,7 @@ import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletSettingService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceEntityItemVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceEntityVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeImportMapper;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeInvoiceMapper;
|
||||
@@ -76,6 +80,10 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
|
||||
Integer totalPrice = importList.stream().map(WalletRechargeImportEntity::getPrice).reduce(Integer::sum).orElse(0);
|
||||
// 转换为元
|
||||
double price = BigDecimal.valueOf(totalPrice).divide(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
// 生成款项
|
||||
WalletRechargeInvoiceEntityItemVo item = new WalletRechargeInvoiceEntityItemVo();
|
||||
item.setName(LocalDateTimeUtil.format(applyDetail.getImportTime(), DatePattern.NORM_MONTH_PATTERN));
|
||||
item.setPrice(price);
|
||||
|
||||
WalletRechargeInvoiceEntityVo result = new WalletRechargeInvoiceEntityVo();
|
||||
result.setApplyId(applyDetail.getId());
|
||||
@@ -87,6 +95,7 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
|
||||
result.setPayeeDept(walletSetting.getTopupDeptStr());
|
||||
result.setPayeeUser(payeeUser);
|
||||
result.setStatus(WalletRechargeInvoiceStatusEnum.DEFAULT.getCode());
|
||||
result.setItemJson(JSONUtil.toJsonStr(item));
|
||||
result.setRemark("");
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user