zy-asrs-common/src/main/java/com/zy/asrs/common/domain/dto/OrderNameListDto.java
New file @@ -0,0 +1,8 @@ package com.zy.asrs.common.domain.dto; import lombok.Data; @Data public class OrderNameListDto { private String order_no; } zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/MobileService.java
@@ -17,4 +17,6 @@ void adjust(MobileAdjustParam param, Long userId, Long hostId); R WarehouseIn(String locNo, String barcode,Long hostId); R WarehouseOut(CombParam combParam, Long hostId); } zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/OrderService.java
@@ -1,6 +1,7 @@ package com.zy.asrs.common.wms.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zy.asrs.common.domain.dto.OrderNameListDto; import com.zy.asrs.common.wms.entity.Order; import com.zy.asrs.common.wms.entity.OrderDetl; import com.zy.asrs.common.wms.entity.WrkDetl; @@ -22,4 +23,6 @@ void checkComplete(String orderNo, Long hostId); List<OrderNameListDto> selectAllorderNo(Long hostId); } zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/MobileServiceImpl.java
@@ -103,7 +103,7 @@ } } // 关联组托 } else { } else { Order order = orderService.selectByNo(param.getOrderNo(), hostId); if (order.getSettle() > 2) { throw new CoolException("单据编号已过期"); @@ -118,7 +118,7 @@ throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); } // 修改订单明细数量 if (!orderDetlService.increase(order.getId(), hostId, elem.getMatnr(), elem.getBatch(), elem.getAnfme())) { if (!orderDetlService.increaseWorkQtyByOrderNo(order.getOrderNo(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), hostId)) { throw new CoolException("修改单据明细数量失败"); } @@ -237,7 +237,7 @@ @Override @Transactional public R WarehouseIn(String locNo, String barcode,Long hostId) { //判断库位状态 //判断库位状态 LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, locNo).eq(LocMast::getHostId,hostId)); if (Cools.isEmpty(locMast)){ return R.error("该库位不存在"); @@ -266,11 +266,28 @@ locDetl.setModiTime(now); locDetl.setAppeTime(now); locDetlService.save(locDetl); //是否属于订单数据 if (!Cools.isEmpty(waitPakin.getOrderNo())){ Order order = orderService.selectByNo(waitPakin.getOrderNo(), hostId); if (Cools.isEmpty(order)){ continue; } OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), waitPakin.getMatnr(), waitPakin.getBatch()); if (Cools.isEmpty(orderDetl)){ continue; } // 修改订单明细完成数量 if (!orderDetlService.increase(order.getId(), hostId, waitPakin.getMatnr(), waitPakin.getBatch(), waitPakin.getAnfme())) { throw new CoolException("修改单据明细数量失败"); } } } //修改库位状态 locMast.setLocSts("F"); locMast.setModiTime(now); locMastService.updateById(locMast); // 保存入库通知档历史档 if (!waitPakinLogService.saveToHistory(barcode, hostId)) { @@ -282,4 +299,26 @@ } return R.ok("上架成功"); } @Override public R WarehouseOut(CombParam combParam, Long hostId) { //判断库位状态 LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, combParam.getLocno()).eq(LocMast::getHostId,hostId)); if (Cools.isEmpty(locMast)){ return R.error("该库位不存在"); } if (!locMast.getLocSts().equals("F")){ return R.error("该库位状态为:"+locMast.getLocSts()+",禁止出库"); } //查询库存数据 List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getZpallet, combParam.getBarcode()).eq(LocDetl::getLocNo, combParam.getLocno()).eq(LocDetl::getHostId, hostId)); if (Cools.isEmpty(locDetls)){ return R.error("未查询到库存数据"); } for (LocDetl locDetl: locDetls){ } return R.ok(); } } zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/OrderServiceImpl.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zy.asrs.common.domain.dto.DetlDto; import com.zy.asrs.common.domain.dto.OrderNameListDto; import com.zy.asrs.common.domain.param.OpenOrderPakinParam; import com.zy.asrs.common.domain.param.OpenOrderPakoutParam; import com.zy.asrs.common.wms.entity.*; @@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zy.asrs.framework.common.Cools; import com.zy.asrs.framework.common.DateUtils; import com.zy.asrs.framework.common.R; import com.zy.asrs.framework.common.SnowflakeIdWorker; import com.zy.asrs.framework.exception.CoolException; import org.springframework.beans.factory.annotation.Autowired; @@ -156,4 +158,25 @@ } } @Override public List<OrderNameListDto> selectAllorderNo(Long hostId) { List<Order> list = list(new LambdaQueryWrapper<Order>().eq(Order::getHostId, hostId)); if (Cools.isEmpty(list)){ return null; } ArrayList<OrderNameListDto> orderNameListDtos = new ArrayList<>(); for (Order order :list){ DocType docType = docTypeService.getOne(new LambdaQueryWrapper<DocType>().eq(DocType::getDocId, order.getDocType())); if (docType.getPakin() == 1){ OrderNameListDto orderNameListDto = new OrderNameListDto(); orderNameListDto.setOrder_no(order.getOrderNo()); orderNameListDtos.add(orderNameListDto); } } return orderNameListDtos; } } zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/LocDetlController.java
@@ -28,6 +28,16 @@ @Autowired private MatService matService; @RequestMapping(value = "/locDetl/forLocNoAndBarcode/auth") @ManagerAuth public R forLocNoAndBarcode(@RequestParam String locNo,@RequestParam String barcode) { List<LocDetl> detls = locDetlService.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocNo, locNo).eq(LocDetl::getZpallet, barcode).eq(LocDetl::getHostId, getHostId())); if (Cools.isEmpty(detls)){ return R.error("未查询到库存数据"); } return R.ok(detls); } @RequestMapping(value = "/locDetl/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) { zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/MobileController.java
@@ -70,6 +70,12 @@ return mobileService.WarehouseIn(locNo,barcode,getHostId()); } @RequestMapping("/pda/WarehouseOut") @ManagerAuth public R WarehouseOut(@RequestBody CombParam combParam){ return mobileService.WarehouseOut(combParam,getHostId()); } @RequestMapping("/menu/pda/auth") @ManagerAuth public R menuPda(){ zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/OrderController.java
@@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.*; @RestController @@ -47,6 +48,25 @@ @Autowired private DocTypeService docTypeService; @RequestMapping(value = "/order/list/orderNo") public R orderListorderNo(@RequestParam String orderNo) { //数量修改成为完成数量 List<OrderDetl> orderDetl1=orderDetlService.list(new LambdaQueryWrapper<OrderDetl>().eq(OrderDetl::getOrderNo,orderNo)); List<OrderDetl> orderDetls= new ArrayList<OrderDetl>(); for (OrderDetl o: orderDetl1) { BigDecimal c1 = new BigDecimal(o.getEnableQty()).setScale(2,BigDecimal.ROUND_HALF_UP); o.setAnfme(c1.doubleValue()); orderDetls.add(o); } return R.ok(orderDetls); } @RequestMapping(value = "/order/list/all") @ManagerAuth public R orderList() { return R.ok(orderService.selectAllorderNo(getHostId())); } @RequestMapping(value = "/order/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) {