已删除5个文件
已修改19个文件
已添加20个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | /***************************************************************************************** |
| | | ** 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; |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 150, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | render: (h, { row, column, index }) => { |
| | | return h('div', {}, [ |
| | | h( |
| | | 'span', |
| | | { |
| | | style: { |
| | | 'cursor': 'pointer', |
| | | 'padding': '5px 10px', |
| | | 'border-radius': '3px', |
| | | 'background-color': '#67c23a', |
| | | 'color': '#fff', |
| | | 'font-size': '13px ', |
| | | }, |
| | | onClick: (e) => { |
| | | this.request('UpdateAuto', row); |
| | | // this.request(row); |
| | | } |
| | | }, |
| | | 'èªå¨' |
| | | ), |
| | | h( |
| | | 'span', |
| | | { |
| | | style: { |
| | | 'cursor': 'pointer', |
| | | 'margin-left': "10px", |
| | | 'padding': '5px 10px', |
| | | 'border-radius': '3px', |
| | | 'background-color': '#f56c6c', |
| | | 'color': '#fff', |
| | | 'font-size': '13px ', |
| | | }, |
| | | onClick: (e) => { |
| | | this.request('UpdateManual', row); |
| | | // this.request(row); |
| | | } |
| | | }, |
| | | 'æå¨' |
| | | ) |
| | | ]); |
| | | } |
| | | }); |
| | | }, |
| | | request(action,row) { |
| | | // let url = `api/VV_Dispatch/${action}`; |
| | | let url = `/api/dt_pattern/${action}`; |
| | | // let params = { |
| | | // Name: row.Name, |
| | | // Enable:row.Enable |
| | | // } |
| | | this.http.post(url , row, true).then((x) => { |
| | | if (!x.status) return this.$error(x.message); |
| | | this.$success(x.message); |
| | | // this.refresh(); |
| | | this.search(); |
| | | }); |
| | | }, |
| | | 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: '/dt_Interfacerecord_pcs', |
| | | name: 'dt_Interfacerecord_pcs', |
| | | component: () => import('@/views/widesea_wcs/system/dt_Interfacerecord_pcs.vue') |
| | | } ,{ |
| | | path: '/dt_pattern', |
| | | name: 'dt_pattern', |
| | | component: () => import('@/views/widesea_wcs/wcs/dt_pattern.vue') |
| | | }] |
| | | |
| | | export default viewgird |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wcs/wcs/dt_pattern.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_pattern.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'ID', |
| | | footer: "Foots", |
| | | cnName: 'å
¥åºæ¨¡å¼', |
| | | name: 'wcs/dt_pattern', |
| | | url: "/dt_pattern/", |
| | | sortName: "ID" |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([]); |
| | | const searchFormFields = ref({}); |
| | | const searchFormOptions = ref([]); |
| | | const columns = ref([{field:'ID',title:'ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'}, |
| | | {field:'pattern_name',title:'模å¼å',type:'string',width:220,align:'left',sort:true}, |
| | | {field:'pattern_state',title:'模å¼ç¶æ',type:'int',bind:{ key:'PatternStates',data:[]},width:110,require:true,align:'left'}, |
| | | {field:'pattern_remark',title:'pattern_remark',type:'string',width:220,align:'left'}]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "" |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | /// <summary> |
| | | /// ç©ºè´§ä½ |
| | | /// </summary> |
| | | <<<<<<< Updated upstream |
| | | Empty |
| | | ======= |
| | | Empty, |
| | | Busy |
| | | >>>>>>> Stashed changes |
| | | /// <summary> |
| | | /// å ç¨ |
| | | /// </summary> |
| | | Busy, |
| | | /// <summary> |
| | | /// å¼å¸¸ |
| | | /// </summary> |
| | | Abnormal |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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 = "dt_pattern")] |
| | | public partial class dt_pattern:BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name ="ID")] |
| | | [Column(TypeName="int")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public int ID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="pattern_name")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName="nvarchar(255)")] |
| | | [Editable(true)] |
| | | public string pattern_name { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ¨¡å¼ |
| | | /// </summary> |
| | | [Display(Name ="模å¼")] |
| | | [Column(TypeName="int")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public int pattern_state { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="pattern_remark")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName="nvarchar(255)")] |
| | | [Editable(true)] |
| | | public string pattern_remark { 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 dt_pattern |
| | | { |
| | | //æ¤å¤é
ç½®åæ®µ(åæ®µé
ç½®è§æ¤modelçå¦ä¸ä¸ªpartial),å¦æè¡¨ä¸æ²¡ææ¤å段请å ä¸ [NotMapped]屿§ï¼å¦åä¼å¼å¸¸ |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_Entity.DomainModels |
| | | { |
| | | [Entity(TableCnName = "åºä½ä¿¡æ¯",TableName = "dt_stationinfo")] |
| | | public partial class dt_stationinfo:BaseEntity |
| | | [Entity(TableCnName = "åºä½ä¿¡æ¯", TableName = "dt_stationinfo")] |
| | | public partial class dt_stationinfo : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="id")] |
| | | [Column(TypeName="uniqueidentifier")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public Guid id { get; set; } |
| | | /// |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name = "id")] |
| | | [Column(TypeName = "uniqueidentifier")] |
| | | //[Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public Guid id { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç¼åæ¶ç¼å· |
| | | /// </summary> |
| | | [Display(Name ="ç¼åæ¶ç¼å·")] |
| | | [MaxLength(30)] |
| | | [Column(TypeName="nvarchar(30)")] |
| | | [Editable(true)] |
| | | public string stationCode { get; set; } |
| | | /// <summary> |
| | | ///ç¼åæ¶ç¼å· |
| | | /// </summary> |
| | | [Display(Name = "ç¼åæ¶ç¼å·")] |
| | | [MaxLength(30)] |
| | | [Column(TypeName = "nvarchar(30)")] |
| | | //[Editable(true)] |
| | | public string stationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç©æç±»å |
| | | /// </summary> |
| | | [Display(Name ="ç©æç±»å")] |
| | | [MaxLength(25)] |
| | | [Column(TypeName="nvarchar(25)")] |
| | | [Editable(true)] |
| | | public string stationType { get; set; } |
| | | /// <summary> |
| | | ///ç©æç±»å |
| | | /// </summary> |
| | | [Display(Name = "ç©æç±»å")] |
| | | [MaxLength(25)] |
| | | [Column(TypeName = "nvarchar(25)")] |
| | | //[Editable(true)] |
| | | public string? stationType { get; set; } |
| | | |
| | | /// <summary> |
| | | ///åºå |
| | | /// </summary> |
| | | [Display(Name ="åºå")] |
| | | [MaxLength(15)] |
| | | [Column(TypeName="nvarchar(15)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public string area { get; set; } |
| | | /// <summary> |
| | | ///åºå |
| | | /// </summary> |
| | | [Display(Name = "åºå")] |
| | | [MaxLength(15)] |
| | | [Column(TypeName = "nvarchar(15)")] |
| | | //[Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string area { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ¯å¦å¯ç¨ |
| | | /// </summary> |
| | | [Display(Name ="æ¯å¦å¯ç¨")] |
| | | [Column(TypeName="bit")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public bool enable { get; set; } |
| | | /// <summary> |
| | | ///æ¯å¦å¯ç¨ |
| | | /// </summary> |
| | | [Display(Name = "æ¯å¦å¯ç¨")] |
| | | [Column(TypeName = "bit")] |
| | | //[Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public bool enable { get; set; } |
| | | |
| | | /// <summary> |
| | | ///è´§ä½ç¶æ |
| | | /// </summary> |
| | | [Display(Name ="è´§ä½ç¶æ")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName="varchar(255)")] |
| | | [Editable(true)] |
| | | public string location_state { get; set; } |
| | | /// <summary> |
| | | ///è´§ä½ç¶æ |
| | | /// </summary> |
| | | [Display(Name = "è´§ä½ç¶æ")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName = "varchar(255)")] |
| | | //[Editable(true)] |
| | | public string location_state { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æåç¶ææ¹åæ¶é´ |
| | | /// </summary> |
| | | [Display(Name ="æåç¶ææ¹åæ¶é´")] |
| | | [Column(TypeName="datetime")] |
| | | [Editable(true)] |
| | | public DateTime? lastUpdateTime { get; set; } |
| | | /// <summary> |
| | | ///æåç¶ææ¹åæ¶é´ |
| | | /// </summary> |
| | | [Display(Name = "æåç¶ææ¹åæ¶é´")] |
| | | [Column(TypeName = "datetime")] |
| | | //[Editable(true)] |
| | | public DateTime? lastUpdateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | ///车轮æ°é |
| | | /// </summary> |
| | | [Display(Name ="车轮æ°é")] |
| | | [Column(TypeName="int")] |
| | | public int? quantity { get; set; } |
| | | /// <summary> |
| | | ///车轮æ°é |
| | | /// </summary> |
| | | [Display(Name = "车轮æ°é")] |
| | | [Column(TypeName = "int")] |
| | | public int quantity { get; set; } |
| | | |
| | | /// <summary> |
| | | ///车轮SNå· |
| | | /// </summary> |
| | | [Display(Name ="车轮SNå·")] |
| | | [MaxLength(500)] |
| | | [Column(TypeName="nvarchar(500)")] |
| | | public string bindSN { get; set; } |
| | | /// <summary> |
| | | ///车轮SNå· |
| | | /// </summary> |
| | | [Display(Name = "车轮SNå·")] |
| | | [MaxLength(500)] |
| | | [Column(TypeName = "nvarchar(500)")] |
| | | public string bindSN { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æçç¶æ |
| | | /// </summary> |
| | | [Display(Name ="æçç¶æ")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName="nvarchar(100)")] |
| | | public string tray_status { get; set; } |
| | | /// <summary> |
| | | ///æçç¶æ |
| | | /// </summary> |
| | | [Display(Name = "æçç¶æ")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName = "nvarchar(100)")] |
| | | public string tray_status { get; set; } |
| | | |
| | | /// <summary> |
| | | ///夿³¨ |
| | | /// </summary> |
| | | [Display(Name ="夿³¨")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName="nvarchar(100)")] |
| | | [Editable(true)] |
| | | public string remark { get; set; } |
| | | /// <summary> |
| | | ///夿³¨ |
| | | /// </summary> |
| | | [Display(Name = "夿³¨")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName = "nvarchar(100)")] |
| | | //[Editable(true)] |
| | | public string remark { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ä¸»é® |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name ="主é®")] |
| | | [Column(TypeName="int")] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public int zj { get; set; } |
| | | |
| | | /// <summary> |
| | | ///è¡ |
| | | /// </summary> |
| | | [Display(Name ="è¡")] |
| | | [Column(TypeName="int")] |
| | | public int? line { get; set; } |
| | | /// <summary> |
| | | ///è¡ |
| | | /// </summary> |
| | | [Display(Name = "è¡")] |
| | | [Column(TypeName = "int")] |
| | | public int? line { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å |
| | | /// </summary> |
| | | [Display(Name ="å")] |
| | | [Column(TypeName="int")] |
| | | public int? column { get; set; } |
| | | /// <summary> |
| | | ///å |
| | | /// </summary> |
| | | [Display(Name = "å")] |
| | | [Column(TypeName = "int")] |
| | | public int? column { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å·¥åç¼å· |
| | |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName = "nvarchar(255)")] |
| | | [Editable(true)] |
| | | //[Editable(true)] |
| | | public string Number { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Display(Name = "çå·")] |
| | | [Column(TypeName = "int")] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public int heatNumber { get; set; } |
| | | public int? heatNumber { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | ///å·¥å头表ID |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name = "mes_headID")] |
| | | [Column(TypeName = "uniqueidentifier")] |
| | | [Required(AllowEmptyStrings = false)] |
| | |
| | | [Column(TypeName = "nvarchar(255)")] |
| | | [Editable(true)] |
| | | public string plcinfo_remark { get; set; } |
| | | |
| | | /// <summary> |
| | | ///åå· |
| | | /// </summary> |
| | | [Display(Name = "åå·")] |
| | | [MaxLength(20)] |
| | | [Column(TypeName = "nvarchar(20)")] |
| | | [Editable(true)] |
| | | public string plcinfo_model { get; set; } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using WIDESEA_Entity.MappingConfiguration; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | |
| | | namespace WIDESEA_Entity.MappingConfiguration |
| | | { |
| | | public class dt_patternMapConfig : EntityMappingConfiguration<dt_pattern> |
| | | { |
| | | public override void Map(EntityTypeBuilder<dt_pattern> |
| | | builderTable) |
| | | { |
| | | //b.Property(x => x.StorageName).HasMaxLength(45); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | var Gantryplc = FreeDB.Select<dt_plcinfohead>().Where(x => x.plcinfo_name == Gantry_client.PLCName).First(); |
| | | List<string> numbers = new List<string>() { "1åå
é²å", "2åå
é²å", "3åå
é²å", "䏿åºé²å" }; |
| | | var details = FreeDB.Select<dt_plcinfodetail>().Where(x => x.plcdetail_iotype == Gantryplc.plcinfo_iotyep && x.plcdetail_number == numbers[requestin.AreaNr - 1]).ToList(); |
| | | if (MethodName == "AGVRequestin") |
| | | if (MethodName == "AGVRequestin")//请æ±è¿å
¥åºå |
| | | { |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)requestin.AreaNr, numbers[requestin.AreaNr - 1]);//åºåå· |
| | | Gantry_client.WriteByOrder("W_AGV_Request_In", true, numbers[requestin.AreaNr - 1]);//ç³è¯·è¿å
¥åºå |
| | |
| | | if (!Release) throw new Exception("æ¡æ¶æªå
许è¿å
¥ï¼"); |
| | | if (!Gantry_Out_of_Area) throw new Exception("æ¡æ¶å¨åºåå
ï¼"); |
| | | } |
| | | else if (MethodName == "EnteriorLeav") |
| | | else if (MethodName == "EnteriorLeav")//è¿å
¥ç¦»å¼åºå |
| | | { |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)requestin.AreaNr, numbers[requestin.AreaNr - 1]);//åºåå· |
| | | if (requestin.Type == 1) |
| | |
| | | if (Area_Occupied_by_AGV) throw new Exception("æ¡æ¶æªåé¦AGV离å¼ä¿¡å·"); |
| | | } |
| | | } |
| | | else if (MethodName == "AGVOutofArea") |
| | | else if (MethodName == "AGVOutofArea")//AGVä¸å¨åºåå
|
| | | { |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)requestin.AreaNr, numbers[requestin.AreaNr - 1]);//åºåå· |
| | | Gantry_client.WriteByOrder("W_AGV_OUT_OF_Area", requestin.OUTOFArea == 1 ? true : false, numbers[requestin.AreaNr - 1]);//AGVä¸å¨è¯¥åºå |
| | | } |
| | | else if (MethodName == "GantryOutofArea") |
| | | else if (MethodName == "GantryOutofArea")//æ¡æ¶ä¸å¨åºåå
|
| | | { |
| | | var Gantry_Out_of_Area = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Gantry_Out_of_Area").First(), Gantry_client);//æ¡æ¶ä¸å¨è¯¥åºå |
| | | if (!Gantry_Out_of_Area) throw new Exception("æ¡æ¶å¨åºåå
ï¼"); |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | using static System.Collections.Specialized.BitVector32; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | |
| | | Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context); |
| | | Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | /// <summary> |
| | | /// æ¥è¯¢è½¦è½®æ°æ® |
| | | /// </summary> |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | |
| | | #region æ¥è¯¢è½¦è½®æ°æ® |
| | | public void QueryWheeldata(PLCClient client) |
| | | { |
| | | try |
| | |
| | | { |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); |
| | | var on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on").First(), client); |
| | | if ((Int16)on == 1) |
| | | if ((byte)on == 1) |
| | | { |
| | | var wp_type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_type").First(), client); |
| | | var geometry = dataRepository.FindFirst(x => x.TypeId == (Int32)wp_type); |
| | | if (geometry == null) |
| | | { |
| | | //DBExtension.Write(details.Where(x => x.plcdetail_name == "W_i_status").First(), client, (Int16)2); |
| | | client.WriteByOrder("W_i_status", (Int16)2, name);//1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_skip_op", "1", name);//å±è½å·¥èº(å±è½è§è§æ£æµ/å±è½æ¶æ²¹); |
| | | //0-使ç¨ï¼1-è·³è¿ |
| | | client.WriteByOrder("R_oi_on", (Int16)0, name); |
| | | //1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | //å±è½å·¥èº(å±è½è§è§æ£æµ/å±è½æ¶æ²¹); |
| | | //client.WriteByOrder("W_i_skip_op", "1", name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | } |
| | | else |
| | | { |
| | | client.WriteByOrder("W_i_status", (Int16)1, name); |
| | | //1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_parameter_a", (float)geometry.a, name); |
| | | client.WriteByOrder("W_i_parameter_b", (float)geometry.b, name); |
| | | client.WriteByOrder("W_i_parameter_c", (float)geometry.c, name); |
| | |
| | | client.WriteByOrder("W_i_parameter_g", (float)geometry.g, name); |
| | | client.WriteByOrder("W_i_parameter_h", (float)geometry.h, name); |
| | | //å±è½å·¥èº(å±è½è§è§æ£æµ/å±è½æ¶æ²¹) |
| | | client.WriteByOrder("W_i_skip_op", "0", name);//å符串åå
¥-2 |
| | | client.WriteByOrder("R_oi_on", (Int16)0, name); |
| | | if (name != "è¾é䏿æ¥è¯¢è½¦è½®") |
| | | { |
| | | client.WriteByOrder("W_i_skip_op_SJ1", (byte)1, name);//å±è½è§è§æ£æµè®¾å¤1 |
| | | client.WriteByOrder("W_i_skip_op_SJ2", (byte)1, name);//å±è½è§è§æ£æµè®¾å¤2 |
| | | client.WriteByOrder("W_i_skip_op_LT", (byte)1, name);//å±è½é¾æ¡æº |
| | | } |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¥è¯¢è®¢å,æ¯å¦éè¦å å·¥ |
| | | /// </summary> |
| | | #endregion |
| | | |
| | | #region æ¥è¯¢è®¢å,æ¯å¦éè¦å å·¥ |
| | | public void QueryOrder(PLCClient client) |
| | | { |
| | | try |
| | |
| | | { |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); |
| | | var on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on").First(), client); |
| | | if ((Int16)on == 1) |
| | | if ((byte)on == 1) |
| | | { |
| | | var wp_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_id").First(), client); |
| | | //éæ·»å æ¥è¯¢è½¦è½®SNå·è®¢åé»è¾ |
| | | //éæ·»å æ¥è¯¢è½¦è½®SNå·è®¢åé»è¾ éæ·»å å
¥åºæ¨¡å¼å¤æï¼æå¨å
¥åºæ¨¡å¼é人工添å å
¥åºåºåºï¼å¦åæ¥è¦ |
| | | |
| | | |
| | | var wp_type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_type").First(), client); |
| | | var geometry = dataRepository.FindFirst(x => x.TypeId == (Int32)wp_type); |
| | | if (geometry == null) |
| | | { |
| | | client.WriteByOrder("W_i_status", (Int16)2, name);//1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类å |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (Int16)2, name); |
| | | client.WriteByOrder("R_oi_on", (Int16)0, name); |
| | | } |
| | | else |
| | | { |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (Int16)1, name); |
| | | //client.WriteByOrder("W_i_job_id", "", name); |
| | | //client.WriteByOrder("W_i_drawing_id", "", name); |
| | |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 䏿ä½äº¤äº |
| | | /// </summary> |
| | | #endregion |
| | | |
| | | #region 䏿ä½äº¤äº |
| | | public void Layofflevel(PLCClient client) |
| | | { |
| | | try |
| | | { |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | List<string> names = new List<string>() { "1åå
䏿åº", "2åå
䏿åº", "3åå
䏿åº", "䏿åº" }; |
| | | var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "龿¡æº"); |
| | | if (Pipeline_client == null) throw new Exception("龿¡æºè°åº¦æå¡æªå¼å¯ï¼"); |
| | | if (!Pipeline_client.IsConnected) throw new Exception("ä¸é¾æ¡æºè¿æ¥è¶
æ¶ï¼"); |
| | | var Pipelineplc = repository.FindFirst(x => x.plcinfo_name == Pipeline_client.PLCName); |
| | | List<string> names = new List<string>() { "1åå
䏿åº", "2åå
䏿åº", "3åå
䏿åº" }; |
| | | foreach (string name in names) |
| | | { |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); |
| | | |
| | | var Request = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Request_Load").First(), client); |
| | | if (!Request) continue; |
| | | var PartStatus = (Int32)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PartStatus").First(), client);//1:ok;2:nok |
| | | |
| | | List<string> StationCodes = new List<string>() { "X01001001", "X01001002", "X01001003" }; |
| | | if (name == "2åå
䏿åº") |
| | | StationCodes = new List<string>() { "X02001001", "X02001002", "X02001003" }; |
| | | if (name == "3åå
䏿åº") |
| | | StationCodes = new List<string>() { "X03001001", "X03001002" }; |
| | | var Wheel_Type = (Int32)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_Type").First(), client);//车轮类å |
| | | var Wheel_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_id").First(), client).ToString();//车轮SNå· |
| | | |
| | | |
| | | client.WriteByOrder("W_AreaNr", (Int16)1, name);//åºåè´§ä½å· |
| | | client.WriteByOrder("W_IndexNr", (Int16)1, name);//æçä¸ç第å 个车轮 |
| | | client.WriteByOrder("W_Storage_Type", true, name);//æçç±»å1-横æ¾;2-ç«æ¾ |
| | | client.WriteByOrder("W_Enabl_Load", true, name);//æ¯å¦å
许 |
| | | |
| | | for (int i = 0; i < StationCodes.Count - 1; i++) |
| | | { |
| | | var PartStatus = (Int32)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PartStatus").First(), client);//1:ok;2:nok |
| | | string NG = StationCodes[StationCodes.Count - 1];//NGè´§ä½ |
| | | var station = stationinfoRepository.FindFirst(x => x.stationCode == StationCodes[i] && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity < 5); |
| | | if (station == null) continue; |
| | | var Pipelinedetails = plcRepository.Find(x => x.plcdetail_iotype == Pipelineplc.plcinfo_iotyep && x.plcdetail_number == StationCodes[i]).ToList(); |
| | | var PalletSignal = (Int16)DBExtension.Read(Pipelinedetails.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读åæçä¿¡å·:1:æ,2æ |
| | | if (PalletSignal == 1) |
| | | { |
| | | if (PartStatus == 1 && NG != station.stationCode) |
| | | { |
| | | client.WriteByOrder("W_AreaNr", (Int16)i + 1, name);//åºåè´§ä½å· |
| | | client.WriteByOrder("W_IndexNr", (Int16)station.quantity + 1, name);//æçä¸ç第å 个车轮 |
| | | } |
| | | else if (PartStatus == 2 && NG == station.stationCode) |
| | | { |
| | | client.WriteByOrder("W_AreaNr", (Int16)i + 1, name);//åºåè´§ä½å· |
| | | client.WriteByOrder("W_IndexNr", (Int16)station.quantity + 1, name);//æçä¸ç第å 个车轮 |
| | | } |
| | | client.WriteByOrder("W_Storage_Type", (Int16)1, name);//æçç±»å1-横æ¾;2-ç«æ¾(ææ¶åªææ¨ªæ¾æç) |
| | | client.WriteByOrder("W_Enabl_Load", true, name);//æ¯å¦å
许 |
| | | } |
| | | } |
| | | var finished = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_load_finished").First(), client);//æ¾æå®æ |
| | | if (finished) |
| | | { |
| | | |
| | | var AreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_AreaNr").First(), client); |
| | | var station = stationinfoRepository.FindFirst(x => x.stationCode == StationCodes[AreaNr - 1]); |
| | | station.quantity = station.quantity++; |
| | | stationinfoRepository.Update(station); |
| | | client.WriteByOrder("W_Storage_update", true, name);//è´§ä½ç¶ææ´æ° |
| | | } |
| | | } |
| | |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// é²åæªæ½ |
| | | /// </summary> |
| | | static bool Gantry_Out_of_Area1;//æ¡æ¶æ¯å¦å¨åºåå
|
| | | static bool Gantry_Out_of_Area2;//æ¡æ¶æ¯å¦å¨åºåå
|
| | | static bool Gantry_Out_of_Area3;//æ¡æ¶æ¯å¦å¨åºåå
|
| | | static bool Gantry_Out_of_Area4;//æ¡æ¶æ¯å¦å¨åºåå
|
| | | public void Stupidproofmeasure(PLCClient client) |
| | | { |
| | | try |
| | | { |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | List<string> names = new List<string>() { "1åå
é²å", "2åå
é²å", "3åå
é²å", "䏿åºé²å" }; |
| | | foreach (string name in names) |
| | | { |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); |
| | | var Release_In = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Release_In").First(), client);//å
许è¿å
¥ |
| | | if (!Release_In) { } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹Idt_patternRepositoryç¼åæ¥å£ |
| | | */ |
| | | 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_WCS.IRepositories |
| | | { |
| | | public partial interface Idt_patternRepository : IDependency,IRepository<dt_pattern> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS.IServices |
| | | { |
| | | public partial interface Idt_patternService : IService<dt_pattern> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äºdt_patternç±»çä¸å¡ä»£ç æ¥å£åºå¨æ¤å¤ç¼å |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Core.Utilities; |
| | | using System.Linq.Expressions; |
| | | namespace WIDESEA_WCS.IServices |
| | | { |
| | | public partial interface Idt_patternService |
| | | { |
| | | public WebResponseContent UpdateAuto(string v); |
| | | public WebResponseContent UpdateManual(string v); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | jobHistory += $",ãæ§è¡å¤±è´¥:{ex.Message}ã"; |
| | | jobHistory += $",ãæ§è¡å¤±è´¥:{ex.Message}ã+"; |
| | | } |
| | | finally |
| | | { |
| | | taskSeconds = Math.Round(stopwatch.Elapsed.TotalSeconds,3); |
| | | taskSeconds = Math.Round(stopwatch.Elapsed.TotalSeconds, 3); |
| | | jobHistory += $"(èæ¶:{taskSeconds}ç§)"; |
| | | if (taskSeconds > 1 || jobHistory.Contains("æ§è¡å¤±è´¥")) |
| | | WriteLog.Info(jobid + "æ§è¡è®°å½").Write(jobHistory, jobid + "æ§è¡è®°å½"); |
| | |
| | | { |
| | | try |
| | | { |
| | | //ExecuteJob(context, DoAction); |
| | | ExecuteJob(context, DoAction); |
| | | } |
| | | catch { } |
| | | return Task.CompletedTask; |
| | |
| | | { |
| | | //throw new NotImplementedException(); |
| | | //Creation.HCJCreation(); |
| | | Creation.PLCinfodetail(); |
| | | //Creation.PLCinfodetail(); |
| | | |
| | | } |
| | | } |
| | |
| | | gantry.QueryWheeldata(client); |
| | | gantry.QueryOrder(client); |
| | | gantry.Layofflevel(client); |
| | | gantry.Stupidproofmeasure(client); |
| | | } |
| | | |
| | | #region |
| | | static List<MachineDB> MachineDBs = new List<MachineDB>(); |
| | | static List<WheelDataDB> wheelDataDBs = new List<WheelDataDB>(); |
| | | private void DoAction(PLCClient client) |
| | | { |
| | | try |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | | Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context); |
| | | Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); |
| | | |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | var numbers = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep).GroupBy(x => x.plcdetail_number).ToList(); |
| | | foreach (var number in numbers) |
| | | { |
| | | if (number.Key.Contains("è¾é䏿")) |
| | | { |
| | | PropertyInfo[] propertyInfos = typeof(WheelDataDB).GetProperties();//è·åææå±æ§ |
| | | WheelDataDB dBItem = wheelDataDBs.Where(x => x.R_Name == number.Key).FirstOrDefault(); |
| | | if (dBItem == null) |
| | | { |
| | | dBItem = new(); |
| | | dBItem.OnReadSignal += HandleReadSignal; |
| | | wheelDataDBs.Add(dBItem); |
| | | } |
| | | List<dt_plcinfodetail> details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == number.Key).ToList(); |
| | | for (int i = 0; i < propertyInfos.Length; i++) |
| | | { |
| | | if (i == 0) |
| | | { |
| | | dBItem.R_Name = number.Key; |
| | | } |
| | | else |
| | | { |
| | | object readData = DBExtension.Read(details.Where(x => x.plcdetail_name == propertyInfos[i].Name).FirstOrDefault(), client); |
| | | if (readData != null) { } |
| | | object obj = propertyInfos[i].GetValue(dBItem); |
| | | if (obj != readData) |
| | | propertyInfos[i].SetValue(dBItem, readData); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | PropertyInfo[] propertyInfos = typeof(MachineDB).GetProperties();//è·åææå±æ§ |
| | | MachineDB dBItem = MachineDBs.Where(x => x.R_Name == number.Key).FirstOrDefault(); |
| | | if (dBItem == null) |
| | | { |
| | | dBItem = new(); |
| | | dBItem.OnReadSignal += HandleReadSignal; |
| | | MachineDBs.Add(dBItem); |
| | | } |
| | | List<dt_plcinfodetail> details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == number.Key).ToList(); |
| | | for (int i = 0; i < propertyInfos.Length; i++) |
| | | { |
| | | if (i == 0) |
| | | { |
| | | dBItem.R_Name = number.Key; |
| | | } |
| | | else |
| | | { |
| | | object readData = DBExtension.Read(details.Where(x => x.plcdetail_name == propertyInfos[i].Name).FirstOrDefault(), client); |
| | | if (readData != null) { } |
| | | object obj = propertyInfos[i].GetValue(dBItem); |
| | | if (obj != readData) |
| | | propertyInfos[i].SetValue(dBItem, readData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | #endregion |
| | | public void HandleReadSignal(string type, MachineDB DBItem) |
| | | { |
| | | switch (type) |
| | | { |
| | | case OperationType.OperationType_Record: |
| | | |
| | | break; |
| | | case OperationType.OperationType_Processor: |
| | | |
| | | break; |
| | | case OperationType.OperationType_WheelData: |
| | | |
| | | break; |
| | | } |
| | | } |
| | | public void HandleReadSignal(string type, WheelDataDB DBItem) |
| | | { |
| | | switch (type) |
| | | { |
| | | case OperationType.OperationType_Record: |
| | | |
| | | break; |
| | | case OperationType.OperationType_Processor: |
| | | |
| | | break; |
| | | case OperationType.OperationType_WheelData: |
| | | |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Quartz; |
| | | using HslCommunication; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Xml.Linq; |
| | | using WIDESEA_Comm; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.Extensions; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Jobs; |
| | |
| | | /// <param name="client"></param> |
| | | private void Loadinglevel(PLCClient client, string number = "䏿åº") |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | | Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context); |
| | | Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | var Gantry_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "æ¡æ¶"); |
| | | if (!Gantry_client.IsConnected) return; |
| | | var Gantryplc = repository.FindFirst(x => x.plcinfo_name == Gantry_client.PLCName); |
| | | List<string> names = new List<string>() { "S01001001", "S01001002" }; |
| | | foreach (string name in names) |
| | | try |
| | | { |
| | | var station = stationinfoRepository.FindFirst(x => x.stationCode == name && x.enable && x.location_state == LocationStateEnum.Stroge.ToString()); |
| | | if (station == null) |
| | | { |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | continue; |
| | | } |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); |
| | | var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读åæçä¿¡å·:1:æ,2æ |
| | | var MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//读åè´§ç©ä¿¡å·:1:æ,2æ |
| | | if (PalletSignal == 1 && MaterialSignal == 1) |
| | | { |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)1, number);//åºåè´§ä½å· |
| | | Gantry_client.WriteByOrder("W_IndexNr", (Int16)1, number);//æçä¸ç第å 个车轮 |
| | | Gantry_client.WriteByOrder("W_Storage_Type", (Int16)1, number); //æçç±»å1-横æ¾;2-ç«æ¾ |
| | | Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)1, number);//车轮类å |
| | | Gantry_client.WriteByOrder("W_Wheel_id", "", number);//车轮SNå· |
| | | Gantry_client.WriteByOrder("W_RequestUnload", true, number); |
| | | } |
| | | else |
| | | { |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number); |
| | | } |
| | | var Gantrydetails = plcRepository.Find(x => x.plcdetail_iotype == Gantryplc.plcinfo_iotyep && x.plcdetail_number == number).ToList(); |
| | | var Gantry_Out_of_Area = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Gantry_Out_of_Area").First(), Gantry_client);//æ¡æ¶æ¯å¦å¨åºåå
|
| | | VOLContext Context = new VOLContext(); |
| | | Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context); |
| | | Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | var Gantry_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "æ¡æ¶"); |
| | | if (Gantry_client == null) throw new Exception("æ¡æ¶è°åº¦æå¡æªå¼å¯ï¼"); |
| | | if (!Gantry_client.IsConnected) throw new Exception("䏿¡æ¶è¿æ¥è¶
æ¶ï¼"); |
| | | var Gantryplc = repository.FindFirst(x => x.plcinfo_name == Gantry_client.PLCName); |
| | | |
| | | var QueryDate = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_QueryDate").First(), Gantry_client);//ä¿¡æ¯æ¥è¯¢ |
| | | if (QueryDate) |
| | | |
| | | ///æ¥æ¾ä¸æåºçè´§ä½ |
| | | var Stations = stationinfoRepository.Find(x => x.area == "6"); |
| | | //ç¼åæ¶æªå¯ç¨ç¦æ¢æ¡æ¶è¿å
¥ |
| | | foreach (var station in Stations) |
| | | { |
| | | var Date_Vaild = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Date_Vaild").First(), Gantry_client);//ä¿¡æ¯ç¡®è®¤ |
| | | if (!Date_Vaild)//ä¿¡æ¯æè¯¯ï¼è®°å½æ¥å¿ |
| | | if (!station.enable) |
| | | 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).First(); |
| | | if (Station != null) |
| | | { |
| | | var SNS = Station.bindSN.Split(","); |
| | | //ç¼åæ¶ä¸è½¦è½®æ°éä¸SNå·æ°éä¸ä¸è´ |
| | | if (SNS.Length != Station.quantity) |
| | | { |
| | | Station.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | stationinfoRepository.Update(Station, true); |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | throw new Exception("䏿ä½è½¦è½®æ°éä¸SNå·æ°éä¸ä¸è´ï¼ä¸æä½ç¼å·ï¼" + Station.stationCode); |
| | | } |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == Station.stationCode).ToList(); |
| | | var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读åæçä¿¡å·:1:æ,2æ |
| | | var MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//读åè´§ç©ä¿¡å·:1:æ,2æ |
| | | if (PalletSignal == 1 && MaterialSignal == 1) |
| | | { |
| | | var area = Convert.ToInt16(Station.stationCode.Substring(Station.stationCode.Length - 1, 1)); |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)area, number);//åºåè´§ä½å· |
| | | Gantry_client.WriteByOrder("W_IndexNr", (Int16)SNS.Length, number);//æçä¸ç第å 个车轮 |
| | | Gantry_client.WriteByOrder("W_Storage_Type", (Int16)1, number); //æçç±»å1-横æ¾;2-ç«æ¾ |
| | | Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)Convert.ToInt16(Station.stationType), number);//车轮类å |
| | | Gantry_client.WriteByOrder("W_Wheel_id", SNS[SNS.Length - 1], number);//车轮SNå· |
| | | Gantry_client.WriteByOrder("W_RequestUnload", true, number); |
| | | } |
| | | else |
| | | { |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number); |
| | | } |
| | | |
| | | var Gantrydetails = plcRepository.Find(x => x.plcdetail_iotype == Gantryplc.plcinfo_iotyep && x.plcdetail_number == number).ToList(); |
| | | var Gantry_Out_of_Area = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Gantry_Out_of_Area").First(), Gantry_client);//æ¡æ¶æ¯å¦å¨åºåå
|
| | | |
| | | var QueryDate = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_QueryDate").First(), Gantry_client);//ä¿¡æ¯æ¥è¯¢ |
| | | if (QueryDate) |
| | | { |
| | | var Date_Vaild = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Date_Vaild").First(), Gantry_client);//ä¿¡æ¯ç¡®è®¤ |
| | | if (!Date_Vaild)//ä¿¡æ¯æè¯¯ï¼è®°å½æ¥å¿ |
| | | { |
| | | Station.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | stationinfoRepository.Update(Station, true); |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | throw new Exception($"æªæ¥è¯¢å°SNå·ï¼{SNS[SNS.Length - 1]}ç订åï¼ä¸æä½ç¼å·ï¼{Station.stationCode}"); |
| | | } |
| | | } |
| | | var finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client);//夹å宿 |
| | | if (finished) |
| | | { |
| | | Station.quantity = Station.quantity - 1; |
| | | Station.bindSN = OperStr(SNS); |
| | | var count = stationinfoRepository.Update(Station, true); |
| | | if (count < 1) |
| | | throw new Exception($"䏿ä½ä¿¡æ¯æ´æ°å¤±è´¥ï¼ä¸æä½ç¼å·ï¼{Station.stationCode}"); |
| | | Gantry_client.WriteByOrder("W_Storage_update", true, number);//è´§ä½ç¶ææ´æ° |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | } |
| | | } |
| | | var finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client);//夹å宿 |
| | | if (finished) |
| | | { |
| | | |
| | | Gantry_client.WriteByOrder("W_Storage_update", true, number);//è´§ä½ç¶ææ´æ° |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //WritePCSLog.LogAdd(requestin.AreaNr.ToString(), respone.success == 1 ? "æå " : "失败", "WMS", "AGV", json, JsonConvert.SerializeObject(respone), remark, "æ£æµçº¿ä¸æåº", ex.Message); |
| | | } |
| | | } |
| | | |
| | | private string OperStr(string[] strArrty) |
| | | { |
| | | string[] newstr = strArrty.RemoveLast(1); |
| | | string Newsn = string.Join(",", newstr); |
| | | |
| | | return Newsn; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_patternRepositoryç¼å代ç |
| | | */ |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.Extensions.AutofacManager; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS.Repositories |
| | | { |
| | | public partial class dt_patternRepository : RepositoryBase<dt_pattern> , Idt_patternRepository |
| | | { |
| | | public dt_patternRepository(VOLContext dbContext) |
| | | : base(dbContext) |
| | | { |
| | | |
| | | } |
| | | public static Idt_patternRepository Instance |
| | | { |
| | | get { return AutofacContainerModule.GetService<Idt_patternRepository>(); } } |
| | | } |
| | | } |
| | |
| | | PLCClient client = null; |
| | | if (plc.plcinfo_type == "Simene") |
| | | { |
| | | client = new SiemensPLCClient() |
| | | client = new SiemensPLCClient(plc.plcinfo_model) |
| | | { |
| | | PLCName = plc.plcinfo_name, |
| | | Ip = plc.plcinfo_ip, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äºdt_patternç±»çä¸å¡ä»£ç åºå¨æ¤å¤ç¼å |
| | | *å¯ä½¿ç¨repository.è°ç¨å¸¸ç¨æ¹æ³ï¼è·åEF/Dapperçä¿¡æ¯ |
| | | *妿éè¦äºå¡è¯·ä½¿ç¨repository.DbContextBeginTransaction |
| | | *ä¹å¯ä½¿ç¨DBServerProvider.æå¨è·åæ°æ®åºç¸å
³ä¿¡æ¯ |
| | | *ç¨æ·ä¿¡æ¯ãæéãè§è²ç使ç¨UserContext.Currentæä½ |
| | | *dt_patternService对å¢ãå ãæ¹æ¥ã导å
¥ã导åºãå®¡æ ¸ä¸å¡ä»£ç æ©å±åç
§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_WCS.IRepositories; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace WIDESEA_WCS.Services |
| | | { |
| | | public partial class dt_patternService |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly Idt_patternRepository _repository;//è®¿é®æ°æ®åº |
| | | |
| | | [ActivatorUtilitiesConstructor] |
| | | public dt_patternService( |
| | | Idt_patternRepository dbRepository, |
| | | IHttpContextAccessor httpContextAccessor |
| | | ) |
| | | : base(dbRepository) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _repository = dbRepository; |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | public WebResponseContent UpdateAuto(string v) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | var model = JsonConvert.DeserializeObject<dt_pattern>(v); |
| | | model.pattern_state = 1; |
| | | var cont = _repository.Update(model, true); |
| | | if (cont > 0) |
| | | content.OK(model.pattern_name + "设置为èªå¨å
¥åºæåï¼"); |
| | | else |
| | | content.Error(model.pattern_name + "设置为èªå¨å
¥åºå¤±è´¥ï¼"); |
| | | return content; |
| | | } |
| | | public WebResponseContent UpdateManual(string v) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | var model = JsonConvert.DeserializeObject<dt_pattern>(v); |
| | | model.pattern_state = 0; |
| | | var cont = _repository.Update(model, true); |
| | | if (cont > 0) |
| | | content.OK(model.pattern_name + "设置为æå¨å
¥åºæåï¼"); |
| | | else |
| | | content.Error(model.pattern_name + "设置为æå¨å
¥åºå¤±è´¥ï¼"); |
| | | return content; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,æ¤å¤ä»»ä½æ´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ææä¸å¡ç¼åå
¨é¨åºå¨Partialæä»¶å¤¹ä¸dt_patternServiceä¸Idt_patternServiceä¸ç¼å |
| | | */ |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.IServices; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.Extensions.AutofacManager; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS.Services |
| | | { |
| | | public partial class dt_patternService : ServiceBase<dt_pattern, Idt_patternRepository> |
| | | , Idt_patternService, IDependency |
| | | { |
| | | public dt_patternService(Idt_patternRepository repository) |
| | | : base(repository) |
| | | { |
| | | Init(repository); |
| | | } |
| | | public static Idt_patternService Instance |
| | | { |
| | | get { return AutofacContainerModule.GetService<Idt_patternService>(); } } |
| | | } |
| | | } |
| | |
| | | { |
| | | public partial class ToAGVServer |
| | | { |
| | | FreeDB freeDB = new FreeDB(); |
| | | static AGVRespone respone = new AGVRespone(); |
| | | static AGVRequestin requestin = new AGVRequestin(); |
| | | /// <summary> |
| | |
| | | private readonly object _lockWrite = new object(); |
| | | public SiemensS7Net siemensPLCClient { get; set; } |
| | | |
| | | public SiemensPLCClient() |
| | | public SiemensPLCClient(string model) |
| | | { |
| | | siemensPLCClient = new SiemensS7Net(SiemensPLCS.S1200); |
| | | if (model == "S300") |
| | | siemensPLCClient = new SiemensS7Net(SiemensPLCS.S300); |
| | | else |
| | | siemensPLCClient = new SiemensS7Net(SiemensPLCS.S1500); |
| | | base.siemensPLCClient = this.siemensPLCClient; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *æ¥å£ç¼åå¤... |
| | | *妿æ¥å£éè¦åActionçæééªè¯ï¼è¯·å¨Actionä¸ä½¿ç¨å±æ§ |
| | | *å¦: [ApiActionPermission("dt_pattern",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_WCS.IServices; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.Utilities; |
| | | |
| | | namespace WIDESEA_WCS.Controllers |
| | | { |
| | | public partial class dt_patternController |
| | | { |
| | | private readonly Idt_patternService _service;//访é®ä¸å¡ä»£ç |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | [ActivatorUtilitiesConstructor] |
| | | public dt_patternController( |
| | | Idt_patternService service, |
| | | IHttpContextAccessor httpContextAccessor |
| | | ) |
| | | : base(service) |
| | | { |
| | | _service = service; |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | /// <summary> |
| | | /// å
¥åºæ¨¡å¼è®¾ä¸ºèªå¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("UpdateAuto"), AllowAnonymous] |
| | | public WebResponseContent UpdateAuto([FromBody] object saveModel) |
| | | { |
| | | return _service.UpdateAuto(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | /// <summary> |
| | | /// å
¥åºæ¨¡å¼è®¾ä¸ºæå¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("UpdateManual"), AllowAnonymous] |
| | | public WebResponseContent UpdateManual([FromBody] object saveModel) |
| | | { |
| | | return _service.UpdateManual(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *妿è¦å¢å æ¹æ³è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_patternControllerç¼å |
| | | */ |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Controllers.Basic; |
| | | using WIDESEA_Entity.AttributeManager; |
| | | using WIDESEA_WCS.IServices; |
| | | namespace WIDESEA_WCS.Controllers |
| | | { |
| | | [Route("api/dt_pattern")] |
| | | [PermissionTable(Name = "dt_pattern")] |
| | | public partial class dt_patternController : ApiBaseController<Idt_patternService> |
| | | { |
| | | public dt_patternController(Idt_patternService service) |
| | | : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | {field:'agv_tasknum',title:'ä»»å¡ç¼å·',type:'string',sort:true,width:110,require:true,align:'left',sort:true}, |
| | | {field:'agv_fromaddress',title:'èµ·ç¹å°å',type:'string',width:110,align:'left'}, |
| | | {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_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:'agv_worktype',title:'AGVå·¥ä½ç±»å',type:'int',width:110,align:'left'}, |
| | | // {field:'agv_worktype',title:'AGVå·¥ä½ç±»å',type:'int',width:110,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'}, |
| | | // {field:'agv_finishedtime',title:'宿æ¶é´',type:'datetime',width:150,align:'left',sort:true}, |
| | | {field:'agv_tasktype',title:'ä»»å¡ç±»å',type:'string',bind:{ key:'agv_tasktypes',data:[]},width:110,require:true,align:'left'}, |
| | | {field:'agv_grade',title:'ä»»å¡ç级',type:'int',bind:{ key:'task_grade',data:[]},sort:true,width:110,align:'left'}, |
| | | // {field:'agv_barcode',title:'æçç ',type:'string',width:110,require:true,align:'left'}, |
| | | // {field:'agv_materbarcode',title:'ç©æç ',type:'string',width:110,align:'left'}, |
| | | {field:'agv_createtime',title:'å建æ¶é´',type:'datetime',sort:true,width:150,require:true,align:'left',sort:true}, |
| | | {field:'agv_realesstime',title:'æ§è¡æ¶é´',type:'datetime',width:150,align:'left',sort:true}, |
| | | {field:'agv_finishedtime',title:'宿æ¶é´',type:'datetime',width:150,align:'left',sort:true}, |
| | | {field:'agv_tasktype',title:'ä»»å¡ç±»å',type:'string',bind:{ key:'agv_tasktypes',data:[]},width:110,require:true,align:'left'}, |
| | | {field:'agv_remark',title:'夿³¨',type:'string',width:120,align:'left'}, |
| | | {field:'agv_grade',title:'ä»»å¡ç级',type:'int',bind:{ key:'task_grade',data:[]},sort:true,width:110,align:'left'}, |
| | | {field:'agv_userid',title:'å建è
',type:'string',width:110,align:'left'}, |
| | | {field:'agv_barcode',title:'æçç ',type:'string',width:110,require:true,align:'left'}, |
| | | {field:'agv_materbarcode',title:'ç©æç ',type:'string',width:110,align:'left'}, |
| | | {field:'agv_executingBeginTime',title:'èµ·å§ç¹æ§è¡ä¸',type:'datetime',width:150,align:'left',sort:true}, |
| | | {field:'agv_executingEndTime',title:'èµ·å§ç¹å®æ',type:'datetime',width:150,align:'left',sort:true}, |
| | | {field:'agv_completeBeginTime',title:'ç®çç¹æ§è¡ä¸',type:'datetime',width:150,align:'left',sort:true}, |
| | | {field:'unitag',title:'unitag',type:'guid',width:110,align:'left'}, |
| | | {field:'ID',title:'主é®',type:'int',width:80,hidden:true,readonly:true,require:true,align:'left'}]); |
| | | {field:'agv_userid',title:'å建è
',type:'string',width:110,align:'left'}, |
| | | {field:'agv_remark',title:'夿³¨',type:'string',width:120,align:'left'}, |
| | | // {field:'unitag',title:'unitag',type:'guid',width:110,align:'left'} |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | |
| | | |
| | | namespace WIDESEA_Entity.DomainModels |
| | | { |
| | | [Entity(TableCnName = "åºä½ä¿¡æ¯",TableName = "dt_stationinfo")] |
| | | public partial class dt_stationinfo:BaseEntity |
| | | [Entity(TableCnName = "åºä½ä¿¡æ¯", TableName = "dt_stationinfo")] |
| | | public partial class dt_stationinfo : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="id")] |
| | | [Column(TypeName="uniqueidentifier")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public Guid id { get; set; } |
| | | /// |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name = "id")] |
| | | [Column(TypeName = "uniqueidentifier")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public Guid id { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç¼åæ¶ç¼å· |
| | | /// </summary> |
| | | [Display(Name ="ç¼åæ¶ç¼å·")] |
| | | [MaxLength(30)] |
| | | [Column(TypeName="nvarchar(30)")] |
| | | [Editable(true)] |
| | | public string stationCode { get; set; } |
| | | /// <summary> |
| | | ///ç¼åæ¶ç¼å· |
| | | /// </summary> |
| | | [Display(Name = "ç¼åæ¶ç¼å·")] |
| | | [MaxLength(30)] |
| | | [Column(TypeName = "nvarchar(30)")] |
| | | [Editable(true)] |
| | | public string stationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ç©æç±»å |
| | | /// </summary> |
| | | [Display(Name ="ç©æç±»å")] |
| | | [MaxLength(25)] |
| | | [Column(TypeName="nvarchar(25)")] |
| | | [Editable(true)] |
| | | public string stationType { get; set; } |
| | | /// <summary> |
| | | ///ç©æç±»å |
| | | /// </summary> |
| | | [Display(Name = "ç©æç±»å")] |
| | | [MaxLength(25)] |
| | | [Column(TypeName = "nvarchar(25)")] |
| | | [Editable(true)] |
| | | public string stationType { get; set; } |
| | | |
| | | /// <summary> |
| | | ///åºå |
| | | /// </summary> |
| | | [Display(Name ="åºå")] |
| | | [MaxLength(15)] |
| | | [Column(TypeName="nvarchar(15)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public string area { get; set; } |
| | | /// <summary> |
| | | ///åºå |
| | | /// </summary> |
| | | [Display(Name = "åºå")] |
| | | [MaxLength(15)] |
| | | [Column(TypeName = "nvarchar(15)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string area { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ¯å¦å¯ç¨ |
| | | /// </summary> |
| | | [Display(Name ="æ¯å¦å¯ç¨")] |
| | | [Column(TypeName="bit")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public bool enable { get; set; } |
| | | /// <summary> |
| | | ///æ¯å¦å¯ç¨ |
| | | /// </summary> |
| | | [Display(Name = "æ¯å¦å¯ç¨")] |
| | | [Column(TypeName = "bit")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public bool enable { get; set; } |
| | | |
| | | /// <summary> |
| | | ///è´§ä½ç¶æ |
| | | /// </summary> |
| | | [Display(Name ="è´§ä½ç¶æ")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName="varchar(255)")] |
| | | [Editable(true)] |
| | | public string location_state { get; set; } |
| | | /// <summary> |
| | | ///è´§ä½ç¶æ |
| | | /// </summary> |
| | | [Display(Name = "è´§ä½ç¶æ")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName = "varchar(255)")] |
| | | [Editable(true)] |
| | | public string location_state { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æåç¶ææ¹åæ¶é´ |
| | | /// </summary> |
| | | [Display(Name ="æåç¶ææ¹åæ¶é´")] |
| | | [Column(TypeName="datetime")] |
| | | [Editable(true)] |
| | | public DateTime? lastUpdateTime { get; set; } |
| | | /// <summary> |
| | | ///æåç¶ææ¹åæ¶é´ |
| | | /// </summary> |
| | | [Display(Name = "æåç¶ææ¹åæ¶é´")] |
| | | [Column(TypeName = "datetime")] |
| | | [Editable(true)] |
| | | public DateTime? lastUpdateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | ///车轮æ°é |
| | | /// </summary> |
| | | [Display(Name ="车轮æ°é")] |
| | | [Column(TypeName="int")] |
| | | public int? quantity { get; set; } |
| | | /// <summary> |
| | | ///车轮æ°é |
| | | /// </summary> |
| | | [Display(Name = "车轮æ°é")] |
| | | [Column(TypeName = "int")] |
| | | public int? quantity { get; set; } |
| | | |
| | | /// <summary> |
| | | ///车轮SNå· |
| | | /// </summary> |
| | | [Display(Name ="车轮SNå·")] |
| | | [MaxLength(500)] |
| | | [Column(TypeName="nvarchar(500)")] |
| | | public string bindSN { get; set; } |
| | | /// <summary> |
| | | ///车轮SNå· |
| | | /// </summary> |
| | | [Display(Name = "车轮SNå·")] |
| | | [MaxLength(500)] |
| | | [Column(TypeName = "nvarchar(500)")] |
| | | public string bindSN { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æçç¶æ |
| | | /// </summary> |
| | | [Display(Name ="æçç¶æ")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName="nvarchar(100)")] |
| | | public string tray_status { get; set; } |
| | | /// <summary> |
| | | ///æçç¶æ |
| | | /// </summary> |
| | | [Display(Name = "æçç¶æ")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName = "nvarchar(100)")] |
| | | public string tray_status { get; set; } |
| | | |
| | | /// <summary> |
| | | ///è¡ |
| | | /// </summary> |
| | | [Display(Name ="è¡")] |
| | | [Column(TypeName="int")] |
| | | public int? line { get; set; } |
| | | /// <summary> |
| | | ///è¡ |
| | | /// </summary> |
| | | [Display(Name = "è¡")] |
| | | [Column(TypeName = "int")] |
| | | public int? line { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å |
| | | /// </summary> |
| | | [Display(Name ="å")] |
| | | [Column(TypeName="int")] |
| | | public int? column { get; set; } |
| | | /// <summary> |
| | | ///å |
| | | /// </summary> |
| | | [Display(Name = "å")] |
| | | [Column(TypeName = "int")] |
| | | public int? column { get; set; } |
| | | |
| | | /// <summary> |
| | | ///夿³¨ |
| | | /// </summary> |
| | | [Display(Name ="夿³¨")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName="nvarchar(100)")] |
| | | [Editable(true)] |
| | | public string remark { get; set; } |
| | | /// <summary> |
| | | ///夿³¨ |
| | | /// </summary> |
| | | [Display(Name = "夿³¨")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName = "nvarchar(100)")] |
| | | [Editable(true)] |
| | | public string remark { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ä¸»é® |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name ="主é®")] |
| | | [Column(TypeName="int")] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public int zj { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å·¥åç¼å· |
| | | /// </summary> |
| | | [Display(Name ="å·¥åç¼å·")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName="nvarchar(255)")] |
| | | public string Number { get; set; } |
| | | /// <summary> |
| | | ///å·¥åç¼å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [MaxLength(255)] |
| | | [Column(TypeName = "nvarchar(255)")] |
| | | public string Number { get; set; } |
| | | |
| | | /// <summary> |
| | | ///çå· |
| | | /// </summary> |
| | | [Display(Name ="çå·")] |
| | | [Column(TypeName="int")] |
| | | public int? heatNumber { get; set; } |
| | | /// <summary> |
| | | ///çå· |
| | | /// </summary> |
| | | [Display(Name = "çå·")] |
| | | [Column(TypeName = "int")] |
| | | public int? heatNumber { get; set; } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | agvtask.agv_taskstate = AGVTaskStateEnum.Create.ToString(); |
| | | agvtask.agv_tasktype = tasktype; |
| | | agvtask.agv_worktype = 1;//å·¥ä½ç±»å |
| | | agvtask.bindSN = station1.bindSN; |
| | | agvtask.agv_materielid = station1.stationType;//ç©æç±»å |
| | | agvtask.agv_qty = station1.quantity; |
| | | agvtask.agv_createtime = DateTime.Now; |
| | |
| | | respone.Message = tasteInfo.TASK_NO + "ï¼éå¤è°ç¨ï¼ä»»å¡ç¶æä¸ºï¼" + tasteInfo.TASK_State; |
| | | return respone; |
| | | } |
| | | #region 夿任å¡ç¶æ |
| | | //List<string> list = new List<string>() { AGVTaskStateEnum.Executing.ToString(), AGVTaskStateEnum.Complete.ToString(), AGVTaskStateEnum.Executing1.ToString(), AGVTaskStateEnum.Complete1.ToString() }; |
| | | //var index = list.IndexOf(task.agv_taskstate) + 1; |
| | | //if (tasteInfo.TASK_State < index) |
| | | // throw new Exception("ä»»å¡ç¶ææ´æ°å¼å¸¸ï¼å½åä»»å¡ç¶æä¸ºï¼" + index + ";è¯·æ±æ´æ°ç¶æä¸ºï¼" + tasteInfo.TASK_State); |
| | | #endregion |
| | | if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Executing) |
| | | task.agv_executingBeginTime = DateTime.Now; |
| | | else if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Complete) |