From 48e8e81666b2d0f49b931cb7b93729355758f2ae Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 24 九月 2026 19:24:02 +0800
Subject: [PATCH] fix(aftersalesservice): 解决售后工单查询中的空指针异常
---
src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java | 42 +++++++++++++++++++++++++++++-------------
1 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
index abb8797..639fd79 100644
--- a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
+++ b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.aftersalesservice.dto.AfterSalesServiceExeclDto;
+import com.ruoyi.aftersalesservice.dto.AfterSalesServiceImportDto;
import com.ruoyi.aftersalesservice.dto.AfterSalesServiceNewDto;
import com.ruoyi.aftersalesservice.pojo.AfterSalesService;
import com.ruoyi.aftersalesservice.service.AfterSalesServiceService;
@@ -15,9 +16,10 @@
import com.ruoyi.project.system.mapper.SysUserMapper;
import com.ruoyi.sales.dto.SalesLedgerDto;
import com.ruoyi.sales.service.ISalesLedgerService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.web.multipart.MultipartFile;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
@@ -32,7 +34,7 @@
* @date : 2025/7/30 9:27
*/
@RestController
-@Api(tags = "鍞悗鏈嶅姟")
+@Tag(name = "鍞悗鏈嶅姟")
@RequestMapping("/afterSalesService")
@AllArgsConstructor
public class AfterSalesServiceController extends BaseController {
@@ -43,7 +45,7 @@
private ISalesLedgerService salesLedgerService;
@GetMapping("/listPage")
- @ApiOperation("鍞悗鏈嶅姟-鍒嗛〉鏌ヨ")
+ @Operation(summary = "鍞悗鏈嶅姟-鍒嗛〉鏌ヨ")
@Log(title = "鍞悗鏈嶅姟-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
public AjaxResult listPage(Page page, AfterSalesServiceNewDto afterSalesService) {
IPage<AfterSalesServiceNewDto> listPage = afterSalesServiceService.listPage(page, afterSalesService);
@@ -52,7 +54,7 @@
@Log(title = "鍞悗鏈嶅姟-鍙嶉鐧昏", businessType = BusinessType.EXPORT)
@PostMapping("/export")
- @ApiOperation("鍞悗鏈嶅姟-鍙嶉鐧昏")
+ @Operation(summary = "鍞悗鏈嶅姟-鍙嶉鐧昏")
public void export(HttpServletResponse response) {
Page page = new Page(-1,-1);
AfterSalesServiceNewDto afterSalesService = new AfterSalesServiceNewDto();
@@ -70,7 +72,7 @@
@Log(title = "鍞悗鏈嶅姟-鍞悗澶勭悊", businessType = BusinessType.EXPORT)
@PostMapping("/exportTwo")
- @ApiOperation("鍞悗鏈嶅姟-鍞悗澶勭悊")
+ @Operation(summary = "鍞悗鏈嶅姟-鍞悗澶勭悊")
public void exportTwo(HttpServletResponse response) {
Page page = new Page(-1,-1);
AfterSalesServiceNewDto afterSalesService = new AfterSalesServiceNewDto();
@@ -83,14 +85,14 @@
}
@PostMapping("/add")
- @ApiOperation("鍞悗鏈嶅姟-鏂板")
+ @Operation(summary = "鍞悗鏈嶅姟-鏂板")
@Log(title = "鍞悗鏈嶅姟-鏂板", businessType = BusinessType.INSERT)
public AjaxResult add(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
return afterSalesServiceService.addAfterSalesServiceDto(afterSalesServiceNewDto) ? AjaxResult.success() : AjaxResult.error();
}
@PostMapping("/update")
- @ApiOperation("鍞悗鏈嶅姟-淇敼")
+ @Operation(summary = "鍞悗鏈嶅姟-淇敼")
@Log(title = "鍞悗鏈嶅姟-淇敼", businessType = BusinessType.UPDATE)
public AjaxResult update(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
if (afterSalesServiceNewDto.getProductModelIdList() != null && afterSalesServiceNewDto.getProductModelIdList().isEmpty() ) {
@@ -104,7 +106,7 @@
}
@DeleteMapping("/delete")
- @ApiOperation("鍞悗鏈嶅姟-鍒犻櫎")
+ @Operation(summary = "鍞悗鏈嶅姟-鍒犻櫎")
@Log(title = "鍞悗鏈嶅姟-鍒犻櫎", businessType = BusinessType.DELETE)
public AjaxResult delete(@RequestBody List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
@@ -115,7 +117,7 @@
}
@PostMapping("/dispose")
- @ApiOperation("鍞悗鏈嶅姟-澶勭悊")
+ @Operation(summary = "鍞悗鏈嶅姟-澶勭悊")
@Log(title = "鍞悗鏈嶅姟-澶勭悊", businessType = BusinessType.UPDATE)
public AjaxResult dispose(@RequestBody AfterSalesService afterSalesService) {
AfterSalesService byId = afterSalesServiceService.getById(afterSalesService.getId());
@@ -131,7 +133,7 @@
@GetMapping("listSalesLedger")
- @ApiOperation("鍞悗鏈嶅姟-鑾峰彇閿�鍞彴璐�")
+ @Operation(summary = "鍞悗鏈嶅姟-鑾峰彇閿�鍞彴璐�")
public AjaxResult listSalesLedger(SalesLedgerDto salesLedgerDto, Page page) {
IPage<SalesLedgerDto> list = salesLedgerService.listSalesLedger(salesLedgerDto,page);
return AjaxResult.success(list);
@@ -139,15 +141,29 @@
@GetMapping("getById")
- @ApiOperation("鍞悗鏈嶅姟-鏍规嵁id鑾峰彇璇︽儏")
+ @Operation(summary = "鍞悗鏈嶅姟-鏍规嵁id鑾峰彇璇︽儏")
public AjaxResult getById(Long id) {
return AjaxResult.success(afterSalesServiceService.getAfterSalesServiceNewDtoById(id));
}
- @ApiOperation("鍞悗鏈嶅姟-缁熻宸ュ崟鎯呭喌")
+ @Operation(summary = "鍞悗鏈嶅姟-缁熻宸ュ崟鎯呭喌")
@GetMapping("count")
public AjaxResult count() {
return AjaxResult.success(afterSalesServiceService.countAfterSalesService());
}
+ @PostMapping("/import")
+ @Operation(summary = "鍞悗鏈嶅姟-鍙嶉鐧昏瀵煎叆")
+ @Log(title = "鍞悗鏈嶅姟-鍙嶉鐧昏瀵煎叆", businessType = BusinessType.IMPORT)
+ public AjaxResult importData(MultipartFile file) {
+ return afterSalesServiceService.importData(file);
+ }
+
+ @PostMapping("/importTemplate")
+ @Operation(summary = "鍞悗鏈嶅姟-鍙嶉鐧昏瀵煎叆妯℃澘")
+ public void importTemplate(HttpServletResponse response) {
+ ExcelUtil<AfterSalesServiceImportDto> util = new ExcelUtil<AfterSalesServiceImportDto>(AfterSalesServiceImportDto.class);
+ util.importTemplateExcel(response, "鍙嶉鐧昏瀵煎叆妯℃澘");
+ }
+
}
--
Gitblit v1.9.3