| | |
| | | Dt_Task QueryStackerCraneInTask(string deviceNo, string currentAddress = ""); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·å建æ¶é´æåºæ¥è¯¢ä»»å¡æ± ç§»åºä»»å¡ |
| | | /// </summary> |
| | | Dt_Task QueryStackerCraneRelocationTask(string deviceNo); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæç
§ä¼å
级以åå建æ¶é´æåºæ¥è¯¢ä»»å¡æ± åºåºç±»åçæ°å¢çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 100 && x < 500).ToList(); |
| | | |
| | | public List<int> TaskRelocationTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 900 && x < 100).ToList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IApiInfoRepository apiInfoRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | |
| | | continue; |
| | | } |
| | | Dt_Task task = _mapper.Map<Dt_Task>(item); |
| | | if (task.TaskType == TaskTypeEnum.Relocation.ObjToInt()) |
| | | { |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | task.CurrentAddress = item.SourceAddress; |
| | | task.NextAddress = item.TargetAddress; |
| | | task.DeviceCode = task.Roadway; |
| | | task.TaskType = TaskTypeEnum.Relocation.ObjToInt(); |
| | | task.Creater = "WMS"; |
| | | tasks.Add(task); |
| | | continue; |
| | | } |
| | | task.Creater = "WMS"; |
| | | task.TaskState = (int)TaskStatusEnum.New; |
| | | task.CurrentAddress = item.SourceAddress; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·å建æ¶é´æåºæ¥è¯¢ä»»å¡æ± ç§»åºä»»å¡ |
| | | /// </summary> |
| | | public Dt_Task QueryStackerCraneRelocationTask(string deviceNo) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskRelocationTypes.Contains(x.TaskType) && x.TaskState == (int)TaskStatusEnum.SC_Execute, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è®¾å¤ç¼å·ãå½åå°åæç
§ä¼å
级以åå建æ¶é´æåºæ¥è¯¢ä»»å¡æ± åºåºç±»åçæ°å¢çä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneRelocationTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | return task; |
| | | } |
| | | |
| | |
| | | #endregion |
| | | #region åºåºæ¨éä»»å¡1线 |
| | | { |
| | | var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var downTasksOut1 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5236").ToList(); |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5236"); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | |
| | | { |
| | | _taskService.UpdateData(newTasksOut1); |
| | | } |
| | | WriteInfo("5236", $"1线5236æ ä»»å¡ï¼ç¶æ{stationCurrentStatus}å¯ä¸åï¼ä¸åä»»å¡ï¼{newTasksOut1.Select(x => x.TaskNum)}"); |
| | | } |
| | | } |
| | | |
| | |
| | | #endregion |
| | | #region åºåºæ¨éä»»å¡2线 |
| | | { |
| | | var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var downTasksOut2 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").ToList(); |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5243"); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | |
| | | { |
| | | _taskService.UpdateData(newTasksOut2); |
| | | } |
| | | WriteInfo("5243", $"2线5243æ ä»»å¡ï¼ç¶æ{stationCurrentStatus}å¯ä¸åï¼ä¸åä»»å¡ï¼{newTasksOut2.Select(x => x.TaskNum)}"); |
| | | } |
| | | //else |
| | | //{ |
| | |
| | | #endregion |
| | | #region åºåºæ¨éä»»å¡3线 |
| | | { |
| | | var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); |
| | | var downTasksOut3 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").ToList(); |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5250"); |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | |
| | | { |
| | | _taskService.UpdateData(newTasksOut3); |
| | | } |
| | | WriteInfo("5250", $"3线5250æ ä»»å¡ï¼ç¶æ{stationCurrentStatus}å¯ä¸åï¼ä¸åä»»å¡ï¼{newTasksOut3.Select(x => x.TaskNum)}"); |
| | | } |
| | | //else |
| | | //{ |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | if (task==null) |
| | | { |
| | | task = _taskService.QueryStackerCraneRelocationTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | return task; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneRelocationTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | return task; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneRelocationTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | return task; |
| | | } |
| | | |
| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "æå¨ç§»åº", |
| | | icon: '', |
| | | class: '', |
| | | value: 'Relocation', |
| | | type: 'success', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | export default buttons |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="600px" |
| | | :padding="15" |
| | | title="æå°" |
| | | > |
| | | <div> |
| | | <el-form> |
| | | <el-form-item required label="è¯·éæ©ä»åºï¼"> |
| | | <el-select |
| | | v-model="warehouseId" |
| | | filterable |
| | | placeholder="è¯·éæ©" |
| | | @change="getPalletType" |
| | | > |
| | | <el-option |
| | | v-for="item in warehouses" |
| | | :key="item.key" |
| | | :label="item.value" |
| | | :value="item.key" |
| | | > |
| | | <span style="float: left">{{ item.value }}</span> |
| | | <span style="float: right; color: #8492a6; font-size: 13px">{{ |
| | | item.key |
| | | }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item required label="请è¾å
¥èµ·ç¹ï¼" |
| | | ><el-input |
| | | v-model="start" |
| | | style="width: 180px" |
| | | label="请è¾å
¥èµ·ç¹" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item required label="请è¾å
¥ç»ç¹ï¼" |
| | | ><el-input |
| | | v-model="end" |
| | | style="width: 180px" |
| | | label="请è¾å
¥ç»ç¹" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | required |
| | | label="è¯·éæ©å··éï¼" |
| | | v-show="warehouseId != ''" |
| | | > |
| | | <el-radio-group v-model="palletType"> |
| | | <el-radio |
| | | v-for="item in palletTypes" |
| | | :key="item.key" |
| | | :label="item" |
| | | >{{ item.value }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <el-button type="primary" size="small" @click="submit">确认</el-button> |
| | | <el-button type="danger" size="small" @click="close">å
³é</el-button> |
| | | </template> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | warehouses: [], |
| | | warehouseId: "", |
| | | palletType: "", |
| | | palletTypes: [], |
| | | start:"", |
| | | end:"", |
| | | }; |
| | | }, |
| | | methods: { |
| | | open() { |
| | | if (this.warehouses.length == 0) { |
| | | this.getWarehouseInfos(); |
| | | } |
| | | if (this.warehouses.length == 1) { |
| | | this.warehouseId = this.warehouses[0].key; |
| | | this.getPalletType(); |
| | | } |
| | | this.showDetialBox = true; |
| | | }, |
| | | getWarehouseInfos() { |
| | | this.http |
| | | .post("api/Warehouse/GetWarehouseDicByUser", null, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.warehouses = x.data; |
| | | if (this.warehouses.length == 1) { |
| | | this.warehouseId = this.warehouses[0].key; |
| | | } |
| | | }); |
| | | }, |
| | | getPalletType() { |
| | | this.http |
| | | .post("api/LocationInfo/GetLocationRoadway", null, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | console.log(x.data) |
| | | //this.palletTypesçéx.dataä¸warehouseIdçäºthis.warehouseIdç项 |
| | | console.log(this.warehouseId) |
| | | this.palletTypes = x.data.filter(item => item.key == this.warehouseId); |
| | | |
| | | }); |
| | | |
| | | }, |
| | | close() { |
| | | this.showDetialBox = false; |
| | | if (this.warehouses.length > 1) { |
| | | this.warehouseId = ""; |
| | | } |
| | | this.palletType = ""; |
| | | }, |
| | | submit() { |
| | | if (this.warehouseId == "") return this.$message.error("è¯·éæ©ä»åº"); |
| | | if (this.palletType == "") return this.$message.error("è¯·éæ©å··é"); |
| | | if (this.start == "") return this.$message.error("请è¾å
¥èµ·ç¹"); |
| | | if (this.end == "") return this.$message.error("请è¾å
¥ç»ç¹"); |
| | | var request = { |
| | | "warehouseId": this.warehouseId, |
| | | "locationStart": this.start, |
| | | "locationEnd": this.end, |
| | | "locationRoadway": this.palletType.key |
| | | } |
| | | this.http |
| | | .post( |
| | | `api/Task/ManualRelocation`, |
| | | request, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.$parent.refresh(); |
| | | this.close(); |
| | | }); |
| | | }, |
| | | }, |
| | | 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; |
| | | } |
| | | |
| | | canvas { |
| | | display: block; |
| | | margin: auto; |
| | | } |
| | | </style> |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | import gridHeader from './extend/relocationTask.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridHeader: gridHeader, |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | }); |
| | | } |
| | | } |
| | | let relocationBtn = this.buttons.find(x => x.value == 'Relocation'); |
| | | if (relocationBtn) { |
| | | relocationBtn.onClick = function () { |
| | | this.$refs.gridHeader.open(); |
| | | } |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | [ |
| | | { title: "ææææ¥è¯¢",field: "effectiveDate",type: "date"}, |
| | | {title: "ç©ææææ",field: "expirationlabel",type: "selectList",dataKey:"expirationlabelEnum",data:[]}, |
| | | { title: "åºé¾(å°äº)", field: "inventoryage",type: "string"}, |
| | | { title: "åºé¾(大äº)", field: "inventoryage1",type: "string"}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | if (beRelocation.Row <= maxDepth) |
| | | { |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth && x.Column!= beRelocation.Column && x.Layer!=beRelocation.Layer).ToList(); |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth).ToList(); |
| | | } |
| | | else if (beRelocation.Row > maxDepth) |
| | | { |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth && x.Column != beRelocation.Column && x.Layer != beRelocation.Layer).ToList(); |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth).ToList(); |
| | | } |
| | | } |
| | | |
| | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | //if (moreDepthFlag && littleDepthFlag) |
| | | //{ |
| | | // return emptyLocation; |
| | | //} |
| | | |
| | | //List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | //moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | //List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | //littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | break; |
| | | case 1: |
| | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | |
| | | //List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | //moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | //List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | //littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | |
| | | break; |
| | |
| | | { |
| | | throw new Exception($"æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | } |
| | | //æå¤§æ·±ä½å¼ |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | //int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; |
| | | //if (mathCurrentRow <= maxDepth) |
| | | //{ |
| | | // locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | // locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); |
| | | |
| | | //} |
| | | //ç§»åºä¸ºåä¾§ |
| | | if (beRelocation.Row <= maxDepth) |
| | | { |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth).ToList(); |
| | |
| | | if (beRelocation.Row <= maxDepth) |
| | | { |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth && x.Column != beRelocation.Column && x.Layer != beRelocation.Layer).ToList(); |
| | | locationInfos = locationInfos.Where(x => x.Row <= maxDepth).ToList(); |
| | | } |
| | | else if (beRelocation.Row > maxDepth) |
| | | { |
| | | //è¿æ»¤å½åç§»åºçåååå± |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth && x.Column != beRelocation.Column && x.Layer != beRelocation.Layer).ToList(); |
| | | locationInfos = locationInfos.Where(x => x.Row > maxDepth).ToList(); |
| | | } |
| | | } |
| | | |
| | |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | else |
| | | { |
| | | List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) ) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) ) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | if (moreDepthFlag && littleDepthFlag) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Basic |
| | | { |
| | | /// <summary> |
| | | /// æå¨ç§»åºå®ä½ |
| | | /// </summary> |
| | | public class RelocationDTO |
| | | { |
| | | /// <summary> |
| | | /// ç§»åºä»åºId |
| | | /// </summary> |
| | | public int warehouseId { get; set; } |
| | | /// <summary> |
| | | /// ç§»åºèµ·ç¹ |
| | | /// </summary> |
| | | public string locationStart { get; set; } |
| | | /// <summary> |
| | | /// ç§»åºç»ç¹ |
| | | /// </summary> |
| | | public string locationEnd { get; set; } |
| | | /// <summary> |
| | | /// ç§»åºå··éå· |
| | | /// </summary> |
| | | public string locationRoadway { get; set; } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Stock; |
| | |
| | | /// <param name="locationCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent IsRelocation(int taskNum, string locationCode); |
| | | /// <summary> |
| | | /// æå¨ç§»åº |
| | | /// </summary> |
| | | /// <param name="relocationDTO"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent ManualRelocation(RelocationDTO relocationDTO); |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | } |
| | | } |
| | | break; |
| | | case "inventoryage": |
| | | int inventoryage = param.Value.ObjToInt(); |
| | | if (inventoryage > 0) |
| | | { |
| | | DateTime dateTime = DateTime.Now.AddDays(-inventoryage); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= dateTime); |
| | | } |
| | | break; |
| | | case "inventoryage1": |
| | | int inventoryage1 = param.Value.ObjToInt(); |
| | | if (inventoryage1 > 0) |
| | | { |
| | | DateTime dateTime = DateTime.Now.AddDays(-inventoryage1); |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= dateTime); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | }); |
| | | //æ´æ°ä»»å¡ç¶æ |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | |
| | | _inboundOrderService.FeedbackInboundOrder(inboundOrder.Id); |
| | | } |
| | | } |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutQuality.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt()) |
| | |
| | | MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, stockInfo.Details.Where(x => x.MaterielCode == mesOutboundOrders.FirstOrDefault().MaterialCode).Sum(x => x.StockQuantity)); |
| | | UploadMesMaterialLotaAcept(model); |
| | | } |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | return content; |
| | | } |
| | | private static object emptyBack_inbound = new object(); |
| | | /// <summary> |
| | | /// 空æ¡ååº |
| | | /// </summary> |
| | | public WebResponseContent EmptyBackTask(string barCode, string startPoint) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | lock (emptyBack_inbound) |
| | | { |
| | | string palletCode = @"^C\d{5}$"; // æ£åè¡¨è¾¾å¼ |
| | | bool isValid = Regex.IsMatch(barCode, palletCode); |
| | | if (!isValid) |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | return content.Error($"æ¡ç æ ¼å¼é误{barCode}"); |
| | | string palletCode = @"^C\d{5}$"; // æ£åè¡¨è¾¾å¼ |
| | | bool isValid = Regex.IsMatch(barCode, palletCode); |
| | | if (!isValid) |
| | | { |
| | | return content.Error($"æ¡ç æ ¼å¼é误{barCode}"); |
| | | } |
| | | if (!OutStartPonits.Contains(startPoint)) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.Line_Execute.ObjToInt() || x.TaskStatus == TaskStatusEnum.Line_Executing.ObjToInt())); |
| | | //if (taskOldPoint != null) |
| | | //{ |
| | | // return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | //} |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"è¶æ¡{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | //if (_stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode) != null) |
| | | //{ |
| | | // return content.Error($"è¶æ¡{barCode}åºåä¿¡æ¯å·²åå¨"); |
| | | //} |
| | | //todo:临æ¶è§£ç» |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode && x.StockStatus == StockStatusEmun.åºåºå®æ.ObjToInt()); |
| | | if (_stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode) != null) |
| | | { |
| | | proStockInfo.PalletCode = proStockInfo.PalletCode + ":" + DateTime.Now.ToString("MM/dd"); |
| | | } |
| | | //è·åæåå¹³åº |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA101.ToString()); |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = "CL01_CP", |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.EmptyProductBack.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | PalletType = 1 |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | if (proStockInfo != null) |
| | | { |
| | | _stockRepository.ProStockInfoRepository.UpdateData(proStockInfo); |
| | | } |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | content.OK("åéæå"); |
| | | } |
| | | if (!OutStartPonits.Contains(startPoint)) |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | content.Error(ex.Message); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.Line_Execute.ObjToInt() || x.TaskStatus == TaskStatusEnum.Line_Executing.ObjToInt())); |
| | | //if (taskOldPoint != null) |
| | | //{ |
| | | // return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | //} |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"è¶æ¡{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | //if (_stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode) != null) |
| | | //{ |
| | | // return content.Error($"è¶æ¡{barCode}åºåä¿¡æ¯å·²åå¨"); |
| | | //} |
| | | //todo:临æ¶è§£ç» |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (_stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode) != null) |
| | | { |
| | | proStockInfo.PalletCode = proStockInfo.PalletCode + ":" + DateTime.Now.ToString("MM/dd"); |
| | | } |
| | | //è·åæåå¹³åº |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA101.ToString()); |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = "CL01_CP", |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.EmptyProductBack.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | PalletType = 1 |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | if (proStockInfo!=null) |
| | | { |
| | | _stockRepository.ProStockInfoRepository.UpdateData(proStockInfo); |
| | | } |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | content.OK("åéæå"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æå¨ç§»åº |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent ManualRelocation(RelocationDTO relocationDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == relocationDTO.warehouseId); |
| | | if (warehouse == null) |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºç{relocationDTO.warehouseId}ä»åºä¿¡æ¯"); |
| | | } |
| | | Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == relocationDTO.locationStart && x.WarehouseId== warehouse.WarehouseId && x.RoadwayNo == relocationDTO.locationRoadway && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()); |
| | | Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == relocationDTO.locationEnd && x.WarehouseId == warehouse.WarehouseId && x.RoadwayNo== relocationDTO.locationRoadway && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus==EnableStatusEnum.Normal.ObjToInt()); |
| | | if (locationInfoStart == null || locationInfoEnd==null) |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºçè´§ä½ä¿¡æ¯æèµ·ç¹åç»ç¹è´§ä½æ¡ä»¶ä¸æ»¡è¶³"); |
| | | } |
| | | if (locationInfoStart.Column!= locationInfoEnd.Column || locationInfoStart.Layer != locationInfoEnd.Layer || locationInfoStart.Depth>= locationInfoEnd.Depth) |
| | | { |
| | | return content.Error($"èµ·ç¹åç»ç¹ç§»åºè´§ä½éè¦æ»¡è¶³åååå±ç»ç¹è´§ä½æ·±ä½éè¦å¤§äºèµ·ç¹è´§ä½"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == locationInfoStart.LocationCode); |
| | | if (stockInfo == null) |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºè´§ä½çåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_Task taskTemp = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | if (taskTemp != null) |
| | | { |
| | | return content.Error($"æç{stockInfo.PalletCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | Roadway = locationInfoStart.RoadwayNo, |
| | | WarehouseId = locationInfoStart.WarehouseId, |
| | | CurrentAddress = locationInfoStart.LocationCode, |
| | | Grade = 99, |
| | | NextAddress = locationInfoEnd.LocationCode, |
| | | OrderNo = "", |
| | | PalletCode = stockInfo.PalletCode, |
| | | PalletType = stockInfo.PalletType, |
| | | SourceAddress = locationInfoStart.LocationCode, |
| | | TargetAddress = locationInfoEnd.LocationCode, |
| | | TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = TaskStatusEnum.SC_Execute.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Relocation.ObjToInt() |
| | | }; |
| | | |
| | | if (stockInfo.StockLength > 0) |
| | | { |
| | | newTask.TaskLength = stockInfo.StockLength; |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | Repository.AddData(newTask); |
| | | LocationStatusEnum lastStatusEnd = (LocationStatusEnum)locationInfoEnd.LocationStatus; |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, newTask.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoEnd, lastStatusEnd, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum); |
| | | |
| | | LocationStatusEnum lastStatusStart = (LocationStatusEnum)locationInfoStart.LocationStatus; |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, newTask.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoStart, lastStatusStart, LocationStatusEnum.Lock, LocationChangeType.RelocationAssignLocation, taskNum: newTask.TaskNum); |
| | | stockInfo.StockStatus = StockStatusEmun.ç§»åºéå®.ObjToInt(); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | return content.OK(data: _mapper.Map<WMSTaskDTO>(newTask)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent RelocationTaskCompleted(Dt_Task task) |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(task.TaskNum); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | FeedBackWCSTaskCompleted(task.TaskNum); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | return WebResponseContent.Instance.Error(e.Message); |
| | | } |
| | | } |
| | | [HttpPost, Route("GetLocationRoadway"), AllowAnonymous] |
| | | public WebResponseContent GetLocationRoadway() |
| | | { |
| | | try |
| | | { |
| | | List<DictionaryDTO> dictionaryDTOs = Service.Repository.QueryData().GroupBy(x => new { x.RoadwayNo, x.WarehouseId }).Select(x => new DictionaryDTO { Key = x.Key.WarehouseId, Value = x.Key.RoadwayNo }).ToList() ; |
| | | return WebResponseContent.Instance.OK(data: dictionaryDTOs); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return WebResponseContent.Instance.Error(e.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_ITaskInfoService; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æå¨ç§»åº |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("ManualRelocation"), AllowAnonymous] |
| | | public WebResponseContent ManualRelocation([FromBody] RelocationDTO relocationDTO) |
| | | { |
| | | return Service.ManualRelocation(relocationDTO); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |