执行代码清理,修复warning
This commit is contained in:
@@ -97,21 +97,23 @@ namespace Tnb.EquipMgr
|
||||
input.data["code"] = await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE);
|
||||
}
|
||||
|
||||
EqpRepairApply eqpRepairApply = new EqpRepairApply();
|
||||
eqpRepairApply.code = (string)input.data["code"];
|
||||
eqpRepairApply.name = (string)input.data["name"];
|
||||
eqpRepairApply.equip_id = (string)input.data["equip_id"];
|
||||
eqpRepairApply.expect_complete_time = input.data["expect_complete_time"] != null && input.data["expect_complete_time"].ToString() != "" ? Convert.ToDateTime(input.data["expect_complete_time"]) : null;
|
||||
eqpRepairApply.is_ugent = (int?)(long)input.data["is_ugent"];
|
||||
eqpRepairApply.attachment = input.data.ContainsKey("attachment") ? (string)input.data["attachment"] : null;
|
||||
eqpRepairApply.apply_user_id = (string)input.data["apply_user_id"];
|
||||
eqpRepairApply.create_id = (string)input.data["create_id"];
|
||||
eqpRepairApply.create_time = DateTime.Now;
|
||||
eqpRepairApply.org_id = (string)input.data["org_id"];
|
||||
eqpRepairApply.remark = (string)input.data["remark"];
|
||||
eqpRepairApply.description = (string)input.data["description"];
|
||||
eqpRepairApply.status = RepairApplyStatus.TOBEEXECUTED;
|
||||
await _repository.InsertAsync(eqpRepairApply);
|
||||
EqpRepairApply eqpRepairApply = new()
|
||||
{
|
||||
code = (string)input.data["code"],
|
||||
name = (string)input.data["name"],
|
||||
equip_id = (string)input.data["equip_id"],
|
||||
expect_complete_time = input.data["expect_complete_time"] != null && input.data["expect_complete_time"].ToString() != "" ? Convert.ToDateTime(input.data["expect_complete_time"]) : null,
|
||||
is_ugent = (int?)(long)input.data["is_ugent"],
|
||||
attachment = input.data.ContainsKey("attachment") ? (string)input.data["attachment"] : null,
|
||||
apply_user_id = (string)input.data["apply_user_id"],
|
||||
create_id = (string)input.data["create_id"],
|
||||
create_time = DateTime.Now,
|
||||
org_id = (string)input.data["org_id"],
|
||||
remark = (string)input.data["remark"],
|
||||
description = (string)input.data["description"],
|
||||
status = RepairApplyStatus.TOBEEXECUTED
|
||||
};
|
||||
_ = await _repository.InsertAsync(eqpRepairApply);
|
||||
|
||||
// VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
// await _runService.Create(templateEntity, input);
|
||||
@@ -122,7 +124,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<string> Repeal(Dictionary<string, string> dic)
|
||||
{
|
||||
string id = dic["id"];
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
status = RepairApplyStatus.REPEAL
|
||||
}, x => x.id == id);
|
||||
@@ -133,7 +135,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<string> Close(Dictionary<string, string> dic)
|
||||
{
|
||||
string id = dic["id"];
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
status = RepairApplyStatus.CLOSE,
|
||||
}, x => x.id == id);
|
||||
@@ -146,10 +148,10 @@ namespace Tnb.EquipMgr
|
||||
string id = dic["id"];
|
||||
string repairerId = dic["repairerId"];
|
||||
EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id);
|
||||
if (eqpRepairApply.status == RepairApplyStatus.TOBEEXECUTED ||
|
||||
eqpRepairApply.status == RepairApplyStatus.REFUSE)
|
||||
if (eqpRepairApply.status is RepairApplyStatus.TOBEEXECUTED or
|
||||
RepairApplyStatus.REFUSE)
|
||||
{
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
repairer_id = repairerId,
|
||||
status = RepairApplyStatus.TOBERECEIVED,
|
||||
@@ -172,7 +174,7 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
if (_userManager.UserId == eqpRepairApply.repairer_id)
|
||||
{
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
status = RepairApplyStatus.RECEIVED,
|
||||
}, x => x.id == id);
|
||||
@@ -194,7 +196,7 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
string id = dic["id"];
|
||||
string reason = dic["reason"];
|
||||
var db = _repository.AsSugarClient();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id);
|
||||
@@ -202,11 +204,11 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
if (_userManager.UserId == eqpRepairApply.repairer_id)
|
||||
{
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
status = RepairApplyStatus.REFUSE,
|
||||
}, x => x.id == id);
|
||||
EqpRepairRefuse eqpRepairRefuse = new EqpRepairRefuse()
|
||||
EqpRepairRefuse eqpRepairRefuse = new()
|
||||
{
|
||||
repair_apply_id = id,
|
||||
reason = reason,
|
||||
@@ -214,7 +216,7 @@ namespace Tnb.EquipMgr
|
||||
create_time = DateTime.Now,
|
||||
org_id = _userManager.GetUserInfo().Result.organizeId
|
||||
};
|
||||
await db.Insertable<EqpRepairRefuse>(eqpRepairRefuse).ExecuteCommandAsync();
|
||||
_ = await db.Insertable<EqpRepairRefuse>(eqpRepairRefuse).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -227,8 +229,7 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
|
||||
});
|
||||
if (!result.IsSuccess) throw Oops.Oh(result.ErrorMessage);
|
||||
return "拒绝成功";
|
||||
return !result.IsSuccess ? throw Oops.Oh(result.ErrorMessage) : "拒绝成功";
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@@ -248,7 +249,7 @@ namespace Tnb.EquipMgr
|
||||
if (_userManager.UserId == eqpRepairApply.repairer_id)
|
||||
{
|
||||
string status = input.is_out_apply == 1 ? RepairApplyStatus.TOBEOUTAPPLY : RepairApplyStatus.COMPLETED;
|
||||
await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairApply()
|
||||
{
|
||||
fault_id = input.fault_id,
|
||||
is_complete = input.is_complete,
|
||||
@@ -294,13 +295,13 @@ namespace Tnb.EquipMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetRepairRecordList(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<EqpRepairApply>()
|
||||
SqlSugarPagedList<EquipRepairRecordQueryOutput> result = await db.Queryable<EqpRepairApply>()
|
||||
.LeftJoin<UserEntity>((a, b) => a.apply_user_id == b.Id)
|
||||
.LeftJoin<UserEntity>((a, b, c) => a.repairer_id == c.Id)
|
||||
.Where(a => a.equip_id == input.equip_id)
|
||||
@@ -328,7 +329,7 @@ namespace Tnb.EquipMgr
|
||||
|
||||
DateTime? start_time = input.start_time;
|
||||
DateTime? end_time = input.end_time;
|
||||
List<string> statusList = new List<string>();
|
||||
List<string> statusList = new();
|
||||
if (!string.IsNullOrEmpty(input.status))
|
||||
{
|
||||
switch (input.status)
|
||||
@@ -363,8 +364,8 @@ namespace Tnb.EquipMgr
|
||||
input.sidx = "a." + input.sidx;
|
||||
}
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
var result = await db.Queryable<EqpRepairApply>()
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
SqlSugarPagedList<PadRepairListOutput> result = await db.Queryable<EqpRepairApply>()
|
||||
.LeftJoin<UserEntity>((a, b) => a.apply_user_id == b.Id)
|
||||
.LeftJoin<UserEntity>((a, b, c) => a.repairer_id == c.Id)
|
||||
.LeftJoin<EqpEquipment>((a, b, c, d) => a.equip_id == d.id)
|
||||
@@ -393,7 +394,7 @@ namespace Tnb.EquipMgr
|
||||
repairer_id_id = c.Id,
|
||||
remark = a.remark,
|
||||
status = f.FullName
|
||||
}).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50));
|
||||
}).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50);
|
||||
|
||||
return PageResult<PadRepairListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user