Browse Source

线边呼叫

andy 3 years ago
parent
commit
6aacaa0096

+ 27 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LineCallController.java

@@ -0,0 +1,27 @@
+package com.ruoyi.web.controller.warewms.ams;
+
+import com.ruoyi.ams.lineCall.domain.vo.LineCallVO;
+import com.ruoyi.ams.lineCall.service.ILineCallService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/7
+ */
+@RestController
+@RequestMapping("/ams/lineCall")
+public class LineCallController {
+
+    @Autowired
+    private ILineCallService lineCallService;
+
+    @GetMapping(value = "/{id}")
+    public LineCallVO choseFlow(@PathVariable("id") Long id) {
+        return lineCallService.selectLineCall(id,1L);
+    }
+}

+ 9 - 0
ruoyi-ui/src/api/ams/lineCall.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 初始化flow
+export function choseFlow(id) {
+  return request({
+    url: '/ams/lineCall/' + id,
+    method: 'get'
+  })
+}

+ 1 - 1
ruoyi-ui/src/layout/components/Navbar.vue

@@ -8,7 +8,7 @@
     <div class="right-menu">
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
-        
+
         <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
         </el-tooltip>

+ 417 - 0
ruoyi-ui/src/views/ams/lineCall/index.vue

@@ -0,0 +1,417 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="流程名称" prop="flowName">
+        <el-input
+          v-model="queryParams.flowName"
+          placeholder="请输入流程名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!--<el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['ams:flowConfig:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['ams:flowConfig:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['ams:flowConfig:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['ams:flowConfig:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>-->
+
+    <el-table v-loading="loading" :data="flowConfigList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="编号" align="center" prop="id" />
+      <el-table-column label="流程名称" align="center" prop="flowName" />
+      <!--<el-table-column label="物料类型" align="center" prop="skuType" />
+      <el-table-column label="物料类型是否显示" align="center" prop="skuTypeFlag" />
+      <el-table-column label="数量" align="center" prop="qty" />
+      <el-table-column label="数量是否显示" align="center" prop="qtyFlag" />
+      <el-table-column label="重量" align="center" prop="weight" />
+      <el-table-column label="重量是否显示" align="center" prop="weightFlag" />
+      <el-table-column label="供应商" align="center" prop="supplier" />
+      <el-table-column label="供应商是否显示" align="center" prop="supplierFlag" />
+      <el-table-column label="起点范围" align="center" prop="locationFrom" />
+      <el-table-column label="起点是否对接设备" align="center" prop="locationFromDevice" />
+      <el-table-column label="终点范围" align="center" prop="locationTo" />
+      <el-table-column label="终点是否对接设备" align="center" prop="locationToDevice" />-->
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleUpdate(scope.row)"
+          >选择</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改流程配置头对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="物料" prop="skuType">
+          <el-select style="width: 100%" v-model="form.skuType" :multiple="true" placeholder="请选择物料种类" clearable size="small">
+            <el-option
+              v-for="dict in skuTypeCombo"
+              :key="dict.itemCode"
+              :label="dict.itemName"
+              :value="dict.itemCode"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="数量" prop="qty">
+          <el-input v-model="form.qty" placeholder="请输入数量" type="number"/>
+        </el-form-item>
+        <el-form-item label="重量" prop="weight">
+          <el-input v-model="form.weight" placeholder="请输入重量" type="number"/>
+        </el-form-item>
+        <el-form-item label="供应商" prop="supplier">
+          <el-select style="width: 100%" v-model="form.supplier" placeholder="请选择供应商" clearable size="small">
+            <el-option
+              v-for="dict in supplierCombo"
+              :key="dict.supplierId"
+              :label="dict.supplierName"
+              :value="dict.supplierId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="起点范围" prop="locationFrom">
+          <el-select style="width: 100%" v-model="form.locationFrom" placeholder="请选择供应商" clearable size="small">
+            <el-option
+              v-for="dict in locationFromCombo"
+              :key="dict.id"
+              :label="dict.locationNo"
+              :value="dict.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="终点范围" prop="locationTo">
+          <treeselect
+            :multiple="true"
+            v-model="form.locationTo"
+            :options="locationToOptions"
+            :value-consists-of="'BRANCH_PRIORITY'"
+            :filter-node-method="filterNode"
+            :show-count="true" placeholder="请选择终点范围" />
+        </el-form-item>
+        <el-divider content-position="center">批次属性信息</el-divider>
+        <el-table :data="flowConfigDetailsList" :row-class-name="rowFlowConfigDetailsIndex" @selection-change="handleFlowConfigDetailsSelectionChange" ref="flowConfigDetails">
+          <el-table-column label="序号" align="center" prop="index" width="50"/>
+          <el-table-column label="批次属性" prop="lotattId">
+            <template slot-scope="scope">
+              {{scope.row.lotattName}}
+            </template>
+          </el-table-column>
+          <el-table-column label="是否显示" prop="lotattFlag">
+            <template slot-scope="scope">
+              <el-select style="width: 100%" v-model="scope.row.lotattFlag" placeholder="是否显示" clearable size="small">
+                <el-option
+                  v-for="dict in inputTagCombo"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" prop="remark">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark" placeholder="请输入备注" />
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, listLotattConfig } from "@/api/ams/flowConfig";
+import { choseFlow } from "@/api/ams/lineCall";
+import { querySkuTypeDict } from "@/api/base/skuType";
+import { querySupplierDict } from "@/api/base/supplier";
+import { treeselect } from "@/api/base/locationInfo";
+import { inputTag } from "@/utils/combo/dict";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "FlowConfig",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 子表选中数据
+      checkedFlowConfigDetails: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 流程配置头表格数据
+      flowConfigList: [],
+      // 流程配置体表格数据
+      flowConfigDetailsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        flowName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        flowName: [
+          { required: true, message: "流程名称不能为空", trigger: "blur" }
+        ],
+      },
+      defaultProps: {
+        children: "children",
+        label: "label"
+      },
+      inputTagCombo: inputTag,
+      supplierCombo: [],
+      skuTypeCombo: undefined,
+      locationFromOptions: undefined,
+      locationToOptions: undefined,
+      locationFromCombo: undefined
+    };
+  },
+  created() {
+    this.init();
+    this.getList();
+  },
+  methods: {
+    /** 查询流程配置头列表 */
+    getList() {
+      this.loading = true;
+      listFlowConfig(this.queryParams).then(response => {
+        this.flowConfigList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        flowName: null,
+        skuType: null,
+        skuTypeFlag: 'Choice',
+        qty: null,
+        qtyFlag: 'Choice',
+        weight: null,
+        weightFlag: 'Choice',
+        supplier: null,
+        supplierFlag: 'Choice',
+        locationFrom: null,
+        locationTo: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.flowConfigDetailsList = [];
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加流程配置";
+      // 加载批次属性明细
+      listLotattConfig(this.queryParams).then(response => {
+        this.flowConfigDetailsList = response.data;
+      });
+
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      choseFlow(id).then(response => {
+        this.locationFromCombo = response.locationFrom
+        // this.flowConfigDetailsList = response.data.flowConfigDetailsList;
+        this.open = true;
+        this.title = "线边呼叫";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.flowConfigDetailsList = this.flowConfigDetailsList;
+          if (this.form.id != null) {
+            updateFlowConfig(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFlowConfig(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除流程配置编号为"' + ids + '"的数据项?').then(function() {
+        return delFlowConfig(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+	/** 流程配置体序号 */
+    rowFlowConfigDetailsIndex({ row, rowIndex }) {
+      row.index = rowIndex + 1;
+    },
+    /** 流程配置体添加按钮操作 */
+    handleAddFlowConfigDetails() {
+      let obj = {};
+      obj.lotattId = "";
+      obj.lotattFlag = "";
+      obj.remark = "";
+      this.flowConfigDetailsList.push(obj);
+    },
+    /** 流程配置体删除按钮操作 */
+    handleDeleteFlowConfigDetails() {
+      if (this.checkedFlowConfigDetails.length == 0) {
+        this.$modal.msgError("请先选择要删除的流程配置体数据");
+      } else {
+        const flowConfigDetailsList = this.flowConfigDetailsList;
+        const checkedFlowConfigDetails = this.checkedFlowConfigDetails;
+        this.flowConfigDetailsList = flowConfigDetailsList.filter(function(item) {
+          return checkedFlowConfigDetails.indexOf(item.index) == -1
+        });
+      }
+    },
+    /** 复选框选中数据 */
+    handleFlowConfigDetailsSelectionChange(selection) {
+      this.checkedFlowConfigDetails = selection.map(item => item.index)
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('ams/flowConfig/export', {
+        ...this.queryParams
+      }, `flowConfig_${new Date().getTime()}.xlsx`)
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    init() {
+      // 初始化物料分类
+      querySkuTypeDict().then(response => {
+        this.skuTypeCombo = response.data;
+      });
+
+      // 初始化供应商
+      querySupplierDict().then(response => {
+        this.supplierCombo = response.data;
+      });
+
+      // 初始化库位
+      treeselect().then(response => {
+        this.locationFromOptions = response.data;
+        this.locationToOptions = response.data;
+      });
+    }
+  }
+};
+</script>

+ 3 - 2
ruoyi-ui/src/views/ams/locationPriority/index.vue

@@ -401,8 +401,9 @@ export default {
       // 加载批次属性明细
       listLotattConfig().then(response => {
         this.locationPriorityDetailsList = response.data;
-        for(let i=0;i<locationPriorityDetailsList.length;i++) {
-          locationPriorityDetailsList[i].lotattValue = locationPriorityDetailsList[i].defaultValue
+        for(let i=0;i<this.locationPriorityDetailsList.length;i++) {
+          console.log(this.locationPriorityDetailsList[i].defaultValue)
+          this.locationPriorityDetailsList[i].lotattValue = this.locationPriorityDetailsList[i].defaultValue
         }
       });
     },

+ 20 - 17
ruoyi-ui/src/views/base/locationInfo/index.vue

@@ -114,11 +114,11 @@
 
     <el-table v-loading="loading" :data="locationInfoList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="主键" align="center" prop="id" />
-      <el-table-column label="车间id" align="center" prop="warehouseId" />
-      <el-table-column label="区域id" align="center" prop="zoneId" />
+      <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="仓库" align="center" prop="warehouseId" />
+      <!--<el-table-column label="区域" align="center" prop="zoneId" />-->
       <el-table-column label="库位编码" align="center" prop="locationNo" />
-      <el-table-column label="条形码" align="center" prop="locationBarcode" />
+      <!--<el-table-column label="条形码" align="center" prop="locationBarcode" />-->
       <el-table-column label="排号" align="center" prop="rowNo" />
       <el-table-column label="排序号" align="center" prop="rowIndex" />
       <el-table-column label="列号" align="center" prop="colNo" />
@@ -135,11 +135,11 @@
           <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isEmpty"/>
         </template>
       </el-table-column>
-      <el-table-column label="储位类型" align="center" prop="locationType">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.location_type" :value="scope.row.locationType"/>
-        </template>
-      </el-table-column>
+      <!--<el-table-column label="储位类型" align="center" prop="locationType">-->
+        <!--<template slot-scope="scope">-->
+          <!--<dict-tag :options="dict.type.location_type" :value="scope.row.locationType"/>-->
+        <!--</template>-->
+      <!--</el-table-column>-->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -171,10 +171,10 @@
     <!-- 添加或修改库位信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="车间id" prop="warehouseId">
+        <el-form-item label="id" prop="warehouseId">
           <el-input v-model="form.warehouseId" placeholder="请输入车间id" />
         </el-form-item>
-        <el-form-item label="区域id" prop="zoneId">
+        <el-form-item label="区域" prop="zoneId">
           <el-input v-model="form.zoneId" placeholder="请输入区域id" />
         </el-form-item>
         <el-form-item label="库位编码" prop="locationNo">
@@ -202,7 +202,7 @@
           <el-input v-model="form.shiftIndex" placeholder="请输入层序号" />
         </el-form-item>
         <el-form-item label="库位状态" prop="stockStatus">
-          <el-select v-model="form.stockStatus" placeholder="请选择库位状态">
+          <el-select v-model="form.stockStatus" placeholder="请选择库位状态" style="width: 100%">
             <el-option
               v-for="dict in dict.type.库位状态"
               :key="dict.value"
@@ -212,7 +212,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="是否为空" prop="isEmpty">
-          <el-select v-model="form.isEmpty" placeholder="请选择是否为空">
+          <el-select v-model="form.isEmpty" placeholder="请选择是否为空" style="width: 100%">
             <el-option
               v-for="dict in dict.type.sys_yes_no"
               :key="dict.value"
@@ -222,7 +222,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="储位类型" prop="locationType">
-          <el-select v-model="form.locationType" placeholder="请选择储位类型">
+          <el-select v-model="form.locationType" placeholder="请选择储位类型" style="width: 100%">
             <el-option
               v-for="dict in dict.type.location_type"
               :key="dict.value"
@@ -238,10 +238,13 @@
           <el-input v-model="form.agvStation" placeholder="请输入AGV点位" />
         </el-form-item>
         <el-form-item label="是否堆叠" prop="foldedTag">
-          <el-input v-model="form.foldedTag" placeholder="请输入是否堆叠" />
+          <el-select v-model="form.foldedTag" placeholder="请选择是否堆叠" style="width: 100%">
+            <el-option label="非堆叠" value="0"></el-option>
+            <el-option label="堆叠" value="1"></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="堆叠层数" prop="foldedCount">
-          <el-input v-model="form.foldedCount" placeholder="请输入堆叠层数" />
+          <el-input :disabled="form.foldedTag === '0'" v-model="form.foldedCount" placeholder="请输入堆叠层数" />
         </el-form-item>
         <!--<el-form-item label="${comment}" prop="userdefine1">
           <el-input v-model="form.userdefine1" placeholder="请输入${comment}" />
@@ -292,7 +295,7 @@ import { queryWarehouseDict } from "@/api/base/warehouse";
 
 export default {
   name: "LocationInfo",
-  dicts: ['location_type', '库位状态', 'sys_yes_no'],
+  dicts: ['location_type', '库位状态', 'sys_yes_no', 'floor_type'],
   data() {
     return {
       // 遮罩层

+ 70 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/vo/LineCallVO.java

@@ -0,0 +1,70 @@
+package com.ruoyi.ams.lineCall.domain.vo;
+
+import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.domain.BaseSku;
+import com.ruoyi.base.domain.vo.BasLocationTreeSelectVO;
+import com.ruoyi.base.domain.vo.TreeSelectVO;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/7
+ */
+public class LineCallVO {
+    private List<BaseSku> skuList;
+    private Double qty;
+    private Double weight;
+    private String supplier;
+    private List<BaseLocationInfo> locationFrom;
+    private List<BaseLocationInfo> locationTo;
+
+    public List<BaseSku> getSkuList() {
+        return skuList;
+    }
+
+    public void setSkuList(List<BaseSku> skuList) {
+        this.skuList = skuList;
+    }
+
+    public Double getQty() {
+        return qty;
+    }
+
+    public void setQty(Double qty) {
+        this.qty = qty;
+    }
+
+    public Double getWeight() {
+        return weight;
+    }
+
+    public void setWeight(Double weight) {
+        this.weight = weight;
+    }
+
+    public List<BaseLocationInfo> getLocationFrom() {
+        return locationFrom;
+    }
+
+    public void setLocationFrom(List<BaseLocationInfo> locationFrom) {
+        this.locationFrom = locationFrom;
+    }
+
+    public List<BaseLocationInfo> getLocationTo() {
+        return locationTo;
+    }
+
+    public void setLocationTo(List<BaseLocationInfo> locationTo) {
+        this.locationTo = locationTo;
+    }
+
+    public String getSupplier() {
+        return supplier;
+    }
+
+    public void setSupplier(String supplier) {
+        this.supplier = supplier;
+    }
+}

+ 17 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/service/ILineCallService.java

@@ -0,0 +1,17 @@
+package com.ruoyi.ams.lineCall.service;
+
+import com.ruoyi.ams.lineCall.domain.vo.LineCallVO;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/7
+ */
+public interface ILineCallService {
+    /**
+     * 线边呼叫
+     * @param flowConfigId
+     * @return
+     */
+    LineCallVO selectLineCall(Long flowConfigId,Long warehouseId);
+}

+ 85 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/service/impl/LineCallServiceImpl.java

@@ -0,0 +1,85 @@
+package com.ruoyi.ams.lineCall.service.impl;
+
+import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
+import com.ruoyi.ams.config.mapper.FlowConfigHeaderMapper;
+import com.ruoyi.ams.lineCall.domain.vo.LineCallVO;
+import com.ruoyi.ams.lineCall.service.ILineCallService;
+import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.domain.BaseSku;
+import com.ruoyi.base.service.IBaseLocationInfoService;
+import com.ruoyi.base.service.IBaseSkuService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/7
+ */
+@Service
+public class LineCallServiceImpl implements ILineCallService {
+
+    @Autowired
+    private FlowConfigHeaderMapper flowConfigHeaderMapper;
+    @Autowired
+    private IBaseLocationInfoService baseLocationInfoService;
+    @Autowired
+    private IBaseSkuService baseSkuService;
+
+    @Override
+    public LineCallVO selectLineCall(Long flowConfigId, Long warehouseId) {
+        LineCallVO lineCallVO = new LineCallVO();
+        FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderMapper.selectFlowConfigHeaderById(flowConfigId);
+        BaseSku skuQuery = new BaseSku();
+        skuQuery.setSkuType(flowConfigHeaderVO.getSkuType());
+        List<BaseSku> skuList = baseSkuService.selectBaseSkuList(skuQuery);
+
+        List<BaseLocationInfo> locationFromList = new ArrayList<>();
+        List<BaseLocationInfo> locationToList = new ArrayList<>();
+        //初始化起始库位
+        String[] locationFromArr = flowConfigHeaderVO.getLocationFrom().split(",");
+        String[] locationToArr = flowConfigHeaderVO.getLocationTo().split(",");
+        //初始化目标库位
+        for (int i = 0; i < locationFromArr.length; i++) {
+            String s = locationFromArr[i];
+            boolean isLocation = baseLocationInfoService.checkIsLocation(s, warehouseId);
+            if (isLocation) {
+                BaseLocationInfo b = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(s));
+                locationFromList.add(b);
+            } else {
+                BaseLocationInfo query = new BaseLocationInfo();
+                query.setWarehouseId(warehouseId);
+                query.setZoneId(Long.parseLong(s));
+                List<BaseLocationInfo> bList = baseLocationInfoService.selectBaseLocationInfoList(query);
+                locationFromList.addAll(bList);
+            }
+        }
+        for (int i = 0; i < locationToArr.length; i++) {
+            String s = locationToArr[i];
+            boolean isLocation = baseLocationInfoService.checkIsLocation(s, warehouseId);
+            if (isLocation) {
+                BaseLocationInfo b = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(s));
+                locationToList.add(b);
+            } else {
+                BaseLocationInfo query = new BaseLocationInfo();
+                query.setWarehouseId(warehouseId);
+                query.setZoneId(Long.parseLong(s));
+                List<BaseLocationInfo> bList = baseLocationInfoService.selectBaseLocationInfoList(query);
+                locationToList.addAll(bList);
+            }
+        }
+        if (flowConfigHeaderVO.getQty() != null) {
+            lineCallVO.setQty(flowConfigHeaderVO.getQty().doubleValue());
+        }
+        if (flowConfigHeaderVO.getWeight() != null) {
+            lineCallVO.setWeight(flowConfigHeaderVO.getWeight().doubleValue());
+        }
+        lineCallVO.setSkuList(skuList);
+        lineCallVO.setLocationFrom(locationFromList);
+        lineCallVO.setLocationTo(locationToList);
+        return lineCallVO;
+    }
+}

+ 3 - 3
warewms-base/src/main/java/com/ruoyi/base/domain/BaseLocationInfo.java

@@ -88,7 +88,7 @@ public class BaseLocationInfo extends BaseEntity
 
     /** 0默认(没有任何含义),1允许堆叠 */
     @Excel(name = "0默认(没有任何含义),1允许堆叠")
-    private Long foldedTag;
+    private String foldedTag;
 
     /** 叠空托盘上限(当folded_tag为1时有效) */
     @Excel(name = "叠空托盘上限", readConverterExp = "当=folded_tag为1时有效")
@@ -287,12 +287,12 @@ public class BaseLocationInfo extends BaseEntity
     {
         return agvStation;
     }
-    public void setFoldedTag(Long foldedTag) 
+    public void setFoldedTag(String foldedTag)
     {
         this.foldedTag = foldedTag;
     }
 
-    public Long getFoldedTag() 
+    public String getFoldedTag()
     {
         return foldedTag;
     }

+ 9 - 0
warewms-base/src/main/java/com/ruoyi/base/mapper/BaseLocationInfoMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.base.mapper;
 import java.util.List;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 库位信息Mapper接口
@@ -20,6 +21,14 @@ public interface BaseLocationInfoMapper
      */
      BaseLocationInfo selectBaseLocationInfoById(Long id);
 
+    /**
+     * 根据库位编号查询库位信息
+     * @param locationNo
+     * @param wrehouseId
+     * @return
+     */
+     BaseLocationInfo selectBaseLocationInfoByLocationNo(@Param("locationNo") String locationNo,@Param("warehouseId") Long wrehouseId);
+
     /**
      * 查询库位信息列表
      * 

+ 1 - 9
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseLocationInfoServiceImpl.java

@@ -51,15 +51,7 @@ public class BaseLocationInfoServiceImpl implements IBaseLocationInfoService {
 
         }
         if (locationInfo == null) {
-            BaseLocationInfo query = new BaseLocationInfo();
-            query.setLocationNo(idOrNo);
-            query.setWarehouseId(warehouseId);
-            List<BaseLocationInfo> locationInfoList = baseLocationInfoMapper.selectBaseLocationInfoList(query);
-            if (locationInfoList == null || locationInfoList.size() == 0) {
-                return null;
-            } else {
-                return locationInfoList.get(0);
-            }
+            return baseLocationInfoMapper.selectBaseLocationInfoByLocationNo(idOrNo, warehouseId);
         } else {
             return locationInfo;
         }

+ 5 - 0
warewms-base/src/main/resources/mapper/base/BaseLocationInfoMapper.xml

@@ -120,6 +120,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locationType != null  and locationType != ''"> and location_type = #{locationType}</if>
         </where>
     </select>
+
+    <select id="selectBaseLocationInfoByLocationNo" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult">
+        <include refid="selectBaseLocationInfoVo"/>
+        where location_no = #{locationNo} and warehouse_id = #{warehouseId}
+    </select>
     
     <select id="selectBaseLocationInfoById" parameterType="Long" resultMap="BaseLocationInfoResult">
         <include refid="selectBaseLocationInfoVo"/>