| @@ -2,8 +2,7 @@ package com.iformall.controller.invest; | |||||
| import com.iformall.annotation.SystemServiceLog; | import com.iformall.annotation.SystemServiceLog; | ||||
| import com.iformall.common.InvestResultData; | import com.iformall.common.InvestResultData; | ||||
| import com.iformall.domain.dto.InvestDemandDto; | |||||
| import com.iformall.domain.po.invest.InvestDemandEntity; | |||||
| import com.iformall.domain.dto.InvestCustomerDto; | |||||
| import com.iformall.domain.vo.invest.InvestDemandVo; | import com.iformall.domain.vo.invest.InvestDemandVo; | ||||
| import com.iformall.domain.vo.invest.InvestPageQuery; | import com.iformall.domain.vo.invest.InvestPageQuery; | ||||
| import com.iformall.domain.vo.invest.InvestPageResult; | import com.iformall.domain.vo.invest.InvestPageResult; | ||||
| @@ -43,7 +42,7 @@ public class InvestDemandController extends InvestBaseController { | |||||
| @SystemServiceLog | @SystemServiceLog | ||||
| @ApiOperation(value = "分页列表接口") | @ApiOperation(value = "分页列表接口") | ||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| public InvestResultData<InvestPageResult<InvestDemandVo>> list(InvestPageQuery<InvestDemandDto> params) { | |||||
| public InvestResultData<InvestPageResult<InvestDemandVo>> list(InvestPageQuery<InvestCustomerDto> params) { | |||||
| return execute(params, p -> investBizService.queryPageDemand(p)); | return execute(params, p -> investBizService.queryPageDemand(p)); | ||||
| } | } | ||||
| @@ -62,7 +61,7 @@ public class InvestDemandController extends InvestBaseController { | |||||
| */ | */ | ||||
| @SystemServiceLog | @SystemServiceLog | ||||
| @PostMapping("/save") | @PostMapping("/save") | ||||
| public InvestResultData save(@RequestBody InvestDemandDto investDemand) { | |||||
| public InvestResultData save(@RequestBody InvestCustomerDto investDemand) { | |||||
| return execute(investDemand, p -> investBizService.saveCustomerAndDemand(p)); | return execute(investDemand, p -> investBizService.saveCustomerAndDemand(p)); | ||||
| } | } | ||||
| @@ -71,7 +70,7 @@ public class InvestDemandController extends InvestBaseController { | |||||
| */ | */ | ||||
| @SystemServiceLog | @SystemServiceLog | ||||
| @PostMapping("/update") | @PostMapping("/update") | ||||
| public InvestResultData update(@RequestBody InvestDemandDto investDemand) { | |||||
| public InvestResultData update(@RequestBody InvestCustomerDto investDemand) { | |||||
| return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p)); | return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p)); | ||||
| } | } | ||||
| @@ -53,7 +53,7 @@ public class InvestRemindController extends InvestBaseController { | |||||
| /** | /** | ||||
| * 保存 | * 保存 | ||||
| */ | */ | ||||
| @RequiresPermissions("investFollowRecordEdit") | |||||
| //@RequiresPermissions("investFollowRecordEdit") | |||||
| @PostMapping("/save") | @PostMapping("/save") | ||||
| public InvestResultData save(@RequestBody InvestRemindEntity investRemind) { | public InvestResultData save(@RequestBody InvestRemindEntity investRemind) { | ||||
| return execute(investRemind, p -> investRemindService.save(p)); | return execute(investRemind, p -> investRemindService.save(p)); | ||||
| @@ -45,7 +45,6 @@ public class InvestTaskController extends InvestBaseController { | |||||
| return execute(params, p -> bizService.queryPageTask(p)); | return execute(params, p -> bizService.queryPageTask(p)); | ||||
| } | } | ||||
| /** | /** | ||||
| * 信息 | * 信息 | ||||
| */ | */ | ||||
| @@ -58,7 +57,7 @@ public class InvestTaskController extends InvestBaseController { | |||||
| /** | /** | ||||
| * 保存 | * 保存 | ||||
| */ | */ | ||||
| @RequiresPermissions("investTaskEdit") | |||||
| //@RequiresPermissions("investTaskEdit") | |||||
| @SystemServiceLog | @SystemServiceLog | ||||
| @PostMapping("/save") | @PostMapping("/save") | ||||
| public InvestResultData save(@RequestBody InvestTaskEntity investTask) { | public InvestResultData save(@RequestBody InvestTaskEntity investTask) { | ||||
| @@ -0,0 +1,18 @@ | |||||
| package com.iformall.domain.dto; | |||||
| import com.iformall.common.LogColumn; | |||||
| import com.iformall.domain.po.invest.InvestCustomerEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestCustomerDto extends InvestCustomerEntity { | |||||
| /** | |||||
| * 负责人 | |||||
| */ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "招商负责人", name = "owner") | |||||
| @LogColumn | |||||
| private Long owner; | |||||
| } | |||||
| @@ -1,14 +0,0 @@ | |||||
| package com.iformall.domain.dto; | |||||
| import com.iformall.domain.po.invest.InvestCustomerEntity; | |||||
| import com.iformall.domain.po.invest.InvestDemandEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestDemandDto extends InvestDemandEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer",required = true) | |||||
| private InvestCustomerEntity customer; | |||||
| } | |||||
| @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; | |||||
| * 客户预评级:0-无;1-主力店;2-次主力店;3-甲;4-乙;5-丙 | * 客户预评级:0-无;1-主力店;2-次主力店;3-甲;4-乙;5-丙 | ||||
| */ | */ | ||||
| public enum EnumCustomerRatingType { | public enum EnumCustomerRatingType { | ||||
| NULL(0, ""), | |||||
| NONE(0, ""), | |||||
| MAIN(1, "主力店"), | MAIN(1, "主力店"), | ||||
| SECONDARY(2, "次主力店"), | SECONDARY(2, "次主力店"), | ||||
| THIRD(3, "甲"), | THIRD(3, "甲"), | ||||
| @@ -1,7 +1,6 @@ | |||||
| package com.iformall.service.invest; | package com.iformall.service.invest; | ||||
| import com.iformall.domain.dto.InvestDemandDto; | |||||
| import com.iformall.domain.po.invest.InvestDemandEntity; | |||||
| import com.iformall.domain.dto.InvestCustomerDto; | |||||
| import com.iformall.domain.po.invest.InvestFollowRecordEntity; | import com.iformall.domain.po.invest.InvestFollowRecordEntity; | ||||
| import com.iformall.domain.po.invest.InvestTaskEntity; | import com.iformall.domain.po.invest.InvestTaskEntity; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| @@ -11,7 +10,7 @@ import java.util.List; | |||||
| public interface InvestBizService { | public interface InvestBizService { | ||||
| InvestPageResult<InvestDemandVo> queryPageDemand(InvestPageQuery<InvestDemandDto> params); | |||||
| InvestPageResult<InvestDemandVo> queryPageDemand(InvestPageQuery<InvestCustomerDto> params); | |||||
| InvestPageResult<InvestTaskVo> queryPageTask(InvestPageQuery<InvestTaskEntity> params); | InvestPageResult<InvestTaskVo> queryPageTask(InvestPageQuery<InvestTaskEntity> params); | ||||
| @@ -19,9 +18,9 @@ public interface InvestBizService { | |||||
| List<MallUserInfo> queryUserList() ; | List<MallUserInfo> queryUserList() ; | ||||
| boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) ; | |||||
| boolean saveCustomerAndDemand(InvestCustomerDto customerDemandDto) ; | |||||
| boolean updateCustomerAndDemand(InvestDemandDto demandDto) ; | |||||
| boolean updateCustomerAndDemand(InvestCustomerDto demandDto) ; | |||||
| InvestDemandVo findDemandById(Long id) ; | InvestDemandVo findDemandById(Long id) ; | ||||
| @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.iformall.domain.dto.InvestDemandDto; | |||||
| import com.iformall.domain.dto.InvestCustomerDto; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.invest.InvestCustomerEntity; | import com.iformall.domain.po.invest.InvestCustomerEntity; | ||||
| import com.iformall.domain.po.invest.InvestDemandEntity; | import com.iformall.domain.po.invest.InvestDemandEntity; | ||||
| @@ -47,14 +47,19 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| private MallUserInfoService userInfoService; | private MallUserInfoService userInfoService; | ||||
| @Override | @Override | ||||
| public InvestPageResult<InvestDemandVo> queryPageDemand(InvestPageQuery<InvestDemandDto> params) { | |||||
| InvestDemandDto queryDemand = params.getQueryData(); | |||||
| public InvestPageResult<InvestDemandVo> queryPageDemand(InvestPageQuery<InvestCustomerDto> params) { | |||||
| InvestCustomerDto queryParams = params.getQueryData(); | |||||
| InvestDemandEntity queryDemand = null; | |||||
| if (Objects.nonNull(queryParams)) { | |||||
| queryDemand = new InvestDemandEntity(); | |||||
| queryDemand.setOwner(queryParams.getOwner()); | |||||
| } | |||||
| InvestPageResult<InvestDemandEntity> demandPage = demandService.queryPage(new InvestPageQuery<>(queryDemand)); | InvestPageResult<InvestDemandEntity> demandPage = demandService.queryPage(new InvestPageQuery<>(queryDemand)); | ||||
| InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); | InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); | ||||
| if (CollectionUtils.isEmpty(demandPage.getRecords())) { | if (CollectionUtils.isEmpty(demandPage.getRecords())) { | ||||
| return investPage; | return investPage; | ||||
| } | } | ||||
| List<InvestDemandVo> resultList = getTargeInfoList(demandPage, queryDemand.getCustomer()); | |||||
| List<InvestDemandVo> resultList = getTargeInfoList(demandPage, queryParams); | |||||
| BeanUtils.copyProperties(demandPage, investPage); | BeanUtils.copyProperties(demandPage, investPage); | ||||
| investPage.setRecords(resultList); | investPage.setRecords(resultList); | ||||
| return investPage; | return investPage; | ||||
| @@ -139,10 +144,10 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| @Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
| @Override | @Override | ||||
| public boolean saveCustomerAndDemand(InvestDemandDto demandDto) { | |||||
| public boolean saveCustomerAndDemand(InvestCustomerDto demandDto) { | |||||
| InvestHelper.notNull(demandDto); | InvestHelper.notNull(demandDto); | ||||
| InvestCustomerEntity customerEntity = demandDto.getCustomer(); | |||||
| InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getCustomerId()); | |||||
| InvestCustomerEntity customerEntity = demandDto; | |||||
| InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getId()); | |||||
| if (Objects.nonNull(customerEntity)) { | if (Objects.nonNull(customerEntity)) { | ||||
| if (Objects.isNull(customerEntityDB)) { | if (Objects.isNull(customerEntityDB)) { | ||||
| customerService.save(customerEntity); | customerService.save(customerEntity); | ||||
| @@ -158,9 +163,9 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| @Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
| @Override | @Override | ||||
| public boolean updateCustomerAndDemand(InvestDemandDto demandDto) { | |||||
| InvestHelper.notNull(demandDto, demandDto.getCustomerId()); | |||||
| InvestCustomerEntity customerEntity = demandDto.getCustomer(); | |||||
| public boolean updateCustomerAndDemand(InvestCustomerDto demandDto) { | |||||
| InvestHelper.notNull(demandDto, demandDto.getId()); | |||||
| InvestCustomerEntity customerEntity = demandDto; | |||||
| InvestHelper.notNull(customerEntity); | InvestHelper.notNull(customerEntity); | ||||
| customerService.updateById(customerEntity); | customerService.updateById(customerEntity); | ||||
| InvestDemandEntity demandEntity = new InvestDemandEntity(); | InvestDemandEntity demandEntity = new InvestDemandEntity(); | ||||
| @@ -192,8 +197,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| InvestFollowRecordEntity followRecordEntity = followRecordService.getByIdNotNull(id); | InvestFollowRecordEntity followRecordEntity = followRecordService.getByIdNotNull(id); | ||||
| InvestCustomerEntity customerEntity = customerService.getByIdNotNull(followRecordEntity.getCustomerId()); | InvestCustomerEntity customerEntity = customerService.getByIdNotNull(followRecordEntity.getCustomerId()); | ||||
| WxBrand brand = brandService.getById(customerEntity.getBrandId()); | WxBrand brand = brandService.getById(customerEntity.getBrandId()); | ||||
| InvestFollowRecordVo followRecordVo = buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); | |||||
| return followRecordVo; | |||||
| return buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); | |||||
| } | } | ||||
| private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item, InvestCustomerEntity customerEntity, WxBrand brand) { | private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item, InvestCustomerEntity customerEntity, WxBrand brand) { | ||||