IdleResources
parent
9af9588792
commit
e9f4bf050a
|
|
@ -128,13 +128,44 @@ namespace OpenAuth.App
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> GetSequenceGen(string prefix)
|
//public async Task<string> GetSequenceGen(string prefix)
|
||||||
{
|
//{
|
||||||
var orderNumber = await _sequenceGenerator.NextAsync(
|
// var orderNumber = await _sequenceGenerator.NextAsync(
|
||||||
prefix,
|
// prefix,
|
||||||
$"{prefix}-{{0:00000}}");
|
// $"{prefix}-{{0:00000}}");
|
||||||
|
|
||||||
return orderNumber;
|
// return orderNumber;
|
||||||
|
//}
|
||||||
|
|
||||||
|
public async Task<string> GetSequenceGen(decimal lat, decimal lng, string prefix)
|
||||||
|
{
|
||||||
|
var sql = $" SELECT bsm FROM shp_drone_community where ST_Within(st_geomfromtext('POINT({lng} {lat})',4326), geom) = 't'";
|
||||||
|
var model = await client.SqlQueryable<dynamic>(sql).FirstAsync();
|
||||||
|
string bizCode = "";
|
||||||
|
if (model != null)
|
||||||
|
{
|
||||||
|
string bsm = model.bsm;
|
||||||
|
var org = await client.Queryable<SysOrg>().FirstAsync(a => a.Id.ToString() == bsm);
|
||||||
|
if (org != null)
|
||||||
|
{
|
||||||
|
bizCode = org.BizCode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bizCode = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bizCode = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
var orderNumber = await _sequenceGenerator.NextAsync(
|
||||||
|
prefix,
|
||||||
|
$"{prefix}-{{0:00000}}");
|
||||||
|
|
||||||
|
return bizCode + "-" + orderNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,12 +125,12 @@ namespace OpenAuth.WebApi.Controllers
|
||||||
/// <param name="prefix">前置类型</param>
|
/// <param name="prefix">前置类型</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<Response<string>> GetSequenceGen(string prefix)
|
public async Task<Response<string>> GetSequenceGen(decimal lat, decimal lng,string prefix)
|
||||||
{
|
{
|
||||||
var result = new Response<string>();
|
var result = new Response<string>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result.Result = await app.GetSequenceGen(prefix);
|
result.Result = await app.GetSequenceGen(lat,lng,prefix);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue