分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-01 19c66ba052a7fb26c4d27deaa75ae46479eee342
优化堆垛逻辑和入库逻辑
已添加21个文件
已修改42个文件
2060 ■■■■ 文件已修改
代码管理/PCS/WCS_Client/config/buttons.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/extension/widesea_system/system/dt_log_pcs.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/system/Sys_User.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/baseinfo/dt_geometry_data.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/baseinfo/dt_geometry_data_detectionline.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_detail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_detail_hty.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head_hty.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Comm/LogInfo/WriteDBLog.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/Taskinfo/dt_agvtask.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/partial/VV_Mes_Workinfo.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs 321 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IRepositories/ToMES/IVV_Mes_WorkinfoRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/IVV_Mes_WorkinfoService.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/IVV_Mes_WorkinfoService.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/Task/AutoTaskJob.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/AutoUpdateWork.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/EmptyTrayTask.cs 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/新文件夹/GetLocation.cs 271 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/新文件夹/OutboundTask_a.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Repositories/ToMES/VV_Mes_WorkinfoRepository.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/VV_Mes_WorkinfoService.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/VV_Mes_WorkinfoService.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/ToAGV/ToAGVServer.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WebApi/Controllers/ToMes/ToMESController.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask_hty.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Comm/StateEnum/LocationStateEnum.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/Taskinfo/dt_agvtask.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/partial/VV_Mes_Workinfo.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/MappingConfiguration/ToMES/VV_Mes_WorkinfoMapConfig.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/AGVServer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask_Mes.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/IRepositories/ToMES/IVV_Mes_WorkinfoRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/IServices/ToMES/IVV_Mes_WorkinfoService.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/IServices/ToMES/Partial/IVV_Mes_WorkinfoService.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Repositories/ToMES/VV_Mes_WorkinfoRepository.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/ToMES/Partial/VV_Mes_WorkinfoService.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/ToMES/VV_Mes_WorkinfoService.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/ToAGV/ToAGVServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/ToMes/OutsourceInbound.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/ToMes/agvTransferList.cs 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/VV_Mes_WorkinfoController.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/VV_Mes_WorkinfoController.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/其他/服务器账号密码.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Client/config/buttons.js
@@ -80,6 +80,15 @@
    onClick: function () {
        this.upload();
    }
}, {
    name: "完成工单",
    icon: 'el-icon-check',
    type: 'success',
    plain: true,
    value: 'FinishWorkOrder',
    onClick: function () {
        // this.FinishWorkOrder();
    }
}
    // , {
    //     name: "数据结构",
