app接口和表添加

master
tq 4 months ago
parent 5dbff26247
commit 01416c1f22

@ -49,6 +49,11 @@
/// 密码错误次数缓存
/// </summary>
public const string KeyErrorPasswordCount = "sys_errorPasswordCount:";
/// <summary>
/// App密码错误次数缓存
/// </summary>
public const string AppKeyErrorPasswordCount = "app_sys_errorPasswordCount:";
/// <summary>
/// 租户缓存

@ -0,0 +1,36 @@
using Entity.DbModel.Station;
using Entity.Dto.Req;
using HybirdFrameworkCore.Entity;
namespace Entity.Api.Req;
/// <summary>
/// 预约订单分页查询
/// </summary>
public class QueryAmtOrderInfoPageReq: QueryPageModel
{
/// <summary>
/// Desc:客户id
/// Default:
/// Nullable:True
/// </summary>
public long? CustomerId { get; set; }
/// <summary>
/// Desc:查询时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? Time { get; set; }
}
/// <summary>
/// 添加预约订单
/// </summary>
public class AddAmtOrderInfoReq : AmtOrderInfo
{
}
/// <summary>
/// 取消预约单
/// </summary>
public class DeleteAmtOrderInfoReq : BaseIdReq
{
}

@ -10,6 +10,15 @@ public class QuerySwapOrderPageReq : QueryPageModel
/// Nullable:True
/// </summary>
public string? Sn { get; set; }
/// <summary>
/// Desc:客户id
/// Default:
/// Nullable:True
/// </summary>
public long? CustomerId { get; set; }
/// <summary>
/// Desc:车牌号
@ -74,4 +83,11 @@ public class QuerySwapOrderPageReq : QueryPageModel
/// Nullable:True
/// </summary>
public string? UpBatteryNo { get; set; }
/// <summary>
/// Desc:查询时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? Time { get; set; }
}

@ -0,0 +1,174 @@
using SqlSugar;
namespace Entity.DbModel.Station;
/// <summary>
/// 预约订单表
/// </summary>
[SugarTable("amt_order_info")]
public partial class AmtOrderInfo
{
/// <summary>
/// Desc:主键
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(ColumnName = "id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = true)]
public virtual long Id { get; set; }
/// <summary>
/// Desc:换电站编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "sn")]
public string? sn { get; set; }
/// <summary>
/// Desc:车辆编码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "car_no")]
public string CarNo { get; set; }
/// <summary>
/// Desc:预约单号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "order_no")]
public string? OrderNo { get; set; }
/// <summary>
/// Desc:车辆vim码
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "vin")]
public string Vin { get; set; }
/// <summary>
/// Desc:电池类型
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "battery_type")]
public string? BatteryType { get; set; }
/// <summary>
/// Desc:预约电池编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "battery_nos")]
public string? BatteryNos { get; set; }
/// <summary>
/// Desc:预约数量
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "batnum")]
public int? Batnum { get; set; }
/// <summary>
/// Desc:预约电池锁仓仓号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "bin_nos")]
public string BinNos { get; set; }
/// <summary>
/// Desc:预约时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "start_time")]
public DateTime? StartTime { get; set; }
/// <summary>
/// Desc:预约到期时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "end_time")]
public DateTime? EndTime { get; set; }
/// <summary>
/// Desc:预约单状态
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "status")]
public int? Status { get; set; }
/// <summary>
/// Desc:取消时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "cancel_time")]
public DateTime? CancelTime { get; set; }
/// <summary>
/// Desc:换电完成时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "swap_finish_time")]
public DateTime? SwapFinishTime { get; set; }
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "swap_order_no")]
public string? SwapOrderNo { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "created_by")]
public string? CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "created_time")]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "updated_by")]
public string? UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "updated_time")]
public DateTime? UpdatedTime { get; set; }
/// <summary>
/// Desc:客户ID
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "customer_id")]
public long? CustomerId { get; set; }
public AmtOrderInfo()
{
}
}

@ -0,0 +1,172 @@
using Common.Enum;
using SqlSugar;
namespace Entity.DbModel.System.App;
/// <summary>
/// App用户表
/// </summary>
[SugarTable("app_customer")]
public class AppCustomer
{
/// <summary>
/// 自增
/// </summary>
[SugarColumn(ColumnName = "id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = true)]
public virtual long Id { get; set; }
/// <summary>
/// 登录号码
/// </summary>
[SugarColumn(ColumnName = "login_no", ColumnDescription = "登录号码", Length = 20)]
public virtual string LoginNo { get; set; }
/// <summary>
/// 车队ID
/// </summary>
[SugarColumn(ColumnName = "team_id", ColumnDescription = "车队ID")]
public virtual long? TeamId { get; set; }
/// <summary>
/// 登录方式
/// </summary>
[SugarColumn(ColumnName = "login_type", ColumnDescription = "登录方式")]
public virtual byte? LoginType { get; set; }
/// <summary>
/// 登录密码
/// </summary>
[SugarColumn(ColumnName = "login_psd", ColumnDescription = "登录密码", Length = 60)]
public virtual string? LoginPsd { get; set; }
/// <summary>
/// 是否是会员
/// </summary>
[SugarColumn(ColumnName = "is_member", ColumnDescription = "是否是会员")]
public virtual byte? IsMember { get; set; }
/// <summary>
/// 用户昵称
/// </summary>
[SugarColumn(ColumnName = "nick_name", ColumnDescription = "用户昵称", Length = 20)]
public virtual string NickName { get; set; }
/// <summary>
/// 姓名
/// </summary>
[SugarColumn(ColumnName = "user_name", ColumnDescription = "姓名", Length = 30)]
public virtual string? UserName { get; set; }
/// <summary>
/// 用户头像URL
/// </summary>
[SugarColumn(ColumnName = "user_avatar", ColumnDescription = "用户头像URL", Length = 255)]
public virtual string? UserAvatar { get; set; }
/// <summary>
/// 性别
/// </summary>
[SugarColumn(ColumnName = "gender", ColumnDescription = "性别")]
public virtual byte? Gender { get; set; }
/// <summary>
/// 身份证号码
/// </summary>
[SugarColumn(ColumnName = "identify_code", ColumnDescription = "身份证号码", Length = 30)]
public virtual string? IdentifyCode { get; set; }
/// <summary>
/// 手机号码
/// </summary>
[SugarColumn(ColumnName = "iphone_no", ColumnDescription = "手机号码", Length = 15)]
public virtual string? IphoneNo { get; set; }
/// <summary>
/// 邮箱
/// </summary>
[SugarColumn(ColumnName = "email", ColumnDescription = "邮箱", Length = 100)]
public virtual string? Email { get; set; }
/// <summary>
/// 家庭住址
/// </summary>
[SugarColumn(ColumnName = "home_addr", ColumnDescription = "家庭住址", Length = 100)]
public virtual string? HomeAddr { get; set; }
/// <summary>
/// 车牌号
/// </summary>
[SugarColumn(ColumnName = "car_no", ColumnDescription = "车牌号", Length = 20)]
public virtual string? CarNo { get; set; }
/// <summary>
/// 使用状态
/// </summary>
[SugarColumn(ColumnName = "state", ColumnDescription = "使用状态")]
public StatusEnum State { get; set; } = StatusEnum.Enable;
/// <summary>
/// 注册平台
/// </summary>
[SugarColumn(ColumnName = "register_plat", ColumnDescription = "注册平台")]
public virtual byte? RegisterPlat { get; set; }
/// <summary>
/// 支付宝userid
/// </summary>
[SugarColumn(ColumnName = "user_id", ColumnDescription = "支付宝userid", Length = 100)]
public virtual string? UserId { get; set; }
/// <summary>
/// 微信openid
/// </summary>
[SugarColumn(ColumnName = "open_id", ColumnDescription = "微信openid", Length = 100)]
public virtual string? OpenId { get; set; }
/// <summary>
/// unionid
/// </summary>
[SugarColumn(ColumnName = "union_id", ColumnDescription = "unionid", Length = 100)]
public virtual string? UnionId { get; set; }
/// <summary>
/// 公众号openid
/// </summary>
[SugarColumn(ColumnName = "wx_open_id", ColumnDescription = "公众号openid", Length = 100)]
public virtual string? WxOpenId { get; set; }
/// <summary>
/// 出生日期
/// </summary>
[SugarColumn(ColumnName = "birthday", ColumnDescription = "出生日期", Length = 50)]
public virtual string? Birthday { get; set; }
/// <summary>
/// 审核进度
/// </summary>
[SugarColumn(ColumnName = "audit_state", ColumnDescription = "审核进度")]
public virtual byte? AuditState { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnName = "created_by", ColumnDescription = "创建人", Length = 32)]
public virtual string? CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "created_time", ColumnDescription = "创建时间")]
public virtual DateTime? CreatedTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
[SugarColumn(ColumnName = "updated_by", ColumnDescription = "更新人", Length = 32)]
public virtual string? UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[SugarColumn(ColumnName = "updated_time", ColumnDescription = "更新时间")]
public virtual DateTime? UpdatedTime { get; set; }
}

