分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-16 f0e2d9d2c7c41b311217bdb2c4d114ff53f6a146
优化空托逻辑
已修改22个文件
已添加1个文件
1113 ■■■■■ 文件已修改
代码管理/PCS/WCS_Client/config/buttons.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs 264 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs 108 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/新文件夹/GetLocation.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs 242 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Client/config/buttons.js
@@ -89,6 +89,15 @@
    onClick: function () {
        // this.FinishWorkOrder();
    }
}, {
    name: "出库外协",
    icon: 'el-icon-check',
    type: 'danger',
    plain: true,
    value: 'OutsorcingBtn',
    onClick: function () {
        // this.FinishWorkOrder();
    }
}
    // , {
    //     name: "数据结构",
´úÂë¹ÜÀí/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js
@@ -40,6 +40,37 @@
        //     x.icon= 'el-icon-check'
        //   }
        // });
        let OutsorcingBtn = this.buttons.find(r => r.name == "出库外协");
        if(null!=OutsorcingBtn){
          OutsorcingBtn.onClick = function (){
            let rows = this.$refs.table.getSelected();
            if (rows.length == 0) return this.$error("请选择工单!");
            let addkeys = rows.map(x => {
                return x[this.table.key];
            });
            if (!addkeys || addkeys.Length == 0) return this.$error("未获取到工单!");
            this.$confirm("是否确认要出库外协?","提示",{
                        // iconClass:"el-icon-success",//el-icon-remove自定义图标样式
                        confirmButtonText:"确认",//确认按钮文字更换
                        cancelButtonText:"取消",//取消按钮文字更换
                        // cancelBtn:"取消",//取消按钮文字更换
                        showClose: true,//是否显示右上角关闭按钮
                        type: "warning",//提示类型 success:成功/info:信息/warning:警告/error:报错
            }).then(()=>{
              let params = {
                MainData: null,
                DetailData: null,
                DelKeys: addkeys
            }
            this.http.post("/api/dt_mes_head/OutsorcingWorkOrder", params, "正在处理工单....").then(x => {
                if (!x.status) return this.$error(x.message);
                this.$success("处理工单成功!");
                this.refresh();
            });
            })
          }
        }
        let CompleteBtn = this.buttons.find(r => r.name == "完成工单");
        if(null!=CompleteBtn){
          CompleteBtn.onClick = function (){
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue
@@ -31,13 +31,24 @@
            });
            const editFormFields = ref({"skip_op_1":"","skip_op_2":"","skip_op_3":""});
            const editFormOptions = ref([
            [{ "dataKey": "skip_op_Status", "data": [], "title": "视觉检测1", "required": true, "field": "skip_op_1", "type": "select" }],
            [{ "dataKey": "skip_op_Status", "data": [], "title": "视觉检测2", "required": true, "field": "skip_op_2", "type": "select" }],
            [{ "dataKey": "skip_op_Status", "data": [], "title": "喷防锈液", "required": true, "field": "skip_op_3", "type": "select" }]
            [{ "dataKey": "skip_op_Status", "data": [], "title": "视觉检测1", "required": true, "field": "skip_op_1", "type": "radio" }],
            [{ "dataKey": "skip_op_Status", "data": [], "title": "视觉检测2", "required": true, "field": "skip_op_2", "type": "radio" }],
            [{ "dataKey": "skip_op_Status", "data": [], "title": "喷防锈液", "required": true, "field": "skip_op_3", "type": "radio" }],
        //     [{
        //   title: "指定库区", field: "area",
        //   data: [
        //     { key: 9, value: "外协区" },
        //     { key: 2, value: "库区2" },
        //     { key: 3, value: "库区3" },
        //     { key: 4, value: "库区4" },
        //     //{ key: 3, value: "不允许" },
        //   ]
        //   , type: "radio"//type: "select"
        // }],
            ]);
            const searchFormFields = ref({"jobID":"","processCode":"","CreateTime":""});
            const searchFormOptions = ref([
                [{"title":"工单编号","field":"jobID","type":"like"},{"dataKey":"WorkTypes","data":[],"title":"工单类型","field":"processCode","type":"select"}],
                [{"title":"工作令号","field":"workOrder","type":"like"},{"title":"工单编号","field":"jobID","type":"like"},{"dataKey":"WorkTypes","data":[],"title":"工单类型","field":"processCode","type":"select"}],
                [{"title":"图号","field":"drawingNo","type":"like"},{"title":"创建时间","field":"CreateTime","type":"datetime"}]
            ]);
            const columns = ref([{field:'mes_id',title:'mes_id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
@@ -55,7 +66,7 @@
                       {field:'skip_op_1',title:'视觉检测1',type:'bool',bind:{ key:'skip_op_Status',data:[]},width:110,require:true,align:'left'},
                       {field:'skip_op_2',title:'视觉检测2',type:'bool',bind:{ key:'skip_op_Status',data:[]},width:110,require:true,align:'left'},
                       {field:'skip_op_3',title:'喷防锈液',type:'bool',bind:{ key:'skip_op_Status',data:[]},width:110,require:true,align:'left'},
                    //    {field:'area',title:'入库库区',type:'string',width:110,align:'left'},
                       {field:'area',title:'指定库区',type:'string',width:110,align:'left'},
                       {field:'typeID',title:'轮型代码',type:'string',width:110,align:'left'},
                       {field:'stackNoRange',title:'打包数量',type:'int',width:110,align:'left'},
                       {field:'maxDiameterDiff',title:'轮径偏差',type:'decimal',width:110,align:'left'},
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs
@@ -140,8 +140,8 @@
        ///炉号
        /// </summary>
        [Display(Name = "炉号")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        public string heatNumber { get; set; }
        /// <summary>
@@ -151,5 +151,13 @@
        [MaxLength(100)]
        [Column(TypeName = "nvarchar(100)")]
        public string tray_type { get; set; }
        /// <summary>
        ///钢坯号
        /// </summary>
        [Display(Name = "钢坯号")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        public string billetID { get; set; }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs
@@ -13,151 +13,159 @@
namespace WIDESEA_Entity.DomainModels
{
    [Entity(TableCnName = "工单视图",TableName = "VV_Mes_Workinfo")]
    public partial class VV_Mes_Workinfo:BaseEntity
    [Entity(TableCnName = "工单视图", TableName = "VV_Mes_Workinfo")]
    public partial class VV_Mes_Workinfo : BaseEntity
    {
        /// <summary>
       ///
       /// </summary>
       [Display(Name ="jobID")]
       [MaxLength(40)]
       [Column(TypeName="nvarchar(40)")]
       [Editable(true)]
       public string jobID { get; set; }
        ///
        /// </summary>
        [Display(Name = "jobID")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string jobID { get; set; }
       /// <summary>
       ///炉号
       /// </summary>
       [Display(Name ="heatID")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string heatID { get; set; }
        /// <summary>
        ///炉号
        /// </summary>
        [Display(Name = "heatID")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string heatID { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="billetID")]
       [Column(TypeName="int")]
       [Editable(true)]
       public int? billetID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "billetID")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? billetID { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="SN")]
       [MaxLength(50)]
       [Column(TypeName="nvarchar(50)")]
       [Editable(true)]
       public string SN { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "SN")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string SN { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="heatBatchID")]
       [MaxLength(30)]
       [Column(TypeName="nvarchar(30)")]
       [Editable(true)]
       public string heatBatchID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "heatBatchID")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        [Editable(true)]
        public string heatBatchID { get; set; }
       /// <summary>
       ///工作令号
       /// </summary>
       [Display(Name ="workOrder")]
       [MaxLength(50)]
       [Column(TypeName="nvarchar(50)")]
       [Editable(true)]
       public string workOrder { get; set; }
        /// <summary>
        ///工作令号
        /// </summary>
        [Display(Name = "workOrder")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string workOrder { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="reqID")]
       [MaxLength(40)]
       [Column(TypeName="nvarchar(40)")]
       [Editable(true)]
       public string reqID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "reqID")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string reqID { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="reqIDLineNo")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string reqIDLineNo { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "reqIDLineNo")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string reqIDLineNo { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="materialCode")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string materialCode { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "materialCode")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string materialCode { get; set; }
       /// <summary>
       ///图号
       /// </summary>
       [Display(Name ="drawingNo")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string drawingNo { get; set; }
        /// <summary>
        ///图号
        /// </summary>
        [Display(Name = "drawingNo")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string drawingNo { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="drawingNoVer")]
       [MaxLength(10)]
       [Column(TypeName="nvarchar(10)")]
       [Editable(true)]
       public string drawingNoVer { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "drawingNoVer")]
        [MaxLength(10)]
        [Column(TypeName = "nvarchar(10)")]
        [Editable(true)]
        public string drawingNoVer { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="productName")]
       [MaxLength(40)]
       [Column(TypeName="nvarchar(40)")]
       [Editable(true)]
       public string productName { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "productName")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string productName { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="quantity")]
       [Column(TypeName="int")]
       [Editable(true)]
       public int quantity { get; set; }
        /// <summary>
        ///库区
        /// </summary>
        [Display(Name = "库区")]
        [MaxLength(15)]
        [Column(TypeName = "nvarchar(15)")]
        public string area { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="typeID")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string typeID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "quantity")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int quantity { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Key]
       [Display(Name ="stackNoRange")]
       [Column(TypeName="int")]
       [Editable(true)]
       [Required(AllowEmptyStrings=false)]
       public int stackNoRange { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "typeID")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string typeID { get; set; }
       /// <summary>
       ///工单类型 (17-机加工 28-检测线 101移库外协)
       /// </summary>
       [Display(Name ="processCode")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string processCode { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Key]
        [Display(Name = "stackNoRange")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int stackNoRange { get; set; }
        /// <summary>
        ///工单类型 (17-机加工 28-检测线 101移库外协)
        /// </summary>
        [Display(Name = "processCode")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string processCode { get; set; }
        /// <summary>
        ///完成数量
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs
@@ -384,6 +384,9 @@
                    {
                        var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList();
                        var NGStation = "X01001003";
                        if (name == "2单元下料区") NGStation = "X02001003";
                        if (name == "3单元下料区") NGStation = "X03001002";
                        #region MyRegion
                        //var Wheel_Type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_Type").First(), client);//车轮类型
                        //var Wheel_id = client.ReadByOrder<string>("R_Wheel_id", name);//车轮SN号
@@ -485,6 +488,7 @@
                            }
                            station.bindSN = string.IsNullOrEmpty(station.bindSN) ? Wheel_SN : station.bindSN + "," + Wheel_SN;
                            station.billetID = string.IsNullOrEmpty(station.billetID) ? Mes_Work.billetID.ToString() : station.billetID + "," + Mes_Work.billetID;
                            station.quantity++;
                            if (station.quantity == 1)
                            {
@@ -493,6 +497,10 @@
                                station.heatNumber = Mes_Work.heatID;
                                station.tray_status = "StrogeTray";
                            }
                            //else if (station.stationCode == NGStation)
                            //{
                            //    station.heatNumber = string.IsNullOrEmpty(station.heatNumber) ? Mes_Work.heatID : station.heatNumber + "," + Mes_Work.heatID;
                            //}
                            var count = stationinfoRepository.Update(station, true);
                            if (count < 1)
@@ -547,10 +555,9 @@
                        var Request = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Request_Load").First(), client);
                        if (!Request) continue;
                        var Area = client.ReadByOrder<Int16>("W_AreaNr", name);//读取货位号信息
                        if (Area != 0) continue;
                        //var Area = client.ReadByOrder<Int16>("W_AreaNr", name);//读取货位号信息
                        //if (Area != 0) continue;
                        var load_zone = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_load_zone").First(), client);
                        #region è¯»å–桁架信息
                        var Wheel_Type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_Type").First(), client);//车轮类型
                        var Wheel_id = client.ReadByOrder<string>("R_Wheel_id", name);//车轮SN号
@@ -589,9 +596,7 @@
                        var Stations = stationinfoRepository.Find(x => x.area == PipelineJob.area_code(name)).OrderBy(x => x.lastUpdateTime).ToList();
                        var NGStation = "X01001003";
                        if (name == "2单元下料区") NGStation = "X02001003";
                        if (name == "3单元下料区") NGStation = "X03001002";
                        //foreach (var station in Stations)     //任何一个下料位为空或禁用时,都会停止桁架
                        //{
@@ -620,6 +625,8 @@
                        }
                        var PartStatus = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PartStatus").First(), client);//1:ok;2:nok
                        var load_zone = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_load_zone").First(), client);
                        #region æ—¥å¿—记录
                        WriteDBLog.Success(name + "申请放料", $"读取桁架信息:\n车轮SN:{Wheel_id}\n轮型ID:{Wheel_Type}\n车轮状态:{PartStatus}\n是否进入下料区:{load_zone}", "PCS");
                        if (load_zone) continue;
@@ -635,7 +642,7 @@
                           && x.location_state == LocationStateEnum.Stroge.ToString()
                           && x.quantity < 5
                           && x.stationType == Work.drawingNo
                           && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                           //&& x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                           && x.Number == Work.workOrder
                           && x.heatNumber == Work.heatID)
                           .OrderByDescending(x => x.quantity)
@@ -649,7 +656,7 @@
                           && x.location_state == LocationStateEnum.Stroge.ToString()
                           && x.quantity < 5
                           && x.stationType == Work.drawingNo
                           && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                           //&& x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                           && x.Number == Work.workOrder)
                           .OrderByDescending(x => x.quantity)
                           .FirstOrDefault();
@@ -688,8 +695,22 @@
                            if (Stationinfo != null)
                            {
                                #region æ‰˜ç›˜è½¦è½®å †åž›ç¬¬å››ä¸ªæ—¶ä¸‹å‘另外一个炉号的入库任务
                                if (Stationinfo.quantity + 1 >= 4)
                                {
                                    var stationinfo = Stations.Where(x => x.enable && x.stationCode != NGStation && x.stationCode != Stationinfo.stationCode && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
                                    //foreach (var stationinfo in stationinfos)
                                    //{
                                    if (stationinfo != null)
                                        agvtask(stationinfoRepository, stationinfo, Work, name == "3单元下料区" ? "TaskType_OutsourceInbound" : "TaskType_Inbound");
                                    //}
                                }
                                #endregion
                                #region æ‰˜ç›˜ç±»åž‹ä¸ä¸€è‡´éœ€æ›´æ¢æ‰˜ç›˜
                                if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray"))
                                //if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray"))
                                if (Stationinfo.tray_type != "LargeTray" && (wheel == null ? wheel1.e : wheel.e) > 1100)
                                {
                                    client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                                    Stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
@@ -765,16 +786,16 @@
                                    continue;
                                }
                            }
                            else
                            {
                                #region æ²¡æ‰˜ç›˜å¯ç”¨,触发入库任务
                                var stationinfos = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).ToList();
                                foreach (var stationinfo in stationinfos)
                                {
                                    agvtask(stationinfoRepository, stationinfo, Work, name == "3单元下料区" ? "TaskType_OutsourceInbound" : "TaskType_Inbound");
                                }
                                #endregion
                            }
                            //else
                            //{
                            //    #region æ²¡æ‰˜ç›˜å¯ç”¨,触发入库任务
                            //    var stationinfos = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).ToList();
                            //    foreach (var stationinfo in stationinfos)
                            //    {
                            //        agvtask(stationinfoRepository, stationinfo, Work, name == "3单元下料区" ? "TaskType_OutsourceInbound" : "TaskType_Inbound");
                            //    }
                            //    #endregion
                            //}
                        }
                        else if ((Int16)PartStatus == 2)
@@ -802,7 +823,7 @@
                        && x.location_state == LocationStateEnum.Stroge.ToString()
                        && x.quantity < 5
                        && x.stationType == Work.drawingNo
                        && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                        //&& x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                        /*&& x.Number == mes_Detail.jobID*/).FirstOrDefault();
                            //}
@@ -818,7 +839,8 @@
                            if (Stationinfo != null)
                            {
                                #region æ‰˜ç›˜ç±»åž‹ä¸ä¸€è‡´éœ€æ›´æ¢æ‰˜ç›˜
                                if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray"))
                                //if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray"))
                                if (Stationinfo.tray_type != "LargeTray" && (wheel == null ? wheel1.e : wheel.e) > 1100)
                                {
                                    Stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
                                    Stationinfo.tray_type = Stationinfo.tray_type == "SmallTray" ? "SmallTray/LargeTray" : "LargeTray/SmallTray";
@@ -984,7 +1006,7 @@
            //int CompeletedNum = Convert.ToInt32(mes_Head.quantity) - Convert.ToInt32(mes_Head.finishNum);
            //if (mes_Head.quantity <= 50) tasktype = "TaskType_OutsourceInbound";
            if (tasktype == "TaskType_OutsourceInbound")
            if (tasktype == "TaskType_OutsourceInbound" || !string.IsNullOrEmpty(Work.area))
                TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository);
            else if (tasktype == "TaskType_Inbound")
                TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, Work, stationinfo);
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs
@@ -15,5 +15,6 @@
        /// <param name="saveModel"></param>
        /// <returns></returns>
        WebResponseContent FinishWorkOrder(SaveModel saveModel);
        WebResponseContent OutsorcingWorkOrder(SaveModel saveModel);
    }
 }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs
@@ -18,6 +18,7 @@
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.Jobs;
using WIDESEA_WCS.JobsPart.Common;
using WIDESEA_WCS.Repositories;
using WIDESEA_WCS.WCSClient;
using WIDESEA_WMS.IRepositories;
@@ -244,7 +245,8 @@
                    var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == stationCode).ToList();
                    var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读取托盘信号:1:有,2无
                    var MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//读取货物信号:1:有,2无
                    var station = stationinfoRepository.Find(x => x.stationCode == stationCode).FirstOrDefault();
                    var station = stationinfoRepository.Find(x => x.stationCode == stationCode && x.enable).FirstOrDefault();
                    if (station == null) continue;
                    if (PalletSignal == 1 && MaterialSignal == 2 && (station.stationCode.Contains("S0100100") ? station.tray_status == "EmptyTray" : true))
                    {
                        var area = station.tray_type == "SmallTray" ? "11" : "10";
@@ -262,31 +264,34 @@
                            continue;
                        }
                        var EmptyStation = GetStation.EmptyPalletStation(area);
                        #region æŸ¥æ‰¾åº“区一空托盘空货位
                        var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable)
                        .OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//查找没有任务的空托盘货位
                       // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable)
                       //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//查找没有任务的空托盘货位
                        if (EmptyStation != null)
                        {
                            if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any())
                            {
                                EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//排除当列存在任务的货位
                            }
                            if (EmptyStation != null && EmptyStation.line == 2)//如果任务存在第二行,排查第一行是否有货
                            {
                                if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null;
                            }
                        }
                       // if (EmptyStation != null)
                       // {
                       //     if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any())
                       //     {
                       //         EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//排除当列存在任务的货位
                       //     }
                       //     if (EmptyStation != null && EmptyStation.line == 2)//如果任务存在第二行,排查第一行是否有货
                       //     {
                       //         if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null;
                       //     }
                       // }
                       // if (EmptyStation == null)
                       // {
                       //     EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//最后一个货位有任务则不能生成入库任务
                       //     if (EmptyStation != null) continue;
                       //     EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//找最外面没堆满5个的货位
                       //     if (EmptyStation == null)
                       //         EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                       // }
                        #endregion
                        if (EmptyStation == null)
                        {
                            EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//最后一个货位有任务则不能生成入库任务
                            if (EmptyStation != null) continue;
                            EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//找最外面没堆满5个的货位
                            if (EmptyStation == null)
                                EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                        }
                        if (EmptyStation != null)
                        {
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,163 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.Repositories;
using WIDESEA_WCS.WCSClient;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
namespace WIDESEA_WCS.JobsPart.Common
{
    public class GetStation
    {
        /// <summary>
        /// èŽ·å–ç©ºæ‰˜ç›˜è´§ä½
        /// </summary>
        /// <returns></returns>
        public static void EmptyPalletStation(dt_agvtask task)
        {
            dt_stationinfo EmptyStation = null;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "链条机");
                if (Pipeline_client == null) throw new Exception("链条机调度服务未开启!");
                if (!Pipeline_client.IsConnected) throw new Exception("与链条机连接超时!");
                var area = task.agv_Traytype == "SmallTray" ? "11" : "10";
                #region ä¼˜å…ˆå‡º3库区内空托盘
                if (area == "11")
                {
                    EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01004001" /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                    if (EmptyStation == null)
                        EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005001"/* && x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                    if (EmptyStation != null)
                        EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == EmptyStation.area && x.line == EmptyStation.line /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                    if (EmptyStation != null)
                        if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                }
                #endregion
                if (EmptyStation == null)
                    EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == area /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderBy(x => x.column).FirstOrDefault();
                if (EmptyStation != null)
                    if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                if (EmptyStation != null)
                {
                    var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//读取托盘信号:1:有,2无
                    var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", task.agv_toaddress);//读取货物信号:1:有,2无
                    if (PalletSignal == 2 && MaterialSignal == 2)
                    {
                        task.agv_fromaddress = EmptyStation.stationCode;
                        task.StarQuantity = EmptyStation.quantity - 1;
                        task.agv_taskstate = "Create";
                        agvtaskService.Update(task, true);
                        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        WriteDBLog.Success("更新空盘队列任务", $"任务编号:{task.agv_tasknum}", "PCS");
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public static dt_stationinfo Station(dt_stationinfo EmptyStation, Idt_stationinfoRepository stationinfoRepository)
        {
            dt_stationinfo stationinfo = null;
            try
            {
                if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state.Contains("Busy")).Any()) return null;
                stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.quantity > 0 && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                if (stationinfo != null)
                {
                    if (stationinfo.quantity < 5) return stationinfo;
                    else
                        stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                }
                //if (stationinfo == null)
                //    stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.quantity < 5 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
            }
            catch (Exception ex)
            {
            }
            return stationinfo;
        }
        /// <summary>
        /// ç©ºæ‰˜å¯å…¥åº“货位
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static dt_stationinfo EmptyPalletStation(string area)
        {
            dt_stationinfo stationinfo = null;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                #region æŸ¥æ‰¾ç©ºæ‰˜ç›˜åº“区
                if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any())
                {
                    var EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01005001" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault();
                    if (EmptyStation != null)
                    {
                        if (!stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any())
                            return EmptyStation;
                    }
                    EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005001" && x.location_state == "Stroge" && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                    if (EmptyStation != null) stationinfo = Station(EmptyStation, stationinfoRepository);
                    if (stationinfo != null) return stationinfo;
                    EmptyStation = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                    if (EmptyStation.quantity == 5)
                    {
                        EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01004001" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault();
                        if (EmptyStation != null)
                        {
                            if (!stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any())
                                return EmptyStation;
                        }
                        EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01004001" && x.location_state == "Stroge" && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                        if (EmptyStation != null) stationinfo = Station(EmptyStation, stationinfoRepository);
                    }
                }
                else
                {
                    stationinfo = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 /*&& x.location_state == LocationStateEnum.Stroge.ToString()*/ && x.enable).OrderBy(x => x.column).FirstOrDefault();
                    if (stationinfo != null)
                    {
                        if (stationinfo.quantity < 5) return stationinfo;
                        else
                            stationinfo = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                throw;
            }
            return stationinfo;
        }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs
@@ -63,12 +63,12 @@
                    var types = station.tray_type.Split('/');
                    var area = types[0] == "SmallTray" ? "11" : "10";
                    //找1库区的空托位
                    var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable)
                        .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault();
                    if (EmptyStation == null)
                        EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable)
                        .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                    var EmptyStation = GetStation.EmptyPalletStation(area);
                    //var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable)
                    //    .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault();
                    //if (EmptyStation == null)
                    //    EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable)
                    //    .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                    if (EmptyStation != null)
                    {
                        dt_agvtask agvtask = new dt_agvtask()
@@ -93,6 +93,8 @@
                            agv_Traytype = types[0]
                        };
                        agvtaskRepository.Add(agvtask, true);
                        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        WriteDBLog.Success("创建更换空盘任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
                        CreatePartQueue(agvtaskRepository, agvtask, types[1]);
                    }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs
@@ -36,58 +36,68 @@
                {
                    if (task.agv_tasktype == "TaskType_EmptyPallet")//空托任务
                    {
                        if (task.agv_fromaddress == "" && DateTime.Now - task.agv_createtime >= TimeSpan.FromMinutes(5))
                        if (task.agv_fromaddress == "" && DateTime.Now - task.agv_createtime >= TimeSpan.FromMinutes(1))
                        {
                            var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "链条机");
                            if (Pipeline_client == null) throw new Exception("链条机调度服务未开启!");
                            if (!Pipeline_client.IsConnected) throw new Exception("与链条机连接超时!");
                            var area = task.agv_Traytype == "SmallTray" ? "11" : "10";
                            //找1库区的空托位
                            var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains("A") /*&& x.location_state == "Stroge"*//*LocationStateEnum.Stroge.ToString()*/ && x.enable).OrderBy(x => x.column).ThenBy(x => x.line).FirstOrDefault();
                            if (EmptyStation != null)
                                if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                            #region ä¸€ä¸ªåŒºåŸŸåªèƒ½æœ‰ä¸€ä¸ªç©ºæ‰˜ä»»åŠ¡
                            //bool ok = false;
                            //if (EmptyStation != null)
                            //    ok = agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any();
                            //if (EmptyStation == null || ok)
                            //    EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" /*LocationStateEnum.Stroge.ToString()*/ && x.enable)
                            //    .OrderBy(x => x.line).OrderByDescending(x => x.column).FirstOrDefault();
                            #endregion
                            if (EmptyStation == null)
                                EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                            if (EmptyStation == null) continue;
                            #region åº“内存在任务占用
                            if (EmptyStation.location_state == LocationStateEnum.Busy.ToString())
                                continue;
                            #endregion
                            if (EmptyStation == null)
                                EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                            if (EmptyStation != null)
                            if (task.agv_tasknum.Contains("_"))
                            {
                                #region åº“内存在任务占用
                                //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString())
                                //    continue;
                                #endregion
                                //if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any())
                                //    return;
                                #region è¡¥åº“内空托盘,不需要光电判断
                                var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//读取托盘信号:1:有,2无
                                var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", task.agv_toaddress);//读取货物信号:1:有,2无
                                if (PalletSignal == 2 && MaterialSignal == 2)
                                {
                                    task.agv_fromaddress = EmptyStation.stationCode;
                                    task.StarQuantity = EmptyStation.quantity - 1;
                                    task.agv_taskstate = "Create";
                                    agvtaskService.Update(task, true);
                                    EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                                    stationinfoRepository.Update(EmptyStation, true);
                                    WriteDBLog.Success("更新空盘队列任务", $"任务编号:{task.agv_tasknum}", "PCS");
                                }
                                #endregion
                                string mainTaskNum = task.agv_tasknum.Split('_')[0];
                                if (agvtaskService.Find(x => x.agv_tasknum == mainTaskNum && (task.agv_taskstate == "Executing1" || task.agv_taskstate == "Complete1")).Any())
                                    GetStation.EmptyPalletStation(task);
                            }
                            else
                                GetStation.EmptyPalletStation(task);
                            #region
                            //var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "链条机");
                            //if (Pipeline_client == null) throw new Exception("链条机调度服务未开启!");
                            //if (!Pipeline_client.IsConnected) throw new Exception("与链条机连接超时!");
                            //var area = task.agv_Traytype == "SmallTray" ? "11" : "10";
                            ////找1库区的空托位
                            //var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains("A") /*&& x.location_state == "Stroge"*//*LocationStateEnum.Stroge.ToString()*/ && x.enable).OrderBy(x => x.column).ThenBy(x => x.line).FirstOrDefault();
                            //if (EmptyStation != null)
                            //    if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                            //#region ä¸€ä¸ªåŒºåŸŸåªèƒ½æœ‰ä¸€ä¸ªç©ºæ‰˜ä»»åŠ¡
                            ////bool ok = false;
                            ////if (EmptyStation != null)
                            ////    ok = agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any();
                            ////if (EmptyStation == null || ok)
                            ////    EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" /*LocationStateEnum.Stroge.ToString()*/ && x.enable)
                            ////    .OrderBy(x => x.line).OrderByDescending(x => x.column).FirstOrDefault();
                            //#endregion
                            //if (EmptyStation == null)
                            //    EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                            //if (EmptyStation == null) continue;
                            //#region åº“内存在任务占用
                            //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString())
                            //    continue;
                            //#endregion
                            //if (EmptyStation == null)
                            //    EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                            //if (EmptyStation != null)
                            //{
                            //    #region åº“内存在任务占用
                            //    //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString())
                            //    //    continue;
                            //    #endregion
                            //    //if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any())
                            //    //    return;
                            //    #region è¡¥åº“内空托盘,不需要光电判断
                            //    var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//读取托盘信号:1:有,2无
                            //    var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", task.agv_toaddress);//读取货物信号:1:有,2无
                            //    if (PalletSignal == 2 && MaterialSignal == 2)
                            //    {
                            //        task.agv_fromaddress = EmptyStation.stationCode;
                            //        task.StarQuantity = EmptyStation.quantity - 1;
                            //        task.agv_taskstate = "Create";
                            //        agvtaskService.Update(task, true);
                            //        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                            //        stationinfoRepository.Update(EmptyStation, true);
                            //        WriteDBLog.Success("更新空盘队列任务", $"任务编号:{task.agv_tasknum}", "PCS");
                            //    }
                            //    #endregion
                            //}
                            #endregion
                        }
                    }
                    else if (task.agv_tasktype == "TaskType_OutsourceOutbound" || task.agv_tasktype == "TaskType_Outbound")//外协库出库/AB库出库
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs
@@ -85,7 +85,7 @@
                    {
                        if (/*(mesinfo.quantity <= 50 && string.IsNullOrEmpty(mesinfo.area)) ||*/ item.stationCode.Contains("3"))    //小于50件直接出库
                        if (/*(mesinfo.quantity <= 50 &&*/ !string.IsNullOrEmpty(work.area) || item.stationCode.Contains("3"))    //小于50件直接出库
                        {
                            //todo å¯»æ‰¾å¯æ”¾è´§å¤–协放货台
                            tasktype = "TaskType_OutsourceInbound";
@@ -129,6 +129,7 @@
                            TargetLocation.location_state = LocationStateEnum.InBusy.ToString();
                            TargetLocation.stationType = agvtask.agv_materielid;
                            TargetLocation.heatNumber = item.heatNumber;
                            TargetLocation.billetID = item.billetID;
                            TargetLocation.Number = agvtask.jobID;
                            stationinfoRepository.Update(TargetLocation, true);
                            WriteDBLog.Success("创建入库任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ÐÂÎļþ¼Ð/GetLocation.cs
@@ -41,6 +41,10 @@
                    //    stationinfoRepository.Update(stationinfo, true);
                    //    return null;
                    //}
                    string area1 = "";
                    if (stationinfo.tray_type == "LargeTray")
                        area1 = "4";
                    #region æŸ¥æ‰¾åº“å­˜
                    dt_inventory inventory = null;
                    inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
@@ -64,6 +68,57 @@
                    if (inventory != null)
                    {
                        var station = stationinfoRepository.FindFirst(x => x.stationCode == inventory.stationCode);
                        if (!string.IsNullOrEmpty(area1) && station.area != area1)//入大托盘库区
                        {
                            #region å¯»æ‰¾å·²åˆ†é…åŒå›¾å·å…¥åº“任务库位
                            TargetLocation = stationinfoRepository.Find(x => x.stationType == stationinfo.stationType && x.location_state == LocationStateEnum.InBusy.ToString() && x.area == area1).FirstOrDefault();
                            if (TargetLocation != null)
                            {
                                //if (TargetLocation.area == "1")
                                //{
                                //    //TargetLocation = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderByDescending(x => x.line).FirstOrDefault();
                                //    TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderBy(x => x.column).FirstOrDefault();//按行存放
                                //    if (TargetLocation != null)
                                //    {
                                //        if (!stationinfoRepository.Find(x => x.column == TargetLocation.column && x.area == TargetLocation.area /*&& x.enable*/ && x.location_state == LocationStateEnum.OutBusy.ToString()).Any())
                                //            return TargetLocation;
                                //    }
                                //}
                                //else
                                //{
                                    TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderBy(x => x.column).FirstOrDefault();
                                    if (TargetLocation != null)
                                    {
                                        if (!stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any())
                                            return TargetLocation;
                                    }
                                //}
                            }
                            #endregion
                            #region å¯»æ‰¾ç©ºè´§ä½
                            var TargetLocations1 = stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable &&  x.area == area1).OrderBy(x => x.line).ThenBy(x => x.column).ToList();
                            foreach (var Location in TargetLocations1)
                            {
                                //if (Location.area == "1")
                                //{
                                //    if (stationinfoRepository.Find(x => x.column == Location.column && x.area == Location.area && x.stationType == stationinfo.stationType && x.location_state != LocationStateEnum.OutBusy.ToString()).Any()) return Location;
                                //}
                                //else
                                //{
                                    if (stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.stationType == stationinfo.stationType && x.location_state != LocationStateEnum.OutBusy.ToString()).Any()) return Location;
                                //}
                            }
                            //if (TargetLocation != null)
                            //{
                            //    if (stationinfoRepository.Find(x => x.line == TargetLocation.line && x.column == 1 && x.stationType == stationinfo.stationType).Any()) return TargetLocation;
                            //}
                            #endregion
                        }
                        if (station.area == "1")
                        {
                            //TargetLocation = stationinfoRepository.Find(x => x.column == station.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == inventory.area).OrderByDescending(x => x.line).FirstOrDefault();
@@ -137,17 +192,17 @@
                    #endregion
                    #region æœªæ‰¾åˆ°åº“存或当前库存行已满,寻找新的一行
                    //var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area;
                    //var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area;(area == "2" ? 1 : 10)
                    //var area = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, stationinfo.tray_type) : mesinfo.area;
                    var area = GetArea(mesinfo.quantity, stationinfo.tray_type);
                    TargetLocation = stationinfoRepository.Find(x => x.column == (area == "2" ? 1 : 10) && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault();
                    TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault();
                    if (TargetLocation == null && area != "4")
                    {
                        if (area == "2")
                            area = "3";
                        else if (area == "3")
                            area = "2";
                        TargetLocation = stationinfoRepository.Find(x => x.column == (area == "2" ? 1 : 10) && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault();
                        TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault();
                        if (TargetLocation == null)
                            TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault();
                    }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs
@@ -20,6 +20,7 @@
using WIDESEA_Core.EFDbContext;
using WIDESEA_WCS.JobsPart.Common;
using WIDESEA_Core.ManageUser;
using WIDESEA_Comm.LogInfo;
namespace WIDESEA_WCS.Services
{
@@ -40,10 +41,35 @@
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
        public WebResponseContent OutsorcingWorkOrder(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            string compeletor = UserContext.Current.UserName;
            try
            {
                List<string> list = new List<string>();
                foreach (var Key in model.DelKeys)
                {
                    var mes_head = _repository.Find(x => x.mes_id.ToString() == Key.ToString()).FirstOrDefault();
                    if (mes_head != null)
                    {
                        mes_head.area = "外协";
                        _repository.Update(mes_head, true);
                        list.Add(mes_head.jobID);
                    }
                }
                content.OK();
                WriteDBLog.Success("指定工单出库外协", $"工单编号:{list}", "PCS", compeletor);
            }
            catch (Exception ex)
            {
                WriteDBLog.Error("指定工单出库外协", $"错误信息:{ex.Message}", "PCS", compeletor);
            }
            return content;
        }
        public WebResponseContent FinishWorkOrder(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            VOLContext context = new VOLContext();
            try
            {
                string compeletor = UserContext.Current.UserName;
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs
@@ -92,9 +92,9 @@
                    workOrder = workInfo.workOrder,
                    processCode = workInfo.processCode,
                    finishNum = 0,
                    skip_op_1 = true,
                    skip_op_2 = true,
                    skip_op_3 = true,
                    skip_op_1 = false,
                    skip_op_2 = false,
                    skip_op_3 = false,
                };
                freeDB.Add(mes_Head);
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs
@@ -43,5 +43,11 @@
        {
            return Service.FinishWorkOrder(saveModel);
        }
        [HttpPost, Authorize, Route("OutsorcingWorkOrder"), AllowAnonymous]
        public WebResponseContent OutsorcingWorkOrder([FromBody] SaveModel saveModel)
        {
            return Service.OutsorcingWorkOrder(saveModel);
        }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Client/src/api/http.js
@@ -12,7 +12,7 @@
let loadingInstance;
let loadingStatus = false;
if (process.env.NODE_ENV == 'development') {
    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
    axios.defaults.baseURL = 'http://192.168.12.101:8098/';
}
else if (process.env.NODE_ENV == 'debug') {
    axios.defaults.baseURL = 'http://192.168.12.101:8098/';
´úÂë¹ÜÀí/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue
@@ -29,11 +29,12 @@
                url: "/dt_stationinfo/",
                sortName: "id"
            });
            const editFormFields = ref({"stationCode":"","stationType":"","location_state":"","bindSN":"","tray_status":"","Number":"","heatNumber":"","remark":""});
            const editFormFields = ref({"stationCode":"","stationType":"","location_state":"","bindSN":"","billetID":"","tray_status":"","Number":"","heatNumber":"","remark":""});
            const editFormOptions = ref([[{"title":"缓存架编号","field":"stationCode","disabled": true}],
                              [{"title":"图号","field":"stationType"}],
                              [{"dataKey":"location_states","data":[],"title":"货位状态","field":"location_state","type":"select"}],
                              [{"title":"车轮SN号","field":"bindSN"}],
                              [{"title":"钢坯号","field":"billetID"}],
                              [{"dataKey":"tray_types","data":[],"title":"托盘类型","field":"tray_type","type":"select"}],
                              [{"title":"工作令号","field":"Number"}],
                              [{"title":"炉号","field":"heatNumber","type":"text"}],
@@ -54,7 +55,7 @@
                    //    {field:'line',title:'行',type:'int',width:80,align:'left'},
                    //    {field:'column',title:'列',type:'int',width:80,align:'left'},
                    {field:'heatNumber',title:'炉号',type:'string',width:80,align:'left'},
                    //    {field:'zj',title:'主键',type:'int',width:80,hidden:true,require:true,align:'left'},
                       {field:'billetID',title:'钢坯号',type:'string',width:160,align:'left'},
                       {field:'Number',title:'工作令号',type:'string',width:160,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:220,align:'left'}]);
            const detail = ref({
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs
@@ -139,8 +139,8 @@
        ///炉号
        /// </summary>
        [Display(Name = "炉号")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        public string heatNumber { get; set; }
        /// <summary>
@@ -150,5 +150,13 @@
        [MaxLength(100)]
        [Column(TypeName = "nvarchar(100)")]
        public string tray_type { get; set; }
        /// <summary>
        ///钢坯号
        /// </summary>
        [Display(Name = "钢坯号")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        public string billetID { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs
@@ -13,152 +13,160 @@
namespace WIDESEA_Entity.DomainModels
{
    [Entity(TableCnName = "工单视图",TableName = "VV_Mes_Workinfo")]
    public partial class VV_Mes_Workinfo:BaseEntity
    [Entity(TableCnName = "工单视图", TableName = "VV_Mes_Workinfo")]
    public partial class VV_Mes_Workinfo : BaseEntity
    {
        /// <summary>
       ///工单编号
       /// </summary>
       [Display(Name ="jobID")]
       [MaxLength(40)]
       [Column(TypeName="nvarchar(40)")]
       [Editable(true)]
       public string jobID { get; set; }
        ///工单编号
        /// </summary>
        [Display(Name = "jobID")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string jobID { get; set; }
        /// <summary>
        ///炉代号
        /// </summary>
        [Display(Name ="heatID")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string heatID { get; set; }
        [Display(Name = "heatID")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string heatID { get; set; }
        /// <summary>
        ///钢坯号
        /// </summary>
        [Display(Name ="billetID")]
       [Column(TypeName="int")]
       [Editable(true)]
       public int? billetID { get; set; }
        [Display(Name = "billetID")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? billetID { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="SN")]
       [MaxLength(50)]
       [Column(TypeName="nvarchar(50)")]
       [Editable(true)]
       public string SN { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "SN")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string SN { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="heatBatchID")]
       [MaxLength(30)]
       [Column(TypeName="nvarchar(30)")]
       [Editable(true)]
       public string heatBatchID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "heatBatchID")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        [Editable(true)]
        public string heatBatchID { get; set; }
       /// <summary>
       ///工作令号
       /// </summary>
       [Display(Name ="workOrder")]
       [MaxLength(50)]
       [Column(TypeName="nvarchar(50)")]
       [Editable(true)]
       public string workOrder { get; set; }
        /// <summary>
        ///工作令号
        /// </summary>
        [Display(Name = "workOrder")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string workOrder { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="reqID")]
       [MaxLength(40)]
       [Column(TypeName="nvarchar(40)")]
       [Editable(true)]
       public string reqID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "reqID")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string reqID { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="reqIDLineNo")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string reqIDLineNo { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "reqIDLineNo")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string reqIDLineNo { get; set; }
       /// <summary>
       ///物料编码
       /// </summary>
       [Display(Name ="materialCode")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string materialCode { get; set; }
        /// <summary>
        ///物料编码
        /// </summary>
        [Display(Name = "materialCode")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string materialCode { get; set; }
       /// <summary>
       ///图号
       /// </summary>
       [Display(Name ="drawingNo")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string drawingNo { get; set; }
        /// <summary>
        ///图号
        /// </summary>
        [Display(Name = "drawingNo")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string drawingNo { get; set; }
       /// <summary>
       ///技术状态
       /// </summary>
       [Display(Name ="drawingNoVer")]
       [MaxLength(10)]
       [Column(TypeName="nvarchar(10)")]
       [Editable(true)]
       public string drawingNoVer { get; set; }
        /// <summary>
        ///技术状态
        /// </summary>
        [Display(Name = "drawingNoVer")]
        [MaxLength(10)]
        [Column(TypeName = "nvarchar(10)")]
        [Editable(true)]
        public string drawingNoVer { get; set; }
        /// <summary>
        ///产品名称
        /// </summary>
        [Display(Name ="productName")]
       [MaxLength(40)]
       [Column(TypeName="nvarchar(40)")]
       [Editable(true)]
       public string productName { get; set; }
        [Display(Name = "productName")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string productName { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="quantity")]
       [Column(TypeName="int")]
       [Editable(true)]
       public int? quantity { get; set; }
        /// <summary>
        ///库区
        /// </summary>
        [Display(Name = "库区")]
        [MaxLength(15)]
        [Column(TypeName = "nvarchar(15)")]
        public string area { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Display(Name ="typeID")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string typeID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "quantity")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? quantity { get; set; }
       /// <summary>
       ///
       /// </summary>
       [Key]
       [Display(Name ="stackNoRange")]
       [Column(TypeName="int")]
       [Editable(true)]
       [Required(AllowEmptyStrings=false)]
       public int stackNoRange { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Display(Name = "typeID")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string typeID { get; set; }
        /// <summary>
        ///
        /// </summary>
        [Key]
        [Display(Name = "stackNoRange")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int stackNoRange { get; set; }
        /// <summary>
        ///工单类型 (17-机加工 28-检测线 101-移库外协)
        /// </summary>
        [Display(Name ="processCode")]
       [MaxLength(20)]
       [Column(TypeName="nvarchar(20)")]
       [Editable(true)]
       public string processCode { get; set; }
        [Display(Name = "processCode")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string processCode { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs
@@ -171,7 +171,7 @@
                ////空托任务需修改逻辑
                if (station2.stationCode.Contains("X"))
                    station2.quantity = 0;// task.agv_tasktype.Contains("TaskType_EmptyPallet") ? 0 : task.agv_qty; //task.agv_qty;
                else if (station2.area == "10" || station2.area == "11") //入库空托任务
                else if (station2.area == "10" || station2.area == "11" || (station2.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //入库空托任务
                    station2.quantity = station2.quantity + task.agv_qty;
                else
                    station2.quantity = task.agv_qty;
@@ -199,7 +199,7 @@
                //    station1.quantity = 0;
                #endregion
                if (station1.area == "10" || station1.area == "11") //出库空托任务
                if (station1.area == "10" || station1.area == "11" || (station1.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //出库空托任务
                {
                    station1.location_state = LocationStateEnum.Stroge.ToString();
                    station1.quantity = station1.quantity - 1;
@@ -212,6 +212,7 @@
                {
                    station1.location_state = LocationStateEnum.Empty.ToString();
                    station1.Number = string.Empty;
                    station1.billetID = string.Empty;
                    station1.heatNumber = string.Empty;
                    station1.stationType = string.Empty;
                    station1.tray_status = string.Empty;
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs
@@ -119,6 +119,7 @@
            station.stationType = saveModel.MainData["stationType"].ToString();
            station.heatNumber = saveModel.MainData["heatNumber"].ToString();
            station.Number = saveModel.MainData["Number"].ToString();
            station.billetID = saveModel.MainData["billetID"].ToString();
            station.remark = saveModel.MainData["remark"].ToString();
            station.tray_type = saveModel.MainData["tray_type"].ToString();
            if (list.Count == 0)
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs
@@ -12,7 +12,7 @@
        [Invoke(Begin = "2024-01-01 00:00", Interval = 1000 * 5, /*IsEnabled = true,*/ SkipWhileExecuting = true)]
        public void TaskTime()
        {
            //AGVServer.SendAgvTask();
            AGVServer.SendAgvTask();
        }
    }
}