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