@ -0,0 +1,161 @@
using SqlSugar;
namespace Entity.DbModel.System.App;
/// <summary>
/// 客户车辆表
/// </summary>
[SugarTable("app_customer_vehicle")]
public class AppCustomerVehicle
{
/// <summary>
/// 自增
/// </summary>
[SugarColumn(ColumnName = "id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = true)]
public virtual long Id { get; set; }
/// <summary>
/// 客户id
/// </summary>
[SugarColumn(ColumnName = "customer_id", ColumnDescription = "客户id")]
public virtual long? CustomerId { get; set; }
/// <summary>
/// 用户名
/// </summary>
[SugarColumn(ColumnName = "user_name", ColumnDescription = "用户名")]
public virtual string UserName { get; set; }
/// <summary>
/// 手机号
/// </summary>
[SugarColumn(ColumnName = "phone", ColumnDescription = "手机号")]
public virtual string? Phone { get; set; }
/// <summary>
/// 车队id
/// </summary>
[SugarColumn(ColumnName = "team_id", ColumnDescription = "车队id")]
public virtual long? TeamId { get; set; }
/// <summary>
/// 车辆id
/// </summary>
[SugarColumn(ColumnName = "car_id", ColumnDescription = "车辆id")]
public virtual long? CarId { get; set; }
/// <summary>
/// 车牌号
/// </summary>
[SugarColumn(ColumnName = "car_no", ColumnDescription = "车牌号")]
public virtual string CarNo { get; set; }
/// <summary>
/// VIN码
/// </summary>
[SugarColumn(ColumnName = "vin", ColumnDescription = "VIN码")]
public virtual string Vin { get; set; }
/// <summary>
/// MAC地址
/// </summary>
[SugarColumn(ColumnName = "mac", ColumnDescription = "MAC地址")]
public virtual string? Mac { get; set; }
/// <summary>
/// 发动机编号
/// </summary>
[SugarColumn(ColumnName = "engine_no", ColumnDescription = "发动机编号")]
public virtual string? EngineNo { get; set; }
/// <summary>
/// 行驶证图片
/// </summary>
[SugarColumn(ColumnName = "vehicle_license", ColumnDescription = "行驶证图片")]
public virtual string VehicleLicense { get; set; }
/// <summary>
/// 驾驶证图片
/// </summary>
[SugarColumn(ColumnName = "driver_license", ColumnDescription = "驾驶证图片")]
public virtual string DriverLicense { get; set; }
/// <summary>
/// 身份证人像面
/// </summary>
[SugarColumn(ColumnName = "id_front", ColumnDescription = "身份证人像面")]
public virtual string IdFront { get; set; }
/// <summary>
/// 身份证国徽面
/// </summary>
[SugarColumn(ColumnName = "id_back", ColumnDescription = "身份证国徽面")]
public virtual string IdBack { get; set; }
/// <summary>
/// 申请认证时间
/// </summary>
[SugarColumn(ColumnName = "apply_time", ColumnDescription = "申请认证时间")]
public virtual DateTime? ApplyTime { get; set; }
/// <summary>
/// 审核状态
/// 0:未审核;1:通过审核;2:审核拒绝
/// </summary>
[SugarColumn(ColumnName = "audit_status", ColumnDescription = "审核状态")]
public virtual int? AuditStatus { get; set; }
/// <summary>
/// 申请原因
/// </summary>
[SugarColumn(ColumnName = "audit_reason", ColumnDescription = "申请原因")]
public virtual string? AuditReason { get; set; }
/// <summary>
/// 是否默认扣费账户
/// </summary>
[SugarColumn(ColumnName = "is_default", ColumnDescription = "是否默认扣费账户")]
public virtual int? IsDefault { get; set; } = 0;
/// <summary>
/// 审核id
/// </summary>
[SugarColumn(ColumnName = "audit_id", ColumnDescription = "审核id")]
public virtual long? AuditId { get; set; }
/// <summary>
/// 审核人
/// </summary>
[SugarColumn(ColumnName = "audit_name", ColumnDescription = "审核人")]
public virtual string? AuditName { get; set; }
/// <summary>
/// 审核时间
/// </summary>
[SugarColumn(ColumnName = "audit_time", ColumnDescription = "审核时间")]
public virtual DateTime? AuditTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnName = "created_by", ColumnDescription = "创建人")]
public virtual string? CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "created_time", ColumnDescription = "创建时间")]
public virtual DateTime? CreatedTime { get; set; } = DateTime.Now;
/// <summary>
/// 更新人
/// </summary>
[SugarColumn(ColumnName = "updated_by", ColumnDescription = "更新人")]
public virtual string? UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[SugarColumn(ColumnName = "updated_time", ColumnDescription = "更新时间")]
public virtual DateTime? UpdatedTime { get; set; } = DateTime.Now;
}

@ -0,0 +1,100 @@
using SqlSugar;
namespace Entity.DbModel.System.App;
/// <summary>
/// 车队
/// </summary>
[SugarTable("car_team")]
public class CarTeam
{
/// <summary>
/// 自增
/// </summary>
[SugarColumn(ColumnName = "id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = true)]
public virtual long Id { get; set; }
/// <summary>
/// 客户id
/// </summary>
[SugarColumn(ColumnName = "customer_id", ColumnDescription = "客户id")]
public virtual long? CustomerId { get; set; }
/// <summary>
/// 车队编码
/// </summary>
[SugarColumn(ColumnName = "team_code", ColumnDescription = "车队编码", Length = 50)]
public virtual string TeamCode { get; set; }
/// <summary>
/// 车队名称
/// </summary>
[SugarColumn(ColumnName = "team_name", ColumnDescription = "车队名称", Length = 30, IsNullable = false)]
public virtual string TeamName { get; set; }
/// <summary>
/// 负责人
/// </summary>
[SugarColumn(ColumnName = "principal", ColumnDescription = "负责人", Length = 50)]
public virtual string Principal { get; set; }
/// <summary>
/// 联系方式
/// </summary>
[SugarColumn(ColumnName = "contact_way", ColumnDescription = "联系方式", Length = 300)]
public virtual string ContactWay { get; set; }
/// <summary>
/// 是否打折:0:否1是
/// </summary>
[SugarColumn(ColumnName = "is_discount", ColumnDescription = "是否打折:0:否1是")]
public virtual int? IsDiscount { get; set; }
/// <summary>
/// 折扣比例1-100
/// </summary>
[SugarColumn(ColumnName = "discount_percent", ColumnDescription = "折扣比例1-100")]
public virtual int? DiscountPercent { get; set; }
/// <summary>
/// 折扣范围:0全部折扣;1:计费模型折扣3电价折扣
/// </summary>
[SugarColumn(ColumnName = "discount_scope", ColumnDescription = "折扣范围:0全部折扣;1:计费模型折扣3电价折扣")]
public virtual int? DiscountScope { get; set; }
/// <summary>
/// 舍入模式:0.向下取整;1.四舍五入;2.向上取整
/// </summary>
[SugarColumn(ColumnName = "rounding_mode", ColumnDescription = "舍入模式:0.向下取整;1.四舍五入;2.向上取整", IsNullable = false)]
public virtual int RoundingMode { get; set; } = 0;
/// <summary>
/// 额度限制,小于此额度则认证失败,提示余额不足
/// </summary>
[SugarColumn(ColumnName = "limit", ColumnDescription = "额度限制,小于此额度则认证失败,提示余额不足", DecimalDigits = 2)]
public virtual decimal? Limit { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnName = "created_by", ColumnDescription = "创建人", Length = 32)]
public virtual string CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnName = "created_time", ColumnDescription = "创建时间", IsNullable = true, IsOnlyIgnoreUpdate = true)]
public virtual DateTime? CreatedTime { get; set; } = DateTime.Now;
/// <summary>
/// 更新人
/// </summary>
[SugarColumn(ColumnName = "updated_by", ColumnDescription = "更新人", Length = 32)]
public virtual string UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[SugarColumn(ColumnName = "updated_time", ColumnDescription = "更新时间", IsNullable = true)]
public virtual DateTime? UpdatedTime { get; set; } = DateTime.Now;
}

