2024/12/5

1127/gaoxueci
gao 2024-12-05 10:44:14 +08:00
parent d5f46c781b
commit 6866d3185d
25 changed files with 114 additions and 78 deletions

View File

@ -49,6 +49,10 @@ public class ActivityTeamInfoListModel {
* *
*/ */
private String productImage; private String productImage;
/**
* id
*/
private Long productId;
/** /**
* *
*/ */
@ -72,20 +76,6 @@ public class ActivityTeamInfoListModel {
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) { public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
.id(activityTeamInfo.getId())
.name(activityTeamInfo.getName())
// .openTeamNumber(teamOpenTypeNumber)
// .addTeamNumber(teamInTypeNumber)
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
.endTime(activityTeamInfo.getEndTime())
.productImage(activityTeamInfo.getProductImage())
// .teamPrice(discountPrice.getTeamPrice())
// .productPrice(discountPrice.getProductPrice())
// .teamStock(teamProductStockModel.getTeamStock())
// .remainStock(teamProductStockModel.getRemainStock())
.status(activityTeamInfo.getStatus())
.build();
return function.apply( return function.apply(
ActivityTeamInfoListModel.builder() ActivityTeamInfoListModel.builder()
.id(activityTeamInfo.getId()) .id(activityTeamInfo.getId())

View File

@ -48,6 +48,10 @@ public class TeamInfoListResp {
* *
*/ */
private BigDecimal productPrice; private BigDecimal productPrice;
/**
* id
*/
private Long productId;
/** /**
* *
*/ */
@ -80,6 +84,7 @@ public class TeamInfoListResp {
.attendNumber(activityTeamInfoListModel.getAttendNumber()) .attendNumber(activityTeamInfoListModel.getAttendNumber())
.endTime(activityTeamInfoListModel.getEndTime()) .endTime(activityTeamInfoListModel.getEndTime())
.teamPrice(activityTeamInfoListModel.getTeamPrice()) .teamPrice(activityTeamInfoListModel.getTeamPrice())
.productId(activityTeamInfoListModel.getProductId())
.productImage(activityTeamInfoListModel.getProductImage()) .productImage(activityTeamInfoListModel.getProductImage())
.productPrice(activityTeamInfoListModel.getProductPrice()) .productPrice(activityTeamInfoListModel.getProductPrice())
.remainStock(activityTeamInfoListModel.getRemainStock()) .remainStock(activityTeamInfoListModel.getRemainStock())

View File

@ -53,7 +53,7 @@ public class ActivityTeamController {
* @param activityTeamInfoSaveReq * @param activityTeamInfoSaveReq
* @return * @return
*/ */
@PostMapping @PostMapping("/save")
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) { public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq)); activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
return Result.success(); return Result.success();
@ -64,7 +64,7 @@ public class ActivityTeamController {
* @param id * @param id
* @return * @return
*/ */
@PostMapping("/findById/{id}") @PostMapping("/findTeamById/{id}")
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){ public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id))); return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
} }

View File

@ -53,6 +53,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
.productPrice(discountPrice.getProductPrice()) .productPrice(discountPrice.getProductPrice())
.teamStock(teamProductStockModel.getTeamStock()) .teamStock(teamProductStockModel.getTeamStock())
.remainStock(teamProductStockModel.getRemainStock()) .remainStock(teamProductStockModel.getRemainStock())
.productId(activityTeamInfo.getProductId())
.build(); .build();
})).toList(); })).toList();
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>(); TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
@ -111,26 +112,4 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
activityTeamProductSkuInfoService.BathSku(activityTeamProductInfoUpdModel.getUpdSkuList()); activityTeamProductSkuInfoService.BathSku(activityTeamProductInfoUpdModel.getUpdSkuList());
return true; return true;
} }
// activityTeamProductInfoUpdModel.getUpdSkuList().stream().forEach(activityTeamUpdSKuModel -> {
// //存入id
// activityTeamUpdSKuModel.getAddSkuList().stream().forEach(add->{
// add.setTeamId(activityTeamProductInfoUpdModel.getTeamId());
// add.setProductId(activityTeamProductInfoUpdModel.getProductId());
// });
// //非空校验 业务操作
// List<ActivityTeamProductSkuAddModel> addSkuList = activityTeamUpdSKuModel.getAddSkuList();
// Assert.notNull(addSkuList, "添加的SKU列表不能为空");
// activityTeamProductSkuInfoService.add(addSkuList);
//
// List<ActivityTeamProductSkuReqModel> skuList = activityTeamUpdSKuModel.getSkuList();
// Assert.notNull(skuList, "skuList 不能为空");
// activityTeamProductSkuInfoService.updateBath(skuList);
//
// List<Long> delSkuIdList = activityTeamUpdSKuModel.getDelSkuIdList();
// Assert.notNull(delSkuIdList, "delSkuIdList 不能为空");
// activityTeamProductSkuInfoService.removeBatchByIds(delSkuIdList);
// });
} }

View File

@ -1,5 +1,6 @@
package com.muyu.product.cache.datasource.impl; package com.muyu.product.cache.datasource.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.product.cache.datasource.ProjectSkuData; import com.muyu.product.cache.datasource.ProjectSkuData;
import com.muyu.product.domain.ProjectSkuInfo; import com.muyu.product.domain.ProjectSkuInfo;
@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**

View File

@ -1,6 +1,7 @@
package com.muyu.product.remote; package com.muyu.product.remote;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.constant.ServiceNameConstants; import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectInfo; import com.muyu.product.domain.ProjectInfo;
import com.muyu.product.remote.factory.RemoteProjectInfoFactory; import com.muyu.product.remote.factory.RemoteProjectInfoFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;

View File

@ -1,6 +1,7 @@
package com.muyu.product.remote; package com.muyu.product.remote;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.constant.ServiceNameConstants; import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectSkuInfo; import com.muyu.product.domain.ProjectSkuInfo;
import com.muyu.product.remote.factory.RemoteProjectSkuFactory; import com.muyu.product.remote.factory.RemoteProjectSkuFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;

View File

@ -1,8 +1,13 @@
package com.muyu.product.remote; package com.muyu.product.remote;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.constant.ServiceNameConstants; import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectSkuInfo;
import com.muyu.product.domain.RuleAttrInfo; import com.muyu.product.domain.RuleAttrInfo;
import com.muyu.product.remote.factory.RemoteProjectSkuFactory;
import com.muyu.product.remote.factory.RemoteRuleAttrFactory; import com.muyu.product.remote.factory.RemoteRuleAttrFactory;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;

View File

@ -1,8 +1,13 @@
package com.muyu.product.remote; package com.muyu.product.remote;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.constant.ServiceNameConstants; import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectSkuInfo;
import com.muyu.product.domain.RuleInfo; import com.muyu.product.domain.RuleInfo;
import com.muyu.product.remote.factory.RemoteProjectSkuFactory;
import com.muyu.product.remote.factory.RemoteRuleFactory; import com.muyu.product.remote.factory.RemoteRuleFactory;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;

View File

