diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestCustomerController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestCustomerController.java index 27a468b97..6a2b9bd8b 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestCustomerController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestCustomerController.java @@ -1,85 +1,88 @@ -//package com.iformall.controller.invest; -// -//import java.util.Arrays; -//import java.util.List; -// -//import com.iformall.annotation.SystemControllerLog; -//import com.iformall.common.ResultData; -//import com.iformall.domain.po.InvestCustomerEntity; -//import com.iformall.service.invest.InvestCustomerService; -//import io.swagger.annotations.Api; -//import io.swagger.annotations.ApiOperation; -//import lombok.extern.slf4j.Slf4j; -//import org.springframework.web.bind.annotation.*; -//import org.springframework.beans.factory.annotation.Autowired; -// -// -///** -// * 客户管理 -// * -// * @author -// * @email -// * @date 2019-09-23 18:40:43 -// */ -//@Slf4j -//@RestController -//@RequestMapping("invest/customer") -//@Api(tags = "客户管理") -//public class InvestCustomerController { -// @Autowired -// private InvestCustomerService investCustomerService; -// -// /** -// * 客户列表 -// */ -// @ApiOperation("客户列表") -// @SystemControllerLog(description = "客户列表") -// @PostMapping("/list") -// public ResultData list(@RequestBody InvestCustomerEntity params) { -// List page = investCustomerService.queryPage(params); -// return new ResultData(page); -// } -// -// -// /** -// * 客户详细信息 -// */ -// @SystemControllerLog(description = "客户详细信息") -// @GetMapping("/info/{id}") -// public ResultData info(@PathVariable("id") Long id) { -// InvestCustomerEntity investCustomer = investCustomerService.getById(id); -// return new ResultData(investCustomer); -// } -// -// /** -// * 保存客户 -// */ -// @SystemControllerLog(description = "保存客户") -// @PostMapping("/save") -// public ResultData save(@RequestBody InvestCustomerEntity investCustomer) { -// investCustomerService.save(investCustomer); -// return new ResultData(); -// } -// -// /** -// * 修改客户信息 -// */ -// @SystemControllerLog(description = "修改客户信息") -// @PostMapping("/update") -// public ResultData update(@RequestBody InvestCustomerEntity investCustomer) { -// investCustomerService.updateById(investCustomer); -// -// return new ResultData(); -// } -// -// /** -// * 删除客户信息 -// */ -// @SystemControllerLog(description = "删除客户信息") -// @GetMapping("/delete") -// public ResultData delete(@RequestBody Long[] ids) { -// investCustomerService.removeByIds(Arrays.asList(ids)); -// return new ResultData(); -// } -// -//} +package com.iformall.controller.invest; + +import java.util.Arrays; +import java.util.List; + +import com.iformall.annotation.SystemControllerLog; +import com.iformall.common.InvestResultData; +import com.iformall.common.ResultData; +import com.iformall.domain.po.InvestCustomerEntity; +import com.iformall.domain.po.InvestTaskEntity; +import com.iformall.domain.vo.invest.InvestPageQuery; +import com.iformall.domain.vo.invest.InvestPageResult; +import com.iformall.service.invest.InvestCustomerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + + +/** + * 客户管理 + * + * @author + * @email + * @date 2019-09-23 18:40:43 + */ +@Slf4j +@RestController +@RequestMapping("invest/customer") +@Api(tags = "客户管理") +public class InvestCustomerController extends InvestBaseController{ + @Autowired + private InvestCustomerService investCustomerService; + + /** + * 客户列表 + */ + @ApiOperation("客户列表") + @SystemControllerLog(description = "客户列表") + @PostMapping("/list") + public InvestResultData> list(InvestPageQuery params) { + return execute(params, p -> investCustomerService.queryPage(p)); + } + + + /** + // * 客户详细信息 + // */ + //@SystemControllerLog(description = "客户详细信息") + //@GetMapping("/info/{id}") + //public ResultData info(@PathVariable("id") Long id) { + // InvestCustomerEntity investCustomer = investCustomerService.getById(id); + // return new ResultData(investCustomer); + //} + + ///** + // * 保存客户 + // */ + //@SystemControllerLog(description = "保存客户") + //@PostMapping("/save") + //public ResultData save(@RequestBody InvestCustomerEntity investCustomer) { + // investCustomerService.save(investCustomer); + // return new ResultData(); + //} + // + ///** + // * 修改客户信息 + // */ + //@SystemControllerLog(description = "修改客户信息") + //@PostMapping("/update") + //public ResultData update(@RequestBody InvestCustomerEntity investCustomer) { + // investCustomerService.updateById(investCustomer); + // + // return new ResultData(); + //} + + ///** + // * 删除客户信息 + // */ + //@SystemControllerLog(description = "删除客户信息") + //@GetMapping("/delete") + //public ResultData delete(@RequestBody Long[] ids) { + // investCustomerService.removeByIds(Arrays.asList(ids)); + // return new ResultData(); + //} + +} diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestCustomerService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestCustomerService.java index da3ff152b..1247f2109 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestCustomerService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestCustomerService.java @@ -3,8 +3,7 @@ package com.iformall.service.invest; import com.baomidou.mybatisplus.extension.service.IService; import com.iformall.domain.po.InvestCustomerEntity; import com.iformall.domain.vo.invest.InvestPageQuery; - -import java.util.List; +import com.iformall.domain.vo.invest.InvestPageResult; /** * 客户列表 @@ -15,6 +14,6 @@ import java.util.List; */ public interface InvestCustomerService extends IService,InvestBaseService { - List queryPage(InvestPageQuery params); + InvestPageResult queryPage(InvestPageQuery params); } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java index 35caaba37..a8ed062ad 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java @@ -1,18 +1,26 @@ package com.iformall.service.invest.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.iformall.common.ErrorCode; import com.iformall.common.TableLog; import com.iformall.domain.po.InvestCustomerEntity; +import com.iformall.domain.po.InvestTaskEntity; import com.iformall.domain.vo.invest.InvestPageQuery; +import com.iformall.domain.vo.invest.InvestPageResult; +import com.iformall.domain.vo.invest.InvestTaskVo; import com.iformall.mapper.InvestCustomerDao; import com.iformall.service.WxBrandService; import com.iformall.service.WxBusinessService; import com.iformall.service.invest.InvestCustomerService; +import com.iformall.service.invest.InvestHelper; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; import java.util.Objects; import static com.iformall.service.invest.InvestHelper.isTrue; @@ -26,8 +34,21 @@ public class InvestCustomerServiceImpl extends InvestBaseServiceImpl params) { - return this.list(); + public InvestPageResult queryPage(InvestPageQuery params) { + InvestHelper.allNotNull(params); + Page queryPage = buildQueryPage(params); + //1、任务信息 + InvestCustomerEntity queryData = params.getQueryData(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(queryData); + IPage taskPage = this.page(queryPage, queryWrapper); + + + InvestPageResult investPage = new InvestPageResult<>(); + if (CollectionUtils.isEmpty(taskPage.getRecords())) { + return investPage; + } + BeanUtils.copyProperties(taskPage, investPage); + return investPage; } @Override