1
This commit is contained in:
@@ -81,6 +81,7 @@ namespace Tnb.QcMgr
|
||||
CheckTaskOut.mainid = id;
|
||||
CheckTaskOut.wareid = QcCheckExecH.wareid!;
|
||||
CheckTaskOut.workid = QcCheckExecH.workid!;
|
||||
CheckTaskOut.status = QcCheckExecH.status!;
|
||||
if (!string.IsNullOrEmpty(CheckTaskOut.workid))
|
||||
CheckTaskOut.workname = db.Queryable<OrganizeEntity>().Where(p => p.Id == CheckTaskOut.workid).First().FullName;
|
||||
CheckTaskOut.checktypes = new List<CheckExecTypeOut>();
|
||||
@@ -130,13 +131,15 @@ namespace Tnb.QcMgr
|
||||
Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype);
|
||||
Item.setShow.excontent = !string.IsNullOrEmpty(QcCheckExecD.excontent);
|
||||
Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check);
|
||||
Item.setShow.errorcause = Item.setData.errorcause.Count == 0 ? false : true;
|
||||
Item.setShow.errorlevel = Item.setData.errorlevel.Count == 0 ? false : true;
|
||||
Item.setShow.errorcause = Item.setData.errorcause?.Count == 0 ? false : true;
|
||||
Item.setShow.errorlevel = Item.setData.errorlevel?.Count == 0 ? false : true;
|
||||
Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark);
|
||||
Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment);
|
||||
Item.setShow.customer = !string.IsNullOrEmpty(Item.setData.customer);
|
||||
Item.setShow.isexec = Item.setData.isexec == null ? false : true;
|
||||
CheckTaskOut.checktypes.Where(p => p.checktypeid == QcCheckExecD.typeid).First().items.Add(Item);
|
||||
if(!string.IsNullOrEmpty(QcCheckExecD.postdata))
|
||||
Item.postItemForm= JSON.Deserialize<PostItemForm>(QcCheckExecD.postdata!);
|
||||
CheckTaskOut.checktypes.Where(p => p.checktypeid == QcCheckExecD.typeid).First()?.items?.Add(Item);
|
||||
}
|
||||
return CheckTaskOut;
|
||||
}
|
||||
@@ -159,23 +162,29 @@ namespace Tnb.QcMgr
|
||||
QcCheckExecH.execuser = _userManager.UserId;
|
||||
QcCheckExecH.exectime = DateTime.Now.ToString();
|
||||
var QcCheckExecDs = await db.Queryable<QcCheckExecD>().Where(p => p.mainid == CheckTaskInput.mainid).ToListAsync();
|
||||
foreach (var checktype in CheckTaskInput.checktypes)
|
||||
if (CheckTaskInput.checktypes != null)
|
||||
{
|
||||
foreach (var item in checktype.items)
|
||||
foreach (var checktype in CheckTaskInput.checktypes)
|
||||
{
|
||||
var QcCheckExecD = QcCheckExecDs.Where(p => p.id == item.itemdid).FirstOrDefault();
|
||||
if (QcCheckExecD == null)
|
||||
continue;
|
||||
QcCheckExecD.excontent = item.excontent;
|
||||
QcCheckExecD.check = item.check;
|
||||
QcCheckExecD.errorcause = item.errorcause;
|
||||
QcCheckExecD.errorlevel = item.errorlevel;
|
||||
QcCheckExecD.remark = item.remark;
|
||||
QcCheckExecD.attachment = item.attachment;
|
||||
QcCheckExecD.isexec = item.isexec;
|
||||
QcCheckExecD.custom = item.customer;
|
||||
QcCheckExecD.result = item.result;
|
||||
QcCheckExecD.postdata = item.postItemForm;
|
||||
if (checktype.items != null)
|
||||
{
|
||||
foreach (var item in checktype.items)
|
||||
{
|
||||
var QcCheckExecD = QcCheckExecDs.Where(p => p.id == item.itemdid).FirstOrDefault();
|
||||
if (QcCheckExecD == null)
|
||||
continue;
|
||||
QcCheckExecD.excontent = item.excontent;
|
||||
QcCheckExecD.check = item.check;
|
||||
QcCheckExecD.errorcause = item.errorcause;
|
||||
QcCheckExecD.errorlevel = item.errorlevel;
|
||||
QcCheckExecD.remark = item.remark;
|
||||
QcCheckExecD.attachment = item.attachment;
|
||||
QcCheckExecD.isexec = item.isexec;
|
||||
QcCheckExecD.custom = item.customer;
|
||||
QcCheckExecD.result = item.result;
|
||||
QcCheckExecD.postdata = item.postItemForm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
await db.Ado.BeginTranAsync();
|
||||
@@ -183,7 +192,7 @@ namespace Tnb.QcMgr
|
||||
await db.Updateable(QcCheckExecDs).ExecuteCommandAsync();
|
||||
await db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw Oops.Oh(ErrorCode.COM1000);
|
||||
|
||||
Reference in New Issue
Block a user