|  |  | 
 |  |  |             return R.error(); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (!locMast.getLocSts().equals("F") && !Cools.isEmpty(locMast.getFrozen()) && locMast.getFrozen() == 1) { | 
 |  |  |             return R.error("库存在库状态才能冻结"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() | 
 |  |  |                 .eq("source_loc_no", locMast.getLocNo()) | 
 |  |  |                 .or().eq("loc_no", locMast.getLocNo())); | 
 |  |  | 
 |  |  |                 if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()))) { | 
 |  |  |                     throw new CoolException("服务器错误,请联系管理员"); | 
 |  |  |                 } | 
 |  |  |                 locMast.setBarcode(""); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         locMast.setModiUser(getUserId()); | 
 |  |  |         locMast.setModiTime(now); | 
 |  |  |         AdjDetl adjDetl = new AdjDetl(); | 
 |  |  |         adjDetl.setLocNo(locMast.getLocNo()); | 
 |  |  |         adjDetl.setMatnr("原库位状态:" + oldLocMast.getLocSts()); | 
 |  |  |         adjDetl.setBatch("更改库位状态为:" + locMast.getLocSts()); | 
 |  |  |         adjDetl.setModiTime(now); | 
 |  |  |         adjDetl.setModiUser(getUserId()); | 
 |  |  |         if (!adjDetlService.insert(adjDetl)) { | 
 |  |  |             throw new CoolException("库位调整记录失败"); | 
 |  |  |         } | 
 |  |  |         if(!locMastService.updateById(locMast)) { | 
 |  |  |             throw new CoolException("服务器错误,请联系管理员"); | 
 |  |  |         } |