forked from rongchao/epmet-cloud-rizhao
57 changed files with 1748 additions and 47 deletions
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.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; |
|||
|
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.epmet.dto.constant; |
|||
|
|||
/** |
|||
* 常量 |
|||
* @author sun |
|||
* @since 1.0.0 |
|||
*/ |
|||
public interface OperCustomizeConstant { |
|||
/** |
|||
* 数据状态-已发布 |
|||
*/ |
|||
String STATUS = "0"; |
|||
/** |
|||
* 数据状态-草稿 |
|||
*/ |
|||
String STATUS_ONE = "1"; |
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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<HomeComponentFormDTO> componentList; |
|||
} |
@ -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; |
|||
|
|||
} |
@ -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<CommonComponentDesignResultDTO> functionList; |
|||
/** |
|||
* 悬浮区 |
|||
*/ |
|||
private CommonComponentDesignResultDTO floatingList; |
|||
/** |
|||
*用于标识已使用的功能组件id列表(不含通用组件) |
|||
*/ |
|||
private List<String> usedComponentIdList; |
|||
} |
@ -0,0 +1,111 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.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; |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.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; |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.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<HomeDesignByCustomerResultDTO> getValidCustomerList(@RequestBody StrangerFormDTO formDTO) throws Exception { |
|||
return strangerService.getgridhome(formDTO); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.StrangerEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @author sun |
|||
*/ |
|||
@Mapper |
|||
public interface StrangerDao extends BaseDao<StrangerEntity> { |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("stranger") |
|||
public class StrangerEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
} |
@ -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); |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -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<HomeDesignByCustomerResultDTO> getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO); |
|||
|
|||
} |
@ -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); |
|||
} |
|||
|
|||
|
|||
} |
@ -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<HomeDesignByCustomerResultDTO> getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getHomeReleaseByCustomer",formDTO); |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.form.StrangerFormDTO; |
|||
import com.epmet.dto.result.HomeDesignByCustomerResultDTO; |
|||
import com.epmet.entity.StrangerEntity; |
|||
|
|||
public interface StrangerService extends BaseService<StrangerEntity> { |
|||
|
|||
/** |
|||
* 居民端-网格链接获取客户首页配置 |
|||
* @param |
|||
* @return void |
|||
* @author sun |
|||
*/ |
|||
Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO); |
|||
} |
@ -0,0 +1,79 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dao.StrangerDao; |
|||
import com.epmet.dto.form.CustomerHomeFormDTO; |
|||
import com.epmet.dto.form.StrangerFormDTO; |
|||
import com.epmet.dto.form.VisitedFormDTO; |
|||
import com.epmet.dto.result.HomeDesignByCustomerResultDTO; |
|||
import com.epmet.entity.StrangerEntity; |
|||
import com.epmet.feign.EpmetUserFeignClient; |
|||
import com.epmet.feign.OperCustomizeFeignClient; |
|||
import com.epmet.service.StrangerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 居民端-陌生人导览 |
|||
* |
|||
* @author sun |
|||
* @since v1.0.0 2020-03-11 |
|||
*/ |
|||
@Service |
|||
public class StrangerServiceImpl extends BaseServiceImpl<StrangerDao, StrangerEntity> implements StrangerService { |
|||
|
|||
@Autowired |
|||
private EpmetUserFeignClient epmetUserFeignClient; |
|||
@Autowired |
|||
private OperCustomizeFeignClient operCustomizeFeignClient; |
|||
|
|||
/** |
|||
* 居民端-网格链接获取客户首页配置 |
|||
* @return void |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO) { |
|||
//token里边有所属端 userId这些参数 前台传递customerID和gridId
|
|||
//1:调用epmet-user服务查询数据 新建网格记录数据
|
|||
VisitedFormDTO vi = new VisitedFormDTO(); |
|||
vi.setGridId(formDTO.getGridId()); |
|||
vi.setCustomerId(formDTO.getCustomerId()); |
|||
//vi.setUserId(token获取);
|
|||
epmetUserFeignClient.saveLatestAndVisited(vi); |
|||
|
|||
//2:调用ope-customize服务 获取首页发布数据
|
|||
Result<HomeDesignByCustomerResultDTO> res = getCustomerHomeData(formDTO.getCustomerId()); |
|||
return res; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 调用oper-customize服务 获取首页发布数据 |
|||
*/ |
|||
public Result<HomeDesignByCustomerResultDTO> getCustomerHomeData(String customerId){ |
|||
CustomerHomeFormDTO dto = new CustomerHomeFormDTO(); |
|||
dto.setCustomerId(customerId); |
|||
//dto.setClientType(token中获取);//居民端
|
|||
return operCustomizeFeignClient.getHomeReleaseByCustomer(dto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.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; |
|||
|
|||
|
|||
} |
@ -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<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO formDTO); |
|||
|
|||
} |
@ -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<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",formDTO); |
|||
} |
|||
} |
Loading…
Reference in new issue