| | |
| | | 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 |
| | |
| | | private WrkMastService wrkMastService; |
| | | @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); |
| | | 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") |
| | | @ManagerAuth |
| | |
| | | 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(); |
| | |
| | | .add("list", wrkTraceVos) |
| | | .add("orderNo", order.getOrderNo()) |
| | | .add("totalQty", totalQty) |
| | | .add("wrkQty", wrkQty) |
| | | .add("wrkQty", wrkQty+endQty) |
| | | .add("lackQty", lackQty) |
| | | .add("endQty",endQty) |
| | | ); |