´úÂë¹ÜÀí/PCS/WCS_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:8099/';
    axios.defaults.baseURL = 'http://192.168.12.101:8099/';
}
else if (process.env.NODE_ENV == 'debug') {
    axios.defaults.baseURL = 'http://192.168.12.101:8099/';
´úÂë¹ÜÀí/PCS/WCS_Client/src/extension/widesea_system/system/dt_log_pcs.js
@@ -20,9 +20,12 @@
      //默认查询前7天日志
      let dateNow = this.base.getDate(true);
      let beginDate = this.base.addDays(dateNow, -7);
      // let beginDate = this.base.addDays(dateNow, -7);
      let beginDate = this.base.addDays(dateNow, 0);
      beginDate = beginDate.substring(0, 11) + '00:00:00'
      let startDate = this.base.addDays(dateNow, 1);
      // let startDate = this.base.addDays(dateNow, 1);
      let startDate = this.base.addDays(dateNow, 1);//查询当天日志
      startDate=startDate.substring(0, 11) + '00:00:00'
      this.searchFormFields.createtime = [beginDate, startDate];
      //自定义列颜色
´úÂë¹ÜÀí/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js
@@ -32,6 +32,45 @@
        //       this.$Message.success('点击了按钮');
        //     }
        //   });
        // this.buttons.forEach(x => {
        //   if(x.value == 'FinishWorkOrder')
        //   {
        //     x.name = '完成工单'
        //     x.type='success'
        //     x.icon= 'el-icon-check'
        //   }
        // });
        let CompleteBtn = this.buttons.find(r => r.name == "完成工单");
        if(null!=CompleteBtn){
          CompleteBtn.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/FinishWorkOrder", params, "正在完成工单....").then(x => {
                if (!x.status) return this.$error(x.message);
                this.$success("完成工单成功!");
                this.refresh();
            });
            })
          }
        }
        //示例:设置修改新建、编辑弹出框字段标签的长度
        // this.boxOptions.labelWidth = 150;
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/system/Sys_User.vue
@@ -27,7 +27,7 @@
        const editFormOptions = ref([[{ "title": "帐号", "required": true, "field": "UserName", "disabled": true }],
        [{ "title": "姓名", "required": true, "field": "UserTrueName", "type": "text" }],
        [{ "dataKey": "tree_roles", "data": [], "title": "角色", "required": true, "field": "Role_Id", "type": "cascader" }],
        [{ "dataKey": "组织机构", "data": [], "title": "组织构架", "field": "DeptIds", "colSize": 12, "type": "treeSelect" }],
        // [{ "dataKey": "组织机构", "data": [], "title": "组织构架", "field": "DeptIds", "colSize": 12, "type": "treeSelect" }],
        [{ "dataKey": "enable", "data": [], "title": "是否可用", "required": true, "field": "Enable", "type": "select" }],
        [{ "dataKey": "gender", "data": [], "title": "性别", "field": "Gender", "type": "select" }],
        [{ "title": "备注", "field": "Remark", "colSize": 12, "type": "textarea" }],
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/baseinfo/dt_geometry_data.vue
@@ -41,7 +41,7 @@
                              [{"title":"g","required":true,"field":"g","type":"text"},
                               {"title":"h","required":true,"field":"h","type":"text"}]]);
            const searchFormFields = ref({"TypeId":"","Description":""});
            const searchFormOptions = ref([[{"title":"图号","field":"Description","type":"like"},{"title":"","field":"TypeId","type":"like"}]]);
            const searchFormOptions = ref([[{"title":"图号","field":"Description","type":"like"},{"title":"TypeId","field":"TypeId","type":"int"}]]);
            const columns = ref([{field:'TypeId',title:'TypeId',type:'int',width:110,require:true,align:'left',sort:true},
                       {field:'Description',title:'图号',type:'string',width:120,require:true,align:'left'},
                       {field:'a',title:'a',type:'float',width:110,require:true,align:'left'},
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/baseinfo/dt_geometry_data_detectionline.vue
@@ -56,7 +56,7 @@
                               {"title":"skip_14","field":"skip_14","type":"text"}],
                              [{"title":"skip_15","field":"skip_15","type":"text"}]]);
            const searchFormFields = ref({"TypeId":"","Description":""});
            const searchFormOptions = ref([[{"title":"图号","field":"Description","type":"like"},{"title":"","field":"TypeId","type":"like"}]]);
            const searchFormOptions = ref([[{"title":"图号","field":"Description","type":"like"},{"title":"TypeId","field":"TypeId","type":"int"}]]);
            const columns = ref([{field:'ID',title:'ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'TypeId',title:'TypeId',type:'int',width:110,require:true,align:'left',sort:true},
                       {field:'Description',title:'图号',type:'string',width:120,require:true,align:'left'},
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_detail.vue
@@ -31,7 +31,7 @@
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"SN":"","jobID":""});
            const searchFormFields = ref({"SN":"","jobID":"","heatID":"","billetID":""});
            const searchFormOptions = ref([[{"title":"车轮SN号","field":"SN","type":"like"},{"title":"工单编号","field":"jobID","type":"like"}],
            [{"title":"炉代号","field":"heatID","type":"like"},{"title":"钢坯号","field":"billetID","type":"like"}]]);
            const columns = ref([{field:'mes_detail_id',title:'工单明细ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_detail_hty.vue
@@ -31,15 +31,17 @@
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const searchFormFields = ref({"SN":"","jobID":"","heatID":"","billetID":""});
            const searchFormOptions = ref([[{"title":"车轮SN号","field":"SN","type":"like"},{"title":"工单编号","field":"jobID","type":"like"}],
            [{"title":"炉代号","field":"heatID","type":"like"},{"title":"钢坯号","field":"billetID","type":"like"}]]);
            const columns = ref([{field:'mes_detail_id',title:'工单明细ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'jobID',title:'工单编号',type:'string',width:110,align:'left',sort:true},
                       {field:'heatID',title:'炉代号',type:'string',width:110,align:'left'},
                       {field:'billetID',title:'钢坯号',type:'int',width:110,require:true,align:'left'},
                       {field:'heatID',title:'炉代号',type:'string',width:60,align:'left'},
                       {field:'billetID',title:'钢坯号',type:'int',width:60,require:true,align:'left'},
                       {field:'SN',title:'车轮SN号',type:'string',width:110,align:'left'},
                       {field:'heatBatchID',title:'热处理批次',type:'string',width:110,align:'left'},
                       {field:'mes_headID',title:'工单头表ID',type:'guid',width:110,align:'left'},
                       {field:'Status',title:'工单状态',type:'string',width:60,align:'left'},
                       {field:'FinishTime',title:'完成时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'operatetype',title:'操作类型',type:'string',width:110,align:'left'},
                       {field:'compeletor',title:'操作者',type:'string',width:110,align:'left'}]);
´úÂë¹ÜÀí/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue
@@ -22,19 +22,23 @@
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                key: 'mes_id',
                footer: "Foots",
                cnName: '工单头表',
                name: 'tomes/dt_mes_head',
                url: "/dt_mes_head/",
                sortName: "ID"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            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" }]
            ]);
            const searchFormFields = ref({"jobID":"","processCode":"","CreateTime":""});
            const searchFormOptions = ref([
                [{"title":"工单编号","field":"jobID","type":"like"},{"dataKey":"WorkTypes","data":[],"title":"工单类型","field":"processCode","type":"select"}],
                [{"title":"创建时间","field":"CreateTime","type":"datetime"}]
                [{"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'},
                       {field:'workOrder',title:'工作令号',type:'string',width:110,align:'left',sort:true},
@@ -50,8 +54,8 @@
                       {field:'finishNum',title:'完成数量',type:'int',width:110,align:'left'},
                       {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:'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:'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_Client/src/views/widesea_wcs/tomes/dt_mes_head_hty.vue
@@ -31,8 +31,11 @@
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const searchFormFields = ref({"jobID":"","processCode":"","CreateTime":""});
            const searchFormOptions = ref([
                [{"title":"工单编号","field":"jobID","type":"like"},{"dataKey":"WorkTypes","data":[],"title":"工单类型","field":"processCode","type":"select"}],
                [{"title":"图号","field":"drawingNo","type":"like"},{"title":"完成时间","field":"FinishTime","type":"datetime"}]
            ]);
            const columns = ref([{field:'mes_id',title:'mes_id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'workOrder',title:'工作令号',type:'string',width:110,align:'left',sort:true},
                       {field:'jobID',title:'工单编号',type:'string',width:110,align:'left'},
@@ -44,6 +47,7 @@
                       {field:'productName',title:'产品名称',type:'string',width:110,align:'left'},
                       {field:'productDesc',title:'产品描述',type:'string',width:180,align:'left'},
                       {field:'quantity',title:'计划数量',type:'int',width:110,require:true,align:'left'},
                       {field:'finishNum',title:'完成数量',type:'int',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'},
@@ -51,12 +55,11 @@
                       {field:'expectedFinishTime',title:'计划完成时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'creator',title:'创建者',type:'string',width:100,align:'left'},
                       {field:'processCode',title:'工单类型',type:'string',width:110,align:'left'},
                       {field:'finishNum',title:'完成数量',type:'int',width:110,align:'left'},
                       {field:'processCode',title:'工单类型',bind: { key: 'WorkTypes' },type:'string',width:110,align:'left'},
                       {field:'area',title:'入库区域代码',type:'string',width:110,align:'left'},
                       {field:'skip_op_1',title:'视觉检测设备1',type:'bool',width:110,align:'left'},
                       {field:'skip_op_2',title:'视觉检测设备2',type:'bool',width:110,align:'left'},
                       {field:'skip_op_3',title:'链条机',type:'bool',width:110,align:'left'},
                       {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:'FinishTime',title:'完成时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'operatetype',title:'操作类型',type:'string',width:110,align:'left'},
                       {field:'compeletor',title:'操作者',type:'string',width:110,align:'left'}]);
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Comm/LogInfo/WriteDBLog.cs
@@ -6,9 +6,12 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm.DBItem;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.FreeDB;
using WIDESEA_Core.ManageUser;
using WIDESEA_Entity.DomainModels;
using WIDESEA_System.IRepositories;
using WIDESEA_System.Repositories;
using WIDESEA_WCS.JobsPart.Common;
namespace WIDESEA_Comm.LogInfo
@@ -88,7 +91,10 @@
        {
            try
            {
                VOLContext context = new VOLContext();
                Idt_log_pcsRepository pcsRepository = new dt_log_pcsRepository(context);
                //dt_log log = new dt_log();
                dt_log_pcs log = new dt_log_pcs();
                log.id = Guid.NewGuid();
                log.createtime = DateTime.Now;
@@ -105,7 +111,14 @@
                    log.info = JsonConvert.SerializeObject(info);
                }
                //StoredProcedure.Main(log, MethodName.Add);
                //var data = pcsRepository.Find(x => x.dataForm == log.dataForm && x.describe == log.describe && x.status == log.status && x.info == log.info).FirstOrDefault();
                //if (data == null)
                StoredProcedure.EXECAdd(log, MethodName.Add);
                //else
                //{
                //    data.createtime = DateTime.Now;
                //    pcsRepository.Update(data, true);
                //}
                //freeDB.Add(log);
            }
            catch (Exception ex)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs
@@ -44,6 +44,23 @@
        public string FigureNumber { get; set; }
        /// <summary>
        ///物料编码
        /// </summary>
        [Display(Name = "物料编码")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        [Editable(true)]
        public string materialCode { get; set; }
        /// <summary>
        ///技术状态
        /// </summary>
        [Display(Name = "技术状态")]
        [MaxLength(10)]
        [Column(TypeName = "nvarchar(10)")]
        [Editable(true)]
        public string drawingNoVer { get; set; }
        /// <summary>
        ///熔炼炉号
        /// </summary>
        //[Display(Name = "熔炼炉号")]
@@ -120,7 +137,9 @@
        [Column(TypeName = "nvarchar(15)")]
        [Editable(true)]
        public string area { get; set; }
        /// <summary>
        /// å·¥ä½œä»¤å·
        /// </summary>
        [Display(Name = "工单编号")]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs
@@ -128,7 +128,7 @@
        public int column { get; set; }
        /// <summary>
        ///工单编号
        ///工单编号/工作令号
        /// </summary>
        [Display(Name = "工单编号")]
        [MaxLength(255)]
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/Taskinfo/dt_agvtask.cs
@@ -85,7 +85,7 @@
        public string agv_taskstate { get; set; }
        /// <summary>
        ///工单类型/AGV工作类型
        ///工单类型(17-机加工 28-检测线 101移库外协)
        /// </summary>
        [Display(Name = "AGV工作类型")]
        [Column(TypeName = "int")]
@@ -173,7 +173,7 @@
        public string agv_remark { get; set; }
        /// <summary>
        ///任务等级  0、暂缓1、正常2、加急
        ///任务等级  0、暂缓1、正常2、加急 3、特急
        /// </summary>
        [Display(Name = "任务等级")]
        [Column(TypeName = "int")]
@@ -233,7 +233,7 @@
        public DateTime? agv_completeBeginTime { get; set; }
        /// <summary>
        ///工单号
        ///工单号/工作令号
        /// </summary>
        [Display(Name = "工单号")]
        [Column(TypeName = "nvarchar(40)")]
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Entity.SystemModels;
namespace WIDESEA_Entity.DomainModels
{
    [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>
       ///炉号
       /// </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 ="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 ="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 ="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 ="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 ="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 ="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; }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/partial/VV_Mes_Workinfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Entity.SystemModels;
namespace WIDESEA_Entity.DomainModels
{
    public partial class VV_Mes_Workinfo
    {
        //此处配置字段(字段配置见此model的另一个partial),如果表中没有此字段请加上 [NotMapped]属性,否则会异常
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs
@@ -11,6 +11,7 @@
using WIDESEA_Comm.LogInfo;
using WIDESEA_Comm.TaskNo;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.FreeDB;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.JobsPart.Common;
@@ -37,6 +38,7 @@
                VOLContext Context = new VOLContext();
                Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context);
                Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context);
                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
                Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context);
                Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context);
                Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context);
@@ -56,32 +58,47 @@
                        if (name == "3单元辊道下料查询车轮") number = "3单元辊道下料查询订单";
                        if (name == "辊道上料查询车轮") number = "辊道上料查询订单";
                        var wp_id = client.ReadByOrder<string>("R_o_wp_id", number);
                        var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == wp_id);
                        if (mes_Detail == null)
                        var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "辊道上料查询车轮" ? "17" : "28")).FirstOrDefault();
                        if (Mes_Work == null)
                        {
                            client.WriteByOrder("W_i_status", (byte)2, name);
                            client.WriteByOrder("R_oi_on", (byte)0, name);
                            #region æ—¥å¿—记录
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单详情", "PCS");
                            #endregion
                            continue;
                        }
                        var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID);
                        if (mes_Head == null)
                        {
                            client.WriteByOrder("W_i_status", (byte)2, name);
                            client.WriteByOrder("R_oi_on", (byte)0, name);
                            #region æ—¥å¿—记录
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单头表", "PCS");
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单信息", "PCS");
                            #endregion
                            continue;
                        }
                        #region MyRegion
                        //var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == wp_id);
                        //if (mes_Detail == null)
                        //{
                        //    client.WriteByOrder("W_i_status", (byte)2, name);
                        //    client.WriteByOrder("R_oi_on", (byte)0, name);
                        //    #region æ—¥å¿—记录
                        //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单详情", "PCS");
                        //    #endregion
                        //    continue;
                        //}
                        //var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID);
                        //if (mes_Head == null)
                        //{
                        //    client.WriteByOrder("W_i_status", (byte)2, name);
                        //    client.WriteByOrder("R_oi_on", (byte)0, name);
                        //    #region æ—¥å¿—记录
                        //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单头表", "PCS");
                        //    #endregion
                        //    continue;
                        //}
                        #endregion
                        if (name != "辊道上料查询车轮")
                        {
                            //var geometry = dataRepository.FindFirst(x => x.TypeId == (Int32)wp_type);
                            var geometry = dataRepository.Find(x => x.Description == mes_Head.drawingNo).FirstOrDefault();
                            var geometry1 = detectionlineRepository.Find(x => x.Description == mes_Head.drawingNo).FirstOrDefault();
                            var geometry = dataRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault();
                            var geometry1 = detectionlineRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault();
                            if (geometry == null && geometry1 == null)
                            {
                                //DBExtension.Write(details.Where(x => x.plcdetail_name == "W_i_status").First(), client, (Int16)2);
@@ -121,8 +138,8 @@
                        }
                        else
                        {
                            var geometry = detectionlineRepository.Find(x => x.Description == mes_Head.drawingNo).FirstOrDefault();
                            var geometry1 = dataRepository.Find(x => x.Description == mes_Head.drawingNo).FirstOrDefault();
                            var geometry = detectionlineRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault();
                            var geometry1 = dataRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault();
                            if (geometry == null && geometry1 == null)
                            {
                                client.WriteByOrder("W_i_status", (byte)2, name);
@@ -183,6 +200,7 @@
                Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context);
                Idt_geometry_data_detectionlineRepository detectionlineRepository = new dt_geometry_data_detectionlineRepository(Context);
                Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context);
                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
                Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context);
                Idt_patternRepository patternRepository = new dt_patternRepository(Context);
                var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName);
@@ -206,16 +224,9 @@
                            continue;
                        }
                        var wp_type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_type").First(), client);
                        var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == wp_id);
                        #region æµ‹è¯•使用
                        //if (mes_Detail == null)
                        //{
                        //    mes_Detail = mes_DetailRepository.FindFirst(x => x.jobID == (name == "3单元辊道下料查询订单" ? "01180127004-2" : "01180127004-1"));
                        //    mes_Detail.SN = wp_id;
                        //    mes_DetailRepository.Update(mes_Detail, true);
                        //}
                        #endregion
                        if (mes_Detail == null)
                        var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "辊道上料查询订单" ? "17" : "28")).FirstOrDefault();
                        if (Mes_Work == null)
                        {
                            client.WriteByOrder("W_i_status", (byte)2, name);
                            client.WriteByOrder("R_oi_on", (byte)0, name);
@@ -224,16 +235,30 @@
                            #endregion
                            continue;
                        }
                        var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID);
                        if (mes_Head == null)
                        {
                            client.WriteByOrder("W_i_status", (byte)2, name);
                            client.WriteByOrder("R_oi_on", (byte)0, name);
                            #region æ—¥å¿—记录
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单头表", "PCS");
                        #region MyRegion
                        //var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == wp_id);
                        //if (mes_Detail == null)
                        //{
                        //    client.WriteByOrder("W_i_status", (byte)2, name);
                        //    client.WriteByOrder("R_oi_on", (byte)0, name);
                        //    #region æ—¥å¿—记录
                        //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单详情", "PCS");
                        //    #endregion
                        //    continue;
                        //}
                        //var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID);
                        //if (mes_Head == null)
                        //{
                        //    client.WriteByOrder("W_i_status", (byte)2, name);
                        //    client.WriteByOrder("R_oi_on", (byte)0, name);
                        //    #region æ—¥å¿—记录
                        //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{wp_id}\n\n写入桁架信息:\nW_i_status:2\nR_oi_on:0\n\n未查询到工单头表", "PCS");
                        //    #endregion
                        //    continue;
                        //}
                            #endregion
                            continue;
                        }
                        var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == Mes_Work.jobID);
                        if (name != "辊道上料查询订单")
                        {
@@ -265,11 +290,11 @@
                            {
                                //1-好,允许加工,2-不在列表中,3-不加工车轮类型,4-手动入库模式人工未选择库区
                                client.WriteByOrder("W_i_status", (byte)1, name);
                                client.WriteByOrder("W_i_job_id", mes_Detail.jobID, name);
                                client.WriteByOrder("W_i_drawing_id", mes_Head.drawingNo, name);
                                client.WriteByOrder("W_i_heat_id", mes_Detail.heatID, name);
                                client.WriteByOrder("W_i_job_id", Mes_Work.jobID, name);
                                client.WriteByOrder("W_i_drawing_id", Mes_Work.drawingNo, name);
                                client.WriteByOrder("W_i_heat_id", Mes_Work.heatID, name);
                                //client.WriteByOrder("W_i_sourceheat", "", name);
                                client.WriteByOrder("W_i_batch_id", mes_Detail.heatBatchID, name);
                                client.WriteByOrder("W_i_batch_id", Mes_Work.heatBatchID, name);
                                //屏蔽工艺(屏蔽视觉检测/屏蔽涂油)
                                //if (name != "辊道上料查询车轮")
@@ -281,7 +306,7 @@
                                client.WriteByOrder("R_oi_on", (byte)0, name);
                                #region æ—¥å¿—记录
                                WriteDBLog.Success(name, $"读取桁架信息:\n车轮SN:{wp_id}\n轮型ID:{wp_type}\n\n写入桁架信息:\nW_i_status:1" +
                                    $"\nW_i_job_id:{mes_Detail.jobID}\nW_i_drawing_id:{mes_Head.drawingNo}\nW_i_heat_id:{mes_Detail.heatID}\nW_i_batch_id:{mes_Detail.heatBatchID}" +
                                    $"\nW_i_job_id:{Mes_Work.jobID}\nW_i_drawing_id:{Mes_Work.drawingNo}\nW_i_heat_id:{Mes_Work.heatID}\nW_i_batch_id:{Mes_Work.heatBatchID}" +
                                    $"\nW_i_skip_op_SJ1:{(name == "3单元辊道下料查询订单" ? true : mes_Head.skip_op_1)}\nW_i_skip_op_SJ2:{(name == "3单元辊道下料查询订单" ? true : mes_Head.skip_op_2)}" +
                                    $"\nW_i_skip_op_LT:{mes_Head.skip_op_3}\nR_oi_on:0", "PCS");
                                #endregion
@@ -305,15 +330,15 @@
                            {
                                //1-好,允许加工,2-不在列表中,3-不加工车轮类型,4-手动入库模式人工未选择库区
                                client.WriteByOrder("W_i_status", (byte)1, name);
                                client.WriteByOrder("W_i_job_id", mes_Detail.jobID, name);
                                client.WriteByOrder("W_i_drawing_id", mes_Head.drawingNo, name);
                                client.WriteByOrder("W_i_heat_id", mes_Detail.heatID, name);
                                client.WriteByOrder("W_i_job_id", Mes_Work.jobID, name);
                                client.WriteByOrder("W_i_drawing_id", Mes_Work.drawingNo, name);
                                client.WriteByOrder("W_i_heat_id", Mes_Work.heatID, name);
                                //client.WriteByOrder("W_i_sourceheat", "", name);
                                client.WriteByOrder("W_i_batch_id", mes_Detail.heatBatchID, name);
                                client.WriteByOrder("W_i_batch_id", Mes_Work.heatBatchID, name);
                                client.WriteByOrder("R_oi_on", (byte)0, name);
                                #region æ—¥å¿—记录
                                WriteDBLog.Success(name, $"读取桁架信息:\n车轮SN:{wp_id}\n轮型ID:{wp_type}\n\n写入桁架信息:\nW_i_status:1" + $"\nW_i_job_id:{mes_Detail.jobID}" +
                                    $"\nW_i_drawing_id:{mes_Head.drawingNo}\nW_i_heat_id:{mes_Detail.heatID}\nW_i_batch_id:{mes_Detail.heatBatchID}\nR_oi_on:0", "PCS");
                                WriteDBLog.Success(name, $"读取桁架信息:\n车轮SN:{wp_id}\n轮型ID:{wp_type}\n\n写入桁架信息:\nW_i_status:1" + $"\nW_i_job_id:{Mes_Work.jobID}" +
                                    $"\nW_i_drawing_id:{mes_Head.drawingNo}\nW_i_heat_id:{Mes_Work.heatID}\nW_i_batch_id:{Mes_Work.heatBatchID}\nR_oi_on:0", "PCS");
                                #endregion
                            }
                        }
@@ -344,6 +369,7 @@
                Idt_geometry_data_detectionlineRepository detectionlineRepository = new dt_geometry_data_detectionlineRepository(Context);
                Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context);
                Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context);
                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
                Idt_patternRepository patternRepository = new dt_patternRepository(Context);
                var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName);
                var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "链条机");
