1.数据库编译报错
2.修改货架IP接口
This commit is contained in:
@ -15,7 +15,7 @@ namespace WCS.DAL.Db
|
||||
/// </summary>
|
||||
public static SqlSugarScope db = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
ConnectionString = $"Data Source={DbPath.DataDbPath};Version=3;journal_mode=WAL;",
|
||||
ConnectionString = $"Data Source={DbPath.DataDbPath};",
|
||||
DbType = DbType.Sqlite,//[Sqlite]安装[System.Data.SQLite];
|
||||
IsAutoCloseConnection = true
|
||||
}, db =>
|
||||
|
@ -223,6 +223,53 @@ namespace WCS.WebApi.Controllers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Route("updateClientIp")]
|
||||
[HttpPost(Name = "updateClientIp")]
|
||||
public async Task<ResponseBase> updateClientIp(RequestBase request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (request.UserName != "aaa")
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "用户名不对头!修改货架的IP。"
|
||||
};
|
||||
}
|
||||
|
||||
//获取货架 此组后端管的货架
|
||||
var shelfInfos = DbHelp.db.Queryable<ShelfInfo>()
|
||||
.Where(t => t.ClientIp.Contains(".225."))
|
||||
.ToList();
|
||||
shelfInfos.ForEach(t => t.ClientIp = t.ClientIp.Replace(".225.", ".210."));
|
||||
|
||||
|
||||
var moduleInfos = DbHelp.db.Queryable<ModuleInfo>()
|
||||
.Where(t => t.CleintIp.Contains(".225."))
|
||||
.ToList();
|
||||
moduleInfos.ForEach(t => t.CleintIp = t.CleintIp.Replace(".225.", ".210."));
|
||||
|
||||
DbHelp.db.Updateable(moduleInfos).UpdateColumns(t => new { t.CleintIp }).ExecuteCommand();
|
||||
DbHelp.db.Updateable(shelfInfos).UpdateColumns(t => new { t.ClientIp }).ExecuteCommand();
|
||||
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "更新库位成功"
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user