自动化立体仓库 - WMS系统
1.获取erp订单数据时过滤掉状态》5
2.同步erp删除数据时,只删除指定的订单明细
3.订单出库按批号排序
10个文件已修改
134 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MobileController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OpenController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/third/mapper/ExdInstockSourceMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/third/mapper/ExdOutstockSourceMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/third/task/OrderScheduler.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/third/task/handler/OrderHandler.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/asrs/LocDetlMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/third/ExdInstockSourceMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/third/ExdOutstockSourceMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/wrkMast/wrkMast.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -203,7 +203,7 @@
        if (wrkMast != null) {
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            // 去除已出库确认的明细
            wrkDetls.removeIf(wrkDetl -> wrkDetl.getInspect() != null && wrkDetl.getInspect() != 0);
//            wrkDetls.removeIf(wrkDetl -> wrkDetl.getInspect() != null && wrkDetl.getInspect() != 0);
            return R.ok().add(Cools.add("wrkNo", wrkMast.getWrkNo()).add("ioType", wrkMast.getIoType()).add("list", wrkDetls));
        }
        return R.ok();
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -108,7 +108,7 @@
                    .in("wrk_sts", 31L)//31.AGV出库任务下发成功
                    .eq("Pdc_type", robotTaskMessage.getRobotTaskCode()));//AGV出库搬运任务号
            if(!Cools.isEmpty(wrkMast)){
                wrkMast.setWrkSts(32L);//31.AGV出库任务下发成功---->32.AGV已搬离 32后移交给wcs系统,对站点信息进行清除
                wrkMast.setWrkSts(33L);//31.AGV出库任务下发成功---->32.AGV已搬离 32后移交给wcs系统,对站点信息进行清除
                wrkMast.setModiTime(new Date());
                wrkMastService.updateById(wrkMast);
            }
