Browse Source

customize合并到dev1.0,合并冲突解决

# Conflicts:
#	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
dev
yangshaoping 6 years ago
parent
commit
5fe87dd33e
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  2. 8
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeDetailDTO.java
  3. 8
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerHomeTemplateDTO.java
  4. 8
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/HomeComponentDTO.java
  5. 42
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeComponentFormDTO.java
  6. 28
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignByCustomerFormDTO.java
  7. 33
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeDesignFormDTO.java
  8. 50
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentDesignResultDTO.java
  9. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CommonComponentResultDTO.java
  10. 37
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java
  11. 19
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/constant/ReginConstant.java
  12. 45
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/HomeController.java
  13. 15
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java
  14. 21
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDetailDao.java
  15. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java
  16. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeDetailEntity.java
  17. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerHomeTemplateEntity.java
  18. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/HomeComponentEntity.java
  19. 30
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java
  20. 102
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java
  21. 13
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml
  22. 38
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDetailDao.xml
  23. 6
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/HomeComponentDao.xml
  24. 101
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java
  25. 101
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java
  26. 94
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java
  27. 94
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java
  28. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java
  29. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java
  30. 71
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java
  31. 71
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java
  32. 74
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java
  33. 74
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java
  34. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java
  35. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java
  36. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java
  37. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java
  38. 104
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  39. 104
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java
  40. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml
  41. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -50,7 +50,7 @@ public interface ServiceConstant {
String RESI_GUIDE_SERVER = "resi-guide-server";
/**
* 政府机构组织管理
* 政府端组织架构
*/
String GOV_ORG_SERVER = "gov-org-server";
}

8
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;
}
}

8
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;
}
}

8
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;
}
}

42
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;
/**
* 所属区域titleList.标题区topList.置顶区functionList.功能区floatingList.悬浮区
*/
private String region;
/**
* 高级配置项
*/
private String configuration;
/**
* 默认数据
*/
private String demoData;
/**
* 显示顺序
*/
private Integer displayOrder;
}

28
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;
}

33
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<HomeComponentFormDTO> componentList;
}

50
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;
}

5
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;
}

37
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 List<CommonComponentDesignResultDTO> titleList;
/**
* 置顶区
*/
private List<CommonComponentDesignResultDTO> topList;
/**
* 功能区
*/
private List<CommonComponentDesignResultDTO> functionList;
/**
* 悬浮区
*/
private List<CommonComponentDesignResultDTO> floatingList;
/**
*用于标识已使用的功能组件id列表不含通用组件
*/
private List<String> usedComponentIdList;
}

19
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";
}

45
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/HomeController.java

@ -3,9 +3,11 @@ 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.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.*;
@ -33,4 +35,45 @@ public class HomeController {
ValidatorUtils.validateEntity(formDTO);
return homeService.getComponentListByCustomer(formDTO);
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.HomeDesignByCustomerResultDTO>
* @Author yang
* @Description 获取客户首页配置的设计稿
* @Date 2020/3/16 13:21
**/
@PostMapping("gethomedesignbycustomer")
public Result<HomeDesignByCustomerResultDTO> getHomeDesignByCustomer(@RequestBody HomeDesignByCustomerFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return homeService.getHomeDesignByCustomer(formDTO);
}
/**
* 首页设计稿组件上传数据
* @param formDTO 参数
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* Date 2020/3/16 13:21
**/
@PostMapping("savehomedesign")
public Result saveHomeDesign(@RequestBody HomeDesignFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
homeService.saveHomeDesign(formDTO);
return new Result();
}
/**
* 首页设计稿发版
* @param formDTO 参数
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* Date 2020/3/16 13:21
**/
@PostMapping("distributehomedesign")
public Result distributeHomeDesign(@RequestBody HomeDesignFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
homeService.distributeHomeDesign(formDTO);
return new Result();
}
}

15
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java

@ -18,9 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.HomeDesignFormDTO;
import com.epmet.entity.CustomerHomeEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 客户首页表
*
@ -29,5 +32,15 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CustomerHomeDao extends BaseDao<CustomerHomeEntity> {
/**
*
* 客户首页列表查询
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.CommonComponentResultDTO>
* @author zhaoqifeng
* @date 2020/3/16 14:02
**/
List<CustomerHomeEntity> selectCustomerHomeList(HomeDesignFormDTO formDTO);
}

