| | |
| | | }, |
| | | |
| | | openSplitDialog() { |
| | | console.log('å¼å§æå¼æå
å¼¹çª'); |
| | | |
| | | if (this.isOpeningDialog) { |
| | | console.log('æ£å¨æå¼å¼¹çªï¼è·³è¿'); |
| | | return; |
| | | } |
| | | console.log('ç´§æ¥ä¿®å¤çï¼æå¼æå
å¼¹çª'); |
| | | |
| | | if (!this.scanData.palletCode) { |
| | | this.$message.warning('请å
æ«ææçç '); |
| | | return; |
| | | } |
| | | |
| | | this.isOpeningDialog = true; |
| | | // 1. å
³éææVueå¼¹çª |
| | | this.closeAllDialogs(); |
| | | |
| | | // 2. 强å¶ä»DOMä¸ç§»é¤ææå¼¹çª |
| | | setTimeout(() => { |
| | | const dialogs = document.querySelectorAll('.custom-dialog-overlay'); |
| | | dialogs.forEach(dialog => { |
| | | if (dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | }); |
| | | |
| | | // 妿已ç»å卿å¨å¼¹çªï¼å
ç§»é¤ |
| | | if (this.manualDialog && this.manualDialog.parentNode) { |
| | | this.manualDialog.parentNode.removeChild(this.manualDialog); |
| | | } |
| | | |
| | | // 3. çå¾
ä¸å¸§ |
| | | requestAnimationFrame(() => { |
| | | // 4. ç´æ¥å建æ°å¼¹çªï¼ä¸ä¾èµVueçååºå¼ç³»ç» |
| | | this.createManualSplitDialog(); |
| | | }); |
| | | }, 10); |
| | | }, |
| | | |
| | | // å建æå¨æå
å¼¹çª |
| | | createManualSplitDialog() { |
| | | const newDialog = document.createElement('div'); |
| | | newDialog.className = 'custom-dialog-overlay emergency-fix'; |
| | | |
| | | // çæéæºIDç¨äºäºä»¶ç»å® |
| | | const dialogId = 'manual-dialog-' + Date.now(); |
| | | newDialog.id = dialogId; |
| | | |
| | | // åå¨å¼ç¨ |
| | | this.manualDialog = newDialog; |
| | | |
| | | // å¼¹çªå
容 |
| | | newDialog.innerHTML = ` |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog" style="width: 500px;"> |
| | | <div class="custom-dialog-header"> |
| | | <h3 style="margin: 0; color: #303133;">æå
æä½</h3> |
| | | <button class="close-button" onclick="document.getElementById('${dialogId}').remove()" style=" |
| | | font-size: 18px; |
| | | color: #909399; |
| | | padding: 0; |
| | | width: 24px; |
| | | height: 24px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background: none; |
| | | border: none; |
| | | cursor: pointer; |
| | | ">Ã</button> |
| | | </div> |
| | | <div class="custom-dialog-body" style="padding: 20px;"> |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">订åç¼å·:</span> |
| | | <input type="text" value="${this.scanData.orderNo}" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">æçç¼å·:</span> |
| | | <input type="text" value="${this.scanData.palletCode}" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">åæ¡ç :</span> |
| | | <div style="flex: 1; display: flex; align-items: center; gap: 10px;"> |
| | | <input type="text" id="${dialogId}-barcode" placeholder="æ«æåæ¡ç " style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | "> |
| | | <button id="${dialogId}-viewChain" style=" |
| | | padding: 8px 16px; |
| | | background: #409eff; |
| | | color: white; |
| | | border: none; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | white-space: nowrap; |
| | | ">æ¥çæå
é¾</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">ç©æç¼ç :</span> |
| | | <input type="text" id="${dialogId}-materiel" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">å©ä½æ°é:</span> |
| | | <input type="text" id="${dialogId}-remain" disabled style=" |
| | | flex: 1; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | background-color: #f5f7fa; |
| | | color: #909399; |
| | | "> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-bottom: 15px;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 5px;"> |
| | | <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">æå
æ°é:</span> |
| | | <div style="flex: 1;"> |
| | | <input type="number" id="${dialogId}-splitQty" value="1" min="0.01" step="0.01" style=" |
| | | width: 100%; |
| | | padding: 8px 12px; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | "> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="custom-dialog-footer" style=" |
| | | padding: 10px 20px 20px; |
| | | text-align: right; |
| | | border-top: 1px solid #ebeef5; |
| | | "> |
| | | <button id="${dialogId}-cancel" style=" |
| | | padding: 9px 15px; |
| | | background: white; |
| | | color: #606266; |
| | | border: 1px solid #dcdfe6; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | margin-right: 10px; |
| | | ">åæ¶</button> |
| | | <button id="${dialogId}-confirm" style=" |
| | | padding: 9px 15px; |
| | | background: #409eff; |
| | | color: white; |
| | | border: none; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | ">确认æå
</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | `; |
| | | |
| | | // æ·»å æ ·å¼ |
| | | newDialog.style.cssText = ` |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0,0,0,0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 999999; |
| | | `; |
| | | |
| | | // å¼¹çªå®¹å¨æ ·å¼ |
| | | const wrapper = newDialog.querySelector('.custom-dialog-wrapper'); |
| | | if (wrapper) { |
| | | wrapper.style.position = 'relative'; |
| | | wrapper.style.zIndex = '1000000'; |
| | | } |
| | | |
| | | // å¼¹çªå
å®¹æ ·å¼ |
| | | const dialog = newDialog.querySelector('.custom-dialog'); |
| | | if (dialog) { |
| | | dialog.style.background = 'white'; |
| | | dialog.style.borderRadius = '4px'; |
| | | dialog.style.maxWidth = '90vw'; |
| | | dialog.style.maxHeight = '90vh'; |
| | | dialog.style.boxShadow = '0 2px 12px 0 rgba(0, 0, 0, 0.1)'; |
| | | dialog.style.overflow = 'auto'; |
| | | } |
| | | |
| | | // å¼¹çªå¤´é¨æ ·å¼ |
| | | const header = newDialog.querySelector('.custom-dialog-header'); |
| | | if (header) { |
| | | header.style.display = 'flex'; |
| | | header.style.justifyContent = 'space-between'; |
| | | header.style.alignItems = 'center'; |
| | | header.style.padding = '20px 20px 10px'; |
| | | header.style.borderBottom = '1px solid #ebeef5'; |
| | | } |
| | | |
| | | document.body.appendChild(newDialog); |
| | | console.log('ç´§æ¥å¼¹çªå·²å建'); |
| | | |
| | | // ç»å®äºä»¶ |
| | | this.bindManualDialogEvents(dialogId); |
| | | |
| | | // èªå¨èç¦å°æ¡ç è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (barcodeInput) { |
| | | barcodeInput.focus(); |
| | | // æ·»å å车é®çå¬ |
| | | barcodeInput.addEventListener('keyup', (event) => { |
| | | if (event.key === 'Enter') { |
| | | this.onManualSplitBarcodeScan(dialogId); |
| | | } |
| | | }); |
| | | } |
| | | }, 100); |
| | | }, |
| | | |
| | | // ç»å®æå¨å¼¹çªäºä»¶ |
| | | bindManualDialogEvents(dialogId) { |
| | | const vm = this; // ä¿åVueå®ä¾å¼ç¨ |
| | | |
| | | // æ¥çæå
é¾æé® |
| | | const viewChainBtn = document.getElementById(`${dialogId}-viewChain`); |
| | | if (viewChainBtn) { |
| | | viewChainBtn.onclick = () => { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (barcodeInput && barcodeInput.value.trim()) { |
| | | vm.viewSplitChainFromManualDialog(barcodeInput.value.trim(), dialogId); |
| | | } else { |
| | | ElMessage.warning('请å
è¾å
¥æ¡ç '); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | const cancelBtn = document.getElementById(`${dialogId}-cancel`); |
| | | if (cancelBtn) { |
| | | cancelBtn.onclick = () => { |
| | | const dialog = document.getElementById(dialogId); |
| | | if (dialog && dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | // 确认æå
æé® |
| | | const confirmBtn = document.getElementById(`${dialogId}-confirm`); |
| | | if (confirmBtn) { |
| | | confirmBtn.onclick = () => { |
| | | vm.handleManualSplitPackage(dialogId); |
| | | }; |
| | | } |
| | | |
| | | // æ¡ç è¾å
¥æ¡ååäºä»¶ |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (barcodeInput) { |
| | | // 鲿å¤ç |
| | | let timeout; |
| | | barcodeInput.addEventListener('input', () => { |
| | | clearTimeout(timeout); |
| | | timeout = setTimeout(() => { |
| | | if (barcodeInput.value.trim()) { |
| | | vm.onManualSplitBarcodeScan(dialogId); |
| | | } |
| | | }, 500); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // æå¨å¼¹çªçæ¡ç æ«æå¤ç |
| | | async onManualSplitBarcodeScan(dialogId) { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | if (!barcodeInput || !barcodeInput.value.trim()) return; |
| | | |
| | | const barcode = barcodeInput.value.trim(); |
| | | |
| | | try { |
| | | // æ¹æ³1: ä½¿ç¨ setTimeout ç¡®ä¿å¼æ¥æ§è¡ |
| | | setTimeout(() => { |
| | | console.log('æ§è¡å¼¹çªæå¼é»è¾'); |
| | | const res = await http.post('/api/OutboundBatchPicking/split-package-info', { |
| | | orderNo: this.scanData.orderNo, |
| | | palletCode: this.scanData.palletCode, |
| | | barcode: barcode |
| | | }); |
| | | |
| | | if (res.status) { |
| | | // æ´æ°ç©æç¼ç |
| | | const materielInput = document.getElementById(`${dialogId}-materiel`); |
| | | if (materielInput) { |
| | | materielInput.value = res.data.materielCode || ''; |
| | | } |
| | | |
| | | // å
å
³éææå¼¹çª |
| | | this.closeAllDialogsImmediately(); |
| | | // æ´æ°å©ä½æ°é |
| | | const remainInput = document.getElementById(`${dialogId}-remain`); |
| | | if (remainInput) { |
| | | remainInput.value = res.data.remainQuantity || 0; |
| | | } |
| | | |
| | | // ä½¿ç¨ requestAnimationFrame ç¡®ä¿å¨ä¸ä¸å¸§æå¼ |
| | | requestAnimationFrame(() => { |
| | | console.log('设置弹çªç¶æä¸º true'); |
| | | |
| | | // é置表å |
| | | this.resetSplitForm(); |
| | | this.splitForm.orderNo = this.scanData.orderNo; |
| | | this.splitForm.palletCode = this.scanData.palletCode; |
| | | |
| | | // å
³é®ï¼ç´æ¥è®¾ç½®å¼¹çªç¶æ |
| | | this.showCustomSplitDialog = true; |
| | | |
| | | console.log('å¼¹çªç¶æå·²è®¾ç½®ï¼çå¾
DOMæ´æ°'); |
| | | |
| | | // ä½¿ç¨ nextTick ç¡®ä¿DOMæ´æ°å®æ |
| | | this.$nextTick(() => { |
| | | console.log('DOMæ´æ°å®æï¼å¼¹çªåºè¯¥æ¾ç¤ºäº'); |
| | | this.isOpeningDialog = false; |
| | | |
| | | // å°è¯èç¦å°è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const input = this.$refs.splitFormRef?.$el?.querySelector('input'); |
| | | if (input) { |
| | | input.focus(); |
| | | console.log('è¾å
¥æ¡å·²èç¦'); |
| | | } |
| | | }, 100); |
| | | }); |
| | | }); |
| | | }, 0); |
| | | |
| | | // æ´æ°æå
æ°éï¼é»è®¤ä¸º1ï¼ä¸è¶
è¿å©ä½æ°éï¼ |
| | | const splitQtyInput = document.getElementById(`${dialogId}-splitQty`); |
| | | if (splitQtyInput) { |
| | | const maxQty = res.data.remainQuantity || 0; |
| | | splitQtyInput.max = maxQty; |
| | | const currentVal = parseFloat(splitQtyInput.value) || 1; |
| | | if (currentVal > maxQty) { |
| | | splitQtyInput.value = Math.min(1, maxQty); |
| | | } |
| | | } |
| | | } else { |
| | | ElMessage.error(res.message || 'è·åæå
ä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | console.error('æå¼æå
å¼¹çªåºé:', error); |
| | | this.isOpeningDialog = false; |
| | | console.error('è·åæå
ä¿¡æ¯å¤±è´¥:', error); |
| | | ElMessage.error('è·åæå
ä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | }, |
| | | |
| | | // 仿å¨å¼¹çªæ¥çæå
é¾ |
| | | viewSplitChainFromManualDialog(barcode, dialogId) { |
| | | // å
å
³éæå¨å¼¹çª |
| | | const dialog = document.getElementById(dialogId); |
| | | if (dialog && dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | |
| | | // å»¶è¿ä¸ä¸ï¼ç¶åæå¼Vueçæå
é¾å¼¹çª |
| | | setTimeout(() => { |
| | | this.viewSplitChain(barcode); |
| | | }, 50); |
| | | }, |
| | | |
| | | // å¤çæå¨å¼¹çªçæå
æä½ |
| | | async handleManualSplitPackage(dialogId) { |
| | | const barcodeInput = document.getElementById(`${dialogId}-barcode`); |
| | | const splitQtyInput = document.getElementById(`${dialogId}-splitQty`); |
| | | |
| | | if (!barcodeInput || !barcodeInput.value.trim()) { |
| | | ElMessage.warning('请è¾å
¥åæ¡ç '); |
| | | return; |
| | | } |
| | | |
| | | if (!splitQtyInput || !splitQtyInput.value || parseFloat(splitQtyInput.value) <= 0) { |
| | | ElMessage.warning('请è¾å
¥ææçæå
æ°é'); |
| | | return; |
| | | } |
| | | |
| | | const originalBarcode = barcodeInput.value.trim(); |
| | | const splitQuantity = parseFloat(splitQtyInput.value); |
| | | |
| | | try { |
| | | // æ¾ç¤ºå è½½ç¶æ |
| | | const confirmBtn = document.getElementById(`${dialogId}-confirm`); |
| | | if (confirmBtn) { |
| | | confirmBtn.disabled = true; |
| | | confirmBtn.textContent = 'å¤çä¸...'; |
| | | } |
| | | |
| | | const res = await http.post('/api/OutboundBatchPicking/split-package', { |
| | | orderNo: this.scanData.orderNo, |
| | | palletCode: this.scanData.palletCode, |
| | | originalBarcode: originalBarcode, |
| | | splitQuantity: splitQuantity |
| | | }); |
| | | |
| | | if (res.status) { |
| | | ElMessage.success('æå
æå'); |
| | | |
| | | // å
³éæå¨å¼¹çª |
| | | const dialog = document.getElementById(dialogId); |
| | | if (dialog && dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | |
| | | // éæ°å è½½æ°æ® |
| | | await this.loadPalletData(); |
| | | } else { |
| | | ElMessage.error(res.message || 'æå
失败'); |
| | | |
| | | // æ¢å¤æé®ç¶æ |
| | | if (confirmBtn) { |
| | | confirmBtn.disabled = false; |
| | | confirmBtn.textContent = '确认æå
'; |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('æå
失败:', error); |
| | | ElMessage.error('æå
失败'); |
| | | |
| | | // æ¢å¤æé®ç¶æ |
| | | const confirmBtn = document.getElementById(`${dialogId}-confirm`); |
| | | if (confirmBtn) { |
| | | confirmBtn.disabled = false; |
| | | confirmBtn.textContent = '确认æå
'; |
| | | } |
| | | } |
| | | }, |
| | | closeAllDialogsImmediately() { |
| | |
| | | closeAllDialogs() { |
| | | this.activeDialog = null; |
| | | // ç¡®ä¿ææå¼¹çªç¶æé½è¢«éç½® |
| | | // å
³éVueå¼¹çª |
| | | this.showCustomSplitDialog = false; |
| | | this.showRevertSplitDialog = false; |
| | | this.showBatchReturnDialog = false; |
| | | this.showEmptyPalletDialog = false; |
| | | this.showSplitChainDialog = false; |
| | | |
| | | // å
³éæå¨å¼¹çª |
| | | if (this.manualDialog && this.manualDialog.parentNode) { |
| | | this.manualDialog.parentNode.removeChild(this.manualDialog); |
| | | this.manualDialog = null; |
| | | } |
| | | |
| | | // ç§»é¤ææç´§æ¥å¼¹çª |
| | | const emergencyDialogs = document.querySelectorAll('.emergency-fix'); |
| | | emergencyDialogs.forEach(dialog => { |
| | | if (dialog.parentNode) { |
| | | dialog.parentNode.removeChild(dialog); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // ååºç¸å
³æ¹æ³ |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /* åæçæ ·å¼ä¿æä¸å */ |
| | | .OutboundPicking-container { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .scanner-form { |
| | | display: flex; |
| | | gap: 10px; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .scanner-form .el-input { |
| | | width: 200px; |
| | | } |
| | | |
| | | .summary-info { |
| | | display: flex; |
| | | gap: 20px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .table-actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .selection-count { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | } |
| | | |
| | | /* åæçèªå®ä¹å¼¹çªæ ·å¼ */ |
| | | .custom-dialog-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 2000; |
| | | } |
| | | |
| | | .custom-dialog-wrapper { |
| | | position: relative; |
| | | z-index: 2001; |
| | | } |
| | | |
| | | .custom-dialog { |
| | | background: white; |
| | | border-radius: 4px; |
| | | width: 500px; |
| | | max-width: 90vw; |
| | | max-height: 90vh; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | overflow: auto; |
| | | } |
| | | |
| | | .custom-dialog-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 20px 20px 10px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .custom-dialog-header h3 { |
| | | margin: 0; |
| | | color: #303133; |
| | | } |
| | | |
| | | .close-button { |
| | | font-size: 18px; |
| | | color: #909399; |
| | | padding: 0; |
| | | width: 24px; |
| | | height: 24px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .close-button:hover { |
| | | color: #409EFF; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .custom-dialog-body { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .custom-dialog-footer { |
| | | padding: 10px 20px 20px; |
| | | text-align: right; |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .custom-dialog-footer .el-button { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .custom-dialog { |
| | | width: 95vw; |
| | | margin: 10px; |
| | | } |
| | | |
| | | .scanner-form { |
| | | flex-direction: column; |
| | | align-items: stretch; |
| | | } |
| | | |
| | | .scanner-form .el-input { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /* æ°å¢ï¼æå¨å¼¹çªçæé®æ¬åææ */ |
| | | :deep(button) { |
| | | transition: all 0.3s; |
| | | } |
| | | |
| | | :deep(button:hover) { |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | :deep(button:active) { |
| | | opacity: 0.6; |
| | | } |
| | | </style> |
| | |
| | | { |
| | | try |
| | | { |
| | | //erp æµè¯ç¯å¢ |
| | | var request = new TokenRequest { appId = "BG_SYSTEM", secretKey = "7e9239c1e132462a9cf03bfa342a044aMTcxODE5MzgxODI4Mw" }; |
| | | ////erp æ£å¼ç¯å¢ |
| | | //var request = new TokenRequest { appId = "BG_SYSTEM", secretKey = "9a3d0b5a37Bfc6dAM4b34ODb8ebDOSb937106d1b19DS29098" }; |
| | | var response = await PostAsync<TokenRequest, TokenResponse>("auth/getAccessToken", request, includeToken: false); |
| | | var _token = response?.data?.access_token; |
| | | return _token ?? ""; |
| | |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Outbound; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IRepository<Dt_InterfaceLog> _interfacelogRepository; |
| | | |
| | | // åå¨èµæºIDåå
¶å¯¹åºçé对象ãä½¿ç¨ ConcurrentDictionary ç¡®ä¿å¯¹åå
¸æä½æ¬èº«ç线ç¨å®å
¨ã |
| | | private static readonly ConcurrentDictionary<string, object> _resourceLocks = new ConcurrentDictionary<string, object>(); |
| | | |
| | | // å
¨å±éæéï¼ç¨äºä¿æ¤ _resourceLocks åå
¸ä¸ GetOrAdd æ TryRemove æ¶çç«äº |
| | | private static readonly object _globalLocker = new object(); |
| | | public InvokeMESService(IHttpClientFactory httpClientFactory, ILogger<InvokeMESService> logger, IRepository<Dt_FeedbackToMes> feedbacktomesRepository, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IOutStockLockInfoService outStockLockInfoService, IMaterialUnitService materialUnitService, IRepository<Dt_PickingRecord> pickingRecoreRepository) |
| | | public InvokeMESService(IHttpClientFactory httpClientFactory, ILogger<InvokeMESService> logger, IRepository<Dt_FeedbackToMes> feedbacktomesRepository, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IOutStockLockInfoService outStockLockInfoService, IMaterialUnitService materialUnitService, IRepository<Dt_PickingRecord> pickingRecoreRepository, IRepository<Dt_InterfaceLog> interfacelogRepository) |
| | | { |
| | | _httpClientFactory = httpClientFactory; |
| | | _logger = logger; |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _materialUnitService = materialUnitService; |
| | | _pickingRecoreRepository = pickingRecoreRepository; |
| | | _interfacelogRepository = interfacelogRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | // æ¢é失败ï¼è¯´ææå¦ä¸ä¸ªçº¿ç¨ï¼WCSåè°æäººå·¥æä½ï¼æ£å¨å¤ç |
| | | |
| | | return WebResponseContent.Instance.OK("WMSæ£å¨å¤çæ¤åä¼ ä»»å¡ï¼è¯·å¿é夿ä½ã"); |
| | | return WebResponseContent.Instance.Error("WMSæ£å¨å¤çæ¤åä¼ ä»»å¡ï¼è¯·å¿é夿ä½ã"); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | var groups = pickingRecords.GroupBy(x => x.FeedBackMesDocumentNo).ToList(); |
| | | foreach (var group in groups) |
| | | { |
| | | |
| | | |
| | | List<Dt_PickingRecord> records = group.ToList(); // 该åç»ä¸çææè®°å½ |
| | | if (string.IsNullOrEmpty(group.Key)) |
| | | { |
| | | var emptydocumentNo = UniqueValueGenerator.Generate(); |
| | | records.ForEach(x => { x.FeedBackMesDocumentNo = emptydocumentNo; }); |
| | | var result= await _pickingRecoreRepository.Db.Insertable(records).ExecuteCommandAsync(); |
| | | var result = await _pickingRecoreRepository.Db.Updateable(records).ExecuteCommandAsync(); |
| | | |
| | | var interfacelog = new Dt_InterfaceLog |
| | | { |
| | | Content = JsonConvert.SerializeObject(records), |
| | | DocumentNo = emptydocumentNo, |
| | | OrderNo = orderNo, |
| | | OrderType = "2", |
| | | }; |
| | | _interfacelogRepository.AddData(interfacelog); |
| | | |
| | | if (result > 0) |
| | | { |
| | | (bool _flowControl, WebResponseContent _value) = await FeedBackBatchToMes(outboundOrder, orderNo, orderDetails, pickingRecords, emptydocumentNo); |
| | | if (!_flowControl) |
| | | { |
| | | return _value; |
| | | } |
| | | |
| | | return _value; |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | (bool _flowControl, WebResponseContent _value) = await FeedBackBatchToMes(outboundOrder, orderNo, orderDetails, pickingRecords, group.Key); |
| | | if (!_flowControl) |
| | | var ilog = _interfacelogRepository.QueryFirst(x => x.DocumentNo == group.Key); |
| | | if (ilog == null) |
| | | { |
| | | return _value; |
| | | var interfacelog = new Dt_InterfaceLog |
| | | { |
| | | Content = JsonConvert.SerializeObject(records), |
| | | DocumentNo = group.Key, |
| | | OrderNo = orderNo, |
| | | OrderType = "2", |
| | | }; |
| | | _interfacelogRepository.AddData(interfacelog); |
| | | } |
| | | (bool _flowControl, WebResponseContent _value) = await FeedBackBatchToMes(outboundOrder, orderNo, orderDetails, pickingRecords, group.Key); |
| | | |
| | | return _value; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | x.ReturnToMESStatus = 1; |
| | | }); |
| | | await _pickingRecoreRepository.Db.Updateable(updates).ExecuteCommandAsync(); |
| | | await _interfacelogRepository.Db.Updateable<Dt_InterfaceLog>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | if (allCompleted) |
| | | { |
| | | //MESåä¼ æåï¼æ´æ°æç»ä¸ºåä¼ æåç¶æ |
| | |
| | | } |
| | | |
| | | List<string> lockLocationCodes = locationCaches.Select(x => x.LocationCode).ToList(); |
| | | |
| | | //Dictionary<string, SqlSugar.OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | //{ |
| | | // { nameof(Dt_LocationInfo.RoadwayNo),OrderByType.Asc }, |
| | | // { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | // { nameof(Dt_LocationInfo.Column),OrderByType.Asc }, |
| | | // { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | // { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | | //}; |
| | | |
| | | Dictionary<string, SqlSugar.OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_LocationInfo.RoadwayNo),OrderByType.Asc }, |
| | | //{ nameof(Dt_LocationInfo.RoadwayNo),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Column),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | | |
| | | }; |
| | | |
| | | |
| | | var first = BaseDal.QueryFirst(x => x.LocationType == locationType && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode), orderBy);//æ¥è¯¢ç©ºè´§ä½ä¿¡æ¯å¹¶æé¤5åéå
åé
çè´§ä½,æ ¹æ®å±ãåãæ·±åº¦ãè¡æåº |
| | | if (first != null) |
| | |
| | | { |
| | | LocationStatus = (int)LocationStatusEnum.InStockLock, |
| | | }).Where(x => x.Id == first.Id).ExecuteCommand(); |
| | | } |
| | | } |
| | | |
| | | return first; |
| | | } |
| | |
| | | { |
| | | return Repository.QueryData(x => locationCodes.Contains(x.LocationCode)); |
| | | } |
| | | |
| | | |
| | | public List<LocationTypeDto> GetLocationTypes() |
| | | { |
| | | return _locationTypeRepository.Db.Queryable<Dt_LocationType>().Select(x => |
| | |
| | | [Description("AGVæ§è¡ä¸")] |
| | | AGV_Executing = 310, |
| | | |
| | | [Description("AGVåè´§ä¸")] |
| | | AGV_Pull = 315, |
| | | /// <summary> |
| | | /// AGVå¾
ç»§ç»æ§è¡ |
| | | /// </summary> |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | |
| | | Task<WebResponseContent> TaskCompleted(string taskNum); |
| | | |
| | | Task TaskStatusChange(string taskNum, TaskStatusEnum taskStatusEnum); |
| | | |
| | | Task<WebResponseContent> GenerateOutboundTasksAsync(int[] keys, string outStation); |
| | | |
| | | Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews,string station=null); |
| | |
| | | |
| | | public interface ITask_HtyService : IService<Dt_Task_Hty> |
| | | { |
| | | bool DeleteAndMoveIntoHty(Dt_Task task, OperateTypeEnum operateType); |
| | | } |
| | |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | public List<string> BarCodeSubmit { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | using WIDESEA_Model.Models.Outbound; |
| | |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IAllocateService _allocateService; |
| | | private readonly IRepository<Dt_OutboundBatch> _outboundBatchRepository; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<OutboundPickingService> _logger; |
| | | |
| | | private Dictionary<string, string> stations = new Dictionary<string, string> |
| | |
| | | public OutboundBatchPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, |
| | | IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, |
| | | IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService, |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository) : base(BaseDal) |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, ITask_HtyService task_HtyService) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | |
| | | _dailySequenceService = dailySequenceService; |
| | | _allocateService = allocateService; |
| | | _outboundBatchRepository = outboundBatchRepository; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | // <summary> |
| | |
| | | |
| | | // æ´æ°éå®è®°å½ç¶æä¸ºå·²ååº |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Operator = App.User.UserName; |
| | | lockInfo.Operator = App.User.UserName; |
| | | |
| | | await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync(); |
| | | |
| | |
| | | |
| | | // æ´æ°éå®è®°å½ç¶æä¸ºå·²ååº |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Operator = App.User.UserName; |
| | | lockInfo.Operator = App.User.UserName; |
| | | |
| | | await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync(); |
| | | |
| | |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = currentTask.WarehouseId |
| | | }; |
| | | try |
| | | { |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"å建ååºä»»å¡å¤±è´¥ - 订å: {orderNo}, æç: {palletCode}"); |
| | | throw new Exception($"å建ååºä»»å¡å¤±è´¥ - 订å: {orderNo}, æç: {palletCode}"); |
| | | |
| | | } |
| | | // åéESSå½ä»¤ |
| | | await SendESSCommands(palletCode, currentTask.TargetAddress, returnTask); |
| | | |
| | |
| | | // åé
æ°éå¨è®¢åæç»å±é¢ç»ä¸å¤ç |
| | | var originalStatus = lockInfo.Status; |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Operator = App.User.UserName; |
| | | lockInfo.Operator = App.User.UserName; |
| | | |
| | | await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync(); |
| | | |
| | |
| | | /// <summary> |
| | | /// å¤çæªåæ£çéå®è®°å½ååº |
| | | /// </summary> |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¤çæçä¸çåºåè´§ç©ååº |
| | |
| | | |
| | | }; |
| | | // ä¿åååºä»»å¡ |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | var insertcount = await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | if (insertcount <= 0) |
| | | { |
| | | throw new Exception("å建任å¡å¤±è´¥ï¼"); |
| | | } |
| | | var targetAddress = originalTask.TargetAddress; |
| | | |
| | | // å é¤åå§åºåºä»»å¡ |
| | | _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | //_taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | |
| | | |
| | |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | using WIDESEA_Model.Models.Check; |
| | |
| | | private readonly IInboundOrderDetailService _inboundOrderDetailService; |
| | | private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository; |
| | | private readonly IReCheckOrderService _reCheckOrderService; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<OutboundPickingService> _logger; |
| | | |
| | | private Dictionary<string, string> stations = new Dictionary<string, string> |
| | |
| | | public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, |
| | | IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, |
| | | IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService, |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService) : base(BaseDal) |
| | | IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService, ITask_HtyService task_HtyService) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | |
| | | _inboundOrderDetailService = inboundOrderDetailService; |
| | | _warehouseAreaRepository = warehouseAreaRepository; |
| | | _reCheckOrderService = reCheckOrderService; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | }; |
| | | // ä¿åååºä»»å¡ |
| | | await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | var insertcount = await _taskRepository.Db.Insertable(returnTask).ExecuteCommandAsync(); |
| | | if (insertcount <= 0) |
| | | { |
| | | throw new Exception("å建任å¡å¤±è´¥ï¼"); |
| | | } |
| | | var targetAddress = originalTask.TargetAddress; |
| | | |
| | | // å é¤åå§åºåºä»»å¡ |
| | | _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | |
| | | // _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await _taskRepository.Db.Deleteable(originalTask).ExecuteCommandAsync(); |
| | | } |
| | | |
| | | |
| | | // ç» ESS åéæµå¨ä¿¡å·ååå»ºä»»å¡ |
| | |
| | | TaskNum = 0, |
| | | Status = (int)OutLockStockStatusEnum.æ£é宿, |
| | | Unit = outboundOrderDetail.Unit, |
| | | SupplyCode = outboundOrderDetail.SupplyCode?? "æ ", |
| | | SupplyCode = outboundOrderDetail.SupplyCode ?? "æ ", |
| | | OrderType = outboundOrder.OrderType, |
| | | CurrentBarcode = inboundOrderDetail.Barcode, |
| | | IsSplitted = 1, |
| | | Operator = App.User.UserName, |
| | | lineNo= outboundOrderDetail.lineNo, |
| | | lineNo = outboundOrderDetail.lineNo, |
| | | WarehouseCode = outboundOrderDetail.WarehouseCode ?? "æ ", |
| | | BarcodeQty=outboundOrderDetail.NoStockOutQty, |
| | | BarcodeUnit =outboundOrderDetail.BarcodeUnit, |
| | | BarcodeQty = outboundOrderDetail.NoStockOutQty, |
| | | BarcodeUnit = outboundOrderDetail.BarcodeUnit, |
| | | BatchNo = outboundOrderDetail.BatchNo |
| | | }; |
| | | _outStockLockInfoService.AddData(newLockInfo); |
| | |
| | | var documentNo = UniqueValueGenerator.Generate(); |
| | | |
| | | var outfeedmodel = new FeedbackOutboundRequestModel |
| | | { |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | business_type = outboundOrder.BusinessType, |
| | | factoryArea = outboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = App.User.UserName, |
| | | orderNo = outboundOrder.UpperOrderNo, |
| | | documentsNO = documentNo, |
| | | status = outboundOrder.OrderStatus, |
| | | details = new List<FeedbackOutboundDetailsModel>() |
| | | }; |
| | | { |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | business_type = outboundOrder.BusinessType, |
| | | factoryArea = outboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = App.User.UserName, |
| | | orderNo = outboundOrder.UpperOrderNo, |
| | | documentsNO = documentNo, |
| | | status = outboundOrder.OrderStatus, |
| | | details = new List<FeedbackOutboundDetailsModel>() |
| | | }; |
| | | foreach (var detail in outboundOrder.Details) |
| | | { |
| | | // è·å该æç»å¯¹åºçæ¡ç ä¿¡æ¯ï¼ä»éå®è®°å½ï¼ |
| | |
| | | (x.Status == (int)OutLockStockStatusEnum.æ£é宿 || x.Status == (int)OutLockStockStatusEnum.å·²ååº)) |
| | | .ToListAsync(); |
| | | |
| | | var groupdata = detailLocks.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | var groupdata = detailLocks.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode }) |
| | | .Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | |
| | | materialCode = group.Key.MaterielCode, |
| | | lineNo = group.Key.lineNo, |
| | | warehouseCode = group.Key.WarehouseCode, |
| | | qty = group.Sum(x => x.PickedQty), |
| | | currentDeliveryQty = group.Sum(x => x.PickedQty), |
| | | unit = group.Key.BarcodeUnit, |
| | | barcodes = group.Select(lockInfo => new WIDESEA_DTO.Outbound.BarcodesModel |
| | | { |
| | | barcode = lockInfo.CurrentBarcode, |
| | | supplyCode = lockInfo.SupplyCode, |
| | | batchNo = lockInfo.BatchNo, |
| | | unit = lockInfo.BarcodeUnit, |
| | | qty = lockInfo.PickedQty |
| | | }).ToList() |
| | | }).ToList(); |
| | | outfeedmodel.details.AddRange(groupdata); |
| | | } |
| | | var result = await _invokeMESService.FeedbackOutbound(outfeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.OrderId == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | materialCode = group.Key.MaterielCode, |
| | | lineNo = group.Key.lineNo, |
| | | warehouseCode = group.Key.WarehouseCode, |
| | | qty = group.Sum(x => x.PickedQty), |
| | | currentDeliveryQty = group.Sum(x => x.PickedQty), |
| | | unit = group.Key.BarcodeUnit, |
| | | barcodes = group.Select(lockInfo => new WIDESEA_DTO.Outbound.BarcodesModel |
| | | { |
| | | barcode = lockInfo.CurrentBarcode, |
| | | supplyCode = lockInfo.SupplyCode, |
| | | batchNo = lockInfo.BatchNo, |
| | | unit = lockInfo.BarcodeUnit, |
| | | qty = lockInfo.PickedQty |
| | | }).ToList() |
| | | }).ToList(); |
| | | outfeedmodel.details.AddRange(groupdata); |
| | | } |
| | | var result = await _invokeMESService.FeedbackOutbound(outfeedmodel); |
| | | if (result != null && result.code == 200) |
| | | { |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.OrderId == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | |
| | | <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ITaskInfoService\WIDESEA_ITaskInfoService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | private readonly IRecordService _recordService; |
| | | private readonly IAllocateService _allocateService; |
| | | private readonly IInvokeMESService _invokeMESService; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | | private Dictionary<string, SqlSugar.OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _allocateOrderDetailRepository = allocateOrderDetailRepository; |
| | | _allocateOrderRepository = allocateOrderRepository; |
| | | _materialUnitService = materialUnitService; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | public async Task TaskStatusChange(string taskNum,TaskStatusEnum taskStatusEnum) |
| | | { |
| | | if (int.TryParse(taskNum, out var newTaskNum)) |
| | | { |
| | | await Db.Updateable<Dt_Task>().SetColumns(it => new Dt_Task { |
| | | TaskStatus = taskStatusEnum.ObjToInt() |
| | | }) |
| | | .Where(it => it.TaskNum == newTaskNum) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | // BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup); |
| | |
| | | }).ToList(); |
| | | allocatefeedmodel.Details = groupedData; |
| | | |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | var feedbackresult = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | |
| | | }).ToList(); |
| | | allocatefeedmodel.Details = groupedData; |
| | | |
| | | var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (result != null && result.code == 200) |
| | | var feedbackresult = await _invokeMESService.FeedbackAllocate(allocatefeedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | |
| | | }).ToList(); |
| | | feedmodel.details = groupedData; |
| | | |
| | | var result = await _invokeMESService.FeedbackInbound(feedmodel); |
| | | if (result != null && result.code == 200) |
| | | var feedbackresult = await _invokeMESService.FeedbackInbound(feedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | |
| | | var outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().First(x => x.OrderNo == task.OrderNo); |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | // BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | |
| | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | |
| | | // å é¤ä»»å¡è®°å½ |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | BaseDal.DeleteData(task); |
| | | |
| | | //BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | //BaseDal.DeleteData(task); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | // è®°å½è´§ä½ç¶æåæ´ |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord( |
| | | locationInfo, |
| | |
| | | //ä¸ç¨åä¼ |
| | | } |
| | | else |
| | | { |
| | | { |
| | | if (outboundOrder != null && outboundOrder.IsBatch == 0) |
| | | { |
| | | var feedmodel = new FeedbackOutboundRequestModel |
| | |
| | | } |
| | | else if (outboundOrder != null && outboundOrder.IsBatch == 1) |
| | | { |
| | | await _invokeMESService.BatchOrderFeedbackToMes(new List<string>(){outboundOrder.OrderNo },2); |
| | | await _invokeMESService.BatchOrderFeedbackToMes(new List<string>() { outboundOrder.OrderNo }, 2); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | //_stockRepository.Db.Deleteable(stockInfo).ExecuteCommand(); |
| | | // BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | |
| | | var stockresult = _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | if (!stockresult) |
| | | { |
| | | _stockRepository.Db.Deleteable(stockInfo).ExecuteCommand(); |
| | | } |
| | | _stockService.StockInfoService.DeleteData(stockInfo); |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | |
| | | using WIDESEA_Core.BaseRepository; |
| | | using AutoMapper; |
| | | using Microsoft.Extensions.Logging; |
| | | using System.Transactions; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | |
| | | public class Task_HtyService : ServiceBase<Dt_Task_Hty, IRepository<Dt_Task_Hty>>, ITask_HtyService |
| | | { |
| | | public Task_HtyService(IRepository<Dt_Task_Hty> BaseDal) : base(BaseDal) |
| | | private readonly ILogger<Task_HtyService> _logger; |
| | | |
| | | private readonly IMapper _mapper; // AutoMapperå®ä¾ |
| | | public Task_HtyService(IRepository<Dt_Task_Hty> BaseDal, IMapper mapper, ILogger<Task_HtyService> logger) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _logger = logger; |
| | | } |
| | | public bool DeleteAndMoveIntoHty(Dt_Task task, OperateTypeEnum operateType) |
| | | { |
| | | // using var transaction = Db.Ado.UseTran(); |
| | | try |
| | | { |
| | | var historyEntity = _mapper.Map<Dt_Task_Hty>(task); |
| | | |
| | | // 2. å¡«å
åå²å®ä½æ ¸å¿å段 |
| | | historyEntity.SourceId = task.TaskId; |
| | | historyEntity.OperateType = App.User?.UserName != null ? OperateTypeEnum.èªå¨å®æ.ToString() : OperateTypeEnum.äººå·¥å®æ.ToString(); |
| | | historyEntity.Creater = App.User?.UserName != null ? App.User.UserName : "System"; |
| | | |
| | | // è¦çä¿®æ¹äºº/ä¿®æ¹æ¶é´ï¼ä¼å
级é«äºæ å°ï¼ |
| | | // historyEntity.Modifier = App.User?.UserId > 0 ? App.User?.UserName : "System"; |
| | | // historyEntity.ModifyDate = DateTime.Now; |
| | | |
| | | // 3. æå
¥åå²è¡¨ï¼ç±»åå®å
¨ï¼æ åå°æ¼æ¥è¡¨åï¼ |
| | | |
| | | int insertCount = Db.Insertable(historyEntity).ExecuteCommand(); |
| | | |
| | | if (insertCount <= 0) |
| | | { |
| | | _logger.LogError($"ä»»å¡åå²è¡¨Dt_Task_Hty [{task.TaskNum}]æå
¥å¤±è´¥ï¼å½±åè¡æ°ä¸º0"); |
| | | // transaction.RollbackTran(); |
| | | return false; |
| | | } |
| | | |
| | | // 4. å é¤åå®ä½ï¼ç±»åå®å
¨ï¼ |
| | | int deleteCount = Db.Deleteable(task).ExecuteCommand(); |
| | | if (deleteCount <= 0) |
| | | { |
| | | _logger.LogError("ä»»å¡ä¸å¡å®ä½[{0}]å é¤å¤±è´¥ï¼å½±åè¡æ°ä¸º0", task.TaskNum); |
| | | // transaction.RollbackTran(); |
| | | return false; |
| | | } |
| | | //transaction.CommitTran(); |
| | | _logger.LogInformation("ä»»å¡å®ä½[{0}]å·²æåç§»å
¥åå²è¡¨[{1}]å¹¶å é¤åæ°æ®", task.TaskNum); |
| | | return true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // transaction.RollbackTran(); |
| | | _logger.LogError(ex, "ä»»å¡å é¤å®ä½[{0}]å¹¶ç§»å
¥åå²è¡¨å¤±è´¥", task.TaskNum); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | private async Task HandleTaskSuspended(StatusCallbackRequest request) |
| | | { |
| | | _logger.LogWarning("ä»»å¡æèµ·: TaskCode={TaskCode}, ç³»ç»ä»»å¡ç ={SysTaskCode}, åå ={Message}", |
| | | request.TaskCode, request.SysTaskCode, request.Message); |
| | | _logger.LogWarning("ä»»å¡æèµ·: TaskCode={TaskCode}, ç³»ç»ä»»å¡ç ={SysTaskCode}, åå ={Message}",request.TaskCode, request.SysTaskCode, request.Message); |
| | | |
| | | // è¿éæ·»å æ¨çæèµ·å¤çé»è¾ |
| | | await Task.CompletedTask; |
| | |
| | | /// </summary> |
| | | private async Task HandleTaskAllocated(StatusCallbackRequest request) |
| | | { |
| | | _logger.LogInformation("ä»»å¡åé
: TaskCode={TaskCode}, Robot={Robot}", |
| | | request.TaskCode, request.RobotCode); |
| | | _logger.LogInformation("ä»»å¡åé
: TaskCode={TaskCode}, Robot={Robot}",request.TaskCode, request.RobotCode); |
| | | |
| | | // è¿éæ·»å æ¨çä»»å¡åé
å¤çé»è¾ |
| | | await Task.CompletedTask; |
| | |
| | | { |
| | | if (request.Status == WIDESEA_DTO.Basic.TaskStatus.success) |
| | | { |
| | | _logger.LogInformation("åç®±å®æ: Container={Container}, Location={Location}", |
| | | request.ContainerCode, request.LocationCode); |
| | | _logger.LogInformation("åç®±å®æ: Container={Container}, Location={Location}", request.ContainerCode, request.LocationCode); |
| | | |
| | | await _taskService.TaskStatusChange(request.TaskCode, WIDESEA_Common.TaskEnum.TaskStatusEnum.AGV_Pull); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (request.Status == WIDESEA_DTO.Basic.TaskStatus.success) |
| | | { |
| | | _logger.LogInformation("æ¾ç®±å®æ: Container={Container}, Location={Location}", |
| | | request.ContainerCode, request.LocationCode); |
| | | _logger.LogInformation("æ¾ç®±å®æ: Container={Container}, Location={Location}", request.ContainerCode, request.LocationCode); |
| | | await _taskService.TaskStatusChange(request.TaskCode, WIDESEA_Common.TaskEnum.TaskStatusEnum.AGV_Puting); |
| | | } |
| | | else |
| | | { |
| | |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_InboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_OutboundService; |
| | | |
| | |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<InboundOrderController> _logger; |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository) : base(service) |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService) : base(service) |
| | | { |
| | | this.erpApiService = erpApiService; |
| | | _invokeMESService = invokeMESService; |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _outboundOrderDetailService = outboundOrderDetailService; |
| | | _taskRepository = taskRepository; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | | public async Task<WebResponseContent> Test() |
| | | { |
| | | |
| | | var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.人工å é¤); |
| | | if (result) |
| | | { |
| | | var sddd = "trueee"; |
| | | } |
| | | //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | //_taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.èªå¨å®æ); |
| | | // Service.Db.Deleteable<Dt_InboundOrder>().Where(x=>x.UpperOrderNo== "12020251100040").ExecuteCommand(); |
| | | //_inboundService.InboundOrderDetailService.Db.Deleteable<Dt_InboundOrderDetail>() |
| | | // .Where(p => SqlFunc.Subqueryable<Dt_InboundOrder>().Where(s => s.Id == p.OrderId && s.UpperOrderNo == "12020251100040").Any()).ExecuteCommand(); |
| | |
| | | |
| | | //var pdddurchaseToStockResult = await _materialUnitService.ConvertFromToStockAsync("100513-00303", "W013", 1); |
| | | |
| | | //var sddd = _locationInfoService.AssignLocation(); |
| | | //var sddd = _locationInfoService.AssignLocation(1); |
| | | //var code = sddd.LocationCode; |
| | | //var ssss=await _dailySequenceService.GetNextSequenceAsync(); |
| | | //var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0'); |
| | |
| | | //await erpApiService.GetMaterialInfoAsync(new WIDESEA_DTO.Basic.MaterialRequest()); |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | return WebResponseContent.Instance.OK(result?1:0 ); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | |
| | | CreateMap<Dt_ReceiveOrderDetail, Dt_CheckOrder>().ForMember(a => a.ReceivedQuantity, b => b.MapFrom(x => x.ReceivedQuantity)).ForMember(a => a.MaterielCode, b => b.MapFrom(x => x.MaterielCode)).ForMember(a => a.CheckOrderStatus, b => b.MapFrom(x => CheckOrderStatusEnum.NotCheck.ObjToInt())); |
| | | |
| | | CreateMap<Dt_Task, WMSTaskDTO>(); |
| | | |
| | | CreateMap<Dt_Task, Dt_Task_Hty>() |
| | | .ForMember(dest => dest.SourceId, opt => opt.Ignore()) // æå¨å¡«å
ï¼å¿½ç¥æ å° |
| | | .ForMember(dest => dest.OperateType, opt => opt.Ignore()); // æå¨å¡«å
ï¼å¿½ç¥æ å° |
| | | } |
| | | } |
| | | } |