|  |  | 
 |  |  |             throw new CoolException("操作失败,当前仓库找不到空库位"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Date now = new Date(); | 
 |  |  |         // 修改工作档 | 
 |  |  |         StaDesc staDesc = staDescService.queryCrnStn(targetLoc.getCrnNo()); | 
 |  |  |         if (Cools.isEmpty(staDesc)) { | 
 |  |  | 
 |  |  |         wrkMast.setWrkSts(2L); | 
 |  |  |         wrkMast.setLocNo(targetLoc.getLocNo()); | 
 |  |  |         wrkMast.setStaNo(staDesc.getCrnStn()); | 
 |  |  |         wrkMast.setModiTime(now); | 
 |  |  |         wrkMast.setModiUser(userId); | 
 |  |  |         if (!wrkMastService.updateById(wrkMast)) { | 
 |  |  |             throw new CoolException("修改工作档失败"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 修改库位状态 O ===>>> S | 
 |  |  |         if (targetLoc.getLocSts().equals("O")){ | 
 |  |  |             targetLoc.setLocSts("S"); // S.入库预约 | 
 |  |  |             targetLoc.setModiUser(userId); | 
 |  |  |             targetLoc.setModiTime(now); | 
 |  |  |             if (!locMastService.updateById(targetLoc)){ | 
 |  |  |                 throw new CoolException("改变库位状态失败"); | 
 |  |  |             } | 
 |  |  |         } else { | 
 |  |  |             throw new CoolException(targetLoc.getLocNo()+"目标库位已被占用"); | 
 |  |  |         } | 
 |  |  |         // 禁用异常库位 | 
 |  |  | //        locMast.setLocSts("X"); // X.禁用 | 
 |  |  | //        locMast.setModiUser(userId); | 
 |  |  | //        locMast.setModiTime(now); | 
 |  |  | //        if (!locMastService.updateById(locMast)){ | 
 |  |  | //            throw new CoolException("改变库位状态失败"); | 
 |  |  | //        } | 
 |  |  |         return targetLoc.getLocNo(); | 
 |  |  |     } | 
 |  |  |  |