From 0083117df983ebb6cc1044d62f23211b24f38330 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 18 May 2023 18:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E6=B5=81=E8=BD=AC=E7=AD=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/purchase/PurOrderController.java | 7 ++++--- .../api/entity/purchase/PurOrderDetailEntity.java | 6 ++++++ .../java/com/glxp/api/res/inout/IoOrderResponse.java | 6 +++--- .../api/res/purchase/PurOrderDetailResponse.java | 3 +++ .../glxp/api/service/inout/IoChangeInoutService.java | 11 +++++++++++ .../glxp/api/service/inout/IoCheckInoutService.java | 6 ++++-- src/main/resources/application-dev.yml | 2 +- .../mybatis/mapper/purchase/PurOrderDetailDao.xml | 12 ++++++++---- src/main/resources/schemas/schema_v2.1.sql | 2 ++ 9 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java b/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java index 719516b7..f165e2e2 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java @@ -204,11 +204,12 @@ public class PurOrderController { ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); + ioOrderDetailBizEntity.setPrice(obj.getPrice()); ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); - if (basicProductsEntity.getPrice() != null) { - ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); - } +// if (basicProductsEntity.getPrice() != null) { +// ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); +// } ioOrderDetailBizEntity.setSupId(obj.getSupId()); ioOrderDetailBizService.insert(ioOrderDetailBizEntity); } diff --git a/src/main/java/com/glxp/api/entity/purchase/PurOrderDetailEntity.java b/src/main/java/com/glxp/api/entity/purchase/PurOrderDetailEntity.java index 50a0b4b4..914bc521 100644 --- a/src/main/java/com/glxp/api/entity/purchase/PurOrderDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/purchase/PurOrderDetailEntity.java @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import java.math.BigDecimal; + @Data @TableName(value = "pur_order_detail") public class PurOrderDetailEntity { @@ -48,6 +50,10 @@ public class PurOrderDetailEntity { @TableField(value = "zczbhhzbapzbh") private String zczbhhzbapzbh; + + @TableField(value = "price") + private BigDecimal price; + public static final String COL_ID = "id"; public static final String COL_ORDERIDFK = "orderIdFk"; diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java index 165dd73f..c6d65f66 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java @@ -241,7 +241,6 @@ public class IoOrderResponse { private BigDecimal allAmount; - /** * 校验信息 */ @@ -256,10 +255,11 @@ public class IoOrderResponse { public String getFromName() { - if (StrUtil.isNotEmpty(fromCorpName)) - return fromCorpName; + if (StrUtil.isNotEmpty(fromInvName)) return fromInvName; + if (StrUtil.isNotEmpty(fromCorpName)) + return fromCorpName; return fromName; } } diff --git a/src/main/java/com/glxp/api/res/purchase/PurOrderDetailResponse.java b/src/main/java/com/glxp/api/res/purchase/PurOrderDetailResponse.java index c4c2f2c6..c15e3796 100644 --- a/src/main/java/com/glxp/api/res/purchase/PurOrderDetailResponse.java +++ b/src/main/java/com/glxp/api/res/purchase/PurOrderDetailResponse.java @@ -48,4 +48,7 @@ public class PurOrderDetailResponse { private String supId; private String supName; + + private String billNo; + private String nameCode; } diff --git a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java index ffff4c70..6748597f 100644 --- a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java @@ -257,6 +257,17 @@ public class IoChangeInoutService { codeTempEntities.add(codeTempEntity); } codeTempService.insertBatch(codeTempEntities); + + // 生成业务单 + List orderDetailBizEntities = orderDetailBizService.findByOrderId(orderEntity.getBillNo()); + if (CollUtil.isNotEmpty(orderDetailBizEntities)) { + for (IoOrderDetailBizEntity orderDetailBizEntity : orderDetailBizEntities) { + orderDetailBizEntity.setOrderIdFk(outOrder.getBillNo()); + orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId()); + orderDetailBizService.insert(orderDetailBizEntity); + } + } + if (isGenInovice) { //生成发票信息 List invoiceEntities = ioOrderInvoiceService.findByBillNo(orderEntity.getBillNo()); diff --git a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java index ecf3d52e..9a5dfe02 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCheckInoutService.java @@ -290,8 +290,10 @@ public class IoCheckInoutService { orderService.update(orderEntity); return; } - - orderDetailBizService.deleteByOrderId(orderEntity.getBillNo()); + if (orderEntity.getFromType() != ConstantStatus.FROM_COPY + && orderEntity.getFromType() != ConstantStatus.FROM_CHANGE) { + orderDetailBizService.deleteByOrderId(orderEntity.getBillNo()); + } orderDetailResultService.deleteByOrderId(orderEntity.getBillNo()); orderDetailCodeEntities.forEach(orderDetailCodeEntity -> { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index c2a962d2..eed086a0 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,7 +3,7 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml index 1d9052d9..87013f82 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDetailDao.xml @@ -38,11 +38,12 @@