From 08c96e4b797573fd64b42a52a2f9b9805d59d3e3 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期日, 07 四月 2024 14:03:54 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java | 61 +++++++++++++++++++----------- 1 files changed, 39 insertions(+), 22 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java index 03965db..a46a9df 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java @@ -7,13 +7,17 @@ import com.zy.asrs.wcs.common.domain.enums.DictType; import com.zy.asrs.wcs.core.map.controller.param.MapDataParam; import com.zy.asrs.wcs.core.map.controller.param.MapQueryParam; +import com.zy.asrs.wcs.core.map.controller.result.LocVo; +import com.zy.asrs.wcs.core.utils.Utils; import com.zy.asrs.wcs.system.entity.Dict; import com.zy.asrs.wcs.system.service.DictService; import com.zy.asrs.wcs.system.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; +import java.util.List; import java.util.Optional; /** @@ -35,28 +39,7 @@ dict.setName(floorKey); dict.setFlag(floorKey); dict.setType(DictType.JSON.flag); - dict.setValue("[\n" + - " {\n" + - " label: '1F',\n" + - " value: 1\n" + - " },\n" + - " {\n" + - " label: '2F',\n" + - " value: 2\n" + - " },\n" + - " {\n" + - " label: '3F',\n" + - " value: 3\n" + - " },\n" + - " {\n" + - " label: '4F',\n" + - " value: 4\n" + - " },\n" + - " {\n" + - " label: '5F',\n" + - " value: 5\n" + - " },\n" + - "]"); + dict.setValue(floorListStr); dict.setCreateBy(userId); dict.setUpdateBy(userId); if (!dictService.save(dict)) { @@ -96,6 +79,17 @@ } } + + public List<LocVo> getShelfLocNoList(String locNo) { + List<LocVo> locVos = new ArrayList<>(); + int row = Utils.getRow(locNo); + int bay = Utils.getBay(locNo); + for (int lev = 1; lev < 6; lev++) { + locVos.add(new LocVo(Utils.getLocNo(row, bay, lev), "F")); + } + return locVos; + } + private String getMapKey(Integer floor) { if (null != floor) { return "map-" + floor; @@ -103,4 +97,27 @@ return "map"; } + private final String floorListStr = "[\n" + + " {\n" + + " label: '1F',\n" + + " value: 1\n" + + " },\n" + + " {\n" + + " label: '2F',\n" + + " value: 2\n" + + " },\n" + + " {\n" + + " label: '3F',\n" + + " value: 3\n" + + " },\n" + + " {\n" + + " label: '4F',\n" + + " value: 4\n" + + " },\n" + + " {\n" + + " label: '5F',\n" + + " value: 5\n" + + " },\n" + + "]"; + } -- Gitblit v1.9.1