diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java index 25c7cc9c..8069ee93 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesShippingInformation.java @@ -65,11 +65,6 @@ public class SalesShippingInformation extends BaseEntity @Excel(name = "客户订单号") private String salesOrderNumber; - /** 发货日期 */ - private String deliveryDate; - - /** 客户订单号 */ - private String customerNumber; /** 物料合计 */ @Excel(name = "物料合计") @@ -250,24 +245,7 @@ public class SalesShippingInformation extends BaseEntity { return salesOrderNumber; } - public void setDeliveryDate(String deliveryDate) - { - this.deliveryDate = deliveryDate; - } - public String getDeliveryDate() - { - return deliveryDate; - } - public void setCustomerNumber(String customerNumber) - { - this.customerNumber = customerNumber; - } - - public String getCustomerNumber() - { - return customerNumber; - } public void setMaterialSum(Long materialSum) { this.materialSum = materialSum; @@ -437,8 +415,6 @@ public class SalesShippingInformation extends BaseEntity .append("customerId", getCustomerId()) .append("customerName", getCustomerName()) .append("salesOrderNumber", getSalesOrderNumber()) - .append("deliveryDate", getDeliveryDate()) - .append("customerNumber", getCustomerNumber()) .append("materialSum", getMaterialSum()) .append("enterpriseSum", getEnterpriseSum()) .append("allPriceExcludingTaxRmb", getAllPriceExcludingTaxRmb()) 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 ba3741de..4d857b96 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 @@ -20,6 +20,8 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileDownloadUtils; +import com.ruoyi.sales.domain.SalesShippingInformation; +import com.ruoyi.sales.mapper.SalesShippingInformationMapper; import com.ruoyi.system.domain.*; import com.ruoyi.system.dto.ExportShippingInformOrderDto; import com.ruoyi.system.dto.ExportShippingInvoiceDto; @@ -71,6 +73,12 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor @Autowired private AfterSalesShippingDeviceMapper salesShippingDeviceMapper; + + @Autowired + private SalesShippingInformationMapper salesShippingInformationMapper; + + + /** * 查询销售出货通知 * @@ -392,12 +400,18 @@ 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); + + //生成出货资料 + insertShippingInformation(outOrderCode, loginName, salesShippingInform); + + List salesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); String deliverTime = dateFormat.format(salesShippingInform.getDeliverTime()); @@ -453,6 +467,43 @@ 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模板 diff --git a/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml b/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml index 14c12a45..bc49fc80 100644 --- a/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/sales/SalesShippingInformationMapper.xml @@ -17,8 +17,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - @@ -43,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select shipping_information_id, shipping_information_code, sales_order_code, out_order_code, shipping_information_type, shipping_template_type, warehouse_order_type, warehouse_out_type, business_members, customer_id, customer_name, sales_order_number, delivery_date, customer_number, material_sum, enterprise_sum, all_price_excluding_tax_rmb, all_price_excluding_tax_dollar, all_price_includes_tax, planned_delivery_time, acceptance_time, payment_condition, delivery_condition, deliver_time, customer_contact, contact_number, customer_contact_address, customer_contact_billto, contact_number_billto, contact_address_billto, remarks, create_time, create_by, update_by, update_time from sales_shipping_information + select shipping_information_id, shipping_information_code, sales_order_code, out_order_code, shipping_information_type, shipping_template_type, warehouse_order_type, warehouse_out_type, business_members, customer_id, customer_name, sales_order_number, material_sum, enterprise_sum, all_price_excluding_tax_rmb, all_price_excluding_tax_dollar, all_price_includes_tax, planned_delivery_time, acceptance_time, payment_condition, delivery_condition, deliver_time, customer_contact, contact_number, customer_contact_address, customer_contact_billto, contact_number_billto, contact_address_billto, remarks, create_time, create_by, update_by, update_time from sales_shipping_information
  • - +