自动化立体仓库 - WMS系统
zjj
2023-09-12 3e29b0363ad4571183fc856fdbb893dcfe74a022
#预警
11个文件已修改
136 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocDetlController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/result/LocDetlAll.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocDetlMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocDetlService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetlNumWarning/locDetlNumWarning.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/manLocDetl/manLocDetl.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/nodeLoc/nodeLoc.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locDetlNumWarning/locDetlNumWarning.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -43,8 +43,32 @@
    @Autowired
    private ManLocDetlService manLocDetlService;
    @RequestMapping(value = "/locDetl/selectAllNumWarning/auth")
    @ManagerAuth(memo = "库存数量预警")
    public R selectAllNumWarning(@RequestParam(defaultValue = "1")Integer curr,
                    @RequestParam(defaultValue = "10")Integer limit,
                    @RequestParam Map<String, Object> param) {
//        Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class));
//        for (LocDetl locDetl : stockStatis.getRecords()) {
//            Mat mat = matService.selectByMatnr(locDetl.getMatnr());
//            if (mat != null) {
//                locDetl.sync(mat);
//            }
//        }
//        return R.ok().add(stockStatis);
        Page<LocDetlAll> stockStatis = locDetlService.getWarningNumPage(toPage(curr, limit, param, LocDetlAll.class));
        for (LocDetlAll locDetlAll : stockStatis.getRecords()) {
            Mat mat = matService.selectByMatnr(locDetlAll.getMatnr());
            if (mat != null) {
                locDetlAll.sync(mat);
            }
        }
        return R.ok().add(stockStatis);
    }
    @RequestMapping(value = "/locDetl/selectAllWarning/auth")
    @ManagerAuth(memo = "库存预警")
    @ManagerAuth(memo = "库龄预警")
    public Map<String,Object> queryViewStayTimeListByPages(@RequestParam(defaultValue = "1")Integer curr,
                                                           @RequestParam(defaultValue = "10")Integer limit,
                                                           @RequestParam Map<String, Object> param){
src/main/java/com/zy/asrs/entity/result/LocDetlAll.java
@@ -29,6 +29,8 @@
    private Date appe_time;
    private String meno;
    private String manu;
    private Integer inventory_max;
    private Integer inventory_min;
    public String getOwner$(){
        LocOwnerService service = SpringUtils.getBean(LocOwnerService.class);
src/main/java/com/zy/asrs/mapper/LocDetlMapper.java
@@ -52,6 +52,10 @@
    Integer getStockStatisCountAll(Map<String, Object> map);
    List<LocDetlAll> getWarningNumList(Map<String, Object> map);
    Integer getWarningNumListCount(Map<String, Object> map);
    List<LocDetl> getStockStatisExcel();
    @Select("select sum(a.anfme) as sum from asr_loc_detl a left join asr_loc_mast b on a.loc_no = b.loc_no where b.loc_sts = 'F' and a.matnr = #{matnr}")
src/main/java/com/zy/asrs/service/LocDetlService.java
@@ -39,6 +39,8 @@
    Page<LocDetl> getStockStatis(Page<LocDetl> page);
    Page<LocDetlAll> getStockStatisAll(Page<LocDetlAll> page);
    Page<LocDetlAll> getWarningNumPage(Page<LocDetlAll> page);
    Double sumAll();
    Double getSumAnfme(String matnr);
src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java
@@ -77,6 +77,13 @@
    }
    @Override
    public Page<LocDetlAll> getWarningNumPage(Page<LocDetlAll> page) {
        page.setRecords(baseMapper.getWarningNumList(page.getCondition()));
        page.setTotal(baseMapper.getWarningNumListCount(page.getCondition()));
        return page;
    }
    @Override
    public Double sumAll() {
        return this.baseMapper.sumAll();
    }
src/main/resources/mapper/LocDetlMapper.xml
@@ -592,6 +592,74 @@
        ) b
    </select>
<!--    数量预警-->
    <select id="getWarningNumList" resultType="com.zy.asrs.entity.result.LocDetlAll">
        select * from
        (
        select
        ROW_NUMBER() over (order by sum(a.anfme) desc) as row
        , a.matnr
        , sum(a.anfme) as anfme
        from asr_loc_detl_all a
        where 1=1
        <include refid="stockOutCondition"></include>
        group by a.matnr
        ) t
        LEFT JOIN man_mat m ON t.matnr = m.matnr
        WHERE t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
        and t.anfme > m.inventory_max or t.anfme &lt; m.inventory_min
<!--        select * from-->
<!--        (-->
<!--        select-->
<!--        ROW_NUMBER() over (order by sum(a.anfme) desc) as row-->
<!--        , a.matnr-->
<!--        , sum(a.anfme) as anfme-->
<!--        ,m.inventory_max-->
<!--        ,m.inventory_min-->
<!--        from asr_loc_detl_all a-->
<!--        LEFT JOIN man_mat m on a.matnr = m.matnr-->
<!--        where 1=1-->
<!--        <include refid="stockOutCondition"></include>-->
<!--        group by a.matnr,m.inventory_max,m.inventory_min-->
<!--        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})-->
<!--        and t.anfme>t.inventory_max or t.anfme &lt; t.inventory_min-->
    </select>
    <select id="getWarningNumListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
