From b6bc4e35b1c39063a7801db670c7e30815420ac6 Mon Sep 17 00:00:00 2001 From: yinzuomei <57602893@qq.com> Date: Fri, 13 Mar 2020 20:15:39 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=94=B9=E4=B8=BAepmet=5Fcommon=5Fuser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/resi-guide/resi-guide-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index f7f8694547..eb98658a1f 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -89,7 +89,7 @@ - + epmet elink@833066 From 24d9a40f4b893ae4b5a6fada16d1e7cbda50e3ae Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 16 Mar 2020 10:41:47 +0800 Subject: [PATCH 02/39] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E9=99=8C?= =?UTF-8?q?=E7=94=9F=E4=BA=BA=E5=AF=BC=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/StrangerController.java | 39 +++++++++++++++ .../main/java/com/epmet/dao/StrangerDao.java | 33 +++++++++++++ .../java/com/epmet/entity/StrangerEntity.java | 39 +++++++++++++++ .../java/com/epmet/redis/StrangerRedis.java | 47 +++++++++++++++++++ .../com/epmet/service/StrangerService.java | 31 ++++++++++++ .../service/impl/StrangerServiceImpl.java | 41 ++++++++++++++++ .../src/main/resources/mapper/StrangerDao.xml | 16 +++++++ 7 files changed, 246 insertions(+) create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/redis/StrangerRedis.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml 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..13baaafcea --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.java @@ -0,0 +1,39 @@ +/** + * 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.service.StrangerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 居民端陌生人导览 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("customer") +public class StrangerController { + + @Autowired + private StrangerService strangerService; + +} 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..a5a4f0052b --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.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.StrangerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民端陌生人导览 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface StrangerDao extends BaseDao { + +} 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..292f66ee19 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java @@ -0,0 +1,39 @@ +/** + * 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; + +/** + * 居民端陌生人导览 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@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/redis/StrangerRedis.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/redis/StrangerRedis.java new file mode 100644 index 0000000000..a0c13b8054 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/redis/StrangerRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民端陌生人导览 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class StrangerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file 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..c834214c89 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java @@ -0,0 +1,31 @@ +/** + * 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.entity.StrangerEntity; + +/** + * 居民端陌生人导览 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface StrangerService extends BaseService { + +} 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..41c04092c3 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java @@ -0,0 +1,41 @@ +/** + * 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.dao.StrangerDao; +import com.epmet.entity.StrangerEntity; +import com.epmet.redis.StrangerRedis; +import com.epmet.service.StrangerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 居民端陌生人导览 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Service +public class StrangerServiceImpl extends BaseServiceImpl implements StrangerService { + + @Autowired + private StrangerRedis strangerRedis; + + +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml new file mode 100644 index 0000000000..f2e34969f5 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + From d372c147320e8875a54b5f156ca1922c1c7ac8b6 Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Mon, 16 Mar 2020 14:51:29 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE=E7=9A=84=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=A8=BF-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/HomeDesignByCustomerFormDTO.java | 28 ++++++++++ .../CommonComponentDesignResultDTO.java | 50 +++++++++++++++++ .../result/HomeDesignByCustomerResultDTO.java | 37 ++++++++++++ .../com/epmet/controller/HomeController.java | 15 +++++ .../java/com/epmet/dao/CustomerHomeDao.java | 5 +- .../com/epmet/dao/CustomerHomeDetailDao.java | 2 +- .../epmet/dao/CustomerHomeTemplateDao.java | 2 +- .../java/com/epmet/service/HomeService.java | 11 ++++ .../epmet/service/impl/HomeServiceImpl.java | 56 ++++++++++++++++--- .../mapper/CustomerHomeDetailDao.xml | 32 +++++++++++ 10 files changed, 226 insertions(+), 12 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignByCustomerFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentDesignResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java 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/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..3e5fb04a85 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 @@ -3,7 +3,9 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.ComponentListByCustomerFormDTO; +import com.epmet.dto.form.HomeDesignByCustomerFormDTO; 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; @@ -33,4 +35,17 @@ 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); + } } 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..ac9a99cf51 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,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerHomeDTO; +import com.epmet.dto.form.HomeDesignByCustomerFormDTO; import com.epmet.entity.CustomerHomeEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerHomeDao extends BaseDao { - + //根据客户id,所属端口,查询客户是否有发版模板信息 + CustomerHomeDTO getCustomerHomeDetailByCustomerAndClientType(HomeDesignByCustomerFormDTO form); } \ 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..bfe188fa7c 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 @@ -29,5 +29,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerHomeDetailDao extends BaseDao { - + } \ 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..f58966ac3b 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,9 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ComponentListByCustomerFormDTO; +import com.epmet.dto.form.HomeDesignByCustomerFormDTO; import com.epmet.dto.result.ComponentListByCustomerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; /** * @Description 客户定制化服务-首页 @@ -18,4 +20,13 @@ 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); } 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..b84eef3ae9 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,25 @@ 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.CustomerHomeTemplateDao; import com.epmet.dao.HomeComponentDao; +import com.epmet.dto.CustomerHomeDTO; import com.epmet.dto.form.ComponentListByCustomerFormDTO; +import com.epmet.dto.form.HomeDesignByCustomerFormDTO; +import com.epmet.dto.result.CommonComponentDesignResultDTO; import com.epmet.dto.result.ComponentListByCustomerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.service.HomeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + /** * @Description 客户定制化服务-首页 * @Author yinzuomei @@ -15,14 +27,40 @@ import org.springframework.stereotype.Service; */ @Service public class HomeServiceImpl implements HomeService { - @Autowired - private HomeComponentDao homeComponentDao; + @Autowired + private HomeComponentDao homeComponentDao; + @Autowired + private CustomerHomeDetailDao customerHomeDetailDao; + + @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 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); + } } 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..ef5dfa9cd7 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 @@ -19,4 +19,36 @@ + + \ No newline at end of file From 63b23cc521e2cb77a3da858c669571b481b6ea1f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 16 Mar 2020 15:07:30 +0800 Subject: [PATCH 04/39] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8F=98?= =?UTF-8?q?=E5=8A=A8=20=E5=88=A0=E9=99=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/StrangerController.java | 39 --------------- .../main/java/com/epmet/dao/StrangerDao.java | 33 ------------- .../java/com/epmet/entity/StrangerEntity.java | 39 --------------- .../java/com/epmet/redis/StrangerRedis.java | 47 ------------------- .../com/epmet/service/StrangerService.java | 31 ------------ .../service/impl/StrangerServiceImpl.java | 41 ---------------- .../src/main/resources/mapper/StrangerDao.xml | 16 ------- 7 files changed, 246 deletions(-) delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/redis/StrangerRedis.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml 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 deleted file mode 100644 index 13baaafcea..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerController.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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.service.StrangerService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -/** - * 居民端陌生人导览 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@RestController -@RequestMapping("customer") -public class StrangerController { - - @Autowired - private StrangerService strangerService; - -} 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 deleted file mode 100644 index a5a4f0052b..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Mapper -public interface StrangerDao extends BaseDao { - -} 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 deleted file mode 100644 index 292f66ee19..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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; - -/** - * 居民端陌生人导览 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@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/redis/StrangerRedis.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/redis/StrangerRedis.java deleted file mode 100644 index a0c13b8054..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/redis/StrangerRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 居民端陌生人导览 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Component -public class StrangerRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file 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 deleted file mode 100644 index c834214c89..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.entity.StrangerEntity; - -/** - * 居民端陌生人导览 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -public interface StrangerService extends BaseService { - -} 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 deleted file mode 100644 index 41c04092c3..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.dao.StrangerDao; -import com.epmet.entity.StrangerEntity; -import com.epmet.redis.StrangerRedis; -import com.epmet.service.StrangerService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 居民端陌生人导览 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Service -public class StrangerServiceImpl extends BaseServiceImpl implements StrangerService { - - @Autowired - private StrangerRedis strangerRedis; - - -} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml deleted file mode 100644 index f2e34969f5..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerDao.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - From 9a7af6ea3c8a70540986ec3e02b206fd7c87db5d Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Mon, 16 Mar 2020 15:49:01 +0800 Subject: [PATCH 05/39] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE=E7=9A=84=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=A8=BF-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/CustomerHomeDetailDao.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 bfe188fa7c..dd46814c64 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,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +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 +33,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerHomeDetailDao extends BaseDao { - + List getCustomerHomeDetailComponent(HomeDesignByCustomerFormDTO form); } \ No newline at end of file From 4060895be1474435852ca80451fb97bec7c69c6a Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Mon, 16 Mar 2020 15:57:36 +0800 Subject: [PATCH 06/39] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE=E7=9A=84=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=A8=BF-=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerHomeDetailDao.xml | 3 --- 1 file changed, 3 deletions(-) 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 ef5dfa9cd7..673153b3e1 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 @@ -47,8 +47,5 @@ LEFT JOIN home_component c ON b.COMPONENT_ID = c.id WHERE a.DEL_FLAG = 0 - ORDER BY - a.CREATED_TIME DESC - LIMIT 1 \ No newline at end of file From 057910103209b0aa68f8cdf58003c2830e0885cd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 16 Mar 2020 16:16:53 +0800 Subject: [PATCH 07/39] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/GridLatestDTO.java | 101 +++++++++++++++++ .../java/com/epmet/dto/GridVisitedDTO.java | 101 +++++++++++++++++ .../controller/GridLatestController.java | 94 ++++++++++++++++ .../controller/GridVisitedController.java | 94 ++++++++++++++++ .../java/com/epmet/dao/GridLatestDao.java | 33 ++++++ .../java/com/epmet/dao/GridVisitedDao.java | 33 ++++++ .../com/epmet/entity/GridLatestEntity.java | 71 ++++++++++++ .../com/epmet/entity/GridVisitedEntity.java | 71 ++++++++++++ .../java/com/epmet/excel/GridLatestExcel.java | 74 +++++++++++++ .../com/epmet/excel/GridVisitedExcel.java | 74 +++++++++++++ .../java/com/epmet/redis/GridLatestRedis.java | 47 ++++++++ .../com/epmet/redis/GridVisitedRedis.java | 47 ++++++++ .../com/epmet/service/GridLatestService.java | 95 ++++++++++++++++ .../com/epmet/service/GridVisitedService.java | 95 ++++++++++++++++ .../service/impl/GridLatestServiceImpl.java | 104 ++++++++++++++++++ .../service/impl/GridVisitedServiceImpl.java | 104 ++++++++++++++++++ .../main/resources/mapper/GridLatestDao.xml | 23 ++++ .../main/resources/mapper/GridVisitedDao.xml | 23 ++++ 18 files changed, 1284 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java new file mode 100644 index 0000000000..98a6176f5f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java @@ -0,0 +1,101 @@ +/** + * 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-16 + */ +@Data +public class GridLatestDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id(CUSTOMER_USER.id) + */ + private String customerUserId; + + /** + * 所属地区码 (数据统计字段) + */ + private String areaCode; + + /** + * 上级组织ID (数据统计字段) + */ + private String pid; + + /** + * 最近访问时间 + */ + private Date latestTime; + + /** + * 删除标识: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-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 new file mode 100644 index 0000000000..cf2c85a332 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java @@ -0,0 +1,101 @@ +/** + * 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-16 + */ +@Data +public class GridVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 是否注册(0:否 1:是) + */ + private Integer isRegister; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id + */ + private String customerUserId; + + /** + * 是否首次位置授权(0:否 1:是) + */ + private Integer isAuthorized; + + /** + * 访问时间 一个用户一天访问一个网格只有一条记录 + */ + 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-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java new file mode 100644 index 0000000000..a6c1500b02 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java @@ -0,0 +1,94 @@ +/** + * 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.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.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.GridLatestDTO; +import com.epmet.excel.GridLatestExcel; +import com.epmet.service.GridLatestService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("gridlatest") +public class GridLatestController { + + @Autowired + private GridLatestService gridLatestService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridLatestService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridLatestDTO data = gridLatestService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridLatestDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + gridLatestService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridLatestDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridLatestService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridLatestService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridLatestService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridLatestExcel.class); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..a960c39e20 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java @@ -0,0 +1,94 @@ +/** + * 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.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.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.GridVisitedDTO; +import com.epmet.excel.GridVisitedExcel; +import com.epmet.service.GridVisitedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@RestController +@RequestMapping("gridvisited") +public class GridVisitedController { + + @Autowired + private GridVisitedService gridVisitedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = gridVisitedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GridVisitedDTO data = gridVisitedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GridVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + gridVisitedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GridVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + gridVisitedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + gridVisitedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = gridVisitedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GridVisitedExcel.class); + } + +} \ 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 new file mode 100644 index 0000000000..2b31a4b1a8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.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.GridLatestEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface GridLatestDao extends BaseDao { + +} \ 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 new file mode 100644 index 0000000000..e51d88956d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.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.GridVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface GridVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java new file mode 100644 index 0000000000..254829c16f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.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.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("grid_latest") +public class GridLatestEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id(CUSTOMER_USER.id) + */ + private String customerUserId; + + /** + * 所属地区码 (数据统计字段) + */ + private String areaCode; + + /** + * 上级组织ID (数据统计字段) + */ + private String pid; + + /** + * 最近访问时间 + */ + private Date latestTime; + +} 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 new file mode 100644 index 0000000000..9fb79ca7af --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.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.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("grid_visited") +public class GridVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 是否注册(0:否 1:是) + */ + private Integer isRegister; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id + */ + private String customerUserId; + + /** + * 是否首次位置授权(0:否 1:是) + */ + private Integer isAuthorized; + + /** + * 访问时间 一个用户一天访问一个网格只有一条记录 + */ + private Date visitTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java new file mode 100644 index 0000000000..e4d6000914 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java @@ -0,0 +1,74 @@ +/** + * 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 GridLatestExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id CUSTOMER.id") + private String customerId; + + @Excel(name = "网格表Id(CUSTOMER_GRID.id)") + private String gridId; + + @Excel(name = "用户Id(CUSTOMER_USER.id)") + private String customerUserId; + + @Excel(name = "所属地区码 (数据统计字段)") + private String areaCode; + + @Excel(name = "上级组织ID (数据统计字段)") + private String pid; + + @Excel(name = "最近访问时间") + private Date latestTime; + + @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-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 new file mode 100644 index 0000000000..13c5fefc26 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java @@ -0,0 +1,74 @@ +/** + * 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 GridVisitedExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "是否注册(0:否 1:是)") + private Integer isRegister; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格表Id (CUSTOMER_GRID.id)") + private String gridId; + + @Excel(name = "用户Id") + private String customerUserId; + + @Excel(name = "是否首次位置授权(0:否 1:是)") + private Integer isAuthorized; + + @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-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java new file mode 100644 index 0000000000..41bf0cfb49 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class GridLatestRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java new file mode 100644 index 0000000000..9316d6f3c7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Component +public class GridVisitedRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..1ddbb716a8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java @@ -0,0 +1,95 @@ +/** + * 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.page.PageData; +import com.epmet.dto.GridLatestDTO; +import com.epmet.entity.GridLatestEntity; + +import java.util.List; +import java.util.Map; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface GridLatestService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridLatestDTO + * @author generator + * @date 2020-03-16 + */ + GridLatestDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(GridLatestDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(GridLatestDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000000..d081fab310 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java @@ -0,0 +1,95 @@ +/** + * 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.page.PageData; +import com.epmet.dto.GridVisitedDTO; +import com.epmet.entity.GridVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +public interface GridVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridVisitedDTO + * @author generator + * @date 2020-03-16 + */ + GridVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void save(GridVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-16 + */ + void update(GridVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-16 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000000..1ab4bac35f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.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.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.GridLatestDTO; +import com.epmet.entity.GridLatestEntity; +import com.epmet.redis.GridLatestRedis; +import com.epmet.service.GridLatestService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 最近访问网格表 记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Service +public class GridLatestServiceImpl extends BaseServiceImpl implements GridLatestService { + + @Autowired + private GridLatestRedis gridLatestRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridLatestDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridLatestDTO.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 GridLatestDTO get(String id) { + GridLatestEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GridLatestDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridLatestDTO dto) { + GridLatestEntity entity = ConvertUtils.sourceToTarget(dto, GridLatestEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridLatestDTO dto) { + GridLatestEntity entity = ConvertUtils.sourceToTarget(dto, GridLatestEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java new file mode 100644 index 0000000000..fdf5bd0a2f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.GridVisitedDao; +import com.epmet.dto.GridVisitedDTO; +import com.epmet.entity.GridVisitedEntity; +import com.epmet.redis.GridVisitedRedis; +import com.epmet.service.GridVisitedService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Service +public class GridVisitedServiceImpl extends BaseServiceImpl implements GridVisitedService { + + @Autowired + private GridVisitedRedis gridVisitedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridVisitedDTO.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 GridVisitedDTO get(String id) { + GridVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GridVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridVisitedDTO dto) { + GridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridVisitedDTO dto) { + GridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 new file mode 100644 index 0000000000..c05db815e8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..2ea9a363db --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 958b1fb8a4d6d984d4fd90e13a868048aa5e97ee Mon Sep 17 00:00:00 2001 From: hosinokamui Date: Mon, 16 Mar 2020 18:28:45 +0800 Subject: [PATCH 08/39] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=A8=BF=E4=BF=9D=E5=AD=98=EF=BC=8C=E9=A6=96=E9=A1=B5=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E7=A8=BF=E5=8F=91=E7=89=88api=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/HomeComponentFormDTO.java | 42 ++++++++++++++++ .../com/epmet/dto/form/HomeDesignFormDTO.java | 33 ++++++++++++ .../com/epmet/controller/HomeController.java | 30 ++++++++++- .../java/com/epmet/dao/CustomerHomeDao.java | 18 +++++-- .../com/epmet/dao/CustomerHomeDetailDao.java | 10 ++++ .../java/com/epmet/service/HomeService.java | 19 +++++++ .../epmet/service/impl/HomeServiceImpl.java | 50 +++++++++++++++++-- .../main/resources/mapper/CustomerHomeDao.xml | 13 +++++ .../mapper/CustomerHomeDetailDao.xml | 7 +++ 9 files changed, 213 insertions(+), 9 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeComponentFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignFormDTO.java 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/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-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 3e5fb04a85..2ee5686c71 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 @@ -4,10 +4,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.ComponentListByCustomerFormDTO; 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.*; @@ -48,4 +48,32 @@ public class HomeController { 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(); + } } 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 ac9a99cf51..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,11 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.CustomerHomeDTO; -import com.epmet.dto.form.HomeDesignByCustomerFormDTO; +import com.epmet.dto.form.HomeDesignFormDTO; import com.epmet.entity.CustomerHomeEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 客户首页表 * @@ -31,6 +32,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerHomeDao extends BaseDao { - //根据客户id,所属端口,查询客户是否有发版模板信息 - CustomerHomeDTO getCustomerHomeDetailByCustomerAndClientType(HomeDesignByCustomerFormDTO form); + + /** + * + * 客户首页列表查询 + * + * @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 dd46814c64..9a3d2e4343 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 @@ -33,5 +33,15 @@ import java.util.List; */ @Mapper public interface CustomerHomeDetailDao extends BaseDao { + /** + * + * 根据界面id清除数据 + * + * @param homeId 界面ID + * @author zhaoqifeng + * @date 2020/3/16 14:02 + */ + void deleteCustomerHomeDetailByHomeId(String homeId); + List getCustomerHomeDetailComponent(HomeDesignByCustomerFormDTO form); } \ 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 f58966ac3b..cb43d8c0c3 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 @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ComponentListByCustomerFormDTO; import com.epmet.dto.form.HomeDesignByCustomerFormDTO; +import com.epmet.dto.form.HomeDesignFormDTO; import com.epmet.dto.result.ComponentListByCustomerResultDTO; import com.epmet.dto.result.HomeDesignByCustomerResultDTO; @@ -29,4 +30,22 @@ public interface HomeService { * @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); } 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 b84eef3ae9..d68282628e 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 @@ -3,22 +3,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.CustomerHomeTemplateDao; import com.epmet.dao.HomeComponentDao; -import com.epmet.dto.CustomerHomeDTO; import com.epmet.dto.form.ComponentListByCustomerFormDTO; +import com.epmet.dto.form.HomeComponentFormDTO; import com.epmet.dto.form.HomeDesignByCustomerFormDTO; +import com.epmet.dto.form.HomeDesignFormDTO; 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.HashSet; import java.util.List; -import java.util.Set; /** * @Description 客户定制化服务-首页 @@ -31,6 +31,8 @@ public class HomeServiceImpl implements HomeService { private HomeComponentDao homeComponentDao; @Autowired private CustomerHomeDetailDao customerHomeDetailDao; + @Autowired + private CustomerHomeDao customerHomeDao; @Override public Result getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO) { @@ -63,4 +65,44 @@ public class HomeServiceImpl implements HomeService { resultDTO.setUsedComponentIdList(usedComponent); return new Result().ok(resultDTO); } + + @Override + public void saveHomeDesign(HomeDesignFormDTO formDTO) { + + List customerHomeList = customerHomeDao.selectCustomerHomeList(formDTO); + + for(CustomerHomeEntity entity : customerHomeList) { + if (entity.getStatus() == 1) { + saveCustomerHomeDetail(formDTO, entity); + } + } + } + + @Override + public void distributeHomeDesign(HomeDesignFormDTO formDTO) { + + List customerHomeList = customerHomeDao.selectCustomerHomeList(formDTO); + + for(CustomerHomeEntity entity : customerHomeList) { + saveCustomerHomeDetail(formDTO, entity); + } + } + + private void saveCustomerHomeDetail(HomeDesignFormDTO formDTO, CustomerHomeEntity entity) { + //根据homeID清空客户首页详情表中的数据 + customerHomeDetailDao.deleteCustomerHomeDetailByHomeId(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); + + } + } } 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 @@ + + + \ 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 673153b3e1..57a4efe220 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,6 +18,13 @@ + + DELETE + FROM + CUSTOMER_HOME_DETAIL + WHERE + HOME_ID = #{homeId} + Date: Tue, 17 Mar 2020 12:36:16 +0800 Subject: [PATCH 13/39] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/constant/ServiceConstant.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 2329a246b6..c358b530b3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -48,4 +48,9 @@ public interface ServiceConstant { * 陌生人导览 */ String RESI_GUIDE_SERVER = "resi-guide-server"; + + /** + * 政府端组织架构 + */ + String GOV_ORG_SERVER = "gov-org-server"; } From 97744844ed2d469b9f17b251054ef020c3ba039e Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 17 Mar 2020 14:14:39 +0800 Subject: [PATCH 14/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E5=AF=BC?= =?UTF-8?q?=E8=A7=88=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=8E=88=E6=9D=83/?= =?UTF-8?q?=E4=B8=8D=E6=8E=88=E6=9D=83=E4=BD=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=B6=E6=9F=A5=E8=AF=A2=E7=BD=91=E6=A0=BC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/CustomerGridListQueryDTO.java | 37 ++++ .../dto/result/CustomerGridListResultDTO.java | 26 +++ .../epmet/controller/ResiGuideController.java | 39 +++++ .../epmet/dao/StrangerAccessRecordDao.java | 33 ++++ .../entity/StrangerAccessRecordEntity.java | 66 ++++++++ .../excel/StrangerAccessRecordExcel.java | 71 ++++++++ .../com/epmet/service/ResiGuideService.java | 16 ++ .../service/impl/ResiGuideServiceImpl.java | 29 ++++ .../src/main/resources/logback-spring.xml | 159 ++++++++++++++++++ .../mapper/StrangerAccessRecordDao.xml | 24 +++ 10 files changed, 500 insertions(+) create mode 100644 epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/CustomerGridListQueryDTO.java create mode 100644 epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/CustomerGridListResultDTO.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerAccessRecordEntity.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/excel/StrangerAccessRecordExcel.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/resources/logback-spring.xml create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml 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..9edd12b94f --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/CustomerGridListQueryDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto;/** + * Created by 11 on 2020/3/17. + */ + +import lombok.Data; + +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; + + //token信息 + private String token; + + //期望分页页码 + private Integer pageNo; + + //每页数据量(默认20) + private Integer pageSize; + + + private String areaCode; + + + private String lelectedAreaCode; + + //是否首次位置授权(0:是 1:否) + private Integer isAuthorized; +} 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/ResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java new file mode 100644 index 0000000000..9dc4f5c5b2 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java @@ -0,0 +1,39 @@ +package com.epmet.controller;/** + * Created by 11 on 2020/3/17. + */ + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridListResultDTO; +import com.epmet.service.ResiGuideService; +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; + +/** + * @Description + * @ClassName ResiGuideController + * @Author wangc + * @date 2020.03.17 11:33 + */ +@RestController +@RequestMapping("stranger") +public class ResiGuideController { + + @Autowired + private ResiGuideService resiGuideService; + + + @PostMapping() + Result> getlocationcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ + return null; + } + + @PostMapping() + Result> getlelectcdcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ + return null; + } +} 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/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..76965ff098 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerAccessRecordEntity.java @@ -0,0 +1,66 @@ +/** + * 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 lelectedAreaCode; + + /** + * 是否首次位置授权(0:是 1:否) + */ + private Integer isAuthorized; + + /** + * 网格数 根据位置查询到的附近网格数 + */ + private Integer gridNumber; + + /** + * 访问时间 访问的当前时间 + */ + private Date visitTime; + +} 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/service/ResiGuideService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java new file mode 100644 index 0000000000..26dd0af259 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java @@ -0,0 +1,16 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridListResultDTO; +import com.epmet.entity.StrangerAccessRecordEntity; + +/** + * Created by 11 on 2020/3/17. + */ + +public interface ResiGuideService extends BaseService { + + PageData ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO); +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java new file mode 100644 index 0000000000..5efc51dcb0 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java @@ -0,0 +1,29 @@ +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.page.PageData; +import com.epmet.dao.StrangerAccessRecordDao; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridListResultDTO; +import com.epmet.entity.StrangerAccessRecordEntity; +import com.epmet.service.ResiGuideService; +import org.springframework.stereotype.Service; + +/** + * @Description + * @ClassName ResiGuideServiceImpl + * @Author wangc + * @date 2020.03.17 13:01 + */ +@Service +public class ResiGuideServiceImpl extends BaseServiceImpl implements ResiGuideService { + + + @Override + public PageData ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO) { + + return null; + } +} 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..ca90b06034 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 50a775ac70f13a0c9c804b3e7f578fddbb13e0e0 Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Tue, 17 Mar 2020 14:44:19 +0800 Subject: [PATCH 15/39] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id,=E6=89=80=E5=B1=9E=E7=AB=AF=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AE=A2=E6=88=B7=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E8=AE=A1=E7=A8=BF-=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/CustomerHomeDetailDao.java | 7 ++++++- .../main/java/com/epmet/service/impl/HomeServiceImpl.java | 5 +++-- .../src/main/resources/mapper/CustomerHomeDetailDao.xml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) 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 c6571bd2ef..838b83083d 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 @@ -42,6 +42,11 @@ public interface CustomerHomeDetailDao extends BaseDao * @date 2020/3/16 14:02 */ void updateCustomerHomeDetailByHomeId(String homeId); - + /** + * + * 根据客户id,所属端获取客户首页配置的设计稿 + * @author yangshaoping + * @date 2020/3/1714:02 + */ List getCustomerHomeDetailComponent(HomeDesignByCustomerFormDTO form); } \ No newline at end of file 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 2d94250b2e..b3c72107bd 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 @@ -45,9 +45,10 @@ public class HomeServiceImpl implements HomeService { @Override public Result getHomeDesignByCustomer(HomeDesignByCustomerFormDTO formDTO) { HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO(); + //根据客户id,所属端获取客户首页配置的设计稿 List list = customerHomeDetailDao.getCustomerHomeDetailComponent(formDTO); - List flist=new ArrayList();//功能组件 - List usedComponent=new ArrayList<>();//使用的组件集合 + List flist=new ArrayList();//功能组件列表 + List usedComponent=new ArrayList<>();//使用过的组件集合 for(CommonComponentDesignResultDTO c:list){ usedComponent.add(c.getComponentId()); //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 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 91df873854..ab479f04a4 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 @@ -28,7 +28,7 @@ AND DEL_FLAG = 0 - + \ No newline at end of file From 7db67f2594281148d3644e3a1e1dc0b558f2b54c Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 17 Mar 2020 15:35:33 +0800 Subject: [PATCH 17/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E5=AF=BC?= =?UTF-8?q?=E8=A7=88=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=8E=88=E6=9D=83/?= =?UTF-8?q?=E4=B8=8D=E6=8E=88=E6=9D=83=E4=BD=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=B6=E6=9F=A5=E8=AF=A2=E7=BD=91=E6=A0=BC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerGridController.java | 5 +++ .../epmet/controller/ResiGuideController.java | 19 +++++--- .../com/epmet/feign/GovOrgFeignClient.java | 22 ++++++++++ .../epmet/feign/impl/GovOrgFeginFallBack.java | 29 +++++++++++++ .../com/epmet/service/ResiGuideService.java | 2 + .../service/impl/ResiGuideServiceImpl.java | 43 ++++++++++++++++++- 6 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java 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 be74383365..46eba71b6f 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 @@ -91,4 +91,9 @@ public class CustomerGridController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerGridExcel.class); } + @GetMapping("{areaCode}") + public Result queryListByOrder(@PathVariable("areaCode")String areaCode){ + + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java index 9dc4f5c5b2..a7ef911c89 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java @@ -27,13 +27,22 @@ public class ResiGuideController { private ResiGuideService resiGuideService; - @PostMapping() - Result> getlocationcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ - return null; + @PostMapping("getlocationcustomergridlist") + Result> getlocationcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ + Result> result = new Result<>(); + + //TODO..捕获异常 + + return result.ok(resiGuideService.ListCustomerGrid(queryParam)); + } - @PostMapping() + @PostMapping("getlelectcdcustomergridlist") Result> getlelectcdcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ - return null; + Result> result = new Result<>(); + + //TODO..捕获异常 + + return result.ok(resiGuideService.ListCustomerGrid(queryParam)); } } 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..990e8fb5db --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,22 @@ +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.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.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + + +/** + * Created by 11 on 2020/3/17. + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeginFallBack.class) +public interface GovOrgFeignClient { + @PostMapping(value = "/gov/org/customergrid/{areaCode}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> getPageForStrangerGuideInterface(@PathVariable("areaCode")String areaCode); +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java new file mode 100644 index 0000000000..286ce4e36c --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java @@ -0,0 +1,29 @@ +package com.epmet.feign.impl;/** + * Created by 11 on 2020/3/17. + */ + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.result.CustomerGridListResultDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Controller; + +/** + * @Description + * @ClassName GovOrgFeginFallBack + * @Author wangc + * @date 2020.03.17 14:29 + */ +@Component +public class GovOrgFeginFallBack implements GovOrgFeignClient { + + @Override + public Result> getPageForStrangerGuideInterface(String areaCode) { + + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListByAreaCodeOrderBy",areaCode); + } +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java index 26dd0af259..84e11a07da 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java @@ -13,4 +13,6 @@ import com.epmet.entity.StrangerAccessRecordEntity; public interface ResiGuideService extends BaseService { PageData ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO); + + void save(StrangerAccessRecordEntity strangerAccessRecordEntity); } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java index 5efc51dcb0..f7b1b32f59 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java @@ -4,12 +4,19 @@ package com.epmet.service.impl;/** import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.StrangerAccessRecordDao; import com.epmet.dto.CustomerGridListQueryDTO; import com.epmet.dto.result.CustomerGridListResultDTO; import com.epmet.entity.StrangerAccessRecordEntity; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.ResiGuideService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; /** * @Description @@ -20,10 +27,44 @@ import org.springframework.stereotype.Service; @Service public class ResiGuideServiceImpl extends BaseServiceImpl implements ResiGuideService { + @Autowired + private GovOrgFeignClient govOrgFeignClient; @Override public PageData ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO) { - return null; + PageData queryResult = + govOrgFeignClient.getPageForStrangerGuideInterface(customerGridListQueryDTO); + if(null != queryResult.getList() && queryResult.getList().size() > 0){ + for(CustomerGridListResultDTO obj : queryResult.getList()){ + StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity(); + //未授权,手动选择 locationAreaCode + if(0 == customerGridListQueryDTO.getIsAuthorized()){ + strangerTrance.setLocationAreaCode(customerGridListQueryDTO.getLelectedAreaCode()); + }else if( 1 == customerGridListQueryDTO.getIsAuthorized()){ + //已授权,自动选择 lelectedAreaCode + strangerTrance.setLocationAreaCode(customerGridListQueryDTO.getAreaCode()); + } + strangerTrance.setIsAuthorized(customerGridListQueryDTO.getIsAuthorized()); + strangerTrance.setGridNumber(queryResult.getTotal()); + strangerTrance.setVisitTime(new Date()); + strangerTrance.setDelFlag("1"); + strangerTrance.setRevision(0); + strangerTrance.setCreatedBy("陌生人访客"); + strangerTrance.setCreatedTime(new Date()); + + insert(strangerTrance); + } + + } + + return queryResult; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StrangerAccessRecordEntity strangerAccessRecordEntity) { + StrangerAccessRecordEntity entity = ConvertUtils.sourceToTarget(strangerAccessRecordEntity, StrangerAccessRecordEntity.class); + insert(entity); } } From 16e93abf169cc9b29a951d8313037b77b9432f04 Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Tue, 17 Mar 2020 15:40:57 +0800 Subject: [PATCH 18/39] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id,=E6=89=80=E5=B1=9E=E7=AB=AF=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AE=A2=E6=88=B7=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E8=AE=A1=E7=A8=BF-=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E5=BC=95=E7=94=A8=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ClientTypeEnum.java | 42 +++++++++++++++++++ .../epmet/service/impl/HomeServiceImpl.java | 9 ++-- 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java new file mode 100644 index 0000000000..0dcbccfc4f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java @@ -0,0 +1,42 @@ +package com.epmet.constant; + +/** + * @Classname ClientType + * @Description TODO + * @Date 2020/3/17 15:22 + * @Created by yangs + */ +public enum ClientTypeEnum { + //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + title("0", "title"), + top("1","top"), + function("2", "function"), + floating("3", "floating"); + private String key; + + private String name; + + /** + * @param key + * @param name + */ + ClientTypeEnum(String key, String name) { + this.key = key; + this.name = name; + } + + /** + * @return Returns the key. + */ + public String getKey() { + return key; + } + + /** + * @return Returns the name. + */ + public String getName() { + return name; + } + +} 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 b3c72107bd..22b2c3a521 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,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ClientTypeEnum; import com.epmet.dao.CustomerHomeDao; import com.epmet.dao.CustomerHomeDetailDao; import com.epmet.dao.HomeComponentDao; @@ -52,13 +53,13 @@ public class HomeServiceImpl implements HomeService { for(CommonComponentDesignResultDTO c:list){ usedComponent.add(c.getComponentId()); //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 - if("0".equals(c.getRegion())){ + if(ClientTypeEnum.title.getKey().equals(c.getRegion())){ resultDTO.setTitleList(c); - }else if("1".equals(c.getRegion())){ + }else if(ClientTypeEnum.top.getKey().equals(c.getRegion())){ resultDTO.setTopList(c); - }else if("2".equals(c.getRegion())){ + }else if(ClientTypeEnum.function.getKey().equals(c.getRegion())){ flist.add(c); - }else if("3".equals(c.getRegion())){ + }else if(ClientTypeEnum.floating.getKey().equals(c.getRegion())){ resultDTO.setFloatingList(c); } } From 203625ea7fcc195b867d2d16bca8849ee1881288 Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Tue, 17 Mar 2020 15:45:06 +0800 Subject: [PATCH 19/39] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id,=E6=89=80=E5=B1=9E=E7=AB=AF=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AE=A2=E6=88=B7=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E8=AE=A1=E7=A8=BF-=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E5=BC=95=E7=94=A8=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=94=B9=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/{ClientTypeEnum.java => ReginEnum.java} | 8 ++++---- .../java/com/epmet/service/impl/HomeServiceImpl.java | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) rename epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/{ClientTypeEnum.java => ReginEnum.java} (78%) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java similarity index 78% rename from epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java rename to epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java index 0dcbccfc4f..47ef5eed86 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ClientTypeEnum.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java @@ -1,12 +1,12 @@ package com.epmet.constant; /** - * @Classname ClientType - * @Description TODO + * @Classname ReginEnum + * @Description 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 * @Date 2020/3/17 15:22 * @Created by yangs */ -public enum ClientTypeEnum { +public enum ReginEnum { //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 title("0", "title"), top("1","top"), @@ -20,7 +20,7 @@ public enum ClientTypeEnum { * @param key * @param name */ - ClientTypeEnum(String key, String name) { + ReginEnum(String key, String name) { this.key = key; this.name = name; } 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 22b2c3a521..53f42e0acd 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,7 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.ClientTypeEnum; +import com.epmet.constant.ReginEnum; import com.epmet.dao.CustomerHomeDao; import com.epmet.dao.CustomerHomeDetailDao; import com.epmet.dao.HomeComponentDao; @@ -53,13 +53,13 @@ public class HomeServiceImpl implements HomeService { for(CommonComponentDesignResultDTO c:list){ usedComponent.add(c.getComponentId()); //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 - if(ClientTypeEnum.title.getKey().equals(c.getRegion())){ + if(ReginEnum.title.getKey().equals(c.getRegion())){ resultDTO.setTitleList(c); - }else if(ClientTypeEnum.top.getKey().equals(c.getRegion())){ + }else if(ReginEnum.top.getKey().equals(c.getRegion())){ resultDTO.setTopList(c); - }else if(ClientTypeEnum.function.getKey().equals(c.getRegion())){ + }else if(ReginEnum.function.getKey().equals(c.getRegion())){ flist.add(c); - }else if(ClientTypeEnum.floating.getKey().equals(c.getRegion())){ + }else if(ReginEnum.floating.getKey().equals(c.getRegion())){ resultDTO.setFloatingList(c); } } From 62dd732efcd0adb297ca455505a2640e2efb09ff Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Tue, 17 Mar 2020 16:51:49 +0800 Subject: [PATCH 20/39] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id,=E6=89=80=E5=B1=9E=E7=AB=AF=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AE=A2=E6=88=B7=E9=A6=96=E9=A1=B5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E8=AE=A1=E7=A8=BF-regin=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=94=B1int=20=E6=94=B9=E4=B8=BAvarchar(?= =?UTF-8?q?=E6=B6=89=E5=8F=8A3=E4=B8=AA=E7=9B=B8=E5=85=B3=E8=A1=A8?= =?UTF-8?q?=E8=8D=89=E7=A8=BF=E8=A1=A8-=E6=A8=A1=E6=9D=BF=E8=A1=A8-?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=A1=A8=E9=83=BD=E6=94=B9=E4=BA=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ReginConstant.java | 19 +++++++++ .../java/com/epmet/constant/ReginEnum.java | 42 ------------------- .../epmet/service/impl/HomeServiceImpl.java | 10 ++--- 3 files changed, 24 insertions(+), 47 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginConstant.java delete mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginConstant.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginConstant.java new file mode 100644 index 0000000000..1a1b1fec32 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginConstant.java @@ -0,0 +1,19 @@ +package com.epmet.constant; + +/** + * @Classname ReginEnum + * @Description 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * @Date 2020/3/17 15:22 + * @Created by yangs + */ +public interface ReginConstant { + //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + //0.标题区 + String titleList="titleList"; + //1.置顶区 + String topList="topList"; + //2.功能区 + String functionList="functionList"; + //3.悬浮区 + String floatingList="floatingList"; +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java deleted file mode 100644 index 47ef5eed86..0000000000 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginEnum.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.epmet.constant; - -/** - * @Classname ReginEnum - * @Description 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 - * @Date 2020/3/17 15:22 - * @Created by yangs - */ -public enum ReginEnum { - //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 - title("0", "title"), - top("1","top"), - function("2", "function"), - floating("3", "floating"); - private String key; - - private String name; - - /** - * @param key - * @param name - */ - ReginEnum(String key, String name) { - this.key = key; - this.name = name; - } - - /** - * @return Returns the key. - */ - public String getKey() { - return key; - } - - /** - * @return Returns the name. - */ - public String getName() { - return name; - } - -} 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 53f42e0acd..b0edee660e 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,7 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.ReginEnum; +import com.epmet.constant.ReginConstant; import com.epmet.dao.CustomerHomeDao; import com.epmet.dao.CustomerHomeDetailDao; import com.epmet.dao.HomeComponentDao; @@ -53,13 +53,13 @@ public class HomeServiceImpl implements HomeService { for(CommonComponentDesignResultDTO c:list){ usedComponent.add(c.getComponentId()); //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 - if(ReginEnum.title.getKey().equals(c.getRegion())){ + if(ReginConstant.titleList.equals(c.getRegion())){ resultDTO.setTitleList(c); - }else if(ReginEnum.top.getKey().equals(c.getRegion())){ + }else if(ReginConstant.topList.equals(c.getRegion())){ resultDTO.setTopList(c); - }else if(ReginEnum.function.getKey().equals(c.getRegion())){ + }else if(ReginConstant.functionList.equals(c.getRegion())){ flist.add(c); - }else if(ReginEnum.floating.getKey().equals(c.getRegion())){ + }else if(ReginConstant.floatingList.equals(c.getRegion())){ resultDTO.setFloatingList(c); } } From 29dc99bed932b9f04f078968a9eab7515cf1e77c Mon Sep 17 00:00:00 2001 From: yinzuomei <57602893@qq.com> Date: Tue, 17 Mar 2020 17:29:31 +0800 Subject: [PATCH 21/39] =?UTF-8?q?REGION=E6=94=B9=E4=B8=BAvarchar=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=EF=BC=9A=E6=89=80=E5=B1=9E=E5=8C=BA=E5=9F=9F=EF=BC=9A?= =?UTF-8?q?titleList.=E6=A0=87=E9=A2=98=E5=8C=BA=E3=80=81topList.=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E5=8C=BA=E3=80=81functionList.=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8C=BA=E3=80=81floatingList.=E6=82=AC=E6=B5=AE=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/CustomerHomeDetailDTO.java | 8 ++++---- .../main/java/com/epmet/dto/CustomerHomeTemplateDTO.java | 8 ++++---- .../src/main/java/com/epmet/dto/HomeComponentDTO.java | 8 ++++---- .../java/com/epmet/dto/form/HomeComponentFormDTO.java | 4 ++-- .../com/epmet/dto/result/CommonComponentResultDTO.java | 5 +++++ .../java/com/epmet/entity/CustomerHomeDetailEntity.java | 6 +++--- .../java/com/epmet/entity/CustomerHomeTemplateEntity.java | 6 +++--- .../main/java/com/epmet/entity/HomeComponentEntity.java | 6 +++--- .../src/main/resources/mapper/HomeComponentDao.xml | 6 ++++-- 9 files changed, 32 insertions(+), 25 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java index 79fdf9ae05..82f5b1d9ce 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java @@ -23,7 +23,7 @@ import lombok.Data; /** - * 客户首页详情表 + * 客户首页详情表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 @@ -49,9 +49,9 @@ public class CustomerHomeDetailDTO implements Serializable { private String componentId; /** - * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置 @@ -93,4 +93,4 @@ public class CustomerHomeDetailDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeTemplateDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeTemplateDTO.java index e0e3ec6091..866adac425 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeTemplateDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeTemplateDTO.java @@ -23,7 +23,7 @@ import lombok.Data; /** - * 客户首页模板表 + * 客户首页模板表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 @@ -49,9 +49,9 @@ public class CustomerHomeTemplateDTO implements Serializable { private Integer clientType; /** - * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置 JSON串 @@ -93,4 +93,4 @@ public class CustomerHomeTemplateDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/HomeComponentDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/HomeComponentDTO.java index 13ecb98094..1d1e437f1f 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/HomeComponentDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/HomeComponentDTO.java @@ -23,7 +23,7 @@ import lombok.Data; /** - * 首页组件表 + * 首页组件表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 @@ -64,9 +64,9 @@ public class HomeComponentDTO implements Serializable { private Integer conponentType; /** - * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置 @@ -113,4 +113,4 @@ public class HomeComponentDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} 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 index a7833e17a9..e9d71ef719 100644 --- 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 @@ -20,9 +20,9 @@ public class HomeComponentFormDTO implements Serializable { private String componentId; /** - * 所属区域 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置项 diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentResultDTO.java index 8e57e9fd5c..7e2dc3c4f3 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentResultDTO.java @@ -42,4 +42,9 @@ public class CommonComponentResultDTO implements Serializable { * 配置项说明 */ private String configurationDescription; + + /** + * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + */ + private String region; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java index bcc2eedb3a..e6a753278b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户首页详情表 + * 客户首页详情表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 @@ -49,9 +49,9 @@ public class CustomerHomeDetailEntity extends BaseEpmetEntity { private String componentId; /** - * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeTemplateEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeTemplateEntity.java index 189a14d56d..36c677ef90 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeTemplateEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeTemplateEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 客户首页模板表 + * 客户首页模板表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 @@ -49,9 +49,9 @@ public class CustomerHomeTemplateEntity extends BaseEpmetEntity { private Integer clientType; /** - * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置 JSON串 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/HomeComponentEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/HomeComponentEntity.java index 6705b6e9e9..5cbb92b0c6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/HomeComponentEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/HomeComponentEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 首页组件表 + * 首页组件表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 @@ -64,9 +64,9 @@ public class HomeComponentEntity extends BaseEpmetEntity { private Integer conponentType; /** - * 所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + * 所属区域:titleList.标题区、topList.置顶区、functionList.功能区、floatingList.悬浮区 */ - private Integer region; + private String region; /** * 高级配置 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/HomeComponentDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/HomeComponentDao.xml index ff4d87350e..10bfc66952 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/HomeComponentDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/HomeComponentDao.xml @@ -32,7 +32,8 @@ hc.COMPONENT_FRONT_ID, hc.CONFIGURATION, hc.DEMO_DATA, - hc.CONFIGURATION_DESCRIPTION + hc.CONFIGURATION_DESCRIPTION, + hc.REGION FROM home_component hc WHERE @@ -85,7 +86,8 @@ hc.COMPONENT_FRONT_ID, hc.CONFIGURATION, hc.DEMO_DATA, - hc.CONFIGURATION_DESCRIPTION + hc.CONFIGURATION_DESCRIPTION, + hc.REGION FROM home_component hc WHERE From ef5c834105bf507aa7cbd37e939fdfb7af02247f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 18 Mar 2020 12:23:46 +0800 Subject: [PATCH 22/39] update resi to local repoitory --- .../java/com/epmet/GovOrgApplication.java | 4 ++ .../controller/CustomerGridController.java | 7 +++ .../java/com/epmet/dao/CustomerGridDao.java | 5 +- .../epmet/service/CustomerGridService.java | 10 ++++ .../service/impl/CustomerGridServiceImpl.java | 8 +++ .../main/resources/mapper/CustomerGridDao.xml | 22 ++++++++ .../com/epmet/controller/HomeController.java | 16 ++++++ .../com/epmet/dao/CustomerHomeDetailDao.java | 3 ++ .../java/com/epmet/service/HomeService.java | 9 ++++ .../epmet/service/impl/HomeServiceImpl.java | 29 ++++++++-- .../mapper/CustomerHomeDetailDao.xml | 25 +++++++++ .../resi-guide/resi-guide-server/pom.xml | 36 +++++++++++++ .../java/com/epmet/dto/GridVisitedDTO.java | 5 -- epmet-user/epmet-user-server/pom.xml | 12 +++++ .../main/java/com/epmet/UserApplication.java | 3 ++ .../controller/GridVisitedController.java | 18 +++++++ .../java/com/epmet/dao/GridLatestDao.java | 4 +- .../java/com/epmet/dao/GridVisitedDao.java | 6 ++- .../com/epmet/entity/GridVisitedEntity.java | 5 -- .../com/epmet/excel/GridVisitedExcel.java | 3 -- .../com/epmet/service/GridLatestService.java | 8 +++ .../com/epmet/service/GridVisitedService.java | 22 ++++++++ .../service/impl/GridLatestServiceImpl.java | 29 ++++++++++ .../service/impl/GridVisitedServiceImpl.java | 53 ++++++++++++++++++- .../main/resources/mapper/GridLatestDao.xml | 29 ++++++++++ .../main/resources/mapper/GridVisitedDao.xml | 32 ++++++++++- 26 files changed, 381 insertions(+), 22 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java index 7f1f254652..d4cafe7020 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.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; /** * @@ -18,6 +20,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @since 1.0.0 */ @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients public class GovOrgApplication { public static void main(String[] args) { 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 be74383365..3cdebe5e03 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 @@ -26,6 +26,7 @@ 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.dto.CustomerGridDTO; +import com.epmet.dto.form.GovOrgFormDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +92,10 @@ public class CustomerGridController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerGridExcel.class); } + @PostMapping("getcustomergridbygridid") + public Result getCustomerGridByGridId(@RequestBody GovOrgFormDTO formDTO) throws Exception { + System.out.println("2222222222"); + return customerGridService.getCustomerGridByGridId(formDTO); + } + } \ 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 f13389578a..46ff83c5db 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 @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.GovOrgFormDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +31,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerGridDao extends BaseDao { - + + CustomerGridDTO getCustomerGridByGridId(GovOrgFormDTO 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 cdc050da2c..1e3045b9e6 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 @@ -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.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.GovOrgFormDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -92,4 +94,12 @@ public interface CustomerGridService extends BaseService { * @date 2020-03-16 */ void delete(String[] ids); + + /** + * 根据客户Id查询用户数据 + * @param formDTO + * @return + * @date 2020-03-17 + */ + Result getCustomerGridByGridId(GovOrgFormDTO 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 2058bf4d79..d61637487d 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 @@ -23,8 +23,10 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.GovOrgFormDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; @@ -101,4 +103,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(GovOrgFormDTO 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 5765fffd44..7bdfc2df56 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,5 +22,27 @@ + + + \ No newline at end of file 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 2ee5686c71..d6cfc63586 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 @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; 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; @@ -76,4 +77,19 @@ public class HomeController { homeService.distributeHomeDesign(formDTO); return new Result(); } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 获取客户首页发布数据 + **/ + @PostMapping("gethomereleasebycustomer") + public Result getHomeReleaseByCustomer(@RequestBody CustomerHomeFormDTO formDTO) { + System.out.println("33333"); + formDTO.setStatus("0"); + formDTO.setClientType("1"); + ValidatorUtils.validateEntity(formDTO); + return homeService.getHomeReleaseByCustomer(formDTO); + } } 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 c6571bd2ef..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,6 +18,7 @@ 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; @@ -44,4 +45,6 @@ public interface CustomerHomeDetailDao extends BaseDao 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/service/HomeService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java index cb43d8c0c3..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,6 +2,7 @@ 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; @@ -48,4 +49,12 @@ public interface HomeService { * @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 2d94250b2e..093507e308 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 @@ -4,10 +4,7 @@ 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.HomeComponentFormDTO; -import com.epmet.dto.form.HomeDesignByCustomerFormDTO; -import com.epmet.dto.form.HomeDesignFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CommonComponentDesignResultDTO; import com.epmet.dto.result.ComponentListByCustomerResultDTO; import com.epmet.dto.result.HomeDesignByCustomerResultDTO; @@ -107,4 +104,28 @@ public class HomeServiceImpl implements HomeService { } } + + @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("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); + } } 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 91df873854..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 @@ -57,4 +57,29 @@ WHERE a.DEL_FLAG = 0 + + + \ 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 d51420a810..44de695c38 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -58,6 +58,42 @@ feign-httpclient 10.3.0 + + com.epmet + epmet-user-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + com.epmet + epmet-user-server + 2.0.0 + compile + + + com.epmet + gov-org-client + 2.0.0 + compile + + + com.epmet + oper-customize-client + 2.0.0 + compile + + + com.epmet + oper-customize-client + 2.0.0 + compile + 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-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..91f7b019da 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,6 +19,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ + @SpringBootApplication public class UserApplication { 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..27519f2281 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 @@ -25,7 +25,9 @@ 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.dto.GridLatestDTO; 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 +93,20 @@ public class GridVisitedController { ExcelUtils.exportExcelToTarget(response, null, list, GridVisitedExcel.class); } + /** + * 网格访问记录表、最近访问网格表新增数据 + * 网格访问记录表新增数据(一天一条) + * 最近访问表更新时间字段 + * @param formDTO + */ + @PostMapping("savelatestandvisited") + public void saveLatestAndVisited(@RequestBody VisitedFormDTO formDTO) throws Exception { + System.out.println("1111111"); + gridVisitedService.saveLatestAndVisited(formDTO); + } + @GetMapping("getgridhome") + public void getValidCustomerList(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..e00c9ebc70 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 { - + + GridVisitedEntity 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/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..be36d817db 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,30 @@ public class GridLatestServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +112,44 @@ 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); + + } + + public void saveGridVisited(VisitedFormDTO formDTO,CustomerGridDTO cu) { + Date date = new Date(); + GridVisitedDTO vi = new GridVisitedDTO(); + vi.setIsRegister(0);//token中获取是否注册 + vi.setCustomerId(cu.getCustomerId()); + vi.setGridId(cu.getId()); + vi.setCustomerUserId(formDTO.getUserId()); + vi.setVisitTime(date); + vi.setUpdatedTime(date); + //查询是否存在历史数据(一个用户一天对一个网格只存在一条访问记录) + GridVisitedEntity dto = baseDao.getGridVisitedByIds(vi); + GridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, GridVisitedEntity.class); + if(dto==null||dto.getId()==null){ + insert(entity); + }else{ + entity.setUpdatedTime(date); + updateById(entity); + } + } + } \ 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 @@ + \ 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..96d67054ad 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 @@ + \ No newline at end of file From 65c26f2eed598533295542b76eca82ef0c59ec68 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 18 Mar 2020 18:00:46 +0800 Subject: [PATCH 23/39] =?UTF-8?q?authlogin=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-demo/epmet-demo-server/pom.xml | 6 +++++ .../com/epmet/controller/DemoController.java | 7 +++++- .../com/epmet/feign/GovOrgFeignClient.java | 25 +++++++++++++++++++ .../feign/impl/GovOrgFeignClientFallBack.java | 25 +++++++++++++++++++ .../java/com/epmet/service/DemoService.java | 2 ++ .../epmet/service/impl/DemoServiceImpl.java | 16 ++++++++++++ epmet-module/gov-org/gov-org-client/pom.xml | 2 +- .../java/com/epmet/GovOrgApplication.java | 4 +++ 8 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java create mode 100644 epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java diff --git a/epmet-module/epmet-demo/epmet-demo-server/pom.xml b/epmet-module/epmet-demo/epmet-demo-server/pom.xml index d331612129..8e5d67e67c 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/pom.xml +++ b/epmet-module/epmet-demo/epmet-demo-server/pom.xml @@ -55,6 +55,12 @@ 2.0.0 compile + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java index e3d1f43721..8ea90173df 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java @@ -32,7 +32,6 @@ import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.DemoExcel; import com.epmet.service.DemoService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -115,4 +114,10 @@ public class DemoController { ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); return demoService.saveCustomerInfo(dto); } + + @PostMapping("/testDemoToGov") + public String testDemoToGov(){ + + return demoService.testDemo2Gov(); + } } diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..c955830654 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,25 @@ +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.CustomerGridDTO; +import com.epmet.feign.impl.GovOrgFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * Created by 11 on 2020/3/18. + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class, url="http://localhost:8092") +public interface GovOrgFeignClient { + + + @GetMapping("gov/org/customergrid/page") + Result> page(); + + + +} diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java new file mode 100644 index 0000000000..eab629cec6 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java @@ -0,0 +1,25 @@ +package com.epmet.feign.impl;/** + * Created by 11 on 2020/3/18. + */ + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description + * @ClassName GovOrgFeignClientFallBack + * @Author wangc + * @date 2020.03.18 14:52 + */ +@Component +public class GovOrgFeignClientFallBack implements GovOrgFeignClient{ + @Override + public Result> page() { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "page"); + } +} diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/DemoService.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/DemoService.java index ab5a997da0..a9331a78e7 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/DemoService.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/DemoService.java @@ -104,4 +104,6 @@ public interface DemoService extends BaseService { Result queryCustomerInfo(String customerId); Result saveCustomerInfo(SaveCustomerFormDTO dto); + + String testDemo2Gov(); } diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java index 9299b20ddd..a75132488b 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java @@ -26,10 +26,12 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.DemoDao; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.DemoDTO; import com.epmet.dto.form.SaveCustomerFormDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.DemoEntity; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.DemoRedis; import com.epmet.service.DemoService; @@ -58,6 +60,8 @@ public class DemoServiceImpl extends BaseServiceImpl implem private DemoRedis demoRedis; @Autowired private OperCrmFeignClient operCrmFeignClient; + @Autowired + private GovOrgFeignClient govOrgFeignClient; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -147,4 +151,16 @@ public class DemoServiceImpl extends BaseServiceImpl implem return operCrmFeignClient.saveCustomerInfo(dto); } + @Override + public String testDemo2Gov() { + Result> testResult = + govOrgFeignClient.page(); + if(testResult.success()){ + return "成功了"; + }else{ + return "失败了"; + } + + } + } 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-server/src/main/java/com/epmet/GovOrgApplication.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java index 7f1f254652..d4cafe7020 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/GovOrgApplication.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; /** * @@ -18,6 +20,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @since 1.0.0 */ @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients public class GovOrgApplication { public static void main(String[] args) { From 622a4de1ff08e679ffe6b0ed06f54d42cb991eb7 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 19 Mar 2020 12:24:04 +0800 Subject: [PATCH 24/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=9A=E6=A0=B9=E6=8D=AE=E4=BD=8D=E7=BD=AE=E6=8E=88=E6=9D=83?= =?UTF-8?q?/=E4=B8=8D=E6=8E=88=E6=9D=83=E9=80=89=E5=AE=9A=E9=99=84?= =?UTF-8?q?=E8=BF=91=E7=BD=91=E6=A0=BC=E4=BF=A1=E6=81=AF,=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A,=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 4 +- .../com/epmet/controller/DemoController.java | 5 -- .../CustomerGridForStangerResultDTO.java | 25 +++++- epmet-module/gov-org/gov-org-server/pom.xml | 5 ++ .../controller/CustomerGridController.java | 11 ++- .../java/com/epmet/dao/CustomerGridDao.java | 15 +++- .../com/epmet/exception/ModuleErrorCode.java | 17 +++- .../epmet/service/CustomerGridService.java | 9 +++ .../service/impl/CustomerGridServiceImpl.java | 53 ++++++++++++ .../main/resources/mapper/CustomerGridDao.xml | 32 ++++++++ .../epmet/dto/CustomerGridListQueryDTO.java | 47 ++++++++--- .../resi-guide/resi-guide-server/pom.xml | 5 ++ .../epmet/controller/ResiGuideController.java | 48 ----------- .../StrangerAccessRecordController.java | 53 ++++++++++++ .../entity/StrangerAccessRecordEntity.java | 8 +- .../com/epmet/feign/GovOrgFeignClient.java | 25 +++++- .../epmet/feign/impl/GovOrgFeginFallBack.java | 19 +++-- .../com/epmet/service/ResiGuideService.java | 18 ----- .../service/StrangerAccessRecordService.java | 21 +++++ .../service/impl/ResiGuideServiceImpl.java | 70 ---------------- .../impl/StrangerAccessRecordServiceImpl.java | 80 +++++++++++++++++++ .../mapper/StrangerAccessRecordDao.xml | 5 +- 22 files changed, 401 insertions(+), 174 deletions(-) delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerAccessRecordController.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java create mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index c255242999..3827af2249 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -130,7 +130,7 @@ http://localhost:8090 - + http://localhost:8091 @@ -183,7 +183,7 @@ lb://oper-crm-server - lb://resi-guid-server + lb://resi-guide-server lb://gov-org-server diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java index a3d6bc7643..17810c525b 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/DemoController.java @@ -155,9 +155,4 @@ public class DemoController { return demoService.saveCustomerInfo(dto); } - @PostMapping("/testDemoToGov") - public String testDemoToGov(){ - - return demoService.testDemo2Gov(); - } } 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 index 79816d1714..2a8c4108d0 100644 --- 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 @@ -2,11 +2,32 @@ package com.epmet.dto.result;/** * Created by 11 on 2020/3/19. */ +import lombok.Data; + +import java.io.Serializable; + /** - * @Description + * @Description 陌生人搜索网格返回结果 * @ClassName CustomerGridForStangerResultDTO * @Author wangc * @date 2020.03.19 00:38 */ -public class CustomerGridForStangerResultDTO { +@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/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 46eba71b6f..8e0a07fbfd 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 @@ -26,6 +26,7 @@ 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.dto.CustomerGridDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +62,7 @@ public class CustomerGridController { return new Result().ok(data); } - @PostMapping + @PostMapping("save") public Result save(@RequestBody CustomerGridDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -91,9 +92,11 @@ public class CustomerGridController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerGridExcel.class); } - @GetMapping("{areaCode}") - public Result queryListByOrder(@PathVariable("areaCode")String areaCode){ - return new Result(); + + @GetMapping("queryListForStrangerByOrder") + public Result> queryListForStrangerByOrder(@RequestParam("areaCode")String areaCode, @RequestParam("pageNo") Integer pageNo, Integer pageSize){ + + return customerGridService.ListGridForStrangerByOrder(areaCode, pageNo, pageSize); } } \ 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 f13389578a..90aaa87faa 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 @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户网格表 @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerGridDao extends BaseDao { - + + //查特定区的网格 + List selectGridByAreaCode(@Param("areaCode")String areaCode); + + //查整个城市的网格 + List selectGridByCityLike(@Param("areaCode")String areaCode); + + //指定区时查询当前城市下除该区之外其余的网格 + List selectRestGridWithoutGivenAreaCode(@Param("areaCode")String areaCode , @Param("cityCode")String cityCode); + } \ No newline at end of file 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 index 51f1d2cd38..dc2e3e93cc 100644 --- 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 @@ -1,7 +1,20 @@ package com.epmet.exception; +import com.epmet.commons.tools.exception.ErrorCode; + /** - * Created by 11 on 2020/3/19. + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

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

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 */ -public interface ModuleErrorCode { +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/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index cdc050da2c..fb07d7d585 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 @@ -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.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -92,4 +94,11 @@ public interface CustomerGridService extends BaseService { * @date 2020-03-16 */ void delete(String[] ids); + + /** + * 陌生人查询附近网格数据 + * 不管传递的areaCode是市级还是县级,都查询整个城市的网格信息,需要特定的排序 + * + * */ + Result> ListGridForStrangerByOrder(String areaCode, Integer PageNo, Integer pageSize); } \ 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 2058bf4d79..9dc2a5f126 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,14 +20,19 @@ 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.result.CustomerGridForStangerResultDTO; import com.epmet.entity.CustomerGridEntity; +import com.epmet.exception.ModuleErrorCode; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; +import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -101,4 +106,52 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> ListGridForStrangerByOrder(String areaCode, Integer pageNo, Integer pageSize) { + + //判断areaCode是市级还是县级 + if(StringUtils.isBlank(areaCode)){ + throw new RenException(ModuleErrorCode.ARGS_NOT_ALLOW_NULL_ERROR,"地区码不能为空!"); + } + if(areaCode.length() != 6){ + throw new RenException(ModuleErrorCode.NOT_STANDARD_AREA_CODE_ERROR,"无法识别的地区码!"); + } + if(null == pageNo){ + throw new RenException(ModuleErrorCode.ARGS_NOT_ALLOW_NULL_ERROR,"页码不能为空!"); + } + if(null == pageSize || pageSize <= 0 || pageSize >=100){ + pageSize = 20; + } + + Result> result = new Result<>(); + + if(areaCode.endsWith("00")){ + //城市 - 查全部 + PageHelper.startPage(pageNo,pageSize); + List gridList + = baseDao.selectGridByCityLike(areaCode.substring(0,areaCode.length()-2)); + + result.setData(gridList); + result.setCode(0); + return result; + }else{ + //行政区 + List gridListArea + = baseDao.selectGridByAreaCode(areaCode); + List restGridListArea + = baseDao.selectRestGridWithoutGivenAreaCode(areaCode,areaCode.substring(0,areaCode.length()-2)); + for(CustomerGridForStangerResultDTO obj : restGridListArea){ + gridListArea.add(obj); + } + + //分页操作 + + result.setData(gridListArea); + result.setCode(0); + return result; + + } + + } + } \ 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 5765fffd44..cd1a2338f0 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,5 +22,37 @@ + + + + + + + \ No newline at end of file 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 index 9edd12b94f..b51dd9e7bc 100644 --- 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 @@ -4,6 +4,8 @@ package com.epmet.dto;/** import lombok.Data; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -17,21 +19,46 @@ public class CustomerGridListQueryDTO implements Serializable { private static final long serialVersionUID = 1L; - //token信息 - private String token; - - //期望分页页码 + /** + * 当前页 + * */ + @Min(value = 1) private Integer pageNo; - //每页数据量(默认20) - private Integer pageSize; - + /** + * 每页数量 + * */ + private Integer pageSize = 20; + /** + * 地区码 + * */ private String areaCode; + /** + * 选定地区编码 + * */ + private String selectedAreaCode; - private String lelectedAreaCode; - - //是否首次位置授权(0:是 1:否) + /** + * 是否首次位置授权(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-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index d51420a810..721594d7d6 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -58,6 +58,11 @@ feign-httpclient 10.3.0 + + com.epmet + gov-org-client + 2.0.0 + diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java deleted file mode 100644 index a7ef911c89..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/ResiGuideController.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.epmet.controller;/** - * Created by 11 on 2020/3/17. - */ - -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerGridListQueryDTO; -import com.epmet.dto.result.CustomerGridListResultDTO; -import com.epmet.service.ResiGuideService; -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; - -/** - * @Description - * @ClassName ResiGuideController - * @Author wangc - * @date 2020.03.17 11:33 - */ -@RestController -@RequestMapping("stranger") -public class ResiGuideController { - - @Autowired - private ResiGuideService resiGuideService; - - - @PostMapping("getlocationcustomergridlist") - Result> getlocationcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ - Result> result = new Result<>(); - - //TODO..捕获异常 - - return result.ok(resiGuideService.ListCustomerGrid(queryParam)); - - } - - @PostMapping("getlelectcdcustomergridlist") - Result> getlelectcdcustomergridlist(@RequestBody CustomerGridListQueryDTO queryParam){ - Result> result = new Result<>(); - - //TODO..捕获异常 - - return result.ok(resiGuideService.ListCustomerGrid(queryParam)); - } -} 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/entity/StrangerAccessRecordEntity.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerAccessRecordEntity.java index 76965ff098..f707fd0b25 100644 --- 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 @@ -46,7 +46,7 @@ public class StrangerAccessRecordEntity extends BaseEpmetEntity { /** * 选择地区编码 (用户选择地区位置 */ - private String lelectedAreaCode; + private String selectedAreaCode; /** * 是否首次位置授权(0:是 1:否) @@ -63,4 +63,10 @@ public class StrangerAccessRecordEntity extends BaseEpmetEntity { */ 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/feign/GovOrgFeignClient.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 990e8fb5db..fe9f1d879b 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 @@ -4,19 +4,38 @@ 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) +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeginFallBack.class, url="http://localhost:8092") public interface GovOrgFeignClient { - @PostMapping(value = "/gov/org/customergrid/{areaCode}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result> getPageForStrangerGuideInterface(@PathVariable("areaCode")String areaCode); + + /** + * 根据地区编码获取附近网格数据 + * @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/impl/GovOrgFeginFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java index 286ce4e36c..2018edd626 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java @@ -3,14 +3,14 @@ package com.epmet.feign.impl;/** */ import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerGridListQueryDTO; -import com.epmet.dto.result.CustomerGridListResultDTO; +import com.epmet.dto.result.CustomerGridForStangerResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; -import org.springframework.stereotype.Controller; + + +import java.util.List; /** * @Description @@ -21,9 +21,14 @@ import org.springframework.stereotype.Controller; @Component public class GovOrgFeginFallBack implements GovOrgFeignClient { + /** + * 根据地区编码获取附近网格数据 + * @Param areaCode 地区编码 + * @Param pageNo 当前页 + * @Param pageSize 每页数据量 + * */ @Override - public Result> getPageForStrangerGuideInterface(String areaCode) { - - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListByAreaCodeOrderBy",areaCode); + 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/service/ResiGuideService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java deleted file mode 100644 index 84e11a07da..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/ResiGuideService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.epmet.service; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.CustomerGridListQueryDTO; -import com.epmet.dto.result.CustomerGridListResultDTO; -import com.epmet.entity.StrangerAccessRecordEntity; - -/** - * Created by 11 on 2020/3/17. - */ - -public interface ResiGuideService extends BaseService { - - PageData ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO); - - void save(StrangerAccessRecordEntity strangerAccessRecordEntity); -} 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/impl/ResiGuideServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java deleted file mode 100644 index f7b1b32f59..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/ResiGuideServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -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.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.dao.StrangerAccessRecordDao; -import com.epmet.dto.CustomerGridListQueryDTO; -import com.epmet.dto.result.CustomerGridListResultDTO; -import com.epmet.entity.StrangerAccessRecordEntity; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.service.ResiGuideService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; - -/** - * @Description - * @ClassName ResiGuideServiceImpl - * @Author wangc - * @date 2020.03.17 13:01 - */ -@Service -public class ResiGuideServiceImpl extends BaseServiceImpl implements ResiGuideService { - - @Autowired - private GovOrgFeignClient govOrgFeignClient; - - @Override - public PageData ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO) { - - PageData queryResult = - govOrgFeignClient.getPageForStrangerGuideInterface(customerGridListQueryDTO); - if(null != queryResult.getList() && queryResult.getList().size() > 0){ - for(CustomerGridListResultDTO obj : queryResult.getList()){ - StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity(); - //未授权,手动选择 locationAreaCode - if(0 == customerGridListQueryDTO.getIsAuthorized()){ - strangerTrance.setLocationAreaCode(customerGridListQueryDTO.getLelectedAreaCode()); - }else if( 1 == customerGridListQueryDTO.getIsAuthorized()){ - //已授权,自动选择 lelectedAreaCode - strangerTrance.setLocationAreaCode(customerGridListQueryDTO.getAreaCode()); - } - strangerTrance.setIsAuthorized(customerGridListQueryDTO.getIsAuthorized()); - strangerTrance.setGridNumber(queryResult.getTotal()); - strangerTrance.setVisitTime(new Date()); - strangerTrance.setDelFlag("1"); - strangerTrance.setRevision(0); - strangerTrance.setCreatedBy("陌生人访客"); - strangerTrance.setCreatedTime(new Date()); - - insert(strangerTrance); - } - - } - - return queryResult; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(StrangerAccessRecordEntity strangerAccessRecordEntity) { - StrangerAccessRecordEntity entity = ConvertUtils.sourceToTarget(strangerAccessRecordEntity, StrangerAccessRecordEntity.class); - insert(entity); - } -} 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/resources/mapper/StrangerAccessRecordDao.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml index ca90b06034..84434a743a 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 @@ -6,7 +6,7 @@ - + @@ -16,6 +16,9 @@ + + + From 0370b476be60b9b50529da2fe7c2e338bf2f5de3 Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Thu, 19 Mar 2020 13:50:09 +0800 Subject: [PATCH 25/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E8=AE=B0=E5=BD=95=E8=A1=A8=20--=E5=92=8C=E7=8E=8B?= =?UTF-8?q?=E6=9C=9D=E5=90=88=E5=B9=B6=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/StrangerAccessRecordDTO.java | 111 ++++++++++++++++++ .../StrangerAccessRecordController.java | 64 +++++++++- .../epmet/dao/StrangerAccessRecordDao.java | 7 +- .../service/StrangerAccessRecordService.java | 72 ++++++++++++ .../impl/StrangerAccessRecordServiceImpl.java | 69 ++++++++++- .../mapper/StrangerAccessRecordDao.xml | 17 +++ 6 files changed, 333 insertions(+), 7 deletions(-) create mode 100644 epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/StrangerAccessRecordDTO.java 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-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 aef1f145ba..8334da4851 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.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.StrangerAccessRecordDTO; import com.epmet.dto.result.CustomerGridForStangerResultDTO; +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 @@ -50,4 +57,53 @@ public class StrangerAccessRecordController { return new Result>().ok(strangerAccessRecordService.ListCustomerGrid(customerGridListQueryDTO)); } + /** + * 陌生人列表查询 + * */ + @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/dao/StrangerAccessRecordDao.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerAccessRecordDao.java index 2a66e64424..6870fa0b7f 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,10 +17,14 @@ 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; + /** * 陌生人访问记录表 * @@ -29,5 +33,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StrangerAccessRecordDao extends BaseDao { - + //陌生人访问记录表 + 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/service/StrangerAccessRecordService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java index 956682fc98..1a6a9b2ed7 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,11 +1,14 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; import com.epmet.dto.CustomerGridListQueryDTO; +import com.epmet.dto.StrangerAccessRecordDTO; import com.epmet.dto.result.CustomerGridForStangerResultDTO; import com.epmet.entity.StrangerAccessRecordEntity; import java.util.List; +import java.util.Map; /** * Created by 11 on 2020/3/17. @@ -13,6 +16,75 @@ import java.util.List; public interface StrangerAccessRecordService extends BaseService { + /** + * 陌生人列表查询 + * + * @param params + * @return PageData + * @author generator + * @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); + /** * * 陌生人根据位置码获取附近网格数据,并且插入陌生人访客记录 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 00d779cfad..f976b96a6a 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 @@ -3,9 +3,12 @@ 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.CustomerGridListQueryDTO; +import com.epmet.dto.StrangerAccessRecordDTO; import com.epmet.dto.result.CustomerGridForStangerResultDTO; import com.epmet.entity.StrangerAccessRecordEntity; import com.epmet.feign.GovOrgFeignClient; @@ -14,9 +17,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +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 java.util.Map; /** * @Description * @ClassName ResiGuideServiceImpl @@ -25,9 +33,66 @@ import java.util.List; */ @Service public class StrangerAccessRecordServiceImpl extends BaseServiceImpl implements StrangerAccessRecordService { - + @Autowired + private StrangerAccessRecordDao strangerAccessRecordDao; @Autowired private GovOrgFeignClient govOrgFeignClient; + @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/resources/mapper/StrangerAccessRecordDao.xml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/mapper/StrangerAccessRecordDao.xml index 84434a743a..58cdb8d3c4 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,21 @@ + + + + \ No newline at end of file From 8efa3ffe6b3fc75ecf5aa1fc89a631489d3a18fa Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 19 Mar 2020 14:18:01 +0800 Subject: [PATCH 26/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E5=AF=BC?= =?UTF-8?q?=E8=A7=88=E6=8E=A5=E5=8F=A3=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4?= =?UTF-8?q?v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/OperCrmFeignClient.java | 2 +- .../java/com/epmet/feign/DemoFeignClient.java | 2 +- .../controller/CustomerGridController.java | 10 ++++-- .../epmet/service/CustomerGridService.java | 2 +- .../com/epmet/controller/HomeController.java | 12 ++++--- .../epmet/service/impl/HomeServiceImpl.java | 8 ++--- .../com/epmet/feign/GovOrgFeignClient.java | 8 +---- .../src/main/resources/bootstrap.yml | 2 ++ .../main/java/com/epmet/UserApplication.java | 2 ++ .../controller/GridVisitedController.java | 10 ++---- .../java/com/epmet/dao/GridVisitedDao.java | 2 +- .../service/impl/GridLatestServiceImpl.java | 9 +++-- .../service/impl/GridVisitedServiceImpl.java | 36 ++++++++++++++----- .../main/resources/mapper/GridVisitedDao.xml | 6 ++-- 14 files changed, 68 insertions(+), 43 deletions(-) diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java index a66d034f8e..77bcac25aa 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.result.ValidCustomerResultDTO; -import com.epmet.feign.impl.OperCrmFeignClientFallBack; +import com.epmet.feign.fallback.OperCrmFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/DemoFeignClient.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/DemoFeignClient.java index 1b0e38c53e..aaa5112b4d 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/DemoFeignClient.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/DemoFeignClient.java @@ -2,7 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.impl.DemoFeignClientFallBack; +import com.epmet.feign.fallback.DemoFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; 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 3cdebe5e03..0be5ce4745 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 @@ -92,9 +92,15 @@ 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 GovOrgFormDTO formDTO) throws Exception { - System.out.println("2222222222"); + public Result getCustomerGridByGridId(@RequestBody GovOrgFormDTO formDTO){ return customerGridService.getCustomerGridByGridId(formDTO); } 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 1e3045b9e6..e468ac4d23 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 @@ -96,7 +96,7 @@ public interface CustomerGridService extends BaseService { void delete(String[] ids); /** - * 根据客户Id查询用户数据 + * 根据网格Id查询用户数据 * @param formDTO * @return * @date 2020-03-17 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 d6cfc63586..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,6 +2,7 @@ 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; @@ -10,7 +11,10 @@ import com.epmet.dto.result.ComponentListByCustomerResultDTO; import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.service.HomeService; 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 客户定制化服务-首页相关接口 @@ -79,6 +83,7 @@ public class HomeController { } /** + * 供resi-guide服务调用 获取客户首页配置 * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author sun @@ -86,9 +91,8 @@ public class HomeController { **/ @PostMapping("gethomereleasebycustomer") public Result getHomeReleaseByCustomer(@RequestBody CustomerHomeFormDTO formDTO) { - System.out.println("33333"); - formDTO.setStatus("0"); - formDTO.setClientType("1"); + 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/service/impl/HomeServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java index 093507e308..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 @@ -114,13 +114,13 @@ public class HomeServiceImpl implements HomeService { for(CommonComponentDesignResultDTO c:list){ usedComponent.add(c.getComponentId()); //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 - if("0".equals(c.getRegion())){ + if("titleList".equals(c.getRegion())){ resultDTO.setTitleList(c); - }else if("1".equals(c.getRegion())){ + }else if("topList".equals(c.getRegion())){ resultDTO.setTopList(c); - }else if("2".equals(c.getRegion())){ + }else if("functionList".equals(c.getRegion())){ flist.add(c); - }else if("3".equals(c.getRegion())){ + }else if("floatingList".equals(c.getRegion())){ resultDTO.setFloatingList(c); } } 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 fe9f1d879b..b9d2f5b94b 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 @@ -2,17 +2,11 @@ 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 com.epmet.feign.fallback.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; 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-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 91f7b019da..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 @@ -21,6 +21,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients; */ @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 27519f2281..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,8 @@ 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.dto.GridLatestDTO; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.GridVisitedDTO; import com.epmet.dto.form.VisitedFormDTO; import com.epmet.excel.GridVisitedExcel; @@ -96,16 +95,11 @@ public class GridVisitedController { /** * 网格访问记录表、最近访问网格表新增数据 * 网格访问记录表新增数据(一天一条) - * 最近访问表更新时间字段 + * 最近访问表更新访问时间字段 * @param formDTO */ @PostMapping("savelatestandvisited") public void saveLatestAndVisited(@RequestBody VisitedFormDTO formDTO) throws Exception { - System.out.println("1111111"); - gridVisitedService.saveLatestAndVisited(formDTO); - } - @GetMapping("getgridhome") - public void getValidCustomerList(VisitedFormDTO formDTO) throws Exception { gridVisitedService.saveLatestAndVisited(formDTO); } 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 e00c9ebc70..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 @@ -33,5 +33,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface GridVisitedDao extends BaseDao { - GridVisitedEntity getGridVisitedByIds(GridVisitedDTO formDTO); + GridVisitedDTO getGridVisitedByIds(GridVisitedDTO formDTO); } \ 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 be36d817db..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 @@ -111,18 +111,21 @@ public class GridLatestServiceImpl extends BaseServiceImpl implements GridVisitedService { - @Autowired - private GridVisitedRedis gridVisitedRedis; @Autowired private GovOrgFeignClient govOrgFeignClient; @Autowired @@ -112,6 +109,12 @@ public class GridVisitedServiceImpl extends BaseServiceImpl From e8743045fe6b9637ff1f024cfe2a2fbb5d916255 Mon Sep 17 00:00:00 2001 From: yinzuomei <57602893@qq.com> Date: Thu, 19 Mar 2020 14:55:48 +0800 Subject: [PATCH 27/39] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi-guide/resi-guide-server/pom.xml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 44de695c38..f5959bc1c1 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -64,18 +64,6 @@ 2.0.0 compile - - com.epmet - epmet-user-client - 2.0.0 - compile - - - com.epmet - epmet-user-server - 2.0.0 - compile - com.epmet gov-org-client @@ -88,12 +76,6 @@ 2.0.0 compile - - com.epmet - oper-customize-client - 2.0.0 - compile - From 9edb5ab23804864ddfa5ac99ee6f8ab27f64ffd5 Mon Sep 17 00:00:00 2001 From: yangshaoping <123456> Date: Thu, 19 Mar 2020 15:00:34 +0800 Subject: [PATCH 28/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E8=AE=B0=E5=BD=95=E8=A1=A8=20-=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/StrangerAccessRecordController.java | 4 +++- .../main/java/com/epmet/dao/StrangerAccessRecordDao.java | 9 +++++++-- .../com/epmet/service/StrangerAccessRecordService.java | 5 ++--- .../service/impl/StrangerAccessRecordServiceImpl.java | 7 +++++++ .../main/resources/mapper/StrangerAccessRecordDao.xml | 5 ++--- 5 files changed, 21 insertions(+), 9 deletions(-) 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 8334da4851..23de95f078 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 @@ -58,7 +58,9 @@ public class StrangerAccessRecordController { return new Result>().ok(strangerAccessRecordService.ListCustomerGrid(customerGridListQueryDTO)); } /** - * 陌生人列表查询 + * 查询陌生人访问记录 + * @Author yangshaoping + * @date 2020.03.1811:33 * */ @GetMapping("getStrangerAccessRecordPage") public Result> getStrangerAccessRecordPage(@RequestParam Map params){ 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 6870fa0b7f..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 @@ -26,13 +26,18 @@ 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/service/StrangerAccessRecordService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java index 1a6a9b2ed7..178521e40c 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 @@ -17,11 +17,10 @@ import java.util.Map; public interface StrangerAccessRecordService extends BaseService { /** - * 陌生人列表查询 - * + * 查询陌生人访问记录 * @param params * @return PageData - * @author generator + * @author yangshaoping * @date 2020-03-19 */ PageData getStrangerAccessRecordPage(Map params); 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 f976b96a6a..a06fe53573 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 @@ -37,6 +37,13 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl + * @author yangshaoping + * @date 2020-03-19 + */ @Override public PageData getStrangerAccessRecordPage(Map params) { List list = strangerAccessRecordDao.getStrangerAccessRecordPage(params); 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 58cdb8d3c4..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 @@ -25,9 +25,8 @@ - - SELECT a.LOCATION_AREA_CODE, a.PROVINCE, From 90cddd7bcbb51fa7c5b4301a6772f37e56b73118 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 19 Mar 2020 15:00:47 +0800 Subject: [PATCH 29/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E5=AF=BC?= =?UTF-8?q?=E8=A7=88=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=E7=B1=BB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/{GovOrgFormDTO.java => CustomerGridFormDTO.java} | 4 ++-- .../java/com/epmet/controller/CustomerGridController.java | 4 ++-- .../src/main/java/com/epmet/dao/CustomerGridDao.java | 4 ++-- .../src/main/java/com/epmet/service/CustomerGridService.java | 4 ++-- .../java/com/epmet/service/impl/CustomerGridServiceImpl.java | 4 ++-- .../src/main/resources/mapper/CustomerGridDao.xml | 2 +- ...rangerController.java => StrangerResiGuideController.java} | 2 +- .../src/main/java/com/epmet/feign/GovOrgFeignClient.java | 4 ++-- .../com/epmet/feign/fallback/GovOrgFeignClientFallBack.java | 4 ++-- .../java/com/epmet/service/impl/GridVisitedServiceImpl.java | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/{GovOrgFormDTO.java => CustomerGridFormDTO.java} (90%) rename epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/{StrangerController.java => StrangerResiGuideController.java} (97%) 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/CustomerGridFormDTO.java similarity index 90% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GovOrgFormDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridFormDTO.java index 753ff28808..c3c237e83a 100644 --- 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/CustomerGridFormDTO.java @@ -24,11 +24,11 @@ import java.io.Serializable; /** - * 居民端-网格链接获取客户首页配置 + * epmet-user端调用gov-org端的入参 * @author sun */ @Data -public class GovOrgFormDTO implements Serializable { +public class CustomerGridFormDTO implements Serializable { private static final long serialVersionUID = 1L; 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 0be5ce4745..6f1512042d 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 @@ -26,7 +26,7 @@ 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.dto.CustomerGridDTO; -import com.epmet.dto.form.GovOrgFormDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.excel.CustomerGridExcel; import com.epmet.service.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -100,7 +100,7 @@ public class CustomerGridController { * @throws Exception */ @PostMapping("getcustomergridbygridid") - public Result getCustomerGridByGridId(@RequestBody GovOrgFormDTO formDTO){ + public Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO formDTO){ return customerGridService.getCustomerGridByGridId(formDTO); } 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 46ff83c5db..ab9ea706c9 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,7 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.form.GovOrgFormDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.entity.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -32,5 +32,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface CustomerGridDao extends BaseDao { - CustomerGridDTO getCustomerGridByGridId(GovOrgFormDTO formDTO); + 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 e468ac4d23..8a779d24ca 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,7 +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.GovOrgFormDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.entity.CustomerGridEntity; import java.util.List; @@ -101,5 +101,5 @@ public interface CustomerGridService extends BaseService { * @return * @date 2020-03-17 */ - Result getCustomerGridByGridId(GovOrgFormDTO formDTO); + 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 d61637487d..15f785eb31 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 @@ -26,7 +26,7 @@ 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.GovOrgFormDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; @@ -104,7 +104,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(GovOrgFormDTO formDTO) { + public Result getCustomerGridByGridId(CustomerGridFormDTO formDTO) { return new Result().ok(baseDao.getCustomerGridByGridId(formDTO)); } 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 5c585fb4b3..4bce97d08f 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 @@ -31,7 +31,7 @@ customer_id, CONVERT ( grid_name USING gbk ) ASC - - SELECT id AS grid_id , customer_id , grid_name - FROM CUSTOMER_GRID - WHERE AREA_CODE = #{areaCode} + - + 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 + customer_id, + CONVERT ( grid_name USING gbk ) ASC - + SELECT + id AS grid_id, + customer_id, + grid_name + FROM + CUSTOMER_GRID + WHERE + AREA_CODE LIKE CONCAT(#{cityCode},'%') + + AND #{areaCode} + ]]> ORDER BY - customer_id, - CONVERT ( grid_name USING gbk ) ASC + customer_id, + CONVERT ( grid_name USING gbk ) ASC \ No newline at end of file diff --git a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/CustomerGridListFormDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/CustomerGridListFormDTO.java new file mode 100644 index 0000000000..93776cfa94 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/CustomerGridListFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName CustomerGridListFormDTO + * @Author wangc + * @date 2020.03.19 14:19 + */ +@Data +public class CustomerGridListFormDTO 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/result/CustomerGridListResultDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/CustomerGridListResultDTO.java deleted file mode 100644 index 0ee73173ca..0000000000 --- a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/result/CustomerGridListResultDTO.java +++ /dev/null @@ -1,26 +0,0 @@ -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 index aef1f145ba..f4ed63960b 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 @@ -2,8 +2,8 @@ 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.dto.form.CustomerGridListFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.service.StrangerAccessRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; /** - * @Description + * @Description 陌生人导览模块 * @ClassName StrangerAccessRecordController * @Author wangc * @date 2020.03.17 11:33 @@ -28,26 +28,33 @@ public class StrangerAccessRecordController { /** - * 陌生访客授权位置获取附近网格数据 - * - * */ + * @Description 陌生访客根据自动定位获取附近网格数据 + * @Param CustomerGridListFormDTO + * @return Result> + * @Author wangc + * @Date 2020.03.19 14:13 + **/ @PostMapping("getlocationcustomergridlist") - Result> getLocationCustomerGridList(@RequestBody CustomerGridListQueryDTO customerGridListQueryDTO){ + Result> getLocationCustomerGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ - ValidatorUtils.validateEntity(customerGridListQueryDTO); + ValidatorUtils.validateEntity(customerGridListFormDTO); - return new Result>().ok(strangerAccessRecordService.ListCustomerGrid(customerGridListQueryDTO)); + return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO); } + /** - * 陌生访客自动选定位置获取附近网格数据 - * - * */ + * @Description 陌生访客手动选定位置获取附近网格数据 + * @Param CustomerGridListFormDTO + * @return Result> + * @Author wangc + * @Date 2020.03.19 14:13 + **/ @PostMapping("getselectcdcustomergridlist") - Result> getSelectcdCustomerGridList(@RequestBody CustomerGridListQueryDTO customerGridListQueryDTO){ + Result> getSelectcdCustomerGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ - ValidatorUtils.validateEntity(customerGridListQueryDTO); + ValidatorUtils.validateEntity(customerGridListFormDTO); - return new Result>().ok(strangerAccessRecordService.ListCustomerGrid(customerGridListQueryDTO)); + return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO); } } 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 index f707fd0b25..f9788d9b36 100644 --- 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 @@ -63,10 +63,19 @@ public class StrangerAccessRecordEntity extends BaseEpmetEntity { */ 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/feign/GovOrgFeignClient.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index fe9f1d879b..3442187ca8 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 @@ -2,27 +2,25 @@ 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 com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.feign.fallback.GovOrgFeignFallBack; 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.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; /** - * Feign调用gov-org-server模块 - * Created by 11 on 2020/3/17. + * @Description Feign调用gov-org-server模块下的CustomerGirdController + * @ClassName GovOrgFeginFallBack + * @Author wangc + * @date 2020.03.17 14:29 */ -@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeginFallBack.class, url="http://localhost:8092") +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignFallBack.class, url = "http://localhost:8092") public interface GovOrgFeignClient { /** @@ -31,8 +29,8 @@ public interface GovOrgFeignClient { * @Param pageNo 当前页 * @Param pageSize 每页数据量 * */ - @GetMapping("/gov/org/customergrid/queryListForStrangerByOrder") - Result> getPageForStrangerGuideInterface(@RequestParam("areaCode")String areaCode, @RequestParam("pageNo")Integer pageNo, @RequestParam("pageSize")Integer pageSize); + @PostMapping("/gov/org/customergrid/queryListForStrangerByOrder") + Result> getPageForStrangerGuideInterface(@RequestBody ListCustomerGridFormDTO listCustomerGridFormDTO); diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignFallBack.java new file mode 100644 index 0000000000..0554f8be50 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignFallBack.java @@ -0,0 +1,32 @@ +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.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + + +import java.util.List; + +/** + * @Description Feign + * @ClassName GovOrgFeginFallBack + * @Author wangc + * @date 2020.03.17 14:29 + */ +@Component +public class GovOrgFeignFallBack implements GovOrgFeignClient { + + /** + * 根据地区编码获取附近网格数据 + * @Param ListCustomerGridFormDTO 包含:地区编码、页码、每页数据量 + * @return Result> + * */ + @Override + public Result> getPageForStrangerGuideInterface(ListCustomerGridFormDTO listCustomerGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListForStrangerByOrder",listCustomerGridFormDTO); + } +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java deleted file mode 100644 index 2018edd626..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/feign/impl/GovOrgFeginFallBack.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.epmet.feign.impl;/** - * 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/service/StrangerAccessRecordService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java index 956682fc98..553610ed4e 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,21 +1,28 @@ 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.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerGridListFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.entity.StrangerAccessRecordEntity; import java.util.List; /** - * Created by 11 on 2020/3/17. + * @Description 陌生人记录访问表 + * @InterfaceName ResiGuideServiceImpl + * @Author wangc + * @date 2020.03.17 13:01 */ public interface StrangerAccessRecordService extends BaseService { /** - * - * 陌生人根据位置码获取附近网格数据,并且插入陌生人访客记录 - * */ - List ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO); + * @Description 陌生人根据地区编码查询附近网格数据接口定义 + * @Param CustomerGridListFormDTO + * @return Result> + * @Author wangc + * @Date 2020.03.19 14:28 + **/ + Result> listCustomerGrid(CustomerGridListFormDTO customerGridListFormDTO); } 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 00d779cfad..aeca05bbe6 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 @@ -5,20 +5,21 @@ package com.epmet.service.impl;/** 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.dto.form.CustomerGridListFormDTO; +import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; 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.ArrayList; import java.util.Date; import java.util.List; /** - * @Description + * @Description 陌生人记录访问表 * @ClassName ResiGuideServiceImpl * @Author wangc * @date 2020.03.17 13:01 @@ -29,48 +30,61 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl> + * @Author wangc + * @Date 2020.03.19 14:28 + **/ + @Override - public List ListCustomerGrid(CustomerGridListQueryDTO customerGridListQueryDTO) { + public Result> listCustomerGrid(CustomerGridListFormDTO customerGridListFormDTO) { + + + ListCustomerGridFormDTO listCustomerGridFormDTO = new ListCustomerGridFormDTO(); + listCustomerGridFormDTO.setAreaCode(0 == customerGridListFormDTO.getIsAuthorized() ? + customerGridListFormDTO.getSelectedAreaCode() : customerGridListFormDTO.getAreaCode()); - Result> queryResult = + listCustomerGridFormDTO.setPageNo(null == customerGridListFormDTO.getPageNo() ? 1 : customerGridListFormDTO.getPageNo()); + + listCustomerGridFormDTO.setPageSize(customerGridListFormDTO.getPageSize()); + + + Result> queryResult = govOrgFeignClient - .getPageForStrangerGuideInterface(customerGridListQueryDTO.getAreaCode(),customerGridListQueryDTO.getPageNo(),customerGridListQueryDTO.getPageSize()); - if(0 == queryResult.getCode()) { + .getPageForStrangerGuideInterface(listCustomerGridFormDTO); + //Feign调用成功 + if(queryResult.success()) { - List queryList = queryResult.getData(); + 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()); + //未授权,手动选择 + if (0 == customerGridListFormDTO.getIsAuthorized()) { + strangerTrance.setSelectedAreaCode(customerGridListFormDTO.getSelectedAreaCode()); + } else if (1 == customerGridListFormDTO.getIsAuthorized()) { + //已授权,自动选择 + strangerTrance.setLocationAreaCode(customerGridListFormDTO.getAreaCode()); } - strangerTrance.setIsAuthorized(customerGridListQueryDTO.getIsAuthorized()); + strangerTrance.setIsAuthorized(customerGridListFormDTO.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()); + strangerTrance.setProvince(customerGridListFormDTO.getProvince()); + strangerTrance.setCity(customerGridListFormDTO.getCity()); + strangerTrance.setArea(customerGridListFormDTO.getArea()); insert(strangerTrance); - return queryList; + return new Result>().ok(queryList); } else { - - return null; + //没有查询出结果 + return new Result>().ok(new ArrayList<>()); } }else{ - return null; + //Feign调用失败 + return new Result>().error(queryResult.getCode(),queryResult.getMsg()); } From 64a6f3b8df5e8fe47a6d3f290a823e5492d5253f Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 19 Mar 2020 17:30:55 +0800 Subject: [PATCH 32/39] =?UTF-8?q?resi=E6=A8=A1=E5=9D=97=EF=BC=8Ccontroller?= =?UTF-8?q?=E5=88=86=E5=BC=80=EF=BC=8C=E5=88=86=E6=88=90stranger=E5=92=8Cs?= =?UTF-8?q?trangerAccessRecord=E4=B8=A4=E4=B8=AARequestMapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/CustomerGridDao.java | 1 + .../StrangerAccessRecordController.java | 31 +------------- .../StrangerResiGuideController.java | 42 +++++++++++++++++++ .../com/epmet/feign/GovOrgFeignClient.java | 2 +- 4 files changed, 45 insertions(+), 31 deletions(-) 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 fc2f26ac88..293a0d9399 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 @@ -23,6 +23,7 @@ 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; 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 963a8a53ed..38a4f1674a 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 @@ -27,43 +27,14 @@ import java.util.Map; * @date 2020.03.17 11:33 */ @RestController -@RequestMapping("stranger") +@RequestMapping("strangerAccessRecordController") public class StrangerAccessRecordController { @Autowired private StrangerAccessRecordService strangerAccessRecordService; - /** - * @Description 陌生访客根据自动定位获取附近网格数据 - * @Param CustomerGridListFormDTO - * @return Result> - * @Author wangc - * @Date 2020.03.19 14:13 - **/ - @PostMapping("getlocationcustomergridlist") - Result> getLocationCustomerGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ - - ValidatorUtils.validateEntity(customerGridListFormDTO); - - return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO); - - } - /** - * @Description 陌生访客手动选定位置获取附近网格数据 - * @Param CustomerGridListFormDTO - * @return Result> - * @Author wangc - * @Date 2020.03.19 14:13 - **/ - @PostMapping("getselectcdcustomergridlist") - Result> getSelectcdCustomerGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ - - ValidatorUtils.validateEntity(customerGridListFormDTO); - - return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO); - } /** * 查询陌生人访问记录 * @Author yangshaoping 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 index d39f477e79..a15f26739d 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CustomerGridListFormDTO; import com.epmet.dto.form.StrangerFormDTO; +import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.HomeDesignByCustomerResultDTO; +import com.epmet.service.StrangerAccessRecordService; import com.epmet.service.StrangerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -27,6 +31,8 @@ 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; + /** * 居民端-陌生人导览 @@ -40,6 +46,9 @@ public class StrangerResiGuideController { @Autowired private StrangerService strangerService; + @Autowired + private StrangerAccessRecordService strangerAccessRecordService; + /** * @param * @Author sun @@ -51,4 +60,37 @@ public class StrangerResiGuideController { return strangerService.getgridhome(formDTO); } + + + /** + * @Description 陌生访客根据自动定位获取附近网格数据 + * @Param CustomerGridListFormDTO + * @return Result> + * @Author wangc + * @Date 2020.03.19 14:13 + **/ + @PostMapping("getlocationcustomergridlist") + Result> getLocationCustomerGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ + + ValidatorUtils.validateEntity(customerGridListFormDTO); + + return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO); + + } + + /** + * @Description 陌生访客手动选定位置获取附近网格数据 + * @Param CustomerGridListFormDTO + * @return Result> + * @Author wangc + * @Date 2020.03.19 14:13 + **/ + @PostMapping("getselectcdcustomergridlist") + Result> getSelectcdCustomerGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ + + ValidatorUtils.validateEntity(customerGridListFormDTO); + + return strangerAccessRecordService.listCustomerGrid(customerGridListFormDTO); + } + } 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 86b8947289..c6721d4c14 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 @@ -20,7 +20,7 @@ import java.util.List; * @Author wangc * @date 2020.03.17 14:29 */ -@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignFallBack.class, url = "http://localhost:8092") +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignFallBack.class) public interface GovOrgFeignClient { /** From 660ae7997018ef0e324a73d365154c389a728931 Mon Sep 17 00:00:00 2001 From: yinzuomei <57602893@qq.com> Date: Thu, 19 Mar 2020 17:41:27 +0800 Subject: [PATCH 33/39] =?UTF-8?q?getCustomerGridByGridId=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0Override?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerGridServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 36435deb2d..c301f898e4 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 @@ -44,7 +44,7 @@ import java.util.List; import java.util.Map; /** - * 客户网格表 + * 客户网格表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-16 @@ -146,8 +146,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(CustomerGridFormDTO formDTO) { return new Result().ok(baseDao.getCustomerGridByGridId(formDTO)); } -} \ No newline at end of file +} From b7e9e74cf87abdce05772d6c42a7456c98aaaaca Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 19 Mar 2020 17:47:06 +0800 Subject: [PATCH 34/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E5=AF=BC?= =?UTF-8?q?=E8=A7=88=E6=A8=A1=E5=9D=97=E4=B8=8E=E7=8E=8B=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StrangerResiGuideController.java | 6 +- .../main/java/com/epmet/dao/StrangerDao.java | 30 ------- .../java/com/epmet/entity/StrangerEntity.java | 33 -------- .../service/StrangerAccessRecordService.java | 10 +++ .../com/epmet/service/StrangerService.java | 35 -------- .../impl/StrangerAccessRecordServiceImpl.java | 44 ++++++++++- .../service/impl/StrangerServiceImpl.java | 79 ------------------- 7 files changed, 53 insertions(+), 184 deletions(-) delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java delete mode 100644 epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java 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 index a15f26739d..37e8471cfc 100644 --- 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 @@ -24,7 +24,6 @@ import com.epmet.dto.form.StrangerFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.service.StrangerAccessRecordService; -import com.epmet.service.StrangerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -43,9 +42,6 @@ import java.util.List; @RequestMapping("stranger") public class StrangerResiGuideController { - @Autowired - private StrangerService strangerService; - @Autowired private StrangerAccessRecordService strangerAccessRecordService; @@ -57,7 +53,7 @@ public class StrangerResiGuideController { **/ @PostMapping("getgridhome") public Result getValidCustomerList(@RequestBody StrangerFormDTO formDTO) throws Exception { - return strangerService.getgridhome(formDTO); + return strangerAccessRecordService.getgridhome(formDTO); } 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 deleted file mode 100644 index affa495fd1..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/dao/StrangerDao.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 deleted file mode 100644 index 9ee71678a8..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/entity/StrangerEntity.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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/service/StrangerAccessRecordService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java index 48602670fa..e793afd026 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 @@ -5,7 +5,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StrangerAccessRecordDTO; import com.epmet.dto.form.CustomerGridListFormDTO; +import com.epmet.dto.form.StrangerFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.entity.StrangerAccessRecordEntity; import java.util.List; @@ -96,4 +98,12 @@ public interface StrangerAccessRecordService extends BaseService> listCustomerGrid(CustomerGridListFormDTO customerGridListFormDTO); + + /** + * 居民端-网格链接获取客户首页配置 + * @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/StrangerService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java deleted file mode 100644 index f2107ccc13..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerService.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 f955d837ff..4a8a67221d 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 @@ -7,11 +7,13 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.StrangerAccessRecordDao; import com.epmet.dto.StrangerAccessRecordDTO; -import com.epmet.dto.form.CustomerGridListFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.entity.StrangerAccessRecordEntity; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.OperCustomizeFeignClient; import com.epmet.service.StrangerAccessRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,6 +41,10 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl 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服务 获取首页发布数据 + * @param customerId + * @return + * @author sun + */ + 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/java/com/epmet/service/impl/StrangerServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java deleted file mode 100644 index 49d22d716b..0000000000 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerServiceImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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); - } - -} From 28ebd0e0ddfb8f7b677ec9137ee054e795d24f9c Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 19 Mar 2020 17:52:39 +0800 Subject: [PATCH 35/39] =?UTF-8?q?=E5=88=A0=E9=99=A4gov=E4=B8=8B=E7=9A=84Pd?= =?UTF-8?q?ManDbVersion=E6=A8=A1=E5=9D=97=EF=BC=8C=E4=BF=AE=E6=94=B9strang?= =?UTF-8?q?erAccessRecordController=E7=9A=84RequestMapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/PdmanDbVersionDTO.java | 51 --------- .../controller/PdmanDbVersionController.java | 94 ---------------- .../java/com/epmet/dao/PdmanDbVersionDao.java | 33 ------ .../epmet/entity/PdmanDbVersionEntity.java | 51 --------- .../com/epmet/excel/PdmanDbVersionExcel.java | 44 -------- .../com/epmet/redis/PdmanDbVersionRedis.java | 47 -------- .../epmet/service/PdmanDbVersionService.java | 95 ---------------- .../service/impl/CustomerGridServiceImpl.java | 2 +- .../impl/PdmanDbVersionServiceImpl.java | 104 ------------------ .../resources/mapper/PdmanDbVersionDao.xml | 13 --- .../StrangerAccessRecordController.java | 2 +- 11 files changed, 2 insertions(+), 534 deletions(-) delete mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PdmanDbVersionServiceImpl.java delete mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java deleted file mode 100644 index 7b6008323b..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/PdmanDbVersionDTO.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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-16 - */ -@Data -public class PdmanDbVersionDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * - */ - private String dbVersion; - - /** - * - */ - private String versionDesc; - - /** - * - */ - private String createdTime; - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java deleted file mode 100644 index 00851cdb80..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PdmanDbVersionController.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * 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.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.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.dto.PdmanDbVersionDTO; -import com.epmet.excel.PdmanDbVersionExcel; -import com.epmet.service.PdmanDbVersionService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; - - -/** - * - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@RestController -@RequestMapping("pdmandbversion") -public class PdmanDbVersionController { - - @Autowired - private PdmanDbVersionService pdmanDbVersionService; - - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = pdmanDbVersionService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - PdmanDbVersionDTO data = pdmanDbVersionService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody PdmanDbVersionDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - pdmanDbVersionService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody PdmanDbVersionDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - pdmanDbVersionService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - pdmanDbVersionService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = pdmanDbVersionService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, PdmanDbVersionExcel.class); - } - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.java deleted file mode 100644 index 44b4dc43da..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/PdmanDbVersionDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.PdmanDbVersionEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Mapper -public interface PdmanDbVersionDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java deleted file mode 100644 index 9a9e181918..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/PdmanDbVersionEntity.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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("pdman_db_version") -public class PdmanDbVersionEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * - */ - private String dbVersion; - - /** - * - */ - private String versionDesc; - -} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java deleted file mode 100644 index 1bb5b05b13..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/PdmanDbVersionExcel.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 PdmanDbVersionExcel { - - @Excel(name = "") - private String dbVersion; - - @Excel(name = "") - private String versionDesc; - - @Excel(name = "") - private String createdTime; - - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.java deleted file mode 100644 index df050721f3..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/PdmanDbVersionRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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.redis; - -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Component -public class PdmanDbVersionRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java deleted file mode 100644 index 2b869d27c9..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PdmanDbVersionService.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * 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.page.PageData; -import com.epmet.dto.PdmanDbVersionDTO; -import com.epmet.entity.PdmanDbVersionEntity; - -import java.util.List; -import java.util.Map; - -/** - * - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -public interface PdmanDbVersionService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-03-16 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-03-16 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return PdmanDbVersionDTO - * @author generator - * @date 2020-03-16 - */ - PdmanDbVersionDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-03-16 - */ - void save(PdmanDbVersionDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-03-16 - */ - void update(PdmanDbVersionDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-03-16 - */ - void delete(String[] ids); -} \ 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 36435deb2d..20122eca59 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 @@ -145,7 +145,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getCustomerGridByGridId(CustomerGridFormDTO formDTO) { return new Result().ok(baseDao.getCustomerGridByGridId(formDTO)); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PdmanDbVersionServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PdmanDbVersionServiceImpl.java deleted file mode 100644 index 59143774d9..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PdmanDbVersionServiceImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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.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.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.dao.PdmanDbVersionDao; -import com.epmet.dto.PdmanDbVersionDTO; -import com.epmet.entity.PdmanDbVersionEntity; -import com.epmet.redis.PdmanDbVersionRedis; -import com.epmet.service.PdmanDbVersionService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-03-16 - */ -@Service -public class PdmanDbVersionServiceImpl extends BaseServiceImpl implements PdmanDbVersionService { - - @Autowired - private PdmanDbVersionRedis pdmanDbVersionRedis; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PdmanDbVersionDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, PdmanDbVersionDTO.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 PdmanDbVersionDTO get(String id) { - PdmanDbVersionEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, PdmanDbVersionDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(PdmanDbVersionDTO dto) { - PdmanDbVersionEntity entity = ConvertUtils.sourceToTarget(dto, PdmanDbVersionEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(PdmanDbVersionDTO dto) { - PdmanDbVersionEntity entity = ConvertUtils.sourceToTarget(dto, PdmanDbVersionEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - -} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml deleted file mode 100644 index f265a47684..0000000000 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/PdmanDbVersionDao.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file 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 38a4f1674a..e2a164c48f 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 @@ -27,7 +27,7 @@ import java.util.Map; * @date 2020.03.17 11:33 */ @RestController -@RequestMapping("strangerAccessRecordController") +@RequestMapping("strangerAccessRecord") public class StrangerAccessRecordController { @Autowired From 2fe91fed68488b29990909b08d102e779e251a6d Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 20 Mar 2020 14:17:28 +0800 Subject: [PATCH 36/39] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=99=84=E8=BF=91?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-org/gov-org-server/pom.xml | 8 ++- .../java/com/epmet/dao/CustomerGridDao.java | 6 +- .../service/impl/CustomerGridServiceImpl.java | 28 ++++----- .../main/resources/mapper/CustomerGridDao.xml | 62 ++++++++++++++----- .../impl/StrangerAccessRecordServiceImpl.java | 2 + 5 files changed, 72 insertions(+), 34 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 29225234d3..066e5ecb0f 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -54,10 +54,12 @@ feign-httpclient 10.3.0 + + - com.github.pagehelper - pagehelper - 5.0.1 + com.epmet + gov-org-client + 2.0.0 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 293a0d9399..41951995ff 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 @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ListCustomerGridFormDTO; import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.CustomerGridFormDTO; @@ -26,6 +27,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 客户网格表 @@ -53,7 +55,7 @@ public interface CustomerGridDao extends BaseDao { * @Author wangc * @Date 2020.03.19 15:53 **/ - List selectGridByCityLike(@Param("areaCode")String areaCode); + List selectGridByCityLike(ListCustomerGridFormDTO listCustomerGridFormDTO); /** @@ -64,7 +66,7 @@ public interface CustomerGridDao extends BaseDao { * @Author wangc * @Date 2020.03.19 15:53 **/ - List selectRestGridWithoutGivenAreaCode(@Param("areaCode")String areaCode , @Param("cityCode")String cityCode); + List selectRestGridWithoutGivenAreaCode(Map paramsMap); 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/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index c301f898e4..d94eb029cf 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 @@ -33,13 +33,13 @@ import com.epmet.entity.CustomerGridEntity; import com.epmet.redis.CustomerGridRedis; import com.epmet.service.CustomerGridService; -import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -114,32 +114,32 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridList - = baseDao.selectGridByCityLike(areaCode.substring(0,areaCode.length()-2)); + = baseDao.selectGridByCityLike(listCustomerGridFormDTO); result.setData(gridList); result.setCode(0); return result; }else{ //行政区 - List gridListArea - = baseDao.selectGridByAreaCode(areaCode); - List restGridListArea - = baseDao.selectRestGridWithoutGivenAreaCode(areaCode,areaCode.substring(0,areaCode.length()-2)); - for(CustomerGridForStrangerResultDTO obj : restGridListArea){ - gridListArea.add(obj); - } - //分页操作 + Map map = new HashMap<>(); + + map.put("areaCode",areaCode); + map.put("cityCode",areaCode.substring(0,areaCode.length()-2)); + map.put("pageSize",listCustomerGridFormDTO.getPageSize()); + map.put("pageNo",listCustomerGridFormDTO.getPageNo()); + + List gridListArea + = baseDao.selectRestGridWithoutGivenAreaCode(map); result.setData(gridListArea); - result.setCode(0); + return result; } 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 f36eb9ca6b..c18e744373 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 @@ -61,7 +61,7 @@ - SELECT id AS grid_id, customer_id, @@ -74,23 +74,55 @@ ORDER BY customer_id, CONVERT ( grid_name USING gbk ) ASC + + LIMIT #{pageNo}, #{pageSize} - - + + + SELECT c.* + + FROM - CUSTOMER_GRID - WHERE - AREA_CODE LIKE CONCAT(#{cityCode},'%') + ( + + ( + SELECT + a.id AS grid_id, + a.customer_id, + a.grid_name + FROM + CUSTOMER_GRID a + WHERE + a.area_code = #{areaCode} + + ORDER BY + CONVERT ( a.grid_name USING gbk ) ASC + LIMIT 99999 + ) + + UNION + + ( + SELECT + b.id AS grid_id, + b.customer_id, + b.grid_name + FROM + CUSTOMER_GRID b + WHERE + b.area_code LIKE CONCAT(#{cityCode},'%') + + AND #{areaCode} + ]]> + ORDER BY + CONVERT ( b.grid_name USING gbk ) ASC + LIMIT 999999 + ) + ) AS c + LIMIT #{pageNo}, #{pageSize} - AND #{areaCode} - ]]> - ORDER BY - customer_id, - CONVERT ( grid_name USING gbk ) ASC \ No newline at end of file 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 4a8a67221d..3a1c5b78b3 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 @@ -144,9 +144,11 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl Date: Fri, 20 Mar 2020 14:18:16 +0800 Subject: [PATCH 37/39] =?UTF-8?q?=E9=99=8C=E7=94=9F=E4=BA=BA=E5=AF=BC?= =?UTF-8?q?=E8=A7=88=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0token=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20=E8=B5=B0=E6=B3=A8=E5=86=8C=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 3 ++ .../com/epmet/feign/GovOrgFeignClient.java | 21 ------------ .../feign/impl/GovOrgFeignClientFallBack.java | 25 -------------- .../com/epmet/controller/HomeController.java | 1 - .../epmet/service/impl/HomeServiceImpl.java | 33 +++++++++++-------- .../StrangerResiGuideController.java | 6 ++-- .../service/StrangerAccessRecordService.java | 3 +- .../impl/StrangerAccessRecordServiceImpl.java | 14 ++++---- .../service/impl/GridVisitedServiceImpl.java | 5 ++- 9 files changed, 39 insertions(+), 72 deletions(-) delete mode 100644 epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 36fabb7b50..94d5e8a27a 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -127,6 +127,7 @@ spring: - Path=${server.servlet.context-path}/resi/guide/** filters: - StripPrefix=1 + - CpAuth=true #政府端组织管理 - id: gov-org-server uri: @gateway.routes.gov-org-server.uri@ @@ -179,6 +180,7 @@ renren: - /epmetuser/** - /gov/org/** - /oper/access/** + - /resi/guide/** management: endpoints: web: @@ -239,6 +241,7 @@ epmet: - /epmetuser/** - /gov/org/** - /oper/access/** + - /resi/guide/** swaggerUrls: jwt: diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index eb48542008..de3a3191d6 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -18,25 +18,4 @@ public interface GovOrgFeignClient { @GetMapping("gov/org/customergrid/getcustomergrid/{id}") Result getcustomergrid(@PathVariable("id") String id); - -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.CustomerGridDTO; -import com.epmet.feign.impl.GovOrgFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * Created by 11 on 2020/3/18. - */ -@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class, url="http://localhost:8092") -public interface GovOrgFeignClient { - - - @GetMapping("gov/org/customergrid/page") - Result> page(); - - - } diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java deleted file mode 100644 index eab629cec6..0000000000 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/feign/impl/GovOrgFeignClientFallBack.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.epmet.feign.impl;/** - * Created by 11 on 2020/3/18. - */ - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.feign.GovOrgFeignClient; -import org.springframework.stereotype.Component; - -/** - * @Description - * @ClassName GovOrgFeignClientFallBack - * @Author wangc - * @date 2020.03.18 14:52 - */ -@Component -public class GovOrgFeignClientFallBack implements GovOrgFeignClient{ - @Override - public Result> page() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "page"); - } -} 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 66ea831b6d..e528ed9b83 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 @@ -92,7 +92,6 @@ public class HomeController { @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/service/impl/HomeServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java index 5a23466015..68d3faff90 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 @@ -116,24 +116,31 @@ public class HomeServiceImpl implements HomeService { @Override public Result getHomeReleaseByCustomer(CustomerHomeFormDTO formDTO) { HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO(); + //根据客户id,所属端获取客户首页配置的设计稿 List list = customerHomeDetailDao.getHomeReleaseByCustomer(formDTO); - List flist = new ArrayList();//功能组件 - List usedComponent=new ArrayList<>();//使用的组件集合 + List titlelist=new ArrayList(); + List toplist=new ArrayList(); + List functionlist=new ArrayList(); + List floatlist=new ArrayList(); + //List usedComponent=new ArrayList<>();//使用过的组件集合 for(CommonComponentDesignResultDTO c:list){ - usedComponent.add(c.getComponentId()); + //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); + if(ReginConstant.titleList.equals(c.getRegion())){ + titlelist.add(c); + }else if(ReginConstant.topList.equals(c.getRegion())){ + toplist.add(c); + }else if(ReginConstant.functionList.equals(c.getRegion())){ + functionlist.add(c); + }else if(ReginConstant.floatingList.equals(c.getRegion())){ + floatlist.add(c); } } - resultDTO.setFunctionList(flist); - resultDTO.setUsedComponentIdList(usedComponent); + resultDTO.setTitleList(titlelist); + resultDTO.setTopList(toplist); + resultDTO.setFloatingList(floatlist); + resultDTO.setFunctionList(functionlist); + //resultDTO.setUsedComponentIdList(usedComponent); return new Result().ok(resultDTO); } } 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 index 37e8471cfc..5f97343835 100644 --- 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 @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CustomerGridListFormDTO; @@ -52,8 +54,8 @@ public class StrangerResiGuideController { * @Date 2020/3/16 **/ @PostMapping("getgridhome") - public Result getValidCustomerList(@RequestBody StrangerFormDTO formDTO) throws Exception { - return strangerAccessRecordService.getgridhome(formDTO); + public Result getValidCustomerList( @LoginUser TokenDto tokenDTO, @RequestBody StrangerFormDTO formDTO) throws Exception { + return strangerAccessRecordService.getgridhome(tokenDTO, 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 e793afd026..c0c0824075 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 @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StrangerAccessRecordDTO; import com.epmet.dto.form.CustomerGridListFormDTO; @@ -105,5 +106,5 @@ public interface StrangerAccessRecordService extends BaseService getgridhome(StrangerFormDTO formDTO); + Result getgridhome(TokenDto tokenDTO, 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 4a8a67221d..37216fa0d1 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 @@ -3,6 +3,7 @@ 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.StrangerAccessRecordDao; @@ -175,31 +176,32 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl getgridhome(StrangerFormDTO formDTO) { + public Result getgridhome(TokenDto tokenDTO, StrangerFormDTO formDTO) { //token里边有所属端 userId这些参数 前台传递customerID和gridId //1:调用epmet-user服务查询数据 新建网格记录数据 VisitedFormDTO vi = new VisitedFormDTO(); vi.setGridId(formDTO.getGridId()); vi.setCustomerId(formDTO.getCustomerId()); - //vi.setUserId(token获取); + vi.setUserId(tokenDTO.getUserId());//token中获取userId epmetUserFeignClient.saveLatestAndVisited(vi); //2:调用ope-customize服务 获取首页发布数据 - Result res = getCustomerHomeData(formDTO.getCustomerId()); + Result res = getCustomerHomeData(formDTO.getCustomerId(),tokenDTO.getClient()); return res; } /** * 调用oper-customize服务 获取首页发布数据 - * @param customerId + * @param customerId 客户Id + * @param clientType 所属端 * @return * @author sun */ - public Result getCustomerHomeData(String customerId){ + public Result getCustomerHomeData(String customerId,String clientType){ CustomerHomeFormDTO dto = new CustomerHomeFormDTO(); dto.setCustomerId(customerId); - //dto.setClientType(token中获取);//居民端 + dto.setClientType(clientType);//居民端 return operCustomizeFeignClient.getHomeReleaseByCustomer(dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java index 118e08a214..a3810e7268 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java @@ -143,11 +143,10 @@ public class GridVisitedServiceImpl extends BaseServiceImpl Date: Fri, 20 Mar 2020 14:18:31 +0800 Subject: [PATCH 38/39] =?UTF-8?q?loginbywxcode=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9AencryptedData=E3=80=81iv=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/LoginServiceImpl.java | 52 +++++++++++-------- .../token/dto/form/LoginByWxCodeFormDTO.java | 2 - .../java/com/epmet/dto/CustomerUserDTO.java | 7 ++- .../com/epmet/entity/CustomerUserEntity.java | 5 ++ .../main/resources/mapper/CustomerUserDao.xml | 20 ------- 5 files changed, 40 insertions(+), 46 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 23e04e4f9a..ab79c52b24 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -124,29 +124,35 @@ public class LoginServiceImpl implements LoginService { * @since 2020/3/14 19:34 */ private String getUserId(LoginByWxCodeFormDTO formDTO, WxMaJscode2SessionResult wxMaJscode2SessionResult) { - WxLoginUserInfoFormDTO wxLoginUserInfoFormDTO=new WxLoginUserInfoFormDTO(); + WxLoginUserInfoFormDTO wxLoginUserInfoFormDTO = new WxLoginUserInfoFormDTO(); wxLoginUserInfoFormDTO.setApp(formDTO.getApp()); wxLoginUserInfoFormDTO.setOpenId(wxMaJscode2SessionResult.getOpenid()); - Result userResult=epmetUserFeignClient.selecWxLoginUserInfo(wxLoginUserInfoFormDTO); - String userId=""; - if(!userResult.success()){ - throw new RenException("获取用户信息失败"+userResult.getMsg()); + Result userResult = epmetUserFeignClient.selecWxLoginUserInfo(wxLoginUserInfoFormDTO); + String userId = ""; + if (!userResult.success()) { + throw new RenException("获取用户信息失败" + userResult.getMsg()); } - userId= (String) userResult.getData(); - if (StringUtils.isBlank(userId)&&LoginConstant.APP_GOV.equals(formDTO.getApp())) { + userId = (String) userResult.getData(); + if (StringUtils.isBlank(userId) && LoginConstant.APP_GOV.equals(formDTO.getApp())) { //查询customer_staff待完善 - } else if (StringUtils.isBlank(userId)&&LoginConstant.APP_OPER.equals(formDTO.getApp())) { + } else if (StringUtils.isBlank(userId) && LoginConstant.APP_OPER.equals(formDTO.getApp())) { //查询oper_user待完善 - } else if (StringUtils.isBlank(userId)&&LoginConstant.APP_RESI.equals(formDTO.getApp())) { + } else if (StringUtils.isBlank(userId) && LoginConstant.APP_RESI.equals(formDTO.getApp())) { //查询customer_user - WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.resiWxMaService().getUserService() - .getUserInfo(wxMaJscode2SessionResult.getSessionKey(), - formDTO.getEncryptedData(), - formDTO.getIv()); - CustomerUserDTO customerUserDTO=this.packageCustomerUserDTO(wxMaUserInfo); - Result saveCustomerUserResult=epmetUserFeignClient.saveCustomerUser(customerUserDTO); - if(!saveCustomerUserResult.success()){ - throw new RenException("创建用户失败"+userResult.getMsg()); + CustomerUserDTO customerUserDTO = new CustomerUserDTO(); + if (StringUtils.isNotBlank(formDTO.getIv()) && StringUtils.isNotBlank(formDTO.getEncryptedData())) { + WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.resiWxMaService().getUserService() + .getUserInfo(wxMaJscode2SessionResult.getSessionKey(), + formDTO.getEncryptedData(), + formDTO.getIv()); + customerUserDTO = this.packageCustomerUserDTO(wxMaUserInfo); + } else { + customerUserDTO.setWxOpenId(wxMaJscode2SessionResult.getOpenid()); + customerUserDTO.setUnionId(wxMaJscode2SessionResult.getUnionid()); + } + Result saveCustomerUserResult = epmetUserFeignClient.saveCustomerUser(customerUserDTO); + if (!saveCustomerUserResult.success()) { + throw new RenException("创建用户失败" + userResult.getMsg()); } userId = saveCustomerUserResult.getData(); } @@ -222,22 +228,22 @@ public class LoginServiceImpl implements LoginService { public Result loginByPassword(LoginByPassWordFormDTO formDTO) { //1、验证码是否正确 boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); - if(!flag){ + if (!flag) { return new Result().error(ErrorCode.CAPTCHA_ERROR); } //2、账号是否存在 //获取用户信息 - PasswordLoginUserInfoFormDTO passwordLoginUserInfoFormDTO=new PasswordLoginUserInfoFormDTO(); + PasswordLoginUserInfoFormDTO passwordLoginUserInfoFormDTO = new PasswordLoginUserInfoFormDTO(); passwordLoginUserInfoFormDTO.setApp(formDTO.getApp()); passwordLoginUserInfoFormDTO.setPhone(formDTO.getPhone()); - Result userInfoResult=epmetUserFeignClient.selectLoginUserInfoByPassword(passwordLoginUserInfoFormDTO); - logger.info(userInfoResult.getCode()+userInfoResult.getMsg()); - if(!userInfoResult.success()||null==userInfoResult.getData()){ + Result userInfoResult = epmetUserFeignClient.selectLoginUserInfoByPassword(passwordLoginUserInfoFormDTO); + logger.info(userInfoResult.getCode() + userInfoResult.getMsg()); + if (!userInfoResult.success() || null == userInfoResult.getData()) { return new Result().error("账号不存在"); } //3、密码是否正确 //密码错误 - if(!PasswordUtils.matches(formDTO.getPassword(),userInfoResult.getData().getPassWord())){ + if (!PasswordUtils.matches(formDTO.getPassword(), userInfoResult.getData().getPassWord())) { throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); } //4、生成token返回,且将TokenDto存到redis diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java index 149514a0a3..0f61c36255 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/dto/form/LoginByWxCodeFormDTO.java @@ -23,12 +23,10 @@ public class LoginByWxCodeFormDTO extends LoginCommonFormDTO implements Serializ /** * 用户信息 */ - @NotBlank(message = "用户信息不能为空") private String encryptedData; /** * 加密算法的初始向量 */ - @NotBlank(message = "初始向量不能为空") private String iv; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java index 348dc373d2..2964c379c3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerUserDTO.java @@ -48,6 +48,11 @@ public class CustomerUserDTO implements Serializable { */ private String wxOpenId; + /** + * 微信unionId + */ + private String unionId; + /** * 手机号 */ @@ -118,4 +123,4 @@ public class CustomerUserDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java index 11a6e86b09..9b93cd7ee3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerUserEntity.java @@ -48,6 +48,11 @@ public class CustomerUserEntity extends BaseEpmetEntity { */ private String wxOpenId; + /** + * 微信unionId + */ + private String unionId; + /** * 手机号 */ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml index 09dbe55a56..4841a86795 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerUserDao.xml @@ -3,26 +3,6 @@ - - - - - - - - - - - - - - - - - - - -