1
This commit is contained in:
@@ -90,19 +90,31 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SaleOutStockDetailRptPlugInEx\SaleOutStockDetailRptEx.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="PRD_MO\sql\更新对应表中产品对照倒置id.sql" />
|
||||
<Content Include="PRD_MO\sql\模具-产品对照倒置表.sql" />
|
||||
<Content Include="PRD_MO\sql\模具产品对照-同一个模具下多个相同产品查询.sql" />
|
||||
<Content Include="SqlServer\SQLQuery4.sql" />
|
||||
<Content Include="SqlServer\SQLQuery5.sql" />
|
||||
<Content Include="SqlServer\仓位值1.sql" />
|
||||
<Content Include="SqlServer\仓位值2.sql" />
|
||||
<Content Include="SqlServer\仓库值.sql" />
|
||||
<Content Include="SqlServer\存储过程-生产用料清单.sql" />
|
||||
<Content Include="SqlServer\生产用料清单.sql" />
|
||||
<Content Include="SqlServer\生产用料清单查询.sql" />
|
||||
<Content Include="SqlServer\生产订单.sql" />
|
||||
<Content Include="SqlServer\获取产品类型.sql" />
|
||||
<Content Include="SqlServer\获取单据状态.sql" />
|
||||
<Content Include="SAL_SaleOrder\xml\ASN.xml" />
|
||||
<Content Include="SAL_SaleOrder\xml\INVOIC.xml" />
|
||||
<Content Include="SAL_SaleOrder\xml\ORDCHG.xml" />
|
||||
<Content Include="SAL_SaleOrder\xml\ORDERS.xml" />
|
||||
<Content Include="SAL_SaleOrder\xml\POACK.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Sal_OutStockDetailRpt\SaleOutStockDetailRptEx.cs" />
|
||||
<Compile Include="SAL_SaleOrder\AdvanceShipmentNotification.cs" />
|
||||
<Compile Include="STK_InvAgeAnalyzeRpt\InvAgeAnalyzeOverrideEx.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
44
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/sql/更新对应表中产品对照倒置id.sql
Normal file
44
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/sql/更新对应表中产品对照倒置id.sql
Normal file
@@ -0,0 +1,44 @@
|
||||
SELECT
|
||||
t0.FID
|
||||
,t0e.FCPID
|
||||
into #tmp
|
||||
FROM hw_mjcpdzb t0
|
||||
INNER JOIN hw_mjcpdzbs t0e on t0.FID = t0e.FID
|
||||
GROUP BY
|
||||
t0.FID,t0e.FCPID
|
||||
having
|
||||
count(1) =1
|
||||
--SELECT * FROM #tmp
|
||||
SELECT t0.FID
|
||||
,t0.FMJID
|
||||
,t0e.FEntryID
|
||||
,t0e.FCPID
|
||||
into #tmp1
|
||||
FROM hw_mjcpdzb t0
|
||||
inner join hw_mjcpdzbs t0e on t0.FID = t0e.FID
|
||||
WHERE exists (SELECT 1 from #tmp t WHERE t.fid = t0.fid AND t0e.FCPID = t0.FCPID)
|
||||
|
||||
/***********更新bom中的模具编码start***********/
|
||||
--UPDATE t0 SET t0.FMJDZDZID = tt.FEntryID
|
||||
SELECT
|
||||
tt.FEntryID,t0.*
|
||||
FROM
|
||||
#tmp1 tt
|
||||
inner join T_ENG_BOM t0 on t0.FMATERIALID = tt.FCPID AND t0.F_PAEZ_BASE = tt.FMJID
|
||||
|
||||
drop table #tmp
|
||||
drop table #tmp1
|
||||
/***********更新bom中的模具编码end***********/
|
||||
|
||||
--UPDATE t1e SET t1e.FMJDZDZID = t0.FMJDZDZID
|
||||
SELECT
|
||||
t0.FMJDZDZID,t1e.FMJDZDZID
|
||||
FROM T_ENG_BOM t0
|
||||
INNER JOIN T_PRD_MOENTRY t1e on t0.FID = t1e.FBOMID
|
||||
WHERE t0.FMJDZDZID != 0 AND t1e.FMJDZDZID != t0.FMJDZDZID
|
||||
|
||||
--UPDATE t0 SET t0.FMJDZDZID = t1.FMJDZDZID
|
||||
SELECT t0.*
|
||||
FROM T_PRD_PPBOM t0
|
||||
INNER JOIN T_ENG_BOM t1 on t0.FBOMID = t1.FID
|
||||
WHERE t1.FMJDZDZID != 0 AND t1.FMJDZDZID != t0.FMJDZDZID
|
||||
32
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/sql/模具-产品对照倒置表.sql
Normal file
32
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/sql/模具-产品对照倒置表.sql
Normal file
@@ -0,0 +1,32 @@
|
||||
IF EXISTS(SELECT * FROM sysobjects WHERE name = 'V_HWMJCPDZDZB')--单引号里面为视图名称
|
||||
DROP VIEW V_HWMJCPDZDZB--视图名称
|
||||
GO
|
||||
CREATE VIEW V_HWMJCPDZDZB AS
|
||||
SELECT
|
||||
t0e.FEntryID 'FID'
|
||||
,t0e.FID AS 'FPID'
|
||||
,t0e.FCPID
|
||||
,t0e.FMJSMZQ AS 'FMJSCZQ'--'模具生产周期'
|
||||
,CAST(t0e.FMJQS AS decimal(23,6)) AS 'FMJQS'--'模具腔数'
|
||||
,t0e.FBZCL AS 'FBZCN'--'标准产能'
|
||||
,t0e.FJTBZ --AS '机台备注'
|
||||
,t0e.FMJHH --AS '共模/互换明细'
|
||||
,t0e.F_PAEZ_DECIMAL AS 'FCPDZ'--'产品单重'
|
||||
,t0e.F_PAEZ_DECIMAL1 AS 'FCCSKZL'--'产出水口重量'
|
||||
,t0.FNUMBER
|
||||
,t0.FMJID
|
||||
,t0.F_PAEZ_TEXT AS 'FMJGGXH'--'模具规格(宽*高*厚 mm)'
|
||||
,t0.F_PAEZ_TEXT1 AS 'FMJXS'--'模具穴数'
|
||||
,t0.F_PAEZ_COMBO AS 'FMJLX'--'模具类型'
|
||||
,t0.FDOCUMENTSTATUS
|
||||
,t0.FFORBIDSTATUS
|
||||
,t1_l.FNAME AS 'FName'
|
||||
,t2_l.FNAME AS 'FProName'
|
||||
,t0.FMJID AS FMJMATERIALID
|
||||
,t0e.FCPID AS FCPMATERIALID
|
||||
FROM hw_mjcpdzb t0
|
||||
INNER JOIN hw_mjcpdzbs t0e on t0.FID = t0e.FID
|
||||
LEFT JOIN T_BD_MATERIAL_L t1_l on t1_l.FMATERIALID = t0.FMJID AND t1_l.FLOCALEID = 2052
|
||||
LEFT JOIN T_BD_MATERIAL_L t2_l on t2_l.FMATERIALID = t0e.FCPID AND t2_l.FLOCALEID = 2052
|
||||
WHERE
|
||||
t0.FDOCUMENTSTATUS ='C'
|
||||
13
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/sql/模具产品对照-同一个模具下多个相同产品查询.sql
Normal file
13
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/sql/模具产品对照-同一个模具下多个相同产品查询.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
SELECT t.*,t1_l.*
|
||||
FROM (SELECT
|
||||
t0.FID
|
||||
,count(1) co
|
||||
,t0e.FCPID
|
||||
FROM hw_mjcpdzb t0
|
||||
INNER JOIN hw_mjcpdzbs t0e on t0.FID = t0e.FID
|
||||
GROUP BY
|
||||
t0.FID,t0e.FCPID
|
||||
having
|
||||
count(1) >1) t
|
||||
inner join hw_mjcpdzb t0 on t.FID = t0.FID
|
||||
inner join T_BD_MATERIAL_L t1_l on t1_l.FMATERIALID = t0.FMJID
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace HUIWEI.SAL_SaleOrder
|
||||
{
|
||||
|
||||
// 注意: 生成的代码可能至少需要 .NET Framework 4.5 或 .NET Core/Standard 2.0。
|
||||
/// <remarks/>
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
[XmlRoot(Namespace = "", IsNullable = false)]
|
||||
public partial class AdvanceShipmentNotification
|
||||
{
|
||||
/// <remarks/>
|
||||
public AdvanceShipmentNotificationHeader Header { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement("LineItem")]
|
||||
public AdvanceShipmentNotificationLineItem[] LineItem { get; set; }
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class AdvanceShipmentNotificationHeader
|
||||
{
|
||||
|
||||
/// <remarks/>
|
||||
public string Supplier { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Buyer { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement(DataType = "date")]
|
||||
public DateTime PO_Date { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public ulong LEX_PO { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Internal_PO { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement(DataType = "date")]
|
||||
public DateTime Delivery_Date { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Ship_Address { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public ulong Lot_Number { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement("Actual_Ex-factory_Date", DataType = "date")]
|
||||
public DateTime Actual_Exfactory_Date { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
[XmlElement(DataType = "date")]
|
||||
public DateTime ETD_HK { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Container_Number { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Container_Type { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Carrier { get; set; }
|
||||
/// <remarks/>
|
||||
public string Vessel_Name_Or_Flight { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Bill_Of_Lading { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Shipping_Condition { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public object Shipping_Month { get; set; }
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[Serializable()]
|
||||
[DesignerCategory("code")]
|
||||
[XmlType(AnonymousType = true)]
|
||||
public partial class AdvanceShipmentNotificationLineItem
|
||||
{
|
||||
|
||||
/// <remarks/>
|
||||
public byte Item_Line_Number { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string LEX_PN { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public ushort Container_Qty { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public byte Pallet_Qty { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public byte Pallets { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Unit_Of_Measure { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string LXK_Description { get; set; }
|
||||
|
||||
/// <remarks/>
|
||||
public string Serial_No { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,14 +1,17 @@
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core.Report;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.K3.SCM.App.Sal.Report;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace HUIWEI.SaleOutStockDetailRptPlugInEx
|
||||
namespace HUIWEI.Sal_OutStockDetailRpt
|
||||
{
|
||||
[Description("销售出库明细报表数据源插件-扩展"), HotUpdate]
|
||||
internal class SaleOutStockDetailRptEx: SaleOutStockDetailRpt
|
||||
{
|
||||
private string[] TempTableName;
|
||||
@@ -1,340 +0,0 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core.List;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.List.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Metadata;
|
||||
using Kingdee.BOS.Core.Metadata.ConvertElement;
|
||||
using Kingdee.BOS.Core.Metadata.EntityElement;
|
||||
//using Kingdee.BOS.Core.Report.PlugIn;
|
||||
//using Kingdee.BOS.Core.Report.PlugIn.Args;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.K3.Core.MFG.EntityHelper;
|
||||
using Kingdee.BOS.Resource;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kingdee.BOS.Core.BusinessFlow.ServiceArgs;
|
||||
|
||||
namespace HW.ProductionMaterialsReport
|
||||
{
|
||||
public class TablePlugIn : AbstractDynamicFormPlugIn
|
||||
{
|
||||
private readonly string _fromId;
|
||||
|
||||
//public override void FormatCellValue(FormatCellValueArgs args)
|
||||
//{
|
||||
// var billParam = new BillShowParameter();
|
||||
|
||||
//}
|
||||
|
||||
//public override void CellDbClick(CellEventArgs args)
|
||||
//{
|
||||
// base.CellDbClick(args);
|
||||
|
||||
//}
|
||||
private void ListShowFrom()
|
||||
{
|
||||
//ListShowParameter showParam = new ListShowParameter();
|
||||
//showParam.IsLookUp = false;
|
||||
//showParam.OpenStyle.ShowType = ShowType.Modal;
|
||||
//showParam.FormId = "YourFormId";
|
||||
//showParam.Width = 1000;
|
||||
//showParam.Height = 600;
|
||||
//showParam.IsShowQuickFilter = false;
|
||||
|
||||
//ListRegularFilterParameter regularFilterPara = new ListRegularFilterParameter();
|
||||
//string filter = "YourFilterCondition";
|
||||
//regularFilterPara.Filter = filter;
|
||||
//showParam.ListFilterParameter = regularFilterPara;
|
||||
|
||||
//this.View.ShowForm(showParam);
|
||||
}
|
||||
|
||||
protected void TrckDown()
|
||||
{
|
||||
List<DynamicObject> selectedRows = this.GetSelectedRows();
|
||||
if (selectedRows.Count == 0)
|
||||
{
|
||||
this.View.ShowMessage(ResManager.LoadKDString("请选择需要下查的的分录!", "015649000004851", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
return;
|
||||
}
|
||||
ViewLinkDataParameter viewLinkDataParameter = this.BuildViewLinkDataParameter();
|
||||
ShowConvertOpFormEventArgs thirdConvertEventArgs = null;
|
||||
List<ConvertBillElement> list = this.LoadConvertBills(viewLinkDataParameter, out thirdConvertEventArgs);
|
||||
if (list == null || list.Count == 0)
|
||||
{
|
||||
this.View.ShowMessage(ResManager.LoadKDString("没有关联业务数据!", "015649000004852", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
return;
|
||||
}
|
||||
if (!this.ExistsTrackerData(viewLinkDataParameter, thirdConvertEventArgs))
|
||||
{
|
||||
this.View.ShowMessage(ResManager.LoadKDString("没有关联业务数据!", "015649000004852", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
return;
|
||||
}
|
||||
this.ShowLookUpTrackerForm(viewLinkDataParameter, list, thirdConvertEventArgs);
|
||||
}
|
||||
|
||||
private bool ExistsTrackerData(ViewLinkDataParameter viewParameter, ShowConvertOpFormEventArgs thirdConvertEventArgs)
|
||||
{
|
||||
if (thirdConvertEventArgs.ReplaceRelations != null && thirdConvertEventArgs.ReplaceRelations.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (viewParameter.Instances.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
string formId = viewParameter.BillInfo.FormId;
|
||||
foreach (KeyValuePair<string, List<BusinessFlowInstance>> keyValuePair in viewParameter.Instances)
|
||||
{
|
||||
string key = keyValuePair.Key;
|
||||
List<BusinessFlowInstance> value = keyValuePair.Value;
|
||||
TableDefine tableDefine = BusinessFlowServiceHelper.LoadTableDefine(this.View.Context, formId, key);
|
||||
List<BusinessFlowInstance> list = new List<BusinessFlowInstance>();
|
||||
foreach (BusinessFlowInstance businessFlowInstance in value)
|
||||
{
|
||||
if (!this.ValidateInstance(businessFlowInstance, viewParameter.LookUpType, tableDefine.TableNumber))
|
||||
{
|
||||
list.Add(businessFlowInstance);
|
||||
}
|
||||
}
|
||||
foreach (BusinessFlowInstance item in list)
|
||||
{
|
||||
value.Remove(item);
|
||||
}
|
||||
}
|
||||
foreach (KeyValuePair<string, List<BusinessFlowInstance>> keyValuePair2 in viewParameter.Instances)
|
||||
{
|
||||
List<BusinessFlowInstance> value2 = keyValuePair2.Value;
|
||||
if (value2.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ValidateInstance(BusinessFlowInstance instance, ViewLinkDataParameter.Enum_LookUpType lookUpType, string tableNumber)
|
||||
{
|
||||
if (instance.FirstNode == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
List<RouteTreeNode> list = instance.SerarchTargetFormNodes(tableNumber);
|
||||
if (lookUpType == ViewLinkDataParameter.Enum_LookUpType.Down)
|
||||
{
|
||||
using (List<RouteTreeNode>.Enumerator enumerator = list.GetEnumerator())
|
||||
{
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
RouteTreeNode routeTreeNode = enumerator.Current;
|
||||
if (routeTreeNode.ChildNodes.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
foreach (RouteTreeNode routeTreeNode2 in list)
|
||||
{
|
||||
if (routeTreeNode2.ParentNode != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private FormMetadata _oplanMeta;
|
||||
|
||||
protected FormMetadata OPlanMetaData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._oplanMeta == null)
|
||||
{
|
||||
this._oplanMeta = (MetaDataServiceHelper.Load(this.View.Context, "SFC_OperationPlanning", true) as FormMetadata);
|
||||
}
|
||||
return this._oplanMeta;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<ConvertBillElement> LoadConvertBills(ViewLinkDataParameter viewParameter, out ShowConvertOpFormEventArgs thirdConvertEventArgs)
|
||||
{
|
||||
List<ConvertBillElement> list = ConvertServiceHelper.GetConvertBills(this.View.Context, FormOperationEnum.Push, viewParameter.BillInfo.FormId, false);
|
||||
DynamicFormViewPlugInProxy service = this.View.GetService<DynamicFormViewPlugInProxy>();
|
||||
thirdConvertEventArgs = new ShowConvertOpFormEventArgs(FormOperationEnum.TrackDown, list);
|
||||
if (service != null)
|
||||
{
|
||||
new List<ListSelectedRow>();
|
||||
thirdConvertEventArgs.SelectedRows = this.GetSelectedEntityRows();
|
||||
list = (thirdConvertEventArgs.Bills as List<ConvertBillElement>);
|
||||
}
|
||||
if (list == null || list.Count == 0)
|
||||
{
|
||||
this.View.ShowMessage(ResManager.LoadKDString("从启用的单据转换流程中找不到可下查的单据", "015649000004854", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
return new List<ConvertBillElement>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public ListSelectedRow[] GetSelectedEntityRows()
|
||||
{
|
||||
List<ListSelectedRow> list = new List<ListSelectedRow>();
|
||||
List<DynamicObject> selectedRows = this.GetSelectedRows();
|
||||
foreach (DynamicObject dynamicObject in selectedRows)
|
||||
{
|
||||
long dynamicObjectItemValue = dynamicObject.GetDynamicObjectItemValue("OperId", 0L);
|
||||
list.Add(new ListSelectedRow(this.currNodeID, dynamicObjectItemValue.ToString(), 0, this._oplanMeta.Id)
|
||||
{
|
||||
EntryEntityKey = "FENTITY"
|
||||
});
|
||||
}
|
||||
if (list.Count == 0)
|
||||
{
|
||||
ListSelectedRow item = new ListSelectedRow(this.currNodeID, "0", 0, this._oplanMeta.Id);
|
||||
list.Add(item);
|
||||
}
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
private ViewLinkDataParameter BuildViewLinkDataParameter()
|
||||
{
|
||||
if (!this.CheckSelectDataId() && this.GetSelectedRows().Count == 0)
|
||||
{
|
||||
this.View.ShowMessage(ResManager.LoadKDString("没有选择要下查的数据!", "015649000004853", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
return null;
|
||||
}
|
||||
Dictionary<string, List<Tuple<long, long>>> linkIds = this.GetLinkIds();
|
||||
ViewLinkDataParameter viewLinkDataParameter = new ViewLinkDataParameter(this.OPlanMetaData.Id, ViewLinkDataParameter.Enum_LookUpType.Down);
|
||||
foreach (KeyValuePair<string, List<Tuple<long, long>>> keyValuePair in linkIds)
|
||||
{
|
||||
string key = keyValuePair.Key;
|
||||
List<Tuple<long, long>> value = keyValuePair.Value;
|
||||
foreach (Tuple<long, long> tuple in value)
|
||||
{
|
||||
ViewLinkDataRowInfo item = new ViewLinkDataRowInfo(key, tuple.Item1, tuple.Item2);
|
||||
viewLinkDataParameter.BillInfo.Rows.Add(item);
|
||||
}
|
||||
}
|
||||
this.BuildInstanceParameter(viewLinkDataParameter, linkIds);
|
||||
return viewLinkDataParameter;
|
||||
}
|
||||
|
||||
private string currNodeID = string.Empty;
|
||||
|
||||
protected Dictionary<string, List<Tuple<long, long>>> GetLinkIds()
|
||||
{
|
||||
Dictionary<string, List<Tuple<long, long>>> dictionary = new Dictionary<string, List<Tuple<long, long>>>();
|
||||
List<long> list = new List<long>();
|
||||
List<Tuple<long, long>> list2 = new List<Tuple<long, long>>();
|
||||
long num = Convert.ToInt64(this.currNodeID);
|
||||
list.Add(num);
|
||||
list2.Add(new Tuple<long, long>(num, num));
|
||||
dictionary.Add("FBILLHEAD", list2);
|
||||
List<long> list3 = new List<long>();
|
||||
List<Tuple<long, long>> list4 = new List<Tuple<long, long>>();
|
||||
List<DynamicObject> selectedRows = this.GetSelectedRows();
|
||||
foreach (DynamicObject dynamicObject in selectedRows)
|
||||
{
|
||||
long dynamicObjectItemValue = dynamicObject.GetDynamicObjectItemValue("SeqId", 0L);
|
||||
if (!list3.Contains(dynamicObjectItemValue))
|
||||
{
|
||||
list3.Add(dynamicObjectItemValue);
|
||||
list4.Add(new Tuple<long, long>(num, dynamicObjectItemValue));
|
||||
}
|
||||
}
|
||||
if (list3.Count > 0)
|
||||
{
|
||||
dictionary.Add("FENTITY", list4);
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
|
||||
private bool CheckSelectDataId()
|
||||
{
|
||||
bool result = true;
|
||||
object value = this.Model.GetValue("FOPlanID");
|
||||
if (value == null)
|
||||
{
|
||||
result = false;
|
||||
this.View.ShowMessage(ResManager.LoadKDString("没有选择工序计划!", "015376000004785", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
}
|
||||
long num = Convert.ToInt64(value);
|
||||
if (num == 0L)
|
||||
{
|
||||
result = false;
|
||||
this.View.ShowMessage(ResManager.LoadKDString("没有选择工序计划!", "015376000004785", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
}
|
||||
if (!ShopWorkBenchServiceHelper.IsExistOPlan(base.Context, num))
|
||||
{
|
||||
result = false;
|
||||
this.View.ShowMessage(ResManager.LoadKDString("工序计划已经删除,请刷新界面或重新选择其他工序计划!", "015376000004804", SubSystemType.MFG, new object[0]), MessageBoxType.Notice);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void BuildInstanceParameter(ViewLinkDataParameter viewParameter, Dictionary<string, List<Tuple<long, long>>> allEntityIds)
|
||||
{
|
||||
string formId = viewParameter.BillInfo.FormId;
|
||||
foreach (KeyValuePair<string, List<Tuple<long, long>>> keyValuePair in allEntityIds)
|
||||
{
|
||||
string key = keyValuePair.Key;
|
||||
List<Tuple<long, long>> value = keyValuePair.Value;
|
||||
List<long> list = (from p in value
|
||||
select p.Item2).ToList<long>();
|
||||
BusinessFlowInstanceCollection businessFlowInstanceCollection = this.LoadInstances(this.View.Context, formId, key, list.ToArray());
|
||||
List<BusinessFlowInstance> list2 = new List<BusinessFlowInstance>();
|
||||
foreach (BusinessFlowInstance businessFlowInstance in businessFlowInstanceCollection)
|
||||
{
|
||||
if (businessFlowInstance.FirstNode != null)
|
||||
{
|
||||
list2.Add(businessFlowInstance);
|
||||
}
|
||||
}
|
||||
if (list2.Count > 0)
|
||||
{
|
||||
viewParameter.Instances[key] = list2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BusinessFlowInstanceCollection LoadInstances(Context ctx, string formId, string entityKey, long[] entityIds)
|
||||
{
|
||||
LoadInstancesByEntityIdArgs args = new LoadInstancesByEntityIdArgs(formId, entityKey, entityIds);
|
||||
return BusinessFlowDataServiceHelper.LoadInstancesByEntityId(ctx, args);
|
||||
}
|
||||
|
||||
private bool ShowLookUpTrackerForm(ViewLinkDataParameter viewParamter, List<ConvertBillElement> convertBills, ShowConvertOpFormEventArgs thirdConvertEventArgs)
|
||||
{
|
||||
if (convertBills != null && convertBills.Count > 0)
|
||||
{
|
||||
string key = "LookUpTrackerParam";
|
||||
Dictionary<string, object> dictionary = new Dictionary<string, object>();
|
||||
dictionary["ViewParameter"] = viewParamter;
|
||||
dictionary["ConvertBills"] = convertBills;
|
||||
dictionary["PlugParam"] = thirdConvertEventArgs;
|
||||
this.View.Session[key] = dictionary;
|
||||
DynamicFormShowParameter dynamicFormShowParameter = new DynamicFormShowParameter();
|
||||
dynamicFormShowParameter.FormId = "BF_LookUpTracker";
|
||||
dynamicFormShowParameter.ParentPageId = this.View.PageId;
|
||||
dynamicFormShowParameter.OpenStyle.ShowType = ShowType.Default;
|
||||
this.View.ShowForm(dynamicFormShowParameter);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<DynamicObject> GetSelectedRows()
|
||||
{
|
||||
EntryEntity entryEntity = this.View.BusinessInfo.GetEntryEntity("FDetailEntity");
|
||||
List<DynamicObject> list = new List<DynamicObject>();
|
||||
return (from w in this.Model.GetEntityDataObject(entryEntity)
|
||||
where w.GetDynamicObjectItemValue("IsSelect", false)
|
||||
select w).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user