From 298f3f350736cf569c4f2e7b88a81a5dba139c0b Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Sat, 6 May 2023 10:42:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit ff1f825b39e6ebdeee0b4de93d0775fcea6f2e0b) --- .../inout/IoOrderDetailBizController.java | 32 ++++++++++++------- .../entity/inout/IoOrderDetailBizEntity.java | 2 ++ .../entity/inout/IoOrderInvoiceEntity.java | 6 ++++ .../inout/FilterOrderDetailBizRequest.java | 3 +- .../api/req/inout/IoOrderInvoiceRequest.java | 2 +- .../res/inout/IoOrderDetailBizResponse.java | 2 ++ .../service/inout/IoOrderInvoiceService.java | 2 +- .../inout/impl/IoOrderInvoiceServiceImpl.java | 2 +- 8 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index ebe72730..6e81a8d1 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -559,7 +559,7 @@ public class IoOrderDetailBizController extends BaseController { @Log(title = "发票管理", businessType = BusinessType.DELETE) public BaseResponse deleteById(@RequestBody IoOrderInvoiceEntity ioOrderInvoiceEntity) { - ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId().intValue()); + ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+""); //更改 登记状态 IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); @@ -600,8 +600,9 @@ public class IoOrderDetailBizController extends BaseController { @PostMapping("/udiwms/inout/biz/insertInvoice") @Log(title = "发票管理", businessType = BusinessType.INSERT) - public BaseResponse insertInvoice(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) { + public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) { + for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderInvoice.getList()) { IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity(); ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + ""); @@ -612,17 +613,25 @@ public class IoOrderDetailBizController extends BaseController { ioOrderInvoiceEntity.setCreateTime(new Date()); ioOrderInvoiceEntity.setUpdateTime(new Date()); ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); + ioOrderInvoiceEntity.setMachineNo(ioOrderInvoice.getMachineNo()); + ioOrderInvoiceEntity.setInvoiceCode(ioOrderInvoice.getInvoiceCode()); + ioOrderInvoiceEntity.setInvoiceEncode(ioOrderInvoice.getInvoiceEncode()); + ioOrderInvoiceEntity.setInvoiceDate(ioOrderInvoice.getInvoiceDate()); + ioOrderInvoiceEntity.setPrice(ioOrderInvoice.getPrice()); + ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark()); + ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl()); boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity); - + } return ResultVOUtils.success("成功"); } @PostMapping("/udiwms/inout/biz/updateorderBiz") - public BaseResponse updateorderBiz(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) { - ioOrderDetailBizEntity.setRegStatus(true); - orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); - + public BaseResponse updateorderBiz(@RequestBody List list) { + for (IoOrderDetailBizEntity ioOrderDetailBizEntity : list) { + ioOrderDetailBizEntity.setRegStatus(true); + orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + } return ResultVOUtils.success("成功"); } @@ -637,21 +646,22 @@ public class IoOrderDetailBizController extends BaseController { */ @GetMapping("/udiwms/inout/bizDetail/filterBizOrderList") public BaseResponse filterBizOrderList(FilterOrderDetailBizRequest orderDetailBizRequest) { - List list = orderDetailBizService.filterList(orderDetailBizRequest); + List list = orderDetailBizService.getfilterList(orderDetailBizRequest); for (IoOrderDetailBizResponse ioOrderDetailBizResponse : list) { String msg = ""; IoOrderInvoiceRequest ioOrderInvoiceEntity = new IoOrderInvoiceRequest(); ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizResponse.getOrderIdFk()); + ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizResponse.getId()); List ioOrderInvoiceEntityList = ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceEntity); for (IoOrderInvoiceEntity obj : ioOrderInvoiceEntityList) { - if (StrUtil.isNotEmpty(obj.getInvoiceCode())) { - msg += "," + obj.getInvoiceCode(); + if (StrUtil.isNotEmpty(obj.getInvoiceEncode())) { + msg += "," + obj.getInvoiceEncode(); } } if (msg.length() > 1) { msg = msg.substring(1); } - ioOrderDetailBizResponse.setInvoiceCodes(msg); + ioOrderDetailBizResponse.setInvoiceCodes(msg); } PageInfo pageInfo = new PageInfo<>(list); return ResultVOUtils.page(pageInfo); diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java index 186b3e81..6e3afc18 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.math.BigDecimal; +import java.util.List; @Data @TableName(value = "io_order_detail_biz") @@ -201,4 +202,5 @@ public class IoOrderDetailBizEntity { private boolean regStatus; + } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java index dd45cbd7..9d96cda7 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderInvoiceEntity.java @@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; +import java.util.List; +import kotlin.jvm.internal.Lambda; import lombok.Data; @Data @@ -110,6 +112,10 @@ public class IoOrderInvoiceEntity { private Integer regId; + @TableField(exist = false) + private List list; + + public static final String COL_ID = "id"; public static final String COL_ORDERIDFK = "orderIdFk"; diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java index a6cc55bc..7e821569 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailBizRequest.java @@ -3,12 +3,13 @@ package com.glxp.api.req.inout; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; +import java.util.List; + /** * 单据业务详情查询参数 */ @Data public class FilterOrderDetailBizRequest extends ListPageRequest { - /** * 耗材字典产品ID */ diff --git a/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java b/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java index 07ee07cc..5e0ddb7b 100644 --- a/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java +++ b/src/main/java/com/glxp/api/req/inout/IoOrderInvoiceRequest.java @@ -67,7 +67,7 @@ public class IoOrderInvoiceRequest { private String remark; - private Long bizIdFk; + private Integer bizIdFk; public static final String COL_ID = "id"; diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java index 29af9533..2af0db85 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -167,6 +167,8 @@ public class IoOrderDetailBizResponse { private boolean regStatus; + private String invoiceCode; + } diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java b/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java index aae7dfac..ed597467 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderInvoiceService.java @@ -12,7 +12,7 @@ public interface IoOrderInvoiceService extends IService { List findByBillNo(String billNo); - boolean deleteByInvId(Integer id); + boolean deleteByInvId(String id); boolean updateByInvId(IoOrderInvoiceRequest ioOrderInvoiceRequest); diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java index 9bdcdf2e..1e626ac5 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderInvoiceServiceImpl.java @@ -30,7 +30,7 @@ public class IoOrderInvoiceServiceImpl extends ServiceImpl 0; }