diff --git a/src/main/java/com/sztzjy/trade/controller/stu/StuGoodsManageCenterController.java b/src/main/java/com/sztzjy/trade/controller/stu/StuGoodsManageCenterController.java index cba8a70..9603c98 100644 --- a/src/main/java/com/sztzjy/trade/controller/stu/StuGoodsManageCenterController.java +++ b/src/main/java/com/sztzjy/trade/controller/stu/StuGoodsManageCenterController.java @@ -2,7 +2,7 @@ package com.sztzjy.trade.controller.stu; import com.sztzjy.trade.annotation.AnonymousAccess; import com.sztzjy.trade.entity.StuGoodsCommentInfo; -import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO; +import com.sztzjy.trade.entity.dto.StuGoodsManageInfoDTO; import com.sztzjy.trade.service.StuGoodsManageCenterService; import com.sztzjy.trade.util.ResultEntity; import io.swagger.annotations.Api; @@ -51,7 +51,7 @@ public class StuGoodsManageCenterController { @ApiOperation("保存") @PostMapping("/save") @AnonymousAccess - public ResultEntity save(@RequestBody StuGoodsInfoDTO stuGoodsInfoDTO, + public ResultEntity save(@RequestBody StuGoodsManageInfoDTO stuGoodsInfoDTO, @ApiParam("商品主图片")@RequestParam(required = false) MultipartFile file, @ApiParam("轮播图集合")@RequestParam(required = false) List files){ @@ -66,7 +66,7 @@ public class StuGoodsManageCenterController { @ApiOperation("新增") @PostMapping("/add") @AnonymousAccess - public ResultEntity add(@RequestBody StuGoodsInfoDTO stuGoodsInfoDTO, + public ResultEntity add(@RequestBody StuGoodsManageInfoDTO stuGoodsInfoDTO, @ApiParam("商品主图片") MultipartFile file, @ApiParam("轮播图集合")@RequestParam(required = false) List files){ @@ -81,7 +81,7 @@ public class StuGoodsManageCenterController { @ApiOperation("编辑") @PostMapping("/update") @AnonymousAccess - public ResultEntity update(@RequestBody StuGoodsInfoDTO stuGoodsInfoDTO, + public ResultEntity update(@RequestBody StuGoodsManageInfoDTO stuGoodsInfoDTO, @ApiParam("商品主图片") MultipartFile file, @ApiParam("轮播图集合")@RequestParam(required = false) List files){ diff --git a/src/main/java/com/sztzjy/trade/entity/dto/StuGoodsInfoDTO.java b/src/main/java/com/sztzjy/trade/entity/dto/StuGoodsManageInfoDTO.java similarity index 98% rename from src/main/java/com/sztzjy/trade/entity/dto/StuGoodsInfoDTO.java rename to src/main/java/com/sztzjy/trade/entity/dto/StuGoodsManageInfoDTO.java index fc4464f..0bcb528 100644 --- a/src/main/java/com/sztzjy/trade/entity/dto/StuGoodsInfoDTO.java +++ b/src/main/java/com/sztzjy/trade/entity/dto/StuGoodsManageInfoDTO.java @@ -12,7 +12,7 @@ import java.util.List; * @date 2024/11/1 16:33 */ @Data -public class StuGoodsInfoDTO { +public class StuGoodsManageInfoDTO { @ApiModelProperty(notes = "ID") private Integer id; diff --git a/src/main/java/com/sztzjy/trade/service/StuGoodsManageCenterService.java b/src/main/java/com/sztzjy/trade/service/StuGoodsManageCenterService.java index f6919c4..88d17c4 100644 --- a/src/main/java/com/sztzjy/trade/service/StuGoodsManageCenterService.java +++ b/src/main/java/com/sztzjy/trade/service/StuGoodsManageCenterService.java @@ -3,7 +3,7 @@ package com.sztzjy.trade.service; import com.github.pagehelper.PageInfo; import com.sztzjy.trade.entity.StuGoodSalesManage; import com.sztzjy.trade.entity.StuGoodsInfo; -import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO; +import com.sztzjy.trade.entity.dto.StuGoodsManageInfoDTO; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -17,11 +17,11 @@ public interface StuGoodsManageCenterService { PageInfo getGoodsSalesManagementList(String userId, Integer index, Integer size); - Integer save(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List files); + Integer save(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List files); - Integer add(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List files); + Integer add(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List files); - Integer update(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List files); + Integer update(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List files); Integer remove(Integer id); diff --git a/src/main/java/com/sztzjy/trade/service/impl/StuGoodsManageCenterServiceImpl.java b/src/main/java/com/sztzjy/trade/service/impl/StuGoodsManageCenterServiceImpl.java index 0fdd729..252a5b8 100644 --- a/src/main/java/com/sztzjy/trade/service/impl/StuGoodsManageCenterServiceImpl.java +++ b/src/main/java/com/sztzjy/trade/service/impl/StuGoodsManageCenterServiceImpl.java @@ -3,7 +3,7 @@ package com.sztzjy.trade.service.impl; import com.github.pagehelper.PageInfo; import com.sztzjy.trade.config.exception.handler.ServiceException; import com.sztzjy.trade.entity.*; -import com.sztzjy.trade.entity.dto.StuGoodsInfoDTO; +import com.sztzjy.trade.entity.dto.StuGoodsManageInfoDTO; import com.sztzjy.trade.mapper.StuGoodsInfoMapper; import com.sztzjy.trade.mapper.StuGoodsPromotionPricingMapper; import com.sztzjy.trade.mapper.StuGoodsSalesManageMapper; @@ -58,7 +58,7 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ } @Override - public Integer save(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List files) { + public Integer save(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List files) { //主图片上传 String upload=""; @@ -68,7 +68,7 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ stuGoodsInfoDTO.setGoodsMainImage(upload); //轮播图批量上传 - StuGoodsInfoDTO stuGoodsInfoDTO1=new StuGoodsInfoDTO(); + StuGoodsManageInfoDTO stuGoodsInfoDTO1=new StuGoodsManageInfoDTO(); if(!files.isEmpty()){ stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files); } @@ -134,13 +134,13 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ } @Override - public Integer add(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List files) { + public Integer add(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List files) { //主图片上传 String upload= fileUtil.upload(file); stuGoodsInfoDTO.setGoodsMainImage(upload); //轮播图批量上传 - StuGoodsInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files); + StuGoodsManageInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files); //关键词拼接 String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword()); @@ -200,13 +200,13 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ } @Override - public Integer update(StuGoodsInfoDTO stuGoodsInfoDTO, MultipartFile file, List files) { + public Integer update(StuGoodsManageInfoDTO stuGoodsInfoDTO, MultipartFile file, List files) { //主图片上传 String upload= fileUtil.upload(file); stuGoodsInfoDTO.setGoodsMainImage(upload); //轮播图批量上传 - StuGoodsInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files); + StuGoodsManageInfoDTO stuGoodsInfoDTO1 = insertBatch(stuGoodsInfoDTO, files); //关键词拼接 String join = String.join(",", stuGoodsInfoDTO1.getProductKeyword()); @@ -300,7 +300,7 @@ public class StuGoodsManageCenterServiceImpl implements StuGoodsManageCenterServ * @param stuGoodsInfoDTO * @param files */ - private StuGoodsInfoDTO insertBatch(StuGoodsInfoDTO stuGoodsInfoDTO, List files) { + private StuGoodsManageInfoDTO insertBatch(StuGoodsManageInfoDTO stuGoodsInfoDTO, List files) { StringBuilder imageUpload = new StringBuilder(); for (int i = 0; i < files.size(); i++) { String upload = fileUtil.upload(files.get(i)); diff --git a/src/main/java/com/sztzjy/trade/service/impl/StuGoodsTradingCenterServiceImpl.java b/src/main/java/com/sztzjy/trade/service/impl/StuGoodsTradingCenterServiceImpl.java index 5def4d6..f1f0f52 100644 --- a/src/main/java/com/sztzjy/trade/service/impl/StuGoodsTradingCenterServiceImpl.java +++ b/src/main/java/com/sztzjy/trade/service/impl/StuGoodsTradingCenterServiceImpl.java @@ -213,8 +213,7 @@ public class StuGoodsTradingCenterServiceImpl implements StuGoodsTradingCenterSe } // TODO: 2024/10/28 3、生成订单信息并删除所结算商品在购物车中的信息,商品管理信息更新 - for (StuShoppingCartInfo stuShoppingCartInfo:shoppingCartInfos) { - //生成订单信息 + for (StuShoppingCartInfo stuShoppingCartInfo:shoppingCartInfos) {//生成订单信息 StuGoodsOrderInfo stuGoodsOrderInfo=new StuGoodsOrderInfo(); //赋值 Integer uuid= UUID.randomUUID().toString().replaceAll("-","").hashCode();