pan
2025-12-02 991673416fdeb3a4be2837bfd70ba6284ad314d5
Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu

# Conflicts:
# 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
已添加1个文件
已修改9个文件
828 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js 492 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs 162 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -199,6 +199,14 @@
    type: 'warning',
    onClick: function () {
    }
},{
    name: "空托出库",
    // icon: 'el-icon-upload2',
    class: '',
    value: 'EmptyTrayOutbound',
    type: 'primary',
    onClick: function () {
    }
},
]
ÏîÄ¿´úÂë/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("操作成功");
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/extend/EmptyTrayOutbound.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
<template>
  <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-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>
    <template #footer>
      <div>
        <el-button type="danger" size="small" plain @click="submit">
          <i class="el-icon-check">确认</i>
        </el-button>
        <el-button size="small" type="primary" plain @click="() => { this.show = false }">
          <i class="el-icon-close">关闭</i>
        </el-button>
      </div>
    </template>
  </vol-box>
</template>
<script>
import VolBox from '@/components/basic/VolBox.vue'
export default {
  components: {
    'vol-box': VolBox
  },
  data() {
    return {
      num: 1,
      show: false
    }
  },
  methods: {
    open() {
      this.show = true
    },
    submit() {
      this.$emit('parentCall', ($vue) => {
        this.http.post(`/api/Task/PalletOutboundTask?num=${this.num}`, {}, '数据处理中...')
          .then((x) => {
            if (!x.status) {
              this.$message.error(x.message)
            } else {
              this.show = false
              this.$Message.success(x.message)
              $vue.refresh();
            }
          })
      })
    }
  }
}
</script>
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js
@@ -6,12 +6,13 @@
import gridBody from './extend/outOrderDetail.vue'
import gridHeader from './extend/NoStockOut.vue'
import gridFooter from './extend/EmptyTrayOutbound.vue'
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: gridHeader,
    gridBody: gridBody,
    gridFooter: '',
    gridFooter: gridFooter,
    //新建、编辑弹出框扩展组件
    modelHeader: '',
    modelBody: '',
@@ -20,6 +21,8 @@
  tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: {
    view: [
      /* {
       name: '出库',
       type: 'primary',
@@ -45,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的label-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的label-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: {
@@ -364,6 +367,13 @@
        }
      }
      var EmptyTrayOutboundBtn = this.buttons.find(x => x.value == "EmptyTrayOutbound");
        if (EmptyTrayOutboundBtn != null) {
          EmptyTrayOutboundBtn.onClick = () => {
               this.$refs.gridFooter.open();
            }
        }
    },
    onInited() {
      //框架初始化配置后
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -66,6 +66,7 @@
        { title: "物料编号", field: "materielCode" ,type:'like'},
        { title: "物料名称", field: "materielName" ,type:'like'},
        { title: "单据编号", field: "orderNo" ,type:'like'},
        { title: "托盘号", field: "palletCode" ,type:'like'},
      ],
    ]);
    const columns = ref([
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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);
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -18,6 +18,7 @@
using AutoMapper;
using Dm.filter;
using MailKit.Search;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Org.BouncyCastle.Asn1.Ocsp;
@@ -1056,25 +1057,25 @@
                            {
                                if (item.PickedQty > 0)
                                {
                                    var barModel = new BarcodeInfo
                                    {
                                        Barcode = item.CurrentBarcode,
                                        SupplyCode = item.SupplyCode,
                                        BatchNo = item.BatchNo,
                                        Unit = item.BarcodeUnit,
                                        Qty = 0
                                    };
                                    // å•位不一致时转换
                                    if (item.BarcodeUnit != item.Unit)
                                    {
                                        var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, item.Unit, item.BarcodeUnit);
                                        barModel.Unit = convertResult.Unit;
                                        barModel.Qty = convertResult.Quantity;
                                    }
                                    detailModel.Qty += barModel.Qty;
                                    detailModel.Barcodes.Add(barModel);
                                    Barcode = item.CurrentBarcode,
                                    SupplyCode = item.SupplyCode,
                                    BatchNo = item.BatchNo,
                                    Unit = detail.BarcodeUnit,
                                    Qty = 0
                                };
                                // å•位不一致时转换
                                if (detail.BarcodeUnit != detail.Unit)
                                {
                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                    barModel.Unit = convertResult.Unit;
                                    barModel.Qty = convertResult.Quantity;
                                }
                                else
                                {
                                    barModel.Qty = item.PickedQty;
                                }
                                detailModel.Qty += barModel.Qty;
                                detailModel.Barcodes.Add(barModel);
                            }
@@ -1140,6 +1141,7 @@
                            {
                                if (item.PickedQty > 0)
                                {
<<<<<<< .mine
                                    var barModel = new WIDESEA_DTO.Outbound.BarcodesModel
                                    {
                                        barcode = item.CurrentBarcode,
@@ -1159,7 +1161,47 @@
                                    detailModel.qty += barModel.qty;
                                    detailModel.currentDeliveryQty += barModel.qty;
                                    detailModel.barcodes.Add(barModel);
=======
                                    barcode = item.CurrentBarcode,
                                    supplyCode = item.SupplyCode,
                                    batchNo = item.BatchNo,
                                    unit = detail.BarcodeUnit,
                                    qty = item.PickedQty
                                };
                                // å•位不一致时转换
                                if (detail.BarcodeUnit != detail.Unit)
                                {
                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                    barModel.unit = convertResult.Unit;
                                    barModel.qty = convertResult.Quantity;
>>>>>>> .theirs
                                }
<<<<<<< .mine
=======
                                else
                                {
                                    barModel.qty = item.PickedQty;
                                }
                                    detailModel.qty += barModel.qty;
                                detailModel.currentDeliveryQty += barModel.qty;
                                detailModel.barcodes.Add(barModel);
>>>>>>> .theirs
                            }
                            feedmodel.details.Add(detailModel);
                        }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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 =>
                    {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -1,4 +1,5 @@
using Autofac.Core;
using MailKit.Search;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -8,15 +9,19 @@
using System.Threading.Tasks;
using WIDESEA_BasicService;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Allocate;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Mes;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
using WIDESEA_InboundService;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
using WIDESEA_OutboundService;
namespace WIDESEA_WMSServer.Controllers.Inbound
{
@@ -35,8 +40,10 @@
        private readonly ILocationInfoService _locationInfoService;
        private readonly IDailySequenceService _dailySequenceService;
        private readonly IMaterialUnitService _materialUnitService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IOutboundOrderDetailService _outboundOrderDetailService;
        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) : 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) : base(service)
        {
            this.erpApiService = erpApiService;
            _invokeMESService = invokeMESService;
@@ -46,11 +53,14 @@
            _logger = logger;
            _materialUnitService = materialUnitService;
            _inboundService = inboundService;
            _outStockLockInfoService = outStockLockInfoService;
            _outboundOrderDetailService = outboundOrderDetailService;
        }
        [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
        public async Task<WebResponseContent> Test()
        {
            // Service.Db.Deleteable<Dt_InboundOrder>().Where(x=>x.UpperOrderNo== "12020251100040").ExecuteCommand();
            //_inboundService.InboundOrderDetailService.Db.Deleteable<Dt_InboundOrderDetail>()
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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>