diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java index 5adcb70de..6b9f26e15 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java @@ -43,7 +43,7 @@ public class InvestDemandController extends InvestBaseController { @SystemServiceLog @ApiOperation(value = "分页列表接口") @GetMapping("/list") - public InvestResultData> list(InvestPageQuery params) { + public InvestResultData> list(InvestPageQuery params) { return execute(params, p -> investBizService.queryPageDemand(p)); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java index 23616a211..398fd72d3 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java @@ -2,6 +2,7 @@ package com.iformall.controller.invest; import com.iformall.common.InvestResultData; import com.iformall.domain.po.invest.InvestFollowRecordEntity; +import com.iformall.domain.vo.invest.InvestFollowRecordVo; import com.iformall.domain.vo.invest.InvestPageQuery; import com.iformall.domain.vo.invest.InvestPageResult; import com.iformall.service.invest.InvestBizService; @@ -38,8 +39,8 @@ public class InvestFollowRecordController extends InvestBaseController { */ @ApiOperation("分页列表接口") @GetMapping("/list") - public InvestResultData> list(InvestPageQuery params) { - return execute(params, p -> investFollowRecordService.queryPage(p)); + public InvestResultData> list(InvestPageQuery params) { + return execute(params, p -> bizService.queryPageFollowRecord(p)); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java index 916be03c8..dc60b6020 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; -import com.iformall.domain.po.invest.InvestBaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -28,6 +27,7 @@ public class InvestRemindEntity extends InvestBaseEntity { /** * 提醒内容 */ + @io.swagger.annotations.ApiModelProperty(value = "提醒内容", name = "content",example = "\"" + "{" + "\"text\": \"今天约了王老板,要求签订框架协议\"," + diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java index c44ebda48..1a6d7d97b 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java @@ -51,7 +51,7 @@ public class InvestTaskEntity extends InvestBaseEntity { */ @io.swagger.annotations.ApiModelProperty(value = "任务设定条件", name = "content",example = "\"{" + "\"business\": 1," + - " \"lastDate\": \"2018-10-01 12:18:48\"" + + " \"lastDate\": \"2018-10-01 12:18:48\",\"contractId\":222222222222" + "}\"") private String content; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestPageQuery.java b/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestPageQuery.java index b5d131c64..47773257e 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestPageQuery.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestPageQuery.java @@ -6,6 +6,9 @@ import java.util.List; @Data public class InvestPageQuery { + public InvestPageQuery(T queryData) { + this.queryData = queryData; + } @io.swagger.annotations.ApiModelProperty(value = "当前页", name = "pageNum", example = "1") private Integer pageNum = 1; diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java index d8257e549..7783347dd 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java @@ -11,7 +11,7 @@ import java.util.List; public interface InvestBizService { - InvestPageResult queryPageDemand(InvestPageQuery params); + InvestPageResult queryPageDemand(InvestPageQuery params); InvestPageResult queryPageTask(InvestPageQuery params); @@ -26,4 +26,6 @@ public interface InvestBizService { InvestDemandVo findDemandById(Long id) ; InvestTaskVo findTaskById(Long id) ; + + InvestFollowRecordVo findFollowRecordById(Long id) ; } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 5c9685253..3ba8784b0 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -1,6 +1,8 @@ package com.iformall.service.invest.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iformall.domain.dto.InvestDemandDto; import com.iformall.domain.po.*; import com.iformall.domain.po.invest.InvestCustomerEntity; @@ -44,13 +46,14 @@ public class InvestBizServiceImpl implements InvestBizService { private MallUserInfoService userInfoService; @Override - public InvestPageResult queryPageDemand(InvestPageQuery params) { - InvestPageResult demandPage = demandService.queryPage(params); + public InvestPageResult queryPageDemand(InvestPageQuery params) { + InvestDemandDto queryDemand = params.getQueryData(); + InvestPageResult demandPage = demandService.queryPage(new InvestPageQuery<>(queryDemand)); InvestPageResult investPage = new InvestPageResult<>(); if (CollectionUtils.isEmpty(demandPage.getRecords())) { return investPage; } - List resultList = getTargeInfoList(demandPage); + List resultList = getTargeInfoList(demandPage, queryDemand.getCustomer()); BeanUtils.copyProperties(demandPage, investPage); investPage.setRecords(resultList); return investPage; @@ -107,14 +110,7 @@ public class InvestBizServiceImpl implements InvestBizService { for (InvestFollowRecordEntity item : recordList) { InvestCustomerEntity customerEntity = customerMap.get(item.getCustomerId()); WxBrand brand = brandMap.get(customerEntity.getBrandId()); - List ownerInfo = getMallUserInfos(usersMap, item); - InvestFollowRecordVo followRecordVo = new InvestFollowRecordVo(); - followRecordVo.setCustomer(customerEntity); - followRecordVo.setMemberInfo(ownerInfo); - followRecordVo.setBrand(brand); - followRecordVo.setOwnerInfo(usersMap.get(item.getOwner())); - BeanUtils.copyProperties(item, followRecordVo); - resultList.add(followRecordVo); + resultList.add(buildFollowRecordItem(usersMap, item, customerEntity, brand)); } BeanUtils.copyProperties(recordPage, investPage); @@ -189,6 +185,27 @@ public class InvestBizServiceImpl implements InvestBizService { return buildTaskItem(taskEntity, shop, usersMap); } + @Override + public InvestFollowRecordVo findFollowRecordById(Long id) { + Map usersMap = getUserInfoMap(); + InvestFollowRecordEntity followRecordEntity = followRecordService.getByIdNotNull(id); + InvestCustomerEntity customerEntity = customerService.getByIdNotNull(followRecordEntity.getCustomerId()); + WxBrand brand = brandService.getById(customerEntity.getBrandId()); + InvestFollowRecordVo followRecordVo = buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); + return followRecordVo; + } + + private InvestFollowRecordVo buildFollowRecordItem(Map usersMap, InvestFollowRecordEntity item, InvestCustomerEntity customerEntity, WxBrand brand) { + List ownerInfo = getMallUserInfos(usersMap, item); + InvestFollowRecordVo followRecordVo = new InvestFollowRecordVo(); + followRecordVo.setCustomer(customerEntity); + followRecordVo.setMemberInfo(ownerInfo); + followRecordVo.setBrand(brand); + followRecordVo.setOwnerInfo(usersMap.get(item.getOwner())); + BeanUtils.copyProperties(item, followRecordVo); + return followRecordVo; + } + private InvestDemandVo buildDemindItem(InvestDemandEntity item, InvestCustomerEntity customer, WxBrand brand, WxShop shop, Map usersMap) { InvestDemandVo resultItemVo = new InvestDemandVo(); resultItemVo.setBrand(brand); @@ -224,10 +241,12 @@ public class InvestBizServiceImpl implements InvestBizService { return ownerInfo; } - private List getTargeInfoList(InvestPageResult demandPage) { + private List getTargeInfoList(InvestPageResult demandPage, InvestCustomerEntity queryCustomer) { List demandList = demandPage.getRecords(); //2、客户信息 - Collection customers = getCustomers(demandList.stream().map(InvestDemandEntity::getCustomerId)); + LambdaQueryWrapper customerWrapper = new LambdaQueryWrapper<>(queryCustomer); + customerWrapper.in(InvestCustomerEntity::getId, demandList.stream().map(InvestDemandEntity::getCustomerId)); + Collection customers = customerService.list(new QueryWrapper<>(queryCustomer)); Map customersMap = getCustomerMap(customers); //3、目标信息