/******************************************************************************* * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential * 类的信息: * 1.程序名称:PMModuleService.cs * 2.功能描述:生产管理模块WCF服务 * 编辑履历: * 作者 日期 版本 修改内容 * 陈晓野 2015/03/26 1.00 新建 *******************************************************************************/ using System; using System.Collections.Generic; using System.Data; using System.ServiceModel; using System.ServiceModel.Activation; using Curtain.Extension.ExObjectConvert; using Dongke.IBOSS.PRD.Basics.Library; using Dongke.IBOSS.PRD.Service.PDAModuleLogic; using Dongke.IBOSS.PRD.Service.PMModuleService; using Dongke.IBOSS.PRD.WCF.Contracts; using Dongke.IBOSS.PRD.WCF.DataModels; namespace Dongke.IBOSS.PRD.WCF.Services { /// /// 生产管理模块WCF服务 /// /// 服务实现类,继承服务声明接口 /// 该标签声明该服务可以在ASP.NET下运行 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(ConfigurationName = "PMModuleServiceNew", InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)] public class PMModuleServiceNew : ServicesBase, IPMModuleNew { #region 构造函数 /// /// 构造函数 /// public PMModuleServiceNew() : base() { } #endregion #region 注浆管理 #region 注浆登记一览 /// /// 取得FPM0101画面(注浆登记)的初始化数据 /// /// 初始化数据 public ServiceResultEntity GetFPM0101IData() { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0101IData(this.SUserInfo)); } /// /// 取得FPM0101画面(注浆登记)的查询数据 /// /// 查询条件 /// 查询结果 public ServiceResultEntity GetFPM0101SData(FPM0101_SE se) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0101SData(this.SUserInfo, se)); } /// /// 取得FPM0101画面(注浆登记)的查询数据 /// /// 新建注浆登记的id(多个用【,】隔开) /// 查询结果 public ServiceResultEntity GetFPM0101NSData(string ids) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0101SData(this.SUserInfo, ids)); } #endregion 注浆登记 #region 注浆登记 /// /// 取得FPM0102画面(注浆登记)的成型线数据 /// /// 注浆日期(null:当天) /// 成型线ID(多个用【,】隔开;null:全部注浆) /// /// 成型线数据 /// OtherStatus = 1:注浆日期大于账务日期 /// OtherStatus = 2:没有可注浆的成型线 /// OtherStatus = 3:没有可注浆的模具 /// public ServiceResultEntity GetFPM0102_GroutingLine(DateTime? groutingDate, string groutingIDs) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0102_GroutingLine(this.SUserInfo, groutingDate, groutingIDs)); } /// /// 取得FPM0102画面(注浆登记)的初始化数据 /// /// 注浆日报ID /// /// 初始化数据 /// 注浆数据 /// OtherStatus = 1:没有可编辑的注浆信息 /// OtherStatus = 2:没有可编辑的注浆明细信息 /// public ServiceResultEntity GetFPM0102IData(int groutingDailyID) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0102IData(this.SUserInfo, groutingDailyID)); } /// /// 取得FPM0104画面(选择成型线)的查询数据 /// /// 查询条件 /// 查询结果 public ServiceResultEntity GetFPM0104SData(FPM0104_SE se) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0104SData(this.SUserInfo, se)); } /// /// 保存FPM0102画面(注浆登记)的注浆数据 /// /// 注浆日期(null:编辑;非null:新建) /// 注浆数据 /// 保存结果 /// OtherStatus = 1: 没有以下成型线的操作权限 /// OtherStatus = 2: 以下成型线已做过注浆 /// OtherStatus = 3: 以下成型工号已被停用 /// OtherStatus = 4: 补注浆,成型工号没有班次配置 /// OtherStatus = 5: 以下成型工号没有配置员工关联 /// public ServiceResultEntity SetFPM0102Data(DateTime? groutingDate, DataSet groutingInfo) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SetFPM0102Data(this.SUserInfo, groutingDate, groutingInfo)); } /// /// 取得FPM0105画面(选择能绑定条码的注浆登记)的查询数据 /// s /// 查询条件 /// 查询结果 public ServiceResultEntity GetFPM0105SData(FPM0104_SE se) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0105SData(this.SUserInfo, se)); } #endregion 注浆登记 #region 条码绑定 /// /// 取得FPM0103画面(绑定条码)的注浆数据 /// /// 注浆日报ID /// /// 注浆数据 /// OtherStatus = 1:没有可编辑的注浆信息 /// OtherStatus = 2:没有可编辑的注浆明细信息 /// public ServiceResultEntity GetFPM0103Data(int groutingDailyID) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0103Data(this.SUserInfo, groutingDailyID)); } /// /// 保存FPM0103画面(绑定条码)的注浆数据 /// /// 注浆数据 /// 保存结果 public ServiceResultEntity SetFPM0103Data(DataSet groutingInfo) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SetFPM0103Data(this.SUserInfo, groutingInfo)); } #endregion 条码绑定 #endregion 注浆管理 #region 条码管理 #region 条码变更 /// /// 取得FPM0202画面(条码变更用条码查询)的查询数据 /// /// 查询条件 /// 查询结果 public ServiceResultEntity GetFPM0202SData(FPM0202_SE se) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0202SData(this.SUserInfo, se)); } /// /// 取得FPM0203画面(条码变更)的查询数据 /// /// 条码 /// 查询结果 public ServiceResultEntity GetFPM0203NSData(string barcode) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0203SData(this.SUserInfo, barcode)); } /// /// 取得FPM0203画面(条码变更)的查询数据 /// /// 查询条件 /// 查询结果 public ServiceResultEntity GetFPM0203SData(FPM0203_SE se) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFPM0203SData(this.SUserInfo, se)); } /// /// 更换条码 /// /// 原条码 /// 新条码 /// 备注 /// 操作结果 public ServiceResultEntity SetFPM0201Data(string barcode, string newBarcode, string remarks, string groutingUserCode, string goodsCode) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SetFPM0201Data(this.SUserInfo, barcode, newBarcode, remarks, groutingUserCode, goodsCode)); } #endregion 条码变更 #endregion 条码管理 #region 请求处理 /// /// 处理请求 /// /// /// public ServiceResultEntity HandleRequest(ClientRequestEntity cre) { try { #region 生产数据查询(干补) if (cre.NameSpace == "ProductionData") { // 干补一览表 if ("GetProductionData_8" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetProductionData8(this.SUserInfo, cre)); } return null; } #endregion #region 注浆盘点 if (cre.NameSpace == "GBChecked") { // seachbox if ("seachbox_GetList" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGBCheckedList(this.SUserInfo, cre)); } else if ("UpdateGBChecked" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.UpdateGBChecked(this.SUserInfo, cre)); } else if ("GetGBCheckedInfoForUpdate" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGBCheckedInfoForUpdate(this.SUserInfo, cre)); } else if ("SaveGBChecked" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveGBChecked(this.SUserInfo, cre)); } else if ("DisableGBChecked" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.DisableGBChecked(this.SUserInfo, cre)); } else if ("GetAllGBCheckList" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetAllGBCheckList(this.SUserInfo, cre)); } else if ("GetAllGBCheckDetail" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetAllGBCheckDetail(this.SUserInfo, cre)); } else if ("SaveClearGBChecked" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveClearGBChecked(this.SUserInfo, cre)); } // 盘点选中条码 else if ("GBCheckBarcodes" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GBCheckBarcodes(this.SUserInfo, cre)); } return null; } // 在产盘点 if (cre.NameSpace == "InChecked") { // 盘点选中条码 if ("CheckBarcodes" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckBarcodes(this.SUserInfo, cre)); } } #endregion #region 取消最后注浆 if (cre.NameSpace == "F_PM_0106") { if ("CheckFPM0106GLCode" == cre.Name) { string glcode = cre.Properties["glcode"] + ""; return ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckFPM0106GLCode(this.SUserInfo, glcode)); } if ("SetFPM0106GLCode" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SetFPM0106GLCode(this.SUserInfo, cre)); } } #endregion #region 生产管理 // 集中采集的结束工序(包装装板)验证参数(商标、型号、数量) if (cre.NameSpace == "FinishedLoadingCar") { // 包装装板验证 if ("GetSetting" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetFinishedLoadingCarSetting(this.SUserInfo, cre)); } return null; } #endregion #region 成型报损 if (cre.NameSpace == "GroutingScrapProduct") { // 查询注浆日报明细表 if ("GetGroutingDailyDetail" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGroutingDailyDetail(cre, this.SUserInfo)); } // 查询成型报损 else if ("GetGroutingScrapProduct" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGroutingScrapProduct(cre, this.SUserInfo)); } // 保存成型报损 else if ("SaveGroutingScrapProduct" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveGroutingScrapProduct(cre, this.SUserInfo)); } // 审核成型报损 else if ("AuditGroutingScrapProduct" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.AuditGroutingScrapProduct(cre, this.SUserInfo)); } // 撤销成型报损 else if ("ReverseGroutingScrapProduct" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.ReverseGroutingScrapProduct(cre, this.SUserInfo)); } // 开模报损 else if ("SaveScrapKm" == cre.Name) { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveScrapKm(cre, this.SUserInfo)); } return null; } #endregion #region 产品挂起 // 一览页面查询 if (cre.NameSpace == "ProductSuspend") { if (cre.Name == "GetAllSuspendProduct") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetAllSuspendProduct(this.SUserInfo, cre)); } } // 挂起、撤销 if (cre.NameSpace == "F_PM_3002") { // 获取可以挂起的工序(干补、装车、入窑、出窑)工序不能挂起 if (cre.Name == "GetSuspendProcedure") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetSuspendProcedure(SUserInfo)); } // 验证挂起条码 if (cre.Name == "CheckSuspendBarcode") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckSuspendBarcode(SUserInfo, cre.Properties["Barcode"] + "")); } // 查询挂起条码 if (cre.Name == "GetSuspendProduct") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetSuspendProduct(SUserInfo, cre.Properties["Barcode"] + "")); } // 挂起条码 if (cre.Name == "SaveSuspendProduct") { List gids = new List(); List pids = new List(); foreach (DataRow row in cre.Data.Tables[0].Rows) { gids.Add(Convert.ToInt32(row["groutingdailydetailid"])); } string[] procedureIDs = (cre.Properties["ProcedureIDS"] + "").Split(','); foreach (string s in procedureIDs) { pids.Add(Convert.ToInt32(s)); } return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveSuspendProduct(SUserInfo, pids.ToArray(), gids.ToArray(), cre.Properties["Remarks"] + "")); } // 撤销挂起条码 if (cre.Name == "DeleteSuspendProduct") { List gids = new List(); List pids = new List(); foreach (DataRow row in cre.Data.Tables[0].Rows) { gids.Add(Convert.ToInt32(row["groutingdailydetailid"])); pids.Add(Convert.ToInt32(row["SuspendProcedureID"])); } return ServiceInvoker.Invoke(this, () => PMModuleLogic.DeleteSuspendProduct(SUserInfo, pids.ToArray(), gids.ToArray())); } } #endregion #region 品保抽查 if (cre.NameSpace == "QASpotCheck") { if (cre.Name == "GetAllQASpotCheck") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetAllQASpotCheckForPC(this.SUserInfo, cre)); } if (cre.Name == "CheckQASpotCheck") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.CheckQASpotCheck(this.SUserInfo, cre.Request + "")); } if (cre.Name == "SaveQASpotCheck") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveQASpotCheck(this.SUserInfo, cre.Properties)); } return null; } #endregion #region 产成品交接 // 变更商标(整板) if (cre.NameSpace == "F_PM_2405") { // 条码验证,返回条码数据 if (cre.Name == "FinishedHandoverBarcode") { string barcode = cre.Properties["Barcode"] + ""; int handoverFlag = Convert.ToInt32(cre.Properties["HandoverFlag"] + ""); return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.FinishedHandoverBarcode(barcode, SUserInfo, handoverFlag)); } // 变更商标(整板) if (cre.Name == "SetFinishedLogo") { ServiceResultEntity sre = new ServiceResultEntity(); string[] barcodes = (cre.Properties["Barcodes"] + "").Split(','); int logoID = Convert.ToInt32(cre.Properties["LogoID"] + ""); string returnMessage = ""; sre.Result = ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogicDAL.SetFinishedLogo(barcodes, logoID, SUserInfo, out returnMessage)); sre.Message = returnMessage; return sre; } } // 变更单号(整板) if (cre.NameSpace == "F_PM_2406") { // 条码验证,返回条码数据 if (cre.Name == "FinishedHandoverBarcode") { string barcode = cre.Properties["Barcode"] + ""; int handoverFlag = Convert.ToInt32(cre.Properties["HandoverFlag"] + ""); return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.FinishedHandoverBarcode(barcode, SUserInfo, handoverFlag)); } // 变更单号(整板) if (cre.Name == "SetHandoveredOrder") { ServiceResultEntity sre = new ServiceResultEntity(); string[] barcodes = (cre.Properties["Barcodes"] + "").Split(','); int orderID = Convert.ToInt32(cre.Properties["OrderID"] + ""); sre.Result = ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogicDAL.SetHandoveredOrder(barcodes, orderID, SUserInfo)); return sre; } } #endregion #region 窑车漏扫补件 if (cre.NameSpace == "F_PM_0504") { // 验证窑车编码是否存在 if (cre.Name == "CheckKilnCar") { return PMModuleLogic.CheckKilnCar(cre, SUserInfo); } // 验证窑车烧成批次号是否存在 和 是否能补漏扫 if (cre.Name == "CheckKilnCarBatchNo") { return PMModuleLogic.CheckKilnCarBatchNo(cre, SUserInfo); } // 窑车漏扫补件 if (cre.Name == "SetKilnCarMissing") { return PMModuleLogic.SetKilnCarMissing(cre, SUserInfo); } } #endregion #region 工序半检 xuwei add 2019-12-11 if (cre.NameSpace == "ProcedureSemi") { if (cre.Name == "GetGoodsGradeDataSemi") { return ServiceInvoker.Invoke(this, () => PDAModuleLogic.GetGoodsGradeDataSemi(Convert.ToInt32(cre.Properties["procedureId"]), this.SUserInfo)); } return null; } #endregion #region 梭式窑入窑 fubin add 2020-6-24 if (cre.NameSpace == "F_PM_0505") { if (cre.Name == "SaveSKBatchNo") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveSKBatchNo(cre, this.SUserInfo)); } return null; } #endregion #region 重启3#高压注浆 else if (cre.NameSpace == "F_PM_0107") { // 查询3#高压注浆线 if (cre.Name == "GetGroutingLine3") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.GetGroutingLine3(this.SUserInfo)); } // 重置注浆批次 if (cre.Name == "SaveGroutingLine3") { return ServiceInvoker.Invoke(this, () => PMModuleLogic.SaveGroutingLine3(cre, this.SUserInfo)); } } #endregion #region 生产订单 fubin add 2020-8-21 else if (cre.NameSpace == "F_PM_2301") { if (cre.Name == "GetOrderDetail") { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.GetOrderDetail(cre.Properties["OrderID"].ToInt32())); } return null; } else if ("F_PM_2302" == cre.NameSpace) { // 保存订单 if (cre.Name == "SaveOrder") { OrderEntity order = JsonHelper.FromJson(cre.Request + ""); return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogicDAL.SaveOrder(order, SUserInfo)); } return null; } #endregion #region 产成品整撤销 if (cre.NameSpace == "F_PM_2407") { if (cre.Name == "BackFinishedHandoverCheck") { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.BackFinishedHandoverCheck(cre.Properties["Barcode"] + "", this.SUserInfo)); } else if (cre.Name == "BackFinishedHandover") { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogicDAL.BackFinishedHandover(cre.Data.Tables[0], this.SUserInfo)); } return null; } #endregion #region 发货单 if (cre.NameSpace == "F_PM_3501") { // 发货单仓库 if ("GetSendWarehouse" == cre.Name) { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.GetSendWarehouse(this.SUserInfo, cre)); } else if ("GetNumberplaten" == cre.Name) { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.GetNumberPlate(this.SUserInfo, cre)); } else if ("GetSendOutGoodsLog" == cre.Name) { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.GetSendOutGoodsLog(this.SUserInfo, cre)); } else if ("GetSendOutGoodsLogDetail" == cre.Name) { return ServiceInvoker.Invoke(this, () => Service.PMModuleLogic.PMModuleLogic.GetSendOutGoodsLogDetail(this.SUserInfo, cre)); } return null; } #endregion return null; } catch (Exception ex) { throw ex; } } #endregion } }