@ -0,0 +1,21 @@
namespace Entity.Dto.Req.App;
/// <summary>
/// 用户绑定车队
/// </summary>
public class CustomerTeamReq
{
/// <summary>
/// 登录号码
/// </summary>
public virtual string LoginNo { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public virtual long TeamId { get; set; }
/// <summary>
/// 绑定or解绑
/// </summary>
public virtual bool Bind { get; set; }
}

@ -0,0 +1,60 @@
using System.ComponentModel.DataAnnotations;
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Entity;
namespace Entity.Dto.Req.App;
/// <summary>
/// 获取App用户分页列表输入参数
/// </summary>
public class PageCustomerReq : QueryPageModel
{
/// <summary>
/// 账号
/// </summary>
public string Account { get; set; } = "";
/// <summary>
/// 姓名
/// </summary>
public string RealName { get; set; } = "";
}
/// <summary>
/// 增加App用户输入参数
/// </summary>
public class AddAppCustomerReq : AppCustomer
{
}
/// <summary>
/// 更新App用户输入参数
/// </summary>
public class UpdateAppCustomerReq : AddAppCustomerReq
{
}
/// <summary>
/// 修改用户密码输入参数
/// </summary>
public class CustomerPwdReq
{
/// <summary>
/// 账号
/// </summary>
[Required(ErrorMessage = "账号不能为空")]
public string LoginNo { get; set; }
/// <summary>
/// 当前密码
/// </summary>
[Required(ErrorMessage = "当前密码不能为空")]
public string PasswordOld { get; set; }
/// <summary>
/// 新密码
/// </summary>
[Required(ErrorMessage = "新密码不能为空"), MinLength(5, ErrorMessage = "密码需要大于5个字符")]
public string PasswordNew { get; set; }
}

@ -0,0 +1,47 @@
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Entity;
namespace Entity.Dto.Req;
/// <summary>
/// 车队分页查询参数
/// </summary>
public class PageCarTeamReq : QueryPageModel
{
/// <summary>
/// 车队编码
/// </summary>
public virtual string? TeamCode { get; set; }
/// <summary>
/// 车队名称
/// </summary>
public virtual string? TeamName { get; set; }
/// <summary>
/// 负责人
/// </summary>
public virtual string? Principal { get; set; }
}
/// <summary>
/// 增加车队
/// </summary>
public class AddCarTeamReq : CarTeam
{
}
/// <summary>
/// 修改车队
/// </summary>
public class UpdateCarTeamReq : AddCarTeamReq
{
}
/// <summary>
/// 删除车队
/// </summary>
public class DeleteCarTeamReq : BaseIdReq
{
}

@ -0,0 +1,70 @@
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Entity;
namespace Entity.Dto.Req;
/// <summary>
/// 客户车辆查询
/// </summary>
public class PageCustomerVehicleReq: QueryPageModel
{
/// <summary>
/// 客户id
/// </summary>
public virtual long? CustomerId { get; set; }
/// <summary>
/// 车牌
/// </summary>
public virtual string? CarNo { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public virtual int? AuditStatus { get; set; }
}
/// <summary>
/// 增加车辆
/// </summary>
public class AddCustomerVehicleReq : AppCustomerVehicle
{
}
/// <summary>
/// 修改车辆
/// </summary>
public class UpdateCustomerVehicleReq : AddCustomerVehicleReq
{
}
/// <summary>
/// 删除车辆
/// </summary>
public class DeleteCustomerVehicleReq : BaseIdReq
{
}
/// <summary>
/// 车辆审核
/// </summary>
public class VehicleAuditReq
{
/// <summary>
/// 车牌
/// </summary>
public virtual string CarNo { get; set; }
/// <summary>
/// 审核id
/// </summary>
public virtual long AuditId { get; set; }
/// <summary>
/// 审核人
/// </summary>
public virtual string AuditName { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual int? AuditStatus { get; set; }
}

@ -0,0 +1,133 @@
using Common.Enum;
using SqlSugar;
namespace Entity.Dto.Resp;
/// <summary>
/// App用户基础信息
/// </summary>
public class AppCustomerResp
{
/// <summary>
/// 自增
/// </summary>
public virtual long Id { get; set; }
/// <summary>
/// 登录号码
/// </summary>
public virtual string LoginNo { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public virtual long? TeamId { get; set; }
/// <summary>
/// 登录方式
/// </summary>
public virtual byte? LoginType { get; set; }
/// <summary>
/// 是否是会员
/// </summary>
public virtual byte? IsMember { get; set; }
/// <summary>
/// 用户昵称
/// </summary>
public virtual string NickName { get; set; }
/// <summary>
/// 姓名
/// </summary>
public virtual string? UserName { get; set; }
/// <summary>
/// 用户头像URL
/// </summary>
public virtual string? UserAvatar { get; set; }
/// <summary>
/// 性别
/// </summary>
public virtual byte? Gender { get; set; }
/// <summary>
/// 手机号码
/// </summary>
public virtual string IphoneNo { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public virtual string? Email { get; set; }
/// <summary>
/// 家庭住址
/// </summary>
public virtual string? HomeAddr { get; set; }
/// <summary>
/// 车牌号
/// </summary>
public virtual string? CarNo { get; set; }
/// <summary>
/// 使用状态
/// </summary>
public StatusEnum State { get; set; } = StatusEnum.Enable;
/// <summary>
/// 注册平台
/// </summary>
public virtual byte? RegisterPlat { get; set; }
/// <summary>
/// 支付宝userid
/// </summary>
public virtual string? UserId { get; set; }
/// <summary>
/// 微信openid
/// </summary>
public virtual string? OpenId { get; set; }
/// <summary>
/// unionid
/// </summary>
public virtual string? UnionId { get; set; }
/// <summary>
/// 公众号openid
/// </summary>
public virtual string? WxOpenId { get; set; }
/// <summary>
/// 出生日期
/// </summary>
public virtual string? Birthday { get; set; }
/// <summary>
/// 审核进度
/// </summary>
public virtual byte? AuditState { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string? CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreatedTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
public virtual string? UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public virtual DateTime? UpdatedTime { get; set; }
}

@ -0,0 +1,92 @@
using Common.Enum;
namespace Entity.Dto.Resp;
public class AppLoginResp
{
public string token { get; set; }
public long expireAt { get; set; }
/// <summary>
/// 自增
/// </summary>
public virtual long Id { get; set; }
/// <summary>
/// 运营商id
/// </summary>
public virtual long OperatorId { get; set; }
/// <summary>
/// 登录号码
/// </summary>
public virtual string LoginNo { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public virtual long? TeamId { get; set; }
/// <summary>
/// 是否是会员
/// </summary>
public virtual byte? IsMember { get; set; }
/// <summary>
/// 用户昵称
/// </summary>
public virtual string NickName { get; set; }
/// <summary>
/// 姓名
/// </summary>
public virtual string UserName { get; set; }
/// <summary>
/// 用户头像URL
/// </summary>
public virtual string UserAvatar { get; set; }
/// <summary>
/// 性别
/// </summary>
public virtual byte? Gender { get; set; }
/// <summary>
/// 手机号码
/// </summary>
public virtual string IphoneNo { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public virtual string Email { get; set; }
public StatusEnum State { get; set; } = StatusEnum.Enable;
public virtual string Birthday { get; set; }
public virtual byte? AuditState { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string CreatedBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreatedTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
public virtual string UpdatedBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public virtual DateTime? UpdatedTime { get; set; }
}

@ -16,10 +16,6 @@
<ProjectReference Include="..\Entity\Entity.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Station\AmtOrderInfoRepository.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="HybirdFrameworkCore">
<HintPath>..\Common\lib\HybirdFrameworkCore.dll</HintPath>

@ -0,0 +1,51 @@
using System.Linq.Expressions;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using log4net;
using SqlSugar;
namespace Repository.Station;
[Scope("SingleInstance")]
public class AmtOrderInfoRepository: BaseRepository<AmtOrderInfo>
{
private static readonly ILog _log = LogManager.GetLogger(typeof(AmtOrderInfoRepository));
public AmtOrderInfoRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
}
public IPage<AmtOrderInfo> QueryIPage(QueryPageModel page, Expression<Func<AmtOrderInfo, bool>> predicate)
{
if (null == predicate)
{
return QueryPage(page);
}
int totalCount = 0;
List<AmtOrderInfo> pageList = DbBaseClient
.Queryable<AmtOrderInfo>()
.Where(predicate)
.OrderByDescending(x => x.CreatedTime)
.WithNoLockOrNot(false)
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
return new IPage<AmtOrderInfo>(totalCount, page, pageList);
}
public IPage<AmtOrderInfo> QueryPage(QueryPageModel page)
{
int totalCount = 0;
List<AmtOrderInfo> pageList = DbBaseClient
.Queryable<AmtOrderInfo>()
.OrderByDescending(x => x.CreatedTime)
.WithNoLockOrNot(false)
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
return new IPage<AmtOrderInfo>(totalCount, page, pageList);
}
}

@ -0,0 +1,16 @@
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.Station;
[Scope]
public class CarTeamRepository : BaseRepository<CarTeam>
{
private ISqlSugarClient DbBaseClient;
public CarTeamRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
DbBaseClient = sqlSugar;
}
}

@ -0,0 +1,16 @@
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.System.App;
[Scope("SingleInstance")]
public class AppCustomerRepository : BaseRepository<AppCustomer>
{
private ISqlSugarClient DbBaseClient;
public AppCustomerRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
DbBaseClient = sqlSugar;
}
}

@ -0,0 +1,24 @@
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.System.App;
[Scope()]
public class AppCustomerVehicleRepository : BaseRepository<AppCustomerVehicle>
{
private ISqlSugarClient DbBaseClient;
public AppCustomerVehicleRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
DbBaseClient = sqlSugar;
}
public List<string> GetVinList(long? customerId)
{
List<AppCustomerVehicle> vehicles = QueryByClauseToList(u => u.CustomerId == customerId);
List<string> vinList = vehicles.Select(v => v.Vin ?? string.Empty).ToList();
return vinList;
}
}

@ -0,0 +1,55 @@
using Autofac;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Job;
using log4net;
using Repository.Station;
namespace Service.Job;
[Scope]
public class CancelAmtOrderJob : AbstractCronJob
{
private static readonly ILog Log = LogManager.GetLogger(typeof(CancelAmtOrderJob));
public readonly AmtOrderInfoRepository
_amtOrderInfoRepository = AppInfo.Container.Resolve<AmtOrderInfoRepository>();
public readonly BinInfoRepository _binInfoRepository = AppInfo.Container.Resolve<BinInfoRepository>();
protected override Task Handle()
{
var time = DateTime.Now;
DateTime halfHourAgo = time.AddMinutes(-30);
// 查询最近半小时内的预约订单
var recentOrders = _amtOrderInfoRepository.QueryListByClause(u =>
u.CreatedTime > halfHourAgo && u.Status == 1 && u.EndTime < time && u.SwapOrderNo == null);
if (recentOrders != null)
{
foreach (var amtOrderInfo in recentOrders)
{
amtOrderInfo.Status = 2;
// _binInfoRepository.UpdateAsync(i => i.ChargerNo == amtOrderInfo.BinNos, i => i.AmtLock == 0);
_binInfoRepository.UpdateAsync(i => i.AmtLock == 0,i => i.No == amtOrderInfo.BinNos);
}
_amtOrderInfoRepository.Update(recentOrders);
}
return Task.CompletedTask;
}
protected override string Key()
{
return "CancelAmtOrderJob";
}
protected override string Cron()
{
return "0 * * * * ?";
}
}

@ -0,0 +1,148 @@
using System.Linq.Expressions;
using Entity.Api.Req;
using Entity.DbModel.Station;
using Entity.DbModel.System.App;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using log4net;
using Repository.Station;
using Service.Init;
using Swapping.Business.Common;
namespace Service.Station;
[Scope("SingleInstance")]
public class AmtOrderInfoService : BaseServices<AmtOrderInfo>
{
private static readonly ILog Log = LogManager.GetLogger(typeof(AmtOrderInfoService));
private AmtOrderInfoRepository _amtOrderInfoRepository;
public BinInfoRepository _binInfoRepository { get; set; }
public AmtOrderInfoService(AmtOrderInfoRepository dal)
{
_amtOrderInfoRepository = dal;
BaseDal = dal;
}
public PageResult<AmtOrderInfo> AppQuerySwapOrder(QueryAmtOrderInfoPageReq req)
{
//创建一个空的表达式树
Expression<Func<AmtOrderInfo, bool>> where = null;
//// 定义参数表达式
ParameterExpression parameter = Expression.Parameter(typeof(AmtOrderInfo), "u");
where = queryTreeApp(req, where, parameter);
if (where == null)
{
return new PageResult<AmtOrderInfo>();
}
return PageResult<AmtOrderInfo>.ConvertPage(_amtOrderInfoRepository.QueryIPage(req, where));
}
/// <summary>
/// 添加预约订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<Result<string>> InsertAmtOrder(AddAmtOrderInfoReq input)
{
if (input == null || !input.CustomerId.HasValue)
{
return Result<string>.Fail("CustomerId为null");
}
BinInfo binInfo = await _binInfoRepository.QueryByClauseAsync(u => u.No == input.BinNos);
if (binInfo==null||binInfo.AmtLock==1||binInfo.Status==0||binInfo.CanSwapFlag==0)
{
return Result<string>.Fail("仓位不满足换电,请更换仓位预约");
}
var time = DateTime.Now;
DateTime halfHourAgo = time.AddMinutes(-30);
DateTime halfHourLater = time.AddMinutes(30);
// 查询最近半小时内的预约订单
var recentOrders = await _amtOrderInfoRepository.QueryByClauseAsync(u =>
u.CustomerId == input.CustomerId && u.CreatedTime > halfHourAgo && u.Status == 1);
if (recentOrders != null)
{
return Result<string>.Fail("您已有预约订单");
}
// 换电站编码
var stationNo = StaticStationInfo.StationNo;
// 生成订单号
var orderNo = SwapOrderNoGenerator.GenerateOrderNo(stationNo);
input.OrderNo = orderNo;
input.sn = stationNo;
input.Status = 1;
input.CreatedTime = time;
input.StartTime = time;
input.EndTime = halfHourLater;
input.BatteryNos = binInfo.BatteryNo;
input.Batnum = 1;
// 插入新订单
await _amtOrderInfoRepository.InsertAsync(input);
// 查询新插入的订单
var amtOrder = await _amtOrderInfoRepository.QueryByClauseAsync(u => u.OrderNo == orderNo);
if (amtOrder!=null)
{
await _binInfoRepository.UpdateAsync(i => i.AmtLock == 1,i => i.No == input.BinNos);
return Result<string>.Success("新增预约订单id: "+amtOrder.Id);
}
return Result<string>.Fail("新增预约订单失败");
}
public virtual async Task<Result<string>> CancelAmtOrder(DeleteAmtOrderInfoReq req)
{
var amtOrder = await _amtOrderInfoRepository.QueryByClauseAsync(u => u.Id == req.Id);
amtOrder.Status = 2;
if (await _amtOrderInfoRepository.UpdateAsync(amtOrder))
{
await _binInfoRepository.UpdateAsync(i => i.AmtLock == 1, i => i.ChargerNo == amtOrder.BinNos);
}
else
{
return Result<string>.Fail("失败");
}
return Result<string>.Success("成功取消");
}
private Expression<Func<AmtOrderInfo, bool>>? queryTreeApp(QueryAmtOrderInfoPageReq req,
Expression<Func<AmtOrderInfo, bool>>? where, ParameterExpression parameter)
{
if (req.Time != null)
{
DateTime startTime = new DateTime(req.Time.Value.Year, req.Time.Value.Month, 1, 0, 0, 0);
DateTime endTime = startTime.AddMonths(1).AddSeconds(-1);
Expression<Func<AmtOrderInfo, bool>> condition2Expr =
u => u.CreatedTime >= startTime && u.CreatedTime <= endTime;
where = where == null
? condition2Expr
: Expression.Lambda<Func<AmtOrderInfo, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body),
parameter);
}
if (req.CustomerId.HasValue)
{
Expression<Func<AmtOrderInfo, bool>> condition2Expr = u => u.CustomerId == req.CustomerId;
where = where == null
? condition2Expr
: Expression.Lambda<Func<AmtOrderInfo, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body),
parameter);
}
else
{
return null;
}
return where;
}
}

@ -0,0 +1,128 @@
using Entity.DbModel.System.App;
using Entity.Dto.Req;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository.Station;
using SqlSugar;
namespace Service.Station;
[Scope]
public class CarTeamService : BaseServices<CarTeam>
{
private readonly CarTeamRepository _carTeamRepository;
public CarTeamService(
CarTeamRepository carTeamRepository
)
{
_carTeamRepository = carTeamRepository;
}
/// <summary>
/// 获取车队分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PageResult<CarTeam>> Page(PageCarTeamReq input)
{
RefAsync<int> total = 0;
var items = await _carTeamRepository.QueryPageAsync(
entity => true,
!string.IsNullOrWhiteSpace(input.TeamCode), u => u.TeamCode.Equals(input.TeamCode.Trim()),
!string.IsNullOrWhiteSpace(input.TeamName), u => u.TeamName.Equals(input.TeamName.Trim()),
!string.IsNullOrWhiteSpace(input.Principal), u => u.Principal.Equals(input.Principal.Trim()),
u => u.CreatedTime, OrderByType.Desc, input.PageNum, input.PageSize, total);
return new PageResult<CarTeam>()
{
PageNum = input.PageNum,
PageSize = input.PageSize,
ToTal = total,
Rows = items,
};
}
/// <summary>
/// 获取所有车队
/// </summary>
/// <returns></returns>
public async Task<List<CarTeam>> GetTeamList()
{
return await _carTeamRepository.QueryAsync();
}
/// <summary>
/// 新增车队
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> AddCarTeamReq(AddCarTeamReq input)
{
var existingUser =
await _carTeamRepository.QueryByClauseAsync(u =>
u.TeamCode == input.TeamCode || u.TeamName == input.TeamName);
if (existingUser?.TeamCode == input.TeamCode)
{
return "车队编码已存在";
}
if (existingUser?.TeamName == input.TeamName)
{
return "车队名称已存在";
}
// 插入新用户
await _carTeamRepository.InsertAsync(input);
// 查询新ID
CarTeam carTeam = await _carTeamRepository.QueryByClauseAsync(u => u.TeamCode == input.TeamCode);
return "新增车队:" + carTeam.TeamName;
}
/// <summary>
/// 车队修改
/// </summary>
/// <param name="team"></param>
/// <returns></returns>
public virtual async Task<Result<string>> UpdateTeam(UpdateCarTeamReq team)
{
var existingTeam =
await _carTeamRepository.QueryByClauseAsync(u =>
u.TeamCode == team.TeamCode || u.TeamName == team.TeamName && u.Id != team.Id);
if (existingTeam?.TeamCode == team.TeamCode)
{
return Result<string>.Fail("修改失败,车队编码已存在");
}
if (existingTeam?.TeamName == team.TeamName)
{
return Result<string>.Fail("修改失败,车队名称已存在");
}
var updateAsync = await _carTeamRepository.UpdateAsync(team);
if (updateAsync)
{
return Result<string>.Success("修改成功");
}
return Result<string>.Fail("修改失败");
}
/// <summary>
/// 车队删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public virtual async Task<bool> DeleteTeam(DeleteCarTeamReq input)
{
var user = await _carTeamRepository.QueryByClauseAsync(u => u.Id == input.Id);
if (user == null)
throw new ArgumentException($"车队不存在");
return await _carTeamRepository.DeleteAsync(user);
}
}

@ -10,6 +10,7 @@ using AutoMapper;
using Entity.Dto;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using Repository.System.App;
using Service.Mgr;
namespace Service.Station;
@ -24,7 +25,7 @@ public class SwapOrderService : BaseServices<SwapOrder>
public SwapOrderReportCloudRepository SwapOrderReportCloudRepository { get; set; }
public SwapOrderMgr SwapOrderMgr { get; set; }
public AppCustomerVehicleRepository _appCustomerVehicleRepository{ get; set; }
public SwapOrderService(SwapOrderRepository dal)
{
BaseDal = dal;
@ -72,7 +73,7 @@ public class SwapOrderService : BaseServices<SwapOrder>
where = queryTree(swapOrder, where, parameter);
#endregion
//查询
//var swapOrderResp = PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPageByCause(swapOrder, where));
@ -85,8 +86,62 @@ public class SwapOrderService : BaseServices<SwapOrder>
//List<SwapOrderStepResp> StepList = new List<SwapOrderStepResp>();
return PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPage(swapOrder, where));
}
public PageResult<SwapOrderResp> AppQuerySwapOrder(QuerySwapOrderPageReq swapOrder)
{
//创建一个空的表达式树
Expression<Func<SwapOrder, bool>> where = null;
//// 定义参数表达式
ParameterExpression parameter = Expression.Parameter(typeof(SwapOrder), "u");
where = queryTreeApp(swapOrder, where, parameter);
if (where==null)
{
return new PageResult<SwapOrderResp>();
}
return PageResult<SwapOrderResp>.ConvertPage(swapOrderRepository.QueryIPage(swapOrder, where));
}
private Expression<Func<SwapOrder, bool>>? queryTreeApp(QuerySwapOrderPageReq swapOrder,
Expression<Func<SwapOrder, bool>>? where, ParameterExpression parameter)
{
if (swapOrder.Time != null)
{
DateTime startTime = new DateTime(swapOrder.Time.Value.Year, swapOrder.Time.Value.Month, 1, 0, 0, 0);
DateTime endTime = startTime.AddMonths(1).AddSeconds(-1);
Expression<Func<SwapOrder, bool>> condition2Expr = u => u.CreatedTime >= startTime && u.CreatedTime <= endTime;
where = where == null
? condition2Expr
: Expression.Lambda<Func<SwapOrder, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
}
if (swapOrder.CustomerId.HasValue)
{
List<string> vinList = _appCustomerVehicleRepository.GetVinList(swapOrder.CustomerId);
if (vinList != null && vinList.Count > 0)
{
Expression<Func<SwapOrder, bool>> condition2Expr = u => vinList.Contains(u.VehicleVin);
where = where == null
? condition2Expr
: Expression.Lambda<Func<SwapOrder, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body),
parameter);
}
}
else
{
return null;
}
return where;
}
private static Expression<Func<SwapOrder, bool>>? queryTree(QuerySwapOrderPageReq swapOrder,
private Expression<Func<SwapOrder, bool>>? queryTree(QuerySwapOrderPageReq swapOrder,
Expression<Func<SwapOrder, bool>>? where, ParameterExpression parameter)
{
if (!string.IsNullOrEmpty(swapOrder.Sn))
@ -106,6 +161,21 @@ public class SwapOrderService : BaseServices<SwapOrder>
: Expression.Lambda<Func<SwapOrder, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body),
parameter);
}
if (swapOrder.CustomerId.HasValue)
{
List<string> vinList = _appCustomerVehicleRepository.GetVinList(swapOrder.CustomerId);
if (vinList != null && vinList.Count > 0)
{
Expression<Func<SwapOrder, bool>> condition2Expr = u => vinList.Contains(u.VehicleVin);
where = where == null
? condition2Expr
: Expression.Lambda<Func<SwapOrder, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body),
parameter);
}
}
if (!string.IsNullOrEmpty(swapOrder.VehicleMac))
{

@ -0,0 +1,159 @@
using AutoMapper;
using Common.Util;
using Entity.DbModel.System.App;
using Entity.Dto.Req.App;
using Entity.Dto.Resp;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository.System.App;
namespace Service.System.App;
[Scope]
public class AppCustomerService : BaseServices<AppCustomer>
{
private readonly AppCustomerRepository _appCustomerRepository;
public AppCustomerService(
AppCustomerRepository appCustomerRepository
)
{
_appCustomerRepository = appCustomerRepository;
}
/// <summary>
/// App端新增用户
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> AddAppCustomer(AddAppCustomerReq input)
{
var existingUser =
await _appCustomerRepository.QueryByClauseAsync(u =>
u.LoginNo == input.LoginNo || u.IphoneNo == input.IphoneNo);
if (existingUser?.LoginNo == input.LoginNo)
{
return "账号已存在";
}
// 对密码进行加密
input.LoginPsd = CryptogramUtil.Encrypt(input.LoginPsd);
// 插入新用户
await _appCustomerRepository.InsertAsync(input);
// 查询新用户的ID
AppCustomer newAddUser = await _appCustomerRepository.QueryByClauseAsync(u => u.LoginNo == input.LoginNo);
return "新增账号:" + newAddUser.LoginNo;
}
/// <summary>
/// App用户基础信息
/// </summary>
/// <param name="loginNo"></param>
/// <returns></returns>
public virtual async Task<AppCustomerResp> GetBaseInfo(String loginNo)
{
AppCustomer appCustomer = await _appCustomerRepository.QueryByClauseAsync(u => u.LoginNo == loginNo);
var config = new MapperConfiguration(cfg => { cfg.CreateMap<AppCustomerResp, AppCustomer>().ReverseMap(); });
IMapper mapper = config.CreateMapper();
AppCustomerResp vo = mapper.Map<AppCustomerResp>(appCustomer);
return vo;
}
/// <summary>
/// 修改App用户基础信息
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public virtual async Task<Result<string>> UpdateBaseInfo(UpdateAppCustomerReq user)
{
var existingUser =
await _appCustomerRepository.QueryByClauseAsync(u =>
u.LoginNo == user.LoginNo && u.Id != user.Id);
if (existingUser?.LoginNo == user.LoginNo)
{
return Result<string>.Fail("修改失败,账号已存在");
}
int updateAsync = await _appCustomerRepository.UpdateAsync(user, true, u => new { u.LoginPsd });
if (updateAsync > 0)
{
return Result<string>.Success("修改成功");
}
return Result<string>.Fail("修改失败");
}
/// <summary>
/// 绑定车队
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public virtual async Task<Result<string>> BindTeam(CustomerTeamReq user)
{
var existingUser = await _appCustomerRepository.QueryByClauseAsync(u => u.LoginNo == user.LoginNo);
if (existingUser == null)
{
return Result<string>.Fail("账户不存在");
}
// 绑定or解绑
return user.Bind ? await TeamBind(user, existingUser) : await UnbindTeam(existingUser);
}
/// <summary>
/// 绑定车队
/// </summary>
/// <param name="user"></param>
/// <param name="existingUser"></param>
/// <returns></returns>
private async Task<Result<string>> TeamBind(CustomerTeamReq user, AppCustomer existingUser)
{
existingUser.TeamId = user.TeamId;
var updateAsync = await _appCustomerRepository.UpdateAsync(existingUser, true);
return updateAsync > 0 ? Result<string>.Success("绑定成功") : Result<string>.Fail("绑定失败");
}
/// <summary>
/// 解绑车队
/// </summary>
/// <param name="existingUser"></param>
/// <returns></returns>
private async Task<Result<string>> UnbindTeam(AppCustomer existingUser)
{
existingUser.TeamId = null;
var updateAsync = await _appCustomerRepository.UpdateAsync(existingUser, false);
return updateAsync > 0 ? Result<string>.Success("解绑成功") : Result<string>.Fail("解绑失败");
}
/// <summary>
/// 修改密码
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> UpdateCustomerPsd(CustomerPwdReq input)
{
var user = await _appCustomerRepository.QueryByClauseAsync(u => u.LoginNo == input.LoginNo);
if (CryptogramUtil.Decrypt(user.LoginPsd) != input.PasswordOld)
return "旧密码不匹配";
if (input.PasswordOld == input.PasswordNew)
return "新密码不能与旧密码相同";
user.LoginPsd = CryptogramUtil.Encrypt(input.PasswordNew);
await _appCustomerRepository.UpdateAsync(user);
return "修改密码成功";
}
}

@ -0,0 +1,119 @@
using Entity.DbModel.System.App;
using Entity.Dto.Req;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository.System.App;
using SqlSugar;
namespace Service.System.App;
[Scope()]
public class AppCustomerVehicleService : BaseServices<AppCustomerVehicle>
{
private readonly AppCustomerVehicleRepository _appCustomerVehicleRepository;
public AppCustomerVehicleService(
AppCustomerVehicleRepository appCustomerVehicleRepository
)
{
_appCustomerVehicleRepository = appCustomerVehicleRepository;
}
/// <summary>
/// 车辆分页查询
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PageResult<AppCustomerVehicle>> Page(PageCustomerVehicleReq input)
{
RefAsync<int> total = 0;
if (!input.CustomerId.HasValue)
{
return new PageResult<AppCustomerVehicle>();
}
var items = await _appCustomerVehicleRepository.QueryPageAsync(
entity => true,
(input.CustomerId.HasValue), u => u.CustomerId.Equals(input.CustomerId),
!string.IsNullOrWhiteSpace(input.CarNo), u => u.CarNo.Equals(input.CarNo.Trim()),
(input.AuditStatus.HasValue), u => u.AuditStatus.Equals(input.AuditStatus),
u => u.CreatedTime, OrderByType.Desc, input.PageNum, input.PageSize, total);
return new PageResult<AppCustomerVehicle>()
{
PageNum = input.PageNum,
PageSize = input.PageSize,
ToTal = total,
Rows = items,
};
}
/// <summary>
/// 车辆新增
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public virtual async Task<string> AddCustomerVehicle(AddCustomerVehicleReq input)
{
if (!input.CustomerId.HasValue)
{
return "客户id为空";
}
AppCustomerVehicle vehicle =
await _appCustomerVehicleRepository.QueryByClauseAsync(u => u.CarNo == input.CarNo);
if (vehicle != null)
{
return "该车牌已被绑定请先解绑";
}
input.ApplyTime = DateTime.Now;
input.AuditStatus = 0;
await _appCustomerVehicleRepository.InsertAsync(input);
// 查询新ID
AppCustomerVehicle newVehicle =
await _appCustomerVehicleRepository.QueryByClauseAsync(u => u.CarNo == input.CarNo);
return "新增车辆:" + newVehicle.CarNo;
}
/// <summary>
/// 车辆审核
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public virtual async Task<Result<string>> AuditVehicle(VehicleAuditReq req)
{
var vehicle = await _appCustomerVehicleRepository.QueryByClauseAsync(u => u.CarNo == req.CarNo);
if (vehicle == null)
{
return Result<string>.Fail("车辆不存在");
}
vehicle.AuditId = req.AuditId;
vehicle.AuditTime = DateTime.Now;
vehicle.AuditStatus = req.AuditStatus;
vehicle.AuditName = req.AuditName;
var updateAsync = await _appCustomerVehicleRepository.UpdateAsync(vehicle, true);
return updateAsync > 0 ? Result<string>.Success("修改成功") : Result<string>.Fail("修改失败");
}
/// <summary>
/// 删除解绑车辆
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public virtual async Task<bool> DeleteCustomerVehicle(DeleteCustomerVehicleReq input)
{
var vehicle = await _appCustomerVehicleRepository.QueryByClauseAsync(u => u.Id == input.Id);
if (vehicle == null)
throw new ArgumentException($"车辆不存在");
return await _appCustomerVehicleRepository.DeleteAsync(vehicle);
}
}

@ -0,0 +1,103 @@
using Autofac;
using AutoMapper;
using Common.Const;
using Common.Enum;
using Common.Util;
using Entity.DbModel.System.App;
using Entity.Dto.Resp;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using HybirdFrameworkCore.Redis;
using Repository.System.App;
namespace Service.System.App;
[Scope]
public class AppLoginService
{
private readonly AppCustomerRepository _appCustomerRepository;
public AppLoginService(
AppCustomerRepository appCustomerRepository
)
{
_appCustomerRepository = appCustomerRepository;
}
RedisHelper _redisHelper = AppInfo.Container.Resolve<RedisHelper>();
public async Task<Result<AppLoginResp>> Login(string username, string password)
{
// 判断密码错误次数默认10次
var keyErrorPasswordCount = $"{RedisConstMgr.AppKeyErrorPasswordCount}{username}";
int errorPasswordCount = Convert.ToInt32(_redisHelper.GetStrValue(keyErrorPasswordCount));
if (errorPasswordCount >= 10)
{
throw new ArgumentException($"密码错误次数过多,账号已锁定,请半小时后重试!");
}
AppCustomer user = await _appCustomerRepository.QueryByClauseAsync(u => u.LoginNo == username);
if (user == null)
{
throw new ArgumentException($"用户名不存在");
}
if (user.State == StatusEnum.Disable)
{
throw new ArgumentException($"当前账户处于禁用状态");
}
// // 国密SM2解密前端密码传输SM2加密后的
// password = CryptogramUtil.SM2Decrypt(password);
string verifyPassword = VerifyPassword(password, keyErrorPasswordCount, errorPasswordCount, user);
if (verifyPassword.Equals("密码不正确"))
{
throw new ArgumentException($"密码不正确");
}
// _userManager.SetManagerContent(user);
return Result<AppLoginResp>.Success(CreateResult(user, JwtUtil.BuildToken(username))) ;
}
private string VerifyPassword(string inputReq, string keyErrorPasswordCount, int errorPasswordCount,
AppCustomer user)
{
string result = "";
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
{
if (!user.LoginPsd.Equals(MD5Util.MD5Encrypt32(inputReq)))
{
errorPasswordCount++;
_redisHelper.SetKeyValueStr(keyErrorPasswordCount, errorPasswordCount.ToString());
result = "密码不正确";
}
}
else
{
if (!CryptogramUtil.Decrypt(user.LoginPsd).Equals(inputReq))
{
errorPasswordCount++;
_redisHelper.SetKeyValueStr(keyErrorPasswordCount, errorPasswordCount.ToString());
result = "密码不正确";
}
}
return result;
}
private AppLoginResp CreateResult(AppCustomer user, string token)
{
var config = new MapperConfiguration(cfg => { cfg.CreateMap<AppLoginResp, AppCustomer>().ReverseMap(); });
IMapper mapper = config.CreateMapper();
AppLoginResp vo = mapper.Map<AppLoginResp>(user);
vo.token = token;
vo.expireAt = LoginService.getTimeStamp();
return vo;
}
}

@ -1,23 +1,14 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using Aliyun.OSS.Util;
using Common.Enum;
using Common.Util;
using Entity.Base;
using Entity.DbModel.System;
using Entity.DbModel.System.App;
using Entity.Dto.Req;
using Furion.VirtualFileServer;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Configuration;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OnceMi.AspNetCore.OSS;
using Repository.System;
using Repository.System.App;
using Service.Mgr;
using SqlSugar;
using Yitter.IdGenerator;
@ -32,16 +23,20 @@ namespace Service.System
private readonly SysFileMgr _sysFileMgr;
private readonly string _imageType = ".jpg.png.bmp.gif.tif";
private readonly AppCustomerRepository _appCustomerRepository;
public SysFileServices(
SysUserRepository sysUserRepository,
SysFileRepository sysFileRep,
SysFileMgr sysFileMgr)
SysFileMgr sysFileMgr,
AppCustomerRepository appCustomerRepository
)
{
_sysUserRep = sysUserRepository;
_sysFileRep = sysFileRep;
_sysFileMgr = sysFileMgr;
_appCustomerRepository = appCustomerRepository;
}
@ -59,6 +54,21 @@ namespace Service.System
await _sysUserRep.UpdateAsync(u => new SysUser() { Avatar = sysFile.Url }, u => u.Id == user.Id);
return sysFile;
}
/// <summary>
/// App端上传头像
/// </summary>
/// <param name="file"></param>
/// <param name="path"></param>
/// <param name="loginNo"></param>
/// <returns></returns>
public async Task<SysFile> UploadAppAvatar([Required] IFormFile file, string path,string loginNo)
{
var sysFile = await _sysFileMgr.HandleUploadFile(file, path, _imageType);
await _appCustomerRepository.UpdateAsync(u => new AppCustomer() { UserAvatar = sysFile.Url }, u => u.LoginNo == loginNo);
return sysFile;
}
/// <summary>
/// 获取文件分页列表 🔖
@ -95,6 +105,7 @@ namespace Service.System
{
return await _sysFileMgr.HandleUploadFile(file, path);
}
/// <summary>
/// 上传文件Base64