@@ -405,28 +431,38 @@
                            var Wheel_SN = client.ReadByOrder<string>("R_Wheel_id", name);//车轮SN号
                            if (string.IsNullOrEmpty(Wheel_SN))
                            {
                                WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN号为空", "PCS");
                                WriteDBLog.Error(name + "放料完成", $"读取桁架信息:\n车轮SN号为空", "PCS");
                                continue;
                            }
                            //var Wheel_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_id").First(), client).ToString();
                            var Detail = mes_DetailRepository.FindFirst(x => x.SN == Wheel_SN);
                            if (Detail == null)
                            var Mes_Work = workinfoRepository.Find(x => x.SN == Wheel_SN && x.processCode == "17").FirstOrDefault();
                            if (Mes_Work == null)
                            {
                                #region æ—¥å¿—记录
                                WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN号:{Wheel_SN}\n\n未查询到工单详情", "PCS");
                                #endregion
                                continue;
                            }
                            var Head = mes_HeadRepository.FindFirst(x => x.jobID == Detail.jobID && x.processCode == "17");
                            if (Head == null)
                            {
                                #region æ—¥å¿—记录
                                WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN号:{Wheel_SN}\n\n未查询到工单头表{Detail.jobID}", "PCS");
                            #region MyRegion
                            //var Detail = mes_DetailRepository.FindFirst(x => x.SN == Wheel_SN);
                            //if (Detail == null)
                            //{
                            //    #region æ—¥å¿—记录
                            //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN号:{Wheel_SN}\n\n未查询到工单详情", "PCS");
                            //    #endregion
                            //    continue;
                            //}
                            //var Head = mes_HeadRepository.FindFirst(x => x.jobID == Detail.jobID && x.processCode == "17");
                            //if (Head == null)
                            //{
                            //    #region æ—¥å¿—记录
                            //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN号:{Wheel_SN}\n\n未查询到工单头表{Detail.jobID}", "PCS");
                            //    #endregion
                            //    continue;
                            //}
                                #endregion
                                continue;
                            }
                            #endregion
                            var AreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_AreaNr").First(), client);
@@ -448,9 +484,9 @@
                            station.quantity++;
                            if (station.quantity == 1)
                            {
                                station.stationType = Head.drawingNo;
                                station.Number = Head.jobID;
                                station.heatNumber = Detail.heatID;
                                station.stationType = Mes_Work.drawingNo;
                                station.Number = Mes_Work.workOrder;
                                station.heatNumber = Mes_Work.heatID;
                                station.tray_status = "StrogeTray";
                            }
@@ -473,11 +509,13 @@
                            //client.WriteByOrder("W_Enabl_Load", false, name);//是否允许
                            #region ä¿®æ”¹å·¥å•状态
                            var Detail = mes_DetailRepository.FindFirst(x => x.jobID == Mes_Work.jobID && x.SN == Mes_Work.SN);
                            Detail.Status = "下线";
                            Detail.FinishTime = DateTime.Now;
                            count = mes_DetailRepository.Update(Detail, true);
                            if (count < 1)
                                throw new Exception($"工单子表信息更新失败!车轮SN号:{Detail.SN}");
                            var Head = mes_HeadRepository.FindFirst(x => x.jobID == Detail.jobID);
                            Head.finishNum = Head.finishNum + 1;
                            count = mes_HeadRepository.Update(Head, true);
                            if (count < 1)
@@ -505,30 +543,40 @@
                        var Request = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Request_Load").First(), client);
                        if (!Request) 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号
                        if (string.IsNullOrEmpty(Wheel_id)) continue;
                        //var Wheel_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_id").First(), client).ToString();
                        var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == Wheel_id);
                        if (mes_Detail == null)
                        var Work = workinfoRepository.Find(x => x.SN == Wheel_id && x.processCode == "17").FirstOrDefault();
                        if (Work == null)
                        {
                            #region æ—¥å¿—记录
                            client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{Wheel_id}\n\n未查询到工单详情", "PCS");
                            #endregion
                            continue;
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{Wheel_id}\n\n未查询到工单信息", "PCS");
                        }
                        var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID);
                        if (mes_Head == null)
                        {
                            #region æ—¥å¿—记录
                            client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                            WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{Wheel_id}\n\n未查询到工单头表", "PCS");
                        #region MyRegion
                        //var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == Wheel_id);
                        //if (mes_Detail == null)
                        //{
                        //    #region æ—¥å¿—记录
                        //    client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                        //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{Wheel_id}\n\n未查询到工单详情", "PCS");
                        //    #endregion
                        //    continue;
                        //}
                        //var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID);
                        //if (mes_Head == null)
                        //{
                        //    #region æ—¥å¿—记录
                        //    client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                        //    WriteDBLog.Error(name, $"读取桁架信息:\n车轮SN:{Wheel_id}\n\n未查询到工单头表", "PCS");
                        //    #endregion
                        //    continue;
                        //}
                            #endregion
                            continue;
                        }
                        #endregion
@@ -538,11 +586,12 @@
                        if (name == "2单元下料区") NGStation = "X02001003";
                        if (name == "3单元下料区") NGStation = "X03001002";
                        foreach (var station in Stations)     //任何一个下料位为空或禁用时,都会停止桁架
                        {
                            if (!station.enable || station.location_state == LocationStateEnum.Empty.ToString())
                                client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                        }
                        //foreach (var station in Stations)     //任何一个下料位为空或禁用时,都会停止桁架
                        //{
                        //    if (!station.enable || station.location_state == LocationStateEnum.Empty.ToString())
                        //        client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                        //}
                        #region MyRegion
                        //var currentAreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_Are00aNr").First(), client);
                        //var currentAreaCode = PipelineJob.area_code(name);   //根据下料口单元名获取区域代码
@@ -552,8 +601,8 @@
                        #endregion
                        var wheel = PipelineJob.QueryMateriel(mes_Head.drawingNo);
                        var wheel1 = PipelineJob.QueryMateriel1(mes_Head.drawingNo);
                        var wheel = PipelineJob.QueryMateriel(Work.drawingNo);
                        var wheel1 = PipelineJob.QueryMateriel1(Work.drawingNo);
                        if (wheel == null && wheel1 == null)
                        {
                            #region æ—¥å¿—记录
@@ -565,22 +614,23 @@
                        var PartStatus = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PartStatus").First(), client);//1:ok;2:nok
                        #region æ—¥å¿—记录
                        WriteDBLog.Success(name + "申请放料", $"读取桁架信息:\n车轮SN:{Wheel_id}\n轮型ID:{Wheel_Type}\n车轮状态:{PartStatus}", "PCS");
                        WriteDBLog.Success(name + "申请放料", $"读取桁架信息:\n车轮SN:{Wheel_id}\n轮型ID:{Wheel_Type}\n车轮状态:{PartStatus}\n是否进入下料区:{load_zone}", "PCS");
                        if (load_zone) continue;
                        #endregion
                        if ((Int16)PartStatus == 1)
                        {
                            dt_stationinfo Stationinfo = null;
                            if (mes_Detail.heatID != null)
                            if (Work.heatID != null)
                            {
                                Stationinfo = Stations
                           .Where(x => x.enable
                           && x.stationCode != NGStation
                           && x.location_state == LocationStateEnum.Stroge.ToString()
                           && x.quantity < 5
                           && x.stationType == mes_Head.drawingNo
                           && x.stationType == Work.drawingNo
                           && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                           && x.Number == mes_Detail.jobID
                           && x.heatNumber == mes_Detail.heatID)
                           && x.Number == Work.workOrder
                           && x.heatNumber == Work.heatID)
                           .OrderByDescending(x => x.quantity)
                           .FirstOrDefault();
                            }
@@ -591,9 +641,9 @@
                           && x.stationCode != NGStation
                           && x.location_state == LocationStateEnum.Stroge.ToString()
                           && x.quantity < 5
                           && x.stationType == mes_Head.drawingNo
                           && x.stationType == Work.drawingNo
                           && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                           && x.Number == mes_Detail.jobID)
                           && x.Number == Work.workOrder)
                           .OrderByDescending(x => x.quantity)
                           .FirstOrDefault();
                            }
@@ -613,23 +663,12 @@
                                var NG = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
                                if (NG != null)
                                {
                                    if (NG.stationType != mes_Head.drawingNo)
                                        agvtask(stationinfoRepository, NG, (wheel == null ? wheel1.e : wheel.e), "TaskType_OutsourceInbound");
                                    if (NG.stationType != Work.drawingNo || NG.Number != Work.workOrder)
                                        agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound");
                                }
                                #endregion
                                Stationinfo = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 0).FirstOrDefault();
                                #region æ²¡æ‰˜ç›˜å¯ç”¨,触发入库任务
                                if (Stationinfo == null)
                                {
                                    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, (wheel == null ? wheel1.e : wheel.e), name == "3单元下料区" ? "TaskType_OutsourceInbound" : "TaskType_Inbound");
                                    }
                                }
                                #endregion
                                #region MyRegion
                                //var stationinfo = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
@@ -675,9 +714,23 @@
                                    #region è´§ä½æ•°é‡ä¸Žå…‰ç”µä¸åŒ¹é…ï¼ŒæŠ¥è­¦
                                    if (list.Count > 0 && MaterialSignal != 1)
                                    {
                                        client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                                        Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                                    //else if (list.Count < 1 && MaterialSignal == 1)
                                    //    Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                                        Stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
                                        Stationinfo.remark = "车轮数量与光电不匹配";
                                        stationinfoRepository.Update(Stationinfo, true);
                                        //WriteDBLog.Error(name+"申请下料",$"{Stationinfo.stationCode}的货位","PCS");
                                    }
                                    else if (list.Count < 1 && MaterialSignal == 1)
                                    {
                                        client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
                                        Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                                        Stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
                                        Stationinfo.remark = "车轮数量与光电不匹配";
                                        stationinfoRepository.Update(Stationinfo, true);
                                    }
                                    #endregion
                                    //缓存架上车轮数量与SN号数量不一致
@@ -703,6 +756,17 @@
                                    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 if ((Int16)PartStatus == 2)
                        {
@@ -728,18 +792,18 @@
                        && x.stationCode == NGStation
                        && x.location_state == LocationStateEnum.Stroge.ToString()
                        && x.quantity < 5
                        && x.stationType == mes_Head.drawingNo
                        && x.stationType == Work.drawingNo
                        && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")
                        /*&& x.Number == mes_Detail.jobID*/).FirstOrDefault();
                            //}
                            if (Stationinfo == null)
                            {
                                var stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
                                if (stationinfo != null)
                                {
                                    agvtask(stationinfoRepository, stationinfo, (wheel == null ? wheel1.e : wheel.e), "TaskType_OutsourceInbound");
                                }
                                //var stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
                                //if (stationinfo != null)
                                //{
                                //    agvtask(stationinfoRepository, stationinfo, (wheel == null ? wheel1.e : wheel.e), "TaskType_OutsourceInbound");
                                //}
                                Stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 0).FirstOrDefault();
                            }
                            if (Stationinfo != null)
@@ -772,8 +836,8 @@
                                    #region è´§ä½æ•°é‡ä¸Žå…‰ç”µä¸åŒ¹é…ï¼ŒæŠ¥è­¦
                                    if (list.Count > 0 && MaterialSignal != 1)
                                        Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                                    //else if (list.Count < 1 && MaterialSignal == 1)
                                    //    Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                                    else if (list.Count < 1 && MaterialSignal == 1)
                                        Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                                    #endregion
                                    //缓存架上车轮数量与SN号数量不一致
