修改充值
This commit is contained in:
parent
794a7efa3e
commit
615500f7b6
@ -51,6 +51,19 @@ public class UserConsumptionDetailsController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:details:list')")
|
||||
@GetMapping("/list/show")
|
||||
@ApiOperation("查询用户充值卡账单明细记录展示列表")
|
||||
public TableDataInfo Showlist(UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
startPage();
|
||||
List<UserConsumptionDetails> list = userConsumptionDetailsService.selectUserConsumptionDetailsShowList(userConsumptionDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户充值卡账单明细记录列表
|
||||
*/
|
||||
|
@ -22,7 +22,6 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "NgUserRechargeRecords",description = "用户充值记录 ng_user_recharge_records")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
public class NgUserRechargeRecords extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -22,7 +22,6 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
@ApiModel(value = "UserConsumptionDetails",description = "用户充值卡账单明细记录 user_consumption_details")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
public class UserConsumptionDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -101,19 +100,19 @@ public class UserConsumptionDetails extends BaseEntity
|
||||
private BigDecimal billingPeriodDuration;
|
||||
|
||||
/** 账单生成的日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("账单生成的日期")
|
||||
private Date billingDate;
|
||||
|
||||
/** 开泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("开泵时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 关泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("关泵时间")
|
||||
private Date endTime;
|
||||
@ -129,7 +128,7 @@ public class UserConsumptionDetails extends BaseEntity
|
||||
private Integer paymentMethod;
|
||||
|
||||
/** 账单支付的时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(" 账单支付的时间")
|
||||
private Date paymentTime;
|
||||
|
@ -9,5 +9,5 @@ public class RechargecardUser {
|
||||
private String cardnumber;
|
||||
private BigDecimal number;
|
||||
private Integer status;
|
||||
private String Areacode;
|
||||
private String areacode;
|
||||
}
|
||||
|
@ -0,0 +1,131 @@
|
||||
package com.fastbee.rechargecard.domain.dto;
|
||||
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
@Data
|
||||
@Builder
|
||||
public class UserConsumptionDetailsDto {
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 关联用户 */
|
||||
@Excel(name = "关联用户")
|
||||
@ApiModelProperty("关联用户")
|
||||
private Long userId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
@ApiModelProperty("设备编码")
|
||||
private String deviceNumber;
|
||||
|
||||
/** 购水卡卡号 */
|
||||
@Excel(name = "购水卡卡号")
|
||||
@ApiModelProperty("购水卡卡号")
|
||||
private String cardNumber;
|
||||
|
||||
/** 所属项目id */
|
||||
@Excel(name = "所属项目id")
|
||||
@ApiModelProperty("所属项目id")
|
||||
private Long projectId;
|
||||
|
||||
/** 所属机构 */
|
||||
@Excel(name = "所属机构")
|
||||
@ApiModelProperty("所属机构")
|
||||
private Long deptId;
|
||||
|
||||
/** 0充值,1刷卡(灌溉消费:刷卡开泵到刷卡关泵期间产生的消费) */
|
||||
@Excel(name = "0充值,1刷卡(灌溉消费:刷卡开泵到刷卡关泵期间产生的消费)")
|
||||
@ApiModelProperty("0充值,1刷卡(灌溉消费:刷卡开泵到刷卡关泵期间产生的消费)")
|
||||
private Integer billingType;
|
||||
|
||||
/** 开泵时长 */
|
||||
@Excel(name = "开泵时长")
|
||||
@ApiModelProperty("开泵时长")
|
||||
private BigDecimal pumpTime;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价(数量 * 单价) */
|
||||
@Excel(name = "总价", readConverterExp = "数=量,*=,单=价")
|
||||
@ApiModelProperty("总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 折扣金额 */
|
||||
@Excel(name = "折扣金额")
|
||||
@ApiModelProperty("折扣金额")
|
||||
private BigDecimal discount;
|
||||
|
||||
/** 税金 */
|
||||
@Excel(name = "税金")
|
||||
@ApiModelProperty("税金")
|
||||
private BigDecimal taxAmount;
|
||||
|
||||
/** 应付金额(总价-折扣金额-税金) */
|
||||
@Excel(name = "应付金额", readConverterExp = "总=价-折扣金额-税金")
|
||||
@ApiModelProperty("应付金额")
|
||||
private BigDecimal amountDue;
|
||||
|
||||
/** 账单所属的周期单位,0:小时、1:天、2:周、3:月、4:季度、5:年 */
|
||||
@Excel(name = "账单所属的周期单位,0:小时、1:天、2:周、3:月、4:季度、5:年")
|
||||
@ApiModelProperty("账单所属的周期单位,0:小时、1:天、2:周、3:月、4:季度、5:年")
|
||||
private Integer billingPeriodUnit;
|
||||
|
||||
/** 账单周期时长 */
|
||||
@Excel(name = "账单周期时长")
|
||||
@ApiModelProperty("账单周期时长")
|
||||
private BigDecimal billingPeriodDuration;
|
||||
|
||||
/** 账单生成的日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("账单生成的日期")
|
||||
private Date billingDate;
|
||||
|
||||
/** 开泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("开泵时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 关泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("关泵时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 表明账单是否已支付,0:“未支付”、1:“部分支付”、2:“已支付” */
|
||||
@Excel(name = "表明账单是否已支付,0:“未支付”、1:“部分支付”、2:“已支付”")
|
||||
@ApiModelProperty("表明账单是否已支付,0:“未支付”、1:“部分支付”、2:“已支付”")
|
||||
private Integer paymentStatus;
|
||||
|
||||
/** 用户支付账单的方式1微信,2支付宝,3银联 */
|
||||
@Excel(name = "用户支付账单的方式1微信,2支付宝,3银联")
|
||||
@ApiModelProperty("用户支付账单的方式1微信,2支付宝,3银联")
|
||||
private Integer paymentMethod;
|
||||
|
||||
/** 账单支付的时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
|
||||
@Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(" 账单支付的时间")
|
||||
private Date paymentTime;
|
||||
|
||||
/** 账单的当前状态,0:已支付、1:已取消 */
|
||||
@Excel(name = "账单的当前状态,0:已支付、1:已取消")
|
||||
@ApiModelProperty("账单的当前状态,0:已支付、1:已取消")
|
||||
private Integer status;
|
||||
|
||||
/** 区域码 */
|
||||
@Excel(name = "区域码")
|
||||
@ApiModelProperty("区域码")
|
||||
private String areaCode;
|
||||
public String userName;
|
||||
}
|
@ -37,6 +37,14 @@ public interface IUserConsumptionDetailsService
|
||||
*/
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsList(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 查询用户充值卡账单明细记录展示列表
|
||||
*
|
||||
* @param userConsumptionDetails 用户充值卡账单明细记录
|
||||
* @return 用户充值卡账单明细记录集合
|
||||
*/
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsShowList(UserConsumptionDetails userConsumptionDetails);
|
||||
|
||||
/**
|
||||
* 新增用户充值卡账单明细记录
|
||||
*
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.fastbee.rechargecard.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.rechargecard.domain.dto.UserConsumptionDetailsDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.rechargecard.mapper.UserConsumptionDetailsMapper;
|
||||
@ -61,6 +63,18 @@ public class UserConsumptionDetailsServiceImpl implements IUserConsumptionDetail
|
||||
return userConsumptionDetailsMapper.selectUserConsumptionDetailsList(userConsumptionDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserConsumptionDetails> selectUserConsumptionDetailsShowList(UserConsumptionDetails userConsumptionDetails)
|
||||
{
|
||||
List<UserConsumptionDetailsDto> result=new ArrayList<>();
|
||||
for(int i=0;i<result.size();i++)
|
||||
{
|
||||
/*UserConsumptionDetailsDto temp=UserConsumptionDetailsDto
|
||||
temp*/
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户充值卡账单明细记录
|
||||
*
|
||||
|
@ -129,8 +129,24 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
|
||||
// 如果没有找到对应的记录,返回0或者一个错误码
|
||||
return 0;
|
||||
}
|
||||
/*UserConsumptionDetails userConsumptionDetails=new UserConsumptionDetails();
|
||||
userConsumptionDetails.setUserId(info.getUserId());
|
||||
userConsumptionDetails.setCardNumber(info.getCardNumber());
|
||||
userConsumptionDetails.setBillingType(0);
|
||||
userConsumptionDetails.setAmountDue(rechargecardUser.getNumber());
|
||||
userConsumptionDetails.setBillingDate(DateUtils.getNowDate());
|
||||
userConsumptionDetails.setPaymentStatus(2);
|
||||
userConsumptionDetails.setPaymentMethod(rechargecardUser.getStatus());
|
||||
userConsumptionDetails.setPaymentTime(DateUtils.getNowDate());
|
||||
userConsumptionDetails.setStatus(0);
|
||||
userConsumptionDetails.setAreaCode(rechargecardUser.getAreacode());
|
||||
userConsumptionDetails.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
NgUserRechargeRecords ngUserRechargeRecords=new NgUserRechargeRecords();
|
||||
ngUserRechargeRecords.setUserId(info.getUserId());*/
|
||||
|
||||
// 计算新的余额
|
||||
BigDecimal newBalance = rechargecardUser.getNumber().add(info.getBalance());
|
||||
/*BigDecimal newBalance = rechargecardUser.getNumber().add(info.getBalance());
|
||||
UserConsumptionDetails userConsumptionDetails = UserConsumptionDetails.builder()
|
||||
.userId(info.getUserId())
|
||||
.cardNumber(info.getCardNumber())
|
||||
@ -142,8 +158,11 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
|
||||
.paymentTime(DateUtils.getNowDate()) // 获取当前日期
|
||||
.status(0)
|
||||
.areaCode(rechargecardUser.getAreacode()) // 假设 getAreacode() 方法返回区域代码
|
||||
.build();
|
||||
userConsumptionDetails.setCreateTime(DateUtils.getNowDate());
|
||||
.build();*/
|
||||
|
||||
|
||||
|
||||
/* userConsumptionDetails.setCreateTime(DateUtils.getNowDate());
|
||||
NgUserRechargeRecords ngUserRechargeRecords = NgUserRechargeRecords.builder()
|
||||
.userId(info.getUserId()).userName(info.getUserName())
|
||||
.cardNumber(info.getCardNumber()).areaCode(rechargecardUser.getAreacode())
|
||||
@ -151,12 +170,16 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
|
||||
.balance(info.getBalance()).rechargeTime(DateUtils.getNowDate())
|
||||
.rechargeCode(null).status(0).serialNumber(null).deviceNumber(null).projectId(null)
|
||||
.deptId(null)
|
||||
.areaCode(rechargecardUser.getAreacode())
|
||||
.build();
|
||||
userRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords);
|
||||
userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails);
|
||||
// 更新用户充值卡信息,包括新的余额
|
||||
info.setBalance(newBalance);
|
||||
info.setUpdateTime(DateUtils.getNowDate());
|
||||
return userRechargeCardsMapper.updateUserRechargeCards(info);
|
||||
info.setAreaCode(rechargecardUser.getAreacode());
|
||||
return userRechargeCardsMapper.updateUserRechargeCards(info);*/
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user