Compare commits
4 Commits
997440fb84
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0faeab0321 | ||
| cd1c87bf8e | |||
| 00f11185ba | |||
| 0210aeacb9 |
@@ -1,18 +1,19 @@
|
|||||||
using Gatedge.NewOrientLandMark.BOS.Services;
|
using System;
|
||||||
using Kingdee.BOS.App;
|
|
||||||
using Kingdee.BOS.Contracts;
|
|
||||||
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn;
|
|
||||||
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args;
|
|
||||||
using Kingdee.BOS.Core.Metadata.FieldElement;
|
|
||||||
using Kingdee.BOS.Orm.DataEntity;
|
|
||||||
using Kingdee.BOS.ServiceHelper;
|
|
||||||
using Kingdee.BOS.Util;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Gatedge.NewOrientLandMark.BOS.Services;
|
||||||
|
using Kingdee.BOS.App;
|
||||||
|
using Kingdee.BOS.Contracts;
|
||||||
|
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn;
|
||||||
|
using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args;
|
||||||
|
using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||||
|
using Kingdee.BOS.Log;
|
||||||
|
using Kingdee.BOS.Orm.DataEntity;
|
||||||
|
using Kingdee.BOS.ServiceHelper;
|
||||||
|
using Kingdee.BOS.Util;
|
||||||
|
|
||||||
namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
||||||
{
|
{
|
||||||
@@ -65,7 +66,8 @@ namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
|||||||
e.TargetBusinessInfo.GetField("FStockId") as BaseDataField;
|
e.TargetBusinessInfo.GetField("FStockId") as BaseDataField;
|
||||||
BaseDataField StockStatusField =
|
BaseDataField StockStatusField =
|
||||||
e.TargetBusinessInfo.GetField("FStockStatusId") as BaseDataField;
|
e.TargetBusinessInfo.GetField("FStockStatusId") as BaseDataField;
|
||||||
|
BaseDataField LotField =
|
||||||
|
e.TargetBusinessInfo.GetField("FLot") as BaseDataField;
|
||||||
IViewService service = ServiceHelper.GetService<IViewService>();
|
IViewService service = ServiceHelper.GetService<IViewService>();
|
||||||
//根据内码获取物料基础资料对象
|
//根据内码获取物料基础资料对象
|
||||||
var org = bill.DataEntity["StockOrgId"] as DynamicObject; // 调出组织
|
var org = bill.DataEntity["StockOrgId"] as DynamicObject; // 调出组织
|
||||||
@@ -91,20 +93,48 @@ namespace Gatedge.NewOrientLandMark.BOS.PlugIn.PUR_PurchaseOrder.ConvertPlugIn
|
|||||||
var unitId = Convert.ToInt64(item["UnitId_Id"]); // 主单位
|
var unitId = Convert.ToInt64(item["UnitId_Id"]); // 主单位
|
||||||
var priceUnitId = Convert.ToInt64(item["PriceUnitID_Id"]); // 计价单位
|
var priceUnitId = Convert.ToInt64(item["PriceUnitID_Id"]); // 计价单位
|
||||||
var remainInStockUnitId = Convert.ToInt64(item["RemainInStockUnitId_Id"]); // 采购单位
|
var remainInStockUnitId = Convert.ToInt64(item["RemainInStockUnitId_Id"]); // 采购单位
|
||||||
|
var baseUnitId = Convert.ToInt64(item["BaseUnitID_Id"]); // 基础单位
|
||||||
//var snUnitId = Convert.ToInt64(item["SNUnitID_Id"]); // 序列号单位
|
//var snUnitId = Convert.ToInt64(item["SNUnitID_Id"]); // 序列号单位
|
||||||
var qty = Convert.ToDecimal(CustomParams["InStockQty"]);
|
var qty = Convert.ToDecimal(CustomParams["InStockQty"]);
|
||||||
item["RealQty"] = qty; // 填写实收数
|
item["RealQty"] = qty; // 填写实收数
|
||||||
if (priceUnitId != 0) // 计价数量
|
// 计价数量
|
||||||
|
if (priceUnitId != 0)
|
||||||
{
|
{
|
||||||
var BaseRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, priceUnitId, qty);
|
var BaseRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, priceUnitId, qty);
|
||||||
item["PriceUnitQty"] = BaseRealQty;
|
item["PriceUnitQty"] = BaseRealQty;
|
||||||
item["PriceUnitQty"] = BaseRealQty;
|
|
||||||
}
|
}
|
||||||
if (remainInStockUnitId != 0) // 采购数量
|
// 采购数量
|
||||||
|
if (remainInStockUnitId != 0)
|
||||||
{
|
{
|
||||||
var SecRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, remainInStockUnitId, qty);
|
var SecRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, remainInStockUnitId, qty);
|
||||||
item["RemainInStockQty"] = SecRealQty;
|
item["RemainInStockQty"] = SecRealQty;
|
||||||
}
|
}
|
||||||
|
// 采购基本数量
|
||||||
|
if (baseUnitId != 0)
|
||||||
|
{
|
||||||
|
var BaseRealQty = unitService.GetQtyByUtilConverRate(materialId, unitId, baseUnitId, qty);
|
||||||
|
item["RemainInStockBaseQty"] = BaseRealQty;
|
||||||
|
item["BaseUnitQty"] = BaseRealQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
var lotId = CustomParams["FLot_Id"].ToString();
|
||||||
|
var lotText = CustomParams["FLot_Text"]?.ToString().Trim();
|
||||||
|
// 如果批号不为空,则赋值
|
||||||
|
if (!lotText.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
// 如果批号Id不为空,赋值批号
|
||||||
|
if (!lotId.IsNullOrEmpty() && lotId != "0")
|
||||||
|
{
|
||||||
|
var lot = service.LoadSingle(this.Context, lotId, LotField.RefFormDynamicObjectType);
|
||||||
|
item["Lot_Id"] = lot["Id"];
|
||||||
|
item["Lot"] = lot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item["Lot_Text"] = lotText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//throw new Exception("1111");
|
||||||
//if (snUnitId != 0)
|
//if (snUnitId != 0)
|
||||||
//{
|
//{
|
||||||
// var snQty = unitService.GetQtyByUtilConverRate(materialId, unitId, snUnitId, qty);
|
// var snQty = unitService.GetQtyByUtilConverRate(materialId, unitId, snUnitId, qty);
|
||||||
|
|||||||
@@ -151,5 +151,25 @@ namespace Gatedge.ScanCode.Controllers
|
|||||||
service.PrintResultBillNo(barRecord);
|
service.PrintResultBillNo(barRecord);
|
||||||
return AjaxResult.Success("扫描记录更新成功.");
|
return AjaxResult.Success("扫描记录更新成功.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量下推采购入库单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="barRecord"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("Delete")]
|
||||||
|
public AjaxResult Delete([FromBody] BarRecord barRecord)
|
||||||
|
{
|
||||||
|
var loginInfo = User.GetLoginInfoByClaimsPrincipal();
|
||||||
|
_utils.InitCloudApi(loginInfo);
|
||||||
|
IBarRecordService service = new BarRecordService(_utils);
|
||||||
|
var result = service.Delete(barRecord);
|
||||||
|
if (result.IsSuccess)
|
||||||
|
{
|
||||||
|
return AjaxResult.Success("删除成功.", result);
|
||||||
|
}
|
||||||
|
return AjaxResult.Error("删除失败.", result);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
Gatedge.ScanCode/Models/K3Request/BaseData/Lot.cs
Normal file
8
Gatedge.ScanCode/Models/K3Request/BaseData/Lot.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Gatedge.ScanCode.Models.K3Request.BaseData
|
||||||
|
{
|
||||||
|
public class Lot
|
||||||
|
{
|
||||||
|
public int? FLotId { get; set; }
|
||||||
|
public string? FNumber { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -110,6 +110,10 @@ namespace Gatedge.ScanCode.Models.K3Request.SaveModel
|
|||||||
/// 源单分录Id
|
/// 源单分录Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FSrcEntryId { get; set; }
|
public string FSrcEntryId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 批号
|
||||||
|
/// </summary>
|
||||||
|
public Lot? FLot { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -60,6 +60,19 @@ namespace Gatedge.ScanCode.Services
|
|||||||
return _utils.CancelAssign(this._FormId, cancelAssignBarRecord);
|
return _utils.CancelAssign(this._FormId, cancelAssignBarRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除条码扫描记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="barRecord"></param>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public K3CloudResponseStatus Delete(BarRecord barRecord)
|
||||||
|
{
|
||||||
|
return _utils.Delete(this._FormId, new Delete()
|
||||||
|
{
|
||||||
|
Ids = barRecord.BarRecordId.ToString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据条码查找条码扫描记录
|
/// 根据条码查找条码扫描记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -143,7 +156,12 @@ namespace Gatedge.ScanCode.Services
|
|||||||
FBarQty = n.FBarQty,
|
FBarQty = n.FBarQty,
|
||||||
FSrcBillId = n.FSrcBillId,
|
FSrcBillId = n.FSrcBillId,
|
||||||
FSrcEntryId = n.FSrcEntryId,
|
FSrcEntryId = n.FSrcEntryId,
|
||||||
FBarAuxPropId = n.FBarAuxpropId == 0 ? null : n.FBarAuxpropId
|
FBarAuxPropId = n.FBarAuxpropId == 0 ? null : n.FBarAuxpropId,
|
||||||
|
FLot = new Lot()
|
||||||
|
{
|
||||||
|
FLotId = n.FLot_Id == 0 ? null : n.FLot_Id,
|
||||||
|
FNumber = n.FLot_Text,
|
||||||
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -89,5 +89,11 @@ namespace Gatedge.ScanCode.Services.IServices
|
|||||||
/// <param name="auditParam"></param>
|
/// <param name="auditParam"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public K3CloudResponseStatus Audit(Audit auditParam);
|
public K3CloudResponseStatus Audit(Audit auditParam);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="barRecord"></param>
|
||||||
|
public K3CloudResponseStatus Delete(BarRecord barRecord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user