@ -0,0 +1,59 @@
using System.ComponentModel.DataAnnotations;
using Entity.Api.Req;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Entity;
using log4net;
using Microsoft.AspNetCore.Mvc;
using Service.Station;
namespace WebStarter.Controllers;
/// <summary>
/// 预约订单
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class AmtOrderInfoController : ControllerBase
{
private static readonly ILog Log = LogManager.GetLogger(typeof(AmtOrderInfoController));
private readonly AmtOrderInfoService _amtOrderInfoService;
public AmtOrderInfoController(AmtOrderInfoService amtOrderInfoService)
{
this._amtOrderInfoService = amtOrderInfoService;
}
/// <summary>
/// 预约订单查询
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost("Page")]
public async Task<Result<PageResult<AmtOrderInfo>>> QueryPage([FromBody] QueryAmtOrderInfoPageReq req)
{
return Result<PageResult<AmtOrderInfo>>.Success(_amtOrderInfoService.AppQuerySwapOrder(req));
}
/// <summary>
/// 添加预约单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("add")]
public async Task<Result<string>> AddTeam([FromBody] [Required] AddAmtOrderInfoReq input)
{
return await _amtOrderInfoService.InsertAmtOrder(input);
}
/// <summary>
/// 取消预约订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("CancelAmtOrder")]
public async Task<Result<string>> CancelAmtOrder([FromBody] [Required] DeleteAmtOrderInfoReq input)
{
return await _amtOrderInfoService.CancelAmtOrder(input);
}
}

