自动化立体仓库 - WMS系统
#
LSH
2024-05-17 f17ef6c78d8a0699c7be5715c554878d8c51e884
#
4个文件已修改
57 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocMastController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/LocMastInitParam.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/Shelves.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locMast/locMast.html 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -15,10 +15,12 @@
import com.zy.asrs.entity.param.LocMastInitParam;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.utils.Utils;
import com.zy.common.entity.Parameter;
import com.zy.common.model.Shelves;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@@ -66,15 +68,24 @@
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
        boolean sign = false;
        for (Map.Entry<String, Object> entry : map.entrySet()){
            String val = String.valueOf(entry.getValue());
            if (val.contains(RANGE_TIME_LINK)){
                String[] dates = val.split(RANGE_TIME_LINK);
                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
            } else {
            } else if (entry.getKey().equals("loc_no")){
                wrapper.like(entry.getKey(), val);
            } else {
                if (entry.getKey().equals("loc_type1")){
                    sign=true;
            }
                wrapper.eq(entry.getKey(), val);
            }
        }
        if (sign){
            wrapper.and().ne("loc_sts","Y");
        }
    }
@@ -173,10 +184,16 @@
                    String locNo = String.format("%02d", r) + String.format("%03d", b) + String.format("%02d", l);
                    // 获取堆垛机号
                    int crnNo = 0;
                    Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getCrnAmount());
                    Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getCrnAmount(),param.getStartRow());
                    for (List<Integer> node : shelves.nodes){
                        if (node.contains(r)) {
                            if (!Cools.isEmpty(param.getStaCrn()) && param.getStaCrn() > 0){
                                crnNo = shelves.nodes.indexOf(node) + param.getStaCrn();
                            }else {
                            crnNo = shelves.nodes.indexOf(node) + 1;
                            }
                            break;
                        }
                    }
@@ -199,9 +216,10 @@
                }
            }
        }
//        locMastService.delete(new EntityWrapper<>());
//        locDetlService.delete(new EntityWrapper<>());
//        locMastService.insertBatch(list);
        if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1){
            locMastService.delete(new EntityWrapper<>());
        }
        locMastService.insertBatch(list);
        return R.ok("初始化成功");
    }
}
src/main/java/com/zy/asrs/entity/param/LocMastInitParam.java
@@ -2,10 +2,12 @@
import com.core.common.BaseRes;
import com.core.exception.CoolException;
import lombok.Data;
/**
 * Created by vincent on 2020/6/13
 */
@Data
public class LocMastInitParam {
    // 起始排
@@ -38,6 +40,12 @@
    // 轻重类型: 1:轻库位  2:重库位
    private Short locType3;
    private Integer enable;
    private Integer staCrn;
    private Integer endCrn;
    public Integer getStartRow() {
        if (null == startRow) {
            throw new CoolException(BaseRes.PARAM);
src/main/java/com/zy/common/model/Shelves.java
@@ -38,7 +38,7 @@
    public Shelves(int size, int group, int offset) {
        this.size = size;
        this.group = group;
        this.offset = offset;
        this.offset = offset-1;
        init();
    }
src/main/webapp/views/locMast/locMast.html
@@ -95,6 +95,15 @@
<!-- 重置库位弹窗 -->
<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">
            <div class="layui-inline">
@@ -134,12 +143,22 @@
                </div>
            </div>
        </div>
        <!-- 堆垛机数量 -->
        <div class="layui-form-item">
            <label class="layui-form-label">堆垛机数量</label>
            <div class="layui-input-inline">
                <input type="text" name="crnAmount" lay-verify="required|number" autocomplete="off" class="layui-input">
            </div>
        </div>
        <!-- 起始堆垛机 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起始堆垛机</label>
                <div class="layui-input-inline" >
                    <input type="text" name="staCrn" autocomplete="off" class="layui-input" lay-verify="number">
                </div>
            </div>
        </div>
        <!-- 库位类型 -->
        <div class="layui-form-item">
            <label class="layui-form-label">高低类型</label>