|  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(param.get("doc_type"))) { | 
|---|
|  |  |  | wrapper.eq(Order::getDocType, param.get("doc_type")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(param.get("docName"))) { | 
|---|
|  |  |  | DocType docType = docTypeService.getOne(new LambdaQueryWrapper<DocType>().eq(DocType::getDocName, param.get("docName"))); | 
|---|
|  |  |  | wrapper.eq(Order::getDocType, docType.getDocId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(param.get("settle"))) { | 
|---|
|  |  |  | wrapper.eq(Order::getSettle, param.get("settle")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | wrkQty = wrkQty + orderDetl.getQty(); | 
|---|
|  |  |  | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); | 
|---|
|  |  |  | if (issued > 0.0) { | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrigin(), null); | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), hostId); | 
|---|
|  |  |  | for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | issued = issued - locDetl.getAnfme(); | 
|---|