diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyEventMaintainController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyEventMaintainController.java new file mode 100644 index 0000000..9094a1f --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyEventMaintainController.java @@ -0,0 +1,81 @@ +package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.controller; + + +import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; +import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.*; +import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@RestController +@Api(tags = "活动运维接口") +@RequestMapping("/v1/eventmaintain") +public class PartyEventMaintainController { + + @Resource + private EventMockDataService eventMockDataService; + @Resource + private EventStyleService eventStyleService; + @Resource + private EventPartyBranchService eventPartyBranchService; + @Resource + private EventSubjectService eventSubjectService; + @Resource + private EventContactService eventContactService; + + + + @ApiOperation("保存联系人") + @PostMapping("/save/contact") + public BaseResponse saveContact(@RequestBody EventContact inVO) { + return BaseResponse.success(eventContactService.saveContact(inVO)); + } + + + @ApiOperation("保存攻坚项目") + @PostMapping("/save/subject") + public BaseResponse saveSubject(@RequestBody EventSubject inVO) { + return BaseResponse.success(eventSubjectService.saveSubject(inVO)); + } + + + @ApiOperation("保存活动风采") + @PostMapping("/save/style") + public BaseResponse saveStyle(@RequestBody EventStyle inVO) { + return BaseResponse.success(eventStyleService.saveStyle(inVO)); + } + + @ApiOperation("保存党支部") + @PostMapping("/save/branch") + public BaseResponse saveBranch(@RequestBody EventPartyBranch inVO) { + return BaseResponse.success(eventPartyBranchService.saveBranch(inVO)); + } + + @ApiOperation("保存党员") + @PostMapping("/save/member") + public BaseResponse saveMember(@RequestBody EventPartyBranch inVO) { + return BaseResponse.success(eventPartyBranchService.saveMember(inVO)); + } + + + @ApiOperation("更新右侧栏数据") + @PostMapping("/save/rightData") + public BaseResponse saveRightData(@RequestBody List list) { + return BaseResponse.success(eventMockDataService.saveRightData(list)); + } + + + @ApiOperation("查询右侧栏数据") + @PostMapping("/query/rightData") + public BaseResponse> queryRightData() { + return BaseResponse.success(eventMockDataService.list()); + } + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java index 31f9b0b..a46c941 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/controller/PartyMemberEventController.java @@ -53,8 +53,8 @@ public class PartyMemberEventController { @ApiOperation("活动联系人列表-按公司分组") @GetMapping("/eventContact/group") - public BaseResponse>> getEventContactGroup() { - return BaseResponse.success(eventContactService.getEventContactGroup()); + public BaseResponse>> getEventContactGroup(@RequestParam(value = "param") String param) { + return BaseResponse.success(eventContactService.getEventContactGroup(param)); } @ApiOperation("活动联系人列表") @@ -77,22 +77,27 @@ public class PartyMemberEventController { } - @ApiOperation("党支部列表") + @ApiOperation("省分列表") @GetMapping("/partyBranch/list") public BaseResponse> getPartyBranchList() { return BaseResponse.success(eventPartyBranchService.getPartyBranchList()); } - @ApiOperation("党支部下党员列表") + @ApiOperation("省份下党员列表") @GetMapping("/partyMember/list") public BaseResponse> getPartyMemberList(@RequestParam(value = "belongBranch") String belongBranch) { return BaseResponse.success(eventPartyBranchService.getPartyMemberList(belongBranch)); } + @ApiOperation("省份下党支部列表") + @PostMapping("/provinceBranch/list") + public BaseResponse> getProvinceBranchList(@RequestBody(required = false) EventQueryInVO inVO) { + return BaseResponse.success(eventPartyBranchService.getProvinceBranchList(inVO)); + } @ApiOperation("党员列表模糊查询") @PostMapping("/partyMember/paramQuery") - public BaseResponse> getPartyMemberListByParam(@RequestBody(required = false) EventQueryInVO inVO){ + public BaseResponse> getPartyMemberListByParam(@RequestBody(required = false) EventQueryInVO inVO){ return BaseResponse.success(eventPartyBranchService.getPartyMemberListByParam(inVO)); } @@ -116,31 +121,4 @@ public class PartyMemberEventController { return BaseResponse.success(eventContactService.saveContact(inVO)); } - - @ApiOperation("保存攻坚项目") - @PostMapping("/save/subject") - public BaseResponse saveSubject(@RequestBody EventSubject inVO) { - return BaseResponse.success(eventSubjectService.saveSubject(inVO)); - } - - - @ApiOperation("保存活动风采") - @PostMapping("/save/style") - public BaseResponse saveStyle(@RequestBody EventStyle inVO) { - return BaseResponse.success(eventStyleService.saveStyle(inVO)); - } - - @ApiOperation("保存党支部") - @PostMapping("/save/branch") - public BaseResponse saveBranch(@RequestBody EventPartyBranch inVO) { - return BaseResponse.success(eventPartyBranchService.saveBranch(inVO)); - } - - @ApiOperation("保存党员") - @PostMapping("/save/member") - public BaseResponse saveMember(@RequestBody EventPartyBranch inVO) { - return BaseResponse.success(eventPartyBranchService.saveMember(inVO)); - } - - } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java index b4c8e59..e960c74 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventContactSuggestion.java @@ -57,6 +57,18 @@ public class EventContactSuggestion implements Serializable { @ApiModelProperty(value = "意见内容") private String suggestionContent; + /** + * 补充说明 + */ + @ApiModelProperty(value = "补充说明") + private String instructions; + + /** + * 附件id + */ + @ApiModelProperty(value = "附件id") + private String attachmentImage; + /** * 意见提出人 */ diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventMaintainInVO.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventMaintainInVO.java new file mode 100644 index 0000000..4bc0079 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventMaintainInVO.java @@ -0,0 +1,98 @@ +package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +/** + * 实体类 EventMaintainInVO + * + * @auto.generated + */ +@Data +@Accessors(chain = true) +@ApiModel +public class EventMaintainInVO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 标题 + */ + @ApiModelProperty(value = "标题") + private String title; + + + /** + * 类别 + */ + @ApiModelProperty(value = "类别 1-首页,2-活动风采,3-攻坚克难") + private String type; + + /** + * 活动内容正文 + */ + @ApiModelProperty(value = "活动内容正文") + private String content; + + /** + * 活动图片 + */ + @ApiModelProperty(value = "活动图片") + private String image; + + /** + * 显示排序 + */ + @ApiModelProperty(value = "显示排序") + private Integer sort; + + /** + * 是否轮播广告:0-否,1-是 + */ + @ApiModelProperty(value = "是否轮播广告:0-否,1-是") + private String banner; + + /** + * 页面显示状态: 0-隐藏 1-显示 + */ + @ApiModelProperty(value = "页面显示状态: 0-隐藏 1-显示") + private String status; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @TableField(typeHandler = CustomLocalDateTimeTypeHandler.class) + private java.time.LocalDateTime createTime; + + /** + * 发布时间 + */ + @ApiModelProperty(value = "发布时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @TableField(typeHandler = CustomLocalDateTimeTypeHandler.class) + private java.time.LocalDateTime sendTime; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @TableField(typeHandler = CustomLocalDateTimeTypeHandler.class) + private java.time.LocalDateTime endTime; +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventMaintainOutVO.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventMaintainOutVO.java new file mode 100644 index 0000000..4e2134a --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventMaintainOutVO.java @@ -0,0 +1,98 @@ +package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +/** + * 实体类 EventMaintainOutVO + * + * @auto.generated + */ +@Data +@Accessors(chain = true) +@ApiModel +public class EventMaintainOutVO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 标题 + */ + @ApiModelProperty(value = "标题") + private String title; + + + /** + * 类别 + */ + @ApiModelProperty(value = "类别 1-首页,2-活动风采,3-攻坚克难") + private String type; + + /** + * 活动内容正文 + */ + @ApiModelProperty(value = "活动内容正文") + private String content; + + /** + * 活动图片 + */ + @ApiModelProperty(value = "活动图片") + private String image; + + /** + * 显示排序 + */ + @ApiModelProperty(value = "显示排序") + private Integer sort; + + /** + * 是否轮播广告:0-否,1-是 + */ + @ApiModelProperty(value = "是否轮播广告:0-否,1-是") + private String banner; + + /** + * 页面显示状态: 0-隐藏 1-显示 + */ + @ApiModelProperty(value = "页面显示状态: 0-隐藏 1-显示") + private String status; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @TableField(typeHandler = CustomLocalDateTimeTypeHandler.class) + private java.time.LocalDateTime createTime; + + /** + * 发布时间 + */ + @ApiModelProperty(value = "发布时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @TableField(typeHandler = CustomLocalDateTimeTypeHandler.class) + private java.time.LocalDateTime sendTime; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @TableField(typeHandler = CustomLocalDateTimeTypeHandler.class) + private java.time.LocalDateTime endTime; +} + + diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyQueryOutVO.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyQueryOutVO.java new file mode 100644 index 0000000..4ffd4b3 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventPartyQueryOutVO.java @@ -0,0 +1,49 @@ +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; + +/** + * 实体类 EventPartyQueryOutVO + * + * @auto.generated + */ +@Data +@Accessors(chain = true) +@Builder +public class EventPartyQueryOutVO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 党支部编码 + */ + @ApiModelProperty(value = "党支部编码") + private String branchCode; + + + /** + * 所属党支部 + */ + @ApiModelProperty(value = "所属党支部") + private String belongBranch; + + /** + * 所属党支部名称 + */ + @ApiModelProperty(value = "所属党支部名称") + private String belongBranchName; + + + /** + * 党员数量 + */ + @ApiModelProperty(value = "党员数量") + private Integer count; + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventQueryInVO.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventQueryInVO.java index 23b882c..ec4b504 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventQueryInVO.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/entity/EventQueryInVO.java @@ -20,15 +20,20 @@ public class EventQueryInVO implements Serializable { private static final long serialVersionUID = 1L; /** - * 数量 + * 党支部编码 */ @ApiModelProperty(value = "党支部编码") private String belongBranch; /** - * 名称 + * 参数 */ @ApiModelProperty(value = "参数") private String param; + /** + * 所属党支部名称 + */ + @ApiModelProperty(value = "所属党支部名称") + private String branchName; } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java index dab913d..cf59738 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventContactService.java @@ -15,7 +15,7 @@ public interface EventContactService extends IService{ - Map> getEventContactGroup(); + Map> getEventContactGroup(String param); List getEventContactList(); diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventMockDataService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventMockDataService.java index d2cbd7e..8b407d8 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventMockDataService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventMockDataService.java @@ -14,4 +14,7 @@ public interface EventMockDataService extends IService{ List getProfessionalDataList(); + + boolean saveRightData(List list); + } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java index 6a402be..73a3f1f 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/EventPartyBranchService.java @@ -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.EventPartyBranch; +import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyQueryOutVO; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventQueryInVO; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.MockDataValue; @@ -29,4 +30,6 @@ public interface EventPartyBranchService extends IService{ boolean saveBranch(EventPartyBranch inVO); boolean saveMember(EventPartyBranch inVO); + + List getProvinceBranchList(EventQueryInVO inVO); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java index 5890462..d7ba32f 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventContactServiceImpl.java @@ -25,9 +25,10 @@ public class EventContactServiceImpl extends ServiceImpl> getEventContactGroup() { + public Map> getEventContactGroup(String param) { LambdaQueryWrapper query = Wrappers.lambdaQuery(); query.eq(EventContact::getStatus, "1"); + query.eq(EventContact::getContactUnit, param); return this.list(query).stream().sorted(Comparator.comparing(EventContact::getSort)).collect(Collectors.groupingBy(EventContact::getContactUnit,LinkedHashMap::new,Collectors.toList())); } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventMockDataServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventMockDataServiceImpl.java index cef7be9..5d24f76 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventMockDataServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventMockDataServiceImpl.java @@ -56,4 +56,16 @@ public class EventMockDataServiceImpl extends ServiceImpl list) { + List collect = list.stream().map(EventMockData::getDataPy).collect(Collectors.toList()); + Map map = list.stream().collect(Collectors.toMap(EventMockData::getDataPy, EventMockData::getDataValue, (o1,o2) -> o2)); + LambdaQueryWrapper query = Wrappers.lambdaQuery(); + query.in(EventMockData::getDataPy, collect); + List dataList = this.list(query); + dataList.forEach(l -> l.setDataValue(map.get(l.getDataPy()))); + + return this.saveOrUpdateBatch(dataList); + } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventPartyBranchServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventPartyBranchServiceImpl.java index 3ce0bce..43ffe82 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventPartyBranchServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventPartyBranchServiceImpl.java @@ -9,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.EventPartyBranchMapper; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyBranch; +import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyQueryOutVO; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventQueryInVO; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.MockDataValue; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.enums.PartyEventExceptionEnum; @@ -38,6 +39,7 @@ public class EventPartyBranchServiceImpl extends ServiceImpl returnList = new ArrayList<>(); list.forEach(f -> returnList.add(MockDataValue.builder().name(f.getContactName()).text(f.getEventDeclaration()).build())); + Collections.shuffle(returnList); return returnList; } @@ -92,7 +94,7 @@ public class EventPartyBranchServiceImpl extends ServiceImpl getPartyMemberList(String belongBranch) { LambdaQueryWrapper queryMember = Wrappers.lambdaQuery(); - queryMember.eq(EventPartyBranch::getType, "2").eq(EventPartyBranch::getStatus, "1").eq(EventPartyBranch::getBelongBranch, belongBranch); + queryMember.eq(EventPartyBranch::getType, "2").eq(EventPartyBranch::getStatus, "1").eq(EventPartyBranch::getBranchCode, belongBranch); return this.list(queryMember); } @@ -101,7 +103,10 @@ public class EventPartyBranchServiceImpl extends ServiceImpl queryMember = Wrappers.lambdaQuery(); if (ObjectUtil.isNotNull(inVO)) { if (StrUtil.isNotBlank(inVO.getBelongBranch())) { - queryMember.eq(EventPartyBranch::getBelongBranch, inVO.getBelongBranch()); + queryMember.eq(EventPartyBranch::getBranchCode, inVO.getBelongBranch()); + } + if (StrUtil.isNotBlank(inVO.getBranchName())) { + queryMember.eq(EventPartyBranch::getBranchName, inVO.getBranchName()); } if (StrUtil.isNotBlank(inVO.getParam())) { queryMember.and(w -> w.like(EventPartyBranch::getContactName, inVO.getParam()) @@ -149,5 +154,31 @@ public class EventPartyBranchServiceImpl extends ServiceImpl getProvinceBranchList(EventQueryInVO inVO) { + List returnList = new ArrayList<>(); + LambdaQueryWrapper query = Wrappers.lambdaQuery(); + if (ObjectUtil.isNull(inVO)) { + return new ArrayList<>(); + } + if (StrUtil.isNotBlank(inVO.getBelongBranch())) { + query.eq(EventPartyBranch::getBranchCode, inVO.getBelongBranch()); + } + if (StrUtil.isNotBlank(inVO.getBranchName())) { + query.eq(EventPartyBranch::getBranchName, inVO.getBranchName()); + } + + query.eq(EventPartyBranch::getType, "2") + .eq(EventPartyBranch::getStatus, "1"); + + List list = this.list(query); + List nameList = list.stream().map(EventPartyBranch::getBelongBranchName).distinct().collect(Collectors.toList()); + Map> collect = list.stream().collect(Collectors.groupingBy(EventPartyBranch::getBelongBranchName)); + Map nameMap = list.stream().collect(Collectors.toMap(EventPartyBranch::getBelongBranchName, EventPartyBranch::getBranchCode, (o1, o2) -> o1)); + nameList.forEach(n -> returnList.add(EventPartyQueryOutVO.builder().belongBranchName(n).count(collect.get(n).size()).branchCode(nameMap.get(n)).build())); + + return returnList; + } + } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java index 659a7fc..37ef2fd 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/partyMemberEvent/service/impl/EventStyleServiceImpl.java @@ -32,6 +32,7 @@ public class EventStyleServiceImpl extends ServiceImpl list = this.list(query); - List subjectIdList = list.stream().map(EventSubject::getId).collect(Collectors.toList()); - List teamLeaderIdList = list.stream().map(EventSubject::getTeamLeader).distinct().collect(Collectors.toList()); - List teamMemberIdList = new ArrayList<>(); - list.forEach(f -> teamMemberIdList.addAll(Stream.of(f.getTeamMenber().split(",")).collect(Collectors.toList()))); + query.orderByDesc(EventSubject::getCreateTime); +// List list = this.list(query); +// List subjectIdList = list.stream().map(EventSubject::getId).collect(Collectors.toList()); +// List teamLeaderIdList = list.stream().map(EventSubject::getTeamLeader).distinct().collect(Collectors.toList()); +// List teamMemberIdList = new ArrayList<>(); +// list.forEach(f -> teamMemberIdList.addAll(Stream.of(f.getTeamMenber().split(",")).collect(Collectors.toList()))); - LambdaQueryWrapper querySubjectTime = Wrappers.lambdaQuery(); - querySubjectTime.eq(EventSubjectTime::getStatus, "1").in(EventSubjectTime::getSubjectId, subjectIdList); - List subjectTimeList = eventSubjectTimeService.list(querySubjectTime); - Map> timeMap = subjectTimeList.stream().collect(Collectors.groupingBy(EventSubjectTime::getSubjectId)); +// LambdaQueryWrapper querySubjectTime = Wrappers.lambdaQuery(); +// querySubjectTime.eq(EventSubjectTime::getStatus, "1").in(EventSubjectTime::getSubjectId, subjectIdList); +// List subjectTimeList = eventSubjectTimeService.list(querySubjectTime); +// Map> timeMap = subjectTimeList.stream().collect(Collectors.groupingBy(EventSubjectTime::getSubjectId)); +// +// List eventContacts = contactService.listByIds(teamLeaderIdList); +// Map leaderMap = eventContacts.stream().collect(Collectors.toMap(EventContact::getId, Function.identity())); +// +// LambdaQueryWrapper contactLambdaQuery = new LambdaQueryWrapper<>(); +// contactLambdaQuery.eq(EventContact::getStatus, "1").in(EventContact::getId, teamMemberIdList.stream().distinct().collect(Collectors.toList())); +// List eventContactList = contactService.list(contactLambdaQuery); +// Map eventContactMap = eventContactList.stream().collect(Collectors.toMap(EventContact::getId, Function.identity())); +// list.forEach(f -> { +// List contactList = new ArrayList<>(); +// List collect = Stream.of(f.getTeamMenber().split(",")).collect(Collectors.toList()); +// collect.forEach(c -> contactList.add(eventContactMap.get(c))); +// f.setTeamMenberInfo(contactList); +// f.setSubjectTimeList(timeMap.get(f.getId())); +// f.setTeamLeaderInfo(leaderMap.get(f.getTeamLeader())); +// }); - List eventContacts = contactService.listByIds(teamLeaderIdList); - Map leaderMap = eventContacts.stream().collect(Collectors.toMap(EventContact::getId, Function.identity())); - - LambdaQueryWrapper contactLambdaQuery = new LambdaQueryWrapper<>(); - contactLambdaQuery.eq(EventContact::getStatus, "1").in(EventContact::getId, teamMemberIdList.stream().distinct().collect(Collectors.toList())); - List eventContactList = contactService.list(contactLambdaQuery); - Map eventContactMap = eventContactList.stream().collect(Collectors.toMap(EventContact::getId, Function.identity())); - list.forEach(f -> { - List contactList = new ArrayList<>(); - List collect = Stream.of(f.getTeamMenber().split(",")).collect(Collectors.toList()); - collect.forEach(c -> contactList.add(eventContactMap.get(c))); - f.setTeamMenberInfo(contactList); - f.setSubjectTimeList(timeMap.get(f.getId())); - f.setTeamLeaderInfo(leaderMap.get(f.getTeamLeader())); - }); - - return list; + return this.list(query); } @Override