schangxiang@126.com
2025-09-01 b08bfd050511ed27e0bde0bd4095eed1fdb5ddeb
暂时提交
已添加8个文件
已修改16个文件
614 ■■■■■ 文件已修改
wcs/yunneiWCS/CommonDll/Yitter.IdGenerator.Net45.dll 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/App - 本地.config 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/App -生产.config 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/App.config 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/ExtendFunction/MyExtend.cs 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/ORM/Wms_outInStockRecord_Details_V2_Mes.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/ORM/Wms_outInStockRecord_V2_Mes.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Program.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Properties/Resources.Designer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Properties/Settings.Designer.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.EmptyBackResponse.datasource 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.GGoutStockResponse.datasource 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.GToutStockResponse.datasource 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.MsgData.datasource 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.OnLowdPartCallResponse.datasource 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.safetySignalResponse.datasource 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/PushMesHandler.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/dto/ApiResponse.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/dto/InboundStockInfoToMes.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/dto/MesRequest.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/wcf/yunneiWcf.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wcs/yunneiWCS/CommonDll/Yitter.IdGenerator.Net45.dll
Binary files differ
wcs/yunneiWCS/yunneiWCS/App - ±¾µØ.config
@@ -10,6 +10,8 @@
  <appSettings>
    <!--是否是虚拟仿真模式,true:是,false:否。生产环境要配置为false ã€EditBy shaocx,2022-01-27】-->
    <add key="IsVirtualMode" value="true"/>
    <!--MES地址 ã€EditBy shaocx,2025-08-27】-->
    <add key="MesUrl" value="http://192.168.6.47:8000/api/Save/"/>
  </appSettings>
  
  <system.serviceModel>
wcs/yunneiWCS/yunneiWCS/App -Éú²ú.config
@@ -11,6 +11,8 @@
  <appSettings>
    <!--是否是虚拟仿真模式,true:是,false:否。生产环境要配置为false ã€EditBy shaocx,2022-01-27】-->
    <add key="IsVirtualMode" value="false"/>
    <!--MES地址 ã€EditBy shaocx,2025-08-27】-->
    <add key="MesUrl" value="http://192.168.6.47:8000/api/Save/"/>
  </appSettings>
  <system.serviceModel>
        
wcs/yunneiWCS/yunneiWCS/App.config
@@ -1,33 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
  </startup>
  <connectionStrings>
    <add name="dbmodel" connectionString="data source=.;initial catalog=LA20025;persist security info=True;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
    <add name="dbmodel" connectionString="data source=.;initial catalog=LA20025;persist security info=True;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <appSettings>
    <!--是否是虚拟仿真模式,true:是,false:否。生产环境要配置为false ã€EditBy shaocx,2022-01-27】-->
    <add key="IsVirtualMode" value="true"/>
    <!--MES地址 ã€EditBy shaocx,2025-08-27】-->
    <add key="MesUrl" value="http://192.168.6.47:8000/api/Save/"/>
  </appSettings>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="AutoServiceSoap" />
        <binding name="AutoServiceSoap"/>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8082/AutoService.asmx" binding="basicHttpBinding" bindingConfiguration="AutoServiceSoap" contract="tianyong.AutoServiceSoap" name="AutoServiceSoap" />
      <endpoint address="http://localhost:8082/AutoService.asmx" binding="basicHttpBinding" bindingConfiguration="AutoServiceSoap" contract="tianyong.AutoServiceSoap" name="AutoServiceSoap"/>
    </client>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
@@ -35,16 +37,16 @@
      <service name="yunneiWCS.wcf.yunneiWcf">
        <endpoint address="" binding="basicHttpBinding" contract="yunneiWCS.wcf.IyunneiWcf">
          <identity>
            <dns value="localhost" />
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8733/Design_Time_Addresses/yunneiWCS.wcf/yunneiWcf/" />
            <add baseAddress="http://localhost:8733/Design_Time_Addresses/yunneiWCS.wcf/yunneiWcf/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>
