Explorar el Código

Merge remote-tracking branch 'origin/master'

silent hace 4 años
padre
commit
ed4f648a3b

+ 0 - 1
src/main/java/org/springblade/gateway/login_gateway/controller/LoginController.java

@@ -55,5 +55,4 @@ public class LoginController {
 		}
 		return R.data(user);
 	}
-
 }

+ 8 - 4
src/main/java/org/springblade/sing/active/controller/ActiveHelpRecordController.java

@@ -27,6 +27,8 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.sing.active.service.IActiveProductRecordService;
+import org.springblade.sing.goods.service.IHelpGoodsService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -49,6 +51,8 @@ import org.springblade.core.boot.ctrl.BladeController;
 public class ActiveHelpRecordController extends BladeController {
 
 	private final IActiveHelpRecordService activeHelpRecordService;
+	private IActiveProductRecordService activeProductRecordService;
+	private IHelpGoodsService helpGoodsService;
 
 	/**
 	 * 详情
@@ -58,7 +62,7 @@ public class ActiveHelpRecordController extends BladeController {
 	@ApiOperation(value = "详情", notes = "传入activeHelpRecord")
 	public R<ActiveHelpRecordVO> detail(ActiveHelpRecord activeHelpRecord) {
 		ActiveHelpRecord detail = activeHelpRecordService.getOne(Condition.getQueryWrapper(activeHelpRecord));
-		return R.data(ActiveHelpRecordWrapper.build().entityVO(detail));
+		return R.data(ActiveHelpRecordWrapper.build(activeProductRecordService, helpGoodsService).entityVO(detail));
 	}
 
 	/**
@@ -69,7 +73,7 @@ public class ActiveHelpRecordController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入activeHelpRecord")
 	public R<IPage<ActiveHelpRecordVO>> list(ActiveHelpRecord activeHelpRecord, Query query) {
 		IPage<ActiveHelpRecord> pages = activeHelpRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(activeHelpRecord));
-		return R.data(ActiveHelpRecordWrapper.build().pageVO(pages));
+		return R.data(ActiveHelpRecordWrapper.build(activeProductRecordService,helpGoodsService).pageVO(pages));
 	}
 
 
@@ -114,7 +118,7 @@ public class ActiveHelpRecordController extends BladeController {
 		return R.status(activeHelpRecordService.saveOrUpdate(activeHelpRecord));
 	}
 
-	
+
 	/**
 	 * 删除 活动助力记录
 	 */
@@ -125,5 +129,5 @@ public class ActiveHelpRecordController extends BladeController {
 		return R.status(activeHelpRecordService.deleteLogic(Func.toLongList(ids)));
 	}
 
-	
+
 }

+ 12 - 0
src/main/java/org/springblade/sing/active/vo/ActiveHelpRecordVO.java

@@ -20,6 +20,7 @@ import org.springblade.sing.active.entity.ActiveHelpRecord;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
+import org.springblade.sing.goods.entity.HelpGoods;
 
 /**
  * 活动助力记录视图实体类
@@ -33,4 +34,15 @@ import io.swagger.annotations.ApiModel;
 public class ActiveHelpRecordVO extends ActiveHelpRecord {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 作品标题
+	 */
+	private String productTitle;
+
+	/**
+	 * 道具
+	 */
+	private HelpGoods helpGoods;
+
+
 }

+ 31 - 0
src/main/java/org/springblade/sing/active/wrapper/ActiveHelpRecordWrapper.java

@@ -19,8 +19,14 @@ package org.springblade.sing.active.wrapper;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.sing.active.entity.ActiveHelpRecord;
+import org.springblade.sing.active.entity.ActiveProductRecord;
+import org.springblade.sing.active.service.IActiveProductRecordService;
 import org.springblade.sing.active.vo.ActiveHelpRecordVO;
+import org.springblade.sing.goods.entity.HelpGoods;
+import org.springblade.sing.goods.service.IHelpGoodsService;
+
 import java.util.Objects;
+import java.util.Optional;
 
 /**
  * 活动助力记录包装类,返回视图层所需的字段
@@ -30,14 +36,39 @@ import java.util.Objects;
  */
 public class ActiveHelpRecordWrapper extends BaseEntityWrapper<ActiveHelpRecord, ActiveHelpRecordVO>  {
 
+
+	private IActiveProductRecordService activeProductRecordService;
+	private IHelpGoodsService helpGoodsService;
+
+	public ActiveHelpRecordWrapper() {
+	}
+
+	public ActiveHelpRecordWrapper(IActiveProductRecordService activeProductRecordService, IHelpGoodsService helpGoodsService) {
+		this.activeProductRecordService = activeProductRecordService;
+		this.helpGoodsService = helpGoodsService;
+	}
+
 	public static ActiveHelpRecordWrapper build() {
 		return new ActiveHelpRecordWrapper();
+	}
+
+	public static ActiveHelpRecordWrapper build(IActiveProductRecordService activeProductRecordService, IHelpGoodsService helpGoodsService) {
+		return new ActiveHelpRecordWrapper(activeProductRecordService,helpGoodsService);
  	}
 
 	@Override
 	public ActiveHelpRecordVO entityVO(ActiveHelpRecord activeHelpRecord) {
 		ActiveHelpRecordVO activeHelpRecordVO = Objects.requireNonNull(BeanUtil.copy(activeHelpRecord, ActiveHelpRecordVO.class));
 
+		if (activeProductRecordService != null && helpGoodsService != null) {
+			ActiveProductRecord productRecord = activeProductRecordService.getById(activeHelpRecordVO.getProductId());
+			String title = Optional.ofNullable(productRecord).map(ActiveProductRecord::getTitle).orElse("");
+			activeHelpRecordVO.setProductTitle(title);
+
+			HelpGoods helpGoods = helpGoodsService.getById(activeHelpRecordVO.getHelpGoodsId());
+			activeHelpRecordVO.setHelpGoods(helpGoods);
+		}
+
 		//User createUser = UserCache.getUser(activeHelpRecord.getCreateUser());
 		//User updateUser = UserCache.getUser(activeHelpRecord.getUpdateUser());
 		//activeHelpRecordVO.setCreateUserName(createUser.getName());