@@ -870,7 +934,7 @@
        /// <summary>
        /// AGV任务
        /// </summary>
        public void agvtask(Idt_stationinfoRepository stationinfoRepository, dt_stationinfo stationinfo, float e, string tasktype)
        public void agvtask(Idt_stationinfoRepository stationinfoRepository, dt_stationinfo stationinfo, VV_Mes_Workinfo Work, string tasktype)
        {
            VOLContext Context = new VOLContext();
            Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
@@ -878,23 +942,24 @@
            var task = agvtaskRepository.Find(x => x.agv_fromaddress == stationinfo.stationCode).FirstOrDefault();
            if (task != null) return;
            var mes_Head = mes_HeadRepository.Find(x => x.jobID == stationinfo.Number).FirstOrDefault();
            if (mes_Head == null)
            {
                stationinfo.remark = "触发入库任务,但未找到工单头表!";
                stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
                stationinfoRepository.Update(stationinfo, true);
                return;
            }
            //var mes_Head = mes_HeadRepository.Find(x => x.jobID == Work.jobID).FirstOrDefault();
            //if (mes_Head == null)
            //{
            //    stationinfo.remark = "触发入库任务,但未找到工单头表!";
            //    stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
            //    stationinfoRepository.Update(stationinfo, true);
            //    return;
            //}
            dt_stationinfo TargetLocation = null;
            int CompeletedNum = Convert.ToInt32(mes_Head.quantity) - Convert.ToInt32(mes_Head.finishNum);
            if (mes_Head.quantity <= 50) tasktype = "TaskType_OutsourceInbound";
            //int CompeletedNum = Convert.ToInt32(mes_Head.quantity) - Convert.ToInt32(mes_Head.finishNum);
            //if (mes_Head.quantity <= 50) tasktype = "TaskType_OutsourceInbound";
            if (tasktype == "TaskType_OutsourceInbound")
                TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository);
            else if (tasktype == "TaskType_Inbound")
                TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository, mes_Head, stationinfo, CompeletedNum, e);
                TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, Work, stationinfo);
            //TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, mes_Head, stationinfo);
            if (TargetLocation != null)
            {
                dt_agvtask agvtask = new dt_agvtask()
@@ -911,8 +976,8 @@
                    agv_toaddress = TargetLocation.stationCode,
                    agv_userid = "系统",
                    bindSN = stationinfo.bindSN,
                    agv_worktype = Convert.ToInt32(mes_Head.processCode),
                    agv_materbarcode = mes_Head.materialCode,
                    agv_worktype = Convert.ToInt32(Work.processCode),
                    agv_materbarcode = Work.materialCode,
                    agv_Traytype = stationinfo.tray_type,
                    jobID = stationinfo.Number,
                    agv_TrayStatus = stationinfo.tray_status
@@ -922,6 +987,8 @@
                stationinfoRepository.Update(stationinfo, true);
                TargetLocation.location_state = LocationStateEnum.InBusy.ToString();
                TargetLocation.stationType = agvtask.agv_materielid;
                TargetLocation.heatNumber = stationinfo.heatNumber;
                TargetLocation.Number = agvtask.jobID;
                stationinfoRepository.Update(TargetLocation, true);
            }
        }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IRepositories/ToMES/IVV_Mes_WorkinfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹IVV_Mes_WorkinfoRepository编写接口
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Core.Extensions.AutofacManager;
namespace WIDESEA_WMS.IRepositories
{
    public partial interface IVV_Mes_WorkinfoRepository : IDependency,IRepository<VV_Mes_Workinfo>
    {
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/IVV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 */
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WMS.IServices
{
    public partial interface IVV_Mes_WorkinfoService : IService<VV_Mes_Workinfo>
    {
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/IVV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
/*
*所有关于VV_Mes_Workinfo类的业务代码接口应在此处编写
*/
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Core.Utilities;
using System.Linq.Expressions;
namespace WIDESEA_WMS.IServices
{
    public partial interface IVV_Mes_WorkinfoService
    {
    }
 }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs
@@ -9,5 +9,11 @@
{
    public partial interface Idt_mes_headService
    {
        /// <summary>
        /// æ‰‹åŠ¨å®Œæˆå·¥å•
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        WebResponseContent FinishWorkOrder(SaveModel saveModel);
    }
 }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/Task/AutoTaskJob.cs
@@ -33,7 +33,8 @@
            //throw new NotImplementedException();
            //Creation.PLCinfodetail();
            //ReplaceTray.a();
            //EmptyTrayTask.InEmptyTrayTask();库内空托任务
            //EmptyTrayTask.InEmptyTrayTask(); //库内空托任务
            //EmptyTrayTask.task();
            StationTask.CreateTask();
            //OutboundTask.CreateOutboundTask();
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs
@@ -79,11 +79,11 @@
                ///查找上料区的货位
                var Stations = stationinfoRepository.Find(x => x.area == area_code(number));
                //缓存架未启用禁止桁架进入
                foreach (var station in Stations)
                {
                    if (!station.enable || station.location_state != LocationStateEnum.Stroge.ToString())
                        Gantry_client.WriteByOrder("W_RequestUnload", false, number);//信号为false桁架停止进入
                }
                //foreach (var station in Stations)
                //{
                //    if (!station.enable || station.location_state != LocationStateEnum.Stroge.ToString())
                //        Gantry_client.WriteByOrder("W_RequestUnload", false, number);//信号为false桁架停止进入
                //}
                var Station = Stations?.Where(x => x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderBy(x => x.quantity).FirstOrDefault();
                if (Station != null)
@@ -140,10 +140,10 @@
                        var Date_Vaild = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Date_Vaild").First(), Gantry_client);//信息确认
                        if (!Date_Vaild)//信息有误,记录日志
                        {
                            Gantry_client.WriteByOrder("W_RequestUnload", false, number);//信号为false桁架停止进入
                            Station.location_state = LocationStateEnum.Abnormal.ToString();
                            Station.remark = $"未查询到SN号:{SNS[SNS.Length - 1]}的订单";
                            stationinfoRepository.Update(Station, true);
                            Gantry_client.WriteByOrder("W_RequestUnload", false, number);//信号为false桁架停止进入
                            //throw new Exception($"未查询到SN号:{SNS[SNS.Length - 1]}的订单,上料位编号:{Station.stationCode}");
                            WriteDBLog.Error("上料区信息查询", $"写入桁架信息:\nW_RequestUnload:false\n\n{Station.stationCode}未查询到SN号:{SNS[SNS.Length - 1]}的订单", "PCS");
                            return;
@@ -178,16 +178,23 @@
                        #region æ—¥å¿—记录
                        WriteDBLog.Success("取料完成", $"写入桁架信息:\n货位状态更新:{true}\nW_RequestUnload:{false}", "PCS");
                        #endregion
                        //finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client);
                        //while (finished)
                        //{
                        //    finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client);
                        //    Gantry_client.WriteByOrder("W_Storage_update", false, number);//货位状态更新
                        //}
                        PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读取托盘信号:1:有,2无
                        MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//读取货物信号:1:有,2无
                        if (Station.quantity > 0 && (PalletSignal != 1 || MaterialSignal != 1))
                        {
                            Station.location_state = LocationStateEnum.Abnormal.ToString();
                            Station.remark = "车轮数量大于0,光电检测无托盘或无车轮";
                            stationinfoRepository.Update(Station, true);
                            client.WriteByOrder("W_AlarmSignal", (Int16)2, number);//报警
                    }
                    //else if (!finished && updatefinished)
                    //    Gantry_client.WriteByOrder("W_Storage_update", false, number);//货位状态更新
                        else if (Station.quantity < 1 && MaterialSignal == 1)
                        {
                            Station.location_state = LocationStateEnum.Abnormal.ToString();
                            Station.remark = "车轮数量小于0,光电检测有车轮";
                            stationinfoRepository.Update(Station, true);
                            client.WriteByOrder("W_AlarmSignal", (Int16)2, number);//报警
                        }
                    }
                }
                else
                    Gantry_client.WriteByOrder("W_RequestUnload", false, number);//信号为false桁架停止进入
@@ -224,20 +231,37 @@
                    if (PalletSignal == 1 && MaterialSignal == 2 && (station.stationCode.Contains("S0100100") ? station.tray_status == "EmptyTray" : true))
                    {
                        var area = station.tray_type == "SmallTray" ? "11" : "10";
                        var task = agvtaskService.Find(x => (x.agv_toaddress.Contains("W") || x.agv_toaddress.Contains("X")) && x.agv_taskstate == "Queue" /*&& x.agv_tasktype == "TaskType_EmptyPallet" */ && x.agv_Traytype == station.tray_type).OrderBy(x => x.agv_createtime).FirstOrDefault();
                        var task = agvtaskService.Find(x => (x.agv_toaddress.Contains("W") || x.agv_toaddress.Contains("X")) && x.agv_taskstate == "Queue" /*&& x.agv_tasktype == "TaskType_EmptyPallet" */ && x.agv_Traytype == station.tray_type).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault();
                        if (task != null)
                        {
                            task.agv_fromaddress = station.stationCode;
                            task.StarQuantity = 0;
                            task.agv_taskstate = "Create";
                            if (station.stationCode.Contains("S0100100"))
                                task.agv_grade = 3;
                            agvtaskService.Update(task, true);
                            station.location_state = LocationStateEnum.Busy.ToString();
                            stationinfoRepository.Update(station, true);
                            continue;
                        }
                        #region æŸ¥æ‰¾åº“区一空托盘空货位
                        var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable)
                        .OrderByDescending(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                        .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;
                            }
                        }
                        #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();//最后一个货位有任务则不能生成入库任务
@@ -258,7 +282,7 @@
                                agv_fromaddress = station.stationCode,
                                agv_id = Guid.NewGuid(),
                                agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                                agv_grade = 1,
                                agv_grade = station.stationCode.Contains("S0100100") ? 3 : 1,
                                agv_createtime = DateTime.Now,
                                agv_taskstate = "Create",
                                //agv_materielid = station.stationType,
@@ -296,7 +320,7 @@
        {
            try
            {
                List<string> names = new List<string>() { "1单元下料区", "2单元下料区", "3单元下料区", "上料区" };
                List<string> names = new List<string>() { "1单元下料区", "2单元下料区", "3单元下料区" };/*, "上料区"*/
                foreach (var name in names)
                {
                    VOLContext Context = new VOLContext();
@@ -392,8 +416,10 @@
            VOLContext Context = new VOLContext();
            Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context);
            Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context);
            IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
            //var mes_Detail = freeDB.Select<dt_mes_detail>().Where(x => x.SN == SN).First();
            var mes_Detail = mes_DetailRepository.Find(x => x.SN == SN).FirstOrDefault();
            var Mes_Work = workinfoRepository.Find(x => x.SN == SN && x.processCode == "28").FirstOrDefault();
            var mes_Detail = mes_DetailRepository.Find(x => x.SN == SN && x.jobID == Mes_Work.jobID).FirstOrDefault();
            if (mes_Detail != null)
            {
                mes_Detail.Status = "上线";
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/AutoUpdateWork.cs
@@ -82,7 +82,7 @@
                foreach (var mes_head in mes_head_jjgs)
                {
                    var inventorys = inventoryRepository.Find(x => x.jobID == mes_head.jobID).ToList();
                    if (inventorys.Count == mes_head.finishNum)
                    if (inventorys.Count == mes_head.quantity)
                        AddHtyMesWork(mes_head, mes_HeadRepository);
                }
            }
@@ -92,7 +92,7 @@
        /// <summary>
        /// å·²å®Œæˆå·¥å•移入历史
        /// </summary>
        public static void AddHtyMesWork(dt_mes_head mes_Head, Idt_mes_headRepository mes_HeadRepository, string compeletor = "系统", string operatetype = "自动完成")
        public static void AddHtyMesWork(dt_mes_head mes_Head, Idt_mes_headRepository mes_HeadRepository, string compeletor = "system", string operatetype = "自动完成")
        {
            try
            {
@@ -157,11 +157,11 @@
                };
                mes_Head_HtyRepository.Add(mes_Head_Hty, true);
                mes_HeadRepository.Delete(mes_Head, true);
                WriteDBLog.Success("处理已完成工单", $"工单编号:{mes_Head.jobID}", "PCS");
                WriteDBLog.Success("处理已完成工单", $"工单编号:{mes_Head.jobID}", "PCS", compeletor);
            }
            catch (Exception ex)
            {
                WriteDBLog.Error("处理已完成工单", $"错误信息:{ex.Message}", "PCS");
                WriteDBLog.Error("处理已完成工单", $"错误信息:{ex.Message}", "PCS", compeletor);
            }
        }
    }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/EmptyTrayTask.cs
@@ -48,7 +48,7 @@
                            agv_fromaddress = "",
                            agv_id = Guid.NewGuid(),
                            agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                            agv_grade = 2,
                            agv_grade = station.stationCode.Contains("W0100100") ? 3 : 2,
                            agv_createtime = DateTime.Now,
                            agv_taskstate = "Queue",
                            agv_qty = 1,
@@ -81,41 +81,69 @@
                VOLContext context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
                Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context);
                var stations = stationinfoRepository.Find(x => x.area == "2" && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.line).OrderBy(x => x.column).ToList();
                if (stations.Count < 1)
                {
                    stations = stationinfoRepository.Find(x => x.area == "3" && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.line).OrderBy(x => x.column).ToList();
                }
                var stations = stationinfoRepository.Find(x => x.stationCode.Contains("C01004") && x.enable && x.location_state == LocationStateEnum.Stroge.ToString()).OrderByDescending(x => x.column).ToList();
                //if (stations.Count < 1)
                //{
                //    stations = stationinfoRepository.Find(x => x.area == "3" && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.line).OrderBy(x => x.column).ToList();
                //}
                foreach (var station in stations)
                {
                    if (agvtaskRepository.Find(x => x.agv_toaddress == station.stationCode).Any())
                    if (agvtaskRepository.Find(x => x.agv_fromaddress == station.stationCode).Any())
                        continue;
                    dt_agvtask taskPart = new dt_agvtask()
                    {
                        agv_fromaddress = "",
                        agv_fromaddress = station.stationCode,
                        agv_id = Guid.NewGuid(),
                        agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                        agv_grade = 2,
                        agv_grade = 1,
                        agv_createtime = DateTime.Now,
                        agv_taskstate = "Queue",
                        //agv_materielid = station.stationType,
                        agv_qty = 1,
                        StarQuantity = 0,
                        EndQuantity = 0,// EmptyStation.quantity,
                        agv_tasktype = "TaskType_EmptyPallet",
                        agv_toaddress = station.stationCode,
                        agv_toaddress = "",// EmptyStation.stationCode,
                        agv_userid = "系统",
                        agv_TrayStatus = "EmptyTray",// station.tray_status, "SmallTray" : "LargeTray"
                        agv_Traytype = station.area == "4" ? "LargeTray" : "SmallTray",
                        agv_TrayStatus = "EmptyTray",//station.tray_status,
                        agv_Traytype = station.tray_type,
                    };
                    agvtaskRepository.Add(taskPart, true);
                    station.location_state = LocationStateEnum.InBusy.ToString();
                    station.location_state = LocationStateEnum.OutBusy.ToString();
                    stationinfoRepository.Update(station, true);
                    WriteDBLog.Success("创建补库内空托任务", $"任务编号:{taskPart.agv_tasknum}", "PCS");
                    //WriteDBLog.Success("创建空托任务", $"任务编号:{taskPart.agv_tasknum}", "PCS");
                }
            }
            catch (Exception ex)
            {
                WriteDBLog.Error("创建补库内空托任务", $"错误信息:{ex.Message}", "PCS");
                //WriteDBLog.Error("创建补库内空托任务", $"错误信息:{ex.Message}", "PCS");
                //throw;
            }
        }
        public static void task()
        {
            VOLContext context = new VOLContext();
            Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
            Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context);
            var tasks = agvtaskRepository.Find(x => x.agv_taskstate == "Queue").OrderBy(x => x.agv_createtime).ToList();
            foreach (var task in tasks)
            {
                if (task.agv_tasktype == "TaskType_EmptyPallet")
                {
                    if (task.agv_toaddress == "")
                    {
                        var EmptyStation = stationinfoRepository.Find(x => x.area == "11" && x.stationCode.Contains("A") && x.quantity < 5 && x.enable).OrderByDescending(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                        if (EmptyStation == null) return;
                        if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) return;
                        task.agv_toaddress = EmptyStation.stationCode;
                        task.EndQuantity = EmptyStation.quantity;
                        task.agv_taskstate = "Create";
                        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        agvtaskRepository.Update(task, true);
                    }
                }
            }
        }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs
