/******************************************************************************* * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential * 类的信息: * 1.程序名称:PDAModuleService.cs * 2.功能描述:PDA模块WCF服务 * 编辑履历: * 作者 日期 版本 修改内容 * 陈晓野 2014/09/16 1.00 新建 *******************************************************************************/ using System; using System.Collections.Generic; using System.Data; using System.IO; using System.ServiceModel; using System.ServiceModel.Activation; using Curtain.Log; using Dongke.IBOSS.PRD.Basics.BaseResources; using Dongke.IBOSS.PRD.Basics.Library; using Dongke.IBOSS.PRD.Service.BarcodePrintService; using Dongke.IBOSS.PRD.Service.CommonModuleLogic; using Dongke.IBOSS.PRD.Service.DataModels; using Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic; using Dongke.IBOSS.PRD.Service.PCModuleLogic; using Dongke.IBOSS.PRD.Service.PDAModuleLogic; using Dongke.IBOSS.PRD.Service.PMModuleLogic; using Dongke.IBOSS.PRD.Service.PublicModuleService; using Dongke.IBOSS.PRD.Service.ReportModuleLogic; using Dongke.IBOSS.PRD.Service.SmartDeviceService; using Dongke.IBOSS.PRD.Service.SystemModuleLogic; using Dongke.IBOSS.PRD.WCF.Contracts; using Dongke.IBOSS.PRD.WCF.DataModels; using Dongke.IBOSS.PRD.WCF.DataModels.ConfigModule; using Dongke.IBOSS.PRD.WCF.DataModels.HRModule; using Dongke.IBOSS.PRD.WCF.DataModels.PCModule; using Dongke.IBOSS.PRD.WCF.DataModels.PMModule; namespace Dongke.IBOSS.PRD.WCF.Services { // 服务实现类,继承服务声明接口 // 该标签声明该服务可以在ASP.NET下运行 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(ConfigurationName = "PDAModuleService", InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)] public partial class PDAModuleService : IPDAModule { #region 属性 /// /// 用户登陆的信息 /// SUserInfo sUserInfo { get; set; } #endregion #region 构造函数 /// /// 构造函数 /// public PDAModuleService() : base() { } #endregion #region 验证 /// /// 验证访问头 /// /// 帐套编码 /// 用户编码 /// 用户密码 /// 访问密钥 /// private ActionResult DoPDACheck(string accountCode, string userCode, string userPassword, string sessionKey) { try { ActionResult actionResult = new ActionResult(); LoginRequestEntity requestEntity = new LoginRequestEntity(); requestEntity.AccountCode = accountCode; requestEntity.UserCode = userCode; requestEntity.Password = userPassword; requestEntity.SessionKey = sessionKey; SUserInfo userInfo = null; string loginStatus = DKIBOSSPRDLogic.AuthenticateRepeatLogin(requestEntity, out userInfo); // 用户登录信息错误 if (Constant.INT_IS_ONE.ToString().Equals(loginStatus)) { actionResult.Status = (int)Constant.PDAResult.LoginInfoError; actionResult.Message = Constant.PDA_RESULT_LOGININFOERROR; } // 用户在其它终端登陆 else if (Constant.INT_IS_TWO.ToString().Equals(loginStatus)) { actionResult.Status = (int)Constant.PDAResult.RepeatLogin; actionResult.Message = Constant.PDA_RESULT_REPEATLOGIN; } // Lic错误 else if ("3".Equals(loginStatus)) { actionResult.Status = (int)Constant.PDAResult.LicInfoError; actionResult.Message = "授权信息错误,请联系管理员。"; } else { actionResult.Status = (int)Constant.PDAResult.Success; } sUserInfo = userInfo; return actionResult; } catch (Exception ex) { throw ex; } } #endregion #region WCF服务 /// /// 测试PDA连接WCF服务 /// /// 测试文本 /// 返回文本 public string TestConnectionEx(string value) { return "连接成功!" + value; } public string TestConnection() { return "连接成功!"; } #endregion #region 系统登录 /// /// 系统登录 /// /// /// /// /// /// /// /// /// /// /// /// public PDALoginResult DoPDALogin(string accountCode, string userCode, string userPassword, string macAddress, string ipAddress, string phoneCode, string phoneType, string appVersion, string systemType, string systemVersion) { try { LoginRequestEntity requestEntity = new LoginRequestEntity(); requestEntity.AccountCode = accountCode; requestEntity.UserCode = userCode; requestEntity.Password = userPassword; requestEntity.ComputerName = phoneCode; requestEntity.IPAddress = ipAddress; requestEntity.MACAddress = macAddress; PDALoginResult result = ServiceInvoker.Invoke(this, () => PDAModuleLogic.DoPDALogin(requestEntity)); return result; } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), LocalPath.LogExePath); PDALoginResult result = new PDALoginResult(); result.Status = (int)Constant.PDAResult.Exception; result.Message = Constant.PDA_RESULT_EXCEPTION; return result; } } /// /// 退出 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// public ActionResult DoPDAOut(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } bool result = DKIBOSSPRDLogic.Logout(sUserInfo.UserID, "3", sUserInfo); actionResult.Result = JsonHelper.ToJson(result); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 修改密码 /// /// /// /// /// /// public ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey, string newPassWord) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } string result = ServiceInvoker.Invoke(this, () => SystemModuleDAL.SaveUserPassWord(newPassWord, userCode, null, sUserInfo)); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 取得展示数据 /// /// 获得生产线菜单 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// /// /// 陈冰 2014.09.18 新建 /// public ActionResult GetProductionLineMenu(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } // 查询菜单 DataTable dtPLM = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetProductionLineMenu(sUserInfo)); PDAFunctionResult pdaFunction = new PDAFunctionResult(); pdaFunction.MenuCode = "Root"; DataRow[] navigationRows = dtPLM.Select("LEN(MenuCode) = " + Constant.INT_IS_TWO.ToString(), "MenuCode ASC"); // 编号2为一级菜单 foreach (DataRow newRow in navigationRows) { #region 插入子节点数据 int? intProcedureID = null; int? intModelType = null; if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString())) { intProcedureID = Convert.ToInt32(newRow["ProcedureID"]); } if (!string.IsNullOrEmpty(newRow["ModelType"].ToString())) { intModelType = Convert.ToInt32(newRow["ModelType"]); } PDAFunctionResult pdaFunctionChild = new PDAFunctionResult(); pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString(); pdaFunctionChild.MenuName = newRow["MenuName"].ToString(); pdaFunctionChild.ProcedureID = intProcedureID; pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString(); pdaFunctionChild.ModelType = intModelType; pdaFunction.PDAFunctions.Add(pdaFunctionChild); #endregion InitTreeView(dtPLM, newRow["MenuCode"].ToString(), pdaFunctionChild); } //actionResult.Result = JsonHelper.ToJson(dtPLM); actionResult.Result = JsonHelper.ToJson(pdaFunction); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 初始化树形控件 /// /// 菜单数据表 /// 待处理的菜单集合 /// 当前树节点 private void InitTreeView(DataTable treeTable, string pFuncCode, PDAFunctionResult pFunctions) { string filterExpression = "MenuCode LIKE '" + pFuncCode + "%' AND LEN(MenuCode) = " + (pFuncCode.Length + Constant.INT_IS_TWO); DataRow[] subRows = treeTable.Select(filterExpression, "MenuCode ASC"); //DataRow[] subRows = treeTable.Select(filterExpression, "ProcedureCode ASC"); foreach (DataRow newRow in subRows) { #region 插入子节点数据 int? intProcedureID = null; int? intModelType = null; if (!string.IsNullOrEmpty(newRow["ProcedureID"].ToString())) { intProcedureID = Convert.ToInt32(newRow["ProcedureID"]); } if (!string.IsNullOrEmpty(newRow["ModelType"].ToString())) { intModelType = Convert.ToInt32(newRow["ModelType"]); } PDAFunctionResult pdaFunctionChild = new PDAFunctionResult(); pdaFunctionChild.MenuCode = newRow["MenuCode"].ToString(); pdaFunctionChild.MenuName = newRow["MenuName"].ToString(); pdaFunctionChild.ProcedureID = intProcedureID; pdaFunctionChild.ProcedureModel = newRow["ProcedureModel"].ToString(); pdaFunctionChild.ModelType = intModelType; pFunctions.PDAFunctions.Add(pdaFunctionChild); #endregion // 递归方法 InitTreeView(treeTable, newRow["MenuCode"].ToString(), pdaFunctionChild); } } #endregion #region 获得工序信息 /// /// 获得工序信息 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// /// /// 陈冰 2014.09.18 新建 /// public ActionResult GetProcedureByID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ProcedureEntity procedureEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetProcedureDataEntityByID(procedureID, sUserInfo)); actionResult.Result = JsonHelper.ToJson(procedureEntity); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 校验 /// /// 校验产品条码是否可以走到该工序 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 条码 /// /// /// 陈冰 2014.09.18 新建 /// public ActionResult CheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet barcodeDataSet = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckBarcodePDA(procedureID, barcode, sUserInfo)); if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]); 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; } /// /// 校验产品条码是否可以进行干补 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 条码 /// /// /// 袁新成 2015.4.1 新建 /// public ActionResult CheckDryRepairBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet barcodeDataSet = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckDryRepairBarcode(procedureID, barcode, sUserInfo)); if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]); 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; } /// /// 检验生产工号 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 生产工号 /// /// 陈冰 2014.09.18 新建 /// public ActionResult CheckProcedureUser(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string procedureUserCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } CheckProcedureUserResult checkProcedureUserResult = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckProcedureUser(procedureID, procedureUserCode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(checkProcedureUserResult); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 校验窑车是否可装车并返回窑车信息 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 窑车号 /// 工序类别 /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult CheckKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int pProcedureId, string kilnCarCode, int modelType) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } CheckKilnCarResultEntity checkKilnCarResultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckKilnCar(pProcedureId, kilnCarCode, modelType, sUserInfo)); actionResult.Result = JsonHelper.ToJson(checkKilnCarResultEntity); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 保存条码信息 /// /// 保存条码信息 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 条码信息 public ActionResult AddWorkPiece(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataTable dtProductionData = DataConvert.ObjectConvertToTable(productionDataEntitys); if (!dtProductionData.Columns.Contains("IsPDA")) { dtProductionData.Columns.Add("IsPDA"); } ProcedureEntity procedureInfo = null; DataTable resultDT = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddWorkPiece(procedureID, dtProductionData, sUserInfo, out procedureInfo)); actionResult.Result = JsonHelper.ToJson(resultDT); actionResult.Status = (int)Constant.PDAResult.Success; if (resultDT != null) { DataRow[] drs = resultDT.Select("out_errMsg is not null and out_errMsg <> ''"); if (drs != null && drs.Length > 0) { return actionResult; } } #region PDA条码打印 if (procedureInfo != null && procedureInfo.BarCodePrintCopies > 0 && procedureInfo.ModelType == (int)Constant.ProcedureModelType.Normal) { try { if (procedureInfo.CollectType == 1) { //foreach (DataRow item in dtProductionData.Rows) //{ // ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(item["barcode"].ToString(), // procedureInfo.BarCodePrintCopies, null, sUserInfo); // if (sre.Status != Constant.ServiceResultStatus.Success) // { // actionResult.Status = (int)Constant.ServiceResultStatus.Other; // actionResult.Message = sre.Message; // return actionResult; // } //} } else { //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(dtProductionData.Rows[0]["barcode"].ToString(), // procedureInfo.BarCodePrintCopies, null, sUserInfo); ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(dtProductionData.Rows[0]["barcode"].ToString(), procedureInfo.BarCodePrintCopies, null, sUserInfo, 0); if (sre.Status != Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.ServiceResultStatus.Other; actionResult.Message = sre.Message; return actionResult; } } } catch (Exception ex) { OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), LocalPath.LogExePath); actionResult.Status = (int)Constant.ServiceResultStatus.Other; actionResult.Message = "条码打印异常"; return actionResult; } } #endregion PDA条码打印 } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), LocalPath.LogExePath); try { string ss = JsonHelper.ToJson(productionDataEntitys); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, $" userCode:{userCode} procedureID:{procedureID} " + ss, LocalPath.LogExePath); } catch { } actionResult.Status = (int)Constant.PDAResult.Exception; actionResult.Message = Constant.PDA_RESULT_EXCEPTION; } return actionResult; } #endregion #region 获得系统/基数数据 /// /// 获得数据字典 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 字典类型 /// public ActionResult GetDataDictionaryByType(string accountCode, string userCode, string userPassword, string sessionKey, string dicType) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataTable dicDataTable = ServiceInvoker.Invoke(this, () => CommonModuleLogic.GetDataDictionaryByType(sUserInfo, dicType)); actionResult.Result = JsonHelper.ToJson(dicDataTable); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 检验工序接口 /// /// 获得检验标识 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult GetDefectFlagData(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } #region 构造缺陷标识的数据源 DataTable dtDefectFlag = CreateDataSource.GetDefectFlagTable(); #endregion actionResult.Result = JsonHelper.ToJson(dtDefectFlag); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 由条码和当前检验工序获取返工工序 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 当前检验工序ID /// 条码 /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult GetReworkProcedureByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { 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(this, () => PMModuleLogic.GetReworkProcedureByBarcode(procedureID, barcode)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 由当前检验工序获取缺陷列表 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 当前检验工序ID /// 缺陷编码 /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult GetDefectByProcedureIDAndDefectCode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string defectCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } object defectDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetDefectByProcedureIDAndDefectCode(procedureID, defectCode)); if (defectDs != null) { actionResult.Result = JsonHelper.ToJson(defectDs); 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; } /// /// 根据产品ID查出缺陷位置 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 产品ID /// 位置编码 /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult GetDefectPositionByGoodsIDAndPositionCode(string accountCode, string userCode, string userPassword, string sessionKey, int goodsID, string positionCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } // 缺陷位置已经不用在关联产品 //object defectDs = ServiceInvoker.Invoke(this,() => PMModuleLogic.GetDefectPositionByGoodsIDAndPositionCode(goodsID, positionCode)); object defectDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetDefectPosition(positionCode, sUserInfo)); if (defectDs != null) { actionResult.Result = JsonHelper.ToJson(defectDs); 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; } /// /// 通过条码和缺陷查出责任工序 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 条码 /// 缺陷ID /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult GetDutyProcedureByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int defectid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dutyProcedureDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetDutyProcedureByBarCode(barcode, defectid, sUserInfo.AccountID)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs); 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; } /// /// 通过条码与工序查出责任工号(己废) /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 条码 /// 责任工序 /// /// /// 陈冰 2014.10.04 新建 /// public ActionResult GetDutyProcedureCodeByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int dutyProcedureID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dutyProcedureDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetDutyProcedureCodeByBarCode(barcode, dutyProcedureID)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 通过条码与工序查出责任工号 /// /// /// /// /// /// 生产数据ID /// public ActionResult GetDutyProcedureCodeByProductionDataID(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 dutyProcedureDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetDutyProcedureCodeByProductionDataID(ProductionDataID)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 通过生产数据与工号ID查询工种 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 生产数据ID /// 工号ID /// /// /// 陈冰 2014.10.08 新建 /// public ActionResult GetDutyJobsByUserIDAndProductionID(string accountCode, string userCode, string userPassword, string sessionKey, //int productionDataID, int userID) int classesSettingID, int defectid, int procedureID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dutyProcedureDs = ServiceInvoker.Invoke(this, //() => PMModuleLogic.GetDutyJobsCodeByUser(userID, productionDataID)); () => PDAModuleLogic.GetDutyJobsCodeByUser(classesSettingID, defectid, procedureID)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 根据生产数据ID,用户ID及工种选出责任员工 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 生产数据ID /// 工号ID /// 工种ID /// /// /// 陈冰 2014.10.08 新建 /// public ActionResult GetDutyStaffByUserIDAndJobs(string accountCode, string userCode, string userPassword, string sessionKey, //int productionDataID, int userID, int jobsID) int classesSettingID, int jobsID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dutyProcedureDs = ServiceInvoker.Invoke(this, //() => PMModuleLogic.GetDutyStaffByUserIDAndJobs(productionDataID, userID, jobsID)); () => PDAModuleLogic.GetDutyStaffByUserIDAndJobs(classesSettingID, jobsID)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 获得产品分级 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// /// /// 陈冰 2014.10.08 新建 /// public ActionResult GetGoodsGradeData(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } #region 构造产品分级的数据源 //DataTable dtGrade = CreateDataSource.GetGoodsGradeTable(); DataSet dsGrade = SystemModuleLogic.GetGoodsLevel(2, sUserInfo); if (dsGrade != null && dsGrade.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dsGrade.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Constant.PDA_RESULT_UNKNOWN_ERR; } #endregion } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), LocalPath.LogExePath); 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; } #endregion #region 保存检验条码 /// /// 保存检验条码 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 条码信息 /// public ActionResult AddCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, ProductionDataEntity[] productionDataEntitys) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } //if(productionDataEntitys.Length>0) //{ // if(productionDataEntitys[0].ProductionDataID>0) // { // productionDataEntitys[0].OPTimeStamp = Convert.ToDateTime(productionDataEntitys[0].OPTimeStampPDA.Replace("-","/")); // } //} string err = ServiceInvoker.Invoke(this, //() => PMModuleLogicDAL.AddCheckBarcode(procedureID, productionDataEntitys, sUserInfo)); () => PMModuleLogicDAL.AddCheckBarcodePDA(procedureID, productionDataEntitys, sUserInfo)); if (err == null) { err = ""; } //actionResult.Result = JsonHelper.ToJson(err); actionResult.Result = err;// JsonHelper.ToJson(err); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 文件上传下载 /// /// 软件更新 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// public Stream AutoUpgrade(string accountCode, string userCode, string userPassword, string sessionKey) { try { return ServiceInvoker.Invoke(this, () => PDAModuleLogic.AutoUpgrade()); } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), LocalPath.LogExePath); return null; } } /// /// 上传临时文件 /// /// /// public ActionResult SaveImg(Stream mageStream) { ActionResult actionResult = new ActionResult(); try { string err = PDAModuleLogic.SaveImg(mageStream); if (err == null) { err = ""; } actionResult.Result = err; actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public Stream GetFileTest(string path) { return PDAModuleLogic.GetImg(path); } public Stream GetFileStream() { FileStream fs = new FileStream("999.apk", FileMode.OpenOrCreate, FileAccess.Read); long l = fs.Length; return fs; } public byte[] GetFileTestByte(string path) { FileStream stream = new FileInfo(path).OpenRead(); Byte[] buffer = new Byte[stream.Length]; //从流中读取字节块并将该数据写入给定缓冲区buffer中 stream.Read(buffer, 0, Convert.ToInt32(stream.Length)); return buffer; } public string GetFile(string path) { string imgFilePath = path; System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open); int i = (int)fs.Length; byte[] content = new byte[i]; fs.Read(content, 0, i); string result = Convert.ToBase64String(content); fs.Close(); FileStream fsTxt = new FileStream("A.txt", FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(fsTxt, System.Text.Encoding.Default); sw.Write(result); sw.Close(); fsTxt.Close(); return result; } #endregion /// /// 获得产品分级 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 当前工序ID /// /// /// 陈冰 2014.10.22 新建 /// public ActionResult GetReworkProcedureByProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID) { 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(this, () => PMModuleLogic.GetReworkProcedureByProcedureID(procedureID)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 获得产品分级 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 条码 /// public ActionResult GetKilnCarByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { 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(this, () => PMModuleLogic.GetKilnCarByBarCode(barcode)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } #region 统计 /// /// 统计当日计数数量 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// public ActionResult StatisticsCollectBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID) { 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(this, () => PDAModuleLogic.StatisticsCollectBarcode(procedureID, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 统计当日计数数量 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// public ActionResult StatisticsKilnCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID) { 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(this, () => PDAModuleLogic.StatisticsKilnCar(procedureID, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 统计产品跟踪 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// public ActionResult StatisticsProductTrack(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } RPT020101_SE se = new RPT020101_SE(); se.Barcode = barcode; ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.ReportModuleLogic.ReportModuleLogic.GetRPT020101SData(sUserInfo, se)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } //ProductionDataEntity productionDataEntity = ServiceInvoker.Invoke(this, // () => PDAModuleLogic.StatisticsProductTrack(barcode, sUserInfo)); //if (productionDataEntity != null) //{ // actionResult.Result = JsonHelper.ToJson(productionDataEntity); // actionResult.Status = (int)Constant.PDAResult.Success; //} //else //{ // actionResult.Status = (int)Constant.PDAResult.Fail; // actionResult.Message = Messages.MSG_CMN_I002; //} } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString() + ex.HelpLink, LocalPath.LogExePath); actionResult.Status = (int)Constant.PDAResult.Exception; actionResult.Message = Constant.PDA_RESULT_EXCEPTION; } return actionResult; } #endregion #region 撤销装车及成检 /// /// 检验条码是否可以撤销装车 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 当前工序ID /// 条码 /// public ActionResult CheckCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } CheckCancelLoadCar checkCancelLoadCar = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckCancelLoadCar(procedureID, barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(checkCancelLoadCar); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 保存撤销装车的条码 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 当前工序ID /// 条码 /// public ActionResult AddCancelLoadCar(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } string err = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddCancelLoadCar(procedureID, barcode, sUserInfo)); if (err == null) { err = ""; } actionResult.Result = JsonHelper.ToJson(err); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 由产品条码获取注浆信息 /// /// /// public ActionResult GetGroutingProducttByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { 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(this, () => PDAModuleLogic.GetGroutingProducttByBarCode(barcode)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 获取工号下的所有工种信息 /// /// 工号ID /// public ActionResult GetAllJobsByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int UserID) { 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(this, () => PDAModuleLogic.GetAllJobsByUserID(UserID, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 根据所选工号对应的工种,查出缺陷责任员工 /// /// 工种ID /// public ActionResult GetDutyStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs) { 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(this, () => PDAModuleLogic.GetDutyStaffByUserID(jobs, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 根据所选工号,查出漏检责任员工 /// /// 工号 /// public ActionResult GetMissedStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid) { 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(this, () => PDAModuleLogic.GetMissedStaffByUserID(userid, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 获取用户列表 /// /// 用户实体 /// public ActionResult SearchUserData(string accountCode, string userCode, string userPassword, string sessionKey, byte IsWorker) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } SUserEntity requestEntity = new SUserEntity(); requestEntity.IsWorker = IsWorker; DataSet reworkDs = ServiceInvoker.Invoke(this, () => PDAModuleLogic.SearchUserData(requestEntity, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 获取数据字典管理的数据 /// /// 显示停用标识 /// 字典类别 /// /// /// 2014.12.03 新建 /// public ActionResult GetDictionaryData(string accountCode, string userCode, string userPassword, string sessionKey, byte Pvalue, string dictionaryType) { 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(this, () => PDAModuleLogic.GetDictionaryData(Pvalue, dictionaryType, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } #endregion #region 保存半检数据 /// /// 保存半检数据 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 半检信息 /// public ActionResult AddSemiTest(string accountCode, string userCode, string userPassword, string sessionKey, SemiTestEntity[] semiTestEntitys) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } string err = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddSemiTest(semiTestEntitys, sUserInfo)); if (err == null) { err = ""; } actionResult.Result = JsonHelper.ToJson(err); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion /// /// 获取产品列表 /// /// public ActionResult SerachGoods(string accountCode, string userCode, string userPassword, string sessionKey, int valueFlag) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } GoodsEntity goodsEntity = new GoodsEntity(); goodsEntity.ValueFlag = 1;//有效标记 DataSet reworkDs = ServiceInvoker.Invoke(this, () => PDAModuleLogic.SerachGoods(sUserInfo, goodsEntity)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 使用存储过程PRO_PM_GetProductionData获取生产工序计件数据 /// /// 生产数据实体类 /// DataTable public ActionResult GetProductionData(string accountCode, string userCode, string userPassword, string sessionKey, int ProcedureID, string BarCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } SearchProductionDataEntity searchEntity = new SearchProductionDataEntity(); searchEntity.ProcedureID = ProcedureID; searchEntity.BarCode = BarCode; DataTable reworkDs = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetProductionData(searchEntity, sUserInfo)); if (reworkDs != null && reworkDs.Rows.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Constant.PDA_RESULT_ALLOW_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; } /// /// 根据所选生产数据ID,显示成检数据信息 /// /// 生产数据ID /// DataSet public ActionResult GetProductionDataByID(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(this, () => PDAModuleLogic.GetProductionDataByID(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(); 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(); } 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; } /// /// 编辑后删除生产数据 /// /// 生产数据ID /// int public ActionResult DeleteProductionDataByID(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; } int row = ServiceInvoker.Invoke(this, () => PMModuleLogic.DeleteProductionDataByID(productionDataID)); actionResult.Result = JsonHelper.ToJson(row); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取产品完成工序的ID /// /// 产品条码 /// int public ActionResult GetCompleteProcedureID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int row = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetCompleteProcedureID(barcode)); actionResult.Result = JsonHelper.ToJson(row); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 绑定图片 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 图片路径 /// public Stream BindDefectImage(string accountCode, string userCode, string userPassword, string sessionKey, string imagePath) { try { return ServiceInvoker.Invoke(this, () => PDAModuleLogic.BindDefectImage(imagePath)); } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), LocalPath.LogExePath); return null; } } /// /// 根据所选工号对应的工种,查出缺陷责任员工 /// /// 工种ID /// public ActionResult GetDutyStaffByUserJobsID(string accountCode, string userCode, string userPassword, string sessionKey, int jobs, int userid) { 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(this, () => PDAModuleLogic.GetDutyStaffByUserJobsID(jobs, sUserInfo, userid)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } #region 产品报废 /// /// 验证废弃产品唯一性 /// /// 产品条码 /// int public ActionResult ScrapProductChack(string accountCode, string userCode, string userPassword, string sessionKey, string barCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } string row = ServiceInvoker.Invoke(this, () => PDAModuleLogic.ScrapProductChack(barCode, sUserInfo)); string[] rm = row.Split(':'); actionResult.Result = rm[0];//JsonHelper.ToJson(rm[0]); if (rm.Length > 1) { actionResult.Message = rm[1]; } actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 根据条码获取该产品的在产信息以及生产数据 /// /// 产品条码 /// 装有两个DataTable的数据集,第一个是在产信息,第二个是生产数据 public ActionResult GetInProductionAndProductionData(string accountCode, string userCode, string userPassword, string sessionKey, string barCode) { 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(this, () => PDAModuleLogic.GetInProductionAndProductionData(barCode, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs); 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; } /// /// 根据工号查询员工档案信息 /// /// /// /// /// /// /// public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId) { 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(this, () => PDAModuleLogic.SearchHrStaffInfo(userId, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 添加废弃产品记录 /// /// 废弃产品实体 /// 废弃责任工序实体 /// 责任者集合 /// 用户基本信息 /// int结果返回值 /// /// 庄天威 2014.09.24 新建 /// public ActionResult AddScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity SProductEntity, ResponProcedureEntity RProcedureEntity, ScrapResponsibleEntity[] SResponsibleList) { ActionResult actionResult = new ActionResult(); if (SResponsibleList == null || SResponsibleList.Length == 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "没有选择责任人"; } try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int addRow = ServiceInvoker.Invoke(this, () => PDAModuleLogic.AddScrapProduct(SProductEntity, RProcedureEntity, SResponsibleList, sUserInfo)); actionResult.Result = JsonHelper.ToJson(addRow); actionResult.Status = (int)Constant.PDAResult.Success; } 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; // TODO 空指针异常问题检测 try { OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, "accountCode:" + accountCode + "#userCode:" + userCode + "#sessionKey:" + sessionKey, LocalPath.LogExePath); string json1 = JsonHelper.ToJson(SProductEntity); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, "SProductEntity:" + json1, LocalPath.LogExePath); string json2 = JsonHelper.ToJson(RProcedureEntity); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, "RProcedureEntity:" + json2, LocalPath.LogExePath); string json3 = JsonHelper.ToJson(SResponsibleList); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, "SResponsibleList:" + json3, LocalPath.LogExePath); } catch (Exception exc) { OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, "参数输入异常:" + exc.Message, LocalPath.LogExePath); } } return actionResult; } /// /// 获取产品分级的数据(根据ID) /// /// 分类类别ID /// 分类ID /// 用户基本信息 /// DataSet /// /// 2014.10.22 庄天威 新建 public ActionResult GetGoodsLevelDataById(string accountCode, string userCode, string userPassword, string sessionKey, int? GoodsLevelTypeID) { 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(this, () => SystemModuleLogic.GetGoodsLevelDataById(GoodsLevelTypeID, null, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 获取账务日期 /// /// /// /// /// /// public ActionResult GetAccountDate(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DateTime reworkDs = ServiceInvoker.Invoke(this, () => CommonModuleLogic.GetAccountDate(sUserInfo)); actionResult.Result = JsonHelper.ToJson(reworkDs); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取登陆帐户有无报损权限 /// /// /// /// /// /// 工号编码 /// public ActionResult GetScrapFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetScrapFuntion(userCode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion /// /// 获取是否存在报损未审核产品 /// /// 产品条码 /// int public ActionResult GetScrapProductAuditStatus(string accountCode, string userCode, string userPassword, string sessionKey, string barCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int row = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetScrapProductAuditStatus(barCode)); actionResult.Result = JsonHelper.ToJson(row); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 查询报废产品信息 /// /// /// /// /// /// 产品条码 /// 报废产品ID /// public ActionResult GetScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barCode, int scrapProductID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ScrapProductEntity selectProEntity = new ScrapProductEntity(); selectProEntity.BarCode = barCode; selectProEntity.ScrapProductID = scrapProductID; DataSet reworkDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetScrapProduct(selectProEntity, sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 根据废弃产品ID获取责任工序 /// /// /// /// /// /// 报废产品ID /// public ActionResult GetResponProcedureBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID) { 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(this, () => PMModuleLogic.GetResponProcedureBySPId(scrapProductID)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 根据废弃产品ID获取责任人列表 /// /// /// /// /// /// 报废产品ID /// public ActionResult GetScrapResponsibleBySPId(string accountCode, string userCode, string userPassword, string sessionKey, int scrapProductID) { 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(this, () => PMModuleLogic.GetScrapResponsibleBySPId(scrapProductID)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 添加废弃产品记录 /// /// 废弃产品实体 /// 废弃责任工序实体 /// 责任者集合 /// 用户基本信息 /// int结果返回值 /// /// 庄天威 2014.09.24 新建 /// public ActionResult UpdateScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, ScrapProductEntity UpdateSProductEntity, ResponProcedureEntity UpdateRProcedureEntity, ScrapResponsibleEntity[] UpdateSResponsibleList, ScrapResponsibleEntity[] YSResponsibleList) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int addRow = ServiceInvoker.Invoke(this, () => PDAModuleLogic.UpdateScrapProduct(UpdateSProductEntity, UpdateRProcedureEntity, UpdateSResponsibleList, YSResponsibleList, sUserInfo)); actionResult.Result = JsonHelper.ToJson(addRow); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取产品窑炉 /// /// /// /// /// /// Datase public ActionResult GetAllKilntInfo(string accountCode, string userCode, string userPassword, string sessionKey) { 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(this, () => PDAModuleLogic.GetAllKilntInfo(sUserInfo)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 获取次品产品条码允许编辑 /// /// /// /// /// /// 产品条码 /// Datase public ActionResult GetSubstandardInfo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { 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(this, () => PDAModuleLogic.GetSubstandardInfo(barcode)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(1); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Result = JsonHelper.ToJson(0); actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "次品条码:" + barcode + "不允许修改"; } } 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; } /// /// 获取产品条码是否重烧 /// /// /// /// /// /// 产品条码 /// Datase public ActionResult GetReFine(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { 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(this, () => PDAModuleLogic.GetReFine(barcode)); if (reworkDs != null && reworkDs.Tables[0].Rows.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(reworkDs.Tables[0].Rows[0]["IsReFire"])); } else { actionResult.Result = JsonHelper.ToJson(0); } actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取登陆帐户有无成检编辑权限 /// /// /// /// /// /// 工号编码 /// public ActionResult GetFinishedProductEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetFinishedProductEditFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 根据条码及工序判断是否漏扫 /// /// /// /// /// /// 工号编码 /// 产品条码 /// 工序ID /// public ActionResult AddBarCodeMissing(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int produceid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = 1; //int returnValue = ServiceInvoker.Invoke(this, // () => PMModuleLogicDAL.AddBarCodeMissing(barcode, produceid, sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取登陆帐户有无报损审批权限 /// /// /// /// /// /// 工号编码 /// public ActionResult GetScrapProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetScrapProductFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取登陆帐户有无报损审批权限 /// /// /// /// /// /// 工号编码 /// public ActionResult GetSpecialRepairflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetSpecialRepairflagByBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取窑车对应产品列表 /// /// /// /// /// /// 窑车ID /// Dataset public ActionResult GetKilnCarGoodsByKilnCarID(string accountCode, string userCode, string userPassword, string sessionKey, int KilnCarID) { 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(this, () => PMModuleLogic.GetKilnCarGoodsByKilnCarID(KilnCarID)); if (reworkDs != null && reworkDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(reworkDs.Tables[0]); 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; } /// /// 更换条码 /// /// /// /// /// ///原条码 /// 新条码 /// 备注 /// 操作结果 public ActionResult SaveBarCodeChange(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SetFPM0201Data(sUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode)); if (serviceResultEntity.Status == Constant.ServiceResultStatus.Success) { actionResult.Result = 1; actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = serviceResultEntity.Message; } } 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; } /// /// 获取(注浆登记)的查询数据 /// /// /// /// /// /// 查询条件 /// Dataset public ActionResult GetGroutingList(string accountCode, string userCode, string userPassword, string sessionKey, FPM0202_SE se) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0202SData(sUserInfo, se)); if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults) { // PDA不显示的列删除掉 //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyDetailID"); //serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingDailyID"); serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingLineName"); serviceResultEntity.Data.Tables[0].Columns.Remove("UserCode"); serviceResultEntity.Data.Tables[0].Columns.Remove("GoodsName"); serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldStatusName"); serviceResultEntity.Data.Tables[0].Columns.Remove("GroutingCount"); serviceResultEntity.Data.Tables[0].Columns.Remove("Remarks"); serviceResultEntity.Data.Tables[0].Columns.Remove("GMouldTypeName"); //serviceResultEntity.Data.Tables[0].Columns.Remove("DMUserCode"); serviceResultEntity.Data.Tables[0].Columns.Remove("IsPublicBody"); actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100 actionResult.Message = "无查询数据"; } } 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; } /// /// 获取(注浆登记)的查询数据 /// /// /// /// /// /// 查询条件 /// Dataset public ActionResult GetGroutingListByBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity serviceResultEntity = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFPM0203SData(sUserInfo, barcode)); if (serviceResultEntity.Status != Constant.ServiceResultStatus.NoSearchResults) { actionResult.Result = JsonHelper.ToJson(serviceResultEntity.Data.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100 actionResult.Message = "无查询数据"; } } 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; } /// ///获得成型线信息 /// /// /// /// /// /// 查询条件 /// Dataset public ActionResult GetGroutingLine(string accountCode, string userCode, string userPassword, string sessionKey, GroutingLineEntity groutingLineEntity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dsReturn = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PCModuleLogic.PCModuleLogic.GetGroutingLine(groutingLineEntity, sUserInfo)); if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0) { actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100 actionResult.Message = "无查询数据"; } } 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; } /// ///获取在产产品的信息标识列表 /// /// /// /// /// /// 查询条件 /// Dataset public ActionResult GetInProductionDataList(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dsReturn = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetInProductionDataList(barcode)); if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0) { actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100 actionResult.Message = "无查询数据"; } } 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; } /// ///获取条码是否注浆登记过,0行无效 /// /// /// /// /// /// 查询条件 /// Dataset public ActionResult GetBarCodeInGroutingDailyDetail(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dsReturn = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetBarCodeInGroutingDailyDetail(barcode)); if (dsReturn != null && dsReturn.Tables[0].Rows.Count > 0) { actionResult.Result = JsonHelper.ToJson(dsReturn.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = Constant.ServiceResultStatus.NoSearchResults.GetHashCode(); //没有数据 -100 actionResult.Message = "该产品条码无效,无法报损!"; } } 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; } /// /// 获取登陆帐户有变更条码权限 /// /// /// /// /// /// public ActionResult GetBarCodeRecordFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetBarCodeRecordFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 成检时获取此条码是否报损 /// /// /// /// /// /// 产品条码 /// public ActionResult CheckScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckScrapProduct(barcode)); if (returnValue == -100) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (returnValue == 0) { actionResult.Message = "该条码:" + barcode + "存在报损记录(待审批)"; } else { actionResult.Message = "该条码:" + barcode + "存在报损记录(审批通过)"; } } } 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; } /// /// 获取产品完成工序的ID(PDA) /// /// 产品条码 /// int public ActionResult GetCompleteProcedureIDPDA(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetCompleteProcedureIDPDA(barcode)); actionResult.Result = JsonHelper.ToJson(ds.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取产品完成工序的ID(PDA) /// /// 产品条码 /// int public ActionResult GetGoodsInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGoodsInfoBybarcode(barcode)); actionResult.Result = JsonHelper.ToJson(ds.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 成检-校验生产工号 /// /// 生产工号 /// int public ActionResult GetUserCode(string accountCode, string userCode, string userPassword, string sessionKey, string usercode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetUserCode(usercode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 更新漏扫的成型工号 /// /// /// /// /// /// 成型工号 /// 漏扫ID /// public ActionResult UpdateGroutingUserCodeByMissingID(string accountCode, string userCode, string userPassword, string sessionKey, string groutingUserCode, int missingID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.UpdateGroutingUserCodeByMissingID(groutingUserCode, missingID, sUserInfo)); if (returnValue != -1) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "存在无效的漏扫工号"; } } 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; } /// /// 在入窑工序检验窑车号是否存在 /// /// /// /// /// /// 窑车编码 /// 工序ID /// public ActionResult CheckKilnCarByIntoCar(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.CheckKilnCarByIntoCar(kilncarcode, procedureid, sUserInfo)); if (returnValue == 1) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (returnValue == -99) actionResult.Message = "窑炉车号无效"; else if (returnValue == -98) actionResult.Message = "窑车己无产品"; else if (returnValue == -97) actionResult.Message = "窑车没有入窑,不可以撤销"; else if (returnValue == -1) actionResult.Message = "保存失败"; } } 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; } /// /// 获取盘点单列表 /// /// /// public ActionResult GetInCheckedList(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetInCheckedList(sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 进行盘点操作 /// /// /// /// /// /// 盘点单ID /// 产品条码 /// public ActionResult UpdateInChecked(string accountCode, string userCode, string userPassword, string sessionKey, int InCheckedID, string BarCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.UpdateInChecked(InCheckedID, BarCode, sUserInfo)); if (returnValue > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = "产品" + BarCode + "盘点成功"; } else if (returnValue == 10) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = "产品" + BarCode + "盘盈成功"; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (returnValue == -2) actionResult.Message = "产品" + BarCode + "不是在产产品"; //if (returnValue == 10) // actionResult.Message = "产品" + BarCode + "盘盈成功"; //if (returnValue > 0) // actionResult.Message = "产品" + BarCode + "盘点成功"; if (returnValue == -22) actionResult.Message = "产品" + BarCode + "己被其他工号盘点"; if (returnValue == -23) actionResult.Message = "产品" + BarCode + "己被其他工号盘盈"; if (returnValue == -24) actionResult.Message = "产品" + BarCode + "己被此工号盘点"; if (returnValue == -25) actionResult.Message = "产品" + BarCode + "己被此工号盘盈"; else if (returnValue == 0) actionResult.Message = "盘点失败"; } } 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; } #region 班次配置 /// /// 班次配置-通过工号获取工种列表 /// /// 工号ID /// public ActionResult BindUserJobs(string accountCode, string userCode, string userPassword, string sessionKey, int userId) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetJobByUserId(userId)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } ///// ///// 班次配置-根据工号查询员工档案信息 ///// ///// 工号ID ///// //public ActionResult SearchHrStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, int userId) //{ // ActionResult actionResult = new ActionResult(); // try // { // // 验证请求头信息 // actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // // 验证失败 // if (actionResult.Status != (int)Constant.PDAResult.Success) // { // return actionResult; // } // DataSet ds = ServiceInvoker.Invoke(this, // () => HRModuleLogic.SearchHrStaffInfo(userId,sUserInfo)); // actionResult.Result = JsonHelper.ToJson(ds); // actionResult.Status = (int)Constant.PDAResult.Success; // } // 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; //} /// /// 班次配置-根据员工姓名查员工信息 /// /// /// public ActionResult SearchStaffInfo(string accountCode, string userCode, string userPassword, string sessionKey, SearchStaffEntity searchStaffEntity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PDAModuleLogic.SearchStaffInfo(searchStaffEntity, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取班次配置信息 /// /// /// public ActionResult SearchClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, SearchClassesSettingEntity searchEntity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } searchEntity.StartAccountDate = Convert.ToDateTime(searchEntity.StartAccountDatePDA); searchEntity.EndAccountDate = Convert.ToDateTime(searchEntity.EndAccountDatePDA).AddDays(1).AddMinutes(-1); DataSet ds = ServiceInvoker.Invoke(this, () => PCModuleLogic.SearchClassesSetting(searchEntity, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public ActionResult SaveClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, ClassesSettingEntity setEntity, ClassesDetailSettingEntity[] setDetailEntity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.SaveClassesSetting(setEntity, setDetailEntity, sUserInfo)); if (returnValue > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "保存失败"; } } 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; } /// /// 班次配置--获取详细信息 /// /// /// public ActionResult SearchClassesDetail(string accountCode, string userCode, string userPassword, string sessionKey, int classesSettingID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PCModuleLogic.SearchClassesDetail(classesSettingID, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取用户是否有班次配置权限 /// /// /// /// /// /// public ActionResult GetClassesSettingFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetClassesSettingFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取盘点单列表 /// /// /// public ActionResult GetAllInChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA); entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1); DataSet ds = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetAllInChecked(entity, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region PDA报表 /// /// 产品质量跟踪 /// /// /// /// /// /// /// public ActionResult GetRPT040104SData(string accountCode, string userCode, string userPassword, string sessionKey, RPT040104_SE se) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } se.CreateTimeStart = Convert.ToDateTime(se.CreateTimeStartPDA); se.CreateTimeEnd = Convert.ToDateTime(se.CreateTimeEndPDA).AddDays(1); ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetRPT040104SData(sUserInfo, se)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 工号产量质量分析表 /// /// /// /// /// /// /// public ActionResult GetFP00002Data(string accountCode, string userCode, string userPassword, string sessionKey, int rptSProcedureID, string workcode, string date) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetFP00002Data(sUserInfo, rptSProcedureID, workcode, Convert.ToDateTime(date))); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 半检数据统计表 /// /// /// /// /// /// /// public ActionResult GetPDARPT000001Data(string accountCode, string userCode, string userPassword, string sessionKey, string workcode, string datebegin, string dateend) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DateTime datetimebegin = Convert.ToDateTime(datebegin); DateTime datetimeend = Convert.ToDateTime(dateend); datetimebegin = datetimebegin.Date; datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1); ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetPDARPT000001Data(sUserInfo, workcode, datetimebegin, datetimeend)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 工号质量统计表 /// /// /// /// /// /// /// public ActionResult GetPDARPT000002Data(string accountCode, string userCode, string userPassword, string sessionKey, int rptSProcedureID, string workcode, string datebegin, string dateend) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DateTime datetimebegin = Convert.ToDateTime(datebegin); DateTime datetimeend = Convert.ToDateTime(dateend); datetimebegin = datetimebegin.Date; datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1); ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetPDARPT000002Data(sUserInfo, rptSProcedureID, workcode, datetimebegin, datetimeend)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 损坯数据统计表 /// /// /// /// /// /// /// public ActionResult GetPDARPT000003Data(string accountCode, string userCode, string userPassword, string sessionKey, string workcode, string datebegin, string dateend) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DateTime datetimebegin = Convert.ToDateTime(datebegin); DateTime datetimeend = Convert.ToDateTime(dateend); datetimebegin = datetimebegin.Date; datetimeend = datetimeend.Date.AddDays(1).AddSeconds(-1); ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetPDARPT000003Data(sUserInfo, workcode, datetimebegin, datetimeend)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } #endregion /// /// 取得报表数据源数据 /// /// /// /// /// /// public ActionResult GetRptProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => ReportModuleLogic.GetRptProcedureModule(sUserInfo)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 取得报表的查询数据源统计工序数据 /// /// /// /// /// /// /// public ActionResult GetRptSourceProcedureModule(string accountCode, string userCode, string userPassword, string sessionKey, int? RptProcedureID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => ReportModuleLogic.GetRptSourceProcedureModule(sUserInfo, RptProcedureID)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 获取用户是否有统计产成品权限 /// /// /// /// /// /// public ActionResult GetStatisticsFinishedProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetStatisticsFinishedProductFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取用户是否有盘点权限 /// /// /// /// /// /// public ActionResult GetInCheckedFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetInCheckedFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 根据条件查询是否存在班次配置 /// /// /// /// /// /// 工号编码 /// public ActionResult GetClassesSetting(string accountCode, string userCode, string userPassword, string sessionKey, string uCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetClassesSetting(uCode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 报损工序查出工号根据生产数据ID /// /// /// /// /// /// 生产数据ID /// public ActionResult GetScrapProductUserCodeByProductionDataID(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 dutyProcedureDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetScrapProductUserCodeByProductionDataID(ProductionDataID)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 在入窑工序检验窑车号是否存在 /// /// /// /// /// /// 窑车编码 /// 工序ID /// public ActionResult CheckKilnCarByIntoCar2(string accountCode, string userCode, string userPassword, string sessionKey, string kilncarcode, int procedureid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.CheckKilnCarByIntoCar2(kilncarcode, procedureid, sUserInfo)); if (returnValue == 1) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (returnValue == -99) actionResult.Message = "窑炉车号无效"; else if (returnValue == -98) actionResult.Message = "窑车己无产品"; else if (returnValue == -97) actionResult.Message = "窑车没有入窑,不可以撤销"; else if (returnValue == -1) actionResult.Message = "保存失败"; } } 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; } /// /// 撤销包装 /// /// /// /// /// /// /// public ActionResult AddChancelFinishedproduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddChancelFinishedproduct(barcode, sUserInfo)); if (Convert.ToInt32(returnValue.Result) > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (Convert.ToInt32(returnValue.Result) == -1) actionResult.Message = "产品条码不存在包装记录"; else if (Convert.ToInt32(returnValue.Result) == -200) actionResult.Message = returnValue.Message; else actionResult.Message = "成品撤销失败"; } } 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; } /* /// /// 获取用户是否有撤销包装权限 /// /// /// /// /// /// public ActionResult GetChancelFinishedproductFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetChancelFinishedproductFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } */ /// /// 窑车状态明细表查询 /// /// /// /// /// /// /// public ActionResult GetKilnCarStatusDetailByCode(string accountCode, string userCode, string userPassword, string sessionKey, string kilnCarCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => ReportModuleLogic.GetKilnCarStatusDetailByCode(kilnCarCode, sUserInfo)); if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = Messages.MSG_CMN_I002; } else { actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 损坯撤销 /// /// /// /// /// /// /// public ActionResult AddCancelScrapProduction(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddCancelScrapProduction(barcode, sUserInfo)); if (Convert.ToInt32(returnValue.Result) > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (Convert.ToInt32(returnValue.Result) == -1) actionResult.Message = "此产品没有损坯,不能撤销"; else if (Convert.ToInt32(returnValue.Result) == -200) actionResult.Message = returnValue.Message; else actionResult.Message = "损坯撤销失败"; } } 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; } /* /// /// 获取用户是否有损坯撤销权限 /// /// /// /// /// /// public ActionResult GetCancelScrapProductionFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetCancelScrapProductionFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } */ /// /// 获取条码注浆信息 /// /// /// /// /// /// public ActionResult GetGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dutyProcedureDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGroutingInfoBybarcode(barcode, sUserInfo)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 获取条码注浆信息 /// /// /// /// /// /// public ActionResult GetFinishedProductGroutingInfoBybarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet dutyProcedureDs = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFinishedProductGroutingInfoBybarcode(barcode, sUserInfo)); if (dutyProcedureDs != null && dutyProcedureDs.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(dutyProcedureDs.Tables[0]); 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; } /// /// 公坯设定 /// /// /// /// /// /// /// public ActionResult AddPublicBodyProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddPublicBodyProduct(barcode, sUserInfo)); if (returnValue > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (returnValue == -1) actionResult.Message = "此产品不在生产线上"; else if (returnValue == -2) actionResult.Message = "该产品已经标识为公坯"; else actionResult.Message = "公坯设定失败"; } } 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; } /* /// /// 获取用户是否有公坯设定 /// /// /// /// /// /// public ActionResult GetPublicBodyProductFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetPublicBodyProductFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } */ /// /// 校验产品条码是否可以走到该工序 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 条码 /// /// /// 陈冰 2014.09.18 新建 /// public ActionResult CheckBarcodeDeliverMud(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet barcodeDataSet = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckBarcodeDeliverMud(procedureID, barcode, sUserInfo)); if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]); 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; } /// /// 获取用户所有菜单权限 /// /// /// /// /// /// public ActionResult GetUserAllFunction(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetUserAllFunction(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public ActionResult AddChancelBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddChancelBarCode(barcode, sUserInfo)); if (Convert.ToInt32(returnValue.Result) > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (Convert.ToInt32(returnValue.Result) == -1) actionResult.Message = "无效条码"; else if (Convert.ToInt32(returnValue.Result) == -2) actionResult.Message = "已经生产完成"; else if (Convert.ToInt32(returnValue.Result) == -3) actionResult.Message = "条码已经申请报废"; else if (Convert.ToInt32(returnValue.Result) == -4) actionResult.Message = "此条码当前工序不允许进行撤销"; else if (Convert.ToInt32(returnValue.Result) == -5) actionResult.Message = "此条码没有生产数据"; else if (Convert.ToInt32(returnValue.Result) == -6) actionResult.Message = "没有当前工序权限"; else if (Convert.ToInt32(returnValue.Result) == -7) actionResult.Message = "条码不在生产线上"; else if (Convert.ToInt32(returnValue.Result) == -8) actionResult.Message = "操作用户无此工序的撤销范围权限"; else if (Convert.ToInt32(returnValue.Result) == -9) actionResult.Message = "条码已经是返工状态"; else if (Convert.ToInt32(returnValue.Result) == -200) actionResult.Message = returnValue.Message; } } 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; } public ActionResult AddChancelDeliverMudBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddChancelDeliverMudBarCode(barcode, sUserInfo)); if (Convert.ToInt32(returnValue.Result) > 0) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (Convert.ToInt32(returnValue.Result) == -1) actionResult.Message = "无效条码"; else if (Convert.ToInt32(returnValue.Result) == -2) actionResult.Message = "已经生产完成"; else if (Convert.ToInt32(returnValue.Result) == -3) actionResult.Message = "条码已经申请报废"; else if (Convert.ToInt32(returnValue.Result) == -4) actionResult.Message = "此条码当前工序不允许进行撤销"; else if (Convert.ToInt32(returnValue.Result) == -5) actionResult.Message = "此条码没有生产数据"; else if (Convert.ToInt32(returnValue.Result) == -55) actionResult.Message = "条码已经不在交坯工序,不允许撤销"; else if (Convert.ToInt32(returnValue.Result) == -6) actionResult.Message = "没有任何影响行"; else if (Convert.ToInt32(returnValue.Result) == -7) actionResult.Message = "条码不在生产线上"; else if (Convert.ToInt32(returnValue.Result) == -8) actionResult.Message = "条码已经是返工状态"; else if (Convert.ToInt32(returnValue.Result) == -200) actionResult.Message = returnValue.Message; } } 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; } public ActionResult GetAllLogoInfo(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet returnValue = ServiceInvoker.Invoke(this, //() => SystemModuleLogic.GetAllLogoInfo(sUserInfo)); () => SystemModuleLogic.GetLogoInfo(sUserInfo)); if (returnValue != null && returnValue.Tables[0].Rows.Count > 0) { //DataView dv = returnValue.Tables[0].DefaultView; //dv.RowFilter = "ValueFlag=1"; //actionResult.Result = JsonHelper.ToJson(dv.ToTable()); actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } public ActionResult GetLogoID(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetLogoID(procedureID, sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public ActionResult SaveBarCodeLogo(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int logoid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.SaveBarCodeLogo(barcode, logoid, sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public ActionResult GetBarCodeLogoID(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetBarCodeLogoID(barcode, sUserInfo)); if (returnValue != null && returnValue.Tables[0].Rows.Count > 0) { actionResult.Result = JsonHelper.ToJson(returnValue.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 半检时,入窑前检验获取此条码是否报损为废品 /// /// /// /// /// /// 产品条码 /// public ActionResult CheckWasteScrapProduct(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckWasteScrapProduct(barcode)); if (returnValue != -100) { actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "条码[" + barcode + "]不是废品,不能进行编辑"; } } 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; } /// /// 获取登陆帐户有无入窑前检验数据编辑权限 /// /// /// /// /// /// 工号编码 /// public ActionResult GetIntoKilnCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetIntoKilnCheckEditFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取登陆帐户有无半检验数据编辑权限 /// /// /// /// /// /// 工号编码 /// public ActionResult GetNormalCheckEditFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetNormalCheckEditFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取缺陷扣罚管理的全部数据 /// /// /// /// /// /// public ActionResult GetAllDefectFine(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetAllDefectFine(sUserInfo)); if (ds != null && ds.Tables[0].Rows.Count > 0) { DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = "valueflag=1"; actionResult.Result = JsonHelper.ToJson(dv.ToTable()); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Result = JsonHelper.ToJson(ds.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 获取缺陷扣除数管理的全部数据 /// /// /// /// /// /// public ActionResult GetAllDefectDeduction(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetAllDefectDeduction(sUserInfo)); if (ds != null && ds.Tables[0].Rows.Count > 0) { DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = "valueflag=1"; actionResult.Result = JsonHelper.ToJson(dv.ToTable()); actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Result = JsonHelper.ToJson(ds.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } } 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; } /// /// 获取缺陷扣罚关系管理的全部数据 /// /// /// /// /// /// public ActionResult GetAllDefectFineRelation(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetAllDefectFineRelation(sUserInfo)); DataTable dt = new DataTable(); dt.Columns.Add("DefectID"); dt.Columns.Add("DefectFineID"); DataView dv = ds.Tables[0].DefaultView; DataTable dtFor = dv.ToTable("defectid", true); for (int i = 0; i < dtFor.Rows.Count; i++) { DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]); string substring = ""; foreach (DataRow r1 in r) { substring += r1["DefectFineID"].ToString() + "-" + r1["DEFECTFINECODE"].ToString() + ","; } if (substring != "") { DataRow drnew = dt.NewRow(); drnew["DefectID"] = dtFor.Rows[i]["defectid"]; drnew["DefectFineID"] = substring.TrimEnd(','); dt.Rows.Add(drnew); } } actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0] actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取缺陷扣除数关系管理的全部数据 /// /// /// /// /// /// public ActionResult GetAllDefectDeductionRelation(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetAllDefectDeductionRelation(sUserInfo)); DataTable dt = new DataTable(); dt.Columns.Add("DefectID"); dt.Columns.Add("DefectDeductionNum"); DataView dv = ds.Tables[0].DefaultView; DataTable dtFor = dv.ToTable("defectid", true); for (int i = 0; i < dtFor.Rows.Count; i++) { DataRow[] r = ds.Tables[0].Select("defectid=" + dtFor.Rows[i]["defectid"]); string substring = ""; foreach (DataRow r1 in r) { substring += r1["DefectDeductionID"].ToString() + "-" + r1["DefectDeductionNum"].ToString() + ","; } if (substring != "") { DataRow drnew = dt.NewRow(); drnew["DefectID"] = dtFor.Rows[i]["defectid"]; drnew["DefectDeductionNum"] = substring.TrimEnd(','); dt.Rows.Add(drnew); } } actionResult.Result = JsonHelper.ToJson(dt);//ds.Tables[0] actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取盘点单明细 /// /// /// public ActionResult GetUpdateInCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, string incheckedno) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetUpdateInCheckedInfo(incheckedno, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 半检检验条码 /// /// /// public ActionResult SemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.SemiCheckBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } /// /// 根据条码获取经过的工序,用于绑定返工工序 /// /// /// public ActionResult GetSemiCheckPassProcedure(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetSemiCheckPassProcedure(barcode)); actionResult.Result = JsonHelper.ToJson(resultEntity); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取登陆帐户有无半检状态权限 /// /// /// public ActionResult GetSemiCheckStatusFuntion(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetSemiCheckStatusFuntion(sUserInfo)); actionResult.Result = JsonHelper.ToJson(resultEntity); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 复检状态数据源 /// /// /// public ActionResult GetSemiCheckType(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetSemiCheckType()); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 根据半成品检验数据ID,显示半成品数据信息 /// /// /// public ActionResult GetSemiCheckByID(string accountCode, string userCode, string userPassword, string sessionKey, int semiCheckID) { 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(this, () => PMModuleLogic.GetSemiCheckByID(semiCheckID)); SemiCheckEntity[] productionDatas = new SemiCheckEntity[1]; 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++) { SemiCheckEntity productionData = new SemiCheckEntity(); 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.SemiCheckID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString()); productionData.GoodsCode = reworkDs.Tables[0].Rows[i]["GoodsCode"].ToString(); productionData.GoodsName = reworkDs.Tables[0].Rows[i]["GoodsName"].ToString(); productionData.SemiCheckType = reworkDs.Tables[0].Rows[i]["SemiCheckType"].ToString(); productionData.ReFine = 0; if (reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString() != "") { productionData.ReworkProcedureID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkProcedureID"].ToString()); } productionData.ReSemiCheckType = reworkDs.Tables[0].Rows[i]["ReSemiCheckType"].ToString(); productionData.ReworkProcedureCode = reworkDs.Tables[0].Rows[i]["ReworkProcedureCode"].ToString(); productionData.ReworkProcedureName = reworkDs.Tables[0].Rows[i]["ReworkProcedureName"].ToString(); productionData.Remarks = reworkDs.Tables[0].Rows[i]["Remarks"].ToString(); if (reworkDs.Tables[0].Rows[i]["UserID"].ToString() != "") { productionData.SemiCheckUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["UserID"].ToString()); productionData.SemiCheckUserCode = reworkDs.Tables[0].Rows[i]["UserCode"].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 = reworkDs.Tables[0].Rows[i]["SpecialRepairFlag"].ToString(); productionData.GroutingUserCode = reworkDs.Tables[0].Rows[i]["GroutingUserCode"].ToString(); productionData.GroutingNum = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["GroutingNum"]); productionData.IsPublicBody = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["IsPublicBody"]); productionData.MouldCode = reworkDs.Tables[0].Rows[i]["MouldCode"].ToString(); productionData.GroutingDate = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["GroutingDate"]); if (reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString() != "") { productionData.ReworkUserID = Convert.ToInt32(reworkDs.Tables[0].Rows[i]["ReworkUserID"].ToString()); productionData.ReworkUserCode = reworkDs.Tables[0].Rows[i]["ReworkUserCode"].ToString(); } productionData.ReSemiCheckUserCode = reworkDs.Tables[0].Rows[i]["ReSemiCheckUserCode"].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.SemiCheckTime = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["SemiCheckTime"]); if (reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"] != DBNull.Value) { productionData.ReSemiCheckDateTimeStart = Convert.ToDateTime(reworkDs.Tables[0].Rows[i]["ReSemiCheckTime"]); } DataView dvDefect = reworkDs.Tables[1].DefaultView; dvDefect.RowFilter = "SemiCheckID=" + reworkDs.Tables[0].Rows[i]["SemiCheckID"].ToString(); DataTable dtDefect = dvDefect.ToTable(); for (int row = 0; row < dtDefect.Rows.Count; row++) { // 产品缺陷 SemiCheckDefectEntity defect = new SemiCheckDefectEntity(); //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.Remarks = dtDefect.Rows[row]["remarks"].ToString(); if (dtDefect.Rows[row]["semicheckid"].ToString() != "") { defect.SemiCheckID = Convert.ToInt32(dtDefect.Rows[row]["semicheckid"].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(); //--------责任员工------------------- DataRow[] drRow = reworkDs.Tables[2].Select("SemiCheckDefectID=" + reworkDs.Tables[1].Rows[row]["SemiCheckDefectID"]); if (drRow.Length > Constant.INT_IS_ZERO) { if (defect.DefectResponsibles == null) { defect.DefectResponsibles = new List(); } foreach (DataRow r in drRow) { SemiCheckResponsibleEntity defectResponsible = new SemiCheckResponsibleEntity(); if (r["SemiCheckDefectID"].ToString() != "") { defectResponsible.SemiCheckDefectID = Convert.ToInt32(r["SemiCheckDefectID"]); } 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.DefectResponsibles.Add(defectResponsible); } } //------------------------------ if (productionData.SemiCheckDefects == null) { productionData.SemiCheckDefects = new List(); } productionData.SemiCheckDefects.Add(defect); } //if (productionDatas.PDAProductionData == null) //{ // productionDatas.PDAProductionData = new System.Collections.Generic.List(); //} productionDatas[0] = productionData; //--------------------------------------------------------------------------------- } } } actionResult.Result = JsonHelper.ToJson(productionDatas); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 保存半检登记 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 半检实体类 /// 用户基本信息 /// public ActionResult AddSemiCheck(string accountCode, string userCode, string userPassword, string sessionKey, SemiCheckEntity[] entityobj) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.AddSemiCheck(entityobj, sUserInfo)); string err = string.Empty; err = resultEntity.Message; if (err == null) { err = ""; } SemiCheckEntity entity = entityobj[0]; if (entity.SemiCheckCategory == 1) // 半检登记 { } else if (entity.SemiCheckCategory == 2)// 复检登记 { err = JsonHelper.ToJson(err); } else if (entity.SemiCheckCategory == 3)// 撤销复检 { err = JsonHelper.ToJson(err); } //actionResult.Result = JsonHelper.ToJson(err); actionResult.Result = err;//JsonHelper.ToJson(err); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 根据所选工号,查出缺陷责任员工 /// /// /// public ActionResult GetSemiCheckDefectStaffByUserID(string accountCode, string userCode, string userPassword, string sessionKey, int userid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetSemiCheckDefectStaffByUserID(sUserInfo, userid)); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取半成品缺陷管理的全部数据 /// /// /// public ActionResult GetAllSemicheckDefect(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetAllSemicheckDefect(sUserInfo)); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 获取半成品缺陷位置管理的全部数据 /// /// /// public ActionResult GetAllScdefectPosition(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetAllScdefectPosition(sUserInfo)); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 复检验条码 /// /// /// public ActionResult ReSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.ReSemiCheckBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } /// /// 撤销复检验条码 /// /// /// public ActionResult CancelSemiCheckBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.CancelSemiCheckBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } /// /// 恢复数据 /// /// /// public ActionResult ResetBarCode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.ResetBarCode(barcode)); if (resultEntity > 0) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = "恢复数据成功"; } else { actionResult.Status = (int)Constant.PDAResult.Fail; if (resultEntity == -1) { actionResult.Message = "此条码没有清除,不能恢复"; } else if (resultEntity == 0) { actionResult.Message = "没有可恢复的数据"; } } } 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; } /// /// 通过SettingCode获取系统参数管理的数据 /// /// /// /// /// /// 设置编码 /// public ActionResult GetSystemSettingDataByCode(string accountCode, string userCode, string userPassword, string sessionKey, string settingcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetSystemSettingDataByCode(settingcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 校验条码是否允许撤销,如果不允许提示错误消息 /// /// /// /// /// /// 原时间 /// 允许撤销天数 /// 设置code,用于返回不同错误消息 /// public ActionResult BarcodeAllowCancel(string accountCode, string userCode, string userPassword, string sessionKey, string orgTime, int days, string settingCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } string[] subOrgTime = orgTime.Split('-'); DateTime newOrgTime = new DateTime(Convert.ToInt32(subOrgTime[0]), Convert.ToInt32(subOrgTime[1]), Convert.ToInt32(subOrgTime[2])); ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.BarcodeAllowCancel(newOrgTime, days, settingCode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } /// /// 获取生产订单管理的全部数据 /// /// /// public ActionResult GetOrderList(string accountCode, string userCode, string userPassword, string sessionKey, OrderEntity order) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetOrderList(order, sUserInfo)); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public ActionResult FinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0 } else { actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } public ActionResult GetSystemData(string accountCode, string userCode, string userPassword, string sessionKey) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = ServiceInvoker.Invoke(this, () => SystemModuleLogic.GetSystemData(sUserInfo)); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } public ActionResult SaveFinishedHandover(string accountCode, string userCode, string userPassword, string sessionKey, int orderid, OrderEntity[] orderEntity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataTable dtOrderData = DataConvert.ObjectConvertToTable(orderEntity); ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.SaveFinishedHandover(orderid, dtOrderData, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } public ActionResult CancelFinishedHandoverBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogic.CancelFinishedHandoverBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } public ActionResult SaveCancelFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.SaveCancelFinishedHandoverByBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } public ActionResult SaveChangeFinishedHandoverByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int orderid) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PMModuleLogicDAL.SaveChangeFinishedHandoverByBarcode(barcode, orderid, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } 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; } #region PDA条码打印 /// /// 获取条码打印机 /// /// /// /// /// /// public ActionResult GetBarcodePrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printType=0) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet resultEntity = BarcodePrintLogic.GetBarcodePrinter(sUserInfo, printType); actionResult.Result = JsonHelper.ToJson(resultEntity.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 打印条码样式(补打) /// /// /// /// /// /// public ActionResult PrintBarcodeLayout(string accountCode, string userCode, string userPassword, string sessionKey, string barcode, int copies, int printerID, int printWay=2) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } //ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode(barcode, // copies, printerID, sUserInfo); ServiceResultEntity sre = BarcodePrintLogic.PrintBarcode_3C(barcode, copies, printerID, sUserInfo, printWay); if (sre.Status != Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.ServiceResultStatus.Other; actionResult.Message = sre.Message; return actionResult; } actionResult.Result = JsonHelper.ToJson(sre.Result as DataTable); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion PDA条码打印 #region 统计报表 /// /// 成型结算报表 /// /// /// /// /// /// public ActionResult GetGroutingSettlementInfo(string accountCode, string userCode, string userPassword, string sessionKey, int currentMonth) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DateTime date = DateTime.Now; if (currentMonth != 1) { date = date.AddMonths(-1); } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => PublicModuleLogic.GetFP00002Data(sUserInfo.AccountID, userCode, date)); if (resultEntity == null || resultEntity.Data == null) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "查询失败"; return actionResult; } if (resultEntity.Status == Constant.ServiceResultStatus.Other) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = resultEntity.Message; return actionResult; } actionResult.Result = JsonHelper.ToJson(resultEntity.Data.Tables["DataM"]); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 设置当期用户默认打印机配置 /// /// 设置当期用户默认打印机配置 /// /// /// /// /// /// /// public ActionResult SetCurrentUserPrinter(string accountCode, string userCode, string userPassword, string sessionKey, int printerID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ServiceResultEntity resultEntity = ServiceInvoker.Invoke(this, () => BarcodePrintLogic.SetCurrentUserPrinter(printerID, sUserInfo)); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (resultEntity.Status == Constant.ServiceResultStatus.Other || Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; } catch (Exception ex) { 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; } /// /// 校验产品条码是否可以进行回收 /// /// 帐套code /// 用户code /// 用户密码 /// 本次登陆密钥 /// 工序ID /// 条码 /// /// /// 王鑫 2017.7.21 新建 /// public ActionResult CheckRecydingFlagBarcode(string accountCode, string userCode, string userPassword, string sessionKey, int procedureID, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet barcodeDataSet = ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckRecydingFlagBarcode(procedureID, barcode, sUserInfo)); if (barcodeDataSet != null && barcodeDataSet.Tables.Count > Constant.INT_IS_ZERO) { actionResult.Result = JsonHelper.ToJson(barcodeDataSet.Tables[0]); 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; } /// /// 获取回收标识 /// /// /// /// /// /// 工号编码 /// public ActionResult GetRecyclingflagByBarcode(string accountCode, string userCode, string userPassword, string sessionKey, string barcode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } int returnValue = ServiceInvoker.Invoke(this, () => PMModuleLogic.GetRecyclingflagByBarcode(barcode, sUserInfo)); actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 注浆盘点 /// /// 获取注浆盘点单列表 /// /// /// public ActionResult GetAllGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA); entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1); DataSet ds = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetAllGBChecked(entity, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } catch (Exception ex) { string json = JsonHelper.ToJson(entity); //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name + "\r\n" + json, ex.ToString(), LocalPath.LogExePath); actionResult.Status = (int)Constant.PDAResult.Exception; actionResult.Message = Constant.PDA_RESULT_EXCEPTION; } return actionResult; } /// /// 进行盘点操作 /// /// /// /// /// /// 盘点单ID /// 产品条码 /// public ActionResult UpdateGBChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["CheckedID"] = CheckedID; cre.Properties["Barcode"] = BarCode; ServiceResultEntity returnValue = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.UpdateGBChecked(sUserInfo, cre)); if (returnValue.Status == Constant.ServiceResultStatus.Success) { //actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = "产品【" + BarCode + "】盘点成功"; } else { //actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = returnValue.Message; } } 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; } /// /// 获取盘点单明细 /// /// /// public ActionResult GetUpdateGBCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic. GetUpdateGBCheckedInfo(checkedID, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 模具盘点 /// /// 获取模具盘点单列表 /// /// /// public ActionResult GetAllMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, InCheckedEntity entity) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } entity.BeginDate = Convert.ToDateTime(entity.BeginDatePDA); entity.EndDate = Convert.ToDateTime(entity.EndDatePDA).AddDays(1); DataSet ds = ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetAllMouldChecked(entity, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } /// /// 进行盘点操作 /// /// /// /// /// /// 盘点单ID /// 产品条码 /// public ActionResult UpdateMouldChecked(string accountCode, string userCode, string userPassword, string sessionKey, int CheckedID, string BarCode) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["CheckedID"] = CheckedID; cre.Properties["Barcode"] = BarCode; ServiceResultEntity returnValue = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.UpdateMouldChecked(sUserInfo, cre)); if (returnValue.Status == Constant.ServiceResultStatus.Success) { //actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = "产品【" + BarCode + "】盘点成功"; } else { //actionResult.Result = JsonHelper.ToJson(returnValue); actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = returnValue.Message; } } 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; } /// /// 获取盘点单明细 /// /// /// public ActionResult GetUpdateMouldCheckedInfo(string accountCode, string userCode, string userPassword, string sessionKey, int checkedID) { ActionResult actionResult = new ActionResult(); try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } DataSet ds = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic. GetUpdateMouldCheckedInfo(checkedID, sUserInfo)); actionResult.Result = JsonHelper.ToJson(ds); actionResult.Status = (int)Constant.PDAResult.Success; } 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; } #endregion #region 通用接口 /// /// PDA调用通用接口 /// /// /// /// /// /// /// /// /// public ActionResult DoAction(string accountCode, string userCode, string userPassword, string sessionKey, string module, string action, string jsonData) { ActionResult actionResult = null; try { // 验证请求头信息 actionResult = this.DoPDACheck(accountCode, userCode, userPassword, sessionKey); // 验证失败 if (actionResult.Status != (int)Constant.PDAResult.Success) { return actionResult; } actionResult.Status = (int)Constant.PDAResult.Fail; Dictionary data = null; if (!string.IsNullOrEmpty(jsonData) && jsonData[0] == '{') { data = JsonHelper.FromJson>(jsonData); } #region PDA报表 if (module == "Report") { // 成型月度结算 if (action == "GetGroutingSettlementInfo") { DateTime month = DateTime.Now; month = new DateTime(month.Year, month.Month, 1); //month = new DateTime(2017, 6, 1); int currentMonth = Convert.ToInt32(data["CurrentMonth"]); if (currentMonth != 1) { month = month.AddMonths(-1); } ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementInfo(sUserInfo, month); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 成型月度结算-明细 if (action == "GetGroutingSettlementDetail") { DateTime month = DateTime.Now; month = new DateTime(month.Year, month.Month, 1); //month = new DateTime(2017, 6, 1); int currentMonth = Convert.ToInt32(data["CurrentMonth"]); if (currentMonth != 1) { month = month.AddMonths(-1); } string goodsCode = data["GoodsCode"].ToString(); string detailDate = data["DetailDate"].ToString(); DateTime? date = null; if (detailDate != "合计") { date = DateTime.Parse(detailDate); } ServiceResultEntity sre = PDAModuleLogic.GetGroutingSettlementDetail(sUserInfo, month, goodsCode, date); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 产成品交接汇总 if (action == "GetFinishedProductHandoverSum") { DateTime date = DateTime.Parse(data["date"].ToString()); ServiceResultEntity sre = ReportModuleLogic.GetRPT0030112NPDAData(date, data["goodscode"] as string, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data); } else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } //xuwei add 2019-10-21 //统计当前工号,当日,按产品编码分组统计半检返修数据数量 if (action == "GetSemiReworkDayCount") { //不指定参数查询当天 string dateStr = DateTime.Now.ToString("yyyy-MM-dd"); //dateStr = "2019-10-17"; //指定参数查询特定日期 if(data.ContainsKey("SemiReworkDate")) dateStr = data["SemiReworkDate"].ToString(); ServiceResultEntity sre = ReportModuleLogic.GetSemiReworkDayCount(sUserInfo, dateStr); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } //xuwe end return actionResult; } #endregion #region 模具管理 if (module == "PC_Mould") { #region 模具新建画面数据初始化 if (action == "GetMouldAddInit") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldID"] = 0; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002LoadData(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } #endregion #region 验证模具产品型号 if (action == "CheckGoodsCodeOnMould") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["GoodsCode"] = data["GoodsCode"]; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1002GoodsData(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success && sre.Data.Tables[0].Rows.Count > 0) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "无效产品型号"; } return actionResult; } #endregion #region 验证模具生产工号 if (action == "CheckUserCodeOnMould") { DataTable sre = PDAModuleLogic.GetUserCodeOnMould(sUserInfo, data["UserCode"].ToString()); if (sre != null && sre.Rows.Count > 0) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "无效生产工号"; } return actionResult; } #endregion #region 新建保存 if (action == "SetMouldAdd" || action == "SetMouldEdit") { ClientRequestEntity cre = new ClientRequestEntity(); foreach (string item in data.Keys) { if (item == "ProductionDate") { cre.Properties.Add(item, Convert.ToDateTime(data[item])); } else { cre.Properties.Add(item, data[item]); } } ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1002Data(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } #endregion #region 模具编辑画面数据初始化 if (action == "GetMouldEditInfo") { DataTable sre = PDAModuleLogic.GetMouldEditInfo(sUserInfo, data["MouldBarcode"].ToString()); if (sre != null && sre.Rows.Count > 0) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "无效模具条码"; } return actionResult; } #endregion #region 模具操作-画面初始化 if (action == "GetMouldOperationInit") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldOperationType"] = data["MouldOperationType"]; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } #endregion #region 模具操作-验证模具条码 if (action == "CheckMouldBarcode") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldBarcode"] = data["MouldBarcode"]; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { if (sre.Data.Tables[0].Rows.Count == 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -1; actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在"; return actionResult; } int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]); int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]); string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString(); #region 报损 if (mouldOperationType == 2) { if (mouldStatusID == 1 || mouldStatusID == 3) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -2; actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作"; } return actionResult; } #endregion #region 撤销 if (mouldOperationType == 3) { if (mouldStatusID == 4) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -2; actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行撤销报损操作"; } return actionResult; } #endregion #region 领用 if (mouldOperationType == 4) { if (mouldStatusID == 1) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -2; actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行领用操作"; } return actionResult; } #endregion #region 回收 if (mouldOperationType == 5) { if (mouldStatusID == 3) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -2; actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行回收操作"; } return actionResult; } #endregion #region 变更型号 if (mouldOperationType == -1) { if (mouldStatusID != 4) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -2; actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行变更型号操作"; } return actionResult; } #endregion #region 替换条码 if (mouldOperationType == -2) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); return actionResult; } #endregion return actionResult; } } #endregion #region 模具操作-保存 if (action == "SetMouldOperation") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldIDs"] = string.Join(",", JsonHelper.FromJson(data["MouldIDs"].ToString())); cre.Properties["MouldOperationType"] = data["MouldOperationType"]; cre.Properties["Remarks"] = data["Remarks"]; int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]); if (mouldOperationType == (int)Constant.MouldOperationType.ChangeGoodsCode) { cre.Properties["GoodsID"] = data["GoodsID"]; cre.Properties["GoodsCode"] = data["GoodsCode"]; } else if (mouldOperationType == (int)Constant.MouldOperationType.InvToScrap) { cre.Properties["ScrapReason"] = data["ScrapReason"]; cre.Properties["ScrapResponsibility"] = data["ScrapRemarks"]; } ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1004Data(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; } return actionResult; } #endregion #region 模具操作-替换条码 if (action == "ChangedMouldBarcode") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldID"] = data["MouldID"]; cre.Properties["MouldBarcode"] = data["MouldBarcode"]; cre.Properties["NewMouldBarcode"] = data["NewMouldBarcode"]; cre.Properties["Remarks"] = data["Remarks"]; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.SetFPC1003Data(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } #endregion #region 模具跟踪表 if (action == "GetMoldTracking") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldBarcode"] = data["MouldBarcode"]; ServiceResultEntity sre = ReportModuleLogic.GetRPT020105Data(cre, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "此模具条码不存在"; } return actionResult; } #endregion return actionResult; } #endregion #region 成型线模具管理 if (module == "PC_GroutingLineMould") { #region 获取当前用户成型线模具管理权限 if (action == "GetGMouldStatusRight") { DataTable right = PDAModuleLogic.GetGMouldStatusRight(sUserInfo); actionResult.Status = (int)Constant.PDAResult.Success; if (right != null && right.Rows.Count > 0) { actionResult.Result = JsonHelper.ToJson(right); } return actionResult; } #endregion #region 获取成型线状态等信息,和成型模具信息 if (action == "GetGroutingLineMould") { int? groutingLineID = null; string groutingLineCode = null; if (data.ContainsKey("GroutingLineID")) { groutingLineID = Convert.ToInt32(data["GroutingLineID"]); } else { groutingLineCode = data["GroutingLineCode"] + ""; } DataSet lineInfo = PDAModuleLogic.GetGroutingLineMould(sUserInfo, groutingLineCode, groutingLineID); if (lineInfo == null) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "成型线【" + groutingLineCode + "】不存在或是停用状态"; } else { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(lineInfo); } return actionResult; } #endregion #region 模具操作-画面初始化 if (action == "GetMouldOperationInit") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldOperationType"] = 2; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetFPC1004LoadData(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } #endregion #region 成型模具操作-画面初始化 if (action == "GetGroutingMouldOperationInit") { DataTable initData = PDAModuleLogic.GetGroutingMouldOperationInit(sUserInfo, 6); if (initData != null && initData.Rows.Count > 0) { actionResult.Status = (int)Constant.PDAResult.Success; Dictionary syssetting = new Dictionary(); foreach (DataRow item in initData.Rows) { syssetting.Add(item["settingcode"].ToString(), item["settingvalue"].ToString()); } actionResult.Result = JsonHelper.ToJson(syssetting); } else { actionResult.Status = (int)Constant.PDAResult.Fail; } return actionResult; } #endregion #region 模具操作-验证模具条码 if (action == "CheckMouldBarcode") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["MouldBarcode"] = data["MouldBarcode"]; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PCModuleService.PCModuleLogic.GetMouldData(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { if (sre.Data.Tables[0].Rows.Count == 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -1; actionResult.Message = "模具【" + data["MouldBarcode"] + "】不存在"; return actionResult; } int mouldOperationType = Convert.ToInt32(data["MouldOperationType"]); int mouldStatusID = Convert.ToInt32(sre.Data.Tables[0].Rows[0]["MouldStatus"]); string mouldStatusName = sre.Data.Tables[0].Rows[0]["MouldStatusName"].ToString(); #region 上线 if (mouldOperationType == 6) { if (mouldStatusID == 1 || mouldStatusID == 3) { if (data.ContainsKey("GoodsID")) { if (sre.Data.Tables[0].Rows[0]["GoodsID"] + "" != data["GoodsID"] + "") { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -3; actionResult.Message = "模具【" + data["MouldBarcode"] + "】的产品型号为【" + sre.Data.Tables[0].Rows[0]["GoodsCode"] + "】与当前不一致"; return actionResult; } } actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -2; actionResult.Message = "模具【" + data["MouldBarcode"] + "】当前状态为【" + mouldStatusName + "】,不能进行报损操作"; } return actionResult; } #endregion return actionResult; } } #endregion #region 停用 if (action == "StopGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"]); } int result = PCModuleLogicDAL.StopGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 启用 if (action == "StartGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"]); } int result = PCModuleLogicDAL.StartGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 维修 if (action == "RepairStartGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"]); } int result = PCModuleLogicDAL.RepairStartGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 结束维修 if (action == "RepairEndGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"]); } int result = PCModuleLogicDAL.RepairEndGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 换模 if (action == "ChangeGMouldStartGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("MouldStatus", typeof(int)); gTable.Columns.Add("ScrapReason", typeof(int)); gTable.Columns.Add("ScrapResponsibility"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); int mouldStatus = Convert.ToInt32(data["MouldStatus"]); int scrapReason = Convert.ToInt32(data["ScrapReason"]); string scrapResponsibility = data["ScrapRemarks"] + ""; foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus, (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility); } int result = PCModuleLogicDAL.ChangeGMouldStartGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 变产 if (action == "UpdateLineStartGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("MouldStatus", typeof(int)); gTable.Columns.Add("ScrapReason", typeof(int)); gTable.Columns.Add("ScrapResponsibility"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); int mouldStatus = Convert.ToInt32(data["MouldStatus"]); int scrapReason = Convert.ToInt32(data["ScrapReason"]); string scrapResponsibility = data["ScrapRemarks"] + ""; foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus, (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility); } int result = PCModuleLogicDAL.UpdateLineStartGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 整线变产 if (action == "UpdateAllLineStartGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("MouldStatus", typeof(int)); gTable.Columns.Add("ScrapReason", typeof(int)); gTable.Columns.Add("ScrapResponsibility"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); int mouldStatus = Convert.ToInt32(data["MouldStatus"]); int scrapReason = Convert.ToInt32(data["ScrapReason"]); string scrapResponsibility = data["ScrapRemarks"] + ""; foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus, (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility); } int result = PCModuleLogicDAL.UpdateAllLineStartGroutingLineDetail(gTable, groutingLineID, lineOPTimeStamp, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 卸模 if (action == "UnloadGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("MouldStatus", typeof(int)); gTable.Columns.Add("ScrapReason", typeof(int)); gTable.Columns.Add("ScrapResponsibility"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); int mouldStatus = Convert.ToInt32(data["MouldStatus"]); int scrapReason = Convert.ToInt32(data["ScrapReason"]); string scrapResponsibility = data["ScrapRemarks"] + ""; foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], mouldStatus, (scrapReason <= 0 ? null : (object)scrapReason), scrapResponsibility); } int result = PCModuleLogicDAL.UnloadGroutingLineDetail(gTable, sUserInfo); if (result > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 结束换模 if (action == "ChangeGMouldEndGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RreasonRemarks"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("GoodsID", typeof(int)); gTable.Columns.Add("GoodsCode"); gTable.Columns.Add("StandardGroutingCount", typeof(int)); gTable.Columns.Add("GroutingCount", typeof(int)); gTable.Columns.Add("MouldSource"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], item["GoodsID"], item["GoodsCode"], item["StandardGroutingCount"], item["GroutingCount"], (mouldID == null ? "0" : "1")); } ServiceResultEntity result = PCModuleLogicDAL.ChangeGMouldEndGroutingLineDetail(gTable, sUserInfo); if (result.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else if (result.OtherStatus == -100) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -100; actionResult.Message = result.Message; return actionResult; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -500; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 结束变产 if (action == "UpdateLineEndGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("RreasonRemarks"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("GoodsID", typeof(int)); gTable.Columns.Add("GoodsCode"); gTable.Columns.Add("StandardGroutingCount", typeof(int)); gTable.Columns.Add("GroutingCount", typeof(int)); gTable.Columns.Add("MouldSource"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"], item["RecordRemarks"], Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], item["GoodsID"], item["GoodsCode"], item["StandardGroutingCount"], item["GroutingCount"], (mouldID == null ? "0" : "1")); } ServiceResultEntity result = PCModuleLogicDAL.UpdateLineEndGroutingLineDetail(gTable, 0, sUserInfo); if (result.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else if (result.OtherStatus == -100) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -100; actionResult.Message = result.Message; return actionResult; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -500; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 结束整线变产 if (action == "UpdateAllLineEndGroutingLineDetail") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("Remarks"); gTable.Columns.Add("RecordRemarks"); //gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("GoodsID", typeof(int)); gTable.Columns.Add("GoodsCode"); gTable.Columns.Add("StandardGroutingCount", typeof(int)); gTable.Columns.Add("GroutingCount", typeof(int)); gTable.Columns.Add("MouldSource"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, item["GLineDetailID"], item["GLineDetailCode"], item["DetailRemarks"], item["RecordRemarks"], //Convert.ToDateTime(item["OPTimeStamp"]), mouldID, item["MouldCode"], item["MouldOutputNo"], item["GoodsID"], item["GoodsCode"], item["StandardGroutingCount"], item["GroutingCount"], (mouldID == null ? "0" : "1")); } ServiceResultEntity result = PCModuleLogicDAL.UpdateAllLineEndGroutingLineDetail(gTable, null, groutingLineID, lineOPTimeStamp, sUserInfo); if (result.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else if (result.OtherStatus == -100) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -100; actionResult.Message = result.Message; return actionResult; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -500; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion #region 上模 if (action == "UpdateGroutingLine_AddMould") { if (data == null || !data.ContainsKey("Details")) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "参数错误"; return actionResult; } Dictionary[] details = JsonHelper.FromJson[]>(data["Details"].ToString()); DataTable gTable = new DataTable(); gTable.Columns.Add("GroutingLineID", typeof(int)); gTable.Columns.Add("GroutingLineCode"); gTable.Columns.Add("LineOPTimeStamp", typeof(DateTime)); gTable.Columns.Add("GroutingLineDetailID", typeof(int)); gTable.Columns.Add("GroutingMouldCode"); gTable.Columns.Add("Remarks"); gTable.Columns.Add("RecordRemarks"); gTable.Columns.Add("OPTimeStamp", typeof(DateTime)); gTable.Columns.Add("MouldID", typeof(int)); gTable.Columns.Add("MouldCode"); gTable.Columns.Add("MouldOutputNo", typeof(int)); gTable.Columns.Add("GoodsID", typeof(int)); gTable.Columns.Add("GoodsCode"); gTable.Columns.Add("StandardGroutingCount", typeof(int)); gTable.Columns.Add("GroutingCount", typeof(int)); gTable.Columns.Add("MouldSource"); int groutingLineID = Convert.ToInt32(data["GroutingLineID"]); string groutingLineCode = data["GroutingLineCode"] + ""; DateTime lineOPTimeStamp = Convert.ToDateTime(data["LineOPTimeStamp"]); foreach (Dictionary item in details) { int? mouldID = null; if (item.ContainsKey("MouldID")) { mouldID = Convert.ToInt32(item["MouldID"]); if (mouldID == 0) { mouldID = null; } } int gldID = Convert.ToInt32(item["GLineDetailID"]); gTable.Rows.Add(groutingLineID, groutingLineCode, lineOPTimeStamp, gldID, item["GLineDetailCode"], item["DetailRemarks"], item["RecordRemarks"], (gldID > 0 ? (object)Convert.ToDateTime(item["OPTimeStamp"]) : null), mouldID, item["MouldCode"], item["MouldOutputNo"], item["GoodsID"], item["GoodsCode"], item["StandardGroutingCount"], item["GroutingCount"], (mouldID == null ? "0" : "1")); } ServiceResultEntity result = PCModuleLogicDAL.UpdateGroutingLine_AddMould(groutingLineID, groutingLineCode, lineOPTimeStamp, gTable, sUserInfo); if (result.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else if (result.OtherStatus == -2 || result.OtherStatus == -100) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result.OtherStatus; actionResult.Message = result.Message; return actionResult; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = -500; actionResult.Message = "成型线状态已被更改,请刷新成型线数据"; return actionResult; } return actionResult; } #endregion return actionResult; } #endregion #region 包装装板限制 if (module == "FinishedLoadingCar") { if (action == "GetSetting") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["GoodsID"] = data["GoodsID"]; ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetFinishedLoadingCarSetting(sUserInfo, cre); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; foreach (DataRow item in sre.Data.Tables[0].Rows) { if (item["settingcode"].ToString() == "S_PM_011") { cre.Properties["S_PM_011"] = item["settingvalue"]; } else if (item["settingcode"].ToString() == "S_PM_012") { cre.Properties["S_PM_012"] = item["settingvalue"]; } else if (item["settingcode"].ToString() == "S_PM_013") { cre.Properties["S_PM_013"] = item["settingvalue"]; } } cre.Properties["PlatelitNum"] = sre.Result; actionResult.Result = JsonHelper.ToJson(cre.Properties); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = ""; } return actionResult; } } #endregion #region 成型报损 if (module == "GroutingScrapProduct") { // 查询注浆日报明细表 if ("GetGroutingDailyDetail" == action) { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = module; cre.Name = action; if (!string.IsNullOrEmpty(jsonData)) { cre.Properties["BarCode"] = data["BarCode"]; } ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingDailyDetail(cre, sUserInfo); //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0 || sre.Data.Tables[0].Rows.Count == 0) { actionResult.Message = "未查询到该产品信息,请确认该产品是否已经进行注浆!"; actionResult.Status = (int)Constant.PDAResult.Fail; } else { DataRow _barCodeRow = sre.Data.Tables[0].Rows[0]; // 判断是否进行了注浆 if ("0".Equals(_barCodeRow["GroutingFlag"])) { actionResult.Message = "该产品还未进行注浆!"; actionResult.Status = (int)Constant.PDAResult.Fail; } // 判断是否进行了交坯 if ("1".Equals(_barCodeRow["DeliverFlag"])) { actionResult.Message = "该产品已经交坯!"; actionResult.Status = (int)Constant.PDAResult.Fail; } // 判断是否已经报损 if ("1".Equals(_barCodeRow["ScrapFlag"])) { actionResult.Message = "该产品已经报损!"; actionResult.Status = (int)Constant.PDAResult.Fail; } actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } } // 获取成型报损原因 else if ("GetScrapReasonData" == action) { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = module; cre.Name = action; ServiceResultEntity sre = SystemModuleLogic.GetScrapReasonData(cre, sUserInfo); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } // 保存成型报损 else if ("SaveGroutingScrapProduct" == action) { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = module; cre.Name = action; if (!string.IsNullOrEmpty(jsonData)) { // DataSet returnData = JsonHelper.FromJson(jsonData); DataTable dt = JsonHelper.FromJson(data["Table"] + ""); DataTable dtResponsible = JsonHelper.FromJson(data["Table1"] + ""); if (dt != null && dt.Rows.Count > 0) { // 总单信息 DataRow properties = dt.Rows[0]; cre.Properties["BarCode"] = properties["BarCode"]; // 产品条码 cre.Properties["GoodsID"] = properties["GoodsID"]; // 产品ID cre.Properties["GoodsCode"] = properties["GoodsCode"]; // 产品编码 cre.Properties["GoodsName"] = properties["GoodsName"]; // 产品名称 cre.Properties["GroutingDailyID"] = properties["GroutingDailyID"]; // 注浆日报ID cre.Properties["GroutingDailyDetailID"] = properties["GroutingDailyDetailID"]; // 注浆日报明细ID cre.Properties["GroutingDate"] = properties["GroutingDate"]; // 注浆日期 cre.Properties["GroutingLineID"] = properties["GroutingLineID"]; // 成型生产线ID cre.Properties["GroutingLineCode"] = properties["GroutingLineCode"]; // 成型生产线编码 cre.Properties["GroutingLineName"] = properties["GroutingLineName"]; // 成型生产线名称 cre.Properties["GMouldTypeID"] = properties["GMouldTypeID"]; // 成型线类型ID cre.Properties["GroutingLineDetailID"] = properties["GroutingLineDetailID"]; // 成型生产线明细ID cre.Properties["GroutingMouldCode"] = properties["GroutingMouldCode"]; // 注浆模具编号 cre.Properties["MouldCode"] = properties["MouldCode"]; // 模具编号 cre.Properties["GroutingUserID"] = properties["GroutingUserID"]; // 注浆工号ID cre.Properties["GroutingUserCode"] = properties["GroutingUserCode"]; // 注浆工号编码 cre.Properties["GroutingNum"] = properties["GroutingNum"]; // 注浆次数 cre.Properties["ScrapType"] = properties["ScrapType"]; // 损坯类型 cre.Properties["ScrapDate"] = properties["ScrapDate"]; // 报损日期 cre.Properties["ScrapRreasonID"] = properties["ScrapRreasonID"]; // 报损日期 cre.Properties["ResponUserID"] = properties["ResponUserID"]; // 损坯工号 cre.Properties["ResponUserCode"] = properties["ResponUserCode"]; cre.Properties["Remarks"] = properties["Remarks"]; // 备注 cre.Properties["AuditStatus"] = properties["AuditStatus"]; // 审批状态 // 责任员工 cre.Data = new DataSet(); //DataTable returnTable = returnData.Tables[1].Copy(); cre.Data.Tables.Add(dtResponsible); } } ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveGroutingScrapProduct(cre, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = sre.Result; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } } // 获取成型报损信息 用于撤销使用 else if ("GetGroutingScrapProduct" == action) { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = module; cre.Name = action; if (!string.IsNullOrEmpty(jsonData)) { cre.Properties["BarCode"] = data["BarCode"]; } ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetGroutingScrapProduct(cre, sUserInfo); actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); actionResult.Status = (int)Constant.PDAResult.Success; } // 撤销成型报损 else if ("ReverseGroutingScrapProduct" == action) { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = module; cre.Name = action; if (!string.IsNullOrEmpty(jsonData)) { cre.Properties["BarCode"] = data["BarCode"]; } ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.ReverseGroutingScrapProduct(cre, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = sre.Result; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } } } #endregion #region 产品挂起 if (module == "ProductSuspend") { // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起 if (action == "GetSuspendProcedure") { ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProcedure(sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 验证挂起条码 if (action == "CheckSuspendBarcode") { ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckSuspendBarcode(sUserInfo, data["barcode"] + ""); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 挂起条码 if (action == "SaveSuspendProduct") { int[] gids = JsonHelper.FromJson(data["groutingdailydetailids"] + ""); int[] pids = JsonHelper.FromJson(data["procedureids"] + ""); ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveSuspendProduct(sUserInfo, pids, gids, data["remarks"] + ""); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 撤销挂起条码 if (action == "DeleteSuspendProduct") { int[] gids = JsonHelper.FromJson(data["groutingdailydetailids"] + ""); int[] pids = JsonHelper.FromJson(data["procedureids"] + ""); ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.DeleteSuspendProduct(sUserInfo, pids, gids); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; //actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 查询挂起条码 if (action == "GetSuspendProduct") { ServiceResultEntity sre = Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetSuspendProduct(sUserInfo, data["barcode"] + ""); if (sre.Status == Constant.ServiceResultStatus.Success) { if (sre.Data.Tables[0].Rows.Count == 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "此条码没有可撤销的挂起信息"; } else { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } } #endregion #region 品保抽查 if (module == "QASpotCheck") { if (action == "GetAllQASpotCheck") { ClientRequestEntity cre = new ClientRequestEntity(); cre.NameSpace = module; cre.Name = action; if (data != null && data.Count > 0) { foreach (string item in data.Keys) { if (item.StartsWith("checktime")) { cre.Properties.Add(item, DateTime.ParseExact(data[item] + "", "yyyy-MM-dd", null)); } else { cre.Properties.Add(item, data[item]); } } } ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.GetAllQASpotCheck(sUserInfo, cre)); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else if (sre.Status == Constant.ServiceResultStatus.NoSearchResults) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } if (action == "AutoSaveQASpotCheck") { string barcode = data["barcode"] + ""; string remarks = data["remarks"] + ""; ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.AutoSaveQASpotCheck(sUserInfo, barcode, remarks)); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } if (action == "CheckQASpotCheck") { ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.CheckQASpotCheck(sUserInfo, jsonData)); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data.Tables[0]); } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } if (action == "SaveQASpotCheck") { data["CheckTime"] = DateTime.ParseExact(data["CheckTime"] + "", "yyyy-MM-dd HH:mm:ss", null); ServiceResultEntity sre = ServiceInvoker.Invoke(this, () => Dongke.IBOSS.PRD.Service.PMModuleService.PMModuleLogic.SaveQASpotCheck(sUserInfo, data)); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } return null; } #endregion #region 产成品交接 if (module == "FinishedProduct") { // 设定商标 if (action == "GetFinishedBarcode") { string barcode = data["barcode"].ToString(); ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 2); //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0 actionResult.Message = resultEntity.Message; } else { actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = resultEntity.Message; } return actionResult; } if (action == "GetHandoveredBarcode") { string barcode = data["barcode"].ToString(); ServiceResultEntity resultEntity = PMModuleLogic.FinishedHandoverBarcode(barcode, sUserInfo, 1); //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = resultEntity.OtherStatus; //漏扫1,反之0 actionResult.Message = resultEntity.Message; } else { actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = resultEntity.Message; } return actionResult; } if (action == "SetFinishedLogo") { int logoid = Convert.ToInt32(data["logoid"]); string[] barcodes = data["barcodes"].ToString().Split(','); int result = PMModuleLogicDAL.SetFinishedLogo(barcodes, logoid, sUserInfo); //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (result < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } return actionResult; } if (action == "SetHandoveredOrder") { int orderID = Convert.ToInt32(data["orderID"]); string[] barcodes = data["barcodes"].ToString().Split(','); int result = PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, sUserInfo); //actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (result < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } return actionResult; } } #endregion #region 产成品装车 /* if (module == "FinishedLoading") { // 设定商标 if (action == "GetMaxLoadingNo") { int no = Service.PMModuleService.PMModuleLogic.GetMaxLoadingNo(sUserInfo); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = no; return actionResult; } if (action == "CheckFinishedLaodingBarcode") { string barcode = data["barcode"].ToString(); ServiceResultEntity resultEntity = Service.PMModuleService.PMModuleLogic.CheckFinishedLaodingBarcode(sUserInfo, barcode); if (resultEntity.Status == Constant.ServiceResultStatus.Success) { actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = resultEntity.Message; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = resultEntity.OtherStatus; actionResult.Message = resultEntity.Message; } return actionResult; } if (action == "SaveFinishedLoading") { int loadingNo = Convert.ToInt32(data["loadingNo"]); string carLicense = data["carLicense"] + ""; int palletNum = Convert.ToInt32(data["palletNum"]); int goodsNum = Convert.ToInt32(data["goodsNum"]); string remarks = data["remarks"] + ""; Dictionary[] details = JsonHelper.FromJson[]>(data["details"] + ""); //"[{\"A\":1,\"B\":\"V\"},{\"A\":2,\"B\":\"V1\"}]" ServiceResultEntity result = Service.PMModuleService.PMModuleLogic.SaveFinishedLoading(sUserInfo, loadingNo, carLicense, palletNum, goodsNum, remarks, details); if (result.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = result.Message; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = result.OtherStatus; actionResult.Message = result.Message; } return actionResult; } } */ #endregion #region 产成品质量改判 if (module == "FinishedProductTamper") { // 获取产成品信息及缺陷数据 if (action == "GetDefectData") { string barcode = data["barcode"].ToString(); ServiceResultEntity sre = PDAModuleLogic.GetDefectData(barcode, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Result); actionResult.Message = sre.Message; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } // 获取产成品信息及缺陷数据 if (action == "SaveDefectData") { ProductionDataEntity productionDataEntity = JsonHelper.FromJson(data["ProductionDataEntity"] + ""); ServiceResultEntity sre = PDAModuleLogic.SaveDefectData(productionDataEntity, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Message = sre.Message; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 通过条码查出责任工序(成品改判用) if (action == "GetDutyProcedureByBarCodeForTamper") { string barcode = data["barcode"] + ""; int defectid = int.Parse(data["defectid"] + ""); ServiceResultEntity sre = PDAModuleLogic.GetDutyProcedureByBarCodeForTamper(barcode, defectid, sUserInfo.AccountID); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Data); actionResult.Message = sre.Message; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } } #endregion #region PDA独立功能 #region 水效标识 if (module == "WaterEffect") { // 获取产成品信息及水效标识 if (action == "GetGoodsByBarCode") { string barcode = data["barcode"].ToString(); ServiceResultEntity sre = PDAModuleLogic.GetGoodsByBarCode(barcode, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; actionResult.Result = JsonHelper.ToJson(sre.Result); actionResult.Message = sre.Message; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre.OtherStatus; actionResult.Message = sre.Message; } return actionResult; } } #endregion #region 盖板型号 if (module == "SeatCoverType") { // 获取产成品信息及水效标识 if (action == "SendGoodsCodeToPLC") { string barcode = data["barcode"].ToString(); int sre = PLCModuleLogic.SendGoodsCodeToPLCBySeatCover(barcode, sUserInfo); if (sre == 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre; switch (sre) { case 1: case 2: actionResult.Message = "无效条码"; break; case 3: actionResult.Message = "此产品型号没有设置盖板标识码"; break; case 4: actionResult.Message = "当前用户没有设置PLC参数"; break; case 5: actionResult.Message = "PLC参数设置不全"; break; default: actionResult.Message = "PLC通信异常"; break; } } return actionResult; } } #endregion #region PDA PLC 相关功能 if (module == "PDA_FUN_PLC") { // PDA扫码发送到PLCServer if (action == "SendBarcodeToPLCServer") { string barcode = data["barcode"].ToString(); int sre = PLCModuleLogic.SendBarcodeToPLCServer(barcode, sUserInfo); if (sre == 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Result = sre; switch (sre) { case 1: case 2: actionResult.Message = "无效条码"; break; case 3: actionResult.Message = "PLC通信异常"; break; case 4: actionResult.Message = "当前用户没有设置PLC参数"; break; case 5: actionResult.Message = "PLC参数设置不全"; break; default: actionResult.Message = "PLC通信异常"; break; } } return actionResult; } } #endregion #endregion #region 半检返修 if (module == "SemiRework") { // 验证半检返修条码 if (action == "CheckSemiReworkBarcode") { ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.CheckSemiReworkBarcode(jsonData); actionResult.Result = JsonHelper.ToJson(Convert.ToInt32(resultEntity.Result)); if (Convert.ToInt32(resultEntity.Result) < 0) { actionResult.Status = (int)Constant.PDAResult.Fail; } else { actionResult.Status = (int)Constant.PDAResult.Success; } actionResult.Message = resultEntity.Message; return actionResult; } // 可以返修的工序 if (action == "GetSemiReworkProcedure") { ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.GetSemiReworkProcedure(jsonData, sUserInfo); actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; return actionResult; } // 根据条码获取经过的工序,用于责任工序 if (action == "GetSemiReworkPassProcedure") { ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.GetSemiReworkPassProcedure(jsonData); actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; return actionResult; } // 根据所选生产工序(生产数据ID)查询责任员工 if (action == "GetSemiReworkDefectStaffByProductionDataID") { int productionDataID = Convert.ToInt32(jsonData); ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.GetSemiReworkDefectStaffByProductionDataID(productionDataID); actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; return actionResult; } // 根据所选工号,查出缺陷责任员工 if (action == "GetSemiReworkDefectStaffByUserID") { int userID = Convert.ToInt32(jsonData); ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.GetSemiReworkDefectStaffByUserID(userID); actionResult.Result = JsonHelper.ToJson(resultEntity.Data); actionResult.Status = (int)Constant.PDAResult.Success; return actionResult; } // 新建半检返修 if (action == "AddSemiRework") { SemiReworkEntity entity = JsonHelper.FromJson(data["SemiReworkEntity"]+""); ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.AddSemiRework(entity, sUserInfo); actionResult.Result = resultEntity.Result; actionResult.Message = resultEntity.Message; if (Convert.ToInt32(resultEntity.Result) > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; } return actionResult; } // 编辑半检返修 if (action == "EditSemiRework") { SemiReworkEntity entity = JsonHelper.FromJson(data["SemiReworkEntity"] + ""); ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.EditSemiRework(entity, sUserInfo); actionResult.Result = resultEntity.Result; actionResult.Message = resultEntity.Message; if (Convert.ToInt32(resultEntity.Result) > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; } return actionResult; } // 撤销半检返修 if (action == "CancelSemiRework") { SemiReworkEntity entity = JsonHelper.FromJson(data["SemiReworkEntity"] + ""); ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.CancelSemiRework(entity, sUserInfo); actionResult.Result = resultEntity.Result; actionResult.Message = resultEntity.Message; if (Convert.ToInt32(resultEntity.Result) > 0) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; } return actionResult; } // 获取半检返修数据(PDA编辑用) if (action == "GetSemiReworkByID") { int id = Convert.ToInt32(jsonData); ServiceResultEntity resultEntity = Dongke.IBOSS.PRD.Service.PMModuleService. PMModuleLogic.GetSemiReworkByID(id,sUserInfo.UserCode); DataTable data1 = resultEntity.Data.Tables[0]; DataTable data2 = resultEntity.Data.Tables[1]; DataTable data3 = resultEntity.Data.Tables[2]; if (data1.Rows.Count == 0) { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = "半检返修信息不存在"; return actionResult; } SemiReworkEntity srEntity = new SemiReworkEntity(); srEntity.SemiReworkID = id; srEntity.BarCode = data1.Rows[0]["BarCode"] + ""; srEntity.ReworkProcedureID = Convert.ToInt32(data1.Rows[0]["ReworkProcedureID"]); srEntity.Remarks = data1.Rows[0]["Remarks"] + ""; srEntity.SemiReworkDefects = new List(); foreach (DataRow row2 in data2.Rows) { SemiReworkDefectEntity defectEntity = new SemiReworkDefectEntity(); srEntity.SemiReworkDefects.Add(defectEntity); defectEntity.SemiReworkDefectID = Convert.ToInt32(row2["SemiReworkDefectID"]); defectEntity.SemiReworkID = id; defectEntity.DefectID = Convert.ToInt32(row2["DefectID"]); defectEntity.DefectCode = row2["DefectCode"] + ""; defectEntity.DefectName = row2["DefectName"] + ""; defectEntity.DefectPositionID = Convert.ToInt32(row2["DefectPositionID"]); defectEntity.DefectPositionCode = row2["DefectPositionCode"] + ""; defectEntity.DefectPositionName = row2["DefectPositionName"] + ""; defectEntity.ScrapResponFlag = row2["ScrapResponFlag"] + ""; defectEntity.DefectProductionDataID = row2["DefectProductionDataID"].ToNullableInt32(); defectEntity.DefectProcedureID = row2["DefectProcedureID"].ToNullableInt32(); defectEntity.DefectProcedureCode = row2["DefectProcedureCode"] + ""; defectEntity.DefectProcedureName = row2["DefectProcedureName"] + ""; defectEntity.Remarks = row2["Remarks"] + ""; defectEntity.DefectUserID = Convert.ToInt32(row2["DefectUserID"]); defectEntity.DefectUserCode = row2["DefectUserCode"] + ""; defectEntity.DefectUserName = row2["DefectUserName"] + ""; defectEntity.DefectResponsibles = new List(); defectEntity.ValueFlag = Convert.ToInt32(row2["ValueFlag"]); DataRow[] row3s = data3.Select("SemiReworkDefectID=" + defectEntity.SemiReworkDefectID); if (row3s.Length == 0) { continue; } foreach (DataRow row3 in row3s) { SemiReworkRPSEntity semiReworkRPS = new SemiReworkRPSEntity(); defectEntity.DefectResponsibles.Add(semiReworkRPS); semiReworkRPS.SemiReworkDefectID = Convert.ToInt32(row3["SemiReworkDefectID"]); semiReworkRPS.StaffID = Convert.ToInt32(row3["StaffID"]); semiReworkRPS.StaffName = row3["StaffName"] + ""; semiReworkRPS.StaffCode = row3["StaffCode"] + ""; semiReworkRPS.SemiReworkID = Convert.ToInt32(row3["SemiReworkID"]); semiReworkRPS.UserID = Convert.ToInt32(row3["UserID"]); semiReworkRPS.UserCode = row3["UserCode"] + ""; semiReworkRPS.UJobsID = Convert.ToInt32(row3["UJobsID"]); semiReworkRPS.SJobsID = Convert.ToInt32(row3["SJobsID"]); } } //xuwei note 总单用于显示,信息较全 actionResult.Message = JsonHelper.ToJson(data1); //xuwei note 总单信息不全,但有明细,用于回传保存 actionResult.Result = JsonHelper.ToJson(srEntity); actionResult.Status = (int)Constant.PDAResult.Success; } } #endregion #region 窑车漏扫补件 if (module == "F_PM_0504") { // 验证窑车编码是否存在 if (action == "CheckKilnCar") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["kilncarcode"] = data["KilnCarCode"]; cre.Properties["procedureID"] = data["ProcedureID"]; ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 验证窑车烧成批次号是否存在 和 是否能补漏扫 if (action == "CheckKilnCarBatchNo") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["KilnID"] = data["KilnID"]; cre.Properties["KilnCarID"] = data["KilnCarID"]; cre.Properties["ProcedureID"] = data["ProcedureID"]; cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"]; ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } // 窑车漏扫补件 if (action == "SetKilnCarMissing") { ClientRequestEntity cre = new ClientRequestEntity(); cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"]; string carData = data["CarData"] + ""; DataTable dataTable = JsonHelper.FromJson(carData); cre.Data = new DataSet(); cre.Data.Tables.Add(dataTable); ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo); if (sre.Status == Constant.ServiceResultStatus.Success) { actionResult.Status = (int)Constant.PDAResult.Success; } else { actionResult.Status = (int)Constant.PDAResult.Fail; actionResult.Message = sre.Message; } return actionResult; } } #endregion return actionResult; } catch (Exception ex) { //LogFileOperation.Error(DataManager.LogFileName, ex.Message); OutputLog.TraceLog(LogPriority.Error, this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name + System.Environment.NewLine + JsonHelper.ToJson(sUserInfo) + System.Environment.NewLine + " module:" + module + " action:" + action + " json:" + jsonData, ex.ToString(), LocalPath.LogExePath); actionResult.Status = (int)Constant.PDAResult.Exception; actionResult.Message = Constant.PDA_RESULT_EXCEPTION; } return actionResult; } #endregion } }