Compare commits
No commits in common. "master" and "order_reconstruction" have entirely different histories.
master
...
order_reco
@ -9,20 +9,15 @@
|
|||||||
<module name="common-mybatis" />
|
<module name="common-mybatis" />
|
||||||
<module name="authorization-server" />
|
<module name="authorization-server" />
|
||||||
<module name="resource-server" />
|
<module name="resource-server" />
|
||||||
<module name="common-permission" />
|
|
||||||
<module name="gateway-server" />
|
<module name="gateway-server" />
|
||||||
<module name="admin-server" />
|
<module name="admin-server" />
|
||||||
<module name="common-web" />
|
<module name="common-web" />
|
||||||
<module name="common-mongodb" />
|
|
||||||
<module name="wechat-server" />
|
<module name="wechat-server" />
|
||||||
<module name="cloud-manage-server" />
|
<module name="cloud-manage-server" />
|
||||||
<module name="common-redis" />
|
<module name="common-redis" />
|
||||||
<module name="common-core" />
|
<module name="common-core" />
|
||||||
</profile>
|
</profile>
|
||||||
</annotationProcessing>
|
</annotationProcessing>
|
||||||
<bytecodeTargetLevel>
|
|
||||||
<module name="common-websocket" target="17" />
|
|
||||||
</bytecodeTargetLevel>
|
|
||||||
</component>
|
</component>
|
||||||
<component name="JavacSettings">
|
<component name="JavacSettings">
|
||||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||||
@ -30,12 +25,9 @@
|
|||||||
<module name="authorization-server" options="-parameters" />
|
<module name="authorization-server" options="-parameters" />
|
||||||
<module name="cloud-manage-server" options="-parameters" />
|
<module name="cloud-manage-server" options="-parameters" />
|
||||||
<module name="common-core" options="-parameters" />
|
<module name="common-core" options="-parameters" />
|
||||||
<module name="common-mongodb" options="-parameters" />
|
|
||||||
<module name="common-mybatis" options="-parameters" />
|
<module name="common-mybatis" options="-parameters" />
|
||||||
<module name="common-permission" options="-parameters" />
|
|
||||||
<module name="common-redis" options="-parameters" />
|
<module name="common-redis" options="-parameters" />
|
||||||
<module name="common-web" options="-parameters" />
|
<module name="common-web" options="-parameters" />
|
||||||
<module name="common-websocket" options="-parameters" />
|
|
||||||
<module name="gateway-server" options="-parameters" />
|
<module name="gateway-server" options="-parameters" />
|
||||||
<module name="resource-server" options="-parameters" />
|
<module name="resource-server" options="-parameters" />
|
||||||
<module name="wechat-server" options="-parameters" />
|
<module name="wechat-server" options="-parameters" />
|
||||||
|
|||||||
@ -4,12 +4,9 @@
|
|||||||
<file url="file://$PROJECT_DIR$/admin-server/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/admin-server/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/authorization-server/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/authorization-server/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-core/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/base-commons/common-core/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-mongodb/src/main/java" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-mybatis/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/base-commons/common-mybatis/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-permission/src/main/java" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-redis/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/base-commons/common-redis/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-web/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/base-commons/common-web/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/common-websocket/src/main/java" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/base-commons/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/base-commons/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/base-commons/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/cloud-manage-server/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/cloud-manage-server/src/main/java" charset="UTF-8" />
|
||||||
|
|||||||
@ -7,11 +7,6 @@
|
|||||||
<option value="$PROJECT_DIR$/pom.xml" />
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
<option name="ignoredFiles">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$/base-commons/common-websocket/pom.xml" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="17 (2)" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="17 (2)" project-jdk-type="JavaSDK" />
|
||||||
</project>
|
</project>
|
||||||
@ -28,10 +28,7 @@
|
|||||||
<groupId>org.hibernate.validator</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.poi</groupId>
|
|
||||||
<artifactId>poi-ooxml</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@ -74,12 +71,6 @@
|
|||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>fastjson</artifactId>
|
|
||||||
<version>1.2.58</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.Dto;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Options
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:Options
|
|
||||||
* @date: 2026年02月14日 9:54
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Schema(name = "下拉菜单参数")
|
|
||||||
public class Options {
|
|
||||||
|
|
||||||
@Schema(description = "下拉菜单的label")
|
|
||||||
String label;
|
|
||||||
@Schema(description = "下拉菜单的value")
|
|
||||||
String value;
|
|
||||||
|
|
||||||
public Options() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Options(String label, String value) {
|
|
||||||
this.label = label;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -22,8 +22,4 @@ public class ResultUtil {
|
|||||||
log.error("当前请求出现异常{}", result.getMsg());
|
log.error("当前请求出现异常{}", result.getMsg());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> Boolean verifyCode(Result<T> result){
|
|
||||||
return CodeMsg.SUCCESS.getCode().equals(result.getCode());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,77 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.Dto.order;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.excel.Excel;
|
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类
|
|
||||||
*
|
|
||||||
* @ClassName:OrderListVo
|
|
||||||
* @date: 2025年05月16日 13:54
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Schema(name = "电子账单")
|
|
||||||
public class OrderBillListVo {
|
|
||||||
/***
|
|
||||||
* 结算总金额
|
|
||||||
*/
|
|
||||||
@Schema(description = "订单总额")
|
|
||||||
Double orderTotalAmount;
|
|
||||||
/***
|
|
||||||
* 站点名称
|
|
||||||
*/
|
|
||||||
@Schema(description = "站点名称")
|
|
||||||
@Excel(name="站点名称")
|
|
||||||
String stationName;
|
|
||||||
/***
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
@Schema(description = "车牌号")
|
|
||||||
@Excel(name="车牌号")
|
|
||||||
String plateNum;
|
|
||||||
/***
|
|
||||||
* 换电人
|
|
||||||
*/
|
|
||||||
@Schema(description = "换电人")
|
|
||||||
@Excel(name="换电人")
|
|
||||||
String preName;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 换电次数
|
|
||||||
*/
|
|
||||||
@Schema(description = "换电次数")
|
|
||||||
Integer orderNum;
|
|
||||||
/***
|
|
||||||
* 换电时间
|
|
||||||
*/
|
|
||||||
@Schema(description = "换电时间")
|
|
||||||
@Excel(name="换电时间", dateFormat ="yyyy-MM-dd HH:mm:ss")
|
|
||||||
Date orderTime;
|
|
||||||
/***
|
|
||||||
* 订单金额
|
|
||||||
*/
|
|
||||||
@Schema(description = "订单金额")
|
|
||||||
Integer orderAmount;
|
|
||||||
|
|
||||||
@Excel(name="订单金额", isStatistics = true)
|
|
||||||
@JsonIgnore
|
|
||||||
Double orderAmountExcel;
|
|
||||||
/***
|
|
||||||
* 订单状态
|
|
||||||
*/
|
|
||||||
@Schema(description = "订单状态")
|
|
||||||
Integer status;
|
|
||||||
@Schema(description = "换电订单详情")
|
|
||||||
List<OrderBillListVo> childList = Collections.emptyList();;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.Dto.order;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类
|
|
||||||
*
|
|
||||||
* @ClassName:OrderDetailVo
|
|
||||||
* @date: 2025年07月23日 15:12
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class OrderDetailVo {
|
|
||||||
|
|
||||||
@Schema(description = "订单编号")
|
|
||||||
private String orderNo;
|
|
||||||
|
|
||||||
@Schema(title = "订单类型", description = "1=换电;2=充电")
|
|
||||||
private Integer orderType;
|
|
||||||
|
|
||||||
@Schema(title = "车牌号")
|
|
||||||
private String plateNum;
|
|
||||||
|
|
||||||
@Schema(title = "订单状态", description = "订单状态:1-已创建,2-换电中,3-换电完成,4-充电中,5-充电完成,6-待结算,7-已完成,9-已取消, -1-退款")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(title = "订单时间")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
private Date orderTime;
|
|
||||||
|
|
||||||
@Schema(title = "换电站")
|
|
||||||
private String stationName;
|
|
||||||
|
|
||||||
@Schema(title = "预约人")
|
|
||||||
private String perName;
|
|
||||||
|
|
||||||
@Schema(title = "交易编码", description = "第三方收款返回的唯一标识")
|
|
||||||
private String notifyOrderNo;
|
|
||||||
|
|
||||||
@Schema(title = "订单总金额")
|
|
||||||
private Integer amount;
|
|
||||||
|
|
||||||
@Schema(title = "计费类型", description="1-ODO, 2-SOC, 3-电量")
|
|
||||||
private Integer feeType;
|
|
||||||
|
|
||||||
@Schema(title = "订单金额")
|
|
||||||
private Integer orderFee;
|
|
||||||
|
|
||||||
@Schema(title = "服务金额")
|
|
||||||
private Integer serviceFee;
|
|
||||||
|
|
||||||
@Schema(title = "服务开始时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date serviceTimeBegin;
|
|
||||||
|
|
||||||
@Schema(title = "服务结束时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date serviceTimeEnd;
|
|
||||||
|
|
||||||
@Schema(title = "订单开始时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date orderTimeBegin;
|
|
||||||
|
|
||||||
@Schema(title = "订单结束时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date orderTimeEnd;
|
|
||||||
|
|
||||||
@Schema(title = "耗电量", description = "耗电量; 如果是soc结算 则是soc的差值, ODO则是里程")
|
|
||||||
private Double electricityQuantity;
|
|
||||||
|
|
||||||
@Schema(title = "开始充电的电量", description = "feeType=3时, 不为空")
|
|
||||||
private Double electStart;
|
|
||||||
|
|
||||||
@Schema(title = "结束充电的电量", description = "feeType=3时, 不为空")
|
|
||||||
private Double electEnd;
|
|
||||||
|
|
||||||
@Schema(title = "租借电池包仓位", description = "feeType=2时, 不为空")
|
|
||||||
private String rentBatNo;
|
|
||||||
|
|
||||||
@Schema(title = "租借电池包编码", description = "feeType=2时, 不为空")
|
|
||||||
private String rentBatCode;
|
|
||||||
|
|
||||||
@Schema(title = "租借电池包SOC", description = "feeType=2时, 不为空")
|
|
||||||
private Double rentBatSoc;
|
|
||||||
|
|
||||||
@Schema(title = "归还电池包仓位", description = "feeType=2时, 不为空")
|
|
||||||
private String returnBatNo;
|
|
||||||
@Schema(title = "归还电池包编码", description = "feeType=2时, 不为空")
|
|
||||||
private String returnBatCode;
|
|
||||||
|
|
||||||
@Schema(title = "归还电池包SOC", description = "feeType=2时, 不为空")
|
|
||||||
private Double returnBatSoc;
|
|
||||||
|
|
||||||
@Schema(title = "换电模式", description="1-全自动; 2-半自动; 3-人工干预")
|
|
||||||
private Integer changeMode;
|
|
||||||
|
|
||||||
@Schema(title = "换电车道", description="1-换电车道A; 2-换电车道B")
|
|
||||||
private Integer changeLane;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.Dto.order;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.excel.Excel;
|
|
||||||
import com.evotech.hd.common.core.excel.handler.impl.OrderSourceExcelHandlerAdapter;
|
|
||||||
import com.evotech.hd.common.core.excel.handler.impl.OrderStatusExcelHandlerAdapter;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OrderExportVo
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:OrderExportVo
|
|
||||||
* @date: 2026年02月10日 10:13
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class OrderExportVo {
|
|
||||||
|
|
||||||
@Excel(name="序号", needMerge=true)
|
|
||||||
Integer serialNumber;
|
|
||||||
@Excel(name="订单编号", needMerge=true)
|
|
||||||
String orderNo;
|
|
||||||
@Excel(name="站点名称", needMerge=true)
|
|
||||||
String stationName;
|
|
||||||
@Excel(name="订单来源", needMerge=true, handler = OrderSourceExcelHandlerAdapter.class)
|
|
||||||
String orderSource;
|
|
||||||
@Excel(name="换电结果", needMerge=true, handler = OrderStatusExcelHandlerAdapter.class)
|
|
||||||
String orderType;
|
|
||||||
@Excel(name="车牌号", needMerge=true)
|
|
||||||
String plateNum;
|
|
||||||
@Excel(name="拆卸电池编号", needMerge=true)
|
|
||||||
String returnBatCode;
|
|
||||||
@Excel(name="拆卸电池SOC", needMerge=true)
|
|
||||||
String returnBatSoc;
|
|
||||||
@Excel(name="安装电池编号", needMerge=true)
|
|
||||||
String rentBatCode;
|
|
||||||
@Excel(name="安装电池SOC", needMerge=true)
|
|
||||||
String rentBatSoc;
|
|
||||||
@Excel(name="车辆进站时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
|
|
||||||
Date serviceTimeBegin;
|
|
||||||
@Excel(name="服务结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
|
|
||||||
Date serviceTimeEnd;
|
|
||||||
@Excel(name="服务耗时", needMerge=true)
|
|
||||||
String serviceDuration;
|
|
||||||
@Excel(name="换电开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
|
|
||||||
Date startTime;
|
|
||||||
@Excel(name="换电结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss", needMerge=true)
|
|
||||||
Date closeTime;
|
|
||||||
@Excel(name="换电耗时", needMerge=true)
|
|
||||||
String batteryDuration;
|
|
||||||
@Excel(name="流程是否完整", needMerge=true)
|
|
||||||
String processComplete;
|
|
||||||
@Excel(name="换电步骤")
|
|
||||||
List<OrderStepExportVo> stepList;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.Dto.order;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.excel.Excel;
|
|
||||||
import com.evotech.hd.common.core.excel.handler.impl.OrderStepExcelHandlerAdapter;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OrderDetailExportVo
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:OrderDetailExportVo
|
|
||||||
* @date: 2026年02月10日 14:18
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class OrderStepExportVo {
|
|
||||||
Integer step;
|
|
||||||
@Excel(name="步骤", handler = OrderStepExcelHandlerAdapter.class)
|
|
||||||
String stepName;
|
|
||||||
@Excel(name="时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
Date stepTime;
|
|
||||||
}
|
|
||||||
@ -6,14 +6,12 @@ public interface HDConstant {
|
|||||||
* 全局删除标识-已删除
|
* 全局删除标识-已删除
|
||||||
*/
|
*/
|
||||||
final static Integer DELETE_YES = 1;
|
final static Integer DELETE_YES = 1;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 全局删除标识-未删除
|
* 全局删除标识-未删除
|
||||||
*/
|
*/
|
||||||
final static Integer DELETE_NO = 0;
|
final static Integer DELETE_NO = 0;
|
||||||
|
|
||||||
final static String PUBLIC_KEY="public_key";
|
|
||||||
final static String PRIVATE_KEY="private_key";
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 大华设备相关CONSTANT
|
* 大华设备相关CONSTANT
|
||||||
*/
|
*/
|
||||||
@ -314,8 +312,4 @@ public interface HDConstant {
|
|||||||
* 预约单失效前缀
|
* 预约单失效前缀
|
||||||
*/
|
*/
|
||||||
String preOrder="pre_order:";
|
String preOrder="pre_order:";
|
||||||
/***
|
|
||||||
* 站控推送策略
|
|
||||||
*/
|
|
||||||
String STRATEGY_NAME = "站控推送";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.dao.cloud;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.evotech.hd.common.core.entity.common.AlarmTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zrb
|
|
||||||
* @since 2025-02-10
|
|
||||||
*/
|
|
||||||
public interface AlarmTemplateDao extends BaseMapper<AlarmTemplate> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -16,6 +16,4 @@ import java.util.List;
|
|||||||
public interface BatteryStationCdStrategyDao extends BaseMapper<BatteryStationCdStrategy> {
|
public interface BatteryStationCdStrategyDao extends BaseMapper<BatteryStationCdStrategy> {
|
||||||
|
|
||||||
List<BatteryStationCdStrategy> listCdStrategy(@Param("stationCode") String stationCode, @Param("status") Integer status);
|
List<BatteryStationCdStrategy> listCdStrategy(@Param("stationCode") String stationCode, @Param("status") Integer status);
|
||||||
|
|
||||||
BatteryStationCdStrategy getBatteryStationCdStrategyByName(@Param("stationCode") String stationCode, @Param("name") String name);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
package com.evotech.hd.common.core.dao.cloud;
|
package com.evotech.hd.common.core.dao.cloud;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderExportVo;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.request.PageListSwapOrderRequest;
|
|
||||||
import com.evotech.hd.common.core.entity.order.Order;
|
import com.evotech.hd.common.core.entity.order.Order;
|
||||||
import com.evotech.hd.common.core.Dto.home.*;
|
import com.evotech.hd.common.core.Dto.home.*;
|
||||||
import com.evotech.hd.common.core.Dto.request.HomeRequestDto;
|
import com.evotech.hd.common.core.Dto.request.HomeRequestDto;
|
||||||
@ -45,9 +43,4 @@ public interface OrderDao extends BaseMapper<Order> {
|
|||||||
Double homeFindOrderAmountData(@Param("date") Date date);
|
Double homeFindOrderAmountData(@Param("date") Date date);
|
||||||
|
|
||||||
List<HomeOrderInfo> findOrderListByStatus(@Param("status") Integer status);
|
List<HomeOrderInfo> findOrderListByStatus(@Param("status") Integer status);
|
||||||
|
|
||||||
List<Order> findBillList(@Param("companyCode") String companyCode, @Param("orderTimeEnd")String orderTimeEnd);
|
|
||||||
|
|
||||||
|
|
||||||
List<OrderExportVo> findExportList(PageListSwapOrderRequest plsor);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,32 +1,38 @@
|
|||||||
package com.evotech.hd.common.core.dao.cloud;
|
//package com.evotech.hd.common.core.dao.cloud;
|
||||||
|
//
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evotech.hd.common.core.constant.HDConstant;
|
//import com.evotech.hd.common.core.Dto.request.HomeRequestDto;
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
//import com.evotech.hd.common.core.Dto.result.home.*;
|
||||||
import com.evotech.hd.common.core.permission.DataScope;
|
//import com.evotech.hd.common.core.constant.HDConstant;
|
||||||
import com.evotech.hd.common.core.permission.DataScopes;
|
//import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
||||||
|
//import com.evotech.hd.common.core.permission.DataScope;
|
||||||
/**
|
//import com.evotech.hd.common.core.permission.DataScopes;
|
||||||
* @author zrb
|
//import org.apache.ibatis.annotations.Param;
|
||||||
* @since 2024-11-22
|
//
|
||||||
*/
|
//import java.util.Date;
|
||||||
@DataScopes({
|
//import java.util.List;
|
||||||
@DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE),
|
//
|
||||||
@DataScope(permissionObject = HDConstant.COMPANY_ROLE_CODE, permissionScopeName = "plate_num", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_CAR_CODE),
|
///**
|
||||||
})
|
// * @author zrb
|
||||||
//@DataScopeOpenMethod(openMethod = true, methodName = {"homeFindHalfYearAmountData"})
|
// * @since 2024-11-22
|
||||||
public interface OrderSwapBatteryDao extends BaseMapper<OrderSwapBattery> {
|
// */
|
||||||
|
//@DataScopes({
|
||||||
|
// @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE),
|
||||||
|
// @DataScope(permissionObject = HDConstant.COMPANY_ROLE_CODE, permissionScopeName = "plate_num", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_CAR_CODE),
|
||||||
|
//})
|
||||||
|
////@DataScopeOpenMethod(openMethod = true, methodName = {"homeFindHalfYearAmountData"})
|
||||||
|
//public interface OrderSwapBatteryDao extends BaseMapper<OrderSwapBattery> {
|
||||||
|
//
|
||||||
//
|
//
|
||||||
// List<HomeOrderSwapBatteryProportionDto> homeFindProportionData(@Param("params") HomeRequestDto params);
|
// List<HomeOrderSwapBatteryProportionDto> homeFindProportionData(@Param("params") HomeRequestDto params);
|
||||||
//
|
//
|
||||||
// List<HomeOrderSwapBatteryAmountDto> homeFindAmountData(@Param("params") HomeRequestDto params);
|
// List<HomeOrderSwapBatteryAmountDto> homeFindAmountData(@Param("params") HomeRequestDto params);
|
||||||
//
|
//
|
||||||
// List<HomeOrderSwapBatteryHalfYearDto> homeFindHalfYearOrderData(@Param("params") HomeRequestDto params);
|
// List<HomeOrderSwapBatteryHalfYearDto> homeFindHalfYearOrderData(@Param("params") HomeRequestDto params);
|
||||||
|
//
|
||||||
// @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, tableAlias = "osb", permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE)
|
//// @DataScope(permissionObject = HDConstant.OPERATOR_ROLE_CODE, tableAlias = "osb", permissionScopeName = "station_code", permissionScopeRedisKey = HDConstant.PermissionConstant.PERMISSION_STATION_CODE)
|
||||||
// List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearAmountData(@Param("params") HomeRequestDto params);
|
// List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearAmountData(@Param("params") HomeRequestDto params);
|
||||||
//因为站端不需要显示金额, 所有重新写一个
|
// //因为站端不需要显示金额, 所有重新写一个
|
||||||
// List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearStationAmountData(@Param("params") HomeRequestDto params);
|
// List<HomeOrderSwapBatteryHalfYearAmountDto> homeFindHalfYearStationAmountData(@Param("params") HomeRequestDto params);
|
||||||
//
|
//
|
||||||
// Long homeFindOrderCountData(@Param("date") Date date);
|
// Long homeFindOrderCountData(@Param("date") Date date);
|
||||||
@ -34,4 +40,4 @@ public interface OrderSwapBatteryDao extends BaseMapper<OrderSwapBattery> {
|
|||||||
// Double homeFindOrderAmountData(@Param("date") Date date);
|
// Double homeFindOrderAmountData(@Param("date") Date date);
|
||||||
//
|
//
|
||||||
// List<HomeOrderInfo> findOrderListByStatus(@Param("status") Integer status);
|
// List<HomeOrderInfo> findOrderListByStatus(@Param("status") Integer status);
|
||||||
}
|
//}
|
||||||
|
|||||||
@ -37,10 +37,4 @@ public class BaseEntity extends IdEntity {
|
|||||||
@TableField(fill = FieldFill.UPDATE)
|
@TableField(fill = FieldFill.UPDATE)
|
||||||
private Date uptime;
|
private Date uptime;
|
||||||
|
|
||||||
public BaseEntity() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseEntity(Integer pkId) {
|
|
||||||
super(pkId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,11 +36,4 @@ public class IdEntity implements Serializable {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
private Date ctime;
|
private Date ctime;
|
||||||
|
|
||||||
public IdEntity() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public IdEntity(Integer pkId) {
|
|
||||||
this.pkId = pkId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,11 +27,6 @@ public class BatteryStation extends BaseEntity implements Serializable {
|
|||||||
@Schema(description = "归属运营商ID", requiredMode = RequiredMode.REQUIRED)
|
@Schema(description = "归属运营商ID", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "无关联运营商信息")
|
@NotBlank(message = "无关联运营商信息")
|
||||||
private String proxyId;
|
private String proxyId;
|
||||||
@Schema(description = "运营商名称", requiredMode = RequiredMode.REQUIRED)
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String poname;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "站点名称", requiredMode = RequiredMode.REQUIRED)
|
@Schema(description = "站点名称", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "站点名称不能为空")
|
@NotBlank(message = "站点名称不能为空")
|
||||||
@ -62,10 +57,6 @@ public class BatteryStation extends BaseEntity implements Serializable {
|
|||||||
@Schema(description = "地址-区县")
|
@Schema(description = "地址-区县")
|
||||||
private String addressArea;
|
private String addressArea;
|
||||||
|
|
||||||
@Schema(description = "区划编码", requiredMode = RequiredMode.REQUIRED)
|
|
||||||
@NotBlank(message = "区划编码不能为空")
|
|
||||||
private String divisionNo;
|
|
||||||
|
|
||||||
@Schema(description = "注册日期")
|
@Schema(description = "注册日期")
|
||||||
private String registerDate;
|
private String registerDate;
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,22 @@
|
|||||||
package com.evotech.hd.common.core.entity.cloud;
|
package com.evotech.hd.common.core.entity.cloud;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.evotech.hd.common.core.entity.BaseEntity;
|
import com.evotech.hd.common.core.entity.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zrb
|
* @author zrb
|
||||||
* @since 2025-02-10
|
* @since 2025-02-10
|
||||||
@ -44,18 +50,4 @@ public class BatteryStationCdStrategyDetail extends BaseEntity implements Serial
|
|||||||
|
|
||||||
@Schema(description = "充电功率")
|
@Schema(description = "充电功率")
|
||||||
private Double chargingPower;
|
private Double chargingPower;
|
||||||
|
|
||||||
/***
|
|
||||||
* 数据状态, 1正常, 2修改, 3删除
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Integer dataType = 1;
|
|
||||||
|
|
||||||
public BatteryStationCdStrategyDetail() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public BatteryStationCdStrategyDetail(Integer pkId, Integer dataType) {
|
|
||||||
super(pkId);
|
|
||||||
this.dataType = dataType;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ public class BatteryStationDc extends BaseEntity implements Serializable {
|
|||||||
private Integer soc;
|
private Integer soc;
|
||||||
|
|
||||||
@Schema(description = "电池仓位号")
|
@Schema(description = "电池仓位号")
|
||||||
private String dccNo;
|
private Integer dccNo;
|
||||||
|
|
||||||
@Schema(description = "删除标志:1-已删除,0-未删除", hidden = true)
|
@Schema(description = "删除标志:1-已删除,0-未删除", hidden = true)
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|||||||
@ -1,162 +1,162 @@
|
|||||||
package com.evotech.hd.common.core.entity.cloud;
|
//package com.evotech.hd.common.core.entity.cloud;
|
||||||
|
//
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
//import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
//import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.evotech.hd.common.core.entity.BaseEntity;
|
//import com.evotech.hd.common.core.entity.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
//import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
//import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
//import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
//import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
//import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
//import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
//
|
||||||
import java.io.Serializable;
|
//import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
//import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
//import java.util.Date;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author zrb
|
// * @author zrb
|
||||||
* @since 2024-11-22
|
// * @since 2024-11-22
|
||||||
*/
|
// */
|
||||||
@Data
|
//@Data
|
||||||
@TableName("hd_cloud_manage.yt_t_order_swap_battery")
|
//@TableName("hd_cloud_manage.yt_t_order_swap_battery")
|
||||||
@Schema(name = "换电订单信息表")
|
//@Schema(name = "换电订单信息表")
|
||||||
public class OrderSwapBattery extends BaseEntity implements Serializable {
|
//public class OrderSwapBattery extends BaseEntity implements Serializable {
|
||||||
|
//
|
||||||
private static final long serialVersionUID = 1L;
|
// private static final long serialVersionUID = 1L;
|
||||||
|
//
|
||||||
@Schema(description = "预约订单ID")
|
// @Schema(description = "预约订单ID")
|
||||||
private Integer orderPreId;
|
// private Integer orderPreId;
|
||||||
|
//
|
||||||
@Schema(description = "预约用户")
|
// @Schema(description = "预约用户")
|
||||||
private String orderPreUid;
|
// private String orderPreUid;
|
||||||
|
//
|
||||||
@Schema(description = "预约用户名称")
|
// @Schema(description = "预约用户名称")
|
||||||
private String orderPreUname;
|
// private String orderPreUname;
|
||||||
|
//
|
||||||
@Schema(description = "预约用户手机")
|
// @Schema(description = "预约用户手机")
|
||||||
private String orderPrePhone;
|
// private String orderPrePhone;
|
||||||
|
//
|
||||||
@Schema(description = "类型:1-换电,2-充电", requiredMode = RequiredMode.REQUIRED)
|
// @Schema(description = "类型:1-换电,2-充电", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotNull(message = "订单类型不能为空")
|
// @NotNull(message = "订单类型不能为空")
|
||||||
private Integer orderType;
|
// private Integer orderType;
|
||||||
|
//
|
||||||
@Schema(description = "订单编码", hidden = true)
|
// @Schema(description = "订单编码", hidden = true)
|
||||||
private String orderNo;
|
// private String orderNo;
|
||||||
|
//
|
||||||
@Schema(description = "车牌号", requiredMode = RequiredMode.REQUIRED)
|
// @Schema(description = "车牌号", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "车牌号不能为空")
|
// @NotBlank(message = "车牌号不能为空")
|
||||||
private String plateNum;
|
// private String plateNum;
|
||||||
|
//
|
||||||
@Schema(description = "订单时间", example = "yyyy-MM-dd HH:mm:ss")
|
// @Schema(description = "订单时间", example = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date orderTime;
|
// private Date orderTime;
|
||||||
|
//
|
||||||
@Schema(description = "换电站编码", requiredMode = RequiredMode.REQUIRED)
|
// @Schema(description = "换电站编码", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "换电站编码不能为空")
|
// @NotBlank(message = "换电站编码不能为空")
|
||||||
private String stationCode;
|
// private String stationCode;
|
||||||
|
//
|
||||||
@Schema(description = "换电站名称", requiredMode = RequiredMode.REQUIRED)
|
// @Schema(description = "换电站名称", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotBlank(message = "换电站名称不能为空")
|
// @NotBlank(message = "换电站名称不能为空")
|
||||||
private String stationName;
|
// private String stationName;
|
||||||
|
//
|
||||||
@Schema(description = "金额账号")
|
// @Schema(description = "金额账号")
|
||||||
private String accountCode;
|
// private String accountCode;
|
||||||
|
//
|
||||||
@Schema(description = "订单金额")
|
// @Schema(description = "订单金额")
|
||||||
private Integer amount;
|
// private Integer amount;
|
||||||
|
//
|
||||||
@Schema(description = "订单状态:1-已创建,2-换电中,3-换电完成,4-充电中,5-充电完成,6-待结算,7-已完成,9-已取消, -1-退款")
|
// @Schema(description = "订单状态:1-已创建,2-换电中,3-换电完成,4-充电中,5-充电完成,6-待结算,7-已完成,9-已取消, -1-退款")
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
|
//
|
||||||
@Schema(description = "计算费用方式:1-ODO,2-SOC,3-按电量")
|
// @Schema(description = "计算费用方式:1-ODO,2-SOC,3-按电量")
|
||||||
private Integer feeType;
|
// private Integer feeType;
|
||||||
|
//
|
||||||
@Schema(description = "基础费用")
|
// @Schema(description = "基础费用")
|
||||||
private BigDecimal basicFee;
|
// private BigDecimal basicFee;
|
||||||
|
//
|
||||||
@Schema(description = "服务开始时间")
|
// @Schema(description = "服务开始时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date serviceTimeBegin;
|
// private Date serviceTimeBegin;
|
||||||
|
//
|
||||||
@Schema(description = "服务结束时间")
|
// @Schema(description = "服务结束时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date serviceTimeEnd;
|
// private Date serviceTimeEnd;
|
||||||
|
//
|
||||||
@Schema(description = "服务费")
|
// @Schema(description = "服务费")
|
||||||
private BigDecimal serviceFee;
|
// private BigDecimal serviceFee;
|
||||||
|
//
|
||||||
@Schema(description = "费用标准")
|
// @Schema(description = "费用标准")
|
||||||
private String feeStandardJson;
|
// private String feeStandardJson;
|
||||||
@Schema(description = "费用标准详情")
|
// @Schema(description = "费用标准详情")
|
||||||
@TableField(exist = false)
|
// @TableField(exist = false)
|
||||||
private BatteryStationHdFeeStandard feeStandardDetail;
|
// private BatteryStationHdFeeStandard feeStandardDetail;
|
||||||
|
//
|
||||||
@Schema(description = "上次租赁电池时车辆里程")
|
// @Schema(description = "上次租赁电池时车辆里程")
|
||||||
private BigDecimal lastRentBatCarOdo;
|
// private BigDecimal lastRentBatCarOdo;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池时车辆里程")
|
// @Schema(description = "归还电池时车辆里程")
|
||||||
private BigDecimal nowReturnBatCarOdo;
|
// private BigDecimal nowReturnBatCarOdo;
|
||||||
|
//
|
||||||
@Schema(description = "按ODO换电费")
|
// @Schema(description = "按ODO换电费")
|
||||||
private BigDecimal odoAmount;
|
// private BigDecimal odoAmount;
|
||||||
|
//
|
||||||
@Schema(description = "充电开始时间")
|
// @Schema(description = "充电开始时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date chargeTimeBegin;
|
// private Date chargeTimeBegin;
|
||||||
|
//
|
||||||
@Schema(description = "充电结束时间")
|
// @Schema(description = "充电结束时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date chargeTimeEnd;
|
// private Date chargeTimeEnd;
|
||||||
|
//
|
||||||
@Schema(description = "总充电量")
|
// @Schema(description = "总充电量")
|
||||||
private BigDecimal electAmount;
|
// private BigDecimal electAmount;
|
||||||
|
//
|
||||||
@Schema(description = "租借电池包仓位")
|
// @Schema(description = "租借电池包仓位")
|
||||||
private Integer rentBatNo;
|
// private Integer rentBatNo;
|
||||||
|
//
|
||||||
@Schema(description = "租用电池包编码")
|
// @Schema(description = "租用电池包编码")
|
||||||
private String rentBatCode;
|
// private String rentBatCode;
|
||||||
|
//
|
||||||
@Schema(description = "租用电池包SOC")
|
// @Schema(description = "租用电池包SOC")
|
||||||
private Integer rentBatSoc;
|
// private Integer rentBatSoc;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池包编码")
|
// @Schema(description = "归还电池包编码")
|
||||||
private String returnBatCode;
|
// private String returnBatCode;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池包仓位")
|
// @Schema(description = "归还电池包仓位")
|
||||||
private Integer returnBatNo;
|
// private Integer returnBatNo;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池包SOC")
|
// @Schema(description = "归还电池包SOC")
|
||||||
private Integer returnBatSoc;
|
// private Integer returnBatSoc;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池租出时soc")
|
// @Schema(description = "归还电池租出时soc")
|
||||||
private Integer returnBatRentSoc;
|
// private Integer returnBatRentSoc;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池租出的换电站编码")
|
// @Schema(description = "归还电池租出的换电站编码")
|
||||||
private String returnBatRentStationCode;
|
// private String returnBatRentStationCode;
|
||||||
|
//
|
||||||
@Schema(description = "归还电池租出的换电站")
|
// @Schema(description = "归还电池租出的换电站")
|
||||||
private String returnBatRentStationName;
|
// private String returnBatRentStationName;
|
||||||
|
//
|
||||||
@Schema(description = "换电模式:1-全自动,2-半自动,3-人工干预 ")
|
// @Schema(description = "换电模式:1-全自动,2-半自动,3-人工干预 ")
|
||||||
private Integer changeMode;
|
// private Integer changeMode;
|
||||||
|
//
|
||||||
@Schema(description = "换电车道 1-A 车道;2-B 车道")
|
// @Schema(description = "换电车道 1-A 车道;2-B 车道")
|
||||||
private Integer changeLane;
|
// private Integer changeLane;
|
||||||
|
//
|
||||||
@Schema(description = "删除状态:1-已删除,0-未删除", hidden = true)
|
// @Schema(description = "删除状态:1-已删除,0-未删除", hidden = true)
|
||||||
private Integer delFlag;
|
// private Integer delFlag;
|
||||||
|
//
|
||||||
@Schema(description = "交易编码", hidden = true)
|
// @Schema(description = "交易编码", hidden = true)
|
||||||
private String tradeNo;
|
// private String tradeNo;
|
||||||
|
//
|
||||||
@Schema(description = "备注信息")
|
// @Schema(description = "备注信息")
|
||||||
private String remark;
|
// private String remark;
|
||||||
}
|
//}
|
||||||
|
|||||||
@ -1,15 +1,19 @@
|
|||||||
package com.evotech.hd.common.core.entity.cloud;
|
package com.evotech.hd.common.core.entity.cloud;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.evotech.hd.common.core.entity.BaseEntity;
|
import com.evotech.hd.common.core.entity.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zrb
|
* @author zrb
|
||||||
* @since 2024-12-11
|
* @since 2024-12-11
|
||||||
@ -31,7 +35,6 @@ public class OrderSwapBatteryStep extends BaseEntity implements Serializable {
|
|||||||
private String stepName;
|
private String stepName;
|
||||||
|
|
||||||
@Schema(description = "步骤时间")
|
@Schema(description = "步骤时间")
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date stepTime;
|
private Date stepTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,9 +24,6 @@ public class TradeDetail extends BaseEntity implements Serializable {
|
|||||||
@Schema(description = "换电站编码")
|
@Schema(description = "换电站编码")
|
||||||
private String stationCode;
|
private String stationCode;
|
||||||
|
|
||||||
@Schema(description = "交易人微信Id")
|
|
||||||
private String plateCompanyCode;
|
|
||||||
|
|
||||||
@Schema(description = "交易人name")
|
@Schema(description = "交易人name")
|
||||||
private String trader;
|
private String trader;
|
||||||
|
|
||||||
@ -39,7 +36,7 @@ public class TradeDetail extends BaseEntity implements Serializable {
|
|||||||
@Schema(description = "交易类型:1-充值,2-订单消费,3-退款, 9-提现")
|
@Schema(description = "交易类型:1-充值,2-订单消费,3-退款, 9-提现")
|
||||||
private Integer tradeType;
|
private Integer tradeType;
|
||||||
|
|
||||||
@Schema(description = "支付方式:1-账户余额,2-微信,3-支付宝,4-网银,5 -充电补偿, 6-公对公转账")
|
@Schema(description = "支付方式:1-账户余额,2-微信,3-支付宝,4-网银,5 -充电补偿")
|
||||||
private Integer payType;
|
private Integer payType;
|
||||||
@Schema(description = "微信支付API类型")
|
@Schema(description = "微信支付API类型")
|
||||||
private String wechatPayApiType;
|
private String wechatPayApiType;
|
||||||
@ -71,7 +68,7 @@ public class TradeDetail extends BaseEntity implements Serializable {
|
|||||||
@Schema(description = "微信支付订单号")
|
@Schema(description = "微信支付订单号")
|
||||||
private String transactionId;
|
private String transactionId;
|
||||||
|
|
||||||
@Schema(description = "支付结果,暂用微信结果的枚举类型, 新增 paymentInProgress 结算中类型")
|
@Schema(description = "支付结果,暂用微信结果的枚举类型")
|
||||||
private String payResult;
|
private String payResult;
|
||||||
|
|
||||||
@Schema(description = "付款人编码,对于个人账户,交易发起人和付款人一般是同一人。公司账户交易发起人是公司,付款人可能是 微信账户")
|
@Schema(description = "付款人编码,对于个人账户,交易发起人和付款人一般是同一人。公司账户交易发起人是公司,付款人可能是 微信账户")
|
||||||
@ -97,8 +94,8 @@ public class TradeDetail extends BaseEntity implements Serializable {
|
|||||||
@Schema(description = "订单总描述")
|
@Schema(description = "订单总描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Schema(description = "状态: edit-编辑中, submit-提交. finish-完成, reject-打回")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
|
|
||||||
// @Schema(description = "在微信等支付网关创建支付订单时失败,返回的失败原因")
|
// @Schema(description = "在微信等支付网关创建支付订单时失败,返回的失败原因")
|
||||||
|
|||||||
@ -1,13 +1,15 @@
|
|||||||
package com.evotech.hd.common.core.entity.cloud.request;
|
package com.evotech.hd.common.core.entity.cloud.request;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import com.evotech.hd.common.core.entity.BasePageRequest;
|
import com.evotech.hd.common.core.entity.BasePageRequest;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -53,9 +55,6 @@ public class PageListSwapOrderRequest extends BasePageRequest {
|
|||||||
@Schema(description = "公司编码")
|
@Schema(description = "公司编码")
|
||||||
private String ccode;
|
private String ccode;
|
||||||
|
|
||||||
@Schema(description = "运营商code")
|
|
||||||
private String proCode;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,4 @@ public class PageListWalletRequest extends BasePageRequest {
|
|||||||
@Schema(description = "引入站点")
|
@Schema(description = "引入站点")
|
||||||
private String stationCode;
|
private String stationCode;
|
||||||
|
|
||||||
@Schema(description = "客户电话")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.entity.common;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.evotech.hd.common.core.entity.BaseEntity;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AlarmTemplate
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:AlarmTemplate
|
|
||||||
* @date: 2025年10月28日 15:01
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
|
||||||
@TableName(value = "sys_alarm_template", schema = "hd_cloud_manage")
|
|
||||||
@Schema(name = "AlarmTemplate", description = "异常通知")
|
|
||||||
public class AlarmTemplate extends BaseEntity implements Serializable {
|
|
||||||
|
|
||||||
@Schema(description = "路径", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
String path;
|
|
||||||
@Schema(description = "通知人员", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
String recipientIds;
|
|
||||||
|
|
||||||
//通知人员姓名
|
|
||||||
@TableField(exist = false)
|
|
||||||
String recipientNames;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
String area;
|
|
||||||
@TableField(exist = false)
|
|
||||||
String message;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -56,8 +56,4 @@ public class BaseOrder extends IdEntity {
|
|||||||
* 支付的回调信息
|
* 支付的回调信息
|
||||||
*/
|
*/
|
||||||
private String notifyInfo;
|
private String notifyInfo;
|
||||||
/***
|
|
||||||
* 交易编码
|
|
||||||
*/
|
|
||||||
private String tradeNo;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.evotech.hd.common.core.entity.order;
|
package com.evotech.hd.common.core.entity.order;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -75,6 +74,4 @@ public class Order extends BaseOrder{
|
|||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
@TableField(exist = false)
|
|
||||||
private OrderDetail orderDetail;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,8 +16,6 @@ public enum OrderStatusEnums implements BaseEnum<Integer, String> {
|
|||||||
|
|
||||||
FINISH(7, "已完成"),
|
FINISH(7, "已完成"),
|
||||||
|
|
||||||
SETTLEMENT_IN_PROGRESS(8, "结算中"),
|
|
||||||
|
|
||||||
CANCLE(9, "已取消"),
|
CANCLE(9, "已取消"),
|
||||||
|
|
||||||
REFUND(-1, "订单退款"),
|
REFUND(-1, "订单退款"),
|
||||||
@ -32,8 +30,6 @@ public enum OrderStatusEnums implements BaseEnum<Integer, String> {
|
|||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Integer getCode() {
|
public Integer getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,9 +9,6 @@ public enum PayTypeEnums {
|
|||||||
ALIPAY(3, "支付宝"),
|
ALIPAY(3, "支付宝"),
|
||||||
|
|
||||||
BANK(4, "网银"),
|
BANK(4, "网银"),
|
||||||
CHARGING_COMPENSATION(5, "充电补偿"),
|
|
||||||
|
|
||||||
BUSINESS_TO_BUSINESS(6, "公对公"),
|
|
||||||
|
|
||||||
OTHER(9, "其他");
|
OTHER(9, "其他");
|
||||||
|
|
||||||
|
|||||||
@ -16,17 +16,17 @@ public enum SwapBatteryStepEnum implements BaseEnum<Integer, String>{
|
|||||||
|
|
||||||
VEHICLE_POSITION(2, "车辆到达指定位置"),
|
VEHICLE_POSITION(2, "车辆到达指定位置"),
|
||||||
|
|
||||||
INSTITUTIONS_FOR_CHINA(3, "启动对中机构"),
|
INSTITUTIONS_FOR_CHINA(3, "对中机构"),
|
||||||
|
|
||||||
GET_NEW_ELECTRICITY(4, "取新电池"),
|
GET_NEW_ELECTRICITY(4, "取新电"),
|
||||||
|
|
||||||
DISMANTLE_OLD_ELECTRICITY(5, "拆旧电池"),
|
DISMANTLE_OLD_ELECTRICITY(5, "拆旧电"),
|
||||||
|
|
||||||
INSTALL_NEW_ELECTRICITY(6, "装新电池"),
|
INSTALL_NEW_ELECTRICITY(6, "装新电"),
|
||||||
|
|
||||||
DISCHARGE_OLD_ELECTRICITY(7, "放旧电池"),
|
DISCHARGE_OLD_ELECTRICITY(7, "放旧电"),
|
||||||
|
|
||||||
COMPLETED(8, "换电完成"),
|
COMPLETED(8, "完成"),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|||||||
@ -1,203 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.excel.handler.ExcelFieldHandlerAdapter;
|
|
||||||
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
|
|
||||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
||||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义导出Excel数据注解
|
|
||||||
*
|
|
||||||
* @author evo
|
|
||||||
*/
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(ElementType.FIELD)
|
|
||||||
public @interface Excel
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 导出时在excel中排序
|
|
||||||
*/
|
|
||||||
public int sort() default Integer.MAX_VALUE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出到Excel中的名字.
|
|
||||||
*/
|
|
||||||
public String name() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期格式, 如: yyyy-MM-dd
|
|
||||||
*/
|
|
||||||
public String dateFormat() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
|
||||||
*/
|
|
||||||
public String dictType() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
|
||||||
*/
|
|
||||||
public String readConverterExp() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分隔符,读取字符串组内容
|
|
||||||
*/
|
|
||||||
public String separator() default ",";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
|
||||||
*/
|
|
||||||
public int scale() default -1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
|
||||||
*/
|
|
||||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出时在excel中每个列的高度
|
|
||||||
*/
|
|
||||||
public double height() default 14;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出时在excel中每个列的宽度
|
|
||||||
*/
|
|
||||||
public double width() default 16;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文字后缀,如% 90 变成90%
|
|
||||||
*/
|
|
||||||
public String suffix() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当值为空时,字段的默认值
|
|
||||||
*/
|
|
||||||
public String defaultValue() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提示信息
|
|
||||||
*/
|
|
||||||
public String prompt() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置只能选择不能输入的列内容.
|
|
||||||
*/
|
|
||||||
public String[] combo() default {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解.
|
|
||||||
*/
|
|
||||||
public boolean comboReadDict() default false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
|
||||||
*/
|
|
||||||
public boolean needMerge() default false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
|
||||||
*/
|
|
||||||
public boolean isExport() default true;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
|
||||||
*/
|
|
||||||
public String targetAttr() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否自动统计数据,在最后追加一行统计数据总和
|
|
||||||
*/
|
|
||||||
public boolean isStatistics() default false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出类型(0数字 1字符串 2图片)
|
|
||||||
*/
|
|
||||||
public ColumnType cellType() default ColumnType.STRING;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出列头背景颜色
|
|
||||||
*/
|
|
||||||
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出列头字体颜色
|
|
||||||
*/
|
|
||||||
public IndexedColors headerColor() default IndexedColors.WHITE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出单元格背景颜色
|
|
||||||
*/
|
|
||||||
public IndexedColors backgroundColor() default IndexedColors.WHITE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出单元格字体颜色
|
|
||||||
*/
|
|
||||||
public IndexedColors color() default IndexedColors.BLACK;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出字段对齐方式
|
|
||||||
*/
|
|
||||||
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义数据处理器
|
|
||||||
*/
|
|
||||||
public Class<?> handler() default ExcelHandlerAdapter.class;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义数据处理器
|
|
||||||
*/
|
|
||||||
public boolean customExcelField() default false;
|
|
||||||
/**
|
|
||||||
* 自定义数据处理器
|
|
||||||
*/
|
|
||||||
public Class<?> excelFieldHandler() default ExcelFieldHandlerAdapter.class;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义数据处理器参数
|
|
||||||
*/
|
|
||||||
public String[] args() default {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
|
||||||
*/
|
|
||||||
Type type() default Type.ALL;
|
|
||||||
|
|
||||||
public enum Type
|
|
||||||
{
|
|
||||||
ALL(0), EXPORT(1), IMPORT(2);
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
Type(int value)
|
|
||||||
{
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int value()
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ColumnType
|
|
||||||
{
|
|
||||||
NUMERIC(0), STRING(1), IMAGE(2), TEXT(3);
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
ColumnType(int value)
|
|
||||||
{
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int value()
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Excel注解集
|
|
||||||
*
|
|
||||||
* @author evo
|
|
||||||
*/
|
|
||||||
@Target(ElementType.FIELD)
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface Excels
|
|
||||||
{
|
|
||||||
public Excel[] value();
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel.handler;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊出具处理接口
|
|
||||||
*
|
|
||||||
* @ClassName:ExcelFieldHandlerAdapter
|
|
||||||
* @date: 2025年07月12日 10:40
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
public interface ExcelFieldHandlerAdapter {
|
|
||||||
|
|
||||||
List<String> buildExcel();
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel.handler;
|
|
||||||
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Excel数据格式处理适配器
|
|
||||||
*
|
|
||||||
* @author evo
|
|
||||||
*/
|
|
||||||
public interface ExcelHandlerAdapter
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 格式化
|
|
||||||
*
|
|
||||||
* @param value 单元格数据值
|
|
||||||
* @param args excel注解args参数组
|
|
||||||
* @param cell 单元格对象
|
|
||||||
* @param wb 工作簿对象
|
|
||||||
*
|
|
||||||
* @return 处理后的值
|
|
||||||
*/
|
|
||||||
Object format(Object value, String[] args, Cell cell, Workbook wb);
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel.handler.impl;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OrderStatusExcelHandlerAdapter
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:OrderStatusExcelHandlerAdapter
|
|
||||||
* @date: 2026年02月11日 14:23
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class OrderSourceExcelHandlerAdapter implements ExcelHandlerAdapter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
|
|
||||||
if(ObjectUtils.isNotEmpty(value)){
|
|
||||||
switch (String.valueOf(value)){
|
|
||||||
case "1":
|
|
||||||
return "小程序";
|
|
||||||
case "2":
|
|
||||||
return "云端";
|
|
||||||
case "3":
|
|
||||||
return "站端";
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel.handler.impl;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.enums.OrderStatusEnums;
|
|
||||||
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OrderStatusExcelHandlerAdapter
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:OrderStatusExcelHandlerAdapter
|
|
||||||
* @date: 2026年02月11日 14:23
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class OrderStatusExcelHandlerAdapter implements ExcelHandlerAdapter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
|
|
||||||
if(ObjectUtils.isNotEmpty(value)){
|
|
||||||
Integer val = Integer.valueOf(String.valueOf(value));
|
|
||||||
for (OrderStatusEnums orderStatus : OrderStatusEnums.values()){
|
|
||||||
if(orderStatus.getCode().equals(val)){
|
|
||||||
return orderStatus.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.excel.handler.impl;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.enums.SwapBatteryStepEnum;
|
|
||||||
import com.evotech.hd.common.core.excel.handler.ExcelHandlerAdapter;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OrderStatusExcelHandlerAdapter
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:OrderStatusExcelHandlerAdapter
|
|
||||||
* @date: 2026年02月11日 14:23
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class OrderStepExcelHandlerAdapter implements ExcelHandlerAdapter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object format(Object value, String[] args, Cell cell, Workbook wb) {
|
|
||||||
|
|
||||||
if(ObjectUtils.isNotEmpty(value)){
|
|
||||||
Integer val = Integer.valueOf(String.valueOf(value));
|
|
||||||
for (SwapBatteryStepEnum stepEnum : SwapBatteryStepEnum.values()){
|
|
||||||
if(stepEnum.getCode().equals(val)){
|
|
||||||
return stepEnum.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
package com.evotech.hd.common.core.utils;
|
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类
|
|
||||||
*
|
|
||||||
* @ClassName:DataUtils
|
|
||||||
* @date: 2025年06月03日 10:25
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class DataUtils {
|
|
||||||
|
|
||||||
public static final BigDecimal DEFAULT_VALUE = new BigDecimal(0);
|
|
||||||
|
|
||||||
|
|
||||||
public static <T> T findDefaultValue(T v, T dv){
|
|
||||||
if(ObjectUtils.isNotEmpty(v)){
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
return dv;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <K, V> V getValOrDefault(Map<K, V> map, K key, V dv) {
|
|
||||||
if(!map.containsKey(key) || ObjectUtils.isEmpty(map.get(key))){
|
|
||||||
return dv;
|
|
||||||
}
|
|
||||||
return map.get(key); // 键不存在时,Java默认返回null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -21,10 +21,5 @@
|
|||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>io.swagger.core.v3</groupId>
|
|
||||||
<artifactId>swagger-models</artifactId>
|
|
||||||
<version>2.2.19</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
@ -35,10 +35,9 @@ public class MongoConstant {
|
|||||||
*/
|
*/
|
||||||
public static final String EQ = "and";
|
public static final String EQ = "and";
|
||||||
public static final String IN = "in";
|
public static final String IN = "in";
|
||||||
public static final String NOT_IN = "not-in";
|
public static final String NOT_IN = "not_in";
|
||||||
public static final String GT = "gt";
|
public static final String GT = "gt";
|
||||||
public static final String GE = "ge";
|
public static final String GE = "ge";
|
||||||
public static final String GT_GE = "ge-ge";
|
|
||||||
public static final String LT = "lt";
|
public static final String LT = "lt";
|
||||||
public static final String LE = "le";
|
public static final String LE = "le";
|
||||||
public static final String REGEX = "regex";
|
public static final String REGEX = "regex";
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
package com.evotech.hd.common.dtos;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电池实时信息
|
|
||||||
* @ClassName:BatData
|
|
||||||
* @date: 2025年04月30日 9:13
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class BatDataDto {
|
|
||||||
//电池编号
|
|
||||||
String batCode;
|
|
||||||
//开始时间
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
Date beginTime;
|
|
||||||
//结束时间
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
Date endTime;
|
|
||||||
}
|
|
||||||
@ -192,11 +192,6 @@ public class MongoDBService {
|
|||||||
case MongoConstant.GE:
|
case MongoConstant.GE:
|
||||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).gte(params.get(key)));
|
query.addCriteria(Criteria.where(keyAndQueryType[1]).gte(params.get(key)));
|
||||||
break;
|
break;
|
||||||
case MongoConstant.GT_GE:
|
|
||||||
String begin = String.valueOf(params.get(key)).split(MongoConstant.SEPARATION)[0];
|
|
||||||
String end = String.valueOf(params.get(key)).split(MongoConstant.SEPARATION)[1];
|
|
||||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).gte(begin).lte(end));
|
|
||||||
break;
|
|
||||||
case MongoConstant.LT:
|
case MongoConstant.LT:
|
||||||
query.addCriteria(Criteria.where(keyAndQueryType[1]).lt(params.get(key)));
|
query.addCriteria(Criteria.where(keyAndQueryType[1]).lt(params.get(key)));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -26,8 +26,12 @@ public class InsertAndUpdateMybatisHandler implements MetaObjectHandler {
|
|||||||
public void insertFill(MetaObject metaObject) {
|
public void insertFill(MetaObject metaObject) {
|
||||||
try {
|
try {
|
||||||
AuthUser user = RedisPermissionUtils.getUser();
|
AuthUser user = RedisPermissionUtils.getUser();
|
||||||
if(BeanUtil.isNotEmpty(metaObject) && BeanUtil.isNotEmpty(user)){
|
if(BeanUtil.isEmpty(user)){
|
||||||
mySetFieldValByName("creater",(BeanUtil.isEmpty(user) ? "system" : user.getUid()),metaObject);
|
log.info("当前操作位登录, 无需执行");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(BeanUtil.isNotEmpty(metaObject)){
|
||||||
|
mySetFieldValByName("creater",user.getUid(),metaObject);
|
||||||
mySetFieldValByName("ctime",new Date(),metaObject);
|
mySetFieldValByName("ctime",new Date(),metaObject);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -48,8 +52,12 @@ public class InsertAndUpdateMybatisHandler implements MetaObjectHandler {
|
|||||||
public void updateFill(MetaObject metaObject) {
|
public void updateFill(MetaObject metaObject) {
|
||||||
try {
|
try {
|
||||||
AuthUser user = RedisPermissionUtils.getUser();
|
AuthUser user = RedisPermissionUtils.getUser();
|
||||||
if(BeanUtil.isNotEmpty(metaObject) && BeanUtil.isNotEmpty(user)){
|
if(BeanUtil.isEmpty(user)){
|
||||||
mySetFieldValByName("updater",(BeanUtil.isEmpty(user) ? "system" : user.getUid()),metaObject);
|
log.info("当前操作未登录, 无需执行");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(BeanUtil.isNotEmpty(metaObject)){
|
||||||
|
mySetFieldValByName("updater",user.getUid(),metaObject);
|
||||||
mySetFieldValByName("uptime",new Date(),metaObject);
|
mySetFieldValByName("uptime",new Date(),metaObject);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -3,15 +3,13 @@ package com.evotech.hd.cloud;
|
|||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
|
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
|
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
|
||||||
@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
@ComponentScan("com.evotech.hd.**")
|
@ComponentScan("com.evotech.hd.**")
|
||||||
@MapperScan({"com.evotech.hd.cloud.dao.**", "com.evotech.hd.common.core.dao.**"})
|
@MapperScan({"com.evotech.hd.cloud.dao.**", "com.evotech.hd.common.core.dao.**"})
|
||||||
|
|||||||
@ -1,18 +1,11 @@
|
|||||||
package com.evotech.hd.cloud.controller;
|
package com.evotech.hd.cloud.controller;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.evotech.hd.cloud.entity.request.PageListBatteryStationDcRequest;
|
import com.evotech.hd.cloud.entity.request.PageListBatteryStationDcRequest;
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.older.BatData;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.older.state.HdChargingData;
|
|
||||||
import com.evotech.hd.cloud.service.BatteryStationDcService;
|
import com.evotech.hd.cloud.service.BatteryStationDcService;
|
||||||
import com.evotech.hd.common.constant.MongoConstant;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
import com.evotech.hd.common.core.Dto.Result;
|
||||||
import com.evotech.hd.common.core.entity.cloud.BatteryStationDc;
|
import com.evotech.hd.common.core.entity.cloud.BatteryStationDc;
|
||||||
import com.evotech.hd.common.core.entity.cloud.BatteryTrace;
|
import com.evotech.hd.common.core.entity.cloud.BatteryTrace;
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import com.evotech.hd.common.dtos.BatDataDto;
|
|
||||||
import com.evotech.hd.common.service.MongoDBService;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@ -20,12 +13,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springdoc.core.annotations.ParameterObject;
|
import org.springdoc.core.annotations.ParameterObject;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Tag(name = "换电站电池")
|
@Tag(name = "换电站电池")
|
||||||
@ApiSupport(order = 12)
|
@ApiSupport(order = 12)
|
||||||
@ -36,9 +30,6 @@ public class BatteryStationDcController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BatteryStationDcService batteryStationDcService;
|
private BatteryStationDcService batteryStationDcService;
|
||||||
@Resource
|
|
||||||
MongoDBService mongoDBService;
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "增加")
|
@Operation(summary = "增加")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ -92,45 +83,4 @@ public class BatteryStationDcController {
|
|||||||
return batteryStationDcService.deleteTrace(id);
|
return batteryStationDcService.deleteTrace(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "电池动态图")
|
|
||||||
@PostMapping("/dynamic/detail")
|
|
||||||
@ApiOperationSupport(order = 8)
|
|
||||||
public Result<Map<String,List>> dynamicDetail(@RequestBody BatDataDto batDataDto) {
|
|
||||||
List<com.evotech.hd.common.documnet.BatData> batDataList = mongoDBService.find(MongoConstant.BATTERY_BOX_DATA_BASE, batDataDto.getBatCode(),
|
|
||||||
com.evotech.hd.common.documnet.BatData.class,
|
|
||||||
Collections.asMap(
|
|
||||||
MongoConstant.GT_GE+ MongoConstant.SEPARATION+"id",String.valueOf(batDataDto.getBeginTime().getTime())+MongoConstant.SEPARATION+String.valueOf(batDataDto.getEndTime().getTime()),
|
|
||||||
MongoConstant.SORT+ MongoConstant.SEPARATION+MongoConstant.SORT_DESC, "id"
|
|
||||||
));
|
|
||||||
List<BatData> resultBatDataList = Collections.emptyList();
|
|
||||||
if(Collections.isNotEmpty(batDataList)){
|
|
||||||
batDataList.stream().forEach(data->{
|
|
||||||
if(StringUtils.isNotEmpty(data.getValue())){
|
|
||||||
BatData batData = JSONUtil.toBean(data.getValue(), BatData.class);
|
|
||||||
batData.setId(data.getId());
|
|
||||||
resultBatDataList.add(batData);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
List<com.evotech.hd.common.documnet.ChargingData> chargingDataList = mongoDBService.find(MongoConstant.BATTERY_DATA_BASE, batDataDto.getBatCode(),
|
|
||||||
com.evotech.hd.common.documnet.ChargingData.class,
|
|
||||||
Collections.asMap(
|
|
||||||
MongoConstant.GT_GE+ MongoConstant.SEPARATION+"id",String.valueOf(batDataDto.getBeginTime().getTime())+MongoConstant.SEPARATION+String.valueOf(batDataDto.getEndTime().getTime()),
|
|
||||||
MongoConstant.SORT+ MongoConstant.SEPARATION+MongoConstant.SORT_DESC, "id"
|
|
||||||
));
|
|
||||||
List<HdChargingData> resultChargingDataList = Collections.emptyList();
|
|
||||||
if(Collections.isNotEmpty(batDataList)){
|
|
||||||
chargingDataList.stream().forEach(data->{
|
|
||||||
if(StringUtils.isNotEmpty(data.getValue())){
|
|
||||||
HdChargingData chargingData = JSONUtil.toBean(data.getValue(), HdChargingData.class);
|
|
||||||
chargingData.setId(data.getId());
|
|
||||||
resultChargingDataList.add(chargingData);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return new Result().success(Collections.asMap("batData", resultBatDataList, "chargingData", resultChargingDataList));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,80 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.controller.alarm;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.evotech.hd.cloud.entity.request.PageListAlarmTemplateRequest;
|
|
||||||
import com.evotech.hd.cloud.service.AlarmTemplateService;
|
|
||||||
import com.evotech.hd.cloud.service.rpc.WechatService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.entity.common.AlarmTemplate;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.springdoc.core.annotations.ParameterObject;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AlarmController
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:AlarmController
|
|
||||||
* @date: 2025年10月28日 15:13
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Tag(name = "异常通知")
|
|
||||||
@ApiSupport(order = 48)
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/alarm")
|
|
||||||
public class AlarmController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
AlarmTemplateService alarmTemplateService;
|
|
||||||
@Autowired
|
|
||||||
WechatService wechatService;
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "增加")
|
|
||||||
@PostMapping("/add")
|
|
||||||
@ApiOperationSupport(order = 1)
|
|
||||||
public Result<Boolean> add(@Valid @ParameterObject AlarmTemplate params) {
|
|
||||||
return Result.getInstance().build(Boolean.class).success(alarmTemplateService.save(params));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除")
|
|
||||||
@PostMapping("/del")
|
|
||||||
@ApiOperationSupport(order = 2)
|
|
||||||
public Result<Boolean> delete(Integer id) {
|
|
||||||
return Result.getInstance().build(Boolean.class).success(alarmTemplateService.removeById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改")
|
|
||||||
@PostMapping({"/update"})
|
|
||||||
@ApiOperationSupport(order = 3)
|
|
||||||
public Result<Boolean> update(@ParameterObject AlarmTemplate params) {
|
|
||||||
return Result.getInstance().build(Boolean.class).success(alarmTemplateService.updateById(params));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询")
|
|
||||||
@GetMapping("/list")
|
|
||||||
@ApiOperationSupport(order = 4)
|
|
||||||
public Result<Page<AlarmTemplate>> list(@ParameterObject PageListAlarmTemplateRequest params) {
|
|
||||||
return alarmTemplateService.pageList(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "推送通知")
|
|
||||||
@PostMapping("/send/{path}")
|
|
||||||
|
|
||||||
public Result<String> deleteDetail(@RequestBody AlarmTemplate param,@PathVariable("path")String path) {
|
|
||||||
AlarmTemplate alarmTemplate = alarmTemplateService.getOne(new LambdaQueryWrapper<AlarmTemplate>().eq(AlarmTemplate::getPath, path), false);
|
|
||||||
if(ObjectUtils.isEmpty(alarmTemplate)){
|
|
||||||
return Result.getInstance().build(String.class).error("当前路径不存在");
|
|
||||||
}
|
|
||||||
alarmTemplate.setArea(param.getArea());
|
|
||||||
alarmTemplate.setMessage(param.getMessage());
|
|
||||||
return wechatService.sendGzhToBeSettledAlarmMessage(alarmTemplate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -28,7 +28,7 @@ public class WechatUserController {
|
|||||||
@Operation(summary = "查询")
|
@Operation(summary = "查询")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<Page<WechatUser>> list(@ParameterObject PageListWechatUserRequest plwur) {
|
public Result<Page<WechatUser>> list(@ParameterObject PageListWechatUserRequest plwur) {
|
||||||
return wechatUserService.pageList(plwur);
|
return wechatUserService.list(plwur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public class OrderPerController {
|
|||||||
@PostMapping("/cancel")
|
@PostMapping("/cancel")
|
||||||
@ApiOperationSupport(order = 2)
|
@ApiOperationSupport(order = 2)
|
||||||
public Result<Integer> cancelPre(@NotNull Integer id) {
|
public Result<Integer> cancelPre(@NotNull Integer id) {
|
||||||
return orderSwapBatteryPreService.updateStatusById(id, 3);
|
return orderSwapBatteryPreService.cancelPre(id, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.evotech.hd.cloud.entity.vo.NativePayVO;
|
import com.evotech.hd.cloud.entity.vo.NativePayVO;
|
||||||
import com.evotech.hd.cloud.service.OrderService;
|
import com.evotech.hd.cloud.service.OrderService;
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
import com.evotech.hd.common.core.Dto.Result;
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderBillListVo;
|
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderDetailVo;
|
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderListVo;
|
import com.evotech.hd.common.core.Dto.order.OrderListVo;
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||||
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
||||||
@ -40,14 +38,6 @@ public class OrderSwapBatteryController {
|
|||||||
return orderService.pageList(plsor);
|
return orderService.pageList(plsor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "查询订单详情")
|
|
||||||
@GetMapping("/{orderNo}")
|
|
||||||
@ApiOperationSupport(order = 6)
|
|
||||||
public Result<OrderDetailVo> getOne(@PathVariable(value = "orderNo") String orderNo) {
|
|
||||||
return orderService.getOneByOrderNo(orderNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询换电步骤")
|
@Operation(summary = "查询换电步骤")
|
||||||
@GetMapping("/step/list")
|
@GetMapping("/step/list")
|
||||||
@ApiOperationSupport(order = 9)
|
@ApiOperationSupport(order = 9)
|
||||||
@ -55,7 +45,12 @@ public class OrderSwapBatteryController {
|
|||||||
return orderService.listStep(orderNo);
|
return orderService.listStep(orderNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "个人账户余额支付")
|
||||||
|
@PostMapping({"/one"})
|
||||||
|
@ApiOperationSupport(order = 11)
|
||||||
|
public Result<Order> one(@RequestParam String orderNo) {
|
||||||
|
return orderService.one(orderNo);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "个人账户余额支付")
|
@Operation(summary = "个人账户余额支付")
|
||||||
@PostMapping({"/wallet/pay"})
|
@PostMapping({"/wallet/pay"})
|
||||||
@ -64,6 +59,10 @@ public class OrderSwapBatteryController {
|
|||||||
return orderService.walletPay(orderNo, wuid, uname);
|
return orderService.walletPay(orderNo, wuid, uname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "查询公司订单")
|
@Operation(summary = "查询公司订单")
|
||||||
@GetMapping("/listcompanyorder")
|
@GetMapping("/listcompanyorder")
|
||||||
@ApiOperationSupport(order = 8)
|
@ApiOperationSupport(order = 8)
|
||||||
@ -84,13 +83,22 @@ public class OrderSwapBatteryController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @Operation(summary = "公司订单扫码支付")
|
|
||||||
// @PostMapping({"/wechat/nativepay"})
|
|
||||||
// @ApiOperationSupport(order = 13)
|
|
||||||
// public Result<String> companyNativePay(@RequestBody NativePayVO prePay) {
|
|
||||||
// return orderService.companyNativePay(prePay);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
@Operation(summary = "公司订单余额支付")
|
||||||
|
@PostMapping({"/companywallet/pay"})
|
||||||
|
@ApiOperationSupport(order = 12)
|
||||||
|
public Result<String> companyWalletPay(@RequestParam String orderNo, String wuid, String uname) {
|
||||||
|
// TODO
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "公司订单扫码支付")
|
||||||
|
@PostMapping({"/wechat/nativepay"})
|
||||||
|
@ApiOperationSupport(order = 13)
|
||||||
|
public Result<String> companyNativePay(@RequestBody NativePayVO prePay) {
|
||||||
|
return orderService.companyNativePay(prePay);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "扫码支付订单查询状态")
|
@Operation(summary = "扫码支付订单查询状态")
|
||||||
@GetMapping("/paystatus/query")
|
@GetMapping("/paystatus/query")
|
||||||
@ -125,44 +133,4 @@ public class OrderSwapBatteryController {
|
|||||||
return orderService.checkList(plsor);
|
return orderService.checkList(plsor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "个人账户余额支付")
|
|
||||||
@PostMapping({"/one"})
|
|
||||||
@ApiOperationSupport(order = 11)
|
|
||||||
public Result<Order> one(@RequestParam String orderNo) {
|
|
||||||
return orderService.one(orderNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "电子对账单")
|
|
||||||
@GetMapping("/bill/list")
|
|
||||||
@ApiOperationSupport(order = 6)
|
|
||||||
public Result<List<OrderBillListVo>> billList(String companyCode, String orderTimeEnd) {
|
|
||||||
return orderService.billList(companyCode, orderTimeEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "下载电子对账单")
|
|
||||||
@PostMapping("/bill/download")
|
|
||||||
@ApiOperationSupport(order = 6)
|
|
||||||
public void billDownload(String companyCode, String orderTimeEnd) {
|
|
||||||
orderService.excelBillList(companyCode, orderTimeEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "公司订单扫码支付")
|
|
||||||
@PostMapping({"/wechat/nativepay"})
|
|
||||||
@ApiOperationSupport(order = 13)
|
|
||||||
public Result<String> companyNativePay(@RequestBody NativePayVO prePay) {
|
|
||||||
return orderService.companyNativePay(prePay);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "订单导出")
|
|
||||||
@PostMapping("/export")
|
|
||||||
@ApiOperationSupport(order = 6)
|
|
||||||
public void export(@ParameterObject PageListSwapOrderRequest plsor) {
|
|
||||||
orderService.export(plsor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,20 +51,6 @@ public class TradeController {
|
|||||||
return tradeService.update(td);
|
return tradeService.update(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "提交")
|
|
||||||
@PostMapping({"/submit"})
|
|
||||||
@ApiOperationSupport(order = 3)
|
|
||||||
public Result<Integer> submit(@ParameterObject TradeDetail td) {
|
|
||||||
return tradeService.submit(td);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "审核")
|
|
||||||
@PostMapping({"/approve"})
|
|
||||||
@ApiOperationSupport(order = 3)
|
|
||||||
public Result<Integer> approve(Integer id, @RequestParam Integer type) {
|
|
||||||
return tradeService.approve(id,type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询")
|
@Operation(summary = "查询")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperationSupport(order = 4)
|
@ApiOperationSupport(order = 4)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,7 @@
|
|||||||
package com.evotech.hd.cloud.dao;
|
package com.evotech.hd.cloud.dao;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.evotech.hd.cloud.entity.MessageMqtt;
|
import com.evotech.hd.cloud.entity.MessageMqtt;
|
||||||
import com.evotech.hd.cloud.entity.request.PageListMessageMqttRequest;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zrb
|
* @author zrb
|
||||||
@ -14,5 +9,4 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface MessageMqttDao extends BaseMapper<MessageMqtt> {
|
public interface MessageMqttDao extends BaseMapper<MessageMqtt> {
|
||||||
|
|
||||||
List<MessageMqtt> pageList(Page<MessageMqtt> page, @Param("param") PageListMessageMqttRequest plmmr);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,12 @@
|
|||||||
package com.evotech.hd.cloud.dao;
|
package com.evotech.hd.cloud.dao;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderStepExportVo;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zrb
|
* @author zrb
|
||||||
* @since 2024-12-11
|
* @since 2024-12-11
|
||||||
*/
|
*/
|
||||||
public interface OrderSwapBatteryStepDao extends BaseMapper<OrderSwapBatteryStep> {
|
public interface OrderSwapBatteryStepDao extends BaseMapper<OrderSwapBatteryStep> {
|
||||||
//推送时间不能作为排序标准
|
|
||||||
@Select(" select step as stepName, step, step_time as stepTime from hd_cloud_manage.yt_t_order_swap_battery_step where order_no=#{orderNo} ORDER BY step_time asc")
|
|
||||||
public List<OrderStepExportVo> findListByOrderNo(@Param("orderNo") String orderNo);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.evotech.hd.cloud.entity;
|
package com.evotech.hd.cloud.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
@ -31,11 +30,6 @@ public class MessageMqtt implements Serializable {
|
|||||||
@Schema(description = "换电站")
|
@Schema(description = "换电站")
|
||||||
private String stationCode;
|
private String stationCode;
|
||||||
|
|
||||||
@Schema(description = "换电站名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String stationName;
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "传送方向")
|
@Schema(description = "传送方向")
|
||||||
private String direction;
|
private String direction;
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.entity.request;
|
|
||||||
|
|
||||||
import com.evotech.hd.common.core.entity.BasePageRequest;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Schema(name = "查询异常请求参数", hidden = true)
|
|
||||||
@EqualsAndHashCode(callSuper=false)
|
|
||||||
public class PageListAlarmTemplateRequest extends BasePageRequest {
|
|
||||||
|
|
||||||
@Schema(description = "路径")
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,5 +1,8 @@
|
|||||||
package com.evotech.hd.cloud.entity.vo;
|
package com.evotech.hd.cloud.entity.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||||
@ -9,9 +12,6 @@ import jakarta.validation.constraints.NotBlank;
|
|||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Schema(name = "Native下单参数")
|
@Schema(name = "Native下单参数")
|
||||||
public class NativePayVO {
|
public class NativePayVO {
|
||||||
@ -21,7 +21,6 @@ public class NativePayVO {
|
|||||||
|
|
||||||
@Schema(description = "公司编码")
|
@Schema(description = "公司编码")
|
||||||
private String ccode;
|
private String ccode;
|
||||||
private String companyCode;
|
|
||||||
|
|
||||||
@Schema(description = "订单总描述", requiredMode = RequiredMode.REQUIRED)
|
@Schema(description = "订单总描述", requiredMode = RequiredMode.REQUIRED)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@ -60,7 +59,5 @@ public class NativePayVO {
|
|||||||
|
|
||||||
@Schema(description = "用户设备型号")
|
@Schema(description = "用户设备型号")
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
@Schema(description = "订单结束时间")
|
|
||||||
String orderTimeEnd;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,7 @@ public enum EventFunctionTypesEnum {
|
|||||||
FUN_CHARGE_RECORD("chargeRecord", "chargeRecordConf", "充电事件记录"),
|
FUN_CHARGE_RECORD("chargeRecord", "chargeRecordConf", "充电事件记录"),
|
||||||
FUN_SWAP_RECORD("swapRecord", "swapRecordConf", "换电事件记录"),
|
FUN_SWAP_RECORD("swapRecord", "swapRecordConf", "换电事件记录"),
|
||||||
FUN_WARN_RECORD("faultRecord", "faultRecordConf", "故障告警事件记录"),
|
FUN_WARN_RECORD("faultRecord", "faultRecordConf", "故障告警事件记录"),
|
||||||
FUN_ORDEREVENT("swapComplete", "swapCompleteConfirm", " 站端换电完成事件"),
|
FUN_ORDEREVENT("swapComplete", "swapCompleteConfirm", " 站端换电完成事件");
|
||||||
FUN_PUSH_STATION_CONTRNL_DATA("", "pushReservation", " 推送站端事件");
|
|
||||||
String function;
|
String function;
|
||||||
String reFunction;
|
String reFunction;
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ public enum StateFunctionTypesEnum {
|
|||||||
FUN_CHARGING_DATA("chargingData", "", "充电过程实时信息"),
|
FUN_CHARGING_DATA("chargingData", "", "充电过程实时信息"),
|
||||||
FUN_BAT_DATA("batData", "", "电池实时信息"),
|
FUN_BAT_DATA("batData", "", "电池实时信息"),
|
||||||
FUN_STATION_STATE("stationState", "", "站级状态信息"),
|
FUN_STATION_STATE("stationState", "", "站级状态信息"),
|
||||||
FUN_CHARGING_STRATEGY("chargingStrategy", "", "充电策略信息"),
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,14 +19,6 @@ public class MessageTopic implements Serializable {
|
|||||||
|
|
||||||
private String messageType;
|
private String messageType;
|
||||||
|
|
||||||
public MessageTopic() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessageTopic( String stationCode, String messageType) {
|
|
||||||
this.stationCode = stationCode;
|
|
||||||
this.messageType = messageType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return businessType + "/" + stationCode + "/" + dataDirection + "/" + messageType;
|
return businessType + "/" + stationCode + "/" + dataDirection + "/" + messageType;
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class MqttResponse<T> implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MqttResponse<T> success(T dataBody){
|
public MqttResponse<T> success(T data){
|
||||||
this.code=SUCCESS;
|
this.code=SUCCESS;
|
||||||
this.msg="成功";
|
this.msg="成功";
|
||||||
this.data=data;
|
this.data=data;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public class OrderStatusData {
|
|||||||
private Integer soc;
|
private Integer soc;
|
||||||
|
|
||||||
@Schema(description = "租借电池包仓位")
|
@Schema(description = "租借电池包仓位")
|
||||||
private String rentBatNo;
|
private Integer rentBatNo;
|
||||||
|
|
||||||
@Schema(description = "租用电池包编码")
|
@Schema(description = "租用电池包编码")
|
||||||
private String rentBatCode;
|
private String rentBatCode;
|
||||||
@ -30,7 +30,7 @@ public class OrderStatusData {
|
|||||||
private String returnBatCode;
|
private String returnBatCode;
|
||||||
|
|
||||||
@Schema(description = "归还电池包仓位")
|
@Schema(description = "归还电池包仓位")
|
||||||
private String returnBatNo;
|
private Integer returnBatNo;
|
||||||
|
|
||||||
@Schema(description = "归还电池包SOC")
|
@Schema(description = "归还电池包SOC")
|
||||||
private Integer returnBatSoc;
|
private Integer returnBatSoc;
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.evotech.hd.cloud.mqtt.message.dto.older.state;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -11,7 +10,6 @@ import java.util.Date;
|
|||||||
* @date 2023-12-03
|
* @date 2023-12-03
|
||||||
*/
|
*/
|
||||||
@Schema(name = "电池箱实时信息", hidden = true)
|
@Schema(name = "电池箱实时信息", hidden = true)
|
||||||
@Data
|
|
||||||
public class HdChargingData {
|
public class HdChargingData {
|
||||||
|
|
||||||
@Schema(name = "主键")
|
@Schema(name = "主键")
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
||||||
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
||||||
import com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.confirm.MqttStrategyConfirmExchangeProcessor;
|
import com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.event.MqttStrategyEventExchangeProcessor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
@ -25,11 +25,11 @@ public class EventMessageService {
|
|||||||
* event消息 处理
|
* event消息 处理
|
||||||
*/
|
*/
|
||||||
public void event(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
public void event(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
Map<String, MqttStrategyConfirmExchangeProcessor> mqttEventExchangeProcessorMap = applicationContext.getBeansOfType(MqttStrategyConfirmExchangeProcessor.class);
|
Map<String, MqttStrategyEventExchangeProcessor> mqttEventExchangeProcessorMap = applicationContext.getBeansOfType(MqttStrategyEventExchangeProcessor.class);
|
||||||
if(CollectionUtils.isEmpty(mqttEventExchangeProcessorMap)){
|
if(CollectionUtils.isEmpty(mqttEventExchangeProcessorMap)){
|
||||||
log.error("mqttEventExchangeProcessorMap is empty, 没有找到当前的请求信息, 请求接口{}, 请求参数{}", JSONUtil.toJsonStr(header), JSONUtil.toJsonStr(dataBody));
|
log.error("mqttEventExchangeProcessorMap is empty, 没有找到当前的请求信息, 请求接口{}, 请求参数{}", JSONUtil.toJsonStr(header), JSONUtil.toJsonStr(dataBody));
|
||||||
}
|
}
|
||||||
for (MqttStrategyConfirmExchangeProcessor processor : mqttEventExchangeProcessorMap.values()) {
|
for (MqttStrategyEventExchangeProcessor processor : mqttEventExchangeProcessorMap.values()) {
|
||||||
if(processor.accept(header.getFunction())){
|
if(processor.accept(header.getFunction())){
|
||||||
processor.exchange(topic, header, dataBody);
|
processor.exchange(topic, header, dataBody);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
package com.evotech.hd.cloud.mqtt.message.handle;
|
package com.evotech.hd.cloud.mqtt.message.handle;
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.crypto.KeyUtil;
|
import cn.hutool.crypto.KeyUtil;
|
||||||
@ -13,7 +11,6 @@ import cn.hutool.crypto.asymmetric.RSA;
|
|||||||
import cn.hutool.crypto.symmetric.AES;
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
||||||
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
||||||
import cn.hutool.json.JSONConfig;
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@ -21,11 +18,9 @@ import com.evotech.hd.cloud.dao.BatteryStationSecretKeyDao;
|
|||||||
import com.evotech.hd.cloud.entity.BatteryStationSecretKey;
|
import com.evotech.hd.cloud.entity.BatteryStationSecretKey;
|
||||||
import com.evotech.hd.cloud.entity.MessageMqtt;
|
import com.evotech.hd.cloud.entity.MessageMqtt;
|
||||||
import com.evotech.hd.cloud.mqtt.config.MqttPublishMessage;
|
import com.evotech.hd.cloud.mqtt.config.MqttPublishMessage;
|
||||||
import com.evotech.hd.cloud.mqtt.enums.MqttMessageTypeEnum;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
||||||
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
||||||
import com.evotech.hd.cloud.mqtt.message.MyMqttMessage;
|
import com.evotech.hd.cloud.mqtt.message.MyMqttMessage;
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
|
||||||
import com.evotech.hd.cloud.service.MessageMqttService;
|
import com.evotech.hd.cloud.service.MessageMqttService;
|
||||||
import com.evotech.hd.common.core.constant.HDConstant;
|
import com.evotech.hd.common.core.constant.HDConstant;
|
||||||
import com.evotech.hd.common.redis.utils.RedisUtil;
|
import com.evotech.hd.common.redis.utils.RedisUtil;
|
||||||
@ -52,21 +47,6 @@ public class MessageUtilService {
|
|||||||
private MqttPublishMessage publishMessage;
|
private MqttPublishMessage publishMessage;
|
||||||
|
|
||||||
|
|
||||||
public void publishStateMessage(String stationCode, String function, MqttResponse response) {
|
|
||||||
publishMessage(function, MqttMessageTypeEnum.STATE.getType(),response, stationCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void publishMessage(String function, String messageType, MqttResponse response, String stationCode) {
|
|
||||||
MessageTopic topic = new MessageTopic();
|
|
||||||
topic.setMessageType(messageType);
|
|
||||||
topic.setStationCode(stationCode);
|
|
||||||
topic.setDataDirection("M2S");
|
|
||||||
|
|
||||||
MqttMessageHeader header = new MqttMessageHeader();
|
|
||||||
header.setTimeStamp(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMATTER));
|
|
||||||
header.setFunction(function);
|
|
||||||
publishAESMessage(topic, header, JSONUtil.parseObj(response, new JSONConfig().setDateFormat(DatePattern.NORM_DATETIME_PATTERN)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录MQTT消息
|
* 记录MQTT消息
|
||||||
@ -100,19 +80,7 @@ public class MessageUtilService {
|
|||||||
public void publishRSAMessage(MessageTopic topic, String msg, String stationPublicKey) {
|
public void publishRSAMessage(MessageTopic topic, String msg, String stationPublicKey) {
|
||||||
RSA rsa = SecureUtil.rsa(null, stationPublicKey);
|
RSA rsa = SecureUtil.rsa(null, stationPublicKey);
|
||||||
String encrypt = rsa.encryptBase64(msg, KeyType.PublicKey);
|
String encrypt = rsa.encryptBase64(msg, KeyType.PublicKey);
|
||||||
|
publishMessage.publish(encrypt, topic.toString());
|
||||||
// 3. 发送MQTT消息
|
|
||||||
try {
|
|
||||||
MqttMessage mqttMessage = publishMessage.publish(encrypt, topic.toString());
|
|
||||||
try {
|
|
||||||
addMqttMessage(topic, mqttMessage.getId()+"", mqttMessage.getQos(), JSONUtil.parseObj(msg));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("MQTT->>>>>>>>>>>>>记录mqtt消息 发送RSA加密消息 出现了错误{},topic:{}; data:{}; message:{}",e.getMessage(),JSONUtil.toJsonStr(topic),JSONUtil.toJsonStr(msg), JSONUtil.toJsonStr(mqttMessage));
|
|
||||||
throw new RuntimeException("记录mqtt消息出现了错误"+e.getMessage());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("MQTT->>>>>>>>>>>>>发送站端mqtt消息 发送RSA加密消息 出现异常{},topic:{}; data:{}",e.getMessage(),JSONUtil.toJsonStr(topic),JSONUtil.toJsonStr(msg));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -135,8 +103,8 @@ public class MessageUtilService {
|
|||||||
try {
|
try {
|
||||||
MqttMessage mqttMessage = publishMessage.publish(encrypt, topic.toString());
|
MqttMessage mqttMessage = publishMessage.publish(encrypt, topic.toString());
|
||||||
try {
|
try {
|
||||||
//dataBody.set("header", JSONUtil.toJsonStr(header));
|
dataBody.set("header", JSONUtil.toJsonStr(header));
|
||||||
addMqttMessage(topic, mqttMessage.getId()+"", mqttMessage.getQos(), JSONUtil.parseObj(message));
|
addMqttMessage(topic, mqttMessage.getId()+"", mqttMessage.getQos(), dataBody);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("MQTT->>>>>>>>>>>>>记录mqtt消息出现了错误{},topic:{}; header:{}, data:{}; message:{}",e.getMessage(),JSONUtil.toJsonStr(topic),JSONUtil.toJsonStr(header),JSONUtil.toJsonStr(dataBody), JSONUtil.toJsonStr(mqttMessage));
|
log.error("MQTT->>>>>>>>>>>>>记录mqtt消息出现了错误{},topic:{}; header:{}, data:{}; message:{}",e.getMessage(),JSONUtil.toJsonStr(topic),JSONUtil.toJsonStr(header),JSONUtil.toJsonStr(dataBody), JSONUtil.toJsonStr(mqttMessage));
|
||||||
throw new RuntimeException("记录mqtt消息出现了错误"+e.getMessage());
|
throw new RuntimeException("记录mqtt消息出现了错误"+e.getMessage());
|
||||||
|
|||||||
@ -52,9 +52,6 @@ public class MqttMessageHandleService {
|
|||||||
// 3.1.2 保存MQTT消息
|
// 3.1.2 保存MQTT消息
|
||||||
MqttMessageHeader header = messageUtilService.addMqttMessage(topic, message.getId()+"", message.getQos(), jo);
|
MqttMessageHeader header = messageUtilService.addMqttMessage(topic, message.getId()+"", message.getQos(), jo);
|
||||||
JSONObject dataBody = jo.getJSONObject("dataBody");
|
JSONObject dataBody = jo.getJSONObject("dataBody");
|
||||||
if(dataBody == null){
|
|
||||||
dataBody = jo.getJSONObject("data");
|
|
||||||
}
|
|
||||||
// 3.2 分类处理
|
// 3.2 分类处理
|
||||||
// 3.2.1 state
|
// 3.2.1 state
|
||||||
if (MqttMessageTypeEnum.STATE.getType().equals(topic.getMessageType())) {
|
if (MqttMessageTypeEnum.STATE.getType().equals(topic.getMessageType())) {
|
||||||
|
|||||||
@ -1,216 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.confirm;
|
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.evotech.hd.cloud.mqtt.enums.EventFunctionTypesEnum;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.confirm.SwapCompleteConfirm;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.event.SwapComplete;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.state.OrderStatusData;
|
|
||||||
import com.evotech.hd.cloud.service.OrderService;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 换电完成事件数据
|
|
||||||
*
|
|
||||||
* @ClassName:MqttRequestBatteryInfoExchangeProcessorImpl
|
|
||||||
* @date: 2025年05月19日 17:41
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class MqttConfirmSwapCompleteExchangeProcessorImpl implements MqttStrategyConfirmExchangeProcessor {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
OrderService orderService;
|
|
||||||
// @Resource
|
|
||||||
// OrderDetailService orderDetailService;
|
|
||||||
// @Resource
|
|
||||||
// private SwapOrderBasicFeeComponent orderBasicFeeComponent;
|
|
||||||
// @Resource
|
|
||||||
// private OrderSwapBatteryStepService orderSwapBatteryStepService;
|
|
||||||
// @Resource
|
|
||||||
// private VehicleService vehicleService;
|
|
||||||
// @Resource
|
|
||||||
// BatteryStationDcService batteryStationDcService;
|
|
||||||
// @Resource
|
|
||||||
// WechatService wechatService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean accept(String functionName) {
|
|
||||||
return EventFunctionTypesEnum.FUN_ORDEREVENT.getFunction().equals(functionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
|
||||||
SwapComplete orderStatus = JSONUtil.toBean(dataBody, SwapComplete.class);
|
|
||||||
OrderStatusData statusData = JSONUtil.toBean(dataBody.getJSONObject("statusData"), OrderStatusData.class);
|
|
||||||
|
|
||||||
MqttResponse<SwapCompleteConfirm> response = new MqttResponse();
|
|
||||||
SwapCompleteConfirm swapRecordConfirm = new SwapCompleteConfirm();
|
|
||||||
try {
|
|
||||||
// 订单状态更新处理
|
|
||||||
orderService.handleOrderStatus(orderStatus, statusData);
|
|
||||||
response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
|
||||||
swapRecordConfirm.setAckStatus(MqttResponse.PUBLIC_SUCCESS);
|
|
||||||
swapRecordConfirm.setOrderNo(orderStatus.getOrderNo());
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
log.error("更新订单信息出现错误: {}", e.getMessage());
|
|
||||||
response.setCode(MqttResponse.PUBLIC_ERROR);
|
|
||||||
response.setMsg(orderStatus.getOrderNo());
|
|
||||||
swapRecordConfirm.setAckStatus(MqttResponse.PUBLIC_ERROR);
|
|
||||||
swapRecordConfirm.setOrderNo(orderStatus.getOrderNo());
|
|
||||||
swapRecordConfirm.setError(e.getMessage());
|
|
||||||
}
|
|
||||||
response.setData(swapRecordConfirm);
|
|
||||||
if(header != null){
|
|
||||||
sendAESMessage(topic, header, EventFunctionTypesEnum.FUN_ORDEREVENT, response);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 订单最终状态的更新
|
|
||||||
// * @param orderStatus
|
|
||||||
// * @param statusData
|
|
||||||
// */
|
|
||||||
// private void handleOrderStatus(SwapComplete orderStatus, OrderStatusData statusData) {
|
|
||||||
//
|
|
||||||
// Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderStatus.getOrderNo()));
|
|
||||||
// if(ObjectUtils.isEmpty(order)){
|
|
||||||
// throw new RuntimeException("未找到订单信息");
|
|
||||||
// }
|
|
||||||
// //更新订单状态
|
|
||||||
// order.setStatus(orderStatus.getStatus());
|
|
||||||
// orderService.updateById(order);
|
|
||||||
// //修改订单状态及金额
|
|
||||||
// alterOrderStatus(order, statusData);
|
|
||||||
// //记录电池信息 or 记录最后的换电步骤
|
|
||||||
// alterSwapBatteryStep(orderStatus, statusData, order);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 修改订单状态方法
|
|
||||||
// * @param order
|
|
||||||
// * @param statusData
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// private void alterOrderStatus(Order order, OrderStatusData statusData) {
|
|
||||||
// if (order.getStatus() == 3 || order.getStatus() == 5) {
|
|
||||||
// //如果订单是完成. 查询订单详情
|
|
||||||
// OrderDetail orderDetail = orderDetailService.getOne(new LambdaQueryWrapper<OrderDetail>().eq(OrderDetail::getOrderId, order.getPkId()));
|
|
||||||
// orderDetail.setFeeType(ParamServiceUtils.getSettlementType());
|
|
||||||
// orderDetail.setOrderTimeEnd(new Date());
|
|
||||||
// orderDetail.setServiceTimeEnd(new Date());
|
|
||||||
// //copy属性
|
|
||||||
// BeanUtils.copyProperties(statusData, orderDetail);
|
|
||||||
// orderDetail.setRentBatSoc(Double.valueOf(statusData.getRentBatSoc()));
|
|
||||||
// orderDetail.setReturnBatSoc(Double.valueOf(statusData.getReturnBatSoc()));
|
|
||||||
// switch (orderDetail.getFeeType()){
|
|
||||||
// case HDConstant.OrderConstant.FEE_TYPE_DL:
|
|
||||||
// orderDetail.setElectricityQuantity(statusData.getElectAmount().doubleValue());
|
|
||||||
// break;
|
|
||||||
// case HDConstant.OrderConstant.FEE_TYPE_ODO:
|
|
||||||
//// orderDetail.setElectricityQuantity(new BigDecimal(statusData.getSoc()).doubleValue());
|
|
||||||
// break;
|
|
||||||
// case HDConstant.OrderConstant.FEE_TYPE_SOC:
|
|
||||||
// default:
|
|
||||||
// orderDetail.setElectricityQuantity(new BigDecimal(statusData.getRentBatSoc()).subtract(new BigDecimal(statusData.getReturnBatSoc())).doubleValue());
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// //计算费用方式
|
|
||||||
// log.info("\r\n=====>>>订单状态更新处理订单状态开始结算:{},{}",order.getOrderNo(),order.getStatus() );
|
|
||||||
// //计算费用信息
|
|
||||||
// orderBasicFeeComponent.orderBasicFee(order, orderDetail);
|
|
||||||
// //发送换电完成推送
|
|
||||||
// wechatService.sendGzhSwapOrderSuccessMessage(order);
|
|
||||||
// orderService.calculateCost(order);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 修改订单费用
|
|
||||||
// * @param order
|
|
||||||
// * @param statusData
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// private void alterSwapBatteryStep(SwapComplete orderStatus, OrderStatusData statusData, Order order) {
|
|
||||||
// if (orderStatus.getStatus() == 3 || orderStatus.getStatus() == 5){
|
|
||||||
// //生成步骤
|
|
||||||
// orderSwapBatteryStepService.addOrderSwapBatteryStepBySwapComplete(orderStatus.getOrderNo(), SwapBatteryStepEnum.COMPLETED.getKey(), orderStatus.getStatusTime());
|
|
||||||
// // 修改车上电池编码
|
|
||||||
// vehicleService.update(new UpdateWrapper<VehicleInfo>()
|
|
||||||
// .set("bat_code", statusData.getRentBatCode())
|
|
||||||
// .set("bat_soc", statusData.getRentBatSoc())
|
|
||||||
// .eq("plate_num", order.getPlateNum()));
|
|
||||||
// //出租电池信息维护
|
|
||||||
// batteryStationDcService.update(new UpdateWrapper<BatteryStationDc>()
|
|
||||||
// .set("status", HDConstant.DcConstant.STATUS_CZ)
|
|
||||||
// .set("source_from", HDConstant.DcConstant.SOURCE_FROM_STATION)
|
|
||||||
// .set("point_type", HDConstant.DcConstant.POINT_TYPE_CAR)
|
|
||||||
// .set("point_code", order.getPlateNum())
|
|
||||||
// .set("point_name", order.getPlateNum())
|
|
||||||
// .set("dcc_no", 0)
|
|
||||||
// .eq("bat_code", statusData.getRentBatCode()));
|
|
||||||
// //归还电池信息维护
|
|
||||||
// batteryStationDcService.update(new UpdateWrapper<BatteryStationDc>()
|
|
||||||
// .set("status", HDConstant.DcConstant.STATUS_CD)
|
|
||||||
// .set("source_from", HDConstant.DcConstant.SOURCE_FROM_CAR)
|
|
||||||
// .set("point_type", HDConstant.DcConstant.POINT_TYPE_STATION)
|
|
||||||
// .set("point_code", order.getPlateNum())
|
|
||||||
// .set("point_name", order.getPlateNum())
|
|
||||||
// .set("soc", statusData.getReturnBatSoc())
|
|
||||||
// .set("dcc_no", statusData.getReturnBatNo())
|
|
||||||
// .eq("bat_code", statusData.getReturnBatCode()));
|
|
||||||
// // 添加2块电池的溯源记录
|
|
||||||
// addBatteryTrace(orderStatus, statusData, order);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 添加电池轨迹记录
|
|
||||||
// *
|
|
||||||
// * @param orderStatus
|
|
||||||
// * @param statusData
|
|
||||||
// * @param osb
|
|
||||||
// */
|
|
||||||
// private void addBatteryTrace(SwapComplete orderStatus, OrderStatusData statusData, Order osb) {
|
|
||||||
// BatteryTrace bt1 = new BatteryTrace();
|
|
||||||
// bt1.setOrderNo(orderStatus.getOrderNo());
|
|
||||||
// bt1.setBatCode(statusData.getRentBatCode());
|
|
||||||
// bt1.setSoc(statusData.getRentBatSoc());
|
|
||||||
// bt1.setBeginTime(orderStatus.getStatusTime());
|
|
||||||
// bt1.setPointType(2);
|
|
||||||
// bt1.setPointCode(osb.getPlateNum());
|
|
||||||
// bt1.setPointName(osb.getPlateNum());
|
|
||||||
// bt1.setCreater("SYS");
|
|
||||||
// BatteryTrace bt2 = new BatteryTrace();
|
|
||||||
// BeanUtils.copyProperties(bt1, bt2);
|
|
||||||
// bt2.setBatCode(statusData.getReturnBatCode());
|
|
||||||
// bt2.setSoc(statusData.getRentBatSoc());
|
|
||||||
// bt2.setPointType(1);
|
|
||||||
// bt2.setPointCode(osb.getStationCode());
|
|
||||||
// bt2.setPointName(osb.getStationName());
|
|
||||||
// batteryStationDcService.addTrace(bt1);
|
|
||||||
// batteryStationDcService.addTrace(bt2);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.confirm;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.json.JSONConfig;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.evotech.hd.cloud.mqtt.enums.EventFunctionTypesEnum;
|
|
||||||
import com.evotech.hd.cloud.mqtt.enums.MqttMessageTypeEnum;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.processor.strategy.MqttStrategyExchangeProcessor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接口
|
|
||||||
*
|
|
||||||
* @ClassName:MqttStrategyequestExchangeProcessor
|
|
||||||
* @date: 2025年06月19日 16:29
|
|
||||||
* @author: andy.shi
|
|
||||||
* @contact: 17330188597
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
public interface MqttStrategyConfirmExchangeProcessor extends MqttStrategyExchangeProcessor {
|
|
||||||
|
|
||||||
default void sendAESMessage(MessageTopic topic, MqttMessageHeader header, EventFunctionTypesEnum typesEnum, MqttResponse response){
|
|
||||||
topic.setMessageType(MqttMessageTypeEnum.CONFIRM.getType());
|
|
||||||
header.setFunction(typesEnum.getReFunction());
|
|
||||||
logger.info("\r\n=====>>>回复站端的EVENT消息--MQTT发送到消息主题:{},头部信息:{},message:{}", topic,header, JSONUtil.parseObj(response, new JSONConfig().setDateFormat(DatePattern.NORM_DATETIME_PATTERN)));
|
|
||||||
sendAESMessage(topic, header, response);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.event;
|
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BaseProcessorImpl
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:BaseProcessorImpl
|
|
||||||
* @date: 2025年10月29日 10:46
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class BaseProcessorImpl implements MqttStrategyEventExchangeProcessor {
|
|
||||||
@Override
|
|
||||||
public boolean accept(String functionName) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,231 @@
|
|||||||
|
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.event;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.evotech.hd.cloud.mqtt.enums.EventFunctionTypesEnum;
|
||||||
|
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
||||||
|
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
||||||
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.confirm.SwapCompleteConfirm;
|
||||||
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.event.SwapComplete;
|
||||||
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
||||||
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.state.OrderStatusData;
|
||||||
|
import com.evotech.hd.cloud.service.*;
|
||||||
|
import com.evotech.hd.cloud.service.rpc.WechatService;
|
||||||
|
import com.evotech.hd.cloud.utils.ParamServiceUtils;
|
||||||
|
import com.evotech.hd.cloud.utils.components.SwapOrderBasicFeeComponent;
|
||||||
|
import com.evotech.hd.common.core.constant.HDConstant;
|
||||||
|
import com.evotech.hd.common.core.entity.cloud.BatteryStationDc;
|
||||||
|
import com.evotech.hd.common.core.entity.cloud.BatteryTrace;
|
||||||
|
import com.evotech.hd.common.core.entity.cloud.VehicleInfo;
|
||||||
|
import com.evotech.hd.common.core.entity.order.Order;
|
||||||
|
import com.evotech.hd.common.core.entity.order.OrderDetail;
|
||||||
|
import com.evotech.hd.common.core.enums.SwapBatteryStepEnum;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 换电完成事件数据
|
||||||
|
*
|
||||||
|
* @ClassName:MqttRequestBatteryInfoExchangeProcessorImpl
|
||||||
|
* @date: 2025年05月19日 17:41
|
||||||
|
* @author: andy.shi
|
||||||
|
* @contact: 17330188597
|
||||||
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MqttEventSwapCompleteExchangeProcessorImpl implements MqttStrategyEventExchangeProcessor {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
OrderService orderService;
|
||||||
|
@Resource
|
||||||
|
OrderDetailService orderDetailService;
|
||||||
|
@Resource
|
||||||
|
private SwapOrderBasicFeeComponent orderBasicFeeComponent;
|
||||||
|
@Resource
|
||||||
|
private OrderSwapBatteryStepService orderSwapBatteryStepService;
|
||||||
|
@Resource
|
||||||
|
private VehicleService vehicleService;
|
||||||
|
@Resource
|
||||||
|
BatteryStationDcService batteryStationDcService;
|
||||||
|
@Resource
|
||||||
|
WechatService wechatService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean accept(String functionName) {
|
||||||
|
return EventFunctionTypesEnum.FUN_ORDEREVENT.getFunction().equals(functionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
|
SwapComplete orderStatus = JSONUtil.toBean(dataBody, SwapComplete.class);
|
||||||
|
OrderStatusData statusData = JSONUtil.toBean(dataBody.getJSONObject("statusData"), OrderStatusData.class);
|
||||||
|
|
||||||
|
MqttResponse<SwapCompleteConfirm> response = new MqttResponse();
|
||||||
|
SwapCompleteConfirm swapRecordConfirm = new SwapCompleteConfirm();
|
||||||
|
try {
|
||||||
|
// 订单状态更新处理
|
||||||
|
handleOrderStatus(orderStatus, statusData);
|
||||||
|
response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
||||||
|
swapRecordConfirm.setAckStatus(MqttResponse.PUBLIC_SUCCESS);
|
||||||
|
swapRecordConfirm.setOrderNo(orderStatus.getOrderNo());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("更新订单信息出现错误: {}", e.getMessage());
|
||||||
|
response.setCode(MqttResponse.PUBLIC_ERROR);
|
||||||
|
response.setMsg(orderStatus.getOrderNo());
|
||||||
|
swapRecordConfirm.setAckStatus(MqttResponse.PUBLIC_ERROR);
|
||||||
|
swapRecordConfirm.setOrderNo(orderStatus.getOrderNo());
|
||||||
|
swapRecordConfirm.setError(e.getMessage());
|
||||||
|
}
|
||||||
|
response.setData(swapRecordConfirm);
|
||||||
|
sendAESMessage(topic, header, EventFunctionTypesEnum.FUN_ORDEREVENT, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单最终状态的更新
|
||||||
|
* @param orderStatus
|
||||||
|
* @param statusData
|
||||||
|
*/
|
||||||
|
private void handleOrderStatus(SwapComplete orderStatus, OrderStatusData statusData) {
|
||||||
|
|
||||||
|
Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderStatus.getOrderNo()));
|
||||||
|
if(ObjectUtils.isEmpty(order)){
|
||||||
|
throw new RuntimeException("未找到订单信息");
|
||||||
|
}
|
||||||
|
//更新订单状态
|
||||||
|
order.setStatus(orderStatus.getStatus());
|
||||||
|
orderService.updateById(order);
|
||||||
|
//修改订单状态及金额
|
||||||
|
alterOrderStatus(order, statusData);
|
||||||
|
//记录换电步骤
|
||||||
|
alterSwapBatteryStep(orderStatus, statusData, order);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单状态方法
|
||||||
|
* @param order
|
||||||
|
* @param statusData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void alterOrderStatus(Order order, OrderStatusData statusData) {
|
||||||
|
if (order.getStatus() == 3 || order.getStatus() == 5) {
|
||||||
|
//如果订单是完成. 查询订单详情
|
||||||
|
OrderDetail orderDetail = orderDetailService.getOne(new LambdaQueryWrapper<OrderDetail>().eq(OrderDetail::getOrderId, order.getPkId()));
|
||||||
|
orderDetail.setFeeType(ParamServiceUtils.getSettlementType());
|
||||||
|
orderDetail.setOrderTimeEnd(new Date());
|
||||||
|
orderDetail.setServiceTimeEnd(new Date());
|
||||||
|
//copy属性
|
||||||
|
BeanUtils.copyProperties(statusData, orderDetail);
|
||||||
|
orderDetail.setRentBatSoc(Double.valueOf(statusData.getRentBatSoc()));
|
||||||
|
orderDetail.setReturnBatSoc(Double.valueOf(statusData.getReturnBatSoc()));
|
||||||
|
switch (orderDetail.getFeeType()){
|
||||||
|
case HDConstant.OrderConstant.FEE_TYPE_DL:
|
||||||
|
orderDetail.setElectricityQuantity(statusData.getElectAmount().doubleValue());
|
||||||
|
break;
|
||||||
|
case HDConstant.OrderConstant.FEE_TYPE_ODO:
|
||||||
|
// orderDetail.setElectricityQuantity(new BigDecimal(statusData.getSoc()).doubleValue());
|
||||||
|
break;
|
||||||
|
case HDConstant.OrderConstant.FEE_TYPE_SOC:
|
||||||
|
default:
|
||||||
|
orderDetail.setElectricityQuantity(new BigDecimal(statusData.getRentBatSoc()).subtract(new BigDecimal(statusData.getReturnBatSoc())).doubleValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//计算费用方式
|
||||||
|
log.info("\r\n=====>>>订单状态更新处理订单状态开始结算:{},{}",order.getOrderNo(),order.getStatus() );
|
||||||
|
//计算费用信息
|
||||||
|
orderBasicFeeComponent.orderBasicFee(order, orderDetail);
|
||||||
|
//发送换电完成推送
|
||||||
|
wechatService.sendGzhSwapOrderSuccessMessage(order);
|
||||||
|
orderService.calculateCost(order);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单费用
|
||||||
|
* @param order
|
||||||
|
* @param statusData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void alterSwapBatteryStep(SwapComplete orderStatus, OrderStatusData statusData, Order order) {
|
||||||
|
if (orderStatus.getStatus() == 3 || orderStatus.getStatus() == 5){
|
||||||
|
//生成步骤
|
||||||
|
orderSwapBatteryStepService.addOrderSwapBatteryStepBySwapComplete(orderStatus.getOrderNo(), SwapBatteryStepEnum.COMPLETED.getKey(), orderStatus.getStatusTime());
|
||||||
|
// 修改车上电池编码
|
||||||
|
vehicleService.update(new UpdateWrapper<VehicleInfo>()
|
||||||
|
.set("bat_code", statusData.getRentBatCode())
|
||||||
|
.set("bat_soc", statusData.getRentBatSoc())
|
||||||
|
.eq("plate_num", order.getPlateNum()));
|
||||||
|
//出租电池信息维护
|
||||||
|
batteryStationDcService.update(new UpdateWrapper<BatteryStationDc>()
|
||||||
|
.set("status", HDConstant.DcConstant.STATUS_CZ)
|
||||||
|
.set("source_from", HDConstant.DcConstant.SOURCE_FROM_STATION)
|
||||||
|
.set("point_type", HDConstant.DcConstant.POINT_TYPE_CAR)
|
||||||
|
.set("point_code", order.getPlateNum())
|
||||||
|
.set("point_name", order.getPlateNum())
|
||||||
|
.set("dcc_no", 0)
|
||||||
|
.eq("bat_code", statusData.getRentBatCode()));
|
||||||
|
//归还电池信息维护
|
||||||
|
batteryStationDcService.update(new UpdateWrapper<BatteryStationDc>()
|
||||||
|
.set("status", HDConstant.DcConstant.STATUS_CD)
|
||||||
|
.set("source_from", HDConstant.DcConstant.SOURCE_FROM_CAR)
|
||||||
|
.set("point_type", HDConstant.DcConstant.POINT_TYPE_STATION)
|
||||||
|
.set("point_code", order.getPlateNum())
|
||||||
|
.set("point_name", order.getPlateNum())
|
||||||
|
.set("soc", statusData.getReturnBatSoc())
|
||||||
|
.set("dcc_no", statusData.getReturnBatNo())
|
||||||
|
.eq("bat_code", statusData.getReturnBatCode()));
|
||||||
|
// 添加2块电池的溯源记录
|
||||||
|
addBatteryTrace(orderStatus, statusData, order);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加电池轨迹记录
|
||||||
|
*
|
||||||
|
* @param orderStatus
|
||||||
|
* @param statusData
|
||||||
|
* @param osb
|
||||||
|
*/
|
||||||
|
private void addBatteryTrace(SwapComplete orderStatus, OrderStatusData statusData, Order osb) {
|
||||||
|
BatteryTrace bt1 = new BatteryTrace();
|
||||||
|
bt1.setOrderNo(orderStatus.getOrderNo());
|
||||||
|
bt1.setBatCode(statusData.getRentBatCode());
|
||||||
|
bt1.setSoc(statusData.getRentBatSoc());
|
||||||
|
bt1.setBeginTime(orderStatus.getStatusTime());
|
||||||
|
bt1.setPointType(2);
|
||||||
|
bt1.setPointCode(osb.getPlateNum());
|
||||||
|
bt1.setPointName(osb.getPlateNum());
|
||||||
|
bt1.setCreater("SYS");
|
||||||
|
BatteryTrace bt2 = new BatteryTrace();
|
||||||
|
BeanUtils.copyProperties(bt1, bt2);
|
||||||
|
bt2.setBatCode(statusData.getReturnBatCode());
|
||||||
|
bt2.setSoc(statusData.getRentBatSoc());
|
||||||
|
bt2.setPointType(1);
|
||||||
|
bt2.setPointCode(osb.getStationCode());
|
||||||
|
bt2.setPointName(osb.getStationName());
|
||||||
|
batteryStationDcService.addTrace(bt1);
|
||||||
|
batteryStationDcService.addTrace(bt2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -11,18 +11,19 @@ import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
|||||||
import com.evotech.hd.cloud.mqtt.message.processor.strategy.MqttStrategyExchangeProcessor;
|
import com.evotech.hd.cloud.mqtt.message.processor.strategy.MqttStrategyExchangeProcessor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MqttStrategyEventExchangeProcessor
|
* 接口
|
||||||
*
|
*
|
||||||
* @author andy.shi
|
* @ClassName:MqttStrategyequestExchangeProcessor
|
||||||
* @ClassName:MqttStrategyEventExchangeProcessor
|
* @date: 2025年06月19日 16:29
|
||||||
* @date: 2025年10月29日 10:41
|
* @author: andy.shi
|
||||||
|
* @contact: 17330188597
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface MqttStrategyEventExchangeProcessor extends MqttStrategyExchangeProcessor {
|
public interface MqttStrategyEventExchangeProcessor extends MqttStrategyExchangeProcessor {
|
||||||
|
|
||||||
|
|
||||||
default void sendAESMessage(MessageTopic topic, MqttMessageHeader header, EventFunctionTypesEnum typesEnum, MqttResponse response){
|
default void sendAESMessage(MessageTopic topic, MqttMessageHeader header, EventFunctionTypesEnum typesEnum, MqttResponse response){
|
||||||
topic.setMessageType(MqttMessageTypeEnum.EVENT.getType());
|
topic.setMessageType(MqttMessageTypeEnum.CONFIRM.getType());
|
||||||
header.setFunction(typesEnum.getReFunction());
|
header.setFunction(typesEnum.getReFunction());
|
||||||
logger.info("\r\n=====>>>回复站端的EVENT消息--MQTT发送到消息主题:{},头部信息:{},message:{}", topic,header, JSONUtil.parseObj(response, new JSONConfig().setDateFormat(DatePattern.NORM_DATETIME_PATTERN)));
|
logger.info("\r\n=====>>>回复站端的EVENT消息--MQTT发送到消息主题:{},头部信息:{},message:{}", topic,header, JSONUtil.parseObj(response, new JSONConfig().setDateFormat(DatePattern.NORM_DATETIME_PATTERN)));
|
||||||
sendAESMessage(topic, header, response);
|
sendAESMessage(topic, header, response);
|
||||||
|
|||||||
@ -1,69 +1,69 @@
|
|||||||
//package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.request;
|
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.request;
|
||||||
//
|
|
||||||
//import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
//import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
//import com.evotech.hd.cloud.mqtt.enums.RequestFunctionTypesEnum;
|
import com.evotech.hd.cloud.mqtt.enums.RequestFunctionTypesEnum;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.dto.newer.req.battery.BatteryData;
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.battery.BatteryData;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.dto.newer.req.battery.BatteryInfoReq;
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.battery.BatteryInfoReq;
|
||||||
//import com.evotech.hd.cloud.service.BatteryStationDcService;
|
import com.evotech.hd.cloud.service.BatteryStationDcService;
|
||||||
//import com.evotech.hd.common.core.constant.HDConstant;
|
import com.evotech.hd.common.core.constant.HDConstant;
|
||||||
//import com.evotech.hd.common.core.entity.cloud.BatteryStationDc;
|
import com.evotech.hd.common.core.entity.cloud.BatteryStationDc;
|
||||||
//import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
//import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
//
|
|
||||||
//import java.util.Collections;
|
import java.util.Collections;
|
||||||
//import java.util.List;
|
import java.util.List;
|
||||||
//import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * 站端请求电池数据
|
* 站端请求电池数据
|
||||||
// *
|
*
|
||||||
// * @ClassName:MqttRequestBatteryInfoExchangeProcessorImpl
|
* @ClassName:MqttRequestBatteryInfoExchangeProcessorImpl
|
||||||
// * @date: 2025年05月19日 17:41
|
* @date: 2025年05月19日 17:41
|
||||||
// * @author: andy.shi
|
* @author: andy.shi
|
||||||
// * @contact: 17330188597
|
* @contact: 17330188597
|
||||||
// * @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
// */
|
*/
|
||||||
//@Service
|
@Service
|
||||||
//@Slf4j
|
@Slf4j
|
||||||
//public class MqttRequestBatteryInfoExchangeProcessorImpl implements MqttStrategyRequestExchangeProcessor {
|
public class MqttRequestBatteryInfoExchangeProcessorImpl implements MqttStrategyRequestExchangeProcessor {
|
||||||
//
|
|
||||||
// @Resource
|
@Resource
|
||||||
// BatteryStationDcService batteryStationDcService;
|
BatteryStationDcService batteryStationDcService;
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public boolean accept(String functionName) {
|
public boolean accept(String functionName) {
|
||||||
// return RequestFunctionTypesEnum.FUN_BATTERYINFO.getFunction().equals(functionName);
|
return RequestFunctionTypesEnum.FUN_BATTERYINFO.getFunction().equals(functionName);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
// BatteryInfoReq batteryInfoReq = JSONUtil.toBean(dataBody, BatteryInfoReq.class);
|
BatteryInfoReq batteryInfoReq = JSONUtil.toBean(dataBody, BatteryInfoReq.class);
|
||||||
// String batCode = batteryInfoReq.getBatCode();
|
String batCode = batteryInfoReq.getBatCode();
|
||||||
// //直接默认为错误
|
//直接默认为错误
|
||||||
// MqttResponse<List<BatteryData>> response = new MqttResponse<List<BatteryData>>().createError(batteryInfoReq.getBatteryInfoRequestId());
|
MqttResponse<List<BatteryData>> response = new MqttResponse<List<BatteryData>>().createError(batteryInfoReq.getBatteryInfoRequestId());
|
||||||
//
|
|
||||||
// List<BatteryStationDc> list = Collections.emptyList();
|
List<BatteryStationDc> list = Collections.emptyList();
|
||||||
// if(org.apache.commons.lang3.StringUtils.isNotEmpty(batCode)){
|
if(org.apache.commons.lang3.StringUtils.isNotEmpty(batCode)){
|
||||||
// list.addAll(batteryStationDcService.list(new LambdaQueryWrapper<BatteryStationDc>().eq(BatteryStationDc::getBatCode, batCode).eq(BatteryStationDc::getDelFlag, HDConstant.DELETE_NO)));
|
list.addAll(batteryStationDcService.list(new LambdaQueryWrapper<BatteryStationDc>().eq(BatteryStationDc::getBatCode, batCode).eq(BatteryStationDc::getDelFlag, HDConstant.DELETE_NO)));
|
||||||
// }else{
|
}else{
|
||||||
// //如果没有电池编号, 则以当前站的电池数据为准
|
//如果没有电池编号, 则以当前站的电池数据为准
|
||||||
// list.addAll(batteryStationDcService.listByStationCode(topic.getStationCode()));
|
list.addAll(batteryStationDcService.listByStationCode(topic.getStationCode()));
|
||||||
// }
|
}
|
||||||
// if(com.evotech.hd.common.core.utils.Collections.isNotEmpty(list)){
|
if(com.evotech.hd.common.core.utils.Collections.isNotEmpty(list)){
|
||||||
// response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
||||||
// response.setData(list.stream().map(x -> new BatteryData(x.getBatCode(), x.getProductionDate(), x.getRegistrationDate())).collect(Collectors.toList()));
|
response.setData(list.stream().map(x -> new BatteryData(x.getBatCode(), x.getProductionDate(), x.getRegistrationDate())).collect(Collectors.toList()));
|
||||||
// }else {
|
}else {
|
||||||
// response.setMsg("未查询到电池信息");
|
response.setMsg("未查询到电池信息");
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// logger.info("\r\n站端请求电池数据: MqttRequestBatteryInfoExchangeProcessorImpl =====>>>message:{}", response.getMsg());
|
logger.info("\r\n站端请求电池数据: MqttRequestBatteryInfoExchangeProcessorImpl =====>>>message:{}", response.getMsg());
|
||||||
// sendAESMessage(topic, header, RequestFunctionTypesEnum.FUN_BATTERYINFO, response);
|
sendAESMessage(topic, header, RequestFunctionTypesEnum.FUN_BATTERYINFO, response);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//}
|
}
|
||||||
|
|||||||
@ -13,14 +13,17 @@ import com.evotech.hd.cloud.service.OrderService;
|
|||||||
import com.evotech.hd.cloud.service.rpc.WechatService;
|
import com.evotech.hd.cloud.service.rpc.WechatService;
|
||||||
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
||||||
import com.evotech.hd.common.core.entity.order.Order;
|
import com.evotech.hd.common.core.entity.order.Order;
|
||||||
|
import com.evotech.hd.common.core.entity.order.OrderDetail;
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
import com.evotech.hd.common.core.utils.Collections;
|
||||||
import com.evotech.hd.common.redis.utils.RedisServiceUtils;
|
import com.evotech.hd.common.redis.utils.RedisServiceUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 换电信息--站端回复开始换电通知信息类
|
* 站端回复开始换电通知信息类
|
||||||
*
|
*
|
||||||
* @ClassName:MqttRequestBatterySwapExchangeProcessorImpl
|
* @ClassName:MqttRequestBatterySwapExchangeProcessorImpl
|
||||||
* @date: 2025年06月20日 11:29
|
* @date: 2025年06月20日 11:29
|
||||||
@ -64,7 +67,11 @@ public class MqttRequestBatterySwapExchangeProcessorImpl implements MqttStrategy
|
|||||||
Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderNo));
|
Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderNo));
|
||||||
//如果是成功, 创建订单详情
|
//如果是成功, 创建订单详情
|
||||||
if(MqttResponse.PUBLIC_SUCCESS.equals(battery.getCode())){
|
if(MqttResponse.PUBLIC_SUCCESS.equals(battery.getCode())){
|
||||||
orderDetailService.addOrderDetailByOrder(order.getPkId());
|
OrderDetail detail = new OrderDetail();
|
||||||
|
detail.setOrderId(order.getPkId());
|
||||||
|
detail.setServiceTimeBegin(new Date());
|
||||||
|
detail.setOrderTimeBegin(new Date());
|
||||||
|
orderDetailService.save(detail);
|
||||||
}else{
|
}else{
|
||||||
wechatService.sendClientMessage(order.getPreWechatId(), JSON.toJSONString(Collections.asMap("code",0, "msg", battery.getMsg())));
|
wechatService.sendClientMessage(order.getPreWechatId(), JSON.toJSONString(Collections.asMap("code",0, "msg", battery.getMsg())));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消订单--取消订单请求类
|
* 取消订单请求类
|
||||||
* @ClassName:MqttRequestCancelOrderExchangeProcessorImpl
|
* @ClassName:MqttRequestCancelOrderExchangeProcessorImpl
|
||||||
* @date: 2025年05月19日 14:51
|
* @date: 2025年05月19日 14:51
|
||||||
* @author: andy.shi
|
* @author: andy.shi
|
||||||
|
|||||||
@ -1,73 +1,73 @@
|
|||||||
//package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.request;
|
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.request;
|
||||||
//
|
|
||||||
//import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
//import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
//import com.evotech.hd.cloud.dao.VehicleWechatUserRelationDao;
|
import com.evotech.hd.cloud.dao.VehicleWechatUserRelationDao;
|
||||||
//import com.evotech.hd.cloud.mqtt.enums.RequestFunctionTypesEnum;
|
import com.evotech.hd.cloud.mqtt.enums.RequestFunctionTypesEnum;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.MqttResponse;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.dto.newer.req.carinfo.CarInfoReq;
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.carinfo.CarInfoReq;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.dto.newer.req.carinfo.VehicleData;
|
import com.evotech.hd.cloud.mqtt.message.dto.newer.req.carinfo.VehicleData;
|
||||||
//import com.evotech.hd.common.core.entity.cloud.VehicleWechatUserRelation;
|
import com.evotech.hd.common.core.entity.cloud.VehicleWechatUserRelation;
|
||||||
//import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
//import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
//import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
//import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
//
|
|
||||||
//import java.util.List;
|
import java.util.List;
|
||||||
//import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * 站端请求车辆信息
|
* 站端请求车辆信息
|
||||||
// * @ClassName:MqttRequestCarInfoExchangeProcessorImpl
|
* @ClassName:MqttRequestCarInfoExchangeProcessorImpl
|
||||||
// * @date: 2025年06月19日 11:21
|
* @date: 2025年06月19日 11:21
|
||||||
// * @author: andy.shi
|
* @author: andy.shi
|
||||||
// * @contact: 17330188597
|
* @contact: 17330188597
|
||||||
// * @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
// */
|
*/
|
||||||
//@Service
|
@Service
|
||||||
//@Slf4j
|
@Slf4j
|
||||||
//public class MqttRequestCarInfoExchangeProcessorImpl implements MqttStrategyRequestExchangeProcessor {
|
public class MqttRequestCarInfoExchangeProcessorImpl implements MqttStrategyRequestExchangeProcessor {
|
||||||
//
|
|
||||||
// @Resource
|
@Resource
|
||||||
// private VehicleWechatUserRelationDao vehicleWechatUserRelationDao;
|
private VehicleWechatUserRelationDao vehicleWechatUserRelationDao;
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public boolean accept(String functionName) {
|
public boolean accept(String functionName) {
|
||||||
// return RequestFunctionTypesEnum.FUN_CARINFO.getFunction().equals(functionName);
|
return RequestFunctionTypesEnum.FUN_CARINFO.getFunction().equals(functionName);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
// CarInfoReq carInfoReq = JSONUtil.toBean(dataBody, CarInfoReq.class);
|
CarInfoReq carInfoReq = JSONUtil.toBean(dataBody, CarInfoReq.class);
|
||||||
// //直接默认为错误
|
//直接默认为错误
|
||||||
// MqttResponse<List<VehicleData>> response = new MqttResponse<List<VehicleData>>().createError(carInfoReq.getCarInfoRequestId());
|
MqttResponse<List<VehicleData>> response = new MqttResponse<List<VehicleData>>().createError(carInfoReq.getCarInfoRequestId());
|
||||||
// String plateNum = carInfoReq.getPlateNum();
|
String plateNum = carInfoReq.getPlateNum();
|
||||||
// if(StringUtils.isEmpty(plateNum)){
|
if(StringUtils.isEmpty(plateNum)){
|
||||||
// response.setMsg("没有车牌号参数");
|
response.setMsg("没有车牌号参数");
|
||||||
// }else{
|
}else{
|
||||||
// List<VehicleWechatUserRelation> list = vehicleWechatUserRelationDao.selectList(new LambdaQueryWrapper<VehicleWechatUserRelation>().eq( VehicleWechatUserRelation::getPlateNum, plateNum));
|
List<VehicleWechatUserRelation> list = vehicleWechatUserRelationDao.selectList(new LambdaQueryWrapper<VehicleWechatUserRelation>().eq( VehicleWechatUserRelation::getPlateNum, plateNum));
|
||||||
// if(com.evotech.hd.common.core.utils.Collections.isNotEmpty(list)){
|
if(com.evotech.hd.common.core.utils.Collections.isNotEmpty(list)){
|
||||||
// response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
||||||
// response.setData(list.stream().map(x->convertVehicleData(x)).collect(Collectors.toList()));
|
response.setData(list.stream().map(x->convertVehicleData(x)).collect(Collectors.toList()));
|
||||||
// }else {
|
}else {
|
||||||
// response.setMsg("未查询到车辆信息");
|
response.setMsg("未查询到车辆信息");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// logger.info("\r\n站端请求车辆信息: MqttRequestCarInfoExchangeProcessorImpl =====>>>message:{}", response.getMsg());
|
logger.info("\r\n站端请求车辆信息: MqttRequestCarInfoExchangeProcessorImpl =====>>>message:{}", response.getMsg());
|
||||||
// sendAESMessage(topic, header, RequestFunctionTypesEnum.FUN_CARINFO, response);
|
sendAESMessage(topic, header, RequestFunctionTypesEnum.FUN_CARINFO, response);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
// public static VehicleData convertVehicleData(VehicleWechatUserRelation data){
|
public static VehicleData convertVehicleData(VehicleWechatUserRelation data){
|
||||||
// VehicleData vd = new VehicleData();
|
VehicleData vd = new VehicleData();
|
||||||
// BeanUtils.copyProperties(data, vd);
|
BeanUtils.copyProperties(data, vd);
|
||||||
// return vd;
|
return vd;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
//}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预约订单--站端请求创建预约单类
|
* 站端请求创建预约单类
|
||||||
*
|
*
|
||||||
* @ClassName:MqttRequestPreOrderExchangeProcessorImpl
|
* @ClassName:MqttRequestPreOrderExchangeProcessorImpl
|
||||||
* @date: 2025年05月19日 17:41
|
* @date: 2025年05月19日 17:41
|
||||||
@ -42,7 +42,7 @@ public class MqttRequestPreOrderExchangeProcessorImpl implements MqttStrategyReq
|
|||||||
@Override
|
@Override
|
||||||
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
OrderSwapBatteryPre orderSwapBatteryPre = JSONUtil.toBean(dataBody, OrderSwapBatteryPre.class);
|
OrderSwapBatteryPre orderSwapBatteryPre = JSONUtil.toBean(dataBody, OrderSwapBatteryPre.class);
|
||||||
MqttResponse response = new MqttResponse().error("");
|
MqttResponse response = new MqttResponse().createError(orderSwapBatteryPre.getSourceId());
|
||||||
// 1. 基础字段校验
|
// 1. 基础字段校验
|
||||||
if (validateRequiredFields(orderSwapBatteryPre)) {
|
if (validateRequiredFields(orderSwapBatteryPre)) {
|
||||||
response.setMsg("预约信息不完整");
|
response.setMsg("预约信息不完整");
|
||||||
@ -55,7 +55,6 @@ public class MqttRequestPreOrderExchangeProcessorImpl implements MqttStrategyReq
|
|||||||
// 创建预约单信息
|
// 创建预约单信息
|
||||||
orderSwapBatteryPre.setUcode(wechatUser.getWuid());
|
orderSwapBatteryPre.setUcode(wechatUser.getWuid());
|
||||||
orderSwapBatteryPre.setSource(3);
|
orderSwapBatteryPre.setSource(3);
|
||||||
orderSwapBatteryPre.setStationCode(topic.getStationCode());
|
|
||||||
Result<Boolean> integerResult = orderSwapBatteryPreService.addOrderSwapBatteryPre(orderSwapBatteryPre);
|
Result<Boolean> integerResult = orderSwapBatteryPreService.addOrderSwapBatteryPre(orderSwapBatteryPre);
|
||||||
//检查结果
|
//检查结果
|
||||||
if (integerResult.getData()){
|
if (integerResult.getData()){
|
||||||
@ -86,12 +85,12 @@ public class MqttRequestPreOrderExchangeProcessorImpl implements MqttStrategyReq
|
|||||||
return Stream.of(
|
return Stream.of(
|
||||||
order.getPlateNum(),
|
order.getPlateNum(),
|
||||||
order.getPhone(),
|
order.getPhone(),
|
||||||
// order.getStationCode(),
|
order.getStationCode(),
|
||||||
// order.getStationName(),
|
order.getStationName(),
|
||||||
order.getUname()
|
order.getUname(),
|
||||||
// order.getSwapDay(),
|
order.getSwapDay(),
|
||||||
// order.getSwapDuration(),
|
order.getSwapDuration(),
|
||||||
// order.getReservationTime()
|
order.getReservationTime()
|
||||||
).anyMatch(StrUtil::isBlankIfStr);
|
).anyMatch(StrUtil::isBlankIfStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化车辆和预约单--接收站端推送的车牌照, 创建车辆信息和预约单
|
* 接收站端推送的车牌照, 创建车辆信息和预约单
|
||||||
*
|
*
|
||||||
* @ClassName:MqttRequestPushCarCreateMakeAppointmentExchangeProcessorImpl
|
* @ClassName:MqttRequestPushCarCreateMakeAppointmentExchangeProcessorImpl
|
||||||
* @date: 2025年04月30日 15:34
|
* @date: 2025年04月30日 15:34
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import com.evotech.hd.common.core.entity.order.Order;
|
|||||||
import com.evotech.hd.common.core.enums.CodeMsg;
|
import com.evotech.hd.common.core.enums.CodeMsg;
|
||||||
import com.evotech.hd.common.core.enums.OrderStatusEnums;
|
import com.evotech.hd.common.core.enums.OrderStatusEnums;
|
||||||
import com.evotech.hd.common.core.enums.SwapBatteryStepEnum;
|
import com.evotech.hd.common.core.enums.SwapBatteryStepEnum;
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import com.evotech.hd.common.redis.utils.RedisServiceUtils;
|
import com.evotech.hd.common.redis.utils.RedisServiceUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -31,7 +30,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单--站端根据车牌号查询订单
|
* 站端根据车牌号查询订单
|
||||||
*
|
*
|
||||||
* @ClassName:MqttRequestQueryOrderExchangeProcessorImpl
|
* @ClassName:MqttRequestQueryOrderExchangeProcessorImpl
|
||||||
* @date: 2025年05月19日 17:41
|
* @date: 2025年05月19日 17:41
|
||||||
@ -73,7 +72,7 @@ public class MqttRequestQueryOrderExchangeProcessorImpl implements MqttStrategyR
|
|||||||
.eq(Order::getPlateNum, orderSwapBatteryPre.getPlateNum())
|
.eq(Order::getPlateNum, orderSwapBatteryPre.getPlateNum())
|
||||||
.eq(Order::getStationCode, orderSwapBatteryPre.getStationCode())
|
.eq(Order::getStationCode, orderSwapBatteryPre.getStationCode())
|
||||||
.eq(Order::getOrderPreId, orderSwapBatteryPre.getPkId())
|
.eq(Order::getOrderPreId, orderSwapBatteryPre.getPkId())
|
||||||
.in(Order::getStatus, Collections.asList(OrderStatusEnums.CREATE.getCode(), OrderStatusEnums.SWAP.getCode())));
|
.eq(Order::getStatus, OrderStatusEnums.CREATE.getCode()));
|
||||||
if (ObjectUtils.isNotEmpty(order)) {
|
if (ObjectUtils.isNotEmpty(order)) {
|
||||||
response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
response.setCode(MqttResponse.PUBLIC_SUCCESS);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import org.springframework.util.StringUtils;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电策略--Mqtt查询充电策略
|
* Mqtt查询充电策略
|
||||||
* @ClassName:StrategyMqttMessageRequestExchangeProcessorImpl
|
* @ClassName:StrategyMqttMessageRequestExchangeProcessorImpl
|
||||||
* @date: 2025年04月08日 11:36
|
* @date: 2025年04月08日 11:36
|
||||||
* @author: andy.shi
|
* @author: andy.shi
|
||||||
|
|||||||
@ -1,42 +1,42 @@
|
|||||||
//package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.state;
|
package com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.state;
|
||||||
//
|
|
||||||
//import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
//import com.evotech.hd.cloud.dao.OrderSwapBatteryStepDao;
|
import com.evotech.hd.cloud.dao.OrderSwapBatteryStepDao;
|
||||||
//import com.evotech.hd.cloud.mqtt.enums.StateFunctionTypesEnum;
|
import com.evotech.hd.cloud.mqtt.enums.StateFunctionTypesEnum;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
||||||
//import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
import com.evotech.hd.cloud.mqtt.message.MqttMessageHeader;
|
||||||
//import com.evotech.hd.cloud.utils.components.HDStepDictComponent;
|
import com.evotech.hd.cloud.utils.components.HDStepDictComponent;
|
||||||
//import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
//import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * 站端反馈订单状态
|
* 站端反馈订单状态
|
||||||
// *
|
*
|
||||||
// * @ClassName:MqttStateSwapStepDataExchangeProcessor
|
* @ClassName:MqttStateSwapStepDataExchangeProcessor
|
||||||
// * @date: 2025年04月29日 13:26
|
* @date: 2025年04月29日 13:26
|
||||||
// * @author: andy.shi
|
* @author: andy.shi
|
||||||
// * @contact: 17330188597
|
* @contact: 17330188597
|
||||||
// * @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
// */
|
*/
|
||||||
//@Slf4j
|
@Slf4j
|
||||||
//@Service
|
@Service
|
||||||
//public class MqttStateOrderStatusDataExchangeProcessor implements MqttStrategyStateExchangeProcessor {
|
public class MqttStateOrderStatusDataExchangeProcessor implements MqttStrategyStateExchangeProcessor {
|
||||||
//
|
|
||||||
// @Resource
|
@Resource
|
||||||
// private HDStepDictComponent hdStepDictComponent;
|
private HDStepDictComponent hdStepDictComponent;
|
||||||
// @Resource
|
@Resource
|
||||||
// private OrderSwapBatteryStepDao orderSwapBatteryStepDao;
|
private OrderSwapBatteryStepDao orderSwapBatteryStepDao;
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public boolean accept(String functionName) {
|
public boolean accept(String functionName) {
|
||||||
// return StateFunctionTypesEnum.FUN_ORDERSTATUS.getFunction().equals(functionName);
|
return StateFunctionTypesEnum.FUN_ORDERSTATUS.getFunction().equals(functionName);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
//// OrderStatus orderStatus = JSONUtil.toBean(dataBody, OrderStatus.class);
|
// OrderStatus orderStatus = JSONUtil.toBean(dataBody, OrderStatus.class);
|
||||||
//// OrderStatusData statusData = JSONUtil.toBean(dataBody.getJSONObject("statusData"), OrderStatusData.class);
|
// OrderStatusData statusData = JSONUtil.toBean(dataBody.getJSONObject("statusData"), OrderStatusData.class);
|
||||||
// log.info("\r\n=====>>>站端反馈订单状态--MQTT收到消息主题:{},换电步骤名称:{}",topic, dataBody.toString());
|
log.info("\r\n=====>>>站端反馈订单状态--MQTT收到消息主题:{},换电步骤名称:{}",topic, dataBody.toString());
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|||||||
@ -50,11 +50,16 @@ public class MqttStateSwapStepDataExchangeProcessor implements MqttStrategyState
|
|||||||
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
public void exchange(MessageTopic topic, MqttMessageHeader header, JSONObject dataBody) {
|
||||||
SwapStep swapStep = JSONUtil.toBean(dataBody, SwapStep.class);
|
SwapStep swapStep = JSONUtil.toBean(dataBody, SwapStep.class);
|
||||||
// 记录换电步骤
|
// 记录换电步骤
|
||||||
|
// OrderSwapBatteryStep step = new OrderSwapBatteryStep();
|
||||||
|
// BeanUtils.copyProperties(swapStep, step);
|
||||||
|
// step.setCtime(new Date());
|
||||||
|
// step.setCreater("SYS");
|
||||||
|
// step.setStepName(hdStepDictComponent.hdStepDictName(step.getStep()));
|
||||||
log.info("\r\n=====>>>站端反馈换电步骤--MQTT收到消息主题:{},换电步骤名称:{}",topic, hdStepDictComponent.hdStepDictName(swapStep.getStep()));
|
log.info("\r\n=====>>>站端反馈换电步骤--MQTT收到消息主题:{},换电步骤名称:{}",topic, hdStepDictComponent.hdStepDictName(swapStep.getStep()));
|
||||||
if(orderSwapBatteryStepService.addOrderSwapBatteryStepBySwapComplete(swapStep.getOrderNo(), swapStep.getStep(), swapStep.getStepTime())){
|
if(orderSwapBatteryStepService.addOrderSwapBatteryStepBySwapComplete(swapStep.getOrderNo(), swapStep.getStep(), swapStep.getStepTime())){
|
||||||
Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, swapStep.getOrderNo()).eq(Order::getDelFlag, HDConstant.DELETE_NO));
|
Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, swapStep.getOrderNo()).eq(Order::getDelFlag, HDConstant.DELETE_NO));
|
||||||
//发送通知到指定客户端
|
//发送通知到指定客户端
|
||||||
wechatService.sendClientMessage(order.getPreWechatId(), JSON.toJSONString(orderSwapBatteryStepService.list(new LambdaQueryWrapper<OrderSwapBatteryStep>().eq(OrderSwapBatteryStep::getOrderNo, order.getOrderNo()).orderByAsc(OrderSwapBatteryStep::getStep))));
|
wechatService.sendClientMessage(order.getPreWechatId(), JSON.toJSONString(orderSwapBatteryStepService.list(new LambdaQueryWrapper<OrderSwapBatteryStep>().eq(OrderSwapBatteryStep::getOrderNo, order.getOrderNo()).orderByAsc(OrderSwapBatteryStep::getStepTime))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类
|
|
||||||
*
|
|
||||||
* @ClassName:OpenParams
|
|
||||||
* @date: 2025年08月19日 15:10
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class OpenParams {
|
|
||||||
|
|
||||||
private String stationCode;
|
|
||||||
private String sign;
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open;
|
|
||||||
|
|
||||||
import cn.hutool.crypto.SecureUtil;
|
|
||||||
import cn.hutool.crypto.asymmetric.Sign;
|
|
||||||
import cn.hutool.crypto.asymmetric.SignAlgorithm;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StrategyFactory;
|
|
||||||
import com.evotech.hd.cloud.service.BatteryStationSecretKeyService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.constant.HDConstant;
|
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类
|
|
||||||
*
|
|
||||||
* @ClassName:OpenStationController
|
|
||||||
* @date: 2025年08月19日 15:07
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/open/station")
|
|
||||||
public class OpenStationController {
|
|
||||||
@Autowired
|
|
||||||
BatteryStationSecretKeyService batteryStationSecretKeyService;
|
|
||||||
@Autowired
|
|
||||||
private StrategyFactory strategyFactory;
|
|
||||||
|
|
||||||
@PostMapping("/message")
|
|
||||||
public Result message(@Valid @RequestBody OpenParams params){
|
|
||||||
Map<String, String> secretKeyMap = batteryStationSecretKeyService.getStationSecretKeyByStationCode(params.getStationCode());
|
|
||||||
if(Collections.isEmpty(secretKeyMap)){
|
|
||||||
return Result.getInstance().error("未找到当前站端的秘钥信息");
|
|
||||||
}
|
|
||||||
Sign verifier = SecureUtil.sign(SignAlgorithm.SHA256withRSA, null, secretKeyMap.get(HDConstant.PUBLIC_KEY));
|
|
||||||
if(!verifier.verify(params.getData().getBytes(), Base64.getDecoder().decode(params.getSign()))){
|
|
||||||
return Result.getInstance().error("当前信息已被篡改");
|
|
||||||
}
|
|
||||||
return strategyFactory.exchange(JSONObject.parseObject(params.getData()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站控消息处理接口
|
|
||||||
*
|
|
||||||
* @ClassName:StationMessageStrategyExchangeProcessor
|
|
||||||
* @date: 2025年08月20日 10:16
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface StationMessageStrategyExchangeProcessor {
|
|
||||||
|
|
||||||
default boolean accept(String method){
|
|
||||||
return getMethod().stream().filter(data-> data.equalsIgnoreCase(method)).count() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 默认读取子类除exchange 以外 所有的method
|
|
||||||
* 可以继承复写
|
|
||||||
* 如 StationRunningStatusProcessor 子类之有一个exchange 可以复写
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
default List<String> getMethod(){
|
|
||||||
return Arrays.stream(this.getClass().getMethods()).filter(data-> !data.getName().equalsIgnoreCase("exchange")).map(data -> data.getName()).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 默认读取子类除exchange 以外 所有的method
|
|
||||||
* 可以继承复写
|
|
||||||
* 如 StationRunningStatusProcessor 子类之有一个exchange 可以复写
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
default Result exchange(JSONObject json) throws Exception{
|
|
||||||
Method method = this.getClass().getMethod(json.getString("method"), JSONObject.class);
|
|
||||||
return (Result) method.invoke(this, json);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类
|
|
||||||
*
|
|
||||||
* @ClassName:StrategyFactory
|
|
||||||
* @date: 2025年08月21日 14:11
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.evotech.hd.cloud.entity.MessageMqtt;
|
|
||||||
import com.evotech.hd.cloud.service.MessageMqttService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.springframework.beans.BeansException;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.ApplicationContextAware;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 策略工厂
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class StrategyFactory implements InitializingBean, ApplicationContextAware {
|
|
||||||
|
|
||||||
private ApplicationContext applicationContext;
|
|
||||||
|
|
||||||
private static final Map<String, StationMessageStrategyExchangeProcessor> CONTEXT = new HashMap<>();
|
|
||||||
|
|
||||||
private static MessageMqttService messageMqttService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
|
||||||
this.applicationContext = applicationContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterPropertiesSet(){
|
|
||||||
// 手动将所有实现注册到工厂容器
|
|
||||||
applicationContext.getBeansOfType(StationMessageStrategyExchangeProcessor.class)
|
|
||||||
.values()
|
|
||||||
.forEach(exchange -> CONTEXT.putIfAbsent(exchange.getClass().getSimpleName().toLowerCase(), exchange));
|
|
||||||
messageMqttService = applicationContext.getBean(MessageMqttService.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Result exchange(JSONObject json) {
|
|
||||||
try {
|
|
||||||
StationMessageStrategyExchangeProcessor processor = CONTEXT.get(json.getString("class").toLowerCase());
|
|
||||||
log(json);
|
|
||||||
if (ObjectUtils.isEmpty(processor)){
|
|
||||||
return Result.getInstance().error("当前接口不存在");
|
|
||||||
}
|
|
||||||
if(processor.accept(json.getString("method"))){
|
|
||||||
return processor.exchange(json);
|
|
||||||
}
|
|
||||||
return Result.getInstance().error("当前method不存在");
|
|
||||||
} catch (Exception e) {
|
|
||||||
Throwable realException = e.getCause();
|
|
||||||
if(realException != null){
|
|
||||||
realException.printStackTrace();
|
|
||||||
}// 获取实际的异常
|
|
||||||
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.getInstance().error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void log(JSONObject json){
|
|
||||||
MessageMqtt messageMqtt = new MessageMqtt();
|
|
||||||
messageMqtt.setStationCode(json.getString("stationCode"));
|
|
||||||
messageMqtt.setDirection("M2S");
|
|
||||||
messageMqtt.setType("WEB站控推送");
|
|
||||||
messageMqtt.setMessageFunction(json.getString("method"));
|
|
||||||
messageMqtt.setTopic(json.getString("class"));
|
|
||||||
messageMqtt.setContent(json.toJSONString());
|
|
||||||
messageMqttService.add(messageMqtt);
|
|
||||||
}
|
|
||||||
// public void
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.evotech.hd.cloud.mqtt.enums.StateFunctionTypesEnum;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StationMessageStrategyExchangeProcessor;
|
|
||||||
import com.evotech.hd.cloud.service.BatteryStationService;
|
|
||||||
import com.evotech.hd.common.constant.MongoConstant;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import com.evotech.hd.common.documnet.StationState;
|
|
||||||
import com.evotech.hd.common.service.MongoDBService;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 告警信息处理类
|
|
||||||
*
|
|
||||||
* @ClassName:AlarmProcessor
|
|
||||||
* @date: 2025年08月23日 14:58
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class AlarmProcessor implements StationMessageStrategyExchangeProcessor {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
BatteryStationService batteryStationService;
|
|
||||||
@Resource
|
|
||||||
MongoDBService mongoDBService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getMethod() {
|
|
||||||
return Collections.asList("alarmMessage");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result exchange(JSONObject json) {
|
|
||||||
// BatteryStation batteryStation = batteryStationDao.selectOne(new LambdaQueryWrapper<BatteryStation>().eq(BatteryStation::getCode, json.getString("stationCode")), false);
|
|
||||||
try {
|
|
||||||
/***
|
|
||||||
* state: 获取运行状态 1-运营;2-调试;3-检修;
|
|
||||||
* smoke: 获取烟感告警信号, 多个烟感状态,分割, 每个代表一个烟感的状态 0-未知;1-正常;2-告警
|
|
||||||
* fire: 获取消防告警信号 0-未知;1-正常;2-告警
|
|
||||||
*/
|
|
||||||
batteryStationService.updateStatusByAlarm(json.getString("stationCode"), json.getInteger("state"), json.getString("smoke"), json.getInteger("fire"));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("更改云端数据信息出错"+e.getMessage());
|
|
||||||
}finally {
|
|
||||||
StationState document = new StationState(json.toJSONString());
|
|
||||||
document.setId(String.valueOf(System.currentTimeMillis()));
|
|
||||||
document.setStationCode(json.getString("stationCode"));
|
|
||||||
mongoDBService.save(MongoConstant.STATION_INFO_BASE, StateFunctionTypesEnum.FUN_STATION_STATE.getFunction(), document);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return Result.getInstance().build(Boolean.class).success(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StationMessageStrategyExchangeProcessor;
|
|
||||||
import com.evotech.hd.cloud.service.BatteryStationCdStrategyDetailService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BatteryStrategyProcessor
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:BatteryStrategyProcessor
|
|
||||||
* @date: 2025年09月28日 9:18
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BatteryStrategyProcessor implements StationMessageStrategyExchangeProcessor {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
BatteryStationCdStrategyDetailService batteryStationCdStrategyDetailService;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 推送策略
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result receiveStationStrategy(JSONObject json){
|
|
||||||
return batteryStationCdStrategyDetailService.addBatteryStationCdStrategyDetailByCloud(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StationMessageStrategyExchangeProcessor;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BatteryStrategyProcessor
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:BatteryStrategyProcessor
|
|
||||||
* @date: 2025年09月28日 9:18
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class KeepaliveProcessor implements StationMessageStrategyExchangeProcessor {
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 心跳检查
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result keepalive(JSONObject json){
|
|
||||||
return Result.getInstance().build(Boolean.class).success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.evotech.hd.cloud.dao.BatteryStationDao;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StationMessageStrategyExchangeProcessor;
|
|
||||||
import com.evotech.hd.cloud.service.OrderSwapBatteryPreService;
|
|
||||||
import com.evotech.hd.cloud.service.WechatUserService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.BatteryStation;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
|
||||||
import com.evotech.hd.common.core.entity.wechat.WechatUser;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站端新增预约订单
|
|
||||||
*
|
|
||||||
* @ClassName:AddOrderSwapBatteryPreProcessor
|
|
||||||
* @date: 2025年08月20日 15:56
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class OrderSwapBatteryPreProcessor implements StationMessageStrategyExchangeProcessor {
|
|
||||||
@Resource
|
|
||||||
WechatUserService wechatUserService;
|
|
||||||
@Resource
|
|
||||||
private BatteryStationDao batteryStationDao;
|
|
||||||
@Resource
|
|
||||||
OrderSwapBatteryPreService orderSwapBatteryPreService;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 取消预约单, 禁止删除, 反射调用
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result orderSwapBatteryPreUpdateStatus(JSONObject json){
|
|
||||||
return orderSwapBatteryPreService.updateStatusById(json.getInteger("pkId"), json.getInteger("status"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 新增预约单 禁止删除, 反射调用
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result orderSwapBatteryPreAdd(JSONObject json){
|
|
||||||
BatteryStation batteryStation = batteryStationDao.selectOne(new LambdaQueryWrapper<BatteryStation>().eq(BatteryStation::getCode, json.getString("stationCode")), false);
|
|
||||||
if(ObjectUtils.isEmpty(batteryStation)){
|
|
||||||
return Result.getInstance().error("未找到站点信息, 站端编码异常");
|
|
||||||
}
|
|
||||||
OrderSwapBatteryPre orderSwapBatteryPre = JSONObject.parseObject(json.toJSONString(), OrderSwapBatteryPre.class);
|
|
||||||
//添加预约单
|
|
||||||
WechatUser wechatUser =wechatUserService.selectUcode(orderSwapBatteryPre.getPhone(),orderSwapBatteryPre.getUname());
|
|
||||||
if(ObjectUtils.isEmpty(wechatUser)){
|
|
||||||
return Result.getInstance().error("未找到预约人信息");
|
|
||||||
}
|
|
||||||
orderSwapBatteryPre.setUcode(wechatUser.getWuid());
|
|
||||||
orderSwapBatteryPre.setUname(wechatUser.getName());
|
|
||||||
orderSwapBatteryPre.setSourceId(String.valueOf(batteryStation.getPkId()));
|
|
||||||
Result<Boolean> saveResult = orderSwapBatteryPreService.addOrderSwapBatteryPre(orderSwapBatteryPre);
|
|
||||||
if(saveResult.getData()){
|
|
||||||
return Result.getInstance().build(JSONObject.class).success(JSONObject.parseObject(JSONObject.toJSONString(orderSwapBatteryPre)));
|
|
||||||
}
|
|
||||||
return Result.getInstance().build(JSONObject.class).error(saveResult.getMsg());
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 查询预约单, 禁止删除, 反射调用
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result findOrderSwapBatteryPre(JSONObject json){
|
|
||||||
try {
|
|
||||||
Date limitDate = json.getDate("limitDate");
|
|
||||||
LambdaQueryWrapper<OrderSwapBatteryPre> query = new LambdaQueryWrapper<OrderSwapBatteryPre>().eq(OrderSwapBatteryPre::getStationCode, json.getString("stationCode")).eq(OrderSwapBatteryPre::getStatus,1).ne(OrderSwapBatteryPre::getSource,3);
|
|
||||||
if(limitDate != null){
|
|
||||||
query.apply(" DATE_FORMAT(reservation_time,'%Y-%m-%d') >= {0}", DateFormatUtils.format(limitDate, "yyyy-MM-dd"));
|
|
||||||
}
|
|
||||||
List<OrderSwapBatteryPre> orderSwapBatteryPre = orderSwapBatteryPreService.list(query);
|
|
||||||
return Result.getInstance().build(JSONArray.class).success((JSONArray)JSONArray.toJSON(orderSwapBatteryPre));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.getInstance().build(JSONObject.class).error("查询云端预约单信息失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor.impl;
|
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.MessageTopic;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.event.SwapComplete;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.state.OrderStatusData;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.confirm.MqttConfirmSwapCompleteExchangeProcessorImpl;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.processor.strategy.impl.state.MqttStateSwapStepDataExchangeProcessor;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StationMessageStrategyExchangeProcessor;
|
|
||||||
import com.evotech.hd.cloud.service.OrderDetailService;
|
|
||||||
import com.evotech.hd.cloud.service.OrderService;
|
|
||||||
import com.evotech.hd.cloud.service.OrderSwapBatteryPreService;
|
|
||||||
import com.evotech.hd.cloud.service.OrderSwapBatteryStepService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.Dto.ResultUtil;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
|
||||||
import com.evotech.hd.common.core.entity.order.Order;
|
|
||||||
import com.evotech.hd.common.core.enums.OrderStatusEnums;
|
|
||||||
import com.evotech.hd.common.core.enums.SwapBatteryStepEnum;
|
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import com.evotech.hd.common.redis.utils.RedisServiceUtils;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 换电订单类
|
|
||||||
*
|
|
||||||
* @ClassName:OrderSwapProcessor
|
|
||||||
* @date: 2025年08月21日 13:19
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class OrderSwapProcessor implements StationMessageStrategyExchangeProcessor {
|
|
||||||
@Resource
|
|
||||||
OrderSwapBatteryPreService orderSwapBatteryPreService;
|
|
||||||
@Resource
|
|
||||||
OrderService orderService;
|
|
||||||
@Resource
|
|
||||||
OrderDetailService orderDetailService;
|
|
||||||
@Resource
|
|
||||||
private OrderSwapBatteryStepService orderSwapBatteryStepService;
|
|
||||||
@Resource
|
|
||||||
private MqttStateSwapStepDataExchangeProcessor mqttStateSwapStepDataExchangeProcessor;
|
|
||||||
@Resource
|
|
||||||
private MqttConfirmSwapCompleteExchangeProcessorImpl mqttEventSwapCompleteExchangeProcessorImpl;
|
|
||||||
/***
|
|
||||||
* 新增换电单 禁止删除, 反射调用
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result orderSwapAdd(JSONObject json){
|
|
||||||
String errorMsg = "";
|
|
||||||
OrderSwapBatteryPre orderSwapBatteryPre = orderSwapBatteryPreService.getById(json.getInteger("preId"));
|
|
||||||
Order order = orderService.getOne(new LambdaQueryWrapper<Order>()
|
|
||||||
.eq(Order::getPlateNum, orderSwapBatteryPre.getPlateNum())
|
|
||||||
.eq(Order::getStationCode, orderSwapBatteryPre.getStationCode())
|
|
||||||
.eq(Order::getOrderPreId, orderSwapBatteryPre.getPkId())
|
|
||||||
.in(Order::getStatus, Collections.asList(OrderStatusEnums.CREATE.getCode(), OrderStatusEnums.SWAP.getCode())));
|
|
||||||
if (ObjectUtils.isNotEmpty(order)) {
|
|
||||||
return Result.getInstance().build(JSONObject.class).success((JSONObject)JSONObject.toJSON(order));
|
|
||||||
}else{
|
|
||||||
Result<Order> result = orderService.addOrderByPre(orderSwapBatteryPre);
|
|
||||||
//如果不等于成功
|
|
||||||
if(ResultUtil.verifyCode(result)){
|
|
||||||
order = result.getData();
|
|
||||||
//走到此处, 证明上面逻辑没有问题, 需要删除预约单过期标识
|
|
||||||
RedisServiceUtils.del("preorder:expire:"+orderSwapBatteryPre.getPkId());
|
|
||||||
//更新预约单为到店使用
|
|
||||||
orderSwapBatteryPre.setStatus(2);
|
|
||||||
orderSwapBatteryPreService.updateById(orderSwapBatteryPre);
|
|
||||||
orderSwapBatteryStepService.addOrderSwapBatteryStepBySwapComplete(order.getOrderNo(), SwapBatteryStepEnum.VEHICLES_ENTER_STATION.getKey(), new Date());
|
|
||||||
return Result.getInstance().build(JSONObject.class).success((JSONObject)JSONObject.toJSON(order));
|
|
||||||
}
|
|
||||||
errorMsg = result.getMsg();
|
|
||||||
}
|
|
||||||
return Result.getInstance().build(JSONObject.class).error(errorMsg, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 车辆到位信息
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result arrivalSignal(JSONObject json){
|
|
||||||
try {
|
|
||||||
Order order = orderService.getById(json.getInteger("pkId"));
|
|
||||||
json.put("orderNo", order.getOrderNo());
|
|
||||||
mqttStateSwapStepDataExchangeProcessor.exchange(new MessageTopic(json.getString("stationCode")+"_WEB站推送", "http"), null, JSONUtil.parseObj(json.toJSONString()));
|
|
||||||
return Result.getInstance().build(Boolean.class).success(true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();;
|
|
||||||
return Result.getInstance().build(Boolean.class).error(e.getMessage(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 车辆换电完成
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result orderCompleted(JSONObject json){
|
|
||||||
try {
|
|
||||||
Order order = orderService.getById(json.getInteger("pkId"));
|
|
||||||
|
|
||||||
OrderStatusData statusData = JSONUtil.toBean(json.toJSONString(), OrderStatusData.class);
|
|
||||||
SwapComplete orderStatus = new SwapComplete();
|
|
||||||
orderStatus.setOrderNo(order.getOrderNo());
|
|
||||||
orderStatus.setStatus(3);
|
|
||||||
orderStatus.setStatusTime(new Date());
|
|
||||||
orderStatus.setStatusData(statusData);
|
|
||||||
// 订单状态更新处理
|
|
||||||
orderService.handleOrderStatus(orderStatus, statusData);
|
|
||||||
//再次查询数据信息
|
|
||||||
order = orderService.getById(json.getInteger("pkId"));
|
|
||||||
order.setOrderDetail(orderDetailService.getOrderDetailByOrder(order.getPkId()));
|
|
||||||
return Result.getInstance().build(JSONObject.class).success((JSONObject)JSONObject.toJSON(order));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.getInstance().build(JSONObject.class).error(e.getMessage(), null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 关闭订单信息
|
|
||||||
* @param json
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result closeOrderStatus(JSONObject json){
|
|
||||||
try {
|
|
||||||
Order order = orderService.getById(json.getInteger("pkId"));
|
|
||||||
order.setStatus(json.getInteger("status"));
|
|
||||||
return Result.getInstance().build(Boolean.class).success(orderService.updateById(order));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.getInstance().build(Boolean.class).error(e.getMessage(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.open.processor.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.evotech.hd.cloud.dao.BatteryStationDao;
|
|
||||||
import com.evotech.hd.cloud.open.processor.StationMessageStrategyExchangeProcessor;
|
|
||||||
import com.evotech.hd.cloud.service.BatteryStationService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.BatteryStation;
|
|
||||||
import com.evotech.hd.common.core.utils.Collections;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站端调整运行.停运状态
|
|
||||||
*
|
|
||||||
* @ClassName:StationRunningStatusProcessor
|
|
||||||
* @date: 2025年08月20日 10:18
|
|
||||||
* @author: andy.shi
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class StationRunningStatusProcessor implements StationMessageStrategyExchangeProcessor {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
BatteryStationService batteryStationService;
|
|
||||||
@Resource
|
|
||||||
private BatteryStationDao batteryStationDao;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getMethod() {
|
|
||||||
return Collections.asList("updateStationRunningStatus");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result exchange(JSONObject json) {
|
|
||||||
BatteryStation batteryStation = batteryStationDao.selectOne(new LambdaQueryWrapper<BatteryStation>().eq(BatteryStation::getCode, json.getString("stationCode")), false);
|
|
||||||
if(ObjectUtils.isEmpty(batteryStation)){
|
|
||||||
return Result.getInstance().error("未找到站点信息, 站端编码异常");
|
|
||||||
}
|
|
||||||
//修改运行状态, 1为正常运营, 4为指令停运
|
|
||||||
batteryStation.setStatus(json.getBoolean("status") ? 1 : 4);
|
|
||||||
return batteryStationService.update(batteryStation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.evotech.hd.cloud.entity.request.PageListAlarmTemplateRequest;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.entity.common.AlarmTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AlarmTemplateService
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:AlarmTemplateService
|
|
||||||
* @date: 2025年10月28日 15:14
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
public interface AlarmTemplateService extends IService<AlarmTemplate> {
|
|
||||||
|
|
||||||
public Result<Page<AlarmTemplate>> pageList(PageListAlarmTemplateRequest params);
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.BatteryStationCdStrategyDetail;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BatteryStationCdStrategyDetailService
|
|
||||||
*
|
|
||||||
* @author andy.shi
|
|
||||||
* @ClassName:BatteryStationCdStrategyDetailService
|
|
||||||
* @date: 2025年09月28日 9:22
|
|
||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
|
||||||
*/
|
|
||||||
public interface BatteryStationCdStrategyDetailService extends IService<BatteryStationCdStrategyDetail> {
|
|
||||||
|
|
||||||
|
|
||||||
public Result<JSONObject> addBatteryStationCdStrategyDetailByCloud (JSONObject jsonObject);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
package com.evotech.hd.cloud.service;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface BatteryStationSecretKeyService {
|
|
||||||
|
|
||||||
public Map<String, String> getStationSecretKeyByStationCode(String stationCode);
|
|
||||||
}
|
|
||||||
@ -13,9 +13,4 @@ import com.evotech.hd.common.core.entity.order.OrderDetail;
|
|||||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||||
*/
|
*/
|
||||||
public interface OrderDetailService extends IService<OrderDetail> {
|
public interface OrderDetailService extends IService<OrderDetail> {
|
||||||
|
|
||||||
|
|
||||||
public OrderDetail addOrderDetailByOrder(Integer orderId);
|
|
||||||
|
|
||||||
public OrderDetail getOrderDetailByOrder(Integer orderId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,18 +2,14 @@ package com.evotech.hd.cloud.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.evotech.hd.common.core.entity.order.Order;
|
||||||
import com.evotech.hd.cloud.entity.vo.NativePayVO;
|
import com.evotech.hd.cloud.entity.vo.NativePayVO;
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.event.SwapComplete;
|
|
||||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.state.OrderStatusData;
|
|
||||||
import com.evotech.hd.common.core.Dto.Result;
|
import com.evotech.hd.common.core.Dto.Result;
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderBillListVo;
|
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderDetailVo;
|
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderListVo;
|
import com.evotech.hd.common.core.Dto.order.OrderListVo;
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre;
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||||
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
import com.evotech.hd.common.core.entity.cloud.request.BatterySwapResponse;
|
||||||
import com.evotech.hd.common.core.entity.cloud.request.PageListSwapOrderRequest;
|
import com.evotech.hd.common.core.entity.cloud.request.PageListSwapOrderRequest;
|
||||||
import com.evotech.hd.common.core.entity.order.Order;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
@ -35,11 +31,6 @@ public interface OrderService extends IService<Order> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result<Page<OrderListVo>> pageList(PageListSwapOrderRequest plsor);
|
Result<Page<OrderListVo>> pageList(PageListSwapOrderRequest plsor);
|
||||||
/***
|
|
||||||
* 订单数据导出
|
|
||||||
* @param plsor
|
|
||||||
*/
|
|
||||||
void export(PageListSwapOrderRequest plsor);
|
|
||||||
/***
|
/***
|
||||||
* 订单结算
|
* 订单结算
|
||||||
* @param osb
|
* @param osb
|
||||||
@ -82,12 +73,4 @@ public interface OrderService extends IService<Order> {
|
|||||||
Result<BatterySwapResponse> getStartSwap(String wuid, String orderId);
|
Result<BatterySwapResponse> getStartSwap(String wuid, String orderId);
|
||||||
|
|
||||||
Result<Order> one(String orderNo);
|
Result<Order> one(String orderNo);
|
||||||
|
|
||||||
Result<OrderDetailVo> getOneByOrderNo(String orderNo);
|
|
||||||
|
|
||||||
Result<List<OrderBillListVo>> billList(String companyCode, String orderTimeEnd);
|
|
||||||
|
|
||||||
void excelBillList(String companyCode, String orderTimeEnd);
|
|
||||||
|
|
||||||
void handleOrderStatus(SwapComplete orderStatus, OrderStatusData statusData);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public interface OrderSwapBatteryPreService extends IService<OrderSwapBatteryPre
|
|||||||
|
|
||||||
public Result<Page<OrderSwapBatteryPre>> list(PageListSwapOrderPreRequest plsopr);
|
public Result<Page<OrderSwapBatteryPre>> list(PageListSwapOrderPreRequest plsopr);
|
||||||
|
|
||||||
public Result<Integer> updateStatusById(Integer id, Integer status);
|
public Result<Integer> cancelPre(Integer id, Integer status);
|
||||||
|
|
||||||
List<OrderSwapBatteryPre> findOrderSwapBatteryPreList(String stationCode);
|
List<OrderSwapBatteryPre> findOrderSwapBatteryPreList(String stationCode);
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
package com.evotech.hd.cloud.service;
|
package com.evotech.hd.cloud.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.evotech.hd.common.core.Dto.order.OrderStepExportVo;
|
|
||||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryStep;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 换电步骤
|
* 换电步骤
|
||||||
@ -18,6 +16,4 @@ import java.util.List;
|
|||||||
public interface OrderSwapBatteryStepService extends IService<OrderSwapBatteryStep> {
|
public interface OrderSwapBatteryStepService extends IService<OrderSwapBatteryStep> {
|
||||||
|
|
||||||
public Boolean addOrderSwapBatteryStepBySwapComplete(String orderNo, Integer step, Date stepTime);
|
public Boolean addOrderSwapBatteryStepBySwapComplete(String orderNo, Integer step, Date stepTime);
|
||||||
|
|
||||||
List<OrderStepExportVo> findListByOrderNo(String orderNo);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,10 +16,6 @@ public interface TradeService extends IService<TradeDetail> {
|
|||||||
|
|
||||||
public Result<Integer> update(TradeDetail td);
|
public Result<Integer> update(TradeDetail td);
|
||||||
|
|
||||||
public Result<Integer> submit(TradeDetail td);
|
|
||||||
|
|
||||||
public Result<Integer> approve(Integer id, Integer type);
|
|
||||||
|
|
||||||
public Result<Page<TradeDetail>> list(PageListTradeRequest pltr);
|
public Result<Page<TradeDetail>> list(PageListTradeRequest pltr);
|
||||||
|
|
||||||
public List<TradeDetail> tradeList(PageListTradeRequest pltr);
|
public List<TradeDetail> tradeList(PageListTradeRequest pltr);
|
||||||
|
|||||||
@ -5,13 +5,9 @@ import com.evotech.hd.cloud.entity.request.PageListWechatUserRequest;
|
|||||||
import com.evotech.hd.common.core.Dto.Result;
|
import com.evotech.hd.common.core.Dto.Result;
|
||||||
import com.evotech.hd.common.core.entity.wechat.WechatUser;
|
import com.evotech.hd.common.core.entity.wechat.WechatUser;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface WechatUserService {
|
public interface WechatUserService {
|
||||||
|
|
||||||
public Result<Page<WechatUser>> pageList(PageListWechatUserRequest plwur);
|
public Result<Page<WechatUser>> list(PageListWechatUserRequest plwur);
|
||||||
|
|
||||||
public Result<List<WechatUser>> list(List<String> wuIds);
|
|
||||||
|
|
||||||
public Result<Integer> alterPhone(String wuid, String phone, String name);
|
public Result<Integer> alterPhone(String wuid, String phone, String name);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user