Merge branch 'dev-new' into dev-new-rabbitmq

# Conflicts:
#	jsowell-admin/src/test/java/PaymentTestController.java
This commit is contained in:
Guoqs
2024-12-19 13:30:11 +08:00
64 changed files with 2858 additions and 767 deletions

View File

@@ -175,6 +175,11 @@ public class OrderBasicInfo {
*/
private String endSoc;
/**
* 停止原因码
*/
private String stopReasonCode;
/**
* 异常原因
*/

View File

@@ -155,6 +155,11 @@ public class PersonalChargingRecord {
*/
private BigDecimal valleyUsedElectricity;
/**
* 停止原因码
*/
private String stopReasonCode;
/**
* 异常原因
*/

View File

@@ -1,5 +1,6 @@
package com.jsowell.pile.domain;
import com.alibaba.fastjson2.annotation.JSONField;
import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity;
import lombok.Data;
@@ -8,6 +9,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.List;
/**
* 充电站信息对象 pile_station_info
@@ -336,6 +338,57 @@ public class PileStationInfo extends BaseEntity {
@Excel(name = "是否有地锁(0-无1-有)")
private String parkingLockFlag;
/**
*服务车型描述
*/
@Excel(name = "服务车型描述")
private List<String> swapMatchCars;
/**
*是否为通用类型
*/
@Excel(name = "是否为通用类型(1-通用 ; 2-非通用)")
private Integer generalApplicationType;
/**
*充换电站方位
* 1地面-停车场
* 2地面-路侧
* 3地下停车场
* 4立体式停车楼
*/
@Excel(name = "充换电站方位")
private Integer stationOrientation;
/**
* 充换电站建筑面积
*/
@Excel(name = "充换电站建筑面积")
private String stationArea;
/**
* 充换电站人工值守
*/
@Excel(name = "是否有充换电站人工值守(0-无 ; 1-有)")
private String havePerson;
/**
* 周边配套设施
* 1卫生间
* 2便利店
* 3餐厅
* 4休息室
* 5雨棚
*/
@Excel(name = "周边配套设施")
private String supportingFacilities;
/**
* 站点额定总功率
*/
@Excel(name = "站点额定总功率")
private BigDecimal ratedPower;
/**
* 删除标识0-正常1-删除)
*/
@@ -386,6 +439,9 @@ public class PileStationInfo extends BaseEntity {
.append("barrierFlag", barrierFlag)
.append("parkingLockFlag", parkingLockFlag)
.append("delFlag", delFlag)
.append("swapMatchCars", swapMatchCars)
.append("generalApplicationType",generalApplicationType)
.append("ratedPower",ratedPower)
.toString();
}
}

View File

@@ -49,4 +49,6 @@ public class QueryConnectorListDTO {
* 接口编号
*/
private List<String> connectorCodeList;
private String requestSource;
}

View File

@@ -391,4 +391,7 @@ public interface OrderBasicInfoMapper {
List<BusinessOrderDetailInfoVO> getOrderDetailByStationIds(@Param("stationIds") List<String> stationIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<OrderBasicInfo> queryOrdersByPileConnectorCodeAndStatus(@Param("pileConnectorCode") String pileConnectorCode, @Param("orderStatus") String orderStatus, @Param("payStatus") String payStatus);
List<String> tempGetOrderCodes(QueryOrderDTO dto);
}

View File

@@ -504,4 +504,11 @@ public interface OrderBasicInfoService{
* @param orderCode
*/
List<BusinessOrderBillingInfoVO> getOrderBillingDetail(String orderCode);
/**
* 临时接口根据站点id、订单创建时间区间查询订单编号
* @param dto
* @return
*/
List<String> tempGetOrderCodes(QueryOrderDTO dto);
}

View File

@@ -1,5 +1,7 @@
package com.jsowell.pile.service;
import com.jsowell.common.core.domain.ykc.BMSChargeInfoData;
import com.jsowell.common.core.domain.ykc.BMSDemandAndChargerOutputData;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.domain.ebike.deviceupload.EBikeMessageCmd20;
@@ -110,7 +112,6 @@ public interface PileBasicInfoService {
/**
* 通过桩sn查询basic信息
*
* @param id 桩id
* @return 结果集合
*/
PileDetailVO selectPileDetailByPileSn(String pileSn);
@@ -151,6 +152,31 @@ public interface PileBasicInfoService {
*/
void saveRealTimeMonitorData2Redis(RealTimeMonitorData realTimeMonitorData);
/**
* 0x23数据保存到redis
* @param bmsDemandAndChargerOutputData
*/
void saveBMSDemandAndChargerOutputInfo2Redis(BMSDemandAndChargerOutputData bmsDemandAndChargerOutputData);
/**
* 0x25数据保存到redis
* @param bmsChargeInfoData
*/
void saveBMSChargeInfo2Redis(BMSChargeInfoData bmsChargeInfoData);
/**
* 根据交易流水号获取0x25数据时间倒序
* @return
*/
List<BMSChargeInfoData> getBMSChargeInfoList(String transactionCode);
/**
* 根据交易流水号查询0x23数据时间倒序
* @param transactionCode
* @return
*/
List<BMSDemandAndChargerOutputData> getBMSDemandAndChargerOutputInfoList(String transactionCode);
PileConnectorDetailVO queryPileConnectorDetail(String pileConnectorCode);
String getPileQrCodeUrl(String pileSn);
@@ -206,7 +232,6 @@ public interface PileBasicInfoService {
/**
* 获取充电桩列表
* 提供给联联平台
* @param pileStationInfo
* @return
*/
// List<EquipmentInfo> getPileList(PileStationInfo pileStationInfo);

View File

@@ -72,7 +72,7 @@ public class PileSnGenerateService {
increResult = prefix + year + String.format("%1$010d", increNum);
// 保存到字典中
savePileSn2Dict(pileNum);
// savePileSn2Dict(pileNum);
} catch (Exception e) {
logger.error("获取序列号失败", e);
}
@@ -91,7 +91,7 @@ public class PileSnGenerateService {
} else {
SysDictData dictData = new SysDictData();
dictData.setDictType(pile_sn_generate_type);
dictData.setDictLabel(EBIKE_PILE_SN_LABEL);
dictData.setDictLabel(EV_PILE_SN_LABEL);
dictData.setDictValue(pileSnNum + "");
dictData.setListClass(Constants.DEFAULT);
dictData.setCreateBy(Constants.SYSTEM);

View File

@@ -1208,6 +1208,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
}
List<String> orderCodeList = Lists.newArrayList(StringUtils.split(orderCodes, ","));
List<OrderBasicInfo> orderBasicInfos = queryOrderList(orderCodeList);
logger.info("运营商id:{}, 日期:{}, 订单号数量:{}, 查询结果数量:{}, orderCodeList:{}", merchantId, orderReport.getTradeDate(), orderCodeList.size(), orderBasicInfos.size(), JSON.toJSONString(orderCodeList));
if (CollectionUtils.isEmpty(orderBasicInfos)) {
continue;
}
@@ -1247,12 +1248,11 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
.subtract(feeAmt);
clearingBillDetail.setFeeAmt(feeAmt);
clearingBillDetail.setConfirmAmt(confirmAmt);
billDetailList.add(clearingBillDetail);
} else {
clearingBillDetail.setFeeAmt(BigDecimal.ZERO);
clearingBillDetail.setConfirmAmt(BigDecimal.ZERO);
billDetailList.add(clearingBillDetail);
}
billDetailList.add(clearingBillDetail);
} catch (Exception e) {
logger.error("订单交易确认失败:{}", orderBasicInfo.getOrderCode(), e);
}
@@ -4458,5 +4458,10 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
}
return resultList;
}
@Override
public List<String> tempGetOrderCodes(QueryOrderDTO dto) {
return orderBasicInfoMapper.tempGetOrderCodes(dto);
}
}

