党员活动接口
This commit is contained in:
@ -35,7 +35,7 @@ public class PartyMemberEventController {
|
|||||||
@ApiOperation("右侧专业线数据")
|
@ApiOperation("右侧专业线数据")
|
||||||
@GetMapping("/data/list")
|
@GetMapping("/data/list")
|
||||||
public BaseResponse<List<EventMockData>> getProfessionalDataList() {
|
public BaseResponse<List<EventMockData>> getProfessionalDataList() {
|
||||||
return BaseResponse.success(eventMockDataService.list());
|
return BaseResponse.success(eventMockDataService.getProfessionalDataList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("活动风采轮播列表")
|
@ApiOperation("活动风采轮播列表")
|
||||||
@ -52,7 +52,7 @@ public class PartyMemberEventController {
|
|||||||
|
|
||||||
@ApiOperation("活动宣言")
|
@ApiOperation("活动宣言")
|
||||||
@GetMapping("/eventDeclaration/list")
|
@GetMapping("/eventDeclaration/list")
|
||||||
public BaseResponse<List<String>> getEventDeclarationList() {
|
public BaseResponse<List<MockDataValue>> getEventDeclarationList() {
|
||||||
return BaseResponse.success(eventPartyBranchService.getEventDeclarationList());
|
return BaseResponse.success(eventPartyBranchService.getEventDeclarationList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
type="com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData">
|
type="com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData">
|
||||||
<result column="id" jdbcType="BIGINT" property="id"/>
|
<result column="id" jdbcType="BIGINT" property="id"/>
|
||||||
<result column="data_class" jdbcType="VARCHAR" property="dataClass"/>
|
<result column="data_class" jdbcType="VARCHAR" property="dataClass"/>
|
||||||
|
<result column="parent_class" jdbcType="VARCHAR" property="parentClass"/>
|
||||||
<result column="data_py" jdbcType="VARCHAR" property="dataPy"/>
|
<result column="data_py" jdbcType="VARCHAR" property="dataPy"/>
|
||||||
<result column="data_value" jdbcType="VARCHAR" property="dataValue"/>
|
<result column="data_value" jdbcType="VARCHAR" property="dataValue"/>
|
||||||
<result column="data_type" jdbcType="VARCHAR" property="dataType"/>
|
<result column="data_type" jdbcType="VARCHAR" property="dataType"/>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity;
|
package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -7,6 +8,7 @@ import lombok.Data;
|
|||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实体类 EventMockData
|
* 实体类 EventMockData
|
||||||
@ -33,6 +35,12 @@ public class EventMockData implements Serializable {
|
|||||||
@ApiModelProperty(value = "数据归类")
|
@ApiModelProperty(value = "数据归类")
|
||||||
private String dataClass;
|
private String dataClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据父类
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "数据父类")
|
||||||
|
private String parentClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据拼音
|
* 数据拼音
|
||||||
*/
|
*/
|
||||||
@ -63,5 +71,10 @@ public class EventMockData implements Serializable {
|
|||||||
@ApiModelProperty(value = "同比")
|
@ApiModelProperty(value = "同比")
|
||||||
private String dataCompare;
|
private String dataCompare;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同比
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "同比")
|
||||||
|
private List<MockDataValue> data;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体类 MockDataValue
|
||||||
|
*
|
||||||
|
* @auto.generated
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Builder
|
||||||
|
public class MockDataValue implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文字
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文字")
|
||||||
|
private String text;
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,8 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对数据表 event_mock_data 操作的 service
|
* 对数据表 event_mock_data 操作的 service
|
||||||
* @author Auto create
|
* @author Auto create
|
||||||
@ -11,5 +13,5 @@ import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData;
|
|||||||
public interface EventMockDataService extends IService<EventMockData>{
|
public interface EventMockDataService extends IService<EventMockData>{
|
||||||
|
|
||||||
|
|
||||||
|
List<EventMockData> getProfessionalDataList();
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyBranch;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyBranch;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.MockDataValue;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -14,7 +15,7 @@ import java.util.Map;
|
|||||||
public interface EventPartyBranchService extends IService<EventPartyBranch>{
|
public interface EventPartyBranchService extends IService<EventPartyBranch>{
|
||||||
|
|
||||||
|
|
||||||
List<String> getEventDeclarationList();
|
List<MockDataValue> getEventDeclarationList();
|
||||||
|
|
||||||
Map<String,Integer> getPartyBranchMemberCount();
|
Map<String,Integer> getPartyBranchMemberCount();
|
||||||
|
|
||||||
|
@ -1,11 +1,20 @@
|
|||||||
package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.impl;
|
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.extension.service.impl.ServiceImpl;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventMockDataMapper;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventMockDataMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMockData;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.MockDataValue;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventMockDataService;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventMockDataService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对数据表 event_mock_data 操作的 serviceImpl
|
* 对数据表 event_mock_data 操作的 serviceImpl
|
||||||
* @author Auto create
|
* @author Auto create
|
||||||
@ -15,4 +24,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
public class EventMockDataServiceImpl extends ServiceImpl<EventMockDataMapper, EventMockData> implements EventMockDataService {
|
public class EventMockDataServiceImpl extends ServiceImpl<EventMockDataMapper, EventMockData> implements EventMockDataService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EventMockData> getProfessionalDataList() {
|
||||||
|
List<EventMockData> list = this.list();
|
||||||
|
List<EventMockData> returnList = list.stream().filter(f -> StrUtil.isBlank(f.getParentClass()) ).collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<String, List<EventMockData>> map = list.stream().filter(f -> StrUtil.isNotBlank(f.getParentClass())).collect(Collectors.groupingBy(EventMockData::getParentClass));
|
||||||
|
|
||||||
|
returnList.forEach(f -> {
|
||||||
|
List<EventMockData> dataList = map.get(f.getDataPy());
|
||||||
|
if (ObjectUtil.isNotNull(dataList) && !dataList.isEmpty()) {
|
||||||
|
List<MockDataValue> newList = new ArrayList<>();
|
||||||
|
dataList.forEach(l -> newList.add(MockDataValue.builder().name(l.getDataName()).value(l.getDataValue()).build()));
|
||||||
|
f.setData(newList);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return returnList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventPartyBranchMapper;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventPartyBranchMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyBranch;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyBranch;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.MockDataValue;
|
||||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventPartyBranchService;
|
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventPartyBranchService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -22,15 +23,15 @@ public class EventPartyBranchServiceImpl extends ServiceImpl<EventPartyBranchMap
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getEventDeclarationList() {
|
public List<MockDataValue> getEventDeclarationList() {
|
||||||
LambdaQueryWrapper<EventPartyBranch> query = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<EventPartyBranch> query = Wrappers.lambdaQuery();
|
||||||
query.eq(EventPartyBranch::getType, "2").eq(EventPartyBranch::getStatus, "1").isNotNull(EventPartyBranch::getEventDeclaration);
|
query.eq(EventPartyBranch::getType, "2").eq(EventPartyBranch::getStatus, "1").isNotNull(EventPartyBranch::getEventDeclaration);
|
||||||
List<EventPartyBranch> list = this.list(query);
|
List<EventPartyBranch> list = this.list(query);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
List<String> returnList = new ArrayList<>();
|
List<MockDataValue> returnList = new ArrayList<>();
|
||||||
list.forEach(f -> returnList.add(f.getContactName() + ":" + f.getEventDeclaration()));
|
list.forEach(f -> returnList.add(MockDataValue.builder().name(f.getContactName()).text(f.getEventDeclaration()).build()));
|
||||||
return returnList;
|
return returnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user