|
@@ -1,13 +1,15 @@
|
|
package com.caimei.modules.user.service;
|
|
package com.caimei.modules.user.service;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import com.caimei.modules.consult.entity.type.CmConsulttype;
|
|
import com.caimei.modules.oss.service.CmOssArchiveService;
|
|
import com.caimei.modules.oss.service.CmOssArchiveService;
|
|
import com.caimei.modules.oss.utils.OSSUtils;
|
|
import com.caimei.modules.oss.utils.OSSUtils;
|
|
-import com.caimei.modules.user.entity.CmClubRemarks;
|
|
|
|
-import com.caimei.modules.user.entity.RemarksFileVo;
|
|
|
|
-import com.caimei.modules.user.entity.UserBeansHistory;
|
|
|
|
|
|
+import com.caimei.modules.project.model.ServiceProviderModel;
|
|
|
|
+import com.caimei.modules.user.entity.*;
|
|
|
|
+import com.thinkgem.jeesite.common.utils.StringUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -15,7 +17,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import com.thinkgem.jeesite.common.persistence.Page;
|
|
import com.thinkgem.jeesite.common.persistence.Page;
|
|
import com.thinkgem.jeesite.common.service.CrudService;
|
|
import com.thinkgem.jeesite.common.service.CrudService;
|
|
-import com.caimei.modules.user.entity.NewCmClub;
|
|
|
|
import com.caimei.modules.user.dao.NewCmClubDao;
|
|
import com.caimei.modules.user.dao.NewCmClubDao;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -59,7 +60,7 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
|
|
}
|
|
}
|
|
|
|
|
|
@Transactional(readOnly = false)
|
|
@Transactional(readOnly = false)
|
|
- public void insert(NewCmClub userClub){
|
|
|
|
|
|
+ public void insert(NewCmClub userClub) {
|
|
newCmClubDao.insert(userClub);
|
|
newCmClubDao.insert(userClub);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -75,9 +76,9 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
|
|
|
|
|
|
public NewCmClub findClubById(Integer clubId) {
|
|
public NewCmClub findClubById(Integer clubId) {
|
|
List<NewCmClub> newCmClubs = newCmClubDao.findClubById(clubId);
|
|
List<NewCmClub> newCmClubs = newCmClubDao.findClubById(clubId);
|
|
- if(CollectionUtils.isNotEmpty(newCmClubs) && newCmClubs.size() > 0 ){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(newCmClubs) && newCmClubs.size() > 0) {
|
|
return newCmClubs.get(0);
|
|
return newCmClubs.get(0);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -87,13 +88,13 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
|
|
newCmClubDao.insertBeansHistory(beansHistory);
|
|
newCmClubDao.insertBeansHistory(beansHistory);
|
|
}
|
|
}
|
|
|
|
|
|
- public Page<CmClubRemarks> findRemarksPage(Page<CmClubRemarks> page, CmClubRemarks cmClubRemarks){
|
|
|
|
|
|
+ public Page<CmClubRemarks> findRemarksPage(Page<CmClubRemarks> page, CmClubRemarks cmClubRemarks) {
|
|
cmClubRemarks.setPage(page);
|
|
cmClubRemarks.setPage(page);
|
|
List<CmClubRemarks> remarksList = newCmClubDao.findRemarksList(cmClubRemarks);
|
|
List<CmClubRemarks> remarksList = newCmClubDao.findRemarksList(cmClubRemarks);
|
|
- remarksList.forEach(remarks->{
|
|
|
|
|
|
+ remarksList.forEach(remarks -> {
|
|
List<String> imageList = newCmClubDao.getRemarksImageList(remarks.getRemarksId());
|
|
List<String> imageList = newCmClubDao.getRemarksImageList(remarks.getRemarksId());
|
|
List<RemarksFileVo> fileList = newCmClubDao.getRemarksFileList(remarks.getRemarksId());
|
|
List<RemarksFileVo> fileList = newCmClubDao.getRemarksFileList(remarks.getRemarksId());
|
|
- fileList.forEach(f->f.setFileUrl(OSSUtils.getOssUrl(f.getOssName())));
|
|
|
|
|
|
+ fileList.forEach(f -> f.setFileUrl(OSSUtils.getOssUrl(f.getOssName())));
|
|
remarks.setImageList(imageList);
|
|
remarks.setImageList(imageList);
|
|
remarks.setFileList(fileList);
|
|
remarks.setFileList(fileList);
|
|
});
|
|
});
|
|
@@ -105,4 +106,42 @@ public class NewCmClubService extends CrudService<NewCmClubDao, NewCmClub> {
|
|
OSSUtils.downFile(ossName, fileName);
|
|
OSSUtils.downFile(ossName, fileName);
|
|
cmOssArchiveService.download(request, response, fileName);
|
|
cmOssArchiveService.download(request, response, fileName);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public Page<CmClubRemarks> findRegistPage(Page<CmClubRemarks> cmClubRemarksPage, CmClubRemarks cmClubRemarks) {
|
|
|
|
+ cmClubRemarks.setPage(cmClubRemarksPage);
|
|
|
|
+ List<CmClubRemarks> remarksList = newCmClubDao.findRegistList(cmClubRemarks);
|
|
|
|
+ remarksList.forEach(remarks -> {
|
|
|
|
+ if (null != remarks.getConsultType()) {
|
|
|
|
+ List<String> strings = Arrays.asList(remarks.getConsultType().split(","));
|
|
|
|
+ String cons = "";
|
|
|
|
+ for (String string : strings) {
|
|
|
|
+ cons += newCmClubDao.findClassName(string) + ",";
|
|
|
|
+ }
|
|
|
|
+ cons = cons.substring(0, cons.length() - 1);
|
|
|
|
+ remarks.setConsultType(cons);
|
|
|
|
+ }
|
|
|
|
+ List<String> imageList = newCmClubDao.getRemarksImageList(remarks.getRemarksId());
|
|
|
|
+ List<RemarksFileVo> fileList = newCmClubDao.getRemarksFileList(remarks.getRemarksId());
|
|
|
|
+ fileList.forEach(f -> f.setFileUrl(OSSUtils.getOssUrl(f.getOssName())));
|
|
|
|
+ remarks.setImageList(imageList);
|
|
|
|
+ remarks.setFileList(fileList);
|
|
|
|
+ });
|
|
|
|
+ if (StringUtils.isNotBlank(cmClubRemarks.getConsult())) {
|
|
|
|
+ remarksList.removeIf(r -> !r.getConsult().contains(cmClubRemarks.getConsult()));
|
|
|
|
+ }
|
|
|
|
+ cmClubRemarksPage.setList(remarksList);
|
|
|
|
+ return cmClubRemarksPage;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<CmConsulttype> findConsults() {
|
|
|
|
+ return newCmClubDao.findConsults();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<CmSaleMan> findTeams() {
|
|
|
|
+ return newCmClubDao.findTeams();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<ServiceProviderModel> findGroup(Integer leaderId) {
|
|
|
|
+ return newCmClubDao.findGroup(leaderId);
|
|
|
|
+ }
|
|
}
|
|
}
|