View File

@@ -1,14 +1,13 @@
package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.google.common.collect.Lists;
import com.jsowell.common.YouDianUtils;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.domain.ykc.GroundLockData;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.core.domain.ykc.*;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.DelFlagEnum;
import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum;
@@ -634,6 +633,14 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
if (StringUtils.equals(realTimeMonitorData.getTransactionCode(), Constants.ILLEGAL_TRANSACTION_CODE)) {
return;
}
BigDecimal outputVoltage = new BigDecimal(realTimeMonitorData.getOutputVoltage());
BigDecimal outputCurrent = new BigDecimal(realTimeMonitorData.getOutputCurrent());
if (outputCurrent.compareTo(BigDecimal.ZERO) == 0) {
// 电流等于0不保存到redis
return;
}
// 保存到redis
String redisKey = CacheConstants.PILE_REAL_TIME_MONITOR_DATA + realTimeMonitorData.getPileConnectorCode() + "_" + realTimeMonitorData.getTransactionCode();
@@ -641,8 +648,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
Date now = new Date();
realTimeMonitorData.setDateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now));
// 计算功率,后面查询要用
String power = new BigDecimal(realTimeMonitorData.getOutputVoltage())
.multiply(new BigDecimal(realTimeMonitorData.getOutputCurrent())).setScale(2, RoundingMode.HALF_UP).toString();
String power = outputVoltage.multiply(outputCurrent).setScale(2, RoundingMode.HALF_UP).toString();
realTimeMonitorData.setOutputPower(power);
// 保存json字符串
String jsonMsg = JSON.toJSONString(realTimeMonitorData);
@@ -663,6 +669,122 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
redisCache.setCacheObject(pileIsChargingKey, realTimeMonitorData.getTransactionCode(), 20);
}
/**
* 0x23信息设置缓存 (缓存时间3天)
* @param data
*/
@Override
public void saveBMSDemandAndChargerOutputInfo2Redis(BMSDemandAndChargerOutputData data) {
if (StringUtils.equals(data.getTransactionCode(), Constants.ILLEGAL_TRANSACTION_CODE)) {
return;
}
// 保存到redis
String redisKey = CacheConstants.BMS_DEMAND_AND_CHARGER_OUTPUT_BY_TRANSACTION_CODE + data.getTransactionCode();
// 设置接收到实时数据的时间
Date now = new Date();
data.setDateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now));
// 计算功率,后面查询要用
String power = new BigDecimal(data.getPileVoltageOutput())
.multiply(new BigDecimal(data.getPileCurrentOutput())).setScale(2, RoundingMode.HALF_UP).toString();
data.setOutputPower(power);
// 保存json字符串
String jsonMsg = JSON.toJSONString(data);
// 0x23数据20秒发送一次1分钟3次在同一分钟内只保留最后一条实时数据
redisCache.hset(redisKey, DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:00", now), jsonMsg);
// 设置过期时间
try {
redisCache.expire(redisKey, CacheConstants.cache_expire_time_3d);
// if (redisCache.getExpire(redisKey) < 0) {
// }
} catch (Exception e) {
log.info("0x23存入缓存设置过期时间error", e);
}
}
/**
* 0x25数据保存到redis
* @param bmsChargeInfoData
*/
@Override
public void saveBMSChargeInfo2Redis(BMSChargeInfoData bmsChargeInfoData) {
if (StringUtils.equals(bmsChargeInfoData.getTransactionCode(), Constants.ILLEGAL_TRANSACTION_CODE)) {
return;
}
// 保存到redis
String redisKey = CacheConstants.BMS_CHARGE_INFO_BY_TRANSACTION_CODE + bmsChargeInfoData.getTransactionCode();
// 设置接收到实时数据的时间
Date now = new Date();
bmsChargeInfoData.setDateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now));
// 保存json字符串
String jsonMsg = JSON.toJSONString(bmsChargeInfoData);
// 0x25数据20秒发送一次1分钟3次在同一分钟内只保留最后一条实时数据
redisCache.hset(redisKey, DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:00", now), jsonMsg);
// 设置过期时间
try {
redisCache.expire(redisKey, CacheConstants.cache_expire_time_3d);
} catch (Exception e) {
log.info("0x25存入缓存设置过期时间error", e);
}
}
/**
* 根据交易流水号获取0x25数据
* @param transactionCode
* @return
*/
@Override
public List<BMSChargeInfoData> getBMSChargeInfoList(String transactionCode) {
List<BMSChargeInfoData> resultList = Lists.newArrayList();
if (StringUtils.isBlank(transactionCode)) {
return resultList;
}
String redisKey = CacheConstants.BMS_CHARGE_INFO_BY_TRANSACTION_CODE + transactionCode;
// 拿到所有数据
Map<Object, Object> map = redisCache.hmget(redisKey);
if (map != null && !map.isEmpty()) {
List<String> keyList = map.keySet().stream()
.map(x -> (String) x)
.sorted(Comparator.reverseOrder()) // 对keyList排序 时间倒序
.collect(Collectors.toList());
for (String s : keyList) {
Object o = map.get(s);
BMSChargeInfoData data = JSONObject.parseObject((String) o, BMSChargeInfoData.class);
resultList.add(data);
}
}
return resultList;
}
/**
* 根据交易流水号查询0x23数据时间倒序
* @param transactionCode
* @return
*/
@Override
public List<BMSDemandAndChargerOutputData> getBMSDemandAndChargerOutputInfoList(String transactionCode) {
List<BMSDemandAndChargerOutputData> resultList = Lists.newArrayList();
if (StringUtils.isBlank(transactionCode)) {
return resultList;
}
String redisKey = CacheConstants.BMS_DEMAND_AND_CHARGER_OUTPUT_BY_TRANSACTION_CODE + transactionCode;
// 拿到所有数据
Map<Object, Object> map = redisCache.hmget(redisKey);
if (map != null && !map.isEmpty()) {
List<String> keyList = map.keySet().stream()
.map(x -> (String) x)
.sorted(Comparator.reverseOrder()) // 对keyList排序 时间倒序
.collect(Collectors.toList());
for (String s : keyList) {
Object o = map.get(s);
BMSDemandAndChargerOutputData data = JSONObject.parseObject((String) o, BMSDemandAndChargerOutputData.class);
resultList.add(data);
}
}
return resultList;
}
@Override
public PileConnectorDetailVO queryPileConnectorDetail(String pileConnectorCode) {
return pileBasicInfoMapper.queryPileConnectorDetail(pileConnectorCode);
@@ -1111,6 +1233,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
String pileSn = pileBasicInfo.getSn();
equipmentInfo.setEquipmentID(pileSn);
equipmentInfo.setEquipmentClassification(1);
equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN);
equipmentInfo.setManufacturerName(Constants.MANUFACTURER_NAME);
equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime()));
@@ -1146,6 +1269,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
resultList.add(equipmentInfo);
}
return resultList;
}
@@ -1208,6 +1332,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
connectorInfo.setParkNo(pileConnectorInfo.getParkNo());
}
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
connectorInfo.setEquipmentClassification(1);
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
connectorInfo.setConnectorName(pileConnectorInfo.getPileConnectorCode());

