完成推送云星空部分
This commit is contained in:
parent
0cc51644b2
commit
94d802d5da
@ -31,7 +31,7 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
|
||||
/// <summary>
|
||||
/// 客户
|
||||
/// </summary>
|
||||
public FCustId FCustId { get; set; }
|
||||
public FCustomerId FCustId { get; set; }
|
||||
/// <summary>
|
||||
/// 交货方式
|
||||
/// </summary>
|
||||
@ -190,13 +190,21 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
|
||||
public class FSaleOrgId
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string FNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public string FOrgId { get; set; }
|
||||
}
|
||||
|
||||
public class FCustId
|
||||
public class FCustomerId
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
public string FCustId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@ -253,6 +261,7 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
|
||||
|
||||
public class FSalerId
|
||||
{
|
||||
public long? FId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@ -773,7 +782,7 @@ namespace MyCode.Project.Domain.Message.Request.KingDee.SaveModel
|
||||
/// <summary>
|
||||
/// 税率%
|
||||
/// </summary>
|
||||
public int? FEntryTaxRate { get; set; }
|
||||
public decimal? FEntryTaxRate { get; set; }
|
||||
/// <summary>
|
||||
/// 批号
|
||||
/// </summary>
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
using MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model;
|
||||
|
||||
namespace MyCode.Project.Domain.Message.Response.KingDee.K3Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 金蝶云星空返回类
|
||||
/// </summary>
|
||||
public class K3ApiResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回对象
|
||||
/// </summary>
|
||||
public KingdeeResult Result { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
namespace MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回类
|
||||
/// </summary>
|
||||
public class KingdeeResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 响应对象
|
||||
/// </summary>
|
||||
public ResponseStatus ResponseStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 转换响应对象
|
||||
/// </summary>
|
||||
public ResponseStatus ConvertResponseStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回结果,用于查看单据
|
||||
/// </summary>
|
||||
public object Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始索引
|
||||
/// </summary>
|
||||
public long StartIndex { get; set; }
|
||||
/// <summary>
|
||||
/// 是否最后
|
||||
/// </summary>
|
||||
public bool IsLast { get; set; }
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
/// </summary>
|
||||
public long FileSize { get; set; }
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件内容(Base64)
|
||||
/// </summary>
|
||||
public string FilePart { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 响应对象
|
||||
/// </summary>
|
||||
public class ResponseStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 错误代码
|
||||
/// </summary>
|
||||
public int ErrorCode { get; set; }
|
||||
/// <summary>
|
||||
/// 是否成功
|
||||
/// </summary>
|
||||
public bool IsSuccess { get; set; }
|
||||
/// <summary>
|
||||
/// 错误信息列表
|
||||
/// </summary>
|
||||
public List<ResultInfo> Errors { get; set; }
|
||||
/// <summary>
|
||||
/// 成功实体
|
||||
/// </summary>
|
||||
public List<SuccessEntity> SuccessEntitys { get; set; }
|
||||
/// <summary>
|
||||
/// 成功消息
|
||||
/// </summary>
|
||||
public List<ResultInfo> SuccessMessages { get; set; }
|
||||
/// <summary>
|
||||
/// 消息代码
|
||||
/// </summary>
|
||||
public int MsgCode { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
namespace MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 金蝶云星空查看错误信息类
|
||||
/// </summary>
|
||||
public class ResultInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 字段名称
|
||||
/// </summary>
|
||||
public string FieldName { get; set; }
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int DIndex { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
namespace MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 成功实体
|
||||
/// </summary>
|
||||
public class SuccessEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 单据编号
|
||||
/// </summary>
|
||||
public string Number { get; set; }
|
||||
/// <summary>
|
||||
/// 实体索引
|
||||
/// </summary>
|
||||
public int DIndex { get; set; }
|
||||
/// <summary>
|
||||
/// 分录Id
|
||||
/// </summary>
|
||||
public object EntryIds { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
namespace MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 成功信息
|
||||
/// </summary>
|
||||
public class SuccessMessage
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -11,191 +11,200 @@ namespace MyCode.Project.Domain.Model
|
||||
[SugarTable("YTKJ_t_ShopParameter")]
|
||||
public partial class YTKJTShopParameter
|
||||
{
|
||||
public YTKJTShopParameter(){
|
||||
public YTKJTShopParameter()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long FID {get;set;}
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long FID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string FBILLNO {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string FBILLNO { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:审核状态 C=已审核
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string FDOCUMENTSTATUS {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:审核状态 C=已审核
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string FDOCUMENTSTATUS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:门店编码
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_SHOPCODE")]
|
||||
public string FSHOPCODE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:门店编码
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SHOPCODE")]
|
||||
public string FSHOPCODE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:门店名称
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_SHOPNAME")]
|
||||
public string FSHOPNAME {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:门店名称
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SHOPNAME")]
|
||||
public string FSHOPNAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_YTKJ_TEXT2")]
|
||||
public string FYTKJTEXT2 {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_YTKJ_TEXT2")]
|
||||
public string FYTKJTEXT2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:是否同步金蝶
|
||||
/// Default:1
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_SYNCHRONIZEKINGDEE")]
|
||||
public string FSYNCHRONIZEKINGDEE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:是否同步金蝶
|
||||
/// Default:1
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SYNCHRONIZEKINGDEE")]
|
||||
public string FSYNCHRONIZEKINGDEE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:是否同步WMS
|
||||
/// Default:1
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_SYNCHRONIZEWMS")]
|
||||
public string FSYNCHRONIZEWMS {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:是否同步WMS
|
||||
/// Default:1
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SYNCHRONIZEWMS")]
|
||||
public string FSYNCHRONIZEWMS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:销售客户
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_SALESCUSTOMERS")]
|
||||
public int FSALESCUSTOMERS {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:销售客户
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SALESCUSTOMERS")]
|
||||
public int FSALESCUSTOMERS { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:发货仓库ID
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_WAREHOUSE")]
|
||||
public int FWAREHOUSE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:发货仓库ID
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_WAREHOUSE")]
|
||||
public int FWAREHOUSE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:仓库货主
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_CANGKUHUOZHU")]
|
||||
public string FCANGKUHUOZHU {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:仓库货主
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_CANGKUHUOZHU")]
|
||||
public string FCANGKUHUOZHU { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:公司ID
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_COMPANYID")]
|
||||
public string FCOMPANYID {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:公司ID
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_COMPANYID")]
|
||||
public string FCOMPANYID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:发货大仓
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_DACANG")]
|
||||
public string FDACANG {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:发货大仓
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_DACANG")]
|
||||
public string FDACANG { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:税率
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_TAXRATE")]
|
||||
public decimal FTAXRATE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:税率
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_TAXRATE")]
|
||||
public decimal FTAXRATE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_YTKJ_CREATEDATE")]
|
||||
public DateTime? FYTKJCREATEDATE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:创建日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_YTKJ_CREATEDATE")]
|
||||
public DateTime? FYTKJCREATEDATE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_YTKJ_MODIFYDATE")]
|
||||
public DateTime? FYTKJMODIFYDATE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:修改日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_YTKJ_MODIFYDATE")]
|
||||
public DateTime? FYTKJMODIFYDATE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:审核日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_AUDITDATE")]
|
||||
public DateTime? FAUDITDATE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:审核日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_AUDITDATE")]
|
||||
public DateTime? FAUDITDATE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建人
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_YTKJ_CREATORID")]
|
||||
public int FYTKJCREATORID {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:创建人
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_YTKJ_CREATORID")]
|
||||
public int FYTKJCREATORID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改人
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_YTKJ_MODIFIERID")]
|
||||
public int FYTKJMODIFIERID {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:修改人
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_YTKJ_MODIFIERID")]
|
||||
public int FYTKJMODIFIERID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:审核人
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_AUDITOR")]
|
||||
public int FAUDITOR {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:审核人
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_AUDITOR")]
|
||||
public int FAUDITOR { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:仓库编码
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_WAREHOUSE_CODE")]
|
||||
public string FWAREHOUSECODE {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:仓库编码
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_WAREHOUSE_CODE")]
|
||||
public string FWAREHOUSECODE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:仓库名称
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_WAREHOUSE_NAME")]
|
||||
public string FWAREHOUSENAME {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:仓库名称
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_WAREHOUSE_NAME")]
|
||||
public string FWAREHOUSENAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:销售员ID
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="F_SALER")]
|
||||
public long? FSALER {get;set;}
|
||||
/// <summary>
|
||||
/// Desc:销售员ID
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SALER")]
|
||||
public long? FSALER { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:销售员ID
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "F_SALE_ORGID")]
|
||||
public long? FSaleOrgId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,6 +80,12 @@
|
||||
<Compile Include="Message\Response\JackYun\CreateAndStockinResp.cs" />
|
||||
<Compile Include="Message\Response\JackYun\PushOrderListResp.cs" />
|
||||
<Compile Include="Message\Response\KingDee\ErrorResponse.cs" />
|
||||
<Compile Include="Message\Response\KingDee\K3Result\K3ApiResult.cs" />
|
||||
<Compile Include="Message\Response\KingDee\K3Result\Model\KingdeeResult.cs" />
|
||||
<Compile Include="Message\Response\KingDee\K3Result\Model\ResponseStatus.cs" />
|
||||
<Compile Include="Message\Response\KingDee\K3Result\Model\ResultInfo.cs" />
|
||||
<Compile Include="Message\Response\KingDee\K3Result\Model\SuccessEntity.cs" />
|
||||
<Compile Include="Message\Response\KingDee\K3Result\Model\SuccessMessage.cs" />
|
||||
<Compile Include="Message\Response\LxmZHMDReport\ReportCalRateResp.cs" />
|
||||
<Compile Include="Message\Response\Queue\QueueProcess.cs" />
|
||||
<Compile Include="Message\Response\User\AdminLoginInfo.cs" />
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using MyCode.Project.Domain.Message.Request.KingDee;
|
||||
using MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model;
|
||||
|
||||
namespace MyCode.Project.OutSideService
|
||||
{
|
||||
@ -10,7 +11,7 @@ namespace MyCode.Project.OutSideService
|
||||
/// <param name="formId"></param>
|
||||
/// <param name="billSave"></param>
|
||||
/// <returns></returns>
|
||||
string Save(string formId, BillSave billSave);
|
||||
ResponseStatus Save(string formId, BillSave billSave);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using Kingdee.CDP.WebApi.SDK;
|
||||
using MyCode.Project.Domain.Message.Request.KingDee;
|
||||
using MyCode.Project.Domain.Message.Response.KingDee;
|
||||
using MyCode.Project.Domain.Message.Response.KingDee.K3Result;
|
||||
using MyCode.Project.Domain.Message.Response.KingDee.K3Result.Model;
|
||||
using MyCode.Project.Infrastructure.Common;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
@ -17,7 +18,7 @@ namespace MyCode.Project.OutSideService.Implementation
|
||||
}
|
||||
public static K3CloudApi staClient = null;
|
||||
public static DateTime timeOut = DateTime.Now;
|
||||
|
||||
|
||||
|
||||
#region
|
||||
/// <summary>
|
||||
@ -77,12 +78,12 @@ namespace MyCode.Project.OutSideService.Implementation
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 保存一个订单对象
|
||||
/// <summary>
|
||||
/// 保存一个订单对象
|
||||
@ -90,40 +91,28 @@ namespace MyCode.Project.OutSideService.Implementation
|
||||
/// <param name="formId"></param>
|
||||
/// <param name="billSave"></param>
|
||||
/// <returns></returns>
|
||||
public string Save(string formId, BillSave billSave)
|
||||
public ResponseStatus Save(string formId, BillSave billSave)
|
||||
{
|
||||
staClient = GetK3CloudClient();
|
||||
var datastr = JsonHelper.ToJson(billSave,false, false, true);
|
||||
var datastr = JsonHelper.ToJson(billSave, false, false, true);
|
||||
LogHelper.Info(datastr);
|
||||
var resultString = staClient.Save(formId, datastr);
|
||||
if (resultString.Contains("ErrorCode"))
|
||||
var result = JsonHelper.ToObject<K3ApiResult>(resultString);
|
||||
if (!result.Result.ResponseStatus.IsSuccess)
|
||||
{
|
||||
LogHelper.Error("金蝶云接口调用失败,请检查");
|
||||
LogHelper.Error(resultString);
|
||||
//throw new Exception("单据在云星空已锁定,请联系采购员");
|
||||
string Message = "";
|
||||
try
|
||||
{
|
||||
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
|
||||
Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string ds = ex.Message;
|
||||
throw new Exception("2云星空接口调用失败,请联系管理员,错误信息:" + resultString);
|
||||
|
||||
}
|
||||
throw new Exception("1云星空接口调用失败,请联系管理员,错误信息:" + Message);
|
||||
string Message = string.Join(",", result.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
|
||||
throw new Exception("云星空接口调用失败,请联系管理员,错误信息:" + Message);
|
||||
}
|
||||
var result = JsonHelper.ToObject<Dictionary<string, Dictionary<string, dynamic>>>(resultString);
|
||||
var data = result["Result"]["ResponseStatus"];
|
||||
return resultString;
|
||||
var data = result.Result.ResponseStatus;
|
||||
return data;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region Delete(删除某个订单)
|
||||
/// <summary>
|
||||
/// 删除某个订单
|
||||
@ -133,34 +122,34 @@ namespace MyCode.Project.OutSideService.Implementation
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
|
||||
public dynamic Delete(string formId, BillDelete billdelete)
|
||||
{
|
||||
staClient = GetK3CloudClient();
|
||||
var datastr = JsonHelper.ToJson(billdelete);
|
||||
LogHelper.Info(datastr);
|
||||
var resultString = staClient.Delete(formId, datastr);
|
||||
if (resultString.Contains("ErrorCode"))
|
||||
{
|
||||
LogHelper.Error("金蝶云接口调用失败,请检查");
|
||||
LogHelper.Error(resultString);
|
||||
string Message = "";
|
||||
try
|
||||
{
|
||||
ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
|
||||
Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string ds = ex.Message;
|
||||
throw new Exception("2云星空接口调用失败,请联系管理员,错误信息:" + resultString);
|
||||
//public dynamic Delete(string formId, BillDelete billdelete)
|
||||
//{
|
||||
// staClient = GetK3CloudClient();
|
||||
// var datastr = JsonHelper.ToJson(billdelete);
|
||||
// LogHelper.Info(datastr);
|
||||
// var resultString = staClient.Delete(formId, datastr);
|
||||
// if (resultString.Contains("ErrorCode"))
|
||||
// {
|
||||
// LogHelper.Error("金蝶云接口调用失败,请检查");
|
||||
// LogHelper.Error(resultString);
|
||||
// string Message = "";
|
||||
// try
|
||||
// {
|
||||
// ErrorResponse errorResponse = JsonHelper.ToObject<ErrorResponse>(resultString);
|
||||
// Message = string.Join(",", errorResponse.Result.ResponseStatus.Errors.Select(t => t.Message).ToList());
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// string ds = ex.Message;
|
||||
// throw new Exception("2云星空接口调用失败,请联系管理员,错误信息:" + resultString);
|
||||
|
||||
}
|
||||
throw new Exception("1云星空接口调用失败,请联系管理员,错误信息:" + Message);
|
||||
}
|
||||
var result = JsonHelper.ToObject<dynamic>(resultString);
|
||||
var data = result["Result"]["ResponseStatus"]["SuccessEntitys"];
|
||||
return JsonHelper.ToJson(data);
|
||||
}
|
||||
// }
|
||||
// throw new Exception("1云星空接口调用失败,请联系管理员,错误信息:" + Message);
|
||||
// }
|
||||
// var result = JsonHelper.ToObject<dynamic>(resultString);
|
||||
// var data = result["Result"]["ResponseStatus"]["SuccessEntitys"];
|
||||
// return JsonHelper.ToJson(data);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@ -157,34 +157,47 @@ namespace MyCode.Project.Services.Implementation
|
||||
|
||||
public void PushOrderToKingDee(string id)
|
||||
{
|
||||
var orderSHeet = _pushKingDeeOrderRepository.Queryable().Where(t => id == t.Id.ToString()).First();
|
||||
if (orderSHeet.Status != 0)
|
||||
var orderHead = _pushKingDeeOrderRepository.Queryable().Where(t => id == t.Id.ToString()).First();
|
||||
if (orderHead.Status != 0)
|
||||
{
|
||||
throw new BaseException("单据已经下推.");
|
||||
}
|
||||
var one = _yTKJTShopParameterRepository
|
||||
|
||||
var param = _yTKJTShopParameterRepository
|
||||
.Queryable()
|
||||
//.Where(t => t.FSHOPCODE == orderSHeet.ShopCode)
|
||||
.Where(t => t.FSHOPCODE == "bybo")
|
||||
.Where(t => t.FSHOPCODE == orderHead.ShopCode)
|
||||
.First();
|
||||
if (one is null)
|
||||
if (param is null)
|
||||
{
|
||||
throw new BaseException($"门店编号:{orderSHeet.ShopCode},门店名称:{orderSHeet.ShopName},没有找到对应的门店参数 ");
|
||||
throw new BaseException($"门店编号:{orderHead.ShopCode},门店名称:{orderHead.ShopName},没有找到对应的门店参数 ");
|
||||
}
|
||||
// 如果这个配置都没有勾选则直接报错
|
||||
if (param.FSYNCHRONIZEKINGDEE == "0" && param.FSYNCHRONIZEWMS == "0")
|
||||
{
|
||||
throw new BaseException($"门店编号:{orderHead.ShopCode},门店名称:{orderHead.ShopName},参数配置错误,请联系管理员检查 ");
|
||||
}
|
||||
// TODO 如果是False则同步到云星空销售订单
|
||||
if (one.FSYNCHRONIZEWMS == "1")
|
||||
//if (param.FSYNCHRONIZEWMS == "1")
|
||||
if (param.FSYNCHRONIZEKINGDEE == "1")
|
||||
{
|
||||
PushKingdeeSaleOrder(orderSHeet);
|
||||
var response = PushKingdeeSaleOrder(orderHead, param);
|
||||
// 如果保存成功,需要更新源单数据
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
orderHead.Status = 2;
|
||||
_pushKingDeeOrderRepository.Update(orderHead);
|
||||
}
|
||||
}
|
||||
// 如果为True则同步到WMS
|
||||
else
|
||||
else if (param.FSYNCHRONIZEWMS == "1")
|
||||
{
|
||||
//wms
|
||||
PushWMSSaleOrder(orderSHeet);
|
||||
PushWMSSaleOrder(orderHead, param);
|
||||
}
|
||||
}
|
||||
|
||||
private string PushWMSSaleOrder(PushKingDeeOrder pushKingdeeOrder)
|
||||
|
||||
private string PushWMSSaleOrder(PushKingDeeOrder pushKingdeeOrder, YTKJTShopParameter param)
|
||||
{
|
||||
var itemList = _pushKingDeeOrderItemRepository
|
||||
.Queryable()
|
||||
@ -195,13 +208,13 @@ namespace MyCode.Project.Services.Implementation
|
||||
// 赋值
|
||||
order.CreateTime = pushKingdeeOrder.CreateTime?.ToString("yyyy/MM/dd");
|
||||
order.OrderNo = pushKingdeeOrder.Id.ToString();
|
||||
order.CompanyId = string.Empty; // 公司Id
|
||||
order.OrderType = pushKingdeeOrder.TradeType == 8 ? "8" : "4"; // 订单类型
|
||||
order.CustomerId = string.Empty; // 货主ID
|
||||
order.CompanyId = param.FCOMPANYID; // 公司Id
|
||||
order.OrderType = pushKingdeeOrder.TradeType == 8 ? "7" : "4"; // 订单类型
|
||||
order.CustomerId = param.FCANGKUHUOZHU; // 货主ID
|
||||
order.WarehouseId = pushKingdeeOrder?.WarehouseId;
|
||||
order.OrderTime = pushKingdeeOrder.ConsignTime?.ToString("yyyy/MM/dd");
|
||||
order.Channel = string.Empty; // 下发系统
|
||||
order.ItemType = string.Empty; // 单据类型
|
||||
order.Channel = "K3Cloud"; // 下发系统
|
||||
order.ItemType = pushKingdeeOrder.TradeType == 8 ? "退货订单" : "标准销售订单"; // 单据类型
|
||||
order.TotalQty = itemList.Sum(n => n.SellCount);
|
||||
order.TotalMount = itemList.Sum(n => n.SellTotal);
|
||||
order.CreateTime = pushKingdeeOrder.CreateTime?.ToString("yyyy/MM/dd");
|
||||
@ -220,7 +233,7 @@ namespace MyCode.Project.Services.Implementation
|
||||
ItemId = n.GoodsId, // 商品
|
||||
}).ToArray();
|
||||
|
||||
var uri = "";
|
||||
var uri = "http://172.16.42.45:9000";
|
||||
|
||||
var requestString = JsonHelper.ToJson(order, false, false, true);
|
||||
var client = new RestClient($"{uri}/sale/order/return");
|
||||
@ -237,18 +250,27 @@ namespace MyCode.Project.Services.Implementation
|
||||
return resultString;
|
||||
}
|
||||
|
||||
private string PushKingdeeSaleOrder(PushKingDeeOrder pushKingdeeOrder)
|
||||
/// <summary>
|
||||
/// 推送到金蝶云星空
|
||||
/// </summary>
|
||||
/// <param name="pushKingdeeOrder">源单信息</param>
|
||||
/// <param name="param">门店配置</param>
|
||||
/// <returns></returns>
|
||||
private Domain.Message.Response.KingDee.K3Result.Model.ResponseStatus PushKingdeeSaleOrder(PushKingDeeOrder pushKingdeeOrder, YTKJTShopParameter param)
|
||||
{
|
||||
var itemList = _pushKingDeeOrderItemRepository.Queryable().Where(t => pushKingdeeOrder.Id == t.PushKingDeeOrderId).ToList();
|
||||
// 遍历单体,构造单据体实体
|
||||
var entryList = itemList.Select(n => new FSaleOrderEntryItem()
|
||||
{
|
||||
Fcode = n.Barcode, // 条码带出物料 、物料带出税额
|
||||
//Fcode = "2120101128415", // 条码带出物料 、物料带出税额
|
||||
FEntryTaxRate = param.FTAXRATE,
|
||||
FQty = n.SellCount, // 销售数量
|
||||
FTaxPrice = Math.Round(n.DivideSellTotal / n.SellCount, 10), // 含税单价等于 金额/总数
|
||||
|
||||
FSOStockId = new FSOStockId() // 仓库必填
|
||||
{
|
||||
FNUMBER = pushKingdeeOrder.WarehouseCode
|
||||
FNUMBER = param.FWAREHOUSECODE
|
||||
},
|
||||
|
||||
}).ToList();
|
||||
@ -261,19 +283,20 @@ namespace MyCode.Project.Services.Implementation
|
||||
// 1:零售业务7:售后发货;8:售后退货
|
||||
FNUMBER = pushKingdeeOrder.TradeType == 8 ? "XSDD05_SYS" : "XSDD01_SYS"
|
||||
},
|
||||
FOrdertype = pushKingdeeOrder.TradeType == 8 ? "8" : "4",
|
||||
FOrdertype = pushKingdeeOrder.TradeType == 8 ? "7" : "4",
|
||||
FDate = pushKingdeeOrder.ConsignTime?.ToString("yyyy/MM/dd"),
|
||||
FSaleOrgId = new FSaleOrgId()
|
||||
{
|
||||
FNumber = "" // 固定组织
|
||||
FOrgId = param.FSaleOrgId.ToString() // 销售组织
|
||||
},
|
||||
FCustId = new FCustId()
|
||||
FCustId = new FCustomerId()
|
||||
{
|
||||
FNumber = "", // 客户?
|
||||
FCustId = param.FSALESCUSTOMERS.ToString(), // 客户?
|
||||
},
|
||||
FSalerId = new FSalerId()
|
||||
{
|
||||
FNumber = "", // 销售员
|
||||
FId = param.FSALER, // 销售员
|
||||
//FNumber = "思迅销售员_GW000002_1", // 销售员
|
||||
},
|
||||
Foutlets = new Foutlets()
|
||||
{
|
||||
@ -291,9 +314,9 @@ namespace MyCode.Project.Services.Implementation
|
||||
};
|
||||
SaleOrderModel fSaleOrderEntry = new SaleOrderModel();
|
||||
|
||||
var resultString = _kingDeeService.Save("SAL_SaleOrder", billSave);
|
||||
LogHelper.Info(resultString);
|
||||
return resultString;
|
||||
var responseStatus = _kingDeeService.Save("SAL_SaleOrder", billSave);
|
||||
//LogHelper.Info();
|
||||
return responseStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user