mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update
This commit is contained in:
@@ -12,7 +12,6 @@ import com.jsowell.service.PileService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -73,15 +72,4 @@ public class JumpController extends BaseController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 迁移异常订单到订单主表
|
|
||||||
* 临时接口,使用完删除
|
|
||||||
* http://localhost:8080/app-xcx-h5/moveAbnormalOrder
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/moveAbnormalOrder")
|
|
||||||
public RestApiResponse<?> moveAbnormalOrder() {
|
|
||||||
orderBasicInfoService.moveAbnormalOrder();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,8 +130,6 @@ public interface IOrderBasicInfoService {
|
|||||||
*/
|
*/
|
||||||
void saveAbnormalOrder(TransactionRecordsData data);
|
void saveAbnormalOrder(TransactionRecordsData data);
|
||||||
|
|
||||||
void moveAbnormalOrder();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取充电实时数据
|
* 获取充电实时数据
|
||||||
* @param orderCode 订单编号
|
* @param orderCode 订单编号
|
||||||
|
|||||||
@@ -836,147 +836,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void moveAbnormalOrder() {
|
|
||||||
List<OrderAbnormalRecord> list = orderAbnormalRecordService.selectOrderAbnormalRecordList(null);
|
|
||||||
for (OrderAbnormalRecord record : list) {
|
|
||||||
logger.info("异常订单记录 record:{}", record);
|
|
||||||
TransactionRecordsData data = new TransactionRecordsData();
|
|
||||||
BeanUtils.copyBeanProp(data, record);
|
|
||||||
data.setTransactionCode(record.getOrderCode());
|
|
||||||
logger.info("异常订单记录 data:{}", data);
|
|
||||||
tempSaveAbnormalOrder(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void tempSaveAbnormalOrder(TransactionRecordsData data) {
|
|
||||||
// 保存到订单主表
|
|
||||||
// 订单基本信息
|
|
||||||
PileInfoVO pileInfoVO = pileBasicInfoService.selectPileInfoBySn(data.getPileSn());
|
|
||||||
if (pileInfoVO == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String orderCode = IdUtils.getOrderCode();
|
|
||||||
OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder().build();
|
|
||||||
// 订单编号
|
|
||||||
orderBasicInfo.setOrderCode(orderCode);
|
|
||||||
// 交易流水号
|
|
||||||
orderBasicInfo.setTransactionCode(data.getTransactionCode());
|
|
||||||
// 订单状态 固定值异常
|
|
||||||
orderBasicInfo.setOrderStatus(OrderStatusEnum.SUSPICIOUS.getValue());
|
|
||||||
// 站点id
|
|
||||||
orderBasicInfo.setStationId(pileInfoVO.getStationId());
|
|
||||||
// 充电桩编号
|
|
||||||
orderBasicInfo.setPileSn(data.getPileSn());
|
|
||||||
// 枪口号
|
|
||||||
orderBasicInfo.setConnectorCode(data.getConnectorCode());
|
|
||||||
// 枪口编号
|
|
||||||
orderBasicInfo.setPileConnectorCode(pileInfoVO.getPileSn() + data.getConnectorCode());
|
|
||||||
// 启动方式
|
|
||||||
String transactionIdentifier = data.getTransactionIdentifier();
|
|
||||||
String startMode = null;
|
|
||||||
if (StringUtils.equals(transactionIdentifier, "01")) {
|
|
||||||
startMode = StartModeEnum.APP.getValue();
|
|
||||||
} else if (StringUtils.equals(transactionIdentifier, "02")) {
|
|
||||||
// 卡启动
|
|
||||||
startMode = StartModeEnum.CARD.getValue();
|
|
||||||
}
|
|
||||||
orderBasicInfo.setStartMode(startMode);
|
|
||||||
// 支付方式
|
|
||||||
orderBasicInfo.setPayMode(null);
|
|
||||||
// 支付金额
|
|
||||||
orderBasicInfo.setPayAmount(null);
|
|
||||||
// 支付状态
|
|
||||||
orderBasicInfo.setPayStatus(null);
|
|
||||||
// 支付时间
|
|
||||||
orderBasicInfo.setPayTime(null);
|
|
||||||
// 订单金额
|
|
||||||
orderBasicInfo.setOrderAmount(new BigDecimal(data.getConsumptionAmount()));
|
|
||||||
// 充电开始时间
|
|
||||||
orderBasicInfo.setChargeStartTime(DateUtils.parseDate(data.getStartTime()));
|
|
||||||
// 充电结束时间
|
|
||||||
orderBasicInfo.setChargeEndTime(DateUtils.parseDate(data.getEndTime()));
|
|
||||||
// 停止原因
|
|
||||||
orderBasicInfo.setReason(data.getStopReasonMsg());
|
|
||||||
// 结算时间
|
|
||||||
orderBasicInfo.setSettlementTime(DateUtils.getNowDate());
|
|
||||||
// 创建人
|
|
||||||
orderBasicInfo.setCreateBy(data.getLogicCard());
|
|
||||||
orderBasicInfo.setUpdateBy("system");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 订单详情
|
|
||||||
OrderDetail orderDetail = OrderDetail.builder().build();
|
|
||||||
// 订单编号
|
|
||||||
orderDetail.setOrderCode(orderCode);
|
|
||||||
// 订单总金额
|
|
||||||
orderDetail.setTotalOrderAmount(new BigDecimal(data.getConsumptionAmount()));
|
|
||||||
// 总用电量
|
|
||||||
orderDetail.setTotalUsedElectricity(new BigDecimal(data.getTotalElectricity()));
|
|
||||||
// 总服务费金额
|
|
||||||
// orderDetail.setTotalServiceAmount();
|
|
||||||
// 总电费金额
|
|
||||||
// orderDetail.setTotalElectricityAmount();
|
|
||||||
|
|
||||||
// 尖时段金额
|
|
||||||
orderDetail.setSharpAmount(new BigDecimal(data.getSharpAmount()));
|
|
||||||
// 尖时段单价
|
|
||||||
orderDetail.setSharpPrice(new BigDecimal(data.getSharpPrice()));
|
|
||||||
// 尖时段服务费单价
|
|
||||||
// orderDetail.setSharpServicePrice();
|
|
||||||
// 尖时段电费单价
|
|
||||||
// orderDetail.setSharpElectricityPrice();
|
|
||||||
// 尖时段用电量
|
|
||||||
orderDetail.setSharpUsedElectricity(new BigDecimal(data.getSharpUsedElectricity()));
|
|
||||||
|
|
||||||
// 峰时段金额
|
|
||||||
orderDetail.setPeakAmount(new BigDecimal(data.getPeakAmount()));
|
|
||||||
// 峰时段单价
|
|
||||||
orderDetail.setPeakPrice(new BigDecimal(data.getPeakPrice()));
|
|
||||||
// 峰时段服务费单价
|
|
||||||
// orderDetail.setPeakServicePrice();
|
|
||||||
// 峰时段电费单价
|
|
||||||
// orderDetail.setPeakElectricityPrice();
|
|
||||||
// 峰时段用电量
|
|
||||||
orderDetail.setPeakUsedElectricity(new BigDecimal(data.getPeakUsedElectricity()));
|
|
||||||
|
|
||||||
// 平时段金额
|
|
||||||
orderDetail.setFlatAmount(new BigDecimal(data.getFlatAmount()));
|
|
||||||
// 平时段单价
|
|
||||||
orderDetail.setFlatPrice(new BigDecimal(data.getFlatPrice()));
|
|
||||||
// 平时段服务费单价
|
|
||||||
// orderDetail.setFlatServicePrice();
|
|
||||||
// 平时段电费单价
|
|
||||||
// orderDetail.setFlatElectricityPrice();
|
|
||||||
// 平时段用电量
|
|
||||||
orderDetail.setFlatUsedElectricity(new BigDecimal(data.getFlatUsedElectricity()));
|
|
||||||
|
|
||||||
|
|
||||||
// 谷时段金额
|
|
||||||
orderDetail.setValleyAmount(new BigDecimal(data.getValleyAmount()));
|
|
||||||
// 谷时段单价
|
|
||||||
orderDetail.setValleyPrice(new BigDecimal(data.getValleyPrice()));
|
|
||||||
// 谷时段服务费单价
|
|
||||||
// orderDetail.setValleyServicePrice();
|
|
||||||
// 谷时段电费单价
|
|
||||||
// orderDetail.setValleyElectricityPrice();
|
|
||||||
// 谷时段用电量
|
|
||||||
orderDetail.setValleyUsedElectricity(new BigDecimal(data.getValleyUsedElectricity()));
|
|
||||||
orderDetail.setUpdateBy("system");
|
|
||||||
|
|
||||||
if (data.getCreateTime() != null) {
|
|
||||||
orderBasicInfo.setCreateTime(data.getCreateTime());
|
|
||||||
orderDetail.setCreateTime(data.getCreateTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()
|
|
||||||
.orderBasicInfo(orderBasicInfo)
|
|
||||||
.orderDetail(orderDetail)
|
|
||||||
.build();
|
|
||||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单编号获取充电实时数据 时间倒序
|
* 根据订单编号获取充电实时数据 时间倒序
|
||||||
* 订单只有在充电中,才会把实时数据保存到redis
|
* 订单只有在充电中,才会把实时数据保存到redis
|
||||||
|
|||||||
Reference in New Issue
Block a user