执行代码清理,修复warning

This commit is contained in:
2023-11-06 19:59:12 +08:00
parent c6b8dfc861
commit 1dbb17f103
118 changed files with 5046 additions and 4111 deletions

View File

@@ -40,12 +40,12 @@ namespace Tnb.EquipMgr
[HttpPost]
public async Task<string> Upload([FromForm] string equip_id, [FromForm] ChunkModel input)
{
string msg = "";
string msg;
try
{
var attachment = await _fileService.Uploader("annexpic", input);
dynamic attachment = await _fileService.Uploader("annexpic", input);
EqpEquipFile eqpEquipFile = new EqpEquipFile()
EqpEquipFile eqpEquipFile = new()
{
file_name = input.file.FileName,
equip_id = equip_id,
@@ -55,12 +55,11 @@ namespace Tnb.EquipMgr
org_id = _userManager.GetUserInfo().Result.organizeId,
};
await _repository.InsertAsync(eqpEquipFile);
_ = await _repository.InsertAsync(eqpEquipFile);
msg = "上传成功";
}
catch (Exception e)
{
msg = "上传失败";
Log.Error(e.Message);
throw Oops.Oh(ErrorCode.D8001);
}
@@ -71,13 +70,13 @@ namespace Tnb.EquipMgr
[HttpPost]
public async Task<dynamic> GetEquipFileList(EquipQueryInput input)
{
var db = _repository.AsSugarClient();
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
ISqlSugarClient db = _repository.AsSugarClient();
Dictionary<string, string>? queryJson = new();
if (!string.IsNullOrEmpty(input.queryJson))
{
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
}
var result = await db.Queryable<EqpEquipFile>()
SqlSugarPagedList<EquipFileQueryOutput> result = await db.Queryable<EqpEquipFile>()
.LeftJoin<UserEntity>((a, b) => a.create_id == b.Id)
.LeftJoin<UserEntity>((a, b, c) => a.modify_id == c.Id)
.LeftJoin<EqpEquipment>((a, b, c, d) => a.equip_id == d.id)