| | |
| | | } |
| | | else |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == item.StationCode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.RGV_Finish.ObjToInt()); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == item.StationCode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.RGV_Finish.ObjToInt() && x.TaskNum == conveyorLineInfoRead.TaskNo); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.Roadway, sourceAddress: item.StackerCraneStationCode); |
| | |
| | | |
| | | if (!conveyorLineSignalRead3.STB && !conveyorLineSignalRead3.ACK && conveyorLineStatus3.Online && conveyorLineStatus3.Free && !conveyorLineStatus3.Goods && !conveyorLineStatus3.Alarm && !STB && !ACK)//夿åºåºå£æ¯å¦ç©ºé² |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.DeviceCode == device.DeviceCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); |
| | | if (task != null) |
| | | Dt_Task outTask = _taskRepository.QueryFirst(x => x.TaskType >= TaskTypeEnum.Outbound.ObjToInt() && x.TaskType <= TaskTypeEnum.Inbound.ObjToInt() && (x.TaskState == TaskStatusEnum.RGV_Executing.ObjToInt()|| x.TaskState == TaskStatusEnum.RGV_Execute.ObjToInt())); |
| | | if (outTask == null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.RGV_Execute, sourceAddress: item.StationCode, targetAddress: routers.NextPosi, nextAddress: routers.NextPosi); |
| | | Thread.Sleep(100); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.DeviceCode == device.DeviceCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.RGV_Execute, sourceAddress: item.StationCode, targetAddress: routers.NextPosi, nextAddress: routers.NextPosi); |
| | | Thread.Sleep(100); |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | } |
| | | WriteDebug("æ¿æè¾éåºåºå£", $"åºåºè¾é线ACKä¿¡å·{item.StationCode}å·²åå
¥ï¼ä»»å¡å·{task.TaskNum}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | |
| | | } |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | Thread.Sleep(100); |
| | | } |
| | | } |
| | | |
| | | } |
| | | WriteDebug("RGVç¶æè¯»åæ¥å¿", $"èæºï¼:{device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Online)}ï¼ç©ºé²ï¼{device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Free)}ï¼æ è´§ï¼{!device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Goods)}ï¼ä»»å¡å·ä¸º0ï¼{device.GetValue<R_ConveyorLineDB, int>(R_ConveyorLineDB.TaskNum) == 0}ï¼æ æ
é{!device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Alarm)}"); |
| | | if (device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Online) && device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Free) && !device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Goods) && device.GetValue<R_ConveyorLineDB, int>(R_ConveyorLineDB.TaskNum) == 0 && !device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Alarm)) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskType >= TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.RGV_NEW.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | //åå
¥RGVä»»å¡ |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.SourceAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskType, 2, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.RGV_Executing); |
| | | //åå
¥RGVå
¥åºä»»å¡ |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.SourceAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskType, 2, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.RGV_Executing); |
| | | } |
| | | WriteDebug(device.DeviceName, $"å
¥åºRGVä»»å¡å·{task.TaskNum}å·²åå
¥"); |
| | | } |
| | | Dt_Task task1 = _taskRepository.QueryFirst(x => x.TaskType >= TaskTypeEnum.Outbound.ObjToInt()&& x.TaskType <= TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.RGV_Execute.ObjToInt()); |
| | | if (task1 != null) |
| | | else |
| | | { |
| | | //åå
¥RGVä»»å¡ |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, task1.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task1.SourceAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskType, 2, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task1.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | |
| | | _taskService.UpdateTask(task1, TaskStatusEnum.RGV_Executing); |
| | | WriteDebug(device.DeviceName, $"åºåºRGVä»»å¡å·{task1.TaskNum}å·²åå
¥"); |
| | | Dt_Task task1 = _taskRepository.QueryFirst(x => x.TaskType >= TaskTypeEnum.Outbound.ObjToInt() && x.TaskType <= TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.RGV_Execute.ObjToInt()); |
| | | //åå
¥RGVåºåºä»»å¡ |
| | | if (task1 != null) |
| | | { |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, task1.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task1.SourceAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskType, 2, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task1.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | _taskService.UpdateTask(task1, TaskStatusEnum.RGV_Executing); |
| | | WriteDebug(device.DeviceName, $"åºåºRGVä»»å¡å·{task1.TaskNum}å·²åå
¥"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | if (device.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.ACK)) |
| | |
| | | this.modelOpenProcess(row); |
| | | }, |
| | | setContinueAdd(isAdd) { |
| | | console.log(this.boxButtons) |
| | | if (!this.continueAdd) return; |
| | | var _button = this.boxButtons.find((x) => { |
| | | return x.value == 'save'; |
| | |
| | | <template> |
| | | <div class="title"></div> |
| | | <div class="container"> |
| | | <div class="header"> |
| | | <h2 class="title">è´§ä½æå¾</h2> |
| | | </div> |
| | | |
| | | <div class="content-wrapper"> |
| | | <!-- æ§å¶é¢æ¿åºå --> |
| | | <div class="control-panel"> |
| | | <div class="form-group"> |
| | | <label>åºåï¼</label> |
| | | <el-select |
| | | size="mini" |
| | | filterable |
| | | v-model="Area.shelf_code" |
| | | placeholder="è¯·éæ©" |
| | | class="full-width" |
| | | > |
| | | <el-option |
| | | v-for="item in slectData" |
| | | :value="item.shelf_code" |
| | | :label="item.house_name" |
| | | :key="item.house_name" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label>æï¼</label> |
| | | <el-select |
| | | size="mini" |
| | | clearable |
| | | filterable |
| | | @change="SCChange" |
| | | v-model="Area.tunnel" |
| | | placeholder="è¯·éæ©" |
| | | class="full-width" |
| | | > |
| | | <el-option |
| | | v-for="item in scList" |
| | | :value="item" |
| | | :label="item" |
| | | :key="item" |
| | | ></el-option> |
| | | </el-select> |
| | | </div> |
| | | |
| | | <el-button type="success" class="refresh-btn" @click="GetViewData"> |
| | | å·æ° |
| | | </el-button> |
| | | |
| | | <div class="legend-section"> |
| | | <h4>说æ</h4> |
| | | <div class="legend-grid"> |
| | | <div |
| | | class="legend-item" |
| | | v-for="item in infoMsg" |
| | | :key="item.bgcolor" |
| | | > |
| | | <span |
| | | class="color-box" |
| | | :style="{ 'background-color': item.bgcolor }" |
| | | ></span> |
| | | <span class="legend-label">{{ item.msg }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- è´§ä½å±ç¤ºåºå --> |
| | | <div class="location-view"> |
| | | <div |
| | | class="layer-container" |
| | | v-for="layer in locationData" |
| | | :key="layer.index" |
| | | > |
| | | <h3 class="layer-title">第{{ layer.index }}å±</h3> |
| | | <div class="row" v-for="row in layer.rows" :key="row.index"> |
| | | <div |
| | | class="location-cell" |
| | | :style="{ 'background-color': GetBgColor(col) }" |
| | | v-for="col in row.cols" |
| | | :key="col.index" |
| | | @mouseenter="showTooltip(col, $event)" |
| | | @mouseleave="hideTooltip" |
| | | > |
| | | {{ row.index }}-{{ col.index }}-{{ layer.index }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- æ¬æµ®æç¤ºæ¡ --> |
| | | <div |
| | | v-if="showTooltipFlag" |
| | | class="location-tooltip" |
| | | :style="{ |
| | | left: tooltipPosition.x + 'px', |
| | | top: tooltipPosition.y + 'px', |
| | | }" |
| | | > |
| | | <div v-if="currentLocation"> |
| | | <p><strong>è´§ä½å·:</strong>{{ currentLocation.locationCode }}</p> |
| | | <p> |
| | | <strong>è´§ä½æåå±:</strong> {{ currentLocation.row }}æ{{ |
| | | currentLocation.index |
| | | }}å{{ currentLocation.layer }}å± |
| | | </p> |
| | | <p><strong>ç¶æ:</strong> {{ getStatusText(currentLocation) }}</p> |
| | | <p> |
| | | <strong>ç¦ç¨:</strong> |
| | | {{ currentLocation.location_lock == 3 ? "æ¯" : "å¦" }} |
| | | </p> |
| | | <!-- æ¢å¤ç©æä¿¡æ¯æ¾ç¤ºï¼éé
æè´§ç¶æ --> |
| | | <p v-if="currentLocation.location_state === 2"> |
| | | <strong>ç©æç¼ç :</strong> |
| | | {{ currentLocation.material_code || "æ " }} |
| | | </p> |
| | | <p v-if="currentLocation.location_state === 2"> |
| | | <strong>æ°é:</strong> {{ currentLocation.quantity || "æ " }} |
| | | </p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, reactive } from 'vue' |
| | | import { ElButton } from "element-plus"; |
| | | |
| | | export default { |
| | | setup() { |
| | | data() { |
| | | return { |
| | | slectData: [], |
| | | scList: [], |
| | | Area: { house_name: "", tunnel: "", shelf_code: "" }, |
| | | mian_height: "", |
| | | infoMsg: [ |
| | | { bgcolor: "lightgreen", msg: "空货ä½", state: 0 }, |
| | | { bgcolor: "orange", msg: "æè´§", state: 2 }, // å
³é®æ¹ï¼stateä»100â2 |
| | | { bgcolor: "#2BB3D5", msg: "éå®", state: "InAssigned" }, |
| | | { bgcolor: "#ccc", msg: "ç¦ç¨", state: 3 }, |
| | | { bgcolor: "#b7ba6b", msg: "å
¶å®", state: "else" }, |
| | | ], |
| | | locationData: [], |
| | | showTooltipFlag: false, |
| | | currentLocation: null, |
| | | tooltipPosition: { x: 0, y: 0 }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | GetBgColor() { |
| | | return (col) => { |
| | | var bgColor = "#b7ba6b"; |
| | | //ä¼å
æ¾ç¤ºç¦ç¨ç¶æ |
| | | if (col.location_lock == 3) { |
| | | this.infoMsg.forEach((el) => { |
| | | if (el.state == col.location_lock) { |
| | | bgColor = el.bgcolor; |
| | | } |
| | | }); |
| | | } else { |
| | | this.infoMsg.forEach((el) => { |
| | | // å
³é®æ¹ï¼å¹é
æè´§ç¶æï¼2ï¼ï¼èé100 |
| | | if (col.location_state === 2) { |
| | | bgColor = this.infoMsg.find(item => item.state === 2).bgcolor; |
| | | } |
| | | // éå®ç¶æï¼1/10/20/99ï¼é»è¾ä¿æä¸å |
| | | else if (col.location_state > 0 && col.location_state < 100) { |
| | | if (el.state == "InAssigned") { |
| | | bgColor = el.bgcolor; |
| | | } |
| | | } |
| | | // 空货ä½ï¼0ï¼é»è¾ä¿æä¸å |
| | | else if (el.state == col.location_state) { |
| | | bgColor = el.bgcolor; |
| | | } |
| | | }); |
| | | } |
| | | return bgColor; |
| | | }; |
| | | }, |
| | | }, |
| | | watch: { |
| | | //忢åºåº |
| | | "Area.shelf_code"(newValue, oldValue) { |
| | | this.scList = []; |
| | | this.slectData.forEach((e) => { |
| | | if (e.shelf_code == newValue) { |
| | | this.Area.tunnel = e.tunnel[0]; |
| | | this.scList = e.tunnel; |
| | | } |
| | | }); |
| | | this.GetViewData(); |
| | | }, |
| | | }, |
| | | methods: { |
| | | GetViewData() { |
| | | var _this = this; |
| | | this.http |
| | | .post("/api/LocationInfoRow/GetLocationStatu", _this.Area, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | _this.locationData = x; |
| | | console.log("å端è¿å:", x); |
| | | }); |
| | | }, |
| | | // 忢æ |
| | | SCChange() { |
| | | this.GetViewData(); |
| | | }, |
| | | showTooltip(location, event) { |
| | | this.currentLocation = location; |
| | | this.showTooltipFlag = true; |
| | | |
| | | } |
| | | } |
| | | } |
| | | // 设置æç¤ºæ¡ä½ç½®ï¼ç¨å¾®åç§»é¿å
鮿¡é¼ æ |
| | | this.tooltipPosition = { |
| | | x: event.clientX + 10, |
| | | y: event.clientY + 10, |
| | | }; |
| | | }, |
| | | |
| | | hideTooltip() { |
| | | this.showTooltipFlag = false; |
| | | this.currentLocation = null; |
| | | }, |
| | | |
| | | getStatusText(location) { |
| | | // å
³é®æ¹ï¼æç¡®å¹é
æè´§ç¶æï¼2ï¼ |
| | | if (location.location_state === 2) return "æè´§"; |
| | | if (location.location_state === 0) return "空货ä½"; |
| | | if (location.location_state === 1) return "éå®"; |
| | | if (location.location_state === 10) return "æè´§éå®"; |
| | | if (location.location_state === 20) return "空é²éå®"; |
| | | if (location.location_state === 99) return "大æçéå®"; |
| | | return "å
¶ä»"; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | var mainHeight = document.getElementById("vol-main"); |
| | | this.mian_height = mainHeight.offsetHeight - 40 + "px"; |
| | | var _this = this; |
| | | //å è½½ä¸æé项 |
| | | this.http.get("/api/LocationInfoRow/GetArea", {}, "æ¥è¯¢ä¸").then((x) => { |
| | | _this.slectData = x; |
| | | //å 载第ä¸ä¸ªåºåï¼ç¬¬ä¸æ |
| | | _this.Area.shelf_code = _this.slectData[0].shelf_code; |
| | | _this.scList = _this.slectData[0].tunnel; |
| | | }); |
| | | }, |
| | | components: { ElButton }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | line-height: 70vh; |
| | | /* æ ·å¼é¨åæ ä¿®æ¹ï¼ä¿æåé»è¾ */ |
| | | .container { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .header { |
| | | text-align: center; |
| | | font-size: 28px; |
| | | color: orange; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .title { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | margin: 0; |
| | | } |
| | | |
| | | .content-wrapper { |
| | | display: flex; |
| | | flex: 1; |
| | | min-height: 0; |
| | | } |
| | | |
| | | .control-panel { |
| | | width: 220px; |
| | | padding: 15px; |
| | | background-color: #f5f7fa; |
| | | border-radius: 4px; |
| | | margin-right: 15px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .form-group { |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .full-width { |
| | | width: 100%; |
| | | } |
| | | |
| | | .refresh-btn { |
| | | margin-top: 10px; |
| | | width: 100%; |
| | | } |
| | | |
| | | .legend-section { |
| | | margin-top: 30px; |
| | | } |
| | | |
| | | .legend-section h4 { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .legend-grid { |
| | | display: grid; |
| | | grid-template-columns: 1fr; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .legend-item { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .color-box { |
| | | display: inline-block; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-right: 8px; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .legend-label { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .location-view { |
| | | flex: 1; |
| | | overflow: auto; |
| | | padding: 10px; |
| | | background-color: white; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .layer-container { |
| | | margin-bottom: 25px; |
| | | } |
| | | |
| | | .layer-title { |
| | | margin: 0 0 10px 0; |
| | | font-size: 16px; |
| | | color: #333; |
| | | } |
| | | |
| | | .row { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 8px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .location-cell { |
| | | width: 66px; |
| | | height: 38px; |
| | | margin: 3px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | border-radius: 3px; |
| | | line-height: 38px; |
| | | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .location-tooltip { |
| | | position: fixed; |
| | | z-index: 9999; |
| | | background-color: white; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | padding: 10px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); |
| | | pointer-events: none; |
| | | max-width: 250px; |
| | | } |
| | | |
| | | .location-tooltip p { |
| | | margin: 5px 0; |
| | | font-size: 13px; |
| | | line-height: 1.4; |
| | | } |
| | | |
| | | .location-tooltip strong { |
| | | display: inline-block; |
| | | width: 70px; |
| | | color: #666; |
| | | } |
| | | </style> |
| | |
| | | }); |
| | | const editFormFields = ref({ |
| | | orderType: "", |
| | | orderNo:"", |
| | | orderNo: "", |
| | | upperOrderNo: "", |
| | | remark: "", |
| | | }); |
| | |
| | | field: "warehouseId", |
| | | title: "ä»åºID", |
| | | type: "select", |
| | | dataKey:"warehouses", |
| | | data:[] |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly:true |
| | | readonly: true, |
| | | }, |
| | | { |
| | | { |
| | | title: "åæ®ç¶æ", |
| | | field: "orderStatus", |
| | | type: "select", |
| | |
| | | title: "䏿¸¸åæ®ç¼å·", |
| | | field: "upperOrderNo", |
| | | type: "string", |
| | | readonly:true |
| | | readonly: true, |
| | | }, |
| | | |
| | | ], |
| | | [ |
| | | { |
| | |
| | | title: "夿³¨", |
| | | field: "remark", |
| | | type: "textarea", |
| | | }, |
| | | { |
| | | field: "inoutType", |
| | | title: "åºå
¥åºç±»å", |
| | | type: "select", |
| | | dataKey:"inoutTypeEnum", |
| | | data:[], |
| | | readonly:true |
| | | }, |
| | | { |
| | | field: "system", |
| | | title: "åæ®æ¥æº", |
| | | type: "string", |
| | | readonly:true |
| | | }, |
| | | ], |
| | | ]); |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind:{key:"warehouses",data:[]} |
| | | bind: { key: "warehouses", data: [] }, |
| | | }, |
| | | |
| | | |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | |
| | | field: "createType", |
| | | title: "å建æ¹å¼", |
| | | type: "string", |
| | | width: 90, |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "createType", data: [] }, |
| | | }, |
| | | { |
| | | field: "system", |
| | | title: "åæ®æ¥æº", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | readonly:true, |
| | | |
| | | readonly: true, |
| | | }, |
| | | { |
| | | field: "orderQuantity", |
| | |
| | | dataKey: "stockStatusEmun", |
| | | data: [], |
| | | }, |
| | | { title: "åºåç¼å·", |
| | | { title: "å
³èåºåç¼å·", |
| | | field: "id", |
| | | type: "like", |
| | | }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | [ |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | |
| | | ] |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | field: "palletCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | | width: 90, |
| | | width: 150, |
| | | align: "left", |
| | | //sort:true, |
| | | }, |
| | |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 200, |
| | | align: "left", |
| | | //sort:true, |
| | | }, |
| | |
| | | width: 150, |
| | | align: "left", |
| | | // sort:true, |
| | | hidden:true, |
| | | },{ |
| | | field: "remark", |
| | | title: "夿³¨", |
| | |
| | | { title: "ç©æç¼å·", field: "materielCode",type :"like"}, |
| | | { title: "ç©æåç§°", field: "materielName",type :"like"}, |
| | | { title: "åæ®ç¼å·", field: "orderNo",type :"like"}, |
| | | { title: "å
³èåºåç¼å·", field: "stockId",type :"int"}, |
| | | ], |
| | | [ |
| | | { title: "æ¹æ¬¡å·", field: "batchNo",type :"like"}, |
| | | {title: "åºåæç»ç¶æ",field: "status",type: "select",dataKey:"stockStatusEmun", data: []}, |
| | | { title: "ä¾åºåæ¹æ¬¡", field: "supplierBatch",type :"like"}, |
| | | { title: "åå»ºæ¥æ",field: "createDate",type: "datetime"}, |
| | | ], |
| | | ]); |
| | |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "ç©æè¯¦æ
", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "ç©ææ¹æ¬¡", |
| | | type: "string", |
| | |
| | | align: "left", |
| | | // sort:true, |
| | | }, |
| | | // { |
| | | // field: "serialNumber", |
| | | // title: "å
å·", |
| | | // type: "string", |
| | | // width: 50, |
| | | // align: "left", |
| | | // sort:true, |
| | | // }, |
| | | // { |
| | | // field: "batchNoName", |
| | | // title: "ç©ææ¹æ¬¡è¯¦æ
", |
| | | // type: "int", |
| | | // width: 120, |
| | | // align: "left", |
| | | // // sort:true, |
| | | // }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | |
| | | }, |
| | | { |
| | | field: "supplierBatch", |
| | | title: "ä¾åºåæ¹æ¬¡", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockQuantity", |
| | | title: "éé", |
| | | title: "ç©ææ°é", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "status", |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | // sort:true, |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | { |
| | |
| | | locationCode: "", |
| | | locationName: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | |
| | | ]); |
| | | const editFormOptions = ref([]); |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | // locationCode: "", |
| | | materielCode:"", |
| | | batchNo:"" |
| | | materielCode: "", |
| | | batchNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçç¼å·", field: "palletCode",type: "like" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode",type: "like" }, |
| | | { title: "è´§ä½ç¶æ", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],}, |
| | | { title: "åºåç¶æ", field: "stockStatus",type: "select",dataKey: "stockStatusEmun",data: [],}, |
| | | { title: "æçç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode", type: "like" }, |
| | | { |
| | | title: "è´§ä½ç¶æ", |
| | | field: "locationStatus", |
| | | type: "selectList", |
| | | dataKey: "locationStatusEnum", |
| | | data: [], |
| | | }, |
| | | { |
| | | title: "åºåç¶æ", |
| | | field: "stockStatus", |
| | | type: "select", |
| | | dataKey: "stockStatusEmun", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode",type: "like"}, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo",type: "like"}, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "select",dataKey: "warehouses",data: [],}, |
| | | { title: "åºåå建æ¶é´",field: "createDate",type: "datetime"}, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | { |
| | | title: "æå±ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | }, |
| | | { title: "åºåå建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "decimal", |
| | | width: 100, |
| | | align: "left", |
| | | hidden:true |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | |
| | | title: "æå«ç©ææ¹æ¬¡", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left" |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "sumStock", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | bind:{key: "locationTypeEnum", data: []} |
| | | bind: { key: "locationTypeEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "locationStatus", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden:true |
| | | hidden: true, |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockId", |
| | | title: "åºåä¿¡æ¯ä¸»é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 110, |
| | | width: 150, |
| | | align: "left", |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 130, |
| | | width: 150, |
| | | align: "left", |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "ç©ææ¹æ¬¡", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "decimal", |
| | | width: 130, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielSpec", |
| | | title: "è§æ ¼åå·", |
| | | field: "supplierBatch", |
| | | title: "ä¾åºåæ¹æ¬¡", |
| | | type: "string", |
| | | width: 180, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "serialNumber", |
| | | title: "åºåå·", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "stockQuantity", |
| | | title: "åºåæ°é", |
| | | title: "ç©ææ°é", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outboundQuantity", |
| | | title: "åºåºæ°é", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 50, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "effectiveDate", |
| | | title: "æææ¥æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "stockStatusEmun", data: [] } |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true |
| | | // sort:true, |
| | | }, |
| | | { |
| | | field: "createDate", |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden: true |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden: true |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true |
| | | hidden: true, |
| | | }, |
| | | ], |
| | | sortName: "id", |
| | |
| | | |
| | | public int Code { get; set; } |
| | | |
| | | public string msg { get; set; } |
| | | |
| | | public string Message { get; set; } |
| | | |
| | | public object Data { get; set; } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Basic |
| | | { |
| | | public class LocationArea |
| | | { |
| | | /// <summary> |
| | | /// åºåºåç§° |
| | | /// </summary> |
| | | public string house_name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç¼å· |
| | | /// </summary> |
| | | public int shelf_code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public int tunnel { get; set; } |
| | | } |
| | | |
| | | |
| | | public class LocationLayer |
| | | { |
| | | public int index { get; set; } |
| | | public List<LocationRow> rows { get; set; } |
| | | } |
| | | public class LocationRow |
| | | { |
| | | public int index { get; set; } |
| | | public List<LocationCol> cols { get; set; } |
| | | } |
| | | |
| | | public class LocationCol |
| | | { |
| | | public string locationCode { get; set; } |
| | | public int row { get; set; } |
| | | public int layer { get; set; } |
| | | |
| | | public int index { get; set; } |
| | | /// <summary> |
| | | /// æ£æµæç¶æ |
| | | /// </summary> |
| | | public string remark { get; set; } |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public int location_state { get; set; } |
| | | /// <summary> |
| | | /// éå®ç¶æ |
| | | /// </summary> |
| | | public int location_lock { get; set; } |
| | | } |
| | | |
| | | } |
| | |
| | | /// <summary> |
| | | /// ç©ææ¹å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©ææ¹å·")] |
| | | [ExporterHeader(DisplayName = "ç©æå
鍿¹å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | | ///ä¾åºåæ¹å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ä¾åºåæ¹æ¬¡")] |
| | | public string SupplierBatch { get; set; } |
| | | /// <summary> |
| | | /// åºåæ°é |
| | | /// </summary> |
| | |
| | | PageGridData<StockViewDTO> GetPageData(PageDataOptions options); |
| | | |
| | | object GetDetailPage(PageDataOptions pageData); |
| | | |
| | | WebResponseContent Export(PageDataOptions options); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_ISystemRepository |
| | | { |
| | | public interface ISys_RoleDataPermissionRepository : IRepository<Sys_RoleDataPermission> |
| | | { |
| | | } |
| | | } |
| | |
| | | WebResponseContent IsRelocations(int TaskNum, string SourceAddress); |
| | | WebResponseContent Cancelinventory(int taskNum); |
| | | WebResponseContent InboundTaskCompleted(int taskNum); |
| | | WebResponseContent OutboundTaskCompleted(int taskNum); |
| | | WebResponseContent OutboundTaskCompleted(int taskNum); |
| | | WebResponseContent AddOutboundOrders(Houseounbound orderAddDTO); |
| | | WebResponseContent InventoryOut(HouseCancelOut houseInventoryOut); |
| | | WebResponseContent InventoryIn(string name, int qty); |
| | |
| | | } |
| | | else |
| | | { |
| | | if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçå·éå¤"); |
| | | } |
| | | beforeQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | //if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) |
| | | //{ |
| | | return WebResponseContent.Instance.Error($"æçå·éå¤,该æçå·²ç»è¿ç©æ"); |
| | | //} |
| | | //beforeQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | } |
| | | |
| | | if (warehouse.WarehouseCode == WarehouseEnum.SC01_BC.ToString()) |
| | |
| | | |
| | | if (inboundOrderOld != null) |
| | | { |
| | | if (inboundOrderOld.OrderStatus != OrderDetailStatusEnum.New.ObjToInt()) |
| | | if (inboundOrderOld.OrderStatus == InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | return content.Error($"{model.AsnNo}忮已å¼å§!"); |
| | | inboundOrderOld.OrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrderOld); |
| | | } |
| | | Dt_InboundOrderDetail orderDetail1 = BaseDal.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inboundOrderOld.Id).First(); |
| | | Dt_InboundOrderDetail? inboundOrderDetailOld = inboundOrderOld.Details?.FirstOrDefault(x => x.LinId == item.LinId && x.MaterielCode == item.MaterielCode); |
| | |
| | | .Db.Queryable<Dt_InboundOrderDetail>() |
| | | .Where(d => d.OrderId == inboundOrder.Id) |
| | | .Count(); |
| | | |
| | | //æ£æ¥æç»å®æçä¸ªæ° |
| | | int overCount = _inboundRepository.InboundOrderDetailRepository |
| | | .Db.Queryable<Dt_InboundOrderDetail>() |
| | | .Where(d => d.OrderId == inboundOrder.Id && d.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()) |
| | | .Count(); |
| | | // å¦ææ²¡æå©ä½æç»ï¼åå é¤ä¸»è®¢å |
| | | if (remainingDetailsCount == 0) |
| | | { |
| | | _inboundRepository.InboundOrderRepository.DeleteAndMoveIntoHty(inboundOrder, OperateType.äººå·¥åæ¶); |
| | | } |
| | | //妿忶以åæç»å·²ç»å
¨é¨å®æ |
| | | if (remainingDetailsCount == overCount) |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | |
| | | List<Dt_TakeStockOrder> takeStockOrders = new List<Dt_TakeStockOrder>(); |
| | | if (string.IsNullOrEmpty(orderNo)) |
| | | { |
| | | takeStockOrders = Db.Queryable<Dt_TakeStockOrder>().Where(x => x.TakeStockStatus < TakeStockStatusEnum.çç¹å®æ.ObjToInt() && x.WarehouseId == warehouseId).ToPageList(pageNo, 5); |
| | | takeStockOrders = Db.Queryable<Dt_TakeStockOrder>().Where(x => x.TakeStockStatus < TakeStockStatusEnum.çç¹å®æ.ObjToInt() && x.WarehouseId == warehouseId).Includes(x=>x.Details).ToPageList(pageNo, 5); |
| | | } |
| | | else |
| | | { |
| | | takeStockOrders = Db.Queryable<Dt_TakeStockOrder>().Where(x => (x.OrderNo.Contains(orderNo) && x.TakeStockStatus < TakeStockStatusEnum.çç¹å®æ.ObjToInt() && x.WarehouseId == warehouseId)).ToPageList(pageNo, 5); |
| | | takeStockOrders = Db.Queryable<Dt_TakeStockOrder>().Where(x => (x.OrderNo.Contains(orderNo) && x.TakeStockStatus < TakeStockStatusEnum.çç¹å®æ.ObjToInt() && x.WarehouseId == warehouseId)).Includes(x=>x.Details).ToPageList(pageNo, 5); |
| | | } |
| | | content.OK(data: takeStockOrders); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Sys_RoleDataPermission))] |
| | | public class Sys_RoleDataPermission : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | public int Id { get; set; } |
| | | |
| | | public int RoleId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "è§è²åç§°")] |
| | | public string RoleName { get; set; } |
| | | |
| | | public int WarehouseId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")] |
| | | public string WarehouseName { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | ids = item.LinId; |
| | | var postContent = new MultipartFormDataContent(); |
| | | postContent.Headers.Add("ContentType", $"multipart/form-data"); |
| | | postContent.Add(new StringContent(ids), "ids"); |
| | | string result = string.Empty; |
| | | HttpClient client = null; |
| | |
| | | { |
| | | using (client = new HttpClient()) |
| | | { |
| | | HttpResponseMessage response = client.PostAsync(ToCancelOutFeedbackERP, postContent) |
| | | .ConfigureAwait(false).GetAwaiter().GetResult(); |
| | | // 2. åéè¯·æ± |
| | | var response = HttpHelper.Post<WebResponseContent>(ToCancelOutFeedbackERP, postContent, "åºåºæç»åæ¶åä¼ ERP"); |
| | | |
| | | // ç¡®ä¿ååºæå |
| | | response.EnsureSuccessStatusCode(); |
| | | result = response.Content.ReadAsStringAsync() |
| | | .ConfigureAwait(false).GetAwaiter().GetResult(); |
| | | if (response.Code !=0) |
| | | { |
| | | throw new Exception($"æä½å¤±è´¥: {response.msg ?? "æªæä¾é误信æ¯"}"); |
| | | } |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | _outboundRepository.OutboundOrderDetailRepository.DeleteAndMoveIntoHty(outboundOrderDetails, OperateType.äººå·¥åæ¶); |
| | |
| | |  |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using Magicodes.ExporterAndImporter.Excel; |
| | | using Microsoft.AspNetCore.Http; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | { |
| | | switch (param.Name) |
| | | { |
| | | case var name when name == nameof(Dt_StockInfo.PalletCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x=>x.PalletCode.Contains(param.Value.ToString())); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.LocationCode == param.Value.ToString()); |
| | | .Where(x => x.LocationCode.Contains(param.Value.ToString())); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_LocationInfo.LocationStatus).FirstLetterToLower(): |
| | |
| | | { |
| | | x.MaterielCode = string.Join(",", x.Details.Select(d => d.MaterielCode).Distinct()); |
| | | x.BatchNo = string.Join(",", x.Details.Select(d => d.BatchNo).Distinct()); |
| | | x.SupplierBatch = string.Join(",", x.Details.Select(d => d.SupplierBatch).Distinct()); |
| | | x.MaterielSpec = x.Details.FirstOrDefault()?.MaterieSpec ?? ""; |
| | | x.MaterielName = x.Details.FirstOrDefault()?.MaterielName ?? ""; |
| | | }); |
| | |
| | | } |
| | | return new PageGridData<object>(total: 0, null); |
| | | } |
| | | |
| | | public virtual WebResponseContent Export(PageDataOptions options) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Type t = typeof(StockViewDTO); |
| | | |
| | | string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport"; |
| | | IExporter exporter = new ExcelExporter(); |
| | | options.Page = 1; |
| | | options.Rows = 30; |
| | | options.Order = "desc"; |
| | | options.Sort = "stockId"; |
| | | |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>().Includes(x => x.Details); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>(); |
| | | ISugarQueryable<Dt_StockInfoDetail> sugarQueryable2 = _dbBase.Queryable<Dt_StockInfoDetail>(); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | | { |
| | | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList?.Any() == true) |
| | | { |
| | | foreach (var param in searchParametersList) |
| | | { |
| | | switch (param.Name) |
| | | { |
| | | case var name when name == nameof(Dt_StockInfo.PalletCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.PalletCode.Contains(param.Value.ToString())); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.MaterielCode.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.BatchNo.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.LocationCode.Contains(param.Value.ToString())); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_LocationInfo.LocationStatus).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable = sugarQueryable |
| | | .Where(x => x.LocationStatus == param.Value.ObjToInt()); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfo.StockStatus).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.StockStatus == param.Value.ObjToInt()); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfo.WarehouseId).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.WarehouseId == param.Value.ObjToInt()); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfo.CreateDate).FirstLetterToLower(): |
| | | if (DateTime.TryParse(param.Value?.ToString(), out DateTime minDate)) |
| | | { |
| | | LinqExpressionType expressionType = param.DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= minDate); |
| | | } |
| | | else if (expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= minDate); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | |
| | | |
| | | ISugarQueryable<StockViewDTO> list = sugarQueryable1 |
| | | .InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode) |
| | | .Select((b, a) => new StockViewDTO |
| | | { |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | Depth = a.Depth, |
| | | EnalbeStatus = a.EnableStatus, |
| | | Layer = a.Layer, |
| | | LocationName = a.LocationName, |
| | | LocationStatus = a.LocationStatus, |
| | | LocationType = a.LocationType, |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | StockRemark = b.Remark, |
| | | RoadwayNo = a.RoadwayNo, |
| | | Row = a.Row, |
| | | StockId = b.Id, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.Details, |
| | | }); |
| | | |
| | | int totalCount = 0; |
| | | var stockViewDTOs = list.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | |
| | | stockViewDTOs.ForEach(x => |
| | | { |
| | | x.MaterielCode = string.Join(",", x.Details.Select(d => d.MaterielCode).Distinct()); |
| | | x.BatchNo = string.Join(",", x.Details.Select(d => d.BatchNo).Distinct()); |
| | | x.SupplierBatch= string.Join(",", x.Details.Select(d => d.SupplierBatch).Distinct()); |
| | | x.StockCounts = Math.Round(x.Details.Sum(x => x.StockQuantity), 3).ToString(); |
| | | x.MaterielSpec = x.Details.FirstOrDefault()?.MaterieSpec ?? ""; |
| | | x.MaterielName = x.Details.FirstOrDefault()?.MaterielName ?? ""; |
| | | }); |
| | | |
| | | byte[] data = exporter.ExportAsByteArray(stockViewDTOs).Result; |
| | | |
| | | string fileName = "åºåè§å¾.xlsx"; |
| | | |
| | | FileHelper.WriteFile(savePath, fileName, data); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Dt_StockInfodt> stolist= new List<Dt_StockInfodt>(); |
| | | for (int i = 0; i < entities.Count; i++) |
| | | { |
| | | Dt_StockInfoDetail dt_StockIndet = detdata.Where(x => x.StockId == entities[i].Id).FirstOrDefault(); |
| | | List<Dt_StockInfoDetail> dt_StockIndet = detdata.Where(x => x.StockId == entities[i].Id).ToList(); |
| | | string MaterialTypet = "åææ"; |
| | | if (entities[i].MaterialType == (int)InventoryMaterialType.æå) |
| | | { |
| | | MaterialTypet = "æå"; |
| | | } |
| | | else if(entities[i].MaterialType == (int)InventoryMaterialType.空æ) |
| | | else if (entities[i].MaterialType == (int)InventoryMaterialType.空æ) |
| | | { |
| | | MaterialTypet = "空æ"; |
| | | } |
| | | |
| | | string Wlstatust = "å¾
æ£"; |
| | | if (entities[i].Wlstatus== (int)InventoryMaterialStatus.åæ ¼) |
| | | if (entities[i].Wlstatus == (int)InventoryMaterialStatus.åæ ¼) |
| | | { |
| | | Wlstatust = "åæ ¼"; |
| | | } |
| | |
| | | MaterialType = MaterialTypet, |
| | | LocationCode = entities[i].LocationCode, |
| | | Wlstatus = Wlstatust, |
| | | MaterielCode = dt_StockIndet?.MaterielCode ?? "", // 妿 dt_StockIndet 为 nullï¼ä½¿ç¨ç©ºå符串ä½ä¸ºé»è®¤å¼ |
| | | MaterielName = dt_StockIndet?.MaterielName ?? "", |
| | | OrderNo = dt_StockIndet?.OrderNo ?? "", |
| | | BatchNo = dt_StockIndet?.BatchNo ?? "", |
| | | SerialNumber = dt_StockIndet?.SerialNumber ?? "", |
| | | StockQuantity = dt_StockIndet?.StockQuantity ?? 0, // å设 StockQuantity æ¯æ°å¼ç±»åï¼ä½¿ç¨ 0 ä½ä¸ºé»è®¤å¼ |
| | | BatchNoName = dt_StockIndet?.BatchNoName ?? "", |
| | | CreateDate = dt_StockIndet?.CreateDate ?? DateTime.MinValue, // å设 CreateDate æ¯æ¥æç±»åï¼ä½¿ç¨é»è®¤æ¶é´ |
| | | MaterielCode = dt_StockIndet?.FirstOrDefault()?.MaterielCode ?? "", |
| | | MaterielName = dt_StockIndet?.FirstOrDefault()?.MaterielName ?? "", |
| | | OrderNo = dt_StockIndet?.FirstOrDefault()?.OrderNo ?? "", |
| | | BatchNo = dt_StockIndet?.FirstOrDefault()?.BatchNo ?? "", |
| | | SerialNumber = dt_StockIndet?.FirstOrDefault()?.SerialNumber ?? "", |
| | | StockQuantity = dt_StockIndet?.Sum(item => item.StockQuantity) ?? 0, |
| | | BatchNoName = dt_StockIndet?.FirstOrDefault()?.BatchNoName ?? "", |
| | | CreateDate = dt_StockIndet?.FirstOrDefault()?.CreateDate ?? DateTime.MinValue, |
| | | Remark = entities[i].Remark, |
| | | }; |
| | | stolist.Add(dt_); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_ISystemRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_SystemRepository |
| | | { |
| | | public class Sys_RoleDataPermissionRepository : RepositoryBase<Sys_RoleDataPermission>, ISys_RoleDataPermissionRepository |
| | | { |
| | | public Sys_RoleDataPermissionRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (task != null) |
| | | { |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return WebResponseContent.Instance.OK($"该æçå·²çæä»»å¡", _mapper.Map<WMSTaskDTO>(task)); |
| | | return WebResponseContent.Instance.Error($"该æç{palletCode}å·²çæä»»å¡"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask); |
| | | |
| | | //PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | return WebResponseContent.Instance.OK(data: wMSTaskDTO); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (task != null) |
| | | { |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return WebResponseContent.Instance.OK($"该æçå·²çæä»»å¡", _mapper.Map<WMSTaskDTO>(task)); |
| | | return WebResponseContent.Instance.Error($"该æç{palletCode}å·²çæä»»å¡"); |
| | | } |
| | | // è·åå
¥åºåæç» |
| | | var inboundOrderDet = GetInboundOrderDetail(palletCode); |
| | |
| | | using WIDESEA_InboundRepository; |
| | | using System.Drawing.Printing; |
| | | using System; |
| | | using WIDESEA_Common.Log; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | private readonly IStockInfoDetailRepository _stockInfoDetailRepository; |
| | | private readonly IReturnOrderRepository _returnOrderRepository; |
| | | private readonly IProductionRepository _productionRepository; |
| | | private readonly IInboundRepository _inboundRepository; |
| | | private readonly IInboundRepository _inboundRepository; |
| | | |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IMaterielInfoService materielInfoService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IInboundOrder_HtyService inboundOrder_HtyService, IStockRepository stockRepository, IInboundOrderDetailService inboundOrderDetailService, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IBasicRepository basicRepository, IStockInfoDetailRepository stockInfoDetailRepository, IPalletTypeInfoRepository palletTypeInfoRepository, IReturnOrderRepository returnOrderRepository, IProductionRepository productionRepository,IInboundRepository inboundRepository) : base(BaseDal) |
| | |
| | | public string ReceiveWMSTaskAllocatein = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskAllocatein"]; |
| | | public string ReceiveERPTaskout = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveERPTaskout"]; |
| | | public string InMaterialWarehousingCallback = WIDESEA_Core.Helper.AppSettings.Configuration["InMaterialWarehousingCallback"]; |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ä¿¡æ¯æ¨éè³WCS |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WCSApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); |
| | | } |
| | | string response = HttpHelper.Get($"{url}/api/Task/RecWMSTaskCompleted?taskNum=" + taskNum); |
| | | string response = HttpHelper.Post($"{url}/api/Task/RecWMSTaskCompleted?taskNum=" + taskNum); |
| | | |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); |
| | | } |
| | |
| | | if (outboundOrderDetails.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt() && inboundOrder.System.Equals("ERP")) |
| | | { |
| | | FeedBackOutERP(outboundOrder.OrderNo, outboundOrderDetails.LinId); |
| | | //DownloadReport(path, savePath, outboundOrderDetails.Id); |
| | | //printTest(savePath); |
| | | DownloadReport(path, savePath, outboundOrderDetails.Id); |
| | | } |
| | | ///忮宿æ¨éSMOMç³»ç» |
| | | if (outboundOrder.OrderStatus == OutboundStatusEnum.åºåºå®æ.ObjToInt() && inboundOrder.System.Equals("SMOM")) |
| | |
| | | throw new Exception($"æä½å¤±è´¥: {response.Message ?? "æªæä¾é误信æ¯"}"); |
| | | } |
| | | } |
| | | public string DownloadReport(string path, string savePath, int orderId) |
| | | // æ¹æ³å£°ææ·»å async å
³é®åï¼è¿å弿¹ä¸º Task<string> |
| | | public async Task<string> DownloadReport(string path, string savePath, int orderId) |
| | | { |
| | | // æå»ºå®æ´ URLï¼ï¼æ¥è¡¨ä¼ åï¼ |
| | | string reportUrl = path + "&orderId=" + orderId; |
| | | |
| | | try |
| | | { |
| | | // ç¡®ä¿ä¿åç®å½åå¨ |
| | | string directory = Path.GetDirectoryName(savePath); |
| | | Console.WriteLine($"ä¸è½½å°å: {reportUrl}"); |
| | | Console.WriteLine($"ä¿åè·¯å¾: {savePath}"); |
| | | |
| | | // ç¡®ä¿ç®å½åå¨ |
| | | if (!Directory.Exists(directory)) |
| | | { |
| | | Directory.CreateDirectory(directory); |
| | | Console.WriteLine($"å·²å建ç®å½: {directory}"); |
| | | } |
| | | |
| | | string[] files = Directory.GetFiles(directory); |
| | | // å 餿¯ä¸ªæä»¶ |
| | | foreach (string filePath in files) |
| | | // æ¸
çç®å½ä¸ç°ææä»¶ |
| | | if (File.Exists(savePath)) |
| | | { |
| | | File.Delete(filePath); |
| | | File.Delete(savePath); |
| | | Console.WriteLine($"å·²å 餿§æä»¶: {savePath}"); |
| | | } |
| | | // ä½¿ç¨ HttpClient ä¸è½½æä»¶ |
| | | |
| | | // 使ç¨ä¸´æ¶æä»¶åä¸è½½ï¼ä¸è½½å®æååéå½å |
| | | string tempFilePath = savePath + ".tmp"; |
| | | |
| | | // 弿¥ä¸è½½æä»¶ |
| | | using (var httpClient = new HttpClient()) |
| | | { |
| | | // 设置è¶
æ¶æ¶é´ï¼å¸è½¯æ¥è¡¨çæå¯è½éè¦è¾é¿æ¶é´ï¼ |
| | | httpClient.Timeout = TimeSpan.FromMinutes(5); |
| | | |
| | | // åé GET 请æ±ï¼åæ¥æ¹å¼ï¼ |
| | | using (var response = httpClient.GetAsync(reportUrl, HttpCompletionOption.ResponseHeadersRead).GetAwaiter().GetResult()) |
| | | using (var response = await httpClient.GetAsync(reportUrl, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false)) |
| | | { |
| | | // æ£æ¥ååºç¶æ |
| | | response.EnsureSuccessStatusCode(); |
| | | |
| | | // è·åå
容æµï¼åæ¥æ¹å¼ï¼ |
| | | using (var contentStream = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult()) |
| | | using (var contentStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) |
| | | { |
| | | // å建æä»¶æµ |
| | | using (var fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None)) |
| | | Console.WriteLine($"å¼å§åå
¥ä¸´æ¶æä»¶: {tempFilePath}"); |
| | | |
| | | using (var fileStream = new FileStream( |
| | | tempFilePath, |
| | | FileMode.Create, |
| | | FileAccess.Write, |
| | | FileShare.None, |
| | | bufferSize: 4096, |
| | | useAsync: true |
| | | )) |
| | | { |
| | | // å¤å¶å
容尿件ï¼åæ¥æ¹å¼ï¼ |
| | | contentStream.CopyToAsync(fileStream).GetAwaiter().GetResult(); |
| | | await contentStream.CopyToAsync(fileStream).ConfigureAwait(false); |
| | | await fileStream.FlushAsync().ConfigureAwait(false); |
| | | Console.WriteLine($"ä¸´æ¶æä»¶åå
¥å®æ: {tempFilePath}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return savePath; |
| | | |
| | | // å
³é®ä¼åï¼ç¡®ä¿æä»¶å®å
¨åå
¥ç£ç |
| | | await EnsureFileCompletelyWritten(tempFilePath); |
| | | |
| | | // éå½åä¸ºç®æ æä»¶ |
| | | File.Move(tempFilePath, savePath, true); |
| | | Console.WriteLine($"æä»¶éå½å宿: {savePath}"); |
| | | |
| | | // éªè¯æä»¶å¯è®¿é® |
| | | await ValidateFileAccessible(savePath); |
| | | |
| | | // æå°æä»¶ |
| | | PrintTestDirect(savePath); |
| | | |
| | | return savePath; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new ValidationException(ex.Message); |
| | | Console.WriteLine($"ä¸è½½å¤±è´¥: {ex.Message}"); |
| | | throw new InvalidOperationException($"æä»¶ä¸è½½å¼å¸¸: {ex.Message}", ex); |
| | | } |
| | | } |
| | | |
| | | public virtual void printTest(string fullPath) |
| | | /// <summary> |
| | | /// ç¡®ä¿æä»¶å®å
¨åå
¥ç£ç |
| | | /// </summary> |
| | | private async Task EnsureFileCompletelyWritten(string filePath) |
| | | { |
| | | Spire.Pdf.PdfDocument pdf = new PdfDocument(); |
| | | //æä»¶å°å |
| | | pdf.LoadFromFile(fullPath); |
| | | //æå®æå°æºä½ç½® |
| | | string url = AppSettings.app("PrinterName"); |
| | | pdf.PrintSettings.PrinterName = url; |
| | | //æ§è¡æå° |
| | | pdf.Print(); |
| | | //å
åéæ¾ |
| | | pdf.Dispose(); |
| | | const int maxRetries = 5; |
| | | const int delayMs = 500; |
| | | |
| | | for (int i = 0; i < maxRetries; i++) |
| | | { |
| | | try |
| | | { |
| | | // å°è¯ä»¥è¯»åæ¨¡å¼æå¼æä»¶ï¼ç¡®ä¿æä»¶æ²¡æè¢«å ç¨ |
| | | using (var fs = new FileStream(filePath, |
| | | FileMode.Open, |
| | | FileAccess.Read, |
| | | FileShare.Read, |
| | | bufferSize: 4096, |
| | | useAsync: true)) |
| | | { |
| | | // éªè¯æä»¶æå
容 |
| | | if (fs.Length > 0) |
| | | { |
| | | Console.WriteLine($"æä»¶éªè¯æå: 大å°={fs.Length}åè (å°è¯ {i + 1}/{maxRetries})"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | Console.WriteLine($"è¦å: æä»¶å¤§å°ä¸º0 (å°è¯ {i + 1}/{maxRetries})"); |
| | | } |
| | | } |
| | | } |
| | | catch (IOException ex) |
| | | { |
| | | Console.WriteLine($"æä»¶å¯è½ä»å¨åå
¥ä¸ (å°è¯ {i + 1}/{maxRetries}): {ex.Message}"); |
| | | } |
| | | |
| | | if (i < maxRetries - 1) |
| | | { |
| | | await Task.Delay(delayMs); |
| | | } |
| | | } |
| | | |
| | | throw new IOException($"æä»¶åå
¥æªå®æææ æ³è®¿é®: {filePath}"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯æä»¶å¯è®¿é®ä¸ä¸ä¸ºç©º |
| | | /// </summary> |
| | | private async Task ValidateFileAccessible(string filePath) |
| | | { |
| | | const int maxRetries = 3; |
| | | const int delayMs = 300; |
| | | |
| | | for (int i = 0; i < maxRetries; i++) |
| | | { |
| | | try |
| | | { |
| | | if (!File.Exists(filePath)) |
| | | { |
| | | throw new FileNotFoundException($"æä»¶ä¸åå¨: {filePath}"); |
| | | } |
| | | |
| | | var fileInfo = new FileInfo(filePath); |
| | | |
| | | // éªè¯æä»¶å¤§å°å¤§äº0 |
| | | if (fileInfo.Length == 0) |
| | | { |
| | | throw new InvalidDataException($"æä»¶å¤§å°ä¸º0: {filePath}"); |
| | | } |
| | | |
| | | // éªè¯æä»¶ä¸æ¯å®å
¨ç±ç©ºåç¬¦ç»æï¼å¯éæ£æ¥ï¼ |
| | | await ValidateFileContent(filePath); |
| | | |
| | | Console.WriteLine($"æä»¶éªè¯éè¿: {filePath} (大å°={fileInfo.Length}åè)"); |
| | | return; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine($"æä»¶éªè¯å¤±è´¥ (å°è¯ {i + 1}/{maxRetries}): {ex.Message}"); |
| | | |
| | | if (i == maxRetries - 1) |
| | | { |
| | | throw; |
| | | } |
| | | |
| | | await Task.Delay(delayMs); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éªè¯æä»¶å
容ï¼å¯éï¼ |
| | | /// </summary> |
| | | private async Task ValidateFileContent(string filePath) |
| | | { |
| | | try |
| | | { |
| | | // 读åæä»¶åå 个åèï¼ç¡®ä¿ä¸æ¯å®å
¨ç±ç©ºåç¬¦ç»æ |
| | | using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, true)) |
| | | { |
| | | byte[] buffer = new byte[Math.Min(1024, fs.Length)]; |
| | | int bytesRead = await fs.ReadAsync(buffer, 0, buffer.Length); |
| | | |
| | | // æ£æ¥æ¯å¦é½æ¯0ï¼ç©ºæä»¶ï¼ |
| | | if (bytesRead > 0 && buffer.All(b => b == 0)) |
| | | { |
| | | throw new InvalidDataException("æä»¶å
容å¼å¸¸: å
¨é¨ä¸º0åè"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine($"æä»¶å
容éªè¯å¼å¸¸: {ex.Message}"); |
| | | // å¯ä»¥éæ©æ¯å¦æåºå¼å¸¸ |
| | | } |
| | | } |
| | | |
| | | public virtual void PrintTestDirect(string fullPath) |
| | | { |
| | | const int maxRetryCount = 3; |
| | | const int retryDelayMs = 1000; |
| | | |
| | | if (!File.Exists(fullPath)) |
| | | { |
| | | Console.WriteLine($"æå°å¤±è´¥ï¼æä»¶ä¸åå¨ {fullPath}"); |
| | | return; |
| | | } |
| | | |
| | | // è·åæå°æºåç§° |
| | | string printerName = AppSettings.app("PrinterName"); |
| | | |
| | | // å°è¯ä¸åçæå°æ¹æ³ |
| | | for (int retryCount = 0; retryCount < maxRetryCount; retryCount++) |
| | | { |
| | | try |
| | | { |
| | | Console.WriteLine($"å°è¯æå° (æ¹æ³ {retryCount + 1}/{maxRetryCount}): {fullPath}"); |
| | | |
| | | switch (retryCount) |
| | | { |
| | | case 0: |
| | | // æ¹æ³1: 使ç¨åå§æå°å½ä»¤ |
| | | PrintUsingRawCommand(fullPath, printerName); |
| | | break; |
| | | case 1: |
| | | // æ¹æ³3: ç´æ¥ä½¿ç¨Spire.PDFä½ç®å设置 |
| | | PrintUsingSpireSimple(fullPath, printerName); |
| | | break; |
| | | case 2: |
| | | // æ¹æ³3: ç´æ¥ä½¿ç¨Spire.PDFä½ç®å设置 |
| | | PrintUsingSpireSimple(fullPath, printerName); |
| | | break; |
| | | } |
| | | |
| | | Console.WriteLine("æå°ä»»å¡åéæå"); |
| | | return; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine($"æå°æ¹æ³ {retryCount + 1} 失败: {ex.Message}"); |
| | | |
| | | if (retryCount < maxRetryCount - 1) |
| | | { |
| | | Thread.Sleep(retryDelayMs); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Console.WriteLine("æææå°æ¹æ³é½å¤±è´¥"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨åå§æå°å½ä»¤ |
| | | /// </summary> |
| | | private void PrintUsingRawCommand(string filePath, string printerName) |
| | | { |
| | | try |
| | | { |
| | | // æ¹æ³1: 使ç¨Processç´æ¥æå° |
| | | var process = new System.Diagnostics.Process(); |
| | | process.StartInfo.FileName = filePath; |
| | | process.StartInfo.Verb = "print"; |
| | | process.StartInfo.CreateNoWindow = true; |
| | | process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; |
| | | process.Start(); |
| | | |
| | | // çå¾
䏿®µæ¶é´è®©æå°ä»»å¡æäº¤ |
| | | if (!process.WaitForExit(5000)) |
| | | { |
| | | Console.WriteLine("æå°è¿ç¨æªåæ¶éåºï¼ä½ä»»å¡å¯è½å·²æäº¤"); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | // 妿ä¸è¿°æ¹æ³å¤±è´¥ï¼å°è¯ä½¿ç¨rundll32 |
| | | try |
| | | { |
| | | var args = $@"/c rundll32.exe C:\Windows\System32\shimgvw.dll,ImageView_PrintTo ""{filePath}"" ""{printerName}"""; |
| | | System.Diagnostics.Process.Start("cmd.exe", args); |
| | | } |
| | | catch |
| | | { |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨Spire.PDFä½ç®å设置 |
| | | /// </summary> |
| | | private void PrintUsingSpireSimple(string filePath, string printerName) |
| | | { |
| | | using (Spire.Pdf.PdfDocument pdf = new Spire.Pdf.PdfDocument()) |
| | | { |
| | | // ä½¿ç¨æå°é
ç½®å è½½æä»¶ |
| | | pdf.LoadFromFile(filePath); |
| | | |
| | | // è®¾ç½®åºæ¬æå°æºä¿¡æ¯ |
| | | if (!string.IsNullOrEmpty(printerName)) |
| | | { |
| | | pdf.PrintSettings.PrinterName = printerName; |
| | | } |
| | | |
| | | // ç´æ¥æå°ï¼ä¸æ£æ¥ |
| | | pdf.Print(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ£æ¥æä»¶æ¯å¦å¯è®¿é® |
| | | /// </summary> |
| | | private bool IsFileAccessible(string filePath) |
| | | { |
| | | try |
| | | { |
| | | using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) |
| | | { |
| | | return fs.Length > 0; |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å°è¯å¼ºå¶åå¾åæ¶ï¼éæ¾å¯è½åå¨çæä»¶å¥æ |
| | | /// </summary> |
| | | private void TryForceGarbageCollection() |
| | | { |
| | | try |
| | | { |
| | | GC.Collect(); |
| | | GC.WaitForPendingFinalizers(); |
| | | Console.WriteLine("å·²æ§è¡åå¾åæ¶"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine($"åå¾åæ¶å¤±è´¥: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_ISystemRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ |
| | | /// </summary> |
| | | [Route("api/LocationInfoRow")] |
| | | [ApiController] |
| | | public class LocationInfoRowController : ApiBaseController<ILocationInfoService, Dt_LocationInfo> |
| | | { |
| | | private readonly ILocationInfoRepository _repository; |
| | | private readonly ISys_RoleDataPermissionRepository _permissionRepository; |
| | | private readonly ILocationInfoRepository _locationInfoRepository; |
| | | public LocationInfoRowController(ILocationInfoService service, ILocationInfoRepository repository, ISys_RoleDataPermissionRepository permissionRepository, ILocationInfoRepository locationInfoRepository) : base(service) |
| | | { |
| | | _repository = repository; |
| | | _permissionRepository = permissionRepository; |
| | | _locationInfoRepository = locationInfoRepository; |
| | | } |
| | | /// <summary> |
| | | /// è·ååºåºæé |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet, HttpPost, Route("GetArea"), AllowAnonymous] |
| | | public object GetArea() |
| | | { |
| | | List<object> list = new List<object>(); |
| | | List<Dt_LocationInfo>? locations = null; |
| | | List<Sys_RoleDataPermission> permissions = _permissionRepository.QueryData(x => x.RoleId == App.User.RoleId); |
| | | if (permissions.Count > 0) |
| | | locations = _locationInfoRepository.QueryData(x => permissions.Select(k => k.WarehouseId).ToList().Contains(x.WarehouseId)); |
| | | foreach (var permission in permissions) |
| | | { |
| | | var Rows = locations.Where(x => x.WarehouseId == permission.WarehouseId).GroupBy(x => x.Row).Select(x => x.Key).OrderBy(x => x).ToList(); |
| | | var obj = new |
| | | { |
| | | house_name = permission.WarehouseName, |
| | | shelf_code = permission.WarehouseId, |
| | | tunnel = Rows |
| | | }; |
| | | list.Add(obj); |
| | | } |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// è·åè´§ä½ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="area"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("GetLocationStatu"), AllowAnonymous] |
| | | public object GetLocationStatu([FromBody] LocationArea area) |
| | | { |
| | | List<LocationLayer> layers = new List<LocationLayer>(); |
| | | var data = _locationInfoRepository.QueryData(x => x.WarehouseId == area.shelf_code && x.Row == area.tunnel); |
| | | foreach (var layer in data.GroupBy(t => t.Layer)) |
| | | { |
| | | var rows = new List<LocationRow>(); |
| | | var data_rows = layer.GroupBy(t => t.Row); |
| | | foreach (var data_row in data_rows) |
| | | { |
| | | var cols = new List<LocationCol>(); |
| | | foreach (var data_col in data_row) |
| | | { |
| | | cols.Add(new LocationCol() |
| | | { |
| | | //å |
| | | row = data_col.Row, |
| | | layer = data_col.Layer, |
| | | index = data_col.Column, |
| | | locationCode = data_col.LocationCode, |
| | | location_state = data_col.LocationStatus, |
| | | location_lock = data_col.EnableStatus, |
| | | remark = data_col.Remark |
| | | }); |
| | | } |
| | | cols = cols.OrderBy(t => t.index).ToList(); |
| | | rows.Add(new LocationRow() |
| | | { |
| | | //è¡ |
| | | index = data_row.Key, |
| | | cols = cols |
| | | }); |
| | | } |
| | | rows = rows.OrderBy(t => t.index).ToList(); |
| | | layers.Add(new LocationLayer() |
| | | { |
| | | //å± |
| | | index = layer.Key, |
| | | rows = rows |
| | | }); |
| | | } |
| | | layers = layers.OrderBy(t => t.index).ToList(); |
| | | return layers; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Options; |
| | | using System.Reflection; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | |
| | | { |
| | | return _stockViewService.GetDetailPage(pageData); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¯¼åºæ°æ® |
| | | /// </summary> |
| | | /// <param name="loadData"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("Export")] |
| | | public virtual ActionResult Export([FromBody] PageDataOptions loadData) |
| | | { |
| | | WebResponseContent result = InvokeService("Export", new object[] { loadData }) as WebResponseContent; |
| | | if (result.Status) |
| | | return File( |
| | | System.IO.File.ReadAllBytes(result.Data.ToString()), |
| | | System.Net.Mime.MediaTypeNames.Application.Octet, |
| | | Path.GetFileName(result.Data.ToString()) |
| | | ); |
| | | return Json(result); |
| | | } |
| | | private object InvokeService(string methodName, object[] parameters) |
| | | { |
| | | Type t = _stockViewService.GetType(); |
| | | List<Type> types = new List<Type>(); |
| | | foreach (var param in parameters) |
| | | { |
| | | types.Add(param.GetType()); |
| | | } |
| | | MethodInfo method = t.GetMethod(methodName, types.ToArray()); |
| | | return method.Invoke(_stockViewService, parameters); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | "urls": "http://*:9290", //webæå¡ç«¯å£ï¼å¦æç¨IISé¨ç½²ï¼æè¿ä¸ªå»æ |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "inOrderType,inoutType,outOrderType,inboundState,createType,enableEnum,enableStatusEnum,locationStatusEnum,locationTypeEnum,taskTypeEnum,taskStatusEnum,outboundStatusEnum,orderDetailStatusEnum,stockStatusEmun,stockChangeType,outStockStatus,InventoryMaterialType,InventoryMaterialStatus", |
| | | "AllowedHosts": "*", |
| | | "urls": "http://*:9290", //webæå¡ç«¯å£ï¼å¦æç¨IISé¨ç½²ï¼æè¿ä¸ªå»æ |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "inOrderType,inoutType,outOrderType,inboundState,createType,enableEnum,enableStatusEnum,locationStatusEnum,locationTypeEnum,taskTypeEnum,taskStatusEnum,outboundStatusEnum,orderDetailStatusEnum,stockStatusEmun,stockChangeType,outStockStatus,InventoryMaterialType,Inventory,materialStatus,warehouses,inoutTypeEnum,takeStockStatusEnum,takeStockDetailStatusEnum", |
| | | "AllowedHosts": "*", |
| | | |
| | | "ReceiveTask": "http://192.168.110.172:9291/api/Task/ReceiveTask", //ä¸ååºåºä»»å¡è³WCS |
| | | "ReceiveWMSTaskin": "http://10.168.3.36:1041/api/dataportal/invoke", //ç«åºå
¥åºæ°éä¿¡æ¯åä¼ WMS |
| | | "ReceiveWMSTaskout": "http://10.168.3.36:1041/api/dataportal/invoke", //ç«åºåºåºæ°éä¿¡æ¯åä¼ WMS |
| | | "ReceiveWMSTaskAUT": "http://10.168.3.36:1041/api/dataportal/invoke", //ç«åºå
¥åºæ°éä¿¡æ¯åä¼ WMSéªè¯ |
| | | "ReceiveWMSInventoryIn": "http://10.168.3.36:1041/api/dataportal/invoke", //çç¹å·®å¼æ°éåä¼ WMS |
| | | "ReceiveWMSTaskAllocatein": "http://10.168.3.36:1041/api/dataportal/invoke", //è°æ¨ä»»å¡æ°éåä¼ WMS |
| | | "ReceiveWMSTask": "http://192.168.110.172:9291/ReceiveWMSTask", //æ¥è¯¢åºåï¼ç¡®è®¤å
¥åºç«å° |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_JAMK;User ID=sa;Password=sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://127.0.0.1:1818 å http://localhost:1818 æ¯ä¸ä¸æ ·ç |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080" |
| | | }, |
| | | "WCS": "http://localhost:9291", |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": true |
| | | "ReceiveTask": "http://192.168.110.172:9291/api/Task/ReceiveTask", //ä¸ååºåºä»»å¡è³WCS |
| | | "ReceiveWMSTaskin": "http://172.30.0.192:1031/api/dataportal/invoke", //ç«åºå
¥åºæ°éä¿¡æ¯åä¼ WMS |
| | | "ReceiveWMSTaskreturn": "http://172.30.0.192:1031/api/dataportal/invoke", //ç«åºååºæ°éä¿¡æ¯åä¼ WMS |
| | | "ReceiveWMSTaskout": "http://172.30.0.192:1031/api/dataportal/invoke", //ç«åºåºåºæ°éä¿¡æ¯åä¼ WMS |
| | | "ReceiveWMSTaskAUT": "http://172.30.0.192:1031/api/dataportal/invoke", //ç«åºå
¥åºæ°éä¿¡æ¯åä¼ WMSéªè¯ |
| | | "ReceiveWMSInventoryIn": "http://172.30.0.192:1031/api/dataportal/invoke", //çç¹å·®å¼æ°éåä¼ WMS |
| | | "ReceiveWMSTaskAllocatein": "http://172.30.0.192:1031/api/dataportal/invoke", //è°æ¨ä»»å¡æ°éåä¼ WMS |
| | | "ReceiveWMSTask": "http://192.168.110.172:9291/ReceiveWMSTask", //æ¥è¯¢åºåï¼ç¡®è®¤å
¥åºç«å° |
| | | |
| | | "ReceiveERPTaskout": "http://172.30.0.192:99/external/asrs/api/OutMaterialWarehousingCallback", //ç«åºåºåºæ°éä¿¡æ¯åä¼ ERP |
| | | "CancelOutFeedbackERP": "http://172.30.0.192:99/external/asrs/api/CancelOutMaterialWarehousing", //åºåºåæç»åæ¶åä¼ ERP |
| | | "InMaterialWarehousingCallback": "http://172.30.0.184:99/external/asrs/api/InMaterialWarehousingCallback", //å
¥åºå宿åä¼ ERP |
| | | "CancelInMaterialWarehousing": "http://172.30.0.184:99/external/asrs/api/CancelInMaterialWarehousing", //å
¥åºååæ¶åä¼ ERP |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_JAMK;User ID=sa;Password=root;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://127.0.0.1:1818 å http://localhost:1818 æ¯ä¸ä¸æ ·ç |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080" |
| | | }, |
| | | "ERP": "http://172.30.0.192:99", |
| | | "WCS": "http://localhost:9291", |
| | | "PrinterName": "SHARP MX-5148NC PCL6", |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": true |
| | | } |
| | |
| | | </view> |
| | | </u-sticky> |
| | | <uni-list :border="true"> |
| | | <uni-list-item direction="column" clickable @click="groupClick(item.orderNo)" link |
| | | :to="page+item.orderNo+'&warehouseId='+warehouseId+'&id='+item.id" v-for="item in allReceivingOrders" |
| | | :key="item.orderNo"> |
| | | <uni-list-item |
| | | direction="column" |
| | | clickable |
| | | @click="groupClick(item.orderNo)" |
| | | link |
| | | :to="`${page}${item.orderNo}&warehouseId=${warehouseId}&id=${item.id}`" |
| | | v-for="item in allReceivingOrders" |
| | | :key="item.orderNo" |
| | | > |
| | | <template v-slot:body> |
| | | <uni-group margin-top="20"> |
| | | <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;"> |
| | | <view style="line-height: 17px;color: #596671;font-size: 14px;display: flex;justify-content: space-between;"> |
| | | çç¹åå· {{item.orderNo}} |
| | | </view> |
| | | <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;"> |
| | | <view style="line-height: 17px;color: #596671;font-size: 14px;display: flex;justify-content: space-between;"> |
| | | å建æ¶é´ {{item.createDate}} |
| | | </view> |
| | | <!-- æçç¼å·å±ç¤ºåºå --> |
| | | <view style="line-height: 17px;color: #596671;font-size: 14px;margin-top: 10rpx;"> |
| | | éçç¹çå·ï¼ |
| | | <view style="display: inline-flex;flex-wrap: wrap;margin-left: 10rpx;"> |
| | | <text |
| | | style="display: inline-block;background-color: #f5f5f5;padding: 2rpx 10rpx;border-radius: 4rpx;margin: 0 5rpx 5rpx 0;" |
| | | v-for="(detail, index) in item.details" |
| | | :key="index"> |
| | | {{detail.takePalletCode}} ,æå·:{{detail.materielCode}} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | <view |
| | | style="margin-top: 10rpx;display: flex;align-items: center; "> |
| | |
| | | </uni-group> |
| | | </template> |
| | | </uni-list-item> |
| | | |
| | | </uni-list> |
| | | <uni-load-more :status="status" v-if="loadVisible"></uni-load-more> |
| | | <!-- å è½½æ´å¤ç»ä»¶ --> |
| | | <uni-load-more |
| | | :status="status" |
| | | :show-icon="true" |
| | | v-if="allReceivingOrders.length > 0 || status === 'loading'" |
| | | ></uni-load-more> |
| | | |
| | | <u-back-top :scroll-top="scrollTop" top="400"></u-back-top> |
| | | </view> |
| | |
| | | data() { |
| | | return { |
| | | page: "/pages/stash/TakeStock?orderNo=", |
| | | loadVisible: false, |
| | | searchValue: "", |
| | | warehouseId: "", |
| | | status: "more", |
| | | status: "more", // å è½½ç¶æï¼more-å¯å è½½ï¼loading-å è½½ä¸ï¼noMore-æ æ´å¤ |
| | | allReceivingOrders: [], |
| | | pageNo: 1, |
| | | pageSize: 5, // å
³é®ä¿®å¤ï¼ä¸åç«¯ä¿æä¸è´ï¼æ¯é¡µ5æ¡ï¼ |
| | | scrollTop: 0, |
| | | isLoaded:false |
| | | isLoaded: false, |
| | | isLoading: false, // 鲿¢éå¤å è½½çé |
| | | hasMore: true // æ¯å¦è¿ææ´å¤æ°æ® |
| | | } |
| | | }, |
| | | onLoad(res) { |
| | | this.warehouseId = res.warehouseId; |
| | | this.isLoaded = true; |
| | | this.getData(); |
| | | this.resetData(); // éç½®æ°æ®å¹¶å 载第ä¸é¡µ |
| | | }, |
| | | onPageScroll(e) { |
| | | this.scrollTop = e.scrollTop; |
| | | }, |
| | | onShow() { |
| | | if (this.isLoaded) { |
| | | // ä»å
¶ä»é¡µé¢è¿åæ¶å·æ° |
| | | this.getData(); |
| | | this.resetData(); |
| | | } |
| | | }, |
| | | onReachBottom() { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | // 䏿å°åºé¨æ¶å è½½æ´å¤ |
| | | if (this.hasMore && !this.isLoading) { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | } |
| | | }, |
| | | methods: { |
| | | search(res) { |
| | | // æç´¢æ¶éç½®æ°æ® |
| | | search() { |
| | | this.resetData(); |
| | | }, |
| | | |
| | | // éç½®æ°æ®å°åå§ç¶æ |
| | | resetData() { |
| | | this.pageNo = 1; |
| | | this.allReceivingOrders = []; |
| | | this.hasMore = true; |
| | | this.status = "more"; |
| | | this.getData(); |
| | | }, |
| | | |
| | | groupClick() { |
| | | |
| | | // ç¹å»äºä»¶å¤ç |
| | | }, |
| | | |
| | | // è·åæ°æ® |
| | | getData() { |
| | | var postData = { |
| | | if (this.isLoading || !this.hasMore) return; |
| | | |
| | | this.isLoading = true; |
| | | this.status = "loading"; |
| | | |
| | | const postData = { |
| | | MainData: { |
| | | orderNo: this.searchValue, |
| | | pageNo: this.pageNo, |
| | | // å端åºå®æ¯é¡µ5æ¡ï¼è¿éå¯ä»¥ä¸ä¼ épageSizeï¼ä¿æä¸å端ä¸è´ |
| | | warehouseId: this.warehouseId, |
| | | }, |
| | | } |
| | | this.$u.post('/api/TakeStockOrder/GetTakeStockOrders', postData).then((res) => { |
| | | if (res.status) { |
| | | if (res.data.length > 0) { |
| | | if (this.searchValue == '') { |
| | | this.allReceivingOrders =res.data.map(i => ({ |
| | | ...i, |
| | | takeStockStatus: TakeStockStatus.find(item => item.value == i |
| | | .takeStockStatus).label |
| | | })) |
| | | // this.allReceivingOrders = res.data; |
| | | if (this.allReceivingOrders.length > 3) { |
| | | this.loadVisible = true; |
| | | |
| | | this.$u.post('/api/TakeStockOrder/GetTakeStockOrders', postData) |
| | | .then((res) => { |
| | | this.isLoading = false; |
| | | |
| | | if (res.status) { |
| | | const processedData = res.data.map(item => ({ |
| | | ...item, |
| | | takeStockStatus: TakeStockStatus.find(status => status.value === item.takeStockStatus)?.label || '' |
| | | })); |
| | | |
| | | if (processedData.length > 0) { |
| | | if (this.pageNo === 1) { |
| | | this.allReceivingOrders = processedData; |
| | | } else { |
| | | this.loadVisible = false; |
| | | this.allReceivingOrders = [...this.allReceivingOrders, ...processedData]; |
| | | } |
| | | |
| | | // å
³é®ä¿®å¤ï¼æ ¹æ®å端å®é
è¿åæ°é夿æ¯å¦è¿ææ´å¤ |
| | | // å端åºå®æ¯é¡µ5æ¡ï¼æä»¥å½è¿å5æ¡æ¶è¯´æå¯è½è¿ææ´å¤ï¼å°äº5æ¡åè¯´ææ²¡ææ´å¤ |
| | | this.hasMore = processedData.length === this.pageSize; |
| | | this.status = this.hasMore ? "more" : "noMore"; |
| | | } else { |
| | | // this.allReceivingOrders = res.data; |
| | | if (postData.MainData.pageNo == 1) { |
| | | if (this.pageNo === 1) { |
| | | this.allReceivingOrders = []; |
| | | } |
| | | this.allReceivingOrders =res.data.map(i => ({ |
| | | ...i, |
| | | takeStockStatus: TakeStockStatus.find(item => item.value == i |
| | | .takeStockStatus).label |
| | | })) |
| | | if (this.allReceivingOrders.length > 3) { |
| | | this.loadVisible = true; |
| | | } else { |
| | | this.loadVisible = false; |
| | | } |
| | | this.hasMore = false; |
| | | this.status = "noMore"; |
| | | } |
| | | } else { |
| | | this.status = 'noMore'; |
| | | //this.allReceivingOrders = []; |
| | | this.loadVisible = true; |
| | | this.status = this.pageNo > 1 ? "more" : "noMore"; |
| | | this.$u.toast('æ°æ®å 载失败ï¼è¯·éè¯'); |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | this.isLoading = false; |
| | | this.status = this.pageNo > 1 ? "more" : "noMore"; |
| | | this.$u.toast('ç½ç»é误ï¼è¯·æ£æ¥ç½ç»'); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | /* æ ·å¼ä¿æä¸å */ |
| | | @import '@/common/uni-ui.scss'; |
| | | |
| | | page { |