#
luxiaotao1123
2021-03-10 9d13343087fad70aebae38f04d533dd3832ef40c
#
10个文件已修改
204 ■■■■ 已修改文件
src/main/java/zy/cloud/wms/manager/controller/LocDetlController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/mapper/LocDetlMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/service/LocDetlService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/service/impl/LocDetlServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/ioWorks/stockOut.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/ioWorks/locDetlQuery.html 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/ioWorks/stockOut.html 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locDetl/locDetl.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/controller/LocDetlController.java
@@ -43,31 +43,19 @@
        Object nodeId = param.get("node_id");
        if (Cools.isEmpty(nodeId)) {
            nodeId = getOriginNode().getId();
            param.put("node_id", String.valueOf(nodeId));
        }
        return R.ok(locDetlService.getPage(new Page<>(curr, limit)
                , String.valueOf(nodeId)
                , param.get("loc_no")
                , param.get("matnr")
                , param.get("maktx"))
        );
        if (!Cools.isEmpty(param.get("update_time"))){
            String val = String.valueOf(param.get("update_time"));
            if (val.contains(RANGE_TIME_LINK)) {
                String[] dates = val.split(RANGE_TIME_LINK);
                param.put("startTime", DateUtils.convert(dates[0]));
                param.put("endTime", DateUtils.convert(dates[1]));
                param.remove("update_time");
            }
        }
        return R.ok(locDetlService.getPage(toPage(curr, limit, param, LocDetl.class)));
    }
//    @RequestMapping(value = "/stock/out/list/auth")
//    @ManagerAuth
//    public R stockOutList(@RequestParam(defaultValue = "1")Integer curr,
//                          @RequestParam(defaultValue = "10")Integer limit,
//                          @RequestParam Map<String, Object> param){
//        if (!Cools.isEmpty(param.get("update_time"))){
//            String val = String.valueOf(param.get("update_time"));
//            if (val.contains(RANGE_TIME_LINK)) {
//                String[] dates = val.split(RANGE_TIME_LINK);
//                param.put("startTime", DateUtils.convert(dates[0]));
//                param.put("endTime", DateUtils.convert(dates[1]));
//                param.remove("modi_time");
//            }
//        }
//        return R.ok(locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class)));
//    }
    private void convert(Map<String, Object> map, EntityWrapper wrapper){
        for (Map.Entry<String, Object> entry : map.entrySet()){
src/main/java/zy/cloud/wms/manager/mapper/LocDetlMapper.java
@@ -1,19 +1,21 @@
package zy.cloud.wms.manager.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import zy.cloud.wms.manager.entity.LocDetl;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
public interface LocDetlMapper extends BaseMapper<LocDetl> {
    List<LocDetl> listByPage(Page page, @Param("nodeId") String nodeId, @Param("locNo") Object locNo, @Param("matnr") Object matnr, @Param("maktx") Object maktx);
    List<LocDetl> listByPage(Map<String, Object> map);
    Integer listByPageCount(Map<String, Object> map);
    LocDetl selectByLocNoAndMatnr(@Param("nodeId")Long nodeId, @Param("matnr")String martnr);
src/main/java/zy/cloud/wms/manager/service/LocDetlService.java
@@ -8,7 +8,7 @@
public interface LocDetlService extends IService<LocDetl> {
    Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx);
    Page<LocDetl> getPage(Page<LocDetl> page);
    LocDetl getLocDetl(Long nodeId, String matnr);
src/main/java/zy/cloud/wms/manager/service/impl/LocDetlServiceImpl.java
@@ -28,8 +28,10 @@
    private MatService matService;
    @Override
    public Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx) {
        return page.setRecords(baseMapper.listByPage(page, nodeId, locNo, matnr, maktx));
    public Page<LocDetl> getPage(Page<LocDetl> page) {
        page.setRecords(baseMapper.listByPage(page.getCondition()));
        page.setTotal(baseMapper.listByPageCount(page.getCondition()));
        return page;
    }
    @Override
src/main/resources/mapper/LocDetlMapper.xml
@@ -31,15 +31,9 @@
    </resultMap>
    <select id="listByPage" resultMap="BaseResultMap">
        SELECT
        mld.*
        FROM man_loc_detl mld
        LEFT JOIN man_node mn ON mld.node_id = mn.id
        WHERE 1=1
        AND (CHARINDEX(#{nodeId}, ','+mn.path+',') > 0 OR mn.id = #{nodeId})
        <if test="locNo != null and locNo != ''">
            and mld.loc_no like concat('%',#{locNo},'%')
    <sql id="locDetlCondition">
        <if test="loc_no != null and loc_no != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="matnr != null and matnr != ''">
            and mld.matnr like concat('%',#{matnr},'%')
@@ -47,7 +41,33 @@
        <if test="maktx != null and maktx != ''">
            and mld.maktx like concat('%',#{maktx},'%')
        </if>
        ORDER BY mld.create_time DESC
        <if test="startTime!=null and endTime!=null">
            and mld.update_time between #{startTime} and #{endTime}
        </if>
    </sql>
    <select id="listByPage" resultMap="BaseResultMap">
        select * from
        (
            SELECT
            ROW_NUMBER() over (order by mld.create_time desc) as row,
            mld.*
            FROM man_loc_detl mld
            LEFT JOIN man_node mn ON mld.node_id = mn.id
            WHERE 1=1
            AND (CHARINDEX(#{node_id}, ','+mn.path+',') > 0 OR mn.id = #{node_id})
            <include refid="locDetlCondition"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="listByPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
        select
        count(1)
        FROM man_loc_detl mld
        LEFT JOIN man_node mn ON mld.node_id = mn.id
        WHERE 1=1
        AND (CHARINDEX(#{node_id}, ','+mn.path+',') > 0 OR mn.id = #{node_id})
        <include refid="locDetlCondition"></include>
    </select>
    <select id="selectByLocNoAndMatnr" resultMap="BaseResultMap">
src/main/webapp/static/js/common.js
@@ -200,8 +200,9 @@
var detlCols = [
    {field: 'matnr', align: 'center',title: '商品编号'}
    ,{field: 'maktx', align: 'center',title: '商品名称'}
    ,{field: 'name', align: 'center',title: '名称'}
    ,{field: 'specs', align: 'center',title: '规格'}
    ,{field: 'anfme', align: 'center',title: '库存数量'}
    ,{field: 'name', align: 'center',title: '名称', hide: true}
    ,{field: 'specs', align: 'center',title: '规格', hide: true}
    ,{field: 'model', align: 'center',title: '型号', hide: true}
    ,{field: 'batch', align: 'center',title: '批号', hide: true}
    ,{field: 'unit', align: 'center',title: '单位'}
@@ -210,7 +211,7 @@
    ,{field: 'docNum', align: 'center',title: '单据编号', hide: true}
    ,{field: 'custName', align: 'center',title: '客户名称', hide: true}
    ,{field: 'itemNum', align: 'center',title: '品项数', hide: true}
    ,{field: 'count', align: 'center',title: '数量'}
    ,{field: 'count', align: 'center',title: '数量', hide: true}
    ,{field: 'weight', align: 'center',title: '重量', hide: true}
    ,{field: 'zpallet', align: 'center',title: '托盘条码'}
    ,{field: 'zpallet', align: 'center',title: '托盘码'}
]
src/main/webapp/static/js/ioWorks/stockOut.js
@@ -2,13 +2,13 @@
var locDetlData = [];
function getCol() {
    var cols = [
        // {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        {field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'locNo$', align: 'center',title: '库位号'}
        {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '原数量'}
        ,{field: 'locNo', align: 'center',title: '库位号'}
    ];
    arrRemove(detlCols,  'field', 'anfme');
    cols.push.apply(cols, detlCols);
    // cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    return cols;
}
@@ -28,7 +28,7 @@
        cols: [getCol()],
        done: function(res, curr, count) {
            limit();
            getOutBound();
            // getOutBound();
        }
    });
@@ -45,11 +45,11 @@
                if (data.length === 0){
                    layer.msg('请先添加库位物料');
                } else {
                    var staNo = $("#staNoSelect").val();
                    if (staNo === "" || staNo === null){
                        layer.msg("请选择出库口");
                        return;
                    }
                    // var staNo = $("#staNoSelect").val();
                    // if (staNo === "" || staNo === null){
                    //     layer.msg("请选择出库口");
                    //     return;
                    // }
                    var locDetls = [];
                    data.forEach(function(elem) {
                        locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.count});
@@ -67,7 +67,10 @@
                        success: function (res) {
                            if (res.code === 200){
                                locDetlData = [];
                                tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}});
                                tableIns.reload({data: locDetlData,done:function (res) {
                                    limit();
                                    // getOutBound();
                                }});
                                layer.msg(res.msg);
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
@@ -91,7 +94,10 @@
                        locDetlData.splice(i, 1);
                    }
                }
                tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}});
                tableIns.reload({data: locDetlData,done:function (res) {
                    limit();
                    // getOutBound();
                }});
                break;
        }
    });
@@ -115,7 +121,10 @@
                layer.msg("数量必须大于零");
            }
        }
        tableIns.reload({data: locDetlData,done:function (res) {limit(); getOutBound();}});
        tableIns.reload({data: locDetlData,done:function (res) {
            limit();
            // getOutBound();
        }});
    }
    // 获取出库口
@@ -162,7 +171,7 @@
    for (var i=0;i<data.length;i++){
        let pass = false;
        for (var j=0;j<locDetlData.length;j++){
            if (data[i].matnr === locDetlData[j].matnr && data[i].locNo$ === locDetlData[j].locNo$) {
            if (data[i].matnr === locDetlData[j].matnr && data[i].locNo === locDetlData[j].locNo) {
                pass = true;
                break;
            }
src/main/webapp/views/ioWorks/locDetlQuery.html
@@ -46,33 +46,23 @@
    <div id="search-box" class="layui-form layui-card-header">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off">
                <input class="layui-input" type="text" name="loc_no" placeholder="货位" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="matnr" placeholder="物料号"  autocomplete="off">
                <input class="layui-input" type="text" name="matnr" placeholder="商品编号"  autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="maktx" placeholder="物料名称" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="type" placeholder="物料类别" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lgnum" placeholder="规格" autocomplete="off">
                <input class="layui-input" type="text" name="maktx" placeholder="商品名称" autocomplete="off">
            </div>
        </div>
        <!-- 日期范围 -->
        <div class="layui-inline" style="width: 300px">
            <div class="layui-input-inline">
                <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">
                <input class="layui-input layui-laydate-range" name="update_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">
            </div>
        </div>
        <!-- 待添加 -->
@@ -106,11 +96,11 @@
    function getCol() {
        var cols = [
            {type: 'checkbox'}
            ,{field: 'locNo$', align: 'center',title: '库位号'}
            ,{field: 'locNo', align: 'center',title: '货位'}
        ];
        cols.push.apply(cols, detlCols);
        cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true}
            ,{field: 'modiTime$', align: 'center',title: '修改时间'})
        cols.push({field: 'updateBy$', align: 'center',title: '修改人员', hide: true}
            ,{field: 'updateTime$', align: 'center',title: '修改时间'})
        return cols;
    }
@@ -124,7 +114,7 @@
        locDetlTableIns = table.render({
            elem: '#stockOut',
            headers: {token: localStorage.getItem('token')},
            url: baseUrl+'/stock/out/list/auth',
            url: baseUrl+'/locDetl/list/auth',
            page: true,
            limit: 10,
            even: true,
@@ -151,8 +141,8 @@
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                $('.layui-form-checkbox').css("pointer-events", "none");
                $('td[data-field="0').css("cursor", "pointer")
                // $('.layui-form-checkbox').css("pointer-events", "none");
                // $('td[data-field="0').css("cursor", "pointer")
            }
        });
@@ -211,19 +201,19 @@
        });
    })
    var b = true;
    $(function(){
        $(document.body).on('click','td[data-field="0"]',function(){
            var locNo = $(this).next().children("div").html();
            if (b) {
                b = false;
                $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click();
                setTimeout(function () {
                    b = true;
                }, 200)
            }
        });
    })
    // var b = true;
    // $(function(){
    //     $(document.body).on('click','td[data-field="0"]',function(){
    //         var locNo = $(this).next().children("div").html();
    //         if (b) {
    //             b = false;
    //             $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click();
    //             setTimeout(function () {
    //                 b = true;
    //             }, 200)
    //         }
    //     });
    // })
    function tableReload(child) {
        var searchData = {};
src/main/webapp/views/ioWorks/stockOut.html
@@ -45,7 +45,7 @@
        }
        #btn-outbound {
            margin-left: 60px;
            margin-left: 20px;
            display: none;
        }
@@ -94,10 +94,10 @@
        <div class="layui-form">
            <div class="layui-btn-container">
                <!-- 1.选择出库口 -->
                <span id="staNoSpan">出库口:</span>
                <select id="staNoSelect" lay-verify="required">
                    <option value="">请选择站点</option>
                </select>
<!--                <span id="staNoSpan">出库口:</span>-->
<!--                <select id="staNoSelect" lay-verify="required">-->
<!--                    <option value="">请选择站点</option>-->
<!--                </select>-->
                <!-- 2.启动出库 -->
                <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button>
            </div>
src/main/webapp/views/locDetl/locDetl.html
@@ -69,9 +69,9 @@
                    <!-- 表格工具栏2 -->
                    <div id="search-box" class="layui-form toolbar"  style="padding-top: 5px">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">货位编号:</label>
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">货位:</label>
                            <div class="layui-input-inline">
                                <input name="loc_no" class="layui-input" placeholder="输入货位编号"/>
                                <input name="loc_no" class="layui-input" placeholder="输入货位"/>
                            </div>
                        </div>
                        <div class="layui-inline">