|  |  | 
 |  |  | import com.zy.asrs.service.*; | 
 |  |  | import com.zy.common.model.DetlDto; | 
 |  |  | import com.zy.common.web.BaseController; | 
 |  |  | import io.swagger.models.auth.In; | 
 |  |  | import org.springframework.beans.BeanUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import javax.print.Doc; | 
 |  |  | import java.util.*; | 
 |  |  |  | 
 |  |  | @RestController | 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private WrkMastLogService wrkMastLogService; | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/order/search/pda/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R pdaOrderSearch(@RequestParam(required = false)String condition){ | 
 |  |  |         EntityWrapper<Order> wrapper = new EntityWrapper<>(); | 
 |  |  |         if (!Cools.isEmpty(condition)) { | 
 |  |  | //            wrapper.like("matnr", condition).or().like("maktx", condition); | 
 |  |  |             wrapper.like("order_no", condition); | 
 |  |  |         } | 
 |  |  |         wrapper.orderBy("create_time", false); | 
 |  |  |         List<Order> mats = orderService.selectList(wrapper); | 
 |  |  |         return R.ok().add(mats); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/order/list/pda/page/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R pdaPageList(@RequestParam(required = true)Long tagId, | 
 |  |  |                          @RequestParam(defaultValue = "1")Integer curr, | 
 |  |  |                          @RequestParam(defaultValue = "10")Integer limit){ | 
 |  |  |         List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakin", 1)); | 
 |  |  |         ArrayList<Integer> arrayList = new ArrayList<>(); | 
 |  |  |         docTypes.forEach(docType -> { | 
 |  |  |             arrayList.add(docType.getDocId().intValue()); | 
 |  |  |         }); | 
 |  |  |         EntityWrapper<Order> wrapper = new EntityWrapper<>(); | 
 |  |  | //        wrapper.eq("tag_id", tagId); | 
 |  |  |         wrapper.in("doc_type", arrayList); | 
 |  |  |         wrapper.in("settle",1,2); | 
 |  |  |         wrapper.orderBy("create_time", false); | 
 |  |  |         return R.ok().add(orderService.selectPage(new Page<>(curr, limit), wrapper)); | 
 |  |  |         Page<Order> orderPage = orderService.selectPage(new Page<>(curr, limit), wrapper); | 
 |  |  |         return R.ok().add(orderPage); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/order/list/pda/page/out/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R pdaPageListOut(@RequestParam(required = true)Long tagId, | 
 |  |  |                          @RequestParam(defaultValue = "1")Integer curr, | 
 |  |  |                          @RequestParam(defaultValue = "10")Integer limit){ | 
 |  |  |         List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1)); | 
 |  |  |         ArrayList<Integer> arrayList = new ArrayList<>(); | 
 |  |  |         docTypes.forEach(docType -> { | 
 |  |  |             arrayList.add(docType.getDocId().intValue()); | 
 |  |  |         }); | 
 |  |  |         EntityWrapper<Order> wrapper = new EntityWrapper<>(); | 
 |  |  | //        wrapper.eq("tag_id", tagId); | 
 |  |  |         wrapper.in("doc_type", arrayList); | 
 |  |  |         wrapper.in("settle",1,2); | 
 |  |  |         wrapper.orderBy("create_time", false); | 
 |  |  |         Page<Order> orderPage = orderService.selectPage(new Page<>(curr, limit), wrapper); | 
 |  |  |         return R.ok().add(orderPage); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/order/nav/list/auth") | 
 |  |  | 
 |  |  |             endQty = endQty + orderDetl.getQty(); | 
 |  |  |             double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).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(), orderDetl.getOrigin(), null,null,null,null); | 
 |  |  |                 for (LocDetl locDetl : locDetls) { | 
 |  |  |                     if (issued > 0) { | 
 |  |  |                         issued = issued - locDetl.getAnfme(); |