无关风月
2025-01-09 1e2d55b9f92cebfc9909e83e09478c864fa11ca0
manage/src/main/java/com/jilongda/manage/controller/TOrderAftersalesController.java
@@ -17,6 +17,7 @@
import com.jilongda.manage.vo.TOrderAftersalesVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
@@ -68,6 +69,11 @@
    @ApiOperation(value = "订单售后添加")
    @PostMapping(value = "/add")
    public ApiResult<String> add(@RequestBody TOrderAftersales dto) {
        List<TOrderAftersales> list = orderAftersalesService.lambdaQuery()
                .eq(TOrderAftersales::getOrderId, dto.getOrderId()).list();
        if (!list.isEmpty()){
            return ApiResult.failed("该订单已售后,不可再次操作!");
        }
        dto.setCode(WarehousingConstant.ASTER_SALES+ CodeGenerateUtils.generateVolumeSn());
        orderAftersalesService.save(dto);
        return ApiResult.success();
@@ -81,9 +87,10 @@
        SecUser byId3 = secUserService.getById(byId.getSysId());
        TOptometrist byId5 = tOptometristService.getById(byId.getOptometristId());
        TOrderAftersalesDetailVO res = new TOrderAftersalesDetailVO();
        BeanUtils.copyProperties(byId,res);
        res.setOrderId(byId1.getId());
        if (byId1.getUserId()!=null){
            TAppUser byId4 = appUserService.getById(byId1);
            TAppUser byId4 = appUserService.getById(byId1.getUserId());
            if (byId4!=null){
                res.setPhone(byId4.getPhone());
                res.setName(byId4.getName());