|
|
@@ -2658,6 +2658,264 @@ namespace Dongke.IBOSS.PRD.WCF.Services
|
|
|
return actionResult;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据所选生产数据ID,显示成检数据信息--复检专用
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="productionDataID">生产数据ID</param>
|
|
|
+ /// <returns>DataSet</returns>
|
|
|
+ public ActionResult GetProductionDataByIDSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, int productionDataID)
|
|
|
+ {
|
|
|
+ ActionResult actionResult = new ActionResult();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ // 验证请求头信息
|
|
|
+ actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey);
|
|
|
+
|
|
|
+ // 验证失败
|
|
|
+ if (actionResult.Status != (int)Constant.PDAResult.Success)
|
|
|
+ {
|
|
|
+ return actionResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ DataSet reworkDs = ServiceInvoker.Invoke<DataSet>(this,
|
|
|
+ () => PDAModuleLogic.GetProductionDataByIDSemiCheck(productionDataID));
|
|
|
+ PDAProductionDataResult productionDatas = new PDAProductionDataResult();
|
|
|
+ if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO)
|
|
|
+ {
|
|
|
+ if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < reworkDs.Tables[0].Rows.Count; i++)
|
|
|
+ {
|
|
|
+ PDAProductionDataResult productionData = new PDAProductionDataResult();
|
|
|
+ productionData.BarCode = reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
|
|
|
+ if (reworkDs.Tables[0].Rows[i]["GoodsID"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.GoodsID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsID"].ToString());
|
|
|
+ }
|
|
|
+ productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString();
|
|
|
+ productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString();
|
|
|
+ if (reworkDs.Tables[0].Rows[0]["DefectFlagID"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.DefectFlagID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["DefectFlagID"].ToString());
|
|
|
+ }
|
|
|
+ if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString());
|
|
|
+ }
|
|
|
+ productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString();
|
|
|
+ if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.UserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString());
|
|
|
+ }
|
|
|
+ if (reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.GoodsLevelTypeID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GoodsLevelTypeID"].ToString());
|
|
|
+ }
|
|
|
+ productionData.UserCode = reworkDs.Tables[0].Rows[i]["UserCode"].ToString();
|
|
|
+ productionData.UserName = reworkDs.Tables[0].Rows[i]["UserName"].ToString();
|
|
|
+ productionData.SpecialRepairflag = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SpecialRepairflag"]);
|
|
|
+ productionData.IsReFire = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsReFire"]);
|
|
|
+ productionData.KilnCarCode = reworkDs.Tables[0].Rows[i]["KilnCarCode"].ToString();
|
|
|
+ productionData.KilnCode = reworkDs.Tables[0].Rows[i]["KilnCode"].ToString();
|
|
|
+ productionData.GlazeName = reworkDs.Tables[0].Rows[i]["GlazeName"].ToString();
|
|
|
+ if (reworkDs.Tables[0].Rows[i]["logoid"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.LogoID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["logoid"]);
|
|
|
+ productionData.LogoCode = reworkDs.Tables[0].Rows[i]["LogoCode"].ToString();
|
|
|
+ productionData.LogoName = reworkDs.Tables[0].Rows[i]["LogoName"].ToString();
|
|
|
+ }
|
|
|
+ productionData.CreateTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CreateTime"]);
|
|
|
+ if (reworkDs.Tables[0].Rows[i]["CheckTime"].ToString() != "")
|
|
|
+ {
|
|
|
+ productionData.CheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["CheckTime"].ToString());
|
|
|
+ }
|
|
|
+ DataView dvDefect = reworkDs.Tables[1].DefaultView;
|
|
|
+ dvDefect.RowFilter = "BarCode=" + reworkDs.Tables[0].Rows[i]["BarCode"].ToString();
|
|
|
+ DataTable dtDefect = dvDefect.ToTable();
|
|
|
+ for (int row = 0; row < dtDefect.Rows.Count; row++)
|
|
|
+ {
|
|
|
+ // 产品缺陷
|
|
|
+ PDADefectResult defect = new PDADefectResult();
|
|
|
+ defect.SpecialDefect = dtDefect.Rows[row]["SpecialDefect"].ToString();
|
|
|
+ defect.DefectDeductionNum = Convert.ToDecimal(dtDefect.Rows[row]["DefectDeductionNum"].ToString());
|
|
|
+ if (dtDefect.Rows[row]["ProductionDefectID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.ProductionDefectID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDefectID"].ToString());
|
|
|
+ }
|
|
|
+ defect.BarCode = dtDefect.Rows[row]["BarCode"].ToString();
|
|
|
+ if (dtDefect.Rows[row]["DefectID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.DefectID = Convert.ToInt32(dtDefect.Rows[row]["DefectID"].ToString());
|
|
|
+ }
|
|
|
+ defect.DefectName = dtDefect.Rows[row]["DefectName"].ToString();
|
|
|
+ defect.DefectCode = dtDefect.Rows[row]["DefectCode"].ToString();
|
|
|
+ if (dtDefect.Rows[row]["DefectPositionID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.DefectPositionID = Convert.ToInt32(dtDefect.Rows[row]["DefectPositionID"].ToString());
|
|
|
+ }
|
|
|
+ defect.DefectPositionName = dtDefect.Rows[row]["DefectPositionName"].ToString();
|
|
|
+ defect.DefectPositionCode = dtDefect.Rows[row]["DefectPositionCode"].ToString();
|
|
|
+ if (dtDefect.Rows[row]["DefectProcedureID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.DefectProcedureID = Convert.ToInt32(dtDefect.Rows[row]["DefectProcedureID"].ToString());
|
|
|
+ }
|
|
|
+ defect.DefectProcedureName = dtDefect.Rows[row]["DefectProcedureName"].ToString();
|
|
|
+ defect.DefectProcedureCode = dtDefect.Rows[row]["DefectProcedureCode"].ToString();
|
|
|
+ if (dtDefect.Rows[row]["DefectUserID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.DefectUserID = Convert.ToInt32(dtDefect.Rows[row]["DefectUserID"].ToString());
|
|
|
+ }
|
|
|
+ defect.DefectUserName = dtDefect.Rows[row]["DefectUserName"].ToString();
|
|
|
+ defect.DefectUserCode = dtDefect.Rows[row]["DefectUserCode"].ToString();
|
|
|
+ if (dtDefect.Rows[row]["Jobs"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.Jobs = Convert.ToInt32(dtDefect.Rows[row]["Jobs"].ToString());
|
|
|
+ }
|
|
|
+ if (dtDefect.Rows[row]["MissedUserID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.MissedUserID = Convert.ToInt32(dtDefect.Rows[row]["MissedUserID"].ToString());
|
|
|
+ }
|
|
|
+ defect.MissedUserCode = dtDefect.Rows[row]["MissedUserCode"].ToString();
|
|
|
+ defect.MissedUserName = dtDefect.Rows[row]["MissedUserName"].ToString();
|
|
|
+ defect.JobsText = dtDefect.Rows[row]["JobsText"].ToString();
|
|
|
+ defect.DefectRemarks = dtDefect.Rows[row]["DefectRemarks"].ToString();
|
|
|
+
|
|
|
+ if (dtDefect.Rows[row]["ProductionDataID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.ProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["ProductionDataID"].ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dtDefect.Rows[row]["DefectProductionDataID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.DefectProductionDataID = Convert.ToInt32(dtDefect.Rows[row]["DefectProductionDataID"].ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dtDefect.Rows[row]["DefectFineID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defect.DefectFineID = Convert.ToInt32(dtDefect.Rows[row]["DefectFineID"].ToString());
|
|
|
+ }
|
|
|
+ defect.DefectFineValue = dtDefect.Rows[row]["DefectFineValue"].ToString();
|
|
|
+ defect.CheckTime = Convert.ToDateTime(dtDefect.Rows[row]["CheckTime"]);
|
|
|
+ //--------责任员工-------------------
|
|
|
+ DataRow[] drRow = reworkDs.Tables[2].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
|
|
|
+ if (drRow.Length > Constant.INT_IS_ZERO)
|
|
|
+ {
|
|
|
+ foreach (DataRow r in drRow)
|
|
|
+ {
|
|
|
+ PDADefectResponsibleResult defectResponsible = new PDADefectResponsibleResult();
|
|
|
+ if (r["ProductionDefectID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
|
|
|
+ }
|
|
|
+ if (r["StaffID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
|
|
|
+ }
|
|
|
+ defectResponsible.StaffCode = r["StaffCode"].ToString();
|
|
|
+ defectResponsible.StaffName = r["StaffName"].ToString();
|
|
|
+ if (r["StaffStatus"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
|
|
|
+ }
|
|
|
+ if (r["UJobsID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
|
|
|
+ }
|
|
|
+ if (r["SJobsID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
|
|
|
+ }
|
|
|
+ defect.PDADefectResponsibles.Add(defectResponsible);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //------------------------------
|
|
|
+
|
|
|
+ //--------漏检员工-------------------
|
|
|
+ DataRow[] drMissedRow = reworkDs.Tables[4].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[i]["ProductionDefectID"]);
|
|
|
+ if (drMissedRow.Length > Constant.INT_IS_ZERO)
|
|
|
+ {
|
|
|
+ foreach (DataRow r in drMissedRow)
|
|
|
+ {
|
|
|
+ PDADefectMissedResponsibleResult defectMissedResponsible = new PDADefectMissedResponsibleResult();
|
|
|
+ if (r["ProductionDefectID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectMissedResponsible.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
|
|
|
+ }
|
|
|
+ if (r["StaffID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectMissedResponsible.StaffID = Convert.ToInt32(r["StaffID"]);
|
|
|
+ }
|
|
|
+ defectMissedResponsible.StaffCode = r["StaffCode"].ToString();
|
|
|
+ defectMissedResponsible.StaffName = r["StaffName"].ToString();
|
|
|
+ if (r["StaffStatus"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectMissedResponsible.StaffStatus = Convert.ToInt32(r["StaffStatus"]);
|
|
|
+ }
|
|
|
+ if (r["UJobsID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectMissedResponsible.UJobsID = Convert.ToInt32(r["UJobsID"]);
|
|
|
+ }
|
|
|
+ if (r["SJobsID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectMissedResponsible.SJobsID = Convert.ToInt32(r["SJobsID"]);
|
|
|
+ }
|
|
|
+ defect.PDADefectMissedResponsibles.Add(defectMissedResponsible);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //------------------------------
|
|
|
+ DataRow[] drImageRow = reworkDs.Tables[3].Select("ProductionDefectID=" + reworkDs.Tables[1].Rows[row]["ProductionDefectID"]);
|
|
|
+ if (drImageRow.Length > Constant.INT_IS_ZERO)
|
|
|
+ {
|
|
|
+ foreach (DataRow r in drImageRow)
|
|
|
+ {
|
|
|
+ PDADefectImageResult defectImage = new PDADefectImageResult();
|
|
|
+ if (r["ProductionDefectID"].ToString() != "")
|
|
|
+ {
|
|
|
+ defectImage.ProductionDefectID = Convert.ToInt32(r["ProductionDefectID"]);
|
|
|
+ }
|
|
|
+ defectImage.Thumbnailpath = r["Thumbnailpath"].ToString();
|
|
|
+ //if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + r["Imagepath"].ToString()))
|
|
|
+ //{
|
|
|
+ defectImage.Imagepath = r["Imagepath"].ToString();// r["Imagepath"].ToString();
|
|
|
+ //}
|
|
|
+ defect.PDADefectImageResults.Add(defectImage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ productionData.PDADefects.Add(defect);
|
|
|
+ }
|
|
|
+ if (productionDatas.PDAProductionData == null)
|
|
|
+ {
|
|
|
+ productionDatas.PDAProductionData = new System.Collections.Generic.List<PDAProductionDataResult>();
|
|
|
+ }
|
|
|
+ productionDatas.PDAProductionData.Add(productionData);
|
|
|
+ //---------------------------------------------------------------------------------
|
|
|
+ }
|
|
|
+ }
|
|
|
+ actionResult.Result = JsonHelper.ToJson(productionDatas);
|
|
|
+ actionResult.Status = (int)Constant.PDAResult.Success;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ actionResult.Status = (int)Constant.PDAResult.Fail;
|
|
|
+ actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ //LogFileOperation.Error(DataManager.LogFileName, ex.Message);
|
|
|
+ OutputLog.TraceLog(LogPriority.Error,
|
|
|
+ this.ToString(),
|
|
|
+ System.Reflection.MethodBase.GetCurrentMethod().Name,
|
|
|
+ ex.ToString(),
|
|
|
+ LocalPath.LogExePath);
|
|
|
+ actionResult.Status = (int)Constant.PDAResult.Exception;
|
|
|
+ actionResult.Message = Constant.PDA_RESULT_EXCEPTION;
|
|
|
+ }
|
|
|
+ return actionResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 编辑后删除生产数据
|
|
|
/// </summary>
|