自动化立体仓库 - WMS系统
#
zjj
2023-11-13 4d86df5389fb939e5a7a04af89afd8ca34b62fb5
#
2个文件已修改
33 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -899,6 +899,15 @@
            OrderDetl orderDetl = orderDetlService.selectOne(orderDetlWrapper);
            if (Cools.isEmpty(orderDetl)){
                return R.error("订单中未查询到下架数据");
            }
            EntityWrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<>();
            manLocDetlWrapper.eq("zpallet",jsonBarcode);
            manLocDetlWrapper.eq("matnr",jsonManLocDetl.getMatnr());
            ManLocDetl manLocDetl = manLocDetlService.selectOne(manLocDetlWrapper);
            if (Cools.isEmpty(manLocDetl)){
                return R.error("托盘码未查询到库存信息");
            }
            BigDecimal orderQty = new BigDecimal(orderDetl.getQty());
            BigDecimal orderWorkQty = new BigDecimal(orderDetl.getWorkQty());
@@ -911,15 +920,6 @@
            if (diffWorkQty.doubleValue() > orderDetl.getAnfme()){
                return R.error("工作数量大于订单数量");
            }
            orderDetl.setQty(diffQty.doubleValue());
            orderDetl.setWorkQty(diffWorkQty.doubleValue());
            if (!orderDetlService.updateById(orderDetl)){
                return R.error("订单明细更新失败");
            }
            EntityWrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<>();
            manLocDetlWrapper.eq("zpallet",jsonBarcode);
            manLocDetlWrapper.eq("matnr",jsonManLocDetl.getMatnr());
            ManLocDetl manLocDetl = manLocDetlService.selectOne(manLocDetlWrapper);
            BigDecimal locDetlAnfme = new BigDecimal(manLocDetl.getAnfme());
            BigDecimal diffAnfme = locDetlAnfme.subtract(anfme);
@@ -928,16 +928,18 @@
            }
            if (diffAnfme.doubleValue() == 0){
                if (!manLocDetlService.delete(manLocDetlWrapper)){
                    return R.error("删除库存明细失败");
                    throw new RuntimeException("删除库存明细失败");
                }
            } else if (diffAnfme.doubleValue() > 0) {
                manLocDetl.setAnfme(diffAnfme.doubleValue());
                if (!manLocDetlService.update(manLocDetl,manLocDetlWrapper)){
                    return R.error("更新库存明细失败");
                    throw new RuntimeException("更新库存明细失败");
                }
            }
            orderDetl.setQty(diffQty.doubleValue());
            orderDetl.setWorkQty(diffWorkQty.doubleValue());
            if (!orderDetlService.updateById(orderDetl)){
                return R.error("订单明细更新失败");
            }
            Order order = orderService.selectByNo(jsonOrderNo);
            if (IsOrderStatus(jsonOrderNo)){
@@ -949,7 +951,6 @@
                throw new RuntimeException("更新订单状态失败");
            }
        }
        return R.ok();
    }
src/main/resources/mapper/LocDetlMapper.xml
@@ -396,7 +396,7 @@
            and a.zpallet = #{zpallet}
        </if>
        <if test="matnr != null and matnr !='' and matnr !='null'">
            and a.matnr = #{matnr}
            and a.matnr like '%'+#{matnr}+'%'
        </if>
    </select>
    <select id="queryStockViewMergeCount" resultType="java.lang.Integer">