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 db6dea1b61..b66c3c33d2 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 @@ -133,4 +133,9 @@ public interface ServiceConstant { * 积分银行 * */ String EPMET_POINT_SERVER = "epmet-point-server"; + + /** + * 开放接口服务 + */ + String EPMET_EXT_SERVER = "epmet-ext-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index fbbeebccbf..50512fd6d6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -75,6 +75,8 @@ public enum EpmetErrorCode { STAFF_ADD_FAILED(8403,"人员添加失败"), STAFF_EDIT_FAILED(8404,"人员编辑失败"), CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"), + NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"), + GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"), ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index d6d74e1b5b..b21830e44e 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -190,12 +190,15 @@ lb://epmet-third-server - + lb://epmet-heart-server - + lb://epmet-point-server + + lb://epmet-ext-server + @@ -284,6 +287,8 @@ lb://epmet-heart-server lb://epmet-point-server + + lb://epmet-ext-server @@ -369,6 +374,8 @@ lb://epmet-heart-server lb://epmet-point-server + + lb://epmet-ext-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c2105542bb..f3bd69d736 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -313,6 +313,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + # 开放接口服务 + - id: epmet-ext-server + uri: @gateway.routes.epmet-ext-server.url@ + order: 34 + predicates: + - Path=${server.servlet.context-path}/epmet/ext/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/epmet-ext/epmet-ext-client/pom.xml b/epmet-module/epmet-ext/epmet-ext-client/pom.xml new file mode 100644 index 0000000000..edb8fb13a1 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + epmet-ext + com.epmet + 2.0.0 + + + + epmet-ext-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.github.binarywang + weixin-java-mp + 3.6.0 + compile + + + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java new file mode 100644 index 0000000000..5e166ac342 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:33 上午 + */ +@Data +public class StaffSinAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1827402498483127629L; + + //后端自己看 + public interface StaffSinAgency{} + + /** + * appId+customerId+时间戳加密secret + */ +// @NotBlank(message = "secret不能为空",groups = {StaffSinDept.class}) + private String accessToken; + + /** + * 机关Id + */ + @NotBlank(message = "机关Id不能为空",groups = {StaffSinAgency.class}) + private String agencyId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java new file mode 100644 index 0000000000..b66de79686 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:33 上午 + */ +@Data +public class StaffSinDeptFormDTO implements Serializable { + + private static final long serialVersionUID = 1827404498483127629L; + + //后端自己看 + public interface StaffSinDept{} + + /** + * appId+customerId+时间戳加密secret + */ +// @NotBlank(message = "secret不能为空",groups = {StaffSinDept.class}) + private String accessToken; + + /** + * 部门Id + */ + @NotBlank(message = "部门Id不能为空",groups = {StaffSinDept.class}) + private String departmentId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java new file mode 100644 index 0000000000..a694dfddb1 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:33 上午 + */ +@Data +public class StaffSinGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1827404498483127629L; + + //后端自己看 + public interface StaffSinGrid{} + + /** + * appId+customerId+时间戳加密secret + */ +// @NotBlank(message = "secret不能为空",groups = {StaffSinGrid.class}) + private String accessToken; + + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空",groups = {StaffSinGrid.class}) + private String gridId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java new file mode 100644 index 0000000000..a15e6b5827 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:30 上午 + */ +@Data +public class RoleResultDTO implements Serializable { + + private static final long serialVersionUID = -4321366067217459L; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 用户id + */ + @JsonIgnore + private String userId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java new file mode 100644 index 0000000000..dca9c292a3 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:25 上午 + */ +@Data +public class StaffSinDeptResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415466710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/Dockerfile b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile new file mode 100644 index 0000000000..2a18b4bf3a --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8113 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..58cd450f0f --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-ext-server: + container_name: epmet-ext-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.1 + ports: + - "8113:8113" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..14e6df41ba --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-ext-server: + container_name: epmet-ext-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.1 + ports: + - "8113:8113" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..4335ec3381 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-ext-server: + container_name: epmet-ext-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-ext-server:0.0.1 + ports: + - "8113:8113" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml new file mode 100644 index 0000000000..5a9047f096 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -0,0 +1,293 @@ + + + 4.0.0 + 0.0.1 + + + com.epmet + epmet-ext + 2.0.0 + + + epmet-ext-server + jar + + + 3.2.2 + 1.1.0 + 1.0.5 + 2.3.28 + + + + + com.epmet + epmet-ext-client + 2.0.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-user-client + 2.0.0 + + + com.epmet + gov-org-client + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.aliyun + aliyun-java-sdk-core + ${aliyun.core.version} + + + com.aliyun + aliyun-java-sdk-dysmsapi + ${aliyun.dysmsapi.version} + + + com.github.qcloudsms + qcloudsms + ${qcloud.qcloudsms.version} + + + com.sun.mail + javax.mail + + + org.freemarker + freemarker + ${freemarker.version} + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + org.flywaydb + flyway-core + + + + + + com.squareup.okhttp3 + okhttp + 4.0.0 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.dom4j + dom4j + 2.1.3 + compile + + + com.github.binarywang + weixin-java-common + 3.6.0 + compile + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + com.epmet + oper-crm-client + 2.0.0 + compile + + + com.epmet + epmet-oss-client + 2.0.0 + compile + + + org.springframework + spring-test + 5.1.12.RELEASE + compile + + + + + com.aliyun + alibaba-dingtalk-service-sdk + 1.0.1 + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8113 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + + + + test + + + 8113 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + + + + prod + + + 8113 + prod + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + + + + diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java new file mode 100644 index 0000000000..89508e7873 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java @@ -0,0 +1,17 @@ +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; + +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class EpmetExtApplication { + + public static void main(String[] args) { + SpringApplication.run(EpmetExtApplication.class, args); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..5cc47783e6 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "epmetext"; + } +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java new file mode 100644 index 0000000000..d8b34dc284 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -0,0 +1,17 @@ +package com.epmet.constant; + +/** + * @Description + * @author zxc + */ +public interface ModuleConstant { + + String ERROR_GOV_ORG_GRID = "调用gov_org服务查询【网格】下的所有工作人员失败"; + + String ERROR_GOV_ORG_DEPARTMENT = "调用gov_org服务查询【部门】下的所有工作人员失败"; + + String ERROR_GOV_ORG_AGENCY = "调用gov_org服务查询【机关】下的所有工作人员失败"; + + String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败"; + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java new file mode 100644 index 0000000000..68f854f8dc --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -0,0 +1,65 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.*; +import com.epmet.dto.result.StaffSinAgencyResultDTO; +import com.epmet.dto.result.StaffSinDeptResultDTO; +import com.epmet.dto.result.StaffSinGridResultDTO; +import com.epmet.service.OpenUpService; +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; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:16 上午 + */ +@RestController +@RequestMapping("staff") +public class OpenUpController { + + @Autowired + private OpenUpService openUpService; + + /** + * @Description 网格工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:42 上午 + */ + @PostMapping("staffsingrid") + public Result> staffSinGrid(@RequestBody StaffSinGridFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinGridFormDTO.StaffSinGrid.class); + return new Result>().ok(openUpService.staffSinGrid(formDTO)); + } + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + @PostMapping("staffsindept") + public Result> staffSinDept(@RequestBody StaffSinDeptFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinDeptFormDTO.StaffSinDept.class); + return new Result>().ok(openUpService.staffSinDept(formDTO)); + } + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + @PostMapping("staffsinagency") + public Result> staffSinAgency(@RequestBody StaffSinAgencyFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinAgencyFormDTO.StaffSinAgency.class); + return new Result>().ok(openUpService.staffSinAgency(formDTO)); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java new file mode 100644 index 0000000000..5ecbf7aedb --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -0,0 +1,41 @@ +package com.epmet.service; + +import com.epmet.dto.form.StaffSinAgencyFormDTO; +import com.epmet.dto.form.StaffSinDeptFormDTO; +import com.epmet.dto.form.StaffSinGridFormDTO; +import com.epmet.dto.result.StaffSinAgencyResultDTO; +import com.epmet.dto.result.StaffSinDeptResultDTO; +import com.epmet.dto.result.StaffSinGridResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:17 上午 + */ +public interface OpenUpService { + + /** + * @Description 网格工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:42 上午 + */ + List staffSinGrid(StaffSinGridFormDTO formDTO); + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + List staffSinDept(StaffSinDeptFormDTO formDTO); + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + List staffSinAgency(StaffSinAgencyFormDTO formDTO); +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java new file mode 100644 index 0000000000..38120535b9 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -0,0 +1,126 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ModuleConstant; +import com.epmet.dto.form.*; +import com.epmet.dto.result.StaffSinAgencyResultDTO; +import com.epmet.dto.result.StaffSinDeptResultDTO; +import com.epmet.dto.result.StaffSinGridResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.OpenUpService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:18 上午 + */ +@Service +public class OpenUpServiceImpl implements OpenUpService { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + /** + * @Description 网格工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:42 上午 + */ + @Override + public List staffSinGrid(StaffSinGridFormDTO formDTO) { + CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO(); + commonGridId.setGridId(formDTO.getGridId()); + commonGridId.setUserId(UUID.randomUUID().toString().replace(StrConstant.HYPHEN, "")); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); + if (!gridStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID); + } + if (gridStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return this.getStaffList(gridStaffs.getData()); + } + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + @Override + public List staffSinDept(StaffSinDeptFormDTO formDTO) { + DepartmentIdFormDTO departmentId = new DepartmentIdFormDTO(); + departmentId.setDepartmentId(formDTO.getDepartmentId()); + Result> departmentStaffs = govOrgOpenFeignClient.getDepartmentStaffs(departmentId); + if (!departmentStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT); + } + if (departmentStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + List data = this.getStaffList(departmentStaffs.getData()); + List result = new ArrayList<>(); + data.forEach(staff -> { + StaffSinDeptResultDTO dept = new StaffSinDeptResultDTO(); + BeanUtils.copyProperties(staff,dept); + result.add(dept); + }); + return result; + } + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + @Override + public List staffSinAgency(StaffSinAgencyFormDTO formDTO) { + AgencyIdFormDTO agencyId = new AgencyIdFormDTO(); + agencyId.setAgencyId(formDTO.getAgencyId()); + Result> agencyStaffs = govOrgOpenFeignClient.getAgencyStaffs(agencyId); + if (!agencyStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_AGENCY); + } + if (agencyStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + List staffList = this.getStaffList(agencyStaffs.getData()); + List result = new ArrayList<>(); + staffList.forEach(staff -> { + StaffSinAgencyResultDTO agency = new StaffSinAgencyResultDTO(); + BeanUtils.copyProperties(staff,agency); + result.add(agency); + }); + return result; + } + + /** + * @Description 获取工作人员信息 + * @param userIds + * @author zxc + * @date 2020/8/17 1:30 下午 + */ + public List getStaffList(List userIds){ + UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); + userIdsForm.setUserIds(userIds); + Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); + if (!staffInfoList.success()){ + throw new RenException(ModuleConstant.ERROR_EPMET_USER); + } + return staffInfoList.getData(); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..8f43acbf19 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -0,0 +1,100 @@ +server: + port: @server.port@ + servlet: + context-path: /epmet/ext + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-ext-server + # dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + namespace: @nacos.discovery.namespace@ + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + typeAliasesPackage: com.epmet.entity + global-config: + db-config: + id-type: ID_WORKER + field-strategy: NOT_NULL + column-underline: true + banner: false + + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +pagehelper: + helper-dialect: mysql + reasonable: false \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..ec4a9fc8e0 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%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} [%contextName] [%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} [%contextName] [%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} [%contextName] [%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/epmet-ext/pom.xml b/epmet-module/epmet-ext/pom.xml new file mode 100644 index 0000000000..795eb9a45f --- /dev/null +++ b/epmet-module/epmet-ext/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + epmet-ext + pom + + + epmet-ext-client + epmet-ext-server + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java index 64a4bb3376..0b302cdd61 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java @@ -31,6 +31,7 @@ public class AppLetAuthorizationController { @PostMapping("gotoauth") public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO, @RequestHeader("source")String source){ ValidatorUtils.validateEntity(formDTO); + GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO,source); return new Result().ok(goToAuthResultDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java new file mode 100644 index 0000000000..44777f5886 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/17 10:37 上午 + */ +@Data +public class AgencyIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1719033407335647411L; + + /** + * 部门Id + */ + private String agencyId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java new file mode 100644 index 0000000000..0e853c6275 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 5:56 下午 + */ +@Data +public class CustomerIdFormDTO implements Serializable { + + private static final long serialVersionUID = 4512080710854617599L; + + public interface Customer{} + + @NotBlank(message = "customerId不能为空",groups = {Customer.class}) + private String customerId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java new file mode 100644 index 0000000000..326a86860b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 10:37 上午 + */ +@Data +public class DepartmentIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1718433407335647411L; + + /** + * 部门Id + */ + private String departmentId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java new file mode 100644 index 0000000000..89f7e8489b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 10:35 上午 + */ +@Data +public class GridIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1062540828459359881L; + + /** + * 网格Id + */ + private String gridId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java new file mode 100644 index 0000000000..1f583338a2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/14 9:27 上午 + */ +@Data +public class CustomerGridCountResultDTO implements Serializable { + + private static final long serialVersionUID = 386294009143897744L; + + /** + * 客户下的网格数量 + */ + private Integer gridCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index a6bcb7d128..2ada6a69a3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerPartyBranchDTO; -import com.epmet.dto.form.AddAgencyAndStaffFormDTO; -import com.epmet.dto.form.BelongGridNameFormDTO; -import com.epmet.dto.form.ListPartyBranchFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -22,7 +19,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") +//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) public interface GovOrgOpenFeignClient { @@ -187,4 +184,40 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); + + /** + * @Description 查询一个网格下的所有工作人员 + * @param gridIdFormDTO + * @author zxc + * @date 2020/8/13 10:46 上午 + */ + @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs") + Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); + + /** + * @Description 查询部门下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/13 2:46 下午 + */ + @PostMapping(value = "/gov/org/customerstaffdepartment/getdepartmentstaffs") + Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); + + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + @PostMapping(value = "/gov/org/customergrid/gridcount") + Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO); + + /** + * @Description 查询机关下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/17 + */ + @PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs") + Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 6824fa5e65..1394cb2146 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerPartyBranchDTO; -import com.epmet.dto.form.AddAgencyAndStaffFormDTO; -import com.epmet.dto.form.BelongGridNameFormDTO; -import com.epmet.dto.form.ListPartyBranchFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.GovOrgOpenFeignClient; import org.springframework.stereotype.Component; @@ -114,4 +111,24 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } + + @Override + public Result> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO); + } + + @Override + public Result> getDepartmentStaffs(DepartmentIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentStaffs", formDTO); + } + + @Override + public Result selectGridCount(CustomerIdFormDTO customerIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridCount", customerIdFormDTO); + } + + @Override + public Result> getAgencyStaffs(AgencyIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyStaffs", formDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index bff2680d39..4ed6f8392a 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -18,6 +18,11 @@ gov-org-client 2.0.0 + + com.epmet + oper-crm-client + 2.0.0 + com.epmet epmet-commons-mybatis 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 69eecc5d2c..b86bb7df20 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 @@ -216,4 +216,16 @@ public class CustomerGridController { return customerGridService.queryCustomerGridList(formDTO); } + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + @PostMapping("gridcount") + public Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO){ + ValidatorUtils.validateEntity(customerIdFormDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerGridService.selectGridCount(customerIdFormDTO)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index a92d2d8826..ad965efef7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java @@ -17,9 +17,7 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -28,12 +26,8 @@ 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.CustomerStaffAgencyDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.result.CommonStaffInfoResultDTO; +import com.epmet.dto.form.AgencyIdFormDTO; import com.epmet.dto.result.LatestCustomerResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -111,7 +105,15 @@ public class CustomerStaffAgencyController { return customerStaffAgencyService.getLatestCustomer(userId); } - - + /** + * @Description 查询机关下工作人员 + * @param agencyIdFormDTO + * @author zxc + * @date 2020/8/17 10:14 上午 + */ + @PostMapping("getagencystaffs") + public Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO agencyIdFormDTO){ + return new Result>().ok(customerStaffAgencyService.getAgencyStaffs(agencyIdFormDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java index ee22c850bb..e61828a3c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.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.CustomerStaffDepartmentDTO; +import com.epmet.dto.form.DepartmentIdFormDTO; import com.epmet.excel.CustomerStaffDepartmentExcel; import com.epmet.service.CustomerStaffDepartmentService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +92,16 @@ public class CustomerStaffDepartmentController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffDepartmentExcel.class); } + /** + * @Description 查询部门下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/13 2:46 下午 + */ + @PostMapping("getdepartmentstaffs") + public Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerStaffDepartmentService.getDepartmentStaffs(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 09f71efd99..1d50d1453a 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 @@ -216,4 +216,12 @@ public interface CustomerGridDao extends BaseDao { * @Description 单客户-指定区时查询当前城市下除该区之外其余的网格 **/ List selectThirdRestGridWithoutGivenAreaCode(Map map); + + /** + * @Description 查询当前客户已有网格数量 + * @param customerId + * @author zxc + * @date 2020/8/12 5:10 下午 + */ + Integer selectGridCount(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 8cfef54079..ffc46fa725 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -100,4 +100,12 @@ public interface CustomerStaffAgencyDao extends BaseDao getAgencyStaffList(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 88fc246656..363e575499 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -66,4 +66,12 @@ public interface CustomerStaffDepartmentDao extends BaseDao selectDeptStaffs(@Param("deptIdList") List deptIdList); + + /** + * @Description 查询部门下的工作人员userId + * @param departmentId + * @author zxc + * @date 2020/8/13 2:53 下午 + */ + List getDepartmentStaffList(@Param("departmentId")String departmentId); } \ 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 518e20fdb5..67c425915f 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 @@ -251,4 +251,12 @@ public interface CustomerGridService extends BaseService { * @Description 单客户-陌生人导览模块调用-根据地区编码查询客户下的网格列表 **/ Result> queryCustomerGridList(ThirdCustomerGridListFormDTO formDTO); + + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java index 6691351505..8f6f47dfdb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java @@ -21,6 +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.CustomerStaffAgencyDTO; +import com.epmet.dto.form.AgencyIdFormDTO; import com.epmet.dto.form.CommonDepartmentFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.form.CommonGridIdFormDTO; @@ -142,4 +143,12 @@ public interface CustomerStaffAgencyService extends BaseService getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java index f34735eeef..db5fa63d2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.CustomerStaffDepartmentDTO; +import com.epmet.dto.form.DepartmentIdFormDTO; import com.epmet.entity.CustomerStaffDepartmentEntity; import java.util.List; @@ -92,4 +93,12 @@ public interface CustomerStaffDepartmentService extends BaseService getDepartmentStaffs(DepartmentIdFormDTO 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 8f023276a3..afece523c4 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 @@ -29,7 +29,6 @@ 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.constant.CustomerGridConstant; -import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; @@ -37,9 +36,9 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; -import com.epmet.service.CustomerStaffGridService; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -69,11 +68,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -206,15 +205,36 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(griddetail); } + /** + * @Desc 网格添加 + * @Author zxc + * @param tokenDto + * @param addGridFormDTO + * @return + */ @Override @Transactional(rollbackFor = Exception.class) public Result addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { - //查询是否重名 + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId()); + // 1. 查询该客户下可创建网格的最大数量 + GridCountFormDTO gridCount = new GridCountFormDTO(); + String customerId = customerAgencyDTO.getCustomerId(); + gridCount.setCustomerId(customerId); + GridCountResultDTO grid = operCrmOpenFeignClient.getGridCount(gridCount).getData(); + if (grid.getGridCount().equals(NumConstant.ZERO)){ + throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode()); + } + // 2. 判断当前客户下存在的网格数量 + Integer gridCounts = customerGridDao.selectGridCount(customerId); + if (gridCounts >= grid.getGridCount()){ + throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode()); + } + // 3. 查询网格名称是否重名 AddGridResultDTO gridResult = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(), addGridFormDTO.getAgencyId(), null); if (gridResult!=null){ return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); } - CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId()); + CustomerGridEntity customerGridEntity = new CustomerGridEntity(); BeanUtils.copyProperties(addGridFormDTO,customerGridEntity); customerGridEntity.setAreaCode(customerAgencyDTO.getAreaCode()); @@ -615,4 +635,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -213,4 +212,15 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO) { + return customerStaffAgencyDao.getAgencyStaffList(agencyIdFormDTO.getAgencyId()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java index 81cf6dafd9..4e6a504c2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerStaffDepartmentDao; import com.epmet.dto.CustomerStaffDepartmentDTO; +import com.epmet.dto.form.DepartmentIdFormDTO; import com.epmet.entity.CustomerStaffDepartmentEntity; import com.epmet.redis.CustomerStaffDepartmentRedis; import com.epmet.service.CustomerStaffDepartmentService; @@ -47,7 +48,7 @@ import java.util.Map; public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl implements CustomerStaffDepartmentService { @Autowired - private CustomerStaffDepartmentRedis customerStaffDepartmentRedis; + private CustomerStaffDepartmentDao customerStaffDepartmentDao; @Override public PageData page(Map params) { @@ -101,4 +102,16 @@ public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl getDepartmentStaffs(DepartmentIdFormDTO formDTO) { + String departmentId = formDTO.getDepartmentId(); + return customerStaffDepartmentDao.getDepartmentStaffList(departmentId); + } + } \ 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 802ec9f2f3..b9a98117e1 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 @@ -462,4 +462,15 @@ ) AS c LIMIT #{pageNo}, #{pageSize} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 2d548065f3..3df433a5b6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -141,4 +141,15 @@ csa.DEL_FLAG = '0' AND csa.USER_ID = #{staffId} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 927d919372..7e04df040b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -27,6 +27,17 @@ + + + UPDATE diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java new file mode 100644 index 0000000000..bd7a69b259 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/12 17:52 + */ +@Data +public class ProjectResponseFormDTO implements Serializable { + private static final long serialVersionUID = -4915724637094689896L; + /** + * 用户Id + */ + private String userId; + /** + * 项目Id + */ + private String projectId; + /** + * 流程节点Id + */ + private String projectProcessId; + /** + * 公开答复内容 + */ + @Length(max = 1000, message = "公开答复不能超过1000个字符") + private String publicReply; + /** + * 内部流转意见 + */ + @NotBlank(message = "内部备注不能为空") + @Length(max = 1000, message = "内部备注不能超过1000个字符") + private String internalRemark; + /** + * 项目人员关联表ID + */ + private String projectStaffId; + /** + * 部门名 + */ + private String departmentName; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java index f44973bcea..4ffddb9ba4 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * @dscription * @date 2020/5/11 15:33 */ +@NoArgsConstructor @Data public class ProjectDetailResultDTO implements Serializable { @@ -49,6 +51,18 @@ public class ProjectDetailResultDTO implements Serializable { /** * 当前跟进部门 */ - private List departmentNameList; + private List departmentNameList; + @NoArgsConstructor + @Data + public static class DepartmentNameListBean { + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + } } diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 32758e7186..c41495a74f 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.40 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.42 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 79ff122454..82aafceac9 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.40 + 0.3.42 gov-project com.epmet diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index ff9dfb0dc1..dd0f37c086 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -59,6 +59,14 @@ public interface ProjectConstant { * 处理名-转项目 */ String OPERATION_CREATED_NAME = "转项目"; + /** + * 处理-退回 + */ + String OPERATION_RESPONSES = "response"; + /** + * 处理名-退回 + */ + String OPERATION_RESPONSES_NAME = "处理/响应"; /** * 是否处理-未处理 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index a45b46bb0a..4d20d6327c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; @@ -78,6 +79,15 @@ public interface ProjectDao extends BaseDao { */ List selectDepartmentNameList(ProjectDTO dto); + /** + * 当前处理部门及工作人员 + * @author zhaoqifeng + * @date 2020/8/14 10:56 + * @param dto + * @return java.util.List + */ + List selectCurrentDepartmentList(ProjectDTO dto); + /** * 获取项目详情 * @author zhaoqifeng diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 9dafa894ab..e34e2ecd21 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -178,4 +178,13 @@ public interface ProjectService extends BaseService { * @Description 获取客户下已结案项目列表,按结案时间倒序 **/ List getClosedProjectList(LatestListFormDTO formDTO); + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/14 9:42 + * @param formDTO + * @return void + */ + void response(ProjectResponseFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index a3ebf9d74c..d41408524c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -107,4 +107,14 @@ public interface ProjectTraceService { * @Description 项目跟踪-项目人员选择 **/ ProcessorListResultDTO processorList(ProcessorListFormDTO formDTO); + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/12 17:54 + * @param tokenDto + * @param formDTO + * @return void + */ + void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index ea153d138d..3c572a6eac 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -44,10 +44,7 @@ import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectRelatedPersonnelEntity; import com.epmet.entity.ProjectStaffEntity; -import com.epmet.feign.EpmetCommonServiceOpenFeignClient; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.*; import com.epmet.redis.ProjectRedis; import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; @@ -87,6 +84,8 @@ public class ProjectServiceImpl extends BaseServiceImpl departmentNameList = new ArrayList<>(); + List departmentNameList = new ArrayList<>(); + List departmentList = new ArrayList<>(); if (ProjectConstant.CLOSED.equals(resultDTO.getProjectStatus())) { //项目已结案,跟进部门为空 - resultDTO.setDepartmentNameList(departmentNameList); + resultDTO.setDepartmentNameList(departmentList); } else { //项目未结案,找出所有跟进部门 ProjectDTO projectDTO = new ProjectDTO(); projectDTO.setId(fromDTO.getProjectId()); - departmentNameList = baseDao.selectDepartmentNameList(projectDTO); - resultDTO.setDepartmentNameList(departmentNameList); + departmentNameList = baseDao.selectCurrentDepartmentList(projectDTO); + //提取工作人员ID + List staffIdList = departmentNameList.stream().map(ProjectStaffDTO::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + //根据部门分组 + Map> departmentMap = + departmentNameList.stream().collect(Collectors.groupingBy(ProjectStaffDTO::getDepartmentName)); + //获取工作人员信息(姓名) + UserIdsFormDTO userIdsFormDTO = new UserIdsFormDTO(); + userIdsFormDTO.setUserIds(staffIdList); + Result> staffListResult = epmetUserOpenFeignClient.getStaffInfoList(userIdsFormDTO); + if (!staffListResult.success()) { + throw new RenException(staffListResult.getCode(), staffListResult.getMsg()); + } + List staffList = staffListResult.getData(); + for (String departmentName : departmentMap.keySet()) { + ProjectDetailResultDTO.DepartmentNameListBean bean = new ProjectDetailResultDTO.DepartmentNameListBean(); + bean.setDepartmentName(departmentName); + List staffDTOList = departmentMap.get(departmentName); + List staffNameList = + staffDTOList.stream().flatMap(staffDto -> staffList.stream().filter(staffInfo -> + staffDto.getStaffId().equals(staffInfo.getStaffId())).map((StaffSinGridResultDTO::getStaffName))).collect(Collectors.toList()); + bean.setStaffList(staffNameList); + departmentList.add(bean); + } + resultDTO.setDepartmentNameList(departmentList); } return resultDTO; @@ -635,4 +659,41 @@ public class ProjectServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + + //获取项目相关信息 + ProjectEntity projectEntity = baseDao.selectById(formDTO.getProjectId()); + if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { + throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); + } + + //处理响应记录加入项目进展表 + ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity(); + projectProcessEntity.setProjectId(formDTO.getProjectId()); + projectProcessEntity.setDepartmentName(formDTO.getDepartmentName()); + projectProcessEntity.setOperation(ProjectConstant.OPERATION_RESPONSES); + projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RESPONSES_NAME); + projectProcessEntity.setPublicReply(formDTO.getPublicReply()); + projectProcessEntity.setInternalRemark(formDTO.getInternalRemark()); + projectProcessEntity.setStaffId(formDTO.getUserId()); + projectProcessService.insert(projectProcessEntity); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index fb608230b0..d8ddde09ba 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -95,4 +95,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { Result resultDTOResult = govOrgFeignClient.getProcessorList(staffEntity.getOrgId()); return resultDTOResult.getData(); } + + @Override + public void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + projectService.response(formDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index db34280061..8979d90f57 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -183,5 +183,16 @@ AND origin = #{origin} AND origin_id = #{originId} - + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java index 7a78fbb209..8e752eb744 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java @@ -88,6 +88,11 @@ public class CustomerDTO implements Serializable { */ private String logo; + /** + * 客户允许创建的网格数 + */ + private Integer gridNumber; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java new file mode 100644 index 0000000000..a4ebfedc5c --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/12 4:34 下午 + */ +@Data +public class GridCountFormDTO implements Serializable { + + private static final long serialVersionUID = 3121175488079594627L; + + private String customerId; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java new file mode 100644 index 0000000000..c47b3514c2 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/14 9:01 上午 + */ +@Data +public class CustomerInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 7653925905635170972L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 已创建网格数 + */ + private Integer createGridNum; + + /** + * 最大允许创建数 + */ + private Integer maxGridNum; + +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java new file mode 100644 index 0000000000..7264a71c72 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/12 4:31 下午 + */ +@Data +public class GridCountResultDTO implements Serializable { + + private static final long serialVersionUID = -5523213918272649646L; + + private Integer gridCount; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 7b426012b4..161d3e5f9e 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -6,6 +6,8 @@ import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.CustomerAppSecretFormDTO; import com.epmet.dto.form.CustomerManagerFormDTO; +import com.epmet.dto.form.GridCountFormDTO; +import com.epmet.dto.result.GridCountResultDTO; import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -62,4 +64,13 @@ public interface OperCrmOpenFeignClient { */ @PostMapping("/oper/crm/customer/getalllist") Result> getAllCustomerList(); + + /** + * @Description 查询客户下可以创建网格的最大数 + * @param formDTO + * @author zxc + * @date 2020/8/12 4:37 下午 + */ + @PostMapping("/oper/crm/customer/getgridcount") + Result getGridCount(@RequestBody GridCountFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java index b4f3947ed7..f4ad95f4ca 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -7,6 +7,8 @@ import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.CustomerAppSecretFormDTO; import com.epmet.dto.form.CustomerManagerFormDTO; +import com.epmet.dto.form.GridCountFormDTO; +import com.epmet.dto.result.GridCountResultDTO; import com.epmet.feign.OperCrmOpenFeignClient; import org.springframework.stereotype.Component; @@ -50,4 +52,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result> getAllCustomerList() { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllCustomerList", null); } + + @Override + public Result getGridCount(GridCountFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getGridCount", formDTO); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java new file mode 100644 index 0000000000..3363344d1a --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/8/14 9:46 上午 + */ +public interface ModuleConstant { + + String ERROR_GOV_ORG_COUNT = "调用gov_org服务【查询客户下网格数量】失败"; + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 79c49245b6..0369274a34 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -32,6 +32,8 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CustomerDetailResultDTO; +import com.epmet.dto.result.CustomerInfoResultDTO; +import com.epmet.dto.result.GridCountResultDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; @@ -256,4 +258,25 @@ public class CustomerController { return new Result>().ok(customerService.getAllList()); } + /** + * @Description 查询客户下可以创建网格的最大数 + * @author zxc + * @date 2020/8/12 4:30 下午 + */ + @PostMapping("getgridcount") + public Result getGridCount(@RequestBody GridCountFormDTO formDTO){ + return new Result().ok(customerService.getGridCount(formDTO)); + } + + /** + * @Description 查询客户基本信息 + * @param formDTO + * @author zxc + * @date 2020/8/14 9:08 上午 + */ + @PostMapping("getcustomer") + public Result getCustomer(@RequestBody CustomerIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerService.getCustomer(formDTO)); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index dea5f2f40b..6c21743bbb 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.result.CustomerInfoResultDTO; import com.epmet.dto.result.CustomerResultDTO; +import com.epmet.dto.result.GridCountResultDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; import org.apache.ibatis.annotations.Mapper; @@ -74,4 +76,20 @@ public interface CustomerDao extends BaseDao { */ List getAllList(); + /** + * @Description 查询客户下可以创建网格的最大数 + * @param customerId + * @author zxc + * @date 2020/8/12 4:46 下午 + */ + GridCountResultDTO getGridCount(@Param("customerId")String customerId); + + /** + * @Description 根据客户Id查询客户基本信息 + * @param customerId + * @author zxc + * @date 2020/8/14 9:12 上午 + */ + CustomerInfoResultDTO selectCustomerBasicInfo(@Param("customerId")String customerId); + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java index c5c511cbed..6e56fbee35 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java @@ -88,4 +88,9 @@ public class CustomerEntity extends BaseEpmetEntity { */ private String logo; + /** + * 客户允许创建的网格数 + */ + private Integer gridNumber; + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java index 1708a19dbc..7bd1260e8d 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java @@ -76,5 +76,8 @@ public class CustomerExcel { @Excel(name = "更新时间") private Date updatedTime; + @Excel(name = "客户允许创建的网格数") + private Integer gridNumber; + } \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index b815474688..cf32a13308 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -21,13 +21,13 @@ 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.CustomerDTO; -import com.epmet.dto.form.CustomerFormDTO; -import com.epmet.dto.form.CustomerInitFormDTO; -import com.epmet.dto.form.CustomerManagerFormDTO; -import com.epmet.dto.form.PageQueryFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CustomerDetailResultDTO; +import com.epmet.dto.result.CustomerInfoResultDTO; +import com.epmet.dto.result.GridCountResultDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -174,4 +174,19 @@ public interface CustomerService extends BaseService { * @return */ List getAllList(); + + /** + * @Description 查询客户下可以创建网格的最大数 + * @author zxc + * @date 2020/8/12 4:30 下午 + */ + GridCountResultDTO getGridCount( GridCountFormDTO formDTO); + + /** + * @Description 查询客户基本信息 + * @param formDTO + * @author zxc + * @date 2020/8/14 9:08 上午 + */ + CustomerInfoResultDTO getCustomer( CustomerIdFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 219ad17f20..51364b48d9 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ModuleConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.UserWorkType; import com.epmet.dao.CustomerDao; @@ -76,6 +77,8 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -470,6 +473,8 @@ public class CustomerServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.selectGridCount(formDTO); + if (!result.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT); + } + customerInfoResultDTO.setCreateGridNum(result.getData().getGridCount()); + return customerInfoResultDTO; + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql new file mode 100644 index 0000000000..27379d7feb --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql @@ -0,0 +1,5 @@ + +ALTER TABLE `customer` +ADD COLUMN `GRID_NUMBER` int(11) NULL COMMENT '客户允许创建的网格数' AFTER `ORGANIZATION_LEVEL`; + +UPDATE customer SET GRID_NUMBER = 10; \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index a0d49c5172..33c0dd52e2 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -78,4 +78,28 @@ WHERE del_flag = '0' + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java new file mode 100644 index 0000000000..8f2d7d09b7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java @@ -0,0 +1,116 @@ +/** + * 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-08-11 + */ +@Data +public class CustomerFunctionDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 自定义业务域名 + */ + private String domainName; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 自定义排序 + */ + private Integer displayOrder; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java new file mode 100644 index 0000000000..aa54ed57bf --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 定制功能修改 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class CustomizedDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 定制功能ID + */ + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + private String shoppingStatus; + + /** + * 功能说明 + */ + private String functionExplain; + + /** + * 定制功能详情ID + */ + private String customizedId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java new file mode 100644 index 0000000000..cd924cc5c5 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java @@ -0,0 +1,106 @@ +/** + * 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-08-11 + */ +@Data +public class FunctionCustomizedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址(必须是https的请求) + */ + private String targetLink; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 业务域名 + */ + private String realmName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java new file mode 100644 index 0000000000..84d2b50095 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java @@ -0,0 +1,106 @@ +/** + * 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-08-13 + */ +@Data +public class FunctionCustomizedVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户Id + */ + private String userId; + + /** + * 所属端 居民端:resi工作端:work + */ + private String clientType; + + /** + * 功能Id + */ + private String functionId; + + /** + * 请求地址 访问的url地址 + */ + private String url; + + /** + * 结果 成功success失败error + */ + private String result; + + /** + * 原因 失败的原因(例:请求超时、404、500等) + */ + private String msg; + + /** + * 删除标识(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/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java new file mode 100644 index 0000000000..3426469343 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java @@ -0,0 +1,90 @@ +/** + * 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-08-14 + */ +@Data +public class FunctionShoppingHistoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 上下架状态 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 理由 + */ + private String reason; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java new file mode 100644 index 0000000000..a2200fdf5c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 入参为:定制功能ID + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class CommonFunctionIdFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 定制功能ID + */ + @NotBlank(message = "定制功能ID不能为空") + private String functionId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java new file mode 100644 index 0000000000..2c6e3c037a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 定制功能列表 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionCustomizedListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 功能名称 + */ + private String customizedName; + + + /** + * 所属端 + */ + private String fromApp; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0") + private Integer pageSize; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java new file mode 100644 index 0000000000..ee133cd136 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询客户定制功能列表-接口入参 + * @Author sun + */ +@Data +public class FunctionDetailFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 客户ID + */ + @NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class}) + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + @NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String clientType; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java new file mode 100644 index 0000000000..829e019fac --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询客户定制功能列表-接口入参 + * @Author sun + */ +@Data +public class FunctionVisitedFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 用户Id + */ + private String userId; + /** + * 客户Id + */ + private String customerId; + /** + * 所属端 + */ + @NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String clientType; + /** + * 功能Id + */ + @NotBlank(message = "功能Id不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String functionId; + /** + * 请求地址 + */ + @NotBlank(message = "请求地址不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String url; + /** + * 结果 + */ + @NotBlank(message = "结果不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String result; + /** + * 原因 + */ + private String msg; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java new file mode 100644 index 0000000000..20d3fd5298 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 定制功能新增 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class SaveFunctionCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能名称 + */ + @NotBlank(message = "功能名称不能为空") + private String functionName; + + /** + * 功能类型:0.默认功能,1.定制功能 + */ + @NotBlank(message = "功能类型:0.默认功能,1.定制功能不能为空") + private String functionGroup; + + /** + * 功能说明 + */ + @NotBlank(message = "功能说明不能为空") + private String functionExplain; + + /** + * 默认大图标 + */ + @NotBlank(message = "默认大图标不能为空") + private String iconLargeImg; + + /** + * 默认小图标 + */ + @NotBlank(message = "默认小图标不能为空") + private String iconSmallImg; + + /** + * 外链地址 + */ + @NotBlank(message = "外链地址不能为空") + private String targetLink; + + /** + * 上架状态:0:下架、1:上架 + */ + @NotBlank(message = "上架状态:0:下架、1:上架不能为空") + private String shoppingStatus; + + /** + * 业务域名(https;//... 无端口号) + */ + @NotBlank(message = "业务域名(https;//... 无端口号)不能为空") + private String domainName; + + /** + * 来源app(工作端:gov、居民端:resi) + */ + @NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空") + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java new file mode 100644 index 0000000000..83800e2af5 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class UpdateCustomerFunctionFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class}) + private String functionId; + + /** + * 自定义功能名称 + */ + @NotBlank(message = "自定义功能名称不能为空", groups = {AddUserShowGroup.class}) + private String functionName; + + /** + * 自定义大图标 + */ + @NotBlank(message = "自定义大图标不能为空", groups = {AddUserShowGroup.class}) + private String iconLargeImg; + + /** + * 自定义小图标 + */ + @NotBlank(message = "自定义小图标不能为空", groups = {AddUserShowGroup.class}) + private String iconSmallImg; + + private String userId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java new file mode 100644 index 0000000000..5deee63b26 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 定制功能修改 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class UpdateCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 定制功能ID + */ + @NotBlank(message = "定制功能ID不能为空") + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + @NotBlank(message = "上架状态:0:下架、1:上架不能为空") + private String shoppingStatus; + + /** + * 功能说明 + */ + @NotBlank(message = "功能说明不能为空") + private String functionExplain; + + /** + * 默认名称 + */ + @NotBlank(message = "默认名称不能为空") + private String customizedName; + + /** + * 默认大图标 + */ + @NotBlank(message = "默认大图标不能为空") + private String iconLargeImg; + + /** + * 默认小图标 + */ + @NotBlank(message = "默认小图标不能为空") + private String iconSmallImg; + + + /** + * 外链地址 + */ + @NotBlank(message = "外链地址不能为空") + private String targetLink; + + /** + * 业务域名 + */ + @NotBlank(message = "业务域名不能为空") + private String domainName; + + /** + * 来源app(工作端:gov、居民端:resi) + */ + @NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空") + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java new file mode 100644 index 0000000000..2a27cfbc18 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改客户定制功能上下架 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class UpdateShoppingStatusFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class}) + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + @NotBlank(message = "上架状态:0:下架、1:上架不能为空", groups = {AddUserShowGroup.class}) + private String shoppingStatus; + + /** + * 理由 + */ + @NotBlank(message = "上下架理由不能为空", groups = {AddUserShowGroup.class}) + private String reason; + + private String userId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java new file mode 100644 index 0000000000..b9f30936f9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 定制功能详情 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class FunctionCustomizedDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + private String shoppingStatus; + + /** + * 功能说明 + */ + private String functionExplain; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(工作端:gov、居民端:resi) + */ + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java new file mode 100644 index 0000000000..85faedd828 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 定制功能列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionCustomizedListDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + private String shoppingStatus; + + /** + * 功能说明 + */ + private String functionExplain; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java new file mode 100644 index 0000000000..fc44d76d1a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 定制功能列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionCustomizedListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 列表总条数 + */ + private Integer total; + + /** + * 列表内容 + */ + private List listDTOS; + + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java new file mode 100644 index 0000000000..debdfc6016 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * 查询客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class FunctionDetailResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 请求地址(https://+业务域名+外链地址) + */ + private String url; + + /** + * 自定义排序 + */ + private String dispalyOrder; + + /** + * 自定义json(目前是空值) + */ + private ArrayList customerParameter; +} diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 21d31ea187..b24d1e6910 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.26 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.27 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index d6ce7700ad..6951a3f92d 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.26 + 0.3.27 com.epmet oper-customize diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java new file mode 100644 index 0000000000..2c174d1c24 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -0,0 +1,158 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.CustomerFunctionDetailDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; +import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.excel.CustomerFunctionDetailExcel; +import com.epmet.service.CustomerFunctionDetailService; +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-08-11 + */ +@RestController +@RequestMapping("customerfunctiondetail") +public class CustomerFunctionDetailController { + + @Autowired + private CustomerFunctionDetailService customerFunctionDetailService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerFunctionDetailService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerFunctionDetailDTO data = customerFunctionDetailService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerFunctionDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerFunctionDetailService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerFunctionDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerFunctionDetailService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerFunctionDetailService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerFunctionDetailService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionDetailExcel.class); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-获取客户定制功能列表 + **/ + @PostMapping("resifunctiondetaillist") + public Result> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class); + return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-获取客户定制功能列表 + **/ + @PostMapping("workfunctiondetaillist") + public Result> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + } + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + @PostMapping("updateshoppingstatus") + public Result updateShoppingStatus(@LoginUser TokenDto tokenDto, @RequestBody UpdateShoppingStatusFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateShoppingStatusFormDTO.AddUserInternalGroup.class, UpdateShoppingStatusFormDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + return customerFunctionDetailService.updateShoppingStatus(formDTO); + } + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + @PostMapping("updatecustomerfunction") + public Result updateCustomerFunction(@LoginUser TokenDto tokenDto, @RequestBody UpdateCustomerFunctionFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateCustomerFunctionFormDTO.AddUserInternalGroup.class, UpdateCustomerFunctionFormDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + return customerFunctionDetailService.updateCustomerFunction(formDTO); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java new file mode 100644 index 0000000000..1df9d0e568 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -0,0 +1,177 @@ +/** + * 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.FunctionCustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.FunctionCustomizedListFormDTO; +import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.form.UpdateCustomizedFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListResultDTO; +import com.epmet.excel.FunctionCustomizedExcel; +import com.epmet.service.FunctionCustomizedService; +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-08-11 + */ +@RestController +@RequestMapping("functioncustomized") +public class FunctionCustomizedController { + + @Autowired + private FunctionCustomizedService functionCustomizedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = functionCustomizedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionCustomizedDTO data = functionCustomizedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody FunctionCustomizedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionCustomizedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody FunctionCustomizedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + functionCustomizedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + functionCustomizedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = functionCustomizedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedExcel.class); + } + + /** + * 定制功能新增(功能表、定制功能表) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:54 2020-08-13 + **/ + @PostMapping("savefunctioncustomized") + public Result saveFunctionCustomized(@RequestBody SaveFunctionCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + functionCustomizedService.saveFunctionCustomized(formDTO); + return new Result(); + } + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + @PostMapping("getfunctioncustomized") + public Result getFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.getFunctionCustomized(formDTO); + } + + /** + * 定制功能删除 + * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * 当功能 有客户在使用时,返回code: 8000 + * msg: 功能正在使用中,不允许删除! + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:03 2020-08-13 + **/ + @PostMapping("deletefunctioncustomized") + public Result deleteFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.deleteFunctionCustomized(formDTO); + } + + /** + * 定制功能修改 + * 有客户在使用该功能时则不允许修改上下架状态、业务域名和外链地址、所属端app, + * 只能修改功能名称和大小图标 + * 修改的要判断是否有客户在使用,有用的要批量更新已使用客户数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:52 2020-08-13 + **/ + @PostMapping("updatecustomized") + public Result updateCustomized(@RequestBody UpdateCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.updateCustomized(formDTO); + } + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + @PostMapping("functioncustomizedlist") + public Result functionCustomizedList(@RequestBody FunctionCustomizedListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.functionCustomizedList(formDTO); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java new file mode 100644 index 0000000000..faea8de9e9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java @@ -0,0 +1,128 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.excel.FunctionCustomizedVisitedExcel; +import com.epmet.service.FunctionCustomizedVisitedService; +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-08-13 + */ +@RestController +@RequestMapping("functioncustomizedvisited") +public class FunctionCustomizedVisitedController { + + @Autowired + private FunctionCustomizedVisitedService functionCustomizedVisitedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = functionCustomizedVisitedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionCustomizedVisitedDTO data = functionCustomizedVisitedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody FunctionCustomizedVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionCustomizedVisitedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody FunctionCustomizedVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + functionCustomizedVisitedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + functionCustomizedVisitedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = functionCustomizedVisitedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedVisitedExcel.class); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-保存定制功能访问记录 + **/ + @PostMapping("saveresifunctionvisited") + public Result saveResiFunctionVisited(@LoginUser TokenDto tokenDto, @RequestBody FunctionVisitedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionVisitedFromDTO.AddUserInternalGroup.class, FunctionVisitedFromDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + functionCustomizedVisitedService.saveFunctionVisited(formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-保存定制功能访问记录 + **/ + @PostMapping("saveworkfunctionvisited") + public Result> saveWorkFunctionVisited(@LoginUser TokenDto tokenDto, @RequestBody FunctionVisitedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionVisitedFromDTO.AddUserInternalGroup.class, FunctionVisitedFromDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + functionCustomizedVisitedService.saveFunctionVisited(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java new file mode 100644 index 0000000000..51e1c62815 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.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.FunctionShoppingHistoryDTO; +import com.epmet.excel.FunctionShoppingHistoryExcel; +import com.epmet.service.FunctionShoppingHistoryService; +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-08-14 + */ +@RestController +@RequestMapping("functionshoppinghistory") +public class FunctionShoppingHistoryController { + + @Autowired + private FunctionShoppingHistoryService functionShoppingHistoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = functionShoppingHistoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionShoppingHistoryDTO data = functionShoppingHistoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody FunctionShoppingHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionShoppingHistoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody FunctionShoppingHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + functionShoppingHistoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + functionShoppingHistoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = functionShoppingHistoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionShoppingHistoryExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java new file mode 100644 index 0000000000..7ee1a99567 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -0,0 +1,79 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; +import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Mapper +public interface CustomerFunctionDetailDao extends BaseDao { + + /** + * 根据functionId查询使用该功能的,客户id: customizedId + * 可用来判断该功能,是否有客户在使用 + * + * @param functionId + * @return java.util.List + * @Author zhangyong + * @Date 11:14 2020-08-13 + **/ + List selectCustomerIdByFunctionId(@Param("functionId") String functionId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据所属端和客户Id查询客户定制功能列表 + **/ + List selectFunctionDetailList(FunctionDetailFromDTO formDTO); + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param formDTO + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + void updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO); + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param formDTO + * @Author zhangyong + * @Date 10:00 2020-08-17 + **/ + void updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java new file mode 100644 index 0000000000..34b32e48f1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.FunctionCustomizedListFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListDTO; +import com.epmet.entity.FunctionCustomizedEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Mapper +public interface FunctionCustomizedDao extends BaseDao { + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.dto.result.FunctionCustomizedDetailResultDTO + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + FunctionCustomizedDetailResultDTO getFunctionCustomizedByFunctionId(CommonFunctionIdFormDTO formDTO); + + /** + * 根据functionId, 对定制功能表,进行逻辑删除 + * + * @param functionId + * @return void + * @Author zhangyong + * @Date 13:31 2020-08-13 + **/ + void delByFunctionId(@Param("functionId") String functionId); + + /** + * 根据功能id,查询定制功能全部信息(定制功能表+功能表) + * @param functionId + * @return com.epmet.dto.CustomizedDTO + * @Author zhangyong + * @Date 16:21 2020-08-13 + **/ + CustomizedDTO selectCustomized(@Param("functionId") String functionId); + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return java.lang.util + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + List selectListFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 定制功能列表 - 总数 + * + * @param formDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 10:10 2020-08-14 + **/ + Integer countTotalFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 根据功能id,修改定制功能表 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 13:26 2020-08-14 + **/ + void updateFunctionCustomized(FunctionCustomizedEntity entity); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java new file mode 100644 index 0000000000..471724a387 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.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.FunctionCustomizedVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Mapper +public interface FunctionCustomizedVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java new file mode 100644 index 0000000000..674482045f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.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.FunctionShoppingHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Mapper +public interface FunctionShoppingHistoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java new file mode 100644 index 0000000000..53931cb040 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java @@ -0,0 +1,86 @@ +/** + * 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-08-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_function_detail") +public class CustomerFunctionDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 自定义业务域名 + */ + private String domainName; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 自定义排序 + */ + private Integer displayOrder; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java new file mode 100644 index 0000000000..45983b12b0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java @@ -0,0 +1,76 @@ +/** + * 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-08-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_customized") +public class FunctionCustomizedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址(必须是https的请求) + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java new file mode 100644 index 0000000000..6e9dfb53cd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java @@ -0,0 +1,76 @@ +/** + * 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-08-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_customized_visited") +public class FunctionCustomizedVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户Id + */ + private String userId; + + /** + * 所属端 居民端:resi工作端:work + */ + private String clientType; + + /** + * 功能Id + */ + private String functionId; + + /** + * 请求地址 访问的url地址 + */ + private String url; + + /** + * 结果 成功success失败error + */ + private String result; + + /** + * 原因 失败的原因(例:请求超时、404、500等) + */ + private String msg; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java new file mode 100644 index 0000000000..6d8f479bac --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java @@ -0,0 +1,61 @@ +/** + * 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-08-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_shopping_history") +public class FunctionShoppingHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 上下架状态 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 理由 + */ + private String reason; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java new file mode 100644 index 0000000000..13c88668e8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java @@ -0,0 +1,83 @@ +/** + * 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-08-11 + */ +@Data +public class CustomerFunctionDetailExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "自定义功能名称") + private String functionName; + + @Excel(name = "自定义大图标") + private String iconLargeImg; + + @Excel(name = "自定义小图标") + private String iconSmallImg; + + @Excel(name = "自定义业务域名") + private String realmName; + + @Excel(name = "外链地址") + private String targetLink; + + @Excel(name = "自定义排序") + private Integer shoppingStatus; + + @Excel(name = "自定义排序") + private Integer displayOrder; + + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java new file mode 100644 index 0000000000..786705a763 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java @@ -0,0 +1,77 @@ +/** + * 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-08-11 + */ +@Data +public class FunctionCustomizedExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "功能ID(function.ID)") + private String functionId; + + @Excel(name = "默认名称") + private String customizedName; + + @Excel(name = "默认大图标") + private String iconLargeImg; + + @Excel(name = "默认小图标") + private String iconSmallImg; + + @Excel(name = "外链地址(必须是https的请求)") + private String targetLink; + + @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; + + @Excel(name = "业务域名") + private String realmName; + + @Excel(name = "来源app(政府端:gov、居民端:resi)") + private String fromApp; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java new file mode 100644 index 0000000000..6d631d8380 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java @@ -0,0 +1,77 @@ +/** + * 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-08-13 + */ +@Data +public class FunctionCustomizedVisitedExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "用户Id") + private String userId; + + @Excel(name = "所属端 居民端:resi工作端:work") + private String clientType; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "请求地址 访问的url地址") + private String url; + + @Excel(name = "结果 成功success失败error") + private String result; + + @Excel(name = "原因 失败的原因(例:请求超时、404、500等)") + private String msg; + + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java new file mode 100644 index 0000000000..a99dfed1f6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java @@ -0,0 +1,65 @@ +/** + * 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-08-14 + */ +@Data +public class FunctionShoppingHistoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "上下架状态 上架状态:0:下架、1:上架") + private Integer shoppingStatus; + + @Excel(name = "理由") + private String reason; + + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java new file mode 100644 index 0000000000..c60f3b338f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.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-08-11 + */ +@Component +public class CustomerFunctionDetailRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java new file mode 100644 index 0000000000..f2854b11ef --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.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-08-11 + */ +@Component +public class FunctionCustomizedRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java new file mode 100644 index 0000000000..fabdc63ff3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.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-08-13 + */ +@Component +public class FunctionCustomizedVisitedRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java new file mode 100644 index 0000000000..ebe8a91096 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.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-08-14 + */ +@Component +public class FunctionShoppingHistoryRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java new file mode 100644 index 0000000000..3dc099b9ca --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -0,0 +1,130 @@ +/** + * 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.commons.tools.utils.Result; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; +import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +public interface CustomerFunctionDetailService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerFunctionDetailDTO + * @author generator + * @date 2020-08-11 + */ + CustomerFunctionDetailDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void save(CustomerFunctionDetailDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void update(CustomerFunctionDetailDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-11 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据所属端和客户Id查询客户定制功能列表 + **/ + List resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO); + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + Result updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO); + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:00 2020-08-17 + **/ + Result updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java new file mode 100644 index 0000000000..178c2d439b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -0,0 +1,156 @@ +/** + * 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.commons.tools.utils.Result; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.FunctionCustomizedListFormDTO; +import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.form.UpdateCustomizedFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListResultDTO; +import com.epmet.entity.FunctionCustomizedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +public interface FunctionCustomizedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionCustomizedDTO + * @author generator + * @date 2020-08-11 + */ + FunctionCustomizedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void save(FunctionCustomizedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void update(FunctionCustomizedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-11 + */ + void delete(String[] ids); + + /** + * 定制功能新增(功能表、定制功能表) + * + * @param formDTO + * @Author zhangyong + * @Date 09:54 2020-08-13 + **/ + void saveFunctionCustomized(SaveFunctionCustomizedFormDTO formDTO); + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + Result getFunctionCustomized(CommonFunctionIdFormDTO formDTO); + + /** + * 定制功能删除 + * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:03 2020-08-13 + **/ + Result deleteFunctionCustomized(CommonFunctionIdFormDTO formDTO); + + /** + * 定制功能修改 + * 有客户在使用该功能时则不允许修改上下架状态、业务域名和外链地址、所属端app, + * 只能修改功能名称和大小图标 + * 修改的要判断是否有客户在使用,有用的要批量更新已使用客户数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:52 2020-08-13 + **/ + Result updateCustomized(UpdateCustomizedFormDTO formDTO); + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + Result functionCustomizedList(FunctionCustomizedListFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java new file mode 100644 index 0000000000..a87e756c02 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; +import com.epmet.entity.FunctionCustomizedVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +public interface FunctionCustomizedVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionCustomizedVisitedDTO + * @author generator + * @date 2020-08-13 + */ + FunctionCustomizedVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-13 + */ + void save(FunctionCustomizedVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-13 + */ + void update(FunctionCustomizedVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-13 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 保存定制功能访问记录 + **/ + void saveFunctionVisited(FunctionVisitedFromDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java new file mode 100644 index 0000000000..33f6d6ead6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.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.FunctionShoppingHistoryDTO; +import com.epmet.entity.FunctionShoppingHistoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +public interface FunctionShoppingHistoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionShoppingHistoryDTO + * @author generator + * @date 2020-08-14 + */ + FunctionShoppingHistoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-14 + */ + void save(FunctionShoppingHistoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-14 + */ + void update(FunctionShoppingHistoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-14 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java new file mode 100644 index 0000000000..faa4fa72df --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -0,0 +1,149 @@ +/** + * 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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerFunctionDetailDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.FunctionShoppingHistoryDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; +import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; +import com.epmet.redis.CustomerFunctionDetailRedis; +import com.epmet.service.CustomerFunctionDetailService; +import com.epmet.service.FunctionShoppingHistoryService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +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-08-11 + */ +@Service +public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl implements CustomerFunctionDetailService { + + private Logger logger = LogManager.getLogger(CustomerFunctionDetailServiceImpl.class); + @Autowired + private CustomerFunctionDetailRedis customerFunctionDetailRedis; + + @Autowired + private FunctionShoppingHistoryService functionShoppingHistoryService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFunctionDetailDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDetailDTO.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 CustomerFunctionDetailDTO get(String id) { + CustomerFunctionDetailEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFunctionDetailDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFunctionDetailDTO dto) { + CustomerFunctionDetailEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionDetailEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFunctionDetailDTO dto) { + CustomerFunctionDetailEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionDetailEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据所属端和客户Id查询客户定制功能列表 + **/ + @Override + public List resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) { + //根据客户Id和所属端查询客户定制功能列表数据 + logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); + List list = baseDao.selectFunctionDetailList(formDTO); + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO) { + // 修改 客户定制功能详情表,上下架状态 + baseDao.updateShoppingStatus(formDTO); + // 保存日志记录到 客户定制功能上下架历史表 + FunctionShoppingHistoryDTO historyDTO = ConvertUtils.sourceToTarget(formDTO, FunctionShoppingHistoryDTO.class); + historyDTO.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + functionShoppingHistoryService.save(historyDTO); + return new Result(); + } + + @Override + public Result updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO) { + baseDao.updateCustomerFunction(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java new file mode 100644 index 0000000000..59ac2895c5 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -0,0 +1,311 @@ +/** + * 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerFunctionDetailDao; +import com.epmet.dao.FunctionCustomizedDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.CustomizedDTO; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.FunctionCustomizedListFormDTO; +import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.form.UpdateCustomizedFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; +import com.epmet.entity.FunctionCustomizedEntity; +import com.epmet.entity.FunctionEntity; +import com.epmet.redis.FunctionCustomizedRedis; +import com.epmet.service.CustomerFunctionDetailService; +import com.epmet.service.FunctionCustomizedService; +import com.epmet.service.FunctionService; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Service +public class FunctionCustomizedServiceImpl extends BaseServiceImpl implements FunctionCustomizedService { + + @Autowired + private FunctionCustomizedRedis functionCustomizedRedis; + @Autowired + private FunctionService functionService; + @Autowired + private CustomerFunctionDetailDao customerFunctionDetailDao; + @Autowired + private CustomerFunctionDetailService customerFunctionDetailService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionCustomizedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionCustomizedDTO.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 FunctionCustomizedDTO get(String id) { + FunctionCustomizedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionCustomizedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionCustomizedDTO dto) { + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionCustomizedDTO dto) { + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveFunctionCustomized(SaveFunctionCustomizedFormDTO formDTO) { + // 1、定制功能新增,保存数据到 功能表 + FunctionEntity functionEntity = this.saveFunction(formDTO); + // 2、定制功能新增,保存数据到 定制功能表 + FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); + entity.setFunctionId(functionEntity.getId()); + entity.setCustomizedName(formDTO.getFunctionName()); + entity.setIconLargeImg(formDTO.getIconLargeImg()); + entity.setIconSmallImg(formDTO.getIconSmallImg()); + entity.setTargetLink(formDTO.getTargetLink()); + entity.setDomainName(formDTO.getDomainName()); + entity.setFromApp(formDTO.getFromApp()); + insert(entity); + } + + @Override + public Result getFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + FunctionCustomizedDetailResultDTO resultDTO = baseDao.getFunctionCustomizedByFunctionId(formDTO); + return new Result().ok(resultDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result deleteFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + // 1.客户定制功能详情表 ,没查到就是没人在使用 + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + if (customizedId != null && customizedId.size() > NumConstant.ZERO){ + return new Result<>().error(8000, "功能正在使用中,不允许删除!"); + } else { + // 2.单条逻辑删除 - 功能表 + String[] ids = new String[1]; + ids[0] = formDTO.getFunctionId(); + functionService.delete(ids); + // 3.单条逻辑删除 - 定制功能表 + baseDao.delByFunctionId(formDTO.getFunctionId()); + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result updateCustomized(UpdateCustomizedFormDTO formDTO) { + // 1. 客户定制功能详情表 ,没查到就是没人在使用 + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + if (customizedId != null && customizedId.size() > NumConstant.ZERO){ + // 2.1 根据功能id,查询功能的详细信息 + CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); + // 该集合,统一修改 客户定制功能详情表 + List upCustomizedInfo = new ArrayList<>(); + // 统一提示 不能进行修改的客户id + StringBuilder tipCustomizedInfoUserId = new StringBuilder(); + + // 如果这个功能,被客户重新定义了,则不会修改 + for (int i = 0; i < customizedId.size(); i++){ + if (null != customizedDTO){ + // 3.1 功能信息和客户信息:判断这个功能,用户使用的是默认的,还是自定义的 + if (customizedDTO.getCustomizedName().equals(customizedId.get(i).getFunctionName()) + && customizedDTO.getIconLargeImg().equals(customizedId.get(i).getIconLargeImg()) + && customizedDTO.getIconSmallImg().equals(customizedId.get(i).getIconSmallImg()) + && customizedDTO.getDomainName().equals(customizedId.get(i).getDomainName()) + && customizedDTO.getTargetLink().equals(customizedId.get(i).getTargetLink()) ){ + // 这个功能,客户使用的是默认的,则判断本次修改的字段,如果是功能名称和大小图标,则批量更新客户数据,负责提示 不能修改 + if (!formDTO.getShoppingStatus().equals(customizedDTO.getShoppingStatus()) + || !formDTO.getFunctionExplain().equals(customizedDTO.getFunctionExplain()) + || !formDTO.getTargetLink().equals(customizedDTO.getTargetLink()) + || !formDTO.getDomainName().equals(customizedDTO.getDomainName()) + || !formDTO.getFromApp().equals(customizedDTO.getFromApp()) ){ + // 4.1 如果修改的内容是其他字段,则返回语句 + tipCustomizedInfoUserId.append(customizedId.get(i).getId() + ","); + } else if (!formDTO.getCustomizedName().equals(customizedDTO.getCustomizedName()) + || !formDTO.getIconLargeImg().equals(customizedDTO.getIconLargeImg()) + || !formDTO.getIconSmallImg().equals(customizedDTO.getIconSmallImg())){ + // 4.2 如果修改的内容只是:功能名称和大小图标,, 需要批量更新客户数据 + CustomerFunctionDetailEntity customer = new CustomerFunctionDetailEntity(); + customer.setFunctionName(formDTO.getCustomizedName()); + customer.setIconLargeImg(formDTO.getIconLargeImg()); + customer.setIconSmallImg(formDTO.getIconSmallImg()); + customer.setId(customizedId.get(i).getId()); + upCustomizedInfo.add(customer); + } + } + // 3.2 用户使用的是自定义的功能,则不予处理 + } + } + if (upCustomizedInfo != null && upCustomizedInfo.size() > NumConstant.ZERO){ + // 5.1 修改 客户定制功能详情表 + customerFunctionDetailService.updateBatchById(upCustomizedInfo); + // 6. 客户正在使用该功能,根据入参参数,修改功能表、定制功能表 + this.functionInUse(formDTO); + } + // 5.2 提示哪些用户不能被修改 + if (tipCustomizedInfoUserId != null && tipCustomizedInfoUserId.length() >NumConstant.ZERO){ + return new Result<>().error(8000, "客户"+ tipCustomizedInfoUserId +"正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); + } + } else { + // 2.2 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表 + this.functionNotUsed(formDTO); + } + return new Result(); + } + + @Override + public Result functionCustomizedList(FunctionCustomizedListFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + FunctionCustomizedListResultDTO resultDTO = new FunctionCustomizedListResultDTO(); + resultDTO.setListDTOS(baseDao.selectListFunctionCustomizedList(formDTO)); + resultDTO.setTotal(baseDao.countTotalFunctionCustomizedList(formDTO)); + return new Result().ok(resultDTO); + } + + /** + * 保存数据到 功能表 + * @param formDTO + * @return com.epmet.entity.FunctionEntity + * @Author zhangyong + * @Date 10:03 2020-08-13 + **/ + private FunctionEntity saveFunction(SaveFunctionCustomizedFormDTO formDTO){ + FunctionEntity entity = new FunctionEntity(); + entity.setFunctionName(formDTO.getFunctionName()); + entity.setFunctionIcon(formDTO.getIconLargeImg()); + entity.setFunctionGroup(Integer.valueOf(formDTO.getFunctionGroup())); + entity.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + entity.setFunctionExplain(formDTO.getFunctionExplain()); + functionService.insert(entity); + return entity; + } + + /** + * 修改数据到 功能表 + * @param formDTO + * @param flag == 0 只修改图标和名称 + * == 1 修改全部字段 + * @Author zhangyong + * @Date 10:03 2020-08-13 + **/ + private void upFunction(UpdateCustomizedFormDTO formDTO, Integer flag){ + FunctionEntity entity = new FunctionEntity(); + entity.setId(formDTO.getFunctionId()); + entity.setFunctionName(formDTO.getCustomizedName()); + entity.setFunctionIcon(formDTO.getIconLargeImg()); + if (NumConstant.ONE == flag){ + entity.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + entity.setFunctionExplain(formDTO.getFunctionExplain()); + } + functionService.updateById(entity); + } + + /** + * 客户未使用该功能,根据入参参数,修改功能表、定制功能表 + * @param formDTO + * @return void + * @Author zhangyong + * @Date 11:08 2020-08-14 + **/ + private void functionNotUsed(UpdateCustomizedFormDTO formDTO){ + // 1.修改 功能表, 修改的字段范围,是所有入参字段 + this.upFunction(formDTO, NumConstant.ONE); + // 2.修改 定制功能表, 修改的字段范围,是所有入参字段 + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); + baseDao.updateFunctionCustomized(entity); + } + + /** + * 客户正在使用该功能,根据入参参数,修改功能表、定制功能表 + * @param formDTO + * @return void + * @Author zhangyong + * @Date 14:00 2020-08-14 + **/ + private void functionInUse(UpdateCustomizedFormDTO formDTO){ + // 1.修改 功能表, 修改的字段范围,是:功能名称和大小图标 + this.upFunction(formDTO, NumConstant.ZERO); + + // 2.修改 定制功能表, 修改的字段范围,是:功能名称和大小图标 + FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); + entity.setFunctionId(formDTO.getFunctionId()); + entity.setCustomizedName(formDTO.getCustomizedName()); + entity.setIconLargeImg(formDTO.getIconLargeImg()); + entity.setIconSmallImg(formDTO.getIconSmallImg()); + baseDao.updateFunctionCustomized(entity); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java new file mode 100644 index 0000000000..481bb68736 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java @@ -0,0 +1,118 @@ +/** + * 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.FunctionCustomizedVisitedDao; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; +import com.epmet.entity.FunctionCustomizedVisitedEntity; +import com.epmet.redis.FunctionCustomizedVisitedRedis; +import com.epmet.service.FunctionCustomizedVisitedService; +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-08-13 + */ +@Service +public class FunctionCustomizedVisitedServiceImpl extends BaseServiceImpl implements FunctionCustomizedVisitedService { + + @Autowired + private FunctionCustomizedVisitedRedis functionCustomizedVisitedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionCustomizedVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionCustomizedVisitedDTO.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 FunctionCustomizedVisitedDTO get(String id) { + FunctionCustomizedVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionCustomizedVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionCustomizedVisitedDTO dto) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionCustomizedVisitedDTO dto) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 保存定制功能访问记录 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveFunctionVisited(FunctionVisitedFromDTO formDTO) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedVisitedEntity.class); + insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java new file mode 100644 index 0000000000..acd0aed260 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.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.FunctionShoppingHistoryDao; +import com.epmet.dto.FunctionShoppingHistoryDTO; +import com.epmet.entity.FunctionShoppingHistoryEntity; +import com.epmet.redis.FunctionShoppingHistoryRedis; +import com.epmet.service.FunctionShoppingHistoryService; +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-08-14 + */ +@Service +public class FunctionShoppingHistoryServiceImpl extends BaseServiceImpl implements FunctionShoppingHistoryService { + + @Autowired + private FunctionShoppingHistoryRedis functionShoppingHistoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionShoppingHistoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionShoppingHistoryDTO.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 FunctionShoppingHistoryDTO get(String id) { + FunctionShoppingHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionShoppingHistoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionShoppingHistoryDTO dto) { + FunctionShoppingHistoryEntity entity = ConvertUtils.sourceToTarget(dto, FunctionShoppingHistoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionShoppingHistoryDTO dto) { + FunctionShoppingHistoryEntity entity = ConvertUtils.sourceToTarget(dto, FunctionShoppingHistoryEntity.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/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql new file mode 100644 index 0000000000..5e61ca48a2 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -0,0 +1,63 @@ +DROP TABLE IF EXISTS `customer_function_detail`; +CREATE TABLE `customer_function_detail` ( + `ID` varchar(64) NOT NULL COMMENT ''主键'', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT ''客户Id'', + `FUNCTION_ID` varchar(64) NOT NULL COMMENT ''功能Id'', + `FUNCTION_NAME` varchar(128) NOT NULL COMMENT ''自定义功能名称'', + `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT ''自定义大图标'', + `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT ''自定义小图标'', + `DOMAIN_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名'', + `TARGET_LINK` varchar(128) NOT NULL COMMENT ''外链地址'', + `SHOPPING_STATUS` int(11) NOT NULL COMMENT ''上架状态(0.下架 1.上架)'', + `DISPLAY_ORDER` int(11) NOT NULL COMMENT ''自定义排序'', + `DEL_FLAG` int(11) NOT NULL COMMENT ''删除标识(0.未删除 1.已删除)'', + `REVISION` int(11) NOT NULL COMMENT ''乐观锁'', + `CREATED_BY` varchar(32) NOT NULL COMMENT ''创建人'', + `CREATED_TIME` datetime NOT NULL COMMENT ''创建时间'', + `UPDATED_BY` varchar(32) NOT NULL COMMENT ''更新人'', + `UPDATED_TIME` datetime NOT NULL COMMENT ''更新时间'', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=''客户定制功能详情表''; + + + +ALTER TABLE `function_customized` ADD COLUMN `DOMAIN_NAME` VARCHAR (128) CHARACTER +SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名' AFTER `UPDATED_TIME`, + ADD COLUMN `FROM_APP` VARCHAR (32) CHARACTER +SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `REALM_NAME`; + + +DROP TABLE IF EXISTS `function_customized_visited`; +CREATE TABLE function_customized_visited( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(32) NOT NULL COMMENT '客户ID' , + USER_ID VARCHAR(64) NOT NULL COMMENT '用户Id' , + CLIENT_TYPE VARCHAR(32) NOT NULL COMMENT '所属端 居民端:resi工作端:work' , + FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , + URL VARCHAR(128) NOT NULL COMMENT '请求地址 访问的url地址' , + RESULT VARCHAR(1024) NOT NULL COMMENT '结果 成功success失败error' , + MSG VARCHAR(128) NOT NULL COMMENT '原因 失败的原因(例:请求超时、404、500等)' , + DEL_FLAG INT NOT NULL COMMENT '删除标识(0.未删除 1.已删除)' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果'; + + +DROP TABLE IF EXISTS `function_shopping_history`; +CREATE TABLE function_shopping_history( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户Id' , + FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , + SHOPPING_STATUS INT NOT NULL COMMENT '上下架状态 上架状态:0:下架、1:上架' , + REASON VARCHAR(1024) NOT NULL COMMENT '理由' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '客户定制功能上下架历史'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql new file mode 100644 index 0000000000..73725ab557 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql @@ -0,0 +1 @@ +ALTER TABLE function_shopping_history ADD ( DEL_FLAG INT ( 11 ) NOT NULL COMMENT '删除标识(0.未删除 1.已删除)'); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml new file mode 100644 index 0000000000..f215a0d80e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + UPDATE customer_function_detail + SET + SHOPPING_STATUS = #{shoppingStatus}, + UPDATED_BY = #{userId}, + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND FUNCTION_ID = #{functionId} + + + + UPDATE customer_function_detail + SET + + FUNCTION_NAME = #{functionName}, + + + ICON_LARGE_IMG = #{iconLargeImg}, + + + ICON_SMALL_IMG = #{iconSmallImg}, + + UPDATED_BY = #{userId}, + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND FUNCTION_ID = #{functionId} + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml new file mode 100644 index 0000000000..f862114288 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -0,0 +1,117 @@ + + + + + + + + + update function_customized set DEL_FLAG = 1 where FUNCTION_ID = #{functionId} and DEL_FLAG = '0' + + + + + + + + + + + + + UPDATE function_customized + SET + + CUSTOMIZED_NAME = #{customizedName}, + + + ICON_LARGE_IMG = #{iconLargeImg}, + + + ICON_SMALL_IMG = #{iconSmallImg}, + + + TARGET_LINK = #{targetLink}, + + + DOMAIN_NAME = #{domainName}, + + + FROM_APP = #{fromApp}, + + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND FUNCTION_ID = #{functionId} + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml new file mode 100644 index 0000000000..938b189b2b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml new file mode 100644 index 0000000000..a591988091 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index dd7611267b..2f4b8d2ff8 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -42,6 +42,7 @@ epmet-third epmet-heart epmet-point + epmet-ext diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java index 35e6963377..f60ac86651 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java @@ -53,6 +53,11 @@ public class ResiTopicDTO implements Serializable { */ private String status; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + /** * 省 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java index 58853940ce..47ca98ae7b 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.resi.group.dto.topic.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -25,6 +26,9 @@ public class ResiTopicOperationFormDTO implements Serializable { */ private String operateReason; - + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; } diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index 44921cae4f..29a259a5d2 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.64 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.66 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 1e66ca7900..eaef30f6e7 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.64 + 0.3.66 com.epmet resi-group diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 881374f12c..dacfd6dbb8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -59,6 +59,7 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.dto.UserRoleDTO; import com.epmet.resi.group.dto.group.*; import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.form.GridIdFormDTO; import com.epmet.resi.group.dto.group.form.ShouldVoteCountFormDTO; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java index d16ba57c73..1214e5d71a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java @@ -53,6 +53,11 @@ public class ResiTopicEntity extends BaseEpmetEntity { */ private String status; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + /** * 省 */ diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 958b1b4424..1a5d8964a3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -523,6 +523,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl id = new ArrayList<>(); id.add(closeFormDTO.getTopicId()); baseDao.cancelHiddenOrCloseBatch(id,tokenDto.getUserId(),TopicConstant.CLOSED); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql new file mode 100644 index 0000000000..c087db0c7d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql @@ -0,0 +1 @@ +ALTER TABLE resi_topic ADD COLUMN CLOSED_STATUS varchar(32) NULL COMMENT '关闭状态:已解决 resolved,未解决 unresolved' AFTER STATUS; \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java new file mode 100644 index 0000000000..de8c542864 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 1:36 下午 + */ +@Data +public class UserIdsFormDTO implements Serializable { + + private static final long serialVersionUID = -6168528618954442905L; + + private List userIds; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java new file mode 100644 index 0000000000..c6424eca94 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jdk.nashorn.internal.ir.annotations.Ignore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:30 上午 + */ +@Data +public class RoleResultDTO implements Serializable { + + private static final long serialVersionUID = -432136606721817459L; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 用户id + */ + @JsonIgnore + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java new file mode 100644 index 0000000000..93b650d538 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/17 9:25 上午 + */ +@Data +public class StaffSinAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415906710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java new file mode 100644 index 0000000000..3827b2ea17 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:25 上午 + */ +@Data +public class StaffSinGridResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415466710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 8ea872a683..e627d868a9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -259,4 +259,13 @@ public interface EpmetUserOpenFeignClient { **/ @PostMapping(value = "epmetuser/gridlatest/latestgridinfo") Result latestGridInfo(@RequestBody LatestGridInfoFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:37 下午 + */ + @PostMapping("epmetuser/customerstaff/getstaffinfolist") + Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 6e137becc1..f434996933 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -183,4 +183,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result latestGridInfo(LatestGridInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestGridInfo", formDTO); } + + @Override + public Result> getStaffInfoList(UserIdsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO); + } } diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 60fb75bf2c..8555b3ea46 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.116 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.117 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index a1575aa794..c92fe0c949 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.116 + 0.3.117 com.epmet epmet-user diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index fd0c0f5a9e..8ed7c0727d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -321,4 +321,16 @@ public class CustomerStaffController { public Result> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO) { return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndPhone(formDTO)); } + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + @PostMapping("getstaffinfolist") + public Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerStaffService.getStaffInfoList(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index be19478a91..ce0ff406c7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; import com.epmet.dto.form.*; -import com.epmet.dto.result.DepartInStaffListResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.CommonStaffInfoResultDTO; -import com.epmet.dto.result.StaffListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -148,4 +145,12 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据客户ID、手机号查询政府端工作人员基本信息 **/ List selectStaff(ThirdCustomerStaffFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param userIds + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + List getStaffInfoList(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index 275a2e9742..0d019d63f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -20,6 +20,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; +import com.epmet.dto.result.RoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -61,4 +63,12 @@ public interface GovStaffRoleDao extends BaseDao { List listRolesByCustomer(@Param("customerId") String customerId); GovStaffRoleResultDTO getDTOById(@Param("roleId") String roleId); + + /** + * @Description 查询用户的权限 + * @param userIds + * @author zxc + * @date 2020/8/13 2:14 下午 + */ + List getRoleInfoList(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index edbef03d60..1eb5e070e4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -258,4 +258,12 @@ public interface CustomerStaffService extends BaseService { * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 **/ List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + List getStaffInfoList( UserIdsFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 0f00a32191..2ff38361cb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -36,6 +36,7 @@ import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; +import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -56,6 +57,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -93,6 +95,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -540,4 +546,34 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getStaffInfoList(UserIdsFormDTO formDTO) { + List userIds = formDTO.getUserIds(); + // 1. 根据userId查询人员基本信息 + List staffInfoList = customerStaffDao.getStaffInfoList(userIds); + if (staffInfoList.size() == NumConstant.ZERO){ + return staffInfoList; + } + // 2. 根据userId查询权限 + List roleInfoList = govStaffRoleDao.getRoleInfoList(userIds); + staffInfoList.forEach(staffInfo -> { + List roleResult = new ArrayList<>(); + roleInfoList.forEach(role -> { + if (staffInfo.getStaffId().equals(role.getUserId())){ + RoleResultDTO result = new RoleResultDTO(); + BeanUtils.copyProperties(role,result); + roleResult.add(result); + } + }); + staffInfo.setRoleList(roleResult); + }); + return staffInfoList; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 7466c53d67..bcd20d8b96 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -215,4 +215,24 @@ AND mobile = #{mobile} ORDER BY active_time DESC, created_time ASC + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 22f47ce8bc..a9da37f9d9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -68,4 +68,22 @@ gsr.ORG_TYPE AS orgType FROM gov_staff_role gsr WHERE ID = #{roleId} + + + \ No newline at end of file