Sfoglia il codice sorgente

Merge branch 'dev-wgk' of www/als into master

www 4 mesi fa
parent
commit
3e79ebbf75

+ 0 - 137
als-modules/agile-assurance/src/main/java/org/eco/als/controller/ContactsController.java

@@ -1,137 +0,0 @@
-package org.eco.als.controller;
-
-import cn.dev33.satoken.annotation.SaCheckPermission;
-import cn.hutool.core.collection.CollUtil;
-import jakarta.annotation.Resource;
-import jakarta.servlet.http.HttpServletResponse;
-import lombok.RequiredArgsConstructor;
-import org.eco.als.domain.bo.ContactsBo;
-import org.eco.als.domain.vo.ContactsImportVo;
-import org.eco.als.domain.vo.ContactsVo;
-import org.eco.als.service.IContactsService;
-import org.eco.common.core.core.domain.CommonResult;
-import org.eco.common.core.core.domain.model.LoginUser;
-import org.eco.common.core.core.page.PageResult;
-import org.eco.common.excel.utils.ExcelUtil;
-import org.eco.common.log.annotation.Log;
-import org.eco.common.log.enums.BusinessType;
-import org.eco.common.security.utils.LoginHelper;
-import org.eco.common.web.annotation.RepeatSubmit;
-import org.eco.common.web.core.BaseController;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 通讯录Controller
- *
- * @author wgk
- * @date 2024-11-25
- */
-@Validated
-@RequiredArgsConstructor
-@RestController
-@RequestMapping("/als/contacts")
-public class ContactsController extends BaseController {
-    @Resource
-    private IContactsService contactsService;
-
-    /**
-     * 查询通讯录列表
-     */
-    @SaCheckPermission("als:contacts:list")
-    @GetMapping("/list")
-    public CommonResult<PageResult<ContactsVo>> list(ContactsBo contactsBo) {
-        return CommonResult.success(contactsService.selectPage(contactsBo));
-    }
-
-    /**
-     * 导出通讯录列表
-     */
-    @SaCheckPermission("als:contacts:export")
-    @Log(title = "通讯录", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public CommonResult<Void> export(ContactsBo contactsBo) {
-        LoginUser loginUser = LoginHelper.getLoginUser();
-        List<ContactsVo> list = contactsService.selectList(contactsBo);
-        if (CollUtil.isEmpty(list)) {
-            return CommonResult.fail("导出列表为空");
-        }
-        contactsService.asyncExport(list, "通讯录", loginUser);
-        return CommonResult.success();
-    }
-
-    @SaCheckPermission("als:contacts:import")
-    @PostMapping("/importTemplate")
-    public void importTemplate(HttpServletResponse response) {
-        ExcelUtil.exportExcel(new ArrayList<>(), "通讯录", ContactsImportVo.class, response);
-    }
-
-    /**
-     * 导入通讯录列表
-     */
-    @Log(title = "通讯录", businessType = BusinessType.IMPORT)
-    @SaCheckPermission("als:contacts:import")
-    @PostMapping("/importData")
-    public CommonResult<Void> importData(MultipartFile file, boolean updateSupport) {
-        LoginUser loginUser = LoginHelper.getLoginUser();
-        contactsService.asyncImportData(file, updateSupport, loginUser);
-        return CommonResult.success();
-    }
-
-    /**
-     * 获取通讯录详细信息
-     */
-    @SaCheckPermission("als:contacts:query")
-    @GetMapping(value = "/{id}")
-    public CommonResult<ContactsVo> getInfo(@PathVariable Long id) {
-        return CommonResult.success(contactsService.selectById(id));
-    }
-
-    /**
-     * 新增通讯录
-     */
-    @SaCheckPermission("als:contacts:add")
-    @Log(title = "通讯录", businessType = BusinessType.INSERT)
-    @RepeatSubmit()
-    @PostMapping
-    public CommonResult<Void> add(@Validated @RequestBody ContactsBo contactsBo) {
-        boolean inserted = contactsService.insert(contactsBo);
-        if (!inserted) {
-            return CommonResult.fail("新增通讯录记录失败!");
-        }
-        return CommonResult.success();
-    }
-
-    /**
-     * 修改通讯录
-     */
-    @SaCheckPermission("als:contacts:edit")
-    @Log(title = "通讯录", businessType = BusinessType.UPDATE)
-    @RepeatSubmit()
-    @PutMapping
-    public CommonResult<Void> edit(@Validated @RequestBody ContactsBo contactsBo) {
-        boolean updated = contactsService.update(contactsBo);
-        if (!updated) {
-            return CommonResult.fail("修改通讯录记录失败!");
-        }
-        return CommonResult.success();
-    }
-
-    /**
-     * 删除通讯录
-     */
-    @SaCheckPermission("als:contacts:remove")
-    @Log(title = "通讯录", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public CommonResult<Void> remove(@PathVariable Long[] ids) {
-        boolean deleted = contactsService.deleteByIds(ids);
-        if (!deleted) {
-            return CommonResult.fail("删除通讯录记录失败!");
-        }
-        return CommonResult.success();
-    }
-}

+ 21 - 21
als-modules/agile-assurance/src/main/java/org/eco/als/controller/JudgeFaultLogicController.java

@@ -1,29 +1,29 @@
 package org.eco.als.controller;
 
-import lombok.RequiredArgsConstructor;
-import jakarta.servlet.http.HttpServletResponse;
-import cn.hutool.core.collection.CollUtil;
 import cn.dev33.satoken.annotation.SaCheckPermission;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.validation.annotation.Validated;
+import cn.hutool.core.collection.CollUtil;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
+import org.eco.als.domain.bo.JudgeFaultLogicBo;
+import org.eco.als.domain.vo.JudgeFaultLogicImportVo;
+import org.eco.als.domain.vo.JudgeFaultLogicVo;
+import org.eco.als.service.IJudgeFaultLogicService;
 import org.eco.common.core.core.domain.CommonResult;
+import org.eco.common.core.core.domain.model.LoginUser;
+import org.eco.common.core.core.page.PageResult;
+import org.eco.common.excel.utils.ExcelUtil;
 import org.eco.common.log.annotation.Log;
 import org.eco.common.log.enums.BusinessType;
 import org.eco.common.security.utils.LoginHelper;
-import org.eco.common.core.core.domain.model.LoginUser;
 import org.eco.common.web.annotation.RepeatSubmit;
-import org.eco.common.excel.utils.ExcelUtil;
 import org.eco.common.web.core.BaseController;
-import jakarta.annotation.Resource;
-import org.eco.als.domain.vo.JudgeFaultLogicImportVo;
-import org.eco.als.domain.vo.JudgeFaultLogicVo;
-import org.eco.als.domain.bo.JudgeFaultLogicBo;
-import org.eco.als.service.IJudgeFaultLogicService;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-    import org.eco.common.core.core.page.PageResult;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 判故逻辑Controller
@@ -39,11 +39,11 @@ public class JudgeFaultLogicController extends BaseController {
     @Resource
     private IJudgeFaultLogicService judgeFaultLogicService;
 
-/**
- * 查询判故逻辑列表
- */
-@SaCheckPermission("als:judgeFaultLogic:list")
-@GetMapping("/list")
+    /**
+     * 查询判故逻辑列表
+     */
+    @SaCheckPermission("als:judgeFaultLogic:list")
+    @GetMapping("/list")
     public CommonResult<PageResult<JudgeFaultLogicVo>> list(JudgeFaultLogicBo judgeFaultLogicBo) {
         return CommonResult.success(judgeFaultLogicService.selectPage(judgeFaultLogicBo));
     }
@@ -60,7 +60,7 @@ public class JudgeFaultLogicController extends BaseController {
         if (CollUtil.isEmpty(list)) {
             return CommonResult.fail("导出列表为空");
         }
-            judgeFaultLogicService.asyncExport(list, "判故逻辑", loginUser);
+        judgeFaultLogicService.asyncExport(list, "判故逻辑", loginUser);
         return CommonResult.success();
     }
 
@@ -78,7 +78,7 @@ public class JudgeFaultLogicController extends BaseController {
     @PostMapping("/importData")
     public CommonResult<Void> importData(MultipartFile file, boolean updateSupport) {
         LoginUser loginUser = LoginHelper.getLoginUser();
-            judgeFaultLogicService.asyncImportData(file, updateSupport, loginUser);
+        judgeFaultLogicService.asyncImportData(file, updateSupport, loginUser);
         return CommonResult.success();
     }
 

+ 19 - 24
als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifetimeSparePartsController.java

@@ -1,35 +1,30 @@
 package org.eco.als.controller;
 
-import lombok.RequiredArgsConstructor;
-import jakarta.servlet.http.HttpServletResponse;
-import cn.hutool.core.collection.CollUtil;
 import cn.dev33.satoken.annotation.SaCheckPermission;
-import org.eco.als.domain.bo.FaultStatisticsBo;
-import org.eco.als.domain.vo.FaultStatisticsImportVo;
-import org.eco.als.domain.vo.FaultStatisticsVo;
-import org.eco.als.listener.FaultStatisticsImportListener;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
+import org.eco.als.domain.bo.LifetimeSparePartsBo;
+import org.eco.als.domain.vo.LifetimeSparePartsImportVo;
+import org.eco.als.domain.vo.LifetimeSparePartsVo;
 import org.eco.als.listener.LifetimeSparePartsImportListener;
-import org.eco.common.excel.core.ExcelResult;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.validation.annotation.Validated;
+import org.eco.als.service.ILifetimeSparePartsService;
 import org.eco.common.core.core.domain.CommonResult;
+import org.eco.common.core.core.domain.model.LoginUser;
+import org.eco.common.core.core.page.PageResult;
+import org.eco.common.excel.core.ExcelResult;
+import org.eco.common.excel.utils.ExcelUtil;
 import org.eco.common.log.annotation.Log;
 import org.eco.common.log.enums.BusinessType;
 import org.eco.common.security.utils.LoginHelper;
-import org.eco.common.core.core.domain.model.LoginUser;
 import org.eco.common.web.annotation.RepeatSubmit;
-import org.eco.common.excel.utils.ExcelUtil;
 import org.eco.common.web.core.BaseController;
-import jakarta.annotation.Resource;
-import org.eco.als.domain.vo.LifetimeSparePartsImportVo;
-import org.eco.als.domain.vo.LifetimeSparePartsVo;
-import org.eco.als.domain.bo.LifetimeSparePartsBo;
-import org.eco.als.service.ILifetimeSparePartsService;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-    import org.eco.common.core.core.page.PageResult;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 有寿件Controller
@@ -45,11 +40,11 @@ public class LifetimeSparePartsController extends BaseController {
     @Resource
     private ILifetimeSparePartsService lifetimeSparePartsService;
 
-/**
- * 查询有寿件列表
- */
-@SaCheckPermission("als:lifetimeSpareParts:list")
-@GetMapping("/list")
+    /**
+     * 查询有寿件列表
+     */
+    @SaCheckPermission("als:lifetimeSpareParts:list")
+    @GetMapping("/list")
     public CommonResult<PageResult<LifetimeSparePartsVo>> list(LifetimeSparePartsBo lifetimeSparePartsBo) {
         return CommonResult.success(lifetimeSparePartsService.selectPage(lifetimeSparePartsBo));
     }