gongchunyi
2026-06-28 7d6b1cb01d8340c6d86fbf98fd34fe4ca822f57d
src/main/java/com/ruoyi/aftersalesservice/controller/AfterSalesServiceController.java
@@ -1,5 +1,6 @@
package com.ruoyi.aftersalesservice.controller;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.aftersalesservice.dto.AfterSalesServiceExeclDto;
@@ -97,12 +98,15 @@
    @ApiOperation("售后服务-修改")
    @Log(title = "售后服务-修改", businessType = BusinessType.UPDATE)
    public AjaxResult update(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) {
        if (afterSalesServiceNewDto.getProductModelIdList() != null && afterSalesServiceNewDto.getProductModelIdList().isEmpty() ) {
        if (afterSalesServiceNewDto.getProductModelIdList() != null && !afterSalesServiceNewDto.getProductModelIdList().isEmpty() ) {
            String productModelIds = afterSalesServiceNewDto.getProductModelIdList().stream()
                    .map(String::valueOf)
                    .collect(Collectors.joining(","));
            afterSalesServiceNewDto.setProductModelIds(productModelIds);
        }
        if (afterSalesServiceNewDto.getAfterSalesProductList() != null && !afterSalesServiceNewDto.getAfterSalesProductList().isEmpty()) {
            afterSalesServiceNewDto.setAfterSalesProducts(JSON.toJSONString(afterSalesServiceNewDto.getAfterSalesProductList()));
        }
        boolean update = afterSalesServiceService.updateById(afterSalesServiceNewDto);
        return update ? AjaxResult.success() : AjaxResult.error();
    }