21
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,20 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface CustomerHomeDetailDao extends BaseDao<CustomerHomeDetailEntity> {
/**
*
* 根据界面id清除数据
*
* @param homeId 界面ID
* @author zhaoqifeng
* @date 2020/3/16 14:02
*/
void updateCustomerHomeDetailByHomeId(String homeId);
/**
*
* 根据客户id,所属端获取客户首页配置的设计稿
* @author yangshaoping
* @date 2020/3/1714:02
*/
List<CommonComponentDesignResultDTO> getCustomerHomeDetailComponent(HomeDesignByCustomerFormDTO form);
}

2
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<CustomerHomeTemplateEntity> {
}

6
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;
/**
* 高级配置

6
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串

6
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;
/**
* 高级配置

30
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/HomeService.java

@ -2,7 +2,10 @@ 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;
/**
* @Description 客户定制化服务-首页
@ -18,4 +21,31 @@ public interface HomeService {
* @Date 2020/3/11 13:22
**/
Result<ComponentListByCustomerResultDTO> getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO);
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.HomeDesignByCustomerResultDTO>
* @Author yang
* @Description 获取客户首页配置的设计稿
* @Date 2020/3/16 13:21
**/
Result<HomeDesignByCustomerResultDTO> 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);
}

102
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/HomeServiceImpl.java

