增加桩停用提示语,流量方活动电费使用场站电费,修改桩停用,枪也停用
This commit is contained in:
parent
cdb7512cd9
commit
bf1b6f7049
@ -0,0 +1,101 @@
|
||||
package com.xhpc.activity.controller;
|
||||
|
||||
import com.xhpc.activity.service.XhpcWorkHistoryOrderService;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 9:32
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/workHistoryOrder")
|
||||
public class XhpcWorkHistoryOrderController extends BaseController {
|
||||
|
||||
@Resource
|
||||
XhpcWorkHistoryOrderService xhpcWorkHistoryOrderService;
|
||||
|
||||
/**
|
||||
* 历史订单
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getListPage")
|
||||
public TableDataInfo getListPage(String tenantId, Long chargingStationId, Long chargingPileId, Long terminalId, String phone, String transactionNumber, String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime,Integer type,
|
||||
String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult,String stopReasonEvcs)
|
||||
|
||||
{
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tenantId",tenantId);
|
||||
params.put("chargingStationId",chargingStationId);
|
||||
params.put("chargingPileId", chargingPileId);
|
||||
params.put("terminalId", terminalId);
|
||||
params.put("phone", phone);
|
||||
params.put("transactionNumber", transactionNumber);
|
||||
params.put("chargingStationName", chargingStationName);
|
||||
params.put("operatorId", operatorId);
|
||||
params.put("source", source);
|
||||
params.put("beginStartTime", beginStartTime);
|
||||
params.put("beginEndTime", beginEndTime);
|
||||
params.put("type", type);
|
||||
params.put("affiliationOrganization", affiliationOrganization);
|
||||
params.put("evcsOrderNo", evcsOrderNo);
|
||||
params.put("plateNum", plateNum);
|
||||
params.put("internetId", internetId);
|
||||
params.put("internetSerialNumber", internetSerialNumber);
|
||||
params.put("terminalName", terminalName);
|
||||
params.put("vinCode", vinCode);
|
||||
params.put("overStartTime", overStartTime);
|
||||
params.put("overEndTime", overEndTime);
|
||||
params.put("personnelId", personnelId);
|
||||
params.put("confirmResult", confirmResult);
|
||||
params.put("stopReasonEvcs", stopReasonEvcs);
|
||||
|
||||
List<Map<String, Object>> listPage = xhpcWorkHistoryOrderService.getListPage(params);
|
||||
return getDataTable(listPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 历史订单导出
|
||||
* @throws IOException 文件创建异常
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void getExport(HttpServletResponse response,String tenantId, Long chargingStationId, Long chargingPileId, Long terminalId, String phone, String transactionNumber,String chargingStationName, Long operatorId, Integer source, String beginStartTime, String beginEndTime,Integer type,
|
||||
String affiliationOrganization, String evcsOrderNo, String plateNum, Integer internetId, String internetSerialNumber, String terminalName, String vinCode, String overStartTime, String overEndTime, Long personnelId, Integer confirmResult,String stopReasonEvcs) throws IOException {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("tenantId",tenantId);
|
||||
params.put("chargingStationId",chargingStationId);
|
||||
params.put("chargingPileId", chargingPileId);
|
||||
params.put("terminalId", terminalId);
|
||||
params.put("phone", phone);
|
||||
params.put("transactionNumber", transactionNumber);
|
||||
params.put("chargingStationName", chargingStationName);
|
||||
params.put("operatorId", operatorId);
|
||||
params.put("source", source);
|
||||
params.put("beginStartTime", beginStartTime);
|
||||
params.put("beginEndTime", beginEndTime);
|
||||
params.put("type", type);
|
||||
params.put("affiliationOrganization", affiliationOrganization);
|
||||
params.put("evcsOrderNo", evcsOrderNo);
|
||||
params.put("plateNum", plateNum);
|
||||
params.put("internetId", internetId);
|
||||
params.put("internetSerialNumber", internetSerialNumber);
|
||||
params.put("terminalName", terminalName);
|
||||
params.put("vinCode", vinCode);
|
||||
params.put("overStartTime", overStartTime);
|
||||
params.put("overEndTime", overEndTime);
|
||||
params.put("personnelId", personnelId);
|
||||
params.put("confirmResult", confirmResult);
|
||||
params.put("stopReasonEvcs", stopReasonEvcs);
|
||||
xhpcWorkHistoryOrderService.export(response,params);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,313 @@
|
||||
package com.xhpc.activity.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 9:17
|
||||
*/
|
||||
@Data
|
||||
public class XhpcWorkHistoryOrder implements Serializable {
|
||||
/**
|
||||
* 历史订单id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long historyOrderId;
|
||||
|
||||
/**
|
||||
* 电站id
|
||||
*/
|
||||
private Long chargingStationId;
|
||||
|
||||
/**
|
||||
* 充电订单id
|
||||
*/
|
||||
private Long chargeOrderId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
private Long terminalId;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 互联网订单流水号
|
||||
*/
|
||||
private String internetSerialNumber;
|
||||
|
||||
/**
|
||||
* Evcs订单号,供监管平台和第三方使用
|
||||
*/
|
||||
private String evcsOrderNo;
|
||||
|
||||
/**
|
||||
* 订单总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 电站活动抵扣
|
||||
*/
|
||||
private BigDecimal promotionDiscount;
|
||||
|
||||
/**
|
||||
* 实际价格
|
||||
*/
|
||||
private BigDecimal actPrice;
|
||||
|
||||
/**
|
||||
* 实收电费
|
||||
*/
|
||||
private BigDecimal actPowerPrice;
|
||||
|
||||
/**
|
||||
* 实收服务费
|
||||
*/
|
||||
private BigDecimal actServicePrice;
|
||||
|
||||
/**
|
||||
* 流量方总金额抽成
|
||||
*/
|
||||
private BigDecimal internetCommission;
|
||||
|
||||
/**
|
||||
* 流量方服务费抽成
|
||||
*/
|
||||
private BigDecimal internetSvcCommission;
|
||||
/**
|
||||
* 流量方电量抽成
|
||||
*/
|
||||
private BigDecimal internetDegreeCommission;
|
||||
|
||||
/**
|
||||
* 平台总金额抽成
|
||||
*/
|
||||
private BigDecimal platformCommission;
|
||||
|
||||
/**
|
||||
* 平台服务费抽成
|
||||
*/
|
||||
private BigDecimal platformSvcCommisssion;
|
||||
|
||||
/**
|
||||
* 运维总抽成
|
||||
*/
|
||||
private BigDecimal operationCommission;
|
||||
|
||||
/**
|
||||
* 运维服务费抽成
|
||||
*/
|
||||
private BigDecimal operationSvcCommission;
|
||||
|
||||
/**
|
||||
* 开始充电soc
|
||||
*/
|
||||
private String startSoc;
|
||||
|
||||
/**
|
||||
* 结束时soc
|
||||
*/
|
||||
private String endSoc;
|
||||
|
||||
/**
|
||||
* 对账状态(0待确认 1已确认,2待提交,3待审核)
|
||||
*/
|
||||
private Integer reconciliationStatus;
|
||||
|
||||
/**
|
||||
* 清分状态(0待清分 1清分在途,2已提现,3待提交,4待审核)
|
||||
*/
|
||||
private Integer sortingStatus;
|
||||
|
||||
/**
|
||||
* 1 自动结算 2 平台结算
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 总电费
|
||||
*/
|
||||
private BigDecimal powerPriceTotal;
|
||||
|
||||
/**
|
||||
* 总服务费
|
||||
*/
|
||||
private BigDecimal servicePriceTotal;
|
||||
|
||||
/**
|
||||
* 活动总电费
|
||||
*/
|
||||
private BigDecimal activityPowerPriceTotal;
|
||||
|
||||
/**
|
||||
* 活动总服务费
|
||||
*/
|
||||
private BigDecimal activityServicePriceTotal;
|
||||
|
||||
/**
|
||||
* 活动总金额
|
||||
*/
|
||||
private BigDecimal activityTotalPrice;
|
||||
|
||||
/**
|
||||
* 0未统计 1已统计
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* VIN 码
|
||||
*/
|
||||
private String vinNormal;
|
||||
|
||||
/**
|
||||
* 充电电量
|
||||
*/
|
||||
private Double totalPower;
|
||||
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 停止原因
|
||||
*/
|
||||
private String stopReasonEvcs ;
|
||||
|
||||
|
||||
private String stopReasonEvcsName ;
|
||||
|
||||
/**
|
||||
* 运营商/场站OperatorID
|
||||
*/
|
||||
private String operatorIdEvcs;
|
||||
|
||||
/**
|
||||
* 流量方OperatorID
|
||||
*/
|
||||
private String operatorId3rdptyEvcs;
|
||||
|
||||
/**
|
||||
* 终端客户开启充电方式
|
||||
* 0:未知
|
||||
* 1:市/省级平台无卡启动
|
||||
* 2:有卡启动
|
||||
* 3:其他无卡启动
|
||||
*/
|
||||
private Integer chargeModelEvcs;
|
||||
|
||||
/**
|
||||
* 实际充电的客户在运营商侧的名称,<=20字符
|
||||
*/
|
||||
private String userNameEvcs;
|
||||
|
||||
/**
|
||||
* 接口额定功率
|
||||
* 单位:kW, 小数点后 1 位
|
||||
*/
|
||||
private Double connectorPowerEvcs;
|
||||
|
||||
/**
|
||||
* 电表总起值
|
||||
* 单位:度, 小数点后2位
|
||||
*/
|
||||
private Double meterValueStartEvcs;
|
||||
|
||||
/**
|
||||
* 电表总结束值
|
||||
* 单位:度, 小数点后2位
|
||||
*/
|
||||
private Double meterValueEndEvcs;
|
||||
|
||||
/**
|
||||
* 充电用户手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
|
||||
/**
|
||||
* 推送第三方订单返回的确认结果
|
||||
*/
|
||||
private Integer confirmResult;
|
||||
|
||||
/**
|
||||
* 费率模型id
|
||||
*/
|
||||
private Long rateModelId;
|
||||
|
||||
/**
|
||||
* 充电方式
|
||||
*/
|
||||
private String chargingMode;
|
||||
|
||||
/**
|
||||
* 充电方式
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private String activityId;
|
||||
|
||||
/** 搜索值 */
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.xhpc.activity.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 9:25
|
||||
*/
|
||||
public interface XhpcWorkHistoryOrderMapper {
|
||||
|
||||
List<Map<String,Object>> getListPage(@Param("params")Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xhpc.activity.service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 9:23
|
||||
*/
|
||||
public interface XhpcWorkHistoryOrderService {
|
||||
|
||||
List<Map<String,Object>> getListPage(Map<String, Object> params);
|
||||
|
||||
public void export(HttpServletResponse response, Map<String, Object> params) throws IOException;
|
||||
}
|
||||
@ -0,0 +1,154 @@
|
||||
package com.xhpc.activity.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.poi.excel.BigExcelWriter;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.xhpc.activity.mapper.XhpcWorkHistoryOrderMapper;
|
||||
import com.xhpc.activity.service.XhpcWorkHistoryOrderService;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 9:23
|
||||
*/
|
||||
@Service
|
||||
public class XhpcWorkHistoryOrderServiceImpl extends BaseService implements XhpcWorkHistoryOrderService {
|
||||
|
||||
@Resource
|
||||
XhpcWorkHistoryOrderMapper xhpcWorkHistoryOrderMapper;
|
||||
@Resource
|
||||
private TokenService tokenService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getListPage(Map<String, Object> params) {
|
||||
|
||||
|
||||
//获取登陆用户
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
//params.put("tenantId", loginUser.getTenantId());
|
||||
//桩的统计、该时段金额
|
||||
if (UserTypeUtil.USER_ID !=sysUserId) {
|
||||
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())) {
|
||||
params.put("status", 1);
|
||||
//运营商看自己的场站
|
||||
} else {
|
||||
params.put("status", 2);
|
||||
//查询赋值的场站
|
||||
}
|
||||
} else {
|
||||
params.put("status", 0);
|
||||
}
|
||||
startPage();
|
||||
return xhpcWorkHistoryOrderMapper.getListPage(params);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, Map<String, Object> params) throws IOException {
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
//params.put("tenantId", loginUser.getTenantId());
|
||||
//桩的统计、该时段金额
|
||||
if (UserTypeUtil.USER_ID !=sysUserId) {
|
||||
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())) {
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
params.put("status", 1);
|
||||
//运营商看自己的场站
|
||||
} else {
|
||||
params.put("status", 2);
|
||||
//查询赋值的场站
|
||||
}
|
||||
} else {
|
||||
params.put("status", 0);
|
||||
}
|
||||
List<Map<String, Object>> list= xhpcWorkHistoryOrderMapper.getListPage(params);
|
||||
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter("HistoryOrder_" + System.currentTimeMillis() + ".xlsx");
|
||||
writer.addHeaderAlias("historyOrderId", "历史订单ID");
|
||||
writer.addHeaderAlias("serialNumber", "订单号");
|
||||
writer.addHeaderAlias("internetSerialNumber", "流量方订单号");
|
||||
writer.addHeaderAlias("chargingStationName", "电站名称");
|
||||
writer.addHeaderAlias("pileSerialNumber", "桩编号");
|
||||
writer.addHeaderAlias("terminalName", "终端名称");
|
||||
writer.addHeaderAlias("operatorId", "运营商ID");
|
||||
writer.addHeaderAlias("operatorName", "运营商名称");
|
||||
writer.addHeaderAlias("power", "功率");
|
||||
writer.addHeaderAlias("type", "桩类型(1直流(慢) 2交流(快)");
|
||||
writer.addHeaderAlias("orderType", "状态1 自动结算 2 平台结算");
|
||||
writer.addHeaderAlias("startSoc", "开始soc");
|
||||
writer.addHeaderAlias("endSoc", "结束soc");
|
||||
writer.addHeaderAlias("powerPriceTotal", "总电费");
|
||||
writer.addHeaderAlias("servicePriceTotal", "总服务费");
|
||||
writer.addHeaderAlias("totalPrice", "订单总价");
|
||||
writer.addHeaderAlias("activityPowerPriceTotal", "活动总电费");
|
||||
writer.addHeaderAlias("activityServicePriceTotal", "活动总服务费");
|
||||
writer.addHeaderAlias("activityTotalPrice", "活动总金额");
|
||||
writer.addHeaderAlias("promotionDiscount", "电站活动抵扣总金额");
|
||||
writer.addHeaderAlias("actPrice", "实际用户支付金额");
|
||||
writer.addHeaderAlias("internetCommission", "流量方总金额抽成");
|
||||
writer.addHeaderAlias("internetSvcCommission", "流量方服务费抽成");
|
||||
writer.addHeaderAlias("internetDegreeCommission", "流量方电量抽成");
|
||||
writer.addHeaderAlias("platformCommission", "平台总金额抽成");
|
||||
writer.addHeaderAlias("platformSvcCommisssion", "平台服务费抽成");
|
||||
writer.addHeaderAlias("operationCommission", "运维总抽成");
|
||||
writer.addHeaderAlias("operationSvcCommission", "运维服务费抽成");
|
||||
writer.addHeaderAlias("actPowerPrice", "运营商电费");
|
||||
writer.addHeaderAlias("actServicePrice", "运营商服务费");
|
||||
writer.addHeaderAlias("actSumPrice", "运营商总金额");
|
||||
// writer.addHeaderAlias("internetSerialNumber", "电站名称");
|
||||
writer.addHeaderAlias("totalPrice", "订单总价");
|
||||
writer.addHeaderAlias("actPrice", "实际价格");
|
||||
// writer.addHeaderAlias("confirmResult", "历史订单ID");
|
||||
writer.addHeaderAlias("chargingTime", "累计充电时间");
|
||||
writer.addHeaderAlias("chargingDegree", "充电度数");
|
||||
writer.addHeaderAlias("startTime", "开始充电时间");
|
||||
writer.addHeaderAlias("endTime", "结束充电时间");
|
||||
writer.addHeaderAlias("updateTime", "结算时间");
|
||||
writer.addHeaderAlias("chargingModeName", "订单来源");
|
||||
writer.addHeaderAlias("stopReasonEvcs", "停止原因");
|
||||
writer.addHeaderAlias("sourceName", "用户类型");
|
||||
|
||||
// writer.addHeaderAlias("plateNum", "电站名称");
|
||||
// writer.addHeaderAlias("disputeOrderStatus", "桩编号");
|
||||
|
||||
// 默认的,未添加alias的属性也会写出,如果想只写出加了别名的字段,可以调用此方法排除之
|
||||
writer.setOnlyAlias(true);
|
||||
// 一次性写出内容,使用默认样式,强制输出标题
|
||||
writer.write(list, true);
|
||||
//out为OutputStream,需要写出到的目标流
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// //response为HttpServletResponse对象
|
||||
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
// //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
||||
// response.setHeader("Content-Disposition", "attachment;filename=历史订单列表.xls");
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
|
||||
writer.flush(out, true);
|
||||
// 关闭writer,释放内存
|
||||
writer.close();
|
||||
//此处记得关闭输出Servlet流
|
||||
IoUtil.close(out);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,186 @@
|
||||
<?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.xhpc.activity.mapper.XhpcWorkHistoryOrderMapper">
|
||||
|
||||
<resultMap type="com.xhpc.activity.domain.XhpcWorkHistoryOrder" id="XhpcHistoryOrderResult">
|
||||
<id column="history_order_id" jdbcType="BIGINT" property="historyOrderId"/>
|
||||
<result column="charging_station_id" jdbcType="BIGINT" property="chargingStationId"/>
|
||||
<result column="charge_order_id" jdbcType="BIGINT" property="chargeOrderId"/>
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="terminal_id" jdbcType="BIGINT" property="terminalId"/>
|
||||
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber"/>
|
||||
<result column="internet_serial_number" jdbcType="VARCHAR" property="internetSerialNumber"/>
|
||||
<result column="power_price_total" jdbcType="DECIMAL" property="powerPriceTotal"/>
|
||||
<result column="service_price_total" jdbcType="DECIMAL" property="servicePriceTotal"/>
|
||||
<result column="total_price" jdbcType="DECIMAL" property="totalPrice"/>
|
||||
<result column="activity_power_price_total" jdbcType="DECIMAL" property="activityPowerPriceTotal"/>
|
||||
<result column="activity_service_price_total" jdbcType="DECIMAL" property="activityServicePriceTotal"/>
|
||||
<result column="activity_total_price" jdbcType="DECIMAL" property="activityTotalPrice"/>
|
||||
<result column="promotion_discount" jdbcType="DECIMAL" property="promotionDiscount"/>
|
||||
<result column="act_price" jdbcType="DECIMAL" property="actPrice"/>
|
||||
<result column="act_power_price" jdbcType="DECIMAL" property="actPowerPrice"/>
|
||||
<result column="act_service_price" jdbcType="DECIMAL" property="actServicePrice"/>
|
||||
<result column="internet_commission" jdbcType="DECIMAL" property="internetCommission"/>
|
||||
<result column="internet_svc_commission" jdbcType="DECIMAL" property="internetSvcCommission"/>
|
||||
<result column="platform_commission" jdbcType="DECIMAL" property="platformCommission"/>
|
||||
<result column="platform_svc_commisssion" jdbcType="DECIMAL" property="platformSvcCommisssion"/>
|
||||
<result column="operation_commission" jdbcType="DECIMAL" property="operationCommission"/>
|
||||
<result column="operation_svc_commission" jdbcType="DECIMAL" property="operationSvcCommission"/>
|
||||
<result column="start_soc" jdbcType="VARCHAR" property="startSoc"/>
|
||||
<result column="end_soc" jdbcType="VARCHAR" property="endSoc"/>
|
||||
<result column="reconciliation_status" jdbcType="INTEGER" property="reconciliationStatus"/>
|
||||
<result column="sorting_status" jdbcType="INTEGER" property="sortingStatus"/>
|
||||
<result column="type" jdbcType="TINYINT" property="type"/>
|
||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="state" jdbcType="INTEGER" property="state"/>
|
||||
<result column="vin_normal" jdbcType="VARCHAR" property="vinNormal"/>
|
||||
<result column="search_value" jdbcType="VARCHAR" property="searchValue"/>
|
||||
<result column="operator_id_evcs" jdbcType="VARCHAR" property="operatorIdEvcs"/>
|
||||
<result column="charge_model_evcs" jdbcType="INTEGER" property="chargeModelEvcs"/>
|
||||
<result column="connector_power_evcs" jdbcType="DOUBLE" property="connectorPowerEvcs"/>
|
||||
<result column="meter_value_end_evcs" jdbcType="DOUBLE" property="meterValueEndEvcs"/>
|
||||
<result column="meter_value_start_evcs" jdbcType="DOUBLE" property="meterValueStartEvcs"/>
|
||||
<result column="operator_id3rdpty_evcs" jdbcType="VARCHAR" property="operatorId3rdptyEvcs"/>
|
||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
|
||||
<result column="stop_reason_evcs" jdbcType="INTEGER" property="stopReasonEvcs"/>
|
||||
<result column="stop_reason_evcs_name" jdbcType="INTEGER" property="stopReasonEvcsName"/>
|
||||
<result column="rate_model_id" jdbcType="BIGINT" property="rateModelId"/>
|
||||
<result column="total_power" jdbcType="DOUBLE" property="totalPower"/>
|
||||
<result column="user_name_evcs" jdbcType="VARCHAR" property="userNameEvcs"/>
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone"/>
|
||||
<result column="internet_degree_commission" jdbcType="DECIMAL" property="internetDegreeCommission"/>
|
||||
<result column="source" jdbcType="INTEGER" property="source"/>
|
||||
<result column="activity_id" jdbcType="VARCHAR" property="activityId"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
history_order_id, charging_station_id, charge_order_id, user_id, terminal_id, serial_number,
|
||||
internet_serial_number, power_price_total, service_price_total, total_price, promotion_discount,
|
||||
act_price, act_power_price, act_service_price, internet_commission, internet_svc_commission,
|
||||
platform_commission, platform_svc_commisssion, operation_commission, operation_svc_commission,
|
||||
start_soc, end_soc, reconciliation_status, sorting_status, `type`, `status`, del_flag,
|
||||
create_time, create_by, update_time, update_by, remark, `state`, vin_normal, search_value,
|
||||
operator_id_evcs, charge_model_evcs, connector_power_evcs, meter_value_end_evcs,
|
||||
meter_value_start_evcs, operator_id3rdpty_evcs, start_time, stop_reason_evcs, total_power,
|
||||
user_name_evcs, phone, rate_model_id,stop_reason_evcs_name
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="getListPage" resultType="map">
|
||||
select
|
||||
ho.history_order_id as historyOrderId,
|
||||
co.charge_order_id as chargeOrderId,
|
||||
ho.serial_number as serialNumber,
|
||||
ct.name as chargingStationName,
|
||||
ter.pile_serial_number as pileSerialNumber,
|
||||
ter.name as terminalName,
|
||||
op.operator_id as operatorId,
|
||||
op.name as operatorName,
|
||||
-- cp.power as power,
|
||||
-- cp.type as type,
|
||||
-- ho.type as orderType,
|
||||
-- ho.start_soc as startSoc,
|
||||
-- ho.end_soc as endSoc,
|
||||
-- ho.vin_normal as vinCode,
|
||||
-- ho.internet_serial_number as internetSerialNumber,
|
||||
-- ho.evcs_order_no as evcsOrderNo,
|
||||
ho.total_price as totalPrice,
|
||||
ho.act_price as actPrice,
|
||||
-- ho.confirm_Result as confirmResult,
|
||||
-- co.charging_time as chargingTime,
|
||||
-- ho.total_power as chargingDegree,
|
||||
ho.start_time as startTime,
|
||||
ho.end_time as endTime,
|
||||
-- co.update_time as updateTime,
|
||||
-- co.source as source,
|
||||
-- co.Plate_num as plateNum,
|
||||
-- dispute_order_status as disputeOrderStatus,
|
||||
-- ho.power_price_total as powerPriceTotal,
|
||||
-- ho.service_price_total as servicePriceTotal,
|
||||
-- ho.promotion_discount as promotionDiscount,
|
||||
-- ho.activity_power_price_total as activityPowerPriceTotal,
|
||||
-- ho.activity_service_price_total as activityServicePriceTotal,
|
||||
-- ho.activity_total_price as activityTotalPrice,
|
||||
-- ho.act_power_price as actPowerPrice,
|
||||
-- ho.act_service_price as actServicePrice,
|
||||
-- (ho.act_power_price+ho.act_service_price) as actSumPrice,
|
||||
-- ho.internet_commission as internetCommission,
|
||||
-- ho.internet_svc_commission as internetSvcCommission,
|
||||
-- ho.internet_degree_commission as internetDegreeCommission,
|
||||
-- ho.platform_commission as platformCommission,
|
||||
-- ho.platform_svc_commisssion as platformSvcCommisssion,
|
||||
-- ho.operation_commission as operationCommission,
|
||||
-- ho.operation_svc_commission as operationSvcCommission,
|
||||
concat("0X",ho.stop_reason_evcs) AS stopReasonEvcs,
|
||||
ho.stop_reason_evcs_name as stopReasonEvcsName
|
||||
from xhpc_work_history_order as ho
|
||||
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
|
||||
left join xhpc_operator as op on op.operator_id = ct.operator_id
|
||||
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
|
||||
left join xhpc_terminal as ter on ter.terminal_id = ho.terminal_id
|
||||
left join xhpc_charging_pile as cp on cp.charging_pile_id = ter.charging_pile_id
|
||||
|
||||
where ho.status =0 and ho.del_flag=0
|
||||
<if test="params.chargingStationId !=null">
|
||||
and ho.charging_station_id=#{params.chargingStationId}
|
||||
</if>
|
||||
<if test="params.chargingPileId !=null">
|
||||
and ho.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id=#{params.chargingPileId} and del_flag=0)
|
||||
</if>
|
||||
<if test="params.transactionNumber !=null and params.transactionNumber !=''">
|
||||
and ho.serial_number like concat('%', #{params.transactionNumber}, '%')
|
||||
</if>
|
||||
<if test="params.terminalId !=null">
|
||||
and ho.terminal_id=#{params.terminalId}
|
||||
</if>
|
||||
<if test="params.confirmResult !=null">
|
||||
and ho.confirm_Result =#{params.confirmResult}
|
||||
</if>
|
||||
<if test="params.type !=null">
|
||||
and ho.type=#{params.type}
|
||||
</if>
|
||||
<if test="params.source !=null">
|
||||
and ho.source=#{params.source}
|
||||
</if>
|
||||
<if test="params.beginStartTime !=null and params.beginStartTime !=''">
|
||||
and ho.start_time >= #{params.beginStartTime}
|
||||
</if>
|
||||
<if test="params.beginEndTime !=null and params.beginEndTime !=''">
|
||||
and ho.start_time <= #{params.beginEndTime}
|
||||
</if>
|
||||
<if test="params.overStartTime !=null and params.overStartTime !=''">
|
||||
and ho.end_time >= #{params.overStartTime}
|
||||
</if>
|
||||
<if test="params.overEndTime !=null and params.overEndTime !=''">
|
||||
and ho.end_time <= #{params.overEndTime}
|
||||
</if>
|
||||
<if test="params.operatorId !=null">
|
||||
and op.operator_id =#{params.operatorId}
|
||||
</if>
|
||||
<if test="params.status==1">
|
||||
and co.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{params.userId})
|
||||
</if>
|
||||
<if test="params.status==2">
|
||||
and co.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.userId})
|
||||
</if>
|
||||
|
||||
<if test="params.tenantId !=null and '' !=params.tenantId">
|
||||
and ho.tenant_id=#{params.tenantId}
|
||||
</if>
|
||||
<if test="params.stopReasonEvcs !=null and params.stopReasonEvcs !=''">
|
||||
and (ho.stop_reason_evcs like concat('%', #{params.stopReasonEvcs}, '%') or ho.stop_reason_evcs_name like concat('%', #{params.stopReasonEvcs}, '%'))
|
||||
</if>
|
||||
<if test="params.tenantId !=null and '' !=params.tenantId">
|
||||
and ho.tenant_id=#{params.tenantId}
|
||||
</if>
|
||||
order by ho.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,93 @@
|
||||
package com.xhpc.common.enums;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 16:44
|
||||
*/
|
||||
public enum StopReasonEnum {
|
||||
|
||||
FORTY("40", "APP 远程停止(0X40)"),
|
||||
FORTY_ONE("41", "SOC 达到 100%(0X41)"),
|
||||
FORTY_TWO("42", "充电电量满足设定条件(0X42)"),
|
||||
FORTY_THREE("43", "充电金额满足设定条件(0X43)"),
|
||||
FORTY_FOUR("44", "充电时间满足设定条件(0X44)"),
|
||||
FORTY_FIVE("45", "手动停止充电(0X45)"),
|
||||
FORTY_A("4A", "充电桩控制系统故障(需要重启或自动恢复)(0X4A)"),
|
||||
FORTY_B("4B", "控制导引断开(0X4B)"),
|
||||
FORTY_C("4C", "断路器跳位(0X4C)"),
|
||||
FORTY_D("4D", "电表通信中断(0X4D)"),
|
||||
FORTY_E("4E", "余额不足(0X4E)"),
|
||||
FORTY_F("4F", "充电模块故障(0X4F)"),
|
||||
FIVE("50", "急停开入(0X50)"),
|
||||
FIVE_ONE("51", "防雷器异常(0X5)"),
|
||||
FIVE_TWO("52", "BMS 未就绪(0X52)"),
|
||||
FIVE_THREE("53", "温度异常(0X53)"),
|
||||
FIVE_FOUR("54", "电池反接故障(0X54)"),
|
||||
FIVE_FIVE("55", "电子锁异常(0X55)"),
|
||||
FIVE_SIX("56", "合闸失败(0X56)"),
|
||||
FIVE_SEVEN("57", "绝缘异常(0X57)"),
|
||||
FIVE_NINE("59", "接收 BMS 握手报文 BHM 超时(0X59)"),
|
||||
FIVE_A("5A", "接收 BMS 和车辆的辨识报文超时 BRM(0X5A)"),
|
||||
FIVE_B("5B", "接收电池充电参数报文超时 BCP(0X5B)"),
|
||||
FIVE_C("5C", "接收 BMS 完成充电准备报文超时 BRO AA(0X5C)"),
|
||||
FIVE_D("5D", "接收电池充电总状态报文超时 BCS(0X5D)"),
|
||||
FIVE_E("5E", "接收电池充电要求报文超时 BCL(0X5E)"),
|
||||
FIVE_F("5F", "接收电池状态信息报文超时 BSM(0X5F)"),
|
||||
SIXTY("60", "GB2015 电池在BHM 阶段有电压不允许充电(0X60)"),
|
||||
SIXTY_ONE("61", "GB2015 辨识阶段在 BRO_AA 时候电池实际电压与 BCP 报文电池电压差距大于 5%(0X61)"),
|
||||
SIXTY_TWO("62", "B2015 充电机在预充电阶段从 BRO_AA 变成BRO_00 状态(0X62)"),
|
||||
SIXTY_THREE("63", "接收主机配置报文超时(0X63)"),
|
||||
SIXTY_FOUR("64", "充电机未准备就绪,我们没有回 CRO AA,对应老国标(0X64)"),
|
||||
SIXTY_A("6A", "系统闭锁(0X6A)"),
|
||||
SIXTY_B("6B", "导引断开(0X6B)"),
|
||||
SIXTY_C("6C", "断路器跳位(0X6C)"),
|
||||
SIXTY_D("6D", "电表通信中断(0X6D)"),
|
||||
SIXTY_E("6E", "余额不足(0X6E)"),
|
||||
SIXTY_F("6F", "交流保护动作(0X6F)"),
|
||||
SEVENTY("70", "直流保护动作(0X70)"),
|
||||
SEVENTY_ONE("71", "充电模块故障(0X71)"),
|
||||
SEVENTY_TWO("72", "急停按钮停止充电(0X72)"),
|
||||
SEVENTY_THREE("73", "防雷器异常(0X73)"),
|
||||
SEVENTY_FOUR("74", "温度异常(0X74)"),
|
||||
SEVENTY_FIVE("75", "输出异常(0X75)"),
|
||||
SEVENTY_SIX("76", "充电无流(0X76)"),
|
||||
SEVENTY_SEVEN("77", "电子锁异常(0X77)"),
|
||||
SEVENTY_EIGHY("78", "预留(0X78)"),
|
||||
SEVENTY_NINE("79", "总充电电压异常(0X79)"),
|
||||
SEVENTY_A("7A", "总充电电流异常(0X7A)"),
|
||||
SEVENTY_B("7B", "单体充电电压异常(0X7B)"),
|
||||
SEVENTY_C("7C", "电池组过温(0X7C)"),
|
||||
SEVENTY_D("7D", "最高单体充电电压异常(0X7D)"),
|
||||
SEVENTY_E("7E", "最高电池组过温(0X7E)"),
|
||||
SEVENTY_F("7F", "BMV 单体充电电压异常(0X7F)"),
|
||||
EIGHTY("80", "BMT 电池组过温(0X80)"),
|
||||
EIGHTY_ONE("81", "电池状态异常停止充电(0X81)"),
|
||||
EIGHTY_TWO("82", "车辆发报文禁止充电(0X82)"),
|
||||
EIGHTY_THREE("83", "充电桩断电(0X83)"),
|
||||
EIGHTY_FOUE("84", "接收电池充电总状态报文超时(0X84)"),
|
||||
EIGHTY_FIVE("85", "接收电池充电要求报文超时(0X85)"),
|
||||
EIGHTY_SIX("86", "接收电池状态信息报文超时(0X86)"),
|
||||
EIGHTY_SEVEN("87", "接收 BMS 中止充电报文超时(0X87)"),
|
||||
EIGHTY_EIGHY("88", "接收 BMS 充电统计报文超时(0X88)"),
|
||||
EIGHTY_NINE("89", "接收对侧 CCS 报文超时(0X89)"),
|
||||
NINETY_ONE("91", "平台结算(0X91)");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
StopReasonEnum(String code, String name){
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static String getNameByCode(String code) {
|
||||
for (StopReasonEnum typeEnum : StopReasonEnum.values()) {
|
||||
//移除交办
|
||||
if (typeEnum.code.equals(code)) {
|
||||
return typeEnum.name;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,313 @@
|
||||
package com.xhpc.order.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2022/8/5 9:17
|
||||
*/
|
||||
@Data
|
||||
public class XhpcWorkHistoryOrderDto implements Serializable {
|
||||
/**
|
||||
* 历史订单id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long historyOrderId;
|
||||
|
||||
/**
|
||||
* 电站id
|
||||
*/
|
||||
private Long chargingStationId;
|
||||
|
||||
/**
|
||||
* 充电订单id
|
||||
*/
|
||||
private Long chargeOrderId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
private Long terminalId;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 互联网订单流水号
|
||||
*/
|
||||
private String internetSerialNumber;
|
||||
|
||||
/**
|
||||
* Evcs订单号,供监管平台和第三方使用
|
||||
*/
|
||||
private String evcsOrderNo;
|
||||
|
||||
/**
|
||||
* 订单总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 电站活动抵扣
|
||||
*/
|
||||
private BigDecimal promotionDiscount;
|
||||
|
||||
/**
|
||||
* 实际价格
|
||||
*/
|
||||
private BigDecimal actPrice;
|
||||
|
||||
/**
|
||||
* 实收电费
|
||||
*/
|
||||
private BigDecimal actPowerPrice;
|
||||
|
||||
/**
|
||||
* 实收服务费
|
||||
*/
|
||||
private BigDecimal actServicePrice;
|
||||
|
||||
/**
|
||||
* 流量方总金额抽成
|
||||
*/
|
||||
private BigDecimal internetCommission;
|
||||
|
||||
/**
|
||||
* 流量方服务费抽成
|
||||
*/
|
||||
private BigDecimal internetSvcCommission;
|
||||
/**
|
||||
* 流量方电量抽成
|
||||
*/
|
||||
private BigDecimal internetDegreeCommission;
|
||||
|
||||
/**
|
||||
* 平台总金额抽成
|
||||
*/
|
||||
private BigDecimal platformCommission;
|
||||
|
||||
/**
|
||||
* 平台服务费抽成
|
||||
*/
|
||||
private BigDecimal platformSvcCommisssion;
|
||||
|
||||
/**
|
||||
* 运维总抽成
|
||||
*/
|
||||
private BigDecimal operationCommission;
|
||||
|
||||
/**
|
||||
* 运维服务费抽成
|
||||
*/
|
||||
private BigDecimal operationSvcCommission;
|
||||
|
||||
/**
|
||||
* 开始充电soc
|
||||
*/
|
||||
private String startSoc;
|
||||
|
||||
/**
|
||||
* 结束时soc
|
||||
*/
|
||||
private String endSoc;
|
||||
|
||||
/**
|
||||
* 对账状态(0待确认 1已确认,2待提交,3待审核)
|
||||
*/
|
||||
private Integer reconciliationStatus;
|
||||
|
||||
/**
|
||||
* 清分状态(0待清分 1清分在途,2已提现,3待提交,4待审核)
|
||||
*/
|
||||
private Integer sortingStatus;
|
||||
|
||||
/**
|
||||
* 1 自动结算 2 平台结算
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 总电费
|
||||
*/
|
||||
private BigDecimal powerPriceTotal;
|
||||
|
||||
/**
|
||||
* 总服务费
|
||||
*/
|
||||
private BigDecimal servicePriceTotal;
|
||||
|
||||
/**
|
||||
* 活动总电费
|
||||
*/
|
||||
private BigDecimal activityPowerPriceTotal;
|
||||
|
||||
/**
|
||||
* 活动总服务费
|
||||
*/
|
||||
private BigDecimal activityServicePriceTotal;
|
||||
|
||||
/**
|
||||
* 活动总金额
|
||||
*/
|
||||
private BigDecimal activityTotalPrice;
|
||||
|
||||
/**
|
||||
* 0未统计 1已统计
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* VIN 码
|
||||
*/
|
||||
private String vinNormal;
|
||||
|
||||
/**
|
||||
* 充电电量
|
||||
*/
|
||||
private Double totalPower;
|
||||
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 停止原因
|
||||
*/
|
||||
private String stopReasonEvcs ;
|
||||
|
||||
|
||||
private String stopReasonEvcsName ;
|
||||
|
||||
/**
|
||||
* 运营商/场站OperatorID
|
||||
*/
|
||||
private String operatorIdEvcs;
|
||||
|
||||
/**
|
||||
* 流量方OperatorID
|
||||
*/
|
||||
private String operatorId3rdptyEvcs;
|
||||
|
||||
/**
|
||||
* 终端客户开启充电方式
|
||||
* 0:未知
|
||||
* 1:市/省级平台无卡启动
|
||||
* 2:有卡启动
|
||||
* 3:其他无卡启动
|
||||
*/
|
||||
private Integer chargeModelEvcs;
|
||||
|
||||
/**
|
||||
* 实际充电的客户在运营商侧的名称,<=20字符
|
||||
*/
|
||||
private String userNameEvcs;
|
||||
|
||||
/**
|
||||
* 接口额定功率
|
||||
* 单位:kW, 小数点后 1 位
|
||||
*/
|
||||
private Double connectorPowerEvcs;
|
||||
|
||||
/**
|
||||
* 电表总起值
|
||||
* 单位:度, 小数点后2位
|
||||
*/
|
||||
private Double meterValueStartEvcs;
|
||||
|
||||
/**
|
||||
* 电表总结束值
|
||||
* 单位:度, 小数点后2位
|
||||
*/
|
||||
private Double meterValueEndEvcs;
|
||||
|
||||
/**
|
||||
* 充电用户手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
|
||||
/**
|
||||
* 推送第三方订单返回的确认结果
|
||||
*/
|
||||
private Integer confirmResult;
|
||||
|
||||
/**
|
||||
* 费率模型id
|
||||
*/
|
||||
private Long rateModelId;
|
||||
|
||||
/**
|
||||
* 充电方式
|
||||
*/
|
||||
private String chargingMode;
|
||||
|
||||
/**
|
||||
* 充电方式
|
||||
*/
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private String activityId;
|
||||
|
||||
/** 搜索值 */
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.xhpc.order.mapper;
|
||||
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import com.xhpc.order.dto.XhpcChargeHistoryOrder;
|
||||
import com.xhpc.order.dto.XhpcWorkHistoryOrderDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -22,6 +23,8 @@ public interface XhpcHistoryOrderMapper {
|
||||
*/
|
||||
public int insert(XhpcHistoryOrder xhpcHistoryOrder);
|
||||
|
||||
public int insertXhpcWorkHistoryOrderDto(XhpcWorkHistoryOrderDto xhpcWorkHistoryOrderDto);
|
||||
|
||||
int updateXhpcHistoryOrderSerialNumber(XhpcHistoryOrder xhpcHistoryOrder);
|
||||
/**
|
||||
* 更新 历史订单信息
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xhpc.order.service;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import com.xhpc.order.dto.XhpcChargeHistoryOrder;
|
||||
import com.xhpc.order.dto.XhpcWorkHistoryOrderDto;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -48,6 +49,8 @@ public interface IXhpcHistoryOrderService {
|
||||
*/
|
||||
void insert(XhpcHistoryOrder xhpcHistoryOrder);
|
||||
|
||||
void insertXhpcWorkHistoryOrderDto(XhpcWorkHistoryOrderDto xhpcWorkHistoryOrderDto);
|
||||
|
||||
|
||||
int updateXhpcHistoryOrderSerialNumber(XhpcHistoryOrder xhpcHistoryOrder);
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import com.xhpc.order.domain.XhpcChargeOrder;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import com.xhpc.order.domain.XhpcRealTimeOrder;
|
||||
import com.xhpc.order.dto.XhpcChargeHistoryOrder;
|
||||
import com.xhpc.order.dto.XhpcWorkHistoryOrderDto;
|
||||
import com.xhpc.order.mapper.XhpcHistoryOrderMapper;
|
||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||
import com.xhpc.order.service.IXhpcHistoryOrderService;
|
||||
@ -268,6 +269,11 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
xhpcHistoryOrderMapper.insert(xhpcHistoryOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertXhpcWorkHistoryOrderDto(XhpcWorkHistoryOrderDto xhpcWorkHistoryOrderDto) {
|
||||
xhpcHistoryOrderMapper.insertXhpcWorkHistoryOrderDto(xhpcWorkHistoryOrderDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXhpcHistoryOrderSerialNumber(XhpcHistoryOrder xhpcHistoryOrder) {
|
||||
return xhpcHistoryOrderMapper.updateXhpcHistoryOrderSerialNumber(xhpcHistoryOrder);
|
||||
|
||||
@ -13,15 +13,13 @@ import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.service.BaseService;
|
||||
import com.xhpc.common.data.redis.CacheOrderData;
|
||||
import com.xhpc.common.data.redis.CacheRealtimeData;
|
||||
import com.xhpc.common.enums.StopReasonEnum;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.EvcsUtil;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.order.domain.*;
|
||||
import com.xhpc.order.dto.RateTime;
|
||||
import com.xhpc.order.dto.XhpcActivityDiscountDto;
|
||||
import com.xhpc.order.dto.XhpcActivityFormulaDomainDto;
|
||||
import com.xhpc.order.dto.XhpcActivityInternetDomainDto;
|
||||
import com.xhpc.order.dto.*;
|
||||
import com.xhpc.order.mapper.XhpcRealTimeOrderMapper;
|
||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||
import com.xhpc.order.service.IXhpcHistoryOrderService;
|
||||
@ -30,6 +28,7 @@ import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -1314,7 +1313,14 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
logger.info("<<<<<<<<<<<<<<<<订单结束回调成功>>>>>>>>>订单号:>>>"+orderNo+">>>>>");
|
||||
logger.info("<<<<<<<<<<<<<<<<订单结束回调成功>>>>>>>>>订单号:>>>"+orderNo+">>>>>>>>");
|
||||
logger.info("<<<<<<<<<<<<<<<<订单结束回调成功>>>>>>>>>订单号:>>>"+orderNo+">>>>>>>>");
|
||||
|
||||
if(!"40".equals(xhpcHistoryOrder.getStopReasonEvcs())){
|
||||
XhpcWorkHistoryOrderDto xhpcWorkHistoryOrderDto =new XhpcWorkHistoryOrderDto();
|
||||
BeanUtils.copyProperties(xhpcHistoryOrder,xhpcWorkHistoryOrderDto);
|
||||
String nameByCode = StopReasonEnum.getNameByCode(xhpcHistoryOrder.getStopReasonEvcs());
|
||||
xhpcWorkHistoryOrderDto.setStopReasonEvcsName(nameByCode);
|
||||
xhpcHistoryOrderService.insertXhpcWorkHistoryOrderDto(xhpcWorkHistoryOrderDto);
|
||||
logger.info("<<<<<<<<<<<<<<<<入库成功>>>>>>>>>订单号:>>>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -404,6 +404,345 @@
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertXhpcWorkHistoryOrderDto" parameterType="com.xhpc.order.dto.XhpcWorkHistoryOrderDto" useGeneratedKeys="true"
|
||||
keyProperty="historyOrderId">
|
||||
INSERT INTO xhpc_work_history_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="chargingStationId != null">
|
||||
charging_station_id,
|
||||
</if>
|
||||
<if test="chargeOrderId != null">
|
||||
charge_order_id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="terminalId != null">
|
||||
terminal_id,
|
||||
</if>
|
||||
<if test="serialNumber != null">
|
||||
serial_number,
|
||||
</if>
|
||||
<if test="internetSerialNumber != null and ''!=internetSerialNumber">
|
||||
internet_serial_number,
|
||||
</if>
|
||||
<if test="powerPriceTotal != null">
|
||||
power_price_total,
|
||||
</if>
|
||||
<if test="servicePriceTotal != null">
|
||||
service_price_total,
|
||||
</if>
|
||||
<if test="totalPrice != null">
|
||||
total_price,
|
||||
</if>
|
||||
<if test="promotionDiscount != null">
|
||||
promotion_discount,
|
||||
</if>
|
||||
<if test="actPrice != null">
|
||||
act_price,
|
||||
</if>
|
||||
<if test="actPowerPrice != null">
|
||||
act_power_price,
|
||||
</if>
|
||||
<if test="actServicePrice != null">
|
||||
act_service_price,
|
||||
</if>
|
||||
<if test="internetCommission != null">
|
||||
internet_commission,
|
||||
</if>
|
||||
<if test="internetSvcCommission != null">
|
||||
internet_svc_commission,
|
||||
</if>
|
||||
<if test="platformCommission != null">
|
||||
platform_commission,
|
||||
</if>
|
||||
<if test="platformSvcCommisssion != null">
|
||||
platform_svc_commisssion,
|
||||
</if>
|
||||
<if test="operationCommission != null">
|
||||
operation_commission,
|
||||
</if>
|
||||
<if test="operationSvcCommission != null">
|
||||
operation_svc_commission,
|
||||
</if>
|
||||
<if test="startSoc != null">
|
||||
start_soc,
|
||||
</if>
|
||||
<if test="endSoc != null">
|
||||
end_soc,
|
||||
</if>
|
||||
<if test="reconciliationStatus != null">
|
||||
reconciliation_status,
|
||||
</if>
|
||||
<if test="sortingStatus != null">
|
||||
sorting_status,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</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="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state,
|
||||
</if>
|
||||
<if test="vinNormal != null">
|
||||
vin_normal,
|
||||
</if>
|
||||
<if test="searchValue != null">
|
||||
search_value,
|
||||
</if>
|
||||
<if test="operatorIdEvcs != null">
|
||||
operator_id_evcs,
|
||||
</if>
|
||||
<if test="chargeModelEvcs != null">
|
||||
charge_model_evcs,
|
||||
</if>
|
||||
<if test="connectorPowerEvcs != null">
|
||||
connector_power_evcs,
|
||||
</if>
|
||||
<if test="meterValueEndEvcs != null">
|
||||
meter_value_end_evcs,
|
||||
</if>
|
||||
<if test="meterValueStartEvcs != null">
|
||||
meter_value_start_evcs,
|
||||
</if>
|
||||
<if test="operatorId3rdptyEvcs != null and ''!=operatorId3rdptyEvcs">
|
||||
operator_id3rdpty_evcs,
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
start_time,
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="stopReasonEvcs != null">
|
||||
stop_reason_evcs,
|
||||
</if>
|
||||
<if test="null != rateModelId">
|
||||
rate_model_id,
|
||||
</if>
|
||||
<if test="totalPower != null">
|
||||
total_power,
|
||||
</if>
|
||||
<if test="userNameEvcs != null">
|
||||
user_name_evcs,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="chargingMode != null">
|
||||
charging_mode,
|
||||
</if>
|
||||
<if test="source != null">
|
||||
source,
|
||||
</if>
|
||||
<if test="internetDegreeCommission != null">
|
||||
internet_degree_commission,
|
||||
</if>
|
||||
<if test="activityPowerPriceTotal != null">
|
||||
activity_power_price_total,
|
||||
</if>
|
||||
<if test="activityServicePriceTotal != null">
|
||||
activity_service_price_total,
|
||||
</if>
|
||||
<if test="activityTotalPrice != null">
|
||||
activity_total_price,
|
||||
</if>
|
||||
<if test="activityId != null and activityId !=''">
|
||||
activity_id,
|
||||
</if>
|
||||
<if test="stopReasonEvcsName != null and stopReasonEvcsName !=''">
|
||||
stop_reason_evcs_name,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="chargingStationId != null">
|
||||
#{chargingStationId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="chargeOrderId != null">
|
||||
#{chargeOrderId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="terminalId != null">
|
||||
#{terminalId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="serialNumber != null">
|
||||
#{serialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="internetSerialNumber != null and ''!=internetSerialNumber">
|
||||
#{internetSerialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="powerPriceTotal != null">
|
||||
#{powerPriceTotal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="servicePriceTotal != null">
|
||||
#{servicePriceTotal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalPrice != null">
|
||||
#{totalPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="promotionDiscount != null">
|
||||
#{promotionDiscount},
|
||||
</if>
|
||||
<if test="actPrice != null">
|
||||
#{actPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="actPowerPrice != null">
|
||||
#{actPowerPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="actServicePrice != null">
|
||||
#{actServicePrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="internetCommission != null">
|
||||
#{internetCommission,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="internetSvcCommission != null">
|
||||
#{internetSvcCommission,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="platformCommission != null">
|
||||
#{platformCommission,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="platformSvcCommisssion != null">
|
||||
#{platformSvcCommisssion,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="operationCommission != null">
|
||||
#{operationCommission,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="operationSvcCommission != null">
|
||||
#{operationSvcCommission,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="startSoc != null">
|
||||
#{startSoc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="endSoc != null">
|
||||
#{endSoc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="reconciliationStatus != null">
|
||||
#{reconciliationStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sortingStatus != null">
|
||||
#{sortingStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
#{state,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="vinNormal != null">
|
||||
#{vinNormal,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="searchValue != null">
|
||||
#{searchValue,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="operatorIdEvcs != null">
|
||||
#{operatorIdEvcs,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chargeModelEvcs != null">
|
||||
#{chargeModelEvcs,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="connectorPowerEvcs != null">
|
||||
#{connectorPowerEvcs,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="meterValueEndEvcs != null">
|
||||
#{meterValueEndEvcs,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="meterValueStartEvcs != null">
|
||||
#{meterValueStartEvcs,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="operatorId3rdptyEvcs != null and ''!=operatorId3rdptyEvcs">
|
||||
#{operatorId3rdptyEvcs,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
#{startTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
#{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="stopReasonEvcs != null">
|
||||
#{stopReasonEvcs,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="null != rateModelId">
|
||||
#{rateModelId},
|
||||
</if>
|
||||
<if test="totalPower != null">
|
||||
#{totalPower,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="userNameEvcs != null">
|
||||
#{userNameEvcs,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chargingMode != null">
|
||||
#{chargingMode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
#{source},
|
||||
</if>
|
||||
<if test="internetDegreeCommission != null">
|
||||
#{internetDegreeCommission},
|
||||
</if>
|
||||
<if test="activityPowerPriceTotal != null">
|
||||
#{activityPowerPriceTotal},
|
||||
</if>
|
||||
<if test="activityServicePriceTotal != null">
|
||||
#{activityServicePriceTotal},
|
||||
</if>
|
||||
<if test="activityTotalPrice != null">
|
||||
#{activityTotalPrice},
|
||||
</if>
|
||||
<if test="activityId != null and activityId !=''">
|
||||
#{activityId},
|
||||
</if>
|
||||
<if test="stopReasonEvcsName != null and stopReasonEvcsName !=''">
|
||||
#{stopReasonEvcsName},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.xhpc.order.domain.XhpcHistoryOrder">
|
||||
UPDATE xhpc_history_order
|
||||
<set>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user