public IList <QM_REPAIR_DETAILS> getRepairDetail(QM_REPAIR_TOP top) { QM_REPAIR_DETAILS Param = new QM_REPAIR_DETAILS() { TGuid = top.TGuid, AbnormalitySN = top.AbnormalitySN }; return(repair_detailsbo.GetEntitiesByQueryParam(Param)); }
public ReturnValue createScrap(QMRepairScrapRequest req) { ReturnValue rv = new ReturnValue { Result = "", Success = true, Message = "触发OA成功" }; try { DateTime now = SSGlobalConfig.Now; //using (TransactionScope ts = new TransactionScope()) //{ foreach (CV_QM_REPAIR_TO_SCRAP_INFO scrap in req.scrapList) { Guid guid = Guid.NewGuid(); QM_SCRAP_TOP top = new QM_SCRAP_TOP() { TGuid = guid, ScrapID = "S" + DateTime.Now.ToString("yyyyMMddHHmmss"), ScrapSN = scrap.AbnormalitySN, //不良码 OrderID = scrap.OrderID, //工单 RepairID = scrap.ReportID, //维修单号 ScrapWorkshop = scrap.ReportWorkshop, //报废车间 ScrapLine = scrap.ReportLine, //报废产线 ScrapStep = scrap.ReportStep, //报废工序 //ScrapPrincipal //报废责任人 ScrapAppTime = now, //报废办理时间 ScrapApplicant = req.user, //报废办理人 Status = "申请中" //报废单状态 }; scrap_topbo.Insert(top); //获得不良现象 QM_REPAIR_DETAILS detailParam = new QM_REPAIR_DETAILS() { TGuid = scrap.TGuid, AbnormalitySN = scrap.AbnormalitySN }; IList <QM_REPAIR_DETAILS> details = repair_detailsbo.GetEntitiesByQueryParam(detailParam); foreach (QM_REPAIR_DETAILS detail in details) { QM_SCRAP_DETAILS scrap_detail = new QM_SCRAP_DETAILS() { TGuid = guid, ScrapSN = scrap.AbnormalitySN, Abnormality = detail.Abnormality, SupAbnormality = detail.SupAbnormality }; scrap_detailsbo.Insert(scrap_detail); } rv = abnormalToOA(top, req.user); if (!rv.Success) { top.Status = "申请失败"; scrap_topbo.UpdateSome(top); return(rv); } //修改报修单的状态成“报废中” QM_REPAIR_TOP repairTop = new QM_REPAIR_TOP() { TGuid = scrap.TGuid, Status = "报废中" }; repair_topbo.UpdateSome(repairTop); } //ts.Complete(); return(rv); } catch (Exception ex) { rv.Success = false; rv.Message = ex.Message; return(rv); } //} }