From 02f18587bd8860b305e2c688e20465be166bb48c Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 22 七月 2021 15:14:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComCvtCategoryServiceImpl.java | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComCvtCategoryServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComCvtCategoryServiceImpl.java
index 42abdda..47132c4 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComCvtCategoryServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComCvtCategoryServiceImpl.java
@@ -6,14 +6,19 @@
import com.panzhihua.common.model.dtos.community.ComCvtCategoryDTO;
import com.panzhihua.common.model.dtos.community.PageComCvtCategoryDTO;
import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.ComCvtCategoryVO;
import com.panzhihua.service_community.dao.ComCvtCategoryDAO;
+import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComCvtCategoryDO;
import com.panzhihua.service_community.service.ComCvtCategoryService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
/**
* @description:
@@ -49,6 +54,7 @@
if(null!=comCvtCategoryDO){
return R.fail("分类名称重复");
}
+ comCvtCategoryDO = new ComCvtCategoryDO();
BeanUtils.copyProperties(comCvtCategoryDTO,comCvtCategoryDO);
int count = comCvtCategoryDAO.insert(comCvtCategoryDO);
if(count<1){
@@ -98,4 +104,18 @@
}
return R.ok();
}
+
+ @Override
+ public R allComCvtCategory() {
+ List<ComCvtCategoryVO> comCvtCategoryVOS = new ArrayList<>();
+ List<ComCvtCategoryDO> categoryDOS = comCvtCategoryDAO.selectList(new QueryWrapper<ComCvtCategoryDO>().lambda().orderByDesc(ComCvtCategoryDO::getWeight));
+ if (!ObjectUtils.isEmpty(categoryDOS)) {
+ categoryDOS.forEach(categoryDO -> {
+ ComCvtCategoryVO comCvtCategoryVO=new ComCvtCategoryVO();
+ BeanUtils.copyProperties(categoryDO,comCvtCategoryVO);
+ comCvtCategoryVOS.add(comCvtCategoryVO);
+ });
+ }
+ return R.ok(comCvtCategoryVOS);
+ }
}
--
Gitblit v1.7.1