diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/customer/vo/CustomerRespVO.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/customer/vo/CustomerRespVO.java index 73760b5..c4668d3 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/customer/vo/CustomerRespVO.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/controller/admin/customer/vo/CustomerRespVO.java @@ -70,6 +70,18 @@ public class CustomerRespVO { @ExcelProperty("类型") private String type; + @Schema(description = "发票抬头") + @ExcelProperty("发票抬头") + private String invoiceCode; + + @Schema(description = "发票名称") + @ExcelProperty("发票名称") + private String invoiceName; + + @Schema(description = "发票地址") + @ExcelProperty("发票地址") + private String invoiceAddress; + @Schema(description = "数据状态", example = "2") @ExcelProperty(value = "数据状态", converter = DictConvert.class) @DictFormat("oms_data_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 diff --git a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java index 14fb0dc..a70751d 100644 --- a/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java +++ b/hangtag-module-oms/hangtag-module-oms-biz/src/main/java/cn/hangtag/module/oms/service/saleorder/SaleOrderServiceImpl.java @@ -32,6 +32,7 @@ import cn.hangtag.module.oms.dal.dataobject.salecontractentry.SaleContractEntryD import cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO; import cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO; import cn.hangtag.module.oms.dal.dataobject.saleordersku.SaleOrderSkuDO; +import cn.hangtag.module.oms.dal.mysql.customer.CustomerMapper; import cn.hangtag.module.oms.dal.mysql.saleorder.SaleOrderMapper; import cn.hangtag.module.oms.dal.mysql.saleorderentry.SaleOrderEntryMapper; import cn.hangtag.module.oms.dal.mysql.saleordersku.SaleOrderSkuMapper; @@ -102,6 +103,7 @@ public class SaleOrderServiceImpl implements SaleOrderService { private final ProductInfoService productInfoService; private final SaleContractService saleContractService; private final CustomerService customerService; + private final CustomerMapper customerMapper; private final ProductPriceService productPriceService; private final TemplateEngine templateEngine; @@ -491,6 +493,8 @@ public class SaleOrderServiceImpl implements SaleOrderService { saleOrderMapper.insert(order); saleOrderEntryMapper.insertBatch(entryList); skuOrderSkuMapper.insertBatch(skuList); + + updateCustomerInvoiceData(order); System.out.println(order); return order.getId(); } @@ -601,5 +605,23 @@ public class SaleOrderServiceImpl implements SaleOrderService { } + /** + * 更新客户发票数据 + */ + private void updateCustomerInvoiceData(SaleOrderDO order){ + String invoiceCode = order.getInvoiceCode(); + String invoiceName = order.getInvoiceName(); + String invoiceAddress = order.getInvoiceAddress(); + Long customerId = order.getCustomerId(); + if(customerId!=null){ + CustomerDO customer = customerService.getCustomer(customerId); + if(customer!=null){ + customer.setInvoiceCode(invoiceCode); + customer.setInvoiceName(invoiceName); + customer.setInvoiceAddress(invoiceAddress); + customerMapper.updateById(customer); + } + } + } } \ No newline at end of file diff --git a/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue b/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue index ee74889..9eda88d 100644 --- a/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/views/oms/order/createorder/index.vue @@ -589,6 +589,9 @@ onMounted(async () => { formData.value.company = customerData.company; formData.value.contactName = customerData.contacts; formData.value.phone = customerData.phone; + formData.value.invoiceCode = customerData.invoiceCode; + formData.value.invoiceName = customerData.invoiceName; + formData.value.invoiceAddress = customerData.invoiceAddress; if(!formData.value.deliveryAddress && that.addressList.length > 0){ formData.value.deliveryAddress = that.addressList[0].address; that.addressId = that.addressList[0].id;