<!--        select count(1) from-->
<!--        (-->
<!--        select-->
<!--        ROW_NUMBER() over (order by sum(a.anfme) desc) as row-->
<!--        , a.matnr-->
<!--        , sum(a.anfme) as anfme-->
<!--        ,m.inventory_max-->
<!--        ,m.inventory_min-->
<!--        from asr_loc_detl_all a-->
<!--        LEFT JOIN man_mat m on a.matnr = m.matnr-->
<!--        where 1=1-->
<!--        <include refid="stockOutCondition"></include>-->
<!--        group by a.matnr,m.inventory_max,m.inventory_min-->
<!--        ) t-->
        select count(1) from
        (
        select
        ROW_NUMBER() over (order by sum(a.anfme) desc) as row
        , a.matnr
        , sum(a.anfme) as anfme
        from asr_loc_detl_all a
        where 1=1
        <include refid="stockOutCondition"></include>
        group by a.matnr
        ) t
        LEFT JOIN man_mat m ON t.matnr = m.matnr
    </select>
    <select id="sumAll" resultType="java.lang.Double">
        SELECT SUM(anfme) FROM asr_loc_detl_all
    </select>
src/main/webapp/static/js/locDetlNumWarning/locDetlNumWarning.js
@@ -1,7 +1,9 @@
var pageCurr;
function getCol() {
    var cols = [
        {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'}
        {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'},
        {field: 'inventory_max', align: 'center',title: '库存上限', style: 'font-weight: bold'},
        {field: 'inventory_min', align: 'center',title: '库存下限', style: 'font-weight: bold'}
    ];
    arrRemove(detlCols, "field", "anfme")
    arrRemove(detlCols, "field", "zpallet")
@@ -22,7 +24,7 @@
    tableIns = table.render({
        elem: '#locDetlStatis',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locDetl/statis/auth',
        url: baseUrl+'/locDetl/selectAllNumWarning/auth',
        page: true,
        limit: 20,
        limits: [20, 30, 50, 100, 200, 500],
src/main/webapp/static/js/manLocDetl/manLocDetl.js
@@ -6,9 +6,9 @@
        ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
        ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true}
        ,{field: 'specs', align: 'center',title: '规格'}
        ,{field: 'weight', align: 'center',title: '库位总重量', hide: false}
        ,{field: 'weight', align: 'center',title: '库位总重量', hide: true}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true, hide: true}
        ,{field: 'batch', align: 'center',title: '批号', sort:true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'zpallet', align: 'center',title: '托盘条码'}
        ,{field: 'model', align: 'center',title: '代码', hide: true}
@@ -41,7 +41,7 @@
    // cols.push.apply(cols, detlCols);
    cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true}
        ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'}
        // ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'}
        ,{field: 'modiTime$', align: 'center',title: '修改时间'}
    )
    return cols;
src/main/webapp/static/js/nodeLoc/nodeLoc.js
@@ -63,7 +63,7 @@
            {field: 'parentName', align: 'center',title: '库区', hide: false},
            {field: 'createBy$', align: 'center',title: '创建人', hide: false},
            {field: 'createTime$', align: 'center',title: '创建时间', hide: false},
            {field: 'status', align: 'center',title: '库位冻结', templet: '#stockFreezeTpl'},
            // {field: 'status', align: 'center',title: '库位冻结', templet: '#stockFreezeTpl'},
            {field: 'type$', align: 'center',title: '类型', templet: '#tagTpl', hide: false}
        ]],
        request: {
src/main/webapp/static/js/order/order.js
@@ -193,7 +193,7 @@
                            {field: 'matnr', title: '商品编码', width: 160},
                            {field: 'maktx', title: '商品名称', width: 160},
                            // {field: 'batch', title: '批号'},
                            {field: 'batch', title: '批号'},
                            {field: 'anfme', title: '数量'},
                            {field: 'workQty', title: '作业数量'},
                            {field: 'qty', title: '完成数量', style: 'font-weight: bold'},
@@ -206,7 +206,6 @@
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            // {field: 'specs', title: '规格'},
                             {field: 'weight', title: '重量'}
                        ]],
                        request: {
                            pageName: 'curr',
@@ -262,7 +261,11 @@
                    console.log(nList);
                    for (let xi = 0; xi < nList.length; xi++) {
                        if (nList[xi].anfme <= 0){
                            layer.msg('明细修改数量不合法', {icon: 2});
                            layer.msg('明细数量不合法', {icon: 2});
                            return false;
                        }
                        if (nList[xi].batch == null || nList[xi].batch == ""){
                            layer.msg('批次不合法', {icon: 2});
                            return false;
                        }
                        if (nList[xi].anfme < nList[xi].workQty){
@@ -312,7 +315,7 @@
                        {field: 'matnr', title: '商品编码', width: 160},
                        {field: 'maktx', title: '商品名称', width: 200},
                        {field: 'specs', title: '规格'},
                        {field: 'weight', title: '重量', edit: true},
                        {field: 'batch', title: '批次', edit: true},
                        {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                        // {field: 'payment', title: '货物状态',align: 'center', templet: '#payment'},
src/main/webapp/views/locDetlNumWarning/locDetlNumWarning.html
@@ -52,7 +52,7 @@
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/locDetlStatis/locDetlStatis.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/locDetlNumWarning/locDetlNumWarning.js" charset="utf-8"></script>
</body>
</html>