From 45727f8c690da0a1ed5847e2f141714d5c438f0f Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 15 Jul 2024 16:15:57 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=A7=94=E5=A4=96=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E7=9A=84=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E5=A7=94=E5=A4=96?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=8D=95=E5=8F=B7=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E4=BF=AE=E6=94=B9=E5=A7=94=E5=A4=96=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E6=96=B0=E5=A2=9E=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OutsourceQuoteController.java | 13 +++++++++++++ .../system/service/IOutsourceQuoteService.java | 6 ++++++ .../impl/OutsourceQuoteServiceImpl.java | 16 ++++++++++++++++ .../templates/system/outsource_quote/add.html | 18 ++++++++++++++---- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java index c6eaebaa..97cbaa26 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java @@ -161,4 +161,17 @@ public class OutsourceQuoteController extends BaseController { return toAjax(outsourceQuoteService.deleteOutsourceQuoteByOutsourceQuoteIds(ids)); } + + + /** + * 自动生成委外报价编号 + * + */ + @GetMapping("/generateOutsourceQuoteCode") + @ResponseBody + public String generateOutsourceQuoteCode(){ + + String result = outsourceQuoteService.generateOutsourceQuoteCode(); + return result; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java index 644043d4..6072159c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java @@ -68,4 +68,10 @@ public interface IOutsourceQuoteService * @param outsourceQuote 委外报价对象 */ public void insertOutsourceQuoteChild(OutsourceQuote outsourceQuote); + + /** + * 自动生成委外报价编号 + * */ + String generateOutsourceQuoteCode(); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java index 0271061e..ad1dbc4e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.system.domain.OutsourceQuote; @@ -27,6 +29,9 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService @Autowired private OutsourceQuoteMapper outsourceQuoteMapper; + @Autowired + private RedisCache redisCache; + /** * 查询委外报价 * @@ -149,4 +154,15 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService } } } + + /** + * 自动生成委外报价编号 + * */ + @Override + public String generateOutsourceQuoteCode() { + + return redisCache.generateBillNo("WWBJ"); + } + + } diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html b/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html index df6423d3..73901eaf 100644 --- a/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html @@ -12,15 +12,12 @@

委外报价信息

-
- +
-
@@ -104,6 +101,19 @@ WWBJ002"> $.ajax(config) }; + + + //获取单号 + $.ajax({ + url: prefix + "/generateOutsourceQuoteCode", + type: "GET", + dateType: "json", + success: function (resp) { + console.log(resp) + if (resp != null) {$("input[name='outsourceQuoteCode']").val(resp);} else {$.modal.msgError("失败啦");} + } + }); + function submitHandler() { var url = prefix + "/add"; var outsourceQuote = {