mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-03 17:40:13 +08:00
Merge branch 'dev-zza' into dev
# Conflicts: # jsowell-admin/src/main/java/com/jsowell/service/OrderService.java
This commit is contained in:
@@ -29,6 +29,12 @@ public class ChargeAlgorithmRecord extends BaseEntity {
|
||||
@Excel(name = "订单编号")
|
||||
private String orderCode;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private String webUrl;
|
||||
|
||||
private String pdfUrl;
|
||||
|
||||
/**
|
||||
* 总体得分
|
||||
*/
|
||||
|
||||
@@ -120,6 +120,11 @@ public class OrderBasicInfo {
|
||||
*/
|
||||
private Date payTime;
|
||||
|
||||
/**
|
||||
* 保险金额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* 车牌号码
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 订单保险信息对象 order_insurance_info
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
public class OrderInsuranceInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 保险交易流水号
|
||||
*/
|
||||
@Excel(name = "保险交易流水号")
|
||||
private String insuranceTransactionCode;
|
||||
|
||||
/**
|
||||
* 关联订单号
|
||||
*/
|
||||
@Excel(name = "关联订单号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 保险支付金额
|
||||
*/
|
||||
@Excel(name = "保险支付金额")
|
||||
private BigDecimal tradeAmount;
|
||||
|
||||
/**
|
||||
* 删除标识(0-否;1-是)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setInsuranceTransactionCode(String insuranceTransactionCode) {
|
||||
this.insuranceTransactionCode = insuranceTransactionCode;
|
||||
}
|
||||
|
||||
public String getInsuranceTransactionCode() {
|
||||
return insuranceTransactionCode;
|
||||
}
|
||||
|
||||
public void setOrderCode(String orderCode) {
|
||||
this.orderCode = orderCode;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
public void setTradeAmount(BigDecimal tradeAmount) {
|
||||
this.tradeAmount = tradeAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTradeAmount() {
|
||||
return tradeAmount;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
|
||||
.append("id", getId())
|
||||
.append("insuranceTransactionCode", getInsuranceTransactionCode())
|
||||
.append("orderCode", getOrderCode())
|
||||
.append("tradeAmount", getTradeAmount())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,11 @@ public class GenerateOrderDTO extends BasicPileDTO{
|
||||
*/
|
||||
private BigDecimal chargeAmount;
|
||||
|
||||
/**
|
||||
* 保险金额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* 充电桩枪口信息
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,11 @@ public class PayOrderDTO extends BaseDTO{
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 保险金额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* @see ScenarioEnum
|
||||
* 支付场景
|
||||
|
||||
@@ -23,6 +23,11 @@ public class PayOrderSuccessCallbackDTO {
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 保险金额
|
||||
*/
|
||||
private BigDecimal insuranceAmount;
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* 1-余额支付;2-微信支付;3-支付宝支付
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.OrderInsuranceInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 订单保险信息Mapper接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
@Repository
|
||||
public interface OrderInsuranceInfoMapper {
|
||||
/**
|
||||
* 查询订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
public OrderInsuranceInfo selectOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单保险信息列表
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 订单保险信息集合
|
||||
*/
|
||||
public List<OrderInsuranceInfo> selectOrderInsuranceInfoList(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 新增订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 修改订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 删除订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单保险信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 通过订单号查询订单保险信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
OrderInsuranceInfo getInfoByOrderCode(@Param("orderCode") String orderCode);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.OrderInsuranceInfo;
|
||||
|
||||
/**
|
||||
* 订单保险信息Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
public interface IOrderInsuranceInfoService {
|
||||
/**
|
||||
* 查询订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
public OrderInsuranceInfo selectOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单保险信息列表
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 订单保险信息集合
|
||||
*/
|
||||
public List<OrderInsuranceInfo> selectOrderInsuranceInfoList(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 新增订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 修改订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单保险信息
|
||||
*
|
||||
* @param ids 需要删除的订单保险信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单保险信息信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderInsuranceInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 通过订单号查询订单保险信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
OrderInsuranceInfo getInsuranceInfoByOrderCode(String orderCode);
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.jsowell.pile.service.impl;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.UserConstants;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.MemberPlateNumberRelation;
|
||||
import com.jsowell.pile.mapper.MemberPlateNumberRelationMapper;
|
||||
@@ -86,13 +88,13 @@ public class MemberPlateNumberRelationServiceImpl implements MemberPlateNumberRe
|
||||
}
|
||||
|
||||
// 校验vin
|
||||
// String vinCode = memberPlateNumberRelation.getVinCode();
|
||||
// if (StringUtils.isNotBlank(vinCode)) {
|
||||
// // 判断当前vin是否被绑定
|
||||
// if (UserConstants.NOT_UNIQUE.equals(checkVinCodeUnique(vinCode))) {
|
||||
// throw new BusinessException(ReturnCodeEnum.CODE_THIS_VIN_HAS_BEEN_BINDING);
|
||||
// }
|
||||
// }
|
||||
String vinCode = memberPlateNumberRelation.getVinCode();
|
||||
if (StringUtils.isNotBlank(vinCode)) {
|
||||
// 判断当前vin是否被绑定
|
||||
if (UserConstants.NOT_UNIQUE.equals(checkVinCodeUnique(vinCode))) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_THIS_VIN_HAS_BEEN_BINDING);
|
||||
}
|
||||
}
|
||||
return memberPlateNumberRelationMapper.updateMemberPlateNumberRelation(memberPlateNumberRelation);
|
||||
}
|
||||
|
||||
|
||||
@@ -1947,8 +1947,13 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
OrderBasicInfo orderBasicInfo = this.getOrderInfoByOrderCode(afterSettleOrderDTO.getOrderCode());
|
||||
String payMode = orderBasicInfo.getPayMode();
|
||||
|
||||
|
||||
// 校验订单支付金额,消费金额,退款金额
|
||||
BigDecimal orderPayAmount = afterSettleOrderDTO.getOrderPayAmount(); // 支付金额
|
||||
// if (orderBasicInfo.getInsuranceAmount().compareTo(BigDecimal.ZERO) > 0) {
|
||||
// // 如果该笔订单保险金额大于0,则将支付金额 - 保险金额作为新的支付金额
|
||||
// orderPayAmount = orderPayAmount.subtract(orderBasicInfo.getInsuranceAmount());
|
||||
// }
|
||||
BigDecimal orderConsumeAmount = afterSettleOrderDTO.getOrderConsumeAmount(); // 消费金额
|
||||
BigDecimal orderSettleAmount = afterSettleOrderDTO.getOrderSettleAmount();
|
||||
BigDecimal orderRefundAmount = afterSettleOrderDTO.getOrderRefundAmount(); // 退款金额
|
||||
@@ -1979,6 +1984,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 校验通过,将退款金额重新set(为了避免数据库的退款金额没有及时更新)
|
||||
orderBasicInfo.setRefundAmount(orderRefundAmount);
|
||||
afterSettleOrderDTO.setOrderBasicInfo(orderBasicInfo);
|
||||
@@ -2008,6 +2014,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
*/
|
||||
private List<PaymentInfo> getOrderPaymentInfoList(AfterSettleOrderDTO afterSettleOrderDTO) {
|
||||
String orderCode = afterSettleOrderDTO.getOrderCode();
|
||||
OrderBasicInfo orderBasicInfo = afterSettleOrderDTO.getOrderBasicInfo();
|
||||
|
||||
// 查询订单支付记录
|
||||
List<OrderPayRecord> orderPayRecordList = orderPayRecordService.getOrderPayRecordList(orderCode);
|
||||
// 选出需要分账的支付id
|
||||
@@ -2038,11 +2046,11 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
logger.info("执行订单分账/新分账方法, orderCode:{}, 分账金额:{}",
|
||||
afterSettleOrderDTO.getOrderCode(), afterSettleOrderDTO.getOrderSettleAmount());
|
||||
// 如果是PRE环境, 直接返回
|
||||
String env = SpringUtils.getActiveProfile();
|
||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
||||
logger.debug("PRE环境不执行");
|
||||
// return null;
|
||||
}
|
||||
// String env = SpringUtils.getActiveProfile();
|
||||
// if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
||||
// logger.debug("PRE环境不执行");
|
||||
// // return null;
|
||||
// }
|
||||
// 结算金额
|
||||
BigDecimal orderSettleAmount = afterSettleOrderDTO.getOrderSettleAmount();
|
||||
|
||||
@@ -2052,6 +2060,12 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
// 订单编号
|
||||
String orderCode = afterSettleOrderDTO.getOrderCode();
|
||||
|
||||
// 订单信息
|
||||
OrderBasicInfo orderBasicInfo = afterSettleOrderDTO.getOrderBasicInfo();
|
||||
|
||||
// 保险金额(有默认值 0.00)
|
||||
BigDecimal insuranceAmount = orderBasicInfo.getInsuranceAmount();
|
||||
|
||||
// 订单是否需要分账, 结算金额必须大于0
|
||||
if (orderSettleAmount == null || orderSettleAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
logger.info("realTimeOrderSplit-订单[{}]结算金额[{}]必须大于0", afterSettleOrderDTO.getOrderCode(), orderSettleAmount);
|
||||
@@ -2093,7 +2107,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
PaymentConfirmParam param = PaymentConfirmParam.builder()
|
||||
.paymentId(paymentId)
|
||||
.divMemberList(divMemberList)
|
||||
.confirmAmt(orderSettleAmount)
|
||||
.confirmAmt(orderSettleAmount.add(insuranceAmount)) // 订单结算金额 + 保险金额
|
||||
.orderCode(orderCode)
|
||||
.wechatAppId(appId)
|
||||
.build();
|
||||
@@ -2175,6 +2189,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
@Override
|
||||
public List<SplitData> calculationSplitDataList(List<StationSplitConfig> stationSplitConfigList, AfterSettleOrderDTO afterSettleOrderDTO) {
|
||||
List<SplitData> resultList = Lists.newArrayList();
|
||||
OrderBasicInfo orderBasicInfo = afterSettleOrderDTO.getOrderBasicInfo();
|
||||
|
||||
// totalElecSplitRatio和totalServiceSplitRatio 都等于100%, 才进行后续操作
|
||||
boolean verifySplitConfig = stationSplitConfigService.verifySplitConfig(stationSplitConfigList);
|
||||
@@ -2237,6 +2252,17 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
// 如果保险金额大于0,新增一条分账信息
|
||||
if (orderBasicInfo.getInsuranceAmount().compareTo(BigDecimal.ZERO) > 0) {
|
||||
SplitData insuranceSplit = new SplitData();
|
||||
insuranceSplit.setMemberId(Constants.ZERO);
|
||||
insuranceSplit.setAmount(String.valueOf(orderBasicInfo.getInsuranceAmount()));
|
||||
insuranceSplit.setFeeFlag(Constants.N);
|
||||
resultList.add(insuranceSplit);
|
||||
}
|
||||
|
||||
// TODO 是否可以分多笔给同一个账户?,如果不行,下面进行根据adapayMemberId进行金额累加
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@@ -2387,11 +2413,11 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
logger.info("执行订单退款/新退款方法, orderCode:{}, 退款金额:{}, dto:{}",
|
||||
afterSettleOrderDTO.getOrderCode(), afterSettleOrderDTO.getOrderRefundAmount(), JSON.toJSONString(afterSettleOrderDTO));
|
||||
// 如果是PRE环境, 直接返回
|
||||
String env = SpringUtils.getActiveProfile();
|
||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
||||
logger.debug("PRE环境不执行");
|
||||
// return;
|
||||
}
|
||||
// String env = SpringUtils.getActiveProfile();
|
||||
// if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
||||
// logger.debug("PRE环境不执行");
|
||||
// // return;
|
||||
// }
|
||||
// 退款
|
||||
String mode = pileMerchantInfoService.getDelayModeByMerchantId(afterSettleOrderDTO.getMerchantId());
|
||||
AbstractProgramLogic orderLogic = ProgramLogicFactory.getProgramLogic(mode);
|
||||
@@ -4242,7 +4268,6 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
orderInfo.setPayAmount(orderPayAmount.add(payAmount));
|
||||
}
|
||||
orderInfo.setPayTime(new Date());
|
||||
|
||||
String pileSn = orderInfo.getPileSn();
|
||||
|
||||
// 发送启动充电指令前,再次下发计费模板
|
||||
@@ -4261,7 +4286,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
}
|
||||
|
||||
// 获取启动金额
|
||||
BigDecimal chargeAmount = computeChargeAmount(orderInfo.getMerchantId(), orderInfo.getStationId(), orderInfo.getMemberId(), orderInfo.getPayAmount());
|
||||
BigDecimal chargeAmount = computeChargeAmount(orderInfo.getMerchantId(), orderInfo.getStationId(), orderInfo.getMemberId(), dto.getPayAmount());
|
||||
|
||||
// 发送启动指令
|
||||
if (StringUtils.equals(pileConnectorDetailVO.getChargePortType(), Constants.THREE)) {
|
||||
@@ -4781,6 +4806,9 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
.settleAmount(BigDecimal.ZERO)
|
||||
.startType(dto.getStartType())
|
||||
.build();
|
||||
if (dto.getInsuranceAmount().compareTo(BigDecimal.ZERO) > 0) {
|
||||
orderBasicInfo.setInsuranceAmount(dto.getInsuranceAmount());
|
||||
}
|
||||
if (StringUtils.equals(OrderTypeEnum.MERGE_CHARGE_ORDER.getValue(), dto.getOrderType())) {
|
||||
// 并充订单
|
||||
orderBasicInfo.setOrderType(dto.getOrderType());
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.OrderInsuranceInfoMapper;
|
||||
import com.jsowell.pile.domain.OrderInsuranceInfo;
|
||||
import com.jsowell.pile.service.IOrderInsuranceInfoService;
|
||||
|
||||
/**
|
||||
* 订单保险信息Service业务层处理
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2025-09-05
|
||||
*/
|
||||
@Service
|
||||
public class OrderInsuranceInfoServiceImpl implements IOrderInsuranceInfoService {
|
||||
@Autowired
|
||||
private OrderInsuranceInfoMapper orderInsuranceInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单保险信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
@Override
|
||||
public OrderInsuranceInfo selectOrderInsuranceInfoById(Long id) {
|
||||
return orderInsuranceInfoMapper.selectOrderInsuranceInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单保险信息列表
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 订单保险信息
|
||||
*/
|
||||
@Override
|
||||
public List<OrderInsuranceInfo> selectOrderInsuranceInfoList(OrderInsuranceInfo orderInsuranceInfo) {
|
||||
return orderInsuranceInfoMapper.selectOrderInsuranceInfoList(orderInsuranceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo) {
|
||||
orderInsuranceInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return orderInsuranceInfoMapper.insertOrderInsuranceInfo(orderInsuranceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单保险信息
|
||||
*
|
||||
* @param orderInsuranceInfo 订单保险信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateOrderInsuranceInfo(OrderInsuranceInfo orderInsuranceInfo) {
|
||||
orderInsuranceInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return orderInsuranceInfoMapper.updateOrderInsuranceInfo(orderInsuranceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单保险信息
|
||||
*
|
||||
* @param ids 需要删除的订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInsuranceInfoByIds(Long[] ids) {
|
||||
return orderInsuranceInfoMapper.deleteOrderInsuranceInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单保险信息信息
|
||||
*
|
||||
* @param id 订单保险信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInsuranceInfoById(Long id) {
|
||||
return orderInsuranceInfoMapper.deleteOrderInsuranceInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过订单号查询订单保险信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OrderInsuranceInfo getInsuranceInfoByOrderCode(String orderCode) {
|
||||
return orderInsuranceInfoMapper.getInfoByOrderCode(orderCode);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@
|
||||
<resultMap type="com.jsowell.pile.domain.ChargeAlgorithmRecord" id="ChargeAlgorithmRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="webUrl" column="web_url" />
|
||||
<result property="pdfUrl" column="pdf_url" />
|
||||
<result property="score" column="score" />
|
||||
<result property="capacityMetrics" column="capacity_metrics" />
|
||||
<result property="energyIndicator" column="energy_indicator" />
|
||||
@@ -31,7 +34,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectChargeAlgorithmRecordVo">
|
||||
select id, order_code, score, capacity_metrics, energy_indicator, consistency, temp_consistency, volt_consistency,
|
||||
select id, order_code, task_id, web_url, pdf_url, score, capacity_metrics, energy_indicator, consistency, temp_consistency, volt_consistency,
|
||||
capacity_consistency, sot, thermal_runaway, cooling, seal, current_soc, soc_alarm, temp_diff_alarm, temp_rise_alarm,
|
||||
max_allowable_voltage_alarm, max_allowable_electricity_alarm, security_system_level, failure_metrics, performance_metrics, create_time from charge_algorithm_record
|
||||
</sql>
|
||||
@@ -40,6 +43,9 @@
|
||||
<include refid="selectChargeAlgorithmRecordVo"/>
|
||||
<where>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="webUrl != null and webUrl != ''"> and web_url = #{webUrl}</if>
|
||||
<if test="pdfUrl != null and pdfUrl != ''"> and pdf_url = #{pdfUrl}</if>
|
||||
<if test="score != null and score != ''"> and score = #{score}</if>
|
||||
<if test="capacityMetrics != null "> and capacity_metrics = #{capacityMetrics}</if>
|
||||
<if test="energyIndicator != null "> and energy_indicator = #{energyIndicator}</if>
|
||||
@@ -72,6 +78,9 @@
|
||||
insert into charge_algorithm_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="webUrl != null">web_url,</if>
|
||||
<if test="pdfUrl != null">pdf_url,</if>
|
||||
<if test="score != null">score,</if>
|
||||
<if test="capacityMetrics != null">capacity_metrics,</if>
|
||||
<if test="energyIndicator != null">energy_indicator,</if>
|
||||
@@ -96,6 +105,9 @@
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="webUrl != null">#{webUrl},</if>
|
||||
<if test="pdfUrl != null">#{pdfUrl},</if>
|
||||
<if test="score != null">#{score},</if>
|
||||
<if test="capacityMetrics != null">#{capacityMetrics},</if>
|
||||
<if test="energyIndicator != null">#{energyIndicator},</if>
|
||||
@@ -124,6 +136,9 @@
|
||||
update charge_algorithm_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="webUrl != null">web_url = #{webUrl},</if>
|
||||
<if test="pdfUrl != null">pdf_url = #{pdfUrl},</if>
|
||||
<if test="score != null">score = #{score},</if>
|
||||
<if test="capacityMetrics != null">capacity_metrics = #{capacityMetrics},</if>
|
||||
<if test="energyIndicator != null">energy_indicator = #{energyIndicator},</if>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<result column="pay_status" jdbcType="VARCHAR" property="payStatus"/>
|
||||
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount"/>
|
||||
<result column="pay_time" jdbcType="TIMESTAMP" property="payTime"/>
|
||||
<result column="insurance_amount" jdbcType="DECIMAL" property="insuranceAmount"/>
|
||||
<result column="plate_number" jdbcType="VARCHAR" property="plateNumber"/>
|
||||
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount"/>
|
||||
<result column="virtual_amount" jdbcType="DECIMAL" property="virtualAmount"/>
|
||||
@@ -55,7 +56,7 @@
|
||||
<!--@mbg.generated-->
|
||||
id, order_code, transaction_code, order_status, order_type, merge_charge_number, main_connector_code, member_id, station_id, merchant_id,
|
||||
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, third_party_type,
|
||||
pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, virtual_amount,
|
||||
pay_mode, pay_status, pay_amount, pay_time, insurance_amount, plate_number, order_amount, virtual_amount,
|
||||
group_code, discount_amount, settle_amount, actual_received_amount, remedial_amount, charge_start_time, charge_end_time,
|
||||
start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason,
|
||||
settlement_time, refund_amount,
|
||||
@@ -81,7 +82,7 @@
|
||||
pile_sn, connector_code, pile_connector_code,
|
||||
logic_card, vin_code, start_mode,
|
||||
third_party_type, pay_mode, pay_status,
|
||||
pay_amount, pay_time, plate_number,
|
||||
pay_amount, pay_time, insurance_amount, plate_number,
|
||||
order_amount, virtual_amount, group_code,
|
||||
discount_amount, settle_amount, actual_received_amount, remedial_amount,
|
||||
charge_start_time, charge_end_time, start_type,
|
||||
@@ -97,7 +98,7 @@
|
||||
#{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR},
|
||||
#{logicCard,jdbcType=VARCHAR}, #{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR},
|
||||
#{thirdPartyType,jdbcType=VARCHAR}, #{payMode,jdbcType=VARCHAR}, #{payStatus,jdbcType=VARCHAR},
|
||||
#{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{plateNumber,jdbcType=VARCHAR},
|
||||
#{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{insuranceAmount,jdbcType=DECIMAL}, #{plateNumber,jdbcType=VARCHAR},
|
||||
#{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR},
|
||||
#{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{actualReceivedAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL},
|
||||
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
|
||||
@@ -173,6 +174,9 @@
|
||||
<if test="payTime != null">
|
||||
pay_time,
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
insurance_ammount,
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
plate_number,
|
||||
</if>
|
||||
@@ -310,6 +314,9 @@
|
||||
<if test="payTime != null">
|
||||
#{payTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
#{insuranceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
#{plateNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -451,6 +458,9 @@
|
||||
<if test="payTime != null">
|
||||
pay_time = #{payTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
plate_number = #{plateNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -552,6 +562,7 @@
|
||||
pay_status = #{payStatus,jdbcType=VARCHAR},
|
||||
pay_amount = #{payAmount,jdbcType=DECIMAL},
|
||||
pay_time = #{payTime,jdbcType=TIMESTAMP},
|
||||
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
|
||||
plate_number = #{plateNumber,jdbcType=VARCHAR},
|
||||
order_amount = #{orderAmount,jdbcType=DECIMAL},
|
||||
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
||||
@@ -683,6 +694,11 @@
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="insurance_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.insuranceAmount,jdbc=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="plate_number = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR}
|
||||
@@ -958,6 +974,13 @@
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="insurance_amount = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.insuranceAmount != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.insuranceAmount,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="plate_number = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.plateNumber != null">
|
||||
@@ -1144,7 +1167,7 @@
|
||||
insert into order_basic_info
|
||||
(order_code, transaction_code, order_status, order_type, merge_charge_number, main_connector_code, member_id, station_id, merchant_id,
|
||||
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode,
|
||||
third_party_type, pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount,
|
||||
third_party_type, pay_mode, pay_status, pay_amount, pay_time, insurance_amount, plate_number, order_amount,
|
||||
virtual_amount, group_code, discount_amount, settle_amount, actual_received_amount, remedial_amount, charge_start_time,
|
||||
charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code,
|
||||
reason, settlement_time,
|
||||
@@ -1160,7 +1183,7 @@
|
||||
#{item.logicCard,jdbcType=VARCHAR}, #{item.vinCode,jdbcType=VARCHAR}, #{item.startMode,jdbcType=VARCHAR},
|
||||
#{item.thirdPartyType,jdbcType=VARCHAR}, #{item.payMode,jdbcType=VARCHAR},
|
||||
#{item.payStatus,jdbcType=VARCHAR},
|
||||
#{item.payAmount,jdbcType=DECIMAL}, #{item.payTime,jdbcType=TIMESTAMP},
|
||||
#{item.payAmount,jdbcType=DECIMAL}, #{item.payTime,jdbcType=TIMESTAMP}, #{item.insuranceAmount,jdbc=DECIMAL},
|
||||
#{item.plateNumber,jdbcType=VARCHAR},
|
||||
#{item.orderAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL},
|
||||
#{item.groupCode,jdbcType=VARCHAR},
|
||||
@@ -1207,6 +1230,7 @@
|
||||
pay_status,
|
||||
pay_amount,
|
||||
pay_time,
|
||||
insurance_amount,
|
||||
plate_number,
|
||||
order_amount,
|
||||
virtual_amount,
|
||||
@@ -1258,6 +1282,7 @@
|
||||
#{payStatus,jdbcType=VARCHAR},
|
||||
#{payAmount,jdbcType=DECIMAL},
|
||||
#{payTime,jdbcType=TIMESTAMP},
|
||||
#{insuranceAmount,jdbcType=DECIMAL},
|
||||
#{plateNumber,jdbcType=VARCHAR},
|
||||
#{orderAmount,jdbcType=DECIMAL},
|
||||
#{virtualAmount,jdbcType=DECIMAL},
|
||||
@@ -1309,6 +1334,7 @@
|
||||
pay_status = #{payStatus,jdbcType=VARCHAR},
|
||||
pay_amount = #{payAmount,jdbcType=DECIMAL},
|
||||
pay_time = #{payTime,jdbcType=TIMESTAMP},
|
||||
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
|
||||
plate_number = #{plateNumber,jdbcType=VARCHAR},
|
||||
order_amount = #{orderAmount,jdbcType=DECIMAL},
|
||||
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
||||
@@ -1404,6 +1430,9 @@
|
||||
<if test="payTime != null">
|
||||
pay_time,
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
insurance_amount,
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
plate_number,
|
||||
</if>
|
||||
@@ -1545,6 +1574,9 @@
|
||||
<if test="payTime != null">
|
||||
#{payTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
#{insuranceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
#{plateNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -1686,6 +1718,9 @@
|
||||
<if test="payTime != null">
|
||||
pay_time = #{payTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
plate_number = #{plateNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -2125,6 +2160,9 @@
|
||||
<if test="payTime != null">
|
||||
pay_time,
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
insurance_amount,
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
plate_number,
|
||||
</if>
|
||||
@@ -2250,6 +2288,9 @@
|
||||
<if test="payTime != null">
|
||||
#{payTime},
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
#{insuranceAmount},
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
#{plateNumber},
|
||||
</if>
|
||||
@@ -2376,6 +2417,9 @@
|
||||
<if test="payTime != null">
|
||||
pay_time = #{payTime},
|
||||
</if>
|
||||
<if test="insuranceAmount != null">
|
||||
insurance_amount = #{insuranceAmount},
|
||||
</if>
|
||||
<if test="plateNumber != null">
|
||||
plate_number = #{plateNumber},
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
<?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.jsowell.pile.mapper.OrderInsuranceInfoMapper">
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.OrderInsuranceInfo" id="OrderInsuranceInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="insuranceTransactionCode" column="insurance_transaction_code" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="tradeAmount" column="trade_amount" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderInsuranceInfoVo">
|
||||
select id, insurance_transaction_code, order_code, trade_amount, create_time, create_by, update_time, update_by, del_flag from order_insurance_info
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, insurance_transaction_code, order_code, trade_amount, create_time, create_by, update_time, update_by, del_flag
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderInsuranceInfoList" parameterType="com.jsowell.pile.domain.OrderInsuranceInfo" resultMap="OrderInsuranceInfoResult">
|
||||
<include refid="selectOrderInsuranceInfoVo"/>
|
||||
<where>
|
||||
<if test="insuranceTransactionCode != null and insuranceTransactionCode != ''"> and insurance_transaction_code = #{insuranceTransactionCode}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
||||
<if test="tradeAmount != null "> and trade_amount = #{tradeAmount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOrderInsuranceInfoById" parameterType="Long" resultMap="OrderInsuranceInfoResult">
|
||||
<include refid="selectOrderInsuranceInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrderInsuranceInfo" parameterType="com.jsowell.pile.domain.OrderInsuranceInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into order_insurance_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="insuranceTransactionCode != null">insurance_transaction_code,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="tradeAmount != null">trade_amount,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="insuranceTransactionCode != null">#{insuranceTransactionCode},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="tradeAmount != null">#{tradeAmount},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateOrderInsuranceInfo" parameterType="com.jsowell.pile.domain.OrderInsuranceInfo">
|
||||
update order_insurance_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="insuranceTransactionCode != null">insurance_transaction_code = #{insuranceTransactionCode},</if>
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="tradeAmount != null">trade_amount = #{tradeAmount},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOrderInsuranceInfoById" parameterType="Long">
|
||||
delete from order_insurance_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOrderInsuranceInfoByIds" parameterType="String">
|
||||
delete from order_insurance_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getInfoByOrderCode" resultMap="OrderInsuranceInfoResult">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from order_insurance_info where del_flag = '0'
|
||||
and order_code = #{orderCode,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user