党员活动 文档中心获取地址
This commit is contained in:
@ -1,11 +1,14 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.feign.client;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.extend.feign.client.factory.DocumentCenterServiceFallbackFactory;
|
||||
import com.chinaunicom.mall.ebtp.extend.feign.entity.DocumentDataVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 连接山分的文档中心服务
|
||||
*
|
||||
@ -34,4 +37,14 @@ public interface DocumentCenterService {
|
||||
@RequestMapping(method = RequestMethod.POST, value = "v1.0/files/downloadStream")
|
||||
String getFileObjectDetail(@RequestParam("fileId") String fileId);
|
||||
|
||||
/**
|
||||
* 统计查询 sys_storage表中数据
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, value = "v1.0/files/queryReturn")
|
||||
List<DocumentDataVO> queryReturn(@RequestParam("objectIdList") List<String> list);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.feign.client.fallback;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.extend.feign.client.DocumentCenterService;
|
||||
import com.chinaunicom.mall.ebtp.extend.feign.entity.DocumentDataVO;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 熔断
|
||||
*
|
||||
@ -27,4 +30,11 @@ public class DocumentCenterServiceFallbackImpl implements DocumentCenterService
|
||||
public String getFileObjectDetail(String fileId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocumentDataVO> queryReturn(List<String> list) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.feign.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体类 DocumentDataVO
|
||||
*
|
||||
* @author yss
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DocumentDataVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private String fileId;
|
||||
private String objectId;
|
||||
private String originalName;
|
||||
private String filePath;
|
||||
private String fileSize;
|
||||
|
||||
|
||||
}
|
@ -52,9 +52,9 @@ public class PartyMemberEventController {
|
||||
|
||||
|
||||
@ApiOperation("活动联系人列表-按公司分组")
|
||||
@GetMapping("/eventContact/group")
|
||||
public BaseResponse<Map<String, List<EventContact>>> getEventContactGroup(@RequestParam(value = "param", required = false) String param) {
|
||||
return BaseResponse.success(eventContactService.getEventContactGroup(param));
|
||||
@PostMapping("/eventContact/group")
|
||||
public BaseResponse<Map<String, List<EventContact>>> getEventContactGroup(@RequestBody(required = false) EventQueryInVO inVO) {
|
||||
return BaseResponse.success(eventContactService.getEventContactGroup(inVO));
|
||||
}
|
||||
|
||||
@ApiOperation("活动联系人列表")
|
||||
|
@ -111,5 +111,10 @@ public class EventStyle implements Serializable {
|
||||
@TableField(typeHandler = CustomLocalDateTimeTypeHandler.class)
|
||||
private java.time.LocalDateTime sendTime;
|
||||
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@ApiModelProperty(value = "文件地址")
|
||||
@TableField(exist = false)
|
||||
private String filePath;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContact;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventQueryInVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -15,7 +16,7 @@ public interface EventContactService extends IService<EventContact>{
|
||||
|
||||
|
||||
|
||||
Map<String, List<EventContact>> getEventContactGroup(String param);
|
||||
Map<String, List<EventContact>> getEventContactGroup(EventQueryInVO inVO);
|
||||
|
||||
List<EventContact> getEventContactList();
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventContactMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContact;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventQueryInVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventContactService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -25,11 +27,11 @@ public class EventContactServiceImpl extends ServiceImpl<EventContactMapper, Eve
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, List<EventContact>> getEventContactGroup(String param) {
|
||||
public Map<String, List<EventContact>> getEventContactGroup(EventQueryInVO inVO) {
|
||||
LambdaQueryWrapper<EventContact> query = Wrappers.lambdaQuery();
|
||||
query.eq(EventContact::getStatus, "1");
|
||||
if (StrUtil.isNotBlank(param)) {
|
||||
query.eq(EventContact::getContactUnit, param);
|
||||
if (ObjectUtil.isNotNull(inVO) && StrUtil.isNotBlank(inVO.getParam())) {
|
||||
query.eq(EventContact::getContactUnit, inVO.getParam());
|
||||
}
|
||||
return this.list(query).stream().sorted(Comparator.comparing(EventContact::getSort)).collect(Collectors.groupingBy(EventContact::getContactUnit,LinkedHashMap::new,Collectors.toList()));
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
|
||||
import com.chinaunicom.mall.ebtp.extend.feign.client.DocumentCenterService;
|
||||
import com.chinaunicom.mall.ebtp.extend.feign.entity.DocumentDataVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventStyleMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventQueryInVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventStyle;
|
||||
@ -14,8 +16,12 @@ import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventStyleServi
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 对数据表 event_style 操作的 serviceImpl
|
||||
@ -25,6 +31,8 @@ import java.util.List;
|
||||
@Service
|
||||
public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventStyle> implements EventStyleService {
|
||||
|
||||
@Resource
|
||||
private DocumentCenterService documentCenterService;
|
||||
|
||||
@Override
|
||||
public List<EventStyle> getEventStyle(String type, EventQueryInVO inVO) {
|
||||
@ -33,13 +41,19 @@ public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventSt
|
||||
query.like(EventStyle::getTitle, inVO.getParam());
|
||||
}
|
||||
query.orderByDesc(EventStyle::getCreateTime);
|
||||
List<EventStyle> list;
|
||||
if ("banner".equals(type)) {
|
||||
query.eq(EventStyle::getBanner, "1").eq(EventStyle::getStatus, "1").orderByAsc(EventStyle::getSort);
|
||||
return this.list(query);
|
||||
} else {
|
||||
query.eq(EventStyle::getBanner, "0").eq(EventStyle::getStatus, "1").orderByAsc(EventStyle::getSort);
|
||||
return this.list(query);
|
||||
}
|
||||
list = this.list(query);
|
||||
List<String> imageIdList = list.stream().map(EventStyle::getImage).collect(Collectors.toList());
|
||||
List<DocumentDataVO> queryReturn = documentCenterService.queryReturn(imageIdList);
|
||||
Map<String, String> collect = queryReturn.stream().collect(Collectors.toMap(DocumentDataVO::getObjectId, DocumentDataVO::getFilePath));
|
||||
|
||||
list.forEach(l -> l.setFilePath(collect.get(l.getImage())));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user