diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java
new file mode 100644
index 0000000000..c3c237e83a
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * epmet-user端调用gov-org端的入参
+ * @author sun
+ */
+@Data
+public class CustomerGridFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 网格Id
+ */
+ @NotBlank(message = "网格ID不能为空")
+ private String gridId;
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
index 782a2f1678..a08ccf397f 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
@@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.excel.CustomerGridExcel;
import com.epmet.service.CustomerGridService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -63,7 +64,7 @@ public class CustomerGridController {
return new Result().ok(data);
}
- @PostMapping("save")
+ @PostMapping
public Result save(@RequestBody CustomerGridDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@@ -93,7 +94,17 @@ public class CustomerGridController {
ExcelUtils.exportExcelToTarget(response, null, list, CustomerGridExcel.class);
}
-
+ /**
+ * 供epmet-user服务调用 查询客户网格表数据
+ * @author sun
+ * @param formDTO
+ * @return
+ * @throws Exception
+ */
+ @PostMapping("getcustomergridbygridid")
+ public Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO formDTO) {
+ return customerGridService.getCustomerGridByGridId(formDTO);
+ }
/**
* @Description 陌生人导览模块调用 根据陌生揽客传入的地区码进行分页查询显示
* @Param ListCustomerGridFormDTO
@@ -107,4 +118,5 @@ public class CustomerGridController {
ValidatorUtils.validateEntity(listCustomerGridFormDTO);
return customerGridService.listGridForStrangerByOrder(listCustomerGridFormDTO);
}
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index 243180f257..fc2f26ac88 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -19,9 +19,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.entity.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -64,4 +65,5 @@ public interface CustomerGridDao extends BaseDao {
**/
List selectRestGridWithoutGivenAreaCode(@Param("areaCode")String areaCode , @Param("cityCode")String cityCode);
+ CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
index 4a682957c2..ceb317d455 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
@@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
@@ -105,4 +106,11 @@ public interface CustomerGridService extends BaseService {
* @date 2020-03-16
* */
Result> listGridForStrangerByOrder(ListCustomerGridFormDTO listCustomerGridFormDTO);
+
+ /** 根据网格Id查询用户数据
+ * @param formDTO
+ * @return
+ * @date 2020-03-17
+ */
+ Result getCustomerGridByGridId(CustomerGridFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index a81e488a84..36435deb2d 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -20,13 +20,13 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
@@ -112,6 +112,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> result = new Result<>();
+
String areaCode = listCustomerGridFormDTO.getAreaCode();
Integer pageNo = listCustomerGridFormDTO.getPageNo();
Integer pageSize = listCustomerGridFormDTO.getPageSize();
@@ -145,4 +146,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(CustomerGridFormDTO formDTO) {
+ return new Result().ok(baseDao.getCustomerGridByGridId(formDTO));
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index f38d18caeb..f36eb9ca6b 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
@@ -37,6 +37,28 @@
customer_id,
CONVERT ( grid_name USING gbk ) ASC
+
+ SELECT
+ gr.id,
+ gr.customer_id,
+ gr.grid_name,
+ gr.grid_code,
+ gr.pid,
+ gr.pids,
+ gr.sort,
+ gr.longitude,
+ gr.latitude,
+ gr.area_code
+ FROM customer_grid gr
+ WHERE
+ gr.del_flag = '0'
+
+ AND gr.id = #{gridId}
+
+
+
+
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/constant/OperCustomizeConstant.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/constant/OperCustomizeConstant.java
new file mode 100644
index 0000000000..dfddc87a50
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/constant/OperCustomizeConstant.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.epmet.dto.constant;
+
+/**
+ * 常量
+ * @author sun
+ * @since 1.0.0
+ */
+public interface OperCustomizeConstant {
+ /**
+ * 数据状态-已发布
+ */
+ String STATUS = "0";
+ /**
+ * 数据状态-草稿
+ */
+ String STATUS_ONE = "1";
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerHomeFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerHomeFormDTO.java
new file mode 100644
index 0000000000..1cba7b47ab
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerHomeFormDTO.java
@@ -0,0 +1,34 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 陌生人导览-点击网格链接获取客户首页配置入参DTO
+ * @Author sun
+ * @Date 2020/3/16 11:27
+ */
+@Data
+public class CustomerHomeFormDTO implements Serializable {
+ private static final long serialVersionUID = 5272251336837515372L;
+ /**
+ * 客户ID
+ */
+ @NotBlank(message = "客户ID不能为空")
+ private String customerId;
+
+ /**
+ * 所属端类型0.居民端,1.政府端
+ */
+ @NotBlank(message = "所属端类型不能为空(0居民端1政府端)")
+ private String clientType;
+
+ /**
+ * 状态:0.已发布 1.草稿
+ */
+ @NotBlank(message = "状态(0已发布1草稿)")
+ private String status;
+
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeComponentFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeComponentFormDTO.java
new file mode 100644
index 0000000000..a7833e17a9
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeComponentFormDTO.java
@@ -0,0 +1,42 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 运营端-客户定制化服务-首页设计稿组件上传数据-入参
+ * @author zhaoqifeng
+ * @date 2020/3/16 11:27
+ */
+@Data
+public class HomeComponentFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 组件id
+ */
+ private String componentId;
+
+ /**
+ * 所属区域
+ */
+ private Integer region;
+
+ /**
+ * 高级配置项
+ */
+ private String configuration;
+
+ /**
+ * 默认数据
+ */
+ private String demoData;
+
+ /**
+ * 显示顺序
+ */
+ private Integer displayOrder;
+
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignByCustomerFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignByCustomerFormDTO.java
new file mode 100644
index 0000000000..fddbedad98
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignByCustomerFormDTO.java
@@ -0,0 +1,28 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 运营端-客户定制化服务-获取客户首页配置的设计稿-入参
+ * @Author yangshaoping
+ * @Date 2020/3/16 11:27
+ */
+@Data
+public class HomeDesignByCustomerFormDTO implements Serializable {
+ private static final long serialVersionUID = 5272251336837515372L;
+ /**
+ * 客户ID
+ */
+ @NotBlank(message = "客户ID不能为空")
+ private String customerId;
+
+ /**
+ * 所属端类型0.居民端,1.政府端
+ */
+ @NotBlank(message = "所属端类型不能为空(0居民端1政府端)")
+ private String clientType;
+
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignFormDTO.java
new file mode 100644
index 0000000000..c51b897775
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignFormDTO.java
@@ -0,0 +1,33 @@
+package com.epmet.dto.form;
+/**
+ * 运营端-客户定制化服务-首页设计稿组件上传数据-入参
+ * @author zhaoqifeng
+ * @date 2020/3/16 11:27
+ */
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class HomeDesignFormDTO implements Serializable {
+
+
+ private static final long serialVersionUID = -246434129998560246L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 所属端类型 0:居民端 1:政府端
+ */
+ private String clientType;
+
+ /**
+ * 组件集合
+ */
+ private List componentList;
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentDesignResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentDesignResultDTO.java
new file mode 100644
index 0000000000..bd65f9fe44
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentDesignResultDTO.java
@@ -0,0 +1,50 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Description 运营端-客户定制化服务-获取客户可用组件列表-返参[commonList(通用组件列表)属性对应DTO]
+ * @Author yang
+ * @Date 2020/3/16 12:59
+ */
+@Data
+public class CommonComponentDesignResultDTO implements Serializable {
+ private static final long serialVersionUID = 2971689193155710437L;
+
+ /**
+ * 组件id
+ */
+ private String componentId;
+
+ /**
+ * 组件名称
+ */
+ private String componentName;
+ /**
+ * 所属区域
+ */
+ private String region;
+
+ /**
+ * 组件前端标识
+ */
+ private String componentFrontId;
+
+ /**
+ * 高级设置
+ */
+ private String configuration;
+
+ /**
+ * 默认数据
+ */
+ private String demoData;
+
+ /**
+ * 显示顺序
+ */
+ private int displayOrder;
+
+}
diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java
new file mode 100644
index 0000000000..2ccebf420c
--- /dev/null
+++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java
@@ -0,0 +1,37 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @Description 运营端-客户定制化服务-获取客户首页配置的设计稿返参
+ * @Author yang
+ * @Date 2020/3/16 12:57
+ */
+@Data
+public class HomeDesignByCustomerResultDTO implements Serializable {
+ private static final long serialVersionUID = 1496786567582303921L;
+ /**
+ * 标题区
+ */
+ private CommonComponentDesignResultDTO titleList;
+ /**
+ * 置顶区
+ */
+ private CommonComponentDesignResultDTO topList;
+ /**
+ * 功能区
+ */
+ private List functionList;
+ /**
+ * 悬浮区
+ */
+ private CommonComponentDesignResultDTO floatingList;
+ /**
+ *用于标识已使用的功能组件id列表(不含通用组件)
+ */
+ private List usedComponentIdList;
+}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/HomeController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/HomeController.java
index e8000ab20d..66ea831b6d 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/HomeController.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/HomeController.java
@@ -2,12 +2,19 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.constant.OperCustomizeConstant;
import com.epmet.dto.form.ComponentListByCustomerFormDTO;
+import com.epmet.dto.form.CustomerHomeFormDTO;
+import com.epmet.dto.form.HomeDesignByCustomerFormDTO;
+import com.epmet.dto.form.HomeDesignFormDTO;
import com.epmet.dto.result.ComponentListByCustomerResultDTO;
+import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.service.HomeService;
-import net.bytebuddy.asm.Advice;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
/**
* @Description 客户定制化服务-首页相关接口
@@ -33,4 +40,60 @@ public class HomeController {
ValidatorUtils.validateEntity(formDTO);
return homeService.getComponentListByCustomer(formDTO);
}
+
+ /**
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author yang
+ * @Description 获取客户首页配置的设计稿
+ * @Date 2020/3/16 13:21
+ **/
+ @PostMapping("gethomedesignbycustomer")
+ public Result getHomeDesignByCustomer(@RequestBody HomeDesignByCustomerFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ return homeService.getHomeDesignByCustomer(formDTO);
+ }
+
+ /**
+ * 首页设计稿组件上传数据
+ * @param formDTO 参数
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhaoqifeng
+ * Date 2020/3/16 13:21
+ **/
+ @PostMapping("savehomedesign")
+ public Result saveHomeDesign(@RequestBody HomeDesignFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ homeService.saveHomeDesign(formDTO);
+ return new Result();
+ }
+
+ /**
+ * 首页设计稿发版
+ * @param formDTO 参数
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhaoqifeng
+ * Date 2020/3/16 13:21
+ **/
+ @PostMapping("distributehomedesign")
+ public Result distributeHomeDesign(@RequestBody HomeDesignFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ homeService.distributeHomeDesign(formDTO);
+ return new Result();
+ }
+
+ /**
+ * 供resi-guide服务调用 获取客户首页配置
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author sun
+ * @Description 获取客户首页发布数据
+ **/
+ @PostMapping("gethomereleasebycustomer")
+ public Result getHomeReleaseByCustomer(@RequestBody CustomerHomeFormDTO formDTO) {
+ formDTO.setStatus(OperCustomizeConstant.STATUS);//已发布数据
+ formDTO.setClientType("0");//居民端(token中获取)
+ ValidatorUtils.validateEntity(formDTO);
+ return homeService.getHomeReleaseByCustomer(formDTO);
+ }
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java
index 6bffb6e6a6..42bc2824b4 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java
@@ -18,9 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.HomeDesignFormDTO;
import com.epmet.entity.CustomerHomeEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 客户首页表
*
@@ -29,5 +32,15 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CustomerHomeDao extends BaseDao {
-
+
+ /**
+ *
+ * 客户首页列表查询
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author zhaoqifeng
+ * @date 2020/3/16 14:02
+ **/
+ List selectCustomerHomeList(HomeDesignFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDetailDao.java
index 5c792c3394..bfe8a0bee8 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDetailDao.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDetailDao.java
@@ -18,9 +18,14 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.CustomerHomeFormDTO;
+import com.epmet.dto.form.HomeDesignByCustomerFormDTO;
+import com.epmet.dto.result.CommonComponentDesignResultDTO;
import com.epmet.entity.CustomerHomeDetailEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 客户首页详情表
*
@@ -29,5 +34,17 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CustomerHomeDetailDao extends BaseDao {
-
+ /**
+ *
+ * 根据界面id清除数据
+ *
+ * @param homeId 界面ID
+ * @author zhaoqifeng
+ * @date 2020/3/16 14:02
+ */
+ void updateCustomerHomeDetailByHomeId(String homeId);
+
+ List getCustomerHomeDetailComponent(HomeDesignByCustomerFormDTO form);
+
+ List getHomeReleaseByCustomer(CustomerHomeFormDTO form);
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java
index 21bf5f55ae..5e60376eb5 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java
@@ -29,5 +29,5 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CustomerHomeTemplateDao extends BaseDao {
-
+
}
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java
index 50156cef76..375d092f81 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java
@@ -2,7 +2,11 @@ package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ComponentListByCustomerFormDTO;
+import com.epmet.dto.form.CustomerHomeFormDTO;
+import com.epmet.dto.form.HomeDesignByCustomerFormDTO;
+import com.epmet.dto.form.HomeDesignFormDTO;
import com.epmet.dto.result.ComponentListByCustomerResultDTO;
+import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
/**
* @Description 客户定制化服务-首页
@@ -18,4 +22,39 @@ public interface HomeService {
* @Date 2020/3/11 13:22
**/
Result getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO);
+
+ /**
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author yang
+ * @Description 获取客户首页配置的设计稿
+ * @Date 2020/3/16 13:21
+ **/
+ Result getHomeDesignByCustomer(HomeDesignByCustomerFormDTO formDTO);
+
+ /**
+ *
+ * 首页设计稿组件上传数据
+ * @param: formDTO
+ * @author: zhaoqifeng
+ * @date: 2020/03/16 13:49:41
+ */
+ void saveHomeDesign(HomeDesignFormDTO formDTO);
+
+ /**
+ *
+ * 首页设计稿发版
+ * @param: formDTO
+ * @author: zhaoqifeng
+ * @date: 2020/03/16 13:49:41
+ */
+ void distributeHomeDesign(HomeDesignFormDTO formDTO);
+
+ /**
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author sun
+ * @Description 获取客户首页发布数据
+ **/
+ Result getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO);
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java
index 18671698af..e764eec02e 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java
@@ -1,13 +1,22 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dao.CustomerHomeDao;
+import com.epmet.dao.CustomerHomeDetailDao;
import com.epmet.dao.HomeComponentDao;
-import com.epmet.dto.form.ComponentListByCustomerFormDTO;
+import com.epmet.dto.form.*;
+import com.epmet.dto.result.CommonComponentDesignResultDTO;
import com.epmet.dto.result.ComponentListByCustomerResultDTO;
+import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
+import com.epmet.entity.CustomerHomeDetailEntity;
+import com.epmet.entity.CustomerHomeEntity;
import com.epmet.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @Description 客户定制化服务-首页
* @Author yinzuomei
@@ -15,14 +24,108 @@ import org.springframework.stereotype.Service;
*/
@Service
public class HomeServiceImpl implements HomeService {
+ @Autowired
+ private HomeComponentDao homeComponentDao;
+ @Autowired
+ private CustomerHomeDetailDao customerHomeDetailDao;
@Autowired
- private HomeComponentDao homeComponentDao;
+ private CustomerHomeDao customerHomeDao;
+
+ @Override
+ public Result getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO) {
+ ComponentListByCustomerResultDTO resultDTO = new ComponentListByCustomerResultDTO();
+ resultDTO.setCommonList(homeComponentDao.selectListCommonComponentResultDTO(formDTO));
+ resultDTO.setFunctionList(homeComponentDao.selectListFunctionComponentResultDTO(formDTO));
+ return new Result().ok(resultDTO);
+ }
+
+ @Override
+ public Result getHomeDesignByCustomer(HomeDesignByCustomerFormDTO formDTO) {
+ HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO();
+ List list = customerHomeDetailDao.getCustomerHomeDetailComponent(formDTO);
+ List flist=new ArrayList();//功能组件
+ List usedComponent=new ArrayList<>();//使用的组件集合
+ for(CommonComponentDesignResultDTO c:list){
+ usedComponent.add(c.getComponentId());
+ //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区
+ if("0".equals(c.getRegion())){
+ resultDTO.setTitleList(c);
+ }else if("1".equals(c.getRegion())){
+ resultDTO.setTopList(c);
+ }else if("2".equals(c.getRegion())){
+ flist.add(c);
+ }else if("3".equals(c.getRegion())){
+ resultDTO.setFloatingList(c);
+ }
+ }
+ resultDTO.setFunctionList(flist);
+ resultDTO.setUsedComponentIdList(usedComponent);
+ return new Result().ok(resultDTO);
+ }
@Override
- public Result getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO) {
- ComponentListByCustomerResultDTO resultDTO = new ComponentListByCustomerResultDTO();
- resultDTO.setCommonList(homeComponentDao.selectListCommonComponentResultDTO(formDTO));
- resultDTO.setFunctionList(homeComponentDao.selectListFunctionComponentResultDTO(formDTO));
- return new Result().ok(resultDTO);
+ public void saveHomeDesign(HomeDesignFormDTO formDTO) {
+ //根据客户ID和所属端类型从客户首页表找到对应的已发布和草稿
+ List customerHomeList = customerHomeDao.selectCustomerHomeList(formDTO);
+
+ //只处理草稿的数据
+ for(CustomerHomeEntity entity : customerHomeList) {
+ if (entity.getStatus() == 1) {
+ saveCustomerHomeDetail(formDTO, entity);
+ }
+ }
}
+
+ @Override
+ public void distributeHomeDesign(HomeDesignFormDTO formDTO) {
+ //根据客户ID和所属端类型从客户首页表找到对应的已发布和草稿
+ List customerHomeList = customerHomeDao.selectCustomerHomeList(formDTO);
+
+ //草稿和模板数据都要处理
+ for(CustomerHomeEntity entity : customerHomeList) {
+ saveCustomerHomeDetail(formDTO, entity);
+ }
+ }
+
+ private void saveCustomerHomeDetail(HomeDesignFormDTO formDTO, CustomerHomeEntity entity) {
+ //根据homeID清空客户首页详情表中的数据
+ customerHomeDetailDao.updateCustomerHomeDetailByHomeId(entity.getId());
+
+ //将数据存入客户首页详情表
+ for (HomeComponentFormDTO homeComponentForm : formDTO.getComponentList()) {
+ CustomerHomeDetailEntity customerHomeDetailEntity = new CustomerHomeDetailEntity();
+ customerHomeDetailEntity.setHomeId(entity.getId());
+ customerHomeDetailEntity.setComponentId(homeComponentForm.getComponentId());
+ customerHomeDetailEntity.setRegion(homeComponentForm.getRegion());
+ customerHomeDetailEntity.setConfiguration(homeComponentForm.getConfiguration());
+ customerHomeDetailEntity.setDemoData(homeComponentForm.getDemoData());
+ customerHomeDetailEntity.setDisplayOrder(homeComponentForm.getDisplayOrder());
+ customerHomeDetailDao.insert(customerHomeDetailEntity);
+
+ }
+ }
+
+ @Override
+ public Result getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO) {
+ HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO();
+ List list = customerHomeDetailDao.getHomeReleaseByCustomer(formDTO);
+ List flist = new ArrayList();//功能组件
+ List usedComponent=new ArrayList<>();//使用的组件集合
+ for(CommonComponentDesignResultDTO c:list){
+ usedComponent.add(c.getComponentId());
+ //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区
+ if("titleList".equals(c.getRegion())){
+ resultDTO.setTitleList(c);
+ }else if("topList".equals(c.getRegion())){
+ resultDTO.setTopList(c);
+ }else if("functionList".equals(c.getRegion())){
+ flist.add(c);
+ }else if("floatingList".equals(c.getRegion())){
+ resultDTO.setFloatingList(c);
+ }
+ }
+ resultDTO.setFunctionList(flist);
+ resultDTO.setUsedComponentIdList(usedComponent);
+ return new Result().ok(resultDTO);
+ }
}
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml
index 1ae417cdc0..3bc7dfdb23 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml
@@ -16,5 +16,18 @@
+
+
+ SELECT
+ *
+ FROM
+ CUSTOMER_HOME ch
+ WHERE
+ CUSTOMER_ID = #{customerId}
+ AND CLIENT_TYPE = #{clientType}
+ AND DEL_FLAG = '0'
+
+
\ No newline at end of file
diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDetailDao.xml
index b3c5917560..72a121387e 100644
--- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDetailDao.xml
+++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDetailDao.xml
@@ -18,5 +18,68 @@
+
+ UPDATE
+ CUSTOMER_HOME_DETAIL
+ set
+ DEL_FLAG = 1
+ WHERE
+ HOME_ID = #{homeId}
+ AND DEL_FLAG = 0
+
+
+
+ SELECT
+ b.COMPONENT_ID,
+ c.COMPONENT_NAME,
+ b.REGION,
+ b.CONFIGURATION,
+ b.DEMO_DATA,
+ b.DISPLAY_ORDER
+ FROM
+ (
+ SELECT
+ *
+ FROM
+ customer_home a
+ WHERE 1 = 1
+ AND a.DEL_FLAG = 0
+ AND a.CUSTOMER_ID = ${customerId}
+ AND a.CLIENT_TYPE = ${clientType}
+ ORDER BY
+ a.CREATED_TIME DESC
+ LIMIT 1
+ ) a
+ INNER JOIN customer_home_detail b ON a.id = b.HOME_ID
+ LEFT JOIN home_component c ON b.COMPONENT_ID = c.id
+ WHERE
+ a.DEL_FLAG = 0
+
+
+
+
+ SELECT
+ b.COMPONENT_ID,
+ c.COMPONENT_NAME,
+ b.REGION,
+ b.CONFIGURATION,
+ b.DEMO_DATA,
+ b.DISPLAY_ORDER
+ FROM
+ (
+ SELECT
+ id
+ FROM
+ customer_home
+ WHERE DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+ AND CLIENT_TYPE = #{clientType}
+ AND `STATUS` = #{status}
+ ) a
+ INNER JOIN customer_home_detail b ON a.id = b.HOME_ID AND b.DEL_FLAG = '0'
+ LEFT JOIN home_component c ON b.COMPONENT_ID = c.id AND c.DEL_FLAG = '0'
+
\ No newline at end of file
diff --git a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/StrangerAccessRecordDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/StrangerAccessRecordDTO.java
new file mode 100644
index 0000000000..183bc5fb2f
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/StrangerAccessRecordDTO.java
@@ -0,0 +1,111 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 陌生人访问记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-19
+ */
+@Data
+public class StrangerAccessRecordDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 唯一标识
+ */
+ private String id;
+
+ /**
+ * 定位地区编码 (用户允许获取位置)
+ */
+ private String locationAreaCode;
+
+ /**
+ * 选择地区编码 (用户选择地区位置
+ */
+ private String lelectedAreaCode;
+
+ /**
+ * 省份
+ */
+ private String province;
+
+ /**
+ * 城市
+ */
+ private String city;
+
+ /**
+ * 城市
+ */
+ private String area;
+
+ /**
+ * 是否首次位置授权(0:是 1:否)
+ */
+ private Integer isAuthorized;
+
+ /**
+ * 网格数 根据位置查询到的附近网格数
+ */
+ private Integer gridNumber;
+
+ /**
+ * 访问时间 访问的当前时间
+ */
+ private Date visitTime;
+
+ /**
+ * 删除标识:0.未删除 1.已删除
+ */
+ private Integer delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/StrangerFormDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/StrangerFormDTO.java
new file mode 100644
index 0000000000..ce7197da17
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/StrangerFormDTO.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 居民端-网格链接获取客户首页配置入参
+ * @author sun
+ */
+@Data
+public class StrangerFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 网格Id
+ */
+ @NotBlank(message = "网格ID不能为空")
+ private String gridId;
+
+ /**
+ * 客户Id CUSTOMER.id
+ */
+ @NotBlank(message = "客户ID不能为空")
+ private String customerId;
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml
index 721594d7d6..f5959bc1c1 100644
--- a/epmet-module/resi-guide/resi-guide-server/pom.xml
+++ b/epmet-module/resi-guide/resi-guide-server/pom.xml
@@ -58,10 +58,23 @@
feign-httpclient
10.3.0
+
+ com.epmet
+ epmet-user-client
+ 2.0.0
+ compile
+
com.epmet
gov-org-client
2.0.0
+ compile
+
+
+ com.epmet
+ oper-customize-client
+ 2.0.0
+ compile
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerAccessRecordController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerAccessRecordController.java
index f4ed63960b..963a8a53ed 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerAccessRecordController.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerAccessRecordController.java
@@ -1,17 +1,24 @@
package com.epmet.controller;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.dto.StrangerAccessRecordDTO;
import com.epmet.dto.form.CustomerGridListFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.excel.StrangerAccessRecordExcel;
import com.epmet.service.StrangerAccessRecordService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
import java.util.List;
+import java.util.Map;
/**
* @Description 陌生人导览模块
@@ -57,4 +64,55 @@ public class StrangerAccessRecordController {
return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO);
}
+ /**
+ * 查询陌生人访问记录
+ * @Author yangshaoping
+ * @date 2020.03.1811:33
+ * */
+ @GetMapping("getStrangerAccessRecordPage")
+ public Result> getStrangerAccessRecordPage(@RequestParam Map params){
+ PageData page = strangerAccessRecordService.getStrangerAccessRecordPage(params);
+ return new Result>().ok(page);
+ }
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = strangerAccessRecordService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ StrangerAccessRecordDTO data = strangerAccessRecordService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody StrangerAccessRecordDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ strangerAccessRecordService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody StrangerAccessRecordDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ strangerAccessRecordService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ strangerAccessRecordService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = strangerAccessRecordService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, StrangerAccessRecordExcel.class);
+ }
}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
new file mode 100644
index 0000000000..d39f477e79
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.StrangerFormDTO;
+import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
+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;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 居民端-陌生人导览
+ * @author sun
+ * @since v1.0.0 2020-03-16
+ */
+@RestController
+@RequestMapping("stranger")
+public class StrangerResiGuideController {
+
+ @Autowired
+ private StrangerService strangerService;
+
+ /**
+ * @param
+ * @Author sun
+ * @Description 居民端-陌生人导览-网格链接获取客户首页配置
+ * @Date 2020/3/16
+ **/
+ @PostMapping("getgridhome")
+ public Result getValidCustomerList(@RequestBody StrangerFormDTO formDTO) throws Exception {
+ return strangerService.getgridhome(formDTO);
+ }
+
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.java
index 2a66e64424..625e30b399 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.java
@@ -17,17 +17,27 @@
package com.epmet.dao;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.StrangerAccessRecordEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+import java.util.Map;
+
/**
- * 陌生人访问记录表
+ * 陌生人访问记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-16
*/
@Mapper
public interface StrangerAccessRecordDao extends BaseDao {
-
+ /**
+ * 查询陌生人访问记录
+ * @param params
+ * @author yangshaoping
+ * @date 2020-03-19
+ */
+ List getStrangerAccessRecordPage(Map params);
}
\ No newline at end of file
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java
new file mode 100644
index 0000000000..affa495fd1
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 {
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java
new file mode 100644
index 0000000000..9ee71678a8
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
new file mode 100644
index 0000000000..0268ea99ec
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
@@ -0,0 +1,28 @@
+package com.epmet.feign;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.VisitedFormDTO;
+import com.epmet.feign.fallback.EpmetUserFeignClientFallBack;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @Description 居民端陌生人导览 调用epmet-user服务
+ * @Author sun
+ */
+@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class)
+public interface EpmetUserFeignClient {
+
+ /**
+ * 保存或更新网格访问记录表和最近访问网格表数据
+ * @param
+ * @Description
+ **/
+ @PostMapping("/epmetuser/gridvisited/savelatestandvisited")
+ Result saveLatestAndVisited(VisitedFormDTO formDTO);
+
+
+
+
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
index 3442187ca8..86b8947289 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
@@ -9,7 +9,7 @@ import com.epmet.feign.fallback.GovOrgFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
+
import java.util.List;
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java
new file mode 100644
index 0000000000..0a3eb35a01
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java
@@ -0,0 +1,27 @@
+package com.epmet.feign;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CustomerHomeFormDTO;
+import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
+import com.epmet.feign.fallback.OperCustomizeFeignClientFallBack;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @Description 居民端陌生人导览 调用oper_customize服务
+ * @Author sun
+ * @Date 2020/3/16
+ */
+@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeFeignClientFallBack.class)
+public interface OperCustomizeFeignClient {
+
+ /**
+ * @param
+ * @Description 根据客户Id查询客户用户表数据
+ * @Date 2020/3/17
+ **/
+ @PostMapping("/oper/customize/home/gethomereleasebycustomer")
+ Result getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO);
+
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
new file mode 100644
index 0000000000..60688ad717
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
@@ -0,0 +1,24 @@
+package com.epmet.feign.fallback;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.ModuleUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.VisitedFormDTO;
+import com.epmet.feign.EpmetUserFeignClient;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 居民端-陌生人导览 调用epmet-user服务
+ * @Author sun
+ * @Date 2020/3/16
+ */
+@Component
+public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
+
+ @Override
+ public Result saveLatestAndVisited(VisitedFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveLatestAndVisited",formDTO);
+ }
+
+
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java
new file mode 100644
index 0000000000..95853e7da3
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java
@@ -0,0 +1,23 @@
+package com.epmet.feign.fallback;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.ModuleUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CustomerHomeFormDTO;
+import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
+import com.epmet.feign.OperCustomizeFeignClient;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 居民端-陌生人导览 调用oper-customize服务
+ * @Author sun
+ * @Date 2020/3/16
+ */
+@Component
+public class OperCustomizeFeignClientFallBack implements OperCustomizeFeignClient {
+
+ @Override
+ public Result getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getHomeReleaseByCustomer",formDTO);
+ }
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java
index 553610ed4e..48602670fa 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java
@@ -1,12 +1,15 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
+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.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.StrangerAccessRecordEntity;
import java.util.List;
+import java.util.Map;
/**
* @Description 陌生人记录访问表
@@ -17,6 +20,74 @@ import java.util.List;
public interface StrangerAccessRecordService extends BaseService {
+ /**
+ * 查询陌生人访问记录
+ * @param params
+ * @return PageData
+ * @author yangshaoping
+ * @date 2020-03-19
+ */
+ PageData getStrangerAccessRecordPage(Map params);
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2020-03-19
+ */
+ PageData page(Map params);
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2020-03-19
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return StrangerAccessRecordDTO
+ * @author generator
+ * @date 2020-03-19
+ */
+ StrangerAccessRecordDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-19
+ */
+ void save(StrangerAccessRecordDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-03-19
+ */
+ void update(StrangerAccessRecordDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2020-03-19
+ */
+ void delete(String[] ids);
+
/**
* @Description 陌生人根据地区编码查询附近网格数据接口定义
* @Param CustomerGridListFormDTO
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java
new file mode 100644
index 0000000000..f2107ccc13
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 {
+
+ /**
+ * 居民端-网格链接获取客户首页配置
+ * @param
+ * @return void
+ * @author sun
+ */
+ Result getgridhome(StrangerFormDTO formDTO);
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
index aeca05bbe6..f955d837ff 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
@@ -1,10 +1,12 @@
-package com.epmet.service.impl;/**
- * Created by 11 on 2020/3/17.
- */
+package com.epmet.service.impl;
+
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+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.result.CustomerGridForStrangerResultDTO;
@@ -15,9 +17,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Date;
import java.util.List;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.tools.page.PageData;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.Map;
/**
* @Description 陌生人记录访问表
* @ClassName ResiGuideServiceImpl
@@ -26,9 +35,73 @@ import java.util.List;
*/
@Service
public class StrangerAccessRecordServiceImpl extends BaseServiceImpl implements StrangerAccessRecordService {
-
+ @Autowired
+ private StrangerAccessRecordDao strangerAccessRecordDao;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
+ /**
+ * 查询陌生人访问记录
+ * @param params
+ * @return PageData
+ * @author yangshaoping
+ * @date 2020-03-19
+ */
+ @Override
+ public PageData getStrangerAccessRecordPage(Map params) {
+ List list = strangerAccessRecordDao.getStrangerAccessRecordPage(params);
+ return getPageData(list,list.size(), StrangerAccessRecordDTO.class);
+ }
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, StrangerAccessRecordDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, StrangerAccessRecordDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public StrangerAccessRecordDTO get(String id) {
+ StrangerAccessRecordEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, StrangerAccessRecordDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(StrangerAccessRecordDTO dto) {
+ StrangerAccessRecordEntity entity = ConvertUtils.sourceToTarget(dto, StrangerAccessRecordEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(StrangerAccessRecordDTO dto) {
+ StrangerAccessRecordEntity entity = ConvertUtils.sourceToTarget(dto, StrangerAccessRecordEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
/**
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java
new file mode 100644
index 0000000000..49d22d716b
--- /dev/null
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 implements StrangerService {
+
+ @Autowired
+ private EpmetUserFeignClient epmetUserFeignClient;
+ @Autowired
+ private OperCustomizeFeignClient operCustomizeFeignClient;
+
+ /**
+ * 居民端-网格链接获取客户首页配置
+ * @return void
+ * @author sun
+ */
+ @Override
+ public Result 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 res = getCustomerHomeData(formDTO.getCustomerId());
+ return res;
+
+ }
+
+ /**
+ * 调用oper-customize服务 获取首页发布数据
+ */
+ public Result getCustomerHomeData(String customerId){
+ CustomerHomeFormDTO dto = new CustomerHomeFormDTO();
+ dto.setCustomerId(customerId);
+ //dto.setClientType(token中获取);//居民端
+ return operCustomizeFeignClient.getHomeReleaseByCustomer(dto);
+ }
+
+}
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml
index 6c5a00a25e..f067dc5e79 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml
@@ -4,6 +4,8 @@ server:
context-path: /resi/guide
spring:
+ main:
+ allow-bean-definition-overriding: true
application:
name: resi-guide-server
#环境 dev|test|prod
diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml
index 84434a743a..ee340ac3e7 100644
--- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml
+++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml
@@ -24,4 +24,20 @@
+
+
+
+ SELECT
+ a.LOCATION_AREA_CODE,
+ a.PROVINCE,
+ a.CITY,
+ a.AREA,
+ a.IS_AUTHORIZED,
+ a.VISIT_TIME
+ FROM
+ stranger_access_record AS a
+ where a.DEL_FLAG=0 and date_sub(curdate(), interval 3 day) <= a.VISIT_TIME
+ ORDER BY a.VISIT_TIME desc
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java
index cf2c85a332..72eea402f8 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java
@@ -58,11 +58,6 @@ public class GridVisitedDTO implements Serializable {
*/
private String customerUserId;
- /**
- * 是否首次位置授权(0:否 1:是)
- */
- private Integer isAuthorized;
-
/**
* 访问时间 一个用户一天访问一个网格只有一条记录
*/
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitedFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitedFormDTO.java
new file mode 100644
index 0000000000..c8bacca5f9
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitedFormDTO.java
@@ -0,0 +1,52 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 居民端-网格链接获取客户首页配置
+ * @author sun
+ */
+@Data
+public class VisitedFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 网格Id
+ */
+ @NotBlank(message = "网格ID不能为空")
+ private String gridId;
+ /**
+ * 客户Id CUSTOMER.id
+ */
+ @NotBlank(message = "客户ID不能为空")
+ private String customerId;
+ /**
+ * 用户Id
+ */
+ @NotBlank(message = "用户ID不能为空")
+ private String userId;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml
index 4b950069d1..d43f3bc9fc 100644
--- a/epmet-user/epmet-user-server/pom.xml
+++ b/epmet-user/epmet-user-server/pom.xml
@@ -54,6 +54,18 @@
feign-httpclient
10.3.0
+
+ com.epmet
+ gov-org-client
+ 2.0.0
+ compile
+
+
+ com.epmet
+ gov-org-client
+ 2.0.0
+ compile
+
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java
index 7d54b4e248..8f8e583add 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/UserApplication.java
@@ -10,6 +10,8 @@ package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* 管理后台
@@ -17,7 +19,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
+
@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients
public class UserApplication {
public static void main(String[] args) {
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java
index a960c39e20..1f3d09d73c 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java
@@ -23,9 +23,10 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
-import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.GridVisitedDTO;
+import com.epmet.dto.form.VisitedFormDTO;
import com.epmet.excel.GridVisitedExcel;
import com.epmet.service.GridVisitedService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -91,4 +92,15 @@ public class GridVisitedController {
ExcelUtils.exportExcelToTarget(response, null, list, GridVisitedExcel.class);
}
+ /**
+ * 网格访问记录表、最近访问网格表新增数据
+ * 网格访问记录表新增数据(一天一条)
+ * 最近访问表更新访问时间字段
+ * @param formDTO
+ */
+ @PostMapping("savelatestandvisited")
+ public void saveLatestAndVisited(@RequestBody VisitedFormDTO formDTO) throws Exception {
+ gridVisitedService.saveLatestAndVisited(formDTO);
+ }
+
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java
index 2b31a4b1a8..52af37226a 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java
@@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.GridLatestDTO;
import com.epmet.entity.GridLatestEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface GridLatestDao extends BaseDao {
-
+
+ GridLatestEntity getGridLatestByIds(GridLatestDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java
index e51d88956d..b246bdabd5 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java
@@ -18,6 +18,9 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.GridLatestDTO;
+import com.epmet.dto.GridVisitedDTO;
+import com.epmet.entity.GridLatestEntity;
import com.epmet.entity.GridVisitedEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface GridVisitedDao extends BaseDao {
-
+
+ GridVisitedDTO getGridVisitedByIds(GridVisitedDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java
index 9fb79ca7af..a6cb62c704 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java
@@ -58,11 +58,6 @@ public class GridVisitedEntity extends BaseEpmetEntity {
*/
private String customerUserId;
- /**
- * 是否首次位置授权(0:否 1:是)
- */
- private Integer isAuthorized;
-
/**
* 访问时间 一个用户一天访问一个网格只有一条记录
*/
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java
index 13c5fefc26..9e3e61b72b 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java
@@ -46,9 +46,6 @@ public class GridVisitedExcel {
@Excel(name = "用户Id")
private String customerUserId;
- @Excel(name = "是否首次位置授权(0:否 1:是)")
- private Integer isAuthorized;
-
@Excel(name = "访问时间 一个用户一天访问一个网格只有一条记录")
private Date visitTime;
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
new file mode 100644
index 0000000000..5625a3ee76
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
@@ -0,0 +1,27 @@
+package com.epmet.feign;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @Description 居民端陌生人导览 调用gov-org服务
+ * @Author sun
+ * @Date 2020/3/16
+ */
+@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class)
+public interface GovOrgFeignClient {
+
+ /**
+ * @param
+ * @Description 根据客户Id查询客户用户表数据
+ * @Date 2020/3/17
+ **/
+ @PostMapping("/gov/org/customergrid/getcustomergridbygridid")
+ Result getCustomerGridByGridId(CustomerGridFormDTO formDTO);
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
new file mode 100644
index 0000000000..c5e04129bf
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
@@ -0,0 +1,23 @@
+package com.epmet.feign.fallback;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.ModuleUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.feign.GovOrgFeignClient;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 居民端-陌生人导览 调用gov-org服务
+ * @Author sun
+ * @Date 2020/3/16
+ */
+@Component
+public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
+
+ @Override
+ public Result getCustomerGridByGridId(CustomerGridFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",formDTO);
+ }
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
index 1ddbb716a8..138f4c9483 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
@@ -19,7 +19,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.GridLatestDTO;
+import com.epmet.dto.form.VisitedFormDTO;
import com.epmet.entity.GridLatestEntity;
import java.util.List;
@@ -92,4 +94,10 @@ public interface GridLatestService extends BaseService {
* @date 2020-03-16
*/
void delete(String[] ids);
+
+ /**
+ * 最近访问网格表新增数据
+ * @param formDTO
+ */
+ void saveGridLatest(VisitedFormDTO formDTO, CustomerGridDTO cu);
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java
index d081fab310..b324356f94 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java
@@ -19,7 +19,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.GridLatestDTO;
import com.epmet.dto.GridVisitedDTO;
+import com.epmet.dto.form.VisitedFormDTO;
import com.epmet.entity.GridVisitedEntity;
import java.util.List;
@@ -92,4 +94,24 @@ public interface GridVisitedService extends BaseService {
* @date 2020-03-16
*/
void delete(String[] ids);
+
+
+
+
+
+
+ /**
+ * 网格访问记录表新增数据
+ * @param formDTO
+ */
+ //void saveGridVisited(GridVisitedDTO formDTO);
+
+
+
+
+
+ /**
+ * @param formDTO
+ */
+ void saveLatestAndVisited(VisitedFormDTO formDTO) throws Exception;
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
index 1ab4bac35f..ba4dcea6a1 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
@@ -24,7 +24,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.GridLatestDao;
+import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.GridLatestDTO;
+import com.epmet.dto.form.VisitedFormDTO;
import com.epmet.entity.GridLatestEntity;
import com.epmet.redis.GridLatestRedis;
import com.epmet.service.GridLatestService;
@@ -34,6 +36,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -101,4 +104,33 @@ public class GridLatestServiceImpl extends BaseServiceImpl implements GridVisitedService {
@Autowired
- private GridVisitedRedis gridVisitedRedis;
+ private GovOrgFeignClient govOrgFeignClient;
+ @Autowired
+ private GridLatestService gridLatestService;
@Override
public PageData page(Map params) {
@@ -101,4 +109,67 @@ public class GridVisitedServiceImpl extends BaseServiceImpl result = govOrgFeignClient.getCustomerGridByGridId(dto);
+ if(!result.success()){
+ throw new Exception("查询客户网格表数据失败!");
+ }
+ CustomerGridDTO cu = result.getData();
+
+ //2:网格访问记录表新增数据
+ saveGridVisited(formDTO,cu);
+
+ //3:最近访问网格表新增数据
+ gridLatestService.saveGridLatest(formDTO,cu);
+
+ }
+
+ /**
+ * 网格记录表和最近访问网格表新增数据
+ * @param formDTO
+ * @param cu
+ */
+ public void saveGridVisited(VisitedFormDTO formDTO,CustomerGridDTO cu) {
+ Date date = new Date();
+ GridVisitedDTO vi = new GridVisitedDTO();
+ vi.setIsRegister(getRegister("0"));//token中获取是否注册
+ vi.setCustomerId(cu.getCustomerId());
+ vi.setGridId(cu.getId());
+ // vi.setCustomerUserId(formDTO.getUserId());//token传递的值
+ vi.setCustomerUserId("1111111111");//token传递的值
+ vi.setVisitTime(date);
+ vi.setUpdatedTime(date);
+ //查询是否存在历史数据( 一个用户一天对一个网格只存在一条访问记录)
+ GridVisitedDTO dto = baseDao.getGridVisitedByIds(vi);
+ GridVisitedEntity entity = null;
+ if(dto==null||dto.getId()==null){
+ entity = ConvertUtils.sourceToTarget(vi, GridVisitedEntity.class);
+ insert(entity);
+ }else{
+ entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class);
+ entity.setUpdatedTime(date);
+ updateById(entity);
+ }
+ }
+
+ /**
+ * (预留方法)查询是否注册状态值
+ * @param str
+ * @return
+ */
+ public Integer getRegister(String str){
+ return 0;
+ }
+
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml
index c05db815e8..ed9eaa6398 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml
@@ -19,5 +19,34 @@
+
+ SELECT
+ la.id,
+ la.customer_id,
+ la.grid_id,
+ la.customer_user_id,
+ la.area_code,
+ la.pid,
+ la.latest_time,
+ la.del_flag,
+ la.revision,
+ la.created_by,
+ la.created_time,
+ la.updated_by,
+ la.updated_time
+ FROM grid_latest la
+ WHERE
+ la.del_flag = '0'
+
+ AND la.customer_id = #{customerId}
+
+
+ AND la.grid_id = #{gridId}
+
+
+ AND la.customer_user_id = #{customerUserId}
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml
index 2ea9a363db..12c9ebcfeb 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml
@@ -9,7 +9,6 @@
-
@@ -19,5 +18,36 @@
+
+ SELECT
+ vi.id,
+ vi.is_register,
+ vi.customer_id,
+ vi.grid_id,
+ vi.customer_user_id,
+ vi.visit_time,
+ vi.del_flag,
+ vi.revision,
+ vi.created_by,
+ vi.created_time,
+ vi.updated_by,
+ vi.updated_time
+ FROM grid_visited vi
+ WHERE
+ vi.del_flag = '0'
+
+ AND vi.customer_id = #{customerId}
+
+
+ AND vi.grid_id = #{gridId}
+
+
+ AND vi.customer_user_id = #{customerUserId}
+
+
+ AND to_days(vi.visit_time) = to_days(#{visitTime})
+
+
\ No newline at end of file