View File

@@ -337,7 +337,10 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
if (CollectionUtils.isEmpty(pileSns) && CollectionUtils.isEmpty(connectorIds) && CollectionUtils.isEmpty(connectorCodeList)) {
return Lists.newArrayList();
}
PageHelper.startPage(pageNum, pageSize);
if (StringUtils.isBlank(dto.getRequestSource())) {
PageHelper.startPage(pageNum, pageSize);
}
List<PileConnectorInfoVO> pileConnectorInfoList = pileConnectorInfoMapper.getPileConnectorInfoList(pileSns, connectorIds, connectorCodeList);

View File

@@ -116,6 +116,7 @@ public class PileMemberRelationServiceImpl implements PileMemberRelationService
return selectPileMemberRelationList(pileMemberRelation);
}
@Override
public List<MemberVO> selectMemberList(String pileSn) {
return pileMemberRelationMapper.selectMemberList(pileSn);
}

View File

@@ -16,6 +16,7 @@ import com.jsowell.common.enums.ykc.OrderPayRecordEnum;
import com.jsowell.common.enums.ykc.OrderStatusEnum;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.YKCUtils;
import com.jsowell.pile.domain.*;
import com.jsowell.pile.domain.ebike.deviceupload.EBikeMessageCmd03;
import com.jsowell.pile.dto.*;
@@ -246,6 +247,23 @@ public abstract class AbstractProgramLogic implements InitializingBean {
orderBasicInfo.setSettlementTime(DateUtils.getNowDate()); // 结算时间
}
orderBasicInfo.setRefundAmount(residue); // 结算退款金额
if (StringUtils.isBlank(orderBasicInfo.getStartSoc()) || StringUtils.isBlank(orderBasicInfo.getEndSoc())) {
try {
Map<String, String> socMap = YKCUtils.getSOCMap(orderBasicInfo.getTransactionCode());
if (Objects.nonNull(socMap)) {
if (StringUtils.isBlank(orderBasicInfo.getStartSoc())) {
orderBasicInfo.setStartSoc(socMap.get("startSoc"));
}
if (StringUtils.isBlank(orderBasicInfo.getEndSoc())) {
orderBasicInfo.setEndSoc(socMap.get("endSoc"));
}
}
} catch (Exception e) {
logger.error("获取订单充电开始结束SOC失败:{}", e.getMessage());
}
}
}
/**

View File

@@ -23,6 +23,14 @@ public class ConnectorInfo {
@JSONField(name = "ConnectorID")
private String connectorID;
/**
* 设备接口分类
* 1车辆充电设备接口
* 2换电站内的电池箱 充电设备接口
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/**
* 充电设备接口名称 N
*/
@@ -51,12 +59,36 @@ public class ConnectorInfo {
@JSONField(name = "VoltageLowerLimits")
private Integer voltageLowerLimits;
/**
*恒功率电压上限
*/
@JSONField(name = "ConstantVoltageUpperLimits")
private Integer constantVoltageUpperLimits;
/**
*恒功率电压下限
*/
@JSONField(name = "ConstantVoltageLowerLimits")
private Integer constantVoltageLowerLimits;
/**
* 额定电流(单位A) Y
*/
@JSONField(name = "Current")
private Integer current;
/**
*恒功率电流上限
*/
@JSONField(name = "ConstantCurrentUpperLimits")
private Integer ConstantCurrentUpperLimits;
/**
*恒功率电流下限
*/
@JSONField(name = "ConstantCurrentLowerLimits")
private Integer ConstantCurrentLowerLimits;
/**
* 额定功率(单位kW) Y
*/
@@ -105,4 +137,10 @@ public class ConnectorInfo {
@JSONField(name = "AuxPower")
private Integer auxPower;
/**
* 运营时间
*/
@JSONField(name = "OpreateHours")
private String opreateHours;
}

View File

@@ -24,6 +24,13 @@ public class EquipmentInfo {
@JSONField(name = "EquipmentID")
private String equipmentID;
/**
* 设备唯一编码
*设备生产商组织机构代 码 9 位+设备出厂唯一 编码
*/
@JSONField(name = "EquipmentUniqueNumber")
private String equipmentUniqueNumber;
/**
* 设备生产商组织机构代码 Y
*/
@@ -54,7 +61,7 @@ public class EquipmentInfo {
* YYYY-MM-DD
*/
@JSONField(name = "ProductionDate")
private String productionDate;
private String productionDate;
/**
* 建设时间 Y
@@ -69,6 +76,13 @@ public class EquipmentInfo {
@JSONField(name = "EquipmentType")
private Integer equipmentType;
/**
* 设备分类
* 1车辆充电设备 2换电站内的电池箱 充电设备
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/**
* 设备状态 Y
* 0未知
@@ -104,13 +118,15 @@ public class EquipmentInfo {
* 充电设备经度 N
* GCJ-02坐标系
*/
// private BigDecimal EquipmentLng;
@JSONField(name = "EquipmentLng")
private BigDecimal equipmentLng;
/**
* 充电设备纬度 N
* GCJ-02坐标系
*/
// private BigDecimal EquipmentLat;
@JSONField(name = "EquipmentLat")
private BigDecimal equipmentLat;
/**
* 是否支持VIN码识别(0-否1-是) Y
@@ -124,4 +140,10 @@ public class EquipmentInfo {
@JSONField(name = "Power")
private BigDecimal power;
/**
* 站点额定功率
*/
private BigDecimal stationRatedPower;
}

View File

@@ -186,6 +186,14 @@ public class BaseStationInfo {
@JSONField(name = "MatchCars")
private String matchCars;
/**
* 服务车型描述
* 描述换电站可服务的车系车型(厂牌型号)
* 注:站点分类为 2 或 3 时,此字段必填,为 1 时非必填。
*/
@JSONField(name = "SwapMatchCars")
private List<String> swapMatchCars;
/**
* 车位楼层及数量描述 N
* 车位楼层以及数量信息
@@ -256,4 +264,11 @@ public class BaseStationInfo {
@JSONField(name = "EquipmentInfos")
private List<EquipmentInfo> equipmentInfos;
/**
* 充电设备信息列表 Y
* 该充电站所有充电设备信息对象集合
*/
@JSONField(name = "SupEquipmentInfos")
private List<EquipmentInfo> supequipmentInfos;
}

View File

@@ -95,6 +95,11 @@ public class OrderVO {
*/
private String orderStatus;
/**
* 停止原因码
*/
private String stopReasonCode;
/**
* 订单异常原因
*/

View File

@@ -47,6 +47,11 @@ public class PersonPileConnectorSumInfoVO {
*/
private String sourceType;
/**
* 停止原因码
*/
private String stopReasonCode;
/**
* 停止原因
*/

View File

@@ -39,6 +39,11 @@ public class UniAppOrderVO {
*/
private String pileConnectorCode;
/**
* 停止充电原因码
*/
private String stopReasonCode;
/**
* 异常原因
*/

View File

@@ -62,6 +62,7 @@ public class OrderDetailInfoVO {
private String vinCode; // vin号
private String startTime; // 充电开始时间
private String endTime; // 充电结束时间
private String stopReasonCode; // 停止原因码
private String stopReasonMsg; // 停止原因
private String createTime; // 订单创建时间
private String startSOC; // 开始SOC

View File

@@ -36,6 +36,7 @@
<result column="reserved_end_time" jdbcType="TIMESTAMP" property="reservedEndTime" />
<result column="start_soc" jdbcType="VARCHAR" property="startSoc" />
<result column="end_soc" jdbcType="VARCHAR" property="endSoc" />
<result column="stop_reason_code" jdbcType="VARCHAR" property="stopReasonCode" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="settlement_time" jdbcType="TIMESTAMP" property="settlementTime" />
<result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
@@ -52,7 +53,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, order_amount, virtual_amount,
group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, charge_end_time,
start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, reason, settlement_time, refund_amount,
start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason, settlement_time, refund_amount,
refund_status, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
@@ -79,7 +80,7 @@
discount_amount, settle_amount, remedial_amount,
charge_start_time, charge_end_time, start_type,
reserved_start_time, reserved_end_time,
start_soc, end_soc,
start_soc, end_soc, stop_reason_code,
reason, settlement_time, refund_amount,
refund_status, create_by, create_time,
update_by, update_time, del_flag
@@ -94,7 +95,7 @@
#{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL},
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
#{reservedStartTime,jdbcType=TIMESTAMP},#{reservedEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{stopReasonCode,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR}, #{settlementTime,jdbcType=TIMESTAMP}, #{refundAmount,jdbcType=DECIMAL},
#{refundStatus,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR}
@@ -197,6 +198,9 @@
<if test="endSoc != null">
end_soc,
</if>
<if test="stopReasonCode != null">
stop_reason_code,,
</if>
<if test="reason != null">
reason,
</if>
@@ -319,6 +323,9 @@
<if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
@@ -445,6 +452,9 @@
<if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
@@ -509,6 +519,7 @@
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR},
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
@@ -679,6 +690,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="stop_reason_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="reason = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR}
@@ -951,6 +967,13 @@
</if>
</foreach>
</trim>
<trim prefix="stop_reason_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stopReasonCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="reason = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.reason != null">
@@ -1027,7 +1050,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, order_amount,
virtual_amount, group_code, discount_amount, settle_amount, remedial_amount, charge_start_time,
charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, reason, settlement_time,
charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason, settlement_time,
refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag
)
values
@@ -1043,7 +1066,7 @@
#{item.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP},
#{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.reservedStartTime,jdbcType=TIMESTAMP},
#{item.reservedEndTime,jdbcType=TIMESTAMP},
#{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.reason,jdbcType=VARCHAR},
#{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.stopReasonCode,jdbcType=VARCHAR}, #{item.reason,jdbcType=VARCHAR},
#{item.settlementTime,jdbcType=TIMESTAMP}, #{item.refundAmount,jdbcType=DECIMAL},
#{item.refundStatus,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR}
@@ -1088,6 +1111,7 @@
reserved_end_time,
start_soc,
end_soc,
stop_reason_code,
reason,
settlement_time,
refund_amount,
@@ -1134,6 +1158,7 @@
#{reservedEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR},
#{endSoc,jdbcType=VARCHAR},
#{stopReasonCode,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR},
#{settlementTime,jdbcType=TIMESTAMP},
#{refundAmount,jdbcType=DECIMAL},
@@ -1180,6 +1205,7 @@
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR},
stop_reason_code = {stopReasonCode,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
@@ -1291,6 +1317,9 @@
<if test="endSoc != null">
end_soc,
</if>
<if test="stopReasonCode != null">
stop_reason_code,
</if>
<if test="reason != null">
reason,
</if>
@@ -1417,6 +1446,9 @@
<if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
@@ -1543,6 +1575,9 @@
<if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
@@ -1949,6 +1984,9 @@
<if test="endSoc != null">
end_soc,
</if>
<if test="stopReasonCode != null">
stop_reason_code,
</if>
<if test="reason != null">
reason,
</if>
@@ -2059,6 +2097,9 @@
<if test="endSoc != null">
#{endSoc},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode},
</if>
<if test="reason != null">
#{reason},
</if>
@@ -2170,6 +2211,9 @@
<if test="endSoc != null">
end_soc = #{endSoc},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode},
</if>
<if test="reason != null">
reason = #{reason},
</if>
@@ -2389,6 +2433,7 @@
t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
t1.stop_reason_code as stopReasonCode,
t1.reason,
t1.station_id as stationId,
t3.station_name as stationName,
@@ -3026,4 +3071,13 @@
limit 20
</select>
<select id="tempGetOrderCodes" resultType="java.lang.String">
select
order_code
from
order_basic_info
where
station_id = #{stationId,jdbcType=VARCHAR}
and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -31,6 +31,7 @@
<result column="peak_used_electricity" jdbcType="DECIMAL" property="peakUsedElectricity" />
<result column="flat_used_electricity" jdbcType="DECIMAL" property="flatUsedElectricity" />
<result column="valley_used_electricity" jdbcType="DECIMAL" property="valleyUsedElectricity" />
<result column="stop_reason_code" jdbcType="VARCHAR" property="stopReasonCode" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="trade_date" jdbcType="TIMESTAMP" property="tradeDate" />
<result column="source_type" jdbcType="VARCHAR" property="sourceType" />
@@ -46,7 +47,7 @@
pile_connector_code, logic_card, vin_code, start_mode, plate_number, charge_start_time,
charge_end_time, start_type, reservation_start_time, reservation_end_time, start_soc,
end_soc, ammeter_total_start, ammeter_total_end, total_used_electricity, sharp_used_electricity,
peak_used_electricity, flat_used_electricity, valley_used_electricity, reason, trade_date,
peak_used_electricity, flat_used_electricity, valley_used_electricity, stop_reason_code, reason, trade_date,
source_type, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
@@ -72,7 +73,7 @@
start_soc, end_soc, ammeter_total_start,
ammeter_total_end, total_used_electricity,
sharp_used_electricity, peak_used_electricity,
flat_used_electricity, valley_used_electricity,
flat_used_electricity, valley_used_electricity, stop_reason_code,
reason, trade_date, source_type,
create_by, create_time, update_by,
update_time, del_flag)
@@ -85,7 +86,7 @@
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{ammeterTotalStart,jdbcType=VARCHAR},
#{ammeterTotalEnd,jdbcType=VARCHAR}, #{totalUsedElectricity,jdbcType=DECIMAL},
#{sharpUsedElectricity,jdbcType=DECIMAL}, #{peakUsedElectricity,jdbcType=DECIMAL},
#{flatUsedElectricity,jdbcType=DECIMAL}, #{valleyUsedElectricity,jdbcType=DECIMAL},
#{flatUsedElectricity,jdbcType=DECIMAL}, #{valleyUsedElectricity,jdbcType=DECIMAL}, #{stopReasonCode,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR}, #{tradeDate,jdbcType=TIMESTAMP}, #{sourceType,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR})
@@ -172,6 +173,9 @@
<if test="valleyUsedElectricity != null">
valley_used_electricity,
</if>
<if test="stopReasonCode != null">
stop_reason_code,
</if>
<if test="reason != null">
reason,
</if>
@@ -276,6 +280,9 @@
<if test="valleyUsedElectricity != null">
#{valleyUsedElectricity,jdbcType=DECIMAL},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
@@ -384,6 +391,9 @@
<if test="valleyUsedElectricity != null">
valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
@@ -440,6 +450,7 @@
peak_used_electricity = #{peakUsedElectricity,jdbcType=DECIMAL},
flat_used_electricity = #{flatUsedElectricity,jdbcType=DECIMAL},
valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL},
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
trade_date = #{tradeDate,jdbcType=TIMESTAMP},
source_type = #{sourceType,jdbcType=VARCHAR},
@@ -584,6 +595,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.valleyUsedElectricity,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="stop_reason_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="reason = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR}
@@ -816,6 +832,13 @@
</if>
</foreach>
</trim>
<trim prefix="stop_reason_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stopReasonCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="reason = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.reason != null">
@@ -885,7 +908,7 @@
pile_connector_code, logic_card, vin_code, start_mode, plate_number, charge_start_time,
charge_end_time, start_type, reservation_start_time, reservation_end_time, start_soc,
end_soc, ammeter_total_start, ammeter_total_end, total_used_electricity, sharp_used_electricity,
peak_used_electricity, flat_used_electricity, valley_used_electricity, reason,
peak_used_electricity, flat_used_electricity, valley_used_electricity, stop_reason_code, reason,
trade_date, source_type, create_by, create_time, update_by, update_time, del_flag
)
values
@@ -900,7 +923,7 @@
#{item.endSoc,jdbcType=VARCHAR}, #{item.ammeterTotalStart,jdbcType=VARCHAR}, #{item.ammeterTotalEnd,jdbcType=VARCHAR},
#{item.totalUsedElectricity,jdbcType=DECIMAL}, #{item.sharpUsedElectricity,jdbcType=DECIMAL},
#{item.peakUsedElectricity,jdbcType=DECIMAL}, #{item.flatUsedElectricity,jdbcType=DECIMAL},
#{item.valleyUsedElectricity,jdbcType=DECIMAL}, #{item.reason,jdbcType=VARCHAR},
#{item.valleyUsedElectricity,jdbcType=DECIMAL}, #{item.stopReasonCode,jdbcType=VARCHAR}, #{item.reason,jdbcType=VARCHAR},
#{item.tradeDate,jdbcType=TIMESTAMP}, #{item.sourceType,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.delFlag,jdbcType=CHAR})
@@ -939,6 +962,7 @@
peak_used_electricity,
flat_used_electricity,
valley_used_electricity,
stop_reason_code,
reason,
trade_date,
source_type,
@@ -979,6 +1003,7 @@
#{peakUsedElectricity,jdbcType=DECIMAL},
#{flatUsedElectricity,jdbcType=DECIMAL},
#{valleyUsedElectricity,jdbcType=DECIMAL},
#{stopReasonCode,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR},
#{tradeDate,jdbcType=TIMESTAMP},
#{sourceType,jdbcType=VARCHAR},
@@ -1019,6 +1044,7 @@
peak_used_electricity = #{peakUsedElectricity,jdbcType=DECIMAL},
flat_used_electricity = #{flatUsedElectricity,jdbcType=DECIMAL},
valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL},
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
trade_date = #{tradeDate,jdbcType=TIMESTAMP},
source_type = #{sourceType,jdbcType=VARCHAR},
@@ -1114,6 +1140,9 @@
<if test="valleyUsedElectricity != null">
valley_used_electricity,
</if>
<if test="stopReasonCode != null">
stop_reason_code,
</if>
<if test="reason != null">
reason,
</if>
@@ -1222,6 +1251,9 @@
<if test="valleyUsedElectricity != null">
#{valleyUsedElectricity,jdbcType=DECIMAL},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
@@ -1330,6 +1362,9 @@
<if test="valleyUsedElectricity != null">
valley_used_electricity = #{valleyUsedElectricity,jdbcType=DECIMAL},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>