Merge remote-tracking branch 'origin/master'

master
CZ 4 days ago
commit fe5609513d

@ -22,7 +22,7 @@ public class PadarMgr
PadarClient client = AppInfo.Container.Resolve<PadarClient>();
client.AutoReconnect = true;
//client.InitBootstrap("192.168.3.55", int.Parse("2048"));
client.InitBootstrap("127.0.0.1", int.Parse("2048"), 10,0, 0);
client.InitBootstrap("192.168.3.52", int.Parse("2048"), 10,0, 0);
Task.Run(() =>
{
client.Connect();

@ -34,7 +34,7 @@ public static class ClientMgr
NetAddr = "192.168.3.20",
NetPort = "2000",
//NetPort = "10000",
Code = PlcConst.ChargeEqpCode,
Code = PlcConst.PlcEqpCode,
DestAddr = "132,208,208,224"
};
Log.Info($"begin to connect {netInfo.Code} {netInfo.NetAddr}:{netInfo.NetPort}");
@ -43,7 +43,7 @@ public static class ClientMgr
Log.Info($"plc client Id={PlcClient.GetHashCode()}");
PlcClient.AutoReconnect = true;
PlcClient.Sn = PlcConst.ChargeEqpCode;
PlcClient.Sn = PlcConst.PlcEqpCode;
PlcClient.ConnectedEventHandler += (sender, b) =>
{
PlcClient.SessionAttr(netInfo.Code, netInfo.DestAddr);

@ -523,7 +523,7 @@ public class PlcClient : TcpClient<IBaseHandler, Decoder, Encoder>
/// <param name="destAddr"></param>
public void SessionAttr(string sn, string destAddr)
{
ChannelUtils.AddAttr(Channel, PlcConst.ChargerSn, sn);
ChannelUtils.AddAttr(Channel, PlcConst.PlcSn, sn);
ChannelUtils.AddAttr(Channel, PlcConst.EqmTypeNo, sn);
ChannelUtils.AddAttr(Channel, PlcConst.EqmCode, sn);
ChannelUtils.AddAttr(Channel, PlcConst.DestAddr, destAddr);

@ -5,11 +5,11 @@ namespace Service.Charger.Client;
public class PlcConst
{
public static string ChargeEqpCode = "565002033910Q6F00001";
public static string PlcEqpCode = "565002033910Q6F00001";
public static byte[] StartChar =new byte[] { 0x68 };
// public static string ChargerSn = "";
public static readonly AttributeKey<string> ChargerSn = AttributeKey<string>.ValueOf("charger_sn");
public static readonly AttributeKey<string> PlcSn = AttributeKey<string>.ValueOf("plc_sn");
public static readonly AttributeKey<string> EqmTypeNo = AttributeKey<string>.ValueOf("eqm_type_no");
public static readonly AttributeKey<string> EqmCode = AttributeKey<string>.ValueOf("eqm_code");
public static readonly AttributeKey<string> DestAddr = AttributeKey<string>.ValueOf("dest_addr");

@ -42,7 +42,7 @@ public class Decoder : ByteToMessageDecoder
protected override void Decode(IChannelHandlerContext context, IByteBuffer buffer, List<object> output)
{
string? chargerSn = ChannelUtils.GetAttr(context.Channel, PlcConst.ChargerSn);
string? chargerSn = ChannelUtils.GetAttr(context.Channel, PlcConst.PlcSn);
IByteBuffer? delimiter = FindDelimiter(buffer);
if (delimiter != null)
{

@ -14,7 +14,7 @@ public class PlcServer : TcpServer<IBaseHandler, Decoder,Encoder>
{
#region send
private string sn = PlcConst.ChargeEqpCode;
private string sn = PlcConst.PlcEqpCode;
/// <summary>
/// 发送初始化命令
/// </summary>

@ -1,6 +1,9 @@
using Autofac;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac;
using Microsoft.AspNetCore.Mvc;
using Repository.Station;
using Service.Sound.SoundClient;
using SqlSugar;
namespace WebStarter.Controllers.Test;
@ -46,35 +49,7 @@ public class GenController : ControllerBase
[HttpGet("test115")]
public void Test115()
{
var group = new BatteryGroup()
{
BatteryNo = "1",
Group = 1,
};
var batteryGroup = new BatteryGroup()
{
BatteryNo = "2",
Group = 2,
};
var groups = new List<BatteryGroup>() { group, batteryGroup };
_batteryGroupRepository.Insert(groups);
BatteryGroup batteryGroups = _batteryGroupRepository.QueryByClause(i => i.Group == 1);
/*
/*BatteryGroup batteryGroup = batteryGroups[0];
_batteryGroupRepository.Delete(batteryGroup);
BatteryGroup batteryGroup1 = batteryGroups[1];
batteryGroup1.Group = 3;
_batteryGroupRepository.Update(batteryGroup1);#1#
if (batteryGroups == null)
{
Console.WriteLine();
}
else
{
Console.WriteLine();
}
*/
AppInfo.Container.Resolve<SoundClient>().SoundPlay(SoundEnum.music100);
Console.WriteLine("测试完毕");
}

@ -1,39 +0,0 @@
/*
Navicat Premium Dump SQL
Source Server : 180.76.133.253
Source Server Type : MySQL
Source Server Version : 80039 (8.0.39-0ubuntu0.22.04.1)
Source Host : 180.76.133.253:16306
Source Schema : eaxing_dev
Target Server Type : MySQL
Target Server Version : 80039 (8.0.39-0ubuntu0.22.04.1)
File Encoding : 65001
Date: 28/09/2024 10:06:28
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for swap_fail_reason_config
-- ----------------------------
DROP TABLE IF EXISTS `swap_fail_reason_config`;
CREATE TABLE `swap_fail_reason_config` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
`fail_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '失败原因',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`created_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
`created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '失败原因配置表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE swap_order
ADD COLUMN remark VARCHAR(255) DEFAULT NULL COMMENT '备注';

@ -1,55 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.2.2
Source Server Type : MySQL
Source Server Version : 80034
Source Host : 192.168.2.2:3306
Source Schema : eaxing_dev
Target Server Type : MySQL
Target Server Version : 80034
File Encoding : 65001
Date: 30/07/2024 08:51:09
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for app_customer
-- ----------------------------
DROP TABLE IF EXISTS `app_customer`;
CREATE TABLE `app_customer` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`login_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '登录号码',
`team_id` bigint NULL DEFAULT NULL COMMENT '车队ID',
`login_type` tinyint NULL DEFAULT NULL COMMENT '登录方式',
`login_psd` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '登录密码',
`is_member` tinyint NULL DEFAULT 0 COMMENT '是否是会员:0否1是',
`nick_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户昵称',
`user_name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '姓名',
`user_avatar` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户头像URL',
`gender` tinyint NULL DEFAULT 1 COMMENT '性别1男2女3保密',
`identify_code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '身份证号码',
`iphone_no` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号码',
`email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`home_addr` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '家庭住址',
`car_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '车牌号',
`state` tinyint NOT NULL DEFAULT 0 COMMENT '使用状态:0正常1停用',
`register_plat` tinyint NULL DEFAULT 0 COMMENT '注册平台',
`user_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '支付宝userid',
`open_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '微信openid',
`union_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
`wx_open_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公众号openid',
`birthday` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '出生日期',
`audit_state` tinyint NULL DEFAULT 0 COMMENT '审核进度:0:未审核;1:通过审核;2:审核拒绝',
`created_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
`created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 199 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用户注册信息' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,53 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.2.2
Source Server Type : MySQL
Source Server Version : 80034
Source Host : 192.168.2.2:3306
Source Schema : eaxing_dev
Target Server Type : MySQL
Target Server Version : 80034
File Encoding : 65001
Date: 30/07/2024 09:00:41
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for app_customer_vehicle
-- ----------------------------
DROP TABLE IF EXISTS `app_customer_vehicle`;
CREATE TABLE `app_customer_vehicle` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`customer_id` bigint NULL DEFAULT NULL COMMENT '客户id',
`user_name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户名',
`phone` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号',
`team_id` bigint NULL DEFAULT NULL COMMENT '车队id',
`car_id` bigint NULL DEFAULT NULL COMMENT '车辆id',
`car_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '车牌号',
`vin` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'vin',
`mac` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'mac地址',
`engine_no` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '发动机编号',
`vehicle_license` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '行驶证图片',
`driver_license` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '驾驶证图片',
`id_front` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '身份证人像面',
`id_back` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '身份证国徽面',
`apply_time` datetime NULL DEFAULT NULL COMMENT '申请认证时间',
`audit_status` int NULL DEFAULT NULL COMMENT '0:未审核;1:通过审核;2:审核拒绝',
`audit_reason` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '申请原因',
`is_default` int NULL DEFAULT 0 COMMENT '是否默认扣费账户:0否;1是',
`audit_id` bigint NULL DEFAULT NULL COMMENT '审核id',
`audit_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '审核人',
`audit_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '审核时间',
`created_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
`created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 173 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '客户车辆表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,43 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.2.2
Source Server Type : MySQL
Source Server Version : 80034
Source Host : 192.168.2.2:3306
Source Schema : eaxing_dev
Target Server Type : MySQL
Target Server Version : 80034
File Encoding : 65001
Date: 30/07/2024 08:51:17
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for car_team
-- ----------------------------
DROP TABLE IF EXISTS `car_team`;
CREATE TABLE `car_team` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键Id',
`customer_id` bigint NULL DEFAULT NULL COMMENT '客户id',
`team_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '车队编码',
`team_name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '车队名称',
`principal` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '负责人',
`contact_way` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '联系方式',
`is_discount` int NULL DEFAULT NULL COMMENT '是否打折:0:否1是',
`discount_percent` int NULL DEFAULT NULL COMMENT '折扣比例1-100',
`discount_scope` int NULL DEFAULT NULL COMMENT '折扣范围:0全部折扣;1:计费模型折扣3电价折扣',
`rounding_mode` int NULL DEFAULT 0 COMMENT '舍入模式:0.向下取整;1.四舍五入;2.向上取整',
`limit` decimal(12, 2) NULL DEFAULT NULL COMMENT '额度限制,小于此额度则认证失败,提示余额不足',
`created_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
`created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '车队' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

@ -1,2 +0,0 @@
ALTER TABLE amt_order_info
ADD customer_id BIGINT NOT NULL DEFAULT -1 COMMENT '客户id';

@ -1,38 +0,0 @@
/*
Navicat Premium Data Transfer
Source Server : rszn22
Source Server Type : MySQL
Source Server Version : 80039
Source Host : 192.168.2.2:3306
Source Schema : eaxing_dev
Target Server Type : MySQL
Target Server Version : 80039
File Encoding : 65001
Date: 09/09/2024 19:07:27
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for base_vehicle
-- ----------------------------
DROP TABLE IF EXISTS `base_vehicle`;
CREATE TABLE `base_vehicle` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
`vehicle_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '车牌号',
`vehicle_mac` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '车辆mac',
`vehicle_vin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '车辆vin码',
`created_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
`created_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`updated_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`company` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '公司',
`departments` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '部门',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,2 +0,0 @@
INSERT INTO `sys_config` VALUES (1300000000184, 'Station.SelectPackManually', 'SelectPackManually', '10000', 2, 'Station', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, b'0');

@ -1,32 +0,0 @@
ALTER TABLE swap_order_step
ADD COLUMN step_type INT COMMENT '步骤类型1自动 2手动',
ADD COLUMN step_desc varchar(255) COMMENT '描述',
ADD COLUMN param text COMMENT '参数';
INSERT INTO `sys_config` VALUES (1300000000180, 'Station.ServiceTotalFee', 'ServiceTotalFee', '10000', 2, 'Station', 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, b'0');
INSERT INTO `sys_config` VALUES (1300000000181, 'Station.ElectricityTotalFee', 'ElectricityTotalFee', '100000', 2, 'Station', 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, b'0');
INSERT INTO `sys_config` VALUES (1300000000182, 'Station.AppendTotalFee', 'AppendTotalFee', '10000', 2, 'Station', 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, b'0');
ALTER TABLE swap_order_battery
DROP COLUMN nominal_energy;
ALTER TABLE swap_order_battery
ADD COLUMN down_nominal_energy DECIMAL(24,2) COMMENT '放电池标称能量',
ADD COLUMN up_nominal_energy DECIMAL(24,2) COMMENT '取电池标称能量';
ALTER TABLE bin_info
ADD COLUMN nominal_energy DECIMAL(24,2) COMMENT '电池标称能量';
ALTER TABLE swap_order
ADD COLUMN service_total_fee INT COMMENT '换电服务费';
ALTER TABLE swap_order
MODIFY COLUMN electricity_total_fee DECIMAL(24,2) COMMENT '电费',
MODIFY COLUMN append_total_fee DECIMAL(24,2) COMMENT '附加费',
MODIFY COLUMN total_fee DECIMAL(24,2) COMMENT '总费用(所有的总费用)',
MODIFY COLUMN service_total_fee DECIMAL(24,2) COMMENT '换电服务费';
Loading…
Cancel
Save