新增销售订单保存接口,销售退货通知单保存接口,销售发货通知单保存接口
已添加2个文件
已修改10个文件
203 ■■■■ 文件已修改
MES.Service/Dto/webApi/PLM/RelatedObject.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Dto/webApi/PLM/StdDocument.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesRohInManager.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/PLM/PLMManager.cs 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/WomcaaManager.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.exe 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Dto/webApi/PLM/RelatedObject.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MES.Service.Dto.webApi.PLM;
public class RelatedObject
{
    //实体主键
    public long? FID { get; set; }
    //物料编码
    public string? FRE_FCode { get; set; }
    //相关对象
    public long? FRelatedObject { get; set; }
}
MES.Service/Dto/webApi/PLM/StdDocument.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MES.Service.Dto.webApi.PLM;
public class StdDocument
{
    //实体主键
    public long? FID { get; set; }
    //编码
    public string? FCode { get; set; }
    //名称
    public string? FName { get; set; }
    //物理文件名
    public string? FPhysicalFileName { get; set; }
    //物理文件
    public string? FFileId { get; set; }
    //关联对象 è½¬çš„ pdf
    public string? FRelevantObject { get; set; }
}
MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MES.Service/service/BasicData/MesRohInManager.cs
@@ -37,50 +37,6 @@
        }) > 0;
    }
    // æ’入数据的方法
    private bool InsertData(SqlSugarScope db, MesRohIn mesRohIn,
        List<MesRohInData> mesRohInDatas, string FBILLTYPE)
    {
        switch (FBILLTYPE)
        {
            case "A":
            {
                var decimals = mesRohInDatas.Select(s => s.Id).ToArray();
                if (mesRohIn.Id != null) base.DeleteById(mesRohIn.Id);
                if (decimals.Length > 0)
                    db.Deleteable<MesRohInData>().In(decimals).ExecuteCommand();
                var insert = base.Insert(mesRohIn);
                var insertRange =
                    rohInDataManager.InsertRange(mesRohInDatas);
                if (insert && insertRange) return true;
                throw new NotImplementedException("插入失败");
            }
            case "B":
            {
                var decimals = mesRohInDatas.Select(s => s.Id).ToArray();
                if (base.DeleteById(mesRohIn.Id) && db
                        .Deleteable<MesRohInData>().In(decimals)
                        .ExecuteCommand() > 0)
                {
                    var insert = base.Insert(mesRohIn);
                    var insertRange =
                        rohInDataManager.InsertRange(mesRohInDatas);
                    if (insert && insertRange) return true;
                    throw new NotImplementedException("插入失败");
                }
                break;
            }
        }
        throw new NotImplementedException("采购订单类型错误");
    }
    // æ›´æ–°æ•°æ®çš„æ–¹æ³•
    private bool UpdateData(SqlSugarScope db, MesRohIn mesRohIn,
        List<MesRohInData> mesRohInDatas)
