From 11cb6c4972682ffaac0922d41ce99c4ff97c6878 Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 5 Jun 2024 18:01:17 +0800 Subject: [PATCH] =?UTF-8?q?model=20=E6=8F=90=E5=87=BA=20baseModel=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9createTime=20=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=B8=8D=E6=8F=92=E5=85=A5=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/DbModel/BaseModel.cs | 43 +++++++++++++++++++ Entity/DbModel/Station/BatteryGroup.cs | 35 +-------------- Entity/DbModel/Station/BatteryInfo.cs | 34 +-------------- Entity/DbModel/Station/BatteryOpModel.cs | 35 +-------------- .../DbModel/Station/BatteryOpModelDetail.cs | 34 +-------------- Entity/DbModel/Station/BinInfo.cs | 37 ++-------------- Entity/DbModel/Station/ChargeOrder.cs | 35 +-------------- .../DbModel/Station/ElecPriceModelVersion.cs | 35 +-------------- .../Station/ElecPriceModelVersionDetail.cs | 37 ++-------------- Entity/DbModel/Station/EquipAlarmDefine.cs | 34 +-------------- Entity/DbModel/Station/EquipAlarmLevel.cs | 34 +-------------- .../Station/EquipAlarmProcessMethod.cs | 35 +-------------- .../Station/EquipAlarmProcessRecord.cs | 34 +-------------- Entity/DbModel/Station/EquipAlarmRecord.cs | 32 +------------- Entity/DbModel/Station/EquipAlarmType.cs | 35 +-------------- Entity/DbModel/Station/EquipAlarmTypeValue.cs | 34 +-------------- Entity/DbModel/Station/EquipInfo.cs | 34 +-------------- Entity/DbModel/Station/EquipNetInfo.cs | 34 +-------------- Entity/DbModel/Station/EquipType.cs | 33 +------------- .../Station/ExchangeStationDayRunResult.cs | 24 +---------- Entity/DbModel/Station/SelectBatteryRule.cs | 32 +------------- Entity/DbModel/Station/SwapAmtOrder.cs | 34 +-------------- Entity/DbModel/Station/SwapOrder.cs | 34 +-------------- Entity/DbModel/Station/SwapOrderBattery.cs | 34 +-------------- .../DbModel/Station/SwapOrderReportCloud.cs | 34 +-------------- Entity/DbModel/Station/SwapOrderStep.cs | 34 +-------------- Service/Execute/Api/PlcApi.cs | 22 +++++----- WebStarter/bin/Debug/net6.0/log4net.config | 25 +++++++++++ WebStarter/log4net.config | 25 +++++++++++ 29 files changed, 150 insertions(+), 812 deletions(-) create mode 100644 Entity/DbModel/BaseModel.cs diff --git a/Entity/DbModel/BaseModel.cs b/Entity/DbModel/BaseModel.cs new file mode 100644 index 0000000..1665beb --- /dev/null +++ b/Entity/DbModel/BaseModel.cs @@ -0,0 +1,43 @@ +using SqlSugar; + +namespace Entity.DbModel; +/// +/// 业务model 基类 +/// +public class BaseModel +{ + /// + /// Desc:创建人 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "created_by")] + public string? CreatedBy { get; set; } + + /// + /// Desc:创建时间 + /// Default:CURRENT_TIMESTAMP + /// Nullable:True + /// + /// [SugarColumn(IsPrimaryKey = false, , ColumnDescription = "创建时间")] + [SugarColumn(ColumnName = "created_time", InsertServerTime = true)] + public DateTime? CreatedTime { get; set; } + + + /// + /// Desc:更新人 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName = "updated_by")] + public string? UpdatedBy { get; set; } + + /// + /// Desc:更新时间 + /// Default:CURRENT_TIMESTAMP + /// Nullable:True + /// + [SugarColumn(ColumnName = "updated_time", UpdateServerTime = true)] + public DateTime? UpdatedTime { get; set; } = DateTime.Now; + +} \ No newline at end of file diff --git a/Entity/DbModel/Station/BatteryGroup.cs b/Entity/DbModel/Station/BatteryGroup.cs index ea7f8b4..bcf209a 100644 --- a/Entity/DbModel/Station/BatteryGroup.cs +++ b/Entity/DbModel/Station/BatteryGroup.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///电池分组表 /// [SugarTable("battery_group")] - public partial class BatteryGroup + public partial class BatteryGroup : BaseModel { public BatteryGroup(){ @@ -47,37 +47,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="group_count")] public int? GroupCount {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} - + } } diff --git a/Entity/DbModel/Station/BatteryInfo.cs b/Entity/DbModel/Station/BatteryInfo.cs index ebd405a..299e3a0 100644 --- a/Entity/DbModel/Station/BatteryInfo.cs +++ b/Entity/DbModel/Station/BatteryInfo.cs @@ -9,43 +9,13 @@ namespace Entity.DbModel.Station ///电池信息表 /// [SugarTable("battery_info")] - public partial class BatteryInfo + public partial class BatteryInfo : BaseModel { public BatteryInfo(){ } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} + } } diff --git a/Entity/DbModel/Station/BatteryOpModel.cs b/Entity/DbModel/Station/BatteryOpModel.cs index fece6bf..a8a0553 100644 --- a/Entity/DbModel/Station/BatteryOpModel.cs +++ b/Entity/DbModel/Station/BatteryOpModel.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///电池运营模型 /// [SugarTable("battery_op_model")] - public partial class BatteryOpModel + public partial class BatteryOpModel : BaseModel { public BatteryOpModel(){ @@ -31,37 +31,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="model_id")] public int? ModelId {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} - + } } diff --git a/Entity/DbModel/Station/BatteryOpModelDetail.cs b/Entity/DbModel/Station/BatteryOpModelDetail.cs index c3213b6..a56b97e 100644 --- a/Entity/DbModel/Station/BatteryOpModelDetail.cs +++ b/Entity/DbModel/Station/BatteryOpModelDetail.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///电池运营模型详情 /// [SugarTable("battery_op_model_detail")] - public partial class BatteryOpModelDetail + public partial class BatteryOpModelDetail : BaseModel { public BatteryOpModelDetail(){ @@ -63,37 +63,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="battery_type")] public string BatteryType {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} + } } diff --git a/Entity/DbModel/Station/BinInfo.cs b/Entity/DbModel/Station/BinInfo.cs index e830a1c..24dfc74 100644 --- a/Entity/DbModel/Station/BinInfo.cs +++ b/Entity/DbModel/Station/BinInfo.cs @@ -7,7 +7,7 @@ namespace Entity.DbModel.Station ///仓位信息表 /// [SugarTable("bin_info")] - public partial class BinInfo + public partial class BinInfo : BaseModel { public BinInfo() { @@ -165,32 +165,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "status")] public int? Status { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string? CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - /// [SugarColumn(IsPrimaryKey = false, , ColumnDescription = "创建时间")] - [SugarColumn(ColumnName = "created_time", InsertServerTime = true)] - public DateTime? CreatedTime { get; set; } - - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string? UpdatedBy { get; set; } - + /// /// Desc:最后结束充电时间 结束充电后更新 /// Default: @@ -199,13 +174,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "last_charge_finish_time")] public DateTime? LastChargeFinishTime { get; set; } - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time", UpdateServerTime = true)] - public DateTime? UpdatedTime { get; set; } = DateTime.Now; + /// /// 缓存仓标记 0:不是 1:是 diff --git a/Entity/DbModel/Station/ChargeOrder.cs b/Entity/DbModel/Station/ChargeOrder.cs index c9f30b7..fb64653 100644 --- a/Entity/DbModel/Station/ChargeOrder.cs +++ b/Entity/DbModel/Station/ChargeOrder.cs @@ -6,7 +6,7 @@ namespace Entity.DbModel.Station ///充电订单;充电订单表 /// [SugarTable("charge_order")] - public partial class ChargeOrder + public partial class ChargeOrder : BaseModel { public ChargeOrder() { @@ -258,38 +258,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "cloud_report_status")] public int? CloudReportStatus { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } - + /// /// Desc:云平台订单编号 /// Default: diff --git a/Entity/DbModel/Station/ElecPriceModelVersion.cs b/Entity/DbModel/Station/ElecPriceModelVersion.cs index 49639fa..f823d10 100644 --- a/Entity/DbModel/Station/ElecPriceModelVersion.cs +++ b/Entity/DbModel/Station/ElecPriceModelVersion.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///电价模型板板;电价模型版本表,生失效时间左开右闭且不能重叠 /// [SugarTable("elec_price_model_version")] - public partial class ElecPriceModelVersion + public partial class ElecPriceModelVersion : BaseModel { public ElecPriceModelVersion(){ @@ -47,37 +47,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="end_time")] public DateTime? EndTime {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} - + } } diff --git a/Entity/DbModel/Station/ElecPriceModelVersionDetail.cs b/Entity/DbModel/Station/ElecPriceModelVersionDetail.cs index 99fabd3..806ecf3 100644 --- a/Entity/DbModel/Station/ElecPriceModelVersionDetail.cs +++ b/Entity/DbModel/Station/ElecPriceModelVersionDetail.cs @@ -9,8 +9,8 @@ namespace Entity.DbModel.Station ///电价模型详情 /// [SugarTable("elec_price_model_version_detail")] - public partial class ElecPriceModelVersionDetail - { + public partial class ElecPriceModelVersionDetail : BaseModel + { public ElecPriceModelVersionDetail(){ @@ -77,38 +77,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="type")] public int? Type {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} - + /// /// 判断一个时间段是否包含另一个时间段(包括开始和结束时间的秒数) /// diff --git a/Entity/DbModel/Station/EquipAlarmDefine.cs b/Entity/DbModel/Station/EquipAlarmDefine.cs index 63ca115..f6a13f3 100644 --- a/Entity/DbModel/Station/EquipAlarmDefine.cs +++ b/Entity/DbModel/Station/EquipAlarmDefine.cs @@ -6,7 +6,7 @@ namespace Entity.DbModel.Station ///设备报警记录 /// [SugarTable("equip_alarm_define")] - public partial class EquipAlarmDefine + public partial class EquipAlarmDefine : BaseModel { public EquipAlarmDefine() { @@ -68,36 +68,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "process_method")] public string ProcessMethod { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } + } } diff --git a/Entity/DbModel/Station/EquipAlarmLevel.cs b/Entity/DbModel/Station/EquipAlarmLevel.cs index bc319c3..5f14c73 100644 --- a/Entity/DbModel/Station/EquipAlarmLevel.cs +++ b/Entity/DbModel/Station/EquipAlarmLevel.cs @@ -6,7 +6,7 @@ namespace Entity.DbModel.Station ///设备报警等级 /// [SugarTable("equip_alarm_level")] - public partial class EquipAlarmLevel + public partial class EquipAlarmLevel : BaseModel { /// /// 自增id @@ -17,36 +17,6 @@ namespace Entity.DbModel.Station //TODO 数据库字段未设计完 - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } + } } diff --git a/Entity/DbModel/Station/EquipAlarmProcessMethod.cs b/Entity/DbModel/Station/EquipAlarmProcessMethod.cs index bc22fe0..389d46c 100644 --- a/Entity/DbModel/Station/EquipAlarmProcessMethod.cs +++ b/Entity/DbModel/Station/EquipAlarmProcessMethod.cs @@ -9,43 +9,12 @@ namespace Entity.DbModel.Station ///设备报警处理方法 /// [SugarTable("equip_alarm_process_method")] - public partial class EquipAlarmProcessMethod + public partial class EquipAlarmProcessMethod : BaseModel { public EquipAlarmProcessMethod(){ } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} - + } } diff --git a/Entity/DbModel/Station/EquipAlarmProcessRecord.cs b/Entity/DbModel/Station/EquipAlarmProcessRecord.cs index bba040a..d00cda9 100644 --- a/Entity/DbModel/Station/EquipAlarmProcessRecord.cs +++ b/Entity/DbModel/Station/EquipAlarmProcessRecord.cs @@ -6,7 +6,7 @@ namespace Entity.DbModel.Station ///设备报警处理记录 /// [SugarTable("equip_alarm_process_record")] - public partial class EquipAlarmProcessRecord + public partial class EquipAlarmProcessRecord : BaseModel { public EquipAlarmProcessRecord() { @@ -76,36 +76,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "process_time")] public DateTime? ProcessTime { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } + } } diff --git a/Entity/DbModel/Station/EquipAlarmRecord.cs b/Entity/DbModel/Station/EquipAlarmRecord.cs index 1a4a65f..75903e6 100644 --- a/Entity/DbModel/Station/EquipAlarmRecord.cs +++ b/Entity/DbModel/Station/EquipAlarmRecord.cs @@ -6,7 +6,7 @@ namespace Entity.DbModel.Station ///设备报警记录 /// [SugarTable("equip_alarm_record")] - public partial class EquipAlarmRecord + public partial class EquipAlarmRecord : BaseModel { public EquipAlarmRecord() { @@ -68,36 +68,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "process_method")] public string ProcessMethod { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } } } diff --git a/Entity/DbModel/Station/EquipAlarmType.cs b/Entity/DbModel/Station/EquipAlarmType.cs index f7c10fa..68fa3d1 100644 --- a/Entity/DbModel/Station/EquipAlarmType.cs +++ b/Entity/DbModel/Station/EquipAlarmType.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///设备报警类型 /// [SugarTable("equip_alarm_type")] - public partial class EquipAlarmType + public partial class EquipAlarmType : BaseModel { /// /// 自增id @@ -17,38 +17,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] public long Id { get; set; } - //TODO 数据库字段未设计完 - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } + } } diff --git a/Entity/DbModel/Station/EquipAlarmTypeValue.cs b/Entity/DbModel/Station/EquipAlarmTypeValue.cs index e1e1f30..396ebb5 100644 --- a/Entity/DbModel/Station/EquipAlarmTypeValue.cs +++ b/Entity/DbModel/Station/EquipAlarmTypeValue.cs @@ -9,43 +9,13 @@ namespace Entity.DbModel.Station ///设备报警类型阀值 /// [SugarTable("equip_alarm_type_value")] - public partial class EquipAlarmTypeValue + public partial class EquipAlarmTypeValue : BaseModel { public EquipAlarmTypeValue(){ } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} + } } diff --git a/Entity/DbModel/Station/EquipInfo.cs b/Entity/DbModel/Station/EquipInfo.cs index 23c2385..c2261c5 100644 --- a/Entity/DbModel/Station/EquipInfo.cs +++ b/Entity/DbModel/Station/EquipInfo.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///设备信息表 /// [SugarTable("equip_info")] - public partial class EquipInfo + public partial class EquipInfo : BaseModel { public EquipInfo(){ @@ -55,37 +55,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="status")] public int? Status {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} + } } diff --git a/Entity/DbModel/Station/EquipNetInfo.cs b/Entity/DbModel/Station/EquipNetInfo.cs index 747a64d..6d66ed8 100644 --- a/Entity/DbModel/Station/EquipNetInfo.cs +++ b/Entity/DbModel/Station/EquipNetInfo.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///设备通信信息表 /// [SugarTable("equip_net_info")] - public partial class EquipNetInfo + public partial class EquipNetInfo : BaseModel { public EquipNetInfo(){ @@ -55,37 +55,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="dest_addr")] public string DestAddr {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} + } } diff --git a/Entity/DbModel/Station/EquipType.cs b/Entity/DbModel/Station/EquipType.cs index 7f9b447..c558d13 100644 --- a/Entity/DbModel/Station/EquipType.cs +++ b/Entity/DbModel/Station/EquipType.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///设备类型表 /// [SugarTable("equip_type")] - public partial class EquipType + public partial class EquipType : BaseModel { public EquipType(){ @@ -47,37 +47,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="enabled")] public int? Enabled {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} } } diff --git a/Entity/DbModel/Station/ExchangeStationDayRunResult.cs b/Entity/DbModel/Station/ExchangeStationDayRunResult.cs index 1641e7c..0ee0f07 100644 --- a/Entity/DbModel/Station/ExchangeStationDayRunResult.cs +++ b/Entity/DbModel/Station/ExchangeStationDayRunResult.cs @@ -11,7 +11,7 @@ namespace Entity.DbModel.Station ///换电站日运行统计结果 /// [SugarTable("exchange_station_day_count_result")] - public class ExchangeStationDayRunResult + public class ExchangeStationDayRunResult : BaseModel { /// /// 主键ID @@ -91,28 +91,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "toltal_time_count")] public float ToltalTimeCount { get; set; } - /// - /// 创建时间 - /// - [SugarColumn(ColumnName = "created_time")] - public string CreatedTime { get; set; } - - /// - /// 创建人 - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - /// - /// 更新人 - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// 更新时间 - /// - [SugarColumn(ColumnName = "updated_time")] - public string UpdatedTime { get; set; } } } diff --git a/Entity/DbModel/Station/SelectBatteryRule.cs b/Entity/DbModel/Station/SelectBatteryRule.cs index de029f8..e37d5c0 100644 --- a/Entity/DbModel/Station/SelectBatteryRule.cs +++ b/Entity/DbModel/Station/SelectBatteryRule.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///选包规则表 /// [SugarTable("select_battery_rule")] - public partial class SelectBatteryRule + public partial class SelectBatteryRule : BaseModel { public SelectBatteryRule(){ @@ -63,37 +63,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="remart")] public string Remart {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} } } diff --git a/Entity/DbModel/Station/SwapAmtOrder.cs b/Entity/DbModel/Station/SwapAmtOrder.cs index 0776180..7ef3122 100644 --- a/Entity/DbModel/Station/SwapAmtOrder.cs +++ b/Entity/DbModel/Station/SwapAmtOrder.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///换电预约表 /// [SugarTable("swap_amt_order")] - public partial class SwapAmtOrder + public partial class SwapAmtOrder : BaseModel { public SwapAmtOrder(){ @@ -119,37 +119,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="swap_order_sn")] public string SwapOrderSn {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} + } diff --git a/Entity/DbModel/Station/SwapOrder.cs b/Entity/DbModel/Station/SwapOrder.cs index 303b422..85b7ab1 100644 --- a/Entity/DbModel/Station/SwapOrder.cs +++ b/Entity/DbModel/Station/SwapOrder.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///换电订单表 /// [SugarTable("swap_order")] - public partial class SwapOrder + public partial class SwapOrder : BaseModel { public SwapOrder() { @@ -111,37 +111,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "cloud_report_status")] public int? CloudReportStatus { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } + /// /// 云平台订单号 /// diff --git a/Entity/DbModel/Station/SwapOrderBattery.cs b/Entity/DbModel/Station/SwapOrderBattery.cs index 1183478..ee200ce 100644 --- a/Entity/DbModel/Station/SwapOrderBattery.cs +++ b/Entity/DbModel/Station/SwapOrderBattery.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station ///换电订单电池 /// [SugarTable("swap_order_battery")] - public partial class SwapOrderBattery + public partial class SwapOrderBattery : BaseModel { /// @@ -204,37 +204,5 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "up_battery_bin_no")] public int? UpBatteryBinNo { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string? CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string? UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } - } } diff --git a/Entity/DbModel/Station/SwapOrderReportCloud.cs b/Entity/DbModel/Station/SwapOrderReportCloud.cs index 23bfa1e..0c3993f 100644 --- a/Entity/DbModel/Station/SwapOrderReportCloud.cs +++ b/Entity/DbModel/Station/SwapOrderReportCloud.cs @@ -9,7 +9,7 @@ namespace Entity.DbModel.Station /// /// [SugarTable("swap_order_report_cloud")] - public partial class SwapOrderReportCloud + public partial class SwapOrderReportCloud : BaseModel { public SwapOrderReportCloud(){ @@ -39,38 +39,6 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName="cloud_report_status")] public int? CloudReportStatus {get;set;} - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="created_by")] - public string CreatedBy {get;set;} - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="created_time")] - public DateTime? CreatedTime {get;set;} - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_by")] - public string UpdatedBy {get;set;} - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName="updated_time")] - public DateTime? UpdatedTime {get;set;} - /// /// Desc:云平台充电订单 /// Default: diff --git a/Entity/DbModel/Station/SwapOrderStep.cs b/Entity/DbModel/Station/SwapOrderStep.cs index 715019e..385a8bd 100644 --- a/Entity/DbModel/Station/SwapOrderStep.cs +++ b/Entity/DbModel/Station/SwapOrderStep.cs @@ -7,7 +7,7 @@ namespace Entity.DbModel.Station ///换电步序表 /// [SugarTable("swap_order_step")] - public partial class SwapOrderStep + public partial class SwapOrderStep : BaseModel { [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")] public int Id { get; set; } @@ -36,37 +36,7 @@ namespace Entity.DbModel.Station [SugarColumn(ColumnName = "step_name")] public string? StepName { get; set; } - /// - /// Desc:创建人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_by")] - public string? CreatedBy { get; set; } - - /// - /// Desc:创建时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "created_time")] - public DateTime? CreatedTime { get; set; } - - /// - /// Desc:更新人 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_by")] - public string? UpdatedBy { get; set; } - - /// - /// Desc:更新时间 - /// Default:CURRENT_TIMESTAMP - /// Nullable:True - /// - [SugarColumn(ColumnName = "updated_time")] - public DateTime? UpdatedTime { get; set; } + /// diff --git a/Service/Execute/Api/PlcApi.cs b/Service/Execute/Api/PlcApi.cs index 117d564..c67c876 100644 --- a/Service/Execute/Api/PlcApi.cs +++ b/Service/Execute/Api/PlcApi.cs @@ -11,22 +11,16 @@ namespace Service.Execute.Api; public class PlcApi { private const int TimeSpan = 60; - private static readonly ILog Log = LogManager.GetLogger(typeof(PlcApi)); + private static readonly ILog Log = LogManager.GetLogger("PlcApi"); - /// - /// PLC是否连接 - /// - public static bool con; + /// /// 数据有效时间。单位秒 /// static int DataTimeSeconds = 2; - /// - /// 数据刷新时间 - /// - public static DateTime DataValidityTime = DateTime.Now; + /// @@ -35,12 +29,17 @@ public class PlcApi /// public static bool IsRemote() { - return PlcMgr.IsRemote(); + + var isRemote = PlcMgr.IsRemote(); + Log.Info($"plc IsRemove resp={isRemote}"); + return isRemote; } public static bool IsAuto() { - return PlcMgr.IsAuto(); + var isAuto = PlcMgr.IsAuto(); + Log.Info($"plc IsRemove resp={isAuto}"); + return isAuto; } /// @@ -49,6 +48,7 @@ public class PlcApi /// public static bool EntranceRadar() { + return PlcMgr.EntranceRadar(); } diff --git a/WebStarter/bin/Debug/net6.0/log4net.config b/WebStarter/bin/Debug/net6.0/log4net.config index c533256..19ac038 100644 --- a/WebStarter/bin/Debug/net6.0/log4net.config +++ b/WebStarter/bin/Debug/net6.0/log4net.config @@ -29,4 +29,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebStarter/log4net.config b/WebStarter/log4net.config index c533256..19ac038 100644 --- a/WebStarter/log4net.config +++ b/WebStarter/log4net.config @@ -29,4 +29,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file