diff --git a/doc/epmet-cloud.md b/doc/epmet-cloud.md index 43cd0d2f63..28dfe7ff08 100644 --- a/doc/epmet-cloud.md +++ b/doc/epmet-cloud.md @@ -10,4 +10,7 @@ 例如:有A、B2个服务,并且A调用B,如果我们只需要开发A服务,那本地只启动A服务即可,A调用B的时候,会调用服务器的B服务。 如果需要开发AB2个服务,那么将A中的FeignClient的url属性指向localhost。 PS:目前正在测试通过负载均衡器和本地环境变量实现动态修改目标服务IP,成功之后就不需要再修改FeignClient的url,配置一下环境变量即可,到时候具体说 -``` \ No newline at end of file +``` + +如何安装本地jar到本地仓库: +mvn install:install-file -DgroupId=com.inspurcloud -DartifactId=oss -D version=1.1.8 -Dpackaging=jar -Dfile=inspur-cloud-oss-sdk-1.1.8.jar \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 6ec5301b2a..255524170b 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -233,7 +233,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 epmet_message diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index dbf4156922..3dadb32519 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -198,6 +198,7 @@ public class ThirdLoginController { * * @param formDTO * @return + * 目前烟台用的这个!!!!!! */ @PostMapping("resilogin-internalding") public Result resiLoginInternalDing(@RequestBody DingAppLoginMdFormDTO formDTO) { diff --git a/epmet-commons/epmet-commons-mybatis/pom.xml b/epmet-commons/epmet-commons-mybatis/pom.xml index db396c4042..62c677e014 100644 --- a/epmet-commons/epmet-commons-mybatis/pom.xml +++ b/epmet-commons/epmet-commons-mybatis/pom.xml @@ -47,22 +47,22 @@ mysql-connector-java - + - + - + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index 50494598ac..87b6eec666 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -4,6 +4,7 @@ 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import lombok.extern.slf4j.Slf4j; @@ -57,7 +58,8 @@ public class NoRepeatSubmitAop { //因为getLock如果获取失败抛异常 所以不做锁状态的判断 } } catch (Exception e) { - log.warn("noRepeatSubmit key:{},msg:{}", key, e.getMessage()); + String error = ExceptionUtils.getErrorStackTrace(e); + log.warn("noRepeatSubmit key:{},msg:{}", key, error); //"未获取到锁,重复提交了 throw new RenException(EpmetErrorCode.REPEAT_SUBMIT.getCode()); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java index 260e4edb83..c745f4d9c5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/RedissonConfig.java @@ -1,6 +1,7 @@ package com.epmet.commons.tools.config; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.redisson.Redisson; @@ -18,24 +19,24 @@ import org.springframework.context.annotation.Configuration; @Configuration public class RedissonConfig { - @Value("${spring.redis.host}") - private String host; - @Value("${spring.redis.port}") - private String port; + //@Value("${spring.redis.host}") + //private String host; + //@Value("${spring.redis.port}") + //private String port; @Value("${spring.redis.password}") private String password; @Value("${spring.redis.cluster.nodes}") private String clusterNodesStr; - @Value("${spring.redis.cluster.max-redirects}") - private Integer rediTimes; +// @Value("${spring.redis.cluster.max-redirects}") +// private Integer rediTimes; @Bean public RedissonClient getRedisson() { - if (StringUtils.isBlank(host)) { - log.warn("getRedisson redis param is null,don't need to init redissonClient"); - return null; - } + //if (StringUtils.isBlank(host)) { + // log.warn("getRedisson redis param is null,don't need to init redissonClient"); + // return null; + //} try { Config config = new Config(); @@ -55,6 +56,7 @@ public class RedissonConfig { config.useClusterServers().addNodeAddress(getClusterNodes()); config.useClusterServers().setPassword(password); config.useClusterServers().setConnectTimeout(NumConstant.ONE_THOUSAND * NumConstant.FIVE); + return Redisson.create(config); } catch (Exception e) { log.error("初始化redisson失败", e); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index fb294721f8..57e1a2b236 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -101,7 +101,8 @@ public interface StrConstant { String PY_ROOT_AGENCY = "53613e1c5de6ed473467f0159a10b135"; //磐石街道客户Id String PS_CUSTOMER_ID = "1580460084738760705"; - + //小寨子客户id + String XIAOZHAIZI_CUSTOMER_ID="1536638904600752130"; /** * 单位积分,积分上限,积分说明,积分事件 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java index 66abe790f3..61b5b6f250 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java @@ -88,11 +88,12 @@ public class CustomerStaffRedis { private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) { Result staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId); if (staffResult == null || !staffResult.success()) { + log.error("/data/aggregator/epmetuser/getStaffInfo/{staffId} 异常 staffId: ",staffId); throw new RenException("获取工作人员信息失败"); } CustomerStaffInfoCache resultData = staffResult.getData(); if (resultData == null) { - log.warn("getStaffInfo staff is null,staffId:{}", staffId); + log.error("getStaffInfo staff is null,staffId:{}", staffId); return null; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/CustomMergeStrategy.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/CustomMergeStrategy.java new file mode 100644 index 0000000000..bbe8cafbca --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/CustomMergeStrategy.java @@ -0,0 +1,91 @@ +package com.epmet.commons.tools.utils.poi.excel.handler;/** + * @author ZhaoQiFeng + * @date 2022/12/14 + * @apiNote + */ + +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.write.merge.AbstractMergeStrategy; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; + +import java.util.ArrayList; +import java.util.List; + +/** + * 自定义合并策略 该类继承了AbstractMergeStrategy抽象合并策略,需要重写merge()方法 + * @Author zhaoqifeng + * @Date 2022/12/14 15:10 + */ +public class CustomMergeStrategy extends AbstractMergeStrategy { + + /** + * 分组,每几行合并一次 + */ + private List exportFieldGroupCountList; + + /** + * 目标合并列index + */ + private Integer targetColumnIndex; + + // 需要开始合并单元格的首行index + private Integer rowIndex; + + // exportDataList为待合并目标列的值 + public CustomMergeStrategy(List exportDataList, Integer targetColumnIndex) { + this.exportFieldGroupCountList = getGroupCountList(exportDataList); + this.targetColumnIndex = targetColumnIndex; + } + + + @Override + protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { + + if (null == rowIndex) { + rowIndex = cell.getRowIndex(); + } + // 仅从首行以及目标列的单元格开始合并,忽略其他 + if (cell.getRowIndex() == rowIndex && cell.getColumnIndex() == targetColumnIndex) { + mergeGroupColumn(sheet); + } + } + + private void mergeGroupColumn(Sheet sheet) { + int rowCount = rowIndex; + for (Integer count : exportFieldGroupCountList) { + if(count == 1) { + rowCount += count; + continue ; + } + // 合并单元格 + CellRangeAddress cellRangeAddress = new CellRangeAddress(rowCount, rowCount + count - 1, targetColumnIndex, targetColumnIndex); + sheet.addMergedRegionUnsafe(cellRangeAddress); + rowCount += count; + } + } + + // 该方法将目标列根据值是否相同连续可合并,存储可合并的行数 + private List getGroupCountList(List exportDataList){ + if (CollectionUtils.isEmpty(exportDataList)) { + return new ArrayList<>(); + } + + List groupCountList = new ArrayList<>(); + int count = 1; + + for (int i = 1; i < exportDataList.size(); i++) { + if (exportDataList.get(i).equals(exportDataList.get(i - 1))) { + count++; + } else { + groupCountList.add(count); + count = 1; + } + } + // 处理完最后一条后 + groupCountList.add(count); + return groupCountList; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/CustomerTitleHandler.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/CustomerTitleHandler.java new file mode 100644 index 0000000000..fe575e54b8 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/CustomerTitleHandler.java @@ -0,0 +1,61 @@ +package com.epmet.commons.tools.utils.poi.excel.handler; + +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.metadata.data.CellData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.excel.write.handler.CellWriteHandler; +import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import com.alibaba.excel.write.metadata.holder.WriteTableHolder; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; +import org.springframework.util.PropertyPlaceholderHelper; + +import java.util.List; +import java.util.Properties; + +/** + * desc:标头策略 + * + */ +public class CustomerTitleHandler implements CellWriteHandler { + private String title = "xixihaha"; + PropertyPlaceholderHelper placeholderHelper = new PropertyPlaceholderHelper("${", "}"); + public CustomerTitleHandler(String title) { + this.title = title; + } + /*public CustomerTitleHandler(String title) { + this.title = "nihao s"; + }*/ + @Override + public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder,Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { + if (head != null) { + List headNameList = head.getHeadNameList(); + if (CollectionUtils.isNotEmpty(headNameList)) { + Properties properties = new Properties(); + properties.setProperty("title", title); + headNameList.set(1, placeholderHelper.replacePlaceholders(headNameList.get(1), properties)); + } + } + } + @Override + public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, + Cell cell, Head head, Integer integer, Boolean aBoolean) { + + } + + @Override + public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, + WriteCellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) { + + } + + @Override + public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, + List> list, Cell cell, Head head, Integer integer, Boolean aBoolean) { + + } +} diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 3cd5f02c6f..8efbf5c56e 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -524,6 +524,8 @@ epmet: - /oper/customize/customerstartpage/homestartpage - /epmet/point/mqCallback/** - /tduck-api/** + - /data/report/indexexplain/dplist + - /data/report/indexexplain/firsthistoryscore #居民信息采集:查询楼栋,单元,房屋,提交信息 - /gov/org/icneighborhood/open/list - /gov/org/icbuilding/buildingoption diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index ae05f1af6e..91e0645faf 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -30,6 +30,7 @@ public interface DataSourceConstant { String DATA_STATISTICAL="datastatistical"; String EVALUATION_INDEX = "evaluationIndex"; + String EVALUATION_INDEX_READ = "evaluationIndexRead"; String OPERCUSTOMIZE="opercustomize"; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/EventConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/EventConstant.java new file mode 100644 index 0000000000..ad8948fa23 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/EventConstant.java @@ -0,0 +1,10 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午10:47 + */ +public interface EventConstant { + String PROJECT = "project"; + String WORK = "work"; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ListStaffFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ListStaffFormDTO.java index e7569b16d1..bec51ab4db 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ListStaffFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ListStaffFormDTO.java @@ -25,4 +25,9 @@ public class ListStaffFormDTO implements Serializable { private String customerId; public interface Staff extends CustomerClientShowGroup {} + /** + * 姓名或者手机号 + * 可以不填 + */ + private String keyWord; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/EventCategoryResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/EventCategoryResultDTO.java new file mode 100644 index 0000000000..0d16f1d598 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/EventCategoryResultDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dataaggre.dto.evaluationindex; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/4 3:13 下午 + * @DESC + */ +@Data +public class EventCategoryResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 类型,project:事件, work:例行工作 + */ + private String eventType; + + /** + * 分类CODE + */ + private String categoryCode; + + /** + * 分类code父级 + */ + private String parentCategoryCode; + + /** + * 分类名字 + */ + private String categoryName; + + /** + * 分类名字父级 + */ + private String parentCategoryName; + + /** + * 项目数 + */ + private Integer eventTotal; + + /** + * 分值 + */ + private Integer score; + + private Integer totalScore; + + private List children; + @JsonIgnore + private Integer index; + + public EventCategoryResultDTO() { + this.categoryCode = ""; + this.categoryName = ""; + this.eventTotal = NumConstant.ZERO; + this.totalScore = NumConstant.ZERO; + this.children = new ArrayList<>(); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/form/EventCategoryFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/form/EventCategoryFormDTO.java new file mode 100644 index 0000000000..4907c3cf08 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/form/EventCategoryFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dataaggre.dto.evaluationindex.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author Administrator + */ +@Data +public class EventCategoryFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface EventCategoryForm{} + public interface CategoryEventExportForm {} + + /** + * 组织ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型 组织:agency,网格:grid + */ + private String orgType; + private String areaCode; + /** + * 组织级别 + */ + private String orgLevel; + @NotBlank(message = "结束时间不能为空",groups = {EventCategoryForm.class,CategoryEventExportForm.class}) + private String endTime; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 组织名称 + */ + @NotBlank(message = "组织名称不能为空",groups = CategoryEventExportForm.class) + private String orgName; + + private String name; + private String mobile; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/form/EventCategoryListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/form/EventCategoryListFormDTO.java new file mode 100644 index 0000000000..58bf30b26d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/form/EventCategoryListFormDTO.java @@ -0,0 +1,65 @@ +package com.epmet.dataaggre.dto.evaluationindex.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @author Administrator + */ +@Data +public class EventCategoryListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface EventCategoryForm{} + public interface CategoryEventExportForm {} + public interface CategoryEventListExportForm {} + /** + * 组织ID + */ + private String customerId; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织类型 组织:agency,网格:grid + */ + private String orgType; + + @NotBlank(message = "结束时间不能为空",groups = {EventCategoryForm.class,CategoryEventExportForm.class}) + private String endTime; + + /** + * 类型,project:事件, work:例行工作 + */ + @NotNull(message = "事件类型不能为空",groups = CategoryEventListExportForm.class) + private String eventType; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 组织名称 + */ + @NotBlank(message = "组织名称不能为空",groups = CategoryEventExportForm.class) + private String orgName; + + @NotNull(message = "categoryCode不能为空",groups = {EventCategoryForm.class, CategoryEventListExportForm.class}) + private String categoryCode; + + @NotNull(message = "categoryName不能为空",groups = CategoryEventListExportForm.class) + private String categoryName; + private String parentCategoryName; + + private String name; + private String mobile; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/EventCategoryListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/EventCategoryListResultDTO.java new file mode 100644 index 0000000000..6836682946 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/EventCategoryListResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dataaggre.dto.evaluationindex.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Administrator + */ +@Data +public class EventCategoryListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 事件ID + */ + private String eventId; + + /** + * 事件类型 项目:project,例行工作:work + */ + private String eventType; + + /** + * 标题 + */ + private String title; + + /** + * 类别 + */ + private String category; + + /** + * 项目状态:待处理 pending,结案closed + */ + private String status; + + /** + * 项目状态:待处理 pending,结案closed + */ + private String statusDesc; + + /** + * 所属网格 + */ + private String gridName; + private String gridId; + /** + * 项目创建时间 + */ + private String createTime; + + private String staffName; + + private Integer score; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/EventScoreTotalResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/EventScoreTotalResultDTO.java new file mode 100644 index 0000000000..419efe119a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/EventScoreTotalResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.evaluationindex.result;/** + * @author ZhaoQiFeng + * @date 2022/12/14 + * @apiNote + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/12/14 13:39 + */ +@Data +public class EventScoreTotalResultDTO implements Serializable { + private static final long serialVersionUID = 2570384890580378137L; + private String orgName; + private String date; + /** + * 总分 + */ + private String totalScore; + /** + * 网格员数量 + */ + private String memberCount; + /** + * 考核得分 + */ + private String aveScore; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/OrgEventScoreResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/OrgEventScoreResultDTO.java new file mode 100644 index 0000000000..f7b2a334ba --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/result/OrgEventScoreResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dataaggre.dto.evaluationindex.result;/** + * @author ZhaoQiFeng + * @date 2022/12/14 + * @apiNote + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/12/14 13:39 + */ +@Data +public class OrgEventScoreResultDTO implements Serializable { + private static final long serialVersionUID = 2570384890580378137L; + private String orgName; + /** + * 上报事件数 + */ + private String projectCount; + /** + * 上报事件总分 + */ + private String projectScore; + /** + * 例行工作数 + */ + private String workCount; + /** + * 例行工作总分 + */ + private String workScore; + /** + * 网格员数量 + */ + private String memberCount; + /** + * 考核得分 + */ + private String aveScore; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java index 6c1f23785b..a6f2026789 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java @@ -33,4 +33,7 @@ public class GridLivelyFormDTO implements Serializable { @NotBlank(message = "结束查询时间不能为空", groups = {Grid.class}) private String endTime; + //数据区分 type=historyScore表示以平阴中间库网格数据为准来计算 + private String type = ""; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java index f979ead709..8d2624af35 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; +import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; import com.epmet.dataaggre.feign.impl.DataAggregatorOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -33,4 +34,10 @@ public interface DataAggregatorOpenFeignClient { */ @PostMapping("data/aggregator/icuser/listByPolicyRules") Result> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input); + + /** + * 网格活跃度统计 + */ + @PostMapping(value = "data/aggregator/org/gridlively") + Result> grdiLively(@RequestBody GridLivelyFormDTO form); } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java index 2cec07e6b3..c180033e19 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java @@ -7,8 +7,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; +import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; +import java.util.List; + public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpenFeignClient { /** * 定时任务导出网格活跃统计表 @@ -24,4 +27,9 @@ public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpen public Result> listByPolicyRules(ResisByPolicyRulesFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "listByPolicyRules", input); } + + @Override + public Result> grdiLively(GridLivelyFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "grdiLively",form); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index afc18801bc..bdd3fcda4f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -245,6 +245,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + root + root + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PingYinEventController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PingYinEventController.java new file mode 100644 index 0000000000..b42855202d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PingYinEventController.java @@ -0,0 +1,183 @@ +package com.epmet.dataaggre.controller; + +import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.fill.FillConfig; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.CustomMergeStrategy; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventScoreTotalResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; +import com.epmet.dataaggre.service.evaluationindex.PingYinEventService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.core.io.ClassPathResource; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * @author Administrator + */ +@RestController +@RequestMapping("pyevent") +@Slf4j +public class PingYinEventController { + @Resource + private PingYinEventService pingYinEventService; + + /** + * 事件赋值得分 + * + * @Param tokenDto + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/12/9 9:42 + */ + @PostMapping("getEventCategorySore") + public Result> getEventCategorySore(@LoginUser TokenDto tokenDto, @RequestBody EventCategoryFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, EventCategoryFormDTO.EventCategoryForm.class); + return new Result>().ok(pingYinEventService.getEventCategorySore(tokenDto, formDTO)); + } + + /** + * 事件分类列表 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< PageData< EventCategoryListResultDTO>>} + * @Author zhaoqifeng + * @Date 2022/12/13 9:55 + */ + @PostMapping("getEventCategoryList") + public Result> getEventCategoryList(@LoginUser TokenDto tokenDto, @RequestBody EventCategoryListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, EventCategoryListFormDTO.EventCategoryForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(pingYinEventService.getEventCategoryList(formDTO)); + } + + /** + * 事件赋值得分总计 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< EventScoreTotalResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/14 13:46 + */ + @PostMapping("getEventScoreTotal") + public Result getEventScoreTotal(@LoginUser TokenDto tokenDto, @RequestBody EventCategoryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, EventCategoryListFormDTO.EventCategoryForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(pingYinEventService.getEventScoreTotal(formDTO)); + } + + /** + * 事件赋值得分导出 + * @Param tokenDto + * @Param formDTO + * @Param response + * @Return + * @Author zhaoqifeng + * @Date 2022/12/14 16:08 + */ + @PostMapping("eventScoreExport") + public void eventScoreExport(@LoginUser TokenDto tokenDto, + @RequestBody EventCategoryFormDTO formDTO, HttpServletResponse response) throws Exception{ + ValidatorUtils.validateEntity(formDTO, EventCategoryListFormDTO.EventCategoryForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + String fileName = formDTO.getOrgName() + "事件赋值得分.xlsx"; + ExcelWriter excelWriter = null; + //获取模板 + ClassPathResource classPathResource = new ClassPathResource("excel/eventScore.xlsx"); + InputStream inputStream = classPathResource.getInputStream(); + try { + + try { + fileName = URLEncoder.encode("事件赋值得分.xlsx", "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + response.setHeader("Content-disposition", "attachment; filename=" + fileName); + response.setContentType("application/msexcel;charset=UTF-8"); + response.setHeader("Pragma", "No-cache"); + response.setHeader("Cache-Control", "no-cache"); + response.setDateHeader("Expires", 0); + ServletOutputStream outputStream = response.getOutputStream(); + //总计 + EventScoreTotalResultDTO scoreTotal = pingYinEventService.getEventScoreTotal(formDTO); + scoreTotal.setOrgName(formDTO.getOrgName()); + String endTime =DateUtils.format(DateUtils.parse(formDTO.getEndTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_NAME_PATTERN); + if (StringUtils.isNotEmpty(formDTO.getStartTime())) { + String startTime =DateUtils.format(DateUtils.parse(formDTO.getStartTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_NAME_PATTERN); + scoreTotal.setDate(startTime.concat("—").concat(endTime)); + } else { + scoreTotal.setDate("截止到" + endTime); + } + //分类统计 + List categoryList = pingYinEventService.getEventCategorySoreExport(tokenDto, formDTO); + //设置输出流和模板信息 + excelWriter = EasyExcelFactory.write(outputStream).withTemplate(inputStream).build(); + WriteSheet writeSheet = EasyExcelFactory.writerSheet(0) + .registerWriteHandler(new CustomMergeStrategy(categoryList.stream().map(EventCategoryResultDTO::getEventType).collect(Collectors.toList()), 0)) + .registerWriteHandler(new CustomMergeStrategy(categoryList.stream().map(EventCategoryResultDTO::getParentCategoryName).collect(Collectors.toList()), 1)) + .build(); + //开启自动换行,自动换行表示每次写入一条list数据是都会重新生成一行空行,此选项默认是关闭的,需要提前设置为true + FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + excelWriter.fill(categoryList, fillConfig, writeSheet); + excelWriter.fill(scoreTotal, writeSheet); + + List orgScoreList = pingYinEventService.getOrgEventScoreList(formDTO); + WriteSheet writeSheet1 = EasyExcelFactory.writerSheet(1).build(); + excelWriter.fill(orgScoreList, fillConfig, writeSheet1); + excelWriter.fill(scoreTotal, writeSheet1); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java index 2319248c83..6062e45dcb 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java @@ -53,7 +53,9 @@ public interface CustomerStaffDao extends BaseDao { * @Description 模糊查询用户、角色信息 * @author sun */ - List selectByRealName(@Param("customerId") String customerId, @Param("realName") String realName); + List selectByRealName(@Param("customerId") String customerId, + @Param("realName") String realName, + @Param("keyWord") String keyWord); /** * @Description 分页查询排好序的工作人员Id列表 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index ab22fe402c..703145272a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -23,6 +23,7 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -128,4 +129,6 @@ public interface EvaluationIndexDao { * @return */ List getSubAllGridByAgencyPath(@Param("fullAgencyPath") String fullAgencyPath); + + GridLivelyResultDTO streetGridList(GridLivelyFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/PingYinEventDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/PingYinEventDao.java new file mode 100644 index 0000000000..f0b44c9d89 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/PingYinEventDao.java @@ -0,0 +1,157 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.evaluationindex; + +import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author sun + * @Description 指标统计服务 + */ +@Mapper +public interface PingYinEventDao { + /** + * 获取项目分类 + * + * @Param customerId + * @Return {@link List< EventCategoryResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/9 13:40 + */ + List selectProjectCategory(@Param("customerId")String customerId); + + /** + * 获取例行工作分类 + * + * @Param + * @Return {@link List< EventCategoryResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/9 13:41 + */ + List selectWorkCategory(); + + /** + * 项目赋值得分 + * @Param formDTO + * @Return {@link List< EventCategoryResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/9 11:00 + */ + List selectProjectCategoryScoreList(EventCategoryFormDTO formDTO); + + /** + * 例行工作赋值得分 + * @Param formDTO + * @Return {@link List< EventCategoryResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/9 11:00 + */ + List selectWorkCategoryScoreList(EventCategoryFormDTO formDTO); + + /** + * 项目分类列表 + * + * @Param formDTO + * @Return {@link List< EventCategoryListResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/13 10:12 + */ + List getProjectCategoryList(EventCategoryListFormDTO formDTO); + + /** + * 例行工作 + * + * @Param formDTO + * @Return {@link List< EventCategoryListResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/13 10:12 + */ + List getWorkCategoryList(EventCategoryListFormDTO formDTO); + + /** + * 上报事件总分 + * + * @Param formDTO + * @Return {@link Long} + * @Author zhaoqifeng + * @Date 2022/12/14 13:56 + */ + Long getProjectTotalScore(EventCategoryFormDTO formDTO); + + /** + * 例行工作总分 + * + * @Param formDTO + * @Return {@link Long} + * @Author zhaoqifeng + * @Date 2022/12/14 13:56 + */ + Long getWorkTotalScore(EventCategoryFormDTO formDTO); + + /** + * 网格员数 + * + * @Param formDTO + * @Return {@link Long} + * @Author zhaoqifeng + * @Date 2022/12/14 13:56 + */ + Long getMemberCount(EventCategoryFormDTO formDTO); + + /** + * 获取项目分类 + * + * @Param customerId + * @Return {@link List< EventCategoryResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/9 13:40 + */ + List selectProjectCategoryForExport(@Param("customerId")String customerId); + + /** + * 获取例行工作分类 + * + * @Param + * @Return {@link List< EventCategoryResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/9 13:41 + */ + List selectWorkCategoryForExport(); + + /** + * 下级得分 + * + * @Param formDTO + * @Return {@link List< OrgEventScoreResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/15 9:31 + */ + List selectOrgEventScoreList(EventCategoryFormDTO formDTO); + + List selectGridEventScoreList(EventCategoryFormDTO formDTO); + + String getAreaCode(@Param("agencyId")String agencyId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index fe573af2bc..171f1a520d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -9,7 +9,6 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.OrgTypeEnum; -import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; @@ -59,7 +58,6 @@ import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.GetStaffExistRoleFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.DetailByTypeResultDTO; -import com.epmet.dto.form.GetStaffExistRoleFormDTO; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -539,7 +537,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { @Override public List listStaff(ListStaffFormDTO formDTO) { //1.模糊查询用户、角色信息 - List resultList = customerStaffDao.selectByRealName(formDTO.getCustomerId(), formDTO.getRealName()); + List resultList = customerStaffDao.selectByRealName(formDTO.getCustomerId(), formDTO.getRealName(),formDTO.getKeyWord()); if (null == resultList || resultList.size() < NumConstant.ONE) { return new ArrayList<>(); } @@ -639,6 +637,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { .eq(CustomerStaffEntity::getDelFlag,NumConstant.ZERO_STR); CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper); if (null == staffEntity) { + log.error(String.format("customer_staff is null staffId:%s",staffId)); return null; } CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java index a5260a60ba..8d67d2bcf8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -8,6 +8,7 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO; @@ -103,4 +104,6 @@ public interface EvaluationIndexService { * @author sun */ List getGridProejctToProjectMain(GridLivelyFormDTO formDTO); + + GridLivelyResultDTO streetGridList(GridLivelyFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/PingYinEventService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/PingYinEventService.java new file mode 100644 index 0000000000..35f22c00c4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/PingYinEventService.java @@ -0,0 +1,70 @@ +package com.epmet.dataaggre.service.evaluationindex; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventScoreTotalResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; + +import java.util.List; + +/** + * @author Administrator + */ +public interface PingYinEventService { + + /** + * 事件赋值得分 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/12/9 9:55 + */ + List getEventCategorySore (TokenDto tokenDto, EventCategoryFormDTO formDTO); + + /** + * 事件分类列表 + * + * @Param formDTO + * @Return {@link PageData< EventCategoryListResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/13 9:55 + */ + PageData getEventCategoryList(EventCategoryListFormDTO formDTO); + + /** + * 事件赋值得分总计 + * + * @Param formDTO + * @Return {@link EventScoreTotalResultDTO} + * @Author zhaoqifeng + * @Date 2022/12/14 13:46 + */ + EventScoreTotalResultDTO getEventScoreTotal(EventCategoryFormDTO formDTO); + + /** + * 事件赋值得分导出 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/12/9 9:55 + */ + List getEventCategorySoreExport (TokenDto tokenDto, EventCategoryFormDTO formDTO); + + /** + * 下级得分 + * + * @Param formDTO + * @Return {@link List< OrgEventScoreResultDTO>} + * @Author zhaoqifeng + * @Date 2022/12/15 11:05 + */ + List getOrgEventScoreList(EventCategoryFormDTO formDTO); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index 7fa4518b2d..a74fc4ea86 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO; import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; @@ -248,4 +249,11 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { return evaluationIndexDao.getGridProejctToProjectMain(formDTO); } + @Override + public GridLivelyResultDTO streetGridList(GridLivelyFormDTO formDTO) { + GridLivelyResultDTO resultDTO = evaluationIndexDao.streetGridList(formDTO); + resultDTO.setAgencyId(formDTO.getAgencyId()); + return resultDTO; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/PingYinEventServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/PingYinEventServiceImpl.java new file mode 100644 index 0000000000..154f654a98 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/PingYinEventServiceImpl.java @@ -0,0 +1,262 @@ +package com.epmet.dataaggre.service.evaluationindex.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +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.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.EventConstant; +import com.epmet.dataaggre.constant.OrgConstant; +import com.epmet.dataaggre.dao.evaluationindex.PingYinEventDao; +import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.EventScoreTotalResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; +import com.epmet.dataaggre.service.evaluationindex.PingYinEventService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @Author sun + * @Description 指标统计服务 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +public class PingYinEventServiceImpl implements PingYinEventService { + + @Resource + private PingYinEventDao pingYinEventDao; + + /** + * 事件赋值得分 + * + * @param tokenDto + * @param formDTO + * @Param tokenDto + * @Param formDTO + * @Return {@link List < EventCategoryResultDTO >} + * @Author zhaoqifeng + * @Date 2022/12/9 9:55 + */ + @Override + public List getEventCategorySore(TokenDto tokenDto, EventCategoryFormDTO formDTO) { + List result = new ArrayList<>(); + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员的所属组织信息..."); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType("agency"); + } + formDTO.setCustomerId(tokenDto.getCustomerId()); + //获取项目分类 + List projectCategoryList = pingYinEventDao.selectProjectCategory(formDTO.getCustomerId()); + //获取项目赋值得分统计 + List projectScoreList = pingYinEventDao.selectProjectCategoryScoreList(formDTO); + if (CollectionUtils.isNotEmpty(projectScoreList)) { + projectCategoryList.forEach(item -> { + projectScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getParentCategoryCode())).forEach(e -> { + item.setEventTotal(item.getEventTotal() + e.getEventTotal()); + item.setTotalScore(item.getTotalScore() + e.getTotalScore()); + }); + item.getChildren().forEach(son -> projectScoreList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { + son.setEventTotal(e.getEventTotal()); + son.setTotalScore(e.getTotalScore()); + })); + }); + } + result.addAll(projectCategoryList); + //获取例行工作分类 + List workCategoryList = pingYinEventDao.selectWorkCategory(); + //获取例行工作赋值得分统计 + List workScoreList = pingYinEventDao.selectWorkCategoryScoreList(formDTO); + if (CollectionUtils.isNotEmpty(workScoreList)) { + workCategoryList.forEach(item -> { + workScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getParentCategoryCode())).forEach(e -> { + item.setEventTotal(item.getEventTotal() + e.getEventTotal()); + item.setTotalScore(item.getTotalScore() + e.getTotalScore()); + }); + item.getChildren().forEach(son -> workScoreList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { + son.setEventTotal(e.getEventTotal()); + son.setTotalScore(e.getTotalScore()); + })); + }); + } + result.addAll(workCategoryList); + return result; + } + + /** + * 事件分类列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData < EventCategoryListResultDTO >} + * @Author zhaoqifeng + * @Date 2022/12/13 9:55 + */ + @Override + public PageData getEventCategoryList(EventCategoryListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list; + if (EventConstant.PROJECT.equals(formDTO.getEventType())) { + //项目分类列表 + list = pingYinEventDao.getProjectCategoryList(formDTO); + } else { + //例行工作分类列表 + list = pingYinEventDao.getWorkCategoryList(formDTO); + } + PageInfo pageInfo = new PageInfo<>(list); + if(CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null == gridInfo) { + log.error("获取网格信息失败"); + return; + } + item.setGridName(gridInfo.getGridNamePath()); + if (EventConstant.PROJECT.equals(item.getEventType())) { + item.setStatusDesc("pending".equals(item.getStatus())?"处理中":"已结案"); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 事件赋值得分总计 + * + * @param formDTO + * @Param formDTO + * @Return {@link EventScoreTotalResultDTO} + * @Author zhaoqifeng + * @Date 2022/12/14 13:46 + */ + @Override + public EventScoreTotalResultDTO getEventScoreTotal(EventCategoryFormDTO formDTO) { + EventScoreTotalResultDTO result = new EventScoreTotalResultDTO(); + Long projectScore = pingYinEventDao.getProjectTotalScore(formDTO); + Long workScore = pingYinEventDao.getWorkTotalScore(formDTO); + Long memberCount = pingYinEventDao.getMemberCount(formDTO); + Long totalScore = projectScore + workScore; + result.setTotalScore(totalScore.toString()); + result.setMemberCount(memberCount.toString()); + result.setAveScore("0.00"); + if (memberCount != 0L) { + BigDecimal total = new BigDecimal(totalScore); + BigDecimal count = new BigDecimal(memberCount); + BigDecimal ave = total.divide(count, NumConstant.TWO, RoundingMode.HALF_UP); + result.setAveScore(ave.toString()); + } + return result; + } + + /** + * 事件赋值得分导出 + * + * @param tokenDto + * @param formDTO + * @Param tokenDto + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/12/9 9:55 + */ + @Override + public List getEventCategorySoreExport(TokenDto tokenDto, EventCategoryFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员的所属组织信息..."); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType("agency"); + } + formDTO.setCustomerId(tokenDto.getCustomerId()); + //获取项目分类 + List projectCategoryList = pingYinEventDao.selectProjectCategoryForExport(formDTO.getCustomerId()); + //获取项目赋值得分统计 + List projectScoreList = pingYinEventDao.selectProjectCategoryScoreList(formDTO); + if (CollectionUtils.isNotEmpty(projectScoreList)) { + projectCategoryList.forEach(item -> { + projectScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { + item.setEventTotal(e.getEventTotal()); + item.setTotalScore(e.getTotalScore()); + }); + }); + } + List result = new ArrayList<>(projectCategoryList); + //获取例行工作分类 + List workCategoryList = pingYinEventDao.selectWorkCategoryForExport(); + //获取例行工作赋值得分统计 + List workScoreList = pingYinEventDao.selectWorkCategoryScoreList(formDTO); + if (CollectionUtils.isNotEmpty(workScoreList)) { + workCategoryList.forEach(item -> { + workScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { + item.setEventTotal(e.getEventTotal()); + item.setTotalScore(e.getTotalScore()); + }); + }); + } + result.addAll(workCategoryList); + return result; + } + + /** + * 下级得分 + * + * @param formDTO + * @Param formDTO + * @Return {@link List< OrgEventScoreResultDTO >} + * @Author zhaoqifeng + * @Date 2022/12/15 11:05 + */ + @Override + public List getOrgEventScoreList(EventCategoryFormDTO formDTO) { + if (OrgConstant.GRID.equals((formDTO.getOrgLevel()))) { + return Collections.emptyList(); + } + List result; + //获取areacode + if (StringUtils.isBlank(formDTO.getAreaCode())) { + formDTO.setAreaCode(pingYinEventDao.getAreaCode(formDTO.getOrgId())); + } + if (OrgConstant.COMMUNITY.equals(formDTO.getOrgLevel())) { + result = pingYinEventDao.selectGridEventScoreList(formDTO); + } else { + result = pingYinEventDao.selectOrgEventScoreList(formDTO); + } + result.forEach(item -> { + item.setAveScore("0.00"); + if (!NumConstant.ZERO_STR.equals(item.getMemberCount())) { + BigDecimal projectScore = new BigDecimal(item.getProjectScore()); + BigDecimal workScore = new BigDecimal(item.getWorkScore()); + BigDecimal total = projectScore.add(workScore); + BigDecimal count = new BigDecimal(item.getMemberCount()); + BigDecimal ave = total.divide(count, NumConstant.TWO, RoundingMode.HALF_UP); + item.setAveScore(ave.toString()); + } + }); + return result; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 196126509c..ab72e0992d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -707,7 +707,13 @@ public class GovOrgServiceImpl implements GovOrgService { @Override public List grdiLively(GridLivelyFormDTO formDTO) { //1.查询当前组织的直属下级组织列表及组织下的网格总数 - LinkedList subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId()); + LinkedList subList = new LinkedList<>(); + if (StringUtils.isNotBlank(formDTO.getType()) && "historyScore".equals(formDTO.getType())) { + GridLivelyResultDTO dto = evaluationIndexService.streetGridList(formDTO); + subList.add(dto); + }else { + subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId()); + } //2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条 List workList = epmetUserService.getGridDateRoutineWorkList(formDTO); //3.查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格,一天一条 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/excel/eventScore.xlsx b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/excel/eventScore.xlsx new file mode 100644 index 0000000000..4966fd5e32 Binary files /dev/null and b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/excel/eventScore.xlsx differ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml index 2ee923a736..8bc486c5e0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -49,7 +49,14 @@ WHERE del_flag = '0' AND customer_id = #{customerId} - AND real_name LIKE CONCAT('%', #{realName}, '%') + + AND real_name LIKE CONCAT('%', #{realName}, '%') + + + AND (REAL_NAME LIKE CONCAT('%', #{keyWord}, '%') + or MOBILE LIKE CONCAT('%', #{keyWord}, '%') + ) + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/PingYinEventDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/PingYinEventDao.xml new file mode 100644 index 0000000000..2fc6e9e53d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/PingYinEventDao.xml @@ -0,0 +1,584 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java new file mode 100644 index 0000000000..e6665350d1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class HistoryScoreListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface List extends CustomerClientShowGroup {} + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + //@JsonFormat(pattern = "yyyy-MM-dd") + @NotBlank(message = "起始时间不能为空", groups = List.class) + private String startTime; + + /** + * 截止时间 + */ + //@JsonFormat(pattern = "yyyy-MM-dd") + @NotBlank(message = "截止时间不能为空", groups = List.class) + private String endTime; + + /** + * 当前页 + */ + private Integer pageNo = 1; + + /** + * 每页记录数 + */ + private Integer pageSize = 20; + + /** + * 是否分页【true分 false不分】 + */ + private Boolean isPage = true; + + private String customerId; + private String userId; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java new file mode 100644 index 0000000000..374a5af2e1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java @@ -0,0 +1,160 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class HistoryScoreDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Add extends CustomerClientShowGroup { + } + + public interface Edit extends CustomerClientShowGroup { + } + + /** + * id + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + private Date startTime; + + /** + * 截止时间 + */ + private Date endTime; + + /** + * 时间区间 + */ + private String time; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 截止时间 + */ + private List detailList; + + @Data + public static class Detail implements Serializable { + /** + * id + */ + private String id; + + /** + * screen_py_history_score.id + */ + private String historyScoreId; + + /** + * 街道组织Id + */ + private String agencyId = ""; + + /** + * 街道名称 + */ + private String agencyName = ""; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd = new BigDecimal(0); + + /** + * 事件赋分 + */ + private BigDecimal sjff = new BigDecimal(0); + + /** + * 接入率 + */ + private BigDecimal jrl = new BigDecimal(0); + + /** + * 在线率 + */ + private BigDecimal zxl = new BigDecimal(0); + + /** + * 出图率 + */ + private BigDecimal ctl = new BigDecimal(0); + + /** + * 雪亮工程 + */ + private BigDecimal xlgc = new BigDecimal(0); + + /** + * 完成进度 + */ + private BigDecimal wcjd = new BigDecimal(0); + + /** + * 未补检 + */ + private BigDecimal wbj = new BigDecimal(0); + + /** + * 反馈抽检 + */ + private BigDecimal fkcj = new BigDecimal(0); + + /** + * 日核周调 + */ + private BigDecimal rhzt = new BigDecimal(0); + + /** + * 亮点工作 + */ + private BigDecimal ldgz = new BigDecimal(0); + + /** + * 亮点工作备注 + */ + private String ldgzbz; + + /** + * 其他工作 + */ + private BigDecimal qtgz = new BigDecimal(0); + + /** + * 其他工作备注 + */ + private String qtgzbz; + + /** + * 能力得分 + */ + private BigDecimal nldf = new BigDecimal(0); + } + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreResultDTO.java new file mode 100644 index 0000000000..54c196cff8 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HistoryScoreResultDTO implements Serializable { + private static final long serialVersionUID = -4316054054019675419L; + + /** + * id + */ + private String id; + /** + * 标题 + */ + private String title; + /** + * 起始时间 + */ + private String startTime; + /** + * 截止时间 + */ + private String endTime; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java index e248a6ac35..86c7b2e3c5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java @@ -21,6 +21,9 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.result.HistoryScoreResultDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; @@ -78,5 +81,19 @@ public class IndexExplainController { return new Result().ok(result); } + @RequestMapping("dplist") + public Result> dplist(@RequestBody HistoryScoreListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, HistoryScoreListFormDTO.List.class); + return new Result>().ok(indexExplainService.dplist(formDTO)); + } + + /** + * 获取最近一条记录数据信息 + * @return + */ + @RequestMapping("firsthistoryscore") + public Result firstHistoryScore() { + return new Result().ok(indexExplainService.firstHistoryScore()); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java index 64fc30bac1..d5c2e683f5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java @@ -17,6 +17,9 @@ package com.epmet.datareport.dao.evaluationindex.index; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.result.HistoryScoreResultDTO; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,4 +36,8 @@ import java.util.List; public interface IndexExplainDao { List getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); + + List selectDpList(HistoryScoreListFormDTO formDTO); + + HistoryScoreResultDTO firstHistoryScore(); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java index c028422cd4..3106fc573b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java @@ -17,6 +17,9 @@ package com.epmet.datareport.service.evaluationindex.index; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.result.HistoryScoreResultDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; @@ -51,4 +54,8 @@ public interface IndexExplainService { * @date 2021/5/20 10:20 上午 */ IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO); + + List dplist(HistoryScoreListFormDTO formDTO); + + HistoryScoreResultDTO firstHistoryScore(); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index ae40c88329..910424c541 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -29,6 +29,9 @@ import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.result.HistoryScoreResultDTO; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; @@ -45,6 +48,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -436,4 +440,36 @@ public class IndexExplainServiceImpl implements IndexExplainService { return headers; } + + @Override + public List dplist(HistoryScoreListFormDTO formDTO) { + //按条件查询数据,并做加和取平均值操作 + List resultList = indexExplainDao.selectDpList(formDTO); + Map map = new HashMap<>(); + map.put("1258587398679126017", "榆山街道"); + map.put("1215437824174608386", "锦水街道"); + map.put("f8d4a6af53b3fc5991ab1434b6ad39b8", "东阿镇"); + map.put("d20a7488eedf5bcfd5231c3771bc0e3d", "玫瑰镇"); + map.put("ea78a8e9252f567517c4a8d60250c714", "安城镇"); + map.put("1234085031077498881", "孔村镇"); + map.put("f279343a67653fc20d8333c6b2e4dbee", "孝直镇"); + map.put("c259c3b1d27f960b9b379fb2886179ba", "洪范池镇"); + resultList.forEach(re -> { + map.remove(re.getAgencyId()); + }); + for (String ma : map.keySet()) { + HistoryScoreDetailResultDTO.Detail detail = new HistoryScoreDetailResultDTO.Detail(); + detail.setAgencyId(ma); + detail.setAgencyName(map.get(ma)); + resultList.add(detail); + } + return resultList; + + } + + @Override + public HistoryScoreResultDTO firstHistoryScore() { + return indexExplainDao.firstHistoryScore(); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml index 9c7f5d0870..057c365b5b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml @@ -37,4 +37,48 @@ AND PID = #{pid} ORDER BY SORT + + + + + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java index c54642b6f1..88eede71e8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -27,4 +28,7 @@ public class EventInfoFormDTO extends PageFormDTO implements Serializable { * 2在完全初始化之后,由于eventreport_pingyin表没有客户ID,初始化其他客户的数据时候可以设2,直接新增 */ private String initFlag = "0"; + + private Date startTime; + private Date endTime; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyGridStaffDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyGridStaffDTO.java new file mode 100644 index 0000000000..89e5acb5a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyGridStaffDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + */ +@Data +public class ScreenPyGridStaffDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格名称 + */ + private String pids; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 网格员姓名 + */ + private String staffName; + + /** + * 手机号 + */ + private String mobile; + + /** + * 是否离职,格式为Y:是、N:否 + */ + private String isLeave; + + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDTO.java new file mode 100644 index 0000000000..55e7648c2b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDTO.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 平阴历史得分主表 + * + * @author generator generator@elink-cn.com + */ +@Data +public class ScreenPyHistoryScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + private Date startTime; + + /** + * 截止时间 + */ + private Date endTime; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDetailDTO.java new file mode 100644 index 0000000000..9eaee8b276 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDetailDTO.java @@ -0,0 +1,166 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 平阴历史得分明细表 + * + * @author generator generator@elink-cn.com + */ +@Data +public class ScreenPyHistoryScoreDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * screen_py_history_score.id + */ + private String historyScoreId; + + /** + * 街道组织Id + */ + private String agencyId; + + /** + * 街道名称 + */ + private String agencyName; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 接入率 + */ + private BigDecimal jrl; + + /** + * 在线率 + */ + private BigDecimal zxl; + + /** + * 出图率 + */ + private BigDecimal ctl; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 完成进度 + */ + private BigDecimal wcjd; + + /** + * 未补检 + */ + private BigDecimal wbj; + + /** + * 反馈抽检 + */ + private BigDecimal fkcj; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 亮点工作备注 + */ + private String ldgzbz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 其他工作备注 + */ + private String qtgzbz; + + /** + * 能力得分 + */ + private BigDecimal nldf; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyWeightConfigurationDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyWeightConfigurationDTO.java new file mode 100644 index 0000000000..b38a036873 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyWeightConfigurationDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 平阴政法能力权重配置 + * + * @author generator generator@elink-cn.com + */ +@Data +public class ScreenPyWeightConfigurationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreComputeFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreComputeFormDTO.java new file mode 100644 index 0000000000..47dce61362 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreComputeFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.indexcollect.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class HistoryScoreComputeFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Compute extends CustomerClientShowGroup {} + + /** + * 组织Id + */ + @NotBlank(message = "组织Id不能为空", groups = Compute.class) + private String agencyId; + /** + * 计算类型 grid:网格活跃度 event:事件赋分 + */ + @NotBlank(message = "计算类型不能为空", groups = Compute.class) + private String type; + /** + * 起始时间,yyyyMMdd + */ + @NotBlank(message = "起始时间不能为空", groups = {Compute.class}) + private String startTime; + /** + * 终止时间,yyyyMMdd + */ + @NotBlank(message = "终止时间不能为空", groups = {Compute.class}) + private String endTime; + + private String customerId; + private String userId; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreFormDTO.java new file mode 100644 index 0000000000..9b90bca58f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreFormDTO.java @@ -0,0 +1,146 @@ +package com.epmet.dto.indexcollect.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class HistoryScoreFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Add extends CustomerClientShowGroup {} + public interface Edit extends CustomerClientShowGroup {} + + /** + * id + */ + @NotBlank(message = "id不能为空", groups = Edit.class) + private String id; + + /** + * 标题 + */ + @NotBlank(message = "标题不能为空", groups = Add.class) + private String title; + + /** + * 起始时间 + */ + @NotNull(message = "起始时间不能为空", groups = {Add.class}) + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startTime; + + /** + * 截止时间 + */ + @NotNull(message = "截止时间不能为空", groups = {Add.class}) + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endTime; + + /** + * 截止时间 + */ + private List detailList; + + private String customerId; + private String userId; + + + @Data + public static class Detail implements Serializable { + /** + * 街道组织Id + */ + private String agencyId; + + /** + * 街道名称 + */ + private String agencyName; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd = new BigDecimal(0); + + /** + * 事件赋分 + */ + private BigDecimal sjff = new BigDecimal(0); + + /** + * 接入率 + */ + private BigDecimal jrl = new BigDecimal(0); + + /** + * 在线率 + */ + private BigDecimal zxl = new BigDecimal(0); + + /** + * 出图率 + */ + private BigDecimal ctl = new BigDecimal(0); + + /** + * 雪亮工程 + */ + private BigDecimal xlgc = new BigDecimal(0); + + /** + * 完成进度 + */ + private BigDecimal wcjd = new BigDecimal(0); + + /** + * 未补检 + */ + private BigDecimal wbj = new BigDecimal(0); + + /** + * 反馈抽检 + */ + private BigDecimal fkcj = new BigDecimal(0); + + /** + * 日核周调 + */ + private BigDecimal rhzt = new BigDecimal(0); + + /** + * 亮点工作 + */ + private BigDecimal ldgz = new BigDecimal(0); + + /** + * 亮点工作备注 + */ + private String ldgzbz; + + /** + * 其他工作 + */ + private BigDecimal qtgz = new BigDecimal(0); + + /** + * 其他工作备注 + */ + private String qtgzbz; + + /** + * 能力得分 + */ + private BigDecimal nldf = new BigDecimal(0); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java new file mode 100644 index 0000000000..faa54eaf8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.indexcollect.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class HistoryScoreListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface List extends CustomerClientShowGroup {} + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + //@JsonFormat(pattern = "yyyy-MM-dd") + @NotBlank(message = "起始时间不能为空", groups = List.class) + private String startTime; + + /** + * 截止时间 + */ + //@JsonFormat(pattern = "yyyy-MM-dd") + @NotBlank(message = "截止时间不能为空", groups = List.class) + private String endTime; + + /** + * 当前页 + */ + private Integer pageNo = 1; + + /** + * 每页记录数 + */ + private Integer pageSize = 20; + + /** + * 是否分页【true分 false不分】 + */ + private Boolean isPage = true; + + private String customerId; + private String userId; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationFormDTO.java new file mode 100644 index 0000000000..c816171923 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationFormDTO.java @@ -0,0 +1,58 @@ +package com.epmet.dto.indexcollect.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class WeightConfigurationFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Add extends CustomerClientShowGroup {} + public interface Edit extends CustomerClientShowGroup {} + + /** + * id + */ + @NotBlank(message = "标题不能为空", groups = Edit.class) + private String id; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + private String customerId; + private String userId; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationListFormDTO.java new file mode 100644 index 0000000000..0b3b3b79ba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/WeightConfigurationListFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class WeightConfigurationListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当前页 + */ + private Integer pageNo = 1; + + /** + * 每页记录数 + */ + private Integer pageSize = 20; + + /** + * 是否分页【true分 false不分】 + */ + private Boolean isPage; + + private String customerId; + private String userId; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreComputeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreComputeResultDTO.java new file mode 100644 index 0000000000..f89b49bfca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreComputeResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HistoryScoreComputeResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 分数 + */ + private String score = "0"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java new file mode 100644 index 0000000000..371199267d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java @@ -0,0 +1,160 @@ +package com.epmet.dto.indexcollect.result; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class HistoryScoreDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Add extends CustomerClientShowGroup { + } + + public interface Edit extends CustomerClientShowGroup { + } + + /** + * id + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + private Date startTime; + + /** + * 截止时间 + */ + private Date endTime; + + /** + * 时间区间 + */ + private String time; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 截止时间 + */ + private List detailList; + + @Data + public static class Detail implements Serializable { + /** + * id + */ + private String id; + + /** + * screen_py_history_score.id + */ + private String historyScoreId; + + /** + * 街道组织Id + */ + private String agencyId = ""; + + /** + * 街道名称 + */ + private String agencyName = ""; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd = new BigDecimal(0); + + /** + * 事件赋分 + */ + private BigDecimal sjff = new BigDecimal(0); + + /** + * 接入率 + */ + private BigDecimal jrl = new BigDecimal(0); + + /** + * 在线率 + */ + private BigDecimal zxl = new BigDecimal(0); + + /** + * 出图率 + */ + private BigDecimal ctl = new BigDecimal(0); + + /** + * 雪亮工程 + */ + private BigDecimal xlgc = new BigDecimal(0); + + /** + * 完成进度 + */ + private BigDecimal wcjd = new BigDecimal(0); + + /** + * 未补检 + */ + private BigDecimal wbj = new BigDecimal(0); + + /** + * 反馈抽检 + */ + private BigDecimal fkcj = new BigDecimal(0); + + /** + * 日核周调 + */ + private BigDecimal rhzt = new BigDecimal(0); + + /** + * 亮点工作 + */ + private BigDecimal ldgz = new BigDecimal(0); + + /** + * 亮点工作备注 + */ + private String ldgzbz; + + /** + * 其他工作 + */ + private BigDecimal qtgz = new BigDecimal(0); + + /** + * 其他工作备注 + */ + private String qtgzbz; + + /** + * 能力得分 + */ + private BigDecimal nldf = new BigDecimal(0); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreListResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreListResultDTO.java new file mode 100644 index 0000000000..656a0dd50c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreListResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HistoryScoreListResultDTO implements Serializable { + private static final long serialVersionUID = -4316054054019675419L; + + /** + * id + */ + private String id; + /** + * 标题 + */ + private String title; + /** + * 时间区间 + */ + private String time; + /** + * 发布者 + */ + private String updatedBy; + private String updatedById; + /** + * 发布时间 + */ + private String releaseTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreSjffResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreSjffResultDTO.java new file mode 100644 index 0000000000..a6a19a0ef9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreSjffResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HistoryScoreSjffResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 上报事件总得分 + */ + private Integer eventScore = 0; + /** + * 例行工作总得分 + */ + private Integer projectScore = 0; + /** + * 网格员总数 + */ + private Integer gridStaffNum = 0; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/WeightConfigurationListResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/WeightConfigurationListResultDTO.java new file mode 100644 index 0000000000..c25999074d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/WeightConfigurationListResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class WeightConfigurationListResultDTO implements Serializable { + private static final long serialVersionUID = -4316054054019675419L; + + /** + * id + */ + private String id; + /** + * 网格活跃度 + */ + private BigDecimal wghyd; + /** + * 事件赋分 + */ + private BigDecimal sjff; + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + /** + * 日核周调 + */ + private BigDecimal rhzt; + /** + * 亮点工作 + */ + private BigDecimal ldgz; + /** + * 其他工作 + */ + private BigDecimal qtgz; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/EventreportPingyinDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/EventreportPingyinDTO.java new file mode 100644 index 0000000000..05682f55a0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/EventreportPingyinDTO.java @@ -0,0 +1,179 @@ +package com.epmet.dto.screen; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 平阴区事件上报中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Data +public class EventreportPingyinDTO { + + private static final long serialVersionUID = 1L; + + /** + * 上报区县代码,参照6位行政区划代码 + */ + private String qxBm; + + /** + * 上报区县名称 + */ + private String qxMc; + + /** + * 网格编码,参照《山东省社会治理网格化智能工作平台数据标准》 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 事件编号,可以使用区县系统中的事件唯一识别码 + */ + private String eventCode; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件类别,参照《山东省社会治理网格化智能工作平台数据标准》10.19 + */ + private String eventCategory; + + /** + * 上报网格员姓名 + */ + private String gridUserName; + + /** + * 上报网格员的身份证号码 + */ + private String gridUserCardid; + + /** + * 事件上报时间 + */ + private Date reportTime; + + /** + * 事件发生时间 + */ + private Date happenTime; + + /** + * 事件发生地点描述 + */ + private String happenPlace; + + /** + * 事件简述,详细一些,文字数量不少于10字 + */ + private String eventDescription; + + /** + * 事件办结方式,符合《标准》10.20 + */ + private String waysOfResolving; + + /** + * 必填 是否化解,填写Y、N(Y 是 N 否) + */ + private String successfulOrNo; + + /** + * 必填 是否办结,填写Y、N(Y 是 N 否) + */ + private String successfulDefuse; + + /** + * 办结层级,符合《标准》10.21 + */ + private String completeLevel; + + /** + * 办结时间,办结后填写 + */ + private Date completeTime; + + /** + * 事件发生位置经度,wgs84坐标系,请勿用火星坐标系,不得跑出辖区 + */ + private BigDecimal lng; + + /** + * 事件发生位置纬度,wgs84坐标系,请勿用火星坐标系,不得跑出辖区 + */ + private BigDecimal lat; + + /** + * 事件主要当事人姓名 + */ + private String name; + + /** + * 事件涉及人数 + */ + private Integer numberInvolved; + + /** + * 事件涉及单位名称 + */ + private String relatedUnites; + + /** + * 重点场所类别,符合《标准》10.25 + */ + private String keyAreaType; + + /** + * 宗教活动规模,符合《标准》10.26 + */ + private String religionScale; + + /** + * 宗教类别,符合《标准》10.27 + */ + private String religionType; + + /** + * 重点场所是否变动,填写Y、N(Y 是 N 否) + */ + private String isKeyareaState; + + /** + * 重点人员是否在当地,填写Y、N(Y 是 N 否) + */ + private String isKeypeopleLocate; + + /** + * 重点人员现状描述 + */ + private String keypeopleStatus; + + /** + * 例行工作编辑插入、更新时间,县市区填写 + */ + private Date updateTime; + + /** + * 事件是否删除,Y:是、N:否 + */ + private String isDel; + + /** + * 入库时间,自动生成,请勿设置 + */ + private Date recoredInsertTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/GridstaffWorkInfoPingyinDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/GridstaffWorkInfoPingyinDTO.java new file mode 100644 index 0000000000..b277c2bee9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/GridstaffWorkInfoPingyinDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.screen; + +import lombok.Data; + +import java.util.Date; + +/** + * 平阴区网格员例行工作信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Data +public class GridstaffWorkInfoPingyinDTO { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 上报区县代码,参照6位行政区划代码 + */ + private String qxBm; + + /** + * 上报区县名称 + */ + private String qxMc; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + private String gridId; + + /** + * 例行工作类型,应符合10.27中的例行工作类型 + */ + private String workType; + + /** + * 发生日期,格式为“YYYY-MM-DD” + */ + private Date happenTime; + + /** + * 基础信息主键,出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填 + */ + private Integer baseInfoId; + + /** + * 有无变动(异常),Y:是、N:否 + */ + private String workResult; + + /** + * 说明 + */ + private String workContent; + + /** + * 例行工作编辑插入、更新时间,,县市区填写 + */ + private Date updateTime; + + /** + * 例行工作是否删除,Y:是、N:否 + */ + private String isDel; + + /** + * 入库时间,自动生成,请勿设置 + */ + private Date recoredInsertTime; + + private String happenTimeString; + + private String title; + private String staffName; + private String mobile; + private String orgId; + private String pids; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/SavePyEventDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/SavePyEventDataFormDTO.java new file mode 100644 index 0000000000..e415027135 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/SavePyEventDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.screen.form;/** + * @author ZhaoQiFeng + * @date 2022/12/8 + * @apiNote + */ + +import com.epmet.dto.screen.EventreportPingyinDTO; +import com.epmet.dto.screen.GridstaffWorkInfoPingyinDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/12/8 13:47 + */ +@Data +public class SavePyEventDataFormDTO implements Serializable { + private static final long serialVersionUID = 526763788231934112L; + /** + * 项目列表 + */ + private List projectList; + /** + * 例行工作列表 + */ + private List workList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index ffd9da0f11..0f90ba3d7f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -8,10 +8,12 @@ import com.epmet.dto.basereport.result.EventInfoResultDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; +import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; +import com.epmet.dto.screen.form.SavePyEventDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; @@ -379,4 +381,10 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatNeighborhood") Result userHouseStatNeighborhood(@RequestBody FactUserHouseFormDTO formDTO); + + @PostMapping("/data/stats/datareporting/saveData") + Result saveData(@RequestBody SavePyEventDataFormDTO formDTO); + + @PostMapping("/data/stats/screenPyStaffData/savelist") + Result saveList(@RequestBody List dtoList); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index a46ceb0635..39be018129 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -9,10 +9,12 @@ import com.epmet.dto.basereport.result.EventInfoResultDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; +import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; +import com.epmet.dto.screen.form.SavePyEventDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; @@ -372,4 +374,14 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result userHouseStatNeighborhood(FactUserHouseFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatNeighborhood", formDTO); } + + @Override + public Result saveData(SavePyEventDataFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "SavePyEventDataFormDTO", formDTO); + } + + @Override + public Result saveList(List dtoList) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "saveList", dtoList); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 58c569ab81..fc14a26018 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -148,6 +148,12 @@ 2.0.0 compile + + com.epmet + data-aggregator-client + 2.0.0 + compile + @@ -582,7 +588,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java index a61a208f34..54f5b02b41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java @@ -7,6 +7,7 @@ import com.epmet.dto.basereport.result.EventInfoResultDTO; import com.epmet.dto.org.form.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.screen.form.SavePyEventDataFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; @@ -14,12 +15,14 @@ import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.opendata.dto.BaseDisputeProcessDTO; import com.epmet.service.DataReportingService; +import com.epmet.service.evaluationindex.screen.ScreenPyEventDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.util.List; /** @@ -31,6 +34,8 @@ import java.util.List; public class DataReportingController { @Autowired private DataReportingService dataReportingService; + @Resource + private ScreenPyEventDataService screenPyEventDataService; /** * @Author sun @@ -106,4 +111,18 @@ public class DataReportingController { public Result> getEventInfoV2(@RequestBody(required = false) EventInfoFormDTO formDTO) { return new Result>().ok(dataReportingService.getEventInfoV2(formDTO)); } + + /** + * 保存同步到中间库的数据 + * + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/12/8 16:03 + */ + @PostMapping("saveData") + public Result getEventInfoV2(@RequestBody(required = false) SavePyEventDataFormDTO formDTO) { + screenPyEventDataService.saveData(formDTO); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyGridStaffController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyGridStaffController.java new file mode 100644 index 0000000000..d622b70bab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyGridStaffController.java @@ -0,0 +1,36 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyGridStaffService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@RestController +@RequestMapping("screenPyGridStaff") +public class ScreenPyGridStaffController { + + @Autowired + private ScreenPyGridStaffService screenPyStaffDataService; + + + @PostMapping("savelist") + public Result saveList(@RequestBody List dtoList) { + screenPyStaffDataService.saveList(dtoList); + return new Result(); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java new file mode 100644 index 0000000000..5c90c6a5d0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java @@ -0,0 +1,164 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.support.ExcelTypeEnum; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.CustomerTitleHandler; +import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillCellMergeStrategy; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; +import com.epmet.excel.HistoryScoreDetailExcel; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Date; +import java.util.List; + +/** + * 平阴历史得分主表 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@RestController +@RequestMapping("screenPyHistoryScore") +public class ScreenPyHistoryScoreController { + + @Autowired + private ScreenPyHistoryScoreService screenPyHistoryScoreService; + @Autowired + private ScreenPyHistoryScoreDetailService screenPyHistoryScoreDetailService; + + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(screenPyHistoryScoreService.list(formDTO)); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { + ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Add.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + screenPyHistoryScoreService.save(dto); + return new Result(); + } + + @PostMapping("edit") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { + ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Edit.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + screenPyHistoryScoreService.update(dto); + return new Result(); + } + + @PostMapping("deleteById") + public Result deleteById(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { + ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Edit.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + screenPyHistoryScoreService.deleteById(dto); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, HistoryScoreFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(screenPyHistoryScoreService.detail(formDTO)); + } + + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreListFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.FIVE_HUNDRED); + try { + String fileName = "历史得分" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), HistoryScoreDetailExcel.class).excelType(ExcelTypeEnum.XLSX).build(); + + PageData data = null; + List list = null; + do { + data = screenPyHistoryScoreDetailService.selectScoreDetailList(formDTO); + + for (HistoryScoreDetailResultDTO d : data.getList()){ + list = ConvertUtils.sourceToTarget(d.getDetailList(), HistoryScoreDetailExcel.class); + //一条主表记录一个sheet页 + WriteSheet writeSheet = EasyExcel.writerSheet("(" + d.getTitle() + ")").registerWriteHandler(new CustomerTitleHandler(d.getTime())).build(); + excelWriter.write(list, writeSheet); + } + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + @RequestMapping("computescore") + public Result computeScore(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreComputeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, HistoryScoreComputeFormDTO.Compute.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(screenPyHistoryScoreService.computeScore(formDTO)); + } + + @PostMapping("nldfscore") + public Result nldfScore(@RequestBody HistoryScoreFormDTO.Detail dto) { + return new Result().ok(screenPyHistoryScoreService.nldfScore(dto)); + } + + @RequestMapping("dplist") + public Result> dplist(@RequestBody HistoryScoreListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, HistoryScoreListFormDTO.List.class); + return new Result>().ok(screenPyHistoryScoreService.dplist(formDTO)); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyWeightConfigurationController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyWeightConfigurationController.java new file mode 100644 index 0000000000..81064ee2f7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyWeightConfigurationController.java @@ -0,0 +1,70 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO; +import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; +import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 平阴政法能力权重配置 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@RestController +@RequestMapping("screenPyWeightConfiguration") +public class ScreenPyWeightConfigurationController { + + @Autowired + private ScreenPyWeightConfigurationService screenPyWeightConfigurationService; + + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(screenPyWeightConfigurationService.list(formDTO)); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) { + ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Add.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + screenPyWeightConfigurationService.save(dto); + return new Result(); + } + + @PostMapping("edit") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) { + ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Edit.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + screenPyWeightConfigurationService.update(dto); + return new Result(); + } + + @PostMapping("deleteById") + public Result deleteById(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) { + ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Edit.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + screenPyWeightConfigurationService.deleteById(dto); + return new Result(); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyGridStaffDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyGridStaffDao.java new file mode 100644 index 0000000000..396f2d6b8c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyGridStaffDao.java @@ -0,0 +1,36 @@ +package com.epmet.dao.evaluationindex.indexcoll; /** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyGridStaffEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + */ +@Mapper +public interface ScreenPyGridStaffDao extends BaseDao { + + ScreenPyGridStaffEntity selectStaff(@Param("gridId") String gridId, @Param("staffId") String staffId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java new file mode 100644 index 0000000000..531aa77f53 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java @@ -0,0 +1,47 @@ +package com.epmet.dao.evaluationindex.indexcoll; /** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 平阴历史得分主表 + * + * @author generator generator@elink-cn.com + */ +@Mapper +public interface ScreenPyHistoryScoreDao extends BaseDao { + + List selectHistoryScoreList(HistoryScoreListFormDTO formDTO); + + HistoryScoreSjffResultDTO sumEventScore(HistoryScoreComputeFormDTO formDTO); + + HistoryScoreSjffResultDTO sumProjectScore(HistoryScoreComputeFormDTO formDTO); + + HistoryScoreSjffResultDTO sumGridNum(HistoryScoreComputeFormDTO formDTO); + + List selectDpList(HistoryScoreListFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.java new file mode 100644 index 0000000000..0a39d1186f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.java @@ -0,0 +1,40 @@ +package com.epmet.dao.evaluationindex.indexcoll; /** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 平阴历史得分明细表 + * + * @author generator generator@elink-cn.com + */ +@Mapper +public interface ScreenPyHistoryScoreDetailDao extends BaseDao { + + void delByHistoryScoreId(@Param("historyScoreId") String historyScoreId, @Param("userId") String userId); + + List selectScoreDetailList(HistoryScoreListFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.java new file mode 100644 index 0000000000..2d2d431f6e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.java @@ -0,0 +1,43 @@ +package com.epmet.dao.evaluationindex.indexcoll; /** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.ScreenPyWeightConfigurationDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; +import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 平阴政法能力权重配置 + * + * @author generator generator@elink-cn.com + */ +@Mapper +public interface ScreenPyWeightConfigurationDao extends BaseDao { + + List selectWeightConfigurationList(WeightConfigurationListFormDTO formDTO); + + ScreenPyWeightConfigurationDTO selectOneDTO(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPyEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPyEventDataDao.java new file mode 100644 index 0000000000..ed3f74ccc9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPyEventDataDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 上报到市平台中间库的事件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-12-08 + */ +@Mapper +public interface ScreenPyEventDataDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyGridStaffEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyGridStaffEntity.java new file mode 100644 index 0000000000..1c59536017 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyGridStaffEntity.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_py_grid_staff") +public class ScreenPyGridStaffEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格名称 + */ + private String pids; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 网格员姓名 + */ + private String staffName; + + /** + * 手机号 + */ + private String mobile; + + /** + * 是否离职,格式为Y:是、N:否 + */ + private String isLeave; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java new file mode 100644 index 0000000000..f1e06c0ff5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 平阴历史得分明细表 + * + * @author generator generator@elink-cn.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_py_history_score_detail") +public class ScreenPyHistoryScoreDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * screen_py_history_score.id + */ + private String historyScoreId; + + /** + * 街道组织Id + */ + private String agencyId; + + /** + * 街道名称 + */ + private String agencyName; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 接入率 + */ + private BigDecimal jrl; + + /** + * 在线率 + */ + private BigDecimal zxl; + + /** + * 出图率 + */ + private BigDecimal ctl; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 完成进度 + */ + private BigDecimal wcjd; + + /** + * 未补检 + */ + private BigDecimal wbj; + + /** + * 反馈抽检 + */ + private BigDecimal fkcj; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 亮点工作备注 + */ + private String ldgzbz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 其他工作备注 + */ + private String qtgzbz; + + /** + * 能力得分 + */ + private BigDecimal nldf; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreEntity.java new file mode 100644 index 0000000000..db484429cd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreEntity.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 平阴历史得分主表 + * + * @author generator generator@elink-cn.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_py_history_score") +public class ScreenPyHistoryScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + private Date startTime; + + /** + * 截止时间 + */ + private Date endTime; + + /** + * 发布时间 + */ + private Date releaseTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java new file mode 100644 index 0000000000..1997025a99 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyWeightConfigurationEntity.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 平阴政法能力权重配置 + * + * @author generator generator@elink-cn.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_py_weight_configuration") +public class ScreenPyWeightConfigurationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPyEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPyEventDataEntity.java new file mode 100644 index 0000000000..2b31ed2fed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPyEventDataEntity.java @@ -0,0 +1,70 @@ +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 上报到市平台中间库的事件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_py_event_data") +public class ScreenPyEventDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + ///** + // * 客户Id + // */ + //private String customerId; + + /** + * 上级组织Id + */ + private String orgId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String pids; + + /** + * 事件Id + */ + private String eventId; + + /** + * 事件类别 上报事件:project;例行工作:work + */ + private String eventType; + + /** + * 事件时间 + */ + private Date eventCreateTime; + + /** + * 事件分类编码 + */ + private String categoryCode; + + private String title; + + private String staffName; + + private String mobile; + + ///** + // * 父类事件分类编码 + // */ + //private String parentCategoryCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/HistoryScoreDetailExcel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/HistoryScoreDetailExcel.java new file mode 100644 index 0000000000..e086132a19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/HistoryScoreDetailExcel.java @@ -0,0 +1,57 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.alibaba.excel.annotation.write.style.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 政法能力历史得分-导出 + * + * @author generator generator@elink-cn.com + */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +@HeadRowHeight(40) +@Data +public class HistoryScoreDetailExcel implements Serializable { + + private static final long serialVersionUID = -12110233388005838L; + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "下级单位"}) + @ColumnWidth(15) + @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) + private String agencyName; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "网格活跃度"}) + @ColumnWidth(15) + private BigDecimal wghyd; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "事件赋值得分"}) + @ColumnWidth(20) + private BigDecimal sjff; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "雪亮工程"}) + @ColumnWidth(15) + private BigDecimal xlgc; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "日核周调"}) + @ColumnWidth(15) + private BigDecimal rhzt; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "亮点工作"}) + @ColumnWidth(15) + private BigDecimal ldgz; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "其他工作"}) + @ColumnWidth(15) + private BigDecimal qtgz; + + @ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "能力得分"}) + @ColumnWidth(15) + private BigDecimal nldf; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyGridStaffService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyGridStaffService.java new file mode 100644 index 0000000000..057a9aa6af --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyGridStaffService.java @@ -0,0 +1,15 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; + +import java.util.List; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + */ +public interface ScreenPyGridStaffService { + + void saveList(List dtoList); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailService.java new file mode 100644 index 0000000000..0fea59c676 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; + +import java.util.List; + +/** + * 平阴历史得分明细表 + * + * @author generator generator@elink-cn.com + */ +public interface ScreenPyHistoryScoreDetailService { + + PageData selectScoreDetailList(HistoryScoreListFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java new file mode 100644 index 0000000000..53d012a042 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java @@ -0,0 +1,35 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; + +import java.util.List; + +/** + * 平阴历史得分主表 + * + * @author generator generator@elink-cn.com + */ +public interface ScreenPyHistoryScoreService { + + PageData list(HistoryScoreListFormDTO formDTO); + + void save(HistoryScoreFormDTO dto); + + void update(HistoryScoreFormDTO dto); + + void deleteById(HistoryScoreFormDTO dto); + + HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO); + + HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO); + + HistoryScoreComputeResultDTO nldfScore(HistoryScoreFormDTO.Detail dto); + + List dplist(HistoryScoreListFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java new file mode 100644 index 0000000000..fe5b41076b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyWeightConfigurationService.java @@ -0,0 +1,23 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO; +import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; +import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; + +/** + * 平阴政法能力权重配置 + * + * @author generator generator@elink-cn.com + */ +public interface ScreenPyWeightConfigurationService { + + PageData list(WeightConfigurationListFormDTO formDTO); + + void save(WeightConfigurationFormDTO dto); + + void update(WeightConfigurationFormDTO dto); + + void deleteById(WeightConfigurationFormDTO dto); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyGridStaffServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyGridStaffServiceImpl.java new file mode 100644 index 0000000000..35fc1058a7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyGridStaffServiceImpl.java @@ -0,0 +1,53 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.ScreenPyGridStaffDao; +import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyGridStaffEntity; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyGridStaffService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenPyGridStaffServiceImpl extends BaseServiceImpl implements ScreenPyGridStaffService { + + @Override + public void saveList(List dtoList) { + dtoList.forEach(d -> { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(StrConstant.PY_CUSTOMER, d.getStaffId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", d.getStaffId())); + } + ScreenPyGridStaffEntity entity = baseDao.selectStaff(d.getGridId(), d.getStaffId()); + //存在就更新 不存在就新增 + if (null != entity) { + ScreenPyGridStaffEntity entity1 = ConvertUtils.sourceToTarget(d, ScreenPyGridStaffEntity.class); + entity1.setId(entity.getId()); + entity1.setPids(("".equals(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":") + staffInfo.getAgencyId()); + baseDao.updateById(entity1); + } else { + ScreenPyGridStaffEntity saveEntity = ConvertUtils.sourceToTarget(d, ScreenPyGridStaffEntity.class); + saveEntity.setId(IdWorker.getIdStr()); + saveEntity.setPids(("".equals(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":") + staffInfo.getAgencyId()); + insert(saveEntity); + } + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreDetailServiceImpl.java new file mode 100644 index 0000000000..aab939444f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreDetailServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 平阴历史得分明细表 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenPyHistoryScoreDetailServiceImpl extends BaseServiceImpl implements ScreenPyHistoryScoreDetailService { + + + @Override + public PageData selectScoreDetailList(HistoryScoreListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectScoreDetailList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java new file mode 100644 index 0000000000..bf657668e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java @@ -0,0 +1,251 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.RenException; +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.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao; +import com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao; +import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; +import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; +import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; +import com.epmet.dto.indexcollect.ScreenPyHistoryScoreDetailDTO; +import com.epmet.dto.indexcollect.ScreenPyWeightConfigurationDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; +import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO; +import com.epmet.dto.result.IcMoveInListResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.*; + +/** + * 平阴历史得分主表 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX_READ) +public class ScreenPyHistoryScoreServiceImpl implements ScreenPyHistoryScoreService { + + @Autowired + private ScreenPyHistoryScoreDao screenPyHistoryScoreDao; + @Autowired + private ScreenPyHistoryScoreDetailServiceImpl screenPyHistoryScoreDetailServiceImpl; + @Autowired + private ScreenPyHistoryScoreDetailDao screenPyHistoryScoreDetailDao; + @Autowired + private DataAggregatorOpenFeignClient dataAggregatorOpenFeignClient; + @Autowired + private ScreenPyWeightConfigurationDao screenPyWeightConfigurationDao; + + + @Override + public PageData list(HistoryScoreListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = screenPyHistoryScoreDao.selectHistoryScoreList(formDTO); + list.forEach(l->{ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), l.getUpdatedById()); + if (null != staffInfo) { + l.setUpdatedBy(staffInfo.getRealName()); + } + }); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HistoryScoreFormDTO formDTO) { + //1.主表新增数据 + ScreenPyHistoryScoreEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class); + entity.setReleaseTime(new Date()); + screenPyHistoryScoreDao.insert(entity); + //2.明细表新增数据 + ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO(); + List list = new ArrayList<>(); + formDTO.getDetailList().forEach(dto -> { + ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class); + detailEntity.setCustomerId(formDTO.getCustomerId()); + detailEntity.setHistoryScoreId(entity.getId()); + if (null != wcDTO) { + BigDecimal nldf = detailEntity.getWghyd().multiply(wcDTO.getWghyd()).add(detailEntity.getSjff().multiply(wcDTO.getSjff())) + .add(detailEntity.getXlgc().multiply(wcDTO.getXlgc())).add(detailEntity.getRhzt().multiply(wcDTO.getRhzt())) + .add(detailEntity.getLdgz().multiply(wcDTO.getLdgz())).add(detailEntity.getQtgz().multiply(wcDTO.getQtgz())); + detailEntity.setNldf(nldf); + } + list.add(detailEntity); + }); + screenPyHistoryScoreDetailServiceImpl.insertBatch(list); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HistoryScoreFormDTO formDTO) { + ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); + if (entity == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); + } + //1.更新主表 + ScreenPyHistoryScoreEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class); + newEntity.setId(entity.getId()); + screenPyHistoryScoreDao.updateById(newEntity); + //2.更新字表 字表先删后增 + List list = new ArrayList<>(); + ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO(); + formDTO.getDetailList().forEach(dto -> { + ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class); + detailEntity.setCustomerId(entity.getCustomerId()); + detailEntity.setHistoryScoreId(entity.getId()); + if (null != wcDTO) { + BigDecimal nldf = detailEntity.getWghyd().multiply(wcDTO.getWghyd()).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())) + .add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())) + .add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())); + detailEntity.setNldf(nldf); + } + list.add(detailEntity); + }); + screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId()); + screenPyHistoryScoreDetailServiceImpl.insertBatch(list); + } + + @Override + public void deleteById(HistoryScoreFormDTO formDTO) { + ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); + if (entity == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); + } + entity.setDelFlag("1"); + screenPyHistoryScoreDao.deleteById(entity); + screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId()); + } + + @Override + public HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO) { + HistoryScoreDetailResultDTO resultDTO = new HistoryScoreDetailResultDTO(); + //1.主表数据 + ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); + if (entity == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); + } + resultDTO = ConvertUtils.sourceToTarget(entity, HistoryScoreDetailResultDTO.class); + //2.字表数据 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenPyHistoryScoreDetailEntity::getHistoryScoreId, formDTO.getId()); + wrapper.eq(ScreenPyHistoryScoreDetailEntity::getDelFlag, "0"); + wrapper.orderByDesc(ScreenPyHistoryScoreDetailEntity::getNldf); + List list = screenPyHistoryScoreDetailDao.selectList(wrapper); + List detailList = ConvertUtils.sourceToTarget(list, HistoryScoreDetailResultDTO.Detail.class); + resultDTO.setDetailList(detailList); + return resultDTO; + } + + @Override + public HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO) { + HistoryScoreComputeResultDTO resultDTO = new HistoryScoreComputeResultDTO(); + resultDTO.setAgencyId(formDTO.getAgencyId()); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.TWO); + if ("grid".equals(formDTO.getType())) { + /** + * 网格活跃度每周得分=(活跃网格数/本街镇网格数)x100+(正常网格数/本街镇网格数)x80 + * 1周内每个末级网格有五天及五天以上上传事件或开展例行工作的为活跃网格;有2天及2天以上,5天以下上传事件或开展例行工作的为正常运行网格;只有1天上传事件或开展例行工作的为僵尸网格 + * 本街镇网格数基于本街镇基础网格总数进行计算,不包含专属网格 + */ + //1.获取街道下时间区间内的网格活跃度数据 + GridLivelyFormDTO form = ConvertUtils.sourceToTarget(formDTO, GridLivelyFormDTO.class); + form.setType("historyScore"); + Result> result = dataAggregatorOpenFeignClient.grdiLively(form); + if (!result.success() || result.getData() == null) { + throw new RenException("统计街道下网格活跃度数据失败"); + } + if (!CollectionUtils.isEmpty(result.getData())) { + GridLivelyResultDTO gridLively = result.getData().get(NumConstant.ZERO); + String score = (gridLively.getGridSumNum() <= 0) ? "0" : numberFormat.format(((float) gridLively.getGridLivelyNum() / (float) gridLively.getGridSumNum()) * 100 + ((float)gridLively.getGridOrdinaryNum() / (float)gridLively.getGridSumNum()) * 80); + resultDTO.setScore(score); + } + } else if ("event".equals(formDTO.getType())) { + /** + * 事件赋分= 街道下末级网格上报事件数量乘以对应的每项事件分值的累加和除以街道下有效未离职状态的网格员总数 + * 加上街道下末级网格例行工作数量乘以对应的每项事件分值的累加和除以街道下有效未离职状态的网格员总数 + */ + //查询街道下时间区间内事件总分 + HistoryScoreSjffResultDTO dto1 = screenPyHistoryScoreDao.sumEventScore(formDTO); + //查询街道下时间区间内例行工作总分 + HistoryScoreSjffResultDTO dto2 = screenPyHistoryScoreDao.sumProjectScore(formDTO); + //查询街道下有效网格员数 + HistoryScoreSjffResultDTO dto3 = screenPyHistoryScoreDao.sumGridNum(formDTO); + String score = numberFormat.format(((float) dto1.getEventScore() / (float) dto3.getGridStaffNum()) + ((float)dto2.getProjectScore() / (float)dto3.getGridStaffNum())); + resultDTO.setScore(score); + } + return resultDTO; + } + + /** + * 政法能力-历史得分-填完六个数后计算能力得分使用 + * @param dto + * @return + */ + @Override + public HistoryScoreComputeResultDTO nldfScore(HistoryScoreFormDTO.Detail dto) { + HistoryScoreComputeResultDTO resultDTO = new HistoryScoreComputeResultDTO(); + resultDTO.setAgencyId(dto.getAgencyId()); + ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO(); + if (null != wcDTO) { + BigDecimal nldf = dto.getWghyd().multiply(wcDTO.getWghyd()).add(dto.getWghyd().multiply(wcDTO.getWghyd())) + .add(dto.getWghyd().multiply(wcDTO.getWghyd())).add(dto.getWghyd().multiply(wcDTO.getWghyd())) + .add(dto.getWghyd().multiply(wcDTO.getWghyd())).add(dto.getWghyd().multiply(wcDTO.getWghyd())); + resultDTO.setScore(nldf.toString()); + } + return resultDTO; + } + + @Override + public List dplist(HistoryScoreListFormDTO formDTO) { + //按条件查询数据,并做加和取平均值操作 + List resultList = screenPyHistoryScoreDao.selectDpList(formDTO); + Map map = new HashMap<>(); + map.put("1258587398679126017","榆山街道");map.put("1215437824174608386","锦水街道"); + map.put("f8d4a6af53b3fc5991ab1434b6ad39b8","东阿镇");map.put("d20a7488eedf5bcfd5231c3771bc0e3d","玫瑰镇"); + map.put("ea78a8e9252f567517c4a8d60250c714","安城镇");map.put("1234085031077498881","孔村镇"); + map.put("f279343a67653fc20d8333c6b2e4dbee","孝直镇");map.put("c259c3b1d27f960b9b379fb2886179ba","洪范池镇"); + resultList.forEach(re->{ + map.remove(re.getAgencyId()); + }); + for (String ma : map.keySet()){ + HistoryScoreDetailResultDTO.Detail detail = new HistoryScoreDetailResultDTO.Detail(); + detail.setAgencyId(ma); + detail.setAgencyName(map.get(ma)); + resultList.add(detail); + } + return resultList; + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java new file mode 100644 index 0000000000..e40c30e023 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyWeightConfigurationServiceImpl.java @@ -0,0 +1,74 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao; +import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO; +import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; +import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity; +import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 平阴政法能力权重配置 + * + * @author generator generator@elink-cn.com + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenPyWeightConfigurationServiceImpl extends BaseServiceImpl implements ScreenPyWeightConfigurationService { + + + @Override + public PageData list(WeightConfigurationListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectWeightConfigurationList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WeightConfigurationFormDTO formDTO) { + //1.主表新增数据 + ScreenPyWeightConfigurationEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WeightConfigurationFormDTO formDTO) { + ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId()); + if (entity == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); + } + ScreenPyWeightConfigurationEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class); + newEntity.setId(entity.getId()); + baseDao.updateById(newEntity); + } + + @Override + public void deleteById(WeightConfigurationFormDTO formDTO) { + ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId()); + if (entity == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); + } + entity.setDelFlag("1"); + baseDao.deleteById(entity); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPyEventDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPyEventDataService.java new file mode 100644 index 0000000000..3c060d2ad6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPyEventDataService.java @@ -0,0 +1,24 @@ +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.screen.form.SavePyEventDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity; + +/** + * 上报到市平台中间库的事件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-12-08 + */ +public interface ScreenPyEventDataService extends BaseService { + /** + * 保存同步到中间库的数据 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/12/8 11:14 + */ + void saveData(SavePyEventDataFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPyEventDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPyEventDataServiceImpl.java new file mode 100644 index 0000000000..b916f891a7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPyEventDataServiceImpl.java @@ -0,0 +1,95 @@ +package com.epmet.service.evaluationindex.screen.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.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao; +import com.epmet.dao.evaluationindex.screen.ScreenPyEventDataDao; +import com.epmet.dto.screen.form.SavePyEventDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenPyEventDataService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 上报到市平台中间库的事件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-12-08 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenPyEventDataServiceImpl extends BaseServiceImpl implements ScreenPyEventDataService { + + @Resource + private ScreenProjectDataDao screenProjectDataDao; + /** + * 保存同步到中间库的数据 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/12/8 11:14 + */ + @Override + public void saveData(SavePyEventDataFormDTO formDTO) { + if (CollectionUtils.isNotEmpty(formDTO.getProjectList())) { + formDTO.getProjectList().forEach(item -> { + ScreenPyEventDataEntity entity = new ScreenPyEventDataEntity(); + entity.setEventId(item.getEventCode().replace("py_", "")); + entity.setEventType("project"); + entity.setEventCreateTime(item.getReportTime()); + entity.setCategoryCode(item.getEventCategory()); + ScreenProjectDataEntity project = screenProjectDataDao.selectById(entity.getEventId()); + if (null != project) { + entity.setOrgId(project.getOrgId()); + entity.setPids(project.getAllParentIds()); + entity.setTitle(project.getProjectTitle()); + entity.setStaffName(project.getLinkName()); + entity.setMobile(project.getLinkMobile()); + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenPyEventDataEntity::getEventId, entity.getEventId()); + wrapper.eq(ScreenPyEventDataEntity::getEventType, entity.getEventType()); + ScreenPyEventDataEntity event = baseDao.selectOne(wrapper); + if (null == event) { + baseDao.insert(entity); + } else { + entity.setId(event.getId()); + baseDao.updateById(entity); + } + }); + } + if (CollectionUtils.isNotEmpty(formDTO.getWorkList())) { + formDTO.getWorkList().forEach(item -> { + ScreenPyEventDataEntity entity = new ScreenPyEventDataEntity(); + entity.setEventId(item.getId()); + entity.setEventType("work"); + entity.setEventCreateTime(item.getHappenTime()); + entity.setCategoryCode(item.getWorkType()); + entity.setOrgId(item.getOrgId()); + entity.setPids(item.getPids()); + entity.setTitle(item.getTitle()); + entity.setStaffName(item.getStaffName()); + entity.setMobile(item.getMobile()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenPyEventDataEntity::getEventId, entity.getEventId()); + wrapper.eq(ScreenPyEventDataEntity::getEventType, entity.getEventType()); + ScreenPyEventDataEntity event = baseDao.selectOne(wrapper); + if (null == event) { + baseDao.insert(entity); + } else { + entity.setId(event.getId()); + baseDao.updateById(entity); + } + }); + } + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyGridStaffDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyGridStaffDao.xml new file mode 100644 index 0000000000..207b413c14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyGridStaffDao.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml new file mode 100644 index 0000000000..1b311eb25c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.xml new file mode 100644 index 0000000000..df3891e1b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailDao.xml @@ -0,0 +1,65 @@ + + + + + + + UPDATE + screen_py_history_score_detail + SET + updated_by = #{userId}, + updated_time = NOW(), + del_flag = '1' + WHERE + history_score_id = #{historyScoreId} + AND del_flag = '0' + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml new file mode 100644 index 0000000000..4a29b5dc19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyWeightConfigurationDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPyEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPyEventDataDao.xml new file mode 100644 index 0000000000..9f07fd4b0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPyEventDataDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java index 0115706902..1217ea6875 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java @@ -179,5 +179,9 @@ public class IcPartyActivityDTO implements Serializable { */ @JsonIgnore private Date updatedTime; - + /** + * actId不为空小程序 + * 为空管理平台 + */ + private String originName; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java index 1aed3be19f..b269fa0d5b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java @@ -86,6 +86,11 @@ public class IcPartyUnitDTO implements Serializable { */ private List serviceMatterNameList; + /** + * 服务事项名称多个按照中文顿号隔开 + */ + private String serviceMatterName; + /** * 联系人 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java new file mode 100644 index 0000000000..255d395e0a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class IcPublicServiceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + private String type; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + private List serviceMatterList; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java new file mode 100644 index 0000000000..64a993efa9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java @@ -0,0 +1,90 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 公共服务组织服务事项(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class IcPublicServiceOrgServiceMatterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonIgnore + private String id; + + /** + * 客户id + */ + @JsonIgnore + private String customerId; + + /** + * ic_public_service_org.ID + */ + @JsonIgnore + private String orgId; + + /** + * ic_service_item_dict.ID + */ + private String categoryId; + + /** + * 服务事项编码ic_service_item_dict.CATEGORY_CODE + */ + private String categoryCode; + + /** + * 删除标识 0未删除、1已删除 + */ + @JsonIgnore + private String delFlag; + + /** + * 乐观锁 + */ + @JsonIgnore + private Integer revision; + + /** + * 创建人 + */ + @JsonIgnore + private String createdBy; + + /** + * 创建时间 + */ + @JsonIgnore + private Date createdTime; + + /** + * 更新人 + */ + @JsonIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @JsonIgnore + private Date updatedTime; + + /** + * 详情页面显示 + */ + private String categoryName; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java new file mode 100644 index 0000000000..f5aa42b008 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java @@ -0,0 +1,133 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/3 15:04 + */ +@Data +public class IcPublicServiceOrgFormDTO { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateUserInternalGroup { + } + + public interface UpdateUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 主键 + */ + @NotBlank(message = "id为空", groups = UpdateUserInternalGroup.class) + private String id; + + /** + * 客户id + */ + @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) + private String customerId; + + /** + * 组织ID + */ + @NotBlank(message = "agencyId不能为空",groups =UpdateUserInternalGroup.class ) + private String agencyId; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + @Length(max = 100, groups = AddUserShowGroup.class, message = "最多输入100字") + @NotBlank(message = "名称不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + @NotBlank(message = "类别不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String type; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String contact; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String contactMobile; + + /** + * 地址 + */ + @NotBlank(message = "地址不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class}) + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + @Length(max = 500,message = "最多输入500字",groups ={UpdateUserShowGroup.class,AddUserShowGroup.class} ) + private String remark; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private List serviceMatterList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java new file mode 100644 index 0000000000..d056c4af1d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/3 16:02 + */ +@Data +public class IcPublicServiceOrgPageFormDTO extends PageFormDTO { + private String customerId; + private String agencyId; + private String name; + private List categoryIds; + private String type; + private String contact; + private String contactMobile; + + /** + * 工作端当前登录人员 + */ + private String currentStaffId; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java index fb67921cd8..76f6d485db 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; @@ -15,7 +16,7 @@ import java.util.Date; */ @NoArgsConstructor @Data -public class PartyActivityFormDTO implements Serializable { +public class PartyActivityFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = -2510068555703677L; @NotBlank(message = "组织Id不能为空" ) private String agencyId; @@ -27,7 +28,7 @@ public class PartyActivityFormDTO implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date endTime; private String serviceMatter; - private Integer pageNo; - private Integer pageSize; + // private Integer pageNo; + // private Integer pageSize; private String customerId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java index ec4a1751dd..f238e5dbe1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; import lombok.NoArgsConstructor; @@ -12,7 +13,7 @@ import java.io.Serializable; */ @NoArgsConstructor @Data -public class PartyUnitFormDTO implements Serializable { +public class PartyUnitFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = 1256798619648265622L; private String customerId; @@ -22,8 +23,8 @@ public class PartyUnitFormDTO implements Serializable { private String type; private String contact; private String contactMobile; - private Integer pageNo; - private Integer pageSize; + // private Integer pageNo; + // private Integer pageSize; /** * 工作端当前登录人员 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java new file mode 100644 index 0000000000..a596953035 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java @@ -0,0 +1,87 @@ +package com.epmet.dto.result; + +import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; +import lombok.Data; + +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/3 15:52 + */ +@Data +public class IcPublicServiceOrgDetailResDTO { + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + + private String agencyName; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + private String type; + + private String typeName; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + /** + * 服务事项名称 + * 多个,按照英文逗号隔开 + */ + private String serviceMatterName; + + private List serviceMatterList; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java index 3408b5f724..7a745fa207 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java @@ -13,6 +13,10 @@ import java.io.Serializable; public class ServiceItemResultDTO implements Serializable { private static final long serialVersionUID = -590440160577071133L; private String categoryId; + /** + * 分类编码 + */ + private String categoryCode; private String categoryName; private Integer awardPoint; private Boolean usableFlag; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 168d343a79..f0906621f7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -119,6 +119,7 @@ public interface EpmetHeartOpenFeignClient { /** * Desc: 获取联建单位名字 + * 查询项目处理进展时调用 * @param formDTO * @author zxc * @date 2022/5/17 17:53 diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 2ab5b46da6..d812566efc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -308,7 +308,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 true diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java index 38b63b836d..7e428aa6a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java @@ -17,15 +17,21 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.ExcelUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; @@ -40,19 +46,23 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcPartyActivityService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; import java.io.IOException; -import java.util.ArrayList; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.file.Path; +import java.util.Date; import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; +import java.util.UUID; /** @@ -64,7 +74,7 @@ import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("icpartyactivity") -public class IcPartyActivityController { +public class IcPartyActivityController implements ResultDataResolver { @Autowired private IcPartyActivityService icPartyActivityService; @@ -111,23 +121,36 @@ public class IcPartyActivityController { } @PostMapping("export") - public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception { - List list = icPartyActivityService.list(formDTO); - List excelList = new ArrayList<>(); - AtomicInteger i = new AtomicInteger(1); - if (CollectionUtils.isNotEmpty(list)) { - excelList = list.stream().map(item -> { - IcPartyActivityExcel excel = new IcPartyActivityExcel(); - excel.setIndex(i.getAndIncrement()); - excel.setUnitName(item.getUnitName()); - excel.setTitle(item.getTitle()); - excel.setAddress(item.getAddress()); - excel.setPeopleCount(item.getPeopleCount()); - excel.setActivityTime(DateUtils.format(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN)); - return excel; - }).collect(Collectors.toList()); + public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + // 这里 需要指定写用哪个class去写 + String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); + String fileName = "联建活动".concat(today); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyActivityExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icPartyActivityService.search(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcPartyActivityExcel.class); + formDTO.setPageNo(++pageNo); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + + } catch (Exception e) { + log.error("export exception", e); + } finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } } - ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class); + } /** @@ -141,58 +164,49 @@ public class IcPartyActivityController { */ @PostMapping("import") public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { - if (file.isEmpty()) { - throw new RenException("请上传文件"); + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_activity", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【联建活动导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); } - String originalFilename = file.getOriginalFilename(); - // 校验文件类型 - String extension = FilenameUtils.getExtension(originalFilename); - if (!"xls".equals(extension) && !"xlsx".equals(extension)) { - throw new RenException("文件类型不匹配"); + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error("method exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); } - //1.查询当前工作人员是否有再导入的党员先锋数据,有则不允许导入,没有则进行新的导入 + // 2.生成导入任务记录 ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); - importTaskForm.setOriginFileName(file.getOriginalFilename()); importTaskForm.setOperatorId(tokenDto.getUserId()); - importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT); - Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm); - if (!result.success()) { - throw new RenException(result.getInternalMsg()); - } - - // 异步执行导入 - CompletableFuture.runAsync(() -> { - try { - Thread.sleep(1000L); - } catch (InterruptedException e) { - log.error("method exception", e); - } - submitResiImportTask(tokenDto, response, file, result.getData().getTaskId()); - }); - return new Result(); - } + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_ACTIVITY); + importTaskForm.setOriginFileName(originalFilename); - private void submitResiImportTask(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String importTaskId) { + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "联建活动导入错误", + "联建活动导入失败"); - try { - icPartyActivityService.importData(tokenDto, response, file, importTaskId); - } catch (Throwable e) { - String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); - log.error("【导入联建活动信息失败】导入失败:{}", errorMsg); - - ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); - importTaskForm.setOperatorId(tokenDto.getUserId()); - importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_ACTIVITY); - importTaskForm.setTaskId(importTaskId); - importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); - importTaskForm.setResultDesc("联建活动信息导入失败,请查看系统日志"); - Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm); - if (!result.success()) { - throw new RenException(result.getInternalMsg()); - } - } + // 3.执行导入 + icPartyActivityService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId()); + return new Result(); } /** @@ -214,4 +228,30 @@ public class IcPartyActivityController { PageData page = icPartyActivityService.getActivityList(tokenDto, formDTO); return new Result>().ok(page); } + + /** + * 下载联建活动导入模板 + * @param response + * @throws IOException + */ + @RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("联建活动导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/icpartyactivity_import_tem.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 4545cb226b..d94fcf94ce 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -1,16 +1,24 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; 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.utils.*; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; @@ -26,20 +34,25 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcPartyUnitService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; import java.nio.file.Path; -import java.util.ArrayList; +import java.util.Date; import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicInteger; +import java.util.UUID; import java.util.stream.Collectors; @@ -52,18 +65,13 @@ import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("icpartyunit") -public class IcPartyUnitController { +public class IcPartyUnitController implements ResultDataResolver { @Autowired private IcPartyUnitService icPartyUnitService; @Resource private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; - /** - * 联建单位上传临时目录 - */ - private Path IC_PARTY_UNIT_UPLOAD_DIR; - /** * 联建单位-列表查询 @@ -117,25 +125,38 @@ public class IcPartyUnitController { @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception { formDTO.setCustomerId(tokenDto.getCustomerId()); - List list = icPartyUnitService.list(formDTO); - List excelList = new ArrayList<>(); - AtomicInteger i = new AtomicInteger(1); - if (CollectionUtils.isNotEmpty(list)) { - excelList = list.stream().map(item -> { - IcPartyUnitExcel excel = new IcPartyUnitExcel(); - excel.setIndex(i.getAndIncrement()); - excel.setUnitName(item.getUnitName()); - excel.setContact(item.getContact()); - excel.setContactMobile(item.getContactMobile()); - excel.setType(item.getType()); - excel.setMemberCount(item.getMemberCount()); - excel.setRemark(item.getRemark()); - excel.setSatisfaction(item.getSatisfaction()); - excel.setServiceMatter(String.join(String.valueOf((char) 10), item.getServiceMatterList())); - return excel; - }).collect(Collectors.toList()); + formDTO.setIsPage(false); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + // 这里 需要指定写用哪个class去写 + String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); + String fileName = "联建单位".concat(today); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPartyUnitExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icPartyUnitService.search(formDTO); + data.getList().stream().map(item -> { + item.setServiceMatterName(StringUtils.join(item.getServiceMatterList(), StrConstant.COMMA_ZH)); + return item; + }).collect(Collectors.toList()); + list = ConvertUtils.sourceToTarget(data.getList(), IcPartyUnitExcel.class); + formDTO.setPageNo(++pageNo); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + + } catch (Exception e) { + log.error("export exception", e); + } finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } } - ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class); } /** @@ -172,42 +193,53 @@ public class IcPartyUnitController { */ @PostMapping("import") public Result importData(@LoginUser TokenDto tokenDto, HttpServletRequest multipartRequest, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); - if (file.isEmpty()) { - throw new RenException("请上传文件"); + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_unit", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【联建单位导入】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败"); } - String originalFilename = file.getOriginalFilename(); - // 校验文件类型 - String extension = FilenameUtils.getExtension(originalFilename); - if (!"xls".equals(extension) && !"xlsx".equals(extension)) { - throw new RenException("文件类型不匹配"); + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error("method exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); } - //1.查询当前工作人员是否有再导入的党员先锋数据,有则不允许导入,没有则进行新的导入 + // 2.生成导入任务记录 ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); - importTaskForm.setOriginFileName(file.getOriginalFilename()); importTaskForm.setOperatorId(tokenDto.getUserId()); importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT); - Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm); - if (!result.success()) { - throw new RenException(result.getInternalMsg()); - } + importTaskForm.setOriginFileName(originalFilename); - // 异步执行导入 - CompletableFuture.runAsync(() -> { - try { - Thread.sleep(1000L); - } catch (InterruptedException e) { - log.error("method exception", e); - } - submitResiImportTask(tokenDto, response, file, result.getData().getTaskId()); - }); + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "联建单位导入错误", + "联建单位导入失败"); + + // 3.执行导入 + icPartyUnitService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId()); return new Result(); } /** - * @Description 按类型统计单位数量 + * @Description 按类型统计单位数量、可视化平台-社区党建-联建单位分析-饼图展示分类下的联建单位数量 * @Param dto * @Return {@link Result< List< OptionDataResultDTO>>} * @Author zhaoqifeng @@ -216,7 +248,7 @@ public class IcPartyUnitController { @PostMapping("typestatistics") public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return new Result>().ok(icPartyUnitService.typeStatistics(formDTO)); + return new Result>().ok(icPartyUnitService.typeStatistics(formDTO.getAgencyId())); } /** @@ -233,7 +265,8 @@ public class IcPartyUnitController { } /** - * 联建单位-简要信息列表 + * 可视化平台-社区党建-联建单位分析 + * 联建单位-简要信息列表展示:单位名称、单位类型 * * @param form * @return com.epmet.commons.tools.utils.Result @@ -266,7 +299,7 @@ public class IcPartyUnitController { /** * 计算区域化党建单位的群众满意度 - * + * 服务完成后,会发mq * @param formDTO * @return */ @@ -277,29 +310,9 @@ public class IcPartyUnitController { return new Result(); } - private void submitResiImportTask(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String importTaskId) { - - try { - icPartyUnitService.importData(tokenDto, response, file, importTaskId); - } catch (Throwable e) { - String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); - log.error("【导入联建单位信息失败】导入失败:{}", errorMsg); - - ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); - importTaskForm.setOperatorId(tokenDto.getUserId()); - importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT); - importTaskForm.setTaskId(importTaskId); - importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); - importTaskForm.setResultDesc("联建单位信息导入失败,请查看系统日志"); - Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm); - if (!result.success()) { - throw new RenException(result.getInternalMsg()); - } - } - } - /** * Desc: 获取联建单位名字 + * 查询项目处理进展时调用 * @param formDTO * @author zxc * @date 2022/5/17 17:53 @@ -310,7 +323,8 @@ public class IcPartyUnitController { } /** - * Desc: 协办单位列表 + * Desc: 协办单位列表、本来是前端调用,后面需求升级,联建单位+社区自组织同步到了部门中 + * 此接口已弃用 * @param tokenDto * @author zxc * @date 2022/5/18 13:37 @@ -330,4 +344,27 @@ public class IcPartyUnitController { return new Result(); } + /** + * 下载联建单位导入模板 + * @param response + * @throws IOException + */ + @RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + //response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("联建单位导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/icpartyunit_impoort_tem.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java new file mode 100644 index 0000000000..ddfd674cfd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java @@ -0,0 +1,101 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.IcPublicServiceOrgFormDTO; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.service.IcPublicServiceOrgService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@RestController +@RequestMapping("icPublicServiceOrg") +public class IcPublicServiceOrgController { + + @Autowired + private IcPublicServiceOrgService icPublicServiceOrgService; + + /** + * + * @param tokenDto + * @param formDTO + * @return + */ + @RequestMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgPageFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + //工作端调用的话,赋值当前登录用户id + if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ + formDTO.setCurrentStaffId(tokenDto.getUserId()); + } + PageData page = icPublicServiceOrgService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail/{id}") + public Result get(@PathVariable("id") String id){ + IcPublicServiceOrgDetailResDTO data = icPublicServiceOrgService.get(id); + return new Result().ok(data); + } + + /** + * 新增;名称组织下唯一 + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCreatedBy(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.AddUserShowGroup.class, IcPublicServiceOrgFormDTO.AddUserInternalGroup.class); + icPublicServiceOrgService.save(formDTO); + return new Result(); + } + + /** + * + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcPublicServiceOrgFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCreatedBy(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.UpdateUserShowGroup.class, IcPublicServiceOrgFormDTO.UpdateUserInternalGroup.class); + icPublicServiceOrgService.update(formDTO); + return new Result(); + } + + /** + * 同时删除服务事项表 + * @param ids + * @return + */ + @PostMapping("delete") + public Result delete(@RequestBody List ids){ + if(CollectionUtils.isNotEmpty(ids)){ + icPublicServiceOrgService.delete(ids); + } + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index 7608069b76..b2b12c40e8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -87,6 +87,18 @@ public class IcServiceItemDictController { return new Result>().ok(icServiceItemDictService.queryDictListForSelect(formDTO)); } + /** + * 烟台的公共服务组织:服务事项列表 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("dict-options") + public Result> queryDictOption(@LoginUser TokenDto tokenDto, @RequestBody ServiceItemSelectFormDTO formDTO) { + return new Result>().ok(icServiceItemDictService.queryDictOption(formDTO.getType(), tokenDto.getCustomerId())); + } + /** * 客户初始化数据 * @Param customerId diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java new file mode 100644 index 0000000000..227091f5cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java @@ -0,0 +1,21 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.entity.IcPublicServiceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Mapper +public interface IcPublicServiceOrgDao extends BaseDao { + + List pageList(IcPublicServiceOrgPageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java new file mode 100644 index 0000000000..3994195445 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO; +import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 公共服务组织服务事项(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Mapper +public interface IcPublicServiceOrgServiceMatterDao extends BaseDao { + + List selectServiceMatter(String orgId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java new file mode 100644 index 0000000000..4c044abd5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java @@ -0,0 +1,76 @@ +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 2023-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_public_service_org") +public class IcPublicServiceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * AGENCY_ID的pids + */ + private String pids; + + /** + * 名称 + */ + private String name; + + /** + * 1:实有单位;2:社会服务组织3:志愿团队 + */ + private String type; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 地址 + */ + private String address; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java new file mode 100644 index 0000000000..98dd6ebc71 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java @@ -0,0 +1,44 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 公共服务组织服务事项(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_public_service_org_service_matter") +public class IcPublicServiceOrgServiceMatterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * ic_public_service_org.ID + */ + private String orgId; + + /** + * ic_service_item_dict.ID + */ + private String categoryId; + + /** + * 服务事项编码ic_service_item_dict.CATEGORY_CODE + */ + private String categoryCode; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java index 9ea9544285..4b52917350 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java @@ -17,9 +17,13 @@ package com.epmet.excel; -import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import java.util.Date; + /** * 联建活动 * @@ -28,23 +32,31 @@ import lombok.Data; */ @Data public class IcPartyActivityExcel { - - @Excel(name = "序号") - private Integer index; - - @Excel(name = "单位名称") + @ColumnWidth(20) + @ExcelProperty(value = "单位名称") private String unitName; - @Excel(name = "活动标题") + @ColumnWidth(25) + @ExcelProperty(value = "活动标题") private String title; - @Excel(name = "活动地址") + @ColumnWidth(35) + @ExcelProperty(value = "活动地址") private String address; - @Excel(name = "服务人数") + @ColumnWidth(15) + @ExcelProperty(value = "服务人数") private Integer peopleCount; - @Excel(name = "活动时间") - private String activityTime; - + @ColumnWidth(20) + @ExcelProperty(value = "活动时间") + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date activityTime; + /** + * actId不为空小程序 + * 为空管理平台 + */ + @ColumnWidth(20) + @ExcelProperty(value = "来源") + private String originName; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java index 6a2d4116ef..6998d20078 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityImportExcel.java @@ -17,9 +17,16 @@ package com.epmet.excel; -import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; /** * 联建活动 @@ -28,39 +35,57 @@ import lombok.Data; * @since v1.0.0 2021-11-19 */ @Data -public class IcPartyActivityImportExcel extends ExcelVerifyInfo { - - @Excel(name = "单位名称") - private String unitName; +public class IcPartyActivityImportExcel extends ExcelVerifyInfo { - @Excel(name = "服务事项") - private String serviceMatter; - - @Excel(name = "活动标题") + @NotBlank(message = "活动标题必填") + @Length(max = 50, message = "活动标题最多输入50字") + @ExcelProperty(value = "活动标题*") private String title; - @Excel(name = "活动目标") + @NotBlank(message = "活动目标必填") + @Length(max = 100, message = "活动目标最多输入100字") + @ExcelProperty(value = "活动目标*") private String target; - @Excel(name = "活动内容") - private String content; + @NotNull(message = "服务人数必填") + @ExcelProperty(value = "服务人数*") + private Integer peopleCount; - @Excel(name = "活动地址") + @NotNull(message = "活动时间不能为空") + @ExcelProperty("活动时间*") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date activityTime; + + @NotBlank(message = "详细地址") + @Length(max = 250, message = "详细地址最多输入250字") + @ExcelProperty(value = "详细地址*") private String address; - @Excel(name = "活动地址经度") - private String longitude; - @Excel(name = "活动地址纬度") - private String latitude; + @Data + public static class ErrorRow { + @ColumnWidth(38) + @ExcelProperty(value = "活动标题*") + private String title; - @Excel(name = "服务人数") - private Integer peopleCount; + @ColumnWidth(40) + @ExcelProperty(value = "活动目标*") + private String target; + + @ColumnWidth(10) + @ExcelProperty(value = "服务人数*") + private Integer peopleCount; - @Excel(name = "活动时间") - private String activityTime; + @ColumnWidth(25) + @ExcelProperty("活动时间*") + private Date activityTime; - @Excel(name = "活动结果") - private String result; + @ColumnWidth(40) + @ExcelProperty(value = "详细地址*") + private String address; + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java index 652542ef62..36e9484acc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java @@ -17,7 +17,8 @@ package com.epmet.excel; -import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; /** @@ -29,30 +30,42 @@ import lombok.Data; @Data public class IcPartyUnitExcel { - @Excel(name = "序号") - private Integer index; - - @Excel(name = "单位名称") + @ColumnWidth(30) + @ExcelProperty(value = "单位名称") private String unitName; - @Excel(name = "分类") - private String type; + @ColumnWidth(25) + @ExcelProperty(value = "所属组织") + private String agencyName; + + @ColumnWidth(25) + @ExcelProperty(value = "分类") + private String typeName; - @Excel(name = "服务事项") - private String serviceMatter; + /** + * 服务事项名称多个按照中文顿号隔开 + */ + @ColumnWidth(100) + @ExcelProperty(value = "服务事项") + private String serviceMatterName; - @Excel(name = "联系人") + @ColumnWidth(16) + @ExcelProperty(value = "联系人") private String contact; - @Excel(name = "联系电话") + @ColumnWidth(16) + @ExcelProperty(value = "联系电话") private String contactMobile; - @Excel(name = "在职党员") + @ColumnWidth(18) + @ExcelProperty(value = "在职党员数") private Integer memberCount; - @Excel(name = "群众满意度") + @ColumnWidth(18) + @ExcelProperty(value = "群众满意度") private String satisfaction; - @Excel(name = "备注") + @ColumnWidth(100) + @ExcelProperty(value = "备注") private String remark; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java index 13e8f27c6a..b1fd6d7dff 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportExcel.java @@ -17,9 +17,14 @@ package com.epmet.excel; -import cn.afterturn.easypoi.excel.annotation.Excel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.epmet.commons.tools.utils.ExcelVerifyInfo; import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * 联建单位 @@ -30,33 +35,73 @@ import lombok.Data; @Data public class IcPartyUnitImportExcel extends ExcelVerifyInfo { - @Excel(name = "单位名称") + @NotBlank(message = "单位名称必填") + @Length(max = 50,message = "单位名称最多输入50字") + @ExcelProperty(value = "单位名称*") private String unitName; - @Excel(name = "分类") - private String type; - - @Excel(name = "服务事项") - private String serviceMatter; + @NotBlank(message = "分类必填") + @ExcelProperty(value = "分类*") + private String typeName; - @Excel(name = "联系人") + @Length(max = 30,message = "联系人最多输入30字") + @NotBlank(message = "联系人必填") + @ExcelProperty(value = "联系人*") private String contact; - @Excel(name = "联系电话") + + @Length(max = 30,message = "联系电话最多输入30字") + @NotBlank(message = "联系电话必填") + @ExcelProperty(value = "联系电话*") private String contactMobile; - @Excel(name = "在职党员") + + @NotNull(message = "在职党员必填") + @ExcelProperty(value = "在职党员*") private Integer memberCount; - @Excel(name = "地址") + @Length(max = 500,message = "备注最多输入50字") + @ExcelProperty(value = "备注") + private String remark; + + + @Length(max = 250,message = "详细地址最多输入250字") + @NotBlank(message = "详细地址必填") + @ExcelProperty(value = "详细地址*") private String address; - @Excel(name = "中心位置经度") - private String longitude; + @Data + public static class ErrorRow { + @ColumnWidth(40) + @ExcelProperty("单位名称*") + private String unitName; - @Excel(name = "中心位置纬度") - private String latitude; + @ColumnWidth(20) + @ExcelProperty("分类*") + private String type; - @Excel(name = "备注") - private String remark; + @ColumnWidth(20) + @ExcelProperty("联系人*") + private String contact; + + @ColumnWidth(20) + @ExcelProperty("联系电话*") + private String contactMobile; + + @ColumnWidth(10) + @ExcelProperty("在职党员*") + private Integer memberCount; + + @ColumnWidth(30) + @ExcelProperty("备注") + private String remark; + + @ColumnWidth(50) + @ExcelProperty("详细地址*") + private String address; + + @ColumnWidth(50) + @ExcelProperty("错误信息") + private String errorInfo; + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java index 2cd7e44e2a..fe47433803 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitImportFailedExcel.java @@ -30,9 +30,27 @@ import lombok.Data; @Data public class IcPartyUnitImportFailedExcel extends ExcelVerifyInfo { - @Excel(name = "单位名称", width = 40) + @Excel(name = "单位名称*", width = 40) private String unitName; + @Excel(name = "分类*",width = 20) + private String type; + + @Excel(name = "联系人*",width = 20) + private String contact; + + @Excel(name = "联系电话*",width = 20) + private String contactMobile; + + @Excel(name = "在职党员*",width = 10) + private Integer memberCount; + + @Excel(name = "备注",width = 30) + private String remark; + + @Excel(name = "详细地址*",width = 50) + private String address; + @Excel(name = "错误信息", width = 50) private String errorInfo; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java new file mode 100644 index 0000000000..26e1d9d2a3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java @@ -0,0 +1,111 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.IcPartyActivityEntity; +import com.epmet.excel.IcPartyActivityImportExcel; +import com.epmet.service.impl.IcPartyActivityServiceImpl; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/2/20 15:36 + */ +@Slf4j +public class IcPartyActivityImportListener implements ReadListener { + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 200; + /** + * 当前操作用户 + */ + private CustomerStaffInfoCacheResult staffInfo; + private String customerId; + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + private IcPartyActivityServiceImpl icPartyActivityService; + + public IcPartyActivityImportListener(String customerId, CustomerStaffInfoCacheResult staffInfo, IcPartyActivityServiceImpl icPartyActivityService) { + this.customerId=customerId; + this.staffInfo = staffInfo; + this.icPartyActivityService = icPartyActivityService; + } + + + @Override + public void invoke(IcPartyActivityImportExcel data, AnalysisContext context) { + try { + // 先校验数据 + ValidatorUtils.validateEntity(data); + IcPartyActivityEntity e = ConvertUtils.sourceToTarget(data, IcPartyActivityEntity.class); + e.setCustomerId(customerId); + e.setAgencyId(staffInfo.getAgencyId()); + e.setPids(staffInfo.getAgencyPIds()); + e.setContent(StrConstant.EPMETY_STR); + datas.add(e); + + if (datas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + errorMsg = "未知错误"; + log.error("【联建活动导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + IcPartyActivityImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyActivityImportExcel.ErrorRow.class); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (datas != null && datas.size() > 0) { + icPartyActivityService.batchPersist(datas); + } + } finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java new file mode 100644 index 0000000000..eb823af8e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java @@ -0,0 +1,139 @@ +package com.epmet.excel.handler; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.entity.IcPartyUnitEntity; +import com.epmet.excel.IcPartyUnitImportExcel; +import com.epmet.service.impl.IcPartyUnitServiceImpl; +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * @Description + * @Author yzm + * @Date 2023/2/20 15:36 + */ +@Slf4j +public class IcPartyUnitExcelImportListener implements ReadListener { + /** + * 最大条数阈值 + */ + public static final int MAX_THRESHOLD = 200; + /** + * 当前操作用户 + */ + private CustomerStaffInfoCacheResult staffInfo; + private String customerId; + /** + * 数据 + */ + private List datas = new ArrayList<>(); + + /** + * 错误项列表 + */ + private List errorRows = new ArrayList<>(); + private IcPartyUnitServiceImpl icPartyUnitService; + //字典表数据 + private Map partyUnitTypeMap; + + public IcPartyUnitExcelImportListener(String customerId, CustomerStaffInfoCacheResult staffInfo, IcPartyUnitServiceImpl icPartyUnitService,Map partyUnitTypeMap) { + this.customerId=customerId; + this.staffInfo = staffInfo; + this.icPartyUnitService = icPartyUnitService; + this.partyUnitTypeMap=partyUnitTypeMap; + } + + + @Override + public void invoke(IcPartyUnitImportExcel data, AnalysisContext context) { + try { + // 先校验数据 + ValidatorUtils.validateEntity(data); + AtomicBoolean bl = new AtomicBoolean(false); + StringBuffer errMsg = new StringBuffer(""); + //先对一下字段值填写是否正确做判断 + if (!partyUnitTypeMap.containsKey(data.getTypeName())) { + errMsg.append("‘返回方式’值填写错误;"); + bl.set(true); + } + //错误数据记录到错误文件 + if (bl.get()) { + IcPartyUnitImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyUnitImportExcel.ErrorRow.class); + errorRow.setErrorInfo(errMsg.toString()); + errorRows.add(errorRow); + return; + } + // 判断名称是否已存在 + if(icPartyUnitService.checkUnitName(data.getUnitName(),staffInfo.getAgencyId(),null)){ + IcPartyUnitImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyUnitImportExcel.ErrorRow.class); + errorRow.setErrorInfo("联建单位名称已存在"); + errorRows.add(errorRow); + return; + } + + IcPartyUnitEntity e = ConvertUtils.sourceToTarget(data, IcPartyUnitEntity.class); + if (partyUnitTypeMap.containsKey(data.getTypeName())) { + e.setType(partyUnitTypeMap.get(data.getTypeName())); + } + e.setCustomerId(customerId); + e.setAgencyId(staffInfo.getAgencyId()); + e.setPids(staffInfo.getAgencyPIds()); + datas.add(e); + + if (datas.size() == MAX_THRESHOLD) { + execPersist(); + } + } catch (Exception e) { + String errorMsg = null; + if (e instanceof ValidateException) { + errorMsg = ((ValidateException) e).getMsg(); + } else { + errorMsg = "未知错误"; + log.error("【联建单位导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + IcPartyUnitImportExcel.ErrorRow errorRow = ConvertUtils.sourceToTarget(data,IcPartyUnitImportExcel.ErrorRow.class); + errorRow.setErrorInfo(errorMsg); + errorRows.add(errorRow); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + // 最后几条达不到阈值,这里必须再调用一次 + execPersist(); + } + + + /** + * 执行持久化 + */ + private void execPersist() { + try { + if (datas != null && datas.size() > 0) { + icPartyUnitService.batchPersist(datas); + } + } finally { + datas.clear(); + } + } + + /** + * 获取错误行 + * @return + */ + public List getErrorRows() { + return errorRows; + } +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java index 6fe8225b11..22c559aace 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -24,10 +24,8 @@ import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyActivityEntity; -import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; +import java.nio.file.Path; import java.util.List; /** @@ -88,17 +86,6 @@ public interface IcPartyActivityService extends BaseService { List options(IcPartyUnitDTO dto); /** - * 导入数据 - * - * @Param tokenDto - * @Param response - * @Param file - * @Return - * @Author zhaoqifeng - * @Date 2021/11/29 11:01 - */ - void importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file, String taskId) throws IOException; - - /** - * @Description 按类型统计单位数量 - * @Param formDTO + * @Description 按类型统计单位数量、可视化平台-社区党建-联建单位分析-饼图展示分类下的联建单位数量 + * @Param agencyId * @Return {@link List< OptionDataResultDTO>} * @Author zhaoqifeng * @Date 2021/12/8 14:56 */ - List typeStatistics(PartyActivityFormDTO formDTO); + List typeStatistics(String agencyId); /** * 联建单位分布 @@ -149,6 +135,7 @@ public interface IcPartyUnitService extends BaseService { /** * Desc: 获取联建单位名字 + * 查询项目处理进展时调用 * @param formDTO * @author zxc * @date 2022/5/17 17:53 @@ -165,7 +152,8 @@ public interface IcPartyUnitService extends BaseService { /** - * 联建单位-简要信息列表 + * 可视化平台-社区党建-联建单位分析 + * 联建单位-简要信息列表展示:单位名称、单位类型 * * @param form */ @@ -187,4 +175,10 @@ public interface IcPartyUnitService extends BaseService { * @return */ List getUnitNames(List unitIds); + + /** + * 执行Excel导入 + * @param filePath + */ + void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java new file mode 100644 index 0000000000..79bf76d182 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java @@ -0,0 +1,34 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.IcPublicServiceOrgFormDTO; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.entity.IcPublicServiceOrgEntity; + +import java.util.List; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +public interface IcPublicServiceOrgService extends BaseService { + + /** + * 公共服务组织 + * @param dto + * @return + */ + String save(IcPublicServiceOrgFormDTO dto); + + String update(IcPublicServiceOrgFormDTO formDTO); + + void delete(List orgIds); + + IcPublicServiceOrgDetailResDTO get(String id); + + PageData page(IcPublicServiceOrgPageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index 6ed62cbdf2..92a6dc4ef6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -81,4 +81,6 @@ public interface IcServiceItemDictService extends BaseService queryDictOption(String type, String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 388594a48b..0036e17a81 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -30,6 +30,7 @@ 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.commons.tools.utils.SpringContextUtils; import com.epmet.constant.ActConstant; import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActUserRelationDao; @@ -66,16 +67,13 @@ public class ActInfoServiceImpl extends BaseServiceImpl option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + Map option = SpringContextUtils.getBean(IcPartyUnitService.class).option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); List unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); detailResultDTO.setUnitIdList(unitIds); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 4d89c1bef8..180877f027 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -17,25 +17,20 @@ package com.epmet.service.impl; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; 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.exception.ExceptionUtils; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; 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.DateUtils; -import com.epmet.commons.tools.utils.ExcelPoiUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPartyActivityDao; import com.epmet.dto.IcPartyActivityDTO; @@ -49,7 +44,7 @@ import com.epmet.entity.IcActivityServiceRelationEntity; import com.epmet.entity.IcActivityUnitRelationEntity; import com.epmet.entity.IcPartyActivityEntity; import com.epmet.excel.IcPartyActivityImportExcel; -import com.epmet.excel.IcPartyActivityImportFailedExcel; +import com.epmet.excel.handler.IcPartyActivityImportListener; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.service.*; @@ -62,16 +57,16 @@ import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; -import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -121,15 +116,17 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); dtoList.forEach(dto -> { - //联建单位ID与单位名匹配 - List unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); - // List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); - // if(CollectionUtils.isEmpty(unitNames)){ - List unitNames=icPartyUnitService.getUnitNames(unitIds); - // } - dto.setUnitIdList(unitIds); - dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA)); - dto.setUnitNameList(unitNames); + if(StringUtils.isNotBlank(dto.getUnitId())){ + //联建单位ID与单位名匹配 + List unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); + // List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); + // if(CollectionUtils.isEmpty(unitNames)){ + List unitNames=icPartyUnitService.getUnitNames(unitIds); + // } + dto.setUnitIdList(unitIds); + dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA)); + dto.setUnitNameList(unitNames); + } if (StringUtils.isNotEmpty(dto.getGridId())) { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); if (null != gridInfo) { @@ -151,6 +148,11 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl fileList = new ArrayList<>(); - ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyActivityImportExcel.class); - List failList = importResult.getFailList(); - //存放错误数据行号 - if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { - for (IcPartyActivityImportExcel entity : failList) { - //打印失败的行 和失败的信息 - log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(entity, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo(entity.getErrorMsg()); - fileList.add(failed); - } - } - List result = importResult.getList(); - - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - //获取服务事项 - List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - //获取联建单位 - IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); - unitDTO.setAgencyId(staffInfoCache.getAgencyId()); - Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); - - //1.数据校验 - Iterator iterator = result.iterator(); - while (iterator.hasNext()) { - IcPartyActivityImportExcel obj = iterator.next(); - //单位名称校验 - if (StringUtils.isBlank(obj.getUnitName())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("单位名称为空"); - fileList.add(failed); - log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum())); - iterator.remove(); - } else { - List unitList = Arrays.asList(obj.getUnitName().split(StrConstant.COMMA)); - unitList.forEach(unit -> { - if (null == option.get(unit)) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("单位名称不存在"); - fileList.add(failed); - log.warn(String.format("单位名称不存在,行号->%s", obj.getRowNum())); - iterator.remove(); - } - }); - } - //服务事项校验 - if (StringUtils.isBlank(obj.getServiceMatter())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("服务事项为空"); - fileList.add(failed); - log.warn(String.format("服务事项为空,行号->%s", obj.getRowNum())); - iterator.remove(); - } else { - List serviceList = Arrays.asList(obj.getServiceMatter().split(StrConstant.SEMICOLON)); - serviceList.forEach(service -> { - if (null == categoryMap.get(service)) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("服务事项不存在"); - fileList.add(failed); - log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum())); - iterator.remove(); - } - }); - - } - //活动标题 活动目标 活动内容 活动时间 活动地址 活动地址经度 活动地址纬度 活动结果 - if (StringUtils.isBlank(obj.getTitle())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动标题为空"); - fileList.add(failed); - log.warn(String.format("活动标题为空,行号->%s", obj.getRowNum())); - iterator.remove(); - } else if (StringUtils.isBlank(obj.getTarget())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动目标为空"); - fileList.add(failed); - log.warn(String.format("活动目标为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getContent())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动内容为空"); - fileList.add(failed); - log.warn(String.format("活动内容为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getActivityTime())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动时间为空"); - fileList.add(failed); - log.warn(String.format("活动时间为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getAddress())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动地址为空"); - fileList.add(failed); - log.warn(String.format("活动地址为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getLatitude())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动地址纬度为空"); - fileList.add(failed); - log.warn(String.format("活动地址纬度为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getLongitude())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动地址经度为空"); - fileList.add(failed); - log.warn(String.format("活动地址经度为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getResult())) { - IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); - failed.setErrorInfo("活动结果为空"); - fileList.add(failed); - log.warn(String.format("活动结果为空,行号->%s", obj.getRowNum())); - } - } - if (CollectionUtils.isNotEmpty(result)) { - result.forEach(item -> { - IcPartyActivityEntity entity = new IcPartyActivityEntity(); - entity.setCustomerId(tokenDto.getCustomerId()); - entity.setAgencyId(staffInfoCache.getAgencyId()); - entity.setPids(staffInfoCache.getAgencyPIds()); - entity.setTitle(item.getTitle()); - entity.setTarget(item.getTarget()); - entity.setContent(item.getContent()); - entity.setPeopleCount(item.getPeopleCount()); - entity.setActivityTime(DateUtils.parse(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN)); - entity.setAddress(item.getAddress()); - entity.setLatitude(item.getLatitude()); - entity.setLongitude(item.getLongitude()); - entity.setResult(item.getResult()); - insert(entity); - - //保存活动与单位关系 - icActivityUnitRelationService.deleteByActivity(entity.getId()); - AtomicInteger i = new AtomicInteger(NumConstant.ONE); - List unitRelationList = Arrays.stream(item.getUnitName().split(StrConstant.COMMA)).map(unit -> { - IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity(); - relation.setCustomerId(entity.getCustomerId()); - relation.setAgencyId(entity.getAgencyId()); - relation.setPids(entity.getPids()); - relation.setActivityId(entity.getId()); - relation.setUnitId(option.get(unit)); - relation.setSort(i.getAndIncrement()); - return relation; - }).collect(Collectors.toList()); - icActivityUnitRelationService.insertBatch(unitRelationList); - - //保存活动与服务关系 - icActivityServiceRelationService.deleteByActivity(entity.getId()); - AtomicInteger j = new AtomicInteger(NumConstant.ONE); - List serviceRelationList = Arrays.stream(item.getServiceMatter().split(StrConstant.SEMICOLON)).map(service -> { - IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity(); - relation.setCustomerId(entity.getCustomerId()); - relation.setAgencyId(entity.getAgencyId()); - relation.setPids(entity.getPids()); - relation.setActivityId(entity.getId()); - relation.setServiceMatter(categoryMap.get(service)); - relation.setSort(j.getAndIncrement()); - return relation; - }).collect(Collectors.toList()); - icActivityServiceRelationService.insertBatch(serviceRelationList); - }); - } - String str = String.format("共%s条,成功导入%s条。", fileList.size() + result.size(), fileList.size() + result.size() - fileList.size()); - - if (fileList.size() > NumConstant.ZERO) { - List numList = fileList.stream().map(IcPartyActivityImportFailedExcel::getRowNum).sorted().collect(Collectors.toList()); - String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); - log.warn(str + "第" + subList + "行未成功!"); - } - - //错误数据生成文件,修改导入任务状态 - erroeImport(fileList, taskId, tokenDto.getUserId()); - } - - private void erroeImport(List fileList, String importTaskId, String staffId) throws IOException { - String url = ""; - //1.有错误数据则生成错误数据存放文件传到阿里云服务 - if (CollectionUtils.isNotEmpty(fileList)) { - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表", "导入失败的数据列表"), - IcPartyActivityImportFailedExcel.class, fileList); - // 文件名 - String resultDescFileName = UUID.randomUUID().toString().concat(".xlsx"); - FileItemFactory factory = new DiskFileItemFactory(16, null); - FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName); - OutputStream os = fileItem.getOutputStream(); - Result uploadResult = null; - try { - workbook.write(os); - uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); - } catch (Exception e) { - String errormsg = ExceptionUtils.getErrorStackTrace(e); - log.error("【联建活动信息导入】上传错误描述文件:{}", errormsg); - } finally { - try { - os.close(); - } catch (IOException e) { - String errormsg = ExceptionUtils.getErrorStackTrace(e); - log.error("【联建活动信息导入】上传错误描述文件关闭输出流:{}", errormsg); - } - try { - fileItem.delete(); - } catch (Exception e) { - String errormsg = ExceptionUtils.getErrorStackTrace(e); - log.error("【联建活动信息导入】上传错误描述文件删除临时文件:{}", errormsg); - } - } - - if (uploadResult == null || !uploadResult.success()) { - log.error("【联建活动信息导入】调用OSS上传结果描述文件失败"); - } else { - url = uploadResult.getData().getUrl(); - } - } - //2.更新导入任务数据 - ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); - importTaskForm.setOperatorId(staffId); - importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_ACTIVITY); - importTaskForm.setTaskId(importTaskId); - importTaskForm.setResultDescFilePath(url); - importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); - if (CollectionUtils.isNotEmpty(fileList)) { - importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); - importTaskForm.setResultDesc("联建活动导入存在错误数据"); - } - Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm); - if (!result.success()) { - throw new RenException(result.getInternalMsg()); - } - } - /** * 联建活动统计 * @@ -651,4 +411,102 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl errorRows = listener.getErrorRows(); + + boolean failed = errorRows.size() > 0; + if (failed) { + // 生成并上传错误文件 + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_activity", "import", "error_des"); + String fileName = UUID.randomUUID().toString().concat(".xlsx"); + errorDescFile = errorDescDir.resolve(fileName); + + FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); + OutputStream os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcPartyActivityImportExcel.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows); + + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + if (Files.exists(errorDescFile)) { + Files.delete(errorDescFile); + } + } + } + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc(""); + importFinishTaskForm.setResultDescFilePath(errorDesFileUrl); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【联建活动导入】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【联建活动导入】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc("导入失败"); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【联建活动导入】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + log.error("method exception", e); + } + } + } + } + + /** + * 批量持久化 + * @param entities + */ + public void batchPersist(List entities) { + entities.forEach(e -> { + String id = IdWorker.getIdStr(e); + e.setId(id); + baseDao.insert(e); + }); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 0f31a1287d..d0d8c5d541 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -17,12 +17,11 @@ package com.epmet.service.impl; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO; import com.epmet.commons.tools.constant.FieldConstant; @@ -33,11 +32,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.DictListResultDTO; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.enums.DictTypeEnum; -import com.epmet.commons.tools.enums.PartyUnitTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; @@ -45,8 +42,9 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.UserDemandConstant; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPartyUnitDao; @@ -59,7 +57,7 @@ import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import com.epmet.entity.IcPartyUnitEntity; import com.epmet.excel.IcPartyUnitImportExcel; -import com.epmet.excel.IcPartyUnitImportFailedExcel; +import com.epmet.excel.handler.IcPartyUnitExcelImportListener; import com.epmet.feign.*; import com.epmet.service.IcCommunitySelfOrganizationService; import com.epmet.service.IcPartyUnitService; @@ -75,18 +73,18 @@ import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; -import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; import java.math.BigDecimal; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; @@ -102,16 +100,16 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 - Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); + Map pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { + item.setTypeName(unitTypeMap.getData().get(item.getType())); + //这是错误的,应该是赋值type,遗留bug, 先不改了.... item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); @@ -181,8 +181,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 - Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); + Map pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { + item.setTypeName(unitTypeMap.getData().get(item.getType())); + //这是错误的,应该是赋值type,遗留bug, 先不改了.... item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); @@ -210,13 +212,15 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); + Map pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id)); // 分类名称 //获取分类名称字典 Result> typeDictMapRes=epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); Map typeDictMap = typeDictMapRes.success() && MapUtils.isNotEmpty(typeDictMapRes.getData()) ? typeDictMapRes.getData() : new HashMap<>(); + dto.setTypeName(MapUtils.isNotEmpty(typeDictMap) && typeDictMap.containsKey(dto.getType()) ? typeDictMap.get(dto.getType()) : StrConstant.EPMETY_STR); + //这是错误的,应该是赋值type,遗留bug, 先不改了.... dto.setType(MapUtils.isNotEmpty(typeDictMap) && typeDictMap.containsKey(dto.getType()) ? typeDictMap.get(dto.getType()) : StrConstant.EPMETY_STR); // 服务事项 if(CollectionUtils.isNotEmpty(dto.getServiceMatterList())){ @@ -268,7 +272,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + if (SpringContextUtils.getBean(IcUserDemandRecService.class).selectCountByServerId(id) > NumConstant.ZERO) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); } //校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【联建单位被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】 @@ -375,223 +379,15 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl fileList = new ArrayList<>(); - - ExcelImportResult importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcPartyUnitImportExcel.class); - List failList = importResult.getFailList(); - //存放错误数据行号 - if (!org.springframework.util.CollectionUtils.isEmpty(failList)) { - for (IcPartyUnitImportExcel entity : failList) { - //打印失败的行 和失败的信息 - log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(entity, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo(entity.getErrorMsg()); - fileList.add(failed); - } - } - List result = importResult.getList(); - - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - if (null == staffInfoCache) { - throw new EpmetException(8000, "获取用户缓存失败"); - } - List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - //1.数据校验 - Iterator iterator = result.iterator(); - while (iterator.hasNext()) { - IcPartyUnitImportExcel obj = iterator.next(); - //单位名称不能为空,不可重复 - if (StringUtils.isBlank(obj.getUnitName())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("单位名称为空"); - fileList.add(failed); - log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum())); - iterator.remove(); - } else { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(IcPartyUnitEntity::getAgencyId, staffInfoCache.getAgencyId()); - wrapper.eq(IcPartyUnitEntity::getUnitName, obj.getUnitName()); - List list = baseDao.selectList(wrapper); - if (CollectionUtils.isNotEmpty(list)) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("单位名称已存在"); - fileList.add(failed); - log.warn(String.format("单位名称已存在,行号->%s", obj.getRowNum())); - iterator.remove(); - } - } - //分类校验 - if (StringUtils.isBlank(obj.getType()) || null == PartyUnitTypeEnum.getCode(obj.getType())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("分类名不存在"); - fileList.add(failed); - log.warn(String.format("分类名不存在,行号->%s", obj.getRowNum())); - iterator.remove(); - } - //服务事项校验 - if (StringUtils.isNotBlank(obj.getServiceMatter())) { - List matters = Arrays.asList(obj.getServiceMatter().split(StrConstant.COLON)); - matters.forEach(item -> { - if (null == categoryMap.get(item)) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("服务事项不存在"); - fileList.add(failed); - log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum())); - iterator.remove(); - } - }); - } - //联系人 联系电话 在职党员 地址 中心位置经度 中心位置纬度 校验 - if (StringUtils.isBlank(obj.getContact())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("联系人为空"); - fileList.add(failed); - log.warn(String.format("联系人为空,行号->%s", obj.getRowNum())); - iterator.remove(); - } else if (StringUtils.isBlank(obj.getContactMobile())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("联系电话为空"); - fileList.add(failed); - log.warn(String.format("联系电话为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getAddress())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("地址为空"); - fileList.add(failed); - log.warn(String.format("地址为空,行号->%s", obj.getRowNum())); - } else if (null == obj.getMemberCount()) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("在职党员为空"); - fileList.add(failed); - log.warn(String.format("在职党员为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getLatitude())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("中心位置纬度为空"); - fileList.add(failed); - log.warn(String.format("中心位置纬度为空,行号->%s", obj.getRowNum())); - } else if (StringUtils.isBlank(obj.getLongitude())) { - IcPartyUnitImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyUnitImportFailedExcel.class); - failed.setErrorInfo("中心位置经度为空"); - fileList.add(failed); - log.warn(String.format("中心位置经度为空,行号->%s", obj.getRowNum())); - } - - } - if (CollectionUtils.isNotEmpty(result)) { - List list = result.stream().map(item -> { - IcPartyUnitEntity entity = new IcPartyUnitEntity(); - entity.setCustomerId(tokenDto.getCustomerId()); - entity.setAgencyId(staffInfoCache.getAgencyId()); - entity.setPids(staffInfoCache.getAgencyPIds()); - entity.setUnitName(item.getUnitName()); - entity.setType(PartyUnitTypeEnum.getCode(item.getType())); - if (StringUtils.isNotBlank(item.getServiceMatter())) { - entity.setServiceMatter(getServiceMatter(categoryMap, item.getServiceMatter())); - } - entity.setContact(item.getContact()); - entity.setContactMobile(item.getContactMobile()); - entity.setAddress(item.getAddress()); - entity.setLatitude(item.getLatitude()); - entity.setLongitude(item.getLongitude()); - entity.setMemberCount(item.getMemberCount()); - entity.setRemark(item.getRemark()); - return entity; - }).collect(Collectors.toList()); - - insertBatch(list); - } - - String str = String.format("共%s条,成功导入%s条。", fileList.size() + result.size(), fileList.size() + result.size() - fileList.size()); - if (fileList.size() > NumConstant.ZERO) { - List numList = fileList.stream().map(IcPartyUnitImportFailedExcel::getRowNum).sorted().collect(Collectors.toList()); - String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、")); - log.warn(str + "第" + subList + "行未成功!"); - } - - //错误数据生成文件,修改导入任务状态 - erroeImport(fileList, taskId, tokenDto.getUserId()); - } - - private void erroeImport(List fileList, String importTaskId, String staffId) throws IOException { - String url = ""; - //1.有错误数据则生成错误数据存放文件传到阿里云服务 - if (CollectionUtils.isNotEmpty(fileList)) { - Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表", "导入失败的数据列表"), - IcPartyUnitImportFailedExcel.class, fileList); - // 文件名 - String resultDescFileName = UUID.randomUUID().toString().concat(".xlsx"); - FileItemFactory factory = new DiskFileItemFactory(16, null); - FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName); - OutputStream os = fileItem.getOutputStream(); - Result uploadResult = null; - try { - workbook.write(os); - uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); - } catch (Exception e) { - String errormsg = ExceptionUtils.getErrorStackTrace(e); - log.error("【联建单位信息导入】上传错误描述文件:{}", errormsg); - } finally { - try { - os.close(); - } catch (IOException e) { - String errormsg = ExceptionUtils.getErrorStackTrace(e); - log.error("【联建单位信息导入】上传错误描述文件关闭输出流:{}", errormsg); - } - try { - fileItem.delete(); - } catch (Exception e) { - String errormsg = ExceptionUtils.getErrorStackTrace(e); - log.error("【联建单位信息导入】上传错误描述文件删除临时文件:{}", errormsg); - } - } - - if (uploadResult == null || !uploadResult.success()) { - log.error("【联建单位信息导入】调用OSS上传结果描述文件失败"); - } else { - url = uploadResult.getData().getUrl(); - } - } - //2.更新导入任务数据 - ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); - importTaskForm.setOperatorId(staffId); - importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_PARTY_UNIT); - importTaskForm.setTaskId(importTaskId); - importTaskForm.setResultDescFilePath(url); - importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); - if (CollectionUtils.isNotEmpty(fileList)) { - importTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); - importTaskForm.setResultDesc("联建单位导入存在错误数据"); - } - Result result = commonServiceOpenFeignClient.finishImportTask(importTaskForm); - if (!result.success()) { - throw new RenException(result.getInternalMsg()); - } - } - - /** - * @param formDTO - * @Description 按类型统计单位数量 + * @param agencyId + * @Description 按类型统计单位数量、可视化平台-社区党建-联建单位分析-饼图展示分类下的联建单位数量 * @Param formDTO * @Return {@link List} * @Author zhaoqifeng * @Date 2021/12/8 14:56 */ @Override - public List typeStatistics(PartyActivityFormDTO formDTO) { + public List typeStatistics(String agencyId) { DictListFormDTO dictFromDTO = new DictListFormDTO(); dictFromDTO.setDictType(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFromDTO); @@ -599,7 +395,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.getTypeStatistics(formDTO.getAgencyId()); + List list = baseDao.getTypeStatistics(agencyId); Map map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); return dictResult.getData().stream().map(item -> { @@ -643,7 +439,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); + List list = SpringContextUtils.getBean(IcUserDemandRecService.class).groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); for (ServiceStatDTO serviceStatDTO : list) { if (0 != serviceStatDTO.getDemandCount()) { BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); @@ -662,6 +458,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); @@ -792,4 +595,134 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl> partyUnitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Map tMap = partyUnitTypeMap.getData().entrySet().stream().collect(Collectors.toMap(entry -> entry.getValue(), entry -> entry.getKey())); + + IcPartyUnitExcelImportListener listener = new IcPartyUnitExcelImportListener(customerId,staffInfo, this,tMap); + + EasyExcel.read(filePath.toFile(), IcPartyUnitImportExcel.class, listener).headRowNumber(1).sheet(0).doRead(); + + Path errorDescFile = null; + String errorDesFileUrl = null; + List errorRows = listener.getErrorRows(); + + boolean failed = errorRows.size() > 0; + if (failed) { + // 生成并上传错误文件 + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_party_unit", "import", "error_des"); + String fileName = UUID.randomUUID().toString().concat(".xlsx"); + errorDescFile = errorDescDir.resolve(fileName); + + FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); + OutputStream os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcPartyUnitImportExcel.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows); + + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + if (Files.exists(errorDescFile)) { + Files.delete(errorDescFile); + } + } + } + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc(""); + importFinishTaskForm.setResultDescFilePath(errorDesFileUrl); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【联建单位导入】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【联建单位导入】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc("导入失败"); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【联建单位导入】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + log.error("method exception", e); + } + } + } + } + + public CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + return staffInfo; + } + + /** + * 批量持久化 + * @param entities + */ + public void batchPersist(List entities) { + entities.forEach(e -> { + String id = IdWorker.getIdStr(e); + e.setId(id); + baseDao.insert(e); + }); + } + + /** + * + * @param unitName + * @param agencyId + * @param id + * @return true 已存在 + * false 不存在 + */ + public Boolean checkUnitName(String unitName,String agencyId,String id){ + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, agencyId) + .eq(IcPartyUnitEntity::getUnitName, unitName) + .ne(StringUtils.isNotBlank(id),IcPartyUnitEntity::getId,id); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(list)) { + return true; + } + return false; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java new file mode 100644 index 0000000000..7dd3dbc851 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java @@ -0,0 +1,171 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +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.utils.ConvertUtils; +import com.epmet.dao.IcPublicServiceOrgDao; +import com.epmet.dao.IcPublicServiceOrgServiceMatterDao; +import com.epmet.dto.form.IcPublicServiceOrgFormDTO; +import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO; +import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO; +import com.epmet.entity.IcPublicServiceOrgEntity; +import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity; +import com.epmet.service.IcPublicServiceOrgService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +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.List; +import java.util.stream.Collectors; + +/** + * 公共服务组织管理(烟台需求) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Service +public class IcPublicServiceOrgServiceImpl extends BaseServiceImpl implements IcPublicServiceOrgService { + @Autowired + private IcPublicServiceOrgServiceMatterDao icPublicServiceOrgServiceMatterDao; + + + @Transactional(rollbackFor = EpmetException.class) + @Override + public String save(IcPublicServiceOrgFormDTO formDto) { + CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(formDto.getCustomerId(),formDto.getCreatedBy()); + if(null==staffInfo|| StringUtils.isBlank(staffInfo.getAgencyId())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode()); + } + checkUnqiueName(formDto.getName(),staffInfo.getAgencyId(),null); + formDto.setAgencyId(staffInfo.getAgencyId()); + formDto.setPids(staffInfo.getAgencyPIds()); + IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDto,IcPublicServiceOrgEntity.class); + baseDao.insert(entity); + if(CollectionUtils.isNotEmpty(formDto.getServiceMatterList())){ + formDto.getServiceMatterList().forEach(dto->{ + IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class); + serviceOrgServiceMatterEntity.setOrgId(entity.getId()); + serviceOrgServiceMatterEntity.setCustomerId(formDto.getCustomerId()); + icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity); + }); + } + return entity.getId(); + } + + /** + * + * @param name + * @param agencyId + * @param id + */ + private void checkUnqiueName(String name, String agencyId, String id) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPublicServiceOrgEntity::getName,name) + .eq(IcPublicServiceOrgEntity::getAgencyId,agencyId) + .ne(StringUtils.isNotBlank(id),IcPublicServiceOrgEntity::getId,id); + int count=baseDao.selectCount(queryWrapper); + if(count>0){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"名称已存在","名称已存在"); + } + } + + @Transactional(rollbackFor = EpmetException.class) + @Override + public String update(IcPublicServiceOrgFormDTO formDTO) { + checkUnqiueName(formDTO.getName(),formDTO.getAgencyId(),formDTO.getId()); + IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDTO,IcPublicServiceOrgEntity.class); + baseDao.updateById(entity); + //先删除 + LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper<>(); + deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,formDTO.getId()); + icPublicServiceOrgServiceMatterDao.delete(deleteWrapper); + if(CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())){ + formDTO.getServiceMatterList().forEach(dto->{ + IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class); + serviceOrgServiceMatterEntity.setOrgId(entity.getId()); + serviceOrgServiceMatterEntity.setCustomerId(formDTO.getCustomerId()); + icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity); + }); + } + return entity.getId(); + } + + @Transactional(rollbackFor = EpmetException.class) + @Override + public void delete(List orgIds) { + orgIds.forEach(orgId->{ + baseDao.deleteById(orgId); + //先删除 + LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper<>(); + deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,orgId); + icPublicServiceOrgServiceMatterDao.delete(deleteWrapper); + }); + } + + + @Override + public IcPublicServiceOrgDetailResDTO get(String id) { + IcPublicServiceOrgEntity entity = baseDao.selectById(id); + if (null == entity) { + return null; + } + IcPublicServiceOrgDetailResDTO result = ConvertUtils.sourceToTarget(entity, IcPublicServiceOrgDetailResDTO.class); + // 1:实有单位;2:社会服务组织3:志愿团队 + if(NumConstant.ONE_STR.equals(result.getType())){ + result.setTypeName("实有单位"); + }else if(NumConstant.TWO_STR.equals(result.getType())){ + result.setTypeName("社会服务组织"); + }else if(NumConstant.THREE_STR.equals(result.getType())){ + result.setTypeName("志愿团队"); + } + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(result.getAgencyId()); + if (null != agencyInfoCache) { + result.setAgencyName(agencyInfoCache.getOrganizationName()); + } + result.setServiceMatterList(icPublicServiceOrgServiceMatterDao.selectServiceMatter(id)); + List nameList=result.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(nameList)){ + result.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray())); + } + return result; + } + + + + @Override + public PageData page(IcPublicServiceOrgPageFormDTO formDTO) { + if (StringUtils.isNotBlank(formDTO.getCurrentStaffId()) && StringUtils.isBlank(formDTO.getAgencyId())) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.pageList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + list.forEach(item -> { + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(item.getAgencyId()); + item.setAgencyName(null != agencyInfoCache ? agencyInfoCache.getOrganizationName() : StrConstant.EPMETY_STR); + List nameList=item.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(nameList)){ + item.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray())); + } + }); + return new PageData<>(list, pageInfo.getTotal()); + } + + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index a34bb83907..1e7b7f0271 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -205,4 +205,26 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl queryDictOption(String type, String customerId) { + List resultList = new ArrayList<>(); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcServiceItemDictEntity::getCustomerId, customerId) + .eq(StringUtils.isNotBlank(type) && "usable".equals(type), IcServiceItemDictEntity::getUsableFlag, true) + .orderByAsc(IcServiceItemDictEntity::getSort); + List list = baseDao.selectList(query); + for (IcServiceItemDictEntity entity : list) { + ServiceItemResultDTO dto = new ServiceItemResultDTO(); + dto.setCategoryName(entity.getCategoryName()); + dto.setCategoryId(entity.getId()); + dto.setCategoryCode(entity.getCategoryCode()); + dto.setUsableFlag(entity.getUsableFlag()); + dto.setAwardPoint(entity.getAwardPoint()); + resultList.add(dto); + } + return resultList; + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 8535dddcb8..6a8f969d88 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -497,7 +497,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(serverId)); if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询爱心互助志愿者信息异常","志愿者信息查询异常"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询爱心互助志愿者信息异常","志愿者信息查询异常"); } serviceName=userInfoRes.getData().get(NumConstant.ZERO).getRealName(); mobile = userInfoRes.getData().get(NumConstant.ZERO).getMobile(); @@ -506,7 +506,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl icUserInfoRes = epmetUserOpenFeignClient.getIcResiUserDTO(serverId); if (!icUserInfoRes.success() || null==icUserInfoRes.getData()) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询居民信息志愿者信息异常","查询居民信息志愿者信息异常"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询居民信息志愿者信息异常","查询居民信息志愿者信息异常"); } serviceName=icUserInfoRes.getData().getName(); mobile = icUserInfoRes.getData().getMobile(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql new file mode 100644 index 0000000000..25ce6a5fc2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql @@ -0,0 +1,38 @@ +CREATE TABLE `ic_public_service_org` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PIDS` varchar(255) NOT NULL COMMENT 'AGENCY_ID的pids', + `NAME` varchar(128) NOT NULL COMMENT '名称', + `TYPE` varchar(64) NOT NULL COMMENT '1:实有单位;2:社会服务组织3:志愿团队', + `CONTACT` varchar(32) NOT NULL COMMENT '联系人', + `CONTACT_MOBILE` varchar(32) NOT NULL COMMENT '联系电话', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置经度', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置纬度', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织管理(烟台需求)'; + + + +CREATE TABLE `ic_public_service_org_service_matter` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `ORG_ID` varchar(64) NOT NULL COMMENT 'ic_public_service_org.ID', + `CATEGORY_ID` varchar(64) NOT NULL COMMENT 'ic_service_item_dict.ID', + `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '服务事项编码ic_service_item_dict.CATEGORY_CODE', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织服务事项(烟台需求)'; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.30__icpartyunit.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.30__icpartyunit.sql new file mode 100644 index 0000000000..1256f76295 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.30__icpartyunit.sql @@ -0,0 +1 @@ +alter table ic_party_unit MODIFY COLUMN `TYPE` varchar(32) NULL COMMENT '分类 【字典表】:02.20因烟台导入需求改为不必填'; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml new file mode 100644 index 0000000000..a877134331 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml new file mode 100644 index 0000000000..9603aab514 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx new file mode 100644 index 0000000000..143cdaa637 Binary files /dev/null and b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyactivity_import_tem.xlsx differ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyunit_impoort_tem.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyunit_impoort_tem.xlsx new file mode 100644 index 0000000000..713aed6eb4 Binary files /dev/null and b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/icpartyunit_impoort_tem.xlsx differ diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 0d7124cff7..53336db181 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -312,7 +312,7 @@ - 192.168.10.165:9876 + 192.168.10.161:9876 epmet_message diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/enums/OssTypeEnum.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/enums/OssTypeEnum.java index 6bb92ad38b..565500d199 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/enums/OssTypeEnum.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/enums/OssTypeEnum.java @@ -38,7 +38,11 @@ public enum OssTypeEnum { /** * minio */ - MINIO(6); + MINIO(6), + /** + * 浪潮oss + */ + INSPUR(7); private int value; diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index d4bc4152b6..ea22b95498 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -96,6 +96,10 @@ minio 8.4.2 + + com.inspurcloud + oss + diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java index 6b44c47d66..bfa8799ef7 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java @@ -104,6 +104,9 @@ public class CloudStorageConfig implements Serializable { private AliyunCloudStorageConfig aliyun; private MinioStorageConfig minio; + private InspurOssConfigProps inspur; + + /** * 阿里云存储配置 */ @@ -170,4 +173,22 @@ public class CloudStorageConfig implements Serializable { private String minioPrefix; private String minioBucketName; } + + /** + * 浪潮政务云oss存储 + */ + @Data + public static class InspurOssConfigProps { + /** + * https://oss.cn-north-3.inspurcloudoss.com + */ + private String domain; + /** + * oss.cn-north-3.inspurcloudoss.com + */ + private String endPoint; + private String accessKey; + private String secretKey; + private String bucketName; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/InspurStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/InspurStorageService.java new file mode 100644 index 0000000000..ad55f177fd --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/InspurStorageService.java @@ -0,0 +1,89 @@ +package com.epmet.cloud; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.inspurcloud.oss.client.impl.OSSClientImpl; +import com.inspurcloud.oss.model.CannedAccessControlList; +import lombok.extern.slf4j.Slf4j; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * 浪潮云oss文件操作 + */ +@Slf4j +public class InspurStorageService extends AbstractCloudStorageService { + + private CloudStorageConfig.InspurOssConfigProps inspurProps; + + private OSSClientImpl ossClient; + + public InspurStorageService(CloudStorageConfig config) { + inspurProps = config.getInspur(); + log.info("浪潮OSS参数:endPoint:{}, accessKey:{}, secretKey:{}", inspurProps.getEndPoint(), inspurProps.getAccessKey(), inspurProps.getSecretKey()); + ossClient = new OSSClientImpl(inspurProps.getEndPoint(), inspurProps.getAccessKey(), inspurProps.getSecretKey()); + + // 设置公共读权限 + CannedAccessControlList currentAcl = ossClient.getBucketAcl(inspurProps.getBucketName()); + if (CannedAccessControlList.PublicRead != currentAcl) { + log.info("set inspur oss acl:::::public read"); + ossClient.setBucketAcl(inspurProps.getBucketName(), CannedAccessControlList.PublicRead); + } + } + + @Override + public String getOssDomain(String privacy) { + return inspurProps.getDomain(); + } + + @Override + public String getOssPrefix(String privacy) { + return null; + } + + @Override + public String upload(byte[] data, String path, String privacyType) { + return upload(new ByteArrayInputStream(data), path, privacyType); + } + + @Override + public String uploadSuffix(byte[] data, String suffix, String privacyType) { + return uploadSuffix(new ByteArrayInputStream(data), suffix, privacyType); + } + + @Override + public String upload(InputStream inputStream, String path, String privacyType) { + try { + //log.info("上传参数:bucket:{}, path:{}", inspurProps.getBucketName(), path); + ossClient.putObject(inspurProps.getBucketName(), path, inputStream); + + // /oss统一前缀,是为了nginx做代理,识别用的。因为烟台的oss域名,需要dns,这个dns只能在服务器内网配置,政务外配置了不能用,所以需要一层代理 + // "http://172.20.46.177" + "/oss" + "/oss-202212261434580001" + String url = inspurProps.getDomain() + "/oss" + "/" + path; + //log.info("文件访问路径:" + url); + return url; + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + log.error("浪潮云oss文件上传:{}", errorStackTrace); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), errorStackTrace); + } + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix, String privacyType) { + return upload(inputStream, getPath(getOssPrefix(null), suffix, privacyType), privacyType); + } + + @Override + public void down(String privacyType) throws IOException { + + } + + @Override + public boolean delete(String objectName, String privacyType) { + return false; + } +} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java index a9113d5fba..59bdf3b7a6 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java @@ -8,6 +8,7 @@ package com.epmet.cloud; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.enums.OssTypeEnum; import com.epmet.remote.ParamsRemoteService; @@ -42,6 +43,8 @@ public final class OssFactory { abstractCloudStorageService = new LocalCloudStorageService(config); }else if(config.getType() == OssTypeEnum.MINIO.value()){ abstractCloudStorageService = new MinioStorageService(config); + }else if (config.getType() == OssTypeEnum.INSPUR.value()) { + abstractCloudStorageService = new InspurStorageService(config); } } return abstractCloudStorageService; diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java index 50fa2fb21b..041d419ce2 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/TestController.java @@ -35,9 +35,9 @@ public class TestController { } @PostMapping("upload2aliyun") - public Result upload2aliyun(@RequestParam("fileName") String fileName) { - try (final FileInputStream fis = new FileInputStream("/opt/upload_files/" + fileName)) { - final MockMultipartFile mockMultipartFile = new MockMultipartFile(fileName, fis); + public Result upload2aliyun() { + try (final FileInputStream fis = new FileInputStream("C:\\Users\\wxz\\Documents\\微信截图_20230101224521.png")) { + final MockMultipartFile mockMultipartFile = new MockMultipartFile("1.png", fis); return ossService.uploadImg(mockMultipartFile, null); } catch (FileNotFoundException e) { log.error("method exception", e); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index 18ebc7ea24..fa4190e991 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -20,11 +20,13 @@ spring: date-format: yyyy-MM-dd HH:mm:ss redis: # 烟台使用cluster模式下使用cluster:配置段 - # database: @spring.redis.index@ - # host: @spring.redis.host@ - # port: @spring.redis.port@ - # password: @spring.redis.password@ - # timeout: 30s + cluster-enabled: true + +# database: @spring.redis.index@ +# host: @spring.redis.host@ +# port: @spring.redis.port@ +# password: @spring.redis.password@ +# timeout: 30s database: @spring.redis.index@ password: @spring.redis.password@ diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 096798dec7..f9e1eb6d09 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -276,7 +276,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.20__dinginfo.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.20__dinginfo.sql new file mode 100644 index 0000000000..b4a81c44a5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.20__dinginfo.sql @@ -0,0 +1,6 @@ +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1015', '2337180550', '', '5000000004594353', '完善信息', 'dingsel3r29wgzk5qqmb', 'OIhUY-q3eHlSRG820Am2fvvjjygfI_meX22oMyTTZBoAGvYdDJzdixLkhlQpSYSi', '', NULL, 0, 0, '烟台企业内部应用', '2023-01-03 10:00:00', '烟台企业内部应用', '2023-01-03 10:00:00'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1016', '2337327052', '', '5000000004594531', '徽章管理', 'dingxti95xydoqbgrulx', 'HqVtJ4_bbQxJJfuEyF9Yv_0pZBR-3ej-BCS2oZTQIq3etjm9_G4U1IlZlfADp-1Q', '', NULL, 0, 0, '烟台企业内部应用', '2023-01-03 10:00:00', '烟台企业内部应用', '2023-01-03 10:00:00'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1017', '2337375052', '', '5000000004595206', '使用意见反馈', 'ding79wl8vk4pweex53k', 'cOYdU0DEKykjuF0mkT39gP1z1xmf776QqOGF0y5PjgQe6b4aWviEL0PmzXh1gyvn', '', '', 0, 0, '烟台企业内部应用', '2023-01-03 10:00:00', '烟台企业内部应用', '2023-01-03 10:00:00'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1018', '2337252559', '', '5000000004595145', '我的家庭', 'dingrgjosxaitua4aikj', 'Z3MGW5I1s2JOXawx23Gw1jK9CRjyYPukIpYwz1-jGFoU4VbsIcIb-o-D4n7X3Wnh', '', '', 0, 0, '烟台企业内部应用', '2023-01-03 10:00:00', '烟台企业内部应用', '2023-01-03 10:00:00'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1019', '2357864966', '', '5000000004605189', '楼院小组', 'dinghuk7t6posgu8enes', 'P48CJKz6esuDlujvhwWivWPxTb9r3C5Um0v9kgvrlEFt9xW1nUnLFB0_FdWd5MTa', '', '', 0, 0, '烟台企业内部应用', '2023-01-03 10:00:00', '烟台企业内部应用', '2023-01-03 10:00:00'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1020', '2357990563', '', '5000000004605052', '消息通知', 'dingkymf8dcqqlagjrv7', 'n_tFdaMUbEjQlAccXOkNS_75rep_mCh3lQn7IfSXTr2rnPD-6qEU2Kh23XUixna5', '', '', 0, 0, '烟台企业内部应用', '2023-01-03 10:00:00', '烟台企业内部应用', '2023-01-03 10:00:00'); diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java new file mode 100644 index 0000000000..782e21231f --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java @@ -0,0 +1,112 @@ +package com.epmet.dto; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class ThirdAppManageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 应用名称 + */ + @NotBlank(message = "应用名称不能为空") + private String name; + + /** + * 应用链接 + */ + @NotBlank(message = "应用链接不能为空") + private String link; + + /** + * 账号 + */ + @NotBlank(message = "测试账号不能为空") + private String account; + + /** + * 密码 + */ + @NotBlank(message = "测试密码不能为空") + private String password; + + /** + * 应用介绍 + */ + private String remark; + + /** + * 第三方公司名 + */ + private String companyName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空") + private String contacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空") + private String mobile; + + /** + * 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 + */ + private String status; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0:未删除 1:删除 + */ + private Integer delFlag; + + /** + * 创建者 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新者 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java new file mode 100644 index 0000000000..6b9398b62e --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Data +public class ThirdAppManageFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + + /** + * 应用名称 + */ + private String name; + + /** + * 第三方公司名 + */ + private String companyName; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 + */ + private String status; +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java new file mode 100644 index 0000000000..2c5b143236 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java @@ -0,0 +1,83 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +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.ThirdAppManageDTO; +import com.epmet.dto.form.ThirdAppManageFormDTO; +import com.epmet.service.ThirdAppManageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@RestController +@RequestMapping("thirdAppManage") +public class ThirdAppManageController { + + @Autowired + private ThirdAppManageService thirdAppManageService; + + @PostMapping("page") + public Result> page(@RequestBody ThirdAppManageFormDTO formDTO){ + PageData page = thirdAppManageService.page(formDTO); + return new Result>().ok(page); + } + + @PostMapping("detail/{id}") + public Result get(@PathVariable("id") String id){ + ThirdAppManageDTO data = thirdAppManageService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody ThirdAppManageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + thirdAppManageService.save(dto); + return new Result(); + } + + /** + * 审核 + * + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/2/3 14:18 + */ + @NoRepeatSubmit + @PostMapping("audit") + public Result audit(@RequestBody ThirdAppManageDTO dto){ + //效验数据 + thirdAppManageService.audit(dto); + return new Result(); + } + + /** + * 发布 + * + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/2/3 14:18 + */ + @NoRepeatSubmit + @PostMapping("release") + public Result release(@RequestBody ThirdAppManageDTO dto){ + //效验数据 + thirdAppManageService.release(dto); + return new Result(); + } + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java new file mode 100644 index 0000000000..e930e21767 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ThirdAppManageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Mapper +public interface ThirdAppManageDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java new file mode 100644 index 0000000000..a44b474fc4 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java @@ -0,0 +1,71 @@ +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 2023-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("third_app_manage") +public class ThirdAppManageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 应用名称 + */ + private String name; + + /** + * 应用链接 + */ + private String link; + + /** + * 账号 + */ + private String account; + + /** + * 密码 + */ + private String password; + + /** + * 应用介绍 + */ + private String remark; + + /** + * 第三方公司名 + */ + private String companyName; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】 + */ + private String status; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java new file mode 100644 index 0000000000..fbc7216cb8 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java @@ -0,0 +1,66 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ThirdAppManageDTO; +import com.epmet.dto.form.ThirdAppManageFormDTO; +import com.epmet.entity.ThirdAppManageEntity; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +public interface ThirdAppManageService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-02-03 + */ + PageData page(ThirdAppManageFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return ThirdAppManageDTO + * @author generator + * @date 2023-02-03 + */ + ThirdAppManageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-02-03 + */ + void save(ThirdAppManageDTO dto); + + /** + * 审核 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + void audit(ThirdAppManageDTO dto); + + /** + * 发布 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + void release(ThirdAppManageDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java new file mode 100644 index 0000000000..db9affc717 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java @@ -0,0 +1,112 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.ThirdAppManageDao; +import com.epmet.dto.ThirdAppManageDTO; +import com.epmet.dto.form.ThirdAppManageFormDTO; +import com.epmet.entity.ThirdAppManageEntity; +import com.epmet.service.ThirdAppManageService; +import com.github.pagehelper.PageInfo; +import com.github.pagehelper.page.PageMethod; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 烟台第三方应用管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-03 + */ +@Service +public class ThirdAppManageServiceImpl extends BaseServiceImpl implements ThirdAppManageService { + + @Override + public PageData page(ThirdAppManageFormDTO formDTO) { + PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(formDTO.getName()), ThirdAppManageEntity::getName, formDTO.getName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getCompanyName()), ThirdAppManageEntity::getCompanyName, formDTO.getCompanyName()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContacts()), ThirdAppManageEntity::getContacts, formDTO.getContacts()); + wrapper.like(StringUtils.isNotBlank(formDTO.getMobile()), ThirdAppManageEntity::getMobile, formDTO.getMobile()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getStatus()), ThirdAppManageEntity::getStatus, formDTO.getStatus()); + wrapper.orderByDesc(ThirdAppManageEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(ConvertUtils.sourceToTarget(list, ThirdAppManageDTO.class), pageInfo.getTotal()); + } + + @Override + public ThirdAppManageDTO get(String id) { + ThirdAppManageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ThirdAppManageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ThirdAppManageDTO dto) { + ThirdAppManageEntity entity = ConvertUtils.sourceToTarget(dto, ThirdAppManageEntity.class); + insert(entity); + } + + /** + * 审核 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + @Override + public void audit(ThirdAppManageDTO dto) { + ThirdAppManageEntity info = baseDao.selectById(dto.getId()); + if (!NumConstant.ZERO_STR.equals(info.getStatus())) { + String errorMsg = "应用已审核"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + ThirdAppManageEntity entity = new ThirdAppManageEntity(); + entity.setId(dto.getId()); + entity.setStatus(dto.getStatus()); + baseDao.updateById(entity); + } + + /** + * 发布 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2023/2/3 14:19 + */ + @Override + public void release(ThirdAppManageDTO dto) { + ThirdAppManageEntity info = baseDao.selectById(dto.getId()); + if (NumConstant.ZERO_STR.equals(info.getStatus())) { + String errorMsg = "应用未审核,请先审核"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } else if (NumConstant.ONE_STR.equals(info.getStatus())) { + String errorMsg = "应用审核不通过,不能发布"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } else if (NumConstant.THREE_STR.equals(info.getStatus())) { + String errorMsg = "应用已发布"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + ThirdAppManageEntity entity = new ThirdAppManageEntity(); + entity.setId(dto.getId()); + entity.setStatus(NumConstant.THREE_STR); + baseDao.updateById(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql new file mode 100644 index 0000000000..563fcf3815 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql @@ -0,0 +1,20 @@ +CREATE TABLE `third_app_manage` ( + `ID` varchar(64) NOT NULL COMMENT 'id', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `NAME` varchar(64) NOT NULL COMMENT '应用名称', + `LINK` varchar(128) NOT NULL COMMENT '应用链接', + `ACCOUNT` varchar(64) NOT NULL COMMENT '账号', + `PASSWORD` varchar(64) NOT NULL COMMENT '密码', + `REMARK` text COMMENT '应用介绍', + `COMPANY_NAME` varchar(64) DEFAULT '0' COMMENT '第三方公司名', + `CONTACTS` varchar(64) NOT NULL COMMENT '联系人', + `MOBILE` varchar(32) NOT NULL COMMENT '联系电话', + `STATUS` varchar(1) DEFAULT '0' COMMENT '状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` tinyint(1) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台第三方应用管理'; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml new file mode 100644 index 0000000000..afbc2b77fa --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java new file mode 100644 index 0000000000..45b27c1eba --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java @@ -0,0 +1,100 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Data +public class IssueCommentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 议题ID + */ + @NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class) + private String issueId; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 评论内容至多200字 + */ + @Length(max = 200,message = "评论内容最多输入200字",groups = AddUserShowGroup.class) + @NotBlank(message = "content不能为空",groups = AddUserInternalGroup.class) + private String content; + + /** + * 评论用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String commentId; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java new file mode 100644 index 0000000000..90e7fa79a8 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2023/2/2 13:45 + */ +@Data +public class IssueCommentPageFormDTO extends PageFormDTO { + @NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class) + private String issueId; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java index 84b0d8f5e6..11532b097f 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,8 +14,9 @@ import java.io.Serializable; @Data public class IssueDetailFormDTO implements Serializable { private static final long serialVersionUID = 4859779755214503489L; - - @NotBlank(message = "议题id不能为空") + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "议题id不能为空",groups =AddUserShowGroup.class ) private String issueId; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java index 872eb43772..b41592a829 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java @@ -122,4 +122,19 @@ public class IssueShiftedFromTopicFormDTO implements Serializable { private String groupId; private String issueId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; } diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index cb600edfe4..f26a6595bb 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -292,7 +292,7 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd true - 192.168.10.165:9876 + 192.168.10.161:9876 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java new file mode 100644 index 0000000000..f579c9d1fe --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java @@ -0,0 +1,61 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.dto.form.IssueCommentPageFormDTO; +import com.epmet.service.IssueCommentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 议题评论表 + * 目前只有烟台客户,钉钉居民端,议事厅,可以发表评论 + * 产品没有此功能 + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@RestController +@RequestMapping("issuecomment") +public class IssueCommentController { + + @Autowired + private IssueCommentService issueCommentService; + + /** + * 议题评论列表 + * @param formDTO + * @return + */ + @RequestMapping("page") + public Result> page(@RequestBody IssueCommentPageFormDTO formDTO){ + PageData page = issueCommentService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 议题评论 + * @param tokenDto + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IssueCommentDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(dto,IssueCommentDTO.AddUserShowGroup.class,IssueCommentDTO.AddUserInternalGroup.class); + issueCommentService.save(dto); + return new Result(); + } + + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index efb1ede9f1..1f642c9790 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -43,6 +43,7 @@ public class IssueController { */ @PostMapping(value = "detail") public Result detail(@RequestBody IssueDetailFormDTO issueDetail){ + ValidatorUtils.validateEntity(issueDetail,IssueDetailFormDTO.AddUserShowGroup.class); return new Result().ok(issueService.detail(issueDetail)); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java new file mode 100644 index 0000000000..beaca75c6a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java @@ -0,0 +1,20 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.entity.IssueCommentEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Mapper +public interface IssueCommentDao extends BaseDao { + + List selectCommentList(String issueId); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java new file mode 100644 index 0000000000..4ad01c7038 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java @@ -0,0 +1,54 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_comment") +public class IssueCommentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 评论内容至多200字 + */ + private String content; + + /** + * 评论用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 头像 + */ + private String headPhoto; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java new file mode 100644 index 0000000000..3fa35a8077 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java @@ -0,0 +1,37 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.dto.form.IssueCommentPageFormDTO; +import com.epmet.entity.IssueCommentEntity; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +public interface IssueCommentService extends BaseService { + + /** + * 默认分页 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-02-02 + */ + PageData page(IssueCommentPageFormDTO formDTO); + + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-02-02 + */ + void save(IssueCommentDTO dto); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java new file mode 100644 index 0000000000..61df62df96 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java @@ -0,0 +1,75 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IssueCommentDao; +import com.epmet.dto.IssueCommentDTO; +import com.epmet.dto.form.IssueCommentPageFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.entity.IssueCommentEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.IssueCommentService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 议题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Slf4j +@Service +public class IssueCommentServiceImpl extends BaseServiceImpl implements IssueCommentService { + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + + /** + * 议题评论列表 + * @param formDTO + * @return + */ + @Override + public PageData page(IssueCommentPageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.selectCommentList(formDTO.getIssueId()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 议题评论 + * 需求来源于烟台:https://modao.cc/app/Uz9nPVerhvcupzLnhoiY#screen=sl8mfpxd863xmb5 + * @param dto + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueCommentDTO dto) { + //查询用户信息 + List userIdList=new ArrayList<>(); + userIdList.add(dto.getUserId()); + Result> userInfoRes= userOpenFeignClient.queryUserBaseInfo(userIdList); + if(!userInfoRes.success()|| CollectionUtils.isEmpty(userInfoRes.getData())){ + log.error("议题评论查询用户信息异常userId: "+dto.getUserId()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询用户信息异常userId:"+dto.getUserId(),"查询用户信息异常"); + } + IssueCommentEntity entity = ConvertUtils.sourceToTarget(dto, IssueCommentEntity.class); + entity.setHeadPhoto(userInfoRes.getData().get(NumConstant.ZERO).getHeadImgUrl()); + entity.setUserName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); + insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index b576a0f1ca..ac11b644fc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -510,23 +510,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public String audit(TokenDto token, IssueAuditionFormDTO param){ - - if (StringUtils.isNotBlank(param.getReason())) { - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - taskDTO.setContent(param.getReason()); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); - } - } - } - + scanReason(param.getReason()); Date unifiedDate = new Date(); IssueApplicationDTO application = applicationService.get(param.getIssueApplicationId()); @@ -613,6 +597,24 @@ public class IssueServiceImpl extends BaseServiceImpl imp return app2update.getIssueId(); } + private void scanReason(String reason) { + if (StringUtils.isNotBlank(reason)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(reason); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + /** * @Description 表决中列表 * @param issueListForm diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql new file mode 100644 index 0000000000..3897a5369d --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql @@ -0,0 +1,16 @@ +CREATE TABLE `issue_comment` ( + `ID` varchar(32) NOT NULL COMMENT '主键ID', + `ISSUE_ID` varchar(32) NOT NULL COMMENT '议题ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `CONTENT` varchar(255) NOT NULL COMMENT '评论内容至多200字', + `USER_ID` varchar(64) NOT NULL COMMENT '评论用户id', + `USER_NAME` varchar(64) DEFAULT NULL COMMENT '姓名', + `HEAD_PHOTO` varchar(255) DEFAULT NULL COMMENT '头像', + `DEL_FLAG` varchar(2) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='议题评论表'; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml new file mode 100644 index 0000000000..fc7676ed60 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 77e9db60da..5f7be12f1b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -115,6 +115,15 @@ suggestion, + + ADDRESS, + + + LONGITUDE, + + + LATITUDE, + customer_id, @@ -186,6 +195,15 @@ #{suggestion}, + + #{address}, + + + #{longitude}, + + + #{latitude}, + #{customerId}, diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java index 195336b46e..5aa877ecaf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/BuildingTreeLevelDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -57,4 +58,8 @@ public class BuildingTreeLevelDTO implements Serializable { private String showNum; private String showName; + //agency、grid + @JsonIgnore + private String orgType; + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java index 3554df553f..a276e36387 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java @@ -43,6 +43,10 @@ public class IcPropertyManagementDTO implements Serializable { * 物业名称 */ private String name; + /** + * 客户id + */ + private String customerId; /** * 删除标识 0未删除、1已删除 @@ -73,5 +77,8 @@ public class IcPropertyManagementDTO implements Serializable { * 更新时间 */ private Date updatedTime; - + /** + * 关联的小区数量 + */ + private Integer totalNeighborHood; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java index 0cbb5c1ab5..63bf3c6e55 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java @@ -118,4 +118,10 @@ public class AddAgencyV2FormDTO implements Serializable { * 中心点位位置 */ private String centerAddress; + + /** + * 社区简介 + */ + @Length(max = 500,message ="最多输入500字",groups =DefaultUserShowGroup.class ) + private String remark; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index 57e535ad25..2d0da966d0 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -110,4 +110,7 @@ public class EditAgencyFormDTO implements Serializable { private String centerAddress; private String customerId; + + @Length(max = 500,message = "最多输入500字",groups =DefaultUserShowGroup.class ) + private String remark; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseManageTreeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseManageTreeFormDTO.java new file mode 100644 index 0000000000..f8a659eafd --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseManageTreeFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 烟台,房屋信息界面,左侧树查询入参 + * @Author yzm + * @Date 2023/1/6 13:39 + */ +@Data +public class HouseManageTreeFormDTO implements Serializable { + public interface InitTreeGroup { + } + + // public interface AddUserShowGroup extends CustomerClientShowGroup {} + public interface NodeEventGroup { + } + + + /** + * 组织id、网格id、小区id、楼栋id + */ + @NotBlank(message = "id不能为空", groups = NodeEventGroup.class) + private String id; + /** + * 省级:province + * 市级: city + * 区县级: district, + * 乡(镇、街道)级:street, + * 社区级:community, + * 网格:grid + * 小区:neighborHood + * 楼栋:building + */ + @NotBlank(message = "level不能为空", groups = NodeEventGroup.class) + private String level; + + + // ------------------------------------ + /** + * tokenDto.customerId + */ + @NotBlank(message = "customerId不能为空", groups = {InitTreeGroup.class,NodeEventGroup.class}) + private String customerId; + /** + * tokenDto.userId + */ + @NotBlank(message = "staffId不能为空", groups = {InitTreeGroup.class,NodeEventGroup.class}) + private String staffId; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java index e2022b1420..fc24ee9fae 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseListFormDTO.java @@ -115,4 +115,14 @@ public class IcHouseListFormDTO extends PageFormDTO { * 楼栋ID */ private String unitId; + + + //对应界面上的所属组织 + /** + * 组织:agency + * 网格:grid + * 与orgId一起使用 + */ + private String orgType; + private String orgId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java index 63ea329d22..bbc2cd7152 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java @@ -22,6 +22,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -39,6 +40,8 @@ public class IcPropertyManagementFormDTO implements Serializable { public interface UpdateShowGroup extends CustomerClientShowGroup { } + public interface PageGroup extends CustomerClientShowGroup { + } @NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class}) private String id; @@ -49,5 +52,11 @@ public class IcPropertyManagementFormDTO implements Serializable { @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class}) private String name; + private String customerId; + + @NotNull(message = "pageNo不能为空", groups = PageGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空", groups = PageGroup.class) + private Integer pageSize; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 99028d23bb..f95c6349a4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -133,4 +133,8 @@ public class AgencysResultDTO implements Serializable { * 中心点位位置 */ private String centerAddress; + + private String remark; + + private String coordinates; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java index 22d4951210..ab9256c1b2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java @@ -96,4 +96,6 @@ public class GridDetailResultDTO implements Serializable { */ private Integer gridSort = 0; + private String coordinates; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index cc90ddbc2f..9818f7f832 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -460,6 +460,12 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/grid/getbaseinfo") Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); + /** + * @V23 + * @param houseIds + * @param customerId + * @return 根据房屋id查询房屋表,并且放到了缓存里 + */ @PostMapping(value = "/gov/org/house/queryListHouseInfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId); @@ -486,6 +492,7 @@ public interface GovOrgOpenFeignClient { Result> getBranchOption(@RequestBody CustomerPartyBranchDTO formDTO); /** + * @V23 * @Description 获取小区内的楼栋 * @Param dto * @Return {@link Result>} @@ -496,6 +503,7 @@ public interface GovOrgOpenFeignClient { Result> getBuildingOptions(IcBuildingDTO dto); /** + * @V23 * @Description 获取楼栋内单元 * @Param dto * @Return {@link Result>} @@ -505,10 +513,16 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/icbuildingunit/unitoption") Result> getUnitOptions(IcBuildingUnitDTO dto); + /** + * @V23 + * @param formDTO + * @return 根据楼栋id、单元id获取房屋列表 + */ @PostMapping("/gov/org/ichouse/houseoption") Result> getHouseOption(@RequestBody HouseFormDTO formDTO); /** + * @V23 * @Description 获取网格下小区列表 * @Param dto * @Return {@link Result< List< OptionResultDTO>>} @@ -519,23 +533,47 @@ public interface GovOrgOpenFeignClient { Result> getNeighborHoodOptions(IcNeighborHoodDTO dto); /** - * @param idCard + * @V23 + * @param idCard 对应ic_house.OWNER_ID_CARD 房主身份证号 * @Description 查询房屋信息 * @author zxc * @date 2021/11/3 3:30 下午 + * @return 返回该小区名+楼栋名+单元名+房屋名 */ @PostMapping("/gov/org/ichouse/selecthouseinfobyidcard") Result> selectHouseInfoByIdCard(@RequestParam("idCard") String idCard, @RequestParam("customerId") String customerId); + /** + * @V23 + * @param id + * @Description 根据房屋id查询,查询房屋信息;这个接口需要重构吧,怎么还查询两次。 + */ @GetMapping("/gov/org/ichouse/{id}") Result get(@PathVariable("id") String id); + /** + * @V23 + * @param buildingIdList + * @return 根据楼栋id,查询楼栋信息 + */ @PostMapping("/gov/org/building/buildinglistbyids") Result> buildingListByIds(@RequestBody List buildingIdList); + /** + * @V23 + * @param buildingIdList + * @param pageNo + * @param pageSize + * @return 分页查询楼栋信息 + */ @PostMapping("/gov/org/building/buildinglistbyidsPage/{pageNo}/{pageSize}") Result buildinglistbyidsPage(@RequestBody List buildingIdList, @PathVariable("pageNo") Integer pageNo, @PathVariable("pageSize") Integer pageSize); + /** + * @V23 + * @param ids + * @Description 根据小区id查询小区信息 + */ @PostMapping("/gov/org/icneighborhood/getlistbyids") Result> getListByIds(@RequestBody List ids); @@ -555,7 +593,7 @@ public interface GovOrgOpenFeignClient { /** * 根据ID查询楼栋信息 - * + * @V23 * @param id * @return */ @@ -564,7 +602,7 @@ public interface GovOrgOpenFeignClient { /** * 通过ID查询小区信息 - * + * @V23 * @param id * @return */ @@ -587,6 +625,7 @@ public interface GovOrgOpenFeignClient { @RequestParam("orgType") String orgType); /** + * @V23 * @Author sun * @Description 查询组织、网格、小区、楼栋、单元、房屋信息 **/ @@ -595,7 +634,7 @@ public interface GovOrgOpenFeignClient { /** * 查询单元 - * + * @V23 * @param id * @return */ @@ -614,7 +653,7 @@ public interface GovOrgOpenFeignClient { /** * Desc: 根据身份证查询房屋名 - * + * @V23 * @param idCards * @author zxc * @date 2022/4/12 16:42 @@ -624,7 +663,7 @@ public interface GovOrgOpenFeignClient { /** * Desc: 房屋更新 - * + * @V23 * @param formDTO * @author zxc * @date 2022/5/11 09:46 @@ -643,7 +682,7 @@ public interface GovOrgOpenFeignClient { /** * 根据houseId查询数据 - * + * @V23 * @param houseId * @return com.epmet.commons.tools.utils.Result * @author LZN @@ -661,7 +700,7 @@ public interface GovOrgOpenFeignClient { /** * 根据房屋编码查询房屋信息 - * + * @V23 * @param houseCode * @return com.epmet.commons.tools.utils.Result * @author work@yujt.net.cn @@ -677,6 +716,7 @@ public interface GovOrgOpenFeignClient { * @author wangtong * @date 2022/6/10 13:27 * @params [dto] + * @V23 */ @PostMapping("/gov/org/house/getHomeInfoByHouseCode") Result getHomeInfoByHouseCode(CommonHouseFormDTO dto); @@ -685,6 +725,7 @@ public interface GovOrgOpenFeignClient { * desc:根据房屋id更新 屋内的居民数量 * @param paramList * @return + * @V23 */ @PostMapping("/gov/org/ichouse/updateIcHouseResiNumber") Result updateIcHouseResiNumber(List> paramList); @@ -706,6 +747,7 @@ public interface GovOrgOpenFeignClient { * @Return {@link Result< List>} * @Author zhaoqifeng * @Date 2022/7/20 9:52 + * @V23 */ @PostMapping("/gov/org/ichouse/getOwnerHouseList") Result> getOwnerHouseList(@RequestBody IcHouseDTO formDTO); diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 86bf1a5ebb..36dee53ef8 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -347,7 +347,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 epmet_message diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java index 9185571640..971015a298 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -109,12 +109,50 @@ public class BuildingController { return new Result(); } + /** + * 房屋信息左侧树 + * 此接口返回的树是完整的,针对烟台市这个客户,改为逐级展开,烟台调用下面的接口: + * @param tokenDTO + * @return + */ @PostMapping("treelist") - public Result treeList(@LoginUser TokenDto tokenDTO){ + public Result> treeList(@LoginUser TokenDto tokenDTO){ List buildingTreeLevelDTOS =buildingService.treeList(tokenDTO.getCustomerId(), tokenDTO.getUserId()); return new Result().ok(buildingTreeLevelDTOS); } + /** + * 房屋信息左侧树 + * 逐级展开,用户点击树节点去查询 目前只有烟台客户房屋信息调用 + * @param tokenDTO + * @return + */ + @PostMapping("treeinit") + public Result treeInit(@LoginUser TokenDto tokenDTO){ + HouseManageTreeFormDTO formDTO=new HouseManageTreeFormDTO(); + formDTO.setCustomerId(tokenDTO.getCustomerId()); + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO,HouseManageTreeFormDTO.InitTreeGroup.class); + BuildingTreeLevelDTO buildingTreeLevelDTOS =buildingService.treeInit(formDTO); + return new Result().ok(buildingTreeLevelDTOS); + } + + /** + * 房屋信息左侧树 + * 点击树上节点,查询下一级列表 + * @param tokenDTO + * @param formDTO + * @return + */ + @PostMapping("next-tree-node") + public Result> nextTreeNode(@LoginUser TokenDto tokenDTO,@RequestBody HouseManageTreeFormDTO formDTO){ + formDTO.setCustomerId(tokenDTO.getCustomerId()); + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO,HouseManageTreeFormDTO.NodeEventGroup.class); + List resultList =buildingService.nextTreeNode(formDTO); + return new Result>().ok(resultList); + } + /** * Desc: 根据前端方便,新开接口,只返回树的ID * @param tokenDTO diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 878200dc01..0e5c5ffccb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -43,7 +43,7 @@ public class GridController { * @return */ @PostMapping("griddetail") - public Result gridDetail(@LoginUser TokenDto tokenDto,@RequestBody CustomerGridFormDTO customerGridFormDTO){ + public Result gridDetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){ Result griddetail = customerGridService.griddetail(customerGridFormDTO); return griddetail; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 6282777484..53738a3d4c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -169,6 +169,14 @@ public class HouseController implements ResultDataResolver { return new Result>().ok(houseService.getHouseList(formDTO)); } + /** + * 房屋管理-新增房屋 + * + * @param tokenDTO + * @param formDTO + * @return + * @throws Exception + */ @NoRepeatSubmit @PostMapping("houseadd") public Result houseAdd(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseAddFormDTO formDTO) throws Exception { @@ -293,6 +301,12 @@ public class HouseController implements ResultDataResolver { epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); } + /** + * 根据房屋id查询房屋表,并且放到了缓存里 + * @param houseIds + * @param customerId + * @return + */ @PostMapping("queryListHouseInfo") Result> queryListHouseInfo(@RequestBody Set houseIds, @RequestParam("customerId") String customerId) { return new Result>().ok(houseService.queryListHouseInfo(houseIds, customerId)); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index 21cddd9951..0de2518bcd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -254,6 +254,7 @@ public class HouseInformationController { /** * @describe: 【双实录入】获取小区编码 + * 生成小区编码 * @author wangtong * @date 2022/6/29 9:59 * @params [tokenDTO, gridId] diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index e7b5ac7e56..c2420c0832 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -26,9 +26,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; -import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.HouseFormDTO; -import com.epmet.dto.result.*; +import com.epmet.dto.result.HouseAgencyInfoResultDTO; +import com.epmet.dto.result.HouseInfoDTO; +import com.epmet.dto.result.HouseListResultDTO; +import com.epmet.dto.result.HousesNameResultDTO; import com.epmet.service.IcHouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -57,6 +59,11 @@ public class IcHouseController { return new Result().ok(data); } + /** + * 根据楼栋id、单元id获取房屋列表 + * @param formDTO + * @return + */ @PostMapping("houseoption") public Result> getHouseOption(@RequestBody HouseFormDTO formDTO) { return new Result>().ok(icHouseService.getHouseOption(formDTO)); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java index d318f9116b..9302784464 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -77,6 +77,12 @@ public class NeighborHoodController { } + /** + * 房屋管理-新增小区 + * @param tokenDTO + * @param formDTO + * @return + */ @NoRepeatSubmit @PostMapping("neighborhoodadd") public Result neighborhoodadd(@LoginUser TokenDto tokenDTO, @RequestBody IcNeighborHoodAddFormDTO formDTO){ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java index 6a38dd3e39..ba24389143 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java @@ -18,12 +18,13 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; -import com.epmet.service.IcPropertyManagementService; import com.epmet.service.PropertyManagementService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -45,33 +46,46 @@ import java.util.Map; @RestController @RequestMapping("propertymanagement") public class PropertyManagementController { - - @Autowired - private IcPropertyManagementService icPropertyManagementService; @Autowired private PropertyManagementService propertyManagementService; + /** + * 分页查询物业列表 + */ + @PostMapping("page") + public Result> page(@RequestBody IcPropertyManagementFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,IcPropertyManagementFormDTO.PageGroup.class); + return new Result>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName())); + } - + /** + * 新增小区时,下拉框调用此接口 + * @return + */ @PostMapping("list") public Result> list(){ return new Result>().ok(propertyManagementService.getList()); } - + /** + * 新增物业 + * 新增小区页面,添加小区也调用此接口 + * @param tokenDTO + * @param formDTO + * @return + */ @PostMapping("add") public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 + formDTO.setCustomerId(tokenDTO.getCustomerId()); ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class); Map map=new HashMap<>(); map.put("propertyId",propertyManagementService.add(formDTO)); return new Result().ok(map); } - - @PostMapping("update") - public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class); propertyManagementService.update(formDTO); @@ -79,7 +93,7 @@ public class PropertyManagementController { } @PostMapping("delete") - public Result delete(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){ + public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class); propertyManagementService.delete(formDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index e2fbd3162a..7e98f598f8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.GridInfoVaccinePrarmeterFormDTO; import com.epmet.dto.form.OrgInfoPointFormDTO; @@ -401,6 +402,25 @@ public interface CustomerAgencyDao extends BaseDao { List getCurrentUserCommunityInfo(@Param("customerId") String customerId,@Param("staffAgencyId")String staffAgencyId); + /** + * + * @param agencyId + * @return 组织信息,用于房屋信息左侧树 + */ + BuildingTreeLevelDTO selectAgencyTree(String agencyId); + /** + * + * @param agencyId + * @return 获取当前agencyId的下一级组织+直属网格 + */ + List selectNextOrg(String agencyId); + + /** + * 查询当前agencyId下 组织数+网格数 + * @param agencyId + * @return + */ + Integer selectTotalNext(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index 46f0041e8d..4b10e94bf1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -51,7 +51,9 @@ public interface IcBuildingDao extends BaseDao { List searchAllBuilding( @Param("building")IcBuildingEntity building, @Param("house")IcHouseEntity house); - List selectAgencyChildrenList(@Param("agencyId") String agencyId); + List selectAgencyChildrenList(@Param("customerId")String customerId, + @Param("pidsKey") String pidsKey, + @Param("pid")String pid); List> selectListByName(@Param("customerId") String customerId, @Param("neighborNameList")ArrayList strings, diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java index 52a038ab3b..915b2f6d7d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java @@ -34,7 +34,7 @@ import java.util.List; @Mapper public interface IcPropertyManagementDao extends BaseDao { - IcPropertyManagementEntity selectByName(String name); + IcPropertyManagementEntity selectByName(String customerId,String name,String id); /** * @Description 根据物业名查询已存在的物业名 @@ -58,4 +58,6 @@ public interface IcPropertyManagementDao extends BaseDao selectPropertyNameList(String neighborhoodId); + + List queryList(@Param("customerId") String customerId,@Param("name")String name); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index fda8070609..a2668ae5fd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java @@ -143,4 +143,10 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { * 联系电话 */ private String mobile; + + /** + * 备注 + */ + private String remark; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java index ff8b648d6a..239fce61cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java @@ -39,5 +39,5 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity { * 物业名称 */ private String name; - + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java index 441995271b..27e1c4c1ee 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/BuildingService.java @@ -20,10 +20,7 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.BuildingTreeLevelDTO; -import com.epmet.dto.form.IcBuildingListFormDTO; -import com.epmet.dto.form.IcBulidingAddFormDTO; -import com.epmet.dto.form.IcHouseListFormDTO; -import com.epmet.dto.form.ImportInfoFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.BuildingResultPagedDTO; import com.epmet.dto.result.IcBuildingListResultDTO; @@ -57,7 +54,29 @@ public interface BuildingService { void addBuilding(String customerId, IcBulidingAddFormDTO formDTO); + /** + * 房屋信息左侧树 + * @param customerId + * @param staffId + * @return + */ List treeList(String customerId, String staffId); + + /** + * 房屋信息左侧树 + * @param houseManageTreeFormDTO + * @return 逐级展开,用户点击树节点去查询 + */ + BuildingTreeLevelDTO treeInit(HouseManageTreeFormDTO houseManageTreeFormDTO); + + /** + * 房屋信息左侧树 + * 点击树上节点,查询下一级列表 + * @param houseManageTreeFormDTO + * @return + */ + List nextTreeNode(HouseManageTreeFormDTO houseManageTreeFormDTO); + List treeIds(String customerId, String staffId); PageData listBuilding(IcBuildingListFormDTO formDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index d1d1b87503..1161a1ee9f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -38,7 +38,12 @@ import java.util.Set; */ public interface HouseService { - + /** + * 房屋管理-新增房屋 + * + * @param customerId + * @param formDTO + */ void addHouse(String customerId, IcHouseAddFormDTO formDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java index b091fc4e32..72524f19ff 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/NeighborHoodService.java @@ -33,7 +33,12 @@ import javax.servlet.http.HttpServletResponse; * @since v1.0.0 2021-10-25 */ public interface NeighborHoodService{ - + /** + * 房屋管理-新增小区 + * + * @param customerId + * @param formDTO + */ void addNeighborhood(String customerId, IcNeighborHoodAddFormDTO formDTO); PageData listNeighborhood(IcNeighborHoodListFormDTO formDTO); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java index 7bbbad3616..f3f77cde27 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java @@ -17,6 +17,8 @@ package com.epmet.service; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; @@ -36,4 +38,6 @@ public interface PropertyManagementService { void update(IcPropertyManagementFormDTO formDTO); void delete(IcPropertyManagementFormDTO formDTO); + + PageData page(Integer pageNo, Integer pageSize, String name); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 6833141ad4..04d8dfb98b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -166,6 +166,7 @@ public class AgencyServiceImpl implements AgencyService { originalEntity.setCode(formDTO.getCode()); originalEntity.setContacts(formDTO.getContacts()); originalEntity.setMobile(formDTO.getMobile()); + originalEntity.setRemark(formDTO.getRemark()); //利用mybatis 拦截器填充值 originalEntity.setUpdatedTime(null); originalEntity.setUpdatedBy(null); @@ -1149,8 +1150,9 @@ public class AgencyServiceImpl implements AgencyService { AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); agencyOrgIdPath = getOrgIdPath(agencyInfo.getPids(), agencyInfo.getId()); List currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null); - List preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime); - return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size()); + // List preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime); + // return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size()); + return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), 0); } else if ("grid".equals(orgType)) { // 网格下不会有该数据,给个0 return new UsingCommunityStatsResultDTO(0, 0); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 36dde00dfe..5f16fb2c62 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -53,10 +53,7 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; @@ -181,7 +178,7 @@ public class BuildingServiceImpl implements BuildingService { // agency.setAgencyId("77f6bc7f07064bf4c09ef848139a344c"); //1.获取所在组织及下级组织 CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(agency.getAgencyId()); - List customerAgencyList = icBuildingDao.selectAgencyChildrenList(agency.getAgencyId()); + List customerAgencyList = icBuildingDao.selectAgencyChildrenList(customerId,agency.getAgencyId(),null); customerAgencyList.add(customerAgency); if (CollectionUtils.isEmpty(customerAgencyList)) { @@ -313,6 +310,184 @@ public class BuildingServiceImpl implements BuildingService { } + /** + * 房屋信息左侧树 + * + * @param formDTO + * @return 逐级展开,用户点击树节点去查询 + */ + @Override + public BuildingTreeLevelDTO treeInit(HouseManageTreeFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); + BuildingTreeLevelDTO resultDto = customerAgencyDao.selectAgencyTree(staffInfoCacheResult.getAgencyId()); + if (null != resultDto) { + int showNum = customerAgencyDao.selectTotalNext(staffInfoCacheResult.getAgencyId()); + resultDto.setShowNum(String.valueOf(showNum)); + resultDto.setShowName(String.format("%s(%s)", resultDto.getLabel(), showNum)); + List children = customerAgencyDao.selectNextOrg(staffInfoCacheResult.getAgencyId()); + for (BuildingTreeLevelDTO dto : children) { + if ("agency".equals(dto.getOrgType())) { + dto.setShowNum(String.valueOf(customerAgencyDao.selectTotalNext(dto.getId()))); + dto.setShowName(String.format("%s(%s)", dto.getLabel(), dto.getShowNum())); + } else if ("grid".equals(dto.getOrgType())) { + LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda() + .eq(IcNeighborHoodEntity::getGridId, dto.getId()); + dto.setShowNum(String.valueOf(icNeighborHoodDao.selectCount(queryWrapper))); + dto.setShowName(String.format("%s(%s)", dto.getLabel(), dto.getShowNum())); + } + } + resultDto.setChildren(children); + } + return resultDto; + } + + /** + * 房屋信息左侧树 + * 点击树上节点,查询下一级列表 + * + * @param formDTO + * @return + */ + @Override + public List nextTreeNode(HouseManageTreeFormDTO formDTO) { + /** + * level:::: + * 省级:province + * 市级: city + * 区县级: district, + * 乡(镇、街道)级:street, + * 社区级:community, + * 网格:grid + * 小区:neighborHood + * 楼栋:building + */ + List resultList = new ArrayList<>(); + if ("province".equals(formDTO.getLevel()) + || "city".equals(formDTO.getLevel()) + || "district".equals(formDTO.getLevel()) + || "street".equals(formDTO.getLevel())) { + List list = customerAgencyDao.selectNextOrg(formDTO.getId()); + for (BuildingTreeLevelDTO dto : list) { + if ("agency".equals(dto.getOrgType())) { + dto.setShowNum(String.valueOf(customerAgencyDao.selectTotalNext(dto.getId()))); + dto.setShowName(String.format("%s(%s)", dto.getLabel(), dto.getShowNum())); + } else if ("grid".equals(dto.getOrgType())) { + LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda() + .eq(IcNeighborHoodEntity::getGridId, dto.getId()); + dto.setShowNum(String.valueOf(icNeighborHoodDao.selectCount(queryWrapper))); + dto.setShowName(String.format("%s(%s)", dto.getLabel(), dto.getShowNum())); + } + } + resultList.addAll(list); + } else if ("community".equals(formDTO.getLevel())) { + // 网格列表,需要计算网格下小区数量 + resultList.addAll(getGridTreeNode(formDTO.getId())); + } else if ("grid".equals(formDTO.getLevel())) { + // 小区列表,需要计算小区下楼栋数量 + resultList.addAll(getNeighborHoodTreeNode(formDTO.getId())); + } else if ("neighborHood".equals(formDTO.getLevel())) { + // 楼栋列表,需要计算楼栋下 实有房屋数/楼栋总户数 + resultList.addAll(getBuildTreeNode(formDTO.getId())); + } else if ("building".equals(formDTO.getLevel())) { + // 直接返回 + return resultList; + } + return resultList; + } + + private List getGridTreeNode(String agencyId) { + List list = new ArrayList<>(); + LambdaQueryWrapper gridWrapper = new LambdaQueryWrapper<>(); + gridWrapper.eq(CustomerGridEntity::getPid, agencyId); + gridWrapper.last("ORDER BY sort,CAST(GRID_NAME AS SIGNED),CONVERT(GRID_NAME using gbk)"); + List customerGridList = customerGridDao.selectList(gridWrapper); + customerGridList.forEach(gridEntity -> { + BuildingTreeLevelDTO resultDto = new BuildingTreeLevelDTO(); + resultDto.setId(gridEntity.getId()); + resultDto.setLabel(gridEntity.getGridName()); + resultDto.setLevel("grid"); + resultDto.setPId(gridEntity.getPid()); + resultDto.setLongitude(gridEntity.getLongitude()); + resultDto.setLatitude(gridEntity.getLatitude()); + resultDto.setChildren(new ArrayList<>()); + // 当前网格下有几个小区 + LambdaQueryWrapper neighborhoodWrapper = new QueryWrapper().lambda() + .eq(IcNeighborHoodEntity::getGridId, resultDto.getId()); + resultDto.setShowNum(String.valueOf(icNeighborHoodDao.selectCount(neighborhoodWrapper))); + resultDto.setShowName(String.format("%s(%s)", resultDto.getLabel(), resultDto.getShowNum())); + list.add(resultDto); + }); + return list; + } + + private List getNeighborHoodTreeNode(String gridId) { + List list = new ArrayList<>(); + // 当前网格下有几个小区 + LambdaQueryWrapper neighborhoodWrapper = new QueryWrapper().lambda() + .eq(IcNeighborHoodEntity::getGridId, gridId) + .last("ORDER BY CAST(NEIGHBOR_HOOD_NAME AS SIGNED),CONVERT(NEIGHBOR_HOOD_NAME using gbk)"); + ; + List neighborHoodEntityList = icNeighborHoodDao.selectList(neighborhoodWrapper); + neighborHoodEntityList.forEach(item -> { + BuildingTreeLevelDTO neighborHood = new BuildingTreeLevelDTO(); + neighborHood.setId(item.getId()); + neighborHood.setPId(item.getGridId()); + neighborHood.setLabel(item.getNeighborHoodName()); + neighborHood.setLevel("neighborHood"); + neighborHood.setLongitude(item.getLongitude()); + neighborHood.setLatitude(item.getLatitude()); + neighborHood.setChildren(new ArrayList<>()); + // 当前小区下,有几栋楼 + LambdaQueryWrapper buildingQueryWrapper = new QueryWrapper().lambda() + .eq(IcBuildingEntity::getNeighborHoodId, neighborHood.getId()); + neighborHood.setShowNum(String.valueOf(icBuildingDao.selectCount(buildingQueryWrapper))); + neighborHood.setShowName(String.format("%s(%s)", neighborHood.getLabel(), neighborHood.getShowNum())); + list.add(neighborHood); + }); + return list; + } + + private List getBuildTreeNode(String neighborHoodId) { + List list = new ArrayList<>(); + LambdaQueryWrapper buildingQueryWrapper = new QueryWrapper().lambda() + .in(IcBuildingEntity::getNeighborHoodId, neighborHoodId) + .last("ORDER BY SORT, CAST(BUILDING_NAME AS SIGNED),CONVERT(BUILDING_NAME USING gbk)"); + List icBuildingList = icBuildingDao.selectList(buildingQueryWrapper); + + // 获取楼里已经有多少个房屋 + LambdaQueryWrapper icHouseEntityWrapper = new QueryWrapper().lambda() + .eq(IcHouseEntity::getNeighborHoodId, neighborHoodId) + .select(IcHouseEntity::getId) + .select(IcHouseEntity::getBuildingId); + List buildingHouseCount = icHouseDao.selectList(icHouseEntityWrapper); + Map buildingHouseCountMap = buildingHouseCount.stream().collect(Collectors.groupingBy(IcHouseEntity::getBuildingId, Collectors.counting())); + + icBuildingList.forEach(item -> { + BuildingTreeLevelDTO building = new BuildingTreeLevelDTO(); + building.setId(item.getId()); + building.setPId(item.getNeighborHoodId()); + building.setLabel(item.getBuildingName()); + building.setLevel("building"); + building.setLongitude(item.getLongitude()); + building.setLatitude(item.getLatitude()); + building.setChildren(new ArrayList<>()); + // 当前楼栋共有多少户,有多少户有人住 + building.setShowNum(StrConstant.EPMETY_STR); + // 楼栋总户数 + Integer total = null == item.getTotalHouseNum() ? NumConstant.ZERO : item.getTotalHouseNum(); + // 实际已录入的总房屋数 + int count = buildingHouseCountMap.getOrDefault(item.getId(), NumConstant.ZERO_L).intValue(); + if (NumConstant.ZERO == total) { + building.setShowNum(String.format("%s/%s", count, count)); + } else { + building.setShowNum(String.format("%s/%s", count, total)); + } + building.setShowName(String.format("%s(%s)", building.getLabel(), building.getShowNum())); + list.add(building); + }); + return list; + } + /** * Desc: * 2022-06-06 需求变动,只返回当前组织下级ID @@ -441,6 +616,7 @@ public class BuildingServiceImpl implements BuildingService { private List covertToTree(CustomerAgencyEntity customerAgency, List agencyList) { BuildingTreeLevelDTO buildingTreeLevelDTO = new BuildingTreeLevelDTO(); buildingTreeLevelDTO.setId(customerAgency.getId()); + buildingTreeLevelDTO.setPId(customerAgency.getPid()); buildingTreeLevelDTO.setLabel(customerAgency.getOrganizationName()); buildingTreeLevelDTO.setLevel(customerAgency.getLevel()); buildingTreeLevelDTO.setLongitude(customerAgency.getLongitude()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index dd1f8866fd..ab5e4ce22c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -239,6 +239,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl griddetail(CustomerGridFormDTO customerGridFormDTO) { GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO); + if(null==griddetail){ + return new Result<>(); + } List customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO); //获取人员具体信息(头像、名字...) Result> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 56b87d06fa..d7e3b1f8b2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -8,7 +8,6 @@ import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.HouseQrcodeEnum; @@ -35,17 +34,14 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; -import com.epmet.dto.form.stats.UserHouseStatsQueryFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.enums.*; import com.epmet.feign.*; import com.epmet.model.HouseInfoModel; import com.epmet.model.ImportHouseInfoListener; -import com.epmet.redis.CustomerAgencyRedis; import com.epmet.redis.IcHouseRedis; import com.epmet.service.*; -import com.epmet.stats.UserHouseStatsResultDTO; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.cache.Cache; @@ -69,7 +65,6 @@ import java.awt.image.BufferedImage; import java.io.*; import java.net.URLEncoder; import java.text.NumberFormat; -import java.time.LocalDate; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; @@ -137,7 +132,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { @Autowired private DataReportOpenFeignClient dataReportOpenFeignClient; - + /** + * 房屋管理-新增房屋 + * + * @param customerId + * @param formDTO + */ @Override @Transactional(rollbackFor = Exception.class) public void addHouse(String customerId, IcHouseAddFormDTO formDTO) { @@ -724,6 +724,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { resultDTO.setOrgId(formDTO.getOrgId()); resultDTO.setOrgType(formDTO.getOrgType()); + /*应烟台要求 页面去掉“较上月”的数据,后端程序也去掉,提升接口相应时间 // 加载上个月,该组织的人房统计信息,并且计算较上月信息 Date lastDayOfLastMonth = DateUtils.getLastDayOfMonth(DateUtils.addDateMonths(new Date(), -1)); UserHouseStatsQueryFormDTO form = new UserHouseStatsQueryFormDTO(formDTO.getOrgId(), formDTO.getOrgType(), DateUtils.format(lastDayOfLastMonth, "yyyyMMdd")); @@ -733,7 +734,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { resultDTO.setHouseTotalJSY(resultDTO.getHouseTotal() - lastMonthUserHouseStats.getHouseTotal()); resultDTO.setCzHouseTotalJSY(resultDTO.getCzHouseTotal() - lastMonthUserHouseStats.getCzHouseTotal()); resultDTO.setXzHouseTotalJSY(resultDTO.getXzHouseTotal() - lastMonthUserHouseStats.getXzHouseTotal()); - resultDTO.setZzHouseTotalJSY(resultDTO.getZzHouseTotal() - lastMonthUserHouseStats.getZzHouseTotal()); + resultDTO.setZzHouseTotalJSY(resultDTO.getZzHouseTotal() - lastMonthUserHouseStats.getZzHouseTotal());*/ return resultDTO; } @@ -1154,6 +1155,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { if (null == house) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到房屋信息", "未查到房屋信息"); } + // 市北区-智慧社区: 1623486671774978060 23.2月为了方便社区的同事们演示系统,新建的一个客户id + if("1623486671774978060".equals(house.getCustomerId())){ + return StrConstant.EPMETY_STR; + } //url组成:小程序地址?房屋编码 CustomerOrgParameterEntity codePre = icHouseDao.selectByCustomerId(house.getCustomerId(), HouseQrcodeEnum.PREFIX_KEY.getCode()); if(null == codePre){ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java index 679dde5615..7867b1434b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -280,12 +281,16 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(IcNeighborHoodEntity::getCustomerId,customerId) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java index bfc46dd0b6..41d2f7bfbc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java @@ -1,19 +1,24 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.epmet.commons.tools.exception.RenException; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.dao.IcNeighborHoodPropertyDao; import com.epmet.dao.IcPropertyManagementDao; +import com.epmet.dto.IcPropertyManagementDTO; import com.epmet.dto.form.IcPropertyManagementFormDTO; import com.epmet.dto.result.IcPropertyManagementResultDTO; import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.entity.IcPropertyManagementEntity; import com.epmet.service.PropertyManagementService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.ArrayList; @@ -28,9 +33,15 @@ public class PropertyManagementServiceImpl implements PropertyManagementService @Resource private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao; + /** + * 查询当前客户下的物业 + * @return + */ @Override public List getList() { - List propertyManagementEntityList = icPropertyManagementDao.selectList(null); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPropertyManagementEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + List propertyManagementEntityList = icPropertyManagementDao.selectList(queryWrapper); List list = new ArrayList<>(); propertyManagementEntityList.forEach(item->{ IcPropertyManagementResultDTO propertyManagementResultDTO = new IcPropertyManagementResultDTO(); @@ -41,13 +52,19 @@ public class PropertyManagementServiceImpl implements PropertyManagementService return list; } + /** + * 新增物业 + * 名称客户下唯一 + * @param formDTO + * @return + */ @Override @Transactional(rollbackFor = Exception.class) public String add(IcPropertyManagementFormDTO formDTO) { //物业名字平台内唯一 //如果输入的物业名字已经存在,直接返回物业id formDTO.setName(formDTO.getName().trim()); - IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName()); + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(),formDTO.getName(),null); if (null != entity) { return entity.getId(); } @@ -59,17 +76,34 @@ public class PropertyManagementServiceImpl implements PropertyManagementService @Override @Transactional(rollbackFor = Exception.class) public void update(IcPropertyManagementFormDTO formDTO) { + IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(),formDTO.getName(),formDTO.getId()); + if (null != entity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在"); + } IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); icPropertyManagementDao.updateById(icPropertyManagementEntity); } + /** + * 单个删除 + * @param formDTO + */ @Override @Transactional(rollbackFor = Exception.class) public void delete(IcPropertyManagementFormDTO formDTO) { - List list = icNeighborHoodPropertyDao.selectList(new QueryWrapper().lambda().eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId())); - if(!CollectionUtils.isEmpty(list)){ - throw new RenException("物业存在与小区关联,无法删除"); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId,formDTO.getId()); + if (icNeighborHoodPropertyDao.selectCount(queryWrapper) > 0) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业存在与小区关联,无法删除","已与小区关联,无法删除"); } icPropertyManagementDao.deleteById(formDTO.getId()); } + + @Override + public PageData page(Integer pageNo, Integer pageSize, String name) { + PageHelper.startPage(pageNo,pageSize); + List list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql new file mode 100644 index 0000000000..14ec16f9b4 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql @@ -0,0 +1,8 @@ +alter table ic_property_management add COLUMN `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户id' after NAME; + + +update ic_property_management p,ic_neighbor_hood_property pr,ic_neighbor_hood h +set p.CUSTOMER_ID=h.CUSTOMER_ID +where p.DEL_FLAG='0' + and p.id=pr.PROPERTY_ID + and pr.NEIGHBOR_HOOD_ID=h.id; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql new file mode 100644 index 0000000000..bcfc36cf16 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_org`.`customer_agency` + ADD COLUMN `REMARK` varchar(512) NULL COMMENT '备注说明' AFTER `REVISION`; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index f46e9f038d..37964a6e2c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -1050,9 +1050,74 @@ and LEVEL = 'community' AND CUSTOMER_ID = #{customerId} - AND PIDS like concat('%',#{staffAgencyId},'%') + AND (PIDS like concat('%',#{staffAgencyId},'%') or ID = #{staffAgencyId}) + + + + + + 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 9febecf227..fcd7f78600 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 @@ -197,7 +197,8 @@ grid_type AS 'gridType', contacts AS 'contacts', mobile AS 'mobile', - sort AS gridSort + sort AS gridSort, + COORDINATES AS coordinates FROM customer_grid WHERE diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index a825c2538a..2c8176a18f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -190,13 +190,20 @@ ca.organization_name AS organizationName, ca.LEVEL AS LEVEL, ca.pid as pid, - ca.pids as pids + ca.pids as pids, + ca.LONGITUDE longitude, + ca.LATITUDE latitude FROM customer_agency ca WHERE ca.del_flag = '0' - and - CONCAT(':',ca.pids, ':') like CONCAT('%:',#{agencyId},':%') + and ca.customer_id = #{customerId} + + and CONCAT(':',ca.pids, ':') like CONCAT('%:',#{pidsKey},':%') + + + and ca.pid = #{pid} + ORDER BY CAST(organization_name AS SIGNED),CONVERT(organization_name using gbk) 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 441dfe7f1b..6eac8ed9fd 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 @@ -128,6 +128,16 @@ 1 = 1 and a.del_flag = '0' + + + AND c.GRID_ID = #{orgId} + + + + + and (c.AGENCY_ID =#{orgId} or c.AGENCY_PIDS like concat('%',#{orgId},'%') ) + + and case c.AGENCY_PIDS when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%') else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%') end diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml index 0b0aba046c..045514482f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml @@ -14,14 +14,18 @@ - SELECT m.id FROM ic_property_management m WHERE m.DEL_FLAG = '0' + and m.customer_id = #{customerId} AND m.`NAME` = #{name} + + and m.id !=#{id} + @@ -65,4 +69,17 @@ AND p.DEL_FLAG = '0' ) + + \ 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 d40ff78a46..e5bf477bc6 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 @@ -1870,6 +1870,28 @@ public class IcEventServiceImpl extends BaseServiceImpl msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(icEventEntity.getGridId()); + messageFormDTO.setUserId(icEventEntity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + // 获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentUserId()); + messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为议题,请查看。", staffInfo.getAgencyName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(icEventEntity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件转议题,给居民端用户发送站内信异常,事件Id->%s", icEventEntity.getId())); + } + } } /** diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java index e86357966e..6be60b5d1e 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -20,10 +22,16 @@ public class CommonArticleListFormDTO implements Serializable { * */ public interface ArticleBannerInternalGroup{} + /** + * 烟台需求:周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧 + * + */ + public interface YanTaiShowGroup extends CustomerClientShowGroup { + } /** * 网格Id * */ - @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) + @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class,YanTaiShowGroup.class}) private String gridId; /** @@ -34,10 +42,19 @@ public class CommonArticleListFormDTO implements Serializable { /** * 标签名称(高级配置里的参数) * */ + @NotBlank(message = "标签名称不能为空",groups = YanTaiShowGroup.class) private String tagName; /** * 排除的标签名称(高级配置里的参数) * */ private String excludeTagName; - + /** + * 是否置顶 1是;0否; + */ + private Integer isTop; + + @NotNull(message = "pageNo不能为空", groups = YanTaiShowGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空", groups = YanTaiShowGroup.class) + private Integer pageSize; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java index d8edcf1308..212cfd9a7a 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java @@ -16,7 +16,15 @@ import java.io.Serializable; public class GuideListFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = -4471422632936288213L; + /** + * tokenDto.customerId + */ private String customerId; + + /** + * tokenDto.userId + */ + private String userId; /** * 组织ID */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java index 7cd2400afa..f4b2403608 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java @@ -32,4 +32,10 @@ public class GuideListResultDTO implements Serializable { * 更新时间 */ private Date updatedTime; + + /** + * 1:已读 + * 0:未读 + */ + private Integer readFlag; } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 611c9d2b79..a984a8a42a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -331,6 +331,21 @@ public class ArticleController { return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); } + /** + * @param formDTO + * @return 烟台钉钉应用:实时动态周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧 + * 包括最新活动 + */ + @PostMapping("article-list-ytding") + public Result> pageArticleListByTagName(@RequestBody CommonArticleListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CommonArticleListFormDTO.YanTaiShowGroup.class); + return new Result>().ok(articleService.pageArticleListByTagName(formDTO.getPageNo(), + formDTO.getPageSize(), + formDTO.getGridId(), + formDTO.getTagName())); + } + + /** * @param articlePageFormDTO * @return List diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java index 8fe57c6f76..a1586ee736 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java @@ -100,8 +100,10 @@ public class GuideController { */ @PostMapping("list") public Result> guideList(@LoginUser TokenDto tokenDto, @RequestBody GuideListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); - PageData page = guideService.guideList(tokenDto, formDTO); + PageData page = guideService.guideList(formDTO); return new Result>().ok(page); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java index 2c19c2aa38..53524c9bb7 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -114,7 +114,11 @@ public interface ArticleDao extends BaseDao { * @author wangc * @date 2020.06.02 16:04 **/ - List selectLatestArticleMsg(@Param("gridId") String gridId, @Param("tagName") String tagName, @Param("excludeTagName") String excludeTagName, @Param("num") Integer num); + List selectLatestArticleMsg(@Param("gridId") String gridId, + @Param("tagName") String tagName, + @Param("excludeTagName") String excludeTagName, + @Param("num") Integer num, + @Param("isTop")Integer isTop); /** * @param gridId @@ -163,4 +167,16 @@ public interface ArticleDao extends BaseDao { List subjectList(@Param("pidList")List pidList); List selectAllArticle(ArticleListFormDTO formDTO); + + /** + * 根据标签名,查询文章列表 + * @param gridId + * @param tagName + * @param customerId + * @return + */ + List pageArticleListByTagName(@Param("gridId")String gridId, + @Param("tagName")String tagName, + @Param("customerId")String customerId, + @Param("agencyId")String agencyId); } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java new file mode 100644 index 0000000000..a7f5887077 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideReaderEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 办事指南阅读记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Mapper +public interface GuideReaderDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java new file mode 100644 index 0000000000..b5b1f881fc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java @@ -0,0 +1,44 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 办事指南阅读记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_reader") +public class GuideReaderEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南id + */ + private String guideId; + + /** + * 用户id;进入过办事指南详情就算是已读 + */ + private String userId; + + /** + * 工作端:gov;居民端:resi + */ + private String userType; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index dca18d0bb7..d9374b1263 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -278,4 +278,18 @@ public interface ArticleService extends BaseService { * @param currentOperUserId */ void delete(List articleIds,String customerId,String currentOperUserId); + + /** + * 烟台钉钉居民端:需求来源:烟台钉钉应用:实时动态周边疫情 就业服务 警民互动 物业通知 党务公开 居务公开 财务公开 以上标签在实时动态里写死吧 + * + * @param pageNo + * @param pageSize + * @param gridId + * @param tagName + * @return + */ + PageData pageArticleListByTagName(Integer pageNo, + Integer pageSize, + String gridId, + String tagName); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java new file mode 100644 index 0000000000..646a578a72 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java @@ -0,0 +1,34 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.GuideReaderEntity; + +/** + * 办事指南阅读记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +public interface GuideReaderService extends BaseService { + + /** + * 单条查询 + * + * @param guideId + * @param userId + * @return GuideReaderDTO + * @author generator + * @date 2023-02-02 + */ + GuideReaderEntity get(String guideId,String userId); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-02-02 + */ + void save(GuideReaderEntity dto); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java index a2493a88ac..6f5d3c7071 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java @@ -109,7 +109,7 @@ public interface GuideService extends BaseService { * @Author zhaoqifeng * @Date 2021/9/7 14:00 */ - PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO); + PageData guideList(GuideListFormDTO formDTO); /** * 添加指南 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 8c8d695d51..a1777b5056 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -42,10 +42,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.*; import com.epmet.dao.*; @@ -537,8 +534,10 @@ public class ArticleServiceImpl extends BaseServiceImpl getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { - return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(),commonArticleListFormDTO.getTagName(),commonArticleListFormDTO.getExcludeTagName(), + return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(), + commonArticleListFormDTO.getTagName(), + commonArticleListFormDTO.getExcludeTagName(), null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? - NumConstant.FIVE : commonArticleListFormDTO.getNum()); + NumConstant.FIVE : commonArticleListFormDTO.getNum(), + commonArticleListFormDTO.getIsTop()); } /** @@ -1740,47 +1742,47 @@ public class ArticleServiceImpl extends BaseServiceImpl list = baseDao.selectAllArticle(formDTO); - - if (!CollectionUtils.isEmpty(list)) { - resultDTO = list.get(NumConstant.ZERO); - resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>()); - resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false); - //查询文章涉及的发布范围网络Id列表 - LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); - tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId()); - tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR); - //【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】 - if("offline".equals(resultDTO.getStatusFlag())){ - tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline"); - }else { - tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published"); - } - List entityList = articlePublishRangeDao.selectList(tWrapper); - if (!CollectionUtils.isEmpty(entityList)) { - List contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); - resultDTO.setGridIdList(contentList); - } - - //查询文章内容 - LambdaQueryWrapper tWrapper1 = new LambdaQueryWrapper<>(); - tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId()); - tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR); - tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum); - List contentEntityList = articleContentDao.selectList(tWrapper1); - if (!CollectionUtils.isEmpty(contentEntityList)) { - List contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class); - resultDTO.setContentList(contentList); - } - - //标签列表 - LambdaQueryWrapper tWrapper2 = new LambdaQueryWrapper<>(); - tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId()); - tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR); - List tagsEntityList = articleTagsDao.selectList(tWrapper2); - if (!CollectionUtils.isEmpty(tagsEntityList)) { - List contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList()); - resultDTO.setTagIdList(contentList); - } + if(CollectionUtils.isEmpty(list)){ + return null; + } + resultDTO = list.get(NumConstant.ZERO); + resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>()); + resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false); + //查询文章涉及的发布范围网络Id列表 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId()); + tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR); + //【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】 + if("offline".equals(resultDTO.getStatusFlag())){ + tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline"); + }else { + tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published"); + } + List entityList = articlePublishRangeDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + List contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); + resultDTO.setGridIdList(contentList); + } + + //查询文章内容 + LambdaQueryWrapper tWrapper1 = new LambdaQueryWrapper<>(); + tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId()); + tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR); + tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum); + List contentEntityList = articleContentDao.selectList(tWrapper1); + if (!CollectionUtils.isEmpty(contentEntityList)) { + List contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class); + resultDTO.setContentList(contentList); + } + + //标签列表 + LambdaQueryWrapper tWrapper2 = new LambdaQueryWrapper<>(); + tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId()); + tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR); + List tagsEntityList = articleTagsDao.selectList(tWrapper2); + if (!CollectionUtils.isEmpty(tagsEntityList)) { + List contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList()); + resultDTO.setTagIdList(contentList); } return resultDTO; @@ -1799,7 +1801,7 @@ public class ArticleServiceImpl extends BaseServiceImpl queryWrapper=new LambdaQueryWrapper(); - queryWrapper.eq(ArticleCoverEntity::getArticleId,articleEntity); + queryWrapper.eq(ArticleCoverEntity::getArticleId,articleId); if (articleCoverDao.selectCount(queryWrapper) == 0) { ArticleCoverEntity articleCoverEntity=new ArticleCoverEntity(); articleCoverEntity.setCustomerId(articleEntity.getCustomerId()); @@ -1847,6 +1849,7 @@ public class ArticleServiceImpl extends BaseServiceImpl pageArticleListByTagName(Integer pageNo, Integer pageSize, String gridId, String tagName) { + PageHelper.startPage(pageNo, pageSize); + List list = baseDao.pageArticleListByTagName( + gridId, + tagName, + EpmetRequestHolder.getLoginUserCustomerId(), + null); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideReaderServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideReaderServiceImpl.java new file mode 100644 index 0000000000..e66e635289 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideReaderServiceImpl.java @@ -0,0 +1,35 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.GuideReaderDao; +import com.epmet.entity.GuideReaderEntity; +import com.epmet.service.GuideReaderService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 办事指南阅读记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-02-02 + */ +@Service +public class GuideReaderServiceImpl extends BaseServiceImpl implements GuideReaderService { + + @Override + public GuideReaderEntity get(String guideId,String userId) { + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper<>(); + queryWrapper.eq(GuideReaderEntity::getGuideId,guideId) + .eq(GuideReaderEntity::getUserId,userId); + GuideReaderEntity entity = baseDao.selectOne(queryWrapper); + return entity; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideReaderEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java index d93f21b2af..eadca17c92 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -31,6 +32,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; 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.commons.tools.utils.SpringContextUtils; import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.GuideDao; import com.epmet.dto.GuideDTO; @@ -38,10 +40,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.GuideDetailResultDTO; import com.epmet.dto.result.GuideListResultDTO; import com.epmet.dto.result.OrgResultDTO; -import com.epmet.entity.GuideAttachmentEntity; -import com.epmet.entity.GuideEntity; -import com.epmet.entity.GuideExternalLinkEntity; -import com.epmet.entity.GuideModuleEntity; +import com.epmet.entity.*; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; import com.github.pagehelper.PageHelper; @@ -140,15 +139,14 @@ public class GuideServiceImpl extends BaseServiceImpl imp * @Date 2021/9/7 14:00 */ @Override - public PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO) { + public PageData guideList(GuideListFormDTO formDTO) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); - formDTO.setCustomerId(tokenDto.getCustomerId()); List list = baseDao.getGuideList(formDTO); if (CollectionUtils.isNotEmpty(list)) { list.forEach(item -> { - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), item.getCreatedId()); if (null == staffInfoCache) { - item.setCategoryName(""); + item.setCategoryName(StrConstant.EPMETY_STR); } else { item.setCreatedName(staffInfoCache.getRealName()); } @@ -390,6 +388,15 @@ public class GuideServiceImpl extends BaseServiceImpl imp if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) { result.setCollectionFlag(NumConstant.ONE_STR); } + //记录已读未读 来源于烟台 + if (null == SpringContextUtils.getBean(GuideReaderService.class).get(formDTO.getGuideId(), tokenDto.getUserId())) { + GuideReaderEntity guideReaderEntity=new GuideReaderEntity(); + guideReaderEntity.setGuideId(formDTO.getGuideId()); + guideReaderEntity.setCustomerId(formDTO.getCustomerId()); + guideReaderEntity.setUserId(tokenDto.getUserId()); + guideReaderEntity.setUserType(tokenDto.getApp()); + SpringContextUtils.getBean(GuideReaderService.class).save(guideReaderEntity); + } return result; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql new file mode 100644 index 0000000000..eb1fb181c0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql @@ -0,0 +1,14 @@ +CREATE TABLE `guide_reader` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南id', + `USER_ID` varchar(64) NOT NULL COMMENT '用户id;进入过办事指南详情就算是已读', + `USER_TYPE` varchar(10) NOT NULL COMMENT '工作端:gov;居民端:resi', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='办事指南阅读记录'; \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 572bd59e84..5e67b953a0 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -187,7 +187,7 @@ - SELECT art.ID AS articleId, art.TITLE AS articleTitle , @@ -224,7 +224,9 @@ art.DEL_FLAG = '0' AND art.STATUS_FLAG = 'published' - + + AND art.IS_TOP=#{isTop} + GROUP BY art.ID HAVING 1 = 1 @@ -360,7 +362,7 @@ FROM ARTICLE art LEFT JOIN ARTICLE_PUBLISH_RANGE prange ON (art.ID = prange.ARTICLE_ID AND prange.DEL_FLAG = '0' AND prange.PUBLISH_STATUS = 'published') - LEFT JOIN article_tags ats ON (ats.ARTICLE_ID = art.ID) + LEFT JOIN article_tags ats ON (ats.ARTICLE_ID = art.ID and ats.del_flag='0') LEFT JOIN article_cover ac ON (ac.ARTICLE_ID = art.ID AND ac.DEL_FLAG = 0) WHERE art.DEL_FLAG = '0' @@ -479,6 +481,7 @@ WHERE del_flag = '0' AND article_id = a.id AND agency_id = #{publishRangeId} + and PUBLISH_STATUS='published' ) @@ -487,6 +490,7 @@ WHERE del_flag = '0' AND article_id = a.id AND grid_id = #{publishRangeId} + and PUBLISH_STATUS='published' ) @@ -504,4 +508,43 @@ ORDER BY a.publish_date DESC, a.updated_time DESC + + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml index d3d5c34a56..c93cf14e36 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml @@ -26,7 +26,11 @@ g.TITLE AS "title", gc.CATEGORY_NAME AS "categoryName", g.CREATED_BY AS "createdId", - g.UPDATED_TIME AS "updatedTime" + g.UPDATED_TIME AS "updatedTime", + if(exists( select gr.id from guide_reader gr + where gr.del_flag='0' + and gr.GUIDE_ID=g.id + and gr.USER_ID = #{userId}),1,0) AS readFlag FROM guide g INNER JOIN guide_category gc ON g.CATEGORY_CODE = gc.CATEGORY_CODE AND gc.DEL_FLAG = 0 AND gc.CUSTOMER_ID = #{customerId} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml new file mode 100644 index 0000000000..0c1d006449 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/pom.xml b/epmet-module/open-data-worker/open-data-worker-server/pom.xml index 275a49d532..e89af673af 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/pom.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/pom.xml @@ -262,7 +262,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java index cc44f4c5b8..5969fcc7cb 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java @@ -36,4 +36,17 @@ public class EventreportPingyinController { return new Result(); } + /** + * 将数据同步到平阴库 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/12/9 14:15 + */ + @PostMapping("saveData") + public Result saveData(@RequestBody(required = false) EventInfoFormDTO formDTO) { + eventreportPingyinService.saveData(formDTO); + return new Result(); + } + } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java index 3dd7d54d03..f209818c61 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java @@ -1,20 +1,14 @@ package com.epmet.opendata.controller; -import com.epmet.commons.tools.aop.NoRepeatSubmit; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.opendata.service.GridstaffWorkInfoPingyinService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; +import javax.annotation.Resource; /** @@ -27,6 +21,20 @@ import java.util.Map; @RequestMapping("gridstaffWorkInfoPingyin") public class GridstaffWorkInfoPingyinController { + @Resource + private GridstaffWorkInfoPingyinService gridstaffWorkInfoPingyinService; + /** + * 将数据同步到平阴库 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/12/9 14:15 + */ + @PostMapping("saveData") + public Result saveData(@RequestBody(required = false) EventInfoFormDTO formDTO) { + gridstaffWorkInfoPingyinService.saveData(formDTO); + return new Result(); + } } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java index d2fe6c88f2..9091b7876e 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java @@ -20,4 +20,13 @@ public interface EventreportPingyinService extends BaseService wrapper = new LambdaQueryWrapper<>(); + wrapper.ge(EventreportPingyinEntity::getReportTime, formDTO.getStartTime()); + wrapper.le(EventreportPingyinEntity::getReportTime, formDTO.getEndTime()); + List list = baseDao.selectList(wrapper); + List> partition = ListUtils.partition(list, NumConstant.ONE_THOUSAND); + partition.forEach(part -> { + //将同步的数据保存 + SavePyEventDataFormDTO savePyEventData = new SavePyEventDataFormDTO(); + savePyEventData.setProjectList(ConvertUtils.sourceToTarget(part, EventreportPingyinDTO.class)); + dataStatisticalOpenFeignClient.saveData(savePyEventData); + }); } private void saveEvent(List list, String initFlag) { @@ -173,7 +203,9 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl staffList = new ArrayList<>(); result.getData().forEach(r -> { GridstaffInfoPingyinEntity entity = ConvertUtils.sourceToTarget(r, GridstaffInfoPingyinEntity.class); entity.setQxBm("370124"); @@ -142,7 +144,24 @@ public class GridstaffInfoPingyinServiceImpl extends BaseServiceImpl data; + do { + Result> record = epmetUserOpenFeignClient.getPatrolRoutineWorkListV2(midPatrolFormDTO); + if (record == null || !record.success()) { + log.warn("获取例行工作记录V2失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + data = record.getData(); + if (CollectionUtils.isNotEmpty(record.getData())) { + List newList = new ArrayList<>(); + data.forEach(item -> { + if (StringUtils.isBlank(item.getGridId())){ + return; + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null == gridInfo) { + return; + } + item.setGridCode(gridInfo.getCode()); + if (StringUtils.isNotBlank(item.getGridCode())) { + newList.add(item); + } + }); + List list = newList.stream().map(item -> { + GridstaffWorkInfoPingyinDTO dto = new GridstaffWorkInfoPingyinDTO(); + dto.setId(item.getId()); + dto.setHappenTime(DateUtils.parseDate(item.getHappenTime().concat(" 00:00:00"), DateUtils.DATE_PATTERN)); + dto.setWorkType(item.getWorkTypeSecondCode()); + dto.setTitle(item.getTitle()); + dto.setOrgId(item.getGridId()); + dto.setPids(item.getPids()); + dto.setStaffName(item.getStaffName()); + dto.setMobile(item.getMobile()); + return dto; + }).collect(Collectors.toList()); + //将同步的数据保存 + SavePyEventDataFormDTO savePyEventData = new SavePyEventDataFormDTO(); + savePyEventData.setWorkList(list); + dataStatisticalOpenFeignClient.saveData(savePyEventData); + } + midPatrolFormDTO.setPageNo(midPatrolFormDTO.getPageNo() + 1); + } while (data.size() == NumConstant.ONE_THOUSAND); + } + /** * Desc: 数据存入 * @@ -112,11 +181,22 @@ public class GridstaffWorkInfoPingyinServiceImpl extends BaseServiceImpl list) { List insertList = new ArrayList<>(); + List newList = new ArrayList<>(); list.forEach(o -> { if (StringUtils.isBlank(o.getGridCode())) { return; } insertList.add(buildNewEntity(o)); + GridstaffWorkInfoPingyinDTO dto = new GridstaffWorkInfoPingyinDTO(); + dto.setId(o.getId()); + dto.setHappenTime(DateUtils.parseDate(o.getHappenTime().concat(" 00:00:00"), DateUtils.DATE_PATTERN)); + dto.setWorkType(o.getWorkTypeSecondCode()); + dto.setTitle(o.getTitle()); + dto.setOrgId(o.getGridId()); + dto.setPids(o.getPids()); + dto.setStaffName(o.getStaffName()); + dto.setMobile(o.getMobile()); + newList.add(dto); }); //insert if (CollectionUtils.isEmpty(insertList)) { @@ -124,6 +204,10 @@ public class GridstaffWorkInfoPingyinServiceImpl extends BaseServiceImpl { **/ void init(CustomerInitFormDTO formDTO); + /** + * 本地初始化(不走小程序) + */ + void initLocal(CustomerInitFormDTO input); + /** * desc:获取所有客户列表 * @return diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 856a72c96d..0c1c2a3d47 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -22,6 +22,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; import com.epmet.commons.tools.constant.FieldConstant; @@ -585,6 +586,74 @@ public class CustomerServiceImpl extends BaseServiceImpl resultPoint = epmetPointOpenFeignClient.initPointRule(customerId); + if (!resultPoint.success()) { + throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg()); + } + + //9.新客户初始化评价指标 权重 + InitCustomerIndexForm indexForm = new InitCustomerIndexForm(); + indexForm.setCustomerId(customerId); + Result resultData = dataStatisticalOpenFeignClient.initCustomerIndex(indexForm); + if (!resultData.success()) { + throw new RenException(resultData.getCode(), resultData.getInternalMsg()); + } + //2021.1.25 end + + } + private InitCustomerMQMsg.InitCustomerStaff constructStaffInfo4CustomerInit(String agencyId, PaUserDTO paUser) { InitCustomerMQMsg.InitCustomerStaff staff = new InitCustomerMQMsg.InitCustomerStaff(); staff.setAgencyId(agencyId); diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index acd09b7375..ba6a1705a9 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -287,7 +287,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 epmet_message diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java index 457e794443..1ba2bee6fe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java @@ -120,4 +120,16 @@ public interface TopicConstant { String RESOLVED = "resolved"; String MEMBER = "member"; + /** + * 反对 + */ + String OPPOSITION = "opposition"; + /** + * 赞成 + */ + String SUPPORT = "support"; + /** + * 无 + */ + String NONE = "none"; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java new file mode 100644 index 0000000000..dddb6d1c4c --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java @@ -0,0 +1,95 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 烟台话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,关联resi_topic的id + */ + private String topicId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java new file mode 100644 index 0000000000..ff5b669689 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java @@ -0,0 +1,109 @@ +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 烟台话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java new file mode 100644 index 0000000000..b397d26fef --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java @@ -0,0 +1,74 @@ +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 烟台话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicCommentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,来自resi_topic + */ + private String topicId; + + /** + * + */ + private String commentContent; + + /** + * 评论状态:讨论中:discussing;已屏蔽 :hidden + */ + private String status; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,评论人Id,来自user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java new file mode 100644 index 0000000000..8e4fa3add3 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java @@ -0,0 +1,125 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 定位地址 + */ + private String locateAddress; + + /** + * 定位经度 + */ + private String locateLongitude; + + /** + * 定位维度 + */ + private String locateLatitude; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,发布人Id来源于user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java new file mode 100644 index 0000000000..bf8d7c10b1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java @@ -0,0 +1,70 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +public class YtTopicVoteDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 态度 - opposition(反对)support(赞成) + */ + private String attitude; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java new file mode 100644 index 0000000000..de00da7503 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java @@ -0,0 +1,100 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zhaoqifeng + * @Date 2023/1/30 16:17 + */ +@Data +public class CreateYtTopicFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "customerId不能为空",groups =AddUserInternalGroup.class ) + private String customerId; + + @NotBlank(message ="网格不能为空",groups =AddUserShowGroup.class ) + private String gridId; + + @Length(max=3000,message ="话题内容最多输入3000字",groups =AddUserShowGroup.class ) + private String topicContent; + + /** + * 经度 + * */ + private String longitude; + + /** + * 纬度 + * */ + private String latitude; + + /** + * 地址 + * */ + @NotBlank(message = "地址信息不能为空") + private String address; + + /** + * 经度 + * */ + private String locateLongitude; + + /** + * 纬度 + * */ + private String locateLatitude; + + /** + * 地址 + * */ + private String locateAddress; + + /** + * 省份 + * */ + private String province; + + /** + * 城市 + * */ + private String city; + + /** + * 地区 + * */ + private String area; + + /** + * 图片附件 + */ + private List imageList; + // /** + // * 文件附件 + // */ + // private List docList; + /** + * 语音附件 + */ + private List voiceList; + // /** + // * 视频附件 + // */ + // private List videoList; + /** + * tokenDto.getUserId + */ + @NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class ) + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java index 6eba4678d7..ac45f7b351 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java @@ -122,4 +122,19 @@ public class IssueShiftedFromTopicFormDTO implements Serializable { private String groupId; private String issueId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java new file mode 100644 index 0000000000..e047e12eae --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ResiPublishCommentFormDTO + * @Author wangc + * @date 2020.03.31 17:32 + */ +@Data +public class YtTopicCommentFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "话题Id不能为空") + private String topicId; + + //@NotBlank(message = "评论内容不能为空") + private String commentContent; + + /** + * 图片附件集合 + */ + private List imageList; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java new file mode 100644 index 0000000000..61b03690ba --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiTopicDetailFormDTO + * @Author wangc + * @date 2020.04.07 09:07 + */ +@Data +public class YtTopicDetailFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 话题Id + * */ + @NotBlank(message = "话题Id不能为空",groups = AddUserShowGroup.class) + private String topicId; + + /** + * tokenDto.getUserId + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class ) + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java new file mode 100644 index 0000000000..b0649e5cc8 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author Administrator + */ +@Data +public class YtTopicPageFormDTO extends PageFormDTO implements Serializable{ + + private static final long serialVersionUID = 1L; + /** + * 组织Id + * */ + private String agencyId; + + /** + * 网格Id,source是居民端时必填 + * */ + @NotBlank(message = "网格Id不能为空") + private String gridId; + + /** + * 搜索时可以带状态的查询,也可以不带 + * */ + private String status; + + /** + * 用户Id + * */ + private String userId; + + /** + * 请求来源0 居民端,1 PC端 + * */ + private String source; + + /** + * 话题内容 + * */ + private String topicContent; + + /** + * 话题发表人 + * */ + private String userName; + + /** + * 发布时间 + * */ + private String startDate; + + /** + * 发布时间 + * */ + private String endDate; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java new file mode 100644 index 0000000000..153467c7a2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiPublishCommentFormDTO + * @Author wangc + * @date 2020.03.31 17:32 + */ +@Data +public class YtTopicVoteFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "话题Id不能为空") + private String topicId; + + /** + * 态度opposition(反对)support(赞成) + */ + @NotBlank(message = "投票结果不能为空") + private String attitude; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java index ac3516418d..8577b8493b 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java @@ -33,4 +33,19 @@ public class ResiTopicAndGroupResultDTO implements Serializable { * 客户Id * */ private String customerId; + + /** + * 定位地址 + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java new file mode 100644 index 0000000000..cf18c2d385 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java @@ -0,0 +1,65 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @ClassName ResiCommentResultDTO + * @Author wangc + * @date 2020.04.01 17:07 + */ +@Data +public class YtTopicCommentResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 评论Id + * */ + private String commentId; + + /** + * 评论内容 + * */ + private String commentContent; + + /** + * 评论者头像 + * */ + private String commentUserHeadPhoto; + + /** + * 评论者姓名 + * */ + private String commentUserName; + + /** + * 用户Id 评论者Id + * */ + @JsonIgnore + private String userId; + + /** + * 评论时间 yyyy-MM-dd HH:mm + * */ + @JSONField(format="yyyy-MM-dd HH:mm") + private Date commentTime; + + /** + * 评论状态 + * */ + private String commentStatus; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java new file mode 100644 index 0000000000..d5e4675af0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java @@ -0,0 +1,86 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.epmet.resi.group.dto.topic.form.FileDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author Administrator + */ +@Data +public class YtTopicDetailResultDTO implements Serializable { + private static final long serialVersionUID = -6790536784979922200L; + + /** + * 话题Id + * */ + private String topicId; + + + /** + * 发布人名称 + * */ + private String releaseUserName; + + /** + * 发布人头像 + * */ + private String releaseUserHeadPhoto; + + /** + * 发布时间 yyyy-MM-dd HH:mm + * */ + private String releaseTime; + + /** + * 发布地址 + * */ + private String releaseAddress; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 话题内容 + * */ + private String topicContent; + + /** + * 话题状态 + * */ + private String topicStatus; + + /** + * 图片访问地址 + * */ + private List topicImages; + + /** + * 话题语音详情 + * */ + private List topicVoices; + + /** + * 本人投票状态opposition(反对)support(赞成) none(未投票) + * */ + private String voteStatus; + /** + * 投票支持数 + * */ + private String supportCount; + /** + * 投票反对数 + * */ + private String oppositionCount; + private String userName; + private String gridName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java new file mode 100644 index 0000000000..a1ede2ebc7 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java @@ -0,0 +1,75 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * @author Administrator + */ +@Data +public class YtTopicInfoResultDTO implements Serializable { + private static final long serialVersionUID = -7029232911456325417L; + + /** + * 话题Id + * */ + private String topicId; + + /** + * 用户Id 话题发布人 + * */ + private String userId; + + /** + * 发布人名称 + * */ + private String releaseUserName; + private String userName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * 发布人头像 + * */ + private String releaseUserHeadPhoto; + + /** + * 发布时间 yyyy-MM-dd HH:mm + * */ + @JSONField(format="yyyy-MM-dd HH:mm") + private Date releaseTime; + + /** + * 话题内容 + * */ + private String topicContent; + + /** + * 话题状态 讨论中 已关闭 + * */ + private String status; + + /** + * 是否本人 me other + * */ + private String releaseUserFlag; + + /** + * 第一张图片 + * */ + private List imageList; + +} diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 22d49ab7af..f90581a6d2 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -333,7 +333,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java new file mode 100644 index 0000000000..d7ac74fd3b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java @@ -0,0 +1,142 @@ +package com.epmet.modules.topic.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.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.modules.topic.service.YtTopicService; +import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@RestController +@RequestMapping("ytTopic") +public class YtTopicController { + + @Autowired + private YtTopicService ytTopicService; + + /** + * 发布话题 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/1/30 16:32 + */ + @PostMapping("createTopic") + @NoRepeatSubmit + public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody CreateYtTopicFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,CreateYtTopicFormDTO.AddUserShowGroup.class,CreateYtTopicFormDTO.AddUserInternalGroup.class); + ytTopicService.createTopic(formDTO); + return new Result(); + } + + /** + * 话题详情 + * + * @Param tokenDto + * @Param topicDetailFormDTO + * @Return {@link Result< YtTopicDetailResultDTO>} + * @Author zhaoqifeng + * @Date 2023/1/30 16:39 + */ + @PostMapping("topicDetail") + public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO topicDetailFormDTO) { + topicDetailFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(topicDetailFormDTO,YtTopicDetailFormDTO.AddUserShowGroup.class,YtTopicDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(ytTopicService.getTopicDetail(topicDetailFormDTO)); + } + + /** + * 话题列表 + * + * @Param tokenDto + * @Param topicPageFormDTO + * @Return {@link Result< PageData< YtTopicInfoResultDTO>>} + * @Author zhaoqifeng + * @Date 2023/1/30 16:55 + */ + @PostMapping("topicList") + @MaskResponse(fieldNames = "userName", fieldsMaskType = {MaskResponse.MASK_TYPE_CHINESE_NAME}) + public Result> getTopicList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicPageFormDTO topicPageFormDTO) { + topicPageFormDTO.setUserId(tokenDto.getUserId()); + if (NumConstant.ZERO_STR.equals(topicPageFormDTO.getSource())) { + ValidatorUtils.validateEntity(topicPageFormDTO); + } + return new Result>().ok(ytTopicService.getTopicList(tokenDto, topicPageFormDTO)); + } + + /** + * 话题详情评论列表 + * + * @Param tokenDto + * @Param queryCommentFormDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2023/1/30 16:57 + */ + @PostMapping("topicCommentList") + public Result> getTopiCommentList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(ytTopicService.getTopicCommentList(tokenDto, formDTO)); + } + + /** + * 评论话题 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/1/30 17:06 + */ + @PostMapping("topicComment") + @NoRepeatSubmit + public Result topiComment(@LoginUser TokenDto tokenDto, @RequestBody YtTopicCommentFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + ytTopicService.topicComment(tokenDto, formDTO); + return new Result(); + } + + /** + * 话题投票 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2023/1/30 17:08 + */ + @PostMapping("topicVote") + @NoRepeatSubmit + public Result topicVote(@LoginUser TokenDto tokenDto, @RequestBody YtTopicVoteFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + ytTopicService.topicVote(tokenDto, formDTO); + return new Result(); + } + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java new file mode 100644 index 0000000000..332f1ce641 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 烟台话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentAttachmentDao.java new file mode 100644 index 0000000000..25ba6fe8a0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicCommentAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 烟台话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicCommentAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentDao.java new file mode 100644 index 0000000000..2167e676cf --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicCommentDao.java @@ -0,0 +1,29 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicCommentEntity; +import com.epmet.resi.group.dto.topic.form.YtTopicDetailFormDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 烟台话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicCommentDao extends BaseDao { + + /** + * 获取评论列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2023/1/31 14:11 + */ + List selectCommentList(YtTopicDetailFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicDao.java new file mode 100644 index 0000000000..42cf49bcd1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicDao.java @@ -0,0 +1,28 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicEntity; +import com.epmet.resi.group.dto.topic.form.YtTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicDao extends BaseDao { + /** + * 话题列表 + * + * @Param topicPageFormDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2023/1/31 13:52 + */ + List selectTopicList(YtTopicPageFormDTO topicPageFormDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicVoteDetailDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicVoteDetailDao.java new file mode 100644 index 0000000000..c947aef1fc --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicVoteDetailDao.java @@ -0,0 +1,16 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.YtTopicVoteDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Mapper +public interface YtTopicVoteDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicAttachmentEntity.java new file mode 100644 index 0000000000..b7da282f42 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicAttachmentEntity.java @@ -0,0 +1,61 @@ +package com.epmet.modules.topic.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 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_attachment") +public class YtTopicAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,关联resi_topic的id + */ + private String topicId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentAttachmentEntity.java new file mode 100644 index 0000000000..687b276579 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentAttachmentEntity.java @@ -0,0 +1,79 @@ +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 烟台话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_comment_attachment") +public class YtTopicCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentEntity.java new file mode 100644 index 0000000000..52a60634d2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicCommentEntity.java @@ -0,0 +1,41 @@ +package com.epmet.modules.topic.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 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_comment") +public class YtTopicCommentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id,来自resi_topic + */ + private String topicId; + + /** + * + */ + private String commentContent; + + /** + * 评论状态:讨论中:discussing;已屏蔽 :hidden + */ + private String status; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicEntity.java new file mode 100644 index 0000000000..df7773368d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicEntity.java @@ -0,0 +1,101 @@ +package com.epmet.modules.topic.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 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic") +public class YtTopicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所有上级组织ID + */ + private String pids; + + /** + * + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 定位地址 + */ + private String locateAddress; + + /** + * 定位经度 + */ + private String locateLongitude; + + /** + * 定位维度 + */ + private String locateLatitude; + + /** + * 话题发表人姓名 + */ + private String userName; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicVoteDetailEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicVoteDetailEntity.java new file mode 100644 index 0000000000..837b34641a --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/YtTopicVoteDetailEntity.java @@ -0,0 +1,36 @@ +package com.epmet.modules.topic.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 2023-01-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("yt_topic_vote_detail") +public class YtTopicVoteDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 态度 - opposition(反对)support(赞成) + */ + private String attitude; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/YtTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/YtTopicService.java new file mode 100644 index 0000000000..23741a8a09 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/YtTopicService.java @@ -0,0 +1,85 @@ +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.modules.topic.entity.YtTopicEntity; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO; + +/** + * 烟台话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-01-30 + */ +public interface YtTopicService extends BaseService { + + /** + * 发布话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 16:18 + */ + void createTopic(CreateYtTopicFormDTO formDTO); + + /** + * 话题详情 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link YtTopicDetailResultDTO} + * @Author zhaoqifeng + * @Date 2023/1/30 16:39 + */ + YtTopicDetailResultDTO getTopicDetail(YtTopicDetailFormDTO formDTO); + + /** + * 话题列表 + * + * @Param tokenDto + * @Param topicPageFormDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 16:56 + */ + PageData getTopicList(TokenDto tokenDto, YtTopicPageFormDTO topicPageFormDTO); + + /** + * 话题详情评论列表 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 17:02 + */ + PageData getTopicCommentList(TokenDto tokenDto, YtTopicDetailFormDTO formDTO); + + /** + * 评论话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:05 + */ + void topicComment(TokenDto tokenDto, YtTopicCommentFormDTO formDTO); + + /** + * 话题投票 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:08 + */ + void topicVote(TokenDto tokenDto, YtTopicVoteFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 1592aa0fe7..eeda789667 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -1797,38 +1797,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); - if (!textSyncScanResult.success()) { - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); - } - } - } + // 是否已经转议题? + checkShiftedIssue(topicTurnIssueFromDTO.getTopicId()); + // 话题转议题审核:标题、建议 + scanIssueContent(topicTurnIssueFromDTO.getIssueTitle(),topicTurnIssueFromDTO.getSuggestion()); FirstTopicShiftedToIssueApplicationResultDTO result = null; //1.统一时间(群组服务 -> 议题服务) @@ -1856,6 +1828,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl issueResult = issueOpenFeignClient.topicShiftedToIssueV2(issueInfo); if (issueResult == null || !issueResult.success() || null == issueResult.getData()) { @@ -1994,6 +1969,53 @@ public class ResiTopicServiceImpl extends BaseServiceImpl result = govIssueFeignClient.checkTopicShiftIssue(topicInfoFormDTO); + if (result.success()) { + Integer issueCount = result.getData(); + if (issueCount != NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.ALREADY_SHIFT_ISSUE, ModuleConstant.ALREADY_SHIFT_ISSUE); + } + } + } + + /** + * 审核提出来 + * @param issueTitle + * @param suggestion + */ + private void scanIssueContent(String issueTitle, String suggestion) { + //话题转议题审核:标题、建议 + if (StringUtils.isNotBlank(issueTitle) || StringUtils.isNotBlank(suggestion)) { + TextScanParamDTO textScan = new TextScanParamDTO(); + //标题 + TextTaskDTO taskTitle = new TextTaskDTO(); + taskTitle.setContent(issueTitle); + taskTitle.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScan.getTasks().add(taskTitle); + //建议 + TextTaskDTO taskSuggestion = new TextTaskDTO(); + taskSuggestion.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskSuggestion.setContent(suggestion); + textScan.getTasks().add(taskSuggestion); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.SHIFT_ISSUE, issueTitle, suggestion)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + /** * @Description 工作端审核议题通过时获取一些议题相关信息 * @param param @@ -2019,7 +2041,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl implements YtTopicService { + + @Resource + private YtTopicAttachmentDao ytTopicAttachmentDao; + @Resource + private YtTopicCommentDao ytTopicCommentDao; + @Resource + private YtTopicCommentAttachmentDao ytTopicCommentAttachmentDao; + @Resource + private YtTopicVoteDetailDao ytTopicVoteDetailDao; + + /** + * 发布话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 16:18 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void createTopic(CreateYtTopicFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getTopicContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { + //话题内容和语音不能同时为空 + log.error(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); + throw new EpmetException(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); + } + //1.保存话题 + YtTopicEntity topic = ConvertUtils.sourceToTarget(formDTO, YtTopicEntity.class); + //如果只有语音,则话题内容为语音话题 + if (CollectionUtils.isNotEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getTopicContent())) { + topic.setTopicContent("语音话题"); + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo) { + String msg = "获取网格信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(formDTO.getUserId()); + if (null == userInfo) { + String msg = "获取用户信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + topic.setCustomerId(formDTO.getCustomerId()); + topic.setStatus(TopicConstant.PUBLISHMENT); + topic.setPids(gridInfo.getPids()); + topic.setUserName(userInfo.getRealName()); + baseDao.insert(topic); + + //保存图片附件 + if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ + int sort = 0; + for(String url : formDTO.getImageList()){ + YtTopicAttachmentEntity attachment = new YtTopicAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(url); + attachment.setTopicId(topic.getId()); + attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType(TopicConstant.IMAGE); + ytTopicAttachmentDao.insert(attachment); + } + } + + //保存语音附件 + if(CollectionUtils.isNotEmpty(formDTO.getVoiceList())){ + int sort = 0; + for(FileDTO file : formDTO.getVoiceList()){ + YtTopicAttachmentEntity attachment = new YtTopicAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(file.getUrl()); + attachment.setTopicId(topic.getId()); + attachment.setCreatedBy(formDTO.getUserId()); + attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType(TopicConstant.VOICE); + attachment.setDuration(file.getDuration()); + ytTopicAttachmentDao.insert(attachment); + } + } + + + + } + + /** + * 话题详情 + * + * @Param formDTO + * @Return {@link YtTopicDetailResultDTO} + * @Author zhaoqifeng + * @Date 2023/1/30 16:39 + */ + @Override + public YtTopicDetailResultDTO getTopicDetail(YtTopicDetailFormDTO formDTO) { + //1.查询话题信息 + YtTopicEntity entity = baseDao.selectById(formDTO.getTopicId()); + if(null == entity){ + log.error(ModuleConstant.NO_SUCH_TOPIC); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), ModuleConstant.NO_SUCH_TOPIC, ModuleConstant.NO_SUCH_TOPIC); + } + YtTopicDetailResultDTO result = ConvertUtils.sourceToTarget(entity, YtTopicDetailResultDTO.class); + result.setTopicId(formDTO.getTopicId()); + result.setTopicStatus(entity.getStatus()); + result.setReleaseTime(DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + result.setReleaseAddress(entity.getAddress()); + + //2.查询话题图片附件 + LambdaQueryWrapper imgWrapper = new LambdaQueryWrapper<>(); + imgWrapper.eq(YtTopicAttachmentEntity::getTopicId, formDTO.getTopicId()); + imgWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.IMAGE); + imgWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); + List imgList = ytTopicAttachmentDao.selectList(imgWrapper); + if (CollectionUtils.isNotEmpty(imgList)) { + List imageUrls = imgList.stream().map(YtTopicAttachmentEntity::getAttachmentUrl).collect(Collectors.toList()); + result.setTopicImages(imageUrls); + } + + //3.查询话题音频附件 + LambdaQueryWrapper voiceWrapper = new LambdaQueryWrapper<>(); + voiceWrapper.eq(YtTopicAttachmentEntity::getTopicId, formDTO.getTopicId()); + voiceWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.VOICE); + voiceWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); + List voiceList = ytTopicAttachmentDao.selectList(voiceWrapper); + if (CollectionUtils.isNotEmpty(voiceList)) { + List voiceUrls = voiceList.stream().map(item ->{ + FileDTO fileDTO = new FileDTO(); + fileDTO.setUrl(item.getAttachmentUrl()); + fileDTO.setDuration(item.getDuration()); + return fileDTO; + }).collect(Collectors.toList()); + result.setTopicVoices(voiceUrls); + } + + + //4.获取发布人信息 + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(entity.getCreatedBy()); + if (null == userInfo) { + String msg = "获取发布人信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + result.setReleaseUserName(userInfo.getShowName()); + result.setReleaseUserHeadPhoto(userInfo.getHeadImgUrl()); + //5.获取投票信息 + result.setOppositionCount(NumConstant.ZERO_STR); + result.setSupportCount(NumConstant.ZERO_STR); + LambdaQueryWrapper voteWrapper = new LambdaQueryWrapper<>(); + voteWrapper.eq(YtTopicVoteDetailEntity::getTopicId, formDTO.getTopicId()); + List voteList = ytTopicVoteDetailDao.selectList(voteWrapper); + if (CollectionUtils.isNotEmpty(voteList)) { + Map voteMap = voteList.stream().collect(Collectors.groupingBy(YtTopicVoteDetailEntity::getAttitude, Collectors.counting())); + if (voteMap.containsKey(TopicConstant.OPPOSITION)) { + result.setOppositionCount(String.valueOf(voteMap.get(TopicConstant.OPPOSITION))); + } + if (voteMap.containsKey(TopicConstant.SUPPORT)) { + result.setSupportCount(String.valueOf(voteMap.get(TopicConstant.SUPPORT))); + } + } + voteWrapper.eq(YtTopicVoteDetailEntity::getCreatedBy, formDTO.getUserId()); + voteList = ytTopicVoteDetailDao.selectList(voteWrapper); + if (CollectionUtils.isNotEmpty(voteList)) { + result.setVoteStatus(voteList.get(NumConstant.ZERO).getAttitude()); + } else { + result.setVoteStatus(TopicConstant.NONE); + } + + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(entity.getGridId()); + if (null != gridInfo) { + result.setGridName(gridInfo.getGridNamePath()); + } + + return result; + } + + /** + * 话题列表 + * + * @Param tokenDto + * @Param topicPageFormDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 16:56 + */ + @Override + public PageData getTopicList(TokenDto tokenDto, YtTopicPageFormDTO topicPageFormDTO) { + if (NumConstant.ONE_STR.equals(topicPageFormDTO.getSource())) { + if (StringUtils.isBlank(topicPageFormDTO.getGridId())) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo) { + String msg = "获取工作人员信息失败"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + topicPageFormDTO.setAgencyId(staffInfo.getAgencyId()); + } + } + PageMethod.startPage(topicPageFormDTO.getPageNo(), topicPageFormDTO.getPageSize()); + List list = baseDao.selectTopicList(topicPageFormDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); + if (null != userInfo) { + item.setReleaseUserName(userInfo.getShowName()); + item.setReleaseUserHeadPhoto(userInfo.getHeadImgUrl()); + } + if (tokenDto.getUserId().equals(item.getUserId())) { + item.setReleaseUserFlag("me"); + } else { + item.setReleaseUserFlag("other"); + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridNamePath()); + } + //获取附件图片 + LambdaQueryWrapper imgWrapper = new LambdaQueryWrapper<>(); + imgWrapper.eq(YtTopicAttachmentEntity::getTopicId, item.getTopicId()); + imgWrapper.eq(YtTopicAttachmentEntity::getAttachmentType, TopicConstant.IMAGE); + imgWrapper.orderByAsc(YtTopicAttachmentEntity::getSort); + imgWrapper.last("limit 3"); + List imgList = ytTopicAttachmentDao.selectList(imgWrapper); + if (CollectionUtils.isNotEmpty(imgList)) { + List imageUrls = imgList.stream().map(YtTopicAttachmentEntity::getAttachmentUrl).collect(Collectors.toList()); + item.setImageList(imageUrls); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 话题详情评论列表 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2023/1/30 17:02 + */ + @Override + public PageData getTopicCommentList(TokenDto tokenDto, YtTopicDetailFormDTO formDTO) { + PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = ytTopicCommentDao.selectCommentList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + //获取评论附件信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(YtTopicCommentAttachmentEntity::getTopicId, formDTO.getTopicId()); + List attachmentList = ytTopicCommentAttachmentDao.selectList(wrapper); + Map> map = new HashMap<>(); + if (CollectionUtils.isNotEmpty(attachmentList)) { + map = attachmentList.stream().sorted(Comparator.comparingInt(YtTopicCommentAttachmentEntity::getSort)) + .collect(Collectors.groupingBy(YtTopicCommentAttachmentEntity::getTopicCommentId, LinkedHashMap::new, Collectors.toList())); + } + Map> finalMap = map; + list.forEach(item -> { + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); + if (null != userInfo) { + item.setCommentUserName(userInfo.getShowName()); + item.setCommentUserHeadPhoto(userInfo.getHeadImgUrl()); + } + if (finalMap.containsKey(item.getCommentId())) { + List fileList = finalMap.get(item.getCommentId()).stream().map(i -> { + CommentFileDTO file = new CommentFileDTO(); + file.setName(i.getAttachmentName()); + file.setUrl(i.getAttachmentUrl()); + file.setDuration(i.getDuration()); + file.setSize(i.getAttachmentSize()); + file.setFormat(i.getAttachmentFormat()); + file.setType(i.getAttachmentType()); + return file; + }).collect(Collectors.toList()); + item.setImageList(fileList); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 评论话题 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:05 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void topicComment(TokenDto tokenDto, YtTopicCommentFormDTO formDTO) { + YtTopicCommentEntity comment = ConvertUtils.sourceToTarget(formDTO, YtTopicCommentEntity.class); + comment.setStatus(TopicConstant.PUBLISHMENT); + comment.setCustomerId(tokenDto.getCustomerId()); + ytTopicCommentDao.insert(comment); + //保存评论附件 + //图片 + if (CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + YtTopicCommentAttachmentEntity attachment = new YtTopicCommentAttachmentEntity(); + attachment.setCustomerId(tokenDto.getCustomerId()); + attachment.setTopicId(formDTO.getTopicId()); + attachment.setTopicCommentId(comment.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + ytTopicCommentAttachmentDao.insert(attachment); + }); + } + } + + /** + * 话题投票 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2023/1/30 17:08 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void topicVote(TokenDto tokenDto, YtTopicVoteFormDTO formDTO) { + YtTopicVoteDetailEntity entity = ConvertUtils.sourceToTarget(formDTO, YtTopicVoteDetailEntity.class); + entity.setCustomerId(tokenDto.getCustomerId()); + ytTopicVoteDetailDao.insert(entity); + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__yt_topic.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__yt_topic.sql new file mode 100644 index 0000000000..d73eeef70f --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__yt_topic.sql @@ -0,0 +1,94 @@ +CREATE TABLE `yt_topic` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID', + `PIDS` varchar(255) DEFAULT NULL COMMENT '网格所有上级组织ID', + `TOPIC_CONTENT` text COMMENT '话题内容', + `STATUS` varchar(32) NOT NULL COMMENT '话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed)', + `CLOSED_STATUS` varchar(32) DEFAULT NULL COMMENT '关闭状态:已解决 resolved,未解决 unresolved', + `PROVINCE` varchar(32) DEFAULT NULL COMMENT '省', + `CITY` varchar(32) DEFAULT NULL COMMENT '市', + `AREA` varchar(32) DEFAULT NULL COMMENT '区 ', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '维度', + `LOCATE_ADDRESS` varchar(255) DEFAULT NULL COMMENT '定位地址', + `LOCATE_LONGITUDE` varchar(32) DEFAULT NULL COMMENT '定位经度', + `LOCATE_LATITUDE` varchar(32) DEFAULT NULL COMMENT '定位维度', + `USER_NAME` varchar(20) DEFAULT NULL COMMENT '话题发表人姓名', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人,发布人Id来源于user', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题信息表'; +CREATE TABLE `yt_topic_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id,关联resi_topic的id', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_topic_id` (`TOPIC_ID`) USING BTREE COMMENT '话题主键' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题附件表'; +CREATE TABLE `yt_topic_comment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id,来自resi_topic', + `COMMENT_CONTENT` varchar(300) DEFAULT NULL, + `STATUS` varchar(32) DEFAULT NULL COMMENT '评论状态:讨论中:discussing;已屏蔽 :hidden', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人,评论人Id,来自user', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题评论表'; +CREATE TABLE `yt_topic_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id', + `TOPIC_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台话题评论附件表'; +CREATE TABLE `yt_topic_vote_detail` ( + `ID` varchar(32) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(32) NOT NULL COMMENT '话题ID', + `ATTITUDE` varchar(32) NOT NULL COMMENT '态度 - opposition(反对)support(赞成)', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `idx_topic_id` (`TOPIC_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题表决记录表'; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index 2610b429eb..c5ebbc64ea 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -400,7 +400,10 @@ groupp.ID AS groupId, IFNULL(groupp.GRID_ID,'') AS gridId, IFNULL(groupp.CUSTOMER_ID,'') AS customerId, - topic.CREATED_BY AS topicAuthorId + topic.CREATED_BY AS topicAuthorId, + topic.LOCATE_ADDRESS as locateAddress, + topic.LOCATE_LONGITUDE as locateLongitude, + topic.LOCATE_DIMENSION as locateDimension FROM RESI_TOPIC topic INNER JOIN RESI_GROUP groupp ON topic.GROUP_ID = groupp.ID diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicAttachmentDao.xml new file mode 100644 index 0000000000..1ce30b7819 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicAttachmentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentAttachmentDao.xml new file mode 100644 index 0000000000..7046356677 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentAttachmentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentDao.xml new file mode 100644 index 0000000000..8751ea8bb9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicCommentDao.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicDao.xml new file mode 100644 index 0000000000..1d922ef955 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicDao.xml @@ -0,0 +1,36 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicVoteDetailDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicVoteDetailDao.xml new file mode 100644 index 0000000000..81277dd963 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/YtTopicVoteDetailDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java index 84b0d8f5e6..22e0323ed6 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,8 +14,9 @@ import java.io.Serializable; @Data public class IssueDetailFormDTO implements Serializable { private static final long serialVersionUID = 4859779755214503489L; - - @NotBlank(message = "议题id不能为空") + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "议题id不能为空",groups = AddUserShowGroup.class) private String issueId; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java index 881b45bb13..fe7136134b 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java @@ -36,7 +36,7 @@ public class IssueController { @PostMapping(value = "/detail") // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) public Result detail(@LoginUser TokenDto tokenDto,@RequestBody IssueDetailFormDTO issueDetail){ - ValidatorUtils.validateEntity(issueDetail); + ValidatorUtils.validateEntity(issueDetail,IssueDetailFormDTO.AddUserShowGroup.class); return new Result().ok(issueService.detail(tokenDto,issueDetail)); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java index 5b455c43a4..8c6da67576 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java @@ -1,14 +1,13 @@ package com.epmet.modules.person.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.modules.person.service.BadgeService; -import com.epmet.resi.mine.dto.from.BadgeListFormDTO; -import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -37,9 +36,11 @@ public class BadgeController { * @date 2020/11/3 4:11 下午 */ @PostMapping("list") - public Result> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){ - ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class); - return new Result>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO)); + // public Result> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){ + public Result> getBadgeList(@LoginUser TokenDto tokenDto){ + // ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class); + // return new Result>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO)); + return new Result>().ok(badgeService.getBadgeList(tokenDto.getCustomerId(),tokenDto.getUserId())); } /** @@ -49,9 +50,11 @@ public class BadgeController { * @date 2020/11/3 4:28 下午 */ @PostMapping("operlist") - public Result> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){ - ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class); - return new Result>().ok(badgeService.getOperList(tokenDto,operListFormDTO)); + // public Result> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){ + public Result> getOperList(@LoginUser TokenDto tokenDto){ + // ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class); + // return new Result>().ok(badgeService.getOperList(tokenDto,operListFormDTO)); + return new Result>().ok(badgeService.getOperList(tokenDto.getCustomerId(),tokenDto.getUserId())); } /** @@ -61,8 +64,10 @@ public class BadgeController { * @author zxc * @date 2020/11/4 11:16 上午 */ + @NoRepeatSubmit @PostMapping("certification/add") public Result certificationAdd(@LoginUser TokenDto tokenDto,@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + certificationAddFormDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); return badgeService.certificationAdd(tokenDto,certificationAddFormDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java index b8e04ded39..7703b41e50 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java @@ -4,8 +4,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.OpenedOrClosedFormDTO; -import com.epmet.resi.mine.dto.from.BadgeListFormDTO; -import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO; @@ -23,7 +21,8 @@ public interface BadgeService { * @author zxc * @date 2020/11/3 4:11 下午 */ - List getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO); + // List getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO); + List getBadgeList(String customerId,String userId); /** * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) @@ -31,7 +30,8 @@ public interface BadgeService { * @author zxc * @date 2020/11/3 4:28 下午 */ - List getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO); + // List getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO); + List getOperList(String customerId,String userId); /** * @Description 个人中心-提交徽章认证 diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java index 0c1a3239a4..9f98136a82 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java @@ -12,8 +12,6 @@ import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.person.service.BadgeService; -import com.epmet.resi.mine.dto.from.BadgeListFormDTO; -import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO; import lombok.extern.slf4j.Slf4j; @@ -41,10 +39,10 @@ public class BadgeServiceImpl implements BadgeService { * @date 2020/11/3 4:11 下午 */ @Override - public List getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO) { + public List getBadgeList(String customerId,String userId) { UserBadgeListFormDTO form = new UserBadgeListFormDTO(); - form.setCustomerId(badgeListFormDTO.getCustomerId()); - form.setUserId(tokenDto.getUserId()); + form.setCustomerId(customerId); + form.setUserId(userId); Result> listResult = epmetUserOpenFeignClient.selectBadgeList(form); if (!listResult.success()){ throw new RenException("获取徽章点亮列表失败......"); @@ -63,10 +61,10 @@ public class BadgeServiceImpl implements BadgeService { * @date 2020/11/3 4:28 下午 */ @Override - public List getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO) { + public List getOperList(String customerId,String userId) { UserOperListFormDTO userOperListFormDTO = new UserOperListFormDTO(); - userOperListFormDTO.setCustomerId(operListFormDTO.getCustomerId()); - userOperListFormDTO.setUserId(tokenDto.getUserId()); + userOperListFormDTO.setCustomerId(customerId); + userOperListFormDTO.setUserId(userId); Result> listResult = epmetUserOpenFeignClient.selectOperList(userOperListFormDTO); if (!listResult.success()){ throw new RenException("获取徽章列表失败......"); @@ -87,7 +85,6 @@ public class BadgeServiceImpl implements BadgeService { */ @Override public Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) { - certificationAddFormDTO.setUserId(tokenDto.getUserId()); Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO); return result; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index a980778c64..cb24ca9f41 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -114,17 +114,20 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); userResiInfoFormDTO.setCustomerId(fromDto.getCustomerId()); userResiInfoFormDTO.setUserId(fromDto.getUserId()); - UserResiInfoResultDTO userResiInfoResult = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO).getData(); - if (null != userResiInfoResult) { - PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult, - PartymemberInfoDTO.class); - partyMemberInfo.setId(""); - partyMemberInfo.setMobile(userResiInfoResult.getRegMobile()); - partyMemberInfo.setEstate(userResiInfoResult.getDistrict()); - partyMemberInfo.setBuilding(userResiInfoResult.getBuildingAddress()); - result.setPartyMemberInfo(partyMemberInfo); + Result res = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); + if (res.success() && null != res) { + UserResiInfoResultDTO userResiInfoResult = res.getData(); + if (null != userResiInfoResult) { + PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult, + PartymemberInfoDTO.class); + partyMemberInfo.setId(""); + partyMemberInfo.setMobile(userResiInfoResult.getRegMobile()); + partyMemberInfo.setEstate(userResiInfoResult.getDistrict()); + partyMemberInfo.setBuilding(userResiInfoResult.getBuildingAddress()); + partyMemberInfo.setIdCard(userResiInfoResult.getIdNum()); + result.setPartyMemberInfo(partyMemberInfo); + } } - } // 将访问行为存入热心居民申请行为记录表 String visitId = saveOrUpdateVisit(null, fromDto, PartyMemberConstant.OPERATE_INITIALIZE); @@ -502,7 +505,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService List failedReason = new ArrayList<>(); if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()&& !("null").equals(fromDTO.getAutoId())) { PartymemberConfirmAutoEntity autoEntity = partymemberConfirmAutoService.selectById(fromDTO.getAutoId()); - resultDTO.setCertifyTime(autoEntity.getContrastTime().getTime()); + resultDTO.setCertifyTime(autoEntity.getCreatedTime().getTime()); if (PartyMemberConstant.SAME.equals(autoEntity.getMobileResult())) { failedReason.add("手机号匹配"); } else { diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index 5d461dbe41..204ba9650b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java @@ -36,7 +36,7 @@ public interface BadgeConstant { String GET_BADGE_NAME_FAILURE = "获取徽章名称失败......"; - String MESSAGE_CONTENT = "您有一条徽章认证消,,%s申请认证%s,请审核"; + String MESSAGE_CONTENT = "您有一条徽章认证消息,,%s申请认证%s,请审核"; String READ_FLAG = "unread"; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ChangeWelfareDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ChangeWelfareDTO.java index 02ce0b34c8..e3fbf74e1f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ChangeWelfareDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ChangeWelfareDTO.java @@ -1,7 +1,11 @@ package com.epmet.dto; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; @@ -16,15 +20,19 @@ import java.util.Date; public class ChangeWelfareDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AddUserShowGroup extends CustomerClientShowGroup {} + public interface RemoveWelfareShowGroup extends CustomerClientShowGroup {} /** * 主键 */ + @NotBlank(message = "id不能为空",groups = RemoveWelfareShowGroup.class) private String id; /** * epmet用户主键 */ + @NotBlank(message = "userId不能为空",groups = AddGroup.class) private String userId; /** @@ -65,6 +73,7 @@ public class ChangeWelfareDTO implements Serializable { /** * 加入原因 */ + @Length(max = 250,message = "添加原因最多输入250字",groups = AddUserShowGroup.class) private String joinReason; /** @@ -75,6 +84,7 @@ public class ChangeWelfareDTO implements Serializable { /** * 移除原因 */ + @Length(max = 250,message = "移除原因最多输入250字",groups = RemoveWelfareShowGroup.class) private String removeReason; /** @@ -116,4 +126,14 @@ public class ChangeWelfareDTO implements Serializable { * 是否享受福利,1是 0否 空是 */ private String isWelfare; + + /** + * 福利发放标识:1:已发放;0:未发放 + */ + private Integer grantFlag; + /** + * 福利类别 + */ + @Length(max = 100,message = "福利类别最多输入100字",groups = AddUserShowGroup.class) + private String categoryName; } 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 d4d3cbe812..bf93b3b225 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 @@ -21,6 +21,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -45,12 +46,12 @@ public class IcResiUserDTO implements Serializable { private String customerId; /** - * + * */ private String agencyId; /** - * + * */ private String pids; @@ -505,6 +506,12 @@ public class IcResiUserDTO implements Serializable { */ private Date updatedTime; + // 租房审核数据同步使用 + /** + * 疫苗接种记录 + */ + private List vaccineLog; + /** * 预留字段1 */ @@ -555,4 +562,4 @@ public class IcResiUserDTO implements Serializable { */ private String field10; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/VaccineLogDetailDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/VaccineLogDetailDTO.java new file mode 100644 index 0000000000..90757a0d66 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/VaccineLogDetailDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 疫苗接种记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Data +public class VaccineLogDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 接种时间 + */ + private String vacTime; + /** + * 接种地点 + */ + private String vacSite; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index b87f03d8d7..5fe8f73f31 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -110,6 +109,9 @@ public class AddIcNatFormDTO implements Serializable { private String customerId; private String staffId; private String client; - + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java index 39ca1de27d..9bf7351837 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java @@ -1,8 +1,11 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * @description: @@ -11,9 +14,15 @@ import javax.validation.constraints.Min; */ @Data public class AdviceListFormDTO { + /** + * 工作端pc调用此接口,校验参数 + */ + public interface WorkPcGroup extends CustomerClientShowGroup { + } /** * 客户id 不填查询所有 */ + @NotBlank(message = "customerId不能为空",groups = WorkPcGroup.class) private String customerId; /** @@ -21,6 +30,11 @@ public class AdviceListFormDTO { */ private String agencyId; + /** + * 网格id + */ + private String gridId; + /** * 是否被回复,0未回复,1回复, 传空查询所有 */ @@ -44,12 +58,14 @@ public class AdviceListFormDTO { /** * 页码 */ + @NotNull(message = "pageNo不能为空",groups = WorkPcGroup.class) @Min(1) - private int pageNo; + private Integer pageNo; /** * 页大小 */ + @NotNull(message = "pageSize不能为空",groups = WorkPcGroup.class) @Min(1) - private int pageSize; + private Integer pageSize; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java index c3748fe49f..9803eb3c25 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java @@ -20,4 +20,9 @@ public class BadgeAuditFormDTO implements Serializable { @NotBlank(message = "审核结果不能为空") private String auditStatus; private String auditRemark; + + /** + * tokenDto.getUserId + */ + private String currentUserId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java index da021d64f0..85ed907b4a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java @@ -65,4 +65,20 @@ public class CertificationAddFormDTO implements Serializable { */ private String code; + /** + * 是否需要发送站内信: + * 您有一条徽章认证消息,,%s申请认证%s,请审核 + * true:发送 + * false:不发送 + * 微信小程序发送 + * 烟台钉钉自动通过,默认false不发送 + */ + private Boolean sendMsgFlag; + + /** + * 自动通过标识 + * true:自动通过,目前只有烟台这么搞 + */ + private Boolean autoPassFlag; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java index 65f289cd46..4ae7ae8b61 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java @@ -183,7 +183,7 @@ public class IcTripReportFormDTO implements Serializable { /** * 交通方式,来源字典表(traffic_type) */ - @NotBlank(message = "返回方式不能为空", groups = {PcAddRequired.class, ResiUserRequired.class}) + // @NotBlank(message = "返回方式不能为空", groups = {PcAddRequired.class, ResiUserRequired.class}) private String trafficType; /** * 其他返回方式,交通方式为其他时此列需要有值 @@ -192,7 +192,7 @@ public class IcTripReportFormDTO implements Serializable { /** * 来源地详细信息 source_address字段的说明 */ - @NotBlank(message = "来自地区不能为空", groups = {PcAddRequired.class, ResiUserRequired.class}) + // @NotBlank(message = "来自地区不能为空", groups = {PcAddRequired.class, ResiUserRequired.class}) private String sourceDetailAddress; /** * 疫苗接种针次 (0针 1针 2针 3针)【小寨子】 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InternalDelIcResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InternalDelIcResiUserFormDTO.java new file mode 100644 index 0000000000..6573b9f511 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InternalDelIcResiUserFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.enums.IcFormCodeEnum; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2023/1/11 15:26 + */ +@Data +public class InternalDelIcResiUserFormDTO { + + public interface DefaultGroup { + } + + private List icResiUserIds; + + private String formCode = IcFormCodeEnum.RESI_BASE_INFO.getCode(); + + @NotBlank(message = "token获取的customerId不能为空", groups = DefaultGroup.class) + private String customerId; + + @NotBlank(message = "token获取的userId不能为空", groups = DefaultGroup.class) + private String currentStaffId; + + @NotBlank(message = "agencyId不能为空", groups = DefaultGroup.class) + private String agencyId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageRegUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageRegUserFormDTO.java new file mode 100644 index 0000000000..fa4fb4878c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageRegUserFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 来源于烟台需求,pc端新增菜单:用户完善信息列表 + * @Author yzm + * @Date 2023/1/31 14:37 + */ +@Data +public class PageRegUserFormDTO extends PageFormDTO implements Serializable { + private String agencyId; + private String gridId; + private String regStartTime; + private String regEndTime; + private String name; + + /** + * 查询详情时也调用此接口 + */ + private String userId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java index be89dc898c..f3964d04ae 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java @@ -52,5 +52,4 @@ public class RentTenantFormDTO implements Serializable { * 合同结束日期 */ private String endDate; - } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java index f353919247..a602634f6f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java @@ -24,4 +24,15 @@ public class ReplyAdviceFormDTO implements Serializable { private List govImgList; private String govContent; + + /** + * 回复人id + * 工作端回复:customer_staff.user_id + * 运营端回复:oper_user.user_id + */ + private String replyUserId; + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePieFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePieFormDTO.java new file mode 100644 index 0000000000..f1374ada46 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePieFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form;/** + * @author ZhaoQiFeng + * @date 2023/2/2 + * @apiNote + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2023/2/2 15:20 + */ +@Data +public class VaccinePieFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + private String customerId; + private String agencyId; + private String gridId; + /** + * 接种次数 + */ + private String vaccineCount; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/patrol/PatrolQueryFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/patrol/PatrolQueryFormDTO.java index 4cd3988831..9df2c0c337 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/patrol/PatrolQueryFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/patrol/PatrolQueryFormDTO.java @@ -26,4 +26,7 @@ public class PatrolQueryFormDTO extends PageFormDTO implements Serializable { */ private String id; + private String startTime; + private String endTime; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java index 279a66393b..20964eceb4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListDTO.java @@ -1,9 +1,11 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Date; /** * @Description @@ -17,4 +19,11 @@ public class NatListDTO implements Serializable { private String testTime; private String address; private String result; + //01.11,增加以下两个参数 + private String idNatId; + /** + * 采样时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date sampleTime; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java index ce558ef5c5..b2c78f0cc3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java @@ -24,11 +24,12 @@ public class PatrolRoutineWorkResult implements Serializable { private String gridId; private String gridCode; private String gridName; - + private String pids; private String title; private String userId; - + private String staffName; + private String mobile; /** * 一级工作类型 code */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java index 5fb44fd6af..59ffdc648c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * 用户基础信息 返回值 @@ -73,4 +76,19 @@ public class ResiUserBaseInfoResultDTO implements Serializable { * 头像(目前来源于微信,后续系统顾客支持上传头像) */ private String headImgUrl; + + /** + * 注册时间 + * user_Base_info.CREATED_TIME + * register_relation.CREATED_TIME + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date regTime; + + /** + * 用户完善信息列表返回 + */ + private String gridId; + private String agencyId; + private String showIdNum; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java index a4be7e8745..4dc667ec51 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java @@ -59,4 +59,8 @@ public class UserResiInfoResultDTO implements Serializable { private String nickName; private String realName; + /** + * 身份证号 + */ + private String idNum; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinePieResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinePieResultDTO.java new file mode 100644 index 0000000000..59599b5261 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinePieResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result;/** + * @author ZhaoQiFeng + * @date 2023/2/2 + * @apiNote + */ + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2023/2/2 15:20 + */ +@Data +public class VaccinePieResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + private String code; + private String value; + private String label; + private String ratio; + private String remark; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index f8edd1a77e..c80eab326e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -673,6 +673,11 @@ public interface EpmetUserOpenFeignClient { @GetMapping(value = "/epmetuser/user/queryUserClient/{userId}") Result queryUserClient(@PathVariable("userId") String userId); + /** + * @V23 + * @param formDTO + * @return 查询每个楼栋,18类别下,居民数量 + */ @PostMapping("/epmetuser/icresiuser/categorycount") Result>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO); @@ -685,19 +690,24 @@ public interface EpmetUserOpenFeignClient { /** * 根据身份证号||ic_resi_user.id找居民端小程序里的人 - * + * @V23 * @param formDTO * @return */ @PostMapping(value = "/epmetuser/user/findepmetuser") Result findEpmetUser(@RequestBody ResiUserFormDTO formDTO); + /** + * @V23 + * @param icResiUserId + * @return 查询当前居民的姓名,和房屋id + */ @GetMapping("/epmetuser/icresiuser/findfamilymem/{icResiUserId}") Result findFamilyMem(@PathVariable("icResiUserId") String icResiUserId); /** * 查找居民端小程序里的用户对应ic里的人。以及家属们 - * + * @V23 * @param formDTO * @return */ @@ -716,17 +726,19 @@ public interface EpmetUserOpenFeignClient { Result> getPatrolRoutineWorkListV2(@RequestBody PatrolQueryFormDTO patrolQueryFormDTO); /** + * @V23 * 获取ic_resi_user * @param icResiUserId - * @return + * @return 根据居民id,查询居民主表信息 */ @PostMapping(value = "/epmetuser/icresiuser/geticresiuser/{icResiUserId}") Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId); /** + * @V23 * 获取ic_resi_user * @param icResiUserIdList - * @return + * @return 根据居民id,查询居民主表信息(批量查询) */ @PostMapping(value = "/epmetuser/icresiuser/list-icresiuser") Result> getListIcResiUserDTO(@RequestBody List icResiUserIdList); @@ -748,6 +760,7 @@ public interface EpmetUserOpenFeignClient { * @param ids * @author zxc * @date 2022/3/2 10:32 上午 + * @V23 */ @PostMapping("/epmetuser/icresiuser/getexistuserbyhouseids") Result> getExistUserByHouseIds(@RequestBody List ids); @@ -759,6 +772,7 @@ public interface EpmetUserOpenFeignClient { * @return com.epmet.commons.tools.utils.Result * @author zhy * @date 2022/4/26 10:48 + * @V23 */ @PostMapping("/epmetuser/icresiuser/rent/updateimage") Result updateImage(@RequestBody RentTenantFormDTO formDTO); @@ -770,10 +784,17 @@ public interface EpmetUserOpenFeignClient { * @return com.epmet.commons.tools.utils.Result * @author zhy * @date 2022/4/26 10:48 + * @V23 */ @PostMapping("/epmetuser/icresiuser/rent/getrentresiuserinfo") Result getRentResiUserInfo(@RequestBody RentTenantDataFormDTO formDTO); + /** + * 【人房】房屋、居民统计列表数据 + * @param userDTO + * @return + * @V23 + */ @PostMapping("/epmetuser/icresiuser/userchartlist") Result> userChartList(@RequestBody UserChartFormDTO userDTO); @@ -781,6 +802,7 @@ public interface EpmetUserOpenFeignClient { * desc:条件获取房屋成员信息 * @param formDTO * @return + * @V23 */ @PostMapping("/epmetuser/icresiuser/getResiUserGroupHomeId") Result> getHouseMemberList(@RequestBody RentTenantDataFormDTO formDTO); @@ -789,6 +811,7 @@ public interface EpmetUserOpenFeignClient { * desc:更新居民所属 eg:所属网格等等 * @param formDTO * @return + * @V23 */ @PostMapping("/epmetuser/icresiuser/changeIcResiUserBelongTo") Result changeIcResiUserBelongTo(@RequestBody IcUserBelongToChangedFormDTO formDTO); @@ -797,6 +820,7 @@ public interface EpmetUserOpenFeignClient { * 使用身份证号查询家属信息 * @param idCard * @return + * @V23 */ @GetMapping("/epmetuser/icresiuser/findFamilyMemByIdCard/{id-card}") Result findFamilyMemByIdCard(@PathVariable("id-card") String idCard); @@ -805,6 +829,7 @@ public interface EpmetUserOpenFeignClient { * 身份证号查询居民信息 * @param idCard * @return + * @V23 */ @PostMapping("/epmetuser/icresiuser/getByResiIdCard/{idcard}") Result getByResiIdCard(@PathVariable("idcard") String idCard); @@ -814,6 +839,7 @@ public interface EpmetUserOpenFeignClient { * * @param idCard * @return + * @V23 */ @PostMapping("/epmetuser/icresiuser/getAllUserIds") Result> getAllUserIds(@RequestParam("idcard") String idCard, @RequestParam("customerId") String customerId); @@ -836,24 +862,51 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/userresiinfo/getStaffAndResi") Result> getStaffAndResi(@RequestBody List userIds); + /** + * 党员管理,同步到居民信息 + * @V23 + * @param formDTO + * @return + */ @PostMapping("/epmetuser/icresiuser/icPartyMemberSync") Result icPartyMemberSync(@RequestBody IcPartyMemberDTO formDTO); + /** + * icVolunteerDataExtractionTask + * @param customerId + * @return 志愿者数据抽取 + * @V23 + */ @PostMapping("/epmetuser/icVolunteerPoly/volunteerDataExtraction/{customerId}") Result volunteerDataExtraction(@PathVariable("customerId") String customerId); + /** + * 获取用户绑定的房屋信息 + * @return + */ @PostMapping("/epmetuser/myHome/homeInfo") Result getHomeInfo(); + /** + * 获取居民信息里的志愿者 + * @V23 + * @param formDTO + * @return + */ @PostMapping("/epmetuser/icresiuser/getVolunteerList") Result> getVolunteerList(@RequestBody IcResiUserDTO formDTO); + /** + * @param icUserId + * @return 获取居民信息对应的居民端用户ID + * @V23 + */ @PostMapping("/epmetuser/icresiuser/getUserId/{icUserId}") Result> getUserId(@PathVariable("icUserId") String icUserId); /** * 获取录入居民的数量 - * + * @V23 * @Param formDTO * @Return {@link Result>} * @Author zhaoqifeng @@ -864,7 +917,7 @@ public interface EpmetUserOpenFeignClient { /** * desc: 同步数据,房内居民数量 类别统计数据量等只用客户id当条件 - * + * @V23 * @param customerId * @return com.epmet.commons.tools.utils.Result * @author LiuJanJun @@ -899,10 +952,16 @@ public interface EpmetUserOpenFeignClient { * 居民列表,非动态 * @param input * @return + * @V23 */ @PostMapping("/epmetuser/icresiuser/nonDynamic/listResi") Result> listResiNonDynamic(@RequestBody IcResiPageNonDynamicFormDTO input); + /** + * icUpdateYlfnTask + * @V23 + * @return 判定是否是育龄妇女 + */ @PostMapping("/epmetuser/icresiuser/updateYlfn") Result updateYlfn(); @@ -956,6 +1015,11 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/dataSyncConfig/vaccineInfoScanTask") Result vaccineInfoScanTask(@RequestBody DataSyncTaskParam formDTO); + /** + * @V23 + * @param formDTO + * @return + */ @PostMapping("/epmetuser/icresiuser/rhzkList") Result> renHuCondition(@RequestBody RHZKStatisticsFormDTO formDTO); diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 4583c58a72..19cae9270c 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -329,7 +329,7 @@ true - 192.168.10.165:9876 + 192.168.10.161:9876 true diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index eace8b90b0..7f58178ffe 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -152,7 +152,8 @@ public class BadgeController { @NoRepeatSubmit public Result audit(@LoginUser TokenDto tokenDto, @RequestBody BadgeAuditFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - badgeService.audit(tokenDto, formDTO); + formDTO.setCurrentUserId(tokenDto.getUserId()); + badgeService.audit(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeWelfareController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeWelfareController.java index 671c4c8681..730347fabc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeWelfareController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeWelfareController.java @@ -70,7 +70,7 @@ public class ChangeWelfareController { @PostMapping("save") public Result save(@RequestBody ChangeWelfareDTO dto){ //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class,ChangeWelfareDTO.AddUserShowGroup.class); return changeWelfareService.save(dto); } @@ -78,7 +78,7 @@ public class ChangeWelfareController { @PostMapping("update") public Result update(@RequestBody ChangeWelfareDTO dto){ //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class,ChangeWelfareDTO.AddUserShowGroup.class); changeWelfareService.update(dto); return new Result(); } @@ -108,6 +108,7 @@ public class ChangeWelfareController { @NoRepeatSubmit @PostMapping("removeWelfare") public Result removeWelfare(@RequestBody ChangeWelfareDTO dto){ + ValidatorUtils.validateEntity(dto,ChangeWelfareDTO.RemoveWelfareShowGroup.class); return changeWelfareService.removeWelfare(dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java index b841e4b6af..db0fa3b6c0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java @@ -23,9 +23,12 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.EpidemicPreventionFormDTO; +import com.epmet.dto.form.VaccinePieFormDTO; import com.epmet.dto.result.EpidemicPreventionInfoDTO; import com.epmet.dto.result.EpidemicPreventionResultDTO; +import com.epmet.dto.result.VaccinePieResultDTO; import com.epmet.service.IcResiUserService; +import com.epmet.service.IcVaccineService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -35,6 +38,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.List; /** @@ -50,6 +54,8 @@ public class IcEpidemicPreventionController{ @Resource private IcResiUserService icResiUserService; + @Resource + private IcVaccineService icVaccineService; /** @@ -99,6 +105,12 @@ public class IcEpidemicPreventionController{ return new Result().ok(result); } + /** + * 居民防疫信息-点击查看 + * @param tokenDto + * @param formDTO + * @return + */ @PostMapping("info") public Result info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -106,4 +118,8 @@ public class IcEpidemicPreventionController{ return new Result().ok(result); } + @PostMapping("vaccinePie") + public Result> getVaccinePie(@LoginUser TokenDto tokenDto, @RequestBody VaccinePieFormDTO formDTO) { + return new Result>().ok(icVaccineService.getVaccinePie(tokenDto, formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 512a43f7e9..b85f409d2b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -92,7 +92,8 @@ public class IcNatController implements ResultDataResolver { ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); - formDTO.setClient(tokenDto.getClient()); + // formDTO.setClient(tokenDto.getClient()); + formDTO.setApp(tokenDto.getApp()); icNucleinService.add(formDTO); return new Result(); } 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 298ff6f65e..324ee779fb 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 @@ -225,7 +225,32 @@ public class IcResiUserController implements ResultDataResolver { return new Result(); } + /** + * 该接口供开发人员,手动调用 + * 项目上经常要求删除某个社区的人房数据, 索性写一个接口。供开发人员调用 + * @param tokenDto + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("delete-interal") + public Result deleteInternal(@LoginUser TokenDto tokenDto, @RequestBody InternalDelIcResiUserFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, InternalDelIcResiUserFormDTO.DefaultGroup.class); + icResiUserService.deleteInternal(formDTO); + //推送MQ事件 + IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg(); + mqMsg.setCustomerId(tokenDto.getCustomerId()); + // mqMsg.setIcResiUser(userId); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.IC_RESI_USER_DEL); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + log.error(String.format("!!!!!当前组织下的居民已删除agencyId:%s",formDTO.getAgencyId())); + return new Result(); + } /** * @Author sun * @Description 党建互联平台--保存居民信息 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java index 83b232bec7..22aa867f4b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java @@ -186,7 +186,8 @@ public class IcTripReportRecordController implements ResultDataResolver { //磐石客户 if(StrConstant.PS_CUSTOMER_ID.equals(formDTO.getCustomerId())){ ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PsAdd.class); - }else { + }else if(StrConstant.XIAOZHAIZI_CUSTOMER_ID.equals(formDTO.getCustomerId())) { + //小寨子客户id ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.XzzAdd.class); } //校验参数 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java index d004630d41..4e65a25e80 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java @@ -120,4 +120,10 @@ public class PatrolRoutineWorkController { return new Result().ok(gridUserWorkService.detail(formDTO)); } + @PostMapping("getdetail") + public Result getDetail(@LoginUser TokenDto tokenDto, @RequestBody GridMemberRoutineWorkFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(gridUserWorkService.detail(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 8ad9e5da00..885099e001 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -17,8 +17,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -115,9 +118,11 @@ public class UserAdviceController { * @Date 2020/11/10 9:34 */ @PostMapping("replyadvice") - public Result replyAdvice(@RequestBody ReplyAdviceFormDTO dto) { + public Result replyAdvice(@LoginUser TokenDto tokenDto,@RequestBody ReplyAdviceFormDTO dto) { + dto.setReplyUserId(tokenDto.getUserId()); + dto.setApp(tokenDto.getApp()); ValidatorUtils.validateEntity(dto); - userAdviceService.replyAdvice(dto, loginUserUtil.getLoginUserId()); + userAdviceService.replyAdvice(dto); return new Result(); } @@ -145,8 +150,11 @@ public class UserAdviceController { * @Date 2020/11/10 9:32 */ @PostMapping("advicelist") - public Result> adviceList(@RequestBody AdviceListFormDTO dto) { - ValidatorUtils.validateEntity(dto); + public Result> adviceList(@LoginUser TokenDto tokenDto, @RequestBody AdviceListFormDTO dto) { + if (AppClientConstant.APP_GOV.equals(tokenDto.getApp())) { + //工作端调用,校验参数 + ValidatorUtils.validateEntity(dto, AdviceListFormDTO.WorkPcGroup.class); + } //校验时间 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index e4ad4a63b0..637da83ce0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -56,6 +57,27 @@ public class UserBadgeController { */ @PostMapping("authbadgerecord") public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + //发送微信站内信 + certificationAddFormDTO.setSendMsgFlag(true); + certificationAddFormDTO.setAutoPassFlag(false); + ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); + return userBadgeService.authBadgeRecord(certificationAddFormDTO); + } + + /** + * 烟台钉钉居民端应用 + * + * @param tokenDto + * @param certificationAddFormDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("certification/add-autopass") + public Result certificationAddAutoPass(@LoginUser TokenDto tokenDto, @RequestBody CertificationAddFormDTO certificationAddFormDTO) { + certificationAddFormDTO.setUserId(tokenDto.getUserId()); + certificationAddFormDTO.setSendMsgFlag(false); + // 是否自动通过 + certificationAddFormDTO.setAutoPassFlag(true); ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); return userBadgeService.authBadgeRecord(certificationAddFormDTO); } @@ -82,6 +104,7 @@ public class UserBadgeController { */ @PostMapping("certification/detail") public Result certificationDetail(@LoginUser TokenDto tokenDto,@RequestBody CertificationDetailFormDTO certificationDetailFormDTO){ + certificationDetailFormDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(certificationDetailFormDTO); return new Result().ok(userBadgeService.certificationDetail(tokenDto,certificationDetailFormDTO)); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index edd488e9e4..252195a076 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -18,6 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; @@ -30,10 +32,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; -import com.epmet.dto.form.CommonUserIdFormDTO; -import com.epmet.dto.form.DingLoginResiFormDTO; -import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.VolunteerRegResiFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.excel.UserBaseInfoExcel; @@ -238,5 +237,16 @@ public class UserBaseInfoController { public Result dingResiLogin(@RequestBody DingLoginResiFormDTO formDTO){ return new Result().ok(userBaseInfoService.dingResiLogin(formDTO)); } + + /** + * 来源于烟台需求,pc端新增菜单:用户完善信息列表 + * @return + */ + @MaskResponse(fieldNames = { "showIdNum"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD }) + @PostMapping("page-reguser") + public Result> pageRegUser(@RequestBody PageRegUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + return new Result>().ok(userBaseInfoService.pageRegUser(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java index 0c04b9a1fb..0d4b03fe38 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.IcResiRentContractInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 居民租房信息 @@ -12,5 +13,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcResiRentContractInfoDao extends BaseDao { - -} \ No newline at end of file + + IcResiRentContractInfoEntity selectDetailByUserId(@Param("userId") String userId); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java index 54da37af06..ec6a1e07b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java @@ -6,9 +6,11 @@ import com.epmet.dto.IcVaccineDTO; import com.epmet.dto.YTVaccineListDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.form.VaccineListFormDTO; +import com.epmet.dto.form.VaccinePieFormDTO; import com.epmet.dto.result.IcVaccineListResultDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.RelationAndNatResultDTO; +import com.epmet.dto.result.VaccinePieResultDTO; import com.epmet.entity.IcVaccineEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -87,4 +89,10 @@ public interface IcVaccineDao extends BaseDao { */ List getExistVaccine(@Param("list")List list); + void deleteByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId); + + List setDeleteByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId); + + List getVaccinePieData(VaccinePieFormDTO formDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java index 6d087a1055..f35d872d7c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java @@ -5,6 +5,8 @@ import com.epmet.entity.IcVaccineRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 疫苗接种记录关系表 * @@ -17,5 +19,11 @@ public interface IcVaccineRelationDao extends BaseDao { void updateRelationInfoByVaccineId(IcVaccineRelationEntity icVaccineRelationEntity); + /** + * 根据ID删除数据 + * @param delList + */ + void deleteByIdList(@Param("delList")List delList); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index 3fd6a4f205..02409f8dac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import org.apache.ibatis.annotations.Mapper; @@ -37,11 +38,14 @@ public interface UserAdviceDao extends BaseDao { void replyAdvice(@Param("adviceId") String adviceId, @Param("replyContent") String replyContent, @Param("govContent") String govContent, - @Param("replyUserId") String loginUserId); + @Param("replyUserId") String replyUserId, + @Param("replyUserName")String replyUserName); List myAdviceList(@Param("pageSize") int pageSize, @Param("pageNo") int pageNo, @Param("userId") String loginUserId); int saveUserAdvice(UserAdviceDTO dto); + + List selectListAdvice(AdviceListFormDTO dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java index b415ca67c8..01d7fa11d7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java @@ -94,4 +94,12 @@ public interface UserBaseInfoDao extends BaseDao { String selectIdCard(String userId); UserBaseInfoEntity selectUserByMobile(@Param("customerId") String customerId, @Param("mobile")String mobile); + + List pageRegUser(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("name") String name, + @Param("regStartTime") String regStartTime, + @Param("regEndTime") String regEndTime, + @Param("userId") String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ChangeWelfareEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ChangeWelfareEntity.java index 2ddb43582a..7f0ec9189d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ChangeWelfareEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ChangeWelfareEntity.java @@ -72,6 +72,14 @@ public class ChangeWelfareEntity extends BaseEpmetEntity { * 移除原因 */ private String removeReason; + /** + * 福利发放标识:1:已发放;0:未发放 + */ + private Integer grantFlag; + /** + * 福利类别 + */ + private String categoryName; /** * 客户ID diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareExcel.java index acb7705b2f..5a58288ba0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareExcel.java @@ -21,13 +21,13 @@ public class ChangeWelfareExcel { // @Excel(name = "epmet网格ID") // private String gridId; - @Excel(name = "姓名") + @Excel(name = "姓名",width = 20) private String name; - @Excel(name = "证件号") + @Excel(name = "证件号",width = 20) private String idCard; - @Excel(name = "手机号") + @Excel(name = "手机号",width = 20) private String mobile; @Excel(name = "性别",replace = { "男_1", "女_0", "女_2", " _null"} ) @@ -36,8 +36,18 @@ public class ChangeWelfareExcel { // @Excel(name = "类型") // private String type; // - @Excel(name = "加入时间") + @Excel(name = "加入时间",width = 25) private String joinDate; + /** + * 福利发放标识:1:已发放;0:未发放 + */ + @Excel(name = "福利发放",replace = { "已发放_1", "未发放_0", "_null"},width = 20) + private Integer grantFlag; + /** + * 福利类别 + */ + @Excel(name = "福利类别",width = 120) + private String categoryName; // // @Excel(name = "加入原因") // private String joinReason; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java index 992be96b4a..07869bfb2f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java @@ -33,6 +33,16 @@ public class ChangeWelfareImportExcel { // @Excel(name = "客户ID") // private String customerId; + /** + * 福利发放标识:1:已发放;0:未发放 + */ + @Excel(name = "福利发放",replace = { "已发放_1", "未发放_0", "_null"}) + private Integer grantFlag; + /** + * 福利类别 + */ + @Excel(name = "福利类别") + private String categoryName; @ExcelIgnore private Boolean addStatus = false; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index 0322d7b528..8b42599906 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -131,15 +131,19 @@ public class UserBaseInfoRedis { String gridFullName = gridInfoCache.getGridNamePath(); baseInfo.setRegisteredGridName(gridFullName); StringBuffer buffer = new StringBuffer(baseInfo.getSurname()); - switch (baseInfo.getGender()) { - case NumConstant.ONE_STR: - buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE); - break; - case NumConstant.TWO_STR: - buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_FEMALE); - break; - default: - buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); + if(StringUtils.isNotBlank(baseInfo.getGender())){ + switch (baseInfo.getGender()) { + case NumConstant.ONE_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE); + break; + case NumConstant.TWO_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_FEMALE); + break; + default: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); + } + }else{ + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); } baseInfo.setShowName(buffer.toString()); } @@ -179,7 +183,7 @@ public class UserBaseInfoRedis { } } } - + set(baseInfo); return baseInfo; } @@ -266,7 +270,7 @@ public class UserBaseInfoRedis { } } } - + set(baseInfo); return baseInfo; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index 34defc0541..379d3c8fad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -169,11 +169,10 @@ public interface BadgeService extends BaseService { * 审核 * @author zhaoqifeng * @date 2020/11/5 11:08 - * @param tokenDto * @param formDTO * @return void */ - void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO); + void audit(BadgeAuditFormDTO formDTO); void testCache(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ChangeWelfareService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ChangeWelfareService.java index 184cfd9c9a..099c7ae432 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ChangeWelfareService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ChangeWelfareService.java @@ -21,7 +21,7 @@ import java.util.Map; public interface ChangeWelfareService extends BaseService { /** - * 默认分页 + * 福利人员管理-分页查询 * * @param params * @return PageData diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index f346f2c3b1..c29d0cb69d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -53,6 +53,12 @@ public interface IcResiUserService extends BaseService { */ void delete(DelIcResiUserFormDTO formDTO); + /** + * 开发人员掉员工此接口 + * @param formDTO + */ + void deleteInternal(InternalDelIcResiUserFormDTO formDTO); + /** * @Author sun * @Description 党建互联平台--保存居民信息 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java index 609297b255..37e64b8f35 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java @@ -2,12 +2,15 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcVaccineDTO; import com.epmet.dto.form.AddIcVaccineFormDTO; import com.epmet.dto.form.IcVaccineFormDTO; import com.epmet.dto.form.VaccineListFormDTO; +import com.epmet.dto.form.VaccinePieFormDTO; import com.epmet.dto.result.IcVaccineListResultDTO; import com.epmet.dto.result.VaccineListDTO; +import com.epmet.dto.result.VaccinePieResultDTO; import com.epmet.entity.IcVaccineEntity; import java.nio.file.Path; @@ -70,4 +73,15 @@ public interface IcVaccineService extends BaseService { void del(IcVaccineFormDTO formDTO); void initVaccineLocal(); + + /** + * 辖区疫苗接种情况 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2023/2/2 15:35 + */ + List getVaccinePie(TokenDto tokenDto, VaccinePieFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java index 4aff1ed012..852192ceb0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java @@ -107,4 +107,11 @@ public interface OperUserService extends BaseService { * @param dto */ void updatePwd(String userId, PasswordDTO dto); + + /** + * 查询运营人员信息 + * @param userId + * @return + */ + OperUserDTO getOperUserDTO(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java index 0023dea98e..35f82fe153 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/PatrolRoutineWorkService.java @@ -75,4 +75,6 @@ public interface PatrolRoutineWorkService extends BaseService { /** * @Description 回复建议 * @param dto - * @param loginUserId * @return void * @Author liushaowen * @Date 2020/11/6 16:44 */ - void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId); + void replyAdvice(ReplyAdviceFormDTO dto); /** * @Description 建议详情 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index ccd55f362c..b97e4aa3a8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -25,6 +25,7 @@ import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.DingLoginResiFormDTO; +import com.epmet.dto.form.PageRegUserFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; @@ -220,4 +221,11 @@ public interface UserBaseInfoService extends BaseService { * @Date 2022/9/15 11:17 */ DingLoginResiResDTO dingResiLogin(DingLoginResiFormDTO formDTO); + + /** + * 用户完善信息列表 + * @param formDTO + * @return + */ + PageData pageRegUser(PageRegUserFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 2a3809feb3..39359b29ea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -356,32 +356,30 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 审核 * - * @param tokenDto token * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/5 11:08 */ @Override - public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { + public void audit(BadgeAuditFormDTO formDTO) { if(BadgeConstant.REJECTED.equals(formDTO.getAuditStatus())) { if (StringUtils.isEmpty(formDTO.getAuditRemark())) { throw new ValidateException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), "驳回理由不能为空"); } } UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); - BadgeDetailResultDTO detail = baseDao.selectDetail(dto.getCustomerId(), dto.getBadgeId()); dto.setAuditStatus(formDTO.getAuditStatus()); dto.setAuditRemark(formDTO.getAuditRemark()); - dto.setStaffId(tokenDto.getUserId()); + dto.setStaffId(formDTO.getCurrentUserId()); dto.setIsLast(BadgeConstant.YES); dto.setAuditTime(new Date()); userBadgeCertificateRecordService.update(dto); + BadgeDetailResultDTO detail = baseDao.selectDetail(dto.getCustomerId(), dto.getBadgeId()); List msgList = new ArrayList<>(); List wxmpMsgList = new ArrayList<>(); if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { - ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); @@ -435,12 +433,16 @@ public class BadgeServiceImpl extends BaseServiceImpl imp wxmp.setGridId(dto.getGridId()); wxmpMsgList.add(wxmp); } - messageFeignClient.saveUserMessageList(msgList); - log.info("徽章消息,开始推送微信订阅消息"); - Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); - if (!result.success()) { - log.error("徽章消息,发送微信订阅消息失败" + JSON.toJSONString(result)); - } + if(CollectionUtils.isNotEmpty(msgList)){ + messageFeignClient.saveUserMessageList(msgList); + } + if(CollectionUtils.isNotEmpty(wxmpMsgList)){ + log.info("徽章消息,开始推送微信订阅消息"); + Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); + if (!result.success()) { + log.error("徽章消息,发送微信订阅消息失败" + JSON.toJSONString(result)); + } + } } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java index c7582ec8ef..85ff254bc4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeWelfareServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.ExportParams; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -16,10 +15,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.ExcelPoiUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; @@ -38,10 +34,11 @@ import com.epmet.entity.ChangeWelfareEntity; import com.epmet.excel.ChangeWelfareImportExcel; import com.epmet.excel.error.ChangeWelfareErrorExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; -import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.OssFeignClient; import com.epmet.redis.ChangeWelfareRedis; import com.epmet.service.ChangeWelfareService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.fileupload.FileItem; @@ -88,18 +85,23 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl page(Map params) { params.put("customerId", loginUserUtil.getLoginUserCustomerId()); - IPage page = getPage(params); + // IPage page = getPage(params); + PageHelper.startPage(Integer.valueOf((String) params.get("page")), Integer.valueOf((String) params.get("limit"))); List list = baseDao.getWelfareList(params); - return new PageData<>(list, page.getTotal()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); } @Override @@ -137,6 +139,12 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl userList = icResiUserDao.getImportUserList(tokenDto.getCustomerId(),staffInfoCache.getAgencyId()); - // 获取证件号List - List idCardList = userList.stream().map(IcResiUserDTO::getIdCard).collect(Collectors.toList()); + // 获取证件号List(排除X的大小写区分) +// List idCardList = userList.stream().map(IcResiUserDTO::getIdCard).collect(Collectors.toList()); + List idCardList = new ArrayList<>(); + for(IcResiUserDTO icResiUserDTO : userList){ + idCardList.add(icResiUserDTO.getIdCard()); + if(icResiUserDTO.getIdCard() != null && icResiUserDTO.getIdCard().indexOf("X") >= 0){ + idCardList.add(icResiUserDTO.getIdCard().replace("X","x")); + }else if(icResiUserDTO.getIdCard() != null && icResiUserDTO.getIdCard().indexOf("x") >= 0){ + idCardList.add(icResiUserDTO.getIdCard().replace("x","X")); + } + } - // 获取已存在福利人员 - List welfareList = baseDao.getAllWelfareIdCard(tokenDto.getCustomerId()); + // 获取已存在福利人员(排除X的大小写区分) + List welfareList = baseDao.getAllWelfareIdCard(tokenDto.getCustomerId()); + for(String idCard : welfareList){ + idCardList.add(idCard); + if(StringUtils.isNotBlank(idCard) && idCard.indexOf("X") >= 0){ + idCardList.add(idCard.replace("X","x")); + }else if(StringUtils.isNotBlank(idCard) && idCard.indexOf("x") >= 0){ + idCardList.add(idCard.replace("x","X")); + } + } for (int i = 0; i < list.size(); i++) { list.get(i).setNum(i+1); @@ -273,7 +310,7 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl { if (!"10110".equals(idCard) && Integer.valueOf(count.toString()).compareTo(1) != 0){ for (ChangeWelfareImportExcel i : list) { - if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){ + if (idCard.equalsIgnoreCase(i.getIdCard()) && !i.getAddStatus()){ errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); i.setAddStatus(true); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index cbcbaf427f..08fde1f5f9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -119,7 +119,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) { throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); } else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) { - if ("wxmp".equals(formDTO.getClient())) { + if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) { throw new RenException(EpmetErrorCode.RESI_IC_NAT.getCode(), EpmetErrorCode.RESI_IC_NAT.getMsg()); } throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); @@ -129,10 +129,6 @@ public class IcNatServiceImpl extends BaseServiceImpl imp if (null == agencyInfo) { throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId())); } - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); - if (null == staffInfo){ - throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId())); - } ResiAndLocalResiResultDTO resiCount = icResiUserDao.getResiCount(formDTO.getAgencyId(), formDTO.getIdCard(), formDTO.getCustomerId()); //2.新增核酸基础信息数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); @@ -146,8 +142,19 @@ public class IcNatServiceImpl extends BaseServiceImpl imp IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class); relationEntity.setIcNatId(entity.getId()); relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR); - relationEntity.setAgencyId(staffInfo.getAgencyId()); - relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId()); + if(AppClientConstant.APP_GOV.equals(formDTO.getApp())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo){ + log.error(String.format("获取工作人员信息失败%s", formDTO.getStaffId())); + throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId())); + } + relationEntity.setAgencyId(staffInfo.getAgencyId()); + relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId()); + }else{ + relationEntity.setAgencyId(formDTO.getAgencyId()); + AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); + relationEntity.setPids(StringUtils.isNotBlank(agencyInfoCache.getPids()) ? agencyInfoCache.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId()); + } icNatRelationDao.insert(relationEntity); //3.新增通知表信息 @@ -457,18 +464,24 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } return list.stream().map(item -> { NatListDTO dto = new NatListDTO(); + dto.setIdNatId(item.getId()); + dto.setSampleTime(item.getSampleTime()); dto.setAddress(item.getNatAddress()); dto.setTestTime(DateUtils.format(item.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); - switch (item.getNatResult()) - { - case NumConstant.ZERO_STR: - dto.setResult("阴性"); - break; - case NumConstant.ONE_STR: - dto.setResult("阳性"); - break; - default: - dto.setResult("未知"); + if(StringUtils.isNotBlank(item.getNatResult())){ + switch (item.getNatResult()) + { + case NumConstant.ZERO_STR: + dto.setResult("阴性"); + break; + case NumConstant.ONE_STR: + dto.setResult("阳性"); + break; + default: + dto.setResult("未知"); + } + }else{ + dto.setResult("未知"); } return dto; }).collect(Collectors.toList()); 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 fb249f1184..50d5025c4e 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 @@ -80,6 +80,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; @@ -173,6 +174,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params) { @@ -203,6 +213,38 @@ public class IcResiUserServiceImpl extends BaseServiceImpl resiWrapper=new LambdaQueryWrapper<>(); + resiWrapper.eq(IcResiUserEntity::getAgencyId,formDTO.getAgencyId()); + resiWrapper.select(IcResiUserEntity::getId); + List resiIds=icResiUserDao.selectList(resiWrapper); + for(IcResiUserEntity entity:resiIds){ + baseDao.updateToDel(entity.getId(),formDTO.getCurrentStaffId()); + CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class); + Result> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO); + if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) { + for (String subTalbeName : subTableRes.getData()) { + baseDao.updateSubTableToDel(subTalbeName, entity.getId(),formDTO.getCurrentStaffId()); + } + } + //删除ic_user_transfer_record、ic_user_change_record、ic_user_change_detailed + icUserTransferRecordService.deleteByIcResiUserId(entity.getId(),formDTO.getCurrentStaffId()); + icUserChangeRecordService.deleteByIcResiUserId(entity.getId(),formDTO.getCurrentStaffId()); + icUserChangeDetailedService.deleteByIcResiUserId(entity.getId(),formDTO.getCurrentStaffId()); + } + } + } + + /** * @Author sun * @Description 党建互联平台--保存居民信息 @@ -2102,6 +2144,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl icResiUserAttachmentService.save(item)); } + // 同步疫苗接种记录信息 + IcResiUserDTO user = formDTO.getUser(); + List vaccineLog = user.getVaccineLog(); + if(vaccineLog != null && vaccineLog.size() > 0){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // 根据身份证号,客户ID删除旧记录 + icVaccineDao.deleteByIdCard(user.getIdCard(),user.getCustomerId()); + // 删除疫苗接种记录关系表数据 + List delList = icVaccineDao.setDeleteByIdCard(user.getIdCard(),user.getCustomerId()); + if(delList != null && delList.size() > 0){ + icVaccineRelationDao.deleteByIdList(delList); + } + for(VaccineLogDetailDTO vaccineLogDetailDTO : vaccineLog){ + // 插入疫苗接种记录数据 + IcVaccineEntity icVaccineEntity = new IcVaccineEntity(); + icVaccineEntity.setCustomerId(user.getCustomerId()); + icVaccineEntity.setName(user.getName()); + icVaccineEntity.setMobile(user.getMobile()); + icVaccineEntity.setIdCard(user.getIdCard()); + icVaccineEntity.setIsResiUser("1"); + icVaccineEntity.setUserType("import"); + icVaccineEntity.setUserId(resiUserId); + icVaccineEntity.setInoculateTime(sdf.parse(vaccineLogDetailDTO.getVacTime())); + icVaccineEntity.setInoculateAddress(vaccineLogDetailDTO.getVacSite()); + icVaccineDao.insert(icVaccineEntity); + // 插入疫苗接种记录关系表数据 + IcVaccineRelationEntity icVaccineRelationEntity = new IcVaccineRelationEntity(); + icVaccineRelationEntity.setCustomerId(user.getCustomerId()); + icVaccineRelationEntity.setAgencyId(formDTO.getUser().getAgencyId()); + icVaccineRelationEntity.setPids(formDTO.getUser().getPids()); + icVaccineRelationEntity.setIcVaccineId(icVaccineEntity.getId()); + icVaccineRelationEntity.setUserType("prarmeter"); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo) { + logger.warn("未查询到工作人员信息" + resiUserId); + } + if(staffInfo.getAgencyId().equals(formDTO.getUser().getAgencyId())){ + icVaccineRelationEntity.setIsLocalResiUser("1"); + }else{ + icVaccineRelationEntity.setIsLocalResiUser("0"); + } + icVaccineRelationDao.insert(icVaccineRelationEntity); + + } + + } + + // 同步合同信息 + IcResiRentContractInfoEntity rentEntityOne = icResiRentContractInfoDao.selectDetailByUserId(resiUserId); + if(rentEntityOne == null){ + IcResiRentContractInfoEntity rentEntity = new IcResiRentContractInfoEntity(); + rentEntity.setIcResiUser(resiUserId); + rentEntity.setCustomerId(formDTO.getCustomerId()); + rentEntity.setContractStartDate(formDTO.getStartDate()); + rentEntity.setContractEndDate(formDTO.getEndDate()); + icResiRentContractInfoDao.insert(rentEntity); + }else{ + rentEntityOne.setCustomerId(formDTO.getCustomerId()); + rentEntityOne.setContractStartDate(formDTO.getStartDate()); + rentEntityOne.setContractEndDate(formDTO.getEndDate()); + icResiRentContractInfoDao.updateById(rentEntityOne); + } + + return resiUserId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java index 0d6b3418bd..0e9c1faaf8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.commons.tools.page.PageData; 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcNatDao; @@ -53,9 +54,12 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile; import java.io.IOException; import java.io.OutputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; /** @@ -601,6 +605,72 @@ public class IcVaccineServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2023/2/2 15:35 + */ + @Override + public List getVaccinePie(TokenDto tokenDto, VaccinePieFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + if(org.apache.commons.lang3.StringUtils.isBlank(formDTO.getAgencyId())){ + //没有指定查询某个组织时,默认查询当前用户所属组织及下级 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null != staffInfo) { + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + } + List list = baseDao.getVaccinePieData(formDTO); + int total = 0; + if (CollectionUtils.isNotEmpty(list)) { + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); + AtomicBoolean flag = new AtomicBoolean(false); + int finalTotal = total; + list.forEach(item -> { + if (NumConstant.ZERO_STR.equals(item.getCode())) { + item.setLabel("未接种人数"); + item.setRemark("未接种"+ item.getValue() +"人"); + flag.set(true); + } else { + item.setLabel("接种" + item.getCode() + "针人数"); + item.setRemark("接种" + item.getCode() + "针" + item.getValue() + "人"); + } + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(item.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + item.setRatio(radio.stripTrailingZeros().toPlainString().concat("%")); + }); + if (!flag.get()) { + VaccinePieResultDTO dto = new VaccinePieResultDTO(); + dto.setLabel("未接种人数"); + dto.setCode(NumConstant.ZERO_STR); + dto.setValue(NumConstant.ZERO_STR); + dto.setRatio("0%"); + dto.setRemark("未接种0人"); + list.add(dto); + } + } else { + VaccinePieResultDTO dto = new VaccinePieResultDTO(); + dto.setLabel("未接种人数"); + dto.setCode(NumConstant.ZERO_STR); + dto.setValue(NumConstant.ZERO_STR); + dto.setRatio("0%"); + dto.setRemark("未接种0人"); + list.add(dto); + } + return list; + } + @Transactional(rollbackFor = Exception.class) public void updateRelation(List list,String type){ if (NumConstant.ONE_STR.equals(type)){ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java index 9f5df02195..de655b5c3c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java @@ -196,20 +196,23 @@ public class MyHomeServiceImpl implements MyHomeService { */ @Override public HomeInfoResultDTO getHomeInfo(TokenDto tokenDto) { - HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); //通过用户ID获取居民端用户信息 ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); - if (null == baseInfo) { - return resultDto; + if (null == baseInfo||StringUtils.isBlank(baseInfo.getIdNum())) { + log.warn(String.format("user_base_info.id_num is null userId:%s",tokenDto.getUserId())); + return null; } //通过居民身份证号获取居民信息 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum()); + wrapper.select(IcResiUserEntity::getId,IcResiUserEntity::getHomeId,IcResiUserEntity::getIdCard); IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper); - if (null == icUser) { - return resultDto; + if (null == icUser||StringUtils.isBlank(icUser.getHomeId())) { + log.warn(String.format("ic_resi_user is null id_card:%s",baseInfo.getIdNum())); + return null; } + HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); resultDto.setIcResiUserId(icUser.getId()); //通过房屋ID获取房屋信息 HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId()); @@ -221,17 +224,12 @@ public class MyHomeServiceImpl implements MyHomeService { resultDto.setHouseCode(houseInfo.getHouseCode()); resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl()); resultDto.setCoding(houseInfo.getCoding()); - //获取房屋房主信息,判断是否是房主 - Result icHouseResult = govOrgOpenFeignClient.get(icUser.getHomeId()); - if (!icHouseResult.success() || null == icHouseResult.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); - } - if (icUser.getIdCard().equals(icHouseResult.getData().getOwnerIdCard())) { + if (icUser.getIdCard().equals(houseInfo.getOwnerIdCard())) { resultDto.setIsOwner(NumConstant.ONE_STR); } else { resultDto.setIsOwner(NumConstant.ZERO_STR); } - resultDto.setOwnerIdCard(icHouseResult.getData().getOwnerIdCard()); + resultDto.setOwnerIdCard(houseInfo.getOwnerIdCard()); return resultDto; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java index d44fe607eb..4758d01cd1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java @@ -196,4 +196,20 @@ public class OperUserServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OperUserEntity::getUserId, userId); + OperUserEntity entity = baseDao.selectOne(queryWrapper); + if (null != entity) { + return ConvertUtils.sourceToTarget(entity, OperUserDTO.class); + } + return null; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java index 8a0d48152e..ab3f35cbc7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java @@ -446,4 +446,38 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl> unitTypeMap = adminOpenFeignClient.dictMap(DictTypeEnum.PATROL_WORK_TYPE.getCode()); + if (!unitTypeMap.success() || MapUtils.isEmpty(unitTypeMap.getData())) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取例行工作类型字典表数据失败!"); + } + //5.封装数据并返回 + resultDTO.setGridName(gridInfo.getAgencyName() + "-" + gridInfo.getGridName()); + resultDTO.setStaffName(staffInfo.getRealName()); + resultDTO.setWorkTypeName(unitTypeMap.getData().get(resultDTO.getAllPCode()) + "-" + unitTypeMap.getData().get(resultDTO.getWorkTypeCode())); + return resultDTO; + + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index a6480dca76..b3ac688a0f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -20,13 +20,15 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.metadata.OrderItem; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -35,10 +37,12 @@ import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.UserAdviceConstant; import com.epmet.dao.UserAdviceDao; import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.OperUserDTO; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.AdviceDetailResultDTO; @@ -52,6 +56,8 @@ import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceService; import com.epmet.service.UserResiInfoService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import io.jsonwebtoken.lang.Collections; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -148,25 +154,31 @@ public class UserAdviceServiceImpl extends BaseServiceImpl govImgList = dto.getGovImgList(); if (!Collections.isEmpty(govImgList)) { @@ -179,7 +191,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl govImgList = new ArrayList<>(); List resiImgList = new ArrayList<>(); for (UserAdviceImgEntity entity : imgsByAdviceId) { - if ("resi".equals(entity.getType())) { + if (AppClientConstant.APP_RESI.equals(entity.getType())) { resiImgList.add(entity.getImgUrl()); - } else if ("oper".equals(entity.getType())) { + } else if (AppClientConstant.APP_OPER.equals(entity.getType())||AppClientConstant.APP_GOV.equals(entity.getType())) { govImgList.add(entity.getImgUrl()); } } @@ -242,7 +254,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl adviceList(AdviceListFormDTO dto) { - //page分页 + /*//page分页 Page page = new Page<>(dto.getPageNo(), dto.getPageSize()); //时间降序 page.addOrder(OrderItem.desc(FieldConstant.CREATED_TIME)); @@ -300,7 +312,30 @@ public class UserAdviceServiceImpl extends BaseServiceImpl list = baseDao.selectListAdvice(dto); + List records=ConvertUtils.sourceToTarget(list,AdviceListResultDTO.class); + //拼接type + + for (int i = 0; i < records.size(); i++) { + if (!"*".equals(records.get(i).getAdviceType())) { + StringBuilder type = new StringBuilder(); + if (records.get(i).getAdviceType().contains("gov")) { + type.append(UserAdviceConstant.GOV_TYPE_TEXT); + } + if (records.get(i).getAdviceType().contains("software")) { + if (type.length() != 0) { + type.append("\n"); + } + type.append(UserAdviceConstant.SOFTWARE_TYPE_TEXT); + } + records.get(i).setAdviceType(type.toString()); + } + } + PageInfo pageInfo = new PageInfo<>(records); + return new PageData<>(records, pageInfo.getTotal()); } /** @@ -387,7 +422,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl userAuthBadgeList = userBadgeDao.selectAuthRecord(userOperListFormDTO.getUserId()); Object userBadge = userBadgeRedis.getCustomerBadge(userOperListFormDTO.getCustomerId()); if (null == userBadge){ - return new ArrayList<>(); + this.reloadCustomerBadge(userOperListFormDTO.getCustomerId()); + userBadge = userBadgeRedis.getCustomerBadge(userOperListFormDTO.getCustomerId()); } List userOperListResultDTOS = JSON.parseArray(userBadge.toString(), UserOperListResultDTO.class); + if(CollectionUtils.isEmpty(userOperListResultDTOS)){ + return new ArrayList<>(); + } // 没有任何记录 if (CollectionUtils.isEmpty(userAuthBadgeList)){ userOperListResultDTOS.forEach(u -> { @@ -255,7 +264,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { // 校验这个徽章此人有没有 Integer recordCount = userBadgeCertificateRecordDao.selectIsExist(certificationAddFormDTO.getBadgeId(), certificationAddFormDTO.getUserId()); if (recordCount>NumConstant.ZERO){ - throw new RenException("不允许重复提交审核"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"不允许重复提交审核","已存在认证记录,不允许重复提交审核"); } log.info(JSON.toJSONString(certificationAddFormDTO)); AuthFieldFormDTO authFieldFormDTO = new AuthFieldFormDTO(); @@ -273,8 +282,11 @@ public class UserBadgeServiceImpl implements UserBadgeService { List userIds = new ArrayList<>(); userIds.add(certificationAddFormDTO.getUserId()); List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(userIds); - if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) { - throw new RenException("查询用户基本信息集合为空......"); + if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)||null==userBaseInfoResultDTOS.get(NumConstant.ZERO)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("查询用户基本信息集合为空,userId:%s",certificationAddFormDTO.getUserId()),"查询用户基本信息异常"); + } + if(StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"异常信息:注册网格为空","服务器开小差了...注册网格为空"); } userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId()); form.setGridId(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId()); @@ -282,17 +294,57 @@ public class UserBadgeServiceImpl implements UserBadgeService { form.setCertificationImg(certificationAddFormDTO.getCertificationImg()); form.setSurname(certificationAddFormDTO.getSurname()); log.info(JSON.toJSONString(form)); + String recordId=IdWorker.getIdStr(); + form.setId(recordId); userBadgeDao.insertUserBadgeCertificateRecord(form); - //TODO 站内信发送 - String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); - String s = StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict()) ? userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName() : userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()); - String msg = String.format(BadgeConstant.MESSAGE_CONTENT, s, badgeName); - // 记录待审核id,和消息类型 - sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), - UserMessageTypeConstant.BADGE_AUTH_APPLY, - form.getId()); + if(certificationAddFormDTO.getSendMsgFlag()){ + //TODO 站内信发送 + String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); + String s = StringUtils.isBlank(userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict()) ? userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName() : userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()); + String msg = String.format(BadgeConstant.MESSAGE_CONTENT, s, badgeName); + // 记录待审核id,和消息类型 + sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), + UserMessageTypeConstant.BADGE_AUTH_APPLY, + form.getId()); + } + //烟台:徽章认证自动审核通过 + if(certificationAddFormDTO.getAutoPassFlag()){ + BadgeAuditFormDTO badgeAuditFormDTO=new BadgeAuditFormDTO(); + badgeAuditFormDTO.setRecordId(recordId); + //审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 + badgeAuditFormDTO.setAuditStatus(BadgeConstant.APPROVED); + badgeAuditFormDTO.setCurrentUserId("APP_USER"); + autoPassBadge(badgeAuditFormDTO); + } + Map resultMap=new HashMap(); + resultMap.put("recordId",recordId); + return new Result().ok(resultMap); + } + + /** + * 烟台:徽章认证,自动审核通过 + * @param badgeAuditFormDTO + */ + private void autoPassBadge(BadgeAuditFormDTO badgeAuditFormDTO) { + UserBadgeCertificateRecordDTO dto = SpringContextUtils.getBean(UserBadgeCertificateRecordService.class).get(badgeAuditFormDTO.getRecordId()); + dto.setAuditStatus(badgeAuditFormDTO.getAuditStatus()); + dto.setAuditRemark(badgeAuditFormDTO.getAuditRemark()); + dto.setStaffId(badgeAuditFormDTO.getCurrentUserId()); + dto.setIsLast(BadgeConstant.YES); + dto.setAuditTime(new Date()); + SpringContextUtils.getBean(UserBadgeCertificateRecordService.class).update(dto); + + ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); + resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); + resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); + resiUserBadgeDTO.setGridId(dto.getGridId()); + resiUserBadgeDTO.setUserId(dto.getUserId()); + resiUserBadgeDTO.setIsOpened(NumConstant.ONE); + resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); + SpringContextUtils.getBean(ResiUserBadgeService.class).save(resiUserBadgeDTO); + //更新Redis + userBadgeRedis.pushOrRemoveUserBadge4List(dto.getUserId(),dto.getBadgeId(),dto.getCustomerId()); - return new Result(); } private void validateParams(CertificationAddFormDTO certificationAddFormDTO, AuthFieldFormDTO authFieldFormDTO) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index a328399810..3e6203d2c6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -34,6 +34,7 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.NameUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; @@ -41,10 +42,7 @@ import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserWechatDTO; -import com.epmet.dto.form.CommonUserIdFormDTO; -import com.epmet.dto.form.DingLoginResiFormDTO; -import com.epmet.dto.form.UserRoleFormDTO; -import com.epmet.dto.form.VolunteerRegResiFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.RegisterRelationEntity; import com.epmet.entity.UserBaseInfoEntity; @@ -58,6 +56,8 @@ import com.epmet.service.RegisterRelationService; import com.epmet.service.UserBaseInfoService; import com.epmet.service.UserResiInfoService; import com.epmet.util.ModuleConstant; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -569,17 +569,28 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl pageRegUser(PageRegUserFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.pageRegUser(EpmetRequestHolder.getLoginUserCustomerId(), + formDTO.getAgencyId(), + formDTO.getGridId(), + formDTO.getName(), + formDTO.getRegStartTime(), + formDTO.getRegEndTime(), + formDTO.getUserId()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 3efd7e01fa..6101e9c2d5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -186,6 +186,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl优化开源项目:https://gitee.com/yu120/sequence

- * - * @author hubin - * @since 2016-08-18 - */ -@Slf4j -public class MySequence { - - private static final Log logger = LogFactory.getLog(MySequence.class); - /** - * 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动) - */ - private final long twepoch = 1288834974657L; - /** - * 机器标识位数 - */ - private final long workerIdBits = 5L; - private final long datacenterIdBits = 5L; - private final long maxWorkerId = -1L ^ (-1L << workerIdBits); - private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); - /** - * 毫秒内自增位 - */ - private final long sequenceBits = 12L; - private final long workerIdShift = sequenceBits; - private final long datacenterIdShift = sequenceBits + workerIdBits; - /** - * 时间戳左移动位 - */ - private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; - private final long sequenceMask = -1L ^ (-1L << sequenceBits); - - private final long workerId; - - /** - * 数据标识 ID 部分 - */ - private final long datacenterId; - /** - * 并发控制 - */ - private long sequence = 0L; - /** - * 上次生产 ID 时间戳 - */ - private long lastTimestamp = -1L; - - public MySequence() { - this.datacenterId = getDatacenterId(maxDatacenterId); - this.workerId = getMaxWorkerId(datacenterId, maxWorkerId); - String msg = "MySequence datacenterId:" + this.datacenterId + ";workerId:" + this.workerId; - log.info(msg); - HttpClientManager.getInstance().sendAlarmMsg(msg); - } - - /** - * 有参构造器 - * - * @param workerId 工作机器 ID - * @param datacenterId 序列号 - */ - public MySequence(long workerId, long datacenterId) { - Assert.isFalse(workerId > maxWorkerId || workerId < 0, - String.format("MySequence worker Id can't be greater than %d or less than 0", maxWorkerId)); - Assert.isFalse(datacenterId > maxDatacenterId || datacenterId < 0, - String.format("MySequence datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); - this.workerId = workerId; - this.datacenterId = datacenterId; - } - - /** - * 获取 maxWorkerId - */ - protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) { - StringBuilder mpid = new StringBuilder(); - mpid.append(datacenterId); - String name = ManagementFactory.getRuntimeMXBean().getName(); - String msg = "MySequence getMaxWorkerId name:" + name; - log.info(msg); - HttpClientManager.getInstance().sendAlarmMsg(msg); - if (StringUtils.isNotBlank(name)) { - /* - * GET jvmPid - */ - mpid.append(name.split(StringPool.AT)[0]); - } - /* - * MAC + PID 的 hashcode 获取16个低位 - */ - return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1); - } - - /** - * 数据标识id部分 - */ - protected static long getDatacenterId(long maxDatacenterId) { - long id = 0L; - try { - InetAddress ip = InetAddress.getLocalHost(); - NetworkInterface network = NetworkInterface.getByInetAddress(ip); - String msg = "MySequence ip:" + JSON.toJSONString(ip) + ";network: " + JSON.toJSONString(network); - log.info(msg); - HttpClientManager.getInstance().sendAlarmMsg(msg); - if (network == null) { - id = 1L; - log.info("MySequen cenetwork ==null "); - } else { - byte[] mac = network.getHardwareAddress(); - if (null != mac) { - id = ((0x000000FF & (long) mac[mac.length - 2]) | (0x0000FF00 & (((long) mac[mac.length - 1]) << 8))) >> 6; - id = id % (maxDatacenterId + 1); - } - } - } catch (Exception e) { - logger.warn(" getDatacenterId: " + e.getMessage()); - } - return id; - } - - /** - * 获取下一个 ID - * - * @return 下一个 ID - */ - public synchronized long nextId() { - long timestamp = timeGen(); - //闰秒 - if (timestamp < lastTimestamp) { - long offset = lastTimestamp - timestamp; - if (offset <= 5) { - try { - wait(offset << 1); - timestamp = timeGen(); - if (timestamp < lastTimestamp) { - throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset)); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } else { - throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset)); - } - } - - if (lastTimestamp == timestamp) { - // 相同毫秒内,序列号自增 - sequence = (sequence + 1) & sequenceMask; - if (sequence == 0) { - // 同一毫秒的序列数已经达到最大 - timestamp = tilNextMillis(lastTimestamp); - } - } else { - // 不同毫秒内,序列号置为 1 - 3 随机数 - sequence = ThreadLocalRandom.current().nextLong(1, 3); - } - - lastTimestamp = timestamp; - - // 时间戳部分 | 数据中心部分 | 机器标识部分 | 序列号部分 - return ((timestamp - twepoch) << timestampLeftShift) - | (datacenterId << datacenterIdShift) - | (workerId << workerIdShift) - | sequence; - } - - protected long tilNextMillis(long lastTimestamp) { - long timestamp = timeGen(); - while (timestamp <= lastTimestamp) { - timestamp = timeGen(); - } - return timestamp; - } - - protected long timeGen() { - return SystemClock.now(); - } - -} - diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.94__pli_change_welfare.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.94__pli_change_welfare.sql new file mode 100644 index 0000000000..65f58d0090 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.94__pli_change_welfare.sql @@ -0,0 +1,4 @@ +ALTER TABLE pli_change_welfare ADD COLUMN GRANT_FLAG TINYINT ( 1 ) DEFAULT 0 + COMMENT '福利发放标识:1:已发放;0:未发放' AFTER REMOVE_REASON; +ALTER TABLE pli_change_welfare ADD COLUMN CATEGORY_NAME VARCHAR(255) DEFAULT '' + COMMENT '福利类别' AFTER GRANT_FLAG; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx index 8999a52839..9047ad60b9 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx and b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/pli_change_welfare.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/pli_change_welfare.xlsx index a9aa1b3e6a..d1102da4b1 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/pli_change_welfare.xlsx and b/epmet-user/epmet-user-server/src/main/resources/excel/pli_change_welfare.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml index 518f868cac..9c4a45bc10 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeWelfareDao.xml @@ -40,10 +40,12 @@ w.REMOVE_DATE, w.REMOVE_REASON, w.CREATED_TIME, - w.UPDATED_TIME + w.UPDATED_TIME, + w.GRANT_FLAG, + w.CATEGORY_NAME FROM pli_change_welfare w - LEFT JOIN ic_resi_user u ON u.ID_CARD = w.ID_CARD + LEFT JOIN ic_resi_user u ON u.ID_CARD = w.ID_CARD and u.DEL_FLAG = '0' WHERE w.DEL_FLAG = '0' @@ -54,13 +56,13 @@ AND w.GRID_ID = #{gridId} - AND w.NAME = #{name} + AND w.NAME like concat('%', #{name},'%') - AND w.ID_CARD = #{idCard} + AND w.ID_CARD like concat('%', #{idCard},'%') - AND w.MOBILE = #{mobile} + AND w.MOBILE like concat('%', #{mobile},'%') AND w.JOIN_DATE >= #{startTime} @@ -68,6 +70,12 @@ AND w.JOIN_DATE <= #{endTime} + + AND w.CATEGORY_NAME like concat('%',#{categoryName},'%') + + + AND w.GRANT_FLAG = #{grantFlag} + order by w.CREATED_TIME desc @@ -76,12 +84,14 @@ where ID_CARD=#{idCard} and del_flag='0' - + update pli_change_welfare set REMOVE_DATE=#{removeDate}, REMOVE_REASON=#{removeReason}, - del_flag='1' + del_flag='1', + UPDATED_BY = #{updatedBy}, + UPDATED_TIME = #{removeDate} where del_flag='0' AND ID = #{id} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiRentContractInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiRentContractInfoDao.xml index 25a47a8573..a97b6554a9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiRentContractInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiRentContractInfoDao.xml @@ -16,6 +16,12 @@ + + + + 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 ab9c03c402..47bb9cd511 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 @@ -216,7 +216,7 @@ ORDER BY - field( IC_RESI_USER.GRID_ID, '1537272060187049986', '1537272342477508609', '1537275342477501111', '1593432493598076929' ), + field( IC_RESI_USER.GRID_ID, '1537272060187049986', '1537272342477508609', '1537275342477501111', '1593432493598076929','1595582620679204865' ), IC_RESI_USER.VILLAGE_ID ASC, IC_RESI_USER.BUILD_ID ASC, IC_RESI_USER.UNIT_ID ASC, @@ -418,6 +418,8 @@ + + SELECT - ID_CARD, - INOCULATE_TIME + ID_CARD cardno, + INOCULATE_TIME inoculateDate FROM ic_vaccine WHERE DEL_FLAG = '0' and ID_CARD IN @@ -244,4 +244,51 @@ + + update ic_vaccine set DEL_FLAG = '1' where CUSTOMER_ID = #{customerId} and ID_CARD = #{idCard} + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml index acaf54c95f..205b04677a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml @@ -17,5 +17,13 @@ set CUSTOMER_ID = #{customerId},USER_TYPE = #{userType} where IC_VACCINE_ID = #{icVaccineId} + + update ic_vaccine_relation set DEL_FLAG = '1' where ID in + + #{id} + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml index 5d155dbe82..093ea9f131 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/PatrolRoutineWorkDao.xml @@ -26,15 +26,24 @@ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index 53433e05ec..ab6d729adf 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -39,7 +39,7 @@ reply_user_id = #{replyUserId}, reply_time = now(), gov_content = #{govContent}, - reply_user_name = (select real_name from oper_user where user_id = #{replyUserId} and del_flag = 0), + reply_user_name = #{replyUserName}, updated_by = #{replyUserId}, updated_time = now() where id = #{adviceId} and del_flag = 0 @@ -116,4 +116,40 @@ 0,0,#{userId},#{adviceTime},#{userId},#{adviceTime} ) + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index c42a648c62..95b77d51a7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -171,9 +171,6 @@ - - select replace(uuid(),'-','') AS ID - INSERT INTO user_badge_certificate_record ( ID, CUSTOMER_ID, diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index c8f4d403a1..7cdcdc0913 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -83,7 +83,8 @@ DISTRICT district, BUILDING_ADDRESS buildingAddress, NICKNAME nickname, - HEAD_IMG_URL headImgUrl + HEAD_IMG_URL headImgUrl, + CREATED_TIME as regTime FROM user_base_info WHERE DEL_FLAG = '0' AND USER_ID = #{userId} @@ -167,4 +168,50 @@ AND ubi.DEL_FLAG = '0' order by ubi.CREATED_TIME desc limit 1 + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index 9bca7b1bf5..13ad6f26e6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -29,29 +29,29 @@