已删除2个文件
已添加10个文件
已修改15个文件
| | |
| | | let loadingInstance; |
| | | let loadingStatus = false; |
| | | if (process.env.NODE_ENV == 'development') { |
| | | axios.defaults.baseURL = 'http://127.0.0.1:9291/'; |
| | | axios.defaults.baseURL = 'http://11.2.30.112:9291/'; |
| | | //axios.defaults.baseURL = 'http://192.168.35.3:9281/'; |
| | | } |
| | | else if (process.env.NODE_ENV == 'debug') { |
| | | axios.defaults.baseURL = 'http://127.0.0.1:8098/'; |
| | | axios.defaults.baseURL = 'http://11.2.30.112:9291/'; |
| | | } |
| | | |
| | | else if (process.env.NODE_ENV == 'production') { |
| | | axios.defaults.baseURL = 'http://192.168.35.3:9281/'; |
| | | axios.defaults.baseURL = 'http://11.2.30.112:9291/'; |
| | | } |
| | | if (!axios.defaults.baseURL.endsWith('/')) { |
| | | axios.defaults.baseURL+="/"; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="1000px" |
| | | :padding="15" |
| | | title="è´§ä½ç¶æåå¨è®°å½" |
| | | > |
| | | <div class="box-table" style="margin-top: 1%"> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="tableData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | @row-click="handleRowClick" |
| | | height="500px" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | > |
| | | <!-- <el-table-column type="selection" width="55"> </el-table-column> --> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed="left" |
| | | width="55" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.field" |
| | | :label="item.title" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-button |
| | | type="text" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i |
| | | :class="item.icon" |
| | | style="font-size: 22px" |
| | | ></i></el-button |
| | | ></el-tooltip> |
| | | </div> |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | row: null, |
| | | tableData: [], |
| | | LocationStates:[{key: "0", value: "空é²"}, {key: "1", value: "éå®"}, {key: "100", value: "æè´§"}], |
| | | LocationChanges:[{key: "0", value: "å
¥åºåé
"}, {key: "1", value: "åºåºåé
"}, {key: "2", value: "å
¥åºä»»å¡å®æ"}, {key: "3", value: "åºåºä»»å¡å®æ"}], |
| | | tableColumns: [ |
| | | { |
| | | field: "locationId", |
| | | title: "è´§ä½ä¸»é®", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "beforeStatus", |
| | | title: "åå¨åè´§ä½ç¶æ", |
| | | type: "tag", |
| | | width: 150, |
| | | align: "left", |
| | | bindKey: "locationStatusEnum", |
| | | }, |
| | | { |
| | | field: "afterStatus", |
| | | title: "åå¨åè´§ä½ç¶æ", |
| | | type: "tag", |
| | | width: 150, |
| | | align: "left", |
| | | bindKey: "locationStatusEnum", |
| | | }, |
| | | { |
| | | field: "changeType", |
| | | title: "åå¨ç±»å", |
| | | type: "tag", |
| | | width: 100, |
| | | align: "left", |
| | | bindKey: "locationChangeType", |
| | | }, |
| | | { |
| | | field: "taskNum", |
| | | title: "ä»»å¡å·", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden: true, |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | ], |
| | | paginations: { |
| | | sort: "CreateDate", |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [120], |
| | | size: 120, // é»è®¤åé¡µå¤§å° |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 120, |
| | | }, |
| | | dictionaryList: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | this.getDetailData(); |
| | | this.getDictionaryData(); |
| | | }, |
| | | getDetailData() { |
| | | this.http |
| | | .post( |
| | | "/api/LocationStatusChangeRecord/GetLocationState?id=" + this.row.id, |
| | | {}, |
| | | true |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.tableData = x.data; |
| | | }); |
| | | }, |
| | | getDictionary(row, column) { |
| | | if (column.bindKey=="locationStatusEnum") { |
| | | var dicItem = this.LocationStates.find((x) => x.key == row[column.field]); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | | return row[column.field]; |
| | | } |
| | | }else if (column.bindKey=="locationChangeType") { |
| | | var dicItem = this.LocationChanges.find((x) => x.key == row[column.field]); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | | return row[column.field]; |
| | | } |
| | | }else { |
| | | return row[column.field]; |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | created() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-col { |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .grid-content { |
| | | border-radius: 4px; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .content-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .right-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .warning-row { |
| | | background: #e6a23c; |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | |
| | | .el-table .error-row { |
| | | background: #f56c6c; |
| | | } |
| | | </style> |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | // import gridBody from './extend/GetLocationStatus.vue' |
| | | import gridBody from './extend/GetLocationStatus.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | |
| | | cnName: "è´§ä½ä¿¡æ¯", |
| | | name: "locationInfo", |
| | | url: "/LocationInfo/", |
| | | sortName: "id", |
| | | sortName: "createDate", |
| | | }); |
| | | const editFormFields = ref({ |
| | | locationStatus: "", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IRecordRepository; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEA_RecordRepository |
| | | { |
| | | public class LocationStatusChangeRecordRepository : RepositoryBase<Dt_LocationStatusChangeRecord>, ILocationStatusChangeRecordRepository |
| | | { |
| | | public LocationStatusChangeRecordRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public DateTime DateTime { get; set; } |
| | | } |
| | | public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | public class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | public ILocationInfoRepository Repository => BaseDal; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IRecordRepository; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | | { |
| | | public class LocationStatusChangeRecordService : ServiceBase<Dt_LocationStatusChangeRecord, ILocationStatusChangeRecordRepository>, ILocationStatusChangeRecordService |
| | | { |
| | | |
| | | public ILocationStatusChangeRecordRepository Repository => BaseDal; |
| | | public LocationStatusChangeRecordService(ILocationStatusChangeRecordRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// è´§ä½åå¨è®°å½æ·»å (å个) |
| | | /// </summary> |
| | | public void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, LocationStatusEnum lastStatus, LocationStatusEnum newStatus, LocationChangeType changeType, int? taskNum = null) |
| | | { |
| | | try |
| | | { |
| | | Dt_LocationStatusChangeRecord locationStatusChangeRecord = new Dt_LocationStatusChangeRecord() |
| | | { |
| | | AfterStatus = newStatus.ObjToInt(), |
| | | BeforeStatus = lastStatus.ObjToInt(), |
| | | ChangeType = changeType.ObjToInt(), |
| | | LocationCode = locationInfo.LocationCode, |
| | | LocationId = locationInfo.Id, |
| | | TaskNum = taskNum, |
| | | Creater = "", |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | |
| | | BaseDal.AddData(locationStatusChangeRecord); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è´§ä½åå¨è®°å½æ·»å (å¤ä¸ª) |
| | | /// </summary> |
| | | public void AddLocationStatusChangeRecord(List<Dt_LocationInfo> locationInfos, LocationStatusEnum lastStatus, LocationStatusEnum newStatus, LocationChangeType changeType, List<int>? taskNums = null) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_LocationStatusChangeRecord> records = new List<Dt_LocationStatusChangeRecord>(); |
| | | for (int i = 0; i < locationInfos.Count; i++) |
| | | { |
| | | Dt_LocationInfo locationInfo = locationInfos[i]; |
| | | int? taskNum = (taskNums != null && taskNums.Count > 0 && taskNums.Count == locationInfos.Count) ? taskNums[i] : null; |
| | | Dt_LocationStatusChangeRecord locationStatusChangeRecord = new Dt_LocationStatusChangeRecord() |
| | | { |
| | | AfterStatus = newStatus.ObjToInt(), |
| | | BeforeStatus = lastStatus.ObjToInt(), |
| | | ChangeType = changeType.ObjToInt(), |
| | | LocationCode = locationInfo.LocationCode, |
| | | LocationId = locationInfo.Id, |
| | | TaskNum = taskNum, |
| | | Creater = "", |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | records.Add(locationStatusChangeRecord); |
| | | } |
| | | |
| | | |
| | | BaseDal.AddData(records); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è·åæå®è´§ä½åå¨è®°å½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetLocationState(int id) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_LocationStatusChangeRecord> location = BaseDal.QueryData(x => x.LocationId == id).OrderByDescending(x => x.CreateDate).ToList(); |
| | | |
| | | return content = WebResponseContent.Instance.OK(data: location); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Common |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æåæ´ç±»å |
| | | /// </summary> |
| | | public enum LocationChangeType |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºåé
|
| | | /// </summary> |
| | | [Description("å
¥åºåé
")] |
| | | InboundAssignLocation, |
| | | |
| | | /// <summary> |
| | | /// åºåºåé
|
| | | /// </summary> |
| | | [Description("åºåºåé
")] |
| | | OutboundAssignLocation, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("å
¥åºä»»å¡å®æ")] |
| | | InboundCompleted, |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("åºåºä»»å¡å®æ")] |
| | | OutboundCompleted |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// åºåºç«å° |
| | | /// </summary> |
| | | StationType_OnlyOutbound = 2, |
| | | |
| | | /// <summary> |
| | | /// åºå
¥åºç«å° |
| | | /// </summary> |
| | | StationType_InboundAndOutbound = 3, |
| | | StationType_OnlyOutbound = 2 |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string ContainerCode { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// æç§å¢ä¸å |
| | | /// </summary> |
| | | public class TaskSendLight |
| | | { |
| | | /// <summary> |
| | | /// æç§å¢ç¼å·(B1䏿/B2äºææç§å¢) |
| | | /// </summary> |
| | | public string TagNo { get; set; } |
| | | /// <summary> |
| | | /// 订åå· |
| | | /// </summary> |
| | | public string DocNo { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | /// <summary> |
| | | /// è´§ä½å· |
| | | /// </summary> |
| | | public string TagCode { get; set; } |
| | | /// <summary> |
| | | /// çµåæ ç¾æ¾ç¤ºæ°é |
| | | /// </summary> |
| | | public int TagQunity { get; set; } |
| | | /// <summary> |
| | | /// 亮ç¯é¢è² |
| | | /// </summary> |
| | | public string Color { get; set; } |
| | | /// <summary> |
| | | /// æ¨¡å¼ |
| | | /// </summary> |
| | | public int Mode { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEA_IRecordRepository |
| | | { |
| | | public interface ILocationStatusChangeRecordRepository : IRepository<Dt_LocationStatusChangeRecord> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IRecordRepository; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_IBasicInfoService |
| | | { |
| | | public interface ILocationStatusChangeRecordService : IService<Dt_LocationStatusChangeRecord> |
| | | { |
| | | ILocationStatusChangeRecordRepository Repository { get; } |
| | | /// <summary> |
| | | /// è´§ä½åå¨è®°å½æ·»å (å个) |
| | | /// </summary> |
| | | void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, LocationStatusEnum lastStatus, LocationStatusEnum newStatus, LocationChangeType changeType, int? taskNum = null); |
| | | /// <summary> |
| | | /// è´§ä½åå¨è®°å½æ·»å (å¤ä¸ª) |
| | | /// </summary> |
| | | void AddLocationStatusChangeRecord(List<Dt_LocationInfo> locationInfos, LocationStatusEnum lastStatus, LocationStatusEnum newStatus, LocationChangeType changeType, List<int>? taskNums = null); |
| | | /// <summary> |
| | | /// è·åæå®è´§ä½åå¨è®°å½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent GetLocationState(int id); |
| | | } |
| | | } |
| | |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | WebResponseContent ReceiveWMSTask([NotNull] WMSTaskDTO taskDTO); |
| | | /// <summary> |
| | | /// æç§å¢åå§å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent InitLight(); |
| | | /// <summary> |
| | | /// æç§å¢ç»æä½ä¸ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent EndLight(); |
| | | /// <summary> |
| | | /// æç§å¢äº®ç¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent SendLight(TaskSendLight taskSendLight); |
| | | /// <summary> |
| | | /// 容å¨å
¥åºåå»ºä»»å¡ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent ContainerFlow(ContainerFlowDTO containerFlowDTO,string deviceCode); |
| | | WebResponseContent ContainerFlow(ContainerFlowDTO containerFlowDTO,string deviceCode,string stationCode); |
| | | /// <summary> |
| | | /// ç³è¯·å
¥åº |
| | | /// </summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.DB.Models; |
| | | |
| | | namespace WIDESEAWCS_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æåå¨è®°å½ |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_LocationStatusChangeRecord), "è´§ä½ç¶æåå¨è®°å½")] |
| | | public class Dt_LocationStatusChangeRecord : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è´§ä½ä¸»é®")] |
| | | public int LocationId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 30, ColumnDescription = "è´§ä½ç¼å·")] |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨åè´§ä½ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åå¨åè´§ä½ç¶æ")] |
| | | public int BeforeStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨åè´§ä½ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åå¨åè´§ä½ç¶æ")] |
| | | public int AfterStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨ç±»åï¼åºåºãå
¥åºãæå¨è°æ´...ï¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åå¨ç±»åï¼åºåºãå
¥åºï¼")] |
| | | public int ChangeType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡å·")] |
| | | public int? TaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | |
| | | if (stationManger.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) |
| | | { |
| | | commonConveyorLine.Communicator.Write("21", (short)256); |
| | | commonConveyorLine.Communicator.Write("21", new byte[] { 1, 0 }); |
| | | } |
| | | else |
| | | { |
| | | commonConveyorLine.Communicator.Write("23", (short)256); |
| | | commonConveyorLine.Communicator.Write("23", new byte[] { 1, 0 }); |
| | | } |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | if (ex.Message.Contains("æ°æ®åå
¥ï¼å°åï¼ã23ãï¼åå
¥çæ°æ®ï¼ã256ã") || ex.Message.Contains("æ°æ®åå
¥ï¼å°åï¼ã21ãï¼åå
¥çæ°æ®ï¼ã256ã")) |
| | | { |
| | | content.OK(); |
| | | } |
| | | else |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | } |
| | | return content; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æåå¨è®°å½ |
| | | /// </summary> |
| | | [Route("api/LocationStatusChangeRecord")] |
| | | [ApiController] |
| | | public class LocationStatusChangeRecordController : ApiBaseController<ILocationStatusChangeRecordService, Dt_LocationStatusChangeRecord> |
| | | { |
| | | public LocationStatusChangeRecordController(ILocationStatusChangeRecordService service) : base(service) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// è·åæå®è´§ä½åå¨è®°å½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet,Route("GetLocationState")] |
| | | public WebResponseContent GetLocationState(int id) |
| | | { |
| | | return Service.GetLocationState(id); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.RollbackTaskStatusToLast(taskNum); |
| | | } |
| | | private static object lock_containerFlow = new object(); |
| | | /// <summary> |
| | | /// 容卿µå¨æ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("ContainerFlow"), AllowAnonymous] |
| | | public WebResponseContent ContainerFlow([FromBody] ContainerFlowDTO containerFlowDTO) |
| | | { |
| | | lock (lock_containerFlow) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | if (containerFlowDTO.ContainerCode != PickBarCode) throw new Exception($"ä¼ å
¥æç®±ç {containerFlowDTO.ContainerCode}ï¼è¾éæç®±ç {PickBarCode}æ°æ®é误"); |
| | | if (containerFlowDTO.Direction == "100") |
| | | { |
| | | WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode); |
| | | WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode, stationManger.PickStationCode); |
| | | if (!responseContent.Status) throw new Exception(responseContent.Message); |
| | | } |
| | | commonConveyorLine.Communicator.Write("22", (short)(containerFlowDTO.Direction == "100" ? 256 : 512)); |
| | | commonConveyorLine.Communicator.Write("22", (containerFlowDTO.Direction == "100" ? new byte[] { 1, 0 } : new byte[] { 2, 0 })); |
| | | } |
| | | else |
| | | { |
| | |
| | | if (containerFlowDTO.ContainerCode != PickBarCode) throw new Exception($"ä¼ å
¥æç®±ç {containerFlowDTO.ContainerCode}ï¼è¾éæç®±ç {PickBarCode}æ°æ®é误"); |
| | | if (containerFlowDTO.Direction == "100") |
| | | { |
| | | WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode); |
| | | WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode, stationManger.PickStationCode); |
| | | if (!responseContent.Status) throw new Exception(responseContent.Message); |
| | | } |
| | | commonConveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)containerFlowDTO.Direction.ObjToInt(), stationManger.StationCode); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æç§å¢åå§å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("InitLight"), AllowAnonymous] |
| | | public WebResponseContent InitLight() |
| | | { |
| | | return Service.InitLight(); |
| | | } |
| | | /// <summary> |
| | | /// æç§å¢ç»æä½ä¸ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("EndLight"), AllowAnonymous] |
| | | public WebResponseContent EndLight() |
| | | { |
| | | return Service.EndLight(); |
| | | } |
| | | /// <summary> |
| | | /// æç§å¢äº®ç¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("SendLight"), AllowAnonymous] |
| | | public WebResponseContent SendLight([FromBody] TaskSendLight taskSendLight) |
| | | { |
| | | return Service.SendLight(taskSendLight); |
| | | } |
| | | /// <summary> |
| | | /// ç³è¯·å
¥åº |
| | | /// </summary> |
| | |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080" |
| | | }, |
| | | "WMSApiAddress": "http://127.0.0.1:9293", //"http://127.0.0.1:9283",æ£å¼ç¯å¢å°å |
| | | "LogDeubgEnable": true, //æ¯å¦è®°å½è°è¯æ¥å¿ |
| | | "PrintSql": false, //æå°SQLè¯å¥ |
| | | "LogAOPEnable": false, //æ¯å¦è®°å½AOPæ¥å¿ |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 300, |
| | | "QuartzJobAutoStart": true, |
| | |
| | | using System.Linq; |
| | | using System.Net.Http.Headers; |
| | | using System.Security.Policy; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.Agv; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.APIEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | |
| | | private readonly IApiInfoRepository _apiInfoRepository; |
| | | private readonly ILocationInfoRepository _locationInfoRepository; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly ILocationStatusChangeRecordService _locationStatusChangeRecordService; |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | | { |
| | |
| | | |
| | | public List<int> TaskRelocationTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 900 && x < 1000).ToList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IApiInfoRepository apiInfoRepository,ILocationInfoRepository locationInfoRepository,IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IApiInfoRepository apiInfoRepository,ILocationInfoRepository locationInfoRepository,IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService,ILocationStatusChangeRecordService locationStatusChangeRecordService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _cacheService = cacheService; |
| | |
| | | _locationInfoRepository = locationInfoRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _locationInfoService = locationInfoService; |
| | | _locationStatusChangeRecordService=locationStatusChangeRecordService; |
| | | } |
| | | static object lock_taskReceive = new object(); |
| | | /// <summary> |
| | |
| | | BaseDal.AddData(tasks); |
| | | _locationInfoRepository.UpdateData(locationInfos); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(tasks.Select(x => x.TaskNum).ToList(), "æ¥æ¶WMSä»»å¡"); |
| | | |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfos, LocationStatusEnum.InStock, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, tasks.Select(x => x.TaskNum).ToList()); |
| | | content = tasks.Count > 0 ? content.OK("æå!"+(errorMsg.IsNullOrEmpty()? "": errorMsg)) : content.Error("失败"); |
| | | } |
| | | } |
| | |
| | | } |
| | | return content; |
| | | } |
| | | static object lock_containerFlow = new object(); |
| | | |
| | | /// <summary> |
| | | /// 容å¨å
¥åºåå»ºä»»å¡ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent ContainerFlow(ContainerFlowDTO containerFlowDTO, string deviceCode) |
| | | public WebResponseContent ContainerFlow(ContainerFlowDTO containerFlowDTO, string deviceCode, string stationCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | lock (lock_containerFlow) |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = _locationInfoRepository.QueryData(); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x=>x.PalletCode== containerFlowDTO.ContainerCode); |
| | | if (locationInfo != null) throw new Exception($"åºä½æç®±å·{containerFlowDTO.ContainerCode}å·²åå¨"); |
| | | if (BaseDal.QueryFirst(x=>x.PalletCode==containerFlowDTO.ContainerCode)!=null) throw new Exception($"æç®±å·{containerFlowDTO.ContainerCode}ä»»å¡å·²åå¨"); |
| | | if (BaseDal.QueryFirst(x => x.PalletCode == containerFlowDTO.ContainerCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.CL_Executing.ObjToInt() && x.DeviceCode== deviceCode) != null) |
| | | { |
| | | return content.OK(); |
| | | } |
| | | else if(BaseDal.QueryFirst(x => x.PalletCode == containerFlowDTO.ContainerCode) != null) |
| | | { |
| | | throw new Exception($"æç®±å·{containerFlowDTO.ContainerCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_LocationInfo? noInLocation = locationInfos.FirstOrDefault(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()); |
| | | if (noInLocation == null) throw new Exception($"å¯ç¨è´§ä½ä¸è¶³!"); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && x.StationDeviceCode == deviceCode); |
| | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(new List<int>() { task.TaskNum }, "å建å
¥åºä»»å¡"); |
| | | content.OK("æå"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error($"é误信æ¯:{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æç§å¢åå§å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent InitLight() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | EPLightContent lightContent = INITIALIZATION(); |
| | | if (lightContent.Result != "0") throw new Exception($"{lightContent.Msg}"); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// ç»æä½ä¸ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent EndLight() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | EPLightContent lightContent = ENDWORK(); |
| | | if (lightContent.Result != "0") throw new Exception($"{lightContent.Msg}"); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æç§å¢äº®ç¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent SendLight(TaskSendLight taskSendLight) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | EPLightContent pLightContent = new EPLightContent(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | _locationInfoRepository.UpdateData(locationInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(new List<int>() { task.TaskNum }, $"åé
è´§ä½{locationInfo.LocationCode}"); |
| | | |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, LocationStatusEnum.Free, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation, task.TaskNum); |
| | | content.OK("æå"); |
| | | } |
| | | } |
| | |
| | | _locationInfoRepository.UpdateData(locationInfo); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, LocationStatusEnum.Lock, LocationStatusEnum.Free, LocationChangeType.OutboundCompleted, task.TaskNum); |
| | | } |
| | | else if(task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//å
¥åºä»»å¡å®æé»è¾ |
| | | { |
| | |
| | | _locationInfoRepository.UpdateData(locationInfo); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, LocationStatusEnum.Lock, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted, task.TaskNum); |
| | | } |
| | | content.OK("ä»»å¡å®æ"); |
| | | } |
| | |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterExtension _routerExtension; |
| | | |
| | | private static string BarCode1 = ""; |
| | | private static string BarCode2 = ""; |
| | | public ConveyorLineJob1(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | | _cacheService = cacheService; |
| | |
| | | //䏿¥WMSæç®±å°è¾¾ |
| | | if (pickBarCode.IsNotEmptyOrNull()) |
| | | { |
| | | if (device.DeviceCode == "CL1" && BarCode1!= pickBarCode) |
| | | { |
| | | WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode); |
| | | if (content.Status) |
| | | { |
| | |
| | | else |
| | | { |
| | | WriteError(device.DeviceCode, $"{station.PickStationCode}æ£éç³è¯·ä¸æ¥WMSé误{pickBarCode}ï¼ä¿¡æ¯{content.Message}"); |
| | | } |
| | | BarCode1 = pickBarCode; |
| | | } |
| | | if (device.DeviceCode == "CL2" && BarCode1 != pickBarCode) |
| | | { |
| | | WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode); |
| | | if (content.Status) |
| | | { |
| | | WriteInfo(device.DeviceCode, $"{station.PickStationCode}æ£éç³è¯·ä¸æ¥æå{pickBarCode}"); |
| | | } |
| | | else |
| | | { |
| | | WriteError(device.DeviceCode, $"{station.PickStationCode}æ£éç³è¯·ä¸æ¥WMSé误{pickBarCode}ï¼ä¿¡æ¯{content.Message}"); |
| | | } |
| | | BarCode2 = pickBarCode; |
| | | } |
| | | } |
| | | else |
| | |
| | | if (InTake==256 && InBarCode.IsNotEmptyOrNull()) |
| | | { |
| | | //ç³è¯·å
¥åºä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState != TaskStatusEnum.CL_Executing.ObjToInt()); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState != TaskStatusEnum.CL_Executing.ObjToInt() && x.DeviceCode==device.DeviceCode); |
| | | if (task != null) continue; |
| | | |
| | | WebResponseContent content = _taskService.RequestInTask(station.StationCode, InBarCode); |
| | |
| | | /// <summary> |
| | | /// å¿è·³åå
¥ |
| | | /// </summary> |
| | | WriteHeart |
| | | WriteHeart, |
| | | /// <summary> |
| | | /// æé®ç³è¯·(读) |
| | | /// </summary> |
| | | R_DownRequest, |
| | | } |
| | | } |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | |
| | | WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}æ£éç³è¯·ä¸º{PickRequest}æ¡ç 为空å¼"); |
| | | } |
| | | } |
| | | //æé®ç³è¯· |
| | | bool DownRequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.R_DownRequest, station.StationCode); |
| | | if (DownRequest) |
| | | { |
| | | string PickBarCode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, station.StationCode).Trim(); |
| | | //䏿¥WMSæç®±å°è¾¾ |
| | | if (PickBarCode.IsNotEmptyOrNull()) |
| | | { |
| | | ContainerFlowDTO containerFlowDTO = new ContainerFlowDTO() |
| | | { |
| | | SlotCode = station.PickStationCode, |
| | | ContainerCode = PickBarCode, |
| | | Direction="100" |
| | | }; |
| | | WebResponseContent responseContent = _taskService.ContainerFlow(containerFlowDTO, station.StationDeviceCode, station.PickStationCode); |
| | | if (responseContent.Status) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)containerFlowDTO.Direction.ObjToInt(), station.StationCode); |
| | | } |
| | | else |
| | | { |
| | | WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}æé®ç³è¯·é误{PickBarCode}ï¼ä¿¡æ¯{responseContent.Message}"); |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}æé®ç³è¯·ä¸º{DownRequest}æ¡ç 为空å¼"); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | else |