From d06ef3f44d6dc19dae223ab420165369ea13cc16 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 20 五月 2026 16:29:35 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New_pro
---
src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java | 72 +++++++++++++++++-------------------
1 files changed, 34 insertions(+), 38 deletions(-)
diff --git a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
index 95e9999..0c424fb 100644
--- a/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
+++ b/src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
@@ -10,19 +10,19 @@
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
import com.ruoyi.project.system.domain.SysUser;
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 lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
-import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -32,31 +32,27 @@
* @date : 2025/7/30 9:27
*/
@RestController
-@Api(tags = "鍞悗鏈嶅姟")
+@Tag(name = "鍞悗鏈嶅姟")
@RequestMapping("/afterSalesService")
+@AllArgsConstructor
public class AfterSalesServiceController extends BaseController {
- @Autowired
private AfterSalesServiceService afterSalesServiceService;
-
- @Autowired
private SysUserMapper sysUserMapper;
-
- @Autowired
private ISalesLedgerService salesLedgerService;
@GetMapping("/listPage")
- @ApiOperation("鍞悗鏈嶅姟-鍒嗛〉鏌ヨ")
+ @Operation(summary = "鍞悗鏈嶅姟-鍒嗛〉鏌ヨ")
@Log(title = "鍞悗鏈嶅姟-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
- public AjaxResult listPage(Page page, AfterSalesServiceNewDto afterSalesService) {
+ public R<?> listPage(Page page, AfterSalesServiceNewDto afterSalesService) {
IPage<AfterSalesServiceNewDto> listPage = afterSalesServiceService.listPage(page, afterSalesService);
- return AjaxResult.success(listPage);
+ return R.ok(listPage);
}
@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();
@@ -74,7 +70,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();
@@ -87,16 +83,16 @@
}
@PostMapping("/add")
- @ApiOperation("鍞悗鏈嶅姟-鏂板")
+ @Operation(summary = "鍞悗鏈嶅姟-鏂板")
@Log(title = "鍞悗鏈嶅姟-鏂板", businessType = BusinessType.INSERT)
- public AjaxResult add(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
- return afterSalesServiceService.addAfterSalesServiceDto(afterSalesServiceNewDto) ? AjaxResult.success() : AjaxResult.error();
+ public R<?> add(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
+ return afterSalesServiceService.addAfterSalesServiceDto(afterSalesServiceNewDto) ? R.ok() : R.fail();
}
@PostMapping("/update")
- @ApiOperation("鍞悗鏈嶅姟-淇敼")
+ @Operation(summary = "鍞悗鏈嶅姟-淇敼")
@Log(title = "鍞悗鏈嶅姟-淇敼", businessType = BusinessType.UPDATE)
- public AjaxResult update(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
+ public R<?> update(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
if (afterSalesServiceNewDto.getProductModelIdList() != null && afterSalesServiceNewDto.getProductModelIdList().isEmpty() ) {
String productModelIds = afterSalesServiceNewDto.getProductModelIdList().stream()
.map(String::valueOf)
@@ -104,24 +100,24 @@
afterSalesServiceNewDto.setProductModelIds(productModelIds);
}
boolean update = afterSalesServiceService.updateById(afterSalesServiceNewDto);
- return update ? AjaxResult.success() : AjaxResult.error();
+ return update ? R.ok() : R.fail();
}
@DeleteMapping("/delete")
- @ApiOperation("鍞悗鏈嶅姟-鍒犻櫎")
+ @Operation(summary = "鍞悗鏈嶅姟-鍒犻櫎")
@Log(title = "鍞悗鏈嶅姟-鍒犻櫎", businessType = BusinessType.DELETE)
- public AjaxResult delete(@RequestBody List<Long> ids) {
+ public R<?> delete(@RequestBody List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
- return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+ return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
}
boolean delete = afterSalesServiceService.removeByIds(ids);
- return delete ? AjaxResult.success() : AjaxResult.error();
+ return delete ? R.ok() : R.fail();
}
@PostMapping("/dispose")
- @ApiOperation("鍞悗鏈嶅姟-澶勭悊")
+ @Operation(summary = "鍞悗鏈嶅姟-澶勭悊")
@Log(title = "鍞悗鏈嶅姟-澶勭悊", businessType = BusinessType.UPDATE)
- public AjaxResult dispose(@RequestBody AfterSalesService afterSalesService) {
+ public R<?> dispose(@RequestBody AfterSalesService afterSalesService) {
AfterSalesService byId = afterSalesServiceService.getById(afterSalesService.getId());
if(byId == null) throw new RuntimeException("鏈壘鍒拌鏁版嵁");
if(byId.getStatus().equals(2)) throw new RuntimeException("璇ユ暟鎹凡澶勭悊");
@@ -130,28 +126,28 @@
afterSalesService.setDisposeNickName(sysUser.getNickName());
afterSalesService.setStatus(2);
boolean update = afterSalesServiceService.updateById(afterSalesService);
- return update ? AjaxResult.success() : AjaxResult.error();
+ return update ? R.ok() : R.fail();
}
@GetMapping("listSalesLedger")
- @ApiOperation("鍞悗鏈嶅姟-鑾峰彇閿�鍞彴璐�")
- public AjaxResult listSalesLedger(SalesLedgerDto salesLedgerDto, Page page) {
+ @Operation(summary = "鍞悗鏈嶅姟-鑾峰彇閿�鍞彴璐�")
+ public R<?> listSalesLedger(SalesLedgerDto salesLedgerDto, Page page) {
IPage<SalesLedgerDto> list = salesLedgerService.listSalesLedger(salesLedgerDto,page);
- return AjaxResult.success(list);
+ return R.ok(list);
}
@GetMapping("getById")
- @ApiOperation("鍞悗鏈嶅姟-鏍规嵁id鑾峰彇璇︽儏")
- public AjaxResult getById(Long id) {
- return AjaxResult.success(afterSalesServiceService.getAfterSalesServiceNewDtoById(id));
+ @Operation(summary = "鍞悗鏈嶅姟-鏍规嵁id鑾峰彇璇︽儏")
+ public R<?> getById(Long id) {
+ return R.ok(afterSalesServiceService.getAfterSalesServiceNewDtoById(id));
}
- @ApiOperation("鍞悗鏈嶅姟-缁熻宸ュ崟鎯呭喌")
+ @Operation(summary = "鍞悗鏈嶅姟-缁熻宸ュ崟鎯呭喌")
@GetMapping("count")
- public AjaxResult count() {
- return AjaxResult.success(afterSalesServiceService.countAfterSalesService());
+ public R<?> count() {
+ return R.ok(afterSalesServiceService.countAfterSalesService());
}
}
--
Gitblit v1.9.3