已删除3个文件
已修改29个文件
已添加50个文件
已重命名17个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | /***************************************************************************************** |
| | | ** 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æä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import tracklogDetial from "@/views/widesea_system/system/tracklogDetial.vue" |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: tracklogDetial, |
| | | 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.forEach(x => { |
| | | if (x.field == "interface_type") { |
| | | x.getColor = (row, column) => { |
| | | if (row != null) { |
| | | if (row.interface_type == "æå") { |
| | | return "success"; |
| | | } else if (row.interface_type == "失败") { |
| | | return "error"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | let options = { |
| | | field: 'oper', |
| | | title: 'æ°æ®è¯¦æ
', |
| | | type: 'text', |
| | | width: 60, |
| | | //è¿åä¸ä¸ªæ ç¾ |
| | | formatter: (row) => { |
| | | return '<a href="javascript:void(0)">详æ
</a>' |
| | | }, |
| | | //触åäºä»¶,å¯ä»¥å¨æ¤äºä»¶åæå¼ä¸ä¸ªå¼¹åºæ¡çæä½ |
| | | click: (row, column, event) => { |
| | | this.$refs.gridHeader.openDialog(row) |
| | | } |
| | | }; |
| | | this.columns.push(options) |
| | | }, |
| | | 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_geometry_data', |
| | | name: 'dt_geometry_data', |
| | | component: () => import('@/views/widesea_wcs/baseinfo/dt_geometry_data.vue') |
| | | } ,{ |
| | | path: '/dt_Interfacerecord_pcs', |
| | | name: 'dt_Interfacerecord_pcs', |
| | | component: () => import('@/views/widesea_wcs/system/dt_Interfacerecord_pcs.vue') |
| | | }] |
| | | |
| | | export default viewgird |
| | |
| | | <template> |
| | | <div class="title">Welcome To WCS!</div> |
| | | <div class="title">Welcome To PCS!</div> |
| | | </template> |
| | | |
| | | <script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!-- 详æ
å¼¹çª --> |
| | | <vol-box :height="450" v-model="detialBox" :padding="15" title="æ¥å¿è¯¦æ
"> |
| | | <div> |
| | | idï¼{{ rowData.interface_id }} |
| | | <hr /> |
| | | <b>æ¶é´ï¼</b> |
| | | {{ rowData.interface_createtime }} |
| | | <br /> |
| | | <b>æä½åç§°ï¼</b> |
| | | {{ rowData.interface_name }} |
| | | <br /> |
| | | <b>æè¿°ï¼</b> |
| | | {{ rowData.interface_remark }} |
| | | <br /> |
| | | <b>é误信æ¯ï¼</b> |
| | | <br /> |
| | | {{ rowData.interface_message }} |
| | | <br /> |
| | | <br /> |
| | | <b>è¯·æ±æ°æ®ï¼</b> |
| | | <br /> |
| | | <pre> {{ rowData.interface_paradata==""?rowData.interface_paradata:JSON.parse(rowData.interface_paradata) }}</pre> |
| | | <br /> |
| | | <b>è¿åæ°æ®ï¼</b> |
| | | <pre>{{rowData.interface_returndata==""?rowData.interface_returndata:JSON.parse(rowData.interface_returndata)}}</pre> |
| | | </div> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script defer = "true"> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | |
| | | export default { |
| | | components: { "vol-box": VolBox }, |
| | | methods: {}, |
| | | data() { |
| | | return { |
| | | detialBox: false, |
| | | rowData: "", |
| | | }; |
| | | }, |
| | | methods: { |
| | | openDialog(row) { |
| | | this.detialBox = true; |
| | | this.rowData = row; |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style> |
| | | .formContainer { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | </style> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wcs/system/dt_Interfacerecord_pcs.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/system/dt_Interfacerecord_pcs.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'interface_id', |
| | | footer: "Foots", |
| | | cnName: 'æ¥å£æ¥å¿', |
| | | name: 'system/dt_Interfacerecord_pcs', |
| | | url: "/dt_Interfacerecord_pcs/", |
| | | sortName: "interface_createtime" |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([]); |
| | | const searchFormFields = ref({"interface_remark":"",}); |
| | | const searchFormOptions = ref([[{"title":"è¯·æ±æ°æ®","field":"interface_paradata","type":"like"},{"title":"æè¿°","field":"interface_remark","type":"like"}], |
| | | [{"title":"è¿åæ°æ®","field":"interface_returndata","type":"like"},{"title":"å建æ¶é´","field":"interface_createtime","type":"datetime"}] |
| | | ]); |
| | | const columns = ref([ |
| | | {field:'interface_id',title:'主é®',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'}, |
| | | { |
| | | field:'interface_call', |
| | | type:'string', |
| | | title:"请æ±è
", |
| | | width:60, |
| | | // sort:true, |
| | | align:'left' |
| | | }, |
| | | { |
| | | field:'interface_type', |
| | | title:'ç±»å', |
| | | type:'string', |
| | | width:60, |
| | | require:true, |
| | | align:'left', |
| | | bind:{data:[]}, |
| | | //sortable:true |
| | | }, |
| | | {field:'interface_provide',title:'æ¥åè
',type:'string',width:60,require:true,align:'left'}, |
| | | // {field:'interface_call',title:'请æ±è
',type:'string',width:110,require:true,align:'left'}, |
| | | {field:'interface_paradata',title:'è¯·æ±æ°æ®',type:'string',width:110,align:'left'}, |
| | | {field:'interface_returndata',title:'è¿åæ°æ®',type:'string',width:110,align:'left'}, |
| | | {field:'interface_createtime',title:'å建æ¶é´',type:'datetime',width:120,require:true,align:'left',sortable:true}, |
| | | {field:'interface_remark',title:'æè¿°',type:'string',width:120,align:'left'}, |
| | | {field:'interface_operator',title:'æä½è
',type:'string',width:110,require:true,align:'left'}, |
| | | {field:'interface_name',title:'æä½åç§°',type:'string',width:110,require:true,align:'left'}, |
| | | {field:'interface_message',title:'é误信æ¯',type:'string',width:110,align:'left'},]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | | columns: [], |
| | | sortName: "", |
| | | key: "" |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | /// <summary> |
| | | /// æ·»å æ¥å¿ |
| | | /// </summary> |
| | | private static void Write(string describe, object info, LogState logState, string dataFrom, string createuser) |
| | | public static void Write(string describe, object info, LogState logState, string dataFrom, string createuser) |
| | | { |
| | | try |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_System.IRepositories; |
| | | using WIDESEA_System.Repositories; |
| | | |
| | | namespace WIDESEA_Comm.LogInfo |
| | | { |
| | | public class WritePCSLog |
| | | { |
| | | /// <summary> |
| | | /// æ¥å£æ°æ®è®°å½ |
| | | /// </summary> |
| | | /// <param name="id">ä»»å¡ID</param> |
| | | /// <param name="code">æå/失败</param> |
| | | /// <param name="provide">æ¥åè
</param> |
| | | /// <param name="call">请æ±è
</param> |
| | | /// <param name="paradata">è¯·æ±æ°æ®</param> |
| | | /// <param name="returndata">è¿åæ°æ®</param> |
| | | /// <param name="remark">夿³¨/æè¿°</param> |
| | | /// <param name="name">æä½åç§°(æ¹æ³å)</param> |
| | | /// <param name="message">é误信æ¯</param> |
| | | public static void LogAdd(string id, string code, string provide, string call, string paradata, string returndata, string remark, string name, string message) |
| | | { |
| | | VOLContext context = new VOLContext(); |
| | | Idt_Interfacerecord_pcsRepository interfacerecord_PcsRepository = new dt_Interfacerecord_pcsRepository(context); |
| | | dt_Interfacerecord_pcs interfacerecord = new dt_Interfacerecord_pcs() |
| | | { |
| | | interface_id = Guid.NewGuid(), |
| | | interface_type = code, |
| | | interface_provide = provide, |
| | | interface_call = call, |
| | | interface_paradata = paradata, |
| | | interface_returndata = returndata, |
| | | interface_createtime = DateTime.Now, |
| | | interface_remark = remark, |
| | | interface_operator = "admin",//UserContext.Current.UserName == null ? "admin" : UserContext.Current.UserName, |
| | | interface_name = name, |
| | | interface_message = message, |
| | | }; |
| | | dt_Interfacerecord_pcs data = null; |
| | | if (interfacerecord.interface_message != "") |
| | | data = interfacerecord_PcsRepository.FindFirst(x => x.interface_message == interfacerecord.interface_message && x.interface_remark == interfacerecord.interface_remark && (interfacerecord.interface_createtime.Ticks - x.interface_createtime.Ticks >= 5) && x.interface_paradata.Contains(id));//è¶
è¿5ç§è®°å½ |
| | | //data = interfacerecord_PcsRepository.FindFirst(x => x.interface_message == interfacerecord.interface_message && x.interface_remark == interfacerecord.interface_remark && x.interface_createtime.Day == DateTime.Now.Day && x.interface_paradata.Contains(id)); |
| | | if (data == null) |
| | | interfacerecord_PcsRepository.Add(interfacerecord, true); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Comm |
| | | { |
| | | public enum LocationStateEnum |
| | | { |
| | | /// <summary> |
| | | /// æè´§ |
| | | /// </summary> |
| | | Stroge, |
| | | /// <summary> |
| | | /// ç©ºè´§ä½ |
| | | /// </summary> |
| | | Empty |
| | | } |
| | | } |
| | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_Core\WIDESEA_Core.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_System\WIDESEA_System.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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_Interfacerecord_pcs")] |
| | | public partial class dt_Interfacerecord_pcs : BaseEntity |
| | | { |
| | | /// <summary> |
| | | ///ä¸»é® |
| | | /// </summary> |
| | | [Key] |
| | | [Display(Name = "主é®")] |
| | | [Column(TypeName = "uniqueidentifier")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public Guid interface_id { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æå:失败 |
| | | /// </summary> |
| | | [Display(Name = "æå:失败")] |
| | | [MaxLength(20)] |
| | | [Column(TypeName = "nvarchar(20)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string interface_type { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ¥åè
|
| | | /// </summary> |
| | | [Display(Name = "æ¥åè
")] |
| | | [MaxLength(20)] |
| | | [Column(TypeName = "nvarchar(20)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string interface_provide { get; set; } |
| | | |
| | | /// <summary> |
| | | ///请æ±è
|
| | | /// </summary> |
| | | [Display(Name = "请æ±è
")] |
| | | [MaxLength(20)] |
| | | [Column(TypeName = "nvarchar(20)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string interface_call { get; set; } |
| | | |
| | | /// <summary> |
| | | ///è¯·æ±æ°æ® |
| | | /// </summary> |
| | | [Display(Name = "è¯·æ±æ°æ®")] |
| | | [Column(TypeName = "nvarchar(max)")] |
| | | [Editable(true)] |
| | | public string interface_paradata { get; set; } |
| | | |
| | | /// <summary> |
| | | ///è¿åæ°æ® |
| | | /// </summary> |
| | | [Display(Name = "è¿åæ°æ®")] |
| | | [Column(TypeName = "nvarchar(max)")] |
| | | [Editable(true)] |
| | | public string interface_returndata { get; set; } |
| | | |
| | | /// <summary> |
| | | ///å建æ¶é´ |
| | | /// </summary> |
| | | [Display(Name = "å建æ¶é´")] |
| | | [Column(TypeName = "datetime")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public DateTime interface_createtime { get; set; } |
| | | |
| | | /// <summary> |
| | | ///夿³¨ |
| | | /// </summary> |
| | | [Display(Name = "夿³¨")] |
| | | [MaxLength(100)] |
| | | [Column(TypeName = "nvarchar(100)")] |
| | | [Editable(true)] |
| | | public string interface_remark { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æä½è
|
| | | /// </summary> |
| | | [Display(Name = "æä½è
")] |
| | | [MaxLength(50)] |
| | | [Column(TypeName = "nvarchar(50)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string interface_operator { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æä½åç§°(æ¹æ³å) |
| | | /// </summary> |
| | | [Display(Name = "æä½åç§°(æ¹æ³å)")] |
| | | [MaxLength(50)] |
| | | [Column(TypeName = "nvarchar(50)")] |
| | | [Editable(true)] |
| | | [Required(AllowEmptyStrings = false)] |
| | | public string interface_name { get; set; } |
| | | |
| | | /// <summary> |
| | | ///éè¯¯ä¿¡æ¯ |
| | | /// </summary> |
| | | [Display(Name = "é误信æ¯")] |
| | | [Column(TypeName = "nvarchar(max)")] |
| | | [Editable(true)] |
| | | public string interface_message { 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_Interfacerecord_pcs |
| | | { |
| | | //æ¤å¤é
ç½®åæ®µ(åæ®µé
ç½®è§æ¤modelçå¦ä¸ä¸ªpartial),å¦æè¡¨ä¸æ²¡ææ¤å段请å ä¸ [NotMapped]屿§ï¼å¦åä¼å¼å¸¸ |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Entity.ToAGV |
| | | { |
| | | public class AGVRequestin |
| | | { |
| | | /// <summary> |
| | | /// åºåå· |
| | | /// </summary> |
| | | public int AreaNr { get; set; } |
| | | /// <summary> |
| | | /// ç±»å 1:æ£å¨è¿å
¥ã2:æ£å¨ç¦»å¼ |
| | | /// </summary> |
| | | public int Type { get; set; } |
| | | /// <summary> |
| | | ///AGVåºåç¶æ 1:ä¸å¨åºåå
ãå
¶ä»:å¨åºåå
|
| | | /// </summary> |
| | | public int OUTOFArea { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Entity.ToAGV |
| | | { |
| | | public class AGVRespone |
| | | { |
| | | /// <summary> |
| | | /// 1æå |
| | | /// </summary> |
| | | public int success { get; set; } = -1; |
| | | /// <summary> |
| | | /// 失败ï¼è¿åå¤±è´¥ä¿¡æ¯ |
| | | /// </summary> |
| | | public string Message { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using WIDESEA_Entity.MappingConfiguration; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | |
| | | namespace WIDESEA_Entity.MappingConfiguration |
| | | { |
| | | public class dt_Interfacerecord_pcsMapConfig : EntityMappingConfiguration<dt_Interfacerecord_pcs> |
| | | { |
| | | public override void Map(EntityTypeBuilder<dt_Interfacerecord_pcs> |
| | | builderTable) |
| | | { |
| | | //b.Property(x => x.StorageName).HasMaxLength(45); |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹Idt_Interfacerecord_pcsRepositoryç¼åæ¥å£ |
| | | */ |
| | | 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_System.IRepositories |
| | | { |
| | | public partial interface Idt_Interfacerecord_pcsRepository : IDependency,IRepository<dt_Interfacerecord_pcs> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_System.IServices |
| | | { |
| | | public partial interface Idt_Interfacerecord_pcsService : IService<dt_Interfacerecord_pcs> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äºdt_Interfacerecord_pcsç±»çä¸å¡ä»£ç æ¥å£åºå¨æ¤å¤ç¼å |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Core.Utilities; |
| | | using System.Linq.Expressions; |
| | | namespace WIDESEA_System.IServices |
| | | { |
| | | public partial interface Idt_Interfacerecord_pcsService |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_Interfacerecord_pcsRepositoryç¼å代ç |
| | | */ |
| | | using WIDESEA_System.IRepositories; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.Extensions.AutofacManager; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_System.Repositories |
| | | { |
| | | public partial class dt_Interfacerecord_pcsRepository : RepositoryBase<dt_Interfacerecord_pcs> , Idt_Interfacerecord_pcsRepository |
| | | { |
| | | public dt_Interfacerecord_pcsRepository(VOLContext dbContext) |
| | | : base(dbContext) |
| | | { |
| | | |
| | | } |
| | | public static Idt_Interfacerecord_pcsRepository Instance |
| | | { |
| | | get { return AutofacContainerModule.GetService<Idt_Interfacerecord_pcsRepository>(); } } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *ææå
³äºdt_Interfacerecord_pcsç±»çä¸å¡ä»£ç åºå¨æ¤å¤ç¼å |
| | | *å¯ä½¿ç¨repository.è°ç¨å¸¸ç¨æ¹æ³ï¼è·åEF/Dapperçä¿¡æ¯ |
| | | *妿éè¦äºå¡è¯·ä½¿ç¨repository.DbContextBeginTransaction |
| | | *ä¹å¯ä½¿ç¨DBServerProvider.æå¨è·åæ°æ®åºç¸å
³ä¿¡æ¯ |
| | | *ç¨æ·ä¿¡æ¯ãæéãè§è²ç使ç¨UserContext.Currentæä½ |
| | | *dt_Interfacerecord_pcsService对å¢ãå ãæ¹æ¥ã导å
¥ã导åºãå®¡æ ¸ä¸å¡ä»£ç æ©å±åç
§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_System.IRepositories; |
| | | |
| | | namespace WIDESEA_System.Services |
| | | { |
| | | public partial class dt_Interfacerecord_pcsService |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly Idt_Interfacerecord_pcsRepository _repository;//è®¿é®æ°æ®åº |
| | | |
| | | [ActivatorUtilitiesConstructor] |
| | | public dt_Interfacerecord_pcsService( |
| | | Idt_Interfacerecord_pcsRepository dbRepository, |
| | | IHttpContextAccessor httpContextAccessor |
| | | ) |
| | | : base(dbRepository) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _repository = dbRepository; |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,æ¤å¤ä»»ä½æ´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ææä¸å¡ç¼åå
¨é¨åºå¨Partialæä»¶å¤¹ä¸dt_Interfacerecord_pcsServiceä¸Idt_Interfacerecord_pcsServiceä¸ç¼å |
| | | */ |
| | | using WIDESEA_System.IRepositories; |
| | | using WIDESEA_System.IServices; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.Extensions.AutofacManager; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_System.Services |
| | | { |
| | | public partial class dt_Interfacerecord_pcsService : ServiceBase<dt_Interfacerecord_pcs, Idt_Interfacerecord_pcsRepository> |
| | | , Idt_Interfacerecord_pcsService, IDependency |
| | | { |
| | | public dt_Interfacerecord_pcsService(Idt_Interfacerecord_pcsRepository repository) |
| | | : base(repository) |
| | | { |
| | | Init(repository); |
| | | } |
| | | public static Idt_Interfacerecord_pcsService Instance |
| | | { |
| | | get { return AutofacContainerModule.GetService<Idt_Interfacerecord_pcsService>(); } } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics.Metrics; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WCS.WCSClient; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public class AGVandGantry |
| | | { |
| | | static FreeDB FreeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="requestin"></param> |
| | | /// <param name="MethodName">æ¹æ³å</param> |
| | | /// <returns></returns> |
| | | public static AGVRespone GetSetGantry(AGVRequestin requestin, string MethodName) |
| | | { |
| | | AGVRespone respone = new AGVRespone(); |
| | | try |
| | | { |
| | | 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 = 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") |
| | | { |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)requestin.AreaNr, numbers[requestin.AreaNr - 1]);//åºåå· |
| | | Gantry_client.WriteByOrder("W_AGV_Request_In", true, numbers[requestin.AreaNr - 1]);//ç³è¯·è¿å
¥åºå |
| | | var Release = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Release_In").First(), Gantry_client);//å
许è¿å
¥åºå |
| | | var Gantry_Out_of_Area = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Gantry_Out_of_Area").First(), Gantry_client);//æ¡æ¶ä¸å¨è¯¥åºå |
| | | if (!Release) throw new Exception("æ¡æ¶æªå
许è¿å
¥ï¼"); |
| | | if (!Gantry_Out_of_Area) throw new Exception("æ¡æ¶å¨åºåå
ï¼"); |
| | | } |
| | | else if (MethodName == "EnteriorLeav") |
| | | { |
| | | Gantry_client.WriteByOrder("W_AreaNr", (Int16)requestin.AreaNr, numbers[requestin.AreaNr - 1]);//åºåå· |
| | | if (requestin.Type == 1) |
| | | { |
| | | Gantry_client.WriteByOrder("W_AGV_Entering", true, numbers[requestin.AreaNr - 1]);//æ£å¨è¿å
¥ |
| | | var Area_Occupied_by_AGV = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Area_Occupied_by_AGV").First(), Gantry_client);//æ¡æ¶åé¦AGVå ä½ä¿¡å· |
| | | if (!Area_Occupied_by_AGV) throw new Exception("æ¡æ¶æªåé¦AGVå ä½ä¿¡å·"); |
| | | } |
| | | else if (requestin.Type == 2) |
| | | { |
| | | Gantry_client.WriteByOrder("W_AGV_Leaving", true, numbers[requestin.AreaNr - 1]);//æ£å¨ç¦»å¼ |
| | | var Area_Occupied_by_AGV = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Area_Occupied_by_AGV").First(), Gantry_client);//æ¡æ¶åé¦AGVå ä½ä¿¡å· |
| | | if (Area_Occupied_by_AGV) throw new Exception("æ¡æ¶æªåé¦AGV离å¼ä¿¡å·"); |
| | | } |
| | | } |
| | | else if (MethodName == "AGVOutofArea") |
| | | { |
| | | 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") |
| | | { |
| | | 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("æ¡æ¶å¨åºåå
ï¼"); |
| | | } |
| | | respone.success = 1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | respone.Message = ex.Message; |
| | | } |
| | | return respone; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using StackExchange.Redis; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public class Gantry |
| | | { |
| | | static 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); |
| | | /// <summary> |
| | | /// æ¥è¯¢è½¦è½®æ°æ® |
| | | /// </summary> |
| | | public void QueryWheeldata(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 on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on").First(), client); |
| | | if ((Int16)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); |
| | | } |
| | | else |
| | | { |
| | | client.WriteByOrder("W_i_status", (Int16)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_d", (float)geometry.d, name); |
| | | client.WriteByOrder("W_i_parameter_e", (float)geometry.e, name); |
| | | client.WriteByOrder("W_i_parameter_f", (float)geometry.f, 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ¥è¯¢è®¢å,æ¯å¦éè¦å å·¥ |
| | | /// </summary> |
| | | public void QueryOrder(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 on = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_oi_on").First(), client); |
| | | if ((Int16)on == 1) |
| | | { |
| | | var wp_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_id").First(), client); |
| | | //éæ·»å æ¥è¯¢è½¦è½®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-ä¸å 工车轮类å |
| | | client.WriteByOrder("R_oi_on", (Int16)0, name); |
| | | } |
| | | else |
| | | { |
| | | client.WriteByOrder("W_i_status", (Int16)1, name); |
| | | //client.WriteByOrder("W_i_job_id", "", name); |
| | | //client.WriteByOrder("W_i_drawing_id", "", name); |
| | | //client.WriteByOrder("W_i_heat_id", "", name); |
| | | //client.WriteByOrder("W_i_sourceheat", "", name); |
| | | //client.WriteByOrder("W_i_batch_id", "", name); |
| | | client.WriteByOrder("R_oi_on", (Int16)0, name); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 䏿ä½äº¤äº |
| | | /// </summary> |
| | | 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åå
䏿åº", "䏿åº" }; |
| | | 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 |
| | | 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);//æ¯å¦å
许 |
| | | |
| | | var finished = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_load_finished").First(), client);//æ¾æå®æ |
| | | if (finished) |
| | | { |
| | | |
| | | client.WriteByOrder("W_Storage_update", true, name);//è´§ä½ç¶ææ´æ° |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public class GantryDB |
| | | { |
| | | /// <summary> |
| | | /// è½¦è½®æ°æ® |
| | | /// </summary> |
| | | public class Wheeldata |
| | | { |
| | | 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 ushort oi_on { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// è®¢åæ°æ® |
| | | /// </summary> |
| | | public class Orderdata |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 䏿使°æ® |
| | | /// </summary> |
| | | public class Layoffleveldata |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 䏿使°æ® |
| | | /// </summary> |
| | | public class Loadingleveldata |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | finally |
| | | { |
| | | taskSeconds = Math.Round(stopwatch.Elapsed.TotalSeconds); |
| | | 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(); |
| | | |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Jobs; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | |
| | |
| | | /// æ¡æ¶ |
| | | /// </summary> |
| | | [DisallowConcurrentExecution] |
| | | public class GantryJob : IJob |
| | | public class GantryJob : JobBase, 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); |
| | | ExecuteJob(context, DoAction); |
| | | } |
| | | catch { } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | private void DoAction(IJobExecutionContext context) |
| | | { |
| | | var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient; |
| | | //èªå¨éè¿ |
| | | if (!client.IsConnected) |
| | | { |
| | | client.Connect(); |
| | | return; |
| | | } |
| | | Gantry gantry = new Gantry(); |
| | | 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) |
| | |
| | | throw; |
| | | } |
| | | } |
| | | #endregion |
| | | public void HandleReadSignal(string type, MachineDB DBItem) |
| | | { |
| | | switch (type) |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Jobs; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | using static System.Collections.Specialized.BitVector32; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | |
| | | /// 龿¡æº |
| | | /// </summary> |
| | | [DisallowConcurrentExecution] |
| | | public class PipelineJob : IJob |
| | | public class PipelineJob : JobBase, IJob |
| | | { |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | DoAction(client); |
| | | //DoAction(client); |
| | | ExecuteJob(context, DoAction); |
| | | } |
| | | catch { } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | private void DoAction(PLCClient client) |
| | | private void DoAction(IJobExecutionContext context) |
| | | { |
| | | throw new NotImplementedException(); |
| | | var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient; |
| | | //èªå¨éè¿ |
| | | if (!client.IsConnected) |
| | | { |
| | | client.Connect(); |
| | | return; |
| | | } |
| | | Loadinglevel(client); |
| | | } |
| | | /// <summary> |
| | | /// ä¸æåº |
| | | /// </summary> |
| | | /// <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) |
| | | { |
| | | 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);//æ¡æ¶æ¯å¦å¨åºåå
|
| | | |
| | | 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)//ä¿¡æ¯æè¯¯ï¼è®°å½æ¥å¿ |
| | | { |
| | | |
| | | } |
| | | } |
| | | 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);//è´§ä½ç¶ææ´æ° |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Xml.Linq; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | |
| | | namespace WIDESEA_WCS |
| | | { |
| | | public partial class ToAGVServer |
| | | { |
| | | FreeDB freeDB = new FreeDB(); |
| | | static AGVRespone respone = new AGVRespone(); |
| | | static AGVRequestin requestin = new AGVRequestin(); |
| | | /// <summary> |
| | | /// AGVç³è¯·è¿å
¥åºå |
| | | /// </summary> |
| | | /// <param name="v"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public static AGVRespone AGVRequestin(string json) |
| | | { |
| | | return GetSetGantry(json, "AGVRequestin", "AGVç³è¯·è¿å
¥åºå"); |
| | | } |
| | | /// <summary> |
| | | /// AGVæ£å¨ï¼è¿å
¥/离å¼ï¼ |
| | | /// </summary> |
| | | /// <param name="v"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public static AGVRespone EnteriorLeav(string json) |
| | | { |
| | | return GetSetGantry(json, "EnteriorLeav", "AGVæ£å¨(è¿å
¥/离å¼)"); |
| | | } |
| | | /// <summary> |
| | | /// AGVæ´æ°åºåç¶æ |
| | | /// </summary> |
| | | /// <param name="v"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public static AGVRespone AGVOutofArea(string json) |
| | | { |
| | | return GetSetGantry(json, "AGVOutofArea", "AGVæ´æ°åºåç¶æ"); |
| | | } |
| | | /// <summary> |
| | | /// AGVè·åæ¡æ¶åºåç¶æ |
| | | /// </summary> |
| | | /// <param name="v"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public static AGVRespone GantryOutofArea(string json) |
| | | { |
| | | return GetSetGantry(json, "GantryOutofArea", "AGVè·åæ¡æ¶åºåç¶æ"); |
| | | } |
| | | public static AGVRespone GetSetGantry(string json, string MethodName, string remark) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(json) || json == "null") |
| | | throw new Exception("æªè·åå°è¯·æ±åæ°æ°æ®"); |
| | | requestin = JsonConvert.DeserializeObject<AGVRequestin>(json); |
| | | if (requestin.AreaNr < 1 || requestin.AreaNr > 4) |
| | | throw new Exception("æªå®ä¹çåºåå·!"); |
| | | respone = AGVandGantry.GetSetGantry(requestin, MethodName); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | respone.Message = ex.Message; |
| | | } |
| | | WritePCSLog.LogAdd(requestin.AreaNr.ToString(), respone.success == 1 ? "æå " : "失败", "WMS", "AGV", json, JsonConvert.SerializeObject(respone), remark, MethodName, respone.Message); |
| | | return respone; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | public static object Read(dt_plcinfodetail detail, PLCClient client) |
| | | { |
| | | |
| | | if (detail.plcdetail_valtype == typeof(int).Name.ToLower())//4åè,æç¬¦å·ç±»å |
| | | { |
| | | return (client.Read<int>(detail.plcdetail_db+"."+detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(uint).Name.ToLower())//4åè,æ 符å·ç±»å |
| | | { |
| | | return (client.Read<uint>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(short).Name.ToLower())//2åè,æç¬¦å·ç±»å,æå¸¸ç¨ |
| | | { |
| | | return (client.Read<short>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(ushort).Name.ToLower())//2åè,æ 符å·ç±»å |
| | | { |
| | | return (client.Read<ushort>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(float).Name.ToLower())//æµ®ç¹å |
| | | { |
| | | return (client.Read<float>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(bool).Name.ToLower()) |
| | | { |
| | | return (client.Read<bool>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(byte).Name.ToLower())//åè |
| | | { |
| | | return (client.Read<byte>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(string).Name.ToLower())//å符串 |
| | | { |
| | | return (client.Read<string>(detail.plcdetail_db + "." + detail.plcdetail_value, detail.plcdetail_len.GetValueOrDefault())); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ã{detail.plcdetail_remark}ã,DBå°å{detail.plcdetail_db + "." + detail.plcdetail_value},æªå®ä¹æ°æ®ç±»å{detail.plcdetail_valtype}"); |
| | | } |
| | | |
| | | if (detail.plcdetail_valtype == typeof(int).Name.ToLower())//4åè,æç¬¦å·ç±»å |
| | | { |
| | | return (client.Read<int>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(uint).Name.ToLower())//4åè,æ 符å·ç±»å |
| | | { |
| | | return (client.Read<uint>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(short).Name.ToLower())//2åè,æç¬¦å·ç±»å,æå¸¸ç¨ |
| | | { |
| | | return (client.Read<short>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(ushort).Name.ToLower())//2åè,æ 符å·ç±»å |
| | | { |
| | | return (client.Read<ushort>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(float).Name.ToLower())//æµ®ç¹å |
| | | { |
| | | return (client.Read<float>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(bool).Name.ToLower()) |
| | | { |
| | | return (client.Read<bool>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(byte).Name.ToLower())//åè |
| | | { |
| | | return (client.Read<byte>(detail.plcdetail_db + "." + detail.plcdetail_value)); |
| | | } |
| | | else if (detail.plcdetail_valtype == typeof(string).Name.ToLower())//å符串 |
| | | { |
| | | return (client.Read<string>(detail.plcdetail_db + "." + detail.plcdetail_value, detail.plcdetail_len.GetValueOrDefault())); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ã{detail.plcdetail_remark}ã,DBå°å{detail.plcdetail_db + "." + detail.plcdetail_value},æªå®ä¹æ°æ®ç±»å{detail.plcdetail_valtype}"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="detail"></param> |
| | | /// <param name="client"></param> |
| | | /// <param name="value"></param> |
| | | /// <returns></returns> |
| | | public static object Write(dt_plcinfodetail detail, PLCClient client, object value) |
| | | { |
| | | try |
| | | { |
| | | return (client.Write(detail.plcdetail_db + "." + detail.plcdetail_value, value)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WCS; |
| | | |
| | | namespace ToAGV.Controllers |
| | | { |
| | | /// <summary> |
| | | /// AGVæ¥å£ |
| | | /// </summary> |
| | | [Route("api/ToAGV")] |
| | | [ApiController] |
| | | public class ToAGVController : ControllerBase |
| | | { |
| | | /// <summary> |
| | | /// AGVç³è¯·è¿å
¥åºå |
| | | /// </summary> |
| | | /// <param name="saveModel">请æ±åæ°</param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AGVRequestin"), Authorize, AllowAnonymous] |
| | | public AGVRespone AGVRequestin([FromBody] object saveModel) |
| | | { |
| | | return ToAGVServer.AGVRequestin(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | /// <summary> |
| | | /// AGVæ£å¨ï¼è¿å
¥/离å¼ï¼ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("EnteriorLeav"), Authorize, AllowAnonymous] |
| | | public AGVRespone EnteriorLeav([FromBody] object saveModel) |
| | | { |
| | | return ToAGVServer.EnteriorLeav(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | /// <summary> |
| | | /// AGVæ´æ°åºåç¶æ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AGVOutofArea"), Authorize, AllowAnonymous] |
| | | public AGVRespone AGVOutofArea([FromBody] object saveModel) |
| | | { |
| | | return ToAGVServer.AGVOutofArea(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | /// <summary> |
| | | /// AGVè·åæ¡æ¶åºåç¶æ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("GantryOutofArea"), Authorize, AllowAnonymous] |
| | | public AGVRespone GantryOutofArea([FromBody] object saveModel) |
| | | { |
| | | return ToAGVServer.GantryOutofArea(JsonConvert.SerializeObject(saveModel)); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_WebApi.Controllers.ToMes |
| | | { |
| | | /// <summary> |
| | | /// MESæ¥å£ |
| | | /// </summary> |
| | | [Route("api/ToMes")] |
| | | [ApiController] |
| | | public class ToMESController : ControllerBase |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *æ¥å£ç¼åå¤... |
| | | *妿æ¥å£éè¦åActionçæééªè¯ï¼è¯·å¨Actionä¸ä½¿ç¨å±æ§ |
| | | *å¦: [ApiActionPermission("dt_Interfacerecord_pcs",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_System.IServices; |
| | | |
| | | namespace WIDESEA_System.Controllers |
| | | { |
| | | public partial class dt_Interfacerecord_pcsController |
| | | { |
| | | private readonly Idt_Interfacerecord_pcsService _service;//访é®ä¸å¡ä»£ç |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | [ActivatorUtilitiesConstructor] |
| | | public dt_Interfacerecord_pcsController( |
| | | Idt_Interfacerecord_pcsService service, |
| | | IHttpContextAccessor httpContextAccessor |
| | | ) |
| | | : base(service) |
| | | { |
| | | _service = service; |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *妿è¦å¢å æ¹æ³è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_Interfacerecord_pcsControllerç¼å |
| | | */ |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Controllers.Basic; |
| | | using WIDESEA_Entity.AttributeManager; |
| | | using WIDESEA_System.IServices; |
| | | namespace WIDESEA_System.Controllers |
| | | { |
| | | [Route("api/dt_Interfacerecord_pcs")] |
| | | [PermissionTable(Name = "dt_Interfacerecord_pcs")] |
| | | public partial class dt_Interfacerecord_pcsController : ApiBaseController<Idt_Interfacerecord_pcsService> |
| | | { |
| | | public dt_Interfacerecord_pcsController(Idt_Interfacerecord_pcsService service) |
| | | : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Autofac; |
| | |
| | | //å为2份æ¥å£ææ¡£ |
| | | c.SwaggerDoc("v1", new OpenApiInfo { Title = "WIDESEA_Coreåå°Api", Version = "v1", Description = "è¿æ¯å¯¹ææ¡£çæè¿°ãã" }); |
| | | c.SwaggerDoc("v2", new OpenApiInfo { Title = "WIDESEA_Core对å¤ä¸æ¹Api", Version = "v2", Description = "xxxæ¥å£ææ¡£" }); //æ§å¶å¨é使ç¨[ApiExplorerSettings(GroupName = "v2")] |
| | | //å¯ç¨ä¸ææ³¨éåè½ |
| | | // var basePath = PlatformServices.Default.Application.ApplicationBasePath; |
| | | // var xmlPath = Path.Combine(basePath, "WIDESEA_WebApi.xml"); |
| | | // c.IncludeXmlComments(xmlPath, true);//æ¾ç¤ºæ§å¶å¨xml注éå
容 |
| | | //æ·»å è¿æ»¤å¨ å¯èªå®ä¹æ·»å 对æ§å¶å¨ç注éæè¿° |
| | | //c.DocumentFilter<SwaggerDocTag>(); |
| | | //å¯ç¨ä¸ææ³¨éåè½ |
| | | // var basePath = PlatformServices.Default.Application.ApplicationBasePath; |
| | | // var xmlPath = Path.Combine(basePath, "WIDESEA_WebApi.xml"); |
| | | // c.IncludeXmlComments(xmlPath, true);//æ¾ç¤ºæ§å¶å¨xml注éå
容 |
| | | //æ·»å è¿æ»¤å¨ å¯èªå®ä¹æ·»å 对æ§å¶å¨ç注éæè¿° |
| | | //c.DocumentFilter<SwaggerDocTag>(); |
| | | |
| | | var security = new Dictionary<string, IEnumerable<string>> { { AppSetting.Secret.Issuer, new string[] { } } }; |
| | | c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme() |
| | |
| | | BearerFormat = "JWT", |
| | | Scheme = "Bearer" |
| | | }); |
| | | |
| | | #region å¯ç¨ä¸ææ³¨éåè½ |
| | | //WIDESEA_WebApiä¸çPropertyGroupæ·»å <GenerateDocumentationFile>true</GenerateDocumentationFile><!--å¯ç¨ä¸ææ³¨éåè½--> |
| | | //å¯ç¨ä¸ææ³¨éåè½ |
| | | var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; |
| | | //IncludeXmlComments true æ¾ç¤ºæ§å¶å¨æ³¨é |
| | | c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename), true); |
| | | #endregion |
| | | c.AddSecurityRequirement(new OpenApiSecurityRequirement |
| | | { |
| | | { |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk.Web"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <Nullable>disable</Nullable> |
| | | <UserSecretsId>a3e3c6fb-4b7e-44a6-8dbe-5e5f11af4202</UserSecretsId> |
| | | <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> |
| | | </PropertyGroup> |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <Nullable>disable</Nullable> |
| | | <UserSecretsId>a3e3c6fb-4b7e-44a6-8dbe-5e5f11af4202</UserSecretsId> |
| | | <GenerateDocumentationFile>true</GenerateDocumentationFile><!--å¯ç¨ä¸ææ³¨éåè½--> |
| | | <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> |
| | | </PropertyGroup> |
| | | |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
| | | <OutputPath>bin\Debug\netcoreapp6.0\</OutputPath> |
| | | <DocumentationFile>bin\Debug\netcoreapp6.0\WIDESEA_WebApi.xml</DocumentationFile> |
| | | <NoWarn>1701;1702;CS1591;CS8618;CS8600;CS8602;CS1572;CS1573;CS1587;CS1591;CS1570;CS8765;</NoWarn> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
| | | <OutputPath>bin\Debug\netcoreapp6.0\</OutputPath> |
| | | <DocumentationFile>bin\Debug\netcoreapp6.0\WIDESEA_WebApi.xml</DocumentationFile> |
| | | <NoWarn>1701;1702;CS1591;CS8618;CS8600;CS8602;CS1572;CS1573;CS1587;CS1591;CS1570;CS8765;</NoWarn> |
| | | </PropertyGroup> |
| | | |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
| | | <DocumentationFile>bin\Release\netcoreapp6.0\WIDESEA_WebApi.xml</DocumentationFile> |
| | | <OutputPath>bin\Release\netcoreapp6.0\</OutputPath> |
| | | <NoWarn>1701;1702;CS1572;CS1573;CS1587;CS8618;CS8600;CS8602;CS1591;CS1570;CS8765;</NoWarn> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
| | | <DocumentationFile>bin\Release\netcoreapp6.0\WIDESEA_WebApi.xml</DocumentationFile> |
| | | <OutputPath>bin\Release\netcoreapp6.0\</OutputPath> |
| | | <NoWarn>1701;1702;CS1572;CS1573;CS1587;CS8618;CS8600;CS8602;CS1591;CS1570;CS8765;</NoWarn> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" /> |
| | | <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" /> |
| | | <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" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" /> |
| | | <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" /> |
| | | <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" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_Builder\WIDESEA_Builder.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_Core\WIDESEA_Core.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_Entity\WIDESEA_Entity.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_System\WIDESEA_System.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_WCS\WIDESEA_WCS.csproj" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_Builder\WIDESEA_Builder.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_Core\WIDESEA_Core.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_Entity\WIDESEA_Entity.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_System\WIDESEA_System.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_WCS\WIDESEA_WCS.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /***************************************************************************************** |
| | | ** 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; |
| | |
| | | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | // this.boxOptions.labelWidth = 150; |
| | | this.pagination.order = "asc"; |
| | | this.columns.forEach(row=>{ |
| | | if(row.field=="stationCode"){ |
| | | row.sort=true; |
| | | } |
| | | }) |
| | | this.buttons.splice(1, 0, { |
| | | name: "åæ¶ç¦ç¨", |
| | | icon: 'md-refresh', |
| | |
| | | path: '/Dt_Interfacerecord', |
| | | name: 'Dt_Interfacerecord', |
| | | component: () => import('@/views/widesea_system/system/Dt_Interfacerecord.vue') |
| | | }] |
| | | } ,{ |
| | | path: '/dt_geometry_data', |
| | | name: 'dt_geometry_data', |
| | | component: () => import('@/views/widesea_wms/baseinfo/dt_geometry_data.vue') |
| | | }] |
| | | |
| | | export default viewgird |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wms/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_wms/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> |
| | |
| | | url: "/dt_stationinfo/", |
| | | sortName: "zj" |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([]); |
| | | const editFormFields = ref({"stationCode":"","location_state":"","bindSN":"","tray_status":"","Number":"","heatNumber":"","remark":""}); |
| | | const editFormOptions = ref([[{"title":"ç¼åæ¶ç¼å·","field":"stationCode","disabled": true}], |
| | | [{"dataKey":"location_states","data":[],"title":"è´§ä½ç¶æ","field":"location_state","type":"select"}], |
| | | [{"title":"车轮SNå·","field":"bindSN"}], |
| | | [{"dataKey":"tray_status","data":[],"title":"æçç¶æ","field":"tray_status"}], |
| | | [{"title":"å·¥åç¼å·","field":"Number"}], |
| | | [{"title":"çå·","field":"heatNumber","type":"text"}], |
| | | [{"title":"夿³¨","field":"remark"}]]); |
| | | const searchFormFields = ref({"stationCode":"","stationType":"","area":"","enable":"","location_state":[],"bindSN":""}); |
| | | const searchFormOptions = ref([[{"title":"ç¼åæ¶ç¼å·","field":"stationCode","type":"like"},{"title":"车轮SNå·","field":"bindSN","type":"like"},{"dataKey":"materielinfos","data":[],"title":"ç©æç±»å","field":"stationType","type":"select"}],[{"dataKey":"area_name","data":[],"title":"åºå","field":"area","type":"select"},{"dataKey":"location_states","data":[],"title":"è´§ä½ç¶æ","field":"location_state","type":"selectList"},{"dataKey":"status","data":[],"title":"æ¯å¦å¯ç¨","field":"enable","type":"select"}]]); |
| | | const columns = ref([{field:'id',title:'id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'}, |
| | |
| | | /// <summary> |
| | | /// æ·»å æ¥å¿ |
| | | /// </summary> |
| | | private static void Write(string describe, object info, LogState logState, string dataFrom, string createuser) |
| | | public static void Write(string describe, object info, LogState logState, string dataFrom, string createuser) |
| | | { |
| | | try |
| | | { |
| | |
| | | Role_Id = s.Role_Id.GetInt(), |
| | | RoleName = s.RoleName, |
| | | //2022.08.15å¢å é¨é¨id |
| | | DeptId = s.Dept_Id??0, |
| | | DeptId = s.Dept_Id ?? 0, |
| | | Token = s.Token, |
| | | UserName = s.UserName, |
| | | UserTrueName = s.UserTrueName, |
| | | Enable = s.Enable, |
| | | DeptIds= s.DeptIds, |
| | | systemType=s.systemType |
| | | DeptIds = s.DeptIds, |
| | | systemType = s.systemType, |
| | | Tel = s.Tel |
| | | }).ToList().Select(s => new UserInfo() |
| | | { |
| | | User_Id = userId, |
| | |
| | | UserName = s.UserName, |
| | | UserTrueName = s.UserTrueName, |
| | | Enable = 1, |
| | | Tel = s.Tel, |
| | | DeptIds = string.IsNullOrEmpty(s.DeptIds) ? new List<Guid>() : s.DeptIds.Split(",").Select(x => (Guid)x.GetGuid()).ToList(), |
| | | systemType=s.systemType |
| | | systemType = s.systemType |
| | | }).FirstOrDefault(); |
| | | |
| | | if (_userInfo != null && _userInfo.User_Id > 0) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *å¦ææ°æ®åºå段åçååï¼è¯·å¨ä»£ç çå¨éæ°çææ¤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]屿§ï¼å¦åä¼å¼å¸¸ |
| | | } |
| | | } |
| | |
| | | public List<Guid> DeptIds { get; set; } |
| | | |
| | | public string Token { get; set; } |
| | | public string Tel { get; set; } |
| | | } |
| | | } |
| | |
| | | public DateTime agv_createtime { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ§è¡æ¶é´ |
| | | ///ä¸åæ¶é´ |
| | | /// </summary> |
| | | [Display(Name = "æ§è¡æ¶é´")] |
| | | [Display(Name = "ä¸åæ¶é´")] |
| | | [Column(TypeName = "datetime")] |
| | | [Editable(true)] |
| | | public DateTime? agv_realesstime { get; set; } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | namespace WIDESEA_Entity.ToAGV |
| | | { |
| | | /// <summary> |
| | | /// åé¦ç»AGVä¿¡æ¯ |
| | | /// </summary> |
| | | public class AGVRespone |
| | | { |
| | | /// <summary> |
| | |
| | | |
| | | namespace WIDESEA_Entity.ToAGV |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ä¸åä¿¡æ¯ |
| | | /// </summary> |
| | | public class RequestTask |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public string TO_POSITION { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// </summary> |
| | | public int? Grade { get; set; } |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | public int? Quantity { get; set; } |
| | | /// <summary> |
| | | /// ç©æä¿¡æ¯ |
| | | /// </summary> |
| | | public string Material { get; set; } |
| | | #region è½¦è½®æ°æ® |
| | | public float A { get; set; } |
| | | public float B { get; set; } |
| | | public float C { get; set; } |
| | | public float D { get; set; } |
| | | public float E { get; set; } |
| | | public float F { get; set; } |
| | | public float G { get; set; } |
| | | public float H { get; set; } |
| | | #endregion |
| | | } |
| | | /// <summary> |
| | | /// AGVåé¦ä¿¡æ¯ |
| | | /// </summary> |
| | | public class Respone |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç级 |
| | | /// 1æå |
| | | /// </summary> |
| | | public int? Priority { get; set; } |
| | | public int? agv_qty { get; set; } |
| | | public bool Success { get; set; } |
| | | /// <summary> |
| | | /// 失败ï¼è¿åå¤±è´¥ä¿¡æ¯ |
| | | /// </summary> |
| | | public string Msg { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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 |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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 Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | |
| | | namespace WIDESEA_WMS.Common |
| | | { |
| | | public partial class AGVServer |
| | | { |
| | | static FreeDB freeDB = new FreeDB(); |
| | | static Respone respone = new Respone(); |
| | | static RequestTask requestTask = new RequestTask(); |
| | | static string postJson = string.Empty; |
| | | static string report = string.Empty; |
| | | /// <summary> |
| | | /// ä»»å¡ä¸å |
| | | /// </summary> |
| | | public static void SendAgvTask() |
| | | { |
| | | try |
| | | { |
| | | var agv_task = freeDB.Select<dt_agvtask>() |
| | | .Where(t => t.agv_taskstate == AGVTaskStateEnum.Create.ToString() |
| | | && (t.agv_tasktype == "TaskType_Outbound" || t.agv_tasktype == "TaskType_Inbound" || t.agv_tasktype == "TaskType_AOutbound") |
| | | && string.IsNullOrEmpty(t.agv_remark)) |
| | | .OrderByDescending(t => t.agv_grade) |
| | | .OrderBy(t => t.agv_createtime) |
| | | .First(); |
| | | if (agv_task == null) |
| | | agv_task = freeDB.Select<dt_agvtask>() |
| | | .Where(t => t.agv_taskstate == AGVTaskStateEnum.Create.ToString() |
| | | && (t.agv_tasktype == "TaskType_Outbound" || t.agv_tasktype == "TaskType_Inbound" || t.agv_tasktype == "TaskType_AOutbound") |
| | | && !string.IsNullOrEmpty(t.agv_remark)) |
| | | .OrderByDescending(t => t.agv_grade) |
| | | .OrderBy(t => t.agv_createtime) |
| | | .First(); |
| | | if (agv_task != null) |
| | | { |
| | | var Materiel = QueryData.QueryMateriel(agv_task.agv_materielid);//æ¥æ¾è½¦è½®æ°æ® |
| | | if (Materiel == null) |
| | | { |
| | | agv_task.agv_remark = "æªè·åå°å½åä»»å¡çè½¦è½®æ°æ®"; |
| | | freeDB.Update(agv_task).UpdateColumns(t => new { t.agv_remark }).ExecuteAffrows(); |
| | | throw new Exception("æªæ¥è¯¢å°å½åä»»å¡çè½¦è½®ç±»åæ°æ®ï¼ä»»å¡IDï¼" + agv_task.agv_tasknum); |
| | | } |
| | | requestTask.TASK_NO = agv_task.agv_tasknum; |
| | | requestTask.FROM_POSITION = agv_task.agv_fromaddress; |
| | | requestTask.TO_POSITION = agv_task.agv_toaddress; |
| | | requestTask.Material = agv_task.agv_materielid; |
| | | requestTask.Grade = agv_task.agv_grade; |
| | | requestTask.Quantity = agv_task.agv_qty; |
| | | requestTask.A = Materiel.a; |
| | | requestTask.B = Materiel.b; |
| | | requestTask.C = Materiel.c; |
| | | requestTask.D = Materiel.d; |
| | | requestTask.E = Materiel.e; |
| | | requestTask.F = Materiel.f; |
| | | requestTask.G = Materiel.g; |
| | | requestTask.H = Materiel.h; |
| | | postJson = JsonConvert.SerializeObject(requestTask); |
| | | report = Request.RequestData(postJson, "http://192.168.12.250:5566/api/TaskCreat/CreatTask"); |
| | | respone = JsonConvert.DeserializeObject<Respone>(report); |
| | | if (respone.Success) |
| | | { |
| | | agv_task.agv_taskstate = AGVTaskStateEnum.SendOut.ToString(); |
| | | agv_task.agv_realesstime = DateTime.Now; |
| | | freeDB.Update(agv_task).UpdateColumns(t => new { t.agv_realesstime, t.agv_taskstate }).ExecuteAffrows(); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | respone.Success = false; |
| | | respone.Msg = ex.Message; |
| | | } |
| | | WriteWMSLog.LogAdd(requestTask.TASK_NO, respone.Success ? "æå " : "失败", "AGV", "WMS", postJson, report, "ä¸åAGVä»»å¡", "SendAGVTask", respone.Msg); |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/Task.cs ÐÞ¸Ä |
| | |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | |
| | | namespace WIDESEA_WMS |
| | | namespace WIDESEA_WMS.Common |
| | | { |
| | | public class Task |
| | | public class HandleTask |
| | | { |
| | | static FreeDB freeDB = new FreeDB(); |
| | | public static FreeDB freeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// æ·»å åå²ä»»å¡ |
| | | /// </summary> |
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/QueryData.cs ÐÞ¸Ä |
| | |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS |
| | | namespace WIDESEA_WMS.Common |
| | | { |
| | | public class QueryData |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | public static dt_materielinfo QueryMateriel(string type) |
| | | public static dt_geometry_data QueryMateriel(string type) |
| | | { |
| | | var materielinfo = freeDB.Select<dt_materielinfo>().Where(x => x.materiel_id == type).First(); |
| | | var materielinfo = freeDB.Select<dt_geometry_data>().Where(x => x.TypeId.ToString() == type).First(); |
| | | return materielinfo; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *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_WMS.IRepositories |
| | | { |
| | | public partial interface Idt_geometry_dataRepository : IDependency,IRepository<dt_geometry_data> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | */ |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.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_WMS.IServices |
| | | { |
| | | public partial interface Idt_geometry_dataService |
| | | { |
| | | } |
| | | } |
| | |
| | | { |
| | | public partial interface Idt_stationinfoService |
| | | { |
| | | WebResponseContent SetStationEnable(object parm); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *Repositoryæä¾æ°æ®åºæä½ï¼å¦æè¦å¢å æ°æ®åºæä½è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_geometry_dataRepositoryç¼å代ç |
| | | */ |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.Extensions.AutofacManager; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.Repositories |
| | | { |
| | | public partial class 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_WMS.IRepositories; |
| | | |
| | | namespace WIDESEA_WMS.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_WMS.IRepositories; |
| | | using WIDESEA_WMS.IServices; |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.Extensions.AutofacManager; |
| | | using WIDESEA_Entity.DomainModels; |
| | | |
| | | namespace WIDESEA_WMS.Services |
| | | { |
| | | public partial class 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 Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.AspNetCore.Http; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Core.ManageUser; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | |
| | | namespace WIDESEA_WMS.Services |
| | | { |
| | | public class Parm |
| | | { |
| | | public List<string> data { get; set; } |
| | | public int type { get; set; } |
| | | } |
| | | public partial class dt_stationinfoService |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | FreeDB freeDB=new FreeDB(); |
| | | /// <summary> |
| | | /// 设置ç¼åæ¶ç¦ç¨å¯ç¨ |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent SetStationEnable(object json) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | var Tel = UserContext.Current.UserInfo.Tel;//ç¼åæ¶æé |
| | | var data = JsonConvert.DeserializeObject<Parm>(json.ToString()); |
| | | //var updateList = FreeDB.DB.Select<dt_stationinfo>().Where(t => data.data.Contains(t.id.ToString())).ToList(); |
| | | var updateList = _repository.Find(x => data.data.Contains(x.id.ToString())).ToList(); |
| | | if (!string.IsNullOrEmpty(Tel)) |
| | | { |
| | | var types = Tel.Split(','); |
| | | foreach (var update in updateList) |
| | | { |
| | | var OK = false; |
| | | foreach (var type in types) |
| | | { |
| | | if (update.stationCode.Contains(type)) |
| | | OK = true; |
| | | } |
| | | if (!OK) throw new Exception("å½åè´¦å·æ ç¦ç¨æé!"); |
| | | } |
| | | } |
| | | |
| | | var res = freeDB.Update<dt_stationinfo>() |
| | | .Set(t => t.enable, data.type == 1) |
| | | .Where(t => data.data.Contains(t.id.ToString())) |
| | | .ExecuteAffrows(); |
| | | |
| | | var msg = data.type == 1 ? "å¯ç¨" : "ç¦ç¨"; |
| | | WriteDBLog.Write($"æå¨{msg}ç«ç¹ ", $"{string.Join('ã', updateList.Select(t => t.stationCode).ToArray())}", LogState.Sucess, "WCS", UserContext.Current.UserName); |
| | | |
| | | webResponse.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteDBLog.Write($"æå¨å¯ç¨æç¦ç¨ç«ç¹ ", new { éè¯¯ä¿¡æ¯ = ex.Message, æ°æ® = json }, LogState.Error, "WCS", UserContext.Current.UserName); |
| | | webResponse.Error(ex.Message); |
| | | } |
| | | return webResponse; |
| | | } |
| | | public override WebResponseContent Add(SaveModel saveDataModel) |
| | | { |
| | | |
| | |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Xml.Linq; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WMS.Common; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | |
| | |
| | | if (string.IsNullOrEmpty(json) || json == "null") |
| | | throw new Exception("æªè·åå°è¯·æ±åæ°æ°æ®"); |
| | | tasteInfo = JsonConvert.DeserializeObject<UpdateTasteInfo>(json); |
| | | if (tasteInfo == null) |
| | | throw new Exception("请æ±åæ°æ ¼å¼ä¸å¯¹ï¼"); |
| | | if (string.IsNullOrEmpty(tasteInfo.TASK_NO)) |
| | | throw new Exception("æªè·åå°ä»»å¡å·!"); |
| | | var task = repository.FindFirst(x => x.agv_tasknum == tasteInfo.TASK_NO); |
| | |
| | | if (task.agv_taskstate == StateName) |
| | | { |
| | | respone.success = 2; |
| | | throw new Exception(tasteInfo.TASK_NO + "ï¼éå¤è°ç¨ï¼ä»»å¡ç¶æä¸ºï¼" + tasteInfo.TASK_State); |
| | | respone.Message = tasteInfo.TASK_NO + "ï¼éå¤è°ç¨ï¼ä»»å¡ç¶æä¸ºï¼" + tasteInfo.TASK_State; |
| | | return respone; |
| | | } |
| | | if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Executing) |
| | | task.agv_executingBeginTime = DateTime.Now; |
| | |
| | | throw new Exception("ä»»å¡ç¶ææ´æ°å¤±è´¥ï¼ä»»å¡IDï¼" + tasteInfo.TASK_NO + "ï¼ä»»å¡ç¶æï¼" + tasteInfo.TASK_State); |
| | | if (tasteInfo.TASK_State == (int)AGVTaskStateEnum.Complete1) |
| | | { |
| | | Task.AddHtyTask(task); |
| | | Task.Updateinventory(task); |
| | | Task.AutoUpdateHCJState(task); |
| | | HandleTask.AddHtyTask(task); |
| | | HandleTask.Updateinventory(task); |
| | | HandleTask.AutoUpdateHCJState(task); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | WriteWMSLog.LogAdd(tasteInfo.TASK_NO, respone.success == 1 ? "æå " : "失败", "WMS", "AGV", json, JsonConvert.SerializeObject(respone), "AGVåé¦ä»»å¡ç¶æ", "UpdateTaskState", respone.Message); |
| | | } |
| | | return respone; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸åAGVä»»å¡ |
| | | /// </summary> |
| | | /// <param name="agvtask"></param> |
| | | public static void SendAGVTask(dt_agvtask agvtask) |
| | | { |
| | | if (agvtask == null) return; |
| | | VOLContext context = new VOLContext(); |
| | | Idt_agvtaskRepository repository = new dt_agvtaskRepository(context); |
| | | AGVRespone respone = new AGVRespone(); |
| | | 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.FROM_POSITION = agvtask.agv_fromaddress; |
| | | 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 = Request.RequestData(postJson, url); |
| | | respone = JsonConvert.DeserializeObject<AGVRespone>(report); |
| | | if (respone.success != 1) |
| | | throw new Exception(respone.Message); |
| | | agvtask.agv_taskstate = AGVTaskStateEnum.SendOut.ToString(); |
| | | agvtask.agv_realesstime = DateTime.Now; |
| | | repository.Update(agvtask, true); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | respone.Message = ex.Message; |
| | | } |
| | | WriteWMSLog.LogAdd(requestTask.TASK_NO, respone.success == 1 ? "æå " : "失败", "AGV", "WMS", postJson, report, "ä¸åAGVä»»å¡", "SendAGVTask", respone.Message); |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_WMS.Common; |
| | | |
| | | namespace WIDESEA_WebApi.Controllers |
| | | { |
| | | public class JobTask : Job |
| | | { |
| | | [Invoke(Begin = "2024-01-19 00:00", Interval = 1000*5, /*IsEnabled = true,*/ SkipWhileExecuting = true)] |
| | | [Invoke(Begin = "2024-01-01 00:00", Interval = 1000 * 5, /*IsEnabled = true,*/ SkipWhileExecuting = true)] |
| | | public void TaskTime() |
| | | { |
| | | //Console.WriteLine(DateTime.Now.ToString()); |
| | | AGVServer.SendAgvTask(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *æ¥å£ç¼åå¤... |
| | | *妿æ¥å£éè¦å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_WMS.IServices; |
| | | |
| | | namespace WIDESEA_WMS.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; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_WMS.IServices; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_WMS.Services; |
| | | |
| | | namespace WIDESEA_WMS.Controllers |
| | | { |
| | |
| | | _service = service; |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | /// <summary> |
| | | /// 设置ç¼åæ¶ç¦ç¨å¯ç¨ |
| | | /// </summary> |
| | | /// <param name="parm"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("SetStationEnable")] |
| | | public WebResponseContent SetStationEnable([FromBody] object parm) |
| | | { |
| | | return dt_stationinfoService.Instance.SetStationEnable(parm); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *妿è¦å¢å æ¹æ³è¯·å¨å½åç®å½ä¸Partialæä»¶å¤¹dt_geometry_dataControllerç¼å |
| | | */ |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Controllers.Basic; |
| | | using WIDESEA_Entity.AttributeManager; |
| | | using WIDESEA_WMS.IServices; |
| | | namespace WIDESEA_WMS.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) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | <ProjectReference Include="..\WIDESEA_WMS\WIDESEA_WMS.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Controllers\WIDESEA_WCS\Partial\" /> |
| | | </ItemGroup> |
| | | |
| | | |
| | | </Project> |
| | |
| | | |
| | | åºåº:æå¤§å¼,æå°å¼,æåå·,æçå·,æåºåºææ¾(æ¯å¦åºåº2满äºè®¾å
æ¾åºåº3/4) |
| | | |
| | | å¨è½¦è½¦è½®æéè¦ä½¿ç¨ç«åæç(åªæä¸åå
ä¼ä½¿ç¨)ï¼å¯å¨è½¦è½®æ°æ®è¡¨æ·»å åæ®µï¼æçç±»åãæ¯å¦å å·¥ï¼ |
| | | |
| | | å
¥åº |
| | | åºåº |
| | | å¤åå
¥åº |