Browse Source

Merge branches 'dev1.0' and 'dev1.0-authlogin' of http://121.42.41.42:7070/r/epmet-cloud into dev1.0-authlogin

 Conflicts:
	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java
	epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml
dev_shibei_match
yinzuomei 5 years ago
parent
commit
d8d86efa14
  1. 2
      epmet-admin/epmet-admin-server/pom.xml
  2. 2
      epmet-auth/pom.xml
  3. 2
      epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  4. 4
      epmet-gateway/pom.xml
  5. 2
      epmet-module/epmet-activiti/epmet-activiti-server/pom.xml
  6. 2
      epmet-module/epmet-demo/epmet-demo-server/pom.xml
  7. 2
      epmet-module/epmet-job/epmet-job-server/pom.xml
  8. 2
      epmet-module/epmet-message/epmet-message-server/pom.xml
  9. 2
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  10. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  11. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  12. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  13. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  14. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  15. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java
  16. 19
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  17. 10
      epmet-module/oper-access/oper-access-server/pom.xml
  18. 2
      epmet-module/oper-crm/oper-crm-server/pom.xml
  19. 2
      epmet-module/oper-customize/oper-customize-server/pom.xml
  20. 2
      epmet-module/resi-guide/resi-guide-server/pom.xml
  21. 6
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  22. 4
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignFallBack.java
  23. 19
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
  24. 8
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/utils/ModuleConstant.java
  25. 2
      epmet-user/epmet-user-server/pom.xml
  26. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java
  27. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java
  28. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperRoleUserFeignClient.java
  29. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  30. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java
  31. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml
  32. 7
      epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml

2
epmet-admin/epmet-admin-server/pom.xml

@ -99,7 +99,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-auth/pom.xml

@ -123,7 +123,7 @@
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @Author yinzuomei
* @Date 2020/3/16 14:48
*/
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class)
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class )
public interface EpmetUserFeignClient {
/**

4
epmet-gateway/pom.xml

@ -95,9 +95,9 @@
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>

2
epmet-module/epmet-activiti/epmet-activiti-server/pom.xml

@ -175,7 +175,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/epmet-demo/epmet-demo-server/pom.xml

@ -115,7 +115,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -112,7 +112,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/epmet-message/epmet-message-server/pom.xml

@ -135,7 +135,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/epmet-oss/epmet-oss-server/pom.xml

@ -143,7 +143,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/gov-org/gov-org-server/pom.xml

@ -106,7 +106,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -112,11 +112,11 @@ public class CustomerGridController {
* @Author wangc
* @Date 2020.03.19 15:23
**/
@PostMapping("queryListForStrangerByOrder")
public Result<List<CustomerGridForStrangerResultDTO>> queryListForStrangerByOrder(@RequestBody ListCustomerGridFormDTO listCustomerGridFormDTO ){
@PostMapping("querygridlistbyareacode")
public Result<List<CustomerGridForStrangerResultDTO>> queryGridListByAreaCode(@RequestBody ListCustomerGridFormDTO listCustomerGridFormDTO ){
ValidatorUtils.validateEntity(listCustomerGridFormDTO);
return customerGridService.listGridForStrangerByOrder(listCustomerGridFormDTO);
return customerGridService.listGridByAreaCode(listCustomerGridFormDTO);
}
@GetMapping("getcustomergrid/{id}")

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -39,14 +39,6 @@ import java.util.Map;
public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
/**
* @Description 查特定区的网格
* @Param areaCode
* @return CustomerGridForStrangerResultDTO
* @Author wangc
* @Date 2020.03.19 15:53
**/
List<CustomerGridForStrangerResultDTO> selectGridByAreaCode(@Param("areaCode")String areaCode);
/**
* @Description 查整个城市的网格

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -105,7 +105,7 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @author wangc
* @date 2020-03-16
* */
Result<List<CustomerGridForStrangerResultDTO>> listGridForStrangerByOrder(ListCustomerGridFormDTO listCustomerGridFormDTO);
Result<List<CustomerGridForStrangerResultDTO>> listGridByAreaCode(ListCustomerGridFormDTO listCustomerGridFormDTO);
/** 根据网格Id查询用户数据
* @param customerGridFormDTO

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -33,6 +33,7 @@ import com.epmet.entity.CustomerGridEntity;
import com.epmet.redis.CustomerGridRedis;
import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -108,7 +109,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}
@Override
public Result<List<CustomerGridForStrangerResultDTO>> listGridForStrangerByOrder(ListCustomerGridFormDTO listCustomerGridFormDTO) {
public Result<List<CustomerGridForStrangerResultDTO>> listGridByAreaCode(ListCustomerGridFormDTO listCustomerGridFormDTO) {
Result<List<CustomerGridForStrangerResultDTO>> result = new Result<>();
@ -116,17 +117,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
String areaCode = listCustomerGridFormDTO.getAreaCode();
listCustomerGridFormDTO.setPageNo((listCustomerGridFormDTO.getPageNo() - 1) * listCustomerGridFormDTO.getPageSize());
if(areaCode.endsWith("00")){
if(areaCode.endsWith(ModuleConstant.LAST_TWO_LETTER_OF_FORMATIVE_CITY_CODE)){
//城市 - 查全部
listCustomerGridFormDTO.setAreaCode(areaCode.substring(0,areaCode.length()-2));
List<CustomerGridForStrangerResultDTO> gridList
= baseDao.selectGridByCityLike(listCustomerGridFormDTO);
result.setData(gridList);
result.setCode(0);
result.setCode(ModuleConstant.SUCCESS_CODE_RESULT);
return result;
}else{
//行政区
//行政区 - 指定行政区在前,所属城市下其余行政区在后
Map<String,Object> map = new HashMap<>();

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java

@ -0,0 +1,16 @@
package com.epmet.util;/**
* Created by 11 on 2020/3/23.
*/
/**
* @Description
* @IntefaceName ModuleConstant
* @Author wangc
* @date 2020.03.23 18:34
*/
public interface ModuleConstant {
String LAST_TWO_LETTER_OF_FORMATIVE_CITY_CODE = "00";
int SUCCESS_CODE_RESULT = 0;
}

19
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -22,23 +22,8 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 根据区县地区码匹配到当前区县下所有网格 -->
<select id="selectGridByAreaCode" parameterType="java.lang.String" resultType="com.epmet.dto.result.CustomerGridForStrangerResultDTO">
SELECT
id AS grid_id,
customer_id,
grid_name
FROM
CUSTOMER_GRID
WHERE
del_flag = 0
AND
area_code = #{areaCode}
ORDER BY
customer_id,
CONVERT ( grid_name USING gbk ) ASC
</select>
<select id="selectCustomerGridByGridId" parameterType="com.epmet.dto.form.CustomerGridFormDTO"
<select id="getCustomerGridByGridId" parameterType="com.epmet.dto.form.CustomerGridFormDTO"
resultType="com.epmet.dto.CustomerGridDTO">
SELECT
gr.id,

10
epmet-module/oper-access/oper-access-server/pom.xml

@ -95,10 +95,10 @@
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8093</server.port>
<spring.profiles.active>dev</spring.profiles.active>
</activation>
<properties>
<server.port>8093</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>
@ -108,7 +108,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/oper-crm/oper-crm-server/pom.xml

@ -107,7 +107,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -101,7 +101,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

2
epmet-module/resi-guide/resi-guide-server/pom.xml

@ -119,7 +119,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

6
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -20,7 +20,7 @@ import java.util.List;
* @Author wangc
* @date 2020.03.17 14:29
*/
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignFallBack.class)
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignFallBack.class )
public interface GovOrgFeignClient {
/**
@ -29,8 +29,8 @@ public interface GovOrgFeignClient {
* @Param pageNo 当前页
* @Param pageSize 每页数据量
* */
@PostMapping("/gov/org/customergrid/queryListForStrangerByOrder")
Result<List<CustomerGridForStrangerResultDTO>> getPageForStrangerGuideInterface(@RequestBody ListCustomerGridFormDTO listCustomerGridFormDTO);
@PostMapping("/gov/org/customergrid/querygridlistbyareacode")
Result<List<CustomerGridForStrangerResultDTO>> queryGridListByAreaCode(@RequestBody ListCustomerGridFormDTO listCustomerGridFormDTO);

4
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignFallBack.java

@ -26,7 +26,7 @@ public class GovOrgFeignFallBack implements GovOrgFeignClient {
* @return Result<List<CustomerGridForStrangerResultDTO>>
* */
@Override
public Result<List<CustomerGridForStrangerResultDTO>> getPageForStrangerGuideInterface(ListCustomerGridFormDTO listCustomerGridFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListForStrangerByOrder",listCustomerGridFormDTO);
public Result<List<CustomerGridForStrangerResultDTO>> queryGridListByAreaCode(ListCustomerGridFormDTO listCustomerGridFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryGridListByAreaCode",listCustomerGridFormDTO);
}
}

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

@ -25,6 +25,7 @@ import com.epmet.service.StrangerAccessRecordService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.epmet.utils.ModuleConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -61,6 +62,7 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
@Override
public PageData<StrangerAccessRecordDTO> getStrangerAccessRecordPage(Map<String, Object> params) {
//当前陌生人访客记录查询只能查询最近三天,无法查询三天以外的数据,需要完善功能
IPage<StrangerAccessRecordEntity> page = baseDao.selectPage(
getPage(params, "VISIT_TIME", false),
getWrapper(params)
@ -88,7 +90,6 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
/**
* sql语句条件查询拼接
* 陌生人访客记录逻辑删除标识为0访问时间为当前三天按照访问时间降序排列
*
* @param params
* @return QueryWrapper<StrangerAccessRecordEntity>
* @author
@ -135,9 +136,9 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
/**
* @return Result<List < CustomerGridForStrangerResultDTO>>
* @Description 陌生人根据地区编码查询附近网格数据具体实现
* @Param CustomerGridListFormDTO
* @return Result<List<CustomerGridForStrangerResultDTO>>
* @Author wangc
* @Date 2020.03.19 14:28
**/
@ -147,17 +148,17 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
ListCustomerGridFormDTO listCustomerGridFormDTO = new ListCustomerGridFormDTO();
listCustomerGridFormDTO.setAreaCode(0 == customerGridListFormDTO.getIsAuthorized() ?
listCustomerGridFormDTO.setAreaCode(ModuleConstant.NOT_POSITION_AUTHORIZED == customerGridListFormDTO.getIsAuthorized() ?
customerGridListFormDTO.getSelectedAreaCode() : customerGridListFormDTO.getAreaCode());
listCustomerGridFormDTO.setPageNo(null == customerGridListFormDTO.getPageNo() ? 1 : customerGridListFormDTO.getPageNo());
listCustomerGridFormDTO.setPageNo(null == customerGridListFormDTO.getPageNo() ? ModuleConstant.MIN_CURRENT_PAGE_NO : customerGridListFormDTO.getPageNo());
listCustomerGridFormDTO.setPageSize(customerGridListFormDTO.getPageSize());
Result<List<CustomerGridForStrangerResultDTO>> queryResult =
govOrgFeignClient
.getPageForStrangerGuideInterface(listCustomerGridFormDTO);
govOrgFeignClient
.queryGridListByAreaCode(listCustomerGridFormDTO);
//Feign调用成功
if (queryResult.success()) {
@ -166,13 +167,11 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
if (null != queryResult && queryList.size() > 0) {
StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity();
//未授权,手动选择
if (0 == customerGridListFormDTO.getIsAuthorized()) {
if (ModuleConstant.NOT_POSITION_AUTHORIZED == customerGridListFormDTO.getIsAuthorized()) {
strangerTrance.setSelectedAreaCode(customerGridListFormDTO.getSelectedAreaCode());
strangerTrance.setLocationAreaCode("");
} else if (1 == customerGridListFormDTO.getIsAuthorized()) {
} else if (ModuleConstant.POSITION_AUTHORIZED == customerGridListFormDTO.getIsAuthorized()) {
//已授权,自动选择
strangerTrance.setLocationAreaCode(customerGridListFormDTO.getAreaCode());
strangerTrance.setSelectedAreaCode("");
}
strangerTrance.setIsAuthorized(customerGridListFormDTO.getIsAuthorized());
strangerTrance.setGridNumber(queryList.size());

8
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -18,4 +18,12 @@ import com.epmet.commons.tools.constant.Constant;
*/
public interface ModuleConstant extends Constant {
//位置未授权
int NOT_POSITION_AUTHORIZED = 0;
//位置授权
int POSITION_AUTHORIZED = 1;
//当前页最小值
int MIN_CURRENT_PAGE_NO = 1;
}

2
epmet-user/epmet-user-server/pom.xml

@ -115,7 +115,7 @@
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>122.152.200.70</spring.redis.host>
<spring.redis.host>10.10.10.79</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->

4
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java

@ -32,6 +32,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface GridLatestDao extends BaseDao<GridLatestEntity> {
GridLatestDTO selectGridLatestByGridAndUserId(GridLatestDTO formDTO);
int updateByLatestId(GridLatestDTO dto);
GridLatestEntity getGridLatestByIds(GridLatestDTO formDTO);
/**

1
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java

@ -34,4 +34,5 @@ import org.apache.ibatis.annotations.Mapper;
public interface GridVisitedDao extends BaseDao<GridVisitedEntity> {
GridVisitedDTO selectGridVisitedByGridIdAndUserId(GridVisitedDTO formDTO);
int updateByVisitedId(GridVisitedDTO dto);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/OperRoleUserFeignClient.java

@ -13,7 +13,7 @@ import java.util.List;
* @dscription
* @date 2020/3/20 17:19
*/
@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperRoleUserFeignClientFallBack.class)
@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperRoleUserFeignClientFallBack.class )
public interface OperRoleUserFeignClient {
/**

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java

@ -54,6 +54,8 @@ public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLa
@Autowired
private GridLatestRedis gridLatestRedis;
@Autowired
private GridLatestDao gridLatestDao;
@Override
public PageData<GridLatestDTO> page(Map<String, Object> params) {
@ -120,17 +122,15 @@ public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLa
gridLatestDTO.setLatestTime(date);
gridLatestDTO.setUpdatedTime(date);
//查询是否存在历史数据(一个用户对一个网格的访问只记录一条数据)
GridLatestEntity gridLatestEntity = baseDao.getGridLatestByIds(gridLatestDTO);
GridLatestDTO dto = baseDao.selectGridLatestByGridAndUserId(gridLatestDTO);
GridLatestEntity entity = null;
if (null == gridLatestEntity || null == gridLatestEntity.getId()) {
if (null == dto || null == dto.getId()) {
entity = ConvertUtils.sourceToTarget(gridLatestDTO, GridLatestEntity.class);
return insert(entity);
} else {
entity = ConvertUtils.sourceToTarget(gridLatestEntity, GridLatestEntity.class);
entity.setLatestTime(date);
entity.setUpdatedBy(visitedFormDTO.getUserId());
entity.setUpdatedTime(date);
return updateById(entity);
dto.setUpdatedBy(visitedFormDTO.getUserId());
dto.setUpdatedTime(date);
return BaseServiceImpl.retBool(gridLatestDao.updateByLatestId(dto));
}
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java

@ -60,6 +60,8 @@ public class GridVisitedServiceImpl extends BaseServiceImpl<GridVisitedDao, Grid
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private GridLatestService gridLatestService;
@Autowired
private GridVisitedDao gridVisitedDao;
@Override
public PageData<GridVisitedDTO> page(Map<String, Object> params) {
@ -169,10 +171,9 @@ public class GridVisitedServiceImpl extends BaseServiceImpl<GridVisitedDao, Grid
entity = ConvertUtils.sourceToTarget(gridVisitedDTO, GridVisitedEntity.class);
return insert(entity);
} else {
entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class);
entity.setUpdatedBy(visitedFormDTO.getUserId());
entity.setUpdatedTime(date);
return updateById(entity);
dto.setUpdatedBy(visitedFormDTO.getUserId());
dto.setUpdatedTime(date);
return BaseServiceImpl.retBool(gridVisitedDao.updateByVisitedId(dto));
}
}

12
epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml

@ -19,8 +19,8 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getGridLatestByIds" parameterType="com.epmet.dto.GridLatestDTO"
resultType="com.epmet.entity.GridLatestEntity">
<select id="selectGridLatestByGridAndUserId" parameterType="com.epmet.dto.GridLatestDTO"
resultType="com.epmet.dto.GridLatestDTO">
SELECT
la.id,
la.customer_id,
@ -49,6 +49,14 @@
</if>
</select>
<update id="updateByLatestId">
UPDATE grid_latest
SET latest_time = #{latestTime},
updated_by = #{updatedBy},
updated_time = #{updatedTime}
WHERE id = #{id}
</update>
<!-- 根据居民id查询最后一次访问的网格信息 -->
<select id="selectLatestGridInfoByUserId" resultType="com.epmet.dto.result.LatestGridInfoResultDTO" parameterType="java.lang.String">
SELECT

7
epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml

@ -50,4 +50,11 @@
</if>
</select>
<update id="updateByVisitedId">
UPDATE grid_visited
SET updated_by = #{updatedBy},
updated_time = #{updatedTime}
WHERE id = #{id}
</update>
</mapper>
Loading…
Cancel
Save