From a54e249f9fedf3633825dd7a6846621df7b110b9 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 18 十月 2023 12:00:55 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java |   43 +++++++++++++++++++++++++------------------
 1 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
index 2d89c9d..9e9700e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
@@ -1,9 +1,15 @@
 package com.ruoyi.web.controller.project;
 
 import java.util.Arrays;
+import java.util.Calendar;
 import java.util.List;
+
+import com.ruoyi.project.domain.BaseOnlyvalue;
+import com.ruoyi.project.service.IBaseOnlyvalueService;
+import com.ruoyi.web.controller.common.OnlyValueCommon;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -24,24 +30,28 @@
 
 /**
  * 澶栧洿鍗曚綅浜哄憳Controller
- * 
+ *
  * @author ruoyi
  * @date 2021-11-24
  */
 @RestController
 @RequestMapping("/project/externalperson")
-public class ServiceExternalpersonController extends BaseController
-{
+public class ServiceExternalpersonController extends BaseController {
     @Autowired
     private IServiceExternalpersonService serviceExternalpersonService;
+
+    @Autowired
+    private IBaseOnlyvalueService baseOnlyvalueService;
+
+    @Autowired
+    private OnlyValueCommon onlyValueCommon;
 
     /**
      * 鏌ヨ澶栧洿鍗曚綅浜哄憳鍒楄〃
      */
     //@PreAuthorize("@ss.hasPermi('project:externalperson:list')")
     @GetMapping("/list")
-    public TableDataInfo list(ServiceExternalperson serviceExternalperson)
-    {
+    public TableDataInfo list(ServiceExternalperson serviceExternalperson) {
         startPage();
         List<ServiceExternalperson> list = serviceExternalpersonService.queryList(serviceExternalperson);
         return getDataTable(list);
@@ -53,8 +63,7 @@
     //@PreAuthorize("@ss.hasPermi('project:externalperson:export')")
     @Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(ServiceExternalperson serviceExternalperson)
-    {
+    public AjaxResult export(ServiceExternalperson serviceExternalperson) {
         List<ServiceExternalperson> list = serviceExternalpersonService.queryList(serviceExternalperson);
         ExcelUtil<ServiceExternalperson> util = new ExcelUtil<ServiceExternalperson>(ServiceExternalperson.class);
         return util.exportExcel(list, "澶栧洿鍗曚綅浜哄憳鏁版嵁");
@@ -65,8 +74,7 @@
      */
     //@PreAuthorize("@ss.hasPermi('project:externalperson:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(serviceExternalpersonService.getById(id));
     }
 
@@ -77,8 +85,10 @@
     @Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.INSERT)
     @PostMapping
     @RepeatSubmit
-    public AjaxResult add(@RequestBody ServiceExternalperson serviceExternalperson)
-    {
+    public AjaxResult add(@RequestBody ServiceExternalperson serviceExternalperson) {
+        String zj = onlyValueCommon.addOnlyValue("zj");
+        String formattedNumber = String.format("%05d", zj);
+        serviceExternalperson.setUserno(formattedNumber);
         return toAjax(serviceExternalpersonService.save(serviceExternalperson));
     }
 
@@ -88,9 +98,8 @@
     //@PreAuthorize("@ss.hasPermi('project:externalperson:edit')")
     @Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.UPDATE)
     @PostMapping("/editZJInfo")
-    @RepeatSubmit    
-    public AjaxResult edit(@RequestBody ServiceExternalperson serviceExternalperson)
-    {
+    @RepeatSubmit
+    public AjaxResult edit(@RequestBody ServiceExternalperson serviceExternalperson) {
         return toAjax(serviceExternalpersonService.updateById(serviceExternalperson));
     }
 
@@ -100,8 +109,7 @@
     //@PreAuthorize("@ss.hasPermi('project:externalperson:remove')")
     @Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(serviceExternalpersonService.removeByIds(Arrays.asList(ids)));
     }
 
@@ -111,8 +119,7 @@
      */
 
     @GetMapping(value = "/getInfoByUserNo/{userno}")
-    public AjaxResult getInfoByUserNo(@PathVariable("userno") String userno)
-    {
+    public AjaxResult getInfoByUserNo(@PathVariable("userno") String userno) {
         return AjaxResult.success(serviceExternalpersonService.getInfoByUserNo(userno));
     }
 }

--
Gitblit v1.9.3