| | |
| | | onClick: function () { |
| | | this.upload(); |
| | | } |
| | | }, { |
| | | name: "宿工å", |
| | | icon: 'el-icon-check', |
| | | type: 'success', |
| | | plain: true, |
| | | value: 'FinishWorkOrder', |
| | | onClick: function () { |
| | | // this.FinishWorkOrder(); |
| | | } |
| | | } |
| | | // , { |
| | | // name: "æ°æ®ç»æ", |
| | |
| | | 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/'; |
| | |
| | | |
| | | //é»è®¤æ¥è¯¢å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]; |
| | | |
| | | //èªå®ä¹åé¢è² |
| | |
| | | // 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; |
| | |
| | | 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" }], |
| | |
| | | [{"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'}, |
| | |
| | | {"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'}, |
| | |
| | | }); |
| | | 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'}, |
| | |
| | | }); |
| | | 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'}]); |
| | |
| | | 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}, |
| | |
| | | {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'}, |
| | |
| | | }); |
| | | 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'}, |
| | |
| | | {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'}, |
| | |
| | | {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'}]); |
| | |
| | | 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 |
| | |
| | | { |
| | | 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; |
| | |
| | | log.info = JsonConvert.SerializeObject(info); |
| | | } |
| | | //StoredProcedure.Main(log, MethodName.Add); |
| | | StoredProcedure.EXECAdd(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) |
| | |
| | | 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 = "çç¼çå·")] |
| | |
| | | [Column(TypeName = "nvarchar(15)")] |
| | | [Editable(true)] |
| | | public string area { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥ä½ä»¤å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
| | | [Editable(true)] |
| | |
| | | public int column { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å·¥åç¼å· |
| | | ///å·¥åç¼å·/å·¥ä½ä»¤å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [MaxLength(255)] |
| | |
| | | public string agv_taskstate { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å·¥åç±»å/AGVå·¥ä½ç±»å |
| | | ///å·¥åç±»å(17-æºå å·¥ 28-æ£æµçº¿ 101ç§»åºå¤å) |
| | | /// </summary> |
| | | [Display(Name = "AGVå·¥ä½ç±»å")] |
| | | [Column(TypeName = "int")] |
| | |
| | | public string agv_remark { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ä»»å¡ç级 0ãæç¼1ãæ£å¸¸2ãå æ¥ |
| | | ///ä»»å¡ç级 0ãæç¼1ãæ£å¸¸2ãå æ¥ 3ãç¹æ¥ |
| | | /// </summary> |
| | | [Display(Name = "ä»»å¡ç级")] |
| | | [Column(TypeName = "int")] |
| | |
| | | public DateTime? agv_completeBeginTime { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å·¥åå· |
| | | ///å·¥åå·/å·¥ä½ä»¤å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åå·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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; } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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]屿§ï¼å¦åä¼å¼å¸¸ |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | } |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | #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; |
| | | } |
| | | #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 |
| | | |
| | | var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == Mes_Work.jobID); |
| | | |
| | | if (name != "è¾é䏿æ¥è¯¢è®¢å") |
| | | { |
| | |
| | | { |
| | | //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 != "è¾é䏿æ¥è¯¢è½¦è½®") |
| | |
| | | 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 |
| | |
| | | { |
| | | //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 |
| | | } |
| | | } |
| | |
| | | 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 == "龿¡æº"); |
| | |
| | | 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"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | #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 |
| | | |
| | | #endregion |
| | | |
| | | var AreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_AreaNr").First(), client); |
| | |
| | | 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"; |
| | | } |
| | | |
| | |
| | | //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) |
| | |
| | | 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"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | |
| | | #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 |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | 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); //æ ¹æ®ä¸æå£åå
åè·ååºå代ç |
| | |
| | | #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 æ¥å¿è®°å½ |
| | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | && 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(); |
| | | } |
| | |
| | | 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(); |
| | |
| | | |
| | | #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å·æ°éä¸ä¸è´ |
| | |
| | | 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) |
| | | { |
| | |
| | | && 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) |
| | |
| | | #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å·æ°éä¸ä¸è´ |
| | |
| | | /// <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); |
| | |
| | | |
| | | 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() |
| | |
| | | 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 |
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.IServices |
| | | { |
| | | public partial interface IVV_Mes_WorkinfoService : IService<VV_Mes_Workinfo> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äº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 |
| | | { |
| | | } |
| | | } |
| | |
| | | { |
| | | public partial interface Idt_mes_headService |
| | | { |
| | | /// <summary> |
| | | /// æå¨å®æå·¥å |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent FinishWorkOrder(SaveModel saveModel); |
| | | } |
| | | } |
| | |
| | | //throw new NotImplementedException(); |
| | | //Creation.PLCinfodetail(); |
| | | //ReplaceTray.a(); |
| | | //EmptyTrayTask.InEmptyTrayTask();åºå
空æä»»å¡ |
| | | //EmptyTrayTask.InEmptyTrayTask(); //åºå
空æä»»å¡ |
| | | //EmptyTrayTask.task(); |
| | | |
| | | StationTask.CreateTask(); |
| | | //OutboundTask.CreateOutboundTask(); |
| | |
| | | ///æ¥æ¾ä¸æåºçè´§ä½ |
| | | 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) |
| | |
| | | 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; |
| | |
| | | #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 (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 if (!finished && updatefinished) |
| | | // Gantry_client.WriteByOrder("W_Storage_update", false, number);//è´§ä½ç¶ææ´æ° |
| | | |
| | | } |
| | | else |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | |
| | | 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();//æåä¸ä¸ªè´§ä½æä»»å¡åä¸è½çæå
¥åºä»»å¡ |
| | |
| | | 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, |
| | |
| | | { |
| | | 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(); |
| | |
| | | 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 = "ä¸çº¿"; |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | /// <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 |
| | | { |
| | |
| | | }; |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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, |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | 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")//空æä»»å¡ |
| | |
| | | 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) |
| | |
| | | } |
| | | } |
| | | } |
| | | 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) |
| | |
| | | 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("龿¡æºè°åº¦æå¡æªå¼å¯ï¼"); |
| | |
| | | |
| | | 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æ |
| | |
| | | |
| | | //æ ¹æ®ä¸æå£çç»å®ä¿¡æ¯æ¥è¯¢å¯¹åºå·¥åï¼æ£æµæ¤å·¥åæ¯å¦å·²å®æ 宿å³å¯å°å
¶éå
¥åº |
| | | |
| | | 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"; |
| | |
| | | { |
| | | //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) |
| | | { |
| | |
| | | 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 |
| | |
| | | |
| | | 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"); |
| | | } |
| | |
| | | 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 åä¸è¡åªå
许ä¸ä¸ªä»»å¡ |
| | |
| | | // 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 |
| | | |
| | |
| | | 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) |
| | |
| | | |
| | | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | //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) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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"; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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>(); } } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äº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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | | { |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿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; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *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>(); } } |
| | | } |
| | | } |
| | |
| | | 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) |
| | |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | [HttpPost,Route("AddMes_Info"),AllowAnonymous] |
| | | [HttpPost, Route("AddMes_Info"), AllowAnonymous] |
| | | public WebResponseContent AddMES_info([FromBody] object json) |
| | | { |
| | | lock (AddMES_infoobj) |
| | |
| | | return ToMesServer.AddMes_Info(json); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WCS.IServices; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using WIDESEA_Core.Utilities; |
| | | |
| | | namespace WIDESEA_WCS.Controllers |
| | | { |
| | |
| | | _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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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/'; |
| | |
| | | {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'}, |
| | |
| | | {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'}, |
| | |
| | | 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'}]); |
| | |
| | | [{"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":""}); |
| | |
| | | {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", |
| | |
| | | /// <summary> |
| | | /// ç©ºè´§ä½ |
| | | /// </summary> |
| | | Empty |
| | | Empty, |
| | | /// <summary> |
| | | /// å ç¨ |
| | | /// </summary> |
| | | Busy, |
| | | /// <summary> |
| | | /// å
¥åºå ç¨ |
| | | /// </summary> |
| | | InBusy, |
| | | /// <summary> |
| | | /// åºåºå ç¨ |
| | | /// </summary> |
| | | OutBusy, |
| | | /// <summary> |
| | | /// å¼å¸¸ |
| | | /// </summary> |
| | | Abnormal |
| | | } |
| | | } |
| | |
| | | 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 = "çç¼çå·")] |
| | |
| | | [Editable(true)] |
| | | public string area { get; set; } |
| | | /// <summary> |
| | | /// å·¥åç¼å· |
| | | /// å·¥åç¼å·/å·¥ä½ä»¤å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
| | |
| | | public string agv_taskstate { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å·¥åç±»å/AGVå·¥ä½ç±»å |
| | | ///å·¥åç±»å (17-æºå å·¥ 28-æ£æµçº¿ 101ç§»åºå¤å) |
| | | /// </summary> |
| | | [Display(Name = "AGVå·¥ä½ç±»å")] |
| | | [Column(TypeName = "int")] |
| | |
| | | public string agv_remark { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ä»»å¡ç级 0ãæç¼1ãæ£å¸¸2ãå æ¥ |
| | | ///ä»»å¡ç级 0ï¼æç¼1ï¼æ£å¸¸2ï¼å æ¥ 3ï¼ç¹æ¥ |
| | | /// </summary> |
| | | [Display(Name = "ä»»å¡ç级")] |
| | | [Column(TypeName = "int")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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; } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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]屿§ï¼å¦åä¼å¼å¸¸ |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | 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) |
| | |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | using static FreeSql.Internal.GlobalFilter; |
| | | |
| | | namespace WIDESEA_WMS.Common |
| | | { |
| | |
| | | /// <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(","); |
| | |
| | | if (count < 1) |
| | | throw new Exception("åºåæ¸
é¤å¤±è´¥ï¼SNå·:" + bindSN); |
| | | } |
| | | |
| | | } |
| | | else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString()) |
| | | { |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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(",")) |
| | | { |
| | |
| | | } |
| | | 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车轮åºåº |
| | |
| | | } |
| | | 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车轮å
¥åº |
| | |
| | | //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); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.IServices |
| | | { |
| | | public partial interface IVV_Mes_WorkinfoService : IService<VV_Mes_Workinfo> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äº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 |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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>(); } } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äº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); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *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>(); } } |
| | | } |
| | | } |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | 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); |
| | |
| | | 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, |
| | |
| | | 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 |
| | | }; |
| | |
| | | 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 |
| | |
| | | { |
| | | |
| | | 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; |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *æ¥å£ç¼åå¤... |
| | | *妿æ¥å£éè¦å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; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *妿è¦å¢å æ¹æ³è¯·å¨å½åç®å½ä¸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) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | IPï¼192.168.12.101 |
| | | ç¨æ·åï¼TZFWQ |
| | | å¯ç ï¼123456 |