Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck
This commit is contained in:
@@ -552,5 +552,35 @@ namespace WorkFlowCheck.API.Controllers
|
||||
if (retVal.Data == null || retVal.Data.Count <= 0) { retVal.IsSuccess = false; retVal.Errors.Add("No data!"); }
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpPost("UpdateAllMobileUser")]
|
||||
public async Task<ApiResponseDTO<List<MobileUserDTO>>> UpdateAllMobileUser([FromBody] List<MobileUserDTO> mobileUserListDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<MobileUserDTO>>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var mobileUserDTO in mobileUserListDTO)
|
||||
{
|
||||
var userDTO = await _userService.GetUserAsync(mobileUserDTO.Id);
|
||||
if (userDTO != null && userDTO.Id == mobileUserDTO.Id)
|
||||
{
|
||||
userDTO.NFCCode = mobileUserDTO.NFCCode;
|
||||
var result = await _userService.UpdateUserAsync(userDTO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
|
||||
namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
@@ -31,5 +32,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
|
||||
Task<bool> DeviceMessageSend(DeviceMessageDTO deviceMessageDTO);
|
||||
Task<List<DeviceMessageDTO>> DeviceMessageReadUnreaded(string deviceId);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,6 +394,8 @@ namespace WorkFlowCheck.BL.Services
|
||||
user.Email = userDTO.Email;
|
||||
user.Active = userDTO.Active;
|
||||
user.NFCActive = userDTO.NFCActive;
|
||||
user.NFCCode = userDTO.NFCCode;
|
||||
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
retVal = _mapper.Map<UserDTO>(user);
|
||||
|
||||
Reference in New Issue
Block a user