Browse Source

陌生人导览模块与王合并代码

dev
sunyuchao 6 years ago
parent
commit
b7e9e74cf8
  1. 6
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
  2. 30
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java
  3. 33
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java
  4. 10
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java
  5. 35
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java
  6. 44
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
  7. 79
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java

6
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java

@ -24,7 +24,6 @@ import com.epmet.dto.form.StrangerFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.service.StrangerAccessRecordService;
import com.epmet.service.StrangerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -43,9 +42,6 @@ import java.util.List;
@RequestMapping("stranger")
public class StrangerResiGuideController {
@Autowired
private StrangerService strangerService;
@Autowired
private StrangerAccessRecordService strangerAccessRecordService;
@ -57,7 +53,7 @@ public class StrangerResiGuideController {
**/
@PostMapping("getgridhome")
public Result<HomeDesignByCustomerResultDTO> getValidCustomerList(@RequestBody StrangerFormDTO formDTO) throws Exception {
return strangerService.getgridhome(formDTO);
return strangerAccessRecordService.getgridhome(formDTO);
}

30
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java

@ -1,30 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.StrangerEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @author sun
*/
@Mapper
public interface StrangerDao extends BaseDao<StrangerEntity> {
}

33
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java

@ -1,33 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("stranger")
public class StrangerEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
}

10
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java

@ -5,7 +5,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StrangerAccessRecordDTO;
import com.epmet.dto.form.CustomerGridListFormDTO;
import com.epmet.dto.form.StrangerFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.entity.StrangerAccessRecordEntity;
import java.util.List;
@ -96,4 +98,12 @@ public interface StrangerAccessRecordService extends BaseService<StrangerAccessR
* @Date 2020.03.19 14:28
**/
Result<List<CustomerGridForStrangerResultDTO>> listCustomerGrid(CustomerGridListFormDTO customerGridListFormDTO);
/**
* 居民端-网格链接获取客户首页配置
* @param
* @return void
* @author sun
*/
Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO);
}

35
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java

@ -1,35 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StrangerFormDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.entity.StrangerEntity;
public interface StrangerService extends BaseService<StrangerEntity> {
/**
* 居民端-网格链接获取客户首页配置
* @param
* @return void
* @author sun
*/
Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO);
}

44
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java

@ -7,11 +7,13 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.StrangerAccessRecordDao;
import com.epmet.dto.StrangerAccessRecordDTO;
import com.epmet.dto.form.CustomerGridListFormDTO;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.entity.StrangerAccessRecordEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OperCustomizeFeignClient;
import com.epmet.service.StrangerAccessRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -39,6 +41,10 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
private StrangerAccessRecordDao strangerAccessRecordDao;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private OperCustomizeFeignClient operCustomizeFeignClient;
/**
* 查询陌生人访问记录
* @param params
@ -163,5 +169,39 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
}
/**
* 居民端-网格链接获取客户首页配置
* @return void
* @author sun
*/
@Override
public Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO) {
//token里边有所属端 userId这些参数 前台传递customerID和gridId
//1:调用epmet-user服务查询数据 新建网格记录数据
VisitedFormDTO vi = new VisitedFormDTO();
vi.setGridId(formDTO.getGridId());
vi.setCustomerId(formDTO.getCustomerId());
//vi.setUserId(token获取);
epmetUserFeignClient.saveLatestAndVisited(vi);
//2:调用ope-customize服务 获取首页发布数据
Result<HomeDesignByCustomerResultDTO> res = getCustomerHomeData(formDTO.getCustomerId());
return res;
}
/**
* 调用oper-customize服务 获取首页发布数据
* @param customerId
* @return
* @author sun
*/
public Result<HomeDesignByCustomerResultDTO> getCustomerHomeData(String customerId){
CustomerHomeFormDTO dto = new CustomerHomeFormDTO();
dto.setCustomerId(customerId);
//dto.setClientType(token中获取);//居民端
return operCustomizeFeignClient.getHomeReleaseByCustomer(dto);
}
}

79
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java

@ -1,79 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.StrangerDao;
import com.epmet.dto.form.CustomerHomeFormDTO;
import com.epmet.dto.form.StrangerFormDTO;
import com.epmet.dto.form.VisitedFormDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.entity.StrangerEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCustomizeFeignClient;
import com.epmet.service.StrangerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 居民端-陌生人导览
*
* @author sun
* @since v1.0.0 2020-03-11
*/
@Service
public class StrangerServiceImpl extends BaseServiceImpl<StrangerDao, StrangerEntity> implements StrangerService {
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private OperCustomizeFeignClient operCustomizeFeignClient;
/**
* 居民端-网格链接获取客户首页配置
* @return void
* @author sun
*/
@Override
public Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO) {
//token里边有所属端 userId这些参数 前台传递customerID和gridId
//1:调用epmet-user服务查询数据 新建网格记录数据
VisitedFormDTO vi = new VisitedFormDTO();
vi.setGridId(formDTO.getGridId());
vi.setCustomerId(formDTO.getCustomerId());
//vi.setUserId(token获取);
epmetUserFeignClient.saveLatestAndVisited(vi);
//2:调用ope-customize服务 获取首页发布数据
Result<HomeDesignByCustomerResultDTO> res = getCustomerHomeData(formDTO.getCustomerId());
return res;
}
/**
* 调用oper-customize服务 获取首页发布数据
*/
public Result<HomeDesignByCustomerResultDTO> getCustomerHomeData(String customerId){
CustomerHomeFormDTO dto = new CustomerHomeFormDTO();
dto.setCustomerId(customerId);
//dto.setClientType(token中获取);//居民端
return operCustomizeFeignClient.getHomeReleaseByCustomer(dto);
}
}
Loading…
Cancel
Save