#
18516761980
2022-08-02 bd80bef8c6ea2763993ff3ef065ee474b11222a4
src/main/java/com/zy/asrs/service/impl/OutStockServiceImpl.java
@@ -112,9 +112,12 @@
                }
            }
            if (complete) {
                if (!completeCPakOut(FBillNo)) {
                    log.error("{}出库单标记完成失败", FBillNo);
                }
                List<OutStockBillEntry> select1 = this.selectList(new EntityWrapper<OutStockBillEntry>().eq("FInterID", FInterID));
               if(select1.size()<=1){
                    if (!completeCPakOut(FBillNo) )  {
                        log.error("{}出库单标记完成失败", FBillNo);
                    }
               }
            }
            return true;
        } else {
@@ -134,7 +137,8 @@
    public void startupFullTakeStore(StockOutParam param, Long userId) {
        //判断出库熟练是否大于库存数量
        for (StockOutParam.LocDetl detl : param.getLocDetls()) {
            LocDetl locDetl = locDetlService.selectById(detl.getLocNo());
//            LocDetl locDetl = locDetlService.selectById(detl.getLocNo());
            LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",detl.getLocNo()));
            if(locDetl != null){
                if(detl.getCount() > locDetl.getAnfme()){
                    throw new CoolException("出库数量超过了库存数量[locNo=" + detl.getLocNo() + "]");
@@ -200,9 +204,9 @@
        // 生成工作档
        for (OutLocDto dto : dtos) {
            // 判断入出库类型:101.全板出库 or 103.拣料出库
            if (ioType == null) {
//            if (ioType == null) {
                ioType = dto.isAll() ? 101 : 103;
            }
//            }
            // 获取库位
            LocMast locMast = locMastService.selectById(dto.getLocNo());
            // 获取路径
@@ -271,7 +275,8 @@
                Integer FInterI = outStockService.queryOutStockFInterID(fbillNo); // 获取出库单主表主键
                Wrapper wrapper1 = new EntityWrapper<OutStockBillEntry>().eq("FInterID",FInterI).eq("Fnumber",detlDto.getLocDetl().getMatnr());
                OutStockBillEntry outStockBillEntry = outStockService.selectOne(wrapper1);
                outStockBillEntry.setFAmount(outStockBillEntry.getFAmount().add(BigDecimal.valueOf(anfme)));  //借用amount字段,控制下发出库任务数量
                outStockBillEntry.setFAmount(outStockBillEntry.getFAmount().add(BigDecimal.valueOf(anfme)));  //借用famount字段,控制下发出库任务数量
                outStockBillEntry.setFAuxQty(outStockBillEntry.getFAuxQty().subtract(BigDecimal.valueOf(anfme)));
                if(!outStockService.update(outStockBillEntry,wrapper1)){
                    throw new CoolException("更新出库通知档明细FAmount失败[FInterID="+FInterI+",Fnumber="+detlDto.getLocDetl().getMatnr()+"]");
                }