From 2c0ef1be03bab6f0f22443c5360bb178d3ed3b78 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 2 Sep 2024 10:51:44 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E6=A8=A1=E6=9D=BF2=E6=8E=A5=E5=8F=A3=EF=BC=9A?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=87=BA=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E6=A8=A1=E6=9D=BF=E4=B8=80=E7=9A=84=E5=90=8C=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E8=B5=84=E6=96=99=E4=BF=A1=E6=81=AF=20=E6=8F=90=E7=82=BC?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=87=BA=E8=B4=A7=E8=B5=84=E6=96=99=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=BA=E5=85=AC=E5=85=B1=E6=96=B9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=87=BA=E8=B4=A7=E8=B5=84=E6=96=99=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=A0=B9=E6=8D=AE=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=8D=E5=90=8C=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysSalesShippingInformServiceImpl.java | 93 +++++++++++-------- 1 file changed, 54 insertions(+), 39 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java index 4d857b96..6bf7f766 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java @@ -400,16 +400,21 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor String fileName = "销售出货单1.xlsx"; FileDownloadUtils fileDownloadUtils = new FileDownloadUtils(); - String loginName = ShiroUtils.getLoginName(); try { String fileAbsolutePath = fileDownloadUtils.getFileRelativePath(fileName); SysSalesShippingInform salesShippingInform = sysSalesShippingInformMapper.selectSysSalesShippingInformByCode(outOrderCode); + if (StringUtils.isEmpty(outOrderCode)){ + log.warn("出库单号为空:{}",outOrderCode); + throw new RuntimeException("出库单号为空,请检查"); + } + //销售出货单 + String shippingInformationType = "2"; //生成出货资料 - insertShippingInformation(outOrderCode, loginName, salesShippingInform); + insertShippingInformation(outOrderCode,shippingInformationType,salesShippingInform); List salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode); @@ -467,49 +472,13 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor } - private void insertShippingInformation(String outOrderCode, String loginName, SysSalesShippingInform salesShippingInform) { - SalesShippingInformation shippingInformation = new SalesShippingInformation(); - shippingInformation.setOutOrderCode(outOrderCode); - shippingInformation.setSalesOrderCode(salesShippingInform.getSalesOrderCode()); - //销售出货单 - shippingInformation.setShippingInformationType("2"); - shippingInformation.setShippingInformationCode(redisCache.generateBillNo("CHZL")); - shippingInformation.setShippingTemplateType("1"); - shippingInformation.setCreateBy(loginName); - shippingInformation.setCreateTime(new Date()); - shippingInformation.setBusinessMembers(salesShippingInform.getBusinessMembers()); - shippingInformation.setCustomerId(salesShippingInform.getCustomerId()); - - shippingInformation.setAcceptanceTime(salesShippingInform.getAcceptanceTime()); - shippingInformation.setAllPriceExcludingTaxRmb(salesShippingInform.getAllPriceExcludingTaxRmb()); - shippingInformation.setAllPriceExcludingTaxDollar(salesShippingInform.getAllPriceExcludingTaxDollar()); - shippingInformation.setAllPriceIncludesTax(salesShippingInform.getAllPriceIncludesTax()); - shippingInformation.setCustomerName(salesShippingInform.getCustomerName()); - shippingInformation.setCustomerContact(salesShippingInform.getCustomerContact()); - shippingInformation.setCustomerContactAddress(salesShippingInform.getCustomerContactAddress()); - shippingInformation.setCustomerContactBillto(salesShippingInform.getCustomerContactBillto()); - shippingInformation.setContactNumber(salesShippingInform.getContactNumber()); - shippingInformation.setContactNumberBillto(salesShippingInform.getContactNumberBillto()); - shippingInformation.setContactAddressBillto(salesShippingInform.getContactAddressBillto()); - shippingInformation.setDeliveryCondition(salesShippingInform.getDeliveryCondition()); - shippingInformation.setDeliverTime(salesShippingInform.getDeliverTime()); - shippingInformation.setPaymentCondition(salesShippingInform.getPaymentCondition()); - shippingInformation.setPlannedDeliveryTime(salesShippingInform.getPlannedDeliveryTime()); - shippingInformation.setRemark(salesShippingInform.getRemark()); - shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType()); - shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType()); - int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation); - if (result<=0){ - throw new BusinessException("插入销售出货资料单失败"); - } - } - /** * 导出出货单2模板 * */ @Override public void exportShippingOrderTwo(String outOrderCode, HttpServletResponse response) { + String fileName = "销售出货单2.xlsx"; FileDownloadUtils fileDownloadUtils = new FileDownloadUtils(); @@ -523,6 +492,12 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor throw new RuntimeException("出库单号为空,请检查"); } + //销售出货单 + String shippingInformationType = "2"; + + //生成出货资料 + insertShippingInformation(outOrderCode,shippingInformationType,salesShippingInform); + List salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); String deliverTime = dateFormat.format(salesShippingInform.getDeliverTime()); @@ -940,4 +915,44 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor } } + + + + private void insertShippingInformation(String outOrderCode, String shippingInformationType, SysSalesShippingInform salesShippingInform) { + String loginName = ShiroUtils.getLoginName(); + + SalesShippingInformation shippingInformation = new SalesShippingInformation(); + shippingInformation.setOutOrderCode(outOrderCode); + shippingInformation.setSalesOrderCode(salesShippingInform.getSalesOrderCode()); + shippingInformation.setShippingInformationType(shippingInformationType); + shippingInformation.setShippingInformationCode(redisCache.generateBillNo("CHZL")); + shippingInformation.setShippingTemplateType("1"); + shippingInformation.setCreateBy(loginName); + shippingInformation.setCreateTime(new Date()); + shippingInformation.setBusinessMembers(salesShippingInform.getBusinessMembers()); + shippingInformation.setCustomerId(salesShippingInform.getCustomerId()); + + shippingInformation.setAcceptanceTime(salesShippingInform.getAcceptanceTime()); + shippingInformation.setAllPriceExcludingTaxRmb(salesShippingInform.getAllPriceExcludingTaxRmb()); + shippingInformation.setAllPriceExcludingTaxDollar(salesShippingInform.getAllPriceExcludingTaxDollar()); + shippingInformation.setAllPriceIncludesTax(salesShippingInform.getAllPriceIncludesTax()); + shippingInformation.setCustomerName(salesShippingInform.getCustomerName()); + shippingInformation.setCustomerContact(salesShippingInform.getCustomerContact()); + shippingInformation.setCustomerContactAddress(salesShippingInform.getCustomerContactAddress()); + shippingInformation.setCustomerContactBillto(salesShippingInform.getCustomerContactBillto()); + shippingInformation.setContactNumber(salesShippingInform.getContactNumber()); + shippingInformation.setContactNumberBillto(salesShippingInform.getContactNumberBillto()); + shippingInformation.setContactAddressBillto(salesShippingInform.getContactAddressBillto()); + shippingInformation.setDeliveryCondition(salesShippingInform.getDeliveryCondition()); + shippingInformation.setDeliverTime(salesShippingInform.getDeliverTime()); + shippingInformation.setPaymentCondition(salesShippingInform.getPaymentCondition()); + shippingInformation.setPlannedDeliveryTime(salesShippingInform.getPlannedDeliveryTime()); + shippingInformation.setRemark(salesShippingInform.getRemark()); + shippingInformation.setWarehouseOutType(salesShippingInform.getWarehouseOutType()); + shippingInformation.setWarehouseOrderType(salesShippingInform.getWarehouseOrderType()); + int result = salesShippingInformationMapper.insertSalesShippingInformation(shippingInformation); + if (result<=0){ + throw new BusinessException("插入销售出货资料单失败"); + } + } }