public QM_Repair_Util_Response getRepairInfos(CV_QM_REPAIR_TOP_INFO param) { QM_Repair_Util_Response resp = new QM_Repair_Util_Response(); IList <CV_QM_REPAIR_TOP_INFO> repairTopList = cv_repair_infobo.GetEntitiesByQueryParam(param); if (repairTopList != null && repairTopList.Count != 0) { if (repairTopList.Count > 1) { resp.message = "此不良品对应多个报修!"; } else { resp.topList = repairTopList; ////获得不良现象 //QM_REPAIR_DETAILS detailParam = new QM_REPAIR_DETAILS() //{ // TGuid = repairTopList[0].TGuid, // AbnormalitySN = repairTopList[0].AbnormalitySN //}; //resp.detailList = repair_detailsbo.GetEntitiesByQueryParam(detailParam); ////获得维修物料 //QM_REPAIR_MATERIALS matParam = new QM_REPAIR_MATERIALS() //{ // TGuid = repairTopList[0].TGuid, // AbnormalitySN = repairTopList[0].AbnormalitySN //}; //resp.matList = repair_matbo.GetEntitiesByQueryParam(matParam); } //当前为aoi数据 if (repairTopList[0].Reporter == "AOI接口") { string sql = @"select stuff((select ',' + '''' + b.LotID + '''' from MM_LOTS_PCB a left join MM_LOTS_PCB b on a.PcbID = b.PcbID where a.LotID = '" + param.AbnormalitySN + "' for xml path('')),1,1,'') as LotIDs"; DataTable sns = bscbo.GetDataTableBySql(sql); if (sns != null && sns.Rows.Count > 0) { param.AbnormalitySN = null; param.Attribute05 = sns.Rows[0][0].ToString(); resp.topList = cv_repair_infobo.GetEntitiesByQueryParam(param); } else { resp.message = "拼版信息缺失"; } } } else { resp.message = "此不良品尚未报修,请重新报修!"; } return(resp); }
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); }