Merge branch 'phyzwms2' into phyzasrs-erp
# Conflicts:
# src/main/java/com/zy/asrs/controller/AgvMapController.java
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvLocDetl; |
| | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | private Integer max = 10000; |
| | | |
| | | private static final List<String> DISABLE_LOC_NO = new ArrayList<String>() {{ |
| | | // add("0200101"); |
| | | // add("0300101"); |
| | |
| | | |
| | | //获取当前楼层库位数据 |
| | | List<AgvLocMast> locMasts = agvLocMastService.selectLocByLevAndFloor(lev, floor); |
| | | for (AgvLocMast locMast : locMasts) { |
| | | Integer row = locMast.getRow1(); |
| | | Integer bay = locMast.getBay1(); |
| | | |
| | | if (floor == 1 && lev == 2) { |
| | | List<AgvLocMast> distinctRow = agvLocMastService.selectDistinctLocByLevAndFloor(lev, floor); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | int min = 0; |
| | | int i =1; |
| | | for (AgvLocMast locMast : distinctRow) { |
| | | if (min > locMast.getMapRow1()) { |
| | | min = locMast.getMapRow1(); |
| | | } |
| | | if (locMast.getRightSide() == 1) { |
| | | integers.add(i); |
| | | } |
| | | i++; |
| | | |
| | | } |
| | | for (AgvLocMast locMast : locMasts) { |
| | | Integer row = locMast.getMapRow1(); |
| | | if (row < 0) { |
| | | row = row - min + 1; |
| | | } else { |
| | | row = row - min; |
| | | } |
| | | Integer bay = locMast.getMapBay1(); |
| | | Integer rightSide = locMast.getRightSide(); |
| | | int x = bay; |
| | | int y = row; |
| | | y = generateMap4Row(integers, row); |
| | | ArrayList rowData = arrayLists.get(x); |
| | | Object o = rowData.get(y); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(o.toString()); |
| | | jsonObject.put("value", "0"); |
| | | |
| | | jsonObject.put("locNo", locMast.getLocNo());//设置库位号 |
| | | jsonObject.put("locSts", locMast.getLocSts());//库位状态 |
| | | //更新list |
| | | rowData.set(y, jsonObject); |
| | | arrayLists.set(x, rowData); |
| | | } |
| | | } else { |
| | | for (AgvLocMast locMast : locMasts) { |
| | | Integer row = locMast.getRow1(); |
| | | Integer bay = locMast.getBay1(); |
| | | |
| | | |
| | | int x = bay; |
| | | int y = row; |
| | | //2楼 |
| | | if (floor == 1 && lev == 1) { |
| | | x = generateMap1Bay(bay); |
| | | } |
| | | if (floor == 1 && lev == 2) { |
| | | y = generateMap4Row(row); |
| | | } |
| | | //2楼 |
| | | if (floor == 2) { |
| | | y = generateMap2Row(row); |
| | | //y = generateMap2Bay(bay); |
| | | } |
| | | ////3楼 |
| | | if (floor == 3) { |
| | | y = generateMap3Row(row); |
| | | int x = bay; |
| | | int y = row; |
| | | //2楼 |
| | | if (floor == 1 && lev == 1) { |
| | | x = generateMap1Bay(bay); |
| | | } |
| | | //2楼 |
| | | if (floor == 2) { |
| | | y = generateMap2Row(row); |
| | | //y = generateMap2Bay(bay); |
| | | } |
| | | ////3楼 |
| | | if (floor == 3) { |
| | | y = generateMap3Row(row); |
| | | // x = generateMap3Bay(bay); |
| | | } |
| | | |
| | | ArrayList rowData = arrayLists.get(x); |
| | | Object o = rowData.get(y); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(o.toString()); |
| | | jsonObject.put("value", "0"); |
| | | |
| | | jsonObject.put("locNo", locMast.getLocNo());//设置库位号 |
| | | jsonObject.put("locSts", locMast.getLocSts());//库位状态 |
| | | //更新list |
| | | rowData.set(y, jsonObject); |
| | | arrayLists.set(x, rowData); |
| | | } |
| | | |
| | | ArrayList rowData = arrayLists.get(x); |
| | | Object o = rowData.get(y); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(o.toString()); |
| | | jsonObject.put("value", "0"); |
| | | |
| | | jsonObject.put("locNo", locMast.getLocNo());//设置库位号 |
| | | jsonObject.put("locSts", locMast.getLocSts());//库位状态 |
| | | //更新list |
| | | rowData.set(y, jsonObject); |
| | | arrayLists.set(x, rowData); |
| | | } |
| | | |
| | | return JSONObject.toJSONString(arrayLists); |
| | |
| | | |
| | | private Integer generateMap1Bay(int bay) { |
| | | int y = bay; |
| | | Integer[] bayAdd = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105}; |
| | | Integer[] bayAdd = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}; |
| | | for (int i = 0; i < bayAdd.length; i++) { |
| | | if (bay > bayAdd[i]) { |
| | | y++; |
| | |
| | | |
| | | } |
| | | |
| | | private Integer generateMap4Row(int row) { |
| | | private Integer generateMap4Row(List<Integer> rightSide, int row) { |
| | | int x = row; |
| | | Integer[] rowAdd = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119}; |
| | | for (int i = 0; i < rowAdd.length; i++) { |
| | | if (row > rowAdd[i]) { |
| | | // if (rightSide == 0) { |
| | | // x++; |
| | | // } |
| | | for (int i = 0; i < rightSide.size(); i++) { |
| | | if (row > rightSide.get(i)) { |
| | | x++; |
| | | } |
| | | } |
| | |
| | | |
| | | private Integer generateMap2Row(int row) { |
| | | int x = row; |
| | | Integer[] rowAdd = {2, 4, 6, 7, 8, 10, 12, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116}; |
| | | Integer[] rowAdd = {2, 4, 6, 7, 8, 10, 12, 13, 15, 17, 19, 20, 22, 24}; |
| | | for (int i = 0; i < rowAdd.length; i++) { |
| | | if (row > rowAdd[i]) { |
| | | x++; |
| | |
| | | |
| | | private Integer generateMap3Row(int row) { |
| | | int x = row; |
| | | Integer[] rowAdd = {2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122}; |
| | | Integer[] rowAdd = {2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 22, 24, 26, 28, 30, 32}; |
| | | for (int i = 0; i < rowAdd.length; i++) { |
| | | if (row >= rowAdd[i]) { |
| | | x++; |
| | |
| | | if (bay >= 50) y--; |
| | | return y; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | AgvMapController a = new AgvMapController(); |
| | | System.out.println(a.generateMap4Row(4)); |
| | | |
| | | System.out.println(a.process(1)); |
| | | } |
| | | |
| | | private List<Integer> process(int start) { |
| | | List<Integer> l = new ArrayList<>(); |
| | | while (start <= max) { |
| | | l.add(start); |
| | | start = start + 2; |
| | | } |
| | | return l; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/map/searchData/auth") |
| | | @ManagerAuth |
| | |
| | | @ApiModelProperty(value= "") |
| | | private String status; |
| | | |
| | | /** |
| | | * 排 |
| | | */ |
| | | @ApiModelProperty(value= "地图排") |
| | | private Integer mapRow1; |
| | | |
| | | /** |
| | | * 列 |
| | | */ |
| | | @ApiModelProperty(value= "地图列") |
| | | private Integer mapBay1; |
| | | |
| | | @ApiModelProperty(value= "地图列") |
| | | private Integer rightSide; |
| | | |
| | | |
| | | public String getWhsType$(){ |
| | | BasWhsService service = SpringUtils.getBean(BasWhsService.class); |
| | |
| | | |
| | | @Select("SELECT loc_type2 FROM agv_loc_mast WHERE loc_type1 = #{locType1} AND loc_type2 IS NOT NULL GROUP BY loc_type2") |
| | | List<String> queryContainerTypeByLocType1(@Param("locType1")Short locType1); |
| | | |
| | | |
| | | @Select("SELECT distinct map_row1 as mapRow1,right_side as rightSide FROM agv_loc_mast WHERE lev1 = #{lev1} And floor = #{floor} order by map_row1") |
| | | List<AgvLocMast> selectDistinctLocByLevAndFloor(@Param("lev1")Integer lev1,@Param("floor")Integer floor); |
| | | } |
| | |
| | | |
| | | public List<String> queryContainerTypeByLocType1(Short locType1); |
| | | |
| | | List<AgvLocMast> selectDistinctLocByLevAndFloor(int lev, int floor); |
| | | |
| | | } |
| | |
| | | return this.baseMapper.queryContainerTypeByLocType1(locType1); |
| | | } |
| | | |
| | | @Override |
| | | public List<AgvLocMast> selectDistinctLocByLevAndFloor(int lev, int floor) { |
| | | |
| | | return this.agvLocMastMapper.selectDistinctLocByLevAndFloor(lev,floor); |
| | | } |
| | | |
| | | } |
| | |
| | | <input id="floor" class="layui-input" type="text" autocomplete="off" disabled="disabled"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">地图排:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="mapRow1" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">地图列:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="mapBay1" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">侧边过道:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="rightSide" class="layui-input" type="text" autocomplete="off" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;display: none"> |
| | | <label class="layui-form-label">满 板:</label> |
| | | <div class="layui-input-inline" style="text-align: left"> |