@ -0,0 +1,94 @@
using System.ComponentModel.DataAnnotations;
using Entity.DbModel.System.App;
using Entity.Dto.Req;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.Station;
namespace WebStarter.Controllers;
/// <summary>
/// 车队
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class CarTeamController
{
private readonly CarTeamService _carTeamService;
/// <summary>
///
/// </summary>
/// <param name="carTeamService"></param>
public CarTeamController(CarTeamService carTeamService)
{
_carTeamService = carTeamService;
}
/// <summary>
/// 查询车队分页
/// </summary>
/// <param name="req"> 查询参数</param>
/// <returns></returns>
[HttpPost]
[Route("GetTeamPage")]
public async Task<PageResult<CarTeam>> GetTeamPage(
[FromBody] PageCarTeamReq req)
{
return await _carTeamService.Page(req);
}
/// <summary>
/// 获取所有车队
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("GetTeamList")]
public async Task<Result<List<CarTeam>>> GetTeamList()
{
return Result<List<CarTeam>>.Success(await _carTeamService.GetTeamList());
}
/// <summary>
/// 新增车队
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("add")]
public async Task<Result<string>> AddTeam([FromBody] [Required] AddCarTeamReq input)
{
var data = await _carTeamService.AddCarTeamReq(input);
return Result<string>.Success(data);
}
/// <summary>
/// 修改车队
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
[HttpPost]
[Route("UpdateTeam")]
public async Task<Result<string>> UpdateTeam([FromBody] UpdateCarTeamReq user)
{
return await _carTeamService.UpdateTeam(user);
}
/// <summary>
/// 删除车队
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("delete")]
public async Task<Result<bool>> DeleteTeam([FromBody] [Required] DeleteCarTeamReq input)
{
var data = await _carTeamService.DeleteTeam(input);
if (data)
return Result<bool>.Success(data);
else
return Result<bool>.Fail(data);
}
}

