|
@@ -635,33 +635,32 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
info.LastUpdateUserId = dto.UserId;
|
|
|
info.CreateUserId = dto.UserId;
|
|
|
|
|
|
+
|
|
|
if (dto.PortType == 1) //web
|
|
|
{
|
|
|
-
|
|
|
- var _nationalTravelFee = _sqlSugar.Storageable(info).ToStorage();
|
|
|
if (dto.Id == 0) //新增
|
|
|
{
|
|
|
var isNul = await _sqlSugar
|
|
|
.Queryable<Grp_NationalTravelFee>()
|
|
|
.FirstAsync(x => x.IsDel == 0 &&
|
|
|
- info.ProvinceId == x.ProvinceId &&
|
|
|
- info.Continent.Contains(dto.Continent) &&
|
|
|
- info.Country.Contains(dto.Country) &&
|
|
|
- info.City.Contains(dto.City));
|
|
|
+ x.Continent.Equals(dto.Continent) &&
|
|
|
+ x.Country.Equals(dto.Country) &&
|
|
|
+ x.City.Equals(dto.City) &&
|
|
|
+ x.ProvinceId == info.ProvinceId);
|
|
|
if (isNul != null)
|
|
|
{
|
|
|
result.Msg = "该国家或者城市已存在,请勿重复添加!";
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- _nationalTravelFee.AsInsertable.ExecuteCommand(); //不存在插入
|
|
|
+ await _sqlSugar.Insertable(info) .ExecuteCommandAsync();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- _nationalTravelFee.AsUpdateable
|
|
|
+ await _sqlSugar.Updateable(info)
|
|
|
.IgnoreColumns(it => new { it.CreateUserId, it.CreateTime, it.IsDel })
|
|
|
.WhereColumns(it => it.Id)
|
|
|
- .ExecuteCommand(); //存在更新
|
|
|
+ .ExecuteCommandAsync();
|
|
|
}
|
|
|
|
|
|
result.Code = 200;
|