From 3977f35abef2a963b1deda54e9de14ff3e67838b Mon Sep 17 00:00:00 2001 From: xiongshuai <873144595@qq.com> Date: Sun, 9 Nov 2025 20:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/VSWorkspaceState.json | 7 + .vs/yuntongzhuadan/v17/.wsuo | Bin 0 -> 11776 bytes .vs/yuntongzhuadan/v17/DocumentLayout.json | 12 + .../KingDee/SaveModel/PurchaseStockInModel.cs | 134 +++++++ .../Model/YTKJTShopParameter.cs | 8 + .../MyCode.Project.Domain.csproj | 1 + .../IServices/IPurchaseStockInService.cs | 15 + .../Implementation/OrderPushService.cs | 1 + .../Implementation/PurchaseStockInService.cs | 334 ++++++++++++++++++ .../MyCode.Project.Services.csproj | 2 + .../Controllers/TestController.cs | 15 +- 11 files changed, 528 insertions(+), 1 deletion(-) create mode 100644 .vs/VSWorkspaceState.json create mode 100644 .vs/yuntongzhuadan/v17/.wsuo create mode 100644 .vs/yuntongzhuadan/v17/DocumentLayout.json create mode 100644 Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs create mode 100644 Reportapi/MyCode.Project.Services/IServices/IPurchaseStockInService.cs create mode 100644 Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..ad58f3b --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\MyCode.Project.sln", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/yuntongzhuadan/v17/.wsuo b/.vs/yuntongzhuadan/v17/.wsuo new file mode 100644 index 0000000000000000000000000000000000000000..d7a5f9c1da6b68981e15aacba9813441c68ef61e GIT binary patch literal 11776 zcmeHN&2Jk;6n{=BZTTww3Q%!~AgU@Ar)kofIEN}UO#z9tX_7WbZ4Zv^rXO+EvK^rO zC5Thtz@7hq6XI6>01hB=;M7wkPBi>}vpe?edOaEMh7zm$ob}Gm&dhJ-&3kX&d(N+q zkNp1Kk0<|-2wjwY@@)H%ylm9xjIz8b@;aVb_iTH6o3B_#F{1(Ez@m8gv}8o)WCQnx zJmOY5)3EGs@A(@$^!n+qtpo30{Vn$j+RX%lwE#p<9>}Lazl+kGe6_< z!*AoC-bOXVSCPgiZe7+fgN9UbErAy$T-BgmuiK~$<;?Bw)y}LZpB@Gk*JKkY>vA9K z=e1@aUq(&C>=;uf{!6IekIQxa$I({nHRtk=xqz7RVYGP_7yI!w^_~3V{b*2k4EIC0 zP6YLAm(kwm!1L7qt#3Q}uLV%+-}BV}w;-dL{(}i1EujZcrX8S8(>5HzMVrFsgSb=w zUkjdfAAP6Z>vDDrh1#6H^y{zpjnZEf{C%8M>v2F@ycpf!BxcdaO|t1S2Mv=cVR7)gN7xP`t9DT;qd z`F|z&XLay_9$8C1MxBQ_)?;Qg5%_=fdni3>&>g;LN9hBTT<~ptI1PO2BF{5deA@B} zT%;&I{opcqU&p%dD@m}Si=0Z}|8ng-Q%G_6zU);ni;9W|Z1X7qpXb#vT(0ZqdDRR5 zirVuEym0P#L-7L5dlJ{b4{s?`uK2|6C4U|KM^b}kc+gK90bk(~n`CRN-Zw1D%Lmu|3qGq|N zc*Xt~6UZNJrRIM>_&ldtLJM62KFYQdio^^B_t% zf7{ru>!z+sbL{iSIuc4Yqfz(+VGp(`BRILpfOGI;_-&)`Y-}y< z?|%8a^8J$^zA4&Ub-%5ZnyqT%&$CJU|9oa^`sr-){=ITHyOsap_!;e84n(yli~pGO zslcXW@!yLO|IN#y+`x&!e2=-_5n(1~z3u0BTW-H5N&bcL0#EzhBGbC`J7$*u4duqPdm=@pAwZM|ByC+;36Ygo4w0{e*r>0 BIvD@} literal 0 HcmV?d00001 diff --git a/.vs/yuntongzhuadan/v17/DocumentLayout.json b/.vs/yuntongzhuadan/v17/DocumentLayout.json new file mode 100644 index 0000000..d88cc6d --- /dev/null +++ b/.vs/yuntongzhuadan/v17/DocumentLayout.json @@ -0,0 +1,12 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\yuntongzhuadan\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [] + } + ] +} \ No newline at end of file diff --git a/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs b/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs new file mode 100644 index 0000000..148db5d --- /dev/null +++ b/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel +{ + public class PurchaseStockInModel + { + public int? FID { get; set; } + public FBillTypeID FBillTypeID { get; set; } + public string FBillNo { get; set; } + public string FDate { get; set; } + public FStockOrgId FStockOrgId { get; set; } + public FDemandOrgId FDemandOrgId { get; set; } + public FCorrespondOrgId FCorrespondOrgId { get; set; } + public FPurchaseOrgId FPurchaseOrgId { get; set; } + public string FOwnerTypeIdHead { get; set; } + public FOwnerIdHead FOwnerIdHead { get; set; } + public int? FCDateOffsetValue { get; set; } + public string FSplitBillType { get; set; } + public FSalOutStockOrgId FSalOutStockOrgId { get; set; } + public FInStockFin FInStockFin { get; set; } + public List FInStockEntry { get; set; } + } + + public class FDemandOrgId + { + public string FNumber { get; set; } + } + + public class FPurchaseOrgId + { + public string FNumber { get; set; } + } + + public class FOwnerIdHead + { + public string FNumber { get; set; } + } + + public class FSalOutStockOrgId + { + public string FNumber { get; set; } + } + + public class FInStockFin + { + public FSettleOrgId FSettleOrgId { get; set; } + public FSettleCurrId FSettleCurrId { get; set; } + public bool? FIsIncludedTax { get; set; } + public string FPriceTimePoint { get; set; } + public FLocalCurrId FLocalCurrId { get; set; } + public FExchangeTypeId FExchangeTypeId { get; set; } + public decimal? FExchangeRate { get; set; } + public bool? FISPRICEEXCLUDETAX { get; set; } + public decimal? FAllDisCount { get; set; } + public decimal? FHSExchangeRate { get; set; } + } + + public class FSettleOrgId + { + public string FNumber { get; set; } + } + + public class FLocalCurrId + { + public string FNumber { get; set; } + } + + public class FPurchaseStockInEntryItem + { + public string FRowType { get; set; } + public FMaterialId FMaterialId { get; set; } + public FUnitID FUnitID { get; set; } + public string FMaterialDesc { get; set; } + public decimal? FWWPickMtlQty { get; set; } + public decimal? FRealQty { get; set; } + public FPriceUnitID FPriceUnitID { get; set; } + public decimal? FPrice { get; set; } + public decimal? FDisPriceQty { get; set; } + public FStockStatusId FStockStatusId { get; set; } + public bool? FGiveAway { get; set; } + public string FOWNERTYPEID { get; set; } + public decimal? FExtAuxUnitQty { get; set; } + public bool? FCheckInComing { get; set; } + public bool? FIsReceiveUpdateStock { get; set; } + public decimal? FInvoicedJoinQty { get; set; } + public decimal? FPriceBaseQty { get; set; } + public FRemainInStockUnitId FRemainInStockUnitId { get; set; } + public bool? FBILLINGCLOSE { get; set; } + public decimal? FRemainInStockQty { get; set; } + public decimal? FAPNotJoinQty { get; set; } + public decimal? FRemainInStockBaseQty { get; set; } + public decimal? FTaxPrice { get; set; } + public decimal? FEntryTaxRate { get; set; } + public decimal? FDiscountRate { get; set; } + public decimal? FCostPrice { get; set; } + public decimal? FAuxUnitQty { get; set; } + public FOwnerId FOWNERID { get; set; } + public string FSRCBILLTYPEID { get; set; } + public string FSRCBillNo { get; set; } + public decimal? FAllAmountExceptDisCount { get; set; } + public decimal? FPriceDiscount { get; set; } + public decimal? FConsumeSumQty { get; set; } + public decimal? FBaseConsumeSumQty { get; set; } + public decimal? FRejectsDiscountAmount { get; set; } + public int? FSalOutStockEntryId { get; set; } + public decimal? FBeforeDisPriceQty { get; set; } + public int? FPayableEntryID { get; set; } + public int? FSUBREQBILLSEQ { get; set; } + public int? FSUBREQENTRYID { get; set; } + public string FBatchNo { get; set; } + public string FSerialNo { get; set; } + } + + public class FPriceUnitID + { + public string FNumber { get; set; } + } + + public class FStockStatusId + { + public string FNumber { get; set; } + } + + public class FRemainInStockUnitId + { + public string FNumber { get; set; } + } + +} + diff --git a/Reportapi/MyCode.Project.Domain/Model/YTKJTShopParameter.cs b/Reportapi/MyCode.Project.Domain/Model/YTKJTShopParameter.cs index a9efdf4..c4d2ff2 100644 --- a/Reportapi/MyCode.Project.Domain/Model/YTKJTShopParameter.cs +++ b/Reportapi/MyCode.Project.Domain/Model/YTKJTShopParameter.cs @@ -245,5 +245,13 @@ namespace MyCode.Project.Domain.Model [SugarColumn(ColumnName="F_PURCHASINGWAREHOUSECODE")] public string FPURCHASINGWAREHOUSECODE {get;set;} + /// + /// Desc:采购组织ID + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnName="F_PURCHASEORGID")] + public int? FPURCHASEORGID {get;set;} + } } diff --git a/Reportapi/MyCode.Project.Domain/MyCode.Project.Domain.csproj b/Reportapi/MyCode.Project.Domain/MyCode.Project.Domain.csproj index de3d4c4..6997beb 100644 --- a/Reportapi/MyCode.Project.Domain/MyCode.Project.Domain.csproj +++ b/Reportapi/MyCode.Project.Domain/MyCode.Project.Domain.csproj @@ -73,6 +73,7 @@ + diff --git a/Reportapi/MyCode.Project.Services/IServices/IPurchaseStockInService.cs b/Reportapi/MyCode.Project.Services/IServices/IPurchaseStockInService.cs new file mode 100644 index 0000000..8b418f6 --- /dev/null +++ b/Reportapi/MyCode.Project.Services/IServices/IPurchaseStockInService.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyCode.Project.Services.IServices +{ + public interface IPurchaseStockInService + { + string PushPurchaseStockInToKingDee(string id); + } +} + + diff --git a/Reportapi/MyCode.Project.Services/Implementation/OrderPushService.cs b/Reportapi/MyCode.Project.Services/Implementation/OrderPushService.cs index 89fed74..8a2d6e8 100644 --- a/Reportapi/MyCode.Project.Services/Implementation/OrderPushService.cs +++ b/Reportapi/MyCode.Project.Services/Implementation/OrderPushService.cs @@ -240,5 +240,6 @@ namespace MyCode.Project.Services.Implementation //LogHelper.Info(); return responseStatus; } + } } diff --git a/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs b/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs new file mode 100644 index 0000000..b4aa77f --- /dev/null +++ b/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs @@ -0,0 +1,334 @@ +using MyCode.Project.Domain.Message.Request.KingDee; +using MyCode.Project.Domain.Message.Request.KingDee.SaveModel; +using MyCode.Project.Domain.Message.Response.KingDee.K3Result; +using MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model; +using MyCode.Project.Domain.Model; +using MyCode.Project.Domain.Repositories; +using MyCode.Project.Infrastructure.Common; +using MyCode.Project.Infrastructure.Exceptions; +using MyCode.Project.OutSideService; +using MyCode.Project.Services.IServices; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MyCode.Project.Services.Implementation +{ + /// + /// 采购入库单服务实现 + /// 功能:处理采购入库单推送到金蝶云星空的业务逻辑 + /// + public class PurchaseStockInService : ServiceBase, IPurchaseStockInService + { + private const string BILL_TYPE_CODE = "RKD01_SYS"; + private const string OWNER_TYPE = "BD_OwnerOrg"; + private const string EXCHANGE_TYPE = "HLTX01_SYS"; + private const string STOCK_STATUS = "KCZT01_SYS"; + private const string DEFAULT_ORG = "100"; + private const string DEFAULT_CURRENCY = "PRE001"; + private const string DEFAULT_UNIT = "Pcs"; + private const string ROW_TYPE_STANDARD = "Standard"; + private const string ROW_TYPE_SERVICE = "Service"; + private const string FORM_ID = "PUR_PurchaseStockIn"; + + private IPushKingDeeGoodsDocInRepository _pushKingDeeGoodsDocInRepository; + private IBusiOrderGoodsDocInRepository _busiOrderGoodsDocInRepository; + private IYTKJTShopParameterRepository _yTKJTShopParameterRepository; + private IKingDeeService _kingDeeService; + + public PurchaseStockInService( + IPushKingDeeGoodsDocInRepository pushKingDeeGoodsDocInRepository, + IBusiOrderGoodsDocInRepository busiOrderGoodsDocInRepository, + IYTKJTShopParameterRepository yTKJTShopParameterRepository, + IKingDeeService kingDeeService) + { + _pushKingDeeGoodsDocInRepository = pushKingDeeGoodsDocInRepository; + _busiOrderGoodsDocInRepository = busiOrderGoodsDocInRepository; + _yTKJTShopParameterRepository = yTKJTShopParameterRepository; + _kingDeeService = kingDeeService; + } + + /// + /// 推送采购入库单到金蝶云星空 + /// + /// PushKingDeeGoodsDocIn表的主键ID(Guid格式的字符串) + /// 返回金蝶API的响应结果(JSON格式) + public string PushPurchaseStockInToKingDee(string id) + { + var goodsDocIn = _pushKingDeeGoodsDocInRepository + .Queryable() + .Where(t => id == t.ID.ToString()) + .First(); + + if (goodsDocIn == null) + { + throw new BaseException($"未找到ID为 {id} 的采购入库单记录"); + } + + if (goodsDocIn.Status != 0 && goodsDocIn.Status != 1) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 已经推送过,状态为:{goodsDocIn.Status},不允许重复推送"); + } + + var param = _yTKJTShopParameterRepository + .Queryable() + .Where(t => t.FDOCUMENTSTATUS == "C") + .First(); + + if (param == null) + { + throw new BaseException("没有找到已审核的门店参数配置,请联系管理员检查门店参数表"); + } + + if (param.FPURCHASERECEIVING == "0") + { + throw new BaseException("门店参数配置中采购入库单同步功能未启用,请联系管理员检查门店参数配置"); + } + + if (param.FPURCHASERECEIVING == "1") + { + var response = PushKingdeePurchaseStockIn(goodsDocIn, param); + string result = JsonHelper.ToJson(response); + + if (response.IsSuccess) + { + var allRecords = _pushKingDeeGoodsDocInRepository + .Queryable() + .Where(t => t.GoodsdocNo == goodsDocIn.GoodsdocNo) + .ToList(); + + foreach (var record in allRecords) + { + record.Status = 2; + _pushKingDeeGoodsDocInRepository.Update(record); + } + } + + return result; + } + + return ""; + } + + private K3CloudResponseStatus PushKingdeePurchaseStockIn(PushKingDeeGoodsDocIn goodsDocIn, YTKJTShopParameter param) + { + // 从BusiOrderGoodsDocIn表获取明细数据 + var detailList = _busiOrderGoodsDocInRepository + .Queryable() + .Where(t => t.GoodsdocNo == goodsDocIn.GoodsdocNo) + .ToList(); + + if (detailList == null || detailList.Count == 0) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 没有找到明细数据,无法推送"); + } + + var vendorCodes = detailList.Where(d => !string.IsNullOrEmpty(d.VendCode)) + .Select(d => d.VendCode) + .Distinct() + .ToList(); + if (vendorCodes.Count > 1) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 明细行中存在不同的供应商编码:{string.Join(",", vendorCodes)},无法推送"); + } + + // 获取第一条明细用于主表信息 + var firstDetail = detailList.FirstOrDefault(); + if (firstDetail == null) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 明细数据为空,无法推送"); + } + + // 获取采购组织ID + string purchaseOrgId = param.FPURCHASEORGID?.ToString() ?? param.FSALEORGID?.ToString() ?? DEFAULT_ORG; + + // 获取仓库编码 + string warehouseCode = firstDetail.WarehouseCode ?? param.FPURCHASINGWAREHOUSECODE ?? ""; + + // 数据校验 + if (string.IsNullOrEmpty(firstDetail.VendCode)) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 供应商编码为空,无法推送"); + } + if (string.IsNullOrEmpty(warehouseCode)) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 仓库编码为空,无法推送"); + } + + // 构建金蝶API的明细行数据 + var entryList = detailList.Select((n, index) => BuildEntryItem(n, param, purchaseOrgId, warehouseCode)).ToList(); + + if (entryList.Count == 0) + { + throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 明细数据转换失败,无法推送"); + } + + // 构建金蝶API的主表数据 + var model = BuildMainModel(goodsDocIn, firstDetail, param, purchaseOrgId, entryList); + + // 构建金蝶API请求对象 + BillSave billSave = new BillSave() + { + Model = model, + IsAutoSubmitAndAudit = true, + }; + + // 调用金蝶服务保存单据 + var responseStatus = _kingDeeService.Save(FORM_ID, billSave); + return responseStatus; + } + + /// + /// 构建明细行数据 + /// + private FPurchaseStockInEntryItem BuildEntryItem(BusiOrderGoodsDocIn detail, YTKJTShopParameter param, string orgId, string warehouseCode) + { + // 根据入库类型动态设置FRowType(如果入库类型包含"服务"或"费用"等关键字,则设置为Service,否则为Standard) + string rowType = ROW_TYPE_STANDARD; + if (!string.IsNullOrEmpty(detail.InouttypeName)) + { + string inoutType = detail.InouttypeName.ToUpper(); + if (inoutType.Contains("服务") || inoutType.Contains("费用") || inoutType.Contains("SERVICE") || inoutType.Contains("FEE")) + { + rowType = ROW_TYPE_SERVICE; + } + } + + // 计算折扣后金额(无税金额) + decimal? allAmountExceptDisCount = detail.BaceCurrencyNoTaxAmount ?? 0; + + return new FPurchaseStockInEntryItem() + { + FRowType = rowType, + FMaterialId = new FMaterialId() + { + FNumber = detail.SkuBarcode ?? "" + }, + FUnitID = new FUnitID() + { + FNumber = detail.UnitName ?? DEFAULT_UNIT + }, + FMaterialDesc = detail.GoodsName ?? "", + FWWPickMtlQty = 0, + FRealQty = detail.Quantity ?? 0, + FPriceUnitID = new FPriceUnitID() + { + FNumber = detail.UnitName ?? DEFAULT_UNIT + }, + FPrice = detail.BaceCurrencyNoTaxPrice ?? 0, + FDisPriceQty = 0, + FStockStatusId = new FStockStatusId() + { + FNumber = STOCK_STATUS + }, + FGiveAway = false, + FOWNERTYPEID = OWNER_TYPE, + FExtAuxUnitQty = 0, + FCheckInComing = false, + FIsReceiveUpdateStock = false, + FInvoicedJoinQty = 0, + FPriceBaseQty = detail.Quantity ?? 0, + FRemainInStockUnitId = new FRemainInStockUnitId() + { + FNumber = detail.UnitName ?? DEFAULT_UNIT + }, + FBILLINGCLOSE = false, + FRemainInStockQty = detail.Quantity ?? 0, + FRemainInStockBaseQty = detail.Quantity ?? 0, + FAPNotJoinQty = detail.Quantity ?? 0, + FTaxPrice = detail.BaceCurrencyWithTaxPrice ?? 0, + FEntryTaxRate = detail.TaxRate ?? (decimal?)param.FTAXRATE, + FDiscountRate = 0, + FCostPrice = detail.BaceCurrencyCostPrice ?? 0, + FAuxUnitQty = 0, + FOWNERID = new FOwnerId() + { + FNumber = orgId + }, + FSRCBILLTYPEID = detail.SourceBillNo, + FSRCBillNo = detail.SourceBillNo ?? detail.BillNo ?? "", + FAllAmountExceptDisCount = allAmountExceptDisCount, + FPriceDiscount = 0, + FConsumeSumQty = 0, + FBaseConsumeSumQty = 0, + FRejectsDiscountAmount = 0, + FSalOutStockEntryId = 0, + FBeforeDisPriceQty = 0, + FPayableEntryID = 0, + FSUBREQBILLSEQ = 0, + FSUBREQENTRYID = 0, + FBatchNo = detail.BatchNo ?? "", + FSerialNo = detail.SerialNo ?? "" + }; + } + + private PurchaseStockInModel BuildMainModel(PushKingDeeGoodsDocIn goodsDocIn, BusiOrderGoodsDocIn firstDetail, YTKJTShopParameter param, string orgId, List entryList) + { + string dateStr = goodsDocIn.InOutDate2?.ToString("yyyy-MM-dd") ?? DateTime.Now.ToString("yyyy-MM-dd"); + + return new PurchaseStockInModel() + { + FID = 0, + FBillTypeID = new FBillTypeID() + { + FNUMBER = BILL_TYPE_CODE + }, + FDate = dateStr, + FStockOrgId = new FStockOrgId() + { + FNumber = orgId + }, + FDemandOrgId = new FDemandOrgId() + { + FNumber = orgId + }, + FCorrespondOrgId = new FCorrespondOrgId() + { + FNumber = orgId + }, + FPurchaseOrgId = new FPurchaseOrgId() + { + FNumber = orgId + }, + FOwnerTypeIdHead = OWNER_TYPE, + FOwnerIdHead = new FOwnerIdHead() + { + FNumber = orgId + }, + FCDateOffsetValue = 0, + FSplitBillType = "A", + FSalOutStockOrgId = new FSalOutStockOrgId() + { + FNumber = orgId + }, + FInStockFin = new FInStockFin() + { + FSettleOrgId = new FSettleOrgId() + { + FNumber = orgId + }, + FSettleCurrId = new FSettleCurrId() + { + FNumber = goodsDocIn.CurrencyCode ?? DEFAULT_CURRENCY + }, + FIsIncludedTax = true, + FPriceTimePoint = "1", + FLocalCurrId = new FLocalCurrId() + { + FNumber = goodsDocIn.CurrencyCode ?? DEFAULT_CURRENCY + }, + FExchangeTypeId = new FExchangeTypeId() + { + FNumber = EXCHANGE_TYPE + }, + FExchangeRate = goodsDocIn.CurrencyRate ?? 1m, + FISPRICEEXCLUDETAX = true, + FAllDisCount = 0m, + FHSExchangeRate = 1m + }, + FInStockEntry = entryList + }; + } + } +} + diff --git a/Reportapi/MyCode.Project.Services/MyCode.Project.Services.csproj b/Reportapi/MyCode.Project.Services/MyCode.Project.Services.csproj index dd2cdeb..631f7c2 100644 --- a/Reportapi/MyCode.Project.Services/MyCode.Project.Services.csproj +++ b/Reportapi/MyCode.Project.Services/MyCode.Project.Services.csproj @@ -119,6 +119,7 @@ + @@ -129,6 +130,7 @@ + diff --git a/Reportapi/MyCode.Project.WebApi/Controllers/TestController.cs b/Reportapi/MyCode.Project.WebApi/Controllers/TestController.cs index c102c22..ac2c638 100644 --- a/Reportapi/MyCode.Project.WebApi/Controllers/TestController.cs +++ b/Reportapi/MyCode.Project.WebApi/Controllers/TestController.cs @@ -20,14 +20,17 @@ namespace MyCode.Project.WebApi.Controllers private IWMSService _wMSService; private IJackYunStockinService _jackYunStockinService; private IOrderPushService _orderPushService; + private IPurchaseStockInService _purchaseStockInService; public TestController(IJackYunTaskService jackYunTaskService, IWMSService wMSService - , IJackYunStockinService jackYunStockinService, IOrderPushService orderPushService) + , IJackYunStockinService jackYunStockinService, IOrderPushService orderPushService + , IPurchaseStockInService purchaseStockInService) { _jackYunTaskService = jackYunTaskService; _wMSService = wMSService; _jackYunStockinService = jackYunStockinService; _orderPushService = orderPushService; + _purchaseStockInService = purchaseStockInService; } /// @@ -40,6 +43,16 @@ namespace MyCode.Project.WebApi.Controllers return _orderPushService.PushOrderToKingDee(id); } + /// + /// 测试推送采购入库单到金蝶云星空 + /// + [HttpGet] + [AllowAnonymous] + public string TaskSendKingdeePurchaseStockInById(string id) + { + return _purchaseStockInService.PushPurchaseStockInToKingDee(id); + } + #region 调度运行抓吉客云销售订单