</configuration>
</configuration>
wcs/yunneiWCS/yunneiWCS/DataAccess/OutInStockRecord_V2_MesHandler.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,177 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WZ.Useful.Commons.Collections;
using yunneiWCS.EnumDefine;
using yunneiWCS.ExtendFunction;
using yunneiWCS.ORM;
namespace yunneiWCS.DataAccess
{
    /// <summary>
    /// å‡ºå…¥åº“记录(为推送MES)
    /// </summary>
    public class OutInStockRecord_V2_MesHandler
    {
        /// <summary>
        /// äººå·¥åˆ é™¤çš„场景
        /// </summary>
        /// <param name="mod"></param>
        /// <param name="_outInFlag"></param>
        /// <param name="sourcePlace"></param>
        /// <param name="toPlace"></param>
        /// <param name="_task"></param>
        /// <param name="remark"></param>
        /// <param name="productStocks"></param>
        /// <param name="currentTaskType"></param>
        public static void AddRecordForPersonDelete(dbmodel mod, OutInFlag _outInFlag, string remark,
          System.Collections.Generic.List<productStockList> productStocks, productStock modfiyStock)
        {
            try
            {
                //var isMaterilStockMove = MyExtend.IsMaterilStockMove(currentTaskType);
                //if (isMaterilStockMove == false)
                //{
                //    return;
                //}
                //if (string.IsNullOrEmpty(modfiyStock.materialCode))
                //{
                //    return;//认为是空拖
                //}
                Wms_outInStockRecord_V2_Mes log = new Wms_outInStockRecord_V2_Mes()
                {
                    ID = Yitter.IdGenerator.YitIdHelper.NextId(),
                    sourcePlace = "",
                    toPlace = "",
                    containerCode = modfiyStock.containerCode,
                    LastModifier = modfiyStock.creator,
                    LastModifyTime = DateTime.Now,
                    outInFlag = (int)_outInFlag,
                    outInFlagName = _outInFlag.ToString(),
                    CreateTime = DateTime.Now,
                    // Creator = _task.creator,
                    Remark = remark,
                    materialCode = productStocks.First().productCode,
                    materialName = productStocks.First().productName,
                    qty = productStocks.Count(),
                    supplier = modfiyStock.supplier,
                    isSendToMes = 0,
                    //version = modfiyStock.version,
                    //taskId = _task.taskId.ToString(),
                    //taskType = (int)_task.taskType,
                    //taskTypeName = _task.taskTypeName,
                    //taskName = _task.taskName,
                };
                mod.Wms_outInStockRecord_V2_Mes.Add(log);
                //同时把明细也新增进去
                foreach (var item in productStocks)
                {
                    var d_id = Yitter.IdGenerator.YitIdHelper.NextId();
                    Wms_outInStockRecord_Details_V2_Mes wms_OutInStockRecord_Details_V2_Mes = new Wms_outInStockRecord_Details_V2_Mes()
                    {
                        ID = d_id,
                        mainId = log.ID,
                        productCode = item.productCode,
                        productName = item.productName,
                        serialNumber = item.serialNumber
                    };
                    mod.Wms_outInStockRecord_Details_V2_Mes.Add(wms_OutInStockRecord_Details_V2_Mes);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private static void AddRecord(dbmodel mod, OutInFlag _outInFlag, string sourcePlace, string toPlace, task _task, string remark,
            System.Collections.Generic.List<productStockList> productStocks, taskType currentTaskType)
        {
            try
            {
                //var isMaterilStockMove = MyExtend.IsMaterilStockMove(currentTaskType);
                //if (isMaterilStockMove == false)
                //{
                //    return;
                //}
                if (string.IsNullOrEmpty(_task.materialCode))
                {
                    return;//认为是空拖
                }
                Wms_outInStockRecord_V2_Mes log = new Wms_outInStockRecord_V2_Mes()
                {
                    ID = Yitter.IdGenerator.YitIdHelper.NextId(),
                    sourcePlace = sourcePlace,
                    toPlace = toPlace,
                    containerCode = _task.containerCode,
                    LastModifier = _task.creator,
                    LastModifyTime = DateTime.Now,
                    outInFlag = (int)_outInFlag,
                    outInFlagName = _outInFlag.ToString(),
                    CreateTime = DateTime.Now,
                    Creator = _task.creator,
                    Remark = remark,
                    materialCode = _task.materialCode,
                    materialName = _task.materialName,
                    qty = _task.quantity,
                    supplier = _task.supplier,
                    version = _task.version,
                    taskId = _task.taskId.ToString(),
                    taskType = (int)_task.taskType,
                    taskTypeName = _task.taskTypeName,
                    taskName = _task.taskName,
                    isSendToMes = 0,
                };
                mod.Wms_outInStockRecord_V2_Mes.Add(log);
                //同时把明细也新增进去
                foreach (var item in productStocks)
                {
                    Wms_outInStockRecord_Details_V2_Mes wms_OutInStockRecord_Details_V2_Mes = new Wms_outInStockRecord_Details_V2_Mes()
                    {
                        ID = Yitter.IdGenerator.YitIdHelper.NextId(),
                        mainId = log.ID,
                        productCode = item.productCode,
                        productName = item.productName,
                        serialNumber = item.serialNumber
                    };
                    mod.Wms_outInStockRecord_Details_V2_Mes.Add(wms_OutInStockRecord_Details_V2_Mes);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static void AddRecord(dbmodel mod, OutInFlag _outInFlag, string sourcePlace, string toPlace, task _task, string remark,
         taskType currentTaskType)
        {
            var stock = mod.productStock.Where(a => a.containerCode == _task.containerCode).FirstOrDefault();
            if (stock != null)
            {
                System.Collections.Generic.List<productStockList> productStocks = mod.productStockList.Where(a => a.stockId == stock.stockId).ToList();
                AddRecord(mod, _outInFlag, sourcePlace, toPlace, _task, remark,
                productStocks, currentTaskType);
            }
        }
    }
}
wcs/yunneiWCS/yunneiWCS/ExtendFunction/MyExtend.cs
@@ -19,6 +19,26 @@
    /// </summary>
    public class MyExtend
    {
        /// <summary>
        /// æ˜¯å¦æ˜¯ ç‰©æ–™åº“存的转移
        /// </summary>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public static bool IsMaterilStockMove(taskType currentTaskType)
        {
            if (currentTaskType == taskType.空库位
                || currentTaskType == taskType.呼叫空托
                 || currentTaskType == taskType.空托回库
                  || currentTaskType == taskType.空托下线入库
                   || currentTaskType == taskType.空托手动入库
                    || currentTaskType == taskType.空托人工出库
                     || currentTaskType == taskType.旁路工位缸体空托回库
                  )
            {
                return false;
            }
            return true;
        }
        public static string HandlerNoIssuedTaskFor旁路工位缸体空托或余料回库(dbmodel mod, string convPlace, task item, string[] agvSendStatus)
        {
@@ -476,6 +496,7 @@
                                throw new Exception("入库任务,目标站点找不到,toPlace:" + finishTask.toPlace);
                            }
                            OutInStockRecordHandler.AddOutInStockRecord(mod, OutInFlag.入库, finishTask.sourcePlace, finishTask.toPlace, finishTask, "入库类型的任务");
                            OutInStockRecord_V2_MesHandler.AddRecord(mod, OutInFlag.入库, finishTask.sourcePlace, finishTask.toPlace, finishTask, "入库类型的任务", currentTaskType);//堆垛机任务完成后的入库
                            #endregion
                            break;
                        case taskType.缸体下线:
@@ -566,6 +587,7 @@
                                #endregion
                                OutInStockRecordHandler.AddOutInStockRecord(mod, OutInFlag.入库, finishTask.sourcePlace, finishTask.toPlace, finishTask, "入库类型的任务");
                                OutInStockRecord_V2_MesHandler.AddRecord(mod, OutInFlag.入库, finishTask.sourcePlace, finishTask.toPlace, finishTask, "入库类型的任务", currentTaskType);//堆垛机任务完成后的入库
                            }
                            else
                            {
@@ -592,7 +614,9 @@
                            finishTask.remark = "完成";
                            finishTask.finishTime = DateTime.Now;
                            var result = deleteProduct(false, "sys", mod, finishTask.sourcePlace, finishTask, ref errMsg);//删除库存
                            var result = deleteProduct(false, "sys", mod, finishTask.sourcePlace, finishTask, ref errMsg, "堆垛机任务完成-手动出库");//删除库存
                            if (result == false) throw new Exception(errMsg);
                            OutInStockRecordHandler.AddOutInStockRecord(mod, OutInFlag.出库, finishTask.sourcePlace, finishTask.toPlace, finishTask, "出库类型的任务");
@@ -647,6 +671,7 @@
                                errMsg = "缸盖上线/缸体上线任务,中转位为空,暂不处理";
                                return false;
                            }
                            OutInStockRecord_V2_MesHandler.AddRecord(mod, OutInFlag.出库, finishTask.sourcePlace, finishTask.toPlace, finishTask, "出库类型的任务", currentTaskType);//堆垛机任务完成后的出库
                            break;
                        default://其他,出库确认
                            //finishTask.taskStatus = 3;
@@ -769,6 +794,7 @@
            //设置目标位有货
            PositionHandler.Free(true, to_positionStation, "处理 ç¼¸ä½“上线到旁路工位的处理 çš„任务", SysGloble.WCSNAME, item);
            OutInStockRecord_V2_MesHandler.AddRecord(mod, OutInFlag.出库, item.sourcePlace, item.toPlace, item, "出库类型的任务", _taskType);//堆垛机任务完成后的出库
            OutInStockRecordHandler.AddOutInStockRecord(mod, OutInFlag.出库, item.sourcePlace, item.toPlace, item, "出库类型的任务");
            //通知天永,给天永发信号
@@ -948,7 +974,7 @@
        /// <param name="positionName"></param>
        /// <param name="res"></param>
        /// <returns></returns>
        public static bool deleteProduct(bool isPerson, string user, dbmodel mod, string positionName, task _task, ref string res)
        public static bool deleteProduct(bool isPerson, string user, dbmodel mod, string positionName, task _task, ref string res, string preLog)
        {
            res = "";
            string[] stations = { "GTU1", "GTU2", "GTU3", "GGU1", "GGU2", "GGU3" };
@@ -979,6 +1005,7 @@
                        List<productStockList> delteStockDatalist = mod.productStockList.Where(x => x.stockId == delteData.positionId).ToList();
                        if (delteStockDatalist.Count > 0)
                        {
                            OutInStockRecord_V2_MesHandler.AddRecordForPersonDelete(mod, OutInFlag.出库, "删除库存:" + preLog, delteStockDatalist, delteStockData.First());//堆垛机任务完成后的出库
                            foreach (var itemList in delteStockDatalist)
                            {
                                mod.productStockList.Remove(itemList);
@@ -1039,27 +1066,27 @@
                    //var queryTask6 = (int)taskType.余料回库;
                    var queryStats = (int)taskStatus.完成;
                    var allQty = mod.task.Where(x =>
                    var allQty = mod.task.Where(x =>
                        //(
                            //x.taskType == queryTask1
                            //|| x.taskType == queryTask2
                            //|| x.taskType == queryTask3
                            //|| x.taskType == queryTask4
                            //|| x.taskType == queryTask5
                            //|| x.taskType == queryTask6
                        //x.taskType == queryTask1
                        //|| x.taskType == queryTask2
                        //|| x.taskType == queryTask3
                        //|| x.taskType == queryTask4
                        //|| x.taskType == queryTask5
                        //|| x.taskType == queryTask6
                        //) &&
                        x.taskStatus == queryStats).Count();
                    var nowDateTimeStr_1 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
                    var nowDateTimeStr_2 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59");
                    var todayQty = mod.task.Where(x =>
                        //(
                           //x.taskType == queryTask1
                           //|| x.taskType == queryTask2
                           //|| x.taskType == queryTask3
                           //|| x.taskType == queryTask4
                           //|| x.taskType == queryTask5
                           //|| x.taskType == queryTask6
                    var todayQty = mod.task.Where(x =>
                       //(
                       //x.taskType == queryTask1
                       //|| x.taskType == queryTask2
                       //|| x.taskType == queryTask3
                       //|| x.taskType == queryTask4
                       //|| x.taskType == queryTask5
                       //|| x.taskType == queryTask6
                       //) &&
                       x.taskStatus == queryStats
                       && x.finishTime != null && x.finishTime >= nowDateTimeStr_1 && x.finishTime <= nowDateTimeStr_2
@@ -1067,7 +1094,7 @@
                    var nowDateTimeStr_3 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
                    var nowDateTimeStr_4 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM") + "-30 23:59:59");
                    var monthQty = mod.task.Where(x =>
                    var monthQty = mod.task.Where(x =>
                      //  (
                      //     x.taskType == queryTask1
                      //    || x.taskType == queryTask2
wcs/yunneiWCS/yunneiWCS/ORM/Wms_outInStockRecord_Details_V2_Mes.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
namespace yunneiWCS.ORM
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;
    [Table("Wms_outInStockRecord_Details_V2_Mes")]
    public partial class Wms_outInStockRecord_Details_V2_Mes
    {
        public long ID { get; set; }
        public long? mainId { get; set; }
        [StringLength(50)]
        public string productCode { get; set; }
        [StringLength(50)]
        public string productName { get; set; }
        [StringLength(50)]
        public string serialNumber { get; set; }
    }
}
wcs/yunneiWCS/yunneiWCS/ORM/Wms_outInStockRecord_V2_Mes.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
namespace yunneiWCS.ORM
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;
    public partial class Wms_outInStockRecord_V2_Mes
    {
        public long ID { get; set; }
        public int? outInFlag { get; set; }
        [StringLength(100)]
        public string outInFlagName { get; set; }
        [StringLength(128)]
        public string taskId { get; set; }
        public int? taskType { get; set; }
        [StringLength(128)]
        public string taskTypeName { get; set; }
        [StringLength(128)]
        public string taskName { get; set; }
        [StringLength(128)]
        public string sourcePlace { get; set; }
        [StringLength(128)]
        public string toPlace { get; set; }
        [StringLength(100)]
        public string materialCode { get; set; }
        [StringLength(100)]
        public string materialName { get; set; }
        [StringLength(100)]
        public string version { get; set; }
        [StringLength(100)]
        public string supplier { get; set; }
        [StringLength(100)]
        public string containerCode { get; set; }
        public int? qty { get; set; }
        public int? isSendToMes { get; set; }
        public DateTime? SendToMesTime { get; set; }
        [StringLength(128)]
        public string MesRet { get; set; }
        [StringLength(128)]
        public string Remark { get; set; }
        [StringLength(128)]
        public string Creator { get; set; }
        public DateTime? CreateTime { get; set; }
        [StringLength(128)]
        public string LastModifier { get; set; }
        public DateTime? LastModifyTime { get; set; }
    }
}
wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs
@@ -39,6 +39,10 @@
        public virtual DbSet<v_outStockList> v_outStockList { get; set; }
        public virtual DbSet<VproductStock> VproductStock { get; set; }
        public virtual DbSet<Wms_outInStockRecord_V2_Mes> Wms_outInStockRecord_V2_Mes { get; set; }
        public virtual DbSet<Wms_outInStockRecord_Details_V2_Mes> Wms_outInStockRecord_Details_V2_Mes { get; set; }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<BasicDataSet>()
wcs/yunneiWCS/yunneiWCS/Program.cs
@@ -16,6 +16,8 @@
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Yitter.IdGenerator.IdGeneratorOptions options = new Yitter.IdGenerator.IdGeneratorOptions(1);
            Yitter.IdGenerator.YitIdHelper.SetIdGenerator(options);
            Application.Run(new Form1());
            //Application.Run(new TestForm());
        }
wcs/yunneiWCS/yunneiWCS/Properties/Resources.Designer.cs
@@ -19,7 +19,7 @@
    // ç±»é€šè¿‡ç±»ä¼¼äºŽ ResGen æˆ– Visual Studio çš„工具自动生成的。
    // è‹¥è¦æ·»åŠ æˆ–ç§»é™¤æˆå‘˜ï¼Œè¯·ç¼–è¾‘ .ResX æ–‡ä»¶ï¼Œç„¶åŽé‡æ–°è¿è¡Œ ResGen
    // (以 /str ä½œä¸ºå‘½ä»¤é€‰é¡¹),或重新生成 VS é¡¹ç›®ã€‚
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {
@@ -47,8 +47,8 @@
        }
        
        /// <summary>
        ///   ä½¿ç”¨æ­¤å¼ºç±»åž‹èµ„源类,为所有资源查找
        ///   é‡å†™å½“前线程的 CurrentUICulture å±žæ€§ã€‚
        ///   é‡å†™å½“前线程的 CurrentUICulture å±žæ€§ï¼Œå¯¹
        ///   ä½¿ç”¨æ­¤å¼ºç±»åž‹èµ„源类的所有资源查找执行重写。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
wcs/yunneiWCS/yunneiWCS/Properties/Settings.Designer.cs
@@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//     æ­¤ä»£ç ç”±å·¥å…·ç”Ÿæˆã€‚
//     è¿è¡Œæ—¶ç‰ˆæœ¬:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//     å¯¹æ­¤æ–‡ä»¶çš„æ›´æ”¹å¯èƒ½ä¼šå¯¼è‡´ä¸æ­£ç¡®çš„行为,并且如果
//     é‡æ–°ç”Ÿæˆä»£ç ï¼Œè¿™äº›æ›´æ”¹å°†ä¼šä¸¢å¤±ã€‚
// </auto-generated>
//------------------------------------------------------------------------------
namespace yunneiWCS.Properties
{
namespace yunneiWCS.Properties {
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
    {
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
        public static Settings Default
        {
            get
            {
        public static Settings Default {
            get {
                return defaultInstance;
            }
        }
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.EmptyBackResponse.datasource
@@ -6,5 +6,5 @@
    cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="EmptyBackResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>yunneiWCS.tianyong.EmptyBackResponse, Service References.tianyong.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
   <TypeInfo>yunneiWCS.tianyong.EmptyBackResponse, Service References.tianyong.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.GGoutStockResponse.datasource
@@ -6,5 +6,5 @@
    cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="GGoutStockResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>yunneiWCS.tianyong.GGoutStockResponse, Service References.tianyong.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
   <TypeInfo>yunneiWCS.tianyong.GGoutStockResponse, Service References.tianyong.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.GToutStockResponse.datasource
@@ -6,5 +6,5 @@
    cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="GToutStockResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>yunneiWCS.tianyong.GToutStockResponse, Service References.tianyong.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
   <TypeInfo>yunneiWCS.tianyong.GToutStockResponse, Service References.tianyong.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.MsgData.datasource
@@ -6,5 +6,5 @@
    cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="MsgData" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>yunneiWCS.tianyong.MsgData, Service References.tianyong.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
   <TypeInfo>yunneiWCS.tianyong.MsgData, Service References.tianyong.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.OnLowdPartCallResponse.datasource
@@ -6,5 +6,5 @@
    cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="OnLowdPartCallResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>yunneiWCS.tianyong.OnLowdPartCallResponse, Service References.tianyong.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
   <TypeInfo>yunneiWCS.tianyong.OnLowdPartCallResponse, Service References.tianyong.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
wcs/yunneiWCS/yunneiWCS/Service References/tianyong/yunneiWCS.tianyong.safetySignalResponse.datasource
@@ -6,5 +6,5 @@
    cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="safetySignalResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>yunneiWCS.tianyong.safetySignalResponse, Service References.tianyong.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
   <TypeInfo>yunneiWCS.tianyong.safetySignalResponse, Service References.tianyong.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/PushMesHandler.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using yunneiWCS.EnumDefine;
using yunneiWCS.SystemInteraction.mes2.dto;
namespace yunneiWCS.mes
{
    /// <summary>
    /// MES推送接口
    /// </summary>
    public class PushMesHandler
    {
        public static string mes_api_url = ConfigHelper.GetConfigString("MesUrl");//修改为配置文件 ã€EditBy shaocx,2022-01-27】
        static HTTPService mes_api = new HTTPService(mes_api_url);//mes基地址
        /// <summary>
        /// ç»™MES推送入库信息
        /// </summary>
        /// <param name="pushData"></param>
        /// <returns></returns>
        public static ApiResponse<object> Mes_InStockSend(List<InboundStockInfoToMes> pushData)
        {
            ApiResponse<object> res = null;
            try
            {
                MesRequest<List<InboundStockInfoToMes>> mesRequest = new MesRequest<List<InboundStockInfoToMes>>();
                mesRequest.data = pushData;
                string paprm = JsonConvert.SerializeObject(mesRequest);
                Guid guid = System.Guid.NewGuid();
                res = JsonConvert.DeserializeObject<ApiResponse<object>>(mes_api.postContentForString("T_WMS_Inbound_Record", paprm, guid));
                WZ.Useful.Commons.LogTextHelper.WriteLine("PushMesHandler", "Mes_InStockSend è¿”回状态码:", res.Code + " è¿”回信息:" + res.Message);
            }
            catch (Exception ex)
            {
                WZ.Useful.Commons.LogTextHelper.WriteLine("PushMesHandler", "Mes_InStockSend ", " å‘送异常:" + JsonConvert.SerializeObject(ex));
                res.Message = "发送异常:" + ex.Message;
            }
            return res;
        }
    }
}
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/dto/ApiResponse.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yunneiWCS.SystemInteraction.mes2.dto
{
    /// <summary>
    /// é€šç”¨æ³›åž‹æŽ¥å£å“åº”模型
    /// </summary>
    /// <typeparam name="T">Data å­—段的类型,可以是任意类型,如 string、int、自定义类等</typeparam>
    public class ApiResponse<T>
    {
        /// <summary>
        /// çŠ¶æ€ç ï¼Œä¾‹å¦‚ 200 è¡¨ç¤ºæˆåŠŸ
        /// </summary>
        public int Code { get; set; }
        /// <summary>
        /// æ˜¯å¦æˆåŠŸï¼Œtrue è¡¨ç¤ºæˆåŠŸï¼Œfalse è¡¨ç¤ºå¤±è´¥
        /// </summary>
        public bool Success { get; set; }
        /// <summary>
        /// è¿”回消息,例如:"成功" æˆ–错误信息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// è¿”回的数据内容,类型为泛型 T
        /// </summary>
        public T Data { get; set; }
    }
}
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/dto/InboundStockInfoToMes.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yunneiWCS.SystemInteraction.mes2.dto
{
    /// <summary>
    /// æŽ¨é€å…¥åº“接口 - è¯·æ±‚参数中的单个入库记录项
    /// </summary>
    public class InboundStockInfoToMes
    {
        /// <summary>
        /// äº§å“åç§°
        /// </summary>
        public string productName { get; set; }
        /// <summary>
        /// æµæ°´å·
        /// </summary>
        public string serialNumber { get; set; }
        /// <summary>
        /// åº“位号
        /// </summary>
        public string positionName { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string materialCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        public string materialName { get; set; }
        /// <summary>
        /// æ—¶é—´
        /// </summary>
        public string createTime { get; set; }
        /// <summary>
        /// æ‰˜ç›˜å·
        /// </summary>
        public string containerCode { get; set; }
        /// <summary>
        /// ä¾›åº”商
        /// </summary>
        public string supplier { get; set; }
        /// <summary>
        /// æœºåž‹
        /// </summary>
        public string version { get; set; }
    }
}
wcs/yunneiWCS/yunneiWCS/SystemInteraction/mes2/dto/MesRequest.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yunneiWCS.SystemInteraction.mes2.dto
{
    /// <summary>
    /// æŽ¨é€ä¿¡æ¯
    /// </summary>
    public class MesRequest<T>
    {
        /// <summary>
        /// æ•°æ®
        /// </summary>
        public T data { get; set; }
        /// <summary>
        /// æŽ¨é€äºº
        /// </summary>
        public string Creator { get; set; } = "wms";                // åˆ›å»ºäººï¼Œå¦‚ "wms"
        /// <summary>
        /// æŽ¨é€æ—¶é—´
        /// </summary>
        public string Timestamp { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");               // æ—¶é—´æˆ³ï¼Œå¦‚ "2022-03-15 06:43:15"
    }
}
wcs/yunneiWCS/yunneiWCS/wcf/yunneiWcf.cs
@@ -2015,12 +2015,13 @@
                            mod.productStockList.Add(newList);
                        }
                        List<productStockList> record_delteList = new List<productStockList>();
                        var realDeleteList = all_serialNumberList.Where(x => !now_serialNumberList.Contains(x)).ToList();
                        foreach (var item in deleteList)
                        {
                            if (realDeleteList.Contains(item.serialNumber))
                            {
                                record_delteList.Add(item);
                                //记录日志 [EditBy shaocx,2022-03-16]
                                StockClearLog _StockClearLog = new StockClearLog()
                                {
@@ -2042,7 +2043,7 @@
                                mod.StockClearLog.Add(_StockClearLog);
                            }
                        }
                        var preLog = "普通删除";
                        if (taskId > 0)
                        {//说明是 å‡ºåº“分拣 ã€Editby shaocx,2022-03-02】
                            var task = mod.task.Where(x => x.taskId == taskId).FirstOrDefault();
@@ -2057,7 +2058,10 @@
                                return msg;
                            }
                            task.taskStatus = (int)taskStatus.分拣完成;
                            preLog = "人工分拣";
                        }
                        OutInStockRecord_V2_MesHandler.AddRecordForPersonDelete(mod, OutInFlag.出库, "人工删除库存:" + preLog, record_delteList, modfiyStock);//堆垛机任务完成后的出库
                        int res = mod.SaveChanges();
                        if (res > 0)
@@ -2828,7 +2832,7 @@
            {
                using (dbmodel mod = new dbmodel())
                {
                    var b_result = MyExtend.deleteProduct(true, user, mod, positionName, null, ref res);
                    var b_result = MyExtend.deleteProduct(true, user, mod, positionName, null, ref res, "人工直接删除库存");
                    if (b_result == false)
                    {
                        return FunctionReturnEntity<bool>.Fail("删除失败:" + res);
wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj
@@ -9,7 +9,7 @@
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>yunneiWCS</RootNamespace>
    <AssemblyName>yunneiWCS</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
    <PublishUrl>发布\</PublishUrl>
@@ -27,6 +27,7 @@
    <IsWebBootstrapper>false</IsWebBootstrapper>
    <UseApplicationTrust>false</UseApplicationTrust>
    <BootstrapperEnabled>true</BootstrapperEnabled>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
@@ -87,11 +88,15 @@
    <Reference Include="WZ.Useful.Commons">
      <HintPath>..\CommonDll\WZ.Useful.Commons.dll</HintPath>
    </Reference>
    <Reference Include="Yitter.IdGenerator.Net45">
      <HintPath>..\CommonDll\Yitter.IdGenerator.Net45.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Common\SysGloble.cs" />
    <Compile Include="DataAccess\BasicDataSetHandler.cs" />
    <Compile Include="DataAccess\ClearDataHandler.cs" />
    <Compile Include="DataAccess\OutInStockRecord_V2_MesHandler.cs" />
    <Compile Include="DataAccess\PositionHandler.cs" />
    <Compile Include="DataAccess\OutInStockRecordHandler.cs" />
    <Compile Include="DataAccess\TianYongLogHandler.cs" />
@@ -109,6 +114,8 @@
    <Compile Include="ORM\BasicDataSet.cs" />
    <Compile Include="ORM\dbmodel.cs" />
    <Compile Include="ORM\inStockOrder.cs" />
    <Compile Include="ORM\Wms_outInStockRecord_V2_Mes.cs" />
    <Compile Include="ORM\Wms_outInStockRecord_Details_V2_Mes.cs" />
    <Compile Include="ORM\inStockOrderList.cs" />
    <Compile Include="ORM\material.cs" />
    <Compile Include="ORM\module.cs" />
@@ -139,6 +146,10 @@
    <Compile Include="PLC\Trans\convDB.cs" />
    <Compile Include="PLC\Trans\convEntity.cs" />
    <Compile Include="EnumDefine\Device\TransEnum.cs" />
    <Compile Include="SystemInteraction\mes2\dto\ApiResponse.cs" />
    <Compile Include="SystemInteraction\mes2\dto\MesRequest.cs" />
    <Compile Include="SystemInteraction\mes2\dto\InboundStockInfoToMes.cs" />
    <Compile Include="SystemInteraction\mes2\PushMesHandler.cs" />
    <Compile Include="SystemInteraction\tianyong\TianYongSystem.cs" />
    <Compile Include="TestForm.cs">
      <SubType>Form</SubType>