已添加39个文件
已修改13个文件
已删除2个文件
已重命名2个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | /***************************************************************************************** |
| | | ** 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: '/dt_log_pcs', |
| | | name: 'dt_log_pcs', |
| | | component: () => import('@/views/widesea_system/system/dt_log_pcs.vue') |
| | | } ,{ |
| | | path: '/dt_geometry_data', |
| | | name: 'dt_geometry_data', |
| | | component: () => import('@/views/widesea_wcs/baseinfo/dt_geometry_data.vue') |
| | | }] |
| | | |
| | | export default viewgird |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wcs/baseinfo/dt_geometry_data.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/baseinfo/dt_geometry_data.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'TypeId', |
| | | footer: "Foots", |
| | | cnName: '车轮信æ¯', |
| | | name: 'baseinfo/dt_geometry_data', |
| | | url: "/dt_geometry_data/", |
| | | sortName: "TypeId" |
| | | }); |
| | | const editFormFields = ref({"Description":"","a":"","b":"","c":"","d":"","e":"","f":"","g":"","h":""}); |
| | | const editFormOptions = ref([[{"title":"å¾å·","required":true,"field":"Description","type":"text"}], |
| | | [{"title":"","required":true,"field":"a","type":"text"}, |
| | | {"title":"","required":true,"field":"b","type":"text"}], |
| | | [{"title":"","required":true,"field":"c","type":"text"}, |
| | | {"title":"","required":true,"field":"d","type":"text"}], |
| | | [{"title":"","required":true,"field":"e","type":"text"}, |
| | | {"title":"","required":true,"field":"f","type":"text"}], |
| | | [{"title":"","required":true,"field":"g","type":"text"}, |
| | | {"title":"","required":true,"field":"h","type":"decimal"}]]); |
| | | const searchFormFields = ref({"Description":""}); |
| | | const searchFormOptions = ref([[{"title":"å¾å·","field":"Description","type":"like"}]]); |
| | | const columns = ref([{field:'TypeId',title:'TypeId',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'}, |
| | | {field:'Description',title:'å¾å·',type:'string',width:120,require:true,align:'left',sort:true}, |
| | | {field:'a',title:'a',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'b',title:'b',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'c',title:'c',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'d',title:'d',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'e',title:'e',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'f',title:'f',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'g',title:'g',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'h',title:'h',type:'float',width:110,require:true,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; |
| | | using WIDESEA_Comm.ItemDB; |
| | | |
| | | namespace WIDESEA_Comm.DBItem |
| | | { |
| | | public partial class MachineDB |
| | | { |
| | | public event Action<string, MachineDB> OnReadSignal; |
| | | |
| | | public string R_Name { get; set; } |
| | | /// <summary> |
| | | /// SN |
| | | /// </summary> |
| | | public string R_o_wp_id { get; set; } |
| | | /// <summary> |
| | | /// å¼å§æ¶é´ |
| | | /// </summary> |
| | | public DateTime R_o_mach_start_time { get; set; } |
| | | /// <summary> |
| | | /// 宿æ¶é´ |
| | | /// </summary> |
| | | public DateTime R_o_mach_finish_time { get; set; } |
| | | /// <summary> |
| | | /// æä½äºº |
| | | /// </summary> |
| | | public string R_o_operator { get; set; } |
| | | /// <summary> |
| | | /// å»å |
| | | /// </summary> |
| | | public string R_o_shift { get; set; } |
| | | /// <summary> |
| | | /// è´¨æ£ç¶æ 0:æªå®ä¹,1:OK,2:NG |
| | | /// </summary> |
| | | public short R_o_wp_status { get; set; } |
| | | /// <summary> |
| | | /// ç»æ |
| | | /// </summary> |
| | | public short R_o_result { get; set; } |
| | | /// <summary> |
| | | /// é误代ç |
| | | /// </summary> |
| | | public short R_o_error_code { get; set; } |
| | | |
| | | public short R_o_substation { get; set; } |
| | | |
| | | public string R_o_value_result_real_1 { get; set; } |
| | | public string R_o_value_result_real_2 { get; set; } |
| | | public string R_o_value_result_real_3 { get; set; } |
| | | public string R_o_value_result_real_4 { get; set; } |
| | | public bool R_o_value_result_bool { get; set; } |
| | | public short oi_on { get; set; } |
| | | public short R_oi_on |
| | | { |
| | | get |
| | | { |
| | | return oi_on; |
| | | } |
| | | set |
| | | { |
| | | if (value == 1 && R_Name.Contains("è§è§æ£æµ")) |
| | | ReadSignal(OperationType.OperationType_Record, this); |
| | | else if (value == 1 && R_Name.Contains("龿¡æº")) |
| | | ReadSignal(OperationType.OperationType_Processor, this); |
| | | oi_on = value; |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | public void ReadSignal(string type, MachineDB reader) |
| | | { |
| | | Task.Run(() => |
| | | { |
| | | OnReadSignal?.Invoke(type, reader); |
| | | }); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Comm.DBItem |
| | | { |
| | | public class OperationType |
| | | { |
| | | /// <summary> |
| | | /// åªè®°å½æ°æ® |
| | | /// </summary> |
| | | public const string OperationType_Record = "Record"; |
| | | /// <summary> |
| | | /// å¤çæ°æ® |
| | | /// </summary> |
| | | public const string OperationType_Processor = "Processor"; |
| | | /// <summary> |
| | | /// è½¦è½®æ°æ® |
| | | /// </summary> |
| | | public const string OperationType_WheelData = "WheelData"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Comm.DBItem |
| | | { |
| | | public partial class WheelDataDB |
| | | { |
| | | public event Action<string, WheelDataDB> OnReadSignal; |
| | | public string R_Name { get; set; } |
| | | public int R_o_wp_type { get; set; } |
| | | /// <summary> |
| | | /// 1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | /// </summary> |
| | | public short R_i_status { get; set; } |
| | | public int R_i_parameter_a { get; set; } |
| | | public int R_i_parameter_b { get; set; } |
| | | public int R_i_parameter_c { get; set; } |
| | | public int R_i_parameter_d { get; set; } |
| | | public int R_i_parameter_e { get; set; } |
| | | public int R_i_parameter_f { get; set; } |
| | | public int R_i_parameter_g { get; set; } |
| | | public int R_i_parameter_h { get; set; } |
| | | public string R_i_skip_op { get; set; } |
| | | |
| | | public short R_oi_on { get; set; } |
| | | public void ReadSignal(string type, WheelDataDB reader) |
| | | { |
| | | Task.Run(() => |
| | | { |
| | | OnReadSignal?.Invoke(type, reader); |
| | | }); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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_geometry_data")] |
| | | public partial class dt_geometry_data:BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name ="TypeId")] |
| | | [Column(TypeName="int")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public int TypeId { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å¾å· |
| | | /// </summary> |
| | | [Display(Name ="å¾å·")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName="nvarchar(100)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public string Description { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="a")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float a { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="b")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float b { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="c")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float c { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="d")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float d { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="e")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float e { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="f")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float f { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="g")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float g { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name ="h")] |
| | | [Column(TypeName="float")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings=false)] |
| | | public float h { 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_geometry_data |
| | | { |
| | | //æ¤å¤é
ç½®åæ®µ(åæ®µé
ç½®è§æ¤modelçå¦ä¸ä¸ªpartial),å¦æè¡¨ä¸æ²¡ææ¤å段请å ä¸ [NotMapped]屿§ï¼å¦åä¼å¼å¸¸ |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using WIDESEA_Entity.MappingConfiguration; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | |
| | | namespace WIDESEA_Entity.MappingConfiguration |
| | | { |
| | | public class dt_geometry_dataMapConfig : EntityMappingConfiguration<dt_geometry_data> |
| | | { |
| | | public override void Map(EntityTypeBuilder<dt_geometry_data> |
| | | builderTable) |
| | | { |
| | | //b.Property(x => x.StorageName).HasMaxLength(45); |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public class Request |
| | | { |
| | | /// <summary> |
| | | /// postè¯·æ± |
| | | /// </summary> |
| | | /// <param name="postData">åæ°</param> |
| | | /// <param name="address">è·¯å¾</param> |
| | | /// <returns></returns> |
| | | public static string RequestData(string postData, string url = "") |
| | | { |
| | | string reponse = string.Empty; |
| | | try |
| | | { |
| | | //string tmp = ""; |
| | | //if (null != postData) |
| | | // tmp = JsonConvert.SerializeObject(postData); |
| | | byte[] param = Encoding.UTF8.GetBytes(postData); |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json"; |
| | | request.GetRequestStream().Write(param, 0, param.Length); |
| | | using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) |
| | | { |
| | | Stream stream = response.GetResponseStream(); |
| | | StreamReader streamReader = new StreamReader(stream); |
| | | string webResponse = streamReader.ReadToEnd(); |
| | | reponse = webResponse; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | reponse = ex.Message; |
| | | } |
| | | return reponse; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹Idt_geometry_dataRepositoryç¼åæ¥å£ |
| | | */ |
| | | 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_geometry_dataRepository : IDependency,IRepository<dt_geometry_data> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS.IServices |
| | | { |
| | | public partial interface Idt_geometry_dataService : IService<dt_geometry_data> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äºdt_geometry_dataç±»çä¸å¡ä»£ç æ¥å£åºå¨æ¤å¤ç¼å |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Core.Utilities; |
| | | using System.Linq.Expressions; |
| | | namespace WIDESEA_WCS.IServices |
| | | { |
| | | public partial interface Idt_geometry_dataService |
| | | { |
| | | } |
| | | } |
| | |
| | | [DisallowConcurrentExecution] |
| | | public class AutoTaskJob : JobBase, IJob |
| | | { |
| | | LocationCreation Creation = new LocationCreation(); |
| | | /// <summary> |
| | | /// èªå¨ä»»å¡ |
| | | /// </summary> |
| | | Createplcinfodetail Creation = new Createplcinfodetail(); |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | try |
| | |
| | | private void DoAction(IJobExecutionContext context) |
| | | { |
| | | //throw new NotImplementedException(); |
| | | Creation.HCJCreation(); |
| | | //Creation.HCJCreation(); |
| | | //Creation.PLCinfodetail(); |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm.DBItem; |
| | | using WIDESEA_Comm.ItemDB; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | /// <summary> |
| | | /// æ¡æ¶ |
| | | /// </summary> |
| | | [DisallowConcurrentExecution] |
| | | public class GantryJob : IJob |
| | | { |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | try |
| | | { |
| | | var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient; |
| | | if (client == null) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | //èªå¨éè¿ |
| | | if (!client.IsConnected) |
| | | { |
| | | client.Connect(); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | //DoAction(client); |
| | | //ExecuteJob(context, DoAction); |
| | | } |
| | | catch { } |
| | | return Task.CompletedTask; |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | 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 System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_WCS.WCSClient; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | /// <summary> |
| | | /// 龿¡æº |
| | | /// </summary> |
| | | [DisallowConcurrentExecution] |
| | | public class PipelineJob : IJob |
| | | { |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | try |
| | | { |
| | | var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient; |
| | | if (client == null) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | //èªå¨éè¿ |
| | | if (!client.IsConnected) |
| | | { |
| | | client.Connect(); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | DoAction(client); |
| | | } |
| | | catch { } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | private void DoAction(PLCClient client) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS.JobsPart.Common |
| | | { |
| | | public class Createplcinfodetail |
| | | { |
| | | FreeDB FreeDB = new FreeDB(); |
| | | public void PLCinfodetail() |
| | | { |
| | | try |
| | | { |
| | | //for (int i = 1; i <= 3; i++) |
| | | //{ |
| | | int i = 7; |
| | | string name = "3åå
龿¡æº"; |
| | | dt_plcinfodetail plcinfodetail = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 0.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "int16", |
| | | plcdetail_name = "R_oi_on", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "PLC->1, PMS->0 after setting i_ variables" |
| | | }; |
| | | FreeDB.Add(plcinfodetail); |
| | | dt_plcinfodetail plcinfodetail1 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 2.0 + (i - 1) * 330 + "", |
| | | plcdetail_len = 20, |
| | | plcdetail_valtype = "string", |
| | | plcdetail_name = "R_o_wp_id", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "车轮SN" |
| | | }; |
| | | FreeDB.Add(plcinfodetail1); |
| | | dt_plcinfodetail plcinfodetail2 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 22.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "datetime", |
| | | plcdetail_name = "R_o_mach_start_time", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "å¼å§æ¶é´" |
| | | }; |
| | | FreeDB.Add(plcinfodetail2); |
| | | dt_plcinfodetail plcinfodetail3 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 38.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "datetime", |
| | | plcdetail_name = "R_o_mach_finish_time", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "宿æ¶é´" |
| | | }; |
| | | FreeDB.Add(plcinfodetail3); |
| | | dt_plcinfodetail plcinfodetail4 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 54.0 + (i - 1) * 330 + "", |
| | | plcdetail_len = 20, |
| | | plcdetail_valtype = "string", |
| | | plcdetail_name = "R_o_operator", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "æä½äºº" |
| | | }; |
| | | FreeDB.Add(plcinfodetail4); |
| | | dt_plcinfodetail plcinfodetail5 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 74.0 + (i - 1) * 330 + "", |
| | | plcdetail_len = 20, |
| | | plcdetail_valtype = "string", |
| | | plcdetail_name = "R_o_shift", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "å»å" |
| | | }; |
| | | FreeDB.Add(plcinfodetail5); |
| | | dt_plcinfodetail plcinfodetail6 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 94.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "int16", |
| | | plcdetail_name = "R_o_wp_status", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "è´¨æ£ç¶æ 0:æªå®ä¹,1:OK,2:NG" |
| | | }; |
| | | FreeDB.Add(plcinfodetail6); |
| | | dt_plcinfodetail plcinfodetail7 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 96.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "int16", |
| | | plcdetail_name = "R_o_result", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "ç»æ" |
| | | }; |
| | | FreeDB.Add(plcinfodetail7); |
| | | dt_plcinfodetail plcinfodetail8 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 98.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "int16", |
| | | plcdetail_name = "R_o_error_code", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "é误代ç " |
| | | }; |
| | | FreeDB.Add(plcinfodetail8); |
| | | dt_plcinfodetail plcinfodetail9 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 100.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "int16", |
| | | plcdetail_name = "R_o_substation", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = " " |
| | | }; |
| | | FreeDB.Add(plcinfodetail9); |
| | | dt_plcinfodetail plcinfodetail10 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 102.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "string", |
| | | plcdetail_len = 55, |
| | | plcdetail_name = "R_o_value_result_real_1", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "ç»æ1" |
| | | }; |
| | | FreeDB.Add(plcinfodetail10); |
| | | dt_plcinfodetail plcinfodetail11 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 157.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "string", |
| | | plcdetail_len = 55, |
| | | plcdetail_name = "R_o_value_result_real_2", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "ç»æ2" |
| | | }; |
| | | FreeDB.Add(plcinfodetail11); |
| | | dt_plcinfodetail plcinfodetail12 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 212.0 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "string", |
| | | plcdetail_len = 55, |
| | | plcdetail_name = "R_o_value_result_real_3", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "ç»æ3" |
| | | }; |
| | | FreeDB.Add(plcinfodetail12); |
| | | dt_plcinfodetail plcinfodetail13 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 267 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "string", |
| | | plcdetail_len = 55, |
| | | plcdetail_name = "R_o_value_result_real_4", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = "ç»æ4" |
| | | }; |
| | | FreeDB.Add(plcinfodetail13); |
| | | dt_plcinfodetail plcinfodetail14 = new dt_plcinfodetail() |
| | | { |
| | | plcdetail_id = Guid.NewGuid(), |
| | | plcdetail_iotype = "Truss", |
| | | plcdetail_db = "DB611", |
| | | plcdetail_value = 322.1 + (i - 1) * 330 + "", |
| | | plcdetail_valtype = "boolean", |
| | | plcdetail_name = "R_o_value_result_bool", |
| | | plcdetail_number = name, |
| | | plcdetail_remark = " " |
| | | }; |
| | | FreeDB.Add(plcinfodetail14); |
| | | //dt_plcinfodetail plcinfodetail15 = new dt_plcinfodetail() |
| | | //{ |
| | | // plcdetail_id = Guid.NewGuid(), |
| | | // plcdetail_iotype = "Truss", |
| | | // plcdetail_db = "DB611", |
| | | // plcdetail_value = 4.0 + (i - 1) * 330 + "", |
| | | // plcdetail_valtype = "string", |
| | | // plcdetail_len = 18, |
| | | // plcdetail_name = "fault_channel", |
| | | // plcdetail_number = name, |
| | | // plcdetail_remark = "éè¯¯æ¶æ¯é¢é" |
| | | //}; |
| | | //FreeDB.Add(plcinfodetail15); |
| | | //dt_plcinfodetail plcinfodetail16 = new dt_plcinfodetail() |
| | | //{ |
| | | // plcdetail_id = Guid.NewGuid(), |
| | | // plcdetail_iotype = "Truss", |
| | | // plcdetail_db = "DB611", |
| | | // plcdetail_value = 22.0 + (i - 1) * 330 + "", |
| | | // plcdetail_valtype = "string", |
| | | // plcdetail_len = 14, |
| | | // plcdetail_name = "fault_axes_drives", |
| | | // plcdetail_number = name, |
| | | // plcdetail_remark = "éè¯¯æ¶æ¯axes(è½´)驱å¨å¨" |
| | | //}; |
| | | //FreeDB.Add(plcinfodetail16); |
| | | //dt_plcinfodetail plcinfodetail17 = new dt_plcinfodetail() |
| | | //{ |
| | | // plcdetail_id = Guid.NewGuid(), |
| | | // plcdetail_iotype = "Truss", |
| | | // plcdetail_db = "DB611", |
| | | // plcdetail_value = 36.0 + (i - 1) * 330 + "", |
| | | // plcdetail_valtype = "string", |
| | | // plcdetail_len = 16, |
| | | // plcdetail_name = "fault_user_0_to1", |
| | | // plcdetail_number = name, |
| | | // plcdetail_remark = "éè¯¯æ¶æ¯ç¨æ·åºå0...1" |
| | | //}; |
| | | //FreeDB.Add(plcinfodetail17); |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public class LocationCreation |
| | | { |
| | | FreeDB freeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// è´§ä½çæ |
| | | /// </summary> |
| | | public void HCJCreation() |
| | | { |
| | | try |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_geometry_dataRepositoryç¼å代ç |
| | | */ |
| | | 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_geometry_dataRepository : RepositoryBase<dt_geometry_data> , Idt_geometry_dataRepository |
| | | { |
| | | public dt_geometry_dataRepository(VOLContext dbContext) |
| | | : base(dbContext) |
| | | { |
| | | |
| | | } |
| | | public static Idt_geometry_dataRepository Instance |
| | | { |
| | | get { return AutofacContainerModule.GetService<Idt_geometry_dataRepository>(); } } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äºdt_geometry_dataç±»çä¸å¡ä»£ç åºå¨æ¤å¤ç¼å |
| | | *å¯ä½¿ç¨repository.è°ç¨å¸¸ç¨æ¹æ³ï¼è·åEF/Dapperçä¿¡æ¯ |
| | | *妿éè¦äºå¡è¯·ä½¿ç¨repository.DbContextBeginTransaction |
| | | *ä¹å¯ä½¿ç¨DBServerProvider.æå¨è·åæ°æ®åºç¸å
³ä¿¡æ¯ |
| | | *ç¨æ·ä¿¡æ¯ãæéãè§è²ç使ç¨UserContext.Currentæä½ |
| | | *dt_geometry_dataService对å¢ãå ãæ¹æ¥ã导å
¥ã导åºãå®¡æ ¸ä¸å¡ä»£ç æ©å±åç
§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; |
| | | |
| | | namespace WIDESEA_WCS.Services |
| | | { |
| | | public partial class dt_geometry_dataService |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly Idt_geometry_dataRepository _repository;//è®¿é®æ°æ®åº |
| | | |
| | | [ActivatorUtilitiesConstructor] |
| | | public dt_geometry_dataService( |
| | | Idt_geometry_dataRepository dbRepository, |
| | | IHttpContextAccessor httpContextAccessor |
| | | ) |
| | | : base(dbRepository) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _repository = dbRepository; |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,æ¤å¤ä»»ä½æ´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ææä¸å¡ç¼åå
¨é¨åºå¨Partialæä»¶å¤¹ä¸dt_geometry_dataServiceä¸Idt_geometry_dataServiceä¸ç¼å |
| | | */ |
| | | 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_geometry_dataService : ServiceBase<dt_geometry_data, Idt_geometry_dataRepository> |
| | | , Idt_geometry_dataService, IDependency |
| | | { |
| | | public dt_geometry_dataService(Idt_geometry_dataRepository repository) |
| | | : base(repository) |
| | | { |
| | | Init(repository); |
| | | } |
| | | public static Idt_geometry_dataService Instance |
| | | { |
| | | get { return AutofacContainerModule.GetService<Idt_geometry_dataService>(); } } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public partial class ToMesServer |
| | | { |
| | | /// <summary> |
| | | /// æ·»å å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="requestTemp"></param> |
| | | /// <returns></returns> |
| | | public static WebResponseContent AddWorkinfo(dt_Workinfo requestTemp) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æ·»å å·¥å详æ
|
| | | /// </summary> |
| | | /// <param name="requestTemp"></param> |
| | | /// <returns></returns> |
| | | public static WebResponseContent AddActualProduction(dt_ActualProduction requestTemp) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | return content; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public partial class ToWmsServer |
| | | { |
| | | /// <summary> |
| | | /// åWMSç³è¯·æ·»å AGVä»»å¡ |
| | | /// </summary> |
| | | /// <param name="requestTemp"></param> |
| | | /// <returns></returns> |
| | | public static WebResponseContent AddTask(string requestTemp) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | return content; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WCS; |
| | | |
| | | namespace WIDESEA_WebApi.Controllers.ToMes |
| | | { |
| | | [Route("api/ToMes")] |
| | | [ApiController] |
| | | public class ToMESController : ControllerBase |
| | | { |
| | | /// <summary> |
| | | /// æ·»å å·¥åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AddWorkinfo")] |
| | | public WebResponseContent AddWorkinfo([FromBody] dt_Workinfo request) |
| | | { |
| | | return ToMesServer.AddWorkinfo(request); |
| | | } |
| | | /// <summary> |
| | | /// æ·»å å·¥å详æ
|
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AddActualProduction")] |
| | | public WebResponseContent AddActualProduction([FromBody] dt_ActualProduction request) |
| | | { |
| | | return ToMesServer.AddActualProduction(request); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WebApi.Controllers.ToWMS |
| | | { |
| | | [Route("api/ToWMS")] |
| | | [ApiController] |
| | | public class ToWMSController : ControllerBase |
| | | { |
| | | /// <summary> |
| | | /// æ·»å AGVä»»å¡ |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AddWorkinfo")] |
| | | public WebResponseContent AddTask([FromBody] dt_Workinfo request) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *æ¥å£ç¼åå¤... |
| | | *妿æ¥å£éè¦åActionçæééªè¯ï¼è¯·å¨Actionä¸ä½¿ç¨å±æ§ |
| | | *å¦: [ApiActionPermission("dt_geometry_data",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; |
| | | |
| | | namespace WIDESEA_WCS.Controllers |
| | | { |
| | | public partial class dt_geometry_dataController |
| | | { |
| | | private readonly Idt_geometry_dataService _service;//访é®ä¸å¡ä»£ç |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | [ActivatorUtilitiesConstructor] |
| | | public dt_geometry_dataController( |
| | | Idt_geometry_dataService service, |
| | | IHttpContextAccessor httpContextAccessor |
| | | ) |
| | | : base(service) |
| | | { |
| | | _service = service; |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *妿è¦å¢å æ¹æ³è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_geometry_dataControllerç¼å |
| | | */ |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Controllers.Basic; |
| | | using WIDESEA_Entity.AttributeManager; |
| | | using WIDESEA_WCS.IServices; |
| | | namespace WIDESEA_WCS.Controllers |
| | | { |
| | | [Route("api/dt_geometry_data")] |
| | | [PermissionTable(Name = "dt_geometry_data")] |
| | | public partial class dt_geometry_dataController : ApiBaseController<Idt_geometry_dataService> |
| | | { |
| | | public dt_geometry_dataController(Idt_geometry_dataService service) |
| | | : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | // this.boxOptions.labelWidth = 150; |
| | | this.buttons.splice(1, 0, { |
| | | name: "åæ¶ç¦ç¨", |
| | | icon: 'md-refresh', |
| | | type: 'primary', |
| | | onClick: function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©è¦åæ¶ç¦ç¨çæ°æ®"); |
| | | |
| | | this.$confirm('确认è¦åæ¶ç¦ç¨å?', 'è¦å', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | center: true |
| | | }).then(() => { |
| | | let data = []; |
| | | let parm = { |
| | | "data": data, |
| | | "type": "1" |
| | | } |
| | | rows.forEach(t => data.push(t.id)) |
| | | this.http.post("/api/dt_stationinfo/SetStationEnable", parm, "åæ¶ç¦ç¨ä¸...").then(x => { |
| | | if (x.status) { |
| | | this.$Message.success("åæ¶ç¦ç¨æå!"); |
| | | this.refresh(); |
| | | } else { |
| | | this.$Message.error(x.message); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | this.buttons.splice(1, 0, { |
| | | name: "ç¦ç¨", |
| | | icon: 'md-refresh', |
| | | type: 'danger', |
| | | onClick: function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©è¦ç¦ç¨çæ°æ®"); |
| | | |
| | | this.$confirm('确认è¦ç¦ç¨å?', 'è¦å', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | center: true |
| | | }).then(() => { |
| | | let data = []; |
| | | let parm = { |
| | | "data": data, |
| | | "type": "0" |
| | | } |
| | | rows.forEach(t => data.push(t.id)) |
| | | this.http.post("/api/dt_stationinfo/SetStationEnable", parm, "éå®ä¸...").then(x => { |
| | | if (x.status) { |
| | | this.$Message.success("ç¦ç¨æåï¼"); |
| | | this.refresh(); |
| | | } else { |
| | | this.$Message.error(x.message); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | this.buttons.splice(1, 0, { |
| | | name: "ç§»åº", |
| | | icon: 'el-icon-document', |
| | | type: 'danger', |
| | |
| | | /// <summary> |
| | | /// éæ»¡ææ¶ |
| | | /// </summary> |
| | | SendFull = 1, |
| | | //SendFull = 1, |
| | | /// <summary> |
| | | /// åç©ºææ¶ |
| | | /// </summary> |
| | | TakeEmpty = 2, |
| | | //TakeEmpty = 2, |
| | | /// <summary> |
| | | /// ç»çå
¥åº |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("ç»çå
¥åº")] |
| | | TaskType_Inbound = 3, |
| | | [Description("å
¥åº")] |
| | | TaskType_Inbound = 1, |
| | | /// <summary> |
| | | /// æ¬è¿ |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("æ¬è¿")] |
| | | TaskType_Outbound = 4, |
| | | [Description("åºåº")] |
| | | TaskType_Outbound = 2, |
| | | /// <summary> |
| | | /// è°æ¨å
¥åº |
| | | /// å¤åå
¥åº |
| | | /// </summary> |
| | | [Description("è°æ¨å
¥åº")] |
| | | TaskType_AllotInbound = 5, |
| | | [Description("å¤åå
¥åº")] |
| | | TaskType_OutsourceInbound = 3, |
| | | /// <summary> |
| | | /// è°æ¨åºåº |
| | | /// å¤ååºåº |
| | | /// </summary> |
| | | [Description("è°æ¨åºåº")] |
| | | TaskType_AllotOutbound = 6, |
| | | [Description("å¤ååºåº")] |
| | | TaskType_OutsourceOutbound = 4, |
| | | } |
| | | } |
| | |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int? Priority { get; set; } |
| | | public int? agv_qty { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS |
| | | { |
| | | public class QueryData |
| | | { |
| | | static FreeDB freeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// æ¥è¯¢ç©æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public static dt_materielinfo QueryMateriel(string type) |
| | | { |
| | | var materielinfo = freeDB.Select<dt_materielinfo>().Where(x => x.materiel_id == type).First(); |
| | | return materielinfo; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_WMS |
| | | { |
| | | public class Request |
| | | { |
| | | /// <summary> |
| | | /// postè¯·æ± |
| | | /// </summary> |
| | | /// <param name="postData">åæ°</param> |
| | | /// <param name="address">è·¯å¾</param> |
| | | /// <returns></returns> |
| | | public static string RequestData(string postData, string url = "") |
| | | { |
| | | string reponse = string.Empty; |
| | | try |
| | | { |
| | | //string tmp = ""; |
| | | //if (null != postData) |
| | | // tmp = JsonConvert.SerializeObject(postData); |
| | | byte[] param = Encoding.UTF8.GetBytes(postData); |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json"; |
| | | request.GetRequestStream().Write(param, 0, param.Length); |
| | | using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) |
| | | { |
| | | Stream stream = response.GetResponseStream(); |
| | | StreamReader streamReader = new StreamReader(stream); |
| | | string webResponse = streamReader.ReadToEnd(); |
| | | reponse = webResponse; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | reponse = ex.Message; |
| | | } |
| | | return reponse; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | |
| | | { |
| | | public class Task |
| | | { |
| | | static FreeDB freeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// æ·»å åå²ä»»å¡ |
| | | /// </summary> |
| | |
| | | htyRepository.Add(agvtask_Hty, true); |
| | | repository.Delete(task, true); |
| | | } |
| | | /// <summary> |
| | | /// åºåå¤ç |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | public static void Updateinventory(dt_agvtask task) |
| | | { |
| | | string[] bindSNs = task.bindSN.Split(","); |
| | | if (bindSNs.Length > 0) |
| | | { |
| | | var Materiel = QueryData.QueryMateriel(task.agv_materielid); |
| | | List<dt_inventory> inventorys = new List<dt_inventory>(); |
| | | foreach (string bindSN in bindSNs) |
| | | { |
| | | dt_inventory inventory = new dt_inventory() |
| | | { |
| | | SN = bindSN,//å¾
å®å |
| | | }; |
| | | inventorys.Add(inventory); |
| | | } |
| | | if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString() || task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceInbound.ToString()) |
| | | freeDB.AddRange(inventorys); |
| | | else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() || task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceOutbound.ToString()) |
| | | freeDB.Remove(inventorys); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// èªå¨æ´æ°ç¼åæ¶ç¶æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | public static void AutoUpdateHCJState(dt_agvtask task) |
| | | { |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | var station1 = stationinfoRepository.FindFirst(t => t.stationCode == task.agv_fromaddress); |
| | | var station2 = stationinfoRepository.FindFirst(t => t.stationCode == task.agv_toaddress); |
| | | |
| | | station2.quantity = station1.quantity; |
| | | station2.bindSN = station1.bindSN; |
| | | station2.location_state = LocationStateEnum.Stroge.ToString(); |
| | | station2.tray_status = station1.tray_status; |
| | | stationinfoRepository.Update(station2, true); |
| | | |
| | | station1.quantity = 0; |
| | | station1.bindSN = string.Empty; |
| | | station1.location_state = LocationStateEnum.Empty.ToString(); |
| | | station1.tray_status = string.Empty; |
| | | stationinfoRepository.Update(station1, true); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (task.agv_taskstate == StateName) |
| | | { |
| | | respone.success = 2; |
| | | respone.Message = tasteInfo.TASK_NO + "ï¼éå¤è°ç¨ï¼ä»»å¡ç¶æä¸ºï¼" + tasteInfo.TASK_State; |
| | | return respone; |
| | | throw new Exception(tasteInfo.TASK_NO + "ï¼éå¤è°ç¨ï¼ä»»å¡ç¶æä¸ºï¼" + tasteInfo.TASK_State); |
| | | } |
| | | if (tasteInfo.TASK_State == 1) |
| | | if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Executing) |
| | | task.agv_executingBeginTime = DateTime.Now; |
| | | if (tasteInfo.TASK_State == 2) |
| | | else if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Complete) |
| | | task.agv_executingEndTime = DateTime.Now; |
| | | if (tasteInfo.TASK_State == 3) |
| | | else if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Executing1) |
| | | task.agv_completeBeginTime = DateTime.Now; |
| | | task.agv_taskstate = StateName; |
| | | var count = repository.Update(task, true); |
| | | if (count < 1) |
| | | throw new Exception("ä»»å¡ç¶ææ´æ°å¤±è´¥ï¼ä»»å¡IDï¼" + tasteInfo.TASK_NO + "ï¼ä»»å¡ç¶æï¼" + tasteInfo.TASK_State); |
| | | if (tasteInfo.TASK_State == 4) |
| | | if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Complete1) |
| | | { |
| | | Task.AddHtyTask(task); |
| | | |
| | | |
| | | Task.Updateinventory(task); |
| | | Task.AutoUpdateHCJState(task); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | respone.success = 3; |
| | | respone.Message = ex.Message; |
| | | } |
| | | WriteWMSLog.LogAdd(tasteInfo.TASK_NO, respone.success == 1 ? "æå " : "失败", "WMS", "AGV", json, JsonConvert.SerializeObject(respone), "AGVåé¦ä»»å¡ç¶æ", "UpdateTaskState", respone.Message); |
| | | finally |
| | | { |
| | | WriteWMSLog.LogAdd(tasteInfo.TASK_NO, respone.success == 1 ? "æå " : "失败", "WMS", "AGV", json, JsonConvert.SerializeObject(respone), "AGVåé¦ä»»å¡ç¶æ", "UpdateTaskState", respone.Message); |
| | | } |
| | | return respone; |
| | | } |
| | | |
| | |
| | | RequestTask requestTask = new RequestTask(); |
| | | string postJson = string.Empty; |
| | | string report = string.Empty; |
| | | string url = "http://127.0.0.1/api/TaskCreat/CreatTask"; |
| | | try |
| | | { |
| | | requestTask.TASK_NO = agvtask.agv_tasknum; |
| | |
| | | requestTask.TO_POSITION = agvtask.agv_toaddress; |
| | | requestTask.Material = agvtask.agv_materielid; |
| | | requestTask.Priority = agvtask.agv_grade; |
| | | requestTask.agv_qty = agvtask.agv_qty; |
| | | postJson = JsonConvert.SerializeObject(requestTask); |
| | | report = RequestData(postJson); |
| | | report = Request.RequestData(postJson, url); |
| | | respone = JsonConvert.DeserializeObject<AGVRespone>(report); |
| | | if (respone.success != 1) |
| | | throw new Exception(respone.Message); |
| | |
| | | respone.Message = ex.Message; |
| | | } |
| | | WriteWMSLog.LogAdd(requestTask.TASK_NO, respone.success == 1 ? "æå " : "失败", "AGV", "WMS", postJson, report, "ä¸åAGVä»»å¡", "SendAGVTask", respone.Message); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// postè¯·æ± |
| | | /// </summary> |
| | | /// <param name="postData">åæ°</param> |
| | | /// <param name="address">è·¯å¾</param> |
| | | /// <returns></returns> |
| | | public static string RequestData(string postData, string address = "") |
| | | { |
| | | string reponse = string.Empty; |
| | | try |
| | | { |
| | | //string tmp = ""; |
| | | //if (null != postData) |
| | | // tmp = JsonConvert.SerializeObject(postData); |
| | | byte[] param = Encoding.UTF8.GetBytes(postData); |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address); |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json"; |
| | | request.GetRequestStream().Write(param, 0, param.Length); |
| | | using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) |
| | | { |
| | | Stream stream = response.GetResponseStream(); |
| | | StreamReader streamReader = new StreamReader(stream); |
| | | string webResponse = streamReader.ReadToEnd(); |
| | | reponse = webResponse; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | reponse = ex.Message; |
| | | } |
| | | return reponse; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | station2.quantity = station1.quantity; |
| | | station2.bindSN = station1.bindSN; |
| | | station2.location_state = station1.location_state; |
| | | station2.location_state = LocationStateEnum.Stroge.ToString(); |
| | | station2.tray_status = station1.tray_status; |
| | | freeDB.Update(station2); |
| | | |
| | |
| | | throw new Exception("èµ·å§æç®çå°åï¼å·²åå¨ä»»å¡ï¼"); |
| | | } |
| | | content.OK(); |
| | | WriteDBLog.Success($"æå¨ç§»åº", new { æ°æ® = requestTemp }, "WMS", UserContext.Current.UserTrueName); |
| | | WriteDBLog.Success($"æå¨ç§»åº", new { æ°æ® = requestTemp }, "WMS", UserContext.Current.UserName + UserContext.Current.UserTrueName); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteDBLog.Error($"æå¨ç§»åº", new { æ°æ® = requestTemp, å¼å¸¸ä¿¡æ¯ = ex.Message }, "WMS", UserContext.Current.UserTrueName); |
| | | WriteDBLog.Error($"æå¨ç§»åº", new { æ°æ® = requestTemp, å¼å¸¸ä¿¡æ¯ = ex.Message }, "WMS", UserContext.Current.UserName + UserContext.Current.UserTrueName); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.DomainModels.Mes; |
| | | |
| | | namespace WIDESEA_WMS |
| | | { |
| | | public partial class ToMesServer |
| | | { |
| | | /// <summary> |
| | | /// æ´æ°è´§ä½ç¶æ |
| | | /// </summary> |
| | | /// <param name="requestTemp"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpdateStation(dt_agvtask requestTemp) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | return content; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net.Http.Json; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.ToPCS |
| | | { |
| | | public partial class ToPCSServer |
| | | { |
| | | public WebResponseContent AddTask(string json) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | TaskData taskData = new TaskData(); |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(json) || json == "null") |
| | | throw new Exception("æªè·åå°è¯·æ±åæ°æ°æ®"); |
| | | taskData = JsonConvert.DeserializeObject<TaskData>(json); |
| | | var haveInTask = freeDB.Select<dt_agvtask>() |
| | | .Where(t => t.agv_fromaddress == taskData.fromaddress |
| | | || t.agv_fromaddress == taskData.toaddress |
| | | || t.agv_toaddress == taskData.fromaddress |
| | | || t.agv_toaddress == taskData.toaddress |
| | | ).Any(); |
| | | if (haveInTask) |
| | | throw new Exception("å½åèµ·ç¹æç»ç¹å·²åå¨ä»»å¡ï¼"); |
| | | |
| | | dt_agvtask taskinfo = new dt_agvtask() |
| | | { |
| | | |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Message = ex.Message; |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_WMS.ToPCS |
| | | { |
| | | public class TaskData |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNum { get; set; } |
| | | /// <summary> |
| | | /// èµ·ç¹å°å |
| | | /// </summary> |
| | | public string fromaddress { get; set; } |
| | | /// <summary> |
| | | /// ç»ç¹å°å |
| | | /// </summary> |
| | | public string toaddress { get; set; } |
| | | /// <summary> |
| | | /// ç©æç±»å |
| | | /// </summary> |
| | | public string materielid { get; set; } |
| | | /// <summary> |
| | | /// 车轮SNå· |
| | | /// </summary> |
| | | public string WheelSN { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.ToPCS |
| | | { |
| | | public partial class ToPCSServer |
| | | { |
| | | FreeDB freeDB = new FreeDB(); |
| | | public ToPCSServer() |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Pomelo.AspNetCore.TimedJob; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_WebApi.Controllers |
| | | { |
| | | public class JobTask : Job |
| | | { |
| | | [Invoke(Begin = "2024-01-19 00:00", Interval = 1000*5, /*IsEnabled = true,*/ SkipWhileExecuting = true)] |
| | | public void TaskTime() |
| | | { |
| | | //Console.WriteLine(DateTime.Now.ToString()); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels.Mes; |
| | | using WIDESEA_WMS; |
| | | using WIDESEA_WMS.ToPCS; |
| | | |
| | | namespace WIDESEA_WebApi.Controllers.ToPCS |
| | | { |
| | | [Route("api/ToPCS")] |
| | | [ApiController] |
| | | public class ToPCSController : ControllerBase |
| | | { |
| | | ToPCSServer Server=new ToPCSServer(); |
| | | /// <summary> |
| | | /// æ·»å AGVä»»å¡ |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AddTask"), Authorize, AllowAnonymous] |
| | | public WebResponseContent AddTask([FromBody] object saveModel) |
| | | { |
| | | return Server.AddTask(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WebApi/Controllers/ToMes/ToWMSController.cs ÐÞ¸Ä |
| | |
| | | using WIDESEA_Entity.DomainModels.Mes; |
| | | using WIDESEA_WMS; |
| | | |
| | | namespace WIDESEA_WCSServer.Controllers.ToMes |
| | | namespace WIDESEA_WCSServer.Controllers.ToWms |
| | | { |
| | | [Route("api/ToMes")] |
| | | [Route("api/ToWms")] |
| | | [ApiController] |
| | | public class ToWMSController : ControllerBase |
| | | { |
| | | /// <summary> |
| | | /// 3楼设å¤å«æï¼æå¨ï¼ä¸´æ¶ï¼ |
| | | /// ç§»åºï¼æå¨ï¼ä¸´æ¶ï¼ |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <returns></returns> |
| | |
| | | { |
| | | options.MaxRequestBodySize = 1024 * 1024 * 100;//100M |
| | | }); |
| | | services.AddTimedJob();//æ·»å 宿¶å¨ |
| | | } |
| | | |
| | | public void ConfigureContainer(ContainerBuilder builder) |
| | |
| | | { |
| | | endpoints.MapControllers(); |
| | | }); |
| | | app.UseTimedJob();//æ·»å 宿¶å¨ |
| | | } |
| | | } |
| | | |
| | |
| | | <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" /> |
| | | <PackageReference Include="Quartz" Version="3.6.3" /> |
| | | <PackageReference Include="Swashbuckle.AspNetCore" Version="6.0.0" /> |
| | | <PackageReference Include="TimedJob" Version="2.0.0" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | Navicat Premium Data Transfer |
| | | |
| | | Source Server : DESKTOP-SCT31AM |
| | | Source Server Type : SQL Server |
| | | Source Server Version : 13001601 |
| | | Source Catalog : WIDESEA_DB |
| | | Source Schema : dbo |
| | | |
| | | Target Server Type : SQL Server |
| | | Target Server Version : 13001601 |
| | | File Encoding : 65001 |
| | | |
| | | Date: 25/01/2024 11:03:06 |
| | | */ |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- Table structure for dt_geometry_data |
| | | -- ---------------------------- |
| | | IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[dt_geometry_data]') AND type IN ('U')) |
| | | DROP TABLE [dbo].[dt_geometry_data] |
| | | GO |
| | | |
| | | CREATE TABLE [dbo].[dt_geometry_data] ( |
| | | [TypeId] int IDENTITY(1,1) NOT NULL, |
| | | [Description] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
| | | [a] float(53) NOT NULL, |
| | | [b] float(53) NOT NULL, |
| | | [c] float(53) NOT NULL, |
| | | [d] float(53) NOT NULL, |
| | | [e] float(53) NOT NULL, |
| | | [f] float(53) NOT NULL, |
| | | [g] float(53) NOT NULL, |
| | | [h] float(53) NOT NULL |
| | | ) |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[dt_geometry_data] SET (LOCK_ESCALATION = TABLE) |
| | | GO |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- Records of dt_geometry_data |
| | | -- ---------------------------- |
| | | SET IDENTITY_INSERT [dbo].[dt_geometry_data] ON |
| | | GO |
| | | |
| | | INSERT INTO [dbo].[dt_geometry_data] ([TypeId], [Description], [a], [b], [c], [d], [e], [f], [g], [h]) VALUES (N'1', N'TSW-003D (915KKD)', N'69', N'12', N'126', N'-28', N'972', N'185', N'27', N'70') |
| | | GO |
| | | |
| | | INSERT INTO [dbo].[dt_geometry_data] ([TypeId], [Description], [a], [b], [c], [d], [e], [f], [g], [h]) VALUES (N'2', N'TSW-051 (840HESA)', N'70', N'12', N'128', N'-30', N'900', N'197', N'27', N'70') |
| | | GO |
| | | |
| | | INSERT INTO [dbo].[dt_geometry_data] ([TypeId], [Description], [a], [b], [c], [d], [e], [f], [g], [h]) VALUES (N'3', N'TSW-005 (840HDSA)', N'70', N'12', N'128', N'-30', N'898', N'185', N'27', N'70') |
| | | GO |
| | | |
| | | SET IDENTITY_INSERT [dbo].[dt_geometry_data] OFF |
| | | GO |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- Auto increment value for dt_geometry_data |
| | | -- ---------------------------- |
| | | DBCC CHECKIDENT ('[dbo].[dt_geometry_data]', RESEED, 3) |
| | | GO |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- Primary Key structure for table dt_geometry_data |
| | | -- ---------------------------- |
| | | ALTER TABLE [dbo].[dt_geometry_data] ADD CONSTRAINT [PK__dt_geome__516F03B53F710A80] PRIMARY KEY CLUSTERED ([TypeId]) |
| | | WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) |
| | | ON [PRIMARY] |
| | | GO |
| | | |
| | |
| | | åºåº1ï¼32个åºä½,16å;æå¤16个åç§ï¼50件以ä¸ï¼å°ä¼è½¦è½® |
| | | åºåº2ï¼1æ36个åºä½,4æå
±144(144*5ä»¶),æå¤4åç§;é对é常è§è½¦è½®(50-180ä»¶):ä¸ååå·åçå· |
| | | åºåº1ï¼32个åºä½,16å;æå¤16个åç§ï¼50件以ä¸ï¼å°ä¼è½¦è½® ååå·åçå·ä¸å |
| | | åºåº2ï¼1æ36个åºä½,4æå
±144(144*5ä»¶),æå¤4åç§;é对é常è§è½¦è½®(50-180ä»¶):ååå·åçå· |
| | | åºåº3ï¼1æ45个åºä½,5æå
±225ï¼225*5ï¼æå¤5个åç§ï¼é对常è§(840ã915):ååå·(å¾å·å¯ä¸,æ ¹æ®å¾å·åºååå·)/ä¸åçå· ï¼ï¼ï¼äº§å代ç å¹²ä»ä¹ç¨ |
| | | åºåº4ï¼1æ40个åºä½,3æå
±120ï¼120*5ï¼æå¤3个åç§ï¼é对1100mm-1300mm车轮/ä¹è½åæ¾1100mm以ä¸è½¦è½®:ä¸ååå·åçå· |
| | | 72 11*6 |
| | | |
| | | æ ¹æ®è®¢åæ°æ¥è¿æ¯æ ¹æ®åå·æ¥ |
| | | |
| | | é»è¾ï¼å½åºåº1满ï¼50以ä¸è½¦è½®ç´æ¥åºåº |
| | | åºåº2满åºåº3åºä½å¤æ¾åºåº3å¦åæ¾å¤ååº |