@ -1,13 +1,26 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ReginConstant;
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.result.CommonComponentDesignResultDTO;
import com.epmet.dto.result.ComponentListByCustomerResultDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.entity.CustomerHomeDetailEntity;
import com.epmet.entity.CustomerHomeEntity;
import com.epmet.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 客户定制化服务-首页
* @Author yinzuomei
@ -15,14 +28,91 @@ import org.springframework.stereotype.Service;
*/
@Service
public class HomeServiceImpl implements HomeService {
@Autowired
private HomeComponentDao homeComponentDao;
@Autowired
private CustomerHomeDetailDao customerHomeDetailDao;
@Autowired
private HomeComponentDao homeComponentDao;
private CustomerHomeDao customerHomeDao;
@Override
public Result<ComponentListByCustomerResultDTO> getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO) {
ComponentListByCustomerResultDTO resultDTO = new ComponentListByCustomerResultDTO();
resultDTO.setCommonList(homeComponentDao.selectListCommonComponentResultDTO(formDTO));
resultDTO.setFunctionList(homeComponentDao.selectListFunctionComponentResultDTO(formDTO));
return new Result<ComponentListByCustomerResultDTO>().ok(resultDTO);
}
@Override
public Result<HomeDesignByCustomerResultDTO> getHomeDesignByCustomer(HomeDesignByCustomerFormDTO formDTO) {
HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO();
//根据客户id,所属端获取客户首页配置的设计稿
List<CommonComponentDesignResultDTO> list = customerHomeDetailDao.getCustomerHomeDetailComponent(formDTO);
List<CommonComponentDesignResultDTO> titlelist=new ArrayList<CommonComponentDesignResultDTO>();
List<CommonComponentDesignResultDTO> toplist=new ArrayList<CommonComponentDesignResultDTO>();
List<CommonComponentDesignResultDTO> functionlist=new ArrayList<CommonComponentDesignResultDTO>();
List<CommonComponentDesignResultDTO> floatlist=new ArrayList<CommonComponentDesignResultDTO>();
List<String> usedComponent=new ArrayList<>();//使用过的组件集合
for(CommonComponentDesignResultDTO c:list){
usedComponent.add(c.getComponentId());
//所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区
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.setTitleList(titlelist);
resultDTO.setTopList(toplist);
resultDTO.setFloatingList(floatlist);
resultDTO.setFunctionList(functionlist);
resultDTO.setUsedComponentIdList(usedComponent);
return new Result<HomeDesignByCustomerResultDTO>().ok(resultDTO);
}
@Override
public void saveHomeDesign(HomeDesignFormDTO formDTO) {
//根据客户ID和所属端类型从客户首页表找到对应的已发布和草稿
List<CustomerHomeEntity> customerHomeList = customerHomeDao.selectCustomerHomeList(formDTO);
//只处理草稿的数据
for(CustomerHomeEntity entity : customerHomeList) {
if (entity.getStatus() == 1) {
saveCustomerHomeDetail(formDTO, entity);
}
}
}
@Override
public Result<ComponentListByCustomerResultDTO> getComponentListByCustomer(ComponentListByCustomerFormDTO formDTO) {
ComponentListByCustomerResultDTO resultDTO = new ComponentListByCustomerResultDTO();
resultDTO.setCommonList(homeComponentDao.selectListCommonComponentResultDTO(formDTO));
resultDTO.setFunctionList(homeComponentDao.selectListFunctionComponentResultDTO(formDTO));
return new Result<ComponentListByCustomerResultDTO>().ok(resultDTO);
public void distributeHomeDesign(HomeDesignFormDTO formDTO) {
//根据客户ID和所属端类型从客户首页表找到对应的已发布和草稿
List<CustomerHomeEntity> customerHomeList = customerHomeDao.selectCustomerHomeList(formDTO);
//草稿和模板数据都要处理
for(CustomerHomeEntity entity : customerHomeList) {
saveCustomerHomeDetail(formDTO, entity);
}
}
private void saveCustomerHomeDetail(HomeDesignFormDTO formDTO, CustomerHomeEntity entity) {
//根据homeID清空客户首页详情表中的数据
customerHomeDetailDao.updateCustomerHomeDetailByHomeId(entity.getId());
//将数据存入客户首页详情表
for (HomeComponentFormDTO homeComponentForm : formDTO.getComponentList()) {
CustomerHomeDetailEntity customerHomeDetailEntity = new CustomerHomeDetailEntity();
customerHomeDetailEntity.setHomeId(entity.getId());
customerHomeDetailEntity.setComponentId(homeComponentForm.getComponentId());
customerHomeDetailEntity.setRegion(homeComponentForm.getRegion());
customerHomeDetailEntity.setConfiguration(homeComponentForm.getConfiguration());
customerHomeDetailEntity.setDemoData(homeComponentForm.getDemoData());
customerHomeDetailEntity.setDisplayOrder(homeComponentForm.getDisplayOrder());
customerHomeDetailDao.insert(customerHomeDetailEntity);
}
}
}

13
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml

@ -16,5 +16,18 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 功能组件列表查询 -->
<select id="selectCustomerHomeList" parameterType="com.epmet.dto.form.HomeDesignFormDTO"
resultMap="customerHomeMap">
SELECT
*
FROM
CUSTOMER_HOME ch
WHERE
CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
AND DEL_FLAG = '0'
</select>
</mapper>

38
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDetailDao.xml

@ -18,5 +18,43 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateCustomerHomeDetailByHomeId" parameterType="java.lang.String">
UPDATE
CUSTOMER_HOME_DETAIL
set
DEL_FLAG = 1
WHERE
HOME_ID = #{homeId}
AND DEL_FLAG = 0
</update>
<!-- 根据客户id,所属端获取客户首页配置的设计稿 -->
<select id="getCustomerHomeDetailComponent" parameterType="com.epmet.dto.form.HomeDesignByCustomerFormDTO"
resultType="com.epmet.dto.result.CommonComponentDesignResultDTO">
SELECT
b.COMPONENT_ID,
c.COMPONENT_NAME,
b.REGION,
b.CONFIGURATION,
b.DEMO_DATA,
b.DISPLAY_ORDER
FROM
(
SELECT
a.id
FROM
customer_home a
WHERE
a.DEL_FLAG = 0
AND a.CUSTOMER_ID = #{customerId}
AND a.CLIENT_TYPE = #{clientType}
ORDER BY
a.CREATED_TIME DESC
LIMIT 1
) a
INNER JOIN customer_home_detail b ON a.id = b.HOME_ID
LEFT JOIN home_component c ON b.COMPONENT_ID = c.id
WHERE
b.DEL_FLAG = 0 and c.DEL_FLAG=0
</select>
</mapper>

6
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

101
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridLatestDTO.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 最近访问网格表 记录用户访问网格的最近一次记录对同一网格只记录一条记录同一网格每次只更新最近一次访问的时间
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-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;
}

