| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.nc.entity.NccJcQilibcBarcodeflowWms; |
| | | import com.zy.nc.service.NccJcQilibcBarcodeflowWmsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("mobile") |
| | | public class MobileController extends BaseController { |
| | | public class MobileController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MobileService mobileService; |
| | |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private NccJcQilibcBarcodeflowWmsService nccJcQilibcBarcodeflowWmsService; |
| | | @Autowired |
| | | private OrderPakinService orderPakinService; |
| | | |
| | | @Resource |
| | | private StaDescService staDescService; |
| | | |
| | |
| | | @RequestMapping("/pda/WarehouseOutPickMerge/v1") |
| | | @ManagerAuth(memo = "拣料途中并板") |
| | | public R WarehouseOutPickMergeV1(@RequestBody WarehouseOutPickMergeParam param) { |
| | | if (Cools.isEmpty(param,param.getLocNo(),param.getBarcode(),param.getCombMats())) { |
| | | if (Cools.isEmpty(param, param.getLocNo(), param.getBarcode(), param.getCombMats())) { |
| | | return R.parse("参数不能为空!"); |
| | | } |
| | | return mobileService.WarehouseOutPickMergeV1(param, getHostId(), getUserId()); |
| | |
| | | @ManagerAuth(memo = "并板入库") |
| | | public R pickConfirm(@RequestBody PickConfirmParam param) { |
| | | |
| | | if(Cools.isEmpty(param,param.getList(),param.getLocNo(),param.getStaNo())) { |
| | | if (Cools.isEmpty(param, param.getList(), param.getLocNo(), param.getStaNo())) { |
| | | return R.parse("参数不完整"); |
| | | } |
| | | return mobileService.pickConfirm(param, getUserId()); |
| | |
| | | // 商品上架 |
| | | @RequestMapping("/mat/onSale/auth") |
| | | @ManagerAuth |
| | | public R matOnSale(@RequestBody CombParam combParam){ |
| | | public R matOnSale(@RequestBody CombParam combParam) { |
| | | mobileService.onSale(combParam); |
| | | return R.ok("上架成功"); |
| | | } |
| | | |
| | | // 商品下架 |
| | | @RequestMapping("/mat/offSale/auth") |
| | | //@ManagerAuth |
| | | public R matOffSale(@RequestBody OffSaleParam offSaleParam){ |
| | | public R matOffSale(@RequestBody OffSaleParam offSaleParam) { |
| | | mobileService.offSale(offSaleParam); |
| | | return R.ok("下架成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | // 组托 ---------------------------------------------------------------------------------------------------- |
| | |
| | | // } |
| | | @RequestMapping("/order/search/orderNo/auth") |
| | | @ManagerAuth |
| | | public R orderSearchByBarcode(@RequestParam String orderNo){ |
| | | if (Cools.isEmpty(orderNo)){ |
| | | orderNo=null; |
| | | public R orderSearchByBarcode(@RequestParam String orderNo) { |
| | | if (Cools.isEmpty(orderNo)) { |
| | | orderNo = null; |
| | | } |
| | | // List<Order> orders = orderService.selectorderNoL(orderNo); |
| | | List<Order> orders = OrderInAndOutUtil.selectOrderNoL(null, orderNo); |
| | | if (Cools.isEmpty(orders)){ |
| | | List<OrderPakin> orderPakins = orderPakinService.selectorderNoL(orderNo); |
| | | //List<Order> orders = OrderInAndOutUtil.selectOrderNoL(OrderEnumVo.PAKIN.getCode(), orderNo); |
| | | if (Cools.isEmpty(orderPakins)) { |
| | | return R.ok(); |
| | | } |
| | | LinkedList<CombParam> combParams = new LinkedList<>(); |
| | | if (!Cools.isEmpty(orders)){ |
| | | for (Order order:orders){ |
| | | CombParam combParam=new CombParam(); |
| | | if (!Cools.isEmpty(orderPakins)) { |
| | | for (OrderPakin order : orderPakins) { |
| | | CombParam combParam = new CombParam(); |
| | | if (order == null) { |
| | | continue; |
| | | } |
| | |
| | | List<OrderDetl> orderDetls = OrderInAndOutUtil.selectWorkingDetls(order.getPakinPakoutStatus$(), order.getId()); |
| | | if (!Cools.isEmpty(orderDetls)) { |
| | | LinkedList<CombParam.CombMat> combMats = new LinkedList<>(); |
| | | for (OrderDetl orderDetl:orderDetls){ |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | CombParam.CombMat combMat = new CombParam.CombMat(); |
| | | Synchro.Copy(orderDetl, combMat); |
| | | combMat.setMatnr(orderDetl.getMatnr()); |
| | | combMat.setBatch(orderDetl.getBatch()); |
| | | combMat.setAnfme(orderDetl.getAnfme()-orderDetl.getWorkQty()); |
| | | combMat.setAnfme(orderDetl.getAnfme() - orderDetl.getWorkQty()); |
| | | combMat.setMaktx(orderDetl.getMaktx()); |
| | | combMat.setSpecs(orderDetl.getSpecs()); |
| | | combMat.setEnableQty(orderDetl.getAnfme() - orderDetl.getWorkQty()); |
| | | combMats.add(combMat); |
| | | } |
| | | combParam.setCombMats(combMats); |
| | |
| | | combParams.add(combParam); |
| | | } |
| | | } |
| | | return R.ok().add(combParams); |
| | | return R.ok().add(combParams.get(0)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/search/auth") |
| | | @ManagerAuth |
| | | public R pdaSearchV2(@RequestParam String matnr) { |
| | | EntityWrapper<NccJcQilibcBarcodeflowWms> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("VBARCODE", matnr).orderBy("ts", false); |
| | | NccJcQilibcBarcodeflowWms nccJcQilibcBarcodeflowWms = nccJcQilibcBarcodeflowWmsService.selectOne(wrapper); |
| | | if (null == nccJcQilibcBarcodeflowWms) { |
| | | return R.error("未找到此条码"); |
| | | } else { |
| | | if (!nccJcQilibcBarcodeflowWms.getInfla().equals("出库")) { |
| | | return R.error("该条码最后一次不是出库"); |
| | | } |
| | | } |
| | | Mat mat = matService.selectByMatnr(nccJcQilibcBarcodeflowWms.getWlbm()); |
| | | MatParam matParam = new MatParam(); |
| | | Synchro.Copy(mat, matParam); |
| | | matParam.setOrderNo(nccJcQilibcBarcodeflowWms.getZkdh()); |
| | | matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode()); |
| | | matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue()); |
| | | return R.ok().add(matParam); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam){ |
| | | public R comb(@RequestBody CombParam combParam) { |
| | | mobileService.comb(combParam, getUserId()); |
| | | return R.ok("组托成功"); |
| | | } |
| | | |
| | | @RequestMapping("/pack/get/auth") |
| | | @ManagerAuth |
| | | public R packGet(@RequestParam String barcode){ |
| | | public R packGet(@RequestParam String barcode) { |
| | | Pack pack = packService.selectByBarcode(barcode); |
| | | if (pack == null) { |
| | | return R.ok(); |
| | |
| | | |
| | | @RequestMapping("/pack/comb/auth") |
| | | @ManagerAuth(memo = "下线组托") |
| | | public R packComb(@RequestBody CombParam combParam){ |
| | | public R packComb(@RequestBody CombParam combParam) { |
| | | mobileService.packComb(combParam, getUserId()); |
| | | return R.ok("组托成功"); |
| | | } |
| | |
| | | @Deprecated |
| | | public R pakoutQuery(@RequestParam(required = false) String barcode, |
| | | @RequestParam(required = false) Integer staNo, |
| | | @RequestParam(required = false) String matnr){ |
| | | @RequestParam(required = false) String matnr) { |
| | | if (Cools.isEmpty(barcode) && Cools.isEmpty(matnr)) { |
| | | return R.ok(); |
| | | } |
| | |
| | | */ |
| | | @RequestMapping("/pakout/confirm/barcode/auth") |
| | | @ManagerAuth |
| | | public R pakoutQueryByBarcode(@RequestParam(required = false) String barcode){ |
| | | public R pakoutQueryByBarcode(@RequestParam(required = false) String barcode) { |
| | | if (Cools.isEmpty(barcode)) { |
| | | return R.ok(); |
| | | } |
| | |
| | | */ |
| | | @RequestMapping("/pakout/confirm/goods/auth") //待完善 原因(客户未给出详细信息) |
| | | @ManagerAuth |
| | | public R pakoutQueryByGoods(@RequestBody GDYKConfirmGoodsParam combParam){ |
| | | public R pakoutQueryByGoods(@RequestBody GDYKConfirmGoodsParam combParam) { |
| | | if (Cools.isEmpty(combParam)) { |
| | | return R.ok(); |
| | | } |
| | |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, combParam.getOrderNo()); |
| | | List<OrderDetl> orderDetlList = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); |
| | | OrderDetl orderDetl = null; |
| | | for (OrderDetl orderDetl1 : orderDetlList){ |
| | | if (combParam.getMatnr().equals(orderDetl1.getMatnr()) && combParam.getBatch().equals(orderDetl1.getBatch())){ |
| | | for (OrderDetl orderDetl1 : orderDetlList) { |
| | | if (combParam.getMatnr().equals(orderDetl1.getMatnr()) && combParam.getBatch().equals(orderDetl1.getBatch())) { |
| | | orderDetl = orderDetl1; |
| | | break; |
| | | } |
| | | } |
| | | if (Cools.isEmpty(orderDetl)){ |
| | | if (Cools.isEmpty(orderDetl)) { |
| | | return R.error("未查到数据"); |
| | | } |
| | | if (!orderDetl.getQty$().equals("已完成")){ |
| | | if (!orderDetl.getQty$().equals("已完成")) { |
| | | return R.error("任务未完成"); |
| | | } |
| | | //复核数 |
| | | orderDetl.setSource(1); |
| | | // orderDetlService.updateById(orderDetl); |
| | | OrderInAndOutUtil.updateOrderDetl(Boolean.FALSE,order,orderDetl); |
| | | OrderInAndOutUtil.updateOrderDetl(Boolean.FALSE, order, orderDetl); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 根据库位码和商品码搜索商品 |
| | | @RequestMapping("/mat/find/auth") |
| | | public R find(@RequestParam(required = false) String locNo |
| | | , @RequestParam(required = false) String matnr){ |
| | | , @RequestParam(required = false) String matnr) { |
| | | //List<ManLocDetl> manLocDetls = manLocDetlMapper.selectItem0(locNo, matnr); |
| | | ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(locNo, matnr); |
| | | return R.ok(manLocDetl); |
| | |
| | | @RequestMapping("/pakout/confirm/pick/auth") |
| | | @ManagerAuth |
| | | public R pakoutQueryByBarcode(@RequestParam(required = false) Integer wrkNo |
| | | , @RequestParam(required = false) String matnr){ |
| | | , @RequestParam(required = false) String matnr) { |
| | | if (Cools.isEmpty(wrkNo)) { |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/checkDetl/auth/v2") |
| | | @ManagerAuth |
| | | public R getCheckDetlV2(@RequestParam(required = false) String barcode) { |
| | | if (Cools.isEmpty(barcode)) { |
| | | return R.ok(); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(barcode); |
| | | if (wrkMast != null && (wrkMast.getIoType() == 107 || wrkMast.getIoType() == 57)) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | if (!Cools.isEmpty(wrkDetls)) { |
| | | MobileAdjustResult result = new MobileAdjustResult(); |
| | | result.setBarcode(barcode); |
| | | result.setWrkNo(wrkMast.getWrkNo()); |
| | | result.setWrkDetls(wrkDetls); |
| | | return R.ok().add(result); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/adjust/auth") |
| | | @ManagerAuth(memo = "盘点") |
| | | public R adjust(@RequestBody MobileAdjustParam combParam){ |
| | | public R adjust(@RequestBody MobileAdjustParam combParam) { |
| | | mobileService.adjust(combParam, getUserId()); |
| | | return R.ok("盘点成功"); |
| | | } |
| | |
| | | @PostMapping("/order/out/pakout/auth") |
| | | @ManagerAuth(memo = "订单出库") |
| | | public synchronized R pakoutByOrder(@RequestBody JSONObject param) { |
| | | if(!param.containsKey("staNo") || !param.containsKey("orderNo")){ |
| | | if (!param.containsKey("staNo") || !param.containsKey("orderNo")) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | mobileService.pakoutByOrder(param,getUserId()); |
| | | mobileService.pakoutByOrder(param, getUserId()); |
| | | return R.ok("出库成功"); |
| | | } |
| | | |