@@ -29,8 +29,9 @@
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                var tasks = agvtaskService.Find(x => x.agv_taskstate == "Queue").OrderBy(x => x.agv_createtime).ToList();
                var tasks = agvtaskService.Find(x => x.agv_taskstate == "Queue").OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).ToList();
                foreach (var task in tasks)
                {
                    if (task.agv_tasktype == "TaskType_EmptyPallet")//空托任务
@@ -42,9 +43,9 @@
                            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).OrderBy(x => x.line).FirstOrDefault();
                            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)
@@ -107,6 +108,26 @@
                            }
                        }
                    }
                    else if (task.agv_tasktype == "TaskType_OutsourceCarry")//外协移库
                    {
                        if (task.agv_toaddress == "")
                        {
                            var TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository);
                            if (TargetLocation != null)
                            {
                                if (agvtaskService.Find(x => x.agv_toaddress == TargetLocation.stationCode).Any()) continue;
                                task.agv_taskstate = "Create";
                                task.agv_toaddress = TargetLocation.stationCode;
                                TargetLocation.location_state = LocationStateEnum.OutBusy.ToString();
                                TargetLocation.stationType = task.agv_materielid;
                                stationinfoRepository.Update(TargetLocation, true);
                                agvtaskService.Update(task, true);
                                WriteDBLog.Success("更新出库队列任务", $"任务编号:{task.agv_tasknum}", "PCS");
                                return;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs
@@ -34,6 +34,7 @@
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
                Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(context);
                Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context);
                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context);
                var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "链条机");
                if (Pipeline_client == null) throw new Exception("链条机调度服务未开启!");
@@ -43,6 +44,9 @@
                foreach (var item in stationinfos)
                {
                    //判定任务是否已创建//如已存在
                    if (agvtaskRepository.Find(x => x.agv_fromaddress == item.stationCode).Any())
                        continue;
                    var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", item.stationCode);//读取托盘信号:1:有,2无
                    var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", item.stationCode);//读取货物信号:1:有,2无
@@ -50,31 +54,38 @@
                    //根据下料口的绑定信息查询对应工单,检测此工单是否已完成  å®Œæˆå³å¯å°†å…¶é€å…¥åº“
                    dt_mes_head mesinfo = mes_HeadRepository.Find(x => x.jobID == item.Number).FirstOrDefault();
                    if (mesinfo == null)
                    var work = workinfoRepository.Find(x => x.workOrder == item.Number && x.drawingNo == x.drawingNo && x.heatID == item.heatNumber).FirstOrDefault();
                    if (work == null)
                    {
                        item.remark = "触发入库任务,但未找到工单头表!";
                        item.remark = "触发入库任务,但未找到工单信息!";
                        item.location_state = LocationStateEnum.Abnormal.ToString();
                        stationinfoRepository.Update(item, true);
                        continue;
                        //throw new Exception("未找到工单头表!工单号:" + item.Number);
                    }
                    var dt_Geometry_Data = PipelineJob.QueryMateriel(mesinfo.drawingNo);
                    var dt_Geometry_Data1 = PipelineJob.QueryMateriel1(mesinfo.drawingNo);
                    int CompeletedNum = Convert.ToInt32(mesinfo.quantity) - Convert.ToInt32(mesinfo.finishNum);
                    //dt_mes_head mesinfo = mes_HeadRepository.Find(x => x.workOrder == item.Number).FirstOrDefault();
                    //if (mesinfo == null)
                    //{
                    //    item.remark = "触发入库任务,但未找到工单头表!";
                    //    item.location_state = LocationStateEnum.Abnormal.ToString();
                    //    stationinfoRepository.Update(item, true);
                    //    continue;
                    //    //throw new Exception("未找到工单头表!工单号:" + item.Number);
                    //}
                    //var dt_Geometry_Data = PipelineJob.QueryMateriel(mesinfo.drawingNo);
                    //var dt_Geometry_Data1 = PipelineJob.QueryMateriel1(mesinfo.drawingNo);
                    //int CompeletedNum = Convert.ToInt32(mesinfo.quantity) - Convert.ToInt32(mesinfo.finishNum);
                    //判定任务是否已创建//如已存在
                    if (agvtaskRepository.Find(x => x.agv_fromaddress == item.stationCode).Any())
                        continue;
                    dt_stationinfo TargetLocation = null;
                    string tasktype = "";
                    if (item.quantity == 5 || CompeletedNum == 0)  //循环读取车轮数为5或者订单已完成数量的下料口    â†’工单人工关闭的工单
                    if (item.quantity == 5 /*|| CompeletedNum == 0*/)  //循环读取车轮数为5或者订单已完成数量的下料口    â†’工单人工关闭的工单
                    {
                        if (mesinfo.quantity <= 50 || item.stationCode.Contains("3"))    //小于50件直接出库
                        if (/*(mesinfo.quantity <= 50 && string.IsNullOrEmpty(mesinfo.area)) ||*/ item.stationCode.Contains("3"))    //小于50件直接出库
                        {
                            //todo å¯»æ‰¾å¯æ”¾è´§å¤–协放货台
                            tasktype = "TaskType_OutsourceInbound";
@@ -85,7 +96,8 @@
                        {
                            //todo:  è°ƒç”¨WMS接口创建任务
                            tasktype = "TaskType_Inbound";
                            TargetLocation = GetEmptyLocation(stationinfoRepository, mesinfo, item, CompeletedNum, dt_Geometry_Data == null ? dt_Geometry_Data1.e : dt_Geometry_Data.e);
                            TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, work, item);
                            //TargetLocation = GetEmptyLocation(stationinfoRepository, mesinfo, item, CompeletedNum, dt_Geometry_Data == null ? dt_Geometry_Data1.e : dt_Geometry_Data.e);
                        }
                        if (TargetLocation != null)
                        {
@@ -103,8 +115,8 @@
                                agv_toaddress = TargetLocation.stationCode,
                                agv_userid = "系统",
                                bindSN = item.bindSN,
                                agv_worktype = Convert.ToInt32(mesinfo.processCode),
                                agv_materbarcode = mesinfo.materialCode,
                                agv_worktype = Convert.ToInt32(work.processCode),
                                agv_materbarcode = work.materialCode,
                                agv_Traytype = item.tray_type,
                                jobID = item.Number,
                                agv_TrayStatus = item.tray_status
@@ -116,6 +128,8 @@
                            TargetLocation.location_state = LocationStateEnum.InBusy.ToString();
                            TargetLocation.stationType = agvtask.agv_materielid;
                            TargetLocation.heatNumber = item.heatNumber;
                            TargetLocation.Number = agvtask.jobID;
                            stationinfoRepository.Update(TargetLocation, true);
                            WriteDBLog.Success("创建入库任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
                        }
@@ -142,8 +156,10 @@
            dt_stationinfo TargetLocation = null;
            #region åŒç±»åž‹æ”¾ä¸€è¡Œ
            var area1 = GetArea(mesinfo.quantity, e);
            TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo && x.area == area1).OrderByDescending(x => x.line).OrderBy(x => x.column).FirstOrDefault();
            //if (area1 == "1")
            TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo).FirstOrDefault();
            //TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo && x.area == area1).OrderByDescending(x => x.line).OrderBy(x => x.column).FirstOrDefault();
            if (TargetLocation != null)
            {
                #region åŒä¸€è¡Œåªå…è®¸ä¸€ä¸ªä»»åŠ¡
@@ -152,14 +168,33 @@
                //    return null;
                #endregion
                #region å‡ºåº“任务优先,存在出库任务这一行则不能入库
                var OutTask = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == area1 && x.location_state == LocationStateEnum.OutBusy.ToString()).Any();
                if (OutTask) return null;
                #region å‡ºåº“任务优先,存在出库任务则不能入库
                bool OutTask = false;
                if (TargetLocation.area == "1")
                {
                    TargetLocation = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderByDescending(x => x.line).FirstOrDefault();
                    if (TargetLocation != null)
                        OutTask = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.OutBusy.ToString()).Any();
                    if (OutTask)//这列存在出库任务,寻找一列空货位
                        TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.column).FirstOrDefault();
                    if (TargetLocation != null) return TargetLocation;
                }
                else
                {
                    TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.column).FirstOrDefault();
                    if (TargetLocation != null)
                        OutTask = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any();
                    //库内存在出库任务,重新开一行入库
                    if (OutTask)
                        TargetLocation = stationinfoRepository.Find(x => x.column == (TargetLocation.area == "2" ? 1 : 10) && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.line).FirstOrDefault();
                    if (TargetLocation != null) return TargetLocation;
                }
                #endregion
                TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == area1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                if (TargetLocation != null)
                    return TargetLocation;
                //TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                //if (TargetLocation != null)
                //    return TargetLocation;
            }
            #endregion
@@ -249,15 +284,19 @@
                stationinfoRepository.Update(stationinfo, true);
                return null;
            }
            #region æŸ¥æ‰¾åº“å­˜
            dt_inventory inventory = null;
            if (detail.heatID != null)
            {
                inventory = inventoryRepository.Find(x => /*x.HeatNumber == detail.heatID &&*/ x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).FirstOrDefault();
                inventory = inventoryRepository.Find(x => /*x.HeatNumber == detail.heatID &&*/ x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
            }
            else
            {
                inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).FirstOrDefault();
                inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
            }
            #endregion
            #region æ ¹æ®åº“存查找可入库空货位
            if (inventory != null)
@@ -277,8 +316,9 @@
            var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area;
            if (CompeletedNum <= 15)
            if (CompeletedNum <= 15 || area1 == "1")
            {
                TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault();
            }
