From 7688834261de1dd9711a4a175989b75dd00906cc Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 02 十二月 2025 19:42:22 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue | 2
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js | 485 ++++++++++++++++++++--------------------
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 162 ++++++------
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 11
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 4
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue | 28 -
6 files changed, 337 insertions(+), 355 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
index 388b79d..2c950a6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
@@ -209,7 +209,7 @@
? "api/Task/GenerateOutboundTask?orderDetailId="
: "api/Task/GenerateOutboundTask?orderDetailId=";
this.http
- .post(url + this.row.id, this.selection, "鏁版嵁澶勭悊涓�")
+ .post(url + this.row.id+"&station="+this.outboundForm.selectedPlatform, this.selection, "鏁版嵁澶勭悊涓�")
.then((x) => {
if (!x.status) return this.$message.error(x.message);
this.$message.success("鎿嶄綔鎴愬姛");
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue"
index 13c29f0..4e388a9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue"
@@ -2,8 +2,11 @@
<vol-box v-model="show" title="绌烘墭鍑哄簱" :width="800" :height="600">
<template #content>
<el-form ref="form" :model="form" label-width="90px">
- <el-form-item label="鍑哄簱鏁伴噺">
- <el-input type="text" v-model="this.form.remark"></el-input>
+ <el-form-item label="鍑哄簱鏁伴噺:">
+ <el-select v-model="num" placeholder="璇烽�夋嫨鍑哄簱鏁伴噺">
+ <el-option v-for="item in 6" :key="item" :label="item.toString()" :value="item">
+ </el-option>
+ </el-select>
</el-form-item>
</el-form>
</template>
@@ -28,36 +31,23 @@
},
data() {
return {
- form: {
- remark: ''
- },
- palletCode: '',
+ num: 1,
show: false
}
},
methods: {
- open(palletCode) {
+ open() {
this.show = true
- this.palletCode = palletCode
},
submit() {
this.$emit('parentCall', ($vue) => {
- console.log(this.form.remark, this.palletCode)
- if (
- !this.palletCode ||
- this.palletCode == ''
- ) {
- this.$message.error('鍙傛暟閿欒')
- return
- }
- this.http.post(`/api/Task/OutBoundTaskAsync?palletCode=${this.palletCode}&remark=${this.form.remark}`, {}, '鏁版嵁澶勭悊涓�...')
+ this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}`, {}, '鏁版嵁澶勭悊涓�...')
.then((x) => {
if (!x.status) {
this.$message.error(x.message)
} else {
- console.log(x);
this.show = false
- this.$Message.success(this.palletCode + '鍑哄簱鎴愬姛')
+ this.$Message.success(x.message)
$vue.refresh();
}
})
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
index 860af89..bbd9987 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
@@ -48,260 +48,260 @@
});
}
}, */
- {
- name: '绌烘墭鐩樺嚭搴�',
- type: 'primary',
- value: '绌烘墭鐩樺嚭搴�',
- onClick: function () {
+ // {
+ // name: '绌烘墭鐩樺嚭搴�',
+ // type: 'primary',
+ // value: '绌烘墭鐩樺嚭搴�',
+ // onClick: function () {
- const platformOptions = Array.from({ length: 1 }, (_, i) => {
- const num = 1;
- return { label: `绔欏彴${num}`, value: `1-2` };
- });
+ // const platformOptions = Array.from({ length: 1 }, (_, i) => {
+ // const num = 1;
+ // return { label: `绔欏彴${num}`, value: `1-2` };
+ // });
- const quantityOptions = Array.from({ length: 6 }, (_, i) => ({
- label: (i + 1).toString(),
- value: i + 1
- }));
+ // const quantityOptions = Array.from({ length: 6 }, (_, i) => ({
+ // label: (i + 1).toString(),
+ // value: i + 1
+ // }));
- const warehouseOptions = ref([]);
- const isLoadingWarehouses = ref(false);
+ // const warehouseOptions = ref([]);
+ // const isLoadingWarehouses = ref(false);
- const getWarehouseList = async () => {
- isLoadingWarehouses.value = true;
- try {
- const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes');
- if (status && Array.isArray(data)) {
- // 鏍煎紡鍖栦粨搴撻�夐」锛氶�傞厤ElSelect鐨刲abel-value鏍煎紡
- warehouseOptions.value = data.map(item => ({
- label: item.locationTypeDesc,
- value: item.locationType
- }));
- } else {
- ElMessage.error('鑾峰彇鍖哄煙鍒楄〃澶辫触');
- warehouseOptions.value = [];
- }
- } catch (err) {
- ElMessage.error('鍖哄煙鏁版嵁璇锋眰寮傚父锛岃绋嶅悗閲嶈瘯');
- warehouseOptions.value = [];
- } finally {
- isLoadingWarehouses.value = false;
- }
- };
+ // const getWarehouseList = async () => {
+ // isLoadingWarehouses.value = true;
+ // try {
+ // const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes');
+ // if (status && Array.isArray(data)) {
+ // // 鏍煎紡鍖栦粨搴撻�夐」锛氶�傞厤ElSelect鐨刲abel-value鏍煎紡
+ // warehouseOptions.value = data.map(item => ({
+ // label: item.locationTypeDesc,
+ // value: item.locationType
+ // }));
+ // } else {
+ // ElMessage.error('鑾峰彇鍖哄煙鍒楄〃澶辫触');
+ // warehouseOptions.value = [];
+ // }
+ // } catch (err) {
+ // ElMessage.error('鍖哄煙鏁版嵁璇锋眰寮傚父锛岃绋嶅悗閲嶈瘯');
+ // warehouseOptions.value = [];
+ // } finally {
+ // isLoadingWarehouses.value = false;
+ // }
+ // };
- const mountNode = document.createElement('div');
- document.body.appendChild(mountNode);
+ // const mountNode = document.createElement('div');
+ // document.body.appendChild(mountNode);
- const formData = reactive({
- warehouseCode: '',
- palletCode: '',
- selectedPlatform: platformOptions[0].value,
- quantity: 1
- });
+ // const formData = reactive({
+ // warehouseCode: '',
+ // palletCode: '',
+ // selectedPlatform: platformOptions[0].value,
+ // quantity: 1
+ // });
- const vnode = createVNode(ElDialog, {
- title: '绌烘墭鐩樺嚭搴�',
- width: '500px',
- modelValue: true,
- appendToBody: true,
- onOpened: async () => {
- await getWarehouseList();
- const inputRef = vnode.component.refs.boxCodeInput;
- inputRef?.focus();
- },
- 'onUpdate:modelValue': (isVisible) => {
- if (!isVisible) {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- }
- },
- style: {
- padding: '20px 0',
- borderRadius: '8px'
- }
- }, {
- default: () => h(ElForm, {
- model: formData,
- rules: {
- warehouseCode: [
- { required: true, message: '璇烽�夋嫨鍖哄煙', trigger: ['change', 'blur'] }
- ],
- palletCode: [
- { type: 'string', message: '鏂欑鍙峰繀椤讳负瀛楃涓�', trigger: 'blur' }
- ],
- selectedPlatform: [
- { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
- ],
- quantity: [
- { required: true, message: '璇烽�夋嫨绌虹鏁伴噺', trigger: 'change' }
- ]
- },
- ref: 'batchOutForm',
- labelWidth: '100px',
- style: {
- padding: '0 30px',
- }
- },
- [
- // h(ElFormItem, {
- // label: '浠撳簱鍖哄煙',
- // prop: 'warehouseCode',
- // style: {
- // marginBottom: '24px'
- // }
- // }, [
- // h(ElSelect, {
- // placeholder: '璇烽�夋嫨浠撳簱鍖哄煙',
- // modelValue: formData.warehouseCode,
- // 'onUpdate:modelValue': (val) => {
- // formData.warehouseCode = val;
- // },
- // style: {
- // width: '100%',
- // height: '40px',
- // borderRadius: '4px',
- // borderColor: '#dcdfe6'
- // }
- // }, warehouseOptions.value.map(platform =>
- // h(ElOption, { label: platform.label, value: platform.value })
- // ))
- // ]),
- h(ElFormItem, {
- label: '鍑哄簱绔欏彴',
- prop: 'selectedPlatform',
- style: {
- marginBottom: '24px'
- }
- }, [
- h(ElSelect, {
- placeholder: '璇烽�夋嫨鍑哄簱绔欏彴',
- modelValue: formData.selectedPlatform,
- 'onUpdate:modelValue': (val) => {
- formData.selectedPlatform = val;
- },
- style: {
- width: '100%',
- height: '40px',
- borderRadius: '4px',
- borderColor: '#dcdfe6'
- }
- }, platformOptions.map(platform =>
- h(ElOption, { label: platform.label, value: platform.value })
- ))
- ]),
- // h(ElFormItem,{
- // label:'鍑哄簱鏁伴噺',
- // prop:'quantity',
- // style:{
- // marginBottom:'24px'
- // }
- // },[h(ElSelect,{
- // placeholder:'璇烽�夋嫨绌虹鏁伴噺',
- // modelValue:formData.quantity,
- // 'onUpdate:modelValue':(val)=>{
- // formData.quantity=val;
- // },
- // style:{
- // width:'100%',
- // height:'40px',
- // borderRadius:'4px',
- // borderColor:'#dcdfe6'
- // },
- // filterable:false
- // },
- // quantityOptions.map(option=>
- // h(ElOption,{
- // label:option.label,
- // value:option.value
- // })
- // )
- // )]),
- h(ElFormItem, {
- label: '鏂欑鍙�',
- prop: 'palletCode',
- style: {
- marginBottom: '16px'
- }
- }, [
- h(ElInput, {
- type: 'text',
- placeholder: '鍙�夎緭鍏ユ枡绠卞彿锛屼笉濉垯鑷姩鍒嗛厤绌烘枡绠�',
- modelValue: formData.palletCode,
- 'onUpdate:modelValue': (val) => {
- formData.palletCode = val;
- },
- style: {
- width: '100%',
- height: '40px',
- borderRadius: '4px',
- borderColor: '#dcdfe6'
- },
- attrs: {
- placeholderStyle: 'color: #909399;'
- }
- })
- ]),
+ // const vnode = createVNode(ElDialog, {
+ // title: '绌烘墭鐩樺嚭搴�',
+ // width: '500px',
+ // modelValue: true,
+ // appendToBody: true,
+ // onOpened: async () => {
+ // await getWarehouseList();
+ // const inputRef = vnode.component.refs.boxCodeInput;
+ // inputRef?.focus();
+ // },
+ // 'onUpdate:modelValue': (isVisible) => {
+ // if (!isVisible) {
+ // render(null, mountNode);
+ // document.body.removeChild(mountNode);
+ // }
+ // },
+ // style: {
+ // padding: '20px 0',
+ // borderRadius: '8px'
+ // }
+ // }, {
+ // default: () => h(ElForm, {
+ // model: formData,
+ // rules: {
+ // warehouseCode: [
+ // { required: true, message: '璇烽�夋嫨鍖哄煙', trigger: ['change', 'blur'] }
+ // ],
+ // palletCode: [
+ // { type: 'string', message: '鏂欑鍙峰繀椤讳负瀛楃涓�', trigger: 'blur' }
+ // ],
+ // selectedPlatform: [
+ // { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
+ // ],
+ // quantity: [
+ // { required: true, message: '璇烽�夋嫨绌虹鏁伴噺', trigger: 'change' }
+ // ]
+ // },
+ // ref: 'batchOutForm',
+ // labelWidth: '100px',
+ // style: {
+ // padding: '0 30px',
+ // }
+ // },
+ // [
+ // // h(ElFormItem, {
+ // // label: '浠撳簱鍖哄煙',
+ // // prop: 'warehouseCode',
+ // // style: {
+ // // marginBottom: '24px'
+ // // }
+ // // }, [
+ // // h(ElSelect, {
+ // // placeholder: '璇烽�夋嫨浠撳簱鍖哄煙',
+ // // modelValue: formData.warehouseCode,
+ // // 'onUpdate:modelValue': (val) => {
+ // // formData.warehouseCode = val;
+ // // },
+ // // style: {
+ // // width: '100%',
+ // // height: '40px',
+ // // borderRadius: '4px',
+ // // borderColor: '#dcdfe6'
+ // // }
+ // // }, warehouseOptions.value.map(platform =>
+ // // h(ElOption, { label: platform.label, value: platform.value })
+ // // ))
+ // // ]),
+ // h(ElFormItem, {
+ // label: '鍑哄簱绔欏彴',
+ // prop: 'selectedPlatform',
+ // style: {
+ // marginBottom: '24px'
+ // }
+ // }, [
+ // h(ElSelect, {
+ // placeholder: '璇烽�夋嫨鍑哄簱绔欏彴',
+ // modelValue: formData.selectedPlatform,
+ // 'onUpdate:modelValue': (val) => {
+ // formData.selectedPlatform = val;
+ // },
+ // style: {
+ // width: '100%',
+ // height: '40px',
+ // borderRadius: '4px',
+ // borderColor: '#dcdfe6'
+ // }
+ // }, platformOptions.map(platform =>
+ // h(ElOption, { label: platform.label, value: platform.value })
+ // ))
+ // ]),
+ // // h(ElFormItem,{
+ // // label:'鍑哄簱鏁伴噺',
+ // // prop:'quantity',
+ // // style:{
+ // // marginBottom:'24px'
+ // // }
+ // // },[h(ElSelect,{
+ // // placeholder:'璇烽�夋嫨绌虹鏁伴噺',
+ // // modelValue:formData.quantity,
+ // // 'onUpdate:modelValue':(val)=>{
+ // // formData.quantity=val;
+ // // },
+ // // style:{
+ // // width:'100%',
+ // // height:'40px',
+ // // borderRadius:'4px',
+ // // borderColor:'#dcdfe6'
+ // // },
+ // // filterable:false
+ // // },
+ // // quantityOptions.map(option=>
+ // // h(ElOption,{
+ // // label:option.label,
+ // // value:option.value
+ // // })
+ // // )
+ // // )]),
+ // h(ElFormItem, {
+ // label: '鏂欑鍙�',
+ // prop: 'palletCode',
+ // style: {
+ // marginBottom: '16px'
+ // }
+ // }, [
+ // h(ElInput, {
+ // type: 'text',
+ // placeholder: '鍙�夎緭鍏ユ枡绠卞彿锛屼笉濉垯鑷姩鍒嗛厤绌烘枡绠�',
+ // modelValue: formData.palletCode,
+ // 'onUpdate:modelValue': (val) => {
+ // formData.palletCode = val;
+ // },
+ // style: {
+ // width: '100%',
+ // height: '40px',
+ // borderRadius: '4px',
+ // borderColor: '#dcdfe6'
+ // },
+ // attrs: {
+ // placeholderStyle: 'color: #909399;'
+ // }
+ // })
+ // ]),
- h('div', {
- style: {
- textAlign: 'right',
- marginTop: '8px',
- paddingRight: '4px'
- }
- }, [
- h(ElButton, {
- type: 'text',
- onClick: () => {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- ElMessage.info('鍙栨秷鍑哄簱鎿嶄綔');
- },
- style: {
- marginRight: '8px',
- color: '#606266'
- }
- }, '鍙栨秷'),
- h(ElButton, {
- type: 'primary',
- onClick: async () => {
- const formRef = vnode.component.refs.batchOutForm;
- try {
- await formRef.validate();
- } catch (err) {
- return;
- }
+ // h('div', {
+ // style: {
+ // textAlign: 'right',
+ // marginTop: '8px',
+ // paddingRight: '4px'
+ // }
+ // }, [
+ // h(ElButton, {
+ // type: 'text',
+ // onClick: () => {
+ // render(null, mountNode);
+ // document.body.removeChild(mountNode);
+ // ElMessage.info('鍙栨秷鍑哄簱鎿嶄綔');
+ // },
+ // style: {
+ // marginRight: '8px',
+ // color: '#606266'
+ // }
+ // }, '鍙栨秷'),
+ // h(ElButton, {
+ // type: 'primary',
+ // onClick: async () => {
+ // const formRef = vnode.component.refs.batchOutForm;
+ // try {
+ // await formRef.validate();
+ // } catch (err) {
+ // return;
+ // }
- http.post('/api/Task/PalletOutboundTask?palletCode=' + formData.palletCode + '&endStation=' + formData.selectedPlatform, {
+ // http.post('/api/Task/PalletOutboundTask?palletCode=' + formData.palletCode + '&endStation=' + formData.selectedPlatform, {
- }).then(({ data, status, message }) => {
- if (status) {
+ // }).then(({ data, status, message }) => {
+ // if (status) {
- ElMessage.success(`鍑哄簱鎴愬姛`);
- this.refresh();
- render(null, mountNode);
- document.body.removeChild(mountNode);
- } else {
- ElMessage.error(message || data?.message || '鍑哄簱澶辫触');
- }
- }).catch(() => {
- ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
- });
- },
- style: {
- borderRadius: '4px',
- padding: '8px 20px'
- }
- }, '纭畾')
- ])
- ])
- });
+ // ElMessage.success(`鍑哄簱鎴愬姛`);
+ // this.refresh();
+ // render(null, mountNode);
+ // document.body.removeChild(mountNode);
+ // } else {
+ // ElMessage.error(message || data?.message || '鍑哄簱澶辫触');
+ // }
+ // }).catch(() => {
+ // ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+ // });
+ // },
+ // style: {
+ // borderRadius: '4px',
+ // padding: '8px 20px'
+ // }
+ // }, '纭畾')
+ // ])
+ // ])
+ // });
- vnode.appContext = this.$.appContext;
- render(vnode, mountNode);
- }
- }
+ // vnode.appContext = this.$.appContext;
+ // render(vnode, mountNode);
+ // }
+ // }
], box: [], detail: []
}, //鎵╁睍鐨勬寜閽�
methods: {
@@ -370,10 +370,7 @@
var EmptyTrayOutboundBtn = this.buttons.find(x => x.value == "EmptyTrayOutbound");
if (EmptyTrayOutboundBtn != null) {
EmptyTrayOutboundBtn.onClick = () => {
- let rows = this.$refs.table.getSelected();
- if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
- if (rows.length >1) return this.$error("璇烽�夋嫨鏁版嵁!");
- this.$refs.gridHeader.open();
+ this.$refs.gridFooter.open();
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index 584d501..c775562 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -40,13 +40,13 @@
Task<WebResponseContent> RequestInboundTask(string palletCode, string stationCode);
- Task<WebResponseContent> PalletOutboundTask(string endStation, string palletCode = "");
+ Task<WebResponseContent> PalletOutboundTask(int num);
Task<WebResponseContent> TaskCompleted(string taskNum);
Task<WebResponseContent> GenerateOutboundTasksAsync(int[] keys, string outStation);
- Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews);
+ Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews,string station=null);
Task<WebResponseContent> GenerateOutboundBatchTasksAsync(int orderDetailId, decimal batchQuantity, string outStation);
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index f590bb0..f3ef15f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -31,95 +31,93 @@
/// </summary>
/// <param name="inTask"></param>
/// <returns></returns>
- public async Task<WebResponseContent> PalletOutboundTask(string endStation, string palletCode = "")
+ public async Task<WebResponseContent> PalletOutboundTask(int num)
{
+ WebResponseContent content = new WebResponseContent();
try
{
- Dt_StockInfo stockInfo;
- if (string.IsNullOrEmpty(palletCode))
- {
- stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt() && !string.IsNullOrWhiteSpace(x.LocationCode)).First();
- }
- else
- {
- stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.PalletCode == palletCode && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).First();
- }
+ var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).ToList();
- if (stockInfo == null)
+ if (stockInfos.Count() == 0)
{
return WebResponseContent.Instance.Error("鏈壘鍒扮┖鎵樼洏搴撳瓨");
}
- Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
- if (locationInfo == null)
+ for (int i = 0; i < num; i++)
{
- return WebResponseContent.Instance.Error("鏈壘鍒扮┖鎵樼洏搴撳瓨瀵瑰簲鐨勮揣浣嶄俊鎭�");
- }
-
- Dt_Task task = new Dt_Task()
- {
- CurrentAddress = stockInfo.LocationCode,
- Grade = 0,
- NextAddress = endStation,
- PalletCode = stockInfo.PalletCode,
- Roadway = locationInfo.RoadwayNo,
- SourceAddress = stockInfo.LocationCode,
- TargetAddress = endStation,
- TaskStatus = TaskStatusEnum.New.ObjToInt(),
- TaskType = TaskTypeEnum.OutEmpty.ObjToInt(),
- WarehouseId = stockInfo.WarehouseId,
- PalletType = stockInfo.PalletType
-
- };
- int beforeStatus = locationInfo.LocationStatus;
- _unitOfWorkManage.BeginTran();
- stockInfo.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
- locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
-
- int taskId = BaseDal.AddData(task);
- task.TaskId = taskId;
-
- _stockService.StockInfoService.UpdateData(stockInfo);
-
- _locationInfoService.UpdateData(locationInfo);
-
- _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), "", task.TaskNum);
-
- _unitOfWorkManage.CommitTran();
-
- TaskModel esstask = new TaskModel()
- {
- taskType = "carry",
- taskGroupCode = "",
- groupPriority = 0,
- tasks = new List<TasksType>
+ var stockInfo = stockInfos.Where(x=>x.StockStatus != StockStatusEmun.鍑哄簱閿佸畾.ObjToInt()).FirstOrDefault();
+ Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
+ if (locationInfo == null)
{
- new()
- {
- taskCode=task.TaskNum.ToString(),
- taskPriority=0,
- taskDescribe=new TaskDescribeType{
- containerCode=stockInfo.PalletCode,
- containerType= "CT_KUBOT_STANDARD",
- fromLocationCode=stockInfo.LocationCode??"",
- toStationCode="",
- toLocationCode=endStation,
- deadline=0,storageTag=""
- }
- }
+ return WebResponseContent.Instance.Error("鏈壘鍒扮┖鎵樼洏搴撳瓨瀵瑰簲鐨勮揣浣嶄俊鎭�");
}
- };
- var result = await _eSSApiService.CreateTaskAsync(esstask);
- _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
- if (result)
- {
- return WebResponseContent.Instance.OK(200);
- }
- else
- {
- return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
+ Dt_Task task = new Dt_Task()
+ {
+ CurrentAddress = stockInfo.LocationCode,
+ Grade = 0,
+ NextAddress = "1-2",
+ PalletCode = stockInfo.PalletCode,
+ Roadway = locationInfo.RoadwayNo,
+ SourceAddress = stockInfo.LocationCode,
+ TargetAddress = "1-2",
+ TaskStatus = TaskStatusEnum.New.ObjToInt(),
+ TaskType = TaskTypeEnum.OutEmpty.ObjToInt(),
+ WarehouseId = stockInfo.WarehouseId,
+ PalletType = stockInfo.PalletType
+
+ };
+ int beforeStatus = locationInfo.LocationStatus;
+ _unitOfWorkManage.BeginTran();
+ stockInfo.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
+ locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
+
+ int taskId = BaseDal.AddData(task);
+ task.TaskId = taskId;
+
+ _stockService.StockInfoService.UpdateData(stockInfo);
+
+ _locationInfoService.UpdateData(locationInfo);
+
+ _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), "", task.TaskNum);
+
+ _unitOfWorkManage.CommitTran();
+
+ TaskModel esstask = new TaskModel()
+ {
+ taskType = "carry",
+ taskGroupCode = "",
+ groupPriority = 0,
+ tasks = new List<TasksType>
+ {
+ new()
+ {
+ taskCode=task.TaskNum.ToString(),
+ taskPriority=0,
+ taskDescribe=new TaskDescribeType{
+ containerCode=stockInfo.PalletCode,
+ containerType= "CT_KUBOT_STANDARD",
+ fromLocationCode=stockInfo.LocationCode??"",
+ toStationCode="",
+ toLocationCode="1-2",
+ deadline=0,storageTag=""
+ }
+ }
+ }
+ };
+ var result = await _eSSApiService.CreateTaskAsync(esstask);
+
+ _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖: " + result);
+ if (result)
+ {
+ return WebResponseContent.Instance.OK(200);
+ }
+ else
+ {
+ return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
+ }
}
+ return content.OK("绌烘墭鍑哄簱鎴愬姛!");
}
catch (Exception ex)
{
@@ -521,7 +519,7 @@
/// <param name="orderDetailId"></param>
/// <param name="stockSelectViews"></param>
/// <returns></returns>
- public async Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
+ public async Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews,string station=null)
{
try
{
@@ -531,7 +529,7 @@
{
return WebResponseContent.Instance.Error("鎵句笉鍒板崟鎹�");
}
- (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(outboundOrder.Details.First().Id, stockSelectViews);
+ (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(outboundOrder.Details.First().Id, stockSelectViews,station);
WebResponseContent content =await GenerateOutboundTaskDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5);
@@ -550,7 +548,7 @@
/// <param name="stockSelectViews"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
- public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutboundTaskDataHandle(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
+ public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutboundTaskDataHandle(int orderDetailId, List<StockSelectViewDTO> stockSelectViews,string station=null)
{
List<Dt_Task> tasks = new List<Dt_Task>();
Dt_OutboundOrderDetail outboundOrderDetail = _outboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId);
@@ -573,15 +571,15 @@
(List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews);
if (result.Item1 != null && result.Item1.Count > 0)
{
- Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
+ Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
TaskTypeEnum typeEnum = outboundOrder.OrderType switch
{
(int)OutOrderTypeEnum.Issue => TaskTypeEnum.Outbound,
(int)OutOrderTypeEnum.Allocate => TaskTypeEnum.OutAllocate,
(int)OutOrderTypeEnum.Quality => TaskTypeEnum.OutQuality,
- _ => new TaskTypeEnum()
+ _ => TaskTypeEnum.Outbound
};
- tasks = GetTasks(result.Item1, typeEnum);
+ tasks = GetTasks(result.Item1, typeEnum,station);
result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
result.Item3.ForEach(x =>
{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index 6918098..39d5dfa 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -56,12 +56,9 @@
}
[HttpPost, Route("PalletOutboundTask"), AllowAnonymous, MethodParamsValidate]
- public async Task<WebResponseContent> PalletOutboundTask(string endStation, string palletCode = "")
+ public async Task<WebResponseContent> PalletOutboundTask(int num)
{
-
- var result = await Service.PalletOutboundTask(endStation, palletCode);
-
- return result;
+ return await Service.PalletOutboundTask(num);
}
@@ -83,9 +80,9 @@
/// <param name="stockSelectViews"></param>
/// <returns></returns>
[HttpPost, HttpGet, Route("GenerateOutboundTask"), AllowAnonymous]
- public async Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, [FromBody] List<StockSelectViewDTO> stockSelectViews)
+ public async Task<WebResponseContent> GenerateOutboundTask(int orderDetailId, string station, [FromBody] List<StockSelectViewDTO> stockSelectViews)
{
- return await Service.GenerateOutboundTask(orderDetailId, stockSelectViews);
+ return await Service.GenerateOutboundTask(orderDetailId, stockSelectViews, station);
}
/// <summary>
--
Gitblit v1.9.3