| | |
| | | |
| | | import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.order.aftersale.entity.dos.AfterSale; |
| | | import cn.lili.modules.order.aftersale.entity.vo.AfterSaleSearchParams; |
| | | import cn.lili.modules.order.aftersale.entity.vo.AfterSaleVO; |
| | | import cn.lili.modules.order.aftersale.mapper.AfterSaleMapper; |
| | | import cn.lili.modules.order.aftersale.service.AfterSaleService; |
| | | import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO; |
| | | import cn.lili.modules.system.entity.vo.Traces; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Autowired |
| | | private AfterSaleService afterSaleService; |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @ApiOperation(value = "分页获取售后服务") |
| | | @GetMapping(value = "/page") |
| | | public ResultMessage<IPage<AfterSaleVO>> getByPage(AfterSaleSearchParams searchParams) { |
| | | return ResultUtil.data(afterSaleService.getAfterSalePages(searchParams)); |
| | | IPage<AfterSaleVO> afterSalePages = afterSaleService.getAfterSalePages(searchParams); |
| | | for (AfterSaleVO record : afterSalePages.getRecords()) { |
| | | if (StringUtils.isNotBlank(record.getGoodsImage())&&!record.getGoodsImage().contains("http")) { |
| | | record.setGoodsImage(cosUtil.getPreviewUrl(record.getGoodsImage())); |
| | | } |
| | | } |
| | | return ResultUtil.data(afterSalePages); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取导出售后服务列表列表") |
| | |
| | | @ApiImplicitParam(name = "sn", value = "售后单号", required = true, paramType = "path") |
| | | @GetMapping(value = "/get/{sn}") |
| | | public ResultMessage<AfterSaleVO> get(@NotNull(message = "售后单号") @PathVariable("sn") String sn) { |
| | | return ResultUtil.data(afterSaleService.getAfterSale(sn)); |
| | | AfterSaleVO afterSale = afterSaleService.getAfterSale(sn); |
| | | String afterSaleImage = afterSale.getAfterSaleImage(); |
| | | if (StringUtils.isNotBlank(afterSaleImage)) { |
| | | String[] split = afterSaleImage.split(","); |
| | | List<String> asleImages = new ArrayList<>(split.length); |
| | | for (String s : split) { |
| | | if (!s.contains("http")){ |
| | | asleImages.add(cosUtil.getPreviewUrl(s)); |
| | | } |
| | | } |
| | | String join = String.join(",", asleImages); |
| | | afterSale.setAfterSaleImage(join); |
| | | } |
| | | if (StringUtils.isNotBlank(afterSale.getGoodsImage())&&!afterSale.getGoodsImage().contains("http")) { |
| | | afterSale.setGoodsImage(cosUtil.getPreviewUrl(afterSale.getGoodsImage())); |
| | | } |
| | | return ResultUtil.data(afterSale); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看买家退货物流踪迹") |