mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -1,252 +1,209 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单对象 order_basic_info
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2022-09-30
|
||||
* 订单主表
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class OrderBasicInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Excel(name = "订单编号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 交易流水号
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 订单状态(0-待支付;1-充电中;2-待结算;3-待补缴;4-异常;5-可疑;6-订单完成)
|
||||
*/
|
||||
@Excel(name = "订单状态")
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
@Excel(name = "会员id")
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
@Excel(name = "站点id")
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
@Excel(name = "运营商id")
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 充电桩sn号
|
||||
*/
|
||||
@Excel(name = "充电桩sn号")
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 充电桩枪口号
|
||||
*/
|
||||
@Excel(name = "充电桩枪口号")
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* 充电桩枪口编号
|
||||
*/
|
||||
@Excel(name = "充电桩枪口编号")
|
||||
private String pileConnectorCode;
|
||||
|
||||
/**
|
||||
* 逻辑卡号
|
||||
*/
|
||||
@Excel(name = "逻辑卡号")
|
||||
private String logicCard;
|
||||
|
||||
/**
|
||||
* 车辆vin码
|
||||
*/
|
||||
@Excel(name = "车辆vin码")
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* 启动方式
|
||||
* 0-后管启动;1-用户app启动
|
||||
*/
|
||||
@Excel(name = "启动方式")
|
||||
private String startMode;
|
||||
|
||||
/**
|
||||
* 第三方平台类型
|
||||
*/
|
||||
@Excel(name = "第三方平台类型")
|
||||
private String thirdPartyType;
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* 1-余额支付;3-白名单支付; 4-微信支付;5-支付宝支付;
|
||||
*/
|
||||
@Excel(name = "支付方式")
|
||||
private String payMode;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
* 0-待支付;1-支付完成
|
||||
*/
|
||||
@Excel(name = "支付状态")
|
||||
private String payStatus;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
* 指用户本次需要充电的金额
|
||||
*/
|
||||
@Excel(name = "支付金额")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date payTime;
|
||||
|
||||
/**
|
||||
* 车牌号码
|
||||
*/
|
||||
private String plateNumber;
|
||||
|
||||
/**
|
||||
* 订单总金额 = 电费总金额 + 服务费总金额
|
||||
*/
|
||||
@Excel(name = "订单总金额")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/**
|
||||
* 虚拟金额
|
||||
*/
|
||||
@Excel(name = "虚拟金额")
|
||||
private BigDecimal virtualAmount;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderBasicInfo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 折扣金额
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 交易流水号
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 订单状态(0-未启动;1-充电中;2-待结算;3-待补缴;4-异常;5-可疑;6-订单完成;7-超时关闭)
|
||||
*/
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 会员id
|
||||
*/
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
*/
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 充电桩sn
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 充电桩枪口号
|
||||
*/
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* 充电桩枪口编号
|
||||
*/
|
||||
private String pileConnectorCode;
|
||||
|
||||
/**
|
||||
* 卡启动时的卡号
|
||||
*/
|
||||
private String logicCard;
|
||||
|
||||
/**
|
||||
* vin启动时的vin码
|
||||
*/
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* 启动方式(0-后管启动;1-用户app启动;2-卡启动;3-离线卡启动; 4-联联平台启动; 5-车辆vin码启动)
|
||||
*/
|
||||
private String startMode;
|
||||
|
||||
private String thirdPartyType;
|
||||
|
||||
/**
|
||||
* 支付方式(1-余额支付;3-白名单支付;4-微信支付;5-支付宝支付)
|
||||
*/
|
||||
private String payMode;
|
||||
|
||||
/**
|
||||
* 支付状态(0-待支付;1-支付完成)
|
||||
*/
|
||||
private String payStatus;
|
||||
|
||||
/**
|
||||
* 支付金额(指用户预存的金额)
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private Date payTime;
|
||||
|
||||
/**
|
||||
* 车牌号码
|
||||
*/
|
||||
private String plateNumber;
|
||||
|
||||
/**
|
||||
* 订单总金额 = 电费总金额 + 服务费总金额
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/**
|
||||
* 虚拟金额(指使用赠送余额消费部分)
|
||||
*/
|
||||
private BigDecimal virtualAmount;
|
||||
|
||||
/**
|
||||
* 会员组编号
|
||||
*/
|
||||
private String groupCode;
|
||||
|
||||
/**
|
||||
* 折扣金额(指会员优惠金额)
|
||||
*/
|
||||
@Excel(name = "折扣金额")
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
@Excel(name = "结算金额")
|
||||
private BigDecimal settleAmount;
|
||||
/**
|
||||
* 结算金额(指实际产生的消费,包括本金支付,微信支付等)
|
||||
*/
|
||||
private BigDecimal settleAmount;
|
||||
|
||||
/**
|
||||
* 充电开始时间
|
||||
*/
|
||||
private Date chargeStartTime;
|
||||
/**
|
||||
* 充电开始时间
|
||||
*/
|
||||
private Date chargeStartTime;
|
||||
|
||||
/**
|
||||
* 充电结束时间
|
||||
*/
|
||||
private Date chargeEndTime;
|
||||
/**
|
||||
* 充电结束时间
|
||||
*/
|
||||
private Date chargeEndTime;
|
||||
|
||||
/**
|
||||
* 启动类型
|
||||
*/
|
||||
private String startType;
|
||||
/**
|
||||
* 启动类型(now-立即启动;appointment-预约启动)
|
||||
*/
|
||||
private String startType;
|
||||
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
private Date appointmentTime;
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
private Date appointmentTime;
|
||||
|
||||
/**
|
||||
* 开始SOC
|
||||
*/
|
||||
private String startSoc;
|
||||
/**
|
||||
* 开始SOC
|
||||
*/
|
||||
private String startSoc;
|
||||
|
||||
/**
|
||||
* 结束SOC
|
||||
*/
|
||||
private String endSoc;
|
||||
/**
|
||||
* 结束SOC
|
||||
*/
|
||||
private String endSoc;
|
||||
|
||||
/**
|
||||
* 异常原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 异常原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
private Date settlementTime;
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
private Date settlementTime;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 退款状态(0-不需要退款;1-退款中;2-退款完成)
|
||||
*/
|
||||
private String refundStatus;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常;1-删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
private List<OrderDetail> orderDetailList;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", id)
|
||||
.append("orderCode", orderCode)
|
||||
.append("orderStatus", orderStatus)
|
||||
.append("memberId", memberId)
|
||||
.append("stationId", stationId)
|
||||
.append("pileSn", pileSn)
|
||||
.append("connectorCode", connectorCode)
|
||||
.append("startMode", startMode)
|
||||
.append("payMode", payMode)
|
||||
.append("payStatus", payStatus)
|
||||
.append("payAmount", payAmount)
|
||||
.append("payTime", payTime)
|
||||
.append("orderAmount", orderAmount)
|
||||
.append("chargeStartTime", chargeStartTime)
|
||||
.append("chargeEndTime", chargeEndTime)
|
||||
.append("startSOC", startSoc)
|
||||
.append("endSOC", endSoc)
|
||||
.append("reason", reason)
|
||||
.append("delFlag", delFlag)
|
||||
.append("orderDetailList", orderDetailList)
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识(0-正常;1-删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -83,4 +83,7 @@ public class QueryOrderDTO extends BaseEntity {
|
||||
* 结算结束时间
|
||||
*/
|
||||
private String endSettleTime;
|
||||
|
||||
// 会员组编号
|
||||
private String groupCode;
|
||||
}
|
||||
|
||||
@@ -13,12 +13,10 @@ import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.SendMessageVO;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface OrderBasicInfoMapper {
|
||||
/**
|
||||
* delete by primary key
|
||||
|
||||
@@ -220,10 +220,6 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
return orderListVOS;
|
||||
}
|
||||
|
||||
// 批量查手续费
|
||||
// List<String> orderCodeList = orderListVOS.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList());
|
||||
// Map<String, ClearingBillDetail> billDetailMap = clearingBillDetailService.selectByOrderCodeList(orderCodeList);
|
||||
|
||||
for (OrderListVO orderListVO : orderListVOS) {
|
||||
// 如果是微信支付,通过订单号查询微信支付单号
|
||||
// logger.info("如果是微信支付,通过订单号查询微信支付单号 orderListVO:{}", JSON.toJSONString(orderListVO));
|
||||
@@ -252,11 +248,6 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
orderListVO.setChargingTime(DateUtils.getDatePoor(DateUtils.parseDate(chargeEndTime), DateUtils.parseDate(chargeStartTime)));
|
||||
}
|
||||
|
||||
// 交易手续费
|
||||
// ClearingBillDetail clearingBillDetail = billDetailMap.get(orderListVO.getOrderCode());
|
||||
// if (Objects.nonNull(clearingBillDetail)) {
|
||||
// orderListVO.setFeeAmount(clearingBillDetail.getFeeAmt() + "");
|
||||
// }
|
||||
}
|
||||
|
||||
batchQueryFeeAmt(orderListVOS);
|
||||
@@ -2338,7 +2329,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
if (StringUtils.equals(orderListVO.getOrderStatus(), OrderStatusEnum.IN_THE_CHARGING.getValue())) {
|
||||
// 修改数据库订单状态
|
||||
OrderBasicInfo info = OrderBasicInfo.builder()
|
||||
.id(Long.parseLong(orderListVO.getId()))
|
||||
.id(Integer.parseInt(orderListVO.getId()))
|
||||
.orderStatus(OrderStatusEnum.ABNORMAL.getValue())
|
||||
.build();
|
||||
updateOrderBasicInfo(info);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class OrderPayRecordServiceImpl implements OrderPayRecordService {
|
||||
@Override
|
||||
public List<OrderDetailInfoVO.PayRecord> selectOrderPayInfoList(String orderCode) {
|
||||
// 缓存
|
||||
String redisKey = "select_order_pay_info_list:" + orderCode;
|
||||
String redisKey = CacheConstants.SELECT_ORDER_PAY_INFO_LIST + orderCode;
|
||||
List<OrderDetailInfoVO.PayRecord> resultList = redisCache.getCacheList(redisKey);
|
||||
if (CollectionUtils.isNotEmpty(resultList)) {
|
||||
return resultList;
|
||||
|
||||
@@ -779,6 +779,7 @@ public abstract class AbstractProgramLogic implements InitializingBean {
|
||||
discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
||||
discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
||||
}
|
||||
orderBasicInfo.setGroupCode(memberDiscountVO.getGroupCode());
|
||||
}
|
||||
// 订单折扣金额
|
||||
BigDecimal discountAmount = discountServiceAmount.add(discountElectricityAmount);
|
||||
|
||||
Reference in New Issue
Block a user