src/main/java/com/zy/third/mapper/ExdInstockSourceMapper.java
@@ -17,7 +17,7 @@
    List<String> listOrderNo();
    List<String> deletelistOrderNo();
    List<ExdInstockSource> deletelistOrderNo();
    List<ExdInstockSource> listAll(@Param("orderNo") String orderNo);
}
src/main/java/com/zy/third/mapper/ExdOutstockSourceMapper.java
@@ -17,7 +17,7 @@
    List<String> listOrderNo();
    List<String> deletelistOrderNo();
    List<ExdOutstockSource> deletelistOrderNo();
    List<ExdOutstockSource> listAll(@Param("orderNo") String orderNo);
}
src/main/java/com/zy/third/task/OrderScheduler.java
@@ -89,12 +89,10 @@
    @Scheduled(cron = "0/10 * * * * ? ")
    public void deleteInOrder() {
        //log.info("读取入库单据");
        List<String> orderNos = exdInstockSourceMapper.deletelistOrderNo();
        for (String orderNo : orderNos) {
            List<ExdInstockSource> exdInstockSources = exdInstockSourceMapper.listAll(orderNo);
        List<ExdInstockSource> exdInstockSources = exdInstockSourceMapper.deletelistOrderNo();
        for (ExdInstockSource exdInstockSource : exdInstockSources) {
            try {
                boolean success = orderHandler.deletereadInOrder(exdInstockSources).isSuccess();
                for (ExdInstockSource exdInstockSource : exdInstockSources) {
                boolean success = orderHandler.deletereadInOrder(exdInstockSource).isSuccess();
                    if (success) {
                        exdInstockSource.setReadtime(new Date());
                        exdInstockSource.setStatus(8);
@@ -104,17 +102,18 @@
                        exdInstockSource.setStatus(7);
                        exdInstockSourceMapper.updateById(exdInstockSource);
                    }
                }
            } catch (Exception e) {
//                log.error("读取入库单据信息失败:{},{}", exdInstockSources, e.getMessage());
                e.printStackTrace();
                for (ExdInstockSource exdInstockSource : exdInstockSources) {
                    exdInstockSource.setReadormsg(e.getMessage());
                    exdInstockSource.setStatus(7);
                    exdInstockSourceMapper.updateById(exdInstockSource);
                }
                exdInstockSource.setReadormsg(e.getMessage());
                exdInstockSource.setStatus(7);
                exdInstockSourceMapper.updateById(exdInstockSource);
            }
        }
    }
    /**
@@ -157,32 +156,28 @@
    @Scheduled(cron = "0/10 * * * * ? ")
    public void deletereadOutOrder() {
        //log.info("读取出库单据");
        List<String> orderNos = exdOutstockSourceMapper.deletelistOrderNo();
        for (String orderNo : orderNos) {
            List<ExdOutstockSource> exdOutstockSources = exdOutstockSourceMapper.listAll(orderNo);
        List<ExdOutstockSource> exdOutstockSources = exdOutstockSourceMapper.deletelistOrderNo();
        for (ExdOutstockSource exdOutstockSource : exdOutstockSources) {
            try {
                boolean success = orderHandler.deletereadOutOrder(exdOutstockSources).isSuccess();
                for (ExdOutstockSource exdOutstockSource : exdOutstockSources) {
                    if (success) {
                        exdOutstockSource.setReadtime(new Date());
                        exdOutstockSource.setStatus(8);
                        exdOutstockSourceMapper.updateById(exdOutstockSource);
                    } else {
                        exdOutstockSource.setReadtime(new Date());
                        exdOutstockSource.setStatus(7);
                        exdOutstockSourceMapper.updateById(exdOutstockSource);
                    }
                boolean success = orderHandler.deletereadOutOrder(exdOutstockSource).isSuccess();
                if (success) {
                    exdOutstockSource.setReadtime(new Date());
                    exdOutstockSource.setStatus(8);
                    exdOutstockSourceMapper.updateById(exdOutstockSource);
                } else {
                    exdOutstockSource.setReadtime(new Date());
                    exdOutstockSource.setStatus(7);
                    exdOutstockSourceMapper.updateById(exdOutstockSource);
                }
            } catch (Exception e) {
//                log.error("读取出库单据信息失败:{},{}", exdOutstockSources, e.getMessage());
                e.printStackTrace();
                for (ExdOutstockSource exdOutstockSource : exdOutstockSources) {
                    exdOutstockSource.setStatus(7);
                    exdOutstockSource.setReadormsg(e.getMessage());
                    exdOutstockSourceMapper.updateById(exdOutstockSource);
                }
                exdOutstockSource.setStatus(7);
                exdOutstockSource.setReadormsg(e.getMessage());
                exdOutstockSourceMapper.updateById(exdOutstockSource);
            }
        }
    }
    /**
@@ -197,7 +192,7 @@
                List<OrderDetl1> orderNo = orderDetl1Service.selectList(new EntityWrapper<OrderDetl1>().eq("order_no", exdOutstockTarget.getFbillno()));
                if (!Cools.isEmpty(orderNo)) {
                    for (OrderDetl1 orderDetl1 : orderNo) {
                        if (!Cools.isEmpty(orderDetl1.getMemo())&&orderDetl1.getMemo().equals(exdOutstockTarget.getReadormsg())) {
                        if (!Cools.isEmpty(orderDetl1.getMemo()) && orderDetl1.getMemo().equals(exdOutstockTarget.getReadormsg())) {
                            break;
                        }
                        orderDetl1.setMemo(exdOutstockTarget.getReadormsg());
src/main/java/com/zy/third/task/handler/OrderHandler.java
@@ -211,18 +211,35 @@
    }
    @Transactional
    public ReturnT<String> deletereadInOrder(List<ExdInstockSource> exdInstockSource) {
        String fbillno = exdInstockSource.get(0).getFbillno();
    public ReturnT<String> deletereadInOrder(ExdInstockSource exdInstockSource) {
        String fbillno = exdInstockSource.getFbillno();
        Order order = orderService.selectByNo(fbillno);
        if (!Cools.isEmpty(order)&&order.getStatus()>1) {
        if (!Cools.isEmpty(order)) {
            if (order.getSettle() > 1L) {
                throw new CoolException(fbillno + "单据正在作业中,无法删除");
            }
            orderService.remove(order.getId());
            Mat mat = matService.selectBySku(exdInstockSource.getFitemid() + "");
            boolean delete = orderDetlService.delete(new EntityWrapper<OrderDetl>()
                    .eq("order_no", order.getOrderNo())
                    .eq("matnr", mat.getMatnr())
                    .eq("batch", exdInstockSource.getFbatchno())
                    .eq("anfme", exdInstockSource.getFqty()));
            if (delete) {
                log.info("删除订单明细成功,订单号={},物料号={},批号={},数量={}成功",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty());
            }else {
                log.error("删除订单明细失败,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty());
                throw new CoolException(fbillno + "单据明细删除失败");
            }
            int orderNo = orderDetlService.selectCount(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo()));
            if(orderNo==0){
                orderService.remove(order.getId());
                log.info("删除订单主表成功,订单={}",order.getOrderNo());
            }
        }else if(Cools.isEmpty(order)){
            throw new CoolException(fbillno + "单据为在WMS中找到");
        }
        return SUCCESS;
    }
    @Transactional
    public ReturnT<String> readOutOrder(List<ExdOutstockSource> exdOutstockSource) {
@@ -328,14 +345,34 @@
    }
    @Transactional
    public ReturnT<String> deletereadOutOrder(List<ExdOutstockSource> exdInstockSource) {
        String fbillno = exdInstockSource.get(0).getFbillno();
    public ReturnT<String> deletereadOutOrder(ExdOutstockSource exdInstockSource) {
        String fbillno = exdInstockSource.getFbillno();
        Order order = orderService.selectByNo(fbillno);
        if (!Cools.isEmpty(order)&&order.getStatus()>1) {
        if (!Cools.isEmpty(order)) {
            if (order.getSettle() > 1L) {
                throw new CoolException(fbillno + "单据正在作业中,无法删除");
            }
            orderService.remove(order.getId());
            Mat mat = matService.selectBySku(exdInstockSource.getFitemid() + "");
            boolean delete = orderDetlService.delete(new EntityWrapper<OrderDetl>()
                    .eq("order_no", order.getOrderNo())
                    .eq("matnr", mat.getMatnr())
                    .eq("batch", exdInstockSource.getFbatchno())
                    .eq("anfme", exdInstockSource.getFqty()));
            if (delete) {
                log.info("删除订单明细成功,订单号={},物料号={},批号={},数量={}成功",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty());
            }else {
                log.error("删除订单明细失败,订单号={},物料号={},批号={},数量={}",order.getOrderNo(),exdInstockSource.getFitemid(),exdInstockSource.getFbatchno(),exdInstockSource.getFqty());
                throw new CoolException(fbillno + "单据明细删除失败");
            }
            int orderNo = orderDetlService.selectCount(new EntityWrapper<OrderDetl>().eq("order_no", order.getOrderNo()));
            if(orderNo==0){
                orderService.remove(order.getId());
                log.info("删除订单主表成功,订单={}",order.getOrderNo());
            }
        }else if (Cools.isEmpty(order)) {
            throw new CoolException(fbillno + "单据未在WMS中找到");
        }
        return SUCCESS;
    }
src/main/resources/mapper/asrs/LocDetlMapper.xml
@@ -129,6 +129,7 @@
        and b.loc_sts = 'F'
        <include refid="stockOutCondition"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
        order by t.batch
    </select>
    <select id="getStockOutPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
src/main/resources/mapper/third/ExdInstockSourceMapper.xml
@@ -55,15 +55,15 @@
        where status in(0,4)
    </select>
    <select id="deletelistOrderNo" resultType="java.lang.String">
        select distinct fbillno
    <select id="deletelistOrderNo" resultType="com.zy.third.entity.ExdInstockSource">
        select *
        from Exd_Instock_Source
        where status = 5
    </select>
    <select id="listAll" resultType="com.zy.third.entity.ExdInstockSource">
            select  * from Exd_Instock_Source where fbillno = #{orderNo}
            select  * from Exd_Instock_Source where fbillno = #{orderNo} and Status in(0,1,2,3,4)
    </select>
src/main/resources/mapper/third/ExdOutstockSourceMapper.xml
@@ -58,15 +58,15 @@
            where status in (0,4)
    </select>
    <select id="deletelistOrderNo" resultType="java.lang.String">
        select distinct fbillno
    <select id="deletelistOrderNo" resultType="com.zy.third.entity.ExdOutstockSource">
        select *
        from Exd_Outstock_Source
        where status  = 5
    </select>
    <select id="listAll" resultType="com.zy.third.entity.ExdOutstockSource">
            select * from Exd_Outstock_Source where fbillno = #{orderNo}
            select * from Exd_Outstock_Source where fbillno = #{orderNo} and Status in(0,1,2,3,4)
    </select>
src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -34,6 +34,7 @@
            ,{field: 'barcode', align: 'center',title: '条码'}
            ,{field: 'preHave', align: 'center',title: '先入品', hide: true}
            ,{field: 'takeNone', align: 'center',title: '空操作', hide: true}
            ,{field: 'memo', align: 'center',title: 'agv搬运目标位', hide: false}
            // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){
            //         var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.picking === 'Y'){html += " checked ";}