MES.Service/service/PLM/PLMManager.cs
@@ -7,9 +7,19 @@
public class PLMManager
{
    public List<BaseObject> RetrieveDrawings(string ItemNo)
    public List<StdDocument> RetrieveDrawings(string ItemNo)
    {
        return GetPlmCfgBase(ItemNo);
        List<BaseObject> baseObjects = GetPlmCfgBase(ItemNo);
        List<RelatedObject> relatedObjects = GetPlmCfgRelatedObject(baseObjects[0].FID);
        // æ£€æŸ¥è¿”回结果是否为空
        if (relatedObjects == null || !relatedObjects.Any())
        {
            throw new NotImplementedException("返回结果为空");
        }
        List<StdDocument> stdDocuments = GetPlmStdDocument(relatedObjects);
        return stdDocuments;
    }
@@ -29,7 +39,7 @@
        //string fieldKeys = "FCode,FFileId,FRelevantObject";
        //string FilterString = "FID='-2146304'";
        string fieldKeys = "FID,FCode,FName";
        string FilterString = "FCode='5.03.14.1414'";
        string FilterString = string.Format(@"FCode='{0}'", ItemNo);
        string OrderString = "";
        int TopRowCount = 0;
        int StartRow = 0;
@@ -59,4 +69,103 @@
            return entity;
        }).ToList();
    }
    public List<RelatedObject> GetPlmCfgRelatedObject(long? FRelatedObject)
    {
        //注意 1:此处不再使用参数形式传入用户名及密码等敏感信息,改为在登录配置文件中设置。
        //注意 2:必须先配置第三方系统登录授权信息后,再进行业务操作,详情参考各语言版本SDK介绍中的登录配置文件说明。
        //读取配置,初始化SDK
        K3CloudApi client = new K3CloudApi();
        //用于记录结果
        StringBuilder Info = new StringBuilder();
        //业务对象标识
        //string formId = "PLM_STD_DOCUMENT";
        string formId = "PLM_CFG_RELATEDOBJECT";
        DateTime dt = DateTime.Now;
        //查询字段集合,即返回哪些数据,不能为空,根据不同业务单据填写不同的字段名,以下仅为示例
        //string fieldKeys = "FCode,FFileId,FRelevantObject";
        //string FilterString = "FID='-2146304'";
        string fieldKeys = "FID,FRE_FCode,FRelatedObject";
        string FilterString = string.Format(@"FRelatedObject='{0}'", FRelatedObject);
        string OrderString = "";
        int TopRowCount = 0;
        int StartRow = 0;
        int Limit = 0;
        var param = new QueryParam()
        {
            FormId = formId,
            FieldKeys = fieldKeys,
            FilterString = FilterString,
            OrderString = OrderString,
            TopRowCount = TopRowCount,
            StartRow = StartRow,
            Limit = Limit
        };
        //调用接口
        var result = client.ExecuteBillQuery(param.ToJson());
        return result.Select(s =>
        {
            var entity = new RelatedObject
            {
                FID = (long)s[0],
                FRE_FCode = (string)s[1],
                FRelatedObject = (long)s[2],
            };
            return entity;
        }).ToList();
    }
    public List<StdDocument> GetPlmStdDocument(List<RelatedObject> relatedObjects)
    {
        //注意 1:此处不再使用参数形式传入用户名及密码等敏感信息,改为在登录配置文件中设置。
        //注意 2:必须先配置第三方系统登录授权信息后,再进行业务操作,详情参考各语言版本SDK介绍中的登录配置文件说明。
        //读取配置,初始化SDK
        K3CloudApi client = new K3CloudApi();
        //用于记录结果
        StringBuilder Info = new StringBuilder();
        //业务对象标识
        string formId = "PLM_STD_DOCUMENT";
        DateTime dt = DateTime.Now;
        //查询字段集合,即返回哪些数据,不能为空,根据不同业务单据填写不同的字段名,以下仅为示例
        string fieldKeys = "FID,FCode,FName,FPhysicalFileName,FFileId,FRelevantObject";
        // æå– FID å€¼
        var fidList = relatedObjects.Select(obj => obj.FID.ToString()).ToList();
        // å°† FID å€¼ç”¨é€—号分隔,并包裹在单引号中
        string fids = string.Join(",", fidList.Select(fid => $"'{fid}'"));
        // æž„建 FilterString
        string FilterString = $"FID in ({fids})";
        string OrderString = "";
        int TopRowCount = 0;
        int StartRow = 0;
        int Limit = 0;
        var param = new QueryParam()
        {
            FormId = formId,
            FieldKeys = fieldKeys,
            FilterString = FilterString,
            OrderString = OrderString,
            TopRowCount = TopRowCount,
            StartRow = StartRow,
            Limit = Limit
        };
        //调用接口
        var result = client.ExecuteBillQuery(param.ToJson());
        return result.Select(s =>
        {
            var entity = new StdDocument
            {
                FID = (long)s[0],
                FCode = (string)s[1],
                FName = (string)s[2],
                FPhysicalFileName = (string)s[3],
                FFileId = (string)s[4],
                FRelevantObject = (string)s[5],
            };
            return entity;
        }).ToList();
    }
}
MES.Service/service/WomcaaManager.cs
@@ -1,9 +1,7 @@
using Dm;
using MES.Service.DB;
using MES.Service.DB;
using MES.Service.Dto.webApi;
using MES.Service.Modes;
using SqlSugar;
using System.Net.NetworkInformation;
namespace MES.Service.service;
MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