0
This commit is contained in:
@@ -371,7 +371,7 @@ namespace Gatedge.K3Cloud.Utils
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交接口
|
||||
/// 撤销接口
|
||||
/// </summary>
|
||||
/// <param name="formId"></param>
|
||||
/// <param name="billSubmit"></param>
|
||||
|
||||
@@ -31,6 +31,40 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Kingdee.BOS">
|
||||
<HintPath>..\Library\Kingdee.BOS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.App">
|
||||
<HintPath>..\Library\Kingdee.BOS.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Core">
|
||||
<HintPath>..\Library\Kingdee.BOS.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.DataEntity">
|
||||
<HintPath>..\Library\Kingdee.BOS.DataEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.OrmEngine">
|
||||
<HintPath>..\Library\Kingdee.BOS.OrmEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.ServiceHelper">
|
||||
<HintPath>..\Library\Kingdee.BOS.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.BD.BarCode.App.Core">
|
||||
<HintPath>..\Library\Kingdee.K3.BD.BarCode.App.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.BD.BarCode.Business.PlugIn">
|
||||
<HintPath>..\Library\Kingdee.K3.BD.BarCode.Business.PlugIn.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.BD.BarCode.Core">
|
||||
<HintPath>..\Library\Kingdee.K3.BD.BarCode.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.BD.BarCode.ServiceHelper">
|
||||
<HintPath>..\Library\Kingdee.K3.BD.BarCode.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Library\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -41,13 +75,11 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="PlugIn\PUR_PurchaseOrder\ConvertPlugIn\ToStkInStock.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Model\" />
|
||||
<Folder Include="PlugIn\" />
|
||||
<Folder Include="Services\" />
|
||||
<Folder Include="SQL Files\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,64 @@
|
||||
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn;
|
||||
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
||||
{
|
||||
[Description("采购订单下推采购入库单"), HotUpdate]
|
||||
public class ToStkInStock : AbstractConvertPlugIn
|
||||
{
|
||||
private bool IsConvertByScanCode = false;
|
||||
private readonly Dictionary<string, object> CustomParams = new Dictionary<string, object>();
|
||||
private bool InStockQty = false;
|
||||
private bool InStockId = false;
|
||||
private bool FStockDate = false;
|
||||
private bool FExpirationDate = false;
|
||||
private bool FLot_Id = false;
|
||||
private bool FLot_Text = false;
|
||||
|
||||
|
||||
public override void OnInitVariable(InitVariableEventArgs e)
|
||||
{
|
||||
base.OnInitVariable(e);
|
||||
this.Option.TryGetVariableValue<bool>("IsConvertByScanCode", out IsConvertByScanCode);
|
||||
if (IsConvertByScanCode)
|
||||
{
|
||||
string InStockId;
|
||||
this.Option.TryGetVariableValue<string>("InStockId", out InStockId);
|
||||
CustomParams.Add("InStockId", InStockId);
|
||||
object InStockQty;
|
||||
this.Option.TryGetVariableValue("InStockQty", out InStockQty);
|
||||
CustomParams.Add("InStockQty", InStockQty);
|
||||
string FStockDate;
|
||||
this.Option.TryGetVariableValue("FStockDate", out FStockDate);
|
||||
CustomParams.Add("FStockDate", FStockDate);
|
||||
string FExpirationDate;
|
||||
this.Option.TryGetVariableValue("FExpirationDate", out FExpirationDate);
|
||||
CustomParams.Add("FExpirationDate", FExpirationDate);
|
||||
string FLot_Id;
|
||||
this.Option.TryGetVariableValue("FLot_Id", out FLot_Id);
|
||||
CustomParams.Add("FLot_Id", FLot_Id);
|
||||
string FLot_Text;
|
||||
this.Option.TryGetVariableValue("FLot_Text", out FLot_Text);
|
||||
CustomParams.Add("FLot_Text", FLot_Text);
|
||||
}
|
||||
}
|
||||
public override void AfterConvert(AfterConvertEventArgs e)
|
||||
{
|
||||
base.AfterConvert(e);
|
||||
// TODO 如果是来源于扫码,进行下一步
|
||||
if (!IsConvertByScanCode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
private int _proIncrement = 100;
|
||||
|
||||
|
||||
public override void OnInitialize(InitializeEventArgs e)
|
||||
public override void OnInitialize(InitializeEventArgs e)
|
||||
{
|
||||
base.OnInitialize(e);
|
||||
this._permissionConst = ((base.View.OpenParameter.SubSystemId == "SCP") ? "SCP_BarCodePrint" : "BD_BarCodePrint");
|
||||
@@ -101,7 +101,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
this.InitCustParam(e);
|
||||
}
|
||||
|
||||
public override void OnLoad(EventArgs e)
|
||||
public override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if (this._isFromBill == 1)
|
||||
@@ -117,7 +117,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void IsAutoPacking()
|
||||
private void IsAutoPacking()
|
||||
{
|
||||
this.barcodeSysParm = BarCodeCommonServiceHelper.GetBarCodeBillSystemParameters(base.Context, base.Context.CurrentOrganizationInfo.ID, this._sFormId);
|
||||
base.View.Model.SetValue("FAutoPacking", this.barcodeSysParm.AutoCreatePaking);
|
||||
@@ -125,7 +125,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.View.InvokeFieldUpdateService("FAutoPacking", 0);
|
||||
}
|
||||
|
||||
public override void AfterBindData(EventArgs e)
|
||||
public override void AfterBindData(EventArgs e)
|
||||
{
|
||||
base.AfterBindData(e);
|
||||
this.SetDefData();
|
||||
@@ -140,7 +140,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
public void SetComboItems()
|
||||
public void SetComboItems()
|
||||
{
|
||||
Entity entity = base.View.BusinessInfo.GetEntity("FEntityToBar");
|
||||
DynamicObjectCollection entityDataObject = base.View.Model.GetEntityDataObject(entity);
|
||||
@@ -148,7 +148,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
control.SetComboItems(this._noteTemplates);
|
||||
}
|
||||
|
||||
public override void AfterCreateNewEntryRow(CreateNewEntryEventArgs e)
|
||||
public override void AfterCreateNewEntryRow(CreateNewEntryEventArgs e)
|
||||
{
|
||||
if (StringUtils.EqualsIgnoreCase(e.Entity.Key, "FEntityToBill"))
|
||||
{
|
||||
@@ -157,7 +157,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.AfterCreateNewEntryRow(e);
|
||||
}
|
||||
|
||||
public override void BarItemClick(BarItemClickEventArgs e)
|
||||
public override void BarItemClick(BarItemClickEventArgs e)
|
||||
{
|
||||
string text = e.BarItemKey.ToUpperInvariant();
|
||||
if (text != null)
|
||||
@@ -420,7 +420,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.EntryBarItemClick(e);
|
||||
}
|
||||
|
||||
private void CreateBarCode(ExtendedDataEntity[] entitys, int iCount, string sType)
|
||||
private void CreateBarCode(ExtendedDataEntity[] entitys, int iCount, string sType)
|
||||
{
|
||||
Logger.Info("BarCodePrintEdit", "CreateBarCode Start");
|
||||
BarCodeCreateResult barCodeCreateResult = new BarCodeCreateResult();
|
||||
@@ -569,7 +569,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
this.newPrintDatas = new List<DynamicObject>();
|
||||
}
|
||||
|
||||
public override void OnPrepareNotePrintData(PreparePrintDataEventArgs e)
|
||||
public override void OnPrepareNotePrintData(PreparePrintDataEventArgs e)
|
||||
{
|
||||
if (e.DataSourceId.Equals("FEntityToBar", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -764,7 +764,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.OnPrepareNotePrintData(e);
|
||||
}
|
||||
|
||||
private object GetBaseDataPropByBaseData(string formId, string fieldProp, DynamicObject itemValue)
|
||||
private object GetBaseDataPropByBaseData(string formId, string fieldProp, DynamicObject itemValue)
|
||||
{
|
||||
FormMetadata formMetadata = (FormMetadata)MetaDataServiceHelper.Load(base.View.Context, Convert.ToString(formId), true);
|
||||
BusinessInfo businessInfo = formMetadata.BusinessInfo;
|
||||
@@ -784,7 +784,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return oriValue;
|
||||
}
|
||||
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
{
|
||||
int entryRowCount = base.View.Model.GetEntryRowCount("FEntityToBill");
|
||||
int entryRowCount2 = base.View.Model.GetEntryRowCount("FEntityToBar");
|
||||
@@ -913,7 +913,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.DataChanged(e);
|
||||
}
|
||||
|
||||
public override void BeforeF7Select(BeforeF7SelectEventArgs e)
|
||||
public override void BeforeF7Select(BeforeF7SelectEventArgs e)
|
||||
{
|
||||
string text = e.FieldKey.ToUpper();
|
||||
if (text != null)
|
||||
@@ -938,7 +938,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.BeforeF7Select(e);
|
||||
}
|
||||
|
||||
public override void BeforeSetItemValueByNumber(BeforeSetItemValueByNumberArgs e)
|
||||
public override void BeforeSetItemValueByNumber(BeforeSetItemValueByNumberArgs e)
|
||||
{
|
||||
string text = e.BaseDataFieldKey.ToUpper();
|
||||
if (text != null)
|
||||
@@ -961,13 +961,13 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
public override void AfterSave(AfterSaveEventArgs e)
|
||||
public override void AfterSave(AfterSaveEventArgs e)
|
||||
{
|
||||
base.View.UpdateView("FBILLCODEHEAD");
|
||||
base.AfterSave(e);
|
||||
}
|
||||
|
||||
public override void ButtonClick(ButtonClickEventArgs e)
|
||||
public override void ButtonClick(ButtonClickEventArgs e)
|
||||
{
|
||||
base.ButtonClick(e);
|
||||
string text = e.Key.ToUpperInvariant();
|
||||
@@ -982,7 +982,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
public override void CustomEvents(CustomEventsArgs e)
|
||||
public override void CustomEvents(CustomEventsArgs e)
|
||||
{
|
||||
base.CustomEvents(e);
|
||||
List<SqlParam> list = new List<SqlParam>();
|
||||
@@ -1043,7 +1043,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void GetReturnData()
|
||||
private void GetReturnData()
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (ListSelectedRow listSelectedRow in ((IListView)base.View.GetView(this.billPageId)).SelectedRowsInfo)
|
||||
@@ -1062,7 +1062,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void GetReturnDataFromSession(bool clearSessionData)
|
||||
private void GetReturnDataFromSession(bool clearSessionData)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
IListView listView = (IListView)base.View.GetView(this.billPageId);
|
||||
@@ -1094,7 +1094,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void LockPrintInfo()
|
||||
private void LockPrintInfo()
|
||||
{
|
||||
base.View.GetMainBarItem("tbNew").Enabled = true;
|
||||
base.View.GetMainBarItem("tbSave").Enabled = true;
|
||||
@@ -1114,13 +1114,13 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
base.View.StyleManager.SetEnabled("FBILLCODEHEAD", "FBILLCODEHEAD", false);
|
||||
}
|
||||
|
||||
private bool GetBarCodeFilter(out string filter)
|
||||
private bool GetBarCodeFilter(out string filter)
|
||||
{
|
||||
filter = string.Format("\r\n FID IN (SELECT DISTINCT FID from T_BD_BARCODERULETOBILL\r\n WHERE FBILLID = '{0}'\r\n )", this._sFormId);
|
||||
return !string.IsNullOrWhiteSpace(filter);
|
||||
}
|
||||
|
||||
private void SetBillRowLocked(List<int> lSeq)
|
||||
private void SetBillRowLocked(List<int> lSeq)
|
||||
{
|
||||
EntryEntity entryEntity = base.View.BusinessInfo.GetEntryEntity("FEntityToBill");
|
||||
foreach (int num in lSeq)
|
||||
@@ -1133,7 +1133,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void SetDefData()
|
||||
private void SetDefData()
|
||||
{
|
||||
if (this._isFromBill == 1)
|
||||
{
|
||||
@@ -1156,7 +1156,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private string GetDefaultPrinter()
|
||||
private string GetDefaultPrinter()
|
||||
{
|
||||
long userId = base.Context.UserId;
|
||||
long id = base.Context.CurrentOrganizationInfo.ID;
|
||||
@@ -1169,7 +1169,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return BarCodePrintServiceHelper.GetDefaultPrinter(base.View.Context, userId, id, text);
|
||||
}
|
||||
|
||||
private void BindBillData()
|
||||
private void BindBillData()
|
||||
{
|
||||
if (this._isFromBill == 1)
|
||||
{
|
||||
@@ -1199,7 +1199,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void SetBillData(int eRuleId, int row)
|
||||
private void SetBillData(int eRuleId, int row)
|
||||
{
|
||||
string text = string.Empty;
|
||||
if (this.listData != null && this.listData.Count > 0)
|
||||
@@ -1453,13 +1453,13 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSubField(string fieldKey)
|
||||
private bool IsSubField(string fieldKey)
|
||||
{
|
||||
int num = fieldKey.IndexOf("^");
|
||||
return num > 0;
|
||||
}
|
||||
|
||||
private string GetBillBaseDataFieldKey(string fieldKey)
|
||||
private string GetBillBaseDataFieldKey(string fieldKey)
|
||||
{
|
||||
int num = fieldKey.IndexOf("^");
|
||||
string result;
|
||||
@@ -1474,7 +1474,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
private string GetBaseDataSubFieldKey(string fieldKey)
|
||||
private string GetBaseDataSubFieldKey(string fieldKey)
|
||||
{
|
||||
int num = fieldKey.IndexOf("^");
|
||||
string result;
|
||||
@@ -1489,7 +1489,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
private BusinessInfo GetFormBusinessInfo(string formId)
|
||||
private BusinessInfo GetFormBusinessInfo(string formId)
|
||||
{
|
||||
BusinessInfo result;
|
||||
if (!this._baseBusinessInfo.ContainsKey(formId))
|
||||
@@ -1505,7 +1505,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
private DynamicObject GetBaseDataDynamicObject(string formId, string pkId)
|
||||
private DynamicObject GetBaseDataDynamicObject(string formId, string pkId)
|
||||
{
|
||||
string key = string.Format("{0}#{1}", formId, pkId);
|
||||
DynamicObject result;
|
||||
@@ -1523,7 +1523,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
private object GetBaseDataSubFieldValue(DynamicObject dy, BusinessInfo info, string key)
|
||||
private object GetBaseDataSubFieldValue(DynamicObject dy, BusinessInfo info, string key)
|
||||
{
|
||||
object result = null;
|
||||
Field field = info.GetField(key);
|
||||
@@ -1543,7 +1543,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
public DynamicObjectCollection GetDynamicRows(DynamicObject[] dySoruceObjsColl, DynamicObject dyRootSoruceObj, DynamicObjectCollection dybillCol, Dictionary<string, BarCodeBillCorrespondInfo> DicFieldCorresMap, List<string> lEntryNames, DynamicObjectType dotype, DynamicObject dybill, int iCurLevel, int iMaxLevel, string primaryField)
|
||||
public DynamicObjectCollection GetDynamicRows(DynamicObject[] dySoruceObjsColl, DynamicObject dyRootSoruceObj, DynamicObjectCollection dybillCol, Dictionary<string, BarCodeBillCorrespondInfo> DicFieldCorresMap, List<string> lEntryNames, DynamicObjectType dotype, DynamicObject dybill, int iCurLevel, int iMaxLevel, string primaryField)
|
||||
{
|
||||
List<string> list = new List<string>(lEntryNames);
|
||||
Dictionary<string, BarCodeBillCorrespondInfo> dictionary = new Dictionary<string, BarCodeBillCorrespondInfo>(DicFieldCorresMap);
|
||||
@@ -1750,7 +1750,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return dynamicObjectCollection;
|
||||
}
|
||||
|
||||
public DynamicObject GetNewDynamicObject(DynamicObject dybill)
|
||||
public DynamicObject GetNewDynamicObject(DynamicObject dybill)
|
||||
{
|
||||
DynamicObject dynamicObject = new DynamicObject(dybill.DynamicObjectType);
|
||||
foreach (DynamicProperty dynamicProperty in dybill.DynamicObjectType.Properties)
|
||||
@@ -1760,7 +1760,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return dynamicObject;
|
||||
}
|
||||
|
||||
private void CreateBillRows(DynamicObjectCollection billDetils, EntryEntity entity, Dictionary<string, BarCodeBillCorrespondInfo> DicFieldCorresMap)
|
||||
private void CreateBillRows(DynamicObjectCollection billDetils, EntryEntity entity, Dictionary<string, BarCodeBillCorrespondInfo> DicFieldCorresMap)
|
||||
{
|
||||
int num = this.Model.GetEntryRowCount("FEntityToBill");
|
||||
string text = base.View.Model.GetValue("FBARCODEMODEL").ToString();
|
||||
@@ -1903,7 +1903,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void ModifyBillRow(DynamicObject detil, Dictionary<string, BarCodeBillCorrespondInfo> DicFieldCorresMap, int RowIndex)
|
||||
private void ModifyBillRow(DynamicObject detil, Dictionary<string, BarCodeBillCorrespondInfo> DicFieldCorresMap, int RowIndex)
|
||||
{
|
||||
DynamicObject dObject = base.View.Model.GetValue("FBillId") as DynamicObject;
|
||||
bool flag = false;
|
||||
@@ -1990,7 +1990,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCustParam(InitializeEventArgs e)
|
||||
private void InitCustParam(InitializeEventArgs e)
|
||||
{
|
||||
int.TryParse((e.Paramter.GetCustomParameter("isFromBill") == null) ? string.Empty : e.Paramter.GetCustomParameter("isFromBill").ToString(), out this._isFromBill);
|
||||
int.TryParse((e.Paramter.GetCustomParameter("isFromPrintList") == null) ? string.Empty : e.Paramter.GetCustomParameter("isFromPrintList").ToString(), out this._isFromPrintList);
|
||||
@@ -2005,7 +2005,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
public void SetComboField()
|
||||
public void SetComboField()
|
||||
{
|
||||
ComboFieldEditor fieldEditor = base.View.GetFieldEditor<ComboFieldEditor>("FBarCodeModel", 0);
|
||||
fieldEditor.SetComboItems(this._noteTemplates);
|
||||
@@ -2013,7 +2013,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
fieldEditor.SetComboItems(this._noteTemplates);
|
||||
}
|
||||
|
||||
public void OpenBarCodeGetBill()
|
||||
public void OpenBarCodeGetBill()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this._sFormId))
|
||||
{
|
||||
@@ -2102,7 +2102,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyReturnData(FormResult ret)
|
||||
private void ApplyReturnData(FormResult ret)
|
||||
{
|
||||
if (ret != null && ret.ReturnData != null && !string.IsNullOrWhiteSpace(ret.ReturnData.ToString()))
|
||||
{
|
||||
@@ -2136,7 +2136,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckSelectRows()
|
||||
private bool CheckSelectRows()
|
||||
{
|
||||
EntryEntity entryEntity = (EntryEntity)base.View.BusinessInfo.GetEntity("FEntityToBill");
|
||||
DynamicObjectCollection source = (from p in base.View.Model.GetEntityDataObject(entryEntity)
|
||||
@@ -2145,7 +2145,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return source.Count<DynamicObject>() > 1;
|
||||
}
|
||||
|
||||
private string GetBarcodeWriteBackKey(DynamicObject doRule)
|
||||
private string GetBarcodeWriteBackKey(DynamicObject doRule)
|
||||
{
|
||||
string result = string.Empty;
|
||||
if (doRule != null)
|
||||
@@ -2168,7 +2168,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SetBarCodeValue(List<KeyValuePair<int, Dictionary<string, List<string>>>> AllBoxContrastNumbers, string sType, List<string> existedNumbers = null)
|
||||
public void SetBarCodeValue(List<KeyValuePair<int, Dictionary<string, List<string>>>> AllBoxContrastNumbers, string sType, List<string> existedNumbers = null)
|
||||
{
|
||||
Logger.Info("SetBarCodeValue", string.Format(ResManager.LoadKDString("生成条码分录数据开始", "c40bc32ce96a4219", (SubSystemType)16, new object[0]), new object[0]));
|
||||
EntryEntity entryEntity = (EntryEntity)base.View.BusinessInfo.GetEntity("FEntityToBill");
|
||||
@@ -2492,7 +2492,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
Logger.Info("SetBarCodeValue", string.Format(ResManager.LoadKDString("回填条码数量sql执行完成,执行时间:{0}", "3a0a11407d3f4caa", (SubSystemType)16, new object[0]), timeSpan.ToString("g")));
|
||||
}
|
||||
|
||||
public void SetDefRuleId()
|
||||
public void SetDefRuleId()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this._sFormId))
|
||||
{
|
||||
@@ -2505,7 +2505,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void SavingPrintBarCode()
|
||||
private void SavingPrintBarCode()
|
||||
{
|
||||
if (this.CreateSavingPrintBarCode())
|
||||
{
|
||||
@@ -2525,7 +2525,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private bool CreateSavingPrintBarCode()
|
||||
private bool CreateSavingPrintBarCode()
|
||||
{
|
||||
bool flag = false;
|
||||
BarCoder barCoder = new BarCoder();
|
||||
@@ -2567,7 +2567,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
return result;
|
||||
}
|
||||
|
||||
private void PrintBarCode(string printType)
|
||||
private void PrintBarCode(string printType)
|
||||
{
|
||||
this.printDatas = new List<DynamicObject>();
|
||||
this.newPrintDatas = new List<DynamicObject>();
|
||||
@@ -2809,7 +2809,7 @@ namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_BarCodePrint.FormPlugIn
|
||||
}
|
||||
}
|
||||
|
||||
private void CalcCreateNumber2(int RowIndex)
|
||||
private void CalcCreateNumber2(int RowIndex)
|
||||
{
|
||||
decimal d = Convert.ToDecimal(base.View.Model.GetValue("FQty", RowIndex));
|
||||
decimal num = Convert.ToDecimal(base.View.Model.GetValue("FMinPackCount", RowIndex));
|
||||
|
||||
@@ -3,6 +3,9 @@ using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.ScanCode.Common;
|
||||
using Gatedge.ScanCode.Extension;
|
||||
using Gatedge.ScanCode.Models.Dto;
|
||||
using Gatedge.ScanCode.Models.Dto.BarRecord;
|
||||
using Gatedge.ScanCode.Services;
|
||||
using Gatedge.ScanCode.Services.IServices;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -46,7 +49,7 @@ namespace Gatedge.ScanCode.Controllers
|
||||
{
|
||||
FormId = this._FormId,
|
||||
// 单据ID、单据编号
|
||||
FieldKeys = "FID,FBillNo,FDate",
|
||||
FieldKeys = "FID,FBillNo,FDate,FSupplierId.FName",
|
||||
Limit = Param.PageSize,
|
||||
StartRow = Param.PageSize * (Param.PageIndex - 1),
|
||||
};
|
||||
@@ -71,5 +74,20 @@ namespace Gatedge.ScanCode.Controllers
|
||||
var result = _utils.Query(_FormId, Param);
|
||||
return AjaxResult.Success(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量下推采购入库单
|
||||
/// </summary>
|
||||
/// <param name="barRecord"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("BatchPushPurInStock")]
|
||||
public AjaxResult BatchPushPurInStock([FromBody] BarRecord barRecord)
|
||||
{
|
||||
var loginInfo = User.GetLoginInfoByClaimsPrincipal();
|
||||
_utils.InitCloudApi(loginInfo);
|
||||
IPurchaseOrderService service = new PurchaseOrderService(_utils);
|
||||
service.PushPurInStock(barRecord.BarRecordId);
|
||||
return AjaxResult.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Gatedge.ScanCode.Controllers
|
||||
[Route("api/[controller]")]
|
||||
[Authorize]
|
||||
[ApiController]
|
||||
public class InStockController : ControllerBase
|
||||
public class StkInStockController : ControllerBase
|
||||
{
|
||||
private readonly string _FormName = "采购入库单";
|
||||
private readonly string _FormId = "STK_InStock";
|
||||
@@ -23,7 +23,7 @@ namespace Gatedge.ScanCode.Controllers
|
||||
/// <summary>
|
||||
/// 构造方法
|
||||
/// </summary>
|
||||
public InStockController(K3CloudApiUtils utils)
|
||||
public StkInStockController(K3CloudApiUtils utils)
|
||||
{
|
||||
_utils = utils;
|
||||
}
|
||||
@@ -4,5 +4,9 @@
|
||||
<NameOfLastUsedPublishProfile>E:\项目代码\澳门新东方\Gatedge.NewOrientLandMark.BOS\Gatedge.ScanCode\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
|
||||
<ActiveDebugProfile>Gatedge.ScanCode</ActiveDebugProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -40,16 +40,30 @@
|
||||
/// </summary>
|
||||
public int FBarStockId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 辅助属性
|
||||
/// </summary>
|
||||
public int FBarAuxpropId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分录ID
|
||||
/// </summary>
|
||||
public int FMoEntryId { get; set; }
|
||||
public string FSrcBillId { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 辅助属性
|
||||
/// 分录ID
|
||||
/// </summary>
|
||||
public int FBarAuxpropId { get; set; }
|
||||
public string FSrcEntryId { get; set; }
|
||||
/// <summary>
|
||||
/// 批号Id
|
||||
/// </summary>
|
||||
public int FLot_Id { get; set; }
|
||||
/// <summary>
|
||||
/// 批号文本
|
||||
/// </summary>
|
||||
public string FLot_Text { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,9 +103,13 @@ namespace Gatedge.ScanCode.Models.K3Request.SaveModel
|
||||
/// </summary>
|
||||
public Stock? FBarStockId { get; set; }
|
||||
/// <summary>
|
||||
/// 生产订单分录
|
||||
/// 源单Id
|
||||
/// </summary>
|
||||
public MoEntry? FBarMoEntryId { get; set; }
|
||||
public string FSrcBillId { get; set; }
|
||||
/// <summary>
|
||||
/// 源单分录Id
|
||||
/// </summary>
|
||||
public string FSrcEntryId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -143,6 +143,35 @@ namespace Gatedge.ScanCode.Models.Vo
|
||||
/// 辅助属性
|
||||
/// </summary>
|
||||
public Dictionary<string, object> FBarAuxPropId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库时间
|
||||
/// </summary>
|
||||
public DateTime FStockDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有效期至
|
||||
/// </summary>
|
||||
public DateTime FExpirationDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 源单Id
|
||||
/// </summary>
|
||||
public string FSrcBillId { get; set; }
|
||||
/// <summary>
|
||||
/// 源单分录Id
|
||||
/// </summary>
|
||||
public string FSrcEntryId { get; set; }
|
||||
/// <summary>
|
||||
/// 批号Id
|
||||
/// </summary>
|
||||
public int FLot_Id { get; set; }
|
||||
/// <summary>
|
||||
/// 批号文本
|
||||
/// </summary>
|
||||
public string FLot_Text { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -141,10 +141,8 @@ namespace Gatedge.ScanCode.Services
|
||||
FStockId = n.FBarStockId,
|
||||
},
|
||||
FBarQty = n.FBarQty,
|
||||
FBarMoEntryId = n.FMoEntryId == 0 ? null : new MoEntry()
|
||||
{
|
||||
FEntryId = n.FMoEntryId
|
||||
},
|
||||
FSrcBillId = n.FSrcBillId,
|
||||
FSrcEntryId = n.FSrcEntryId,
|
||||
FBarAuxPropId = n.FBarAuxpropId == 0 ? null : n.FBarAuxpropId
|
||||
|
||||
}),
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result.Model;
|
||||
using Gatedge.ScanCode.Models.Dto.PrdInStock;
|
||||
|
||||
namespace Gatedge.ScanCode.Services.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产入库单接口
|
||||
/// </summary>
|
||||
public interface IPrdInStockService
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据查看
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public object View(View param);
|
||||
|
||||
/// <summary>
|
||||
/// 列表接口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ListResult List(Query queryParam);
|
||||
|
||||
/// <summary>
|
||||
/// 提交接口
|
||||
/// </summary>
|
||||
/// <param name="billCancelAssign"></param>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus CancelAssign(CancelAssign billCancelAssign);
|
||||
|
||||
/// <summary>
|
||||
/// 提交接口
|
||||
/// </summary>
|
||||
/// <param name="billSubmit"></param>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus Submit(Submit billSubmit);
|
||||
|
||||
/// <summary>
|
||||
/// 审核接口
|
||||
/// </summary>
|
||||
/// <param name="billAudit"></param>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus Audit(Audit billAudit);
|
||||
|
||||
/// <summary>
|
||||
/// 提交并审核
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus SubmitAndAudit(PrdInStockInspect param);
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="deleteParam"></param>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus Delete(Delete deleteParam);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result.Model;
|
||||
namespace Gatedge.ScanCode.Services.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产订单接口
|
||||
/// </summary>
|
||||
public interface IProductionOrderService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查看接口
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public object View(View param);
|
||||
|
||||
/// <summary>
|
||||
/// 列表接口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ListResult List(Query queryParam);
|
||||
|
||||
/// <summary>
|
||||
/// 下推生产入库单
|
||||
/// </summary>
|
||||
public K3CloudResponseStatus PushPrdInStock(int barRecordId);
|
||||
}
|
||||
}
|
||||
17
Gatedge.ScanCode/Services/IServices/IPurchaseOrderService.cs
Normal file
17
Gatedge.ScanCode/Services/IServices/IPurchaseOrderService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result.Model;
|
||||
|
||||
namespace Gatedge.ScanCode.Services.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购订单服务接口
|
||||
/// </summary>
|
||||
public interface IPurchaseOrderService
|
||||
{
|
||||
/// <summary>
|
||||
/// 下推采购入库单
|
||||
/// </summary>
|
||||
/// <param name="barRecordId"></param>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus PushPurInStock(int barRecordId);
|
||||
}
|
||||
}
|
||||
25
Gatedge.ScanCode/Services/IServices/IStkInStockService.cs
Normal file
25
Gatedge.ScanCode/Services/IServices/IStkInStockService.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result.Model;
|
||||
|
||||
namespace Gatedge.ScanCode.Services.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购入库单服务接口
|
||||
/// </summary>
|
||||
public interface IStkInStockService
|
||||
{
|
||||
/// <summary>
|
||||
/// 撤销
|
||||
/// </summary>
|
||||
/// <param name="cancelAssign"></param>
|
||||
void CancelAssign(CancelAssign cancelAssign);
|
||||
void Delete(Delete stkInStockDeleteParam);
|
||||
|
||||
/// <summary>
|
||||
/// 提交
|
||||
/// </summary>
|
||||
/// <param name="stkInStockSubmitParam"></param>
|
||||
/// <returns></returns>
|
||||
K3CloudResponseStatus Submit(Submit stkInStockSubmitParam);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result;
|
||||
|
||||
namespace Gatedge.ScanCode.Services.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 装配车间排产计划接口
|
||||
/// </summary>
|
||||
public interface IZP_ProductionSchedulingPlanService
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据查询接口
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public dynamic View(View param);
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表信息
|
||||
/// </summary>
|
||||
/// <param name="billQuery"></param>
|
||||
/// <returns></returns>
|
||||
public ListResult List(Query billQuery);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result;
|
||||
|
||||
namespace Gatedge.ScanCode.Services.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 注塑排产计划服务接口
|
||||
/// </summary>
|
||||
public interface IZS_ProductionSchedulingPlanService
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据查询接口
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public dynamic View(View param);
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表信息
|
||||
/// </summary>
|
||||
/// <param name="billQuery"></param>
|
||||
/// <returns></returns>
|
||||
public ListResult List(Query billQuery);
|
||||
}
|
||||
}
|
||||
187
Gatedge.ScanCode/Services/PurchaseOrderService.cs
Normal file
187
Gatedge.ScanCode/Services/PurchaseOrderService.cs
Normal file
@@ -0,0 +1,187 @@
|
||||
using Gatedge.K3Cloud.Utils;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result.Model;
|
||||
using Gatedge.ScanCode.Models.K3Request.SaveModel;
|
||||
using Gatedge.ScanCode.Services.IServices;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace Gatedge.ScanCode.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购订单服务
|
||||
/// </summary>
|
||||
public class PurchaseOrderService : IPurchaseOrderService
|
||||
{
|
||||
|
||||
private readonly string _FormName = "采购订单";
|
||||
private readonly string _FormId = "PUR_PurchaseOrder";
|
||||
private readonly string _TargetFormId = "STK_InStock";
|
||||
private readonly string _ConvertRuleId = "797d4af7-420e-4045-8e62-b3c1fe519ddc";
|
||||
|
||||
/// <summary>
|
||||
/// 金蝶云星空工具类
|
||||
/// </summary>
|
||||
private readonly K3CloudApiUtils _utils;
|
||||
|
||||
/// <summary>
|
||||
/// 构造方法
|
||||
/// </summary>
|
||||
public PurchaseOrderService(K3CloudApiUtils utils)
|
||||
{
|
||||
_utils = utils;
|
||||
}
|
||||
/// <summary>
|
||||
/// 下推采购入库单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public K3CloudResponseStatus PushPurInStock(int barRecordId)
|
||||
{
|
||||
IBarRecordService barRecordService = new BarRecordService(_utils);
|
||||
IStkInStockService stkInStockService = new StkInStockService(_utils);
|
||||
|
||||
var barRecordViewParam = new View()
|
||||
{
|
||||
Id = barRecordId.ToString(),
|
||||
};
|
||||
var barRecord = barRecordService.View(barRecordViewParam);
|
||||
// 单据状态检查
|
||||
if (barRecord.DocumentStatus == "B")
|
||||
{
|
||||
throw new Exception("该扫描结果已经被提交,不允许重复提交");
|
||||
}
|
||||
if (barRecord.DocumentStatus == "C")
|
||||
{
|
||||
throw new Exception("该扫描结果已经被提交,不允许重复提交");
|
||||
}
|
||||
// 提交单据,不允许重复提交,相当于上锁
|
||||
var submitBarRecor = new Submit()
|
||||
{
|
||||
Ids = barRecordId.ToString(),
|
||||
};
|
||||
var submitBarRecorResult = barRecordService.Submit(submitBarRecor);
|
||||
// 如果提交不成功
|
||||
if (!submitBarRecorResult.IsSuccess)
|
||||
{
|
||||
throw new Exception("该扫描结果已经被提交,不允许重复提交");
|
||||
}
|
||||
// 如果提交成功,开始下推生产入库单
|
||||
|
||||
|
||||
var barEntityList = barRecord.FBarEntity;
|
||||
// 构造下推参数
|
||||
List<Push> billPusheList = new List<Push>();
|
||||
foreach (var item in barEntityList)
|
||||
{
|
||||
Push billPush = new Push();
|
||||
billPush.EntryIds = item.FSrcEntryId;
|
||||
billPush.CustomParams = new Dictionary<string, object>();
|
||||
billPush.CustomParams.Add("IsConvertByScanCode", true); // 是否由条码下推
|
||||
billPush.CustomParams.Add("InStockQty", item.FBarQty); // 下推数量
|
||||
billPush.CustomParams.Add("InStockId", item.FBarStockId_Id); // 入库仓库
|
||||
billPush.CustomParams.Add("FStockDate", item.FStockDate); // 入库日期
|
||||
billPush.CustomParams.Add("FExpirationDate", item.FExpirationDate); // 有效期至
|
||||
billPush.CustomParams.Add("FLot_Id", item.FLot_Id); // 有效期至
|
||||
billPush.CustomParams.Add("FLot_Text", item.FLot_Text); // 有效期至
|
||||
billPush.RuleId = _ConvertRuleId; // 注塑/装配车间排产计划专用转换规则
|
||||
billPush.TargetFormId = _TargetFormId; // 目标单据类型:采购入库单
|
||||
billPush.IsEnableDefaultRule = false; // 不启用默认规则
|
||||
billPush.IsDraftWhenSaveFail = false; // 保存失败,不自动暂存
|
||||
billPusheList.Add(billPush);
|
||||
}
|
||||
// 成功列表
|
||||
var successList = new List<K3CloudResponseStatus>();
|
||||
// TODO 遍历下推
|
||||
foreach (var item in billPusheList)
|
||||
{
|
||||
var pushResp = _utils.Push(_FormId, item);
|
||||
// 如果失败,将所有生成的单据删除,并保存错误信息到扫描记录
|
||||
if (pushResp?.IsSuccess != true)
|
||||
{
|
||||
// 从下推成功的记录里获取Id,并且删除
|
||||
var deletePrdInStockIdList = new List<string>();
|
||||
successList.ForEach(n => n.SuccessEntitys?.ForEach(m => deletePrdInStockIdList.Add(m.Id.ToString())));
|
||||
var errorInfo = string.Join("\r\n", pushResp.Errors.Select(n => n.Message));
|
||||
// 如果有成功的下推单,则删除生成的入库单,回写错误信息。
|
||||
if (deletePrdInStockIdList.Count > 0)
|
||||
{
|
||||
// 撤销并删除生产入库单
|
||||
CancelAssignDeletePrdInStock(deletePrdInStockIdList);
|
||||
}
|
||||
barRecordService.SaveErrorInfo(barRecordId, errorInfo);
|
||||
// 撤销提交的栈板单据
|
||||
CancelAssignBarRecord(barRecordId);
|
||||
return pushResp;
|
||||
|
||||
}
|
||||
successList.Add(pushResp);
|
||||
}
|
||||
//如果都成功,将入库单提交
|
||||
var prdInStockIds = new List<string>();
|
||||
successList.ForEach(n => n.SuccessEntitys?.ForEach(m => prdInStockIds.Add(m.Id.ToString())));
|
||||
Submit stkInStockSubmitParam = new Submit()
|
||||
{
|
||||
Ids = string.Join(',', prdInStockIds)
|
||||
};
|
||||
var submitResult = stkInStockService.Submit(stkInStockSubmitParam);
|
||||
return submitResult;
|
||||
// 如果提交不成功
|
||||
if (!submitResult.IsSuccess)
|
||||
{
|
||||
var errorInfo = string.Join("\r\n", submitResult.Errors.Select(n => n.Message));
|
||||
// 撤销并删除入库单
|
||||
CancelAssignDeletePrdInStock(prdInStockIds);
|
||||
// 撤销提交的栈板单据
|
||||
CancelAssignBarRecord(barRecordId);
|
||||
// 回写错误信息
|
||||
barRecordService.SaveErrorInfo(barRecordId, errorInfo);
|
||||
return submitResult;
|
||||
}
|
||||
var result = barRecordService.SubmitSuccess(barRecordId, successList.Select(n => new BarRecordSave.ResultEntry
|
||||
{
|
||||
FResultBillNo = n.SuccessEntitys.First().Number,
|
||||
FResultId = n.SuccessEntitys.First().Id.ToString(),
|
||||
FResultBillId = new Models.K3Request.BaseData.FormType()
|
||||
{
|
||||
FID = _TargetFormId
|
||||
}
|
||||
}));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 撤销并删除所有下推数据
|
||||
/// </summary>
|
||||
/// <param name="deleteIds"></param>
|
||||
private void CancelAssignDeletePrdInStock(List<string> deleteIds)
|
||||
{
|
||||
IStkInStockService stkInStockService = new StkInStockService(_utils);
|
||||
CancelAssign cancelAssign = new CancelAssign()
|
||||
{
|
||||
Ids = string.Join(',', deleteIds.Select(n => n.ToString()))
|
||||
};
|
||||
stkInStockService.CancelAssign(cancelAssign);
|
||||
Delete stkInStockDeleteParam = new Delete()
|
||||
{
|
||||
Ids = string.Join(',', deleteIds.Select(n => n.ToString()))
|
||||
};
|
||||
stkInStockService.Delete(stkInStockDeleteParam);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 撤销栈板单据提交
|
||||
/// </summary>
|
||||
/// <param name="barRecordId"></param>
|
||||
private void CancelAssignBarRecord(int barRecordId)
|
||||
{
|
||||
IBarRecordService barRecordService = new BarRecordService(_utils);
|
||||
CancelAssign cancelAssignBarRecord = new CancelAssign()
|
||||
{
|
||||
Ids = barRecordId.ToString()
|
||||
};
|
||||
// 撤销
|
||||
var cancelAssignBarRecordResult = barRecordService.CancelAssign(cancelAssignBarRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
59
Gatedge.ScanCode/Services/StkInStockService.cs
Normal file
59
Gatedge.ScanCode/Services/StkInStockService.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Gatedge.K3Cloud.Utils;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Request;
|
||||
using Gatedge.K3Cloud.Utils.Model.K3Result.Model;
|
||||
using Gatedge.ScanCode.Services.IServices;
|
||||
|
||||
namespace Gatedge.ScanCode.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购入库单服务
|
||||
/// </summary>
|
||||
public class StkInStockService : IStkInStockService
|
||||
{
|
||||
private readonly string _FormName = "采购入库单";
|
||||
private readonly string _FormId = "STK_InStock";
|
||||
|
||||
/// <summary>
|
||||
/// 金蝶云星空工具类
|
||||
/// </summary>
|
||||
private readonly K3CloudApiUtils _utils;
|
||||
|
||||
/// <summary>
|
||||
/// 构造方法
|
||||
/// </summary>
|
||||
public StkInStockService(K3CloudApiUtils utils)
|
||||
{
|
||||
_utils = utils;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 撤销
|
||||
/// </summary>
|
||||
/// <param name="cancelAssign"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public void CancelAssign(CancelAssign cancelAssign)
|
||||
{
|
||||
_utils.CancelAssign(_FormId, cancelAssign);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除接口
|
||||
/// </summary>
|
||||
/// <param name="stkInStockDeleteParam"></param>
|
||||
public void Delete(Delete stkInStockDeleteParam)
|
||||
{
|
||||
_utils.Delete(_FormId, stkInStockDeleteParam);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交采购入库单
|
||||
/// </summary>
|
||||
/// <param name="stkInStockSubmitParam"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public K3CloudResponseStatus Submit(Submit stkInStockSubmitParam)
|
||||
{
|
||||
return _utils.Submit(_FormId, stkInStockSubmitParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Library/Kingdee.CDP.WebApi.SDK.dll
Normal file
BIN
Library/Kingdee.CDP.WebApi.SDK.dll
Normal file
Binary file not shown.
Reference in New Issue
Block a user