| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.GDYKConfirmGoodsParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.LocDto; |
| | | import com.zy.common.model.TaskDto; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 移动端接口控制器 |
| | |
| | | private PackService packService; |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | |
| | | |
| | | // 商品上架 |
| | |
| | | * 根据单号检索单据数据 |
| | | * http://localhost:8081/jkwms/mobile/order/serach/orderNo/auth?orderNo=123123 |
| | | */ |
| | | // @RequestMapping("/order/search/orderNo/auth") |
| | | // @ManagerAuth |
| | | // public R orderSearchByBarcode(@RequestParam String orderNo){ |
| | | // Order order = orderService.selectByNo(orderNo); |
| | | // if (order == null) { |
| | | // return R.ok(); |
| | | // } |
| | | // DocType docType = docTypeService.selectById(order.getDocType()); |
| | | // if (docType.getPakin() == null || docType.getPakin() != 1) { |
| | | // return R.ok(); |
| | | // } |
| | | // if (order.getSettle() > 2) { |
| | | // return R.ok(); |
| | | // } |
| | | // List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); |
| | | // if (Cools.isEmpty(orderDetls)) { |
| | | // return R.ok(); |
| | | // } |
| | | // return R.ok().add(orderDetls); |
| | | // } |
| | | @RequestMapping("/order/search/orderNo/auth") |
| | | @ManagerAuth |
| | | public R orderSearchByBarcode(@RequestParam String orderNo){ |
| | | Order order = orderService.selectByNo(orderNo); |
| | | if (order == null) { |
| | | if (Cools.isEmpty(orderNo)){ |
| | | orderNo=null; |
| | | } |
| | | List<Order> orders = orderService.selectorderNoL(orderNo); |
| | | if (Cools.isEmpty(orders)){ |
| | | return R.ok(); |
| | | } |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType.getPakin() == null || docType.getPakin() != 1) { |
| | | return R.ok(); |
| | | LinkedList<CombParam> combParams = new LinkedList<>(); |
| | | if (!Cools.isEmpty(orders)){ |
| | | for (Order order:orders){ |
| | | CombParam combParam=new CombParam(); |
| | | if (order == null) { |
| | | continue; |
| | | } |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType.getPakin() == null || docType.getPakin() != 1) { |
| | | continue; |
| | | } |
| | | if (order.getSettle() > 2) { |
| | | continue; |
| | | } |
| | | List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); |
| | | if (!Cools.isEmpty(orderDetls)) { |
| | | LinkedList<CombParam.CombMat> combMats = new LinkedList<>(); |
| | | for (OrderDetl orderDetl:orderDetls){ |
| | | CombParam.CombMat combMat = new CombParam.CombMat(); |
| | | combMat.setMatnr(orderDetl.getMatnr()); |
| | | combMat.setBatch(orderDetl.getBatch()); |
| | | combMat.setAnfme(orderDetl.getAnfme()-orderDetl.getWorkQty()); |
| | | combMat.setMaktx(orderDetl.getMaktx()); |
| | | combMat.setSpecs(orderDetl.getSpecs()); |
| | | combMats.add(combMat); |
| | | } |
| | | combParam.setCombMats(combMats); |
| | | } |
| | | combParam.setOrderNo(order.getOrderNo()); |
| | | combParams.add(combParam); |
| | | } |
| | | } |
| | | if (order.getSettle() > 2) { |
| | | return R.ok(); |
| | | } |
| | | List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(orderDetls); |
| | | return R.ok().add(combParams); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | |
| | | wrkDetls.removeIf(wrkDetl -> wrkDetl.getInspect() != null && wrkDetl.getInspect() != 0); |
| | | return R.ok().add(Cools.add("wrkNo", wrkMast.getWrkNo()).add("ioType", wrkMast.getIoType()).add("list", wrkDetls)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 出库确认 - 扫货物 广德宜科版 |
| | | * 1.全板 返回 101 |
| | | * 2.拣料 返回 103 |
| | | */ |
| | | @RequestMapping("/pakout/confirm/goods/auth") //待完善 原因(客户未给出详细信息) |
| | | @ManagerAuth |
| | | public R pakoutQueryByGoods(@RequestBody GDYKConfirmGoodsParam combParam){ |
| | | if (Cools.isEmpty(combParam)) { |
| | | return R.ok(); |
| | | } |
| | | // List<Order> orders = orderService.selectorderNoL(batch); |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("matnr", combParam.getMatnr()).eq("batch", combParam.getBatch()).eq("order_no",combParam.getOrderNo())); |
| | | if (Cools.isEmpty(orderDetl)){ |
| | | return R.error("未查到数据"); |
| | | } |
| | | if (!orderDetl.getQty$().equals("已完成")){ |
| | | return R.error("任务未完成"); |
| | | } |
| | | //复核数 |
| | | orderDetl.setSource(1); |
| | | orderDetlService.updateById(orderDetl); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.ok("出库成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据通知单查询明细 |
| | | */ |
| | | @RequestMapping("/bill/query1/auth") |
| | | @ManagerAuth(memo = "根据通知单查询明细") |
| | | public R billQuery1(@RequestParam String billNo, @RequestParam String size){ |
| | | List<WaitMatin> waitMatins = waitMatinService.selectList(new EntityWrapper<WaitMatin>().eq("bill_no", billNo).like("size", size).last("and qty > in_qty")); |
| | | // List<WaitMatin> waitMatins = waitMatinService.selectList(new EntityWrapper<WaitMatin>().eq("bill_no", billNo).last("and qty > in_qty")); |
| | | |
| | | //如果通知单单号为空,则查询调拨单号 |
| | | if(Cools.isEmpty(waitMatins) || waitMatins.size()<=0){ |
| | | waitMatins = waitMatinService.selectList(new EntityWrapper<WaitMatin>().eq("temp1", billNo).like("size", size).last("and qty > in_qty")); |
| | | } |
| | | |
| | | List<CombBillQueryVo> vos = new ArrayList<>(); |
| | | if (!Cools.isEmpty(waitMatins)) { |
| | | for (WaitMatin waitMatin : waitMatins) { |
| | | CombBillQueryVo vo = new CombBillQueryVo(); |
| | | vo.setMatNo(waitMatin.getMatNo()); |
| | | vo.setMatName(waitMatin.getMatName()); |
| | | vo.setCount(waitMatin.getQty()-waitMatin.getInQty()); |
| | | vo.setQty(waitMatin.getQty()-waitMatin.getInQty()); |
| | | vo.setBillNo(waitMatin.getBillNo()); |
| | | vo.setSeqNo(waitMatin.getSeqNo()); |
| | | vo.setUnit(waitMatin.getUnit()); |
| | | vo.setSpecs(waitMatin.getSpecs()); |
| | | vo.setSize(waitMatin.getSize()); |
| | | vo.setColor(waitMatin.getColor()); |
| | | vo.setItemBatch(waitMatin.getItemBatch()); |
| | | vo.setOveFlag(waitMatin.getOveFlag()); |
| | | vos.add(vo); |
| | | } |
| | | } |
| | | return R.ok().add(vos); |
| | | } |
| | | } |