@ -2,7 +2,9 @@ package com.muyu.product.remote.factory;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectInfo; import com.muyu.product.domain.ProjectInfo;
import com.muyu.product.domain.RuleInfo;
import com.muyu.product.remote.RemoteProjectInfoService; import com.muyu.product.remote.RemoteProjectInfoService;
import com.muyu.product.remote.RemoteRuleService;
import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.cloud.openfeign.FallbackFactory;
/** /**

View File

@ -1,7 +1,11 @@
package com.muyu.product.remote.factory; package com.muyu.product.remote.factory;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectSkuInfo;
import com.muyu.product.domain.RuleAttrInfo; import com.muyu.product.domain.RuleAttrInfo;
import com.muyu.product.remote.RemoteProjectSkuService;
import com.muyu.product.remote.RemoteRuleAttrService; import com.muyu.product.remote.RemoteRuleAttrService;
import com.muyu.product.remote.RemoteRuleService;
import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.cloud.openfeign.FallbackFactory;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,9 @@
package com.muyu.product.remote.factory; package com.muyu.product.remote.factory;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectSkuInfo;
import com.muyu.product.domain.RuleInfo; import com.muyu.product.domain.RuleInfo;
import com.muyu.product.remote.RemoteProjectSkuService;
import com.muyu.product.remote.RemoteRuleService; import com.muyu.product.remote.RemoteRuleService;
import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.cloud.openfeign.FallbackFactory;

View File

@ -3,7 +3,6 @@ package com.muyu.product.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.model.AttributeGroupSaveModel; import com.muyu.product.domain.model.AttributeGroupSaveModel;
import com.muyu.product.domain.resp.AttributeGroupPageResp; import com.muyu.product.domain.resp.AttributeGroupPageResp;
import com.muyu.product.domain.resp.AttributeGroupUpdResp; import com.muyu.product.domain.resp.AttributeGroupUpdResp;
@ -17,6 +16,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;
@ -24,6 +25,7 @@ import com.muyu.product.domain.req.BrandInfoQueryReq;
import com.muyu.product.domain.req.BrandInfoSaveReq; import com.muyu.product.domain.req.BrandInfoSaveReq;
import com.muyu.product.domain.req.BrandInfoEditReq; import com.muyu.product.domain.req.BrandInfoEditReq;
import com.muyu.product.service.BrandInfoService; import com.muyu.product.service.BrandInfoService;
import com.muyu.common.core.web.page.TableDataInfo;
/** /**
* Controller * Controller

View File

@ -1,9 +1,13 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import java.util.function.Supplier;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.AttributeInfo;
import com.muyu.product.domain.BrandInfo;
import com.muyu.product.domain.model.CategoryInfoSaveModel; import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp; import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
@ -17,12 +21,14 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType; import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.product.domain.CategoryInfo; import com.muyu.product.domain.CategoryInfo;
import com.muyu.product.domain.req.CategoryInfoQueryReq;
import com.muyu.product.domain.req.CategoryInfoSaveReq; import com.muyu.product.domain.req.CategoryInfoSaveReq;
import com.muyu.product.domain.req.CategoryInfoEditReq; import com.muyu.product.domain.req.CategoryInfoEditReq;
import com.muyu.product.service.CategoryInfoService; import com.muyu.product.service.CategoryInfoService;

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;
@ -42,7 +43,7 @@ public class CommentInfoController extends BaseController {
* *
*/ */
@ApiOperation("获取商品评论列表") @ApiOperation("获取商品评论列表")
@RequiresPermissions("product:comment:list") //@RequiresPermissions("product:comment:list")
@GetMapping("/list") @GetMapping("/list")
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) { public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
startPage(); startPage();
@ -107,4 +108,9 @@ public class CommentInfoController extends BaseController {
public Result<String> remove(@PathVariable List<Long> ids) { public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(commentInfoService.removeBatchByIds(ids)); return toAjax(commentInfoService.removeBatchByIds(ids));
} }
@GetMapping("listByProductId/{id}")
public List<CommentInfo> listByProductId(@PathVariable Long id) {
return commentInfoService.listByProductId(id);
}
} }

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;
@ -98,7 +99,8 @@ public class ProjectInfoController extends BaseController {
@GetMapping(value = "/detail/{id}") @GetMapping(value = "/detail/{id}")
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
public Result<ProjectDetailResp> getDetailInfo(@PathVariable("id") Long id) { public Result<ProjectDetailResp> getDetailInfo(@PathVariable("id") Long id) {
return Result.success(projectInfoService.getDetailInfo(id)); ProjectDetailResp detailInfo = projectInfoService.getDetailInfo(id);
return Result.success(detailInfo);
} }
/** /**

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;

View File

@ -1,5 +1,5 @@
package com.muyu.product.controller; package com.muyu.product.controller;
import com.muyu.common.core.domain.Result;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil; import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.log.annotation.Log; import com.muyu.common.log.annotation.Log;

View File

@ -1,6 +1,8 @@
package com.muyu.product.service; package com.muyu.product.service;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.muyu.product.domain.CommentInfo; import com.muyu.product.domain.CommentInfo;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -19,4 +21,10 @@ public interface CommentInfoService extends IService<CommentInfo> {
*/ */
public List<CommentInfo> list(CommentInfo commentInfo); public List<CommentInfo> list(CommentInfo commentInfo);
public default List<CommentInfo> listByProductId(Long id){
LambdaUpdateWrapper<CommentInfo> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(CommentInfo::getProjectId, id);
return list(wrapper);
}
} }

