public RepairInfo getDetailMats(QM_REPAIR_TOP top) { return(new RepairInfo() { detailsList = getRepairDetail(top), matsList = getRepairMats(top) }); }
public IList <QM_REPAIR_MATERIALS> getRepairMats(QM_REPAIR_TOP top) { QM_REPAIR_MATERIALS matParam = new QM_REPAIR_MATERIALS() { TGuid = top.TGuid, AbnormalitySN = top.AbnormalitySN }; return(repair_matbo.GetEntitiesByQueryParam(matParam)); }
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); } //} }
public CV_QM_REPAIR_TOP_INFO submitRepairDetails(QM_Repair_Detail_SubmitParam param) { CV_QM_REPAIR_TOP_INFO cv_top = null; DateTime nowTime = SSGlobalConfig.Now; //不良现象维修结果 using (TransactionScope ts = new TransactionScope()) { CV_QM_REPAIR_TOP_INFO repair = param.repairOrder; //不良现象维修结果 foreach (QM_REPAIR_DETAILS detail in param.detailList) { if (!string.IsNullOrEmpty(detail.RepairResult)) { repair_detailsbo.UpdateSome(detail); } } //报修单维修结果 QM_REPAIR_TOP top = new QM_REPAIR_TOP() { TGuid = repair.TGuid, Status = param.status, Result = param.result, Repairer = param.repairer, RepairFinTime = nowTime }; //获得返回工序 if (param.result.Equals("OK")) { //判断报修工序是否为空 if (string.IsNullOrEmpty(repair.ReportStep)) { log.Info(repair.TGuid.ToString() + "报修工序为空"); } else { QM_INFRA_RETURNSTEP_CONFIG retStepParam = new QM_INFRA_RETURNSTEP_CONFIG() { ReportStepID = repair.ReportStep }; IList <QM_INFRA_RETURNSTEP_CONFIG> retStepConfigs = retStep_configbo.GetEntitiesByQueryParam(retStepParam); if (retStepConfigs == null || retStepConfigs.Count == 0) { log.Info(repair.TGuid.ToString() + "不存在对应的返回工序"); } else { top.ReturnStep = retStepConfigs[0].ReturnStepID; } } //需要更改SN状态 int type = 3; if (repair.ReportWorkshop.Equals("SMT")) { type = 1; } else if (repair.ReportWorkshop.Equals("DIP")) { type = 2; } //更改良品标识和locPK modifyLotStatusLoc(repair.AbnormalitySN, param.repairOrder.ReportLine, type, 2); } repair_topbo.UpdateSome(top); //重新查询获得 CV_QM_REPAIR_TOP_INFO cv_param = new CV_QM_REPAIR_TOP_INFO() { TGuid = repair.TGuid }; cv_top = cv_repair_infobo.GetEntitiesByQueryParam(cv_param)[0]; ts.Complete(); } return(cv_top); }