/// <summary> /// 获取销货出库单服务 /// </summary> /// <param name="programJobNo"></param> /// <param name="scanType"></param> /// <param name="status"></param> /// <param name="docNo"></param> /// <param name="siteNo"></param> /// <param name="ID"></param> /// <returns></returns> public DependencyObjectCollection GetSalesIssue(string programJobNo, string scanType, string status, string[] docNo, string siteNo, string ID) { #region 参数检查 IInfoEncodeContainer infoCodeSer = GetService <IInfoEncodeContainer>(); //信息编码服务 if (Maths.IsEmpty(programJobNo)) { throw new BusinessRuleException(infoCodeSer.GetMessage("A111201", "program_job_no"));//‘入参【programJobNo】未传值’ } if (Maths.IsEmpty(status)) { throw new BusinessRuleException(infoCodeSer.GetMessage("A111201", "status")); } if (Maths.IsEmpty(docNo)) { throw new BusinessRuleException(infoCodeSer.GetMessage("A111201", "doc_no")); } if (Maths.IsEmpty(siteNo)) { throw new BusinessRuleException(infoCodeSer.GetMessage("A111201", "siteNo")); } #endregion //查询销货出库单信息 QueryNode queryNode = GetSalesIssueNode(programJobNo, siteNo, docNo, status); return(GetService <IQueryService>().ExecuteDependencyObject(queryNode)); }
/// <summary> /// 根据传入的供应商编号检查供应商是否存在,若存在返回供应商编号和名称 /// </summary> /// <param name="supplier_no">供应商编号</param> /// <returns></returns> public Hashtable Supplier(string supplier_no) { try { IInfoEncodeContainer infoCode = GetService <IInfoEncodeContainer>();//信息编码服务 if (Maths.IsEmpty(supplier_no)) { throw new BusinessRuleException(infoCode.GetMessage("A111201", "supplier_no"));//‘入参【supplier_no】未传值’ } //获取供应商信息 QueryNode node = GetSupplier(supplier_no); DependencyObjectCollection supplierData = GetService <IQueryService>().ExecuteDependencyObject(node); //Query.Count=0 if (supplierData.Count == 0) { throw new BusinessRuleException(infoCode.GetMessage("A100711"));//报错:供应商不存在 } //组织返回结果 Hashtable result = new Hashtable { { "supplier_no", supplierData[0]["SUPPLIER_CODE"] }, { "supplier_name", supplierData[0]["SUPPLIER_NAME"] } }; //供应商编号 //供应商名称 return(result); } catch (Exception) { throw; } }
/// <summary> /// 产生生产入库申请单 /// </summary> /// <param name="employee_no">扫描人员</param> /// <param name="scan_type">扫描类型1.有箱条码 2.无箱条码</param> /// <param name="report_datetime">上传时间</param> /// <param name="picking_department_no">领料部门</param> /// <param name="recommended_operations">建议执行作业</param> /// <param name="recommended_function">A.新增 S.过帐</param> /// <param name="scan_doc_no">扫描单号</param> /// <param name="scanColl"></param> public DependencyObjectCollection InsertMOReceiptReq(string employee_no, string scan_type, DateTime report_datetime, string picking_department_no, string recommended_operations, string recommended_function, string scan_doc_no, DependencyObjectCollection scanColl) { IInfoEncodeContainer infoContainer = GetService <IInfoEncodeContainer>(); if (string.IsNullOrEmpty(recommended_operations)) { throw new BusinessRuleException(string.Format(infoContainer.GetMessage("A111201"), "recommended_operations")); } if (string.IsNullOrEmpty(recommended_function)) { throw new BusinessRuleException(string.Format(infoContainer.GetMessage("A111201"), "recommended_function")); } string category = "59"; //20170209 add by liwei1 for P001-170203001 ===begin=== object docId = QueryDocId(category, recommended_operations, scanColl); if (Maths.IsEmpty(docId)) { throw new BusinessRuleException(infoContainer.GetMessage("A111275")); } //20170209 add by liwei1 for P001-170203001 ===end=== UtilsClass utilsClass = new UtilsClass(); DependencyObjectCollection resultColl = utilsClass.CreateReturnCollection(); using (IConnectionService connectionService = this.GetService <IConnectionService>()) { _qurService = this.GetService <IQueryService>(); CreateTempTable(); InsertToScan(employee_no, picking_department_no, scanColl); InsertMR(report_datetime, category, recommended_operations, resultColl, docId); } return(resultColl); }
/// <summary> /// 根据传入的信息,生成到货检验单信息 /// </summary> /// <param name="delivery_no">送货单</param> /// <param name="supplier_no">供货商</param> /// <param name="supplier_name">供货商名称</param> /// <param name="receipt_no">收货单</param> /// <param name="receipt_list"></param> /// <returns></returns> public Hashtable InsertPoArrivalInspection(string delivery_no, string supplier_no, string supplier_name, string receipt_no, DependencyObjectCollection receipt_list) { try { // 参数检查 IInfoEncodeContainer infoCodeSer = GetService <IInfoEncodeContainer>(); //信息编码服务 if (Maths.IsEmpty(receipt_no)) { throw new BusinessRuleException(infoCodeSer.GetMessage("A111201", "receipt_no"));//‘入参【receipt_no】未传值’ } //获取到货单信息 DependencyObjectCollection purchaseArrival = GetPurchaseArrival(receipt_no); //单据性质检查 Dictionary <int, object> docIdDt = new Dictionary <int, object>(); foreach (DependencyObject item in purchaseArrival) { string category = string.Empty; if (item["PURCHASE_TYPE"].ToStringExtension() == "1" || item["PURCHASE_TYPE"].ToStringExtension() == "5") { category = "Q1"; } else if (item["PURCHASE_TYPE"].ToStringExtension() == "2" || item["PURCHASE_TYPE"].ToStringExtension() == "3") { category = "Q2"; } object docId = GetDocId(receipt_no, category); if (docId == null || Maths.IsEmpty(docId)) { throw new BusinessRuleException(infoCodeSer.GetMessage("A111275"));//未找到对应的FIL单据类型设置,请检查! } docIdDt.Add(item["SequenceNumber"].ToInt32(), docId); } List <int> paiSequenceNumber = (from item in purchaseArrival where (!item["PURCHASE_TYPE"].Equals("3") && item["INSPECT_MODE_IP"].Equals("2")) || (item["PURCHASE_TYPE"].Equals("3") && item["INSPECT_MODE_MRD"].Equals("2")) select item["SequenceNumber"].ToInt32()).ToList(); //生成到货检验逻辑 string qcNo = InsertPoArrivalInspection(receipt_no, receipt_list, paiSequenceNumber, docIdDt); //组织返回结果 Hashtable result = new Hashtable { { "qc_no", qcNo } }; return(result); } catch (Exception) { throw; } }
/// <summary> /// 根据传入的供应商查询出所有的采购未交明细 /// </summary> /// <param name="supplier_no">供应商编号(必填)</param> /// <param name="date_s">订单日期起</param> /// <param name="date_e">订单日期止</param> /// <param name="due_date_s">预交日期起</param> /// <param name="due_date_e">预交日期止</param> /// <param name="item_no">料件编号</param> /// <param name="item_name">品名</param> /// <param name="item_spec">规格</param> /// <param name="qc_type">检验否</param> /// <param name="enterprise_no">企业别</param> /// <param name="site_no">营运中心</param> /// <param name="purchase_no">采购单号</param> /// <returns></returns> public Hashtable PurchaseOrderUaqty(string supplier_no, string date_s, string date_e, string due_date_s, string due_date_e, string item_no, string item_name, string item_spec, string qc_type, string enterprise_no, string site_no , string purchase_no//20170919 add by liwei1 for B001-170918003 ) { try { if (Maths.IsEmpty(supplier_no)) { IInfoEncodeContainer infoEnCode = GetService <IInfoEncodeContainer>(); throw new BusinessRuleException(infoEnCode.GetMessage("A111201", "supplier_no"));//‘入参【supplier_no】未传值’( A111201) } //查询采购未交明细 QueryNode queryNode = GetPurchaseDetail(supplier_no, date_s, date_e, due_date_s, due_date_e, item_no, item_name, item_spec, site_no , purchase_no//20170919 add by liwei1 for B001-170918003 ); DependencyObjectCollection purchaseDetail = GetService <IQueryService>().ExecuteDependencyObject(queryNode); //组合返回结果 Hashtable result = new Hashtable { { "purchase_detail", purchaseDetail } }; return(result); } catch (Exception) { throw; } }
/// <summary> /// 根据传入的单号信息删除送货单 /// </summary> /// <param name="delivery_no">送货单号</param> public void DeleteFilArrival(string delivery_no) { try { //20170508 add by liwei1 for P001-161209002 ---begin--- //检查该送货单是否已生成到货单,若已生成到货单则不能审核 if (GetCountNum(delivery_no) > 0) { IInfoEncodeContainer infoEnCode = GetService <IInfoEncodeContainer>(); throw new BusinessRuleException(infoEnCode.GetMessage("A111446"));//该送货单已生成到货单,不能删除! } //20170508 add by liwei1 for P001-161209002 ---end--- using (ITransactionService transActionService = GetService <ITransactionService>()) { //删除送货单 QueryNode queryNode = OOQL.Delete("FIL_ARRIVAL") .Where((OOQL.CreateProperty("FIL_ARRIVAL.DOC_NO") == OOQL.CreateConstants(delivery_no))); GetService <IQueryService>().ExecuteNoQuery(queryNode); //删除送货单单身 queryNode = OOQL.Delete("FIL_ARRIVAL.FIL_ARRIVAL_D") .Where(OOQL.CreateProperty("FIL_ARRIVAL.FIL_ARRIVAL_D.DOC_NO") == OOQL.CreateConstants(delivery_no)); GetService <IQueryService>().ExecuteNoQuery(queryNode); transActionService.Complete(); } } catch (Exception) { throw; } }
/// <summary> /// /// </summary> /// <param name="counting_type">盘点类型</param> /// <param name="site_no">营运据点</param> /// <param name="counting_no">盘点计划编号</param> /// <param name="scan"></param> public void UpdateCountingPlan(string counting_type, string site_no, string counting_no, DependencyObjectCollection scan) { if (string.IsNullOrEmpty(counting_no)) { IInfoEncodeContainer infoContainer = this.GetService <IInfoEncodeContainer>(); throw new BusinessRuleException(string.Format(infoContainer.GetMessage("A111201"), "counting_no")); } using (IConnectionService connectionService = this.GetService <IConnectionService>()) { _qurService = this.GetService <IQueryService>(); CreateTempTable(); //创建临时表 InsertToScan(site_no, scan); //临时表储存scan入参 QueryNode queryScan = QueryScan(counting_no); QueryNode querySumNode = QuerySumForInsert(counting_no, queryScan); DependencyObjectCollection sumColl = _qurService.ExecuteDependencyObject(querySumNode); List <DependencyObject> newList = new List <DependencyObject>(); ISaveService saveService = this.GetService <ISaveService>("COUNTING"); if (sumColl.Count > 0) //查询存在记录新增实体COUNTING { ICreateService createSrv = GetService <ICreateService>("COUNTING"); DependencyObject entity = createSrv.Create() as DependencyObject; newList = InsertCOUNTING(counting_type, counting_no, sumColl, entity.DependencyObjectType); } ICreateService createSrvParaFil = this.GetService <ICreateService>("PARA_FIL"); QueryNode updateNode = null; QueryNode insertNode = null; if (createSrvParaFil != null) //表示该typekey存在 { bool bcManagement = GetBcInventoryManagement(); if (bcManagement) { QueryNode querySumBarcodeNode = QuerySumBarcode(counting_no, queryScan); updateNode = GetUpdateNode(counting_type, counting_no, querySumBarcodeNode); insertNode = QueryNodeForInsert(counting_no, counting_type, querySumBarcodeNode); } } using (ITransactionService transActionService = this.GetService <ITransactionService>()) { if (newList.Count > 0) { SetIgnoreWarningTag(true); saveService.Save(newList.ToArray()); SetIgnoreWarningTag(false); } //更新条码盘点计划 if (updateNode != null) //启用条码库存管理更新 { _qurService.ExecuteNoQueryWithManageProperties(updateNode); } //新增条码盘点计划 if (insertNode != null) //启用条码库存管理更新 { _qurService.ExecuteNoQueryWithManageProperties(insertNode); } transActionService.Complete(); } } }
/// <summary> /// 根据传入的供应商查询出所有的销货清单 /// </summary> /// <param name="supplier_no">供应商编号(必填)</param> /// <param name="date_s">对账开始日期</param> /// <param name="date_e">对账截止日期</param> /// <param name="enterprise_no">企业别</param> /// <param name="site_no">营运中心</param> /// <returns></returns> public Hashtable SalesList(string supplier_no, string date_s, string date_e, string enterprise_no, string site_no) { try { if (Maths.IsEmpty(supplier_no)) { IInfoEncodeContainer infoEnCode = GetService <IInfoEncodeContainer>(); throw new BusinessRuleException(infoEnCode.GetMessage("A111201", "supplier_no"));//‘入参【supplier_no】未传值’( A111201) } //获取销货清单 QueryNode queryNode = GetSalesListDetail(supplier_no, date_s, date_e, site_no); DependencyObjectCollection entity = GetService <IQueryService>().ExecuteDependencyObject(queryNode); //返回结果 Hashtable result = new Hashtable(); if (entity.Count > 0) { result.Add("supplier_no", entity[0]["supplier_no"]); //销货方 result.Add("supplier_name", entity[0]["supplier_name"]); //销货方名称 result.Add("employee_no", entity[0]["employee_no"]); //联系人 result.Add("supplier_telephone_number", entity[0]["supplier_telephone_number"]); //联系电话 result.Add("site_no", entity[0]["site_no"]); //进货方 result.Add("site_name", entity[0]["site_name"]); //进货名称 result.Add("telephone_number", entity[0]["telephone_number"]); //联系电话 } else { result.Add("supplier_no", string.Empty); //销货方 result.Add("supplier_name", string.Empty); //销货方名称 result.Add("employee_no", string.Empty); //联系人 result.Add("supplier_telephone_number", string.Empty); //联系电话 result.Add("site_no", string.Empty); //进货方 result.Add("site_name", string.Empty); //进货名称 result.Add("telephone_number", string.Empty); //联系电话 } //需要移除的列 string[] excludeColumns = { "supplier_no", "supplier_name", "employee_no", "supplier_telephone_number", "site_no", "site_name", "telephone_number" }; //重新组合返回结果 DependencyObjectCollection newEntity = RemoveObjectType(entity, excludeColumns); result.Add("sales_list_detail", newEntity);//销货清单 return(result); } catch (Exception) { throw; } }
/// <summary> /// 根据传入的供应商查询出退换货清单 /// </summary> /// <param name="supplier_no">供应商编号(必填)</param> /// <param name="item_no">料件编号</param> /// <param name="item_name">品名</param> /// <param name="item_spec">规格</param> /// <param name="enterprise_no">企业别</param> /// <param name="site_no">营运中心</param> /// <returns></returns> public Hashtable ReturnQty(string supplier_no, string item_no, string item_name, string item_spec, string enterprise_no, string site_no) { try { if (Maths.IsEmpty(supplier_no)) { IInfoEncodeContainer infoEnCode = GetService <IInfoEncodeContainer>(); throw new BusinessRuleException(infoEnCode.GetMessage("A111201", "supplier_no"));//‘入参【supplier_no】未传值’( A111201) } //查询出退换货清单 QueryNode queryNode = GetReturnChangeDetail(supplier_no, item_no, item_name, item_spec, site_no); DependencyObjectCollection returnChangeDetail = GetService <IQueryService>().ExecuteDependencyObject(queryNode); //组合返回值 Hashtable result = new Hashtable(); result.Add("return_change_detail", returnChangeDetail); return(result); } catch (Exception) { throw; } }
/// <summary> /// 根据传入的供应商查询出所有的对账清单 /// </summary> /// <param name="supplier_no">供应商编号(必填)</param> /// <param name="date_s">对账开始日期</param> /// <param name="date_e">对账截止日期</param> /// <param name="enterprise_no">企业别</param> /// <param name="site_no">营运中心</param> /// <returns></returns> public Hashtable CheckList(string supplier_no, string date_s, string date_e, string enterprise_no, string site_no) { try { if (Maths.IsEmpty(supplier_no)) { IInfoEncodeContainer infoEnCode = GetService <IInfoEncodeContainer>(); throw new BusinessRuleException(infoEnCode.GetMessage("A111201", "supplier_no"));//‘入参【supplier_no】未传值’( A111201) } //获取对账清单 QueryNode queryNode = GetCheckListDetail(supplier_no, date_s, date_e, site_no); DependencyObjectCollection checkListDetail = GetService <IQueryService>().ExecuteDependencyObject(queryNode); //返回结果 Hashtable result = new Hashtable { { "check_list_detail", checkListDetail } }; return(result); } catch (Exception) { throw; } }
/// <summary> /// /// </summary> /// <param name="employee_no">扫描人员</param> /// <param name="scan_type">扫描类型1.有箱条码 2.无箱条码</param> /// <param name="report_datetime">上传时间</param> /// <param name="picking_department_no">部门</param> /// <param name="recommended_operations">建议执行作业</param> /// <param name="recommended_function">A.新增 S.过帐</param> /// <param name="scan_doc_no">扫描单号</param> /// <param name="collScan"></param> public DependencyObjectCollection InertTransactionDoc(string employee_no, string scan_type, DateTime report_datetime, string picking_department_no, string recommended_operations, string recommended_function, string scan_doc_no, DependencyObjectCollection scanColl) { IInfoEncodeContainer InfoEncodeSrv = this.GetService <IInfoEncodeContainer>(); if (Maths.IsEmpty(recommended_operations)) { throw new BusinessRuleException(InfoEncodeSrv.GetMessage("A111201", "recommended_operations"));//‘入参【recommended_operations】未传值’ } if (Maths.IsEmpty(recommended_function)) { throw new BusinessRuleException(InfoEncodeSrv.GetMessage("A111201", "recommended_function"));//‘入参【recommended_function】未传值’ } DependencyObjectType type = new DependencyObjectType("ReturnCollection"); type.RegisterSimpleProperty("doc_no", typeof(string)); DependencyObjectCollection Rtn = new DependencyObjectCollection(type); if (scanColl.Count > 0) { string stockAction = string.Empty; string view = string.Empty; if (recommended_operations.StartsWith("11")) { stockAction = "-1"; view = "TRANSACTION_DOC.I02"; } else if (recommended_operations.StartsWith("12")) { stockAction = "1"; view = "TRANSACTION_DOC.I01"; } DependencyObjectCollection docColl = ValidateDocSet(stockAction, scanColl[0]["site_no"].ToStringExtension()); if (docColl.Count <= 0) { throw new BusinessRuleException(InfoEncodeSrv.GetMessage("A111275")); } DataTable dtScan = CreateDtScan(); DataTable dtScanDetail = CreateDtScanDetail(); PrepareDtForInsertScan(employee_no, picking_department_no, scanColl, dtScan, dtScanDetail); using (IConnectionService connService = this.GetService <IConnectionService>()) { _qurService = this.GetService <IQueryService>(); CreateTemp(); InsertTemp(dtScan, dtScanDetail); List <DependencyObject> saveEntities = AddEntity(docColl[0]["DOC_ID"], docColl[0]["SEQUENCE_DIGIT"].ToInt32(), report_datetime, stockAction); if (saveEntities.Count > 0) { using (ITransactionService transService = this.GetService <ITransactionService>()) { InsertBCLine(report_datetime);//20170413 add by wangyq for P001-170412001 需要在保存服务之前,保存自动审核会需要回写 //保存单据 ISaveService saveSrv = this.GetService <ISaveService>("TRANSACTION_DOC"); saveSrv.Save(saveEntities.ToArray()); UpdateTD();//更新 //InsertBCLine(report_datetime);//20170413 mark by wangyq for P001-170412001 //EFNET签核 foreach (DependencyObject item in saveEntities) { IEFNETStatusStatusService efnetSrv = this.GetService <IEFNETStatusStatusService>(); efnetSrv.GetFormFlow(view, item["DOC_ID"], ((DependencyObject)item["Owner_Org"])["ROid"], new object[] { item["TRANSACTION_DOC_ID"] }); } transService.Complete(); } foreach (DependencyObject item in saveEntities) { DependencyObject obj = Rtn.AddNew(); obj["doc_no"] = item["DOC_NO"]; } } } } return(Rtn); }
public DependencyObjectCollection UpdateSalesIssue(string employeeNo, string scanType, DateTime reportDatetime, string pickingDepartmentNo , string recommendedOperations, string recommendedFunction, string scanDocNo, DependencyObjectCollection collection) { DependencyObjectCollection rtnColl = CreateReturnCollection(); #region 参数检查 IInfoEncodeContainer encodeSrv = this.GetService <IInfoEncodeContainer>(); if (Maths.IsEmpty(recommendedOperations)) { throw new BusinessRuleException(encodeSrv.GetMessage("A111201", new object[] { "recommended_operations" })); } if (Maths.IsEmpty(recommendedFunction)) { throw new BusinessRuleException(encodeSrv.GetMessage("A111201", new object[] { "recommended_function" })); } #endregion //创建临时表需要的DataTable和Mapping信息 DataTable dtEntityD = new DataTable(); List <BulkCopyColumnMapping> entityDMap = new List <BulkCopyColumnMapping>(); CreateRelateTable(dtEntityD, entityDMap); List <string> docNos = new List <string>(); //记录单身的单号,保存时需要,可以避免后续再查 //组织数据BulkCopy需要的DataTable数据 InsertDataTable(dtEntityD, collection, docNos); if (dtEntityD.Rows.Count <= 0) { return(rtnColl); } #region 更新逻辑 using (ITransactionService trans = this.GetService <ITransactionService>()) { using (IConnectionService connService = this.GetService <IConnectionService>()) { IQueryService querySrv = this.GetService <IQueryService>(); //新增临时表 IDataEntityType dtTemp = CreateDTmpTable(querySrv); //批量新增到临时表 querySrv.BulkCopy(dtEntityD, dtTemp.Name, entityDMap.ToArray()); //利用临时表批量更新相关数据 UpdateSalesIssueD(querySrv, dtTemp); DataRow[] drs = dtEntityD.Select("BARCODE_NO<>\'\'"); if (drs.Length > 0) //条码不为""的记录大于0时,才执行如下更新,避免多余的性能损失 { ICreateService createService = this.GetService <ICreateService>("PARA_FIL"); if (createService != null) //PARA_FIL实体存在,服务端可以这么判断 { bool bcLintFlag = UtilsClass.IsBCLineManagement(querySrv); if (bcLintFlag) { DeleteBCLine(querySrv, dtTemp); //先删除 InsertBCLine(querySrv, dtTemp); //再重新生成 } } } } //保存 DependencyObjectCollection ids = GetSalesIssue(docNos); IReadService readSrv = this.GetService <IReadService>("SALES_ISSUE"); object[] entities = readSrv.Read(ids.Select(c => c["SALES_ISSUE_ID"]).ToArray()); if (entities != null && entities.Length > 0) { ISaveService saveSrv = this.GetService <ISaveService>("SALES_ISSUE"); saveSrv.Save(entities); } //保存时没有自动审核的,需要重新审核 entities = readSrv.Read(ids.Where(c => !c["AUTO_APPROVE"].ToBoolean()).Select(c => c["SALES_ISSUE_ID"]).ToArray()); IConfirmService confirmService = this.GetService <IConfirmService>("SALES_ISSUE"); ILogOnService logOnSrv = this.GetService <ILogOnService>(); foreach (DependencyObject obj in entities) { ConfirmContext context = new ConfirmContext(obj.Oid, logOnSrv.CurrentUserId, reportDatetime.ToDate()); confirmService.Execute(context); } trans.Complete(); } #endregion #region 组织返回结果 foreach (string item in docNos) { DependencyObject obj = rtnColl.AddNew(); obj["doc_no"] = item; } #endregion return(rtnColl); }