diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.22__jmreport_category.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.22__jmreport_category.sql new file mode 100644 index 0000000000..aa7b268044 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.22__jmreport_category.sql @@ -0,0 +1,5 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509011061993473', 'jmreport_category', '报表应用类别', '居民信息、房屋信息', 32, 0, 0, '1', '2022-08-08 13:14:01', '1', '2022-08-08 13:14:01'); + + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509175185108994', 1556509011061993473, '房屋信息', 'house_info', '0', '', 2, 0, 0, '1', '2022-08-08 13:14:41', '1', '2022-08-08 13:14:41'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1556509102015475714', 1556509011061993473, '居民信息', 'resi_info', '0', '', 1, 0, 0, '1', '2022-08-08 13:14:23', '1', '2022-08-08 13:14:23'); diff --git a/epmet-commons/epmet-commons-feignclient/pom.xml b/epmet-commons/epmet-commons-feignclient/pom.xml new file mode 100644 index 0000000000..4cf486cefb --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/pom.xml @@ -0,0 +1,24 @@ + + + + epmet-commons + com.epmet + 2.0.0 + + + 4.0.0 + jar + + epmet-commons-feignclient + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + \ No newline at end of file diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/.gitkeep b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/.gitkeep b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/JiMuPage.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/JiMuPage.java new file mode 100644 index 0000000000..1c92f30d11 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/JiMuPage.java @@ -0,0 +1,22 @@ +package com.epmet.commons.feignclient.dtos; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 积木报表的返回值Page对象 + * @param + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class JiMuPage { + private int pageNo; + private int pageSize; + private int total; + private int pages; + private List records; +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/JiMuResult.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/JiMuResult.java new file mode 100644 index 0000000000..5aa42d273a --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/JiMuResult.java @@ -0,0 +1,20 @@ +package com.epmet.commons.feignclient.dtos; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 积木报表的返回值Result对象 + * @param + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class JiMuResult { + private boolean success = true; + private String message = ""; + private Integer code = 0; + private T result; + private T data; +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java new file mode 100644 index 0000000000..caf58ec9a9 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JiMuReportFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.commons.feignclient.dtos.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/8/8 15:08 + * @DESC + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class JiMuReportFormDTO implements Serializable { + + private static final long serialVersionUID = 3590609549416867701L; + + /** + * 报表IDs + */ + private List reportIds; + + /** + * 类别 + */ + private List categoryKeys; + + private String id; +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JimuReportExportRequestDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JimuReportExportRequestDTO.java new file mode 100644 index 0000000000..7e66c588e9 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/form/JimuReportExportRequestDTO.java @@ -0,0 +1,27 @@ +package com.epmet.commons.feignclient.dtos.form; + +import lombok.Data; + +/** + * 批量导出用的requst dto + */ +@Data +public class JimuReportExportRequestDTO { + private String excelConfigId; + private ExportRequestQueryParam queryParam = new ExportRequestQueryParam(); + + /** + * 批量导出用的请求参数 + */ + @Data + public static class ExportRequestQueryParam { + private String id; + private String token; + private String paramKey; + private String pageNo; + private Integer pageSize; + private String currentPageNo; + private Integer currentPageSize; + } + +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportDetailResultDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportDetailResultDTO.java new file mode 100644 index 0000000000..9e27d5ab5b --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportDetailResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.commons.feignclient.dtos.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.Map; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class JiMuReportDetailResultDTO { + private String id; + private String code; + private String name; + private String note; + private String status; + private String type; + private String jsonStr; + private String apiUrl; + private String apiMethod; + private String apiCode; + private String thumb; + private Integer template; + private String createBy; + private Date createTime; + private String updateBy; + private Date updateTime; + private Map dataList; +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java new file mode 100644 index 0000000000..6ef587b6d5 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.commons.feignclient.dtos.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/8/8 15:10 + * @DESC + */ +@Data +public class JiMuReportResultDTO implements Serializable { + + private static final long serialVersionUID = -4048477731892329569L; + + private String code; + + private String name; + + private String id; + private String reportId; + private String reportName; + + private Boolean isList = false; +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JimuReportDbDataResultDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JimuReportDbDataResultDTO.java new file mode 100644 index 0000000000..8eb58e8b74 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JimuReportDbDataResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.commons.feignclient.dtos.result; + +import lombok.Data; + +@Data +public class JimuReportDbDataResultDTO { + + private ReportDB reportDb; + + @Data + public static class ReportDB { + private String apiUrl; + private String apiMethod; + private String isList; + private String dbChName; + } + +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JimuReportFieldTreeResultDTO.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JimuReportFieldTreeResultDTO.java new file mode 100644 index 0000000000..ef4037afe8 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JimuReportFieldTreeResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.commons.feignclient.dtos.result; + +import lombok.Data; + +import java.util.List; + +/** + * 积木报表,报表字段列表 + */ +@Data +public class JimuReportFieldTreeResultDTO { + + private Boolean expand; + private String code; + private List children; + private String dbId; + private String type; + private String isList; + + @Data + public static class Child { + private Boolean expand; + private String title; + private String fieldText; + } +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/.gitkeep b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java new file mode 100644 index 0000000000..08b07c0dab --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java @@ -0,0 +1,47 @@ +package com.epmet.commons.feignclient.feigns; + +import com.epmet.commons.feignclient.dtos.JiMuPage; +import com.epmet.commons.feignclient.dtos.JiMuResult; +import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO; +import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO; +import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO; +import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO; +import com.epmet.commons.feignclient.feigns.fallback.JiMuReportOpenFeignClientFallbackFactory; +import com.epmet.commons.tools.constant.ServiceConstant; +import feign.Response; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2022/8/8 13:52 + * @DESC + */ +@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class) +//@FeignClient(name = ServiceConstant.EPMET_JM_REPORT, fallbackFactory = JiMuReportOpenFeignClientFallbackFactory.class, url = "localhost:8118") +public interface JiMuReportOpenFeignClient { + + @GetMapping(value = "jmreport/excelQuery") + JiMuResult> getList(@RequestParam("pageNo") Integer pageNo, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("name") String name, + @RequestParam("reportType") String reportType, + @RequestParam("token") String token, + @RequestHeader MultiValueMap headers); + + @GetMapping("jmreport/show") + JiMuResult> getReport(@RequestParam("id") String id,@RequestParam("apiUrl") String apiUrl,@RequestParam("params") String params,@RequestHeader MultiValueMap headers); + + @GetMapping("/jmreport/field/tree/{report-id}") + JiMuResult>> fieldTree(@PathVariable("report-id") String reportId); + + @GetMapping("jmreport/loadDbData/{report-id}") + JiMuResult loadDbData(@PathVariable("report-id") String reportId); + + @PostMapping("jmreport/exportAllExcelStream") + Response exportAllExcelStream(JimuReportExportRequestDTO param); +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java new file mode 100644 index 0000000000..b1c793d560 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java @@ -0,0 +1,51 @@ +package com.epmet.commons.feignclient.feigns.fallback; + +import com.epmet.commons.feignclient.dtos.JiMuPage; +import com.epmet.commons.feignclient.dtos.JiMuResult; +import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO; +import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO; +import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO; +import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO; +import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient; +import feign.Response; +import org.springframework.util.MultiValueMap; + +import java.util.List; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2022/8/8 13:53 + * @DESC + */ +public class JiMuReportOpenFeignClientFallback implements JiMuReportOpenFeignClient { + + @Override + public JiMuResult> getList(Integer pageNo, Integer pageSize, String name, String reportType, String token, MultiValueMap headers) { + JiMuResult> rst = new JiMuResult<>(false, "请求失败", 200, null,null); + return rst; + } + + @Override + public JiMuResult> getReport(String id,String apiUrl,String params,MultiValueMap headers) { + JiMuResult> rst = new JiMuResult<>(false, "请求失败", 200, null,null); + return rst; + } + + @Override + public JiMuResult loadDbData(String reportId) { + JiMuResult rst = new JiMuResult<>(false, "请求失败", 200, null,null); + return rst; + } + + @Override + public Response exportAllExcelStream(JimuReportExportRequestDTO param) { + return null; + } + + @Override + public JiMuResult>> fieldTree(String reportId) { + JiMuResult rst = new JiMuResult<>(false, "请求失败", 200, null,null); + return rst; + } +} diff --git a/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java new file mode 100644 index 0000000000..e0274436c2 --- /dev/null +++ b/epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallbackFactory.java @@ -0,0 +1,24 @@ +package com.epmet.commons.feignclient.feigns.fallback; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2022/8/9 13:27 + * @DESC + */ +@Slf4j +@Component +public class JiMuReportOpenFeignClientFallbackFactory implements FallbackFactory { + + private JiMuReportOpenFeignClientFallback fallback = new JiMuReportOpenFeignClientFallback(); + + @Override + public JiMuReportOpenFeignClientFallback create(Throwable cause) { + log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); + return fallback; + } +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java index fdd9e5d860..f579fbb1fc 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java @@ -22,6 +22,11 @@ public class OrgOrStaffMQMsg implements Serializable { //删除网格:grid_delete;删除组织:agency_delete private String type; + /** + * org原有的Code + */ + private String oldCode; + //工作人员Id集合 private List staffIdList; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/ReportRequest.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/ReportRequest.java new file mode 100644 index 0000000000..41a9379fe0 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/ReportRequest.java @@ -0,0 +1,13 @@ +package com.epmet.commons.tools.annotation; + +import java.lang.annotation.*; + +/** + * 标记一个接口,它会被报表服务所调用 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ReportRequest { + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java new file mode 100644 index 0000000000..c355a39df1 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ReportRequestAspect.java @@ -0,0 +1,86 @@ +package com.epmet.commons.tools.aspect; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.RedisUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.lang.reflect.Parameter; +import java.util.Map; + +/** + * 需要被报表服务请求的api,需要加上这个注解 + * 1.该注解会取url中固定的key,去redis获取参数,给入参dto复制 + */ +@Aspect +@Component +@Order(20) +@Slf4j +public class ReportRequestAspect { + + /** + * 从redis中取参数用 + */ + public static final String REPORT_REDIS_KEY = "paramKey"; + + @Autowired + private RedisUtils redisUtils; + + @Before("@annotation(com.epmet.commons.tools.annotation.ReportRequest)") + public void before(JoinPoint point) { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + String paramKey = sra.getRequest().getParameter(REPORT_REDIS_KEY); + if (StringUtils.isBlank(paramKey)) { + // 没有携带key参数,直接跳过 + return; + } + + Map cachedParams = redisUtils.hGetAll(paramKey); + if (cachedParams == null || cachedParams.size() == 0) { + log.warn("【报表服务】根据paramKey:{}未获取到有效的参数缓存。", paramKey); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "参数失效", "参数失效"); + // redis中没有此参数 + } + + // 使用方法签名获取出参数class列表 + Object[] args = point.getArgs(); + MethodSignature signature = (MethodSignature) point.getSignature(); + Parameter[] parameters = signature.getMethod().getParameters(); + fillArgsToRequestBody(args, cachedParams, parameters); + } + + /** + * 将redis中取出的参数,赋值到指定的入参dto上 + * @param args + * @param storedParams + */ + private void fillArgsToRequestBody(Object[] args, Map storedParams, Parameter[] parameters) { + for (int i = 0; i < args.length; i++) { + Object arg = args[i]; + RequestBody requestBodyAnno = parameters[i].getAnnotation(RequestBody.class); + if (arg != null && requestBodyAnno != null) { + Object argBean = BeanUtil.mapToBean(storedParams, arg.getClass(), true); + + // "pageSize", "pageNo", "isPage"三个属性不从redis拷贝,而是取传递雇来的 + // redis里面的字段如果是null,则不会赋值给arg + BeanUtil.copyProperties(argBean, arg, new CopyOptions(null, true, "pageSize", "pageNo", "isPage")); + return; + } + } + } +} 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 8b819bcfb8..7d4eafae90 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 @@ -148,4 +148,9 @@ public interface ServiceConstant { * 插件pli-power服务 */ String PLI_POWER_SERVER = "pli-power-base-server"; + + /** + * + */ + String EPMET_JM_REPORT = "epmet-jmreport-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java index 1880debe42..88adefbd17 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DictListFormDTO.java @@ -1,6 +1,8 @@ package com.epmet.commons.tools.dto.form; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; @@ -9,6 +11,8 @@ import javax.validation.constraints.NotBlank; * @Author sun */ @Data +@AllArgsConstructor +@NoArgsConstructor public class DictListFormDTO { /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java new file mode 100644 index 0000000000..935064e933 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CollectUrlEnum.java @@ -0,0 +1,34 @@ +package com.epmet.commons.tools.enums; + +public enum CollectUrlEnum { + + + URL_PRE("subpages/points/pages/fangyi/xinxi/create/index", "小程序码跳转地址"), + GET_CODE_URL("https://api.weixin.qq.com/wxa/getwxacode?access_token=", "获取二维码的url"); + + + private String code; + private String name; + + + CollectUrlEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index e900f79875..07d47ba7b0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -28,6 +28,7 @@ public enum DictTypeEnum { IC_SERVICE_TYPE("ic_service_type","服务类别",20), IC_DANGER_TYPE("ic_danger_type","危化品种类",24), POLICY_LEVEL("policy_level","政策级别",25), + LOG_TYPE("log_type", "日志类型", 33), ; private final String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ResiCategoryEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ResiCategoryEnum.java index 6416582380..f4343639e0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ResiCategoryEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ResiCategoryEnum.java @@ -18,7 +18,8 @@ public enum ResiCategoryEnum { IS_CJ("IS_CJ", "残疾"), IS_DB("IS_DB", "大病"), IS_MB("IS_MB", "慢病"), - IS_SPECIAL("IS_SPECIAL", "特殊人群"); + IS_SPECIAL("IS_SPECIAL", "特殊人群"), + IS_XJC("IS_XJC", "新阶层人士"); private String colName; private String label; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java index f7eb3a778d..746de189e9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/EpmetBaseRequestInterceptor.java @@ -25,8 +25,6 @@ public class EpmetBaseRequestInterceptor implements RequestInterceptor { // Map requestHeaders = getHeadersFromRequest(); - log.debug("EpmetBaseRequestInterceptor#apply#inheritableAdditionalHeaders:" + requestHeaders); - if (requestHeaders != null && requestHeaders.size() > 0) { for (Map.Entry kv : requestHeaders.entrySet()) { template.header(kv.getKey(), kv.getValue()); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java index 55a331c4e2..1e9271dc2a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/page/PageData.java @@ -29,6 +29,7 @@ public class PageData implements Serializable { private List list; + private int pages; /** * 分页 * @param list 列表数据 @@ -38,4 +39,10 @@ public class PageData implements Serializable { this.list = list; this.total = (int)total; } + + public PageData(List list, long total,int pageSize) { + this.list = list; + this.total = (int)total; + this.pages = (int) Math.ceil((double)total / pageSize); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 76585fa96f..b39bb7fa47 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -849,4 +849,11 @@ public class RedisKeys { public static String getServiceOrgNameKey(String customerId,String serviceOrgType,String serviceOrgId){ return rootPrefix.concat("serviceOrgName:").concat(serviceOrgType).concat(":").concat(customerId).concat(":").concat(serviceOrgId); } + + public static String getUserBaseInfoKey(String userId) { + if (StringUtils.isBlank(userId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误"); + } + return rootPrefix.concat("staffbaseinfo:")+userId; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/EpmetRequestHolder.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/EpmetRequestHolder.java index c86ef93152..e24f420fa7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/EpmetRequestHolder.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/EpmetRequestHolder.java @@ -2,6 +2,7 @@ package com.epmet.commons.tools.utils; import com.alibaba.ttl.TransmittableThreadLocal; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.Constant; import org.apache.commons.lang3.StringUtils; import java.util.HashMap; @@ -86,6 +87,14 @@ public class EpmetRequestHolder { return getHeader(AppClientConstant.CLIENT); } + /** + * 获取登陆用户的token + * @return + */ + public static String getLoginUserAuthorizationToken() { + return getHeader(Constant.AUTHORIZATION_HEADER); + } + /** * 获取所有 * @return diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 4fe6be37da..69b9d87b97 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -443,6 +443,34 @@ public class HttpClientManager { } } + public Result sendGet(String url, Map params, Map headerMap) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + + System.out.println(builder.getPath()); + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + if (null != headerMap){ + headerMap.forEach((k,v) -> { + if (StringUtils.isNotBlank(k)) { + httpGet.addHeader(k, v == null ? null : v.toString()); + } + }); + } + return execute(httpGet,false); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + private Result execute(HttpRequestBase httpMethod, boolean isHttps) { CloseableHttpResponse response = null; try { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java index 657b37bb14..517b65938a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java @@ -215,6 +215,21 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String isSpecial; + /** + * 是否租户【是:1 否:0】 + */ + private String isTenant; + + /** + * 是否流动人口【是:1 否:0】 + */ + private String isFloating; + + /** + * 是否新阶层人士【是:1 否:0】 + */ + private String isXjc; + /** * 文化程度【字典表】 */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiServiceImpl.java index 10293c2a8f..2fceaabfd6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiServiceImpl.java @@ -118,6 +118,8 @@ public class IcResiServiceImpl implements IcResiService { query.eq(IcResiUserEntity::getIsMb, true); } else if (ResiCategoryEnum.IS_SPECIAL.getColName().equals(categoryKey)) { query.eq(IcResiUserEntity::getIsSpecial, true); + } else if(ResiCategoryEnum.IS_XJC.getColName().equals(categoryKey)){ + query.eq(IcResiUserEntity::getIsXjc, true); } if (StringUtils.isNotBlank(search)) { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java index 7639f6c561..19b7c71d7e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java @@ -244,17 +244,18 @@ public class CoverageServiceImpl implements CoverageService { if (CollectionUtils.isEmpty(customerMenuList)){ return result; } - List tables = new ArrayList<>(); + List tableMore = new ArrayList<>(); customerMenuList.forEach(cm -> { resources.forEach(r -> { if (cm.getUrl().equals(r)){ String tableName = MenusEnums.getValueByUrl(r); if (StringUtils.isNotBlank(tableName)){ - tables.add(tableName); + tableMore.add(tableName); } } }); }); + List tables = tableMore.stream().distinct().collect(Collectors.toList()); if (CollectionUtils.isEmpty(tables)){ return result; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml index 4b51beae89..29e53ff04b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -470,6 +470,9 @@ AND GRID_ID = #{orgId} + + AND ORG_ID_PATH LIKE concat('%', #{orgId}, '%') + AND DATE_FORMAT(CREATED_TIME,"%Y%m%d%H%i%s") = ]]> #{startDate} @@ -492,6 +495,9 @@ AND GRID_ID = #{orgId} + + AND ORG_ID_PATH LIKE concat('%', #{orgId}, '%') + AND DATE_FORMAT(CREATED_TIME,"%Y%m%d%H%i%s") = ]]> #{startDate} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java index dfd88c7e96..db6bd2c3d6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -206,4 +206,5 @@ public class ScreenProjectDataDTO implements Serializable { private String orgIdPath; private String finishOrgType; + private Date processTime; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java index 043e256c42..988127dab7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java @@ -18,4 +18,8 @@ public interface PingYinConstant { String TEST_PING_YIN_CUSTOMER_ID = "78e2b2227c07de1fe54da14e2b2d9eb6"; String PROD_PING_YIN_CUSTOMER_ID = "6f203e30de1a65aab7e69c058826cd80"; + + String KC = "2fe0065f70ca0e23ce4c26fca5f1d933"; + String YS = "46c55cb862d6d5e6d05d2ab61a1cc07e"; + String JS = "44876154d10d7cb7affd92000f84f833"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java index 4a2260b045..7436847fd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java @@ -225,6 +225,11 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String isFloating; + /** + * 是否新阶层人士【是:1 否:0】 + */ + private String isXjc; + /** * 文化程度【字典表】 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index 6d76dfd175..1ac0f1ab53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.PingYinConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.basereport.result.EventInfoResultDTO; @@ -243,7 +244,7 @@ public class DataReportingServiceImpl implements DataReportingService { if (CollectionUtils.isNotEmpty(formDTO.getProjectId())) { list = projectList.stream().map(project -> { EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap); - ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId()); + CustomerGridDTO grid = customerGridService.getGridById(project.getOrgId()); dto.setOrgId(project.getOrgId()); if (null != grid) { dto.setOrgCode(grid.getCode()); @@ -254,10 +255,10 @@ public class DataReportingServiceImpl implements DataReportingService { } else { //项目ID不为空时,提前取出客户下的组织和网格 Map agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId()); - Map gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId()); + Map gridMap = customerGridService.getGridMap(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID); list = projectList.stream().map(project -> { EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap); - ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId()); + CustomerGridDTO grid = gridMap.get(project.getOrgId()); dto.setOrgId(project.getOrgId()); if (null != grid) { dto.setOrgCode(grid.getCode()); @@ -319,12 +320,16 @@ public class DataReportingServiceImpl implements DataReportingService { dto.setHappenPlace(project.getProjectAddress()); dto.setEventDescription(project.getProjectContent()); dto.setSuccessfulOrNo(ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())?"Y":"N"); - if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) { + dto.setStatus(getProjectStatus(project.getProjectStatusCode())); + dto.setCompleteTime(project.getCloseCaseTime()); + + if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode()) || + ProjectConstant.CLOSED.equals(project.getProjectStatusCode())) { //办结组织是机关时,办结层级为机关的层级 if (OrgTypeConstant.AGENCY.equals(project.getFinishOrgType())) { dto.setWaysOfResolving(ProjectConstant.PROJECT_REPORT); //如果是孔村的项目办结层级需要降一级 - if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId())) { + if(PingYinConstant.KC.equals(project.getCustomerId())) { if (StringUtils.isNotBlank(project.getFinishOrgLevel())) { switch (project.getFinishOrgLevel()) { case OrgTypeConstant.DISTRICT: @@ -355,9 +360,12 @@ public class DataReportingServiceImpl implements DataReportingService { //办结组织是网格时,办结层级为网格 dto.setCompleteLevel("5"); } + if (ProjectConstant.CLOSED.equals(project.getProjectStatusCode()) &&(PingYinConstant.KC.equals(project.getCustomerId()) || + PingYinConstant.YS.equals(project.getCustomerId()) || PingYinConstant.JS.equals(project.getCustomerId()))) { + dto.setCompleteTime(project.getProcessTime()); + } } - dto.setStatus(getProjectStatus(project.getProjectStatusCode())); - dto.setCompleteTime(project.getCloseCaseTime()); + dto.setLat(project.getLatitude()); dto.setLng(project.getLongitude()); dto.setWaysOfResolving(ProjectConstant.PROJECT_SELF_CLOSED); @@ -386,7 +394,6 @@ public class DataReportingServiceImpl implements DataReportingService { case ProjectConstant.PENDING: return "01"; case ProjectConstant.CLOSED: - return "02"; case ProjectConstant.CLOSED_CASE: return "03"; default: diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 13f641fa98..4e840fd674 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -15,6 +15,7 @@ import com.epmet.entity.org.CustomerGridEntity; import java.util.Date; import java.util.List; +import java.util.Map; public interface CustomerGridService extends BaseService { /** @@ -106,4 +107,9 @@ public interface CustomerGridService extends BaseService { * @Description 查询客户下有效网格列表 **/ List gridListByCustomerId(String customerId); + + CustomerGridDTO getGridById(String gridId); + + Map getGridMap(String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 10bfbc4fd5..8c2c6740e5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -1,8 +1,10 @@ package com.epmet.service.org.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.CustomerGridDao; import com.epmet.dto.group.AgencyDTO; @@ -18,12 +20,13 @@ import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.Issue.IssueService; import com.epmet.service.org.CustomerGridService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.GOV_ORG) @@ -157,4 +160,20 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getGridMap(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerGridEntity::getCustomerId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class).stream().collect(Collectors.toMap(CustomerGridDTO::getId, Function.identity())); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 64b783c786..6f4ce649b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -300,7 +300,8 @@ b.HANDLER_ID AS finishOrg, b.HANDLER_TYPE AS finishOrgType, b.ORG_ID_PATH AS orgIdPath, - c.`LEVEL` AS finishOrgLevel + c.`LEVEL` AS finishOrgLevel, + b.PROCESS_TIME FROM screen_project_data a LEFT JOIN ( @@ -309,12 +310,13 @@ PROJECT_ID, HANDLER_ID, HANDLER_TYPE, - ORG_ID_PATH + ORG_ID_PATH, + PROCESS_TIME FROM screen_project_process spp WHERE (( spp.CUSTOMER_ID = '2fe0065f70ca0e23ce4c26fca5f1d933' OR spp.CUSTOMER_ID = '44876154d10d7cb7affd92000f84f833' OR spp.CUSTOMER_ID = '46c55cb862d6d5e6d05d2ab61a1cc07e' ) - AND OPERATION = 'closed_case') + AND (OPERATION = 'closed_case' OR OPERATION = 'close')) OR (( spp.CUSTOMER_ID != '2fe0065f70ca0e23ce4c26fca5f1d933' AND spp.CUSTOMER_ID != '44876154d10d7cb7affd92000f84f833' AND spp.CUSTOMER_ID != '46c55cb862d6d5e6d05d2ab61a1cc07e' ) AND OPERATION = 'close') diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index c1d52f8ea5..5105dd1279 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -61,15 +61,19 @@ + + + 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 c3d15d75e0..7c03f1a94d 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 @@ -196,7 +196,8 @@ `code` AS 'code', grid_type AS 'gridType', contacts AS 'contacts', - mobile AS 'mobile' + mobile AS 'mobile', + sort AS gridSort FROM customer_grid WHERE @@ -256,6 +257,9 @@ CENTER_ADDRESS= #{centerAddress}, + + sort = #{sort}, + UPDATED_TIME=NOW() where id = #{id} @@ -314,7 +318,7 @@ DEL_FLAG = '0' AND ABANDON_FLAG='0' AND PID = #{agencyId} - ORDER BY CREATED_TIME DESC + ORDER BY sort,grid_name,CREATED_TIME DESC LIMIT #{pageSize} @@ -417,6 +421,8 @@ WHERE del_flag = '0' and ABANDON_FLAG='0' AND pid = #{agencyId} + order by + sort,grid_name @@ -474,8 +482,10 @@ AND grid.customer_id = #{customerId} ORDER BY - grid.customer_id, - CONVERT ( gridName USING gbk ) ASC + grid.sort, + CONVERT ( gridName USING gbk ) ASC, + grid.customer_id + LIMIT #{pageNo}, #{pageSize} @@ -488,7 +498,9 @@ SELECT a.id AS grid_id, a.customer_id, - concat( agency.fullname, '-', a.grid_name ) AS gridName + concat( agency.fullname, '-', a.grid_name ) AS gridName, + a.sort as sort, + agency.fullname as fullName FROM CUSTOMER_GRID a LEFT JOIN ( @@ -512,7 +524,7 @@ and a.ABANDON_FLAG='0' AND a.customer_id = #{customerId} ) AS c - ORDER BY CONVERT ( gridName USING gbk ) ASC + ORDER BY fullName,c.sort,CONVERT ( gridName USING gbk ) ASC LIMIT #{pageNo}, #{pageSize} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 851054d218..8b900c90dd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -541,4 +541,13 @@ and CODING=#{coding} + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogDao.xml new file mode 100644 index 0000000000..117786e879 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogDao.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogFileDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogFileDao.xml new file mode 100644 index 0000000000..7461622a6e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcWorkLogFileDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + ic_work_log_file + WHERE + LOG_ID = #{logId} + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java index 22343e9007..c5330c05d8 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -84,5 +84,10 @@ public class IcEventListFormDTO implements Serializable { * 操作类型 0:取消标记 1:标记 */ private String type; + /** + * 事件分类 一类、二类Id集合 + */ + private List firstIdList; + private List secondIdList; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java index c2607974ee..5123bb789a 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.dto.form; import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; -import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.List; @@ -46,6 +45,10 @@ public class OrgProjectListFormDTO extends PageFormDTO implements Serializable { * 事件状态 处理中 pending,已结案 closed */ private String status; + /** + * 解决状态 已解决 resolved,无需解决 unresolved + */ + private String closedStatus; /** * 起始上报时间 精确到秒 */ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java index ec3c6bd18a..5eb7013261 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java @@ -22,7 +22,7 @@ public class TransferFormDTO implements Serializable { @NotBlank(message = "项目人员关联Id不能为空") private String projectStaffId; - @NotBlank(message = "公开答复不能为空") + // @NotBlank(message = "公开答复不能为空") @Length(max=1000,message = "公开答复内容不能超过1000位") private String publicReply; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java index f734a13de8..37a4f57ff7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java @@ -98,6 +98,8 @@ public class OrgProjectListResultDTO implements Serializable { */ private String status; private String statusValue; + private String closedStatus; + private String closedStatusValue; /** * 是否需要自己处理 true:需要 false:不需要 */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java index 5bfc88d274..45c4bdad8d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java @@ -20,6 +20,10 @@ public class IcEventExcel { @ColumnWidth(20) private String gridName; + @ExcelProperty(value = "事件分类") + @ColumnWidth(25) + private String categoryName; + @ExcelProperty(value = "事件内容") @ColumnWidth(25) private String eventContent; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java index 0af3ccc4c9..50d9020259 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java @@ -1,12 +1,9 @@ package com.epmet.excel; -import cn.afterturn.easypoi.excel.annotation.ExcelCollection; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; -import java.util.List; - /** * 事件管理表 * @@ -122,5 +119,9 @@ public class OrgProjectListExcel { @ColumnWidth(20) private String status; + @ExcelProperty(value = "解决状态") + @ColumnWidth(20) + private String closedStatus; + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index 6deb8203fa..f11fd1044d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -125,6 +125,15 @@ public class IcEventServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + //查询分类信息 + IssueProjectCategoryDictListFormDTO dictFormDto = new IssueProjectCategoryDictListFormDTO(); + dictFormDto.setCustomerId(formDTO.getCustomerId()); + Result> categoryRes = govIssueOpenFeignClient.getCategoryList(dictFormDto); + if (!categoryRes.success() || org.springframework.util.CollectionUtils.isEmpty(categoryRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取项目分类名称异常"); + } + Map categoryMap = categoryRes.getData().stream().collect(Collectors.toMap(IssueProjectCategoryDictDTO::getId, o -> o, (o1, o2) -> o1)); + //封装数据 for (IcEventListResultDTO dto : list) { if (gridInfoMap.containsKey(dto.getGridId())) { @@ -133,6 +142,14 @@ public class IcEventServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index af09210b52..ec9ff0745f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -218,6 +218,24 @@ AND ie.`status` = #{status} + + + #{firstId} + + + + + #{secondId} + + + + + #{firstId} + + + #{secondId} + + order by ie.created_time desc, ie.latest_operated_time desc 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 527e4bd62a..73c2f11384 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 @@ -655,6 +655,8 @@ p.back_ground, ( CASE WHEN p.`STATUS` = 'pending' THEN '处理中' WHEN p.`STATUS` = 'closed' THEN '已结案' ELSE '' END ) AS status, p.`status` AS statusValue, + ( CASE WHEN p.CLOSED_STATUS = 'resolved' THEN '已解决' WHEN p.CLOSED_STATUS = 'unresolved' THEN '无需解决' ELSE '' END ) AS closedStatus, + p.CLOSED_STATUS AS closedStatusValue, pc.category_pids, pc.category_id, pp.public_reply, @@ -671,16 +673,24 @@ group by project_id ORDER BY created_time desc )pc ON p.id = pc.project_id - + #{firstId} - + #{secondId} + + + #{firstId} + + + #{secondId} + + LEFT JOIN project_process pp ON p.id = pp.project_id AND pp.operation = 'close' INNER JOIN project_process ppc ON p.id = ppc.project_id AND ppc.operation = 'created' @@ -722,6 +732,9 @@ AND p.created_time #{endTime} + + AND p.CLOSED_STATUS = #{closedStatus} + + SELECT + cr.REPORT_ID, + cr.CUSTOMER_ID, + rf.FUN_CATEGORY_KEY AS categoryKey + FROM ic_customer_report cr + INNER JOIN ic_report_fun rf ON rf.CUSTOMER_REPORT_ID = cr.ID AND rf.DEL_FLAG = 0 + WHERE cr.DEL_FLAG = 0 + + AND rf.FUN_CATEGORY_KEY in ( + + #{r} + + ) + + + AND cr.CUSTOMER_ID = #{customerId} + + ORDER BY cr.CREATED_TIME DESC + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index e2689c4c62..02070f1b63 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -322,4 +322,23 @@ ORDER BY ifi.SORT + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcReportFunDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcReportFunDao.xml new file mode 100644 index 0000000000..0da1a5ae81 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcReportFunDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java index b488b7e15f..d277201298 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java @@ -158,6 +158,12 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal()); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java new file mode 100644 index 0000000000..01a79ad36e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiCollectVisitorDTO.java @@ -0,0 +1,144 @@ +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 2022-08-02 + */ +@Data +public class IcResiCollectVisitorDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 目的地 + */ + private String address; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 所属小区ID; + */ + private String villageId; + + /** + * 所属小区名称 + */ + private String villageName; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 所属楼宇名称 + */ + private String buildName; + + /** + * 单元id + */ + private String unitId; + + /** + * 单元名 + */ + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 房间名 + */ + private String homeName; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 来访事由 + */ + private String comeReason; + + /** + * 人脸照片 + */ + private String faceImg; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java index 2cd1167802..d4d3cbe812 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java @@ -219,6 +219,21 @@ public class IcResiUserDTO implements Serializable { */ private String isSpecial; + /** + * 是否租户【是:1 否:0】 + */ + private String isTenant; + + /** + * 是否是流动人口【是:1 否:0】 + */ + private String isFloating; + + /** + * 是否新阶层人士【是:1 否:0】 + */ + private String isXjc; + /** * 文化程度【字典表】 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java new file mode 100644 index 0000000000..2f7c71dfd8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java @@ -0,0 +1,122 @@ +package com.epmet.dto; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 居民信息采集-访客 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-08-02 + */ +@Data +public class SaveCollectVisitorFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 所属小区ID; + */ + @NotBlank(message = "小区ID不能为空") + private String villageId; + + /** + * 所属小区名称 + */ + @NotBlank(message = "小区名称不能为空") + private String villageName; + + /** + * 所属楼宇Id + */ + @NotBlank(message = "楼宇Id不能为空") + private String buildId; + + /** + * 所属楼宇名称 + */ + @NotBlank(message = "楼宇名称不能为空") + private String buildName; + + /** + * 单元id + */ + @NotBlank(message = "单元id不能为空") + private String unitId; + + /** + * 单元名 + */ + @NotBlank(message = "单元名不能为空") + private String unitName; + + /** + * 所属家庭Id + */ + @NotBlank(message = "家庭Id不能为空") + private String homeId; + + /** + * 房间名 + */ + @NotBlank(message = "房间名不能为空") + private String homeName; + + /** + * 详细地址 + */ + @NotBlank(message = "家庭地址不能为空") + private String address; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空") + private String name; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 来访事由 + */ + private String comeReason; + + /** + * 人脸照片 + */ + private String faceImg; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java new file mode 100644 index 0000000000..1aa8776d36 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-08-03 14:15 + **/ +@Data +public class CollectDetailFormDTO extends PageFormDTO implements Serializable { + + @NotBlank(message = "id不可为空") + private String id; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java new file mode 100644 index 0000000000..3f2f2f728b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectDetailResultDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 收集居民信息入参 + */ +@Data +public class CollectDetailResultDTO implements Serializable { + + private String id; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 所属小区ID + */ + private String villageId; + private String villageName; + + /** + * 所属楼宇Id + */ + private String buildId; + private String buildName; + + /** + * 单元id + */ + private String unitId; + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + private String homeName; + + /** + * 详细地址 + */ + private String address; + + /** + * 房屋状态 + */ + private String houseType; + + /** + * 户主姓名 + */ + private String houseHolderName; + + /** + * 居住成员人数 + */ + private Integer totalResi; + + /** + * 审核状态:0待审核 1未通过 2已通过 + */ + private String checkState; + + /** + * 审核原因 + */ + private String checkReason; + + private List memberList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java new file mode 100644 index 0000000000..1654fe09b3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectPageFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-08-03 14:15 + **/ +@Data +public class CollectPageFormDTO extends PageFormDTO implements Serializable { + + private String customerId; + + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java index 98526ad993..f4d0b7c1dc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java @@ -29,5 +29,6 @@ public class DelIcResiUserFormDTO implements Serializable { private String customerId; private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode(); + private String currentStaffId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ExportResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ExportResiUserFormDTO.java index 4d53cebb86..c6727abd24 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ExportResiUserFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ExportResiUserFormDTO.java @@ -11,8 +11,9 @@ import java.io.Serializable; * @Date 2021/10/27 2:06 下午 */ @Data -public class ExportResiUserFormDTO implements Serializable { +public class ExportResiUserFormDTO extends ReportDataFormDTO implements Serializable { private static final long serialVersionUID = 8777535966834678256L; + /** * 表单查询条件 */ @@ -27,5 +28,6 @@ public class ExportResiUserFormDTO implements Serializable { */ private IcExportTemplateSaveFormDTO exportConfig; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java new file mode 100644 index 0000000000..ad0ac9f106 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectCheckFormDTO.java @@ -0,0 +1,65 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民信息采集-审核入参 + * + * @author wgf + * @since v1.0.0 2022-08-02 + */ +@Data +public class IcResiCollectCheckFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "Id不能为空") + private String id; + + /** + * 审核状态:0待审核 1未通过 2已通过 + */ + @NotBlank(message = "审核状态不能为空") + private String checkState; + + /** + * 审核原因 + */ + private String checkReason; + + /** + * 单元号 + */ + private String buildingUnitId; + + /** + * 房间号 + */ + private String doorName; + + /** + * 客户ID(审核人) + */ + private String customerId; + + /** + * 员工ID(审核人) + */ + private String userId; + + /** + * 员工姓名(审核人) + */ + private String realName; + + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java new file mode 100644 index 0000000000..3de6728d72 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectGetDetailFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 居民信息采集-获取房屋信息 + * + * @author wgf + * @since v1.0.0 2022-08-02 + */ +@Data +public class IcResiCollectGetDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotBlank(message = "Id不能为空") + private String id; + + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java new file mode 100644 index 0000000000..004d5a082f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemDetailDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 家庭成员信息 + * 前端做校验 + */ +@Data +public class IcResiCollectMemDetailDTO implements Serializable { + + /** + * 居住成员1姓名 + */ + // @NotBlank(message = "姓名不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + private String name; + + /** + * 居住成员1身份证号 + */ + // @NotBlank(message = "身份证号不能为空", groups = {ResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + private String idNum; + + /** + * 居住成员1手机号 + */ + // @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + private String mobile; + + /** + * 居住成员1是否参加几轮全员核算检测,数字1-10 + */ + // @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + private String heSuanCount; + + /** + * 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种; + */ + // @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + private Integer ymjz; + + /** + * 户籍所在地 + */ + private String domicilePlace; + + /** + * 户籍所在地行政地区编码 + */ + private String domicilePlaceCode; + + /** + * 户籍所在地行政地区编码全路径,包含自己,英文逗号隔开例如:37,3702,370203 + */ + private String domicilePlaceCodePath; + + /** + * 学校或公司 + */ + private String workPlace; + + /** + * 备注 + */ + private String remark; + + /** + * 社区居民信息登记-查询返参用 + */ + private String id; + + /** + * 与房主关系 + */ + private String relationship; + + /** + * 人脸头像 + */ + private String faceImg; + + /** + * 是否是党员 + */ + private String isParty; + + /** + * 客户ID + */ + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 7e7cb6e846..987783a172 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -73,4 +73,15 @@ public class IcResiCollectMemFormDTO implements Serializable { * 社区居民信息登记-查询返参用 */ private String id; + + /** + * 与房主关系 + */ + private String relationship; + + /** + * 人脸头像 + */ + private String faceImg; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReportDataFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReportDataFormDTO.java new file mode 100644 index 0000000000..6ef39cb1f4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReportDataFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/8/17 11:13 + */ +@Data +public class ReportDataFormDTO { + /** + * 客户Id + */ + private String customerId; + /** + * pageNo 报表用的 + */ + private Integer pageNo = 1; + private Integer pageSize = 1000; + private String id; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java new file mode 100644 index 0000000000..7c3dd2983d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SaveCollectFormDTO.java @@ -0,0 +1,105 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 收集居民信息入参 + */ +@Data +public class SaveCollectFormDTO implements Serializable { + + /** + * id + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 内部:internal;外部:external + */ + private String origin; + + /** + * 网格ID_后端接口赋值 + */ + private String gridId; + + /** + * 组织Id_后端接口赋值 + */ + private String agencyId; + + /** + * 组织的pid_后端接口赋值 + */ + private String pids; + + /** + * 所属小区ID + */ + @NotBlank(message = "小区不能为空") + private String villageId; + @NotBlank(message = "小区名不能为空") + private String villageName; + + /** + * 所属楼宇Id + */ + @NotBlank(message = "楼栋不能为空") + private String buildId; + @NotBlank(message = "楼栋名不能为空") + private String buildName; + + /** + * 单元id + */ + @NotBlank(message = "单元不能为空") + private String unitId; + @NotBlank(message = "单元名不能为空") + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + @NotBlank(message = "家庭名不能为空") + private String homeName; + + /** + * 详细地址 + */ + @NotBlank(message = "家庭地址不能为空") + private String address; + + /** + * 1自有0租住 + */ + @NotBlank(message = "房子属于自有还是租住?") + private String houseType; + + /** + * 户主姓名 + */ + @NotBlank(message = "户主姓名不能为空") + private String houseHolderName; + + /** + * 居住成员人数 + */ + @NotNull(message = "居住成员人数不能为空") + private Integer totalResi; + + + @NotEmpty(message = "成员信息不能为空") + private List memberList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java new file mode 100644 index 0000000000..09ca9bf294 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Author wgf + * @DateTime 2022/8/5 8:00 + * @DESC + */ +@Data +public class VisitListFormDTO extends PageFormDTO { + + private static final long serialVersionUID = 2106773724057183577L; + + private String startTime; + + private String endTime; + + private String userId; + + private String customerId; + + private String orgId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java new file mode 100644 index 0000000000..6e9fa340ee --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author wgf + * @DateTime 2022/3/18 19:00 + * @DESC + */ +@Data +public class CollectHouseInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -6692672375850864451L; + + /** + * label + */ + private String label; + + /** + * 所属小区id + */ + private String neighborHoodId; + + /** + * 所属小区姓名 + */ + private String neighborHoodName; + + /** + * 所属楼栋id + */ + private String buildingId; + /** + * 所属楼栋名称 + */ + private String buildName; + /** + * 所属单元id + */ + private String buildingUnitId; + /** + * 所属单元名称 + */ + private String buildingUnitName; + /** + * 门牌号 + */ + private String doorName; + /** + * 房主姓名 + */ + private String ownerName; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java index 85208ba924..89742845fa 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java @@ -54,7 +54,7 @@ public class CollectListMemberExcelResultDTO implements Serializable { /** * 学校或公司 */ - @Excel(name = "单位或学校", width = 60) + @Excel(name = "单位名称", width = 60) private String workPlace; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java index 0fcaa480d4..9851be6340 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java @@ -24,6 +24,9 @@ public class CollectListResultDTO implements Serializable { // @JsonIgnore private String id; + // 组织Id + private String agencyId; + /** * 居住地址 */ @@ -39,6 +42,16 @@ public class CollectListResultDTO implements Serializable { */ private Integer totalResi; + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 审核状态:0待审核 1审核不通过 2审核通过 + */ + private String checkState; + private String domicilePlace; private List list; @@ -95,5 +108,15 @@ public class CollectListResultDTO implements Serializable { * 备注 */ private String remark; + + /** + * 与户主关系 + */ + private String relationship; + + /** + * 人脸照片 + */ + private String faceImg; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java new file mode 100644 index 0000000000..a25dbcdfec --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectPageListDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/3/18 19:00 + * @DESC + */ +@Data +public class CollectPageListDTO implements Serializable { + + private static final long serialVersionUID = -6692672375850864451L; + + + private String id; + + /** + * 居住地址 + */ + private String address; + + /** + * 居民:resi 访客:visitor + */ + private String type; + + /** + * 居民登记/访客登记 + */ + private String title; + + /** + * 审核状态:0待审核 1审核不通过 2审核通过 + */ + private String checkState; + + /** + * 审核状态名称 + */ + private String checkStateName; + + /** + * 审核原因 + */ + private String checkReason; + + /** + * 提交时间 + */ + private String createTime; + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java index 543493a395..cca091439f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java @@ -10,14 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.CollectListFormDTO; -import com.epmet.dto.form.IcResiCollectFormDTO; -import com.epmet.dto.form.LatestSubmitCollectFormDTO; -import com.epmet.dto.form.ResiCollectFormDTO; -import com.epmet.dto.result.CollectListExcelResultDTO; -import com.epmet.dto.result.CollectListMemberExcelResultDTO; -import com.epmet.dto.result.CollectListResultDTO; -import com.epmet.dto.result.LatestCollectResDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.service.IcResiCollectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -156,4 +150,76 @@ public class IcResiCollectController { ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class); return new Result().ok(icResiCollectService.latestSubmit(formDTO)); } + + /** + * 信息采集-审核 + * @param formDTO + * @param tokenDto + * @return + */ + @PostMapping("collectCheck") + public Result collectCheck(@RequestBody IcResiCollectCheckFormDTO formDTO, @LoginUser TokenDto tokenDto) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icResiCollectService.collectCheck(formDTO,tokenDto); + + return new Result(); + } + + + /** + * @describe: 扫描社区/小区二维码进行居民信息登记 + * @author wangtong + * @date 2022/8/2 16:01 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result + */ + @NoRepeatSubmit + @PostMapping("saveCollectInfo") + public Result saveCollectInfo(@RequestBody SaveCollectFormDTO formDTO) { + //效验数据 + ValidatorUtils.validateEntity(formDTO); + formDTO.setOrigin("internal");//固定为内部 + return icResiCollectService.saveCollectInfo(formDTO); + } + + /** + * @describe: 我的登记列表 + * @author wangtong + * @date 2022/8/3 13:59 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("getCollectPage") + public Result> getCollectPage(@LoginUser TokenDto tokenDto,@RequestBody CollectPageFormDTO dto) { + dto.setUserId(tokenDto.getUserId()); + dto.setCustomerId(tokenDto.getCustomerId()); + PageData page = icResiCollectService.getCollectPage(dto); + return new Result>().ok(page); + } + + /** + * 信息采集-审核通过-新增房屋-复显房屋信息 + * @param formDTO + * @param tokenDto + * @return + */ + @PostMapping("getHouseDetailByCollect") + public Result getHouseDetailByCollect(@RequestBody IcResiCollectGetDetailFormDTO formDTO, @LoginUser TokenDto tokenDto) { + return new Result().ok(icResiCollectService.getHouseDetailByCollect(formDTO)); + } + + /** + * @describe: 查看居民采集信息详情 + * @author wangtong + * @date 2022/8/3 15:05 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getCollectDetail") + public Result getCollectDetail(@RequestBody CollectDetailFormDTO dto) { + ValidatorUtils.validateEntity(dto); + return icResiCollectService.getCollectDetail(dto); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java new file mode 100644 index 0000000000..60995a0211 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java @@ -0,0 +1,137 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +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.IcResiCollectVisitorDTO; +import com.epmet.dto.SaveCollectVisitorFormDTO; +import com.epmet.dto.form.CollectDetailFormDTO; +import com.epmet.dto.form.CollectListFormDTO; +import com.epmet.dto.form.VisitListFormDTO; +import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.excel.IcResiCollectVisitorExcel; +import com.epmet.service.IcResiCollectVisitorService; +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 2022-08-02 + */ +@RestController +@RequestMapping("icResiCollectVisitor") +public class IcResiCollectVisitorController { + + @Autowired + private IcResiCollectVisitorService icResiCollectVisitorService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ +// PageData page = icResiCollectVisitorService.page(params); + PageData page = icResiCollectVisitorService.getPhrasePage(params); + return new Result>().ok(page); + + + } + + /** + * Desc: 访客记录列表 + * @param formDTO + * @param tokenDto + * @author wgf + * @date 2022/8/5 8:23 + */ + @PostMapping("list") +// @MaskResponse(fieldNames = { "memberIdNum", "memberMobile" }, +// fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE }) + public Result> getVisitorList(@RequestBody VisitListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icResiCollectVisitorService.getVisitorList(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcResiCollectVisitorDTO data = icResiCollectVisitorService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcResiCollectVisitorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiCollectVisitorService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcResiCollectVisitorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiCollectVisitorService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiCollectVisitorService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiCollectVisitorService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiCollectVisitorExcel.class); + } + + /** + * @describe: 保存访客信息 + * @author wangtong + * @date 2022/8/3 10:33 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @NoRepeatSubmit + @PostMapping("saveInfo") + public Result saveInfo(@RequestBody SaveCollectVisitorFormDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto); + return icResiCollectVisitorService.saveInfo(dto); + } + + /** + * @describe: 访客信息详情 + * @author wangtong + * @date 2022/8/3 15:41 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getVisitorDetail") + public Result getVisitorDetail(@RequestBody CollectDetailFormDTO dto) { + ValidatorUtils.validateEntity(dto); + return icResiCollectVisitorService.getVisitorDetail(dto); + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index f958d975d3..3e268bf8d9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -25,12 +25,14 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.annotation.ReportRequest; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.dto.form.IcExportTemplateSaveFormDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; @@ -67,6 +69,7 @@ import com.epmet.send.SendMqMsgUtil; import com.epmet.service.IcResiUserExportService; import com.epmet.service.IcResiUserImportService; import com.epmet.service.IcResiUserService; +import com.github.pagehelper.Page; import feign.RequestInterceptor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -187,10 +190,17 @@ public class IcResiUserController implements ResultDataResolver { IC_RESI_DOWNLOAD_DIR = exportDir; } + /** + * 批量删除居民信息 + * @param tokenDto + * @param formDTO + * @return + */ @NoRepeatSubmit @PostMapping("delete") public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, DelIcResiUserFormDTO.IdGroup.class); formDTO.getUserIds().forEach(userId -> { formDTO.setIcResiUserId(userId); @@ -368,6 +378,7 @@ public class IcResiUserController implements ResultDataResolver { return new Result<>(); } + @ReportRequest @PostMapping("listresi") @MaskResponse(fieldNames = {"MOBILE", "ID_CARD"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) public Result>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO) { @@ -524,7 +535,7 @@ public class IcResiUserController implements ResultDataResolver { log.info("通过原来的模板下载,tokenDto:{}", JSON.toJSONString(tokenDto)); this.exportExcelByEasyExcel(tokenDto, pageFormDTO.getSearchForm(), response); } else { - icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, response); + icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, response,false); } } catch (EpmetException e) { response.reset(); @@ -537,6 +548,60 @@ public class IcResiUserController implements ResultDataResolver { } } + /** + * desc: 自定义导出居民信息 不下载只有数据 + * + * @param tokenDto + * @param pageFormDTO + * @param response + * @return void + * @author LiuJanJun + * @date 2021/11/19 4:24 下午 + * @remark 用于报表调用的接口 试试 + */ + @ReportRequest + @NoRepeatSubmit + @RequestMapping(value = "/exportExcelCustomData") + public Map exportExcelCustomData(@LoginUser TokenDto tokenDto, @RequestParam("templateId") String templateId, + @RequestBody ExportResiUserFormDTO pageFormDTO) throws Exception { + log.warn("templateId=【"+templateId+"】"); + log.warn("pageFormDTO入参【"+JSON.toJSONString(pageFormDTO)+"】"); + pageFormDTO.setTemplateId(templateId); + if (null == pageFormDTO.getSearchForm()) { + IcResiUserPageFormDTO searchForm = new IcResiUserPageFormDTO(); + searchForm.setFormCode("resi_base_info"); + searchForm.setCustomerId(tokenDto.getCustomerId()); + searchForm.setStaffId(tokenDto.getUserId()); + // searchForm.setPageNo(pageFormDTO.getPageNo()); + // searchForm.setPageSize(pageFormDTO.getPageSize()); + List conditions=new ArrayList<>(); + // ResiUserQueryValueDTO temp=new ResiUserQueryValueDTO(); + // temp.setColumnName(""); + // temp.setColumnValue(Arrays.asList("IS_UNEMPLOYED")); + // temp.setQueryType("resi_category"); + // temp.setTableName("ic_resi_user"); + // conditions.add(temp); + searchForm.setConditions(conditions); + pageFormDTO.setSearchForm(searchForm); + } + pageFormDTO.getSearchForm().setPageNo(pageFormDTO.getPageNo()); + pageFormDTO.getSearchForm().setPageSize(pageFormDTO.getPageSize()); + if (null == pageFormDTO.getExportConfig()) { + IcExportTemplateSaveFormDTO exportTemplateSaveFormDTO = new IcExportTemplateSaveFormDTO(); + exportTemplateSaveFormDTO.setFormCode("resi_base_info"); + exportTemplateSaveFormDTO.setIsSaveTemp(false); + pageFormDTO.setExportConfig(exportTemplateSaveFormDTO); + } + //固定通用客户Id + pageFormDTO.setCustomerId("jmreport_resi_default"); + Page> maps = icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, null, true); + Map result = new HashMap<>(); + result.put("total",maps.getPages()); + result.put("count",maps.getTotal()); + result.put("data",maps.getResult()); + return result; + } + /** * desc:根据客户id 先从oss下载模版,如果有没有则使用系统默认模板 如果不存在则返回null * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java index db8eb3db7c..5210b45a27 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java @@ -2,7 +2,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.CollectListFormDTO; +import com.epmet.dto.form.IcResiCollectGetDetailFormDTO; +import com.epmet.dto.result.CollectHouseInfoResultDTO; import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.dto.result.CollectPageListDTO; import com.epmet.entity.IcResiCollectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,4 +46,20 @@ public interface IcResiCollectDao extends BaseDao { * @return */ List selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId); -} \ No newline at end of file + + /** + * @describe: 我的登记列表 + * @author wangtong + * @date 2022/8/3 14:19 + * @params [customerId] + * @return java.util.List + */ + List getCollectPage(@Param("customerId") String customerId, @Param("userId") String userId); + + /** + * 获取房屋信息 + * @param formDTO + * @return + */ + CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java new file mode 100644 index 0000000000..acf3fe568c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java @@ -0,0 +1,38 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcResiCollectVisitorDTO; +import com.epmet.dto.form.CollectListFormDTO; +import com.epmet.dto.form.VisitListFormDTO; +import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.entity.IcResiCollectVisitorEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 居民信息采集-访客 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-08-02 + */ +@Mapper +public interface IcResiCollectVisitorDao extends BaseDao { + + /** + * 条件查询 + * @param params + * @return + */ + List getPhrasePage(Map params); + + /** + * Desc: 查询访客信息 + * @param formDTO + * @author wgf + * @date 2022/8/5 8:41 + */ + List getCollectList(VisitListFormDTO formDTO); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java index e61539e1da..bd4c629d53 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java @@ -1,6 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcResiCollectMemDetailDTO; import com.epmet.dto.form.IcResiCollectMemFormDTO; import com.epmet.entity.IcResiMemberEntity; import org.apache.ibatis.annotations.Mapper; @@ -18,4 +19,12 @@ import java.util.List; public interface IcResiMemberDao extends BaseDao { List selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId); -} \ No newline at end of file + + /** + * 审核在用 + * @param collectId + * @return + */ + List selectListByCollectId(@Param("collectId") String collectId); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index ae94fe4ec2..1fedc84df4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -96,9 +96,9 @@ public interface IcResiUserDao extends BaseDao { @Param("icResiUserId") String icResiUserId, @Param("subTableName") String subTableName); - int updateToDel(String icResiUserId); + int updateToDel(@Param("icResiUserId") String icResiUserId,@Param("currentStaffId") String currentStaffId); - int updateSubTableToDel(@Param("subTalbeName") String subTalbeName, @Param("icResiUserId") String icResiUserId); + int updateSubTableToDel(@Param("subTalbeName") String subTalbeName, @Param("icResiUserId") String icResiUserId,@Param("currentStaffId")String currentStaffId); /** * 接口名称 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java index ecb3d1f561..4fa9fd0540 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java @@ -39,4 +39,6 @@ public interface IcUserChangeDetailedDao extends BaseDao icUserIds); + + int deleteByIcResiUserId(@Param("icResiUserId")String icResiUserId,@Param("currentStaffId")String currentStaffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index cff359168c..9c171f54f0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -49,4 +49,6 @@ public interface IcUserChangeRecordDao extends BaseDao * @Description 删除客户是新增类型的变更历史数据 **/ void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type, @Param("icUserIds") List icUserIds); + + int deleteByIcResiUserId(@Param("icResiUserId") String icResiUserId,@Param("currentStaffId")String currentStaffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java index dacd67bd6c..2042361b4c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.IcUserTransferRecordEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 居民调动记录表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcUserTransferRecordDao extends BaseDao { - + + int deleteByIcResiUserId(@Param("icResiUserId") String icResiUserId, @Param("currentStaffId")String currentStaffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java index 3b4b8ac3e0..8c11f4a849 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java @@ -86,4 +86,14 @@ public class IcResiCollectEntity extends BaseEpmetEntity { private String buildName; private String unitName; private String homeName; + + /** + * 审核状态:0待审核 1未通过 2已通过 + */ + private String checkState; + + /** + * 审核原因 + */ + private String checkReason; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java new file mode 100644 index 0000000000..7b9c8a7501 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectVisitorEntity.java @@ -0,0 +1,111 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 居民信息采集-访客 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-08-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_collect_visitor") +public class IcResiCollectVisitorEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 所属小区ID; + */ + private String villageId; + + /** + * 所属小区名称 + */ + private String villageName; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 所属楼宇名称 + */ + private String buildName; + + /** + * 单元id + */ + private String unitId; + + /** + * 单元名 + */ + private String unitName; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 房间名 + */ + private String homeName; + + /** + * 详细地址 + */ + private String address; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 来访事由 + */ + private String comeReason; + + /** + * 人脸照片 + */ + private String faceImg; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java index 583663a1a1..e49fbeb008 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java @@ -77,4 +77,14 @@ public class IcResiMemberEntity extends BaseEpmetEntity { * 备注 */ private String remark; + + /** + * 与房主关系 + */ + private String relationship; + + /** + * 人脸头像 + */ + private String faceImg; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java index 5b70e7a653..f787399b23 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java @@ -225,6 +225,10 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String isFloating; + /** + * 是否新阶层人士【是:1 否:0】 + */ + private String isXjc; /** * 文化程度【字典表】 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java index 7ae5d5d706..c921136c00 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java @@ -35,7 +35,8 @@ public enum IcResiUserTableEnum { IC_DB("virtual_db","大病人员信息录入表", null, 2, "IS_DB", false), IC_MB("virtual_mb","慢病人员信息录入表", null, 2, "IS_MB", false), IC_TENANT("virtual_tenant","租户信息录入表", null, 2, "IS_TENANT", false), - IC_FLOATING("virtual_floating","流动人口信息录入表", null, 2, "IS_FLOATING", false); + IC_FLOATING("virtual_floating","流动人口信息录入表", null, 2, "IS_FLOATING", false), + IC_XJC("virtual_xjc","新阶层人士信息录入表", null, 2, "IS_XJC", false); private String tableName; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java new file mode 100644 index 0000000000..32d4ce6836 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiCollectVisitorExcel.java @@ -0,0 +1,90 @@ +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 2022-08-02 + */ +@Data +public class IcResiCollectVisitorExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "组织的pids") + private String pids; + + @Excel(name = "所属小区ID;") + private String villageId; + + @Excel(name = "所属小区名称") + private String villageName; + + @Excel(name = "所属楼宇Id") + private String buildId; + + @Excel(name = "所属楼宇名称") + private String buildName; + + @Excel(name = "单元id") + private String unitId; + + @Excel(name = "单元名") + private String unitName; + + @Excel(name = "所属家庭Id") + private String homeId; + + @Excel(name = "房间名") + private String homeName; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "来访事由") + private String comeReason; + + @Excel(name = "人脸照片") + private String faceImg; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 8f3c43251c..be03fdfc96 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -3,11 +3,10 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.OrgInfoPointFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CommunityInfoResultDTO; import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.IcHouseInfoCollectResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @@ -85,4 +84,24 @@ public interface GovOrgFeignClient { @GetMapping("/gov/org/customeragency/getCommunityInfoByUserId/{userId}") Result getCommunityInfoByUserId(@PathVariable("userId") String userId); + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 更新房屋新 + * @Date 2020/4/26 23:16 + **/ + @PostMapping("/gov/org/house/updateCollect") + Result updateCollect(CollectHouseFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 获取房屋信息 + * @Date 2020/4/26 23:16 + **/ + @PostMapping("/gov/org/house/getHouseInfoToCollect") + Result getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 0c1f3a6342..77d306b310 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -4,11 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.OrgInfoPointFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CommunityInfoResultDTO; import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.IcHouseInfoCollectResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -51,4 +50,14 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { public Result getCommunityInfoByUserId(String userId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfoByUserId",userId); } + + @Override + public Result updateCollect(CollectHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "updateCollect",formDTO); + } + + @Override + public Result getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHouseInfoToCollect",formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiCollectVisitorRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiCollectVisitorRedis.java new file mode 100644 index 0000000000..f22d25ee1a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiCollectVisitorRedis.java @@ -0,0 +1,30 @@ +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 2022-08-02 + */ +@Component +public class IcResiCollectVisitorRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java index 17b6031472..07a97f933d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectService.java @@ -2,11 +2,12 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.form.CollectListFormDTO; -import com.epmet.dto.form.IcResiCollectFormDTO; -import com.epmet.dto.form.LatestSubmitCollectFormDTO; -import com.epmet.dto.form.ResiCollectFormDTO; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CollectHouseInfoResultDTO; import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.dto.result.CollectPageListDTO; import com.epmet.dto.result.LatestCollectResDTO; import com.epmet.entity.IcResiCollectEntity; @@ -56,4 +57,46 @@ public interface IcResiCollectService extends BaseService { * @return */ CollectListResultDTO detail(CollectListFormDTO formDTO); -} \ No newline at end of file + + /** + * 信息登记审核 + * @param formDTO + * @return + */ + void collectCheck(IcResiCollectCheckFormDTO formDTO, TokenDto tokenDto); + + /** + * @describe: 扫描社区/小区二维码进行居民信息登记 + * @author wangtong + * @date 2022/8/2 17:14 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result + */ + Result saveCollectInfo(SaveCollectFormDTO formDTO); + + /** + * @describe: 我的登记列表 + * @author wangtong + * @date 2022/8/3 14:14 + * @params [dto] + * @return com.epmet.commons.tools.page.PageData + */ + PageData getCollectPage(CollectPageFormDTO dto); + + /** + * @describe: 查看居民采集信息详情 + * @author wangtong + * @date 2022/8/3 15:08 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result getCollectDetail(CollectDetailFormDTO dto); + + /** + * 信息采集-获取房屋信息 + * @param formDTO + * @return + */ + CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO); +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java new file mode 100644 index 0000000000..5f7f3e4d25 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java @@ -0,0 +1,111 @@ +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.IcResiCollectVisitorDTO; +import com.epmet.dto.SaveCollectVisitorFormDTO; +import com.epmet.dto.form.CollectDetailFormDTO; +import com.epmet.dto.form.CollectListFormDTO; +import com.epmet.dto.form.VisitListFormDTO; +import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.entity.IcResiCollectVisitorEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民信息采集-访客 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-08-02 + */ +public interface IcResiCollectVisitorService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-08-02 + */ + PageData page(Map params); + + /** + * 分页条件查询 + * @param params + * @return + */ + PageData getPhrasePage(Map params); + + PageData getVisitorList(VisitListFormDTO formDTO); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-08-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiCollectVisitorDTO + * @author generator + * @date 2022-08-02 + */ + IcResiCollectVisitorDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-08-02 + */ + void save(IcResiCollectVisitorDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-08-02 + */ + void update(IcResiCollectVisitorDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-08-02 + */ + void delete(String[] ids); + + /** + * @describe: 保存访客信息 + * @author wangtong + * @date 2022/8/3 10:44 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result saveInfo(SaveCollectVisitorFormDTO dto); + + /** + * @describe: 访客信息详情 + * @author wangtong + * @date 2022/8/3 15:43 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result getVisitorDetail(CollectDetailFormDTO dto); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserExportService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserExportService.java index 53f9bee81f..f67864cf82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserExportService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserExportService.java @@ -2,8 +2,10 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.form.ExportResiUserFormDTO; +import com.github.pagehelper.Page; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** *@Description 居民信息导出service @@ -23,5 +25,5 @@ public interface IcResiUserExportService { * @author LiuJanJun * @date 2022/4/22 1:35 下午 */ - void exportIcResiUser(TokenDto tokenDto, ExportResiUserFormDTO exportResiUserFormDTO, HttpServletResponse response); + Page> exportIcResiUser(TokenDto tokenDto, ExportResiUserFormDTO exportResiUserFormDTO, HttpServletResponse response, boolean onlyGetData); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java index ce2747ddcd..2b164723f8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java @@ -36,4 +36,6 @@ public interface IcUserChangeDetailedService extends BaseService icUserIds); + + int deleteByIcResiUserId(String icResiUserId,String currentStaffId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java index a75d3a1fe1..620c786e5f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java @@ -54,4 +54,6 @@ public interface IcUserChangeRecordService extends BaseService page(Map params) { @@ -739,7 +745,28 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectStaffBasicInfo(String userId, String customerId) { - StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + StaffBasicInfoResultDTO resultDTO = null; + String userBaseInfoKey = RedisKeys.getUserBaseInfoKey(userId); + resultDTO = (StaffBasicInfoResultDTO)redisUtils.get(userBaseInfoKey); + if(resultDTO == null){ + resultDTO = getStaffBasicInfoResultDTO(userId, customerId, userBaseInfoKey); + } + //启用线程去查询 并替换redis + executorService.submit(() -> { + try { + getStaffBasicInfoResultDTO(userId, customerId, userBaseInfoKey); + } catch (Exception e) { + log.error("selectStaffBasicInfo exception", e); + } + }); + + return new Result().ok(resultDTO); + } + + @Nullable + private StaffBasicInfoResultDTO getStaffBasicInfoResultDTO(String userId, String customerId, String userBaseInfoKey) { + StaffBasicInfoResultDTO resultDTO; + resultDTO = baseDao.selectStaffBasicInfo(userId); if (null != resultDTO) { resultDTO.setRoleList(baseDao.selectStaffRoles(userId, resultDTO.getCustomerId())); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); @@ -767,7 +794,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(resultDTO); + redisUtils.delete(userBaseInfoKey); + redisUtils.set(userBaseInfoKey,resultDTO); + return resultDTO; } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index 5caeb3a008..93c25d9ec5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.RelationshipEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; @@ -12,18 +13,24 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcResiCollectDao; import com.epmet.dao.IcResiMemberDao; +import com.epmet.dao.IcResiUserDao; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CollectListResultDTO; -import com.epmet.dto.result.LatestCollectResDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcResiCollectEntity; import com.epmet.entity.IcResiMemberEntity; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.IcUserChangeRecordEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcResiCollectService; +import com.epmet.service.IcUserChangeRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; @@ -51,6 +58,19 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); //查询之前录入的成员表 Map memMap = queryOriginMem(origin.getId()); - saveOrUpdateMem(newMemberList, memMap,origin.getId()); + saveOrUpdateMem(newMemberList, memMap,origin); } } @@ -130,7 +150,64 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl memberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); + memberList.forEach(mem -> { + if (StringUtils.isNotBlank(mem.getName()) || StringUtils.isNotBlank(mem.getIdNum())) { + //姓名或份身份证号不为空时插入 + mem.setCustomerId(neighborHoodDTO.getCustomerId()); + mem.setIcResiCollectId(entity.getId()); + icResiMemberDao.insert(mem); + } + }); + } else { + IcResiCollectEntity collectInfo = baseDao.selectByAddress(formDTO.getAddress()); + //更新主表 + baseDao.updateRec(collectInfo.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),null); + List newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); + //查询之前录入的成员表 + Map memMap = queryOriginMem(collectInfo.getId()); + saveOrUpdateMem(newMemberList, memMap,collectInfo); + } + return new Result().ok("提交成功"); + } + + @Override + public PageData getCollectPage(CollectPageFormDTO dto) { + PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); + List list = baseDao.getCollectPage(dto.getCustomerId(),dto.getUserId()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + public Result getCollectDetail(CollectDetailFormDTO dto) { + IcResiCollectEntity entity = baseDao.selectById(dto.getId()); + if(null == entity){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "暂无查询到信息","暂无查询到信息"); + } + CollectDetailResultDTO result = ConvertUtils.sourceToTarget(entity, CollectDetailResultDTO.class); + //查询成员信息 + List memberList = icResiMemberDao.selectListByCollectId(dto.getId()); + result.setMemberList(memberList); + return new Result().ok(result); + } + + public IcNeighborHoodDTO queryIcNeighborHood(String villageId) { Result res = govOrgOpenFeignClient.getIcNeighbordhoodById(villageId); if (!res.success() || null == res.getData()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "小区信息查询异常", "小区信息查询异常"); @@ -146,12 +223,12 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl newMemberList, Map memMap, String originIcResiCollectId) { + private void saveOrUpdateMem(List newMemberList, Map memMap, IcResiCollectEntity collectInfo) { for (IcResiMemberEntity entity : newMemberList) { if(StringUtils.isNotBlank(entity.getIdNum())){ if (MapUtils.isNotEmpty(memMap) && memMap.containsKey(entity.getIdNum())) { - entity.setIcResiCollectId(originIcResiCollectId); - entity.setCustomerId(memMap.get(entity.getIdNum()).getCustomerId()); + entity.setIcResiCollectId(collectInfo.getId()); + entity.setCustomerId(collectInfo.getCustomerId()); entity.setId(memMap.get(entity.getIdNum()).getId()); icResiMemberDao.updateById(entity); continue; @@ -161,7 +238,8 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); //查询之前录入的成员表 Map memMap = queryOriginMem(origin.getId()); - saveOrUpdateMem(newMemberList, memMap,origin.getId()); + saveOrUpdateMem(newMemberList, memMap,origin); } } @@ -254,4 +332,245 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl memberList = icResiMemberDao.selectListByCollectId(formDTO.getId()); + + // 更新审核信息 + icResiCollectEntity.setCheckState(formDTO.getCheckState()); + icResiCollectEntity.setCheckReason(formDTO.getCheckReason()); + baseDao.updateById(icResiCollectEntity); + + // 审核状态:0待审核 1未通过 2已通过 + if("2".equals(formDTO.getCheckState())){ + + if("other".equals(icResiCollectEntity.getHomeId())){ + // 新增房屋(新增房屋操作已在审核接口之前,前端调用新增接口实现) + // 更新登记表房屋ID + icResiCollectEntity = updateHomeId(icResiCollectEntity,formDTO); + + for(int i = 0 ; i < memberList.size() ; i++){ + // 根据身份证号和房屋ID获取人员信息 + IcResiUserEntity userIdCardEntity = queryOriginUserByIdCard(memberList.get(i).getIdNum(),icResiCollectEntity.getCustomerId()); + if(userIdCardEntity != null){ + // 已存在人员 人员房屋不一致(更新人员信息和变更记录) + updateUserInfo(icResiCollectEntity,memberList.get(i),true,formDTO,userIdCardEntity); + }else{ + // 不存在人员 + insertUserInfo(icResiCollectEntity,memberList.get(i),formDTO); + } + } + }else{ + // 更新房屋 + updateHouseInfo(icResiCollectEntity); + + for(int i = 0 ; i < memberList.size() ; i++){ + // 根据身份证号和房屋ID获取人员信息 + IcResiUserEntity userIdCardEntity = queryOriginUserByIdCard(memberList.get(i).getIdNum(),icResiCollectEntity.getCustomerId()); + Map userMap = queryOriginUserByHomeId(icResiCollectEntity.getHomeId(),icResiCollectEntity.getCustomerId()); + if(userIdCardEntity != null){ + // 已存在人员 + if(userMap.containsKey(memberList.get(i).getIdNum())){ + // 人员房屋一致(只更新人员信息) + updateUserInfo(icResiCollectEntity,memberList.get(i),false,formDTO,userIdCardEntity); + }else{ + // 人员房屋不一致(更新人员信息和变更记录) + updateUserInfo(icResiCollectEntity,memberList.get(i),true,formDTO,userIdCardEntity); + } + }else{ + // 不存在人员 + insertUserInfo(icResiCollectEntity,memberList.get(i),formDTO); + } + } + } + } + } + + /** + * 更新登记表房屋ID + * @param icResiCollectEntity + * @param formDTO + * @return + */ + private IcResiCollectEntity updateHomeId(IcResiCollectEntity icResiCollectEntity,IcResiCollectCheckFormDTO formDTO){ + + // fegin获取房屋信息 + GetHouseInfoToCollectFormDTO getHouseInfoToCollectFormDTO = new GetHouseInfoToCollectFormDTO(); + getHouseInfoToCollectFormDTO.setBuildingUnitId(formDTO.getBuildingUnitId()); + getHouseInfoToCollectFormDTO.setDoorName(formDTO.getDoorName()); + Result resultDTOResult = govOrgFeignClient.getHouseInfoToCollect(getHouseInfoToCollectFormDTO); + IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = resultDTOResult.getData(); + + // 新增房屋后需要collect更新上房屋ID + // log + icResiCollectEntity.setHomeId(icHouseInfoCollectResultDTO.getId()); + baseDao.updateById(icResiCollectEntity); + return icResiCollectEntity; + + } + + /** + * 更新房屋信息 + * @param icResiCollectEntity + */ + private void updateHouseInfo(IcResiCollectEntity icResiCollectEntity){ + CollectHouseFormDTO collectHouseFormDTO = new CollectHouseFormDTO(); + collectHouseFormDTO.setId(icResiCollectEntity.getHomeId()); + collectHouseFormDTO.setOwnerName(icResiCollectEntity.getHouseHolderName()); + collectHouseFormDTO.setRentFlag(Integer.parseInt(icResiCollectEntity.getHouseType())); + collectHouseFormDTO.setCustomerId(icResiCollectEntity.getCustomerId()); + collectHouseFormDTO.setResiNumber(icResiCollectEntity.getTotalResi()); + govOrgFeignClient.updateCollect(collectHouseFormDTO); + + } + + /** + * 更新人员信息 + * @param icResiCollectEntity 登记信息 + * @param icResiCollectMemDetailDTO 登记城阳信息 + * @param isUpdateLog 是否更新记录 + * @param formDTO 入参 + * @param userEntity 根据身份证号查询到的user信息 + */ + private void updateUserInfo(IcResiCollectEntity icResiCollectEntity,IcResiCollectMemDetailDTO icResiCollectMemDetailDTO,Boolean isUpdateLog, + IcResiCollectCheckFormDTO formDTO,IcResiUserEntity userEntity){ + + // 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户 + if (RelationshipEnum.SELF.getCode().equals(icResiCollectMemDetailDTO.getRelationship())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = icResiUserDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身 + userEntity.setAgencyId(icResiCollectEntity.getAgencyId()); + userEntity.setGridId(icResiCollectEntity.getGridId()); + userEntity.setVillageId(icResiCollectEntity.getVillageId()); + userEntity.setBuildId(icResiCollectEntity.getBuildId()); + userEntity.setUnitId(icResiCollectEntity.getUnitId()); + userEntity.setHomeId(icResiCollectEntity.getHomeId()); + userEntity.setName(icResiCollectMemDetailDTO.getName()); + userEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); + userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); + userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); + userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); + userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); + userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); + icResiUserDao.updateById(userEntity); + + // 判断是否需要更新记录 + if(isUpdateLog){ + //变更记录表 + IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); + changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId()); + changeRecordEntity.setOperatorId(formDTO.getUserId()); + changeRecordEntity.setIcUserId(userEntity.getId()); + changeRecordEntity.setOperatorName(formDTO.getRealName()); + changeRecordEntity.setIcUserName(userEntity.getName()); + changeRecordEntity.setType("update"); + changeRecordEntity.setTypeName("修改"); + changeRecordEntity.setBeforeChangeName("-"); + changeRecordEntity.setAfterChangeName("-"); + changeRecordEntity.setChangeTime(new java.util.Date()); + icUserChangeRecordService.insert(changeRecordEntity); + } + + } + + /** + * 新增人员信息 + * @param icResiCollectMemDetailDTO + */ + private void insertUserInfo(IcResiCollectEntity icResiCollectEntity,IcResiCollectMemDetailDTO icResiCollectMemDetailDTO,IcResiCollectCheckFormDTO formDTO){ + + // 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户 + if (RelationshipEnum.SELF.getCode().equals(icResiCollectMemDetailDTO.getRelationship())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = icResiUserDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + // 新增人员 + IcResiUserEntity userEntity = new IcResiUserEntity(); + userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身 + userEntity.setAgencyId(icResiCollectEntity.getAgencyId()); + userEntity.setGridId(icResiCollectEntity.getGridId()); + userEntity.setVillageId(icResiCollectEntity.getVillageId()); + userEntity.setBuildId(icResiCollectEntity.getBuildId()); + userEntity.setUnitId(icResiCollectEntity.getUnitId()); + userEntity.setHomeId(icResiCollectEntity.getHomeId()); + userEntity.setName(icResiCollectMemDetailDTO.getName()); + userEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); + userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); + userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); + userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); + userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); + userEntity.setCustomerId(icResiCollectMemDetailDTO.getCustomerId()); + userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); + icResiUserDao.insert(userEntity); + + //变更记录表 + IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); + changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId()); + changeRecordEntity.setOperatorId(formDTO.getUserId()); + changeRecordEntity.setIcUserId(userEntity.getId()); + changeRecordEntity.setOperatorName(formDTO.getRealName()); + changeRecordEntity.setIcUserName(userEntity.getName()); + changeRecordEntity.setType("add"); + changeRecordEntity.setTypeName("新增"); + changeRecordEntity.setBeforeChangeName("-"); + changeRecordEntity.setAfterChangeName("-"); + changeRecordEntity.setChangeTime(new java.util.Date()); + icUserChangeRecordService.insert(changeRecordEntity); + + } + + /** + * 获取人员信息 + * @param idCard + * @return + */ + private IcResiUserEntity queryOriginUserByIdCard(String idCard,String customerId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcResiUserEntity::getIdCard, idCard); + query.eq(IcResiUserEntity::getCustomerId, customerId); + IcResiUserEntity originUser = icResiUserDao.selectOne(query); + return originUser; + } + private Map queryOriginUserByHomeId(String homeId,String customerId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcResiUserEntity::getHomeId, homeId); + query.eq(IcResiUserEntity::getCustomerId, customerId); + List originUserList = icResiUserDao.selectList(query); + Map memMap = originUserList.stream().collect(Collectors.toMap(IcResiUserEntity::getIdCard, Function.identity())); + return memMap; + } + + @Override + public CollectHouseInfoResultDTO getHouseDetailByCollect(IcResiCollectGetDetailFormDTO formDTO) { + + CollectHouseInfoResultDTO collectHouseInfoResultDTO = baseDao.getHouseDetailByCollect(formDTO); + + return collectHouseInfoResultDTO; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java new file mode 100644 index 0000000000..ccb7451952 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java @@ -0,0 +1,158 @@ +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcResiCollectVisitorDao; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.IcResiCollectVisitorDTO; +import com.epmet.dto.SaveCollectVisitorFormDTO; +import com.epmet.dto.form.CollectDetailFormDTO; +import com.epmet.dto.form.CollectListFormDTO; +import com.epmet.dto.form.VisitListFormDTO; +import com.epmet.dto.result.CollectListResultDTO; +import com.epmet.entity.IcResiCollectVisitorEntity; +import com.epmet.redis.IcResiCollectVisitorRedis; +import com.epmet.service.IcResiCollectVisitorService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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 2022-08-02 + */ +@Service +public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl implements IcResiCollectVisitorService { + + @Autowired + private IcResiCollectVisitorRedis icResiCollectVisitorRedis; + + @Autowired + private IcResiCollectServiceImpl icResiCollectServiceImpl; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiCollectVisitorDTO.class); + } + + /** + * 条件查询 + * @param params + * @return + */ + @Override + public PageData getPhrasePage(Map params) { + IPage page = getPage(params); + List list = baseDao.getPhrasePage(params); + return new PageData<>(list, page.getTotal()); + } + + /** + * Desc: 查询访客信息 + * @param formDTO + * @author wgf + * @date 2022/8/5 8:23 + */ + @Override + public PageData getVisitorList(VisitListFormDTO formDTO) { + PageData result = new PageData<>(new ArrayList<>(), 0); + if (StringUtils.isBlank(formDTO.getStartTime()) && StringUtils.isBlank(formDTO.getEndTime()) ){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询人员信息失败"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + } + PageInfo pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO)); + result.setList(pageList.getList()); + result.setTotal(Integer.parseInt(String.valueOf(pageList.getTotal()))); + return result; + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiCollectVisitorDTO.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 IcResiCollectVisitorDTO get(String id) { + IcResiCollectVisitorEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiCollectVisitorDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiCollectVisitorDTO dto) { + IcResiCollectVisitorEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectVisitorEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiCollectVisitorDTO dto) { + IcResiCollectVisitorEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectVisitorEntity.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 Result saveInfo(SaveCollectVisitorFormDTO dto) { + IcResiCollectVisitorEntity entity = ConvertUtils.sourceToTarget(dto, IcResiCollectVisitorEntity.class); + //根据小区id查询网格相关信息 + IcNeighborHoodDTO neighborHoodDTO = icResiCollectServiceImpl.queryIcNeighborHood(dto.getVillageId()); + entity.setGridId(neighborHoodDTO.getGridId()); + entity.setAgencyId(neighborHoodDTO.getAgencyId()); + entity.setPids(neighborHoodDTO.getAgencyPids()); + entity.setCustomerId(neighborHoodDTO.getCustomerId()); + insert(entity); + return new Result().ok("提交成功"); + } + + @Override + public Result getVisitorDetail(CollectDetailFormDTO dto) { + IcResiCollectVisitorEntity entity = baseDao.selectById(dto.getId()); + return new Result().ok(entity); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java index a5ff0484c8..8157ac1ccf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java @@ -31,6 +31,7 @@ import com.epmet.constant.IcResiUserConstant; import com.epmet.dto.form.ExportResiUserFormDTO; import com.epmet.dto.form.IcExportTemplateQueryFormDTO; import com.epmet.dto.form.IcResiUserPageFormDTO; +import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.dto.result.IcCustomExportResultDTO; import com.epmet.dto.result.OptionDTO; @@ -45,6 +46,7 @@ import com.google.common.base.Joiner; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.usermodel.VerticalAlignment; @@ -91,7 +93,9 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { * @date 2022/4/22 1:35 下午 */ @Override - public void exportIcResiUser(TokenDto tokenDto, ExportResiUserFormDTO exportResiUserFormDTO, HttpServletResponse response) { + public Page> exportIcResiUser(TokenDto tokenDto, ExportResiUserFormDTO exportResiUserFormDTO, HttpServletResponse response, boolean onlyGetData) { + Page> mapListPage = null; + //校验参数 this.validateSearchForm(tokenDto, exportResiUserFormDTO); IcResiUserPageFormDTO searchForm = exportResiUserFormDTO.getSearchForm(); @@ -99,9 +103,11 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { String templateId = exportResiUserFormDTO.getTemplateId(); ExcelWriter excelWriter = null; + WriteSheet writeSheet = null; try { + String dynamicCustomerId=StringUtils.isNotBlank(exportResiUserFormDTO.getCustomerId()) ? exportResiUserFormDTO.getCustomerId() : tokenDto.getCustomerId(); //获取用户配置的导出条件 - Result exportConfigResult = this.getIcCustomExportConfig(searchForm.getCustomerId(), templateId, exportResiUserFormDTO.getExportConfig()); + Result exportConfigResult = this.getIcCustomExportConfig(dynamicCustomerId, templateId, exportResiUserFormDTO.getExportConfig()); Map itemOriginMap = getItemMap(searchForm.getCustomerId()); IcCustomExportResultDTO exportConfigData = exportConfigResult.getData(); @@ -114,36 +120,42 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { List allShowColumns = new ArrayList<>(exportConfigData.getShowSqlColumns()); - //需要合并的列 - List mergeColumnIndexList = new ArrayList<>(); - for (int i = 0; i < allShowColumns.size(); i++) { - IcCustomExportResultDTO.SqlColumn sqlColumn = allShowColumns.get(i); - if (!sqlColumn.getManyToOne()) { - mergeColumnIndexList.add(i); + + + if (!onlyGetData){ + searchForm.setIsPage(false); + searchForm.setPageSize(NumConstant.TEN_THOUSAND); + + //需要合并的列 + List mergeColumnIndexList = new ArrayList<>(); + for (int i = 0; i < allShowColumns.size(); i++) { + IcCustomExportResultDTO.SqlColumn sqlColumn = allShowColumns.get(i); + if (!sqlColumn.getManyToOne()) { + mergeColumnIndexList.add(i); + } } - } + int[] mergeColumnIndex = mergeColumnIndexList.stream().filter(Objects::nonNull).mapToInt(i -> i).toArray(); + // 从那一列开始合并 + int mergeRowIndex = exportConfigData.getHeaderRow(); - int[] mergeColumnIndex = mergeColumnIndexList.stream().filter(Objects::nonNull).mapToInt(i -> i).toArray(); - // 从那一列开始合并 - int mergeRowIndex = exportConfigData.getHeaderRow(); - - // 头的策略 - WriteCellStyle headWriteCellStyle = new WriteCellStyle(); - // 背景设置为红色 - headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); - WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); - contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); - HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); - FreezeAndFilter writeHandler = new FreezeAndFilter(); - //从第几行开始冻结 - writeHandler.rowSplit = exportConfigData.getHeaderRow(); - excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("居民基本信息.xlsx", response)) - .registerWriteHandler(new ExcelFillCellMergeStrategy(mergeRowIndex, mergeColumnIndex)) - .registerWriteHandler(horizontalCellStyleStrategy) - .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .registerWriteHandler(writeHandler).build(); - - WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").head(exportConfigData.getHeaders()).build(); + // 头的策略 + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + // 背景设置为红色 + headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); + FreezeAndFilter writeHandler = new FreezeAndFilter(); + //从第几行开始冻结 + writeHandler.rowSplit = exportConfigData.getHeaderRow(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("居民基本信息.xlsx", response)) + .registerWriteHandler(new ExcelFillCellMergeStrategy(mergeRowIndex, mergeColumnIndex)) + .registerWriteHandler(horizontalCellStyleStrategy) + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + .registerWriteHandler(writeHandler).build(); + + writeSheet = EasyExcel.writerSheet("Sheet1").head(exportConfigData.getHeaders()).build(); + } String staffOrgPath = null; if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { @@ -151,15 +163,31 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { } else { staffOrgPath = staffInfoCacheResult.getAgencyId(); } - Page> mapListPage = null; allShowColumns.addAll(exportConfigData.getHiddenSqlColumns()); do { + if(StringUtils.isNotBlank(exportResiUserFormDTO.getId())){ + ResiUserQueryValueDTO idCondition=new ResiUserQueryValueDTO(); + idCondition.setTableName("ic_resi_user"); + idCondition.setQueryType("equal"); + idCondition.setColumnName("ID"); + idCondition.setColumnValue(Arrays.asList(exportResiUserFormDTO.getId())); + + if(CollectionUtils.isNotEmpty(searchForm.getConditions())){ + searchForm.getConditions().add(idCondition); + }else{ + List conditions=new ArrayList<>(); + conditions.add(idCondition); + searchForm.setConditions(conditions); + } + } String finalStaffOrgPath = staffOrgPath; mapListPage = PageHelper.startPage(searchForm.getPageNo(), searchForm.getPageSize(), searchForm.getIsPage()).doSelectPage(() -> { icResiUserService.dynamicQuery(searchForm.getCustomerId(), searchForm.getFormCode(), IcResiUserConstant.IC_RESI_USER, allShowColumns, searchForm.getConditions(), staffInfoCacheResult.getAgencyId(), finalStaffOrgPath); }); - searchForm.setPageNo(searchForm.getPageNo() + NumConstant.ONE); + if (!searchForm.getIsPage()){ + searchForm.setPageNo(searchForm.getPageNo() + NumConstant.ONE); + } List> result = mapListPage.getResult(); @@ -168,46 +196,12 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { List showSqlColumns = exportConfigData.getShowSqlColumns(); Set hiddenColumnSet = exportConfigData.getHiddenSqlColumns().stream().map(IcCustomExportResultDTO.SqlColumn::getColumnName).collect(Collectors.toSet()); result.forEach(o -> { - List singleRowData = new ArrayList<>(); - Map originalConditionMap = new ConcurrentHashMap<>(); - o.forEach((key, value) -> { - Map itemMap = showSqlColumns.stream().collect(Collectors.toMap(IcCustomExportResultDTO.SqlColumn::getColumnName, item -> item)); - IcCustomExportResultDTO.SqlColumn columnDTO = itemMap.get(key); - //忽略 不需要显示的列的值得设置 要不然数据会写入到excel中 - if (singleRowData.size() >= showSqlColumns.size()) { - return; - } - - IcCustomExportResultDTO.SqlColumn sqlColumn = itemMap.get(key); - String tableName = sqlColumn.getTableName(); - String itemId = sqlColumn.getItemId(); - String columnName = columnDTO.getColumnName(); - if (hiddenColumnSet.contains(columnName)) { - return; - } - String vauleStr = value == null ? StrConstant.EPMETY_STR : value.toString(); - //保留原始值 便于remote条件获取 - originalConditionMap.putIfAbsent(columnName, vauleStr); - ExportResiUserItemDTO exportResiUserItemDTO = itemOriginMap.get(tableName); - FormItemResult formItemResult = exportResiUserItemDTO.getItemMap().get(columnName); - - String newValue = vauleStr; - - if (Constant.OPITON_SOURCE_REMOTE.equals(sqlColumn.getOptionSourceType()) && StringUtils.isNotBlank(vauleStr)) { - putRemoteValue(exportResiUserItemDTO.getRemoteItemConditionMap().get(itemId), staffInfoCacheResult.getAgencyId(), o, originalConditionMap, formItemResult, columnName, vauleStr); - newValue = String.valueOf(o.get(columnName)); - } else if (Constant.OPITON_SOURCE_LOCAL.equals(sqlColumn.getOptionSourceType())) { - newValue = putOptionValue(formItemResult, vauleStr); - } - if (FieldConstant.ID.equals(key)) { - newValue = Md5Util.md5(vauleStr); - } - singleRowData.add(newValue); - }); - resultData.add(singleRowData); + getDataForResi(itemOriginMap, staffInfoCacheResult, resultData, showSqlColumns, hiddenColumnSet, o); }); - excelWriter.write(resultData, writeSheet); - } while (mapListPage.getResult().size() == searchForm.getPageSize()); + if (!onlyGetData){ + excelWriter.write(resultData, writeSheet); + } + } while (!searchForm.getIsPage() && mapListPage.getResult().size() == searchForm.getPageSize()); } catch (IOException e) { log.error("exportIcResiUser exception", e); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMessage(), "导出失败"); @@ -216,6 +210,48 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { excelWriter.finish(); } } + return mapListPage; + } + + private void getDataForResi(Map itemOriginMap, CustomerStaffInfoCacheResult staffInfoCacheResult, List> resultData, List showSqlColumns, Set hiddenColumnSet, Map o) { + List singleRowData = new ArrayList<>(); + Map originalConditionMap = new ConcurrentHashMap<>(); + o.forEach((key, value) -> { + Map itemMap = showSqlColumns.stream().collect(Collectors.toMap(IcCustomExportResultDTO.SqlColumn::getColumnName, item -> item)); + IcCustomExportResultDTO.SqlColumn columnDTO = itemMap.get(key); + //忽略 不需要显示的列的值得设置 要不然数据会写入到excel中 + if (singleRowData.size() >= showSqlColumns.size()) { + return; + } + + IcCustomExportResultDTO.SqlColumn sqlColumn = itemMap.get(key); + String tableName = sqlColumn.getTableName(); + String itemId = sqlColumn.getItemId(); + String columnName = columnDTO.getColumnName(); + if (hiddenColumnSet.contains(columnName)) { + return; + } + String vauleStr = value == null ? StrConstant.EPMETY_STR : value.toString(); + //保留原始值 便于remote条件获取 + originalConditionMap.putIfAbsent(columnName, vauleStr); + ExportResiUserItemDTO exportResiUserItemDTO = itemOriginMap.get(tableName); + FormItemResult formItemResult = exportResiUserItemDTO.getItemMap().get(columnName); + + String newValue = vauleStr; + + if (Constant.OPITON_SOURCE_REMOTE.equals(sqlColumn.getOptionSourceType()) && StringUtils.isNotBlank(vauleStr)) { + putRemoteValue(exportResiUserItemDTO.getRemoteItemConditionMap().get(itemId), staffInfoCacheResult.getAgencyId(), o, originalConditionMap, formItemResult, columnName, vauleStr); + newValue = String.valueOf(o.get(columnName)); + } else if (Constant.OPITON_SOURCE_LOCAL.equals(sqlColumn.getOptionSourceType())) { + newValue = putOptionValue(formItemResult, vauleStr); + } + o.put(key,newValue); + if (FieldConstant.ID.equals(key)) { + newValue = Md5Util.md5(vauleStr); + } + singleRowData.add(newValue); + }); + resultData.add(singleRowData); } /** @@ -229,8 +265,6 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { searchForm.setCustomerId(tokenDto.getCustomerId()); searchForm.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(searchForm, IcResiUserPageFormDTO.AddUserInternalGroup.class); - searchForm.setIsPage(false); - searchForm.setPageSize(NumConstant.TEN_THOUSAND); } @Nullable diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index f0fcfceefc..d8f57e4e81 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -176,14 +176,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO); if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) { for (String subTalbeName : subTableRes.getData()) { - baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId()); + baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); } } + //删除ic_user_transfer_record、ic_user_change_record、ic_user_change_detailed + icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); + icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); + icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); } /** @@ -536,6 +540,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : formMap.get("ic_party_member")) { + if (!hash.containsKey("ID") && !hash.containsKey("SSZB")) { + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } + } } if ((map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY"))) || (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty()))) { @@ -960,6 +973,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl(pageInfo.getList(), pageInfo.getTotal(), formDTO.getPageSize()); + } return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java index dbdb593d7a..060eab7ba7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java @@ -43,4 +43,9 @@ public class IcUserChangeDetailedServiceImpl extends BaseServiceImpl icUserIds) { baseDao.delByCustomerId(customerId, type, icUserIds); } + + @Override + public int deleteByIcResiUserId(String icResiUserId,String currentStaffId) { + return baseDao.deleteByIcResiUserId(icResiUserId,currentStaffId); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index f72d695c5e..2ccf5d5119 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -171,6 +171,11 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl @@ -16,6 +16,9 @@ + + + @@ -26,6 +29,9 @@ c.ADDRESS AS address, c.HOUSE_TYPE AS houseType, c.TOTAL_RESI AS totalResi, + c.HOME_ID as homeId, + c.CHECK_STATE as checkState, + c.AGENCY_ID as agencyId, #{domicilePlace} as domicile_place FROM ic_resi_collect c left join ic_resi_member m on(c.id=m.IC_RESI_COLLECT_ID and m.del_flag='0') @@ -61,7 +67,9 @@ m.DOMICILE_PLACE_CODE as domicilePlaceCode, m.DOMICILE_PLACE_CODE_PATH as domicilePlaceCodePath, m.WORK_PLACE as workPlace, - m.REMARK as remark + m.REMARK as remark, + m.RELATIONSHIP as relationship, + m.FACE_IMG as faceImg from ic_resi_member m where m.DEL_FLAG = 0 and m.IC_RESI_COLLECT_ID = #{id} @@ -85,7 +93,8 @@ UPDATED_BY = #{updatedBy}, - UPDATED_TIME = NOW() + UPDATED_TIME = NOW(), + CHECK_STATE = '0' WHERE id = #{id} @@ -102,4 +111,56 @@ ORDER BY m.UPDATED_TIME DESC - \ No newline at end of file + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectVisitorDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectVisitorDao.xml new file mode 100644 index 0000000000..52cdb9ace8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectVisitorDao.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml index 13db077a3c..d7cfcc48f2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml @@ -25,4 +25,11 @@ AND m.DEL_FLAG = '0' AND ( m.CREATED_BY = #{userId} OR m.UPDATED_BY = #{userId} ) - \ No newline at end of file + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 8ba307f70c..976ab930d6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -213,7 +213,7 @@ ORDER BY - IC_RESI_USER.GRID_ID ASC, + IC_RESI_USER.GRID_ID desc, IC_RESI_USER.VILLAGE_ID ASC, IC_RESI_USER.BUILD_ID ASC, IC_RESI_USER.UNIT_ID ASC, @@ -221,12 +221,20 @@ IC_RESI_USER.ID ASC - - update ic_resi_user set del_flag='1' where id=#{icResiUserId} + + update ic_resi_user + set del_flag='1', + UPDATED_TIME = now(), + UPDATED_BY = #{currentStaffId} + where id = #{icResiUserId} - update ${subTalbeName} set del_flag='1' where IC_RESI_USER=#{icResiUserId} + update ${subTalbeName} + set del_flag='1', + UPDATED_TIME = now(), + UPDATED_BY = #{currentStaffId} + where IC_RESI_USER=#{icResiUserId} update diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml index 0931d47836..c2a8804395 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml @@ -15,4 +15,11 @@ + + update ic_user_change_detailed + set del_flag='1', + UPDATED_TIME = now(), + UPDATED_BY = #{currentStaffId} + where IC_USER_ID=#{icResiUserId} + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index cd04e8ddfa..4b7203f075 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -73,4 +73,12 @@ + + update ic_user_change_record + set del_flag='1', + UPDATED_TIME = now(), + UPDATED_BY = #{currentStaffId} + where IC_USER_ID = #{icResiUserId} + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml index be24ced9be..2729a66899 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserTransferRecordDao.xml @@ -3,5 +3,11 @@ - + + update ic_user_transfer_record + set del_flag='1', + UPDATED_TIME = now(), + UPDATED_BY = #{currentStaffId} + where IC_USER_ID = #{icResiUserId} + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ff15bf358e..95a3495790 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,8 @@ epmet-module epmet-user epmet-openapi - + epmet-commons/epmet-commons-feignclient + UTF-8