|
@@ -1,5 +1,7 @@
|
|
|
using AutoMapper;
|
|
|
+using MathNet.Numerics.Statistics.Mcmc;
|
|
|
using MySqlX.XDevAPI.Common;
|
|
|
+using NPOI.SS.Formula.Functions;
|
|
|
using OASystem.Domain;
|
|
|
using OASystem.Domain.AesEncryption;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
@@ -62,6 +64,9 @@ WHERE
|
|
|
{
|
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
+ var hotelDataDto = _mapper.Map<Res_HotelData>(dto);
|
|
|
+
|
|
|
+ EncryptionProcessor.EncryptProperties(hotelDataDto);// 加密属性
|
|
|
if (dto.Status == 1)//添加
|
|
|
{
|
|
|
string selectSql = string.Format(@"select * from Res_HotelData where Name='{0}' and IsDel='{1}'"
|
|
@@ -74,10 +79,7 @@ WHERE
|
|
|
}
|
|
|
else//不存在,可添加
|
|
|
{
|
|
|
- var _HotelDataDto = _mapper.Map<Res_HotelData>(dto);
|
|
|
-
|
|
|
- EncryptionProcessor.EncryptProperties(_HotelDataDto);// 加密属性
|
|
|
- int id = await AddAsyncReturnId(_HotelDataDto);
|
|
|
+ int id = await AddAsyncReturnId(hotelDataDto);
|
|
|
if (id == 0)
|
|
|
{
|
|
|
return result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
@@ -88,22 +90,10 @@ WHERE
|
|
|
}
|
|
|
else if (dto.Status == 2)//修改
|
|
|
{
|
|
|
- var updateInfo = new Res_HotelData
|
|
|
- {
|
|
|
- City = dto.City,
|
|
|
- Name = dto.Name,
|
|
|
- Level = dto.Level,
|
|
|
- Address = dto.Address,
|
|
|
- Tel = dto.Tel,
|
|
|
- Fax = dto.Fax,
|
|
|
- Contact = dto.Contact,
|
|
|
- ContactPhone = dto.ContactPhone,
|
|
|
- OtherInformation = dto.OtherInformation,
|
|
|
- Remark = dto.Remark,
|
|
|
- };
|
|
|
- EncryptionProcessor.EncryptProperties(updateInfo);// 加密属性
|
|
|
- bool res = await UpdateAsync(a => a.Id == dto.Id, a => updateInfo);
|
|
|
- if (!res)
|
|
|
+ var res = await _sqlSugar.Updateable(hotelDataDto)
|
|
|
+ .IgnoreColumns(x => new { x.CreateTime, x.CreateUserId, x.DeleteTime, x.DeleteUserId, x.IsDel })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (res < 1)
|
|
|
{
|
|
|
return result = new Result() { Code = -1, Msg = "修改失败!" };
|
|
|
}
|