| @@ -39,6 +39,10 @@ public class InvestBaseController extends BaseController { | |||
| } catch (MallinkException e) { | |||
| log.error("execute error", e); | |||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (NullPointerException e) { | |||
| ErrorCode errorCode = ErrorCode.SYS_NULLPOINTER_ERROR ; | |||
| log.error("execute error", errorCode.getMessage()); | |||
| return new InvestResultData(errorCode); | |||
| } catch (Exception e) { | |||
| log.error("execute error", e); | |||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),e.getMessage()); | |||
| @@ -3,8 +3,8 @@ package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestFollowRecordEntity; | |||
| import com.iformall.domain.vo.invest.InvestFollowQuery; | |||
| 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; | |||
| import com.iformall.service.invest.InvestFollowRecordService; | |||
| @@ -41,7 +41,7 @@ public class InvestFollowRecordController extends InvestBaseController { | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestFollowRecordVo>> list(InvestPageQuery<InvestFollowRecordEntity> params) { | |||
| public InvestResultData<InvestPageResult<InvestFollowRecordVo>> list(InvestFollowQuery params) { | |||
| return execute(params, p -> bizService.queryPageFollowRecord(p)); | |||
| } | |||
| @@ -5,6 +5,8 @@ import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestRemindEntity; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.domain.vo.invest.InvestRemindVo; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestRemindService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -32,6 +34,8 @@ import java.util.Arrays; | |||
| public class InvestRemindController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestRemindService investRemindService; | |||
| @Autowired | |||
| private InvestBizService bizService; | |||
| /** | |||
| * 分页列表 | |||
| @@ -39,8 +43,8 @@ public class InvestRemindController extends InvestBaseController { | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestRemindEntity>> list(InvestPageQuery<InvestRemindEntity> params) { | |||
| return execute(params, p -> investRemindService.queryPage(p)); | |||
| public InvestResultData<InvestPageResult<InvestRemindVo>> list(InvestPageQuery<InvestRemindEntity> params) { | |||
| return execute(params, p -> bizService.queryPageRemind(p)); | |||
| } | |||
| @@ -50,7 +54,7 @@ public class InvestRemindController extends InvestBaseController { | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestRemindEntity> info(@PathVariable("id") Long id) { | |||
| return execute(id, p -> investRemindService.getByIdNotNull(p)); | |||
| return execute(id, p -> bizService.findRemindById(p)); | |||
| } | |||
| /** | |||
| @@ -28,6 +28,6 @@ public class InvestDemandQuery extends InvestPageQuery { | |||
| * 负责人 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "负责人", name = "owner") | |||
| private Long owner; | |||
| private Long demandOwner; | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| package com.iformall.domain.vo.invest; | |||
| import com.iformall.enums.EnumFollowType; | |||
| import com.iformall.enums.EnumTaskStatus; | |||
| import lombok.Data; | |||
| @Data | |||
| public class InvestFollowQuery extends InvestPageQuery { | |||
| /** | |||
| * 跟踪类型:0-招商任务;1-客户需求 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "跟踪类型:0-招商任务;1-客户需求", name = "type") | |||
| private EnumFollowType type; | |||
| /** | |||
| * 跟踪类型的主键ID | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "跟踪类型的主键ID", name = "followId") | |||
| private Long followId; | |||
| } | |||
| @@ -9,7 +9,7 @@ public class InvestTaskQuery extends InvestPageQuery { | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||
| private String shopNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="status") | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="shopStatus") | |||
| private Integer shopStatus; | |||
| /** | |||
| * 经营业态 | |||
| @@ -20,13 +20,13 @@ public class InvestTaskQuery extends InvestPageQuery { | |||
| /** | |||
| * 负责人 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "负责人", name = "owner") | |||
| @io.swagger.annotations.ApiModelProperty(value = "负责人", name = "taskOwner") | |||
| private String taskOwner; | |||
| /** | |||
| * 任务状态:-1-关闭;0-待分配;1-洽谈中;2-意向签约;3-已完成 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "任务状态:-1-关闭;0-待分配;1-洽谈中;2-意向签约;3-已完成", name = "status") | |||
| @io.swagger.annotations.ApiModelProperty(value = "任务状态:-1-关闭;0-待分配;1-洽谈中;2-意向签约;3-已完成", name = "taskStatus") | |||
| private EnumTaskStatus taskStatus; | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.enums; | |||
| import com.baomidou.mybatisplus.annotation.EnumValue; | |||
| import com.fasterxml.jackson.annotation.JsonValue; | |||
| /** | |||
| * 拜访方式:0-拜访;1-来访;2-电话;3-短信、微信或其它 | |||
| @@ -30,6 +31,7 @@ public enum EnumNegotiationType { | |||
| this.info = info; | |||
| } | |||
| @JsonValue | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| @@ -1,8 +1,6 @@ | |||
| package com.iformall.service.invest; | |||
| import com.iformall.domain.dto.InvestDemandDto; | |||
| import com.iformall.domain.dto.InvestTaskDto; | |||
| import com.iformall.domain.po.invest.InvestFollowRecordEntity; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.invest.InvestRemindEntity; | |||
| import com.iformall.domain.vo.invest.*; | |||
| @@ -15,7 +13,7 @@ public interface InvestBizService { | |||
| InvestPageResult<InvestTaskVo> queryPageTask(InvestTaskQuery params); | |||
| InvestPageResult<InvestFollowRecordVo> queryPageFollowRecord(InvestPageQuery<InvestFollowRecordEntity> params); | |||
| InvestPageResult<InvestFollowRecordVo> queryPageFollowRecord(InvestFollowQuery params); | |||
| InvestPageResult<InvestRemindVo> queryPageRemind(InvestPageQuery<InvestRemindEntity> params); | |||
| @@ -29,6 +27,8 @@ public interface InvestBizService { | |||
| InvestTaskVo findTaskById(Long id) ; | |||
| InvestRemindVo findRemindById(Long id) ; | |||
| InvestFollowRecordVo findFollowRecordById(Long id) ; | |||
| @@ -90,9 +90,9 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| } | |||
| InvestDemandEntity demandEntity = null; | |||
| if (ObjectUtils.anyNotNull(params.getOwner())) { | |||
| if (ObjectUtils.anyNotNull(params.getDemandOwner())) { | |||
| demandEntity = new InvestDemandEntity(); | |||
| demandEntity.setOwner(params.getOwner()); | |||
| demandEntity.setOwner(params.getDemandOwner()); | |||
| } | |||
| @@ -171,8 +171,14 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| } | |||
| @Override | |||
| public InvestPageResult<InvestFollowRecordVo> queryPageFollowRecord(InvestPageQuery<InvestFollowRecordEntity> params) { | |||
| InvestPageResult<InvestFollowRecordEntity> recordPage = followRecordService.queryPage(params); | |||
| public InvestPageResult<InvestFollowRecordVo> queryPageFollowRecord(InvestFollowQuery params) { | |||
| InvestHelper.notNull(params); | |||
| InvestFollowRecordEntity followRecordEntity = new InvestFollowRecordEntity(); | |||
| followRecordEntity.setFollowId(params.getFollowId()); | |||
| followRecordEntity.setType(params.getType()); | |||
| InvestPageQuery<InvestFollowRecordEntity> pageQuery = buildPageQuery(params, followRecordEntity); | |||
| InvestPageResult<InvestFollowRecordEntity> recordPage = followRecordService.queryPage(pageQuery); | |||
| InvestPageResult<InvestFollowRecordVo> investPage = new InvestPageResult<>(); | |||
| if (CollectionUtils.isEmpty(recordPage.getRecords())) { | |||
| @@ -211,18 +217,9 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| return investPage; | |||
| } | |||
| Collection<InvestRemindEntity> recordList = recordPage.getRecords(); | |||
| Collection<InvestRemindVo> resultList = Collections.emptyList(); | |||
| Collection<InvestRemindVo> resultList = new ArrayList<>(Collections.emptyList()); | |||
| for (InvestRemindEntity investRemindEntity : recordList) { | |||
| InvestRemindVo remindVo = new InvestRemindVo(); | |||
| BeanUtils.copyProperties(investRemindEntity, remindVo); | |||
| HashMap contentMap = JSON.parseObject(investRemindEntity.getContent(), HashMap.class); | |||
| if (MapUtils.isNotEmpty(contentMap)) { | |||
| Object customerId = contentMap.get(InvestRemindEntity.KEY_CUSTOMER); | |||
| remindVo.setCustomerId(Objects.isNull(customerId) ? null : Long.parseLong((String) customerId)); | |||
| Object negotiationType = contentMap.get(InvestRemindEntity.KEY_NEGOTIATIONTYPE); | |||
| remindVo.setNegotiationType(EnumNegotiationType.getEnum(Integer.valueOf((String) negotiationType))); | |||
| } | |||
| resultList.add(remindVo); | |||
| resultList.add(buildRemindItem(investRemindEntity)); | |||
| } | |||
| //2、用户信息 | |||
| @@ -312,6 +309,21 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| return buildTaskItem(taskEntity, shop, usersMap); | |||
| } | |||
| @Override | |||
| public InvestRemindVo findRemindById(Long id) { | |||
| InvestRemindEntity remindEntity = remindService.getByIdNotNull(id); | |||
| InvestRemindVo remindVo = buildRemindItem(remindEntity); | |||
| InvestCustomerEntity customerEntity = customerService.getByIdNotNull(remindVo.getCustomerId()); | |||
| if (Objects.nonNull(customerEntity)) { | |||
| remindVo.setCustomer(customerEntity); | |||
| remindVo.setBrand(brandService.getById(customerEntity.getBrandId())); | |||
| } | |||
| remindVo.setOwnerInfo(userInfoService.getById(remindEntity.getOwner())); | |||
| return remindVo; | |||
| } | |||
| @Override | |||
| public InvestFollowRecordVo findFollowRecordById(Long id) { | |||
| InvestFollowRecordEntity followRecordEntity = followRecordService.getByIdNotNull(id); | |||
| @@ -353,6 +365,20 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| return resultItemVo; | |||
| } | |||
| private InvestRemindVo buildRemindItem(InvestRemindEntity remindEntity) { | |||
| InvestRemindVo remindVo = new InvestRemindVo(); | |||
| BeanUtils.copyProperties(remindEntity, remindVo); | |||
| HashMap contentMap = JSON.parseObject(remindEntity.getContent(), HashMap.class); | |||
| if (MapUtils.isNotEmpty(contentMap)) { | |||
| Object customerId = contentMap.get(InvestRemindEntity.KEY_CUSTOMER); | |||
| remindVo.setCustomerId(Objects.isNull(customerId) ? null : Long.parseLong((String) customerId)); | |||
| Object negotiationType = contentMap.get(InvestRemindEntity.KEY_NEGOTIATIONTYPE); | |||
| remindVo.setNegotiationType(EnumNegotiationType.getEnum(Integer.valueOf((String) negotiationType))); | |||
| } | |||
| return remindVo; | |||
| } | |||
| private List<MallUserInfo> getMallUserInfos(Object userJson, Map<Long, MallUserInfo> usersMap) { | |||
| List<MallUserInfo> ownerInfo = Lists.newArrayList(); | |||
| JSONArray ownerList; | |||
| @@ -3,6 +3,8 @@ package com.iformall.service.invest.impl; | |||
| import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.domain.po.invest.InvestFollowRecordEntity; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.domain.vo.invest.InvestUserContext; | |||
| import com.iformall.enums.EnumFollowType; | |||
| import com.iformall.mapper.InvestFollowRecordDao; | |||
| @@ -23,6 +25,15 @@ public class InvestFollowRecordServiceImpl extends InvestBaseServiceImpl<InvestF | |||
| @Autowired | |||
| private InvestTaskService taskService ; | |||
| @Override | |||
| public InvestPageResult<InvestFollowRecordEntity> queryPage(InvestPageQuery<InvestFollowRecordEntity> params) { | |||
| InvestFollowRecordEntity queryData = params.getQueryData(); | |||
| InvestHelper.notNull(queryData); | |||
| InvestHelper.notNull(queryData.getFollowId(), "followId"); | |||
| InvestHelper.notNull(queryData.getType(), "type"); | |||
| return super.queryPage(params); | |||
| } | |||
| @Override | |||
| public boolean save(InvestFollowRecordEntity entity) { | |||
| entity.setOperator(InvestUserContext.getUserId()); | |||