|  |  |  | 
|---|
|  |  |  | let loadingInstance; | 
|---|
|  |  |  | let loadingStatus = false; | 
|---|
|  |  |  | if (process.env.NODE_ENV == 'development') { | 
|---|
|  |  |  | axios.defaults.baseURL = 'http://192.168.12.101:8099/'; | 
|---|
|  |  |  | axios.defaults.baseURL = 'http://192.168.12.118:8099/'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (process.env.NODE_ENV == 'debug') { | 
|---|
|  |  |  | axios.defaults.baseURL = 'http://192.168.12.101:8099/'; | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | /***************************************************************************************** | 
|---|
|  |  |  | **  Author:jxx 2022 | 
|---|
|  |  |  | **  QQ:283591387 | 
|---|
|  |  |  | **宿´ææ¡£è§ï¼http://v2.volcore.xyz/document/api ã代ç çæé¡µé¢ViewGridã | 
|---|
|  |  |  | **常ç¨ç¤ºä¾è§ï¼http://v2.volcore.xyz/document/vueDev | 
|---|
|  |  |  | **åå°æä½è§ï¼http://v2.volcore.xyz/document/netCoreDev | 
|---|
|  |  |  | *****************************************************************************************/ | 
|---|
|  |  |  | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæçä»£ç  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let extension = { | 
|---|
|  |  |  | components: { | 
|---|
|  |  |  | //æ¥è¯¢ç颿©å±ç»ä»¶ | 
|---|
|  |  |  | gridHeader: '', | 
|---|
|  |  |  | gridBody: '', | 
|---|
|  |  |  | gridFooter: '', | 
|---|
|  |  |  | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ | 
|---|
|  |  |  | modelHeader: '', | 
|---|
|  |  |  | modelBody: '', | 
|---|
|  |  |  | modelFooter: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | tableAction: '', //æå®æå¼ è¡¨çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) | 
|---|
|  |  |  | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ | 
|---|
|  |  |  | onInit() {  //æ¡æ¶åå§åé
ç½®åï¼ | 
|---|
|  |  |  | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® | 
|---|
|  |  |  | //   this.buttons.unshift({  //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» | 
|---|
|  |  |  | //     name: 'æé®', //æé®åç§° | 
|---|
|  |  |  | //     icon: 'el-icon-document', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) | 
|---|
|  |  |  | //     type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button | 
|---|
|  |  |  | //     onClick: function () { | 
|---|
|  |  |  | //       this.$Message.success('ç¹å»äºæé®'); | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | //   }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ | 
|---|
|  |  |  | // this.boxOptions.labelWidth = 150; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onInited() { | 
|---|
|  |  |  | //æ¡æ¶åå§åé
ç½®å | 
|---|
|  |  |  | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ | 
|---|
|  |  |  | //this.detailOptions.columns.forEach(column=>{ }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | searchBefore(param) { | 
|---|
|  |  |  | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° | 
|---|
|  |  |  | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | searchAfter(result) { | 
|---|
|  |  |  | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤ç表格çå¼ | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | addBefore(formData) { | 
|---|
|  |  |  | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | updateBefore(formData) { | 
|---|
|  |  |  | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rowClick({ row, column, event }) { | 
|---|
|  |  |  | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ | 
|---|
|  |  |  | // this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | modelOpenAfter(row) { | 
|---|
|  |  |  | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® | 
|---|
|  |  |  | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; | 
|---|
|  |  |  | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ | 
|---|
|  |  |  | //(3)this.editFormFields.åæ®µ='xxx'; | 
|---|
|  |  |  | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ | 
|---|
|  |  |  | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | export default extension; | 
|---|
|  |  |  | 
|---|
|  |  |  | path: '/VV_Workinfo_hty', | 
|---|
|  |  |  | name: 'VV_Workinfo_hty', | 
|---|
|  |  |  | component: () => import('@/views/widesea_wcs/tomes/VV_Workinfo_hty.vue') | 
|---|
|  |  |  | }    ,{ | 
|---|
|  |  |  | path: '/dt_info_trace', | 
|---|
|  |  |  | name: 'dt_info_trace', | 
|---|
|  |  |  | component: () => import('@/views/widesea_wcs/wcs/dt_info_trace.vue') | 
|---|
|  |  |  | }] | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default viewgird | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | <!-- | 
|---|
|  |  |  | *Authorï¼jxx | 
|---|
|  |  |  | *Contactï¼283591387@qq.com | 
|---|
|  |  |  | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç | 
|---|
|  |  |  | *ä¸å¡è¯·å¨@/extension/widesea_wcs/wcs/dt_info_trace.jsæ¤å¤ç¼å | 
|---|
|  |  |  | --> | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <view-grid ref="grid" | 
|---|
|  |  |  | :columns="columns" | 
|---|
|  |  |  | :detail="detail" | 
|---|
|  |  |  | :editFormFields="editFormFields" | 
|---|
|  |  |  | :editFormOptions="editFormOptions" | 
|---|
|  |  |  | :searchFormFields="searchFormFields" | 
|---|
|  |  |  | :searchFormOptions="searchFormOptions" | 
|---|
|  |  |  | :table="table" | 
|---|
|  |  |  | :extend="extend"> | 
|---|
|  |  |  | </view-grid> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import extend from "@/extension/widesea_wcs/wcs/dt_info_trace.js"; | 
|---|
|  |  |  | import { ref, defineComponent } from "vue"; | 
|---|
|  |  |  | export default defineComponent({ | 
|---|
|  |  |  | setup() { | 
|---|
|  |  |  | const table = ref({ | 
|---|
|  |  |  | key: 'trace_id', | 
|---|
|  |  |  | footer: "Foots", | 
|---|
|  |  |  | cnName: '车轮信æ¯è¿½æº¯', | 
|---|
|  |  |  | name: 'wcs/dt_info_trace', | 
|---|
|  |  |  | url: "/dt_info_trace/", | 
|---|
|  |  |  | sortName: "trace_online_time" | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | const editFormFields = ref({}); | 
|---|
|  |  |  | const editFormOptions = ref([]); | 
|---|
|  |  |  | const searchFormFields = ref({"trace_SN":"","trace_status":"","trace_workOrder":"","trace_drawingNo":"","trace_heatID":"","trace_billetID":"","trace_line_number":"","trace_mach_number":"","trace_mach_statu":"","trace_process":"","trace_operator":"","trace_tcvm_number":""}); | 
|---|
|  |  |  | const searchFormOptions = ref([[{"title":"车轮SNå·","field":"trace_SN","type":"like"},{"title":"å·¥ä½ä»¤å·","field":"trace_workOrder","type":"like"},{"title":"产åå¾å·","field":"trace_drawingNo","type":"like"}],[{"dataKey":"trace_status","data":[],"title":"ç¶æ","field":"trace_status","type":"select"},{"title":"ç代å·","field":"trace_heatID","type":"like"},{"title":"é¢å¯å·","field":"trace_billetID","type":"like"}],[{"title":"ç产线ç¼å·","field":"trace_line_number","type":"like"},{"title":"æºåºç¼å·","field":"trace_mach_number","type":"like"},{"title":"è§è§æ£æµç¼å·","field":"trace_tcvm_number","type":"like"}],[{"title":"å å·¥è´¨éç¶æ","field":"trace_mach_statu","type":"like"},{"title":"宿æ
åµ","field":"trace_process","type":"like"},{"title":"æä½äººå","field":"trace_operator","type":"like"}]]); | 
|---|
|  |  |  | const columns = ref([{field:'ID',title:'ID',type:'int',width:80,hidden:true,readonly:true,require:true,align:'left'}, | 
|---|
|  |  |  | {field:'trace_id',title:'主é®',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'}, | 
|---|
|  |  |  | {field:'trace_SN',title:'车轮SNå·',type:'string',width:110,require:true,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_status',title:'ç¶æ',type:'string',bind:{ key:'trace_status',data:[]},width:80,align:'left'}, | 
|---|
|  |  |  | {field:'trace_workOrder',title:'å·¥ä½ä»¤å·',type:'string',width:120,align:'left'}, | 
|---|
|  |  |  | {field:'trace_productName',title:'产ååç§°',type:'string',width:80,align:'left'}, | 
|---|
|  |  |  | {field:'trace_drawingNo',title:'产åå¾å·',type:'string',width:80,align:'left'}, | 
|---|
|  |  |  | {field:'trace_heatBatchID',title:'çç¼çå·',type:'string',width:100,align:'left'}, | 
|---|
|  |  |  | {field:'trace_heatID',title:'ç代å·',type:'string',width:60,align:'left'}, | 
|---|
|  |  |  | {field:'trace_billetID',title:'é¢å¯å·',type:'string',width:60,align:'left'}, | 
|---|
|  |  |  | {field:'trace_line_number',title:'ç产线ç¼å·',type:'string',width:100,align:'left'}, | 
|---|
|  |  |  | {field:'trace_online_time',title:'ä¸çº¿æ¶é´',type:'datetime',width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_mach_number',title:'æºåºç¼å·',type:'string',sort:true,width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_mach_start_time',title:'å å·¥å¼å§æ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_mach_finish_time',title:'å å·¥å®ææ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_mach_statu',title:'å å·¥è´¨éç¶æ',type:'int',width:80,align:'left'}, | 
|---|
|  |  |  | {field:'trace_process',title:'宿æ
åµ',type:'int',width:80,align:'left'}, | 
|---|
|  |  |  | {field:'trace_operator',title:'æä½äººå',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_shift',title:'çç»',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_manufacturer',title:'é¢éåå®¶',type:'string',width:120,align:'left'}, | 
|---|
|  |  |  | {field:'trace_offline_time',title:'ä¸çº¿æ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_tcvm_number',title:'è§è§æ£æµç¼å·',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_tcvm_start_time',title:'è§è§æ£æµå¼å§æ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_tcvm_finish_time',title:'è§è§æ£æµå®ææ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_tcvm_statu',title:'æ£æµè´¨éç¶æ',type:'int',width:80,align:'left'}, | 
|---|
|  |  |  | {field:'trace_liquoring_time',title:'å·é²éæ¶²æ¶é´',type:'datetime',width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_bait_number',title:'䏿ä½ç¼å·',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_baiting_time',title:'䏿æ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_direction',title:'å»å(å¾
æ£åº,å¤ååº)',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_in_time',title:'å
¥åºæ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_load_number',title:'䏿ä½ç¼å·',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_loading_time',title:'䏿æ¶é´',type:'datetime',sort:true,width:150,align:'left',sort:true}, | 
|---|
|  |  |  | {field:'trace_defect',title:'ç¼ºé·æè¿°',type:'string',width:110,align:'left'}, | 
|---|
|  |  |  | {field:'trace_remark',title:'夿³¨ï¼æ³¨æäºé¡¹',type:'string',width:110,align:'left'}]); | 
|---|
|  |  |  | const detail = ref({ | 
|---|
|  |  |  | cnName: "#detailCnName", | 
|---|
|  |  |  | table: "#detailTable", | 
|---|
|  |  |  | columns: [], | 
|---|
|  |  |  | sortName: "", | 
|---|
|  |  |  | key: "" | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | table, | 
|---|
|  |  |  | extend, | 
|---|
|  |  |  | editFormFields, | 
|---|
|  |  |  | editFormOptions, | 
|---|
|  |  |  | searchFormFields, | 
|---|
|  |  |  | searchFormOptions, | 
|---|
|  |  |  | columns, | 
|---|
|  |  |  | detail, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | </script> | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | using System; | 
|---|
|  |  |  | using System.Collections.Generic; | 
|---|
|  |  |  | using System.Linq; | 
|---|
|  |  |  | using System.Text; | 
|---|
|  |  |  | using System.Threading.Tasks; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | namespace WIDESEA_Comm | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public class Wheel_trace | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// è½¦è½®ä¸çº¿ï¼DB610ï¼ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public class Wheel_online | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// åç§° | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string Name { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// è½¦è½®SNå· | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_wp_id { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// ä¸çº¿æ¶é´ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_online_time { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// ç³è¯· | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public byte oi_on { get; set; } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// è½¦è½®å å·¥ï¼DB611ï¼ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public class Wheel_Machine | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// åç§° | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string Name { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// è½¦è½®SNå· | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_wp_id { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// å å·¥å¼å§æ¶é´ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_mach_start_time { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// å å·¥å®ææ¶é´ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_mach_finish_time { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// æä½äºº | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_operator { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// çç» | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_shift { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// å å·¥è´¨éç¶æ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public Int16 o_wp_status { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// å®ææ
åµ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public Int16 o_wp_process { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// ç³è¯· | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public byte oi_on { get; set; } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// è½¦è½®ä¸çº¿ï¼DB612ï¼ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public class Wheel_offline | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// åç§° | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string Name { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// è½¦è½®SNå· | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_wp_id { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// ä¸çº¿æ¶é´ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public string o_offline_time { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | ///ʌȌ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public byte o_direction { get; set; } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// ç³è¯· | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | public byte oi_on { get; set; } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | using System; | 
|---|
|  |  |  | using System.Collections.Generic; | 
|---|
|  |  |  | using System.Globalization; | 
|---|
|  |  |  | using System.Linq; | 
|---|
|  |  |  | using System.Reflection; | 
|---|
|  |  |  | 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_WCS.WCSClient; | 
|---|
|  |  |  | using WIDESEA_WMS.IRepositories; | 
|---|
|  |  |  | using WIDESEA_WMS.Repositories; | 
|---|
|  |  |  | using static WIDESEA_Comm.Wheel_trace; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | namespace WIDESEA_WCS | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public class Wheel_info_trace | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// æ¥è¯¢è½¦è½®ä¸çº¿ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="client"></param> | 
|---|
|  |  |  | public static void Wheel_online(PLCClient client) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | VOLContext context = new VOLContext(); | 
|---|
|  |  |  | Idt_info_traceRepository traceRepository = new dt_info_traceRepository(context); | 
|---|
|  |  |  | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); | 
|---|
|  |  |  | PropertyInfo[] propertyInfos = typeof(Wheel_online).GetProperties(); | 
|---|
|  |  |  | var groups = client.itemGroups.Where(x => x.opratortype == "trace_online").OrderBy(x => x.Methods).ThenBy(x => x.name).GroupBy(x => x.Methods).ToList(); | 
|---|
|  |  |  | foreach (var key in groups) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Wheel_online StackerDBItem = new Wheel_online(); | 
|---|
|  |  |  | foreach (var propertyInfo in propertyInfos) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (propertyInfo.Name == "Name") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | StackerDBItem.Name = key.Key; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DBItemGroup group = key.FirstOrDefault(x => x.name == propertyInfo.Name); | 
|---|
|  |  |  | if (group != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var readData = DBExtension.Read(group, client); | 
|---|
|  |  |  | switch (propertyInfo.Name) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case "oi_on": | 
|---|
|  |  |  | StackerDBItem.oi_on = Convert.ToByte(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_wp_id": | 
|---|
|  |  |  | StackerDBItem.o_wp_id = Convert.ToString(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_online_time": | 
|---|
|  |  |  | StackerDBItem.o_online_time = readData.ToString(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #region æ¿æ¢èPCSæ¶ä½¿ç¨ | 
|---|
|  |  |  | if (/*StackerDBItem.oi_on == 1*/true) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (string.IsNullOrEmpty(StackerDBItem.o_wp_id)) throw new Exception($"{StackerDBItem.Name}ï¼SNå·ä¸ºç©º"); | 
|---|
|  |  |  | if (string.IsNullOrEmpty(StackerDBItem.o_online_time)) throw new Exception($"{StackerDBItem.Name}ï¼ä¸çº¿æ¶é´ä¸ºç©º"); | 
|---|
|  |  |  | var info = traceRepository.Find(x => x.trace_SN == StackerDBItem.o_wp_id).FirstOrDefault(); | 
|---|
|  |  |  | if (info != null) throw new Exception(); | 
|---|
|  |  |  | info = new dt_info_trace(); | 
|---|
|  |  |  | info.trace_SN = StackerDBItem.o_wp_id; | 
|---|
|  |  |  | var time = DateTime.ParseExact(StackerDBItem.o_online_time, "yyyyMMddHHmmss", CultureInfo.CurrentCulture); | 
|---|
|  |  |  | //var time1 = DateTime.ParseExact(StackerDBItem.o_online_time, "yyyyMMddHHmmss", new CultureInfo("zh-CN", true)); | 
|---|
|  |  |  | info.trace_status = "å¾
å å·¥"; | 
|---|
|  |  |  | info.trace_online_time = time; | 
|---|
|  |  |  | info.trace_line_number = StackerDBItem.Name; | 
|---|
|  |  |  | var Work = workinfoRepository.Find(x => x.SN == info.trace_SN && x.processCode == "17").FirstOrDefault(); | 
|---|
|  |  |  | if (Work != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | info.trace_workOrder = Work.workOrder; | 
|---|
|  |  |  | info.trace_productName = Work.productName; | 
|---|
|  |  |  | info.trace_drawingNo = Work.drawingNo; | 
|---|
|  |  |  | info.trace_heatBatchID = Work.heatBatchID; | 
|---|
|  |  |  | info.trace_heatID = Work.heatID; | 
|---|
|  |  |  | info.trace_billetID = Work.billetID.ToString(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | traceRepository.Add(info, true); | 
|---|
|  |  |  | //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//ä¿¡å·å¤ä½ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//ä¿¡å·å¤ä½ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// æ¥è¯¢è½¦è½®å å·¥ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="client"></param> | 
|---|
|  |  |  | public static void Wheel_machine(PLCClient client) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | VOLContext context = new VOLContext(); | 
|---|
|  |  |  | Idt_info_traceRepository traceRepository = new dt_info_traceRepository(context); | 
|---|
|  |  |  | PropertyInfo[] propertyInfos = typeof(Wheel_Machine).GetProperties(); | 
|---|
|  |  |  | var groups = client.itemGroups.Where(x => x.opratortype == "trace_Machine").OrderBy(x => x.Methods).ThenBy(x => x.name).GroupBy(x => x.Methods).ToList(); | 
|---|
|  |  |  | foreach (var key in groups) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Wheel_Machine StackerDBItem = new Wheel_Machine(); | 
|---|
|  |  |  | foreach (var propertyInfo in propertyInfos) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (propertyInfo.Name == "Name") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | StackerDBItem.Name = key.Key; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DBItemGroup group = key.FirstOrDefault(x => x.name == propertyInfo.Name); | 
|---|
|  |  |  | if (group != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var readData = DBExtension.Read(group, client); | 
|---|
|  |  |  | switch (propertyInfo.Name) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case "oi_on": | 
|---|
|  |  |  | StackerDBItem.oi_on = Convert.ToByte(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_wp_id": | 
|---|
|  |  |  | StackerDBItem.o_wp_id = Convert.ToString(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_mach_start_time": | 
|---|
|  |  |  | StackerDBItem.o_mach_start_time = readData.ToString(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_mach_finish_time": | 
|---|
|  |  |  | StackerDBItem.o_mach_finish_time = readData.ToString(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_operator": | 
|---|
|  |  |  | StackerDBItem.o_operator = readData.ToString(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_shift": | 
|---|
|  |  |  | StackerDBItem.o_shift = readData.ToString(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_wp_status": | 
|---|
|  |  |  | StackerDBItem.o_wp_status = Convert.ToInt16(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_wp_process": | 
|---|
|  |  |  | StackerDBItem.o_wp_process = Convert.ToInt16(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #region æ¿æ¢èPCSæ¶ä½¿ç¨ | 
|---|
|  |  |  | if (/*StackerDBItem.oi_on == 1*/true) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (string.IsNullOrEmpty(StackerDBItem.o_wp_id)) throw new Exception($"{StackerDBItem.Name}ï¼SNå·ä¸ºç©º"); | 
|---|
|  |  |  | var info = traceRepository.Find(x => x.trace_SN == StackerDBItem.o_wp_id).FirstOrDefault(); | 
|---|
|  |  |  | if (info != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (!string.IsNullOrEmpty(StackerDBItem.o_mach_start_time)) | 
|---|
|  |  |  | info.trace_mach_start_time = DateTime.ParseExact(StackerDBItem.o_mach_start_time, "yyyyMMddHHmmss", CultureInfo.CurrentCulture); | 
|---|
|  |  |  | if (!string.IsNullOrEmpty(StackerDBItem.o_mach_finish_time)) | 
|---|
|  |  |  | info.trace_mach_finish_time = DateTime.ParseExact(StackerDBItem.o_mach_finish_time, "yyyyMMddHHmmss", CultureInfo.CurrentCulture); | 
|---|
|  |  |  | if (!string.IsNullOrEmpty(StackerDBItem.o_operator)) info.trace_operator = StackerDBItem.o_operator; | 
|---|
|  |  |  | if (!string.IsNullOrEmpty(StackerDBItem.o_shift)) info.trace_shift = info.trace_shift; | 
|---|
|  |  |  | info.trace_mach_statu = StackerDBItem.o_wp_status; | 
|---|
|  |  |  | info.trace_process = StackerDBItem.o_wp_process; | 
|---|
|  |  |  | info.trace_mach_number = StackerDBItem.Name; | 
|---|
|  |  |  | traceRepository.Update(info, x => new { x.trace_mach_start_time, x.trace_mach_finish_time, x.trace_operator, x.trace_shift, x.trace_mach_statu, x.trace_process, x.trace_mach_number }, true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//ä¿¡å·å¤ä½ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//ä¿¡å·å¤ä½ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// æ¥è¯¢è½¦è½®ä¸çº¿ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="client"></param> | 
|---|
|  |  |  | public static void Wheel_offline(PLCClient client) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | VOLContext context = new VOLContext(); | 
|---|
|  |  |  | Idt_info_traceRepository traceRepository = new dt_info_traceRepository(context); | 
|---|
|  |  |  | PropertyInfo[] propertyInfos = typeof(Wheel_offline).GetProperties(); | 
|---|
|  |  |  | var groups = client.itemGroups.Where(x => x.opratortype == "trace_offline").OrderBy(x => x.Methods).ThenBy(x => x.name).GroupBy(x => x.Methods).ToList(); | 
|---|
|  |  |  | foreach (var key in groups) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Wheel_offline StackerDBItem = new Wheel_offline(); | 
|---|
|  |  |  | foreach (var propertyInfo in propertyInfos) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (propertyInfo.Name == "Name") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | StackerDBItem.Name = key.Key; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DBItemGroup group = key.FirstOrDefault(x => x.name == propertyInfo.Name); | 
|---|
|  |  |  | if (group != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var readData = DBExtension.Read(group, client); | 
|---|
|  |  |  | switch (propertyInfo.Name) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case "oi_on": | 
|---|
|  |  |  | StackerDBItem.oi_on = Convert.ToByte(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_wp_id": | 
|---|
|  |  |  | StackerDBItem.o_wp_id = Convert.ToString(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_offline_time": | 
|---|
|  |  |  | StackerDBItem.o_offline_time = readData.ToString(); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case "o_direction": | 
|---|
|  |  |  | StackerDBItem.o_direction = Convert.ToByte(readData); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #region æ¿æ¢èPCSæ¶ä½¿ç¨ | 
|---|
|  |  |  | if (/*StackerDBItem.oi_on == 1*/true) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (string.IsNullOrEmpty(StackerDBItem.o_wp_id)) throw new Exception($"{StackerDBItem.Name}ï¼SNå·ä¸ºç©º"); | 
|---|
|  |  |  | var info = traceRepository.Find(x => x.trace_SN == StackerDBItem.o_wp_id).FirstOrDefault(); | 
|---|
|  |  |  | if (info != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (!string.IsNullOrEmpty(StackerDBItem.o_offline_time)) | 
|---|
|  |  |  | info.trace_offline_time = DateTime.ParseExact(StackerDBItem.o_offline_time, "yyyyMMddHHmmss", CultureInfo.CurrentCulture); | 
|---|
|  |  |  | info.trace_direction = StackerDBItem.o_direction.ToString(); | 
|---|
|  |  |  | //info.trace_line_number = info.trace_line_number + StackerDBItem.Name; | 
|---|
|  |  |  | traceRepository.Update(info, x => new { x.trace_offline_time, x.trace_direction }, true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//ä¿¡å·å¤ä½ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//ä¿¡å·å¤ä½ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | client.Connect(); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #region MyRegion | 
|---|
|  |  |  | Wheel_info_trace.Wheel_online(client); | 
|---|
|  |  |  | Wheel_info_trace.Wheel_machine(client); | 
|---|
|  |  |  | Wheel_info_trace.Wheel_offline(client); | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | #region ä¿¡æ¯éé | 
|---|
|  |  |  | WheelDBItem.VK4WheelDBItem = GetDate.GetWheelDate(client); | 
|---|
|  |  |  | VKDBItem.VK4DBItem = GetDate.GetVKDate(client); | 
|---|
|  |  |  | GantryDBItem.VK4GantryDBItem = GetDate.GetGantryDate(client); | 
|---|
|  |  |  | MachineDBItem.VK4MachineDBItem = GetDate.GetMachineDate(client); | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | client.Connect(); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #region MyRegion | 
|---|
|  |  |  | Wheel_info_trace.Wheel_online(client); | 
|---|
|  |  |  | Wheel_info_trace.Wheel_machine(client); | 
|---|
|  |  |  | Wheel_info_trace.Wheel_offline(client); | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | #region ä¿¡æ¯éé | 
|---|
|  |  |  | WheelDBItem.VK5WheelDBItem = GetDate.GetWheelDate(client); | 
|---|
|  |  |  | VKDBItem.VK5DBItem = GetDate.GetVKDate(client); | 
|---|
|  |  |  | GantryDBItem.VK5GantryDBItem = GetDate.GetGantryDate(client); | 
|---|
|  |  |  | MachineDBItem.VK5MachineDBItem = GetDate.GetMachineDate(client); | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //string str = DataParse.GetStr(bytes, 0); | 
|---|
|  |  |  | //return (DataType)(str as object); | 
|---|
|  |  |  | var str = GetContent(siemensPLCClient.ReadString(dbAddress, (ushort)len), dbAddress).ToString(); | 
|---|
|  |  |  | str = str.Replace("\0", "")?.Replace("\\", "")?.Replace("\u0014", "")?.Replace("?\u0006", "")?.Replace("\n", "")?.Replace("?", "")?.Trim(); | 
|---|
|  |  |  | str = str.Replace("\0", "")?.Replace("\\", "")?.Replace("\u0014", "")?.Replace("?\u0006", "")?.Replace("\u000e\u000e", "")?.Replace("\n", "")?.Replace("?", "")?.Trim(); | 
|---|
|  |  |  | return (DataType)(str as object); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|