View File

@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import com.muyu.product.mapper.ProjectInfoMapper; import com.muyu.product.mapper.ProjectInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.transaction.annotation.Transactional;
/** /**
* Service * Service
@ -145,6 +146,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
* @param id ID * @param id ID
* @return * @return
*/ */
@Transactional
@Override @Override
public ProjectDetailResp getDetailInfo (Long id) { public ProjectDetailResp getDetailInfo (Long id) {
// 商品信息获取 // 商品信息获取
@ -173,7 +175,11 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
.map(RuleAttrAddModel::infoBuild).toList(); .map(RuleAttrAddModel::infoBuild).toList();
CategoryCommonElementResp templateAttribute = this.categoryInfoService.getTemplateAttributeByCateGoryId(projectInfo.getType()); String a = String.valueOf(projectInfo.getType());
if (projectInfo.getType()==0){
a = String.valueOf(projectInfo.getParentType());
}
CategoryCommonElementResp templateAttribute = this.categoryInfoService.getTemplateAttributeByCateGoryId(Long.valueOf(a));
List<TemplateAttributeGroupModel> templateAttributeGroupList = templateAttribute.getTemplateAttributeGroupList(); List<TemplateAttributeGroupModel> templateAttributeGroupList = templateAttribute.getTemplateAttributeGroupList();
List<TemplateAttributeModel> templateAttributeList = new ArrayList<>(){{ List<TemplateAttributeModel> templateAttributeList = new ArrayList<>(){{
addAll(templateAttribute.getTemplateAttributeList()); addAll(templateAttribute.getTemplateAttributeList());
@ -194,13 +200,14 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
notInAttributeIdList.addAll( attributeIdList ); notInAttributeIdList.addAll( attributeIdList );
} }
// 添加上,商品的自有属性 // 添加上,商品的自有属性
if (notInAttributeIdList.size()!=0){
List<AsProductAttributeInfo> productAttributeList = this.asProductAttributeInfoService.list( List<AsProductAttributeInfo> productAttributeList = this.asProductAttributeInfoService.list(
new LambdaQueryWrapper<>() {{ new LambdaQueryWrapper<>() {{
eq(AsProductAttributeInfo::getProductId, projectInfo.getId()); eq(AsProductAttributeInfo::getProductId, projectInfo.getId());
notIn(AsProductAttributeInfo::getAttributeId, notInAttributeIdList); notIn(AsProductAttributeInfo::getAttributeId, notInAttributeIdList);
}} }}
); );
List<TemplateAttributeModel> projectAttributeList = new ArrayList<>(); List<TemplateAttributeModel> projectAttributeList = new ArrayList<>();
if (!productAttributeList.isEmpty()){ if (!productAttributeList.isEmpty()){
List<Long> attrIdList = productAttributeList.stream() List<Long> attrIdList = productAttributeList.stream()
@ -218,6 +225,9 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
if (!projectAttributeList.isEmpty()){ if (!projectAttributeList.isEmpty()){
templateAttributeList.addAll(projectAttributeList); templateAttributeList.addAll(projectAttributeList);
} }
}
return ProjectDetailResp.builder() return ProjectDetailResp.builder()
.projectInfo(projectInfo) .projectInfo(projectInfo)
.brandInfo(brandInfo) .brandInfo(brandInfo)

View File

@ -15,16 +15,17 @@ spring:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 113.44.75.158:8848 server-addr: 113.44.75.158:8848
namespace: gxc-muyu namespace: gxc-muyu
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 113.44.75.158:8848 server-addr: 113.44.75.158:8848
namespace: gxc-muyu
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
shared-configs: shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
namespace: gxc-muyu
logging: logging:
level: level:
com.muyu.product.mapper: DEBUG com.muyu.product.mapper: DEBUG