完成 += 和 -=操作

main
潘建东 6 months ago
parent b8b2f979d2
commit 3a3c4dc098

@ -40,34 +40,34 @@ namespace ZKLT.Hadoop.API
app.UseCors("all");
#endregion
app.UseHadoop((c) =>
{
c.Host = "127.0.0.1";
c.Account = "root";
c.PassWord = "root";
c.Key = "hadoopdb";
c.Port = 3306;
});
//app.UseHadoop((c) =>
//{
// c.Host = "127.0.0.1";
// c.Host = "172.17.0.1";
// c.Account = "root";
// c.PassWord = "root";
// c.Key = "hadoopdb";
// c.Port = 3306;
// c.Key = "testdb";
// c.Port = 4000;
//});
//app.UseHadoop((c) =>
//{
// c.Host = "172.17.0.1";
// c.Host = "118.195.165.218";
// c.Account = "root";
// c.PassWord = "root";
// c.Key = "testdb";
// c.Port = 4000;
//});
app.UseHadoop((c) =>
{
c.Host = "118.195.165.218";
c.Account = "root";
c.PassWord = "root";
c.Key = "testdb";
c.Port = 4000;
});
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{

@ -33,7 +33,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:59844",
"applicationUrl": "http://localhost:43666",
"sslPort": 0
}
}

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace ZKLT.Hadoop.Model
{
@ -42,5 +43,35 @@ namespace ZKLT.Hadoop.Model
return action;
}
}
/// <summary>
/// 列转换
/// </summary>
/// <param name="column">列</param>
/// <param name="param">参数</param>
/// <param name="action">公式</param>
/// <returns></returns>
public static string ColConvert(HDP_Column column, Dictionary<string, object> param,object value) {
string _guid;
if (value is string) {
string _action = value.ToString()!;
Regex _regex1 = new Regex(@"(?<=(\+\=))\d+");
if(_regex1.IsMatch(_action))
{
_guid = Guid.NewGuid().ToString("N");
param.Add(_guid,_regex1.Match(_action).Value);
return @$"`{column.Key}` + @{_guid}";
}
Regex _regex2 = new Regex(@"(?<=(\-\=))\d+");
if (_regex2.IsMatch(_action))
{
_guid = Guid.NewGuid().ToString("N");
param.Add(_guid, _regex2.Match(_action).Value);
return @$"`{column.Key}` - @{_guid}";
}
}
param.Add(column.Key!, value);
return $@"@{column.Key}";
}
}
}

@ -579,8 +579,7 @@ namespace ZKLT.Hadoop
var _column = table.Columns[i];
if (_row.ContainsKey(_column.Key!) && !_where.Any(x => x.ContainsKey(_column.Key!)))
{
_colstr.Append($@"`{_column.Key!}`=@{_column.Key!},");
_params.Add(_column.Key!, ((JValue)_row[_column.Key!]!).Value!);
_colstr.Append(@$"`{_column.Key!}`={HDP_CommandAction.ColConvert(_column,_params, ((JValue)_row[_column.Key!]!).Value!)},");
}
else if (!string.IsNullOrEmpty(_column.UpdateDefault))
{

Loading…
Cancel
Save