@ -56,6 +56,30 @@ public class SwapOrderController : ControllerBase
var swapOrderResp = swapOrderService.QuerySwapOrder(req);
Log.Info($"查询换电订单 SwapOrderController end QueryPage swapOrderService.QuerySwapOrder req={req}");
PackageSwapOrder(swapOrderResp);
return Result<PageResult<SwapOrderResp>>.Success(swapOrderResp);
}
/// <summary>
/// app查询换电订单
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost("AppSwapOrder")]
public async Task<Result<PageResult<SwapOrderResp>>> AppSwapOrder([FromBody] QuerySwapOrderPageReq req)
{
Log.Info($"SwapOrderController QueryPage req={req}");
Log.Info($"查询换电订单 SwapOrderController start QueryPage swapOrderService.QuerySwapOrder req={req}");
var swapOrderResp = swapOrderService.AppQuerySwapOrder(req);
Log.Info($"查询换电订单 SwapOrderController end QueryPage swapOrderService.QuerySwapOrder req={req}");
PackageSwapOrder(swapOrderResp);
return Result<PageResult<SwapOrderResp>>.Success(swapOrderResp);
}
private void PackageSwapOrder(PageResult<SwapOrderResp> swapOrderResp)
{
//获取所有订单号
var orderSns = swapOrderResp.Rows.Select(row => row.Sn).ToList();
Log.Info($"查询上报云平台次数 SwapOrderController start QueryPage swapOrderService.QueryReportCloudNumBySn req={orderSns}");
@ -112,7 +136,6 @@ public class SwapOrderController : ControllerBase
swapOrderResp.Rows[i].StepList
.AddRange(swapOrderStep.Where(step => step.SwapOrderSn == swapOrderResp.Rows[i].Sn).ToList());
}
return Result<PageResult<SwapOrderResp>>.Success(swapOrderResp);
}
private PageResult<SwapOrderResp> BatteryCodeList(QuerySwapOrderPageReq req)

