添加区域码和设备编码字段

This commit is contained in:
ALEI_ALEI
2024-12-19 19:54:34 +08:00
parent 5d8e9db6c1
commit d3aedb6399
13 changed files with 92 additions and 50 deletions

View File

@@ -84,4 +84,19 @@ public class NgUserRechargeRecords extends BaseEntity
@ApiModelProperty("充值机编码")
private String serialNumber;
/** 设备编码 */
@Excel(name = "设备编码")
@ApiModelProperty("设备编码")
private String deviceNumber;
/** 项目编码 */
@Excel(name = "项目编码")
@ApiModelProperty("项目编码")
private Long projectId;
/** 机构id */
@Excel(name = "机构id")
@ApiModelProperty("机构id")
private Long deptId;
}

View File

@@ -5,7 +5,6 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -17,12 +16,11 @@ import com.fastbee.common.core.domain.BaseEntity;
* 用户充值卡账单明细记录对象 user_consumption_details
*
* @author kerwincui
* @date 2024-12-18
* @date 2024-12-19
*/
@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 +99,19 @@ public class UserConsumptionDetails extends BaseEntity
private BigDecimal billingPeriodDuration;
/** 账单生成的日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("账单生成的日期")
private Date billingDate;
/** 开泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("开泵时间")
private Date startTime;
/** 关泵时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("关泵时间")
private Date endTime;
@@ -129,7 +127,7 @@ public class UserConsumptionDetails extends BaseEntity
private Integer paymentMethod;
/** 账单支付的时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty(" 账单支付的时间")
private Date paymentTime;
@@ -139,9 +137,9 @@ public class UserConsumptionDetails extends BaseEntity
@ApiModelProperty("账单的当前状态0已支付、1已取消")
private Integer status;
/** 关于账单的额外信息或备注 */
@Excel(name = "关于账单的额外信息或备注")
@ApiModelProperty("关于账单的额外信息或备注")
private String remark;
/** 区域码 */
@Excel(name = "区域码")
@ApiModelProperty("区域码")
private String areaCode;
}

View File

@@ -20,6 +20,13 @@ public interface NgIrrigationControllersMapper
* @return 灌溉控制器信息
*/
public NgIrrigationControllers selectNgIrrigationControllersById(Long id);
/**
* 查询灌溉控制器信息
*
* @param serialNumber 灌溉控制器编码
* @return 灌溉控制器信息
*/
public NgIrrigationControllers selectNgIrrigationControllersBySerialNumber(String serialNumber);
/**
* 查询灌溉控制器信息列表

View File

@@ -28,6 +28,13 @@ public interface UserRechargeCardsMapper extends MPJBaseMapper<UserRechargeCards
* @return 用户充值卡
*/
public UserRechargeCards selectUserRechargeCardsById(Long id);
/**
* 查询用户充值卡
*
* @param cardNumber
* @return 用户充值卡
*/
public UserRechargeCards selectUserRechargeCardsByCardNumber(String cardNumber);
/**
* card_number查询用户充值卡

View File

@@ -69,5 +69,5 @@ public interface IUserRechargeCardsService
* @return 结果
*/
public int updateUserRecharge(RechargecardUser rechargecardUser);
/*public int updateUserRecharge(RechargecardUser rechargecardUser);*/
}

View File

@@ -54,6 +54,8 @@ public class NgUserRechargeRecordsServiceImpl implements INgUserRechargeRecordsS
public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords)
{
ngUserRechargeRecords.setCreateTime(DateUtils.getNowDate());
ngUserRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords);
return ngUserRechargeRecordsMapper.insertNgUserRechargeRecords(ngUserRechargeRecords);
}

View File

@@ -5,7 +5,9 @@ import java.util.ArrayList;
import java.util.List;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.iot.mapper.DeviceMapper;
import com.fastbee.rechargecard.domain.NgIrrigationControllers;
import com.fastbee.rechargecard.domain.dto.UserIrrigationRecordDto;
import com.fastbee.rechargecard.mapper.NgIrrigationControllersMapper;
import com.fastbee.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -27,7 +29,8 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private DeviceMapper deviceMapper;
private NgIrrigationControllersMapper ngIrrigationControllersMapper;
@Override
public List<UserIrrigationRecordDto> selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord) {
@@ -38,7 +41,7 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName()==null ? "" :sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName() == null ? "":deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName();
temp.deviceName=ngIrrigationControllersMapper.selectNgIrrigationControllersBySerialNumber(list.get(i).getDeviceNumber()).getControllerName() == null ? "":ngIrrigationControllersMapper.selectNgIrrigationControllersBySerialNumber(list.get(i).getDeviceNumber()).getControllerName();
temp.cardNumber=list.get(i).getCardNumber() == null ? "" : list.get(i).getCardNumber();
temp.flow=list.get(i).getCurFlow()==null ? BigDecimal.valueOf(0) :list.get(i).getCurFlow();
temp.startTime=list.get(i).getStartTime()==null ? null : list.get(i).getStartTime();
@@ -65,7 +68,7 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer
UserIrrigationRecordDto temp=new UserIrrigationRecordDto();
temp.id=list.get(i).getId();
temp.userName= sysUserMapper.selectUserById(list.get(i).getUserId()).getUserName();
temp.deviceName=deviceMapper.selectDeviceBySerialNumber(list.get(i).getDeviceNumber()).getDeviceName();
temp.deviceName=ngIrrigationControllersMapper.selectNgIrrigationControllersBySerialNumber(list.get(i).getDeviceNumber()).getControllerName();
temp.cardNumber=list.get(i).getCardNumber();
temp.flow=list.get(i).getCurFlow();
temp.startTime=list.get(i).getStartTime();

View File

@@ -116,7 +116,7 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
*
* @return 结果
*/
@Override
/*@Override
public int updateUserRecharge(RechargecardUser rechargecardUser){
// 根据id查询用户充值卡信息
@@ -127,34 +127,17 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
}
// 计算新的余额
BigDecimal newBalance = rechargecardUser.getNumber().add(info.getBalance());
UserConsumptionDetails userConsumptionDetails = UserConsumptionDetails.builder()
.userId(info.getUserId())
.deviceNumber(null) // 确保业务逻辑可以处理 null 值
.cardNumber(info.getCardNumber())
.projectId(null) // 确保业务逻辑可以处理 null 值
.deptId(null) // 确保业务逻辑可以处理 null 值
.billingType(0)
.pumpTime(null) // 确保业务逻辑可以处理 null 值
.unitPrice(null) // 确保业务逻辑可以处理 null 值
.totalPrice(null) // 确保业务逻辑可以处理 null 值
.discount(null) // 确保业务逻辑可以处理 null 值
.taxAmount(null) // 确保业务逻辑可以处理 null 值
.amountDue(rechargecardUser.getNumber())
.billingPeriodUnit(null) // 确保业务逻辑可以处理 null 值
.billingPeriodDuration(null) // 确保业务逻辑可以处理 null 值
.billingDate(DateUtils.getNowDate()) // 获取当前日期
.startTime(null) // 确保业务逻辑可以处理 null 值
.endTime(null) // 确保业务逻辑可以处理 null 值
.paymentStatus(2)
.paymentMethod(rechargecardUser.getStatus())
.paymentTime(DateUtils.getNowDate()) // 获取当前日期
.status(0)
.remark(null) // 确保业务逻辑可以处理 null 值
.build();
UserConsumptionDetails userConsumptionDetails= UserConsumptionDetails.builder()
.userId(info.getUserId()).deviceNumber(null).cardNumber(info.getCardNumber())
.projectId(null).deptId(null).billingType(0).pumpTime(null).unitPrice(null).totalPrice(null)
.discount(null).taxAmount(null).amountDue(rechargecardUser.getNumber()).billingPeriodUnit(null).billingPeriodDuration(null)
.billingDate(DateUtils.getNowDate()).startTime(null).endTime(null).paymentStatus(2).paymentMethod(rechargecardUser.getStatus())
.paymentTime(DateUtils.getNowDate()).status(0).remark(null);
userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails);
// 更新用户充值卡信息,包括新的余额
info.setBalance(newBalance);
info.setUpdateTime(DateUtils.getNowDate());
return userRechargeCardsMapper.updateUserRechargeCards(info);
}
}*/
}