1
hutongqing
2024-09-13 ea9bdf217e8202a5fa475262dba1792decb05bcb
1
已删除3个文件
已修改67个文件
已添加5个文件
1312 ■■■■ 文件已修改
代码管理/WMS/WIDESEA_WMSClient/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3dfde05d-a5a2-4fcc-8f16-01b7d188fff6.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/8d854c1d-3953-4118-905c-6e5e5a843136.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/8f68f6b2-80bb-4d2f-ab81-67151e8aeeb3.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c25c0959-7ed5-454b-8c7e-6d209867e5c4.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d8e0fc94-3eb1-4d2c-ac54-1343a3bbf1a6.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/f32a6908-78df-435f-ab6a-bcc81d7efe7e.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/AreaInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MaterielInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/RoadwayInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WarehouseService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/IService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/IAreaInfoRepository.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/ILocationInfoRepository.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/IWarehouseRepository.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IAreaInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMaterielInfoService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IRoadwayInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IWarehouseService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderDetailService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordSetvice.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_DictionaryListService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_DictionaryService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_MenuService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_RoleAuthService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_RoleService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_TenantService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_UserService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoRepository/ITaskRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderDetailService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/WIDESEA_OutboundService.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordSetvice.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/StockQuantityChangeRecordService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryListService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_MenuService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleAuthService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_TenantService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_UserService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoRepository/TaskRepository.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs 229 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 291 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -19,7 +19,7 @@
}
else if (process.env.NODE_ENV == 'production') {
    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
    axios.defaults.baseURL = 'http://115.159.85.185:9291/';
}
if (!axios.defaults.baseURL.endsWith('/')) {
    axios.defaults.baseURL+="/";
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/StockSelect.vue
@@ -78,8 +78,12 @@
        </el-table>
      </div>
      <template #footer>
        <el-button type="primary" size="small" @click="outbound">直接出库</el-button>
        <el-button type="primary" size="small" @click="lockStock">锁定库存</el-button>
        <el-button type="primary" size="small" @click="outbound"
          >直接出库</el-button
        >
        <el-button type="primary" size="small" @click="lockStock"
          >锁定库存</el-button
        >
        <el-button type="danger" size="small" @click="showDetialBox = false"
          >关闭</el-button
        >
@@ -140,6 +144,13 @@
      this.originalQuantity = this.row.lockQuantity;
      this.selectionSum = this.row.lockQuantity;
      this.getData();
      if (this.selectionSum == this.row.orderQuantity) {
        this.selectionClass = "equle-style";
      } else if (this.selectionSum < this.row.orderQuantity) {
        this.selectionClass = "less-style";
      } else {
        this.selectionClass = "more-style";
      }
    },
    lockStock() {
      this.http
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
@@ -8,15 +8,36 @@
      title="单据明细信息"
    >
      <div class="box-head">
        <!-- <el-row>
          <el-col :span="24">
            <span>已选中 {{ true ? 1 : 0 }} é¡¹</span>
            <el-divider direction="vertical"></el-divider>
            <el-button type="text" size="medium"
              ><i class="el-icon-edit">关闭</i
            ></el-button>
        <el-alert :closable="false" style="width: 100%">
          <el-row>
            <el-col :span="16">
              <span>已选中 {{ selection.length }} é¡¹</span>
          </el-col>
        </el-row> -->
            <el-col :span="8">
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px"
                @click="lockstocks"
                >锁定库存</el-link
              >
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="outbound"
                >直接出库</el-link
              >
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="getData"
                >刷新</el-link
              ></el-col
            >
          </el-row>
        </el-alert>
      </div>
      <div class="box-table" style="margin-top: 1%">
        <el-table
@@ -26,7 +47,10 @@
          highlight-current-row
          @current-change="handleCurrentChange"
          height="500px"
          @row-click="handleRowClick"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column
            label="序号"
            type="index"
@@ -79,6 +103,7 @@
      showDetialBox: false,
      flag: false,
      currentRow: null,
      selection: [],
      tableData: [],
      tableColumns: [
        {
@@ -251,8 +276,39 @@
        this.$refs.selectedStock.open(row);
      }
    },
    assignStock() {},
    viewDetail() {},
    lockstocks() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    outbound() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/Task/GenerateOutboundTasks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    setCurrent(row) {
      this.$refs.singleTable.setCurrentRow(row);
    },
@@ -261,7 +317,11 @@
    },
    getButtonEnable(propName, row) {
      if (propName == "assignStock") {
        if (row.orderDetailStatus !== 0 && row.orderDetailStatus !== 60 && row.orderDetailStatus !== 70) {
        if (
          row.orderDetailStatus !== 0 &&
          row.orderDetailStatus !== 60 &&
          row.orderDetailStatus !== 70
        ) {
          return true;
        } else {
          return false;
@@ -275,6 +335,12 @@
      }
      fun(this);
    },
    handleRowClick(row) {
      this.$refs.singleTable.toggleRowSelection(row);
    },
    handleSelectionChange(val) {
      this.selection = val;
    },
  },
};
</script>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -29,6 +29,7 @@
    const editFormFields = ref({
      orderType: "",
      upperOrderNo: "",
      orderStatus: "",
      remark: "",
    });
    const editFormOptions = ref([
@@ -47,6 +48,14 @@
          type: "string",
        },
        {
          title: "单据状态",
          field: "orderStatus",
          type: "select",
          dataKey: "inboundState",
          data: [],
          readonly: true,
        },
        {
          title: "备注",
          field: "remark",
          type: "textarea",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue
@@ -104,7 +104,6 @@
          width: 90,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
        {
@@ -121,8 +120,6 @@
          type: "string",
          width: 150,
          align: "left",
          edit: { type: "string" },
          required: true,
        },
        {
          field: "materielName",
@@ -137,8 +134,6 @@
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "string" },
          required: true,
        },
        {
          field: "orderQuantity",
@@ -146,8 +141,6 @@
          type: "string",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "lockQuantity",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3dfde05d-a5a2-4fcc-8f16-01b7d188fff6.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/8d854c1d-3953-4118-905c-6e5e5a843136.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/8f68f6b2-80bb-4d2f-ab81-67151e8aeeb3.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c25c0959-7ed5-454b-8c7e-6d209867e5c4.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d8e0fc94-3eb1-4d2c-ac54-1343a3bbf1a6.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/f32a6908-78df-435f-ab6a-bcc81d7efe7e.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/AreaInfoService.cs
@@ -15,5 +15,7 @@
        public AreaInfoService(IAreaInfoRepository BaseDal) : base(BaseDal)
        {
        }
        public IAreaInfoRepository Repository => BaseDal;
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs
@@ -30,6 +30,8 @@
            { nameof(Dt_LocationInfo.Row), OrderByType.Asc },
        };
        public ILocationInfoRepository Repository => BaseDal;
        public LocationInfoService(ILocationInfoRepository BaseDal, IAreaInfoRepository areaInfoRepository, IWarehouseRepository warehouseRepository, IRoadwayInfoRepository roadwayInfoRepository) : base(BaseDal)
        {
            _areaInfoRepository = areaInfoRepository;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MaterielInfoService.cs
@@ -16,6 +16,8 @@
        {
        }
        public IMaterielInfoRepository Repository => BaseDal;
        public bool ExsitMateriel(string materielCode)
        {
            return BaseDal.QueryFirst(x => x.MaterielCode == materielCode) != null;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/RoadwayInfoService.cs
@@ -15,5 +15,7 @@
        public RoadwayInfoService(IRoadwayInfoRepository BaseDal) : base(BaseDal)
        {
        }
        public IRoadwayInfoRepository Repository => BaseDal;
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WarehouseService.cs
@@ -15,5 +15,7 @@
        public WarehouseService(IWarehouseRepository BaseDal) : base(BaseDal)
        {
        }
        public IWarehouseRepository Repository => BaseDal;
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs
@@ -46,6 +46,8 @@
                SequenceAttirbute? sequenceAttirbute = propertyInfo.GetCustomAttribute<SequenceAttirbute>();
                if (sequenceAttirbute != null)
                {
                    if (propertyInfo.GetValue(entityInfo.EntityValue)?.ObjToInt() <= 0)
                    {
                    SqlSugarClient sugarClient = new SqlSugarClient(new ConnectionConfig
                    {
                        ConfigId = MainDb.CurrentDbConnId,
@@ -62,6 +64,8 @@
                    int seq = sugarClient.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceAttirbute.SequenceName}").ObjToInt();
                    propertyInfo.SetValue(entityInfo.EntityValue, seq, null);
                }
                }
            }
            if (entityInfo.EntityValue is BaseEntity baseEntity)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/IService.cs
@@ -8,7 +8,7 @@
namespace WIDESEA_Core.BaseServices
{
    public interface IService<TEntity> : IDependency where TEntity : class
    public interface IService<TEntity> : IDependency where TEntity : class, new()
    {
        ISqlSugarClient Db { get; }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
@@ -59,7 +59,6 @@
            return pageGridData;
        }
        protected string ValidatePageOptions(PageDataOptions options)
        {
            options = options ?? new PageDataOptions();
@@ -358,7 +357,7 @@
                {
                    return WebResponseContent.Instance.Error("传参错误,参数不能为空");
                }
                string validResult = typeof(TEntity).ValidateDicInEntity(saveModel.MainData, false, TProperties, list?.ToArray());
                string validResult = typeof(TEntity).ValidateDicInEntity(saveModel.MainData, false, TProperties, list?.ToArray() ?? null);
                if (!string.IsNullOrEmpty(validResult))
                {
@@ -376,7 +375,7 @@
                List<string> listCol = new List<string>();
                foreach (var item in saveModel.MainData)
                {
                    PropertyInfo propertyInfo = typeof(TEntity).GetProperty(item.Key);
                    PropertyInfo? propertyInfo = typeof(TEntity).GetProperty(item.Key);
                    if (propertyInfo == null)
                    {
                        propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToLower());
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs
@@ -146,7 +146,7 @@
        /// <param name="removeNotContains">移除不存在字段</param>
        /// <param name="removerKey">移除主键</param>
        /// <returns></returns>
        public static string ValidateDicInEntity(this Type typeinfo, Dictionary<string, object> dic, bool removerKey, PropertyInfo[] propertyInfo, string[] ignoreFields = null)
        public static string ValidateDicInEntity(this Type typeinfo, Dictionary<string, object> dic, bool removerKey, PropertyInfo[] propertyInfo, string[]? ignoreFields = null)
        {
            if (dic == null || dic.Count == 0) { return "参数无效"; }
@@ -168,15 +168,23 @@
            foreach (PropertyInfo property in propertyInfo)
            {
                SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>();
                SugarColumn? sugarColumn = property.GetCustomAttribute<SugarColumn>();
                if (sugarColumn == null)
                {
                    Navigate? navigate = property.GetCustomAttribute<Navigate>();
                    if(navigate != null)
                    {
                        continue;
                    }
                    return "请配置SugarColumn属性";
                }
                //忽略与主键的字段不做验证
                if (property.Name == keyName.FirstLetterToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore)
                    continue;
                //不在编辑中的列,是否也要必填
                if (!dic.ContainsKey(property.Name.FirstLetterToLower()))
                if (!dic.ContainsKey(property.Name.FirstLetterToLower()) /*&& !dic.ContainsKey(property.Name.FirstLetterToUpper())*/)
                {
                    if (!sugarColumn.IsNullable)
                    {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/IAreaInfoRepository.cs
@@ -10,8 +10,16 @@
{
    public interface IAreaInfoRepository : IRepository<Dt_AreaInfo>
    {
        /// <summary>
        /// å¯ç”¨çš„区域主键集合
        /// </summary>
        public List<int> EnableAreaIds { get; }
        /// <summary>
        /// ä»“库里面启动的区域主键集合
        /// </summary>
        /// <param name="enableWarehouseIds">仓库主键集合</param>
        /// <returns></returns>
        List<int> GetEnableAreaIds(List<int> enableWarehouseIds);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/ILocationInfoRepository.cs
@@ -12,14 +12,42 @@
{
    public interface ILocationInfoRepository : IRepository<Dt_LocationInfo>
    {
        /// <summary>
        /// æ ¹æ®å··é“获取所有一深、二深对应的一组货位数据集合
        /// </summary>
        /// <param name="roadway">巷道号</param>
        /// <returns></returns>
        List<LocationGroupDTO> GetAllLocationGroups(string roadway);
        /// <summary>
        /// æ ¹æ®å··é“、一深位货位状态、二深位货位状态获取对应的一组货位数据集合
        /// </summary>
        /// <param name="roadway">巷道号</param>
        /// <param name="locationAStatus">一深位货位状态</param>
        /// <param name="locationBStatus">二深位货位状态</param>
        /// <returns></returns>
        List<LocationGroupDTO> GetLocationGroups(string roadway, LocationStatusEnum locationAStatus, LocationStatusEnum locationBStatus);
        /// <summary>
        /// æ ¹æ®å··é“号集合、区域集合获取可出库的货位编号集合
        /// </summary>
        /// <param name="roadways">巷道号集合</param>
        /// <param name="areaIds">区域集合</param>
        /// <returns></returns>
        List<string> GetCanOutLocationCodes(List<string> roadways, List<int> areaIds);
        /// <summary>
        /// æ ¹æ®è´§ä½ç¼–号集合获取货位实体集合
        /// </summary>
        /// <param name="locationCodes">货位编号集合</param>
        /// <returns></returns>
        List<Dt_LocationInfo> GetLocationInfos(List<string> locationCodes);
        /// <summary>
        /// æ‰¹é‡æ›´æ–°è´§ä½çŠ¶æ€
        /// </summary>
        /// <param name="locationInfos">货位实体集合</param>
        /// <param name="locationStatus">货位状态</param>
        void UpdateLocationStatus(List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/IWarehouseRepository.cs
@@ -10,6 +10,9 @@
{
    public interface IWarehouseRepository : IRepository<Dt_Warehouse>
    {
        /// <summary>
        /// å¯ç”¨çš„仓库主键集合
        /// </summary>
        public List<int> EnableWarehouseIds { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IAreaInfoService.cs
@@ -4,11 +4,13 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IBasicService
{
    public interface IAreaInfoService : IService<Dt_AreaInfo>
    {
       IAreaInfoRepository Repository { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs
@@ -6,12 +6,15 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.Basic;
using WIDESEA_IBasicRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IBasicService
{
    public interface ILocationInfoService : IService<Dt_LocationInfo>
    {
        ILocationInfoRepository Repository { get; }
        WebResponseContent InitializationLocation(InitializationLocationDTO initializationLocationDTO);
        Dt_LocationInfo AdjacentDepthLocation(string locationCode);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMaterielInfoService.cs
@@ -4,12 +4,15 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IBasicService
{
    public interface IMaterielInfoService : IService<Dt_MaterielInfo>
    {
        IMaterielInfoRepository Repository { get; }
        bool ExsitMateriel(string materielCode);
        bool ExsitMateriels(List<string> materielCodes);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IRoadwayInfoService.cs
@@ -4,11 +4,13 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IBasicService
{
    public interface IRoadwayInfoService : IService<Dt_RoadwayInfo>
    {
        IRoadwayInfoRepository Repository { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IWarehouseService.cs
@@ -4,11 +4,13 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IBasicService
{
    public interface IWarehouseService : IService<Dt_Warehouse>
    {
        IWarehouseRepository Repository { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderDetailService.cs
@@ -4,12 +4,15 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IInboundRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IInboundService
{
    public interface IInboundOrderDetailService : IService<Dt_InboundOrderDetail>
    {
        IInboundOrderDetailRepository Repository { get; }
        List<Dt_InboundOrderDetail> UpdateReceiptQuantity(List<Dt_InboundOrderDetail> inboundOrderDetails, decimal receiptQuantity);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -6,12 +6,15 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.Inbound;
using WIDESEA_IInboundRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IInboundService
{
    public interface IInboundOrderService : IService<Dt_InboundOrder>
    {
        IInboundOrderRepository Repository { get; }
        WebResponseContent AddInboundOrder(InboundOrderAddDTO orderAddDTO);
        WebResponseContent MaterielGroup(MaterielGroupDTO materielGroupDTO);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs
@@ -4,14 +4,20 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
    public interface IOutStockLockInfoService : IService<Dt_OutStockLockInfo>
    {
        IOutStockLockInfoRepository Repository { get; }
        List<Dt_OutStockLockInfo> GetOutStockLockInfos(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_StockInfo> outStocks, int? taskNum = null);
        List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId);
        List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutStockStatus outStockStatus);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs
@@ -8,19 +8,24 @@
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_DTO.Stock;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
    public interface IOutboundOrderDetailService : IService<Dt_OutboundOrderDetail>
    {
        IOutboundOrderDetailRepository Repository { get; }
        WebResponseContent LockOutboundStock(int orderDetailId);
        (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(int orderDetailId, List<StockSelectViewDTO> stockSelectViews);
        (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrderDetail outboundOrderDetail, List<StockSelectViewDTO> stockSelectViews);
        WebResponseContent LockOutboundStock(int orderDetailId, List<StockSelectViewDTO> stockSelectViews);
        WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock);
        WebResponseContent LockOutboundStock(int[] keys);
        WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null);
        WebResponseContent RevokeLockOutboundStock(int orderDetailId);
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs
@@ -6,12 +6,15 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.Outbound;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
    public interface IOutboundOrderService : IService<Dt_OutboundOrder>
    {
        IOutboundOrderRepository Repository { get; }
        WebResponseContent AddOutboundOrder(OutboundOrderAddDTO orderAddDTO);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordSetvice.cs
@@ -4,12 +4,15 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IRecordRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IRecordService
{
    public interface ILocationStatusChangeRecordSetvice : IService<Dt_LocationStatusChangeRecord>
    {
        ILocationStatusChangeRecordRepository Repository { get; }
        void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, int lastStatus, int changeType, string orderNo, int? taskNum);
        void AddLocationStatusChangeRecord(List<Dt_LocationInfo> locationInfos, int newStatus, int changeType, string? orderNo, List<int>? taskNums);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IRecordService/IStockQuantityChangeRecordService.cs
@@ -5,12 +5,15 @@
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_IRecordRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IRecordService
{
    public interface IStockQuantityChangeRecordService : IService<Dt_StockQuantityChangeRecord>
    {
        IStockQuantityChangeRecordRepository Repository { get; }
        void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeType changeType);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs
@@ -4,12 +4,15 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IStockRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IStockService
{
    public interface IStockInfoDetailService : IService<Dt_StockInfoDetail>
    {
        IStockInfoDetailRepository Repository { get; }
        bool ExistSerialNumber(string SerialNumber);
        bool ExistSerialNumbers(List<string> SerialNumbers);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs
@@ -5,12 +5,15 @@
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IStockService
{
    public interface IStockInfoService : IService<Dt_StockInfo>
    {
        IStockInfoRepository Repository { get; }
        Dt_StockInfo? GetStockByPalletCode(string palletCode);
        void AddMaterielGroup(Dt_StockInfo stockInfo);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_DictionaryListService.cs
@@ -4,11 +4,13 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_ISystemRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_ISystemService
{
    public interface ISys_DictionaryListService : IService<Sys_DictionaryList>
    {
        ISys_DictionaryListRepository Repository { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_DictionaryService.cs
@@ -5,12 +5,15 @@
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.System;
using WIDESEA_ISystemRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_ISystemService
{
    public interface ISys_DictionaryService : IService<Sys_Dictionary>
    {
        ISys_DictionaryRepository Repository { get; }
        List<VueDictionaryDTO> GetVueDictionary(string[] dicNos);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_MenuService.cs
@@ -6,12 +6,15 @@
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.System;
using WIDESEA_ISystemRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_ISystemService
{
    public interface ISys_MenuService : IService<Sys_Menu>
    {
        ISys_MenuRepository Repository { get; }
        object GetCurrentMenuActionList();
        List<MenuDTO> GetUserMenuList(int roleId);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_RoleAuthService.cs
@@ -4,11 +4,13 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_ISystemRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_ISystemService
{
    public interface ISys_RoleAuthService : IService<Sys_RoleAuth>
    {
        ISys_RoleAuthRepository Repository { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_RoleService.cs
@@ -8,12 +8,16 @@
using WIDESEA_Core.BaseServices;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.System;
using WIDESEA_ISystemRepository;
namespace WIDESEA_ISystemService
{
    public interface ISys_RoleService : IService<Sys_Role>
    {
        ISys_RoleRepository Repository { get; }
        List<RoleNodes> GetAllChildren(int roleId);
        WebResponseContent GetCurrentTreePermission();
        WebResponseContent GetUserTreePermission(int role_Id);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_TenantService.cs
@@ -5,12 +5,15 @@
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_ISystemRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_ISystemService
{
    public interface ISys_TenantService : IService<Sys_Tenant>
    {
        ISys_TenantRepository Repository { get; }
        WebResponseContent InitTenantInfo(string tenantName, int tenantType);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_UserService.cs
@@ -6,6 +6,7 @@
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_ISystemRepository;
using WIDESEA_Model;
using WIDESEA_Model.Models;
@@ -13,6 +14,8 @@
{
    public interface ISys_UserService : IService<Sys_User>
    {
        ISys_UserRepository Repository { get; }
        WebResponseContent Login(LoginInfo loginInfo);
        WebResponseContent GetCurrentUserInfo();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoRepository/ITaskRepository.cs
@@ -27,6 +27,6 @@
{
    public interface ITaskRepository : IRepository<Dt_Task>
    {
        int GetTaskNum(string sequenceName);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -26,16 +26,21 @@
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_DTO.Stock;
using WIDESEA_ITaskInfoRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_ITaskInfoService
{
    public interface ITaskService : IService<Dt_Task>
    {
        ITaskRepository Repository { get; }
        WebResponseContent GenerateInboundTask(string stationCode, int taskType, string palletCode);
        WebResponseContent TaskCompleted(int taskNum);
        WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews);
        WebResponseContent GenerateOutboundTask(int[] keys);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderDetailService.cs
@@ -14,6 +14,8 @@
{
    public class InboundOrderDetailService : ServiceBase<Dt_InboundOrderDetail, IInboundOrderDetailRepository>, IInboundOrderDetailService
    {
        public IInboundOrderDetailRepository Repository => BaseDal;
        public InboundOrderDetailService(IInboundOrderDetailRepository BaseDal) : base(BaseDal)
        {
        }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -32,6 +32,8 @@
        private readonly IInboundOrderDetailService _inboundOrderDetailService;
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        public IInboundOrderRepository Repository => BaseDal;
        public InboundOrderService(IInboundOrderRepository BaseDal, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService, ITaskRepository taskRepository, IInboundOrderDetailService inboundOrderDetailService, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _mapper = mapper;
@@ -43,6 +45,11 @@
            _unitOfWorkManage = unitOfWorkManage;
        }
        /// <summary>
        /// æ·»åŠ å•æ®
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        public override WebResponseContent AddData(SaveModel saveModel)
        {
            InboundOrderAddDTO orderAddDTO = saveModel.MainData.DicToModel<InboundOrderAddDTO>();
@@ -50,6 +57,11 @@
            return AddInboundOrder(orderAddDTO);
        }
        /// <summary>
        /// æ·»åŠ å•æ®
        /// </summary>
        /// <param name="orderAddDTO">单据添加DTO</param>
        /// <returns></returns>
        public WebResponseContent AddInboundOrder(InboundOrderAddDTO orderAddDTO)
        {
            WebResponseContent content = new();
@@ -76,6 +88,11 @@
            return content;
        }
        /// <summary>
        /// éªŒè¯å•据添加DTO对象
        /// </summary>
        /// <param name="inboundOrderAddDTO">单据添加DTO</param>
        /// <returns></returns>
        private (bool, string, object?) CheckInboundOrderAddData(InboundOrderAddDTO inboundOrderAddDTO)
        {
            (bool, string, object?) result1 = ModelValidate.ValidateModelData(inboundOrderAddDTO);
@@ -103,6 +120,11 @@
            return (true, "成功", inboundOrderAddDTO);
        }
        /// <summary>
        /// æ ¹æ®å…¥åº“单号获取入库单(含明细)
        /// </summary>
        /// <param name="inboundOrderNo"></param>
        /// <returns></returns>
        public Dt_InboundOrder GetInboundOrder(string inboundOrderNo)
        {
            return BaseDal.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details).First(x => x.OrderNo == inboundOrderNo); ;
@@ -184,6 +206,13 @@
            return content;
        }
        /// <summary>
        /// ç»„盘数据更新
        /// </summary>
        /// <param name="inboundOrder">入库单</param>
        /// <param name="inboundOrderDetails">入库单明细</param>
        /// <param name="stockInfo">组盘数据</param>
        /// <returns></returns>
        public WebResponseContent MaterielGroupUpdateData(Dt_InboundOrder inboundOrder, List<Dt_InboundOrderDetail> inboundOrderDetails, Dt_StockInfo stockInfo)
        {
            try
@@ -202,6 +231,16 @@
            }
        }
        /// <summary>
        /// éªŒè¯ç»„盘数据
        /// </summary>
        /// <param name="materielGroupDTO">物料组盘DTO</param>
        /// <param name="matSerialNumberDTOs">扫码序列号</param>
        /// <param name="materielInfos">物料信息</param>
        /// <param name="materielCodes">物料编号</param>
        /// <param name="inboundOrder">入库单据</param>
        /// <param name="stockInfo">组盘信息</param>
        /// <returns></returns>
        public (bool, string, object?) CheckMaterielGroupParam(MaterielGroupDTO materielGroupDTO, List<MatSerialNumberDTO> matSerialNumberDTOs, List<Dt_MaterielInfo> materielInfos, List<string> materielCodes, Dt_InboundOrder inboundOrder, Dt_StockInfo stockInfo)
        {
            (bool, string, object?) result = ModelValidate.ValidateModelData(materielGroupDTO);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs
@@ -16,19 +16,19 @@
        public int Id { get; set; }
        [CodeRule(WIDESEA_Core.Enums.RuleCode.OutboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号", IsOnlyIgnoreUpdate = true)]
        public string OrderNo { get; set; }
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "上游单据编号")]
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "上游单据编号", IsOnlyIgnoreUpdate = true)]
        public string UpperOrderNo { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型")]
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型", IsOnlyIgnoreUpdate = true)]
        public int OrderType { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式")]
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式", IsOnlyIgnoreUpdate = true)]
        public int CreateType { get; set; }
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs
@@ -9,7 +9,7 @@
namespace WIDESEA_Model.Models
{
    [SugarTable(nameof(Dt_LocationStatusChangeRecord),"货位状态变动记录")]
    public class Dt_LocationStatusChangeRecord
    public class Dt_LocationStatusChangeRecord : BaseEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs
@@ -109,6 +109,9 @@
        [SugarColumn(IsNullable = false, ColumnDescription = "优先级")]
        public int Grade { get; set; }
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "源主键")]
        public int SourceKey { get; set; }
        /// <summary>
        /// ä»»åŠ¡ä¸‹å‘æ—¶é—´
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs
@@ -13,6 +13,8 @@
{
    public class OutStockLockInfoService : ServiceBase<Dt_OutStockLockInfo, IOutStockLockInfoRepository>, IOutStockLockInfoService
    {
        public IOutStockLockInfoRepository Repository => BaseDal;
        public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal) : base(BaseDal)
        {
        }
@@ -44,10 +46,14 @@
            return outStockLockInfos;
        }
        public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId)
        {
            return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId);
        }
        public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutStockStatus outStockStatus)
        {
            return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && x.Status == outStockStatus.ObjToInt());
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs
@@ -12,8 +12,10 @@
using WIDESEA_Core.Helper;
using WIDESEA_DTO.Stock;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockRepository;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -24,24 +26,24 @@
    public class OutboundOrderDetailService : ServiceBase<Dt_OutboundOrderDetail, IOutboundOrderDetailRepository>, IOutboundOrderDetailService
    {
        private readonly IStockInfoService _stockInfoService;
        private readonly IStockInfoRepository _stockInfoRepository;
        private readonly IStockInfoDetailService _stockInfoDetailService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IOutboundOrderRepository _outboundOrderRepository;
        private readonly IStockInfoDetailRepository _stockInfoDetailRepository;
        private readonly IOutStockLockInfoRepository _outStockLockInfoRepository;
        private readonly ILocationInfoRepository _locationInfoRepository;
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly ILocationStatusChangeRecordSetvice _locationStatusChangeRecordSetvice;
        private readonly IOutboundOrderService _outboundOrderService;
        private readonly ILocationInfoService _locationInfoService;
        public OutboundOrderDetailService(IOutboundOrderDetailRepository BaseDal, IStockInfoService stockInfoService, IStockInfoRepository stockInfoRepository, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderRepository outboundOrderRepository, IStockInfoDetailRepository stockInfoDetailRepository, IOutStockLockInfoRepository outStockLockInfoRepository, ILocationInfoRepository locationInfoRepository, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        public IOutboundOrderDetailRepository Repository => BaseDal;
        public OutboundOrderDetailService(IOutboundOrderDetailRepository BaseDal, IStockInfoService stockInfoService, IOutStockLockInfoService outStockLockInfoService, IUnitOfWorkManage unitOfWorkManage, ILocationStatusChangeRecordSetvice locationStatusChangeRecordSetvice, IOutboundOrderService outboundOrderService, ILocationInfoService locationInfoService, IStockInfoDetailService stockInfoDetailService) : base(BaseDal)
        {
            _stockInfoService = stockInfoService;
            _stockInfoRepository = stockInfoRepository;
            _outStockLockInfoService = outStockLockInfoService;
            _outboundOrderRepository = outboundOrderRepository;
            _stockInfoDetailRepository = stockInfoDetailRepository;
            _outStockLockInfoRepository = outStockLockInfoRepository;
            _locationInfoRepository = locationInfoRepository;
            _unitOfWorkManage = unitOfWorkManage;
            _locationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice;
            _outboundOrderService = outboundOrderService;
            _locationInfoService = locationInfoService;
            _stockInfoDetailService = stockInfoDetailService;
        }
        //
        public WebResponseContent LockOutboundStock(int orderDetailId)
@@ -145,19 +147,26 @@
            return (true, "成功");
        }
        public (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        public (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrderDetail outboundOrderDetail, List<StockSelectViewDTO> stockSelectViews)
        {
            Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId);
            (bool, string) result = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews);
            if (!result.Item1) throw new Exception(result.Item2);
            (bool, string) checkResult = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews);
            if (!checkResult.Item1) throw new Exception(checkResult.Item2);
            Dt_OutboundOrder outboundOrder = _outboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
            Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
            decimal originalNeedQuantity = outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity;
            decimal needQuantity = originalNeedQuantity;
            List<Dt_StockInfo> outStocks = _stockInfoRepository.GetStockInfosByPalletCodes(stockSelectViews.Select(x => x.PalletCode).ToList());
            decimal assignQuantity = stockSelectViews.Sum(x => x.UseableQuantity);
            List<Dt_StockInfo> outStocks = _stockInfoService.Repository.GetStockInfosByPalletCodes(stockSelectViews.Select(x => x.PalletCode).ToList());
            decimal assignQuantity = 0;
            outStocks.ForEach(x =>
            {
                x.Details.ForEach(v =>
                {
                    assignQuantity += v.StockQuantity - v.OutboundQuantity;
                });
            });
            outboundOrderDetail.LockQuantity += assignQuantity;
            outStocks.ForEach(x =>
            {
@@ -183,7 +192,7 @@
            List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetOutStockLockInfos(outboundOrder, outboundOrderDetail, outStocks);
            List<Dt_LocationInfo> locationInfos = _locationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList());
            List<Dt_LocationInfo> locationInfos = _locationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList());
            return (outStocks, outboundOrderDetail, outStockLockInfos, locationInfos);
        }
@@ -192,10 +201,14 @@
        {
            try
            {
                (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = AssignStockOutbound(orderDetailId, stockSelectViews);
                Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId);
                (bool, string) checkResult = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews);
                if (!checkResult.Item1) throw new Exception(checkResult.Item2);
                (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                _unitOfWorkManage.BeginTran();
                WebResponseContent content = LockOutboundStockDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4);
                WebResponseContent content = LockOutboundStockDataUpdate(result.Item1, new List<Dt_OutboundOrderDetail> { result.Item2 }, result.Item3, result.Item4);
                if (content.Status)
                {
                    _unitOfWorkManage.CommitTran();
@@ -213,26 +226,80 @@
            }
        }
        public WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock)
        public WebResponseContent LockOutboundStock(int[] keys)
        {
            try
            {
                _stockInfoRepository.UpdateData(stockInfos);
                List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
                List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>();
                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
                List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
                List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
                foreach (var item in keys)
                {
                    Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == item);
                    (bool, string) checkResult = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews);
                    if (!checkResult.Item1) throw new Exception(checkResult.Item2);
                    (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                    if (result.Item1.Count > 0)
                    {
                        stockInfos.AddRange(result.Item1);
                        outboundOrderDetails.Add(result.Item2);
                        outStockLockInfos.AddRange(result.Item3);
                        locationInfos.AddRange(result.Item4);
                    }
                }
                _unitOfWorkManage.BeginTran();
                WebResponseContent content = LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos);
                if (content.Status)
                {
                    _unitOfWorkManage.CommitTran();
                }
                else
                {
                    _unitOfWorkManage.RollbackTran();
                }
                return content;
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null)
        {
            try
            {
                _stockInfoService.Repository.UpdateData(stockInfos);
                List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>();
                foreach (var item in stockInfos)
                {
                    stockInfoDetails.AddRange(item.Details);
                }
                _stockInfoDetailRepository.UpdateData(stockInfoDetails);
                BaseDal.UpdateData(outboundOrderDetail);
                _outStockLockInfoRepository.AddData(outStockLockInfos);
                _stockInfoDetailService.Repository.UpdateData(stockInfoDetails);
                BaseDal.UpdateData(outboundOrderDetails);
                _locationInfoRepository.UpdateLocationStatus(locationInfos, locationStatus);
                List<Dt_OutStockLockInfo> addOutStockLockInfos = outStockLockInfos.Where(x => x.Id == 0).ToList();
                if (addOutStockLockInfos != null && addOutStockLockInfos.Any())
                {
                    _outStockLockInfoService.Repository.AddData(addOutStockLockInfos);
                }
                List<Dt_OutStockLockInfo> updateOutStockLockInfos = outStockLockInfos.Where(x => x.Id > 0).ToList();
                if (updateOutStockLockInfos != null && updateOutStockLockInfos.Any())
                {
                    _outStockLockInfoService.Repository.UpdateData(updateOutStockLockInfos);
                }
                _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, locationStatus.ObjToInt(), StockChangeType.Outbound.ObjToInt(), "", tasks?.Select(x => x.TaskNum).ToList());
                _locationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
@@ -260,10 +327,10 @@
            (bool, string) result = CheckRevoke(outboundOrderDetail);
            if (!result.Item1) return WebResponseContent.Instance.Error(result.Item2);
            List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetByOrderDetailId(orderDetailId);
            List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetByOrderDetailId(orderDetailId, OutStockStatus.已分配);
            if (outStockLockInfos.Count > 0)
            {
                List<Dt_StockInfo> stocks = _stockInfoRepository.GetStockInfosByPalletCodes(outStockLockInfos.Select(x => x.PalletCode).ToList());
                List<Dt_StockInfo> stocks = _stockInfoService.Repository.GetStockInfosByPalletCodes(outStockLockInfos.Select(x => x.PalletCode).ToList());
                if (stocks.Count > 0)
                {
                    stocks.ForEach(x =>
@@ -282,9 +349,9 @@
                        x.Status = OutStockStatus.撤销.ObjToInt();
                    });
                    List<Dt_LocationInfo> locationInfos = _locationInfoRepository.GetLocationInfos(stocks.Select(x => x.LocationCode).ToList());
                    List<Dt_LocationInfo> locationInfos = _locationInfoService.Repository.GetLocationInfos(stocks.Select(x => x.LocationCode).ToList());
                    return LockOutboundStockDataUpdate(stocks, outboundOrderDetail, outStockLockInfos, locationInfos, LocationStatusEnum.InStock);
                    return LockOutboundStockDataUpdate(stocks, new List<Dt_OutboundOrderDetail> { outboundOrderDetail }, outStockLockInfos, locationInfos, LocationStatusEnum.InStock);
                }
                return WebResponseContent.Instance.Error("未找到库存信息");
            }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -1,4 +1,6 @@
using AutoMapper;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -26,6 +28,8 @@
        private readonly IStockInfoService _stockInfoService;
        private readonly IStockInfoDetailService _stockDetailService;
        public IOutboundOrderRepository Repository => BaseDal;
        public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService) : base(BaseDal)
        {
            _mapper = mapper;
@@ -37,8 +41,38 @@
        public override WebResponseContent AddData(SaveModel saveModel)
        {
            OutboundOrderAddDTO outboundOrder = saveModel.MainData.DicToModel<OutboundOrderAddDTO>();
            outboundOrder.Details = saveModel.DetailData.DicToIEnumerable<OutboundOrderDetailAddDTO>();
            List<OutboundOrderDetailAddDTO> orderDetailAddDTOs = saveModel.DetailData.DicToIEnumerable<OutboundOrderDetailAddDTO>();
            outboundOrder.Details = orderDetailAddDTOs.GroupBy(x => x.MaterielCode).Select(x => new OutboundOrderDetailAddDTO
            {
                BatchNo = x.FirstOrDefault()?.BatchNo ?? "",
                MaterielCode = x.Key,
                OrderQuantity = x.Sum(x => x.OrderQuantity),
                Remark = x.FirstOrDefault(v => !string.IsNullOrEmpty(v.Remark))?.Remark ?? ""
            }).ToList();
            return AddOutboundOrder(outboundOrder);
        }
        public override WebResponseContent UpdateData(SaveModel saveModel)
        {
            List<Dt_OutboundOrderDetail> outboundOrderDetails = saveModel.DetailData.DicToIEnumerable<Dt_OutboundOrderDetail>();
            if (outboundOrderDetails.GroupBy(x => x.MaterielCode).Select(x => x.Count()).Any(x => x > 1))
            {
                return WebResponseContent.Instance.Error("物料重复");
            }
            outboundOrderDetails = outboundOrderDetails.Where(x => (x.Id > 0 && x.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) || x.Id == 0).ToList();
            List<Dictionary<string, object>> dics = new List<Dictionary<string, object>>();
            JsonSerializerSettings settings = new JsonSerializerSettings();
            settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            foreach (var item in outboundOrderDetails)
            {
                string str = JsonConvert.SerializeObject(item, settings);
                Dictionary<string, object>? dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(str);
                if (dic != null)
                    dics.Add(dic);
            }
            saveModel.DetailData = dics;
            return base.UpdateData(saveModel);
        }
        public WebResponseContent AddOutboundOrder(OutboundOrderAddDTO orderAddDTO)
@@ -107,7 +141,5 @@
            }
            return content;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/WIDESEA_OutboundService.csproj
@@ -9,6 +9,7 @@
  <ItemGroup>
    <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
    <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
    <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" />
    <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" />
  </ItemGroup>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordSetvice.cs
@@ -19,6 +19,8 @@
        {
        }
        public ILocationStatusChangeRecordRepository Repository => BaseDal;
        public void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, int lastStatus, int changeType, string? orderNo, int? taskNum)
        {
            Dt_LocationStatusChangeRecord locationStatusChangeRecord = new Dt_LocationStatusChangeRecord()
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_RecordService/StockQuantityChangeRecordService.cs
@@ -21,6 +21,8 @@
            _mapper = mapper;
        }
        public IStockQuantityChangeRecordRepository Repository => BaseDal;
        public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeType changeType)
        {
            List<Dt_StockQuantityChangeRecord> stockQuantityChangeRecords = new List<Dt_StockQuantityChangeRecord>();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs
@@ -16,6 +16,8 @@
        {
        }
        public IStockInfoDetailRepository Repository => BaseDal;
        public bool ExistSerialNumber(string SerialNumber)
        {
            return BaseDal.QueryFirst(x => x.SerialNumber == SerialNumber) != null;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -30,6 +30,8 @@
        private readonly IAreaInfoRepository _areaInfoRepository;
        private readonly ILocationInfoRepository _locationInfoRepository;
        public IStockInfoRepository Repository => BaseDal;
        public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IStockQuantityChangeRecordService stockQuantityChangeRecordService, IStockInfoDetailRepository stockInfoDetailRepository, IWarehouseRepository warehouseRepository, IRoadwayInfoRepository roadwayInfoRepository, IAreaInfoRepository areaInfoRepository, ILocationInfoRepository locationInfoRepository) : base(BaseDal)
        {
            _mapper = mapper;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryListService.cs
@@ -15,5 +15,7 @@
        public Sys_DictionaryListService(ISys_DictionaryListRepository BaseDal) : base(BaseDal)
        {
        }
        public ISys_DictionaryListRepository Repository => BaseDal;
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs
@@ -26,6 +26,8 @@
            _unitOfWorkManage = unitOfWorkManage;
        }
        public ISys_DictionaryRepository Repository => BaseDal;
        public List<VueDictionaryDTO> GetVueDictionary(string[] dicNos)
        {
            if (dicNos == null || dicNos.Count() == 0) return new List<VueDictionaryDTO>();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_MenuService.cs
@@ -21,6 +21,8 @@
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        public ISys_MenuRepository Repository => BaseDal;
        public Sys_MenuService(ISys_MenuRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleAuthService.cs
@@ -15,5 +15,7 @@
        public Sys_RoleAuthService(ISys_RoleAuthRepository BaseDal) : base(BaseDal)
        {
        }
        public ISys_RoleAuthRepository Repository => BaseDal;
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs
@@ -24,6 +24,9 @@
        private readonly ISys_MenuRepository _MenuRepository;
        private readonly ISys_MenuService _MenuService;
        private readonly ISys_RoleAuthRepository _RoleAuthRepository;
        public ISys_RoleRepository Repository => BaseDal;
        public Sys_RoleService(ISys_RoleRepository BaseDal, ISys_MenuRepository MenuRepository, ISys_MenuService MenuService, ISys_RoleAuthRepository roleAuthRepository, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_TenantService.cs
@@ -20,6 +20,9 @@
    public class Sys_TenantService : ServiceBase<Sys_Tenant, ISys_TenantRepository>, ISys_TenantService
    {
        private IUnitOfWorkManage _unitOfWorkManage;
        public ISys_TenantRepository Repository => BaseDal;
        public Sys_TenantService(ISys_TenantRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_UserService.cs
@@ -20,6 +20,9 @@
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly ICacheService _cacheService;
        public ISys_UserRepository Repository => BaseDal;
        public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService) : base(repository)
        {
            _unitOfWorkManage = unitOfWorkManage;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoRepository/TaskRepository.cs
@@ -20,7 +20,9 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.Helper;
using WIDESEA_ITaskInfoRepository;
using WIDESEA_Model.Models;
@@ -32,5 +34,29 @@
        {
        }
        public int GetTaskNum(string sequenceName)
        {
            return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
        }
        public override int AddData(Dt_Task entity)
        {
            return base.AddData(entity);
        }
        public override int AddData(List<Dt_Task> listEntity)
        {
            if (listEntity.GroupBy(x => x.PalletCode).Select(x => x.Count()).Any(x => x > 1))
            {
                throw new Exception("任务数组数据托盘号重复");
            }
            if (QueryFirst(x => listEntity.Select(v => v.PalletCode).Contains(x.PalletCode)) != null)
            {
                throw new Exception("有重复任务");
            }
            return base.AddData(listEntity);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,229 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Enums;
using WIDESEA_Core;
using WIDESEA_Model.Models;
using WIDESEA_Core.Helper;
namespace WIDESEA_TaskInfoService
{
    public partial class TaskService
    {
        /// <summary>
        /// PDA申请入库--堆垛机立库入库
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="taskType">任务类型--入空,入料</param>
        /// <param name="palletCode">托盘编号</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent GenerateInboundTask(string stationCode, int taskType, string palletCode)
        {
            string? name = Enum.GetName(typeof(TaskTypeEnum), taskType);
            MethodInfo? methodInfo = GetType().GetMethod(name + "Request");
            if (methodInfo != null)
            {
                WebResponseContent? responseContent = (WebResponseContent?)methodInfo.Invoke(this, new object[] { stationCode, palletCode });
                if (responseContent != null)
                {
                    return responseContent;
                }
            }
            else
            {
                return WebResponseContent.Instance.Error("未找到该任务类型业务");
            }
            return WebResponseContent.Instance.Error("错误");
        }
        /// <summary>
        /// ç©ºæ‰˜ç›˜å…¥åº“
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="palletCode">托盘编号</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent PalletInboundRequest(string stationCode, string palletCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                (bool, string) result = CheckRequestInbound(stationCode, palletCode, false);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                content = AssignLocUpdateData(stationCode, TaskTypeEnum.PalletInbound.ObjToInt(), palletCode, false);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// ç‰©æ–™å…¥åº“
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="palletCode">托盘编号</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent InboundRequest(string stationCode, string palletCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StockInfo stockInfo = _stockInfoService.Repository.GetStockInfo(palletCode);
                (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// å…¥åº“分配货位及处理数据
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="taskType">任务类型</param>
        /// <param name="palletCode">托盘编号</param>
        /// <param name="isUpdateStock">是否更新组盘信息--区分物料入库和空托入库</param>
        /// <param name="stockInfo">组盘信息--可空</param>
        /// <param name="orderNo">订单号--可空</param>
        /// <returns>返回处理结果</returns>
        private WebResponseContent AssignLocUpdateData(string stationCode, int taskType, string palletCode, bool isUpdateStock = true, Dt_StockInfo? stockInfo = null, string orderNo = "")
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation(stationCode, taskType);
                if (locationInfo != null)
                {
                    Dt_Task task = new()
                    {
                        CurrentAddress = stationCode,
                        Grade = 0,
                        PalletCode = palletCode,
                        NextAddress = locationInfo.LocationCode,
                        Roadway = locationInfo.RoadwayNo,
                        SourceAddress = stationCode,
                        TargetAddress = locationInfo.LocationCode,
                        TaskStatus = InTaskStatusEnum.InNew.ObjToInt(),
                        TaskType = taskType,
                    };
                    BaseDal.AddData(task);
                    int beforeStatus = locationInfo.LocationStatus;
                    locationInfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt();
                    if (isUpdateStock)
                    {
                        locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
                        if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0)
                        {
                            orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? "";
                            stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                            _stockInfoService.Repository.UpdateData(stockInfo);
                        }
                        else
                        {
                            return content = WebResponseContent.Instance.Error("未找到库存信息");
                        }
                    }
                    _locationInfoService.Repository.UpdateData(locationInfo);
                    _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
                    return content = WebResponseContent.Instance.OK();
                }
                return content = WebResponseContent.Instance.Error("未找到可分配货位");
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// éªŒè¯æ•°æ®
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="palletCode">托盘编号</param>
        /// <param name="isCheckStock">是否检查组盘信息--区分物料入库和空托入库</param>
        /// <param name="stockInfo">组盘信息--可空</param>
        /// <returns>返回处理结果</returns>
        private (bool, string) CheckRequestInbound(string stationCode, string palletCode, bool isCheckStock = true, Dt_StockInfo? stockInfo = null)
        {
            if (BaseDal.QueryFirst(x => x.PalletCode == palletCode) != null)
            {
                return (false, "该托盘号已有任务");
            }
            if (BaseDal.QueryFirst(x => (x.SourceAddress == stationCode || x.CurrentAddress == stationCode) && x.TaskStatus == InTaskStatusEnum.InNew.ObjToInt()) != null)
            {
                return (false, "当前入库站台已有一条新建任务");
            }
            if (isCheckStock)
            {
                if (stockInfo == null)
                {
                    return (false, "未找到组盘信息");
                }
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt())
                {
                    return (false, "该组盘状态不可入库");
                }
                if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                {
                    return (false, "该托盘已绑定货位");
                }
                if (stockInfo.Details == null || stockInfo.Details.Count == 0)
                {
                    return (false, "没有库存明细信息");
                }
            }
            else
            {
                if (_stockInfoService.Repository.QueryFirst(x => x.PalletCode == palletCode) != null)
                {
                    return (false, "该托盘已存在库内");
                }
            }
            return (true, "成功");
        }
        /// <summary>
        /// ç©ºæ‰˜ç›˜å…¥åº“完成处理
        /// </summary>
        /// <param name="task">任务实体对象</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent PalletInboundTaskCompleted(Dt_Task task)
        {
            Dt_StockInfo stockInfo = new Dt_StockInfo()
            {
                PalletCode = task.PalletCode,
                LocationCode = task.TargetAddress,
                StockStatus = StockStatusEmun.已入库.ObjToInt()
            };
            Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            CheckInboundCompleted(stockInfo, locationInfo);
            _stockInfoService.Repository.AddData(stockInfo);
            int beforeStatus = locationInfo.LocationStatus;
            locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
            _locationInfoService.Repository.UpdateData(locationInfo);
            BaseDal.DeleteData(task);
            _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
            return WebResponseContent.Instance.OK();
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Enums;
using WIDESEA_Core;
using WIDESEA_DTO.Stock;
using WIDESEA_Model.Models;
using WIDESEA_Core.Helper;
namespace WIDESEA_TaskInfoService
{
    public partial class TaskService
    {
        public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            for (int i = 0; i < stockInfos.Count; i++)
            {
                Dt_StockInfo stockInfo = stockInfos[i];
                if (stockInfo != null)
                {
                    Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                    Dt_RoadwayInfo roadwayInfo = _roadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo);
                    if (roadwayInfo != null)
                    {
                        Dt_Task task = new()
                        {
                            CurrentAddress = stockInfo.LocationCode,
                            Grade = 0,
                            PalletCode = stockInfo.PalletCode,
                            NextAddress = roadwayInfo.OutSCStationCode,
                            Roadway = locationInfo.RoadwayNo,
                            SourceAddress = stockInfo.LocationCode,
                            TargetAddress = roadwayInfo.OutStationCode,
                            TaskStatus = InTaskStatusEnum.InNew.ObjToInt(),
                            TaskType = TaskTypeEnum.Outbound.ObjToInt(),
                            TaskNum = BaseDal.GetTaskNum("SeqTaskNum")
                        };
                        tasks.Add(task);
                    }
                }
            }
            return tasks;
        }
        public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutboundTaskDataHandle(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            Dt_OutboundOrderDetail outboundOrderDetail = _outboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId);
            if (outboundOrderDetail == null)
            {
                throw new Exception("未找到出库单明细信息");
            }
            if (stockSelectViews.Sum(x => x.UseableQuantity) > outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity)
            {
                throw new Exception("选择数量超出单据数量");
            }
            List<Dt_StockInfo>? stockInfos = null;
            Dt_OutboundOrderDetail? orderDetail = null;
            List<Dt_OutStockLockInfo>? outStockLockInfos = null;
            List<Dt_LocationInfo>? locationInfos = null;
            if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
            {
                (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                if (result.Item1 != null && result.Item1.Count > 0)
                {
                    tasks = GetTasks(result.Item1);
                    result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                    result.Item3.ForEach(x =>
                    {
                        x.Status = OutStockStatus.出库中.ObjToInt();
                    });
                    stockInfos = result.Item1;
                    orderDetail = result.Item2;
                    outStockLockInfos = result.Item3;
                    locationInfos = result.Item4;
                }
                else
                {
                    throw new Exception("无库存");
                }
            }
            else
            {
                List<Dt_OutStockLockInfo> stockLockInfos = _outStockLockInfoService.GetByOrderDetailId(outboundOrderDetail.OrderId);
                if (stockLockInfos != null && stockLockInfos.Count > 0)
                {
                    List<Dt_StockInfo> stocks = _stockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList());
                    tasks = GetTasks(stocks);
                }
            }
            return (tasks, stockInfos, orderDetail == null ? null : new List<Dt_OutboundOrderDetail> { orderDetail }, outStockLockInfos, locationInfos);
        }
        public WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        {
            try
            {
                (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(orderDetailId, stockSelectViews);
                WebResponseContent content = GenerateOutboundTaskDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5);
                return content;
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutboundOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null)
        {
            try
            {
                _unitOfWorkManage.BeginTran();
                BaseDal.AddData(tasks);
                if (stockInfos != null && outboundOrderDetails != null && outStockLockInfos != null && locationInfos != null)
                {
                    WebResponseContent content = _outboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks);
                    if (content.Status)
                    {
                        _unitOfWorkManage.CommitTran();
                    }
                    else
                    {
                        _unitOfWorkManage.RollbackTran();
                    }
                    return content;
                }
                else if (outboundOrderDetails != null && outboundOrderDetails.Count > 0)
                {
                    outboundOrderDetails.ForEach(x =>
                    {
                        x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                    });
                    _outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent GenerateOutboundTask(int[] keys)
        {
            try
            {
                List<Dt_Task> tasks = new List<Dt_Task>();
                List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
                List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>();
                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
                List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
                List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
                foreach (int key in keys)
                {
                    (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(key, stockSelectViews);
                    if (result.Item2 != null && result.Item2.Count > 0)
                    {
                        stockInfos.AddRange(result.Item2);
                    }
                    if (result.Item3 != null && result.Item3.Count > 0)
                    {
                        outboundOrderDetails.AddRange(result.Item3);
                    }
                    if (result.Item4 != null && result.Item4.Count > 0)
                    {
                        outStockLockInfos.AddRange(result.Item4);
                    }
                    if (result.Item5 != null && result.Item5.Count > 0)
                    {
                        locationInfos.AddRange(result.Item5);
                    }
                    if (result.Item1 != null && result.Item1.Count > 0)
                    {
                        tasks.AddRange(result.Item1);
                    }
                }
                WebResponseContent content = GenerateOutboundTaskDataUpdate(tasks, stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos);
                return content;
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -25,6 +25,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
@@ -36,9 +37,11 @@
using WIDESEA_DTO.Stock;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockRepository;
using WIDESEA_IStockService;
using WIDESEA_ITaskInfoRepository;
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
@@ -46,257 +49,46 @@
namespace WIDESEA_TaskInfoService
{
    public class TaskService : ServiceBase<Dt_Task, ITaskRepository>, ITaskService
    public partial class TaskService : ServiceBase<Dt_Task, ITaskRepository>, ITaskService
    {
        private readonly IMapper _mapper;
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly ILocationInfoService _locationInfoService;
        private readonly ILocationInfoRepository _locationInfoRepository;
        private readonly IStockInfoRepository _stockInfoRepository;
        private readonly IStockInfoService _stockInfoService;
        private readonly ILocationStatusChangeRecordSetvice _locationStatusChangeRecordSetvice;
        private readonly IOutboundOrderDetailService _outboundOrderDetailService;
        private readonly IRoadwayInfoRepository _roadwayInfoRepository;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService, ILocationInfoRepository locationInfoRepository, IStockInfoRepository stockInfoRepository, ILocationStatusChangeRecordSetvice locationStatusChangeRecordSetvice, IOutboundOrderDetailService outboundOrderDetailService, IRoadwayInfoRepository roadwayInfoRepository) : base(BaseDal)
        public ITaskRepository Repository => BaseDal;
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService, IStockInfoRepository stockInfoRepository, ILocationStatusChangeRecordSetvice locationStatusChangeRecordSetvice, IOutboundOrderDetailService outboundOrderDetailService, IRoadwayInfoRepository roadwayInfoRepository, IOutStockLockInfoService outStockLockInfoService, IStockInfoService stockInfoService) : base(BaseDal)
        {
            _mapper = mapper;
            _locationInfoService = locationInfoService;
            _locationInfoRepository = locationInfoRepository;
            _stockInfoRepository = stockInfoRepository;
            _stockInfoService = stockInfoService;
            _locationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice;
            _outboundOrderDetailService = outboundOrderDetailService;
            _roadwayInfoRepository = roadwayInfoRepository;
            _unitOfWorkManage = unitOfWorkManage;
        }
        /// <summary>
        /// PDA申请入库--堆垛机立库入库
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="taskType">任务类型--入空,入料</param>
        /// <param name="palletCode">托盘编号</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent GenerateInboundTask(string stationCode, int taskType, string palletCode)
        {
            string? name = Enum.GetName(typeof(TaskTypeEnum), taskType);
            MethodInfo? methodInfo = GetType().GetMethod(name + "Request");
            if (methodInfo != null)
            {
                WebResponseContent? responseContent = (WebResponseContent?)methodInfo.Invoke(this, new object[] { stationCode, palletCode });
                if (responseContent != null)
                {
                    return responseContent;
                }
            }
            else
            {
                return WebResponseContent.Instance.Error("未找到该任务类型业务");
            }
            return WebResponseContent.Instance.Error("错误");
        }
        /// <summary>
        /// ç©ºæ‰˜ç›˜å…¥åº“
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="palletCode">托盘编号</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent PalletInboundRequest(string stationCode, string palletCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                (bool, string) result = CheckRequestInbound(stationCode, palletCode, false);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                content = AssignLocUpdateData(stationCode, TaskTypeEnum.PalletInbound.ObjToInt(), palletCode, false);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// ç‰©æ–™å…¥åº“
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="palletCode">托盘编号</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent InboundRequest(string stationCode, string palletCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StockInfo stockInfo = _stockInfoRepository.GetStockInfo(palletCode);
                (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// å…¥åº“分配货位及处理数据
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="taskType">任务类型</param>
        /// <param name="palletCode">托盘编号</param>
        /// <param name="isUpdateStock">是否更新组盘信息--区分物料入库和空托入库</param>
        /// <param name="stockInfo">组盘信息--可空</param>
        /// <param name="orderNo">订单号--可空</param>
        /// <returns>返回处理结果</returns>
        private WebResponseContent AssignLocUpdateData(string stationCode, int taskType, string palletCode, bool isUpdateStock = true, Dt_StockInfo? stockInfo = null, string orderNo = "")
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation(stationCode, taskType);
                if (locationInfo != null)
                {
                    Dt_Task task = new()
                    {
                        CurrentAddress = stationCode,
                        Grade = 0,
                        PalletCode = palletCode,
                        NextAddress = locationInfo.LocationCode,
                        Roadway = locationInfo.RoadwayNo,
                        SourceAddress = stationCode,
                        TargetAddress = locationInfo.LocationCode,
                        TaskStatus = InTaskStatusEnum.InNew.ObjToInt(),
                        TaskType = taskType,
                    };
                    BaseDal.AddData(task);
                    int beforeStatus = locationInfo.LocationStatus;
                    locationInfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt();
                    if (isUpdateStock)
                    {
                        locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
                        if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0)
                        {
                            orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? "";
                            stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                            _stockInfoRepository.UpdateData(stockInfo);
                        }
                        else
                        {
                            return content = WebResponseContent.Instance.Error("未找到库存信息");
                        }
                    }
                    _locationInfoRepository.UpdateData(locationInfo);
                    _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
                    return content = WebResponseContent.Instance.OK();
                }
                return content = WebResponseContent.Instance.Error("未找到可分配货位");
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// éªŒè¯æ•°æ®
        /// </summary>
        /// <param name="stationCode">起始地址</param>
        /// <param name="palletCode">托盘编号</param>
        /// <param name="isCheckStock">是否检查组盘信息--区分物料入库和空托入库</param>
        /// <param name="stockInfo">组盘信息--可空</param>
        /// <returns>返回处理结果</returns>
        private (bool, string) CheckRequestInbound(string stationCode, string palletCode, bool isCheckStock = true, Dt_StockInfo? stockInfo = null)
        {
            if (BaseDal.QueryFirst(x => x.PalletCode == palletCode) != null)
            {
                return (false, "该托盘号已有任务");
            }
            if (BaseDal.QueryFirst(x => (x.SourceAddress == stationCode || x.CurrentAddress == stationCode) && x.TaskStatus == InTaskStatusEnum.InNew.ObjToInt()) != null)
            {
                return (false, "当前入库站台已有一条新建任务");
            }
            if (isCheckStock)
            {
                if (stockInfo == null)
                {
                    return (false, "未找到组盘信息");
                }
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt())
                {
                    return (false, "该组盘状态不可入库");
                }
                if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                {
                    return (false, "该托盘已绑定货位");
                }
                if (stockInfo.Details == null || stockInfo.Details.Count == 0)
                {
                    return (false, "没有库存明细信息");
                }
            }
            else
            {
                if (_stockInfoRepository.QueryFirst(x => x.PalletCode == palletCode) != null)
                {
                    return (false, "该托盘已存在库内");
                }
            }
            return (true, "成功");
        }
        /// <summary>
        /// ç©ºæ‰˜ç›˜å…¥åº“完成处理
        /// </summary>
        /// <param name="task">任务实体对象</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent PalletInboundTaskCompleted(Dt_Task task)
        {
            Dt_StockInfo stockInfo = new Dt_StockInfo()
            {
                PalletCode = task.PalletCode,
                LocationCode = task.TargetAddress,
                StockStatus = StockStatusEmun.已入库.ObjToInt()
            };
            Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            CheckInboundCompleted(stockInfo, locationInfo);
            _stockInfoRepository.AddData(stockInfo);
            int beforeStatus = locationInfo.LocationStatus;
            locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
            _locationInfoRepository.UpdateData(locationInfo);
            BaseDal.DeleteData(task);
            _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
            return WebResponseContent.Instance.OK();
            _outStockLockInfoService = outStockLockInfoService;
        }
        public WebResponseContent InboundTaskCompleted(Dt_Task task)
        {
            Dt_StockInfo stockInfo = _stockInfoRepository.GetStockInfo(task.PalletCode);
            Dt_StockInfo stockInfo = _stockInfoService.Repository.GetStockInfo(task.PalletCode);
            Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            CheckInboundCompleted(stockInfo, locationInfo);
            stockInfo.LocationCode = locationInfo.LocationCode;
            stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
            _stockInfoRepository.UpdateData(stockInfo);
            _stockInfoService.Repository.UpdateData(stockInfo);
            int beforeStatus = locationInfo.LocationStatus;
            locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
            _locationInfoRepository.UpdateData(locationInfo);
            _locationInfoService.Repository.UpdateData(locationInfo);
            BaseDal.DeleteData(task);
@@ -355,58 +147,5 @@
            return WebResponseContent.Instance.Error();
        }
        public WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        {
            try
            {
                List<Dt_Task> tasks = new List<Dt_Task>();
                (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundOrderDetailService.AssignStockOutbound(orderDetailId, stockSelectViews);
                for (int i = 0; i < result.Item1.Count; i++)
                {
                    Dt_StockInfo stockInfo = result.Item1[i];
                    if (stockInfo != null)
                    {
                        Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                        Dt_RoadwayInfo roadwayInfo = _roadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo);
                        if (roadwayInfo != null)
                        {
                            Dt_Task task = new()
                            {
                                CurrentAddress = stockInfo.LocationCode,
                                Grade = 0,
                                PalletCode = stockInfo.PalletCode,
                                NextAddress = roadwayInfo.OutSCStationCode,
                                Roadway = locationInfo.RoadwayNo,
                                SourceAddress = stockInfo.LocationCode,
                                TargetAddress = roadwayInfo.OutStationCode,
                                TaskStatus = InTaskStatusEnum.InNew.ObjToInt(),
                                TaskType = TaskTypeEnum.Outbound.ObjToInt(),
                            };
                            tasks.Add(task);
                        }
                    }
                }
                result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                result.Item3.ForEach(x =>
                {
                    x.Status = OutStockStatus.出库中.ObjToInt();
                });
                List<Dt_LocationInfo> locationInfos = _locationInfoRepository.GetLocationInfos(result.Item3.Select(x => x.LocationCode).ToList());
                _unitOfWorkManage.BeginTran();
                BaseDal.AddData(tasks);
                _outboundOrderDetailService.LockOutboundStockDataUpdate(result.Item1, result.Item2, result.Item3, locationInfos);
                _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, LocationStatusEnum.Lock.ObjToInt(), StockChangeType.Outbound.ObjToInt(), "", tasks.Select(x => x.TaskNum).ToList());
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
@@ -11,6 +11,7 @@
    <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
    <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" />
    <ProjectReference Include="..\WIDESEA_IStockRepository\WIDESEA_IStockRepository.csproj" />
    <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" />
    <ProjectReference Include="..\WIDESEA_ITaskInfoService\WIDESEA_ITaskInfoService.csproj" />
  </ItemGroup>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs
@@ -28,16 +28,16 @@
            return Service.LockOutboundStock(id, stockSelectViews);
        }
        [HttpPost, Route("LockOutboundStocks")]
        public WebResponseContent LockOutboundStocks([FromBody] int[] keys)
        {
            return Service.LockOutboundStock(keys);
        }
        [HttpPost, Route("RevokeLockOutboundStock")]
        public WebResponseContent RevokeLockOutboundStock(int id)
        {
            return Service.RevokeLockOutboundStock(id);
        }
        [HttpPost, Route("AssignStockOutbound")]
        public (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(int orderDetailId, [FromBody] List<StockSelectViewDTO> stockSelectViews)
        {
            return Service.AssignStockOutbound(orderDetailId, stockSelectViews);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs
@@ -6,6 +6,7 @@
using WIDESEA_Core;
using WIDESEA_Core.Authorization;
using WIDESEA_Core.BaseController;
using WIDESEA_Core.Caches;
using WIDESEA_Core.Const;
using WIDESEA_Core.Helper;
using WIDESEA_Core.HttpContextUser;
@@ -21,10 +22,12 @@
    public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly ICacheService _cacheService;
        public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService)
        public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor, ICacheService cacheService) : base(userService)
        {
            _httpContextAccessor = httpContextAccessor;
            _cacheService = cacheService;
        }
        [HttpPost, Route("login"), AllowAnonymous]
@@ -81,6 +84,7 @@
                    UserName = App.User.UserName
                };
                string newToken = JwtHelper.IssueJwt(tokenModelJwt);
                _cacheService.AddOrUpdate(tokenModelJwt.UserId.ToString(), newToken);
                return responseContent = WebResponseContent.Instance.OK(data: newToken);
            }
            catch (Exception ex)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -17,22 +17,28 @@
        {
        }
        [HttpPost, Route("GenerateInboundTask"), AllowAnonymous]
        [HttpPost, Route("GenerateInboundTask")]
        public WebResponseContent GenerateInboundTask(string stationCode, int inboundType, string palletCode)
        {
            return Service.GenerateInboundTask(stationCode, inboundType, palletCode);
        }
        [HttpPost, Route("TaskCompleted"), AllowAnonymous]
        [HttpPost, Route("TaskCompleted")]
        public WebResponseContent TaskCompleted(int taskNum)
        {
            return Service.TaskCompleted(taskNum);
        }
        [HttpPost, Route("GenerateOutboundTask"), AllowAnonymous]
        [HttpPost, Route("GenerateOutboundTask")]
        public WebResponseContent GenerateOutboundTask(int id, List<StockSelectViewDTO> stockSelectViews)
        {
            return Service.GenerateOutboundTask(id, stockSelectViews);
        }
        [HttpPost, Route("GenerateOutboundTasks")]
        public WebResponseContent GenerateOutboundTasks([FromBody] int[] keys)
        {
            return Service.GenerateOutboundTask(keys);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -40,7 +40,7 @@
builder.Services.AddAllOptionRegister();//读取配置文件
builder.Services.AddMemoryCacheSetup();//缓存
builder.Services.AddSqlsugarSetup();//SqlSugar å¯åŠ¨æœåŠ¡
//builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
builder.Services.AddDbSetup();//Db å¯åŠ¨æœåŠ¡
builder.Services.AddAutoMapperSetup();