diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/OperCrmFeignClientFallBack.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java similarity index 97% rename from epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/OperCrmFeignClientFallBack.java rename to epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java index dd82f90351..3c79473590 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/OperCrmFeignClientFallBack.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -1,4 +1,4 @@ -package com.epmet.feign.impl; +package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/DemoFeignClientFallBack.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/fallback/DemoFeignClientFallBack.java similarity index 94% rename from epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/DemoFeignClientFallBack.java rename to epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/fallback/DemoFeignClientFallBack.java index efe1cfe0d0..cf991f0190 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/DemoFeignClientFallBack.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/fallback/DemoFeignClientFallBack.java @@ -1,4 +1,4 @@ -package com.epmet.feign.impl; +package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; diff --git a/epmet-module/gov-org/gov-org-client/pom.xml b/epmet-module/gov-org/gov-org-client/pom.xml index 59518f86e2..e9c924f60d 100644 --- a/epmet-module/gov-org/gov-org-client/pom.xml +++ b/epmet-module/gov-org/gov-org-client/pom.xml @@ -10,7 +10,7 @@ gov-org-client - jar + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GovOrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GovOrgFormDTO.java new file mode 100644 index 0000000000..753ff28808 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GovOrgFormDTO.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; + + +/** + * 居民端-网格链接获取客户首页配置 + * @author sun + */ +@Data +public class GovOrgFormDTO 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-client/src/main/java/com/epmet/dto/result/CustomerGridForStangerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStangerResultDTO.java new file mode 100644 index 0000000000..2a8c4108d0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStangerResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result;/** + * Created by 11 on 2020/3/19. + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 陌生人搜索网格返回结果 + * @ClassName CustomerGridForStangerResultDTO + * @Author wangc + * @date 2020.03.19 00:38 + */ +@Data +public class CustomerGridForStangerResultDTO implements Serializable { + private static final long serialVersionUID = -1L; + + /** + * 网格ID + * */ + private String gridId; + + /** + * 客户ID + * */ + private String customerId; + + /** + * 网格名称 + * */ + private String gridName; +} diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index dbdded2ad2..29225234d3 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -54,6 +54,11 @@ feign-httpclient 10.3.0 + + com.github.pagehelper + pagehelper + 5.0.1 + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/exception/ModuleErrorCode.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/exception/ModuleErrorCode.java new file mode 100644 index 0000000000..dc2e3e93cc --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/exception/ModuleErrorCode.java @@ -0,0 +1,20 @@ +package com.epmet.exception; + +import com.epmet.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + + int ARGS_NOT_ALLOW_NULL_ERROR = 100019001; + + int NOT_STANDARD_AREA_CODE_ERROR = 100019002; + +} 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 7bdfc2df56..5c585fb4b3 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 @@ -22,6 +22,15 @@ + + + SELECT id AS grid_id , customer_id , grid_name + FROM CUSTOMER_GRID + WHERE AREA_CODE LIKE CONCAT(#{areaCode},'%') + ORDER BY + customer_id, + CONVERT ( grid_name USING gbk ) ASC + + + + \ No newline at end of file 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/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/CustomerGridListQueryDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/CustomerGridListQueryDTO.java new file mode 100644 index 0000000000..b51dd9e7bc --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/CustomerGridListQueryDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto;/** + * Created by 11 on 2020/3/17. + */ + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName CustomerGridListQueryDTO + * @Author wangc + * @date 2020.03.17 13:45 + */ +@Data +public class CustomerGridListQueryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当前页 + * */ + @Min(value = 1) + private Integer pageNo; + + /** + * 每页数量 + * */ + private Integer pageSize = 20; + + /** + * 地区码 + * */ + private String areaCode; + + /** + * 选定地区编码 + * */ + private String selectedAreaCode; + + /** + * 是否首次位置授权(0:是 1:否) + */ + private Integer isAuthorized; + + /** + * 前端传递的省份 + * */ + @NotBlank(message = "省份信息不能为空") + private String province; + + /** + * 前端传递的城市 + * */ + @NotBlank(message = "城市信息不能为空") + private String city; + + /** + * 前端传递的地区 + * */ + private String area; +} 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-client/src/main/java/com/epmet/dto/result/CustomerGridListResultDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/CustomerGridListResultDTO.java new file mode 100644 index 0000000000..0ee73173ca --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/CustomerGridListResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result;/** + * Created by 11 on 2020/3/17. + */ + +import java.io.Serializable; + +/** + * @Description + * @ClassName CustomerGridListResultDTO + * @Author wangc + * @date 2020.03.17 13:56 + */ +public class CustomerGridListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //网格Id epmet_gov_org.customer_gird.id + private String gridId; + + //客户Id epmet_gov_org.customer_gird.customer_id + private String customerId; + + //网格名称 epmet_gov_org.customer_gird.grid_name + private String gridName; + +} 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 new file mode 100644 index 0000000000..aef1f145ba --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerAccessRecordController.java @@ -0,0 +1,53 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; +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 java.util.List; + +/** + * @Description + * @ClassName StrangerAccessRecordController + * @Author wangc + * @date 2020.03.17 11:33 + */ +@RestController +@RequestMapping("stranger") +public class StrangerAccessRecordController { + + @Autowired + private StrangerAccessRecordService strangerAccessRecordService; + + + /** + * 陌生访客授权位置获取附近网格数据 + * + * */ + @PostMapping("getlocationcustomergridlist") + Result> getLocationCustomerGridList(@RequestBody CustomerGridListQueryDTO customerGridListQueryDTO){ + + ValidatorUtils.validateEntity(customerGridListQueryDTO); + + return new Result>().ok(strangerAccessRecordService.ListCustomerGrid(customerGridListQueryDTO)); + + } + /** + * 陌生访客自动选定位置获取附近网格数据 + * + * */ + @PostMapping("getselectcdcustomergridlist") + Result> getSelectcdCustomerGridList(@RequestBody CustomerGridListQueryDTO customerGridListQueryDTO){ + + ValidatorUtils.validateEntity(customerGridListQueryDTO); + + return new Result>().ok(strangerAccessRecordService.ListCustomerGrid(customerGridListQueryDTO)); + } +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.java new file mode 100644 index 0000000000..c35de19740 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.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 StrangerController { + + @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 new file mode 100644 index 0000000000..2a66e64424 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.StrangerAccessRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 陌生人访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface StrangerAccessRecordDao extends BaseDao { + +} \ 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/StrangerAccessRecordEntity.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerAccessRecordEntity.java new file mode 100644 index 0000000000..f707fd0b25 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerAccessRecordEntity.java @@ -0,0 +1,72 @@ +/** + * 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; + +import java.util.Date; + +/** + * 陌生人访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("stranger_access_record") +public class StrangerAccessRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 定位地区编码 (用户允许获取位置) + */ + private String locationAreaCode; + + /** + * 选择地区编码 (用户选择地区位置 + */ + private String selectedAreaCode; + + /** + * 是否首次位置授权(0:是 1:否) + */ + private Integer isAuthorized; + + /** + * 网格数 根据位置查询到的附近网格数 + */ + private Integer gridNumber; + + /** + * 访问时间 访问的当前时间 + */ + private Date visitTime; + + private String province; + + private String city; + + private String area; + +} 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/excel/StrangerAccessRecordExcel.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/excel/StrangerAccessRecordExcel.java new file mode 100644 index 0000000000..977f253ef3 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/excel/StrangerAccessRecordExcel.java @@ -0,0 +1,71 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 陌生人访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class StrangerAccessRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "定位地区编码 (用户允许获取位置)") + private String locationAreaCode; + + @Excel(name = "选择地区编码 (用户选择地区位置") + private String lelectedAreaCode; + + @Excel(name = "是否首次位置授权(0:是 1:否)") + private Integer isAuthorized; + + @Excel(name = "网格数 根据位置查询到的附近网格数") + private Integer gridNumber; + + @Excel(name = "访问时间 访问的当前时间") + private Date visitTime; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..fe9f1d879b --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,41 @@ +package com.epmet.feign; + + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; +import com.epmet.dto.result.CustomerGridListResultDTO; +import com.epmet.feign.impl.GovOrgFeginFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + + +/** + * Feign调用gov-org-server模块 + * Created by 11 on 2020/3/17. + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeginFallBack.class, url="http://localhost:8092") +public interface GovOrgFeignClient { + + /** + * 根据地区编码获取附近网格数据 + * @Param areaCode 地区编码 + * @Param pageNo 当前页 + * @Param pageSize 每页数据量 + * */ + @GetMapping("/gov/org/customergrid/queryListForStrangerByOrder") + Result> getPageForStrangerGuideInterface(@RequestParam("areaCode")String areaCode, @RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize); + + + + + +} 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/GovOrgFeginFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeginFallBack.java new file mode 100644 index 0000000000..5b1b691b3a --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeginFallBack.java @@ -0,0 +1,33 @@ +package com.epmet.feign.fallback;/** + * Created by 11 on 2020/3/17. + */ + +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.result.CustomerGridForStangerResultDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description + * @ClassName GovOrgFeginFallBack + * @Author wangc + * @date 2020.03.17 14:29 + */ +@Component +public class GovOrgFeginFallBack implements GovOrgFeignClient { + + /** + * 根据地区编码获取附近网格数据 + * @Param areaCode 地区编码 + * @Param pageNo 当前页 + * @Param pageSize 每页数据量 + * */ + @Override + public Result> getPageForStrangerGuideInterface(String areaCode, Integer pageNo, Integer pageSize) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListForStrangerByOrder",areaCode,pageNo,pageSize); + } +} 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 new file mode 100644 index 0000000000..956682fc98 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java @@ -0,0 +1,21 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; +import com.epmet.entity.StrangerAccessRecordEntity; + +import java.util.List; + +/** + * Created by 11 on 2020/3/17. + */ + +public interface StrangerAccessRecordService extends BaseService { + + /** + * + * 陌生人根据位置码获取附近网格数据,并且插入陌生人访客记录 + * */ + List ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO); +} 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 new file mode 100644 index 0000000000..00d779cfad --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java @@ -0,0 +1,80 @@ +package com.epmet.service.impl;/** + * Created by 11 on 2020/3/17. + */ + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.StrangerAccessRecordDao; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; +import com.epmet.entity.StrangerAccessRecordEntity; +import com.epmet.feign.GovOrgFeignClient; +import com.epmet.service.StrangerAccessRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @Description + * @ClassName ResiGuideServiceImpl + * @Author wangc + * @date 2020.03.17 13:01 + */ +@Service +public class StrangerAccessRecordServiceImpl extends BaseServiceImpl implements StrangerAccessRecordService { + + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + /** + * + * 陌生人根据位置码获取附近网格数据,并且插入陌生人访客记录 + * */ + @Override + public List ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO) { + + Result> queryResult = + govOrgFeignClient + .getPageForStrangerGuideInterface(customerGridListQueryDTO.getAreaCode(),customerGridListQueryDTO.getPageNo(),customerGridListQueryDTO.getPageSize()); + if(0 == queryResult.getCode()) { + + + List queryList = queryResult.getData(); + if (null != queryResult && queryList.size() > 0) { + StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity(); + //未授权,手动选择 locationAreaCode + if (0 == customerGridListQueryDTO.getIsAuthorized()) { + strangerTrance.setLocationAreaCode(customerGridListQueryDTO.getSelectedAreaCode()); + } else if (1 == customerGridListQueryDTO.getIsAuthorized()) { + //已授权,自动选择 selectedAreaCode + strangerTrance.setLocationAreaCode(customerGridListQueryDTO.getAreaCode()); + } + strangerTrance.setIsAuthorized(customerGridListQueryDTO.getIsAuthorized()); + strangerTrance.setGridNumber(queryList.size()); + strangerTrance.setVisitTime(new Date()); + strangerTrance.setDelFlag("1"); + strangerTrance.setRevision(0); + strangerTrance.setCreatedBy("陌生人访客"); + strangerTrance.setCreatedTime(new Date()); + strangerTrance.setProvince(customerGridListQueryDTO.getProvince()); + strangerTrance.setCity(customerGridListQueryDTO.getCity()); + strangerTrance.setArea(customerGridListQueryDTO.getArea()); + insert(strangerTrance); + + return queryList; + } else { + + return null; + } + }else{ + return null; + } + + + } + + +} 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/logback-spring.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..6f0e508a90 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..84434a743a --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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/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..e342b66cd5 --- /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.GovOrgFormDTO; +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(GovOrgFormDTO 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..445df65329 --- /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.GovOrgFormDTO; +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(GovOrgFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",formDTO); + } +}