自动化立体仓库 - WMS系统
LSH
2022-12-02 786b7ba9ac838c1d947de03be3ee98d199ca9dc9
#修改合同号
3个文件已修改
54 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocDetlController.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locMast/locMast.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/report/locDetl_detail.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -161,7 +161,48 @@
    @ManagerAuth(memo = "合同号(批号)修改")
    public R updateBatch(LocDetl locDetl){
        if (Cools.isEmpty(locDetl) || null==locDetl.getMatnr()){
            return R.error();
            return R.error("参数异常");
        }else if (locDetl.getBatch().equals(locDetl.getSku())){
            return R.error("前后合同号一致,无需修改!!!");
        }
        try{
            LocDetl locDetlSource = locDetlService.selectItem(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch());
            if (Cools.isEmpty(locDetlSource) || (locDetl.getBatch()==null &&  locDetlSource.getBatch()!=null)){
                locDetlSource = locDetlService.selectOne(new EntityWrapper<LocDetl>()
                        .eq("loc_no",locDetl.getLocNo()).eq("matnr",locDetl.getMatnr()).eq("batch",locDetl.getBatch()));
                if (Cools.isEmpty(locDetlSource)){
                    return R.error("异常");
                }
            }
            LocDetl locDetlEnd = locDetlService.selectItem(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getSku());
            if (!Cools.isEmpty(locDetlEnd) && locDetl.getSku()==null && locDetlEnd.getBatch()!=null){
                locDetlEnd = locDetlService.selectOne(new EntityWrapper<LocDetl>()
                        .eq("loc_no",locDetl.getLocNo()).eq("matnr",locDetl.getMatnr()).eq("batch",locDetl.getSku()));
            }
            if (locDetlSource.getAnfme()-locDetl.getAnfme()==0){
                if (Cools.isEmpty(locDetlEnd)){
                    locDetlSource.setBatch(locDetl.getSku());
                    locDetlService.update(locDetlSource,new EntityWrapper<LocDetl>()
                            .eq("loc_no",locDetlSource.getLocNo()).eq("matnr",locDetlSource.getMatnr()).eq("batch",locDetl.getBatch()));
                }else {
                    locDetlService.updateAnfme(locDetlEnd.getAnfme()+locDetl.getAnfme(),locDetlEnd.getLocNo(),locDetlEnd.getMatnr(),locDetlEnd.getBatch());
                    locDetlService.delete(new EntityWrapper<LocDetl>()
                            .eq("loc_no",locDetl.getLocNo()).eq("matnr",locDetl.getMatnr()).eq("batch",locDetl.getBatch()));
                }
            }else if (locDetlSource.getAnfme()>locDetl.getAnfme()){
                locDetlService.updateAnfme(locDetlSource.getAnfme()-locDetl.getAnfme(),locDetlSource.getLocNo(),locDetlSource.getMatnr(),locDetlSource.getBatch());
                if (Cools.isEmpty(locDetlEnd)){
                    locDetlSource.setAnfme(locDetl.getAnfme());
                    locDetlSource.setBatch(locDetl.getSku());
                    locDetlService.insert(locDetlSource);
                }else {
                    locDetlService.updateAnfme(locDetlEnd.getAnfme()+locDetl.getAnfme(),locDetlEnd.getLocNo(),locDetlEnd.getMatnr(),locDetlEnd.getBatch());
                }
            }else {
                return R.error("输入数量有误,请规范操作!!!");
            }
        }catch (Exception e){
            return R.error("异常");
        }
        return new R(201,"合同号修改成功,请刷新页面!!!");
    }
src/main/webapp/static/js/locMast/locMast.js
@@ -468,6 +468,7 @@
            maktx: $('#maktx').val(),
            zpallet: $('#zpallet').val(),
            specs: $('#specs').val(),
            sku: $('#sku').val(),
        };
        $.ajax({
src/main/webapp/views/report/locDetl_detail.html
@@ -16,9 +16,9 @@
<div id="data-detail" class="layer_self_wrap">
    <form id="updateBatch" class="layui-form" style="height: 100%">
        <div class="layui-inline"  >
            <label class="layui-form-label"><span class="not-null">*</span>合 同 号:</label>
            <label class="layui-form-label"><span class="not-null">*</span>修改合同号:</label>
            <div class="layui-input-inline">
                <input id="batch" class="layui-input" type="text" onkeyup="check(this.id, 'locDetl')">
                <input id="sku" class="layui-input" type="text" onkeyup="check(this.id, 'locDetl')">
            </div>
        </div>
        <div class="layui-inline"  >
@@ -28,6 +28,12 @@
            </div>
        </div>
        <div class="layui-inline"  >
            <label class="layui-form-label"><span class="not-null">*</span>原合同号:</label>
            <div class="layui-input-inline">
                <input id="batch" class="layui-input" disabled ="disabled" type="text" onkeyup="check(this.id, 'locDetl')">
            </div>
        </div>
        <div class="layui-inline"  >
            <label class="layui-form-label"><span class="not-null"></span>库 位 号:</label>
            <div class="layui-input-inline">
                <input id="locNo" class="layui-input" disabled ="disabled" type="text" onkeyup="check(this.id, 'locDetl')">