|
@@ -1,20 +1,64 @@
|
|
|
package com.tzld.piaoquan.api.service.contentplatform.impl;
|
|
|
|
|
|
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanMapper;
|
|
|
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformQwPlanMapper;
|
|
|
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
|
|
|
+import com.tzld.piaoquan.api.model.config.LoginUserContext;
|
|
|
import com.tzld.piaoquan.api.model.param.contentplatform.*;
|
|
|
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount;
|
|
|
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
|
|
|
import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
|
|
|
import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
|
|
|
import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
|
|
|
import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
|
|
|
import com.tzld.piaoquan.growth.common.utils.page.Page;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ContentPlatformGzhPlanMapper gzhPlanMapper;
|
|
|
+ @Autowired
|
|
|
+ private ContentPlatformPlanMapperExt planMapperExt;
|
|
|
+ @Autowired
|
|
|
+ private ContentPlatformQwPlanMapper qwPlanMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public Page<GzhPlanItemVO> gzhPlanList(GzhPlanListParam param) {
|
|
|
- return null;
|
|
|
+ ContentPlatformAccount loginAccount = LoginUserContext.getUser();
|
|
|
+ Page<GzhPlanItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
|
|
|
+ int offset = (param.getPageNum() - 1) * param.getPageSize();
|
|
|
+ int count = planMapperExt.getGzhPlanCount(param, loginAccount.getId());
|
|
|
+ result.setTotalSize(count);
|
|
|
+ if (count == 0) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ List<ContentPlatformGzhPlan> planList = planMapperExt.getGzhPlanList(param,
|
|
|
+ loginAccount.getId(), offset, param.getPageSize());
|
|
|
+ List<GzhPlanItemVO> list = buildGzhPlanItemVOList(planList);
|
|
|
+ result.setObjs(list);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<GzhPlanItemVO> buildGzhPlanItemVOList(List<ContentPlatformGzhPlan> planList) {
|
|
|
+ if (CollectionUtils.isEmpty(planList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<GzhPlanItemVO> result = new ArrayList<>();
|
|
|
+ for (ContentPlatformGzhPlan gzhPlan : planList) {
|
|
|
+ GzhPlanItemVO planItemVO = new GzhPlanItemVO();
|
|
|
+ planItemVO.setId(gzhPlan.getId());
|
|
|
+
|
|
|
+ planItemVO.setCreateTimestamp(gzhPlan.getCreateTimestamp());
|
|
|
+ result.add(planItemVO);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Override
|