From bfb9746a97026b4f499acc49332da8fd4f61825f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Tue, 11 Jul 2023 10:40:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/inout/IoOrderController.java | 5 +++++ .../inout/IoOrderInvoiceController.java | 17 +++++++++++++++++ .../inout/impl/IoOrderInvoiceService.java | 3 +++ 3 files changed, 25 insertions(+) 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