@@ -289,17 +329,31 @@
                //else if (180 < mesinfo.quantity && mesinfo.quantity <= 225 && e < 1100)
                //    TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == "3" && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault();
                //if (50 < mesinfo.quantity && e > 1100 || TargetLocation == null)
                var area = GetArea(mesinfo.quantity, e);
                //var area = GetArea(mesinfo.quantity, e);
                TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault();
                TargetLocation = stationinfoRepository.Find(x => x.column == (area1 == "2" ? 1 : 10) && x.area == area1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                if (TargetLocation == null)
                {
                    if (area == "2")
                        area = "3";
                    else if (area == "3")
                        area = "2";
                    TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault();
                    if (area1 == "2")
                        area1 = "3";
                    else if (area1 == "3")
                        area1 = "2";
                    TargetLocation = stationinfoRepository.Find(x => x.column == (area1 == "2" ? 1 : 10) && x.area == area1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                    if (TargetLocation == null)
                    {
                        //TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo && x.area == "1").OrderByDescending(x => x.column).FirstOrDefault();
                        //if (TargetLocation != null)
                        //    TargetLocation = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderByDescending(x => x.line).FirstOrDefault();
                        //if (TargetLocation == null)
                        //    TargetLocation = stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).OrderByDescending(x => x.line).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();
                    }
                }
                //if (TargetLocation == null)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ÐÂÎļþ¼Ð/GetLocation.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,271 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.Repositories;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static System.Collections.Specialized.BitVector32;
namespace WIDESEA_WCS.JobsPart.Common
{
    public class GetLocation
    {
        private static readonly object GetEmptyLocationobj = new object();
        /// <summary>
        /// èŽ·å–å¯å…¥åº“ç©ºè´§ä½
        /// </summary>
        /// <param name="stationinfoRepository"></param>
        /// <param name="mesinfo"></param>
        /// <param name="stationinfo"></param>
        /// <returns></returns>
        public static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository, VV_Mes_Workinfo mesinfo, dt_stationinfo stationinfo)
        {
            lock (GetEmptyLocationobj)
            {
                try
                {
                    VOLContext context = new VOLContext();
                    //Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(context);
                    Idt_inventoryRepository inventoryRepository = new dt_inventoryRepository(context);
                    //var detail = mes_DetailRepository.Find(x => x.jobID == mesinfo.jobID).FirstOrDefault();
                    //if (detail == null)
                    //{
                    //    stationinfo.remark = "触发入库任务,但未找到工单子表!";
                    //    stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
                    //    stationinfoRepository.Update(stationinfo, true);
                    //    return null;
                    //}
                    #region æŸ¥æ‰¾åº“å­˜
                    dt_inventory inventory = null;
                    inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
                    #region æ ¹æ®æ¡ä»¶æŸ¥è¯¢åº“å­˜
                    //if (mesinfo.heatID != null)
                    //{
                    //    inventory = inventoryRepository.Find(x => x.HeatNumber == mesinfo.heatID && x.FigureNumber == mesinfo.drawingNo && x.jobID == mesinfo.workOrder).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
                    //}
                    //else
                    //{
                    //    inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo && x.jobID == mesinfo.workOrder).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
                    //}
                    #endregion
                    #endregion
                    dt_stationinfo TargetLocation = null;
                    #region æ ¹æ®åº“存查找可入库空货位
                    if (inventory != null)
                    {
                        var station = stationinfoRepository.FindFirst(x => x.stationCode == inventory.stationCode);
                        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();
                            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 == station.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == inventory.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;
                            }
                        }
                        //if (TargetLocation != null) return TargetLocation;
                    }
                    #endregion
                    #region å¯»æ‰¾å·²åˆ†é…åŒå›¾å·å…¥åº“任务库位
                    TargetLocation = stationinfoRepository.Find(x => x.stationType == stationinfo.stationType && x.location_state == LocationStateEnum.InBusy.ToString() && (x.area == "1" || x.area == "2" || x.area == "3" || x.area == "4")).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();
                            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 area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area;
                    //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();
                    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();
                        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();
                    }
                    #endregion
                    if (TargetLocation == null) throw new Exception("库位已满");
                    return TargetLocation;
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
        /// <summary>
        /// èŽ·å–å…¥åº“ç©ºè´§ä½
        /// </summary>
        /// <param name="stationinfoRepository"></param>
        /// <param name="mesinfo"></param>
        /// <param name="stationinfo"></param>
        /// <param name="CompeletedNum"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository, dt_mes_head mesinfo, dt_stationinfo stationinfo)
        {
            lock (GetEmptyLocationobj)
            {
                try
                {
                    VOLContext context = new VOLContext();
                    Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(context);
                    Idt_inventoryRepository inventoryRepository = new dt_inventoryRepository(context);
                    var detail = mes_DetailRepository.Find(x => x.jobID == mesinfo.jobID).FirstOrDefault();
                    if (detail == null)
                    {
                        stationinfo.remark = "触发入库任务,但未找到工单子表!";
                        stationinfo.location_state = LocationStateEnum.Abnormal.ToString();
                        stationinfoRepository.Update(stationinfo, true);
                        return null;
                    }
                    #region æŸ¥æ‰¾åº“å­˜
                    dt_inventory inventory = null;
                    if (detail.heatID != null)
                    {
                        inventory = inventoryRepository.Find(x => /*x.HeatNumber == detail.heatID &&*/ x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
                    }
                    else
                    {
                        inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).OrderByDescending(x => x.OnlineTime).FirstOrDefault();
                    }
                    #endregion
                    dt_stationinfo TargetLocation = null;
                    #region æ ¹æ®åº“存查找可入库空货位
                    if (inventory != null)
                    {
                        var station = stationinfoRepository.FindFirst(x => x.stationCode == inventory.stationCode);
                        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();
                            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 == station.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == inventory.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;
                            }
                        }
                        //if (TargetLocation != null) return TargetLocation;
                    }
                    #endregion
                    #region æœªæ‰¾åˆ°åº“存或当前库存行已满,寻找新的一行
                    //var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area;
                    var area = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, stationinfo.tray_type) : mesinfo.area;
                    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();
                    if (TargetLocation == null)
                    {
                        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();
                        if (TargetLocation == null && area != "4")
                            TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault();
                    }
                    #endregion
                    if (TargetLocation == null) throw new Exception("库位已满");
                    return TargetLocation;
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
        /// <summary>
        /// æ ¹æ®æ‰˜ç›˜ç±»åž‹é€‰æ‹©åº“区
        /// </summary>
        /// <param name="quantity"></param>
        /// <param name="tray_type"></param>
        /// <returns></returns>
        private static string GetArea(int quantity, string tray_type)
        {
            if (tray_type == "SmallTray")
            {
                if (quantity <= 180)
                    return "2";
                else
                    return "3";
            }
            else
                return "4";
        }
        /// <summary>
        /// æ ¹æ®è½¦è½®å¤§å°é€‰æ‹©åº“区
        /// </summary>
        /// <param name="quantity"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        private static string GetArea(int quantity, float e)
        {
            if (e < 1100)
            {
                if (quantity <= 180)
                    return "2";
                else
                    return "3";
            }
            else
                return "4";
        }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ÐÂÎļþ¼Ð/OutboundTask_a.cs
@@ -82,7 +82,7 @@
                                        agv_fromaddress = stationinfo.stationCode,
                                        agv_id = Guid.NewGuid(),
                                        agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                                        agv_grade = 1,
                                        agv_grade = 2,
                                        agv_createtime = DateTime.Now,
                                        agv_taskstate = "Queue",
                                        agv_materielid = stationinfo.stationType,
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Repositories/ToMES/VV_Mes_WorkinfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹VV_Mes_WorkinfoRepository编写代码
 */
using WIDESEA_WMS.IRepositories;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WMS.Repositories
{
    public partial class VV_Mes_WorkinfoRepository : RepositoryBase<VV_Mes_Workinfo> , IVV_Mes_WorkinfoRepository
    {
    public VV_Mes_WorkinfoRepository(VOLContext dbContext)
    : base(dbContext)
    {
    }
    public static IVV_Mes_WorkinfoRepository Instance
    {
      get {  return AutofacContainerModule.GetService<IVV_Mes_WorkinfoRepository>(); } }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/VV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
/*
 *所有关于VV_Mes_Workinfo类的业务代码应在此处编写
*可使用repository.调用常用方法,获取EF/Dapper等信息
*如果需要事务请使用repository.DbContextBeginTransaction
*也可使用DBServerProvider.手动获取数据库相关信息
*用户信息、权限、角色等使用UserContext.Current操作
*VV_Mes_WorkinfoService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter
*/
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
using System.Linq;
using WIDESEA_Core.Utilities;
using System.Linq.Expressions;
using WIDESEA_Core.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_WMS.IRepositories;
namespace WIDESEA_WMS.Services
{
    public partial class VV_Mes_WorkinfoService
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IVV_Mes_WorkinfoRepository _repository;//访问数据库
        [ActivatorUtilitiesConstructor]
        public VV_Mes_WorkinfoService(
            IVV_Mes_WorkinfoRepository dbRepository,
            IHttpContextAccessor httpContextAccessor
            )
        : base(dbRepository)
        {
            _httpContextAccessor = httpContextAccessor;
            _repository = dbRepository;
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
  }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs
@@ -17,6 +17,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_WCS.IRepositories;
using WIDESEA_Core.EFDbContext;
using WIDESEA_WCS.JobsPart.Common;
using WIDESEA_Core.ManageUser;
namespace WIDESEA_WCS.Services
{
@@ -37,5 +40,28 @@
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
        public WebResponseContent FinishWorkOrder(SaveModel model)
        {
            WebResponseContent content = new WebResponseContent();
            VOLContext context = new VOLContext();
            try
            {
                string compeletor = UserContext.Current.UserName;
                foreach (var Key in model.DelKeys)
                {
                    var mes_head = _repository.Find(x => x.mes_id.ToString() == Key.ToString()).FirstOrDefault();
                    if (mes_head != null)
                    {
                        AutoUpdateWork.AddHtyMesWork(mes_head, _repository, compeletor, "手动完成");
                    }
                }
                content.OK();
            }
            catch (Exception ex)
            {
            }
            return content;
        }
  }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/VV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
/*
 *Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,此处任何更改都可能导致被代码生成器覆盖
 *所有业务编写全部应在Partial文件夹下VV_Mes_WorkinfoService与IVV_Mes_WorkinfoService中编写
 */
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.IServices;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WMS.Services
{
    public partial class VV_Mes_WorkinfoService : ServiceBase<VV_Mes_Workinfo, IVV_Mes_WorkinfoRepository>
    , IVV_Mes_WorkinfoService, IDependency
    {
    public VV_Mes_WorkinfoService(IVV_Mes_WorkinfoRepository repository)
    : base(repository)
    {
    Init(repository);
    }
    public static IVV_Mes_WorkinfoService Instance
    {
      get { return AutofacContainerModule.GetService<IVV_Mes_WorkinfoService>(); } }
    }
 }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/ToAGV/ToAGVServer.cs
@@ -70,6 +70,8 @@
                requestin = JsonConvert.DeserializeObject<AGVRequestin>(json);
                if (requestin.AreaNr < 1 || requestin.AreaNr > 4)
                    throw new Exception("未定义的区域号!");
                if (MethodName == "EnteriorLeav")
                    remark = requestin.Type == 1 ? "AGV正在进入" : "AGV正在离开";
                respone = AGVandGantry.GetSetGantry(requestin, MethodName);
            }
            catch (Exception ex)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/Controllers/ToMes/ToMESController.cs
@@ -48,5 +48,7 @@
                return ToMesServer.AddMes_Info(json);
            }
        }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs
@@ -11,6 +11,8 @@
using Microsoft.AspNetCore.Http;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IServices;
using Microsoft.AspNetCore.Authorization;
using WIDESEA_Core.Utilities;
namespace WIDESEA_WCS.Controllers
{
@@ -29,5 +31,17 @@
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        /// <summary>
        /// æ‰‹åŠ¨å®Œæˆå·¥å•
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        [HttpPost, Authorize, Route("FinishWorkOrder"), AllowAnonymous]
        public WebResponseContent FinishWorkOrder([FromBody] SaveModel saveModel)
        {
            return Service.FinishWorkOrder(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/Task/widesea_wms/taskinfo/dt_agvtask.vue
@@ -48,7 +48,7 @@
                       {field:'agv_toaddress',title:'终点地址',type:'string',width:110,align:'left'},
                    //    {field:'agv_code',title:'AGV编号',type:'string',bind:{ key:'agv_code',data:[]},width:110,require:true,align:'left'},
                       {field:'agv_taskstate',title:'任务状态',type:'string',bind:{ key:'Taskstates',data:[]},width:110,require:true,align:'left'},
                       {field:'jobID',title:'工单号',type:'string',width:110,align:'left'},
                       {field:'jobID',title:'工作令号',type:'string',width:160,align:'left'},
                    //    {field:'agv_materielid',title:'物料类型',type:'string',width:110,require:true,align:'left'},
                    {field:'agv_materielid',title:'图号',type:'string',width:110,require:true,align:'left'},
                       {field:'bindSN',title:'车轮SN号',type:'string',width:110,align:'left'},
´úÂë¹ÜÀí/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask_hty.vue
@@ -43,7 +43,7 @@
                       {field:'agv_materielid',title:'物料类型',type:'string',width:110,require:true,align:'left'},
                       {field:'agv_fromaddress',title:'起点地址',type:'string',width:110,align:'left'},
                       {field:'agv_toaddress',title:'终点地址',type:'string',width:110,align:'left'},
                       {field:'jobID',title:'工单号',type:'string',width:110,align:'left'},
                       {field:'jobID',title:'工作令号',type:'string',width:160,align:'left'},
                       {field:'agv_materielid',title:'图号',type:'string',width:110,require:true,align:'left'},
                       {field:'bindSN',title:'车轮SN号',type:'string',width:110,align:'left'},
                       {field:'agv_qty',title:'数量',type:'int',width:110,require:true,align:'left'},
´úÂë¹ÜÀí/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue
@@ -32,16 +32,19 @@
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"SN":"","Name":"","HearthNumber":"","HeatNumber":"","BilletNumber":"","remark":""});
            const searchFormOptions = ref([[{"title":"车轮SN号","field":"SN","type":"like"},{"title":"产品名称","field":"Name","type":"like"},{"title":"描述","field":"remark","type":"like"}],[{"title":"熔炼炉号","field":"HearthNumber","type":"like"},{"title":"炉代号","field":"HeatNumber","type":"like"},{"title":"钢坯号","field":"BilletNumber","type":"like"}]]);
            const searchFormOptions = ref([
                [{"title":"车轮SN号","field":"SN","type":"like"},{"title":"货位编号","field":"stationCode","type":"like"},{"title":"产品名称","field":"Name","type":"like"}],
                [{"title":"产品图号","field":"FigureNumber","type":"like"},{"title":"炉代号","field":"HeatNumber","type":"like"},{"title":"工作令号","field":"BilletNumber","type":"like"}]]);
            const columns = ref([
                       {field:'stationCode',title:'货位编号',type:'string',width:100,align:'left',sort:true},
                       {field:'stationCode',title:'货位编号',type:'string',width:120,align:'left',sort:true},
                       {field:'SN',title:'车轮SN号',type:'string',width:120,align:'left',sort:true},
                       {field:'Name',title:'产品名称',type:'string',width:120,align:'left'},
                       {field:'FigureNumber',title:'产品图号',type:'string',width:120,align:'left'},
                       {field:'Name',title:'产品名称',type:'string',width:120,align:'left',sort:true},
                       {field:'FigureNumber',title:'产品图号',type:'string',width:120,align:'left',sort:true},
                       {field:'jobID',title:'工作令号',type:'string',width:160,align:'left',sort:true},
                    //    {field:'area',title:'区域代码',type:'string',width:80,align:'left'},
                       {field:'HeatNumber',title:'炉代号',type:'string',width:80,align:'left'},
                       {field:'HeatNumber',title:'炉代号',type:'string',width:100,align:'left',sort:true},
                       {field:'BilletNumber',title:'钢坯号',type:'int',width:80,align:'left'},
                       {field:'OnlineTime',title:'入库时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'OnlineTime',title:'入库时间',type:'datetime',width:160,align:'left',sort:true},
                       {field:'Operator',title:'操作人员',type:'string',width:110,align:'left'},
                       {field:'remark',title:'描述',type:'string',width:220,align:'left'},
                       {field:'ID',title:'ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'}]);
´úÂë¹ÜÀí/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue
@@ -35,7 +35,7 @@
                              [{"dataKey":"location_states","data":[],"title":"货位状态","field":"location_state","type":"select"}],
                              [{"title":"车轮SN号","field":"bindSN"}],
                              [{"dataKey":"tray_types","data":[],"title":"托盘类型","field":"tray_type","type":"select"}],
                              [{"title":"工单编号","field":"Number"}],
                              [{"title":"工作令号","field":"Number"}],
                              [{"title":"炉号","field":"heatNumber","type":"text"}],
                              [{"title":"备注","field":"remark"}]]);
            const searchFormFields = ref({"stationCode":"","stationType":"","area":"","enable":"","location_state":[],"bindSN":""});
@@ -50,12 +50,12 @@
                       {field:'quantity',title:'数量',type:'int',width:80,align:'left'},
                       {field:'bindSN',title:'车轮SN号',type:'string',width:220,align:'left'},
                       {field:'tray_status',title:'托盘状态',type:'string',bind:{ key:'tray_status',data:[]},width:80,align:'left'},
                       {field:'tray_type',title:'托盘类型',type:'string',bind:{ key:'tray_types',data:[]},width:120,align:'left'},
                       {field:'tray_type',title:'托盘类型',type:'string',bind:{ key:'tray_types',data:[]},width:100,align:'left'},
                    //    {field:'line',title:'行',type:'int',width:80,align:'left'},
                    //    {field:'column',title:'列',type:'int',width:80,align:'left'},
                    // {field:'heatNumber',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:'Number',title:'工单编号',type:'string',width:220,align:'left'},
                       {field:'Number',title:'工作令号',type:'string',width:160,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Comm/StateEnum/LocationStateEnum.cs
@@ -15,6 +15,22 @@
        /// <summary>
        /// ç©ºè´§ä½
        /// </summary>
        Empty
        Empty,
        /// <summary>
        /// å ç”¨
        /// </summary>
        Busy,
        /// <summary>
        /// å…¥åº“占用
        /// </summary>
        InBusy,
        /// <summary>
        /// å‡ºåº“占用
        /// </summary>
        OutBusy,
        /// <summary>
        /// å¼‚常
        /// </summary>
        Abnormal
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs
@@ -53,6 +53,14 @@
        public string materialCode { get; set; }
        /// <summary>
        ///技术状态
        /// </summary>
        [Display(Name = "技术状态")]
        [MaxLength(10)]
        [Column(TypeName = "nvarchar(10)")]
        [Editable(true)]
        public string drawingNoVer { get; set; }
        /// <summary>
        ///熔炼炉号
        /// </summary>
        //[Display(Name = "熔炼炉号")]
@@ -128,7 +136,7 @@
        [Editable(true)]
        public string area { get; set; }
        /// <summary>
        /// å·¥å•编号
        /// å·¥å•编号/工作令号
        /// </summary>
        [Display(Name = "工单编号")]
        [Column(TypeName = "nvarchar(40)")]
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/Taskinfo/dt_agvtask.cs
@@ -85,7 +85,7 @@
        public string agv_taskstate { get; set; }
        /// <summary>
        ///工单类型/AGV工作类型
        ///工单类型 (17-机加工 28-检测线 101移库外协)
        /// </summary>
        [Display(Name = "AGV工作类型")]
        [Column(TypeName = "int")]
@@ -173,7 +173,7 @@
        public string agv_remark { get; set; }
        /// <summary>
        ///任务等级  0、暂缓1、正常2、加急
        ///任务等级  0:暂缓1:正常2:加急 3:特急
        /// </summary>
        [Display(Name = "任务等级")]
        [Column(TypeName = "int")]
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Entity.SystemModels;
namespace WIDESEA_Entity.DomainModels
{
    [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>
        ///炉代号
        /// </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 ="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 ="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 ="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 ="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 ="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 ="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; }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/partial/VV_Mes_Workinfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Entity.SystemModels;
namespace WIDESEA_Entity.DomainModels
{
    public partial class VV_Mes_Workinfo
    {
        //此处配置字段(字段配置见此model的另一个partial),如果表中没有此字段请加上 [NotMapped]属性,否则会异常
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/MappingConfiguration/ToMES/VV_Mes_WorkinfoMapConfig.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
using WIDESEA_Entity.MappingConfiguration;
using WIDESEA_Entity.DomainModels;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace WIDESEA_Entity.MappingConfiguration
{
    public class VV_Mes_WorkinfoMapConfig : EntityMappingConfiguration<VV_Mes_Workinfo>
    {
        public override void Map(EntityTypeBuilder<VV_Mes_Workinfo>
        builderTable)
        {
          //b.Property(x => x.StorageName).HasMaxLength(45);
        }
     }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/AGVServer.cs
@@ -34,10 +34,10 @@
                VOLContext Context = new VOLContext();
                Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
                var agv_tasks = agvtaskRepository.Find(x => x.agv_taskstate == "Create" && string.IsNullOrEmpty(x.agv_remark)).OrderByDescending(x => x.agv_grade)
                        .OrderBy(x => x.agv_createtime).ToList();
                        .ThenBy(x => x.agv_createtime).ToList();
                if (agv_tasks.Count < 1)
                    agv_tasks = agvtaskRepository.Find(x => x.agv_taskstate == "Create" && !string.IsNullOrEmpty(x.agv_remark)).OrderByDescending(x => x.agv_grade)
                        .OrderBy(x => x.agv_createtime).ToList();
                        .ThenBy(x => x.agv_createtime).ToList();
                if (agv_tasks.Count > 0)
                {
                    foreach (var agv_task in agv_tasks)
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs
@@ -11,6 +11,7 @@
using WIDESEA_Entity.DomainModels;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static FreeSql.Internal.GlobalFilter;
namespace WIDESEA_WMS.Common
{
@@ -66,10 +67,6 @@
        /// <param name="task"></param>
        public static void Updateinventory(dt_agvtask task)
        {
            //string[] bindSNs = task.bindSN.Split(",");
            //int count = 0;
            //if (bindSNs.Length > 0)
            //{
            if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() || task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceCarry.ToString())
            {
                string[] bindSNs = task.bindSN.Split(",");
@@ -83,7 +80,6 @@
                    if (count < 1)
                        throw new Exception("库存清除失败!SN号:" + bindSN);
                }
            }
            else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString())
            {
@@ -92,26 +88,24 @@
                List<dt_inventory> inventorys = new List<dt_inventory>();
                foreach (string bindSN in bindSNs)
                {
                    var mes_detail = freeDB.Select<dt_mes_detail>().Where(x => x.SN == bindSN).First();
                    if (mes_detail == null)
                        throw new Exception("未找到工单信息!");
                    var mes_head = freeDB.Select<dt_mes_head>().Where(x => x.jobID == mes_detail.jobID).First();
                    if (mes_head == null)
                    var mes_Work = freeDB.Select<VV_Mes_Workinfo>().Where(x => x.SN == bindSN && x.processCode == "17").First();
                    if (mes_Work == null)
                        throw new Exception("未找到工单信息!");
                    var station = freeDB.Select<dt_stationinfo>().Where(x => x.stationCode == task.agv_toaddress).First();
                    dt_inventory inventory = new dt_inventory()
                    {
                        SN = bindSN,
                        Name = mes_head.productName,
                        FigureNumber = mes_head.drawingNo,
                        Name = mes_Work.productName,
                        FigureNumber = mes_Work.drawingNo,
                        materialCode = task.agv_materbarcode,
                        HeatNumber = mes_detail.heatID,
                        BilletNumber = mes_detail.billetID,
                        HeatNumber = mes_Work.heatID,
                        drawingNoVer = mes_Work.drawingNoVer,
                        BilletNumber = mes_Work.billetID,
                        OnlineTime = task.agv_finishedtime,
                        Operator = "admin",
                        stationCode = task.agv_toaddress,
                        area = station.area,
                        jobID = mes_detail.jobID,
                        jobID = mes_Work.workOrder,
                        ID = Guid.NewGuid()
                    };
                    inventorys.Add(inventory);
@@ -210,8 +204,8 @@
                    station1.stationType = string.Empty;
                    station1.tray_status = string.Empty;
                    station1.remark = string.Empty;
                    if (!station1.stationCode.Contains("X") && !station1.stationCode.Contains("S") && !station1.stationCode.Contains("W01001004") && !station1.stationCode.Contains("W01001005"))
                        station1.tray_type = string.Empty;
                    //if (!station1.stationCode.Contains("X") && !station1.stationCode.Contains("S") && !station1.stationCode.Contains("W01001004") && !station1.stationCode.Contains("W01001005"))
                    //    station1.tray_type = string.Empty;
                }
                stationinfoRepository.Update(station1, true);
            }
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask_Mes.cs
@@ -35,7 +35,7 @@
                    throw new Exception("无任务数据");
                }
                if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() || task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceOutbound.ToString())
                if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() /*|| task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceOutbound.ToString()*/|| task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceCarry.ToString())
                {
                    foreach (var item in task.bindSN.Split(","))
                    {
@@ -45,13 +45,13 @@
                    }
                    agvInWarehousePara outWarehousePara = new agvInWarehousePara()
                    {
                        details = list,
                        JobID = task.jobID,
                        zoneID = task.agv_fromaddress,
                        processCode = task.agv_worktype.ToString(),
                        details = list,
                        layerNo = 1,
                        stackID = "1",
                        warehouseName = "Agv库",
                        zoneID = task.agv_fromaddress,
                    };
                    obj = outWarehousePara;
                    ActionName = "agvOutWarehouse";//AGV->MES车轮出库
@@ -67,13 +67,13 @@
                    }
                    agvInWarehousePara inWarehousePara = new agvInWarehousePara()
                    {
                        details = list,
                        JobID = task.jobID,
                        zoneID = task.agv_toaddress,
                        processCode = task.agv_worktype.ToString(),
                        details = list,
                        layerNo = 1,
                        stackID = "1",
                        warehouseName = "Agv库",
                        zoneID = task.agv_toaddress,
                    };
                    obj = inWarehousePara;
                    ActionName = "agvInWarehouse";//AGV->MES车轮入库
@@ -82,39 +82,51 @@
                //else if (task.agv_tasktype == "Transfer")  //移库区分  åº“内移库
                else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Carry.ToString())  //移库区分  åº“内移库
                {
                    foreach (var item in task.bindSN.Split(","))
                    {
                        detail detail = new detail();
                        detail.sn = item;
                        list.Add(detail);
                    }
                    agvMoveWarehousePara moveWarehousePara = new agvMoveWarehousePara()
                    {
                        fromZoneID = task.agv_fromaddress,
                        toZoneID = task.agv_toaddress,
                        details = list,
                        fromLayerNo = "1",
                        fromStackID = "1",
                        fromWarehouseName = "Agv库",
                        fromZoneID = task.agv_fromaddress,
                        toLayerNo = "1",
                        toStackID = "1",
                        toWarehouseName = "Agv库",
                        toZoneID = task.agv_toaddress,
                    };
                    obj = moveWarehousePara;
                    ActionName = "agvMoveWarehouse";//AGV->MES车轮移库
                    name = "AGV同步MES车轮AB库移库";
                }
                else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceCarry.ToString())// å¤–协移库
                //else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceCarry.ToString())// å¤–协移库
                //{
                //    var mes_head = FreeDB.Select<dt_mes_head>().Where(x => x.jobID == task.jobID).First();
                //    agvTransferListPara agvTransferListPara = new agvTransferListPara()
                //    {
                //        transferListID = task.agv_tasknum,
                //        materialCode = mes_head.materialCode,
                //        details = list,
                //        drawingNoVer = mes_head.drawingNoVer,
                //        fromWarehouse = "AGV库",
                //        toWarehouse = "毛轮库",
                //        Operator = task.agv_userid,
                //        updateTime = task.agv_createtime.ToString(),
                //    };
                //    obj = agvTransferListPara;
                //    ActionName = "agvTransferList";
                //    name = "AGV同步MES车轮移库AB库->BC库";
                //}
                else
                {
                    var mes_head = FreeDB.Select<dt_mes_head>().Where(x => x.jobID == task.jobID).First();
                    agvTransferListPara agvTransferListPara = new agvTransferListPara()
                    {
                        details = list,
                        transferListID = task.agv_tasknum,
                        materialCode = mes_head.materialCode,
                        drawingNoVer = mes_head.drawingNoVer,
                        fromWarehouse = "AGV库",
                        toWarehouse = "毛轮库",
                        Operator = task.agv_userid,
                        updateTime = task.agv_createtime.ToString(),
                    };
                    obj = agvTransferListPara;
                    ActionName = "agvTransferList";
                    name = "AGV同步MES车轮移库AB库->BC库";
                    requestMes.code = "200";
                    requestMes.Type = "success";
                    return requestMes;
                }
                var postJson = JsonConvert.SerializeObject(obj);
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/IRepositories/ToMES/IVV_Mes_WorkinfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹IVV_Mes_WorkinfoRepository编写接口
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Core.Extensions.AutofacManager;
namespace WIDESEA_WMS.IRepositories
{
    public partial interface IVV_Mes_WorkinfoRepository : IDependency,IRepository<VV_Mes_Workinfo>
    {
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/IServices/ToMES/IVV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 */
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WMS.IServices
{
    public partial interface IVV_Mes_WorkinfoService : IService<VV_Mes_Workinfo>
    {
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/IServices/ToMES/Partial/IVV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
/*
*所有关于VV_Mes_Workinfo类的业务代码接口应在此处编写
*/
using WIDESEA_Core.BaseProvider;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Core.Utilities;
using System.Linq.Expressions;
namespace WIDESEA_WMS.IServices
{
    public partial interface IVV_Mes_WorkinfoService
    {
    }
 }
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Repositories/ToMES/VV_Mes_WorkinfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹VV_Mes_WorkinfoRepository编写代码
 */
using WIDESEA_WMS.IRepositories;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WMS.Repositories
{
    public partial class VV_Mes_WorkinfoRepository : RepositoryBase<VV_Mes_Workinfo> , IVV_Mes_WorkinfoRepository
    {
    public VV_Mes_WorkinfoRepository(VOLContext dbContext)
    : base(dbContext)
    {
    }
    public static IVV_Mes_WorkinfoRepository Instance
    {
      get {  return AutofacContainerModule.GetService<IVV_Mes_WorkinfoRepository>(); } }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Services/ToMES/Partial/VV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
/*
 *所有关于VV_Mes_Workinfo类的业务代码应在此处编写
*可使用repository.调用常用方法,获取EF/Dapper等信息
*如果需要事务请使用repository.DbContextBeginTransaction
*也可使用DBServerProvider.手动获取数据库相关信息
*用户信息、权限、角色等使用UserContext.Current操作
*VV_Mes_WorkinfoService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter
*/
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
using System.Linq;
using WIDESEA_Core.Utilities;
using System.Linq.Expressions;
using WIDESEA_Core.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_WMS.IRepositories;
namespace WIDESEA_WMS.Services
{
    public partial class VV_Mes_WorkinfoService
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IVV_Mes_WorkinfoRepository _repository;//访问数据库
        [ActivatorUtilitiesConstructor]
        public VV_Mes_WorkinfoService(
            IVV_Mes_WorkinfoRepository dbRepository,
            IHttpContextAccessor httpContextAccessor
            )
        : base(dbRepository)
        {
            _httpContextAccessor = httpContextAccessor;
            _repository = dbRepository;
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
  }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Services/ToMES/VV_Mes_WorkinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
/*
 *Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,此处任何更改都可能导致被代码生成器覆盖
 *所有业务编写全部应在Partial文件夹下VV_Mes_WorkinfoService与IVV_Mes_WorkinfoService中编写
 */
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.IServices;
using WIDESEA_Core.BaseProvider;
using WIDESEA_Core.Extensions.AutofacManager;
using WIDESEA_Entity.DomainModels;
namespace WIDESEA_WMS.Services
{
    public partial class VV_Mes_WorkinfoService : ServiceBase<VV_Mes_Workinfo, IVV_Mes_WorkinfoRepository>
    , IVV_Mes_WorkinfoService, IDependency
    {
    public VV_Mes_WorkinfoService(IVV_Mes_WorkinfoRepository repository)
    : base(repository)
    {
    Init(repository);
    }
    public static IVV_Mes_WorkinfoService Instance
    {
      get { return AutofacContainerModule.GetService<IVV_Mes_WorkinfoService>(); } }
    }
 }
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/ToAGV/ToAGVServer.cs
@@ -80,9 +80,9 @@
                    task.agv_finishedtime = DateTime.Now;
                    #region åŒæ­¥MES出入库信息
                    //var mes = HandleTask_Mes.UploadMESInfo(task);
                    //if (mes.code != "200" && mes.Type != "success")
                    //    throw new Exception(mes.message);
                    var mes = HandleTask_Mes.UploadMESInfo(task);
                    if (mes.code != "200" && mes.Type != "success")
                        throw new Exception(mes.message);
                    #endregion
                    HandleTask.Updateinventory(task);
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/ToMes/OutsourceInbound.cs
@@ -56,21 +56,34 @@
                    return content.Error("车轮SN号有误!请重新扫描!");
                #endregion
                dt_mes_detail info = null;
                dt_mes_head mes_head = null;
                //dt_mes_detail info = null;
                //dt_mes_head mes_head = null;
                VV_Mes_Workinfo mes_Work = null;
                int count = 0;  //车轮数量
                foreach (var item in sn.Split(","))
                string bindSN = "";
                List<string> list = new List<string>();
                foreach (var SN in sn.Split(","))
                {
                    if (!string.IsNullOrEmpty(SN))
                        list.Add(SN);
                }
                foreach (var item in list)
                {
                    if (item != null)
                    {
                        count++;
                        info = freeDB.Select<dt_mes_detail>().Where(x => x.SN == item).First();
                        if (info == null)
                            return content.Error($"第{count}个车轮无检测上料工单详情,请核查工单后在扫描!");
                        mes_head = freeDB.Select<dt_mes_head>().Where(x => x.jobID == info.jobID && x.processCode == "28").First();
                        if (mes_head == null)
                        bindSN += bindSN == "" ? item : "," + item;
                         mes_Work = freeDB.Select<VV_Mes_Workinfo>().Where(x => x.SN == item && x.processCode == "28").First();
                        if (mes_Work == null)
                            return content.Error($"第{count}个车轮无检测上料工单信息,请核查工单后在扫描!");
                        //info = freeDB.Select<dt_mes_detail>().Where(x => x.SN == item).First();
                        //if (info == null)
                        //    return content.Error($"第{count}个车轮无检测上料工单详情,请核查工单后在扫描!");
                        //mes_head = freeDB.Select<dt_mes_head>().Where(x => x.jobID == info.jobID && x.processCode == "28").First();
                        //if (mes_head == null)
                        //    return content.Error($"第{count}个车轮无检测上料工单信息,请核查工单后在扫描!");
                    }
                }
                VOLContext Context = new VOLContext();
@@ -81,12 +94,12 @@
                if (!station.enable)
                    return content.Error($"下料口{stationNo}被禁用,请核实!");
                station.quantity = count;
                station.bindSN = sn;
                station.stationType = mes_head.drawingNo;
                station.bindSN = bindSN;
                station.stationType = mes_Work.drawingNo;
                station.location_state = "Stroge";
                station.Number = mes_head.jobID;
                if (info.heatID != null)
                    station.heatNumber = info.heatID;
                station.Number = mes_Work.jobID;
                if (mes_Work.heatID != null)
                    station.heatNumber = mes_Work.heatID;
                station.tray_status = "StrogeTray";
                stationinfoRepository.Update(station, true);
@@ -110,7 +123,7 @@
                    agv_fromaddress = station.stationCode,
                    agv_id = Guid.NewGuid(),
                    agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                    agv_grade = 2,
                    agv_grade = 3,
                    agv_createtime = DateTime.Now,
                    agv_taskstate = "Queue",
                    agv_materielid = station.stationType,
@@ -118,10 +131,10 @@
                    agv_tasktype = "TaskType_OutsourceOutbound",
                    agv_toaddress = "",
                    agv_userid = user,//"系统",
                    jobID = mes_head.jobID,
                    jobID = mes_Work.jobID,
                    bindSN = station.bindSN,
                    agv_worktype = Convert.ToInt32(mes_head.processCode),
                    agv_materbarcode = mes_head.materialCode,
                    agv_worktype = Convert.ToInt32(mes_Work.processCode),
                    agv_materbarcode = mes_Work.materialCode,
                    agv_Traytype = station.tray_type,
                    agv_TrayStatus = station.tray_status
                };
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/ToMes/agvTransferList.cs
@@ -1,17 +1,23 @@
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Xml.Linq;
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Comm.MES_Info;
using WIDESEA_Comm.MES_Info.Request;
using WIDESEA_Comm.TaskNo;
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.ManageUser;
using WIDESEA_Core.Utilities;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Entity.DomainModels.Mes;
using WIDESEA_WMS.Common;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static WIDESEA_Comm.MES_Info.BasicSN;
namespace WIDESEA_WMS
@@ -27,24 +33,32 @@
        {
            WebResponseContent content = new WebResponseContent();
            string postJson = "";
            string mesData = "";
            try
            {
                string sn = saveModel.MainData["sn"].ToString();
                string user = saveModel.MainData["creator"].ToString();
                return content.Error($"{user}无操作权限!");
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                Idt_inventoryRepository inventoryRepository = new dt_inventoryRepository(Context);
                Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
                //return content.Error($"{user}无操作权限!");
                //工单号生成
                string jobID = "TW" + DateTime.Now.ToString("HH-mm-ss-ff");
                //根据库存查询车轮信息
                dt_inventory inventory = freeDB.Select<dt_inventory>().Where(x => x.SN.Contains(sn)).First();
                dt_inventory inventory = inventoryRepository.Find(x => x.SN.Contains(sn)).FirstOrDefault();
                if (inventory == null)
                {
                    return content.Error($"无此车轮{sn}SN号,请核查库存记录!");
                }
                var station = stationinfoRepository.Find(x => x.stationCode == inventory.stationCode).FirstOrDefault();
                if (!station.enable) return content.Error($"库位{station.stationCode}未启用,请核实!");
                if (agvtaskRepository.Find(x => x.agv_fromaddress == station.stationCode).Any())
                    return content.Error($"库位{station.stationCode}存在AGV任务,请核实!");
                List<detail> list = new List<detail>(); //车轮信息
                foreach (var item in inventory.SN.Split(","))
                foreach (var item in station.bindSN.Split(","))
                {
                    detail detail = new detail();
                    detail.sn = item;
@@ -54,29 +68,58 @@
                agvTransferListPara listPara = new agvTransferListPara
                {
                    details = list,
                    transferListID = jobID,
                    transferListID = jobID,// station.Number,
                    toWarehouse = "毛轮库",
                    fromWarehouse = "AGV库",
                    updateTime = DateTime.Now.ToString(),
                    drawingNoVer = "",
                    materialCode = "",
                    drawingNoVer = inventory.drawingNoVer,
                    materialCode = inventory.materialCode,
                    Operator = user == null ? "admin" : user
                };
                var postJson = JsonConvert.SerializeObject(listPara);
                string mesData = Request.RequestData(postJson, MESAPIAddress.IPAddress_MES + "agvTransferList");
                postJson = JsonConvert.SerializeObject(listPara);
                mesData = Request.RequestData(postJson, MESAPIAddress.IPAddress_MES + "agvTransferList");
                if (mesData.Contains("连接尝试失败"))
                    throw new Exception(mesData);
                var requestMes = JsonConvert.DeserializeObject<MES_Response>(mesData);
                if (requestMes.code == "200" && requestMes.Type == "success")
                {
                    return content.OK("移库交接成功!");
                    dt_agvtask agvtask = new dt_agvtask()
                    {
                        agv_fromaddress = station.stationCode,
                        agv_id = Guid.NewGuid(),
                        agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                        agv_grade = 1,
                        agv_createtime = DateTime.Now,
                        agv_taskstate = "Queue",
                        agv_materielid = station.stationType,
                        agv_qty = station.quantity,
                        agv_tasktype = "TaskType_OutsourceCarry",
                        agv_toaddress = "",
                        agv_userid = user,//"系统",
                        jobID = jobID,// mes_head.jobID,
                        bindSN = station.bindSN,
                        agv_worktype = 101, //Convert.ToInt32(mes_head.processCode),
                        agv_materbarcode = inventory.materialCode,
                        agv_Traytype = station.tray_type,
                        agv_TrayStatus = station.tray_status
                    };
                    agvtaskRepository.Add(agvtask, true);
                    station.location_state = LocationStateEnum.OutBusy.ToString();
                    stationinfoRepository.Update(station, true);
                    content.OK("下发移库外协成功!");
                    //日志记录上传数据成功
                    WriteWMSLog.LogAdd("", "成功", "MES", "WMS", postJson, mesData, "AB库移库外协", "agvTransferList", requestMes.message);
                }
                else
                    throw new Exception(requestMes.message);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
                WriteWMSLog.LogAdd("", "失败", "MES", "WMS", postJson, mesData, "AB库移库外协", "agvTransferList", ex.Message);
            }
            return content;
        }
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/VV_Mes_WorkinfoController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
/*
 *接口编写处...
*如果接口需要做Action的权限验证,请在Action上使用属性
*如: [ApiActionPermission("VV_Mes_Workinfo",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WMS.IServices;
namespace WIDESEA_WMS.Controllers
{
    public partial class VV_Mes_WorkinfoController
    {
        private readonly IVV_Mes_WorkinfoService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        [ActivatorUtilitiesConstructor]
        public VV_Mes_WorkinfoController(
            IVV_Mes_WorkinfoService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/VV_Mes_WorkinfoController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果要增加方法请在当前目录下Partial文件夹VV_Mes_WorkinfoController编写
 */
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core.Controllers.Basic;
using WIDESEA_Entity.AttributeManager;
using WIDESEA_WMS.IServices;
namespace WIDESEA_WMS.Controllers
{
    [Route("api/VV_Mes_Workinfo")]
    [PermissionTable(Name = "VV_Mes_Workinfo")]
    public partial class VV_Mes_WorkinfoController : ApiBaseController<IVV_Mes_WorkinfoService>
    {
        public VV_Mes_WorkinfoController(IVV_Mes_WorkinfoService service)
        : base(service)
        {
        }
    }
}
ÏîÄ¿×ÊÁÏ/ÆäËû/·þÎñÆ÷Õ˺ÅÃÜÂë.txt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3 @@
IP:192.168.12.101
用户名:TZFWQ
密码:123456