自动化立体仓库 - WMS系统
#
zjj
2025-03-14 dd984f63c67236c282d33ee45370d0424dadf5b5
#
4个文件已修改
1个文件已添加
225 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/NodeController.java 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/Node.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/NodeLocInitParam.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/node/node.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/node/node.html 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/NodeController.java
@@ -13,9 +13,12 @@
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasWhs;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.NodeLocInitParam;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.asrs.entity.result.KeyValueVo;
import com.zy.asrs.mapper.ManLocDetlMapper;
@@ -23,6 +26,7 @@
import com.zy.common.entity.NodeExcel;
import com.zy.common.entity.NodeExcelListener;
import com.zy.common.entity.Parameter;
import com.zy.common.model.Shelves;
import com.zy.common.utils.ListUtils;
import com.zy.common.utils.NodeUtils;
import com.zy.common.utils.TreeUtils;
@@ -360,40 +364,84 @@
    @RequestMapping(value = "/node/init/auth")
    @ManagerAuth(memo = "平库库位初始化")
    @Transactional
    public R init(@RequestBody JSONObject param) {
        String area = param.getString("name");
        Integer value = param.getInteger("value");
        Integer num = param.getInteger("startRow");
        EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>();
        nodeEntityWrapper.eq("id",value);
        nodeEntityWrapper.eq("name",area);
        Node node = nodeService.selectOne(nodeEntityWrapper);
        String[] string = node.getNamePath().split(",");
        for (int i = 1; i <= num; i++) {
            String locNo =area + String.format("%04d", i);
            String uuid = String.valueOf(System.currentTimeMillis());
            Date now =  new Date();
            Node node1 = new Node();
            node1.setUuid(uuid);
            node1.setName(locNo);
            node1.setParentId(node.getId());
            node1.setParentName(node.getName());
            node1.setType(3);
            node1.setPath(node.getPath()+","+node.getId());
            node1.setNamePath(node.getNamePath()+","+node.getName());
            node1.setLevel(3);
            node1.setStatus(1);
            node1.setCreateBy(getUserId());
            node1.setCreateTime(now);
            node1.setUpdateBy(getUserId());
            node1.setUpdateTime(now);
            if (!nodeService.insert(node1)){
                return R.error("数据插入失败");
            }
        }
//    @Transactional
    public R init(@RequestBody NodeLocInitParam param) {
        try{
            EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>();
            nodeEntityWrapper.eq("id",param.getValue());
            nodeEntityWrapper.eq("name",param.getName());
            Node node = nodeService.selectOne(nodeEntityWrapper);
        return R.ok("初始化成功");
            if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1){
                nodeService.delete(new EntityWrapper<Node>().eq("parent_id",node.getId()));
            }
            List<Node> list = new ArrayList<>();
            for (int r=param.getStartRow(); r<=param.getEndRow(); r++){
                for (int b=param.getStartBay(); b<=param.getEndBay(); b++) {
                    for (int l=param.getStartLev(); l<=param.getEndLev(); l++) {
                        char rowCode = (char)(64+r);
                        // 获取库位号
                        String locNo = String.format("%02d", param.getCode())+rowCode + String.format("%02d", b) + String.format("%02d", l);
                        String[] string = node.getNamePath().split(",");
                        String uuid = String.valueOf(System.currentTimeMillis());
                        Date now =  new Date();
                        Node node1 = new Node();
                        node1.setUuid(uuid);
                        node1.setName(locNo);
                        node1.setParentId(node.getId());
                        node1.setParentName(node.getName());
                        node1.setType(3);
                        node1.setPath(node.getPath()+","+node.getId());
                        node1.setNamePath(node.getNamePath()+","+node.getName());
                        node1.setLevel(3);
                        node1.setStatus(1);
                        node1.setCreateBy(getUserId());
                        node1.setCreateTime(now);
                        node1.setUpdateBy(getUserId());
                        node1.setUpdateTime(now);
                        nodeService.insert(node1);
                    }
                }
            }
            return R.ok("初始化成功");
        }catch (Exception e){
            return R.error("初始化失败===>"+e.getMessage());
        }
//        String area = param.getString("name");
//        Integer value = param.getInteger("value");
//        Integer num = param.getInteger("startRow");
//        EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>();
//        nodeEntityWrapper.eq("id",value);
//        nodeEntityWrapper.eq("name",area);
//        Node node = nodeService.selectOne(nodeEntityWrapper);
//        String[] string = node.getNamePath().split(",");
//        for (int i = 1; i <= num; i++) {
//            String locNo =area + String.format("%04d", i);
//            String uuid = String.valueOf(System.currentTimeMillis());
//            Date now =  new Date();
//            Node node1 = new Node();
//            node1.setUuid(uuid);
//            node1.setName(locNo);
//            node1.setParentId(node.getId());
//            node1.setParentName(node.getName());
//            node1.setType(3);
//            node1.setPath(node.getPath()+","+node.getId());
//            node1.setNamePath(node.getNamePath()+","+node.getName());
//            node1.setLevel(3);
//            node1.setStatus(1);
//            node1.setCreateBy(getUserId());
//            node1.setCreateTime(now);
//            node1.setUpdateBy(getUserId());
//            node1.setUpdateTime(now);
//            if (!nodeService.insert(node1)){
//                return R.error("数据插入失败");
//            }
//        }
    }
}
src/main/java/com/zy/asrs/entity/Node.java
@@ -25,6 +25,7 @@
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    @TableField("id")
    private Long id;
    /**
src/main/java/com/zy/asrs/entity/param/NodeLocInitParam.java
New file
@@ -0,0 +1,39 @@
package com.zy.asrs.entity.param;
import lombok.Data;
@Data
public class NodeLocInitParam {
    // 起始排
    private String name;
    // 终止排
    private Integer value;
    // 起始列
    private Integer code;
    // 起始列
    private Integer select;
    // 终止列
    private Integer enable;
    // 起始排
    private Integer startRow;
    // 终止排
    private Integer endRow;
    // 起始列
    private Integer startBay;
    // 终止列
    private Integer endBay;
    // 起始层
    private Integer startLev;
    // 终止层
    private Integer endLev;
}
src/main/webapp/static/js/node/node.js
@@ -31,18 +31,15 @@
        cols: [[
            {type: 'checkbox'}
            // {type: 'numbers'}
            ,{field: 'name', align: 'left',title: '编号/名称', minWidth: 150}
            ,{field: 'name', align: 'left',title: '编号/名称'}
            // ,{field: 'uuid', left: 'center',title: '编号/名称', minWidth: 150}
            ,{field: 'type$', align: 'center',title: '类型', templet: '#typeTpl'}
            ,{field: 'type$', align: 'center',title: '类型', templet: '#typeTpl', minWidth: 150}
            // ,{field: 'leading', align: 'center',title: '负责人'}
            // ,{field: 'img', align: 'center',title: '图片', hide: true}
            // ,{field: 'brief', align: 'center',title: '简要描述'}
            // ,{field: 'count', align: 'center',title: '数量'}
            // ,{field: 'sort', align: 'center',title: '排序'}
            ,{field: 'status$', align: 'center',title: '状态', hide: true}
            ,{field: 'row1$', align: 'center',title: '排'}
            ,{field: 'bay1$', align: 'center',title: '列'}
            ,{field: 'lev1$', align: 'center',title: '层'}
            ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            ,{field: 'updateBy$', align: 'center',title: '修改人员'}
            ,{field: 'memo', align: 'center',title: '备注', hide: true}
@@ -52,7 +49,7 @@
        done: function (data) {
            console.log(data)
            $('.ew-tree-table-box').css('height', '100%');
            insTb.expandAll();
            // insTb.expandAll();
            tbDataList = data;
        }
src/main/webapp/views/node/node.html
@@ -137,6 +137,16 @@
<div id="resetLocDiv" style="margin: 20px 0 10px 30px; display: none">
    <div class="layui-form layui-form-pane">
       <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">删除库位</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="checkbox" name="enable" lay-skin="switch" value="1" lay-text="删除|保留">
                </div>
            </div>
        </div>
        <!-- 库位类型 -->
        <div class="layui-form-item">
            <label class="layui-form-label">库区</label>
@@ -145,27 +155,61 @@
                </div>
            </div>
        </div>
        <!-- 排 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">库位数量</label>
                <label class="layui-form-label">仓库代码</label>
                <div class="layui-input-inline">
                    <input type="number" name="startRow" autocomplete="off" class="layui-input" lay-verify="required|number">
                    <input type="number" name="code" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <div id="prompt" style="text-indent: 10px;">
            <span class="not-null">初始化库位后将删除库存明细,请谨慎操作!</span>
        <!-- 排 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止排</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startRow" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endRow" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <!-- 列 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止列</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startBay" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endBay" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <!-- 层 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止层</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startLev" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endLev" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <!-- 按钮 -->
        <div style="text-align: center; margin-top: 20px">
            <button class="layui-btn layui-btn-radius layui-btn-normal" id="initDo" lay-submit lay-filter="initDo">确定</button>
        </div>
    </div>
</div>