From 56a3e954b2dc248fa3fa97e2ba4f41bfaf36d878 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期日, 17 十二月 2023 11:50:46 +0800 Subject: [PATCH] 代码提交 --- ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java | 7 ++++--- ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/BaseOnlyValController.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ ruoyi-project/src/main/java/com/ruoyi/project/service/IBaseOnlyvalueService.java | 2 +- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/BaseOnlyValController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/BaseOnlyValController.java new file mode 100644 index 0000000..9e227b7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/BaseOnlyValController.java @@ -0,0 +1,50 @@ +package com.ruoyi.web.controller.project; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.project.domain.BaseItemexpense; +import com.ruoyi.project.domain.BaseOnlyvalue; +import com.ruoyi.project.service.IBaseItemexpenseService; +import com.ruoyi.project.service.IBaseOnlyvalueService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; + +/** + * 鑾峰彇鍞竴鍊糃ontroller + * + * @author ruoyi + * @date 2022-05-11 + */ +@Slf4j +@Api("鏀跺叆璐圭敤绉戠洰") +@RestController +@RequestMapping("/project/baseonlyvalue") +public class BaseOnlyValController extends BaseController { + @Autowired + private IBaseOnlyvalueService baseOnlyvalueService; + + /** + * 鑾峰彇鍞竴缂栧彿 + */ + @ApiOperation("鑾峰彇鍞竴缂栧彿") + @GetMapping("/getOnlyCode") + public AjaxResult getOnlyCode(@RequestParam("businessType") String businessType) { + log.info("鏌ヨ鍞竴缂栧彿绫诲瀷 锛歿}锛�" , businessType); + startPage(); + BaseOnlyvalue baseOnlyvalue = baseOnlyvalueService.getOnlyCode(businessType); + return AjaxResult.success(baseOnlyvalue); + } + + +} diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/IBaseOnlyvalueService.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/IBaseOnlyvalueService.java index 4d0adf6..81a18e0 100644 --- a/ruoyi-project/src/main/java/com/ruoyi/project/service/IBaseOnlyvalueService.java +++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/IBaseOnlyvalueService.java @@ -27,5 +27,5 @@ * @param businessType * @return */ - public String getOnlyCode(String businessType); + public BaseOnlyvalue getOnlyCode(String businessType); } diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java index 8e835ed..7934d1c 100644 --- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java +++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java @@ -49,7 +49,7 @@ @Override - public String getOnlyCode(String businessType) { + public BaseOnlyvalue getOnlyCode(String businessType) { LocalDate currentDate = LocalDate.now(); int year = currentDate.getYear(); int month = currentDate.getMonthValue(); @@ -68,7 +68,8 @@ baseOnlyvalue.setBusinesstype(businessType); save(baseOnlyvalue); - return "OPO-" + data + "1"; +// return "OPO-" + data + "1"; + return baseOnlyvalue; } else { //鍒欏皢currentValue+1,閲嶆柊璧嬪�� BaseOnlyvalue baseOnlyvalue1 = baseOnlyvalues.get(0); @@ -76,7 +77,7 @@ baseOnlyvalue1.setCurrentvalue(newCurrentvalue); updateById(baseOnlyvalue1); - return "OPO-" + data + "" + newCurrentvalue; + return baseOnlyvalue1; } } -- Gitblit v1.9.3