diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 9d7d475b..dec6b676 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -43,6 +43,7 @@ import com.glxp.api.util.OrderNoTypeBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; @@ -798,6 +799,10 @@ public class IoOrderController extends BaseController { List ioOrderInvoiceEntity = orderInvoiceService.list(ew); List orderIds = ioOrderInvoiceEntity.stream().map(IoOrderInvoiceEntity::getOrderIdFk).collect(Collectors.toList()); filterOrderRequest.setOrderIds(orderIds); + if(CollectionUtils.isEmpty(orderIds)){ + PageInfo pageInfo = new PageInfo<>(); + return ResultVOUtils.page(pageInfo); + } } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java index 421176df..ca27b726 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -27,6 +27,7 @@ import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.inout.IoOrderDetailBizService; import com.glxp.api.service.inout.IoOrderDetailCodeService; import com.glxp.api.service.inout.impl.IoOrderInvoiceService; +import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -193,4 +194,20 @@ public class IoOrderInvoiceController { else return ResultVOUtils.error(500, "删除失败!"); } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/invoice/checkInvoiceCode") + public BaseResponse checkInvoiceCode(@RequestBody DeleteRequest deleteRequest) { + if (StrUtil.isEmpty(deleteRequest.getInvoiceEncode())) + return ResultVOUtils.error(500, "发票编码不能为空"); + + List ioOrderInvoiceEntityList = ioOrderInvoiceService.list(new QueryWrapper().eq("invoiceEncode", deleteRequest.getInvoiceEncode())); + if (CollectionUtils.isNotEmpty(ioOrderInvoiceEntityList) && ioOrderInvoiceEntityList.size()>0){ + return ResultVOUtils.error(999,"发票编码已存在!"); + } + return ResultVOUtils.success(); + + } + + } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceService.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceService.java index 1f0cbcd5..d8e66fec 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceService.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceService.java @@ -87,6 +87,9 @@ public class IoOrderInvoiceService extends ServiceImpl