@ -0,0 +1,92 @@
using System.ComponentModel.DataAnnotations;
using Entity.Dto.Req.App;
using Entity.Dto.Resp;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.System.App;
namespace WebStarter.Controllers.System.App;
/// <summary>
/// App用户
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class AppCustomerController
{
private readonly AppCustomerService _appCustomerService;
/// <summary>
///
/// </summary>
/// <param name="appCustomerService"></param>
public AppCustomerController(AppCustomerService appCustomerService)
{
_appCustomerService = appCustomerService;
}
/// <summary>
/// App用户注册
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("add")]
public async Task<Result<string>> AddAppCustomer([FromBody] [Required] AddAppCustomerReq input)
{
var data = await _appCustomerService.AddAppCustomer(input);
return Result<string>.Success(data);
}
/// <summary>
/// 获取用户基础信息
/// </summary>
/// <param name="loginNo"></param>
/// <returns></returns>
[HttpGet]
[Route("GetInfo")]
public async Task<Result<AppCustomerResp>> GetBaseInfo(String loginNo)
{
return Result<AppCustomerResp>.Success(await _appCustomerService.GetBaseInfo(loginNo));
}
/// <summary>
/// 修改用户基础信息
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
[HttpPost]
[Route("UpdateInfo")]
public async Task<Result<string>> UpdateInfo([FromBody] UpdateAppCustomerReq user)
{
return await _appCustomerService.UpdateBaseInfo(user);
}
/// <summary>
/// 车队绑定
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
[HttpPost]
[Route("BindTeam")]
public async Task<Result<string>> BindTeam([FromBody] CustomerTeamReq user)
{
return await _appCustomerService.BindTeam(user);
}
/// <summary>
/// 修改密码
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("UpdateInfoPwd")]
public async Task<Result<string>> UpdateInfoPwd([FromBody] CustomerPwdReq input)
{
var data = await _appCustomerService.UpdateCustomerPsd(input);
return Result<string>.Success(data);
}
}

@ -0,0 +1,78 @@
using System.ComponentModel.DataAnnotations;
using Entity.DbModel.System.App;
using Entity.Dto.Req;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.System.App;
namespace WebStarter.Controllers.System.App;
/// <summary>
/// 客户车辆
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class AppCustomerVehicleController
{
private readonly AppCustomerVehicleService _appCustomerVehicleService;
/// <summary>
///
/// </summary>
/// <param name="appCustomerVehicleService"></param>
public AppCustomerVehicleController(AppCustomerVehicleService appCustomerVehicleService)
{
_appCustomerVehicleService = appCustomerVehicleService;
}
/// <summary>
/// 客户车辆分页
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("CustomerVehiclePage")]
public async Task<PageResult<AppCustomerVehicle>> CustomerVehiclePage(
[FromBody] PageCustomerVehicleReq req)
{
return await _appCustomerVehicleService.Page(req);
}
/// <summary>
/// 车辆新增
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("add")]
public async Task<Result<string>> AddTeam([FromBody] [Required] AddCustomerVehicleReq input)
{
var data = await _appCustomerVehicleService.AddCustomerVehicle(input);
return Result<string>.Success(data);
}
/// <summary>
/// 车辆审核
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("AuditVehicle")]
public async Task<Result<string>> AuditVehicle([FromBody] VehicleAuditReq req)
{
return await _appCustomerVehicleService.AuditVehicle(req);
}
/// <summary>
/// 删除解绑车辆
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("delete")]
public async Task<Result<bool>> Delete([FromBody] [Required] DeleteCustomerVehicleReq input)
{
var data = await _appCustomerVehicleService.DeleteCustomerVehicle(input);
if (data)
return Result<bool>.Success(data);
else
return Result<bool>.Fail(data);
}
}

@ -0,0 +1,39 @@
using System.ComponentModel.DataAnnotations;
using Entity.Dto.Req;
using Entity.Dto.Resp;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.System.App;
namespace WebStarter.Controllers.System.App;
/// <summary>
/// App登录
/// </summary>
[Produces("application/json")]
[ApiController]
public class AppLoginController : ControllerBase
{
private readonly AppLoginService _appLoginService;
/// <summary>
///
/// </summary>
/// <param name="appLoginService"></param>
public AppLoginController(AppLoginService appLoginService)
{
_appLoginService = appLoginService;
}
/// <summary>
/// 登录
/// </summary>
/// <param name="loginInputReq">账户 密码</param>
/// <returns></returns>
[HttpPost]
[Route("/api/app/login")]
public async Task<Result<AppLoginResp>> Login([FromBody] [Required] LoginReq loginInputReq)
{
return await _appLoginService.Login(loginInputReq.Account, loginInputReq.Password);
}
}

@ -32,7 +32,14 @@ namespace WebStarter.Controllers.System
[Route("/api/sysFile/uploadFile")]
public async Task<SysFile> UploadFile([Required] IFormFile file, [FromQuery] string? path)
{
return await _sysFileServices.UploadFile(file, path);
return await _sysFileServices.UploadFile(file, _webHostEnvironment.WebRootPath);
}
[HttpPost]
[Route("/api/app/uploadFile")]
public async Task<Result<SysFile>> AppUploadFile([Required] IFormFile file)
{
return Result<SysFile>.Success(await _sysFileServices.UploadFile(file, _webHostEnvironment.WebRootPath));
}
[HttpPost]
@ -57,6 +64,19 @@ namespace WebStarter.Controllers.System
{
return await _sysFileServices.UploadAvatar(file, _webHostEnvironment.WebRootPath);
}
/// <summary>
/// App上传头像
/// </summary>
/// <param name="file"></param>
/// <param name="loginNo"></param>
/// <returns></returns>
[HttpPost]
[Route("/api/app/sysFile/uploadAvatar")]
public async Task<SysFile> UploadAppAvatar([Required] IFormFile file, [FromForm] string loginNo)
{
return await _sysFileServices.UploadAppAvatar(file, _webHostEnvironment.WebRootPath,loginNo);
}
}

@ -152,7 +152,7 @@
"enable": true
},
"task": {
"enable": false
"enable": true
},
"Task": {
"Disabled": "ChargeOrderUploadTask"
@ -160,6 +160,9 @@
"fire": {
"enable": false
},
"Job": {
"Enabled": true
},
"Log": {
"Src": "D:\\RiderProjects\\hn_back_charger\\WebStarter\\bin\\Debug\\net6.0\\logs",
"Dest": "D:\\zip",

@ -0,0 +1,55 @@
/*
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;

@ -0,0 +1,53 @@
/*
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;

@ -0,0 +1,43 @@
/*
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;

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