andy преди 3 години
родител
ревизия
f994ddfd0f

+ 29 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LocationViewController.java

@@ -0,0 +1,29 @@
+package com.ruoyi.web.controller.warewms.ams;
+
+import com.ruoyi.ams.locationView.domain.form.LocationViewForm;
+import com.ruoyi.ams.locationView.domain.vo.LocationViewVO;
+import com.ruoyi.ams.locationView.service.LocationViewService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/16
+ */
+@RestController
+@RequestMapping("/ams/locationView")
+public class LocationViewController extends BaseController {
+
+    @Autowired
+    private LocationViewService locationViewService;
+
+    @GetMapping(value = "/view")
+    public AjaxResult getInfo(LocationViewForm locationViewForm)
+    {
+        LocationViewVO locationViewVO = locationViewService.locationView(locationViewForm);
+        return AjaxResult.success(locationViewVO);
+    }
+}

+ 14 - 0
ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java

@@ -6,6 +6,9 @@ import com.ruoyi.ams.config.domain.dto.InWarehouseDTO;
 import com.ruoyi.ams.business.IBusinessService;
 import com.ruoyi.ams.config.service.LocationAllocationStrategy;
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
+import com.ruoyi.ams.locationView.domain.form.LocationViewForm;
+import com.ruoyi.ams.locationView.domain.vo.LocationViewVO;
+import com.ruoyi.ams.locationView.service.LocationViewService;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.BaseWarehouse;
 import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
@@ -43,6 +46,8 @@ public class WarehouseTest {
     private BaseSkuMapper baseSkuMapper;
     @Autowired
     private InvLotLocIdMapper invLotLocIdMapper;
+    @Autowired
+    private LocationViewService locationViewService;
 
     @Test
     public void test() {
@@ -73,4 +78,13 @@ public class WarehouseTest {
         List<BaseLocationLotattVO> locationList = invLotLocIdMapper.selectInvLocationList(null,null,null,null,null,null);
         System.out.println(JSON.toJSONString(locationList));
     }
+
+    @Test
+    public void test3(){
+        LocationViewForm form = new LocationViewForm();
+        form.setZoneId(2L);
+        form.setWarehouseId(1L);
+        LocationViewVO locationViewVO = locationViewService.locationView(form);
+        System.out.println(JSON.toJSONString(locationViewVO));
+    }
 }

+ 10 - 0
ruoyi-ui/src/api/ams/locationView.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 查询流程配置头列表
+export function locationView(query) {
+  return request({
+    url: '/ams/locationView/view',
+    method: 'get',
+    params: query
+  })
+}

+ 85 - 236
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -1,265 +1,114 @@
 <template>
   <div class="app-container">
+    <div>
+      <ul class="wall-row"
+          :style="{'width':(this.tableAttr.cols * 39)+'px', 'height':(this.tableAttr.rows * 40) + 'px'}">
+        <li
+          v-for="(item, index) in divList"
+          :key="index"
+          @click="selected"
+        >{{item.locationNo}}
+        </li>
+      </ul>
+    </div>
   </div>
 </template>
 
 <script>
-  import {
-    listFlowConfig,
-    getFlowConfig,
-    updateFlowConfig,
-    listLotattConfig,
-    flowConfigLotatt
-  } from "@/api/ams/flowConfig";
-  import {choseFlow, exec} from "@/api/ams/lineCall";
-  import {querySkuDict} from "@/api/base/baseSku";
-  import {querySupplierDict} from "@/api/base/supplier";
-  import {treeselect} from "@/api/base/locationInfo";
-  import {inputTag} from "@/utils/combo/dict";
+  import {locationView} from "@/api/ams/locationView";
 
   export default {
-    name: "FlowConfig",
-    dicts: ['sys_yes_no', 'ams_inv_quality'],
+    name: "LocationView",
     data() {
       return {
+        divList: [],
         // 遮罩层
         loading: true,
-        // 选中数组
-        ids: [],
-        // 子表选中数据
-        checkedFlowConfigDetails: [],
-        // 非单个禁用
-        single: true,
-        // 非多个禁用
-        multiple: true,
-        // 显示搜索条件
-        showSearch: true,
-        // 总条数
-        total: 0,
-        // 流程配置头表格数据
-        flowConfigList: [],
-        // 流程配置体表格数据
-        flowConfigDetailsList: [],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
-        open: false,
         // 查询参数
         queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          flowName: null,
+          zoneId: 2,
+          warehouseId: 1
         },
         // 表单参数
         form: {},
         // 表单校验
-        rules: {
-          flowName: [
-            {required: true, message: "流程名称不能为空", trigger: "blur"}
-          ],
-        },
-        defaultProps: {
-          children: "children",
-          label: "label"
-        },
-        inputTagCombo: inputTag,
-        supplierCombo: [],
-        skuTypeCombo: undefined,
-        locationFromOptions: undefined,
-        locationToOptions: undefined,
-        locationFromCombo: undefined,
-        locationToCombo: undefined
+        rules: {},
+        tableAttr: {
+          rows: 3,
+          cols: 3
+        }
       };
     },
     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,
-          sku: '',
-          skuTypeFlag: 'Choice',
-          qty: null,
-          qtyFlag: 'Choice',
-          weight: null,
-          weightFlag: 'Choice',
-          supplier: '',
-          supplierFlag: 'Choice',
-          locationFrom: null,
-          locationFromFlag: null,
-          locationTo: null,
-          locationToFlag: null,
-          createBy: null,
-          createTime: null,
-          updateBy: null,
-          updateTime: null,
-          remark: null,
-          lineCallDetailsFormList: 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 = "添加流程配置";
-      },
-      /** 修改按钮操作 */
-      handleUpdate(row) {
-        this.reset();
-        const id = row.id || this.ids
-        // 加载批次属性明细
-        flowConfigLotatt(id).then(response => {
-          this.flowConfigDetailsList = response.data;
-        });
-        choseFlow(id).then(response => {
-          this.locationFromCombo = response.locationFrom
-          this.locationToCombo = response.locationTo
-          this.form.skuTypeFlag = response.skuTypeFlag
-          this.form.qtyFlag = response.qtyFlag
-          this.form.weightFlag = response.weightFlag
-          this.form.supplierFlag = response.supplierFlag
-          this.form.locationFromFlag = response.locationFromFlag
-          this.form.locationToFlag = response.locationToFlag
-          this.skuTypeCombo = response.skuList;
-          this.open = true;
-          this.title = "线边呼叫";
-        });
-      },
-      /** 提交按钮 */
-      submitForm() {
-        this.$refs["form"].validate(valid => {
-          if (valid) {
-            if (this.form.skuTypeFlag === 'Required' && this.form.skuType === '') {
-              this.$modal.msgError("物料必须选择");
-              return
-            }
-            if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
-              this.$modal.msgError("数量必须输入");
-              return
-            }
-            if (this.form.weightFlag === 'Required' && this.form.weight === null) {
-              this.$modal.msgError("重量必须输入");
-              return
-            }
-            if (this.form.supplierFlag === 'Required' && this.form.supplier === null) {
-              this.$modal.msgError("供应商必须输入");
-              return
-            }
-            if (this.form.locationFromFlag === 'Required' && this.form.locationFrom === null) {
-              this.$modal.msgError("必须选择起点位置");
-              return
-            }
-            if (this.form.locationToFlag === 'Required' && this.form.locationTo === null) {
-              this.$modal.msgError("必须选择终点位置");
-              return
-            }
-
-            if (this.flowConfigDetailsList.length > 0) {
-              for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
-                if (this.flowConfigDetailsList[i].lotattFlag === 'Required') {
-                  if(this.flowConfigDetailsList[i].lotattValue === '' || this.flowConfigDetailsList[i].lotattValue === null) {
-                    this.$modal.msgError(this.flowConfigDetailsList[i].lotattName+"必须输入");
-                    return
-                  }
-                }
-              }
-            }
-
-            let lineCallDetailsFormList = new Array();
-            for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
-              let obj = new Object();
-              obj.lotattId = this.flowConfigDetailsList[i].lotattId
-              obj.lotattValue = this.flowConfigDetailsList[i].lotattValue
-              lineCallDetailsFormList.push(obj)
-            }
-            this.form.lineCallDetailsFormList = lineCallDetailsFormList
-            console.log(this.form)
-            exec(this.form).then(response => {
-              if (response.code === 200) {
-                this.$modal.msgSuccess("执行成功");
-                this.open = false;
-              } else {
-                this.$modal.msgError(response.msg);
-              }
-            });
-          }
-        });
-      },
-      /** 流程配置体序号 */
-      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)
-      },
-      // 筛选节点
-      filterNode(value, data) {
-        if (!value) return true;
-        return data.label.indexOf(value) !== -1;
-      },
       init() {
-        // 初始化供应商
-        querySupplierDict().then(response => {
-          this.supplierCombo = response.data;
-        });
+        locationView(this.queryParams).then(response => {
+          let data = response.data
+          this.tableAttr.rows = data.rows
+          this.tableAttr.cols = data.cols
+          this.divList = data.locationViewInfoVOList
+        })
       }
     }
   };
 </script>
+
+<style scoped lang="css">
+  .custom-style {
+    position: absolute;
+    margin: 0;
+    padding: 0;
+    height: 440px;
+    width: 400px;
+    left: 50%;
+    top: 50%;
+    margin-left: -200px;
+    margin-top: -210px;
+  }
+
+  .word {
+    display: block;
+    width: 100%;
+    height: 20px;
+    font-size: 13px;
+    background-color: #e2eef6;
+  }
+
+  .word span {
+    line-height: 20px;
+    text-align: center;
+  }
+
+  .wall-row {
+    width: 400px;
+    height: 400px;
+    padding: 0;
+    margin: 0;
+    display: block;
+    position: relative;
+  }
+
+  .wall-row li {
+    list-style: none;
+    width: 39px;
+    height: 40px;
+    border: 0.5px solid #fff;
+    float: left;
+    background-color: #ebf0f4;
+  }
+
+  .wall-row .bgColor {
+    background-color: #00b4ff;
+  }
+
+  .word-cancel {
+    width: 100%;
+    height: 20px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+
+</style>

+ 27 - 0
warewms-ams/src/main/java/com/ruoyi/ams/locationView/domain/form/LocationViewForm.java

@@ -0,0 +1,27 @@
+package com.ruoyi.ams.locationView.domain.form;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/16
+ */
+public class LocationViewForm {
+    private Long zoneId;
+    private Long warehouseId;
+
+    public Long getZoneId() {
+        return zoneId;
+    }
+
+    public void setZoneId(Long zoneId) {
+        this.zoneId = zoneId;
+    }
+
+    public Long getWarehouseId() {
+        return warehouseId;
+    }
+
+    public void setWarehouseId(Long warehouseId) {
+        this.warehouseId = warehouseId;
+    }
+}

+ 36 - 0
warewms-ams/src/main/java/com/ruoyi/ams/locationView/domain/vo/LocationViewInfoVO.java

@@ -0,0 +1,36 @@
+package com.ruoyi.ams.locationView.domain.vo;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/16
+ */
+public class LocationViewInfoVO {
+    private String locationNo;
+    private String sku;
+    private Float qty;
+
+    public String getLocationNo() {
+        return locationNo;
+    }
+
+    public void setLocationNo(String locationNo) {
+        this.locationNo = locationNo;
+    }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    public Float getQty() {
+        return qty;
+    }
+
+    public void setQty(Float qty) {
+        this.qty = qty;
+    }
+}

+ 38 - 0
warewms-ams/src/main/java/com/ruoyi/ams/locationView/domain/vo/LocationViewVO.java

@@ -0,0 +1,38 @@
+package com.ruoyi.ams.locationView.domain.vo;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/16
+ */
+public class LocationViewVO {
+    private Integer cols;
+    private Integer rows;
+    private List<LocationViewInfoVO> locationViewInfoVOList;
+
+    public Integer getCols() {
+        return cols;
+    }
+
+    public void setCols(Integer cols) {
+        this.cols = cols;
+    }
+
+    public Integer getRows() {
+        return rows;
+    }
+
+    public void setRows(Integer rows) {
+        this.rows = rows;
+    }
+
+    public List<LocationViewInfoVO> getLocationViewInfoVOList() {
+        return locationViewInfoVOList;
+    }
+
+    public void setLocationViewInfoVOList(List<LocationViewInfoVO> locationViewInfoVOList) {
+        this.locationViewInfoVOList = locationViewInfoVOList;
+    }
+}

+ 81 - 0
warewms-ams/src/main/java/com/ruoyi/ams/locationView/service/LocationViewService.java

@@ -0,0 +1,81 @@
+package com.ruoyi.ams.locationView.service;
+
+import com.ruoyi.ams.locationView.domain.form.LocationViewForm;
+import com.ruoyi.ams.locationView.domain.vo.LocationViewInfoVO;
+import com.ruoyi.ams.locationView.domain.vo.LocationViewVO;
+import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
+import com.ruoyi.base.mapper.BaseLocationInfoMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/3/16
+ */
+@Service
+public class LocationViewService {
+
+    @Autowired
+    private BaseLocationInfoMapper baseLocationInfoMapper;
+
+    public LocationViewVO locationView(LocationViewForm locationViewForm) {
+        LocationViewVO locationViewVO = new LocationViewVO();
+        List<LocationViewInfoVO> list = new ArrayList<>();
+        BaseLocationInfo query = new BaseLocationInfo();
+        query.setZoneId(locationViewForm.getZoneId());
+        query.setWarehouseId(locationViewForm.getWarehouseId());
+        List<BaseLocationLotattVO> locationInfoList = baseLocationInfoMapper.selectSortedLocationLotattListByZoneId(query);
+        Integer rows = 0;
+        Integer cols = 0;
+        Integer current = 0;
+        Map<String, List<LocationViewInfoVO>> temp = new HashMap<>();
+        List<LocationViewInfoVO> colList;
+        for (BaseLocationLotattVO b : locationInfoList) {
+            if (!temp.containsKey(b.getColNo())) {
+                colList = new ArrayList<>();
+                cols++;
+                current = 0;
+                temp.put(b.getColNo(), colList);
+            } else {
+                colList = temp.get(b.getColNo());
+            }
+            current++;
+            if (rows < current) {
+                rows = current;
+            }
+            LocationViewInfoVO infoVO = new LocationViewInfoVO();
+            infoVO.setLocationNo(b.getLocationNo());
+            infoVO.setQty(b.getQty());
+            infoVO.setSku(b.getSku());
+            colList.add(infoVO);
+        }
+
+        for (int i = 1; i <= cols; i++) {
+            for (int j = 1; j <= rows; j++) {
+
+            }
+        }
+
+        for (int j = 1; j <= rows; j++) {
+            for (Map.Entry entry : temp.entrySet()) {
+                List<LocationViewInfoVO> l = (List<LocationViewInfoVO>) entry.getValue();
+                if (j > l.size()) {
+                    LocationViewInfoVO infoVO = new LocationViewInfoVO();
+                    list.add(infoVO);
+                } else {
+                    LocationViewInfoVO infoVO = l.get(j-1);
+                    list.add(infoVO);
+                }
+            }
+        }
+
+        locationViewVO.setCols(cols);
+        locationViewVO.setRows(rows);
+        locationViewVO.setLocationViewInfoVOList(list);
+        return locationViewVO;
+    }
+}