diff --git a/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs b/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs
index 7e2f375..7c1f7d2 100644
--- a/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs
+++ b/Reportapi/MyCode.Project.Domain/Message/Request/KingDee/SaveModel/PurchaseStockInModel.cs
@@ -9,6 +9,9 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
public class PurchaseStockInModel
{
public int? FID { get; set; }
+
+ public bool IsVerifyBaseDataField { get; set; }
+
public FBillTypeID FBillTypeID { get; set; }
public string FBillNo { get; set; }
public string FDate { get; set; }
@@ -16,6 +19,11 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
public FDemandOrgId FDemandOrgId { get; set; }
public FCorrespondOrgId FCorrespondOrgId { get; set; }
public FPurchaseOrgId FPurchaseOrgId { get; set; }
+
+ ///
+ /// Ӧ
+ ///
+ public FSupplier FSupplierId { get; set; }
public string FOwnerTypeIdHead { get; set; }
public FOwnerIdHead FOwnerIdHead { get; set; }
public int? FCDateOffsetValue { get; set; }
@@ -25,14 +33,23 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
public List FInStockEntry { get; set; }
}
+ public class FSupplier
+ {
+ public string FNumber { get; set; }
+ public string FOrgId { get; set; }
+ }
+
+
public class FDemandOrgId
{
public string FNumber { get; set; }
+ public string FOrgId { get; set; }
}
public class FPurchaseOrgId
{
public string FNumber { get; set; }
+ public string FOrgId { get; set; }
}
public class FOwnerIdHead
@@ -73,6 +90,12 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
public class FPurchaseStockInEntryItem
{
+ public FStockID FStockID { get; set; }
+
+ ///
+ ///
+ ///
+ public string Fcode { get; set; }
public string FRowType { get; set; }
public FMaterialId FMaterialId { get; set; }
public FUnitID FUnitID { get; set; }
@@ -129,6 +152,7 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
public class FRemainInStockUnitId
{
+ public string FOrgId { get; set; }
public string FNumber { get; set; }
}
diff --git a/Reportapi/MyCode.Project.OutSideService/Implementation/KingDeeService.cs b/Reportapi/MyCode.Project.OutSideService/Implementation/KingDeeService.cs
index c0ea25f..2290a8a 100644
--- a/Reportapi/MyCode.Project.OutSideService/Implementation/KingDeeService.cs
+++ b/Reportapi/MyCode.Project.OutSideService/Implementation/KingDeeService.cs
@@ -96,7 +96,7 @@ namespace MyCode.Project.OutSideService.Implementation
staClient = GetK3CloudClient();
var datastr = JsonHelper.ToJson(billSave, false, false, true);
LogHelper.Info("调度Id:" + id + ",金蝶云接口请求:" + datastr);
- var resultString = staClient.Save(formId, datastr);
+ var resultString = staClient.Draft(formId, datastr);
LogHelper.Info("调度Id:" + id + "金蝶云接口响应:" + resultString);
var result = JsonHelper.ToObject(resultString);
if (!result.Result.ResponseStatus.IsSuccess)
diff --git a/Reportapi/MyCode.Project.Repositories/BusiOrderGoodsDocInRepository.cs b/Reportapi/MyCode.Project.Repositories/BusiOrderGoodsDocInRepository.cs
index 92a3e4b..7da62e4 100644
--- a/Reportapi/MyCode.Project.Repositories/BusiOrderGoodsDocInRepository.cs
+++ b/Reportapi/MyCode.Project.Repositories/BusiOrderGoodsDocInRepository.cs
@@ -66,25 +66,12 @@ namespace MyCode.Project.Repositories
///
public List GetPushGoodsDocInOrder()
{
- string sql = $@"
-SELECT
+ string sql = $@"SELECT
-- 分组字段
CONVERT(date, InOutDate2) AS InOutDate2,
WarehouseCode AS WarehouseCode,
WarehouseName AS WarehouseName,
- GoodsNo AS GoodsNo,
- GoodsName AS GoodsName,
- SkuName AS SkuName,
- UnitName AS UnitName,
- SkuBarcode AS SkuBarcode,
- [CurrencyCode]
- ,[CurrencyCodeName]
- ,[CurrencyRate]
- ,[CreateUserName]
- ,[CompanyName],VendCustomerName,VendCode ,[ApplyCompanyName],
- [TaxRate]
- ,[TransNoTaxPrice]
- ,[TransHasTaxPrice],
+ [GoodsdocNo] AS [GoodsdocNo] ,[ApplyCompanyName],[VendCustomerName],
-- 合计数据
SUM(Quantity) AS Quantity ,-- 总数量,
SUM(BaceCurrencyCostAmount) AS BaceCurrencyCostAmount,--总入库金额,
@@ -93,8 +80,7 @@ SELECT
SUM(BaceCurrencyTaxAmount) AS BaceCurrencyTaxAmount,-- 总本币税额,
SUM(TransNoTaxAmount) AS TransNoTaxAmount,--总原币无税金额,
SUM(TransHasTaxAmount) AS TransHasTaxAmount,--总原币含税金额,
- SUM(TransTaxAmount) AS TransTaxAmount,--总原币税额,
-
+ SUM(TransTaxAmount) AS TransTaxAmount,--总原币税额,
-- 计数统计
COUNT(DISTINCT GoodsdocNo) AS 入库单数,
COUNT(*) AS 明细行数
@@ -105,20 +91,12 @@ GROUP BY
CONVERT(DATE, InOutDate2),
WarehouseCode,
WarehouseName,
- GoodsNo,
- GoodsName,
- SkuName,
- UnitName,SkuBarcode ,[CurrencyCode]
- ,[CurrencyCodeName]
- ,[CurrencyRate]
- ,[CreateUserName]
- ,[CompanyName],CompanyName,VendCustomerName,VendCode ,[ApplyCompanyName], [TaxRate]
- ,[TransNoTaxPrice]
- ,[TransHasTaxPrice]
+ [GoodsdocNo] ,[ApplyCompanyName],[VendCustomerName]
+
ORDER BY
CONVERT(date, InOutDate2) DESC,
WarehouseCode,
- GoodsNo;";
+ [GoodsdocNo]; ";
var list = this.SelectList(sql);
return list;
}
diff --git a/Reportapi/MyCode.Project.Services/Implementation/JackYunService.cs b/Reportapi/MyCode.Project.Services/Implementation/JackYunService.cs
index f3baf31..f226536 100644
--- a/Reportapi/MyCode.Project.Services/Implementation/JackYunService.cs
+++ b/Reportapi/MyCode.Project.Services/Implementation/JackYunService.cs
@@ -99,6 +99,7 @@ namespace MyCode.Project.Services.Implementation
List trades = new List();
TradeTypeList.ForEach(ty =>
{
+ requestBizData.PageIndex = 0;
requestBizData.TradeType = ty;
string lggl = JsonHelper.ToJson(requestBizData);
LogHelper.Info("TradeType:==" + ty.ToString() + " " + lggl);
@@ -186,6 +187,7 @@ namespace MyCode.Project.Services.Implementation
List trades = new List();
TradeTypeList.ForEach(ty =>
{
+ requestBizData.PageIndex = 0;
requestBizData.ProcessStatusList = "";
string lggl = JsonHelper.ToJson(requestBizData);
LogHelper.Info(lggl);
@@ -305,7 +307,7 @@ namespace MyCode.Project.Services.Implementation
List trades = new List();
TradeTypeList.ForEach(ty =>
{
-
+ requestBizData.PageIndex = 0;
string lggl = JsonHelper.ToJson(requestBizData);
LogHelper.Info(lggl);
JackyunResponse response = Call(EnumAttribute.GetAttribute(ApiEnum.STORAGEGOODSDOCINCOUNTS).Value, "1.0", requestBizData);
@@ -397,7 +399,7 @@ namespace MyCode.Project.Services.Implementation
List trades = new List();
TradeTypeList.ForEach(ty =>
{
-
+ requestBizData.PageIndex = 0;
string lggl = JsonHelper.ToJson(requestBizData);
LogHelper.Info(lggl);
JackyunResponse response = Call(EnumAttribute.GetAttribute(ApiEnum.ERPSTORAGEGOODSDOCOUTV2).Value, "1.0", requestBizData);
diff --git a/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs b/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs
index fc8a838..564cad2 100644
--- a/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs
+++ b/Reportapi/MyCode.Project.Services/Implementation/PurchaseStockInService.cs
@@ -6,6 +6,7 @@ using MyCode.Project.Domain.Model;
using MyCode.Project.Domain.Repositories;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Infrastructure.Exceptions;
+using MyCode.Project.Infrastructure.Extensions;
using MyCode.Project.OutSideService;
using MyCode.Project.Services.IServices;
using System;
@@ -29,7 +30,7 @@ namespace MyCode.Project.Services.Implementation
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 const string FORM_ID = "STK_InStock";
private IPushKingDeeGoodsDocInRepository _pushKingDeeGoodsDocInRepository;
private IBusiOrderGoodsDocInRepository _busiOrderGoodsDocInRepository;
@@ -65,7 +66,7 @@ namespace MyCode.Project.Services.Implementation
throw new BaseException($"未找到ID为 {id} 的采购入库单记录");
}
- if (goodsDocIn.Status != 0 && goodsDocIn.Status != 1)
+ if (goodsDocIn.Status ==2 )
{
throw new BaseException($"采购入库单 {goodsDocIn.GoodsdocNo} 已经推送过,状态为:{goodsDocIn.Status},不允许重复推送");
}
@@ -170,7 +171,7 @@ namespace MyCode.Project.Services.Implementation
BillSave billSave = new BillSave()
{
Model = model,
- IsAutoSubmitAndAudit = true,
+ IsAutoSubmitAndAudit = false,
};
// 调用金蝶服务保存单据
@@ -199,24 +200,29 @@ namespace MyCode.Project.Services.Implementation
return new FPurchaseStockInEntryItem()
{
+ Fcode = detail.SkuBarcode ?? "",
FRowType = rowType,
- FMaterialId = new FMaterialId()
- {
- FNumber = detail.SkuBarcode ?? ""
- },
- FUnitID = new FUnitID()
- {
- FNumber = detail.UnitName ?? DEFAULT_UNIT
- },
- FMaterialDesc = detail.GoodsName ?? "",
+ //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
- },
+ //FPriceUnitID = new FPriceUnitID()
+ //{
+ // FNumber = detail.UnitName ?? DEFAULT_UNIT
+ //},
FPrice = detail.BaceCurrencyNoTaxPrice ?? 0,
FDisPriceQty = 0,
+ FStockID = new FStockID()
+ {
+ FNumber = param.FPURCHASINGWAREHOUSECODE
+ },
FStockStatusId = new FStockStatusId()
{
FNumber = STOCK_STATUS
@@ -230,35 +236,20 @@ namespace MyCode.Project.Services.Implementation
FPriceBaseQty = detail.Quantity ?? 0,
FRemainInStockUnitId = new FRemainInStockUnitId()
{
- FNumber = detail.UnitName ?? DEFAULT_UNIT
+ FOrgId = param.FPURCHASEORGID.SafeValue().ToString(),
},
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,
+ FTaxPrice = detail.BaceCurrencyWithTaxPrice ?? 0,
+
FOWNERID = new FOwnerId()
{
- FNumber = orgId
+ FOrgId = 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 ?? ""
+
+
};
}
@@ -274,57 +265,53 @@ namespace MyCode.Project.Services.Implementation
FNUMBER = BILL_TYPE_CODE
},
FDate = dateStr,
+ IsVerifyBaseDataField=true,
FStockOrgId = new FStockOrgId()
{
- FNumber = orgId
+ FOrgId = orgId
},
FDemandOrgId = new FDemandOrgId()
{
- FNumber = orgId
- },
- FCorrespondOrgId = new FCorrespondOrgId()
- {
- FNumber = orgId
+ FOrgId = orgId
},
+
+
FPurchaseOrgId = new FPurchaseOrgId()
{
- FNumber = orgId
+ FOrgId = orgId
+ },
+
+ FSupplierId = new FSupplier()
+ {
+ FNumber = firstDetail.VendCode
},
FOwnerTypeIdHead = OWNER_TYPE,
FOwnerIdHead = new FOwnerIdHead()
{
- FNumber = orgId
+ FOrgId = 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
+ FNumber = DEFAULT_CURRENCY
},
FIsIncludedTax = true,
FPriceTimePoint = "1",
FLocalCurrId = new FLocalCurrId()
{
- FNumber = goodsDocIn.CurrencyCode ?? DEFAULT_CURRENCY
+ FNumber = DEFAULT_CURRENCY
},
FExchangeTypeId = new FExchangeTypeId()
{
FNumber = EXCHANGE_TYPE
},
- FExchangeRate = goodsDocIn.CurrencyRate ?? 1m,
+ FExchangeRate = 1m,
FISPRICEEXCLUDETAX = true,
- FAllDisCount = 0m,
- FHSExchangeRate = 1m
},
FInStockEntry = entryList
};
diff --git a/Reportapi/MyCode.Project.WebApi/Web.config b/Reportapi/MyCode.Project.WebApi/Web.config
index 721f760..66dcc9e 100644
--- a/Reportapi/MyCode.Project.WebApi/Web.config
+++ b/Reportapi/MyCode.Project.WebApi/Web.config
@@ -5,78 +5,79 @@
-->
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
@@ -174,84 +175,88 @@
-->
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+