101
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridVisitedDTO.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 网格访问记录表 用户对网格访问的一个记录只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-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;
}

94
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridLatestController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.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<PageData<GridLatestDTO>> page(@RequestParam Map<String, Object> params){
PageData<GridLatestDTO> page = gridLatestService.page(params);
return new Result<PageData<GridLatestDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<GridLatestDTO> get(@PathVariable("id") String id){
GridLatestDTO data = gridLatestService.get(id);
return new Result<GridLatestDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<GridLatestDTO> list = gridLatestService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, GridLatestExcel.class);
}
}

94
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridVisitedController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.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<PageData<GridVisitedDTO>> page(@RequestParam Map<String, Object> params){
PageData<GridVisitedDTO> page = gridVisitedService.page(params);
return new Result<PageData<GridVisitedDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<GridVisitedDTO> get(@PathVariable("id") String id){
GridVisitedDTO data = gridVisitedService.get(id);
return new Result<GridVisitedDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<GridVisitedDTO> list = gridVisitedService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, GridVisitedExcel.class);
}
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridLatestDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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<GridLatestEntity> {
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridVisitedDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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<GridVisitedEntity> {
}

71
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridLatestEntity.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
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;
}

71
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridVisitedEntity.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
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;
}

74
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridLatestExcel.java

@ -0,0 +1,74 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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;
}

74
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/GridVisitedExcel.java

@ -0,0 +1,74 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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;
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridLatestRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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;
}
}

47
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GridVisitedRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.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;
}
}

95
epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridLatestService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.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<GridLatestEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GridLatestDTO>
* @author generator
* @date 2020-03-16
*/
PageData<GridLatestDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GridLatestDTO>
* @author generator
* @date 2020-03-16
*/
List<GridLatestDTO> list(Map<String, Object> 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);
}

95
epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridVisitedService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.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<GridVisitedEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GridVisitedDTO>
* @author generator
* @date 2020-03-16
*/
PageData<GridVisitedDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GridVisitedDTO>
* @author generator
* @date 2020-03-16
*/
List<GridVisitedDTO> list(Map<String, Object> 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);
}

104
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.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<GridLatestDao, GridLatestEntity> implements GridLatestService {
@Autowired
private GridLatestRedis gridLatestRedis;
@Override
public PageData<GridLatestDTO> page(Map<String, Object> params) {
IPage<GridLatestEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GridLatestDTO.class);
}
@Override
public List<GridLatestDTO> list(Map<String, Object> params) {
List<GridLatestEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GridLatestDTO.class);
}
private QueryWrapper<GridLatestEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GridLatestEntity> 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));
}
}

104
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridVisitedServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.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<GridVisitedDao, GridVisitedEntity> implements GridVisitedService {
@Autowired
private GridVisitedRedis gridVisitedRedis;
@Override
public PageData<GridVisitedDTO> page(Map<String, Object> params) {
IPage<GridVisitedEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GridVisitedDTO.class);
}
@Override
public List<GridVisitedDTO> list(Map<String, Object> params) {
List<GridVisitedEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GridVisitedDTO.class);
}
private QueryWrapper<GridVisitedEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GridVisitedEntity> 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));
}
}

23
epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.GridLatestDao">
<resultMap type="com.epmet.entity.GridLatestEntity" id="gridLatestMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="customerUserId" column="CUSTOMER_USER_ID"/>
<result property="areaCode" column="AREA_CODE"/>
<result property="pid" column="PID"/>
<result property="latestTime" column="LATEST_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

23
epmet-user/epmet-user-server/src/main/resources/mapper/GridVisitedDao.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.GridVisitedDao">
<resultMap type="com.epmet.entity.GridVisitedEntity" id="gridVisitedMap">
<result property="id" column="ID"/>
<result property="isRegister" column="IS_REGISTER"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="customerUserId" column="CUSTOMER_USER_ID"/>
<result property="isAuthorized" column="IS_AUTHORIZED"/>
<result property="visitTime" column="VISIT_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save