a
This commit is contained in:
@@ -21,13 +21,20 @@ using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||
|
||||
namespace GZ.LJY000.Biori.PRD_MO
|
||||
{
|
||||
[Description("生产汇报单下推生产入库单#"), HotUpdate]
|
||||
[Description("生产订单装换插件#"), HotUpdate]
|
||||
public class BillConvertEventPlugInEx : AbstractConvertPlugIn
|
||||
{
|
||||
#region 因使用优联系统,暂时停用
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 转换后事件
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void AfterConvert(AfterConvertEventArgs e)
|
||||
{
|
||||
base.AfterConvert(e);
|
||||
|
||||
return;
|
||||
var paraDIC = this.Option.GetVariables();
|
||||
if (!paraDIC.ContainsKey("ScanEntry"))
|
||||
return;
|
||||
@@ -79,7 +86,7 @@ namespace GZ.LJY000.Biori.PRD_MO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 创建单据视图
|
||||
/// </summary>
|
||||
@@ -141,6 +148,10 @@ namespace GZ.LJY000.Biori.PRD_MO
|
||||
base.OnQueryBuilderParemeter(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据源
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void OnBeforeGetSourceData(BeforeGetSourceDataEventArgs e)
|
||||
{
|
||||
base.OnBeforeGetSourceData(e);
|
||||
@@ -211,9 +222,23 @@ namespace GZ.LJY000.Biori.PRD_MO
|
||||
base.OnBeforeGroupBy(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选单条件策略
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void OnParseFilter(ParseFilterEventArgs e)
|
||||
{
|
||||
base.OnParseFilter(e);
|
||||
var fromId = e.SourceBusinessInfo.GetForm().Id;
|
||||
e.FilterPolicySQL = e.FilterPolicySQL + $@"
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM T_UNW_WMS_BARCODE uwbc
|
||||
WHERE uwbc.FBILLID = t1.FID
|
||||
AND t1.FENTRYID = uwbc.FBILLENTRYID
|
||||
AND uwbc.FBILLFORMID = '{fromId}'
|
||||
)
|
||||
";
|
||||
e.PlugFilterDesc = "已生成条码的数据不能重复打印!";
|
||||
}
|
||||
|
||||
public override void OnGetConvertBusinessService(ConvertBusinessServiceEventArgs e)
|
||||
|
||||
39
14.宝锐/GZ.LJY000.Biori/PRD_MO/BillConvertEventPlugInEx.py
Normal file
39
14.宝锐/GZ.LJY000.Biori/PRD_MO/BillConvertEventPlugInEx.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import clr
|
||||
clr.AddReference("System")
|
||||
clr.AddReference("System.Core")
|
||||
clr.AddReference("Kingdee.BOS")
|
||||
clr.AddReference("Kingdee.BOS.Core")
|
||||
clr.AddReference("Kingdee.BOS.DataEntity")
|
||||
clr.AddReference("Kingdee.BOS.ServiceHelper")
|
||||
clr.AddReference("Newtonsoft.Json")
|
||||
from Kingdee.BOS import *
|
||||
from Kingdee.BOS.Core import *
|
||||
from Kingdee.BOS.Core.Bill import *
|
||||
from Kingdee.BOS.Core.DynamicForm import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
|
||||
from Kingdee.BOS.Core.Metadata import *
|
||||
from Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn import *
|
||||
from Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args import *
|
||||
from Kingdee.BOS.Core.Metadata.FormElement import *
|
||||
from Kingdee.BOS.Orm.DataEntity import *
|
||||
from Kingdee.BOS.Orm.Metadata.DataEntity import *
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
from System import *
|
||||
from System.Collections.Generic import *
|
||||
from System.ComponentModel import *
|
||||
from System.Linq import *
|
||||
|
||||
# python:已生成条码的数据不能重复生成!
|
||||
def OnParseFilter(e):
|
||||
# raise Exception(e.FilterPolicySQL)
|
||||
fromId = e.SourceBusinessInfo.GetForm().Id;
|
||||
e.FilterPolicySQL = e.FilterPolicySQL + """
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM T_UNW_WMS_BARCODE uwbc
|
||||
WHERE uwbc.FBILLID = t1.FID
|
||||
AND t1.FENTRYID = uwbc.FBILLENTRYID
|
||||
AND uwbc.FBILLFORMID = '{0}'
|
||||
)
|
||||
""".format(fromId);
|
||||
e.PlugFilterDesc = "已生成条码的数据不能重复生成!";
|
||||
return;
|
||||
16
14.宝锐/GZ.LJY000.Biori/PRD_MO/BillEventPlugInEx.cs
Normal file
16
14.宝锐/GZ.LJY000.Biori/PRD_MO/BillEventPlugInEx.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GZ.LJY000.Biori.PRD_MO
|
||||
{
|
||||
[HotUpdate, Description("生产订单表单插件")]
|
||||
public class BillEventPlugInEx : AbstractDynamicFormPlugIn
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
14.宝锐/GZ.LJY000.Biori/PRD_MO/ListEventPlugInEx.cs
Normal file
11
14.宝锐/GZ.LJY000.Biori/PRD_MO/ListEventPlugInEx.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GZ.LJY000.Biori.PRD_MO
|
||||
{
|
||||
public class ListEventPlugInEx
|
||||
{
|
||||
}
|
||||
}
|
||||
52
14.宝锐/GZ.LJY000.Biori/PRD_MO/ListEventPlugInEx.py
Normal file
52
14.宝锐/GZ.LJY000.Biori/PRD_MO/ListEventPlugInEx.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import clr
|
||||
clr.AddReference("System")
|
||||
clr.AddReference("System.Xml")
|
||||
clr.AddReference("Kingdee.BOS")
|
||||
clr.AddReference("Kingdee.BOS.Core")
|
||||
clr.AddReference("Kingdee.BOS.DataEntity")
|
||||
clr.AddReference("Kingdee.BOS.App")
|
||||
clr.AddReference("Kingdee.BOS.Contracts")
|
||||
clr.AddReference("Kingdee.BOS.ServiceHelper")
|
||||
|
||||
from Kingdee.BOS import *
|
||||
from Kingdee.BOS.Contracts import *
|
||||
from Kingdee.BOS.Core import *
|
||||
from Kingdee.BOS.Core.List import *
|
||||
from Kingdee.BOS.Core.List.PlugIn import *
|
||||
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
|
||||
from Kingdee.BOS.Core.Metadata.EntityElement import *
|
||||
from Kingdee.BOS.Core.Bill import *
|
||||
from Kingdee.BOS.Core.Metadata import *
|
||||
from Kingdee.BOS.Orm.DataEntity import *
|
||||
from Kingdee.BOS.Util import *
|
||||
from Kingdee.BOS.Core.Util import *
|
||||
from System import *
|
||||
from System.Xml import *
|
||||
from System.ComponentModel import *
|
||||
from System.Collections.Generic import *
|
||||
from System.Text import*
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
|
||||
def BarItemClick(e):
|
||||
# 条码档案
|
||||
if e.BarItemKey.Equals("tbBarCodeMainEx"):
|
||||
|
||||
selectedRow = this.ListView.SelectedRowsInfo;
|
||||
if selectedRow == None or selectedRow.Count == 0:
|
||||
return;
|
||||
# raise Exception(JsonUtil.Serialize(selectedRow))
|
||||
entryIds = List[str]()
|
||||
for row in selectedRow:
|
||||
entryIds.Add(str(row.EntryPrimaryKeyValue))
|
||||
text ="FBILLENTRYID IN ({0})".format(",".join(entryIds));
|
||||
# 条码扫描
|
||||
listShowParameter = ListShowParameter();
|
||||
listShowParameter.FormId = "UNW_WMS_BARCODEMAIN";
|
||||
listShowParameter.ParentPageId = this.View.PageId;
|
||||
listShowParameter.OpenStyle.ShowType = ShowType.MainNewTabPage;
|
||||
# listShowParameter.OpenStyle.TagetKey = "FEntryTab_Code";
|
||||
listShowParameter.HiddenCloseButton = True;
|
||||
listShowParameter.ListFilterParameter.Filter = text;
|
||||
listShowParameter.ListFilterParameter.OrderBy = "FPRINTENTRYID,FPRINTSORT";
|
||||
this.View.ShowForm(listShowParameter);
|
||||
return;
|
||||
115
14.宝锐/GZ.LJY000.Biori/PRD_MO/OperationEventPlugInEx.cs
Normal file
115
14.宝锐/GZ.LJY000.Biori/PRD_MO/OperationEventPlugInEx.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GZ.LJY000.Biori.PRD_MO
|
||||
{
|
||||
[HotUpdate, Description("生产订单服务插件#")]
|
||||
public class OperationEventPlugInEx : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void OnPreparePropertys(PreparePropertysEventArgs e)
|
||||
{
|
||||
base.OnPreparePropertys(e);
|
||||
|
||||
e.FieldKeys.Add("FBillType");
|
||||
e.FieldKeys.Add("FPackSrcBillNo");
|
||||
e.FieldKeys.Add("FFPackSrcSeq");
|
||||
e.FieldKeys.Add("FPackSrcType");
|
||||
|
||||
e.FieldKeys.Add("F_UHIK_Text_re5");
|
||||
e.FieldKeys.Add("F_UHIK_TEXT8");
|
||||
e.FieldKeys.Add("F_BQGG_Text");
|
||||
e.FieldKeys.Add("F_UHIK_Date");
|
||||
e.FieldKeys.Add("F_UHIK_Date1");
|
||||
e.FieldKeys.Add("FLot");
|
||||
}
|
||||
|
||||
public override void EndOperationTransaction(EndOperationTransactionArgs e)
|
||||
{
|
||||
base.EndOperationTransaction(e);
|
||||
//保存8 提交9 审核1 反审核26 删除3
|
||||
//if (this.FormOperation.OperationId == 1)
|
||||
if (this.FormOperation.OperationId == 8)
|
||||
{
|
||||
var dataEntityList = new List<DynamicObject>();
|
||||
|
||||
var sqlL = new List<string>();
|
||||
|
||||
foreach (var data in e.DataEntitys)
|
||||
{
|
||||
var BillType_Id = data["BillType_Id"].ToString();
|
||||
|
||||
var where = string.Empty;
|
||||
foreach (var entity in data["TreeEntity"] as DynamicObjectCollection)
|
||||
{
|
||||
if (BillType_Id.Equals("0e74146732c24bec90178b6fe16a2d1c"))
|
||||
{
|
||||
var FPackSrcBillNo = entity["FPackSrcBillNo"].ToString();
|
||||
var FFPackSrcSeq = entity["FFPackSrcSeq"].Long2Int();
|
||||
var FPackSrcType = entity["FPackSrcType"].Long2Int();
|
||||
|
||||
where = $@"WHERE t0.FBILLNO = '{FPackSrcBillNo}' AND t0e.FSEQ = {FFPackSrcSeq}";
|
||||
}
|
||||
else
|
||||
{
|
||||
var entityLink = entity["FTREEENTITY_Link"] as DynamicObjectCollection;
|
||||
if (entityLink.Any())
|
||||
{
|
||||
var link = entityLink.FirstOrDefault();
|
||||
var entryId = link["SId"].Long2Int();
|
||||
if (entryId > 0 && link["STableName"].ToString().Equals("T_PLN_FORECASTENTRY"))
|
||||
where = $@"WHERE t0e.FENTRYID = {entryId}";
|
||||
}
|
||||
}
|
||||
|
||||
if (where.IsNullOrEmpty())
|
||||
continue;
|
||||
|
||||
var baseSql = $@"
|
||||
SELECT t0e.FENTRYID
|
||||
,'{entity["F_UHIK_Text_re5"]}' '存储条件'
|
||||
,'{entity["F_UHIK_TEXT8"]}' '标签货号'
|
||||
,'{entity["F_UHIK_Text"]}' '标签规格'
|
||||
,'{entity["F_UHIK_Date"]}' '生产日期'
|
||||
,'{entity["F_UHIK_Date1"]}' '有效期至'
|
||||
,{entity["Lot_Id"]} '标签批号'
|
||||
,'{entity["Lot_Text"]}' '标签批号_Text'
|
||||
FROM T_PLN_FORECAST t0
|
||||
INNER JOIN T_PLN_FORECASTENTRY t0e on t0.FID = t0e.FID AND t0e.FPRODUCTTYPE = 2
|
||||
{where}
|
||||
";
|
||||
sqlL.Add(baseSql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sqlL.Any())
|
||||
{
|
||||
var sql = $@"/*dialect*/
|
||||
WITH #基础数据 AS(
|
||||
{string.Join(" UNION ALL ", sqlL)}
|
||||
)
|
||||
UPDATE t1e SET t1e.F_UHIK_TEXT8 = t0.存储条件
|
||||
,t1e.F_UHIK_TEXT_RE5 = t0.标签货号
|
||||
,t1e.F_UHIK_TEXT2 = t0.标签规格
|
||||
,t1e.F_UHIK_DATE = t0.生产日期
|
||||
,t1e.F_UHIK_DATE1 = t0.有效期至
|
||||
,t1e.F_UHIK_LOT = t0.标签批号
|
||||
,t1e.F_UHIK_LOT_Text = t0.标签批号_Text
|
||||
FROM #基础数据 t0
|
||||
INNER JOIN T_PLN_FORECASTENTRY t1e on t0.FENTRYID = t1e.FENTRYID
|
||||
";
|
||||
|
||||
var resData = DBUtils.Execute(this.Context, sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,15 @@ from System.Collections.Generic import List
|
||||
from Kingdee.BOS.ServiceHelper import *
|
||||
from Kingdee.BOS.App.Core import *
|
||||
|
||||
def OnPreparePropertys(e):
|
||||
e.FieldKeys.Add("FBillType");
|
||||
e.FieldKeys.Add("FPackSrcBillNo");
|
||||
e.FieldKeys.Add("FFPackSrcSeq");
|
||||
e.FieldKeys.Add("FPackSrcType");
|
||||
|
||||
def EndOperationTransaction(e):
|
||||
if this.FormOperation.OperationId == 8:
|
||||
raise Exception(JsonUtil.Serialize(e.DataEntitys))
|
||||
# def AfterDoOperation(e):
|
||||
# # 保存8提交9审核1反审核26
|
||||
# # if e.Operation.Operation == "DoBarCodePrintEx":
|
||